phaseSystem.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "phaseSystem.H"
27 #include "surfaceTensionModel.H"
28 #include "aspectRatioModel.H"
29 #include "surfaceInterpolate.H"
30 #include "fvcDdt.H"
31 #include "localEulerDdtScheme.H"
32 #include "fvcDiv.H"
33 #include "fvcGrad.H"
34 #include "fvcSnGrad.H"
35 #include "alphaContactAngleFvPatchScalarField.H"
36 #include "unitConversion.H"
37 #include "dragModel.H"
39 
40 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44  defineTypeNameAndDebug(phaseSystem, 0);
45  defineRunTimeSelectionTable(phaseSystem, dictionary);
46 }
47 
48 const Foam::word Foam::phaseSystem::propertiesName("phaseProperties");
49 
50 
51 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
52 
54 (
55  const phaseModelList& phaseModels
56 ) const
57 {
58  tmp<surfaceScalarField> tmpPhi
59  (
61  (
62  "phi",
63  fvc::interpolate(phaseModels[0])*phaseModels[0].phi()
64  )
65  );
66 
67  for (label phasei=1; phasei<phaseModels.size(); phasei++)
68  {
69  tmpPhi.ref() +=
70  fvc::interpolate(phaseModels[phasei])*phaseModels[phasei].phi();
71  }
72 
73  return tmpPhi;
74 }
75 
76 
78 (
79  const dictTable& modelDicts
80 )
81 {
82  forAllConstIter(dictTable, modelDicts, iter)
83  {
84  const phasePairKey& key = iter.key();
85 
86  // pair already exists
87  if (phasePairs_.found(key))
88  {}
89 
90  // new ordered pair
91  else if (key.ordered())
92  {
93  phasePairs_.insert
94  (
95  key,
96  autoPtr<phasePair>
97  (
98  new orderedPhasePair
99  (
100  phaseModels_[key.first()],
101  phaseModels_[key.second()]
102  )
103  )
104  );
105  }
106 
107  // new unordered pair
108  else
109  {
110  phasePairs_.insert
111  (
112  key,
113  autoPtr<phasePair>
114  (
115  new phasePair
116  (
117  phaseModels_[key.first()],
118  phaseModels_[key.second()]
119  )
120  )
121  );
122  }
123  }
124 }
125 
126 
128 {
129  tmp<volScalarField> sumAlphaMoving
130  (
132  (
133  "sumAlphaMoving",
134  movingPhaseModels_[0],
135  calculatedFvPatchScalarField::typeName
136  )
137  );
138 
139  for
140  (
141  label movingPhasei=1;
142  movingPhasei<movingPhaseModels_.size();
143  movingPhasei++
144  )
145  {
146  sumAlphaMoving.ref() += movingPhaseModels_[movingPhasei];
147  }
148 
149  return sumAlphaMoving;
150 }
151 
152 
154 {
155  // Calculate the mean velocity difference with respect to Um0
156  // from the current velocity of the moving phases
157  volVectorField dUm(Um0);
158 
159  forAll(movingPhaseModels_, movingPhasei)
160  {
161  dUm -=
162  movingPhaseModels_[movingPhasei]
163  *movingPhaseModels_[movingPhasei].U();
164  }
165 
166  forAll(movingPhaseModels_, movingPhasei)
167  {
168  movingPhaseModels_[movingPhasei].URef() += dUm;
169  }
170 }
171 
172 
174 (
175  const PtrList<surfaceScalarField>& alphafs,
176  const surfaceScalarField& phim0
177 )
178 {
179  // Calculate the mean flux difference with respect to phim0
180  // from the current flux of the moving phases
181  surfaceScalarField dphim(phim0);
182 
183  forAll(movingPhaseModels_, movingPhasei)
184  {
185  dphim -=
186  alphafs[movingPhaseModels_[movingPhasei].index()]
187  *movingPhaseModels_[movingPhasei].phi();
188  }
189 
190  forAll(movingPhaseModels_, movingPhasei)
191  {
192  movingPhaseModels_[movingPhasei].phiRef() += dphim;
193  }
194 }
195 
196 
198 (
199  const volScalarField& alpha1,
200  const volScalarField& alpha2
201 ) const
202 {
203  /*
204  // Cell gradient of alpha
205  volVectorField gradAlpha =
206  alpha2*fvc::grad(alpha1) - alpha1*fvc::grad(alpha2);
207 
208  // Interpolated face-gradient of alpha
209  surfaceVectorField gradAlphaf = fvc::interpolate(gradAlpha);
210  */
211 
212  surfaceVectorField gradAlphaf
213  (
215  - fvc::interpolate(alpha1)*fvc::interpolate(fvc::grad(alpha2))
216  );
217 
218  // Face unit interface normal
219  return gradAlphaf/(mag(gradAlphaf) + deltaN_);
220 }
221 
222 
224 (
225  const volScalarField& alpha1,
226  const volScalarField& alpha2
227 ) const
228 {
229  // Face unit interface normal flux
230  return nHatfv(alpha1, alpha2) & mesh_.Sf();
231 }
232 
233 
235 (
236  const phaseModel& phase1,
237  const phaseModel& phase2,
238  surfaceVectorField::Boundary& nHatb
239 ) const
240 {
241  const volScalarField::Boundary& gbf
242  = phase1.boundaryField();
243 
244  const fvBoundaryMesh& boundary = mesh_.boundary();
245 
246  forAll(boundary, patchi)
247  {
248  if (isA<alphaContactAngleFvPatchScalarField>(gbf[patchi]))
249  {
250  const alphaContactAngleFvPatchScalarField& acap =
251  refCast<const alphaContactAngleFvPatchScalarField>(gbf[patchi]);
252 
253  vectorField& nHatPatch = nHatb[patchi];
254 
255  vectorField AfHatPatch
256  (
257  mesh_.Sf().boundaryField()[patchi]
258  /mesh_.magSf().boundaryField()[patchi]
259  );
260 
261  alphaContactAngleFvPatchScalarField::thetaPropsTable::
262  const_iterator tp =
263  acap.thetaProps()
264  .find(phasePairKey(phase1.name(), phase2.name()));
265 
266  if (tp == acap.thetaProps().end())
267  {
269  << "Cannot find interface "
270  << phasePairKey(phase1.name(), phase2.name())
271  << "\n in table of theta properties for patch "
272  << acap.patch().name()
273  << exit(FatalError);
274  }
275 
276  bool matched = (tp.key().first() == phase1.name());
277 
278  scalar theta0 = degToRad(tp().theta0(matched));
279  scalarField theta(boundary[patchi].size(), theta0);
280 
281  scalar uTheta = tp().uTheta();
282 
283  // Calculate the dynamic contact angle if required
284  if (uTheta > small)
285  {
286  scalar thetaA = degToRad(tp().thetaA(matched));
287  scalar thetaR = degToRad(tp().thetaR(matched));
288 
289  // Calculated the component of the velocity parallel to the wall
290  vectorField Uwall
291  (
292  phase1.U()().boundaryField()[patchi].patchInternalField()
293  - phase1.U()().boundaryField()[patchi]
294  );
295  Uwall -= (AfHatPatch & Uwall)*AfHatPatch;
296 
297  // Find the direction of the interface parallel to the wall
298  vectorField nWall
299  (
300  nHatPatch - (AfHatPatch & nHatPatch)*AfHatPatch
301  );
302 
303  // Normalise nWall
304  nWall /= (mag(nWall) + small);
305 
306  // Calculate Uwall resolved normal to the interface parallel to
307  // the interface
308  scalarField uwall(nWall & Uwall);
309 
310  theta += (thetaA - thetaR)*tanh(uwall/uTheta);
311  }
312 
313 
314  // Reset nHatPatch to correspond to the contact angle
315 
316  scalarField a12(nHatPatch & AfHatPatch);
317 
318  scalarField b1(cos(theta));
319 
320  scalarField b2(nHatPatch.size());
321 
322  forAll(b2, facei)
323  {
324  b2[facei] = cos(acos(a12[facei]) - theta[facei]);
325  }
326 
327  scalarField det(1 - a12*a12);
328 
329  scalarField a((b1 - a12*b2)/det);
330  scalarField b((b2 - a12*b1)/det);
331 
332  nHatPatch = a*AfHatPatch + b*nHatPatch;
333 
334  nHatPatch /= (mag(nHatPatch) + deltaN_.value());
335  }
336  }
337 }
338 
339 
341 (
342  const phaseModel& phase1,
343  const phaseModel& phase2
344 ) const
345 {
346  tmp<surfaceVectorField> tnHatfv = nHatfv(phase1, phase2);
347 
348  correctContactAngle(phase1, phase2, tnHatfv.ref().boundaryFieldRef());
349 
350  // Simple expression for curvature
351  return -fvc::div(tnHatfv & mesh_.Sf());
352 }
353 
354 
355 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
356 
358 (
359  const fvMesh& mesh
360 )
361 :
362  IOdictionary
363  (
364  IOobject
365  (
366  "phaseProperties",
367  mesh.time().constant(),
368  mesh,
369  IOobject::MUST_READ_IF_MODIFIED,
370  IOobject::NO_WRITE
371  )
372  ),
373 
374  mesh_(mesh),
375 
376  referencePhaseName_
377  (
378  // Temporary hack for backward compatibility with
379  // reactingTwoPhaseEulerFoam
380  lookup<word>("type").find("TwoPhase") != string::npos
381  ? lookup<wordList>("phases")[1]
382  : lookupOrDefault("referencePhase", word::null)
383  ),
384 
385  phaseModels_
386  (
387  lookup("phases"),
388  phaseModel::iNew(*this, referencePhaseName_)
389  ),
390 
391  phi_(calcPhi(phaseModels_)),
392 
393  dpdt_
394  (
395  IOobject
396  (
397  "dpdt",
398  mesh.time().timeName(),
399  mesh
400  ),
401  mesh,
403  ),
404 
405  MRF_(mesh_),
406 
407  cAlphas_(lookupOrDefault("interfaceCompression", cAlphaTable())),
408 
409  deltaN_
410  (
411  "deltaN",
412  1e-8/pow(average(mesh_.V()), 1.0/3.0)
413  )
414 {
415  // Groupings
416  label movingPhasei = 0;
417  label stationaryPhasei = 0;
418  label anisothermalPhasei = 0;
419  label multiComponentPhasei = 0;
420  forAll(phaseModels_, phasei)
421  {
422  phaseModel& phase = phaseModels_[phasei];
423  movingPhasei += !phase.stationary();
424  stationaryPhasei += phase.stationary();
425  anisothermalPhasei += !phase.isothermal();
426  multiComponentPhasei += !phase.pure();
427  }
428  movingPhaseModels_.resize(movingPhasei);
429  stationaryPhaseModels_.resize(stationaryPhasei);
430  anisothermalPhaseModels_.resize(anisothermalPhasei);
431  multiComponentPhaseModels_.resize(multiComponentPhasei);
432 
433  movingPhasei = 0;
434  stationaryPhasei = 0;
435  anisothermalPhasei = 0;
436  multiComponentPhasei = 0;
437  forAll(phaseModels_, phasei)
438  {
439  phaseModel& phase = phaseModels_[phasei];
440  if (!phase.stationary())
441  {
442  movingPhaseModels_.set(movingPhasei++, &phase);
443  }
444  if (phase.stationary())
445  {
446  stationaryPhaseModels_.set(stationaryPhasei++, &phase);
447  }
448  if (!phase.isothermal())
449  {
450  anisothermalPhaseModels_.set(anisothermalPhasei++, &phase);
451  }
452  if (!phase.pure())
453  {
454  multiComponentPhaseModels_.set(multiComponentPhasei++, &phase);
455  }
456  }
457 
458  // Write phi
459  phi_.writeOpt() = IOobject::AUTO_WRITE;
460 
461  // Blending methods
462  forAllConstIter(dictionary, subDict("blending"), iter)
463  {
464  blendingMethods_.insert
465  (
466  iter().keyword(),
468  (
469  iter().keyword(),
470  iter().dict(),
471  phaseModels_.toc()
472  )
473  );
474  }
475 
476  // Sub-models
477  generatePairsAndSubModels("surfaceTension", surfaceTensionModels_);
478  generatePairsAndSubModels("aspectRatio", aspectRatioModels_);
479 
480  // Update motion fields
481  correctKinematics();
482 
483  // Set the optional reference phase fraction from the other phases
484  if (referencePhaseName_ != word::null)
485  {
486  phaseModel* referencePhasePtr = &phases()[referencePhaseName_];
487  volScalarField& referenceAlpha = *referencePhasePtr;
488 
489  referenceAlpha = 1;
490 
491  forAll(phaseModels_, phasei)
492  {
493  if (&phaseModels_[phasei] != referencePhasePtr)
494  {
495  referenceAlpha -= phaseModels_[phasei];
496  }
497  }
498  }
499 
500  forAll(phases(), phasei)
501  {
502  const volScalarField& alphai = phases()[phasei];
503  mesh_.setFluxRequired(alphai.name());
504  }
505 }
506 
507 
508 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
509 
511 {}
512 
513 
514 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
515 
517 {
518  tmp<volScalarField> rho(movingPhaseModels_[0]*movingPhaseModels_[0].rho());
519 
520  for
521  (
522  label movingPhasei=1;
523  movingPhasei<movingPhaseModels_.size();
524  movingPhasei++
525  )
526  {
527  rho.ref() +=
528  movingPhaseModels_[movingPhasei]
529  *movingPhaseModels_[movingPhasei].rho();
530  }
531 
532  if (stationaryPhaseModels_.empty())
533  {
534  return rho;
535  }
536  else
537  {
538  return rho/sumAlphaMoving();
539  }
540 }
541 
542 
544 {
545  tmp<volVectorField> U(movingPhaseModels_[0]*movingPhaseModels_[0].U());
546 
547  for
548  (
549  label movingPhasei=1;
550  movingPhasei<movingPhaseModels_.size();
551  movingPhasei++
552  )
553  {
554  U.ref() +=
555  movingPhaseModels_[movingPhasei]
556  *movingPhaseModels_[movingPhasei].U();
557  }
558 
559  if (stationaryPhaseModels_.empty())
560  {
561  return U;
562  }
563  else
564  {
565  return U/sumAlphaMoving();
566  }
567 }
568 
569 
571 Foam::phaseSystem::E(const phasePairKey& key) const
572 {
573  if (aspectRatioModels_.found(key))
574  {
575  return aspectRatioModels_[key]->E();
576  }
577  else
578  {
579  return volScalarField::New
580  (
581  aspectRatioModel::typeName + ":E",
582  mesh_,
584  );
585  }
586 }
587 
588 
590 Foam::phaseSystem::sigma(const phasePairKey& key) const
591 {
592  if (surfaceTensionModels_.found(key))
593  {
594  return surfaceTensionModels_[key]->sigma();
595  }
596  else
597  {
598  return volScalarField::New
599  (
600  surfaceTensionModel::typeName + ":sigma",
601  mesh_,
603  );
604  }
605 }
606 
607 
609 Foam::phaseSystem::sigma(const phasePairKey& key, label patchi) const
610 {
611  if (surfaceTensionModels_.found(key))
612  {
613  return surfaceTensionModels_[key]->sigma(patchi);
614  }
615  else
616  {
617  return tmp<scalarField>
618  (
619  new scalarField(mesh_.boundary()[patchi].size(), 0)
620  );
621  }
622 }
623 
624 
627 {
628  tmp<volScalarField> tnearInt
629  (
631  (
632  "nearInterface",
633  mesh_,
635  )
636  );
637 
638  forAll(phases(), phasei)
639  {
640  tnearInt.ref() = max
641  (
642  tnearInt(),
643  pos0(phases()[phasei] - 0.01)*pos0(0.99 - phases()[phasei])
644  );
645  }
646 
647  return tnearInt;
648 }
649 
650 
652 (
653  const phasePairKey& key
654 ) const
655 {
656  const phasePair pair
657  (
658  phaseModels_[key.first()],
659  phaseModels_[key.second()]
660  );
661 
662  return volScalarField::New
663  (
664  IOobject::groupName("dmdtf", pair.name()),
665  mesh(),
667  );
668 }
669 
670 
672 {
673  return PtrList<volScalarField>(phaseModels_.size());
674 }
675 
676 
678 {
679  forAll(phaseModels_, phasei)
680  {
681  if (!phaseModels_[phasei].incompressible())
682  {
683  return false;
684  }
685  }
686 
687  return true;
688 }
689 
690 
691 bool Foam::phaseSystem::implicitPhasePressure(const phaseModel& phase) const
692 {
693  return false;
694 }
695 
696 
698 {
699  return false;
700 }
701 
702 
704 (
705  const phaseModel& phase1
706 ) const
707 {
708  tmp<surfaceScalarField> tSurfaceTension
709  (
711  (
712  "surfaceTension",
713  mesh_,
714  dimensionedScalar(dimensionSet(1, -2, -2, 0, 0), 0)
715  )
716  );
717 
718  forAll(phases(), phasej)
719  {
720  const phaseModel& phase2 = phases()[phasej];
721 
722  if (&phase2 != &phase1)
723  {
724  phasePairKey key12(phase1.name(), phase2.name());
725 
726  cAlphaTable::const_iterator cAlpha(cAlphas_.find(key12));
727 
728  if (cAlpha != cAlphas_.end())
729  {
730  tSurfaceTension.ref() +=
731  fvc::interpolate(sigma(key12)*K(phase1, phase2))
732  *(
733  fvc::interpolate(phase2)*fvc::snGrad(phase1)
734  - fvc::interpolate(phase1)*fvc::snGrad(phase2)
735  );
736  }
737  }
738  }
739 
740  return tSurfaceTension;
741 }
742 
743 
745 {
746  forAll(phaseModels_, phasei)
747  {
748  phaseModels_[phasei].correct();
749  }
750 }
751 
752 
754 {
755  const PtrList<volScalarField> dmdts = this->dmdts();
756 
757  forAll(movingPhaseModels_, movingPhasei)
758  {
759  phaseModel& phase = movingPhaseModels_[movingPhasei];
760  const volScalarField& alpha = phase;
761  volScalarField& rho = phase.thermoRef().rho();
762 
763  volScalarField source
764  (
766  (
767  IOobject::groupName("source", phase.name()),
768  mesh_,
770  )
771  );
772 
773  if (fvOptions().appliesToField(rho.name()))
774  {
775  source += fvOptions()(alpha, rho)&rho;
776  }
777 
778  if (dmdts.set(phase.index()))
779  {
780  source += dmdts[phase.index()];
781  }
782 
783  phase.correctContinuityError(source);
784  }
785 }
786 
787 
789 {
790  bool updateDpdt = false;
791 
792  forAll(phaseModels_, phasei)
793  {
794  phaseModels_[phasei].correctKinematics();
795 
796  updateDpdt = updateDpdt || phaseModels_[phasei].thermo().dpdt();
797  }
798 
799  // Update the pressure time-derivative if required
800  if (updateDpdt)
801  {
802  dpdt_ = fvc::ddt(phaseModels_.begin()().thermo().p());
803  }
804 }
805 
806 
808 {
809  forAll(phaseModels_, phasei)
810  {
811  phaseModels_[phasei].correctThermo();
812  }
813 }
814 
815 
817 {
818  forAll(phaseModels_, phasei)
819  {
820  phaseModels_[phasei].correctReactions();
821  }
822 }
823 
824 
826 {
827  forAll(phaseModels_, phasei)
828  {
829  phaseModels_[phasei].correctSpecies();
830  }
831 }
832 
833 
835 {
836  forAll(phaseModels_, phasei)
837  {
838  phaseModels_[phasei].correctTurbulence();
839  }
840 }
841 
842 
844 {
845  forAll(phaseModels_, phasei)
846  {
847  phaseModels_[phasei].correctEnergyTransport();
848  }
849 }
850 
851 
853 {
854  if (regIOobject::read())
855  {
856  bool readOK = true;
857 
858  forAll(phaseModels_, phasei)
859  {
860  readOK &= phaseModels_[phasei].read();
861  }
862 
863  // models ...
864 
865  return readOK;
866  }
867  else
868  {
869  return false;
870  }
871 }
872 
873 
875 {
876  if (fv::localEulerDdt::enabled(vf.mesh()))
877  {
878  return fv::localEulerDdt::localRDeltaT(vf.mesh())*vf;
879  }
880  else
881  {
882  return vf/vf.mesh().time().deltaT();
883  }
884 }
885 
886 
888 {
889  if (fv::localEulerDdt::enabled(sf.mesh()))
890  {
891  return fv::localEulerDdt::localRDeltaTf(sf.mesh())*sf;
892  }
893  else
894  {
895  return sf/sf.mesh().time().deltaT();
896  }
897 }
898 
899 
900 // ************************************************************************* //
static const word propertiesName
Default name of the phase properties dictionary.
Definition: phaseSystem.H:343
dimensionedScalar tanh(const dimensionedScalar &ds)
dictionary dict
void generatePairs(const dictTable &modelDicts)
Generate pairs.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
dimensionedScalar acos(const dimensionedScalar &ds)
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
tmp< volScalarField > E(const phasePairKey &key) const
Return the aspect-ratio for a pair.
virtual void correctTurbulence()
Correct the turbulence.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
fv::options & fvOptions
static const surfaceScalarField & localRDeltaTf(const fvMesh &mesh)
Return the reciprocal of the local face time-step.
Definition: localEulerDdt.C:58
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
label phasei
Definition: pEqn.H:27
tmp< surfaceScalarField > nHatf(const volScalarField &alpha1, const volScalarField &alpha2) const
Normal to interface between two phases dotted with face areas.
virtual bool read()
Read object.
error FatalError
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
Unit conversion functions.
const dimensionedScalar & sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
void setMixturePhi(const PtrList< surfaceScalarField > &alphafs, const surfaceScalarField &phim)
Re-normalise the flux of the phases.
static tmp< GeometricField< scalar, fvsPatchField, surfaceMesh > > New(const word &name, const Internal &, const PtrList< fvsPatchField< scalar >> &)
Return a temporary field constructed from name,.
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
tmp< volScalarField > sigma(const phasePairKey &key) const
Return the surface tension coefficient for a pair.
tmp< volScalarField > K(const phaseModel &alpha1, const phaseModel &alpha2) const
Curvature of interface between two phases.
Calculate the snGrad of the given volField.
dimensionedScalar det(const dimensionedSphericalTensor &dt)
rhoReactionThermo & thermo
Definition: createFields.H:28
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:58
CGAL::Exact_predicates_exact_constructions_kernel K
tmp< volScalarField > nearInterface() const
Indicator of the proximity of the interface.
scalar degToRad(const scalar deg)
Conversion from degrees to radians.
phi
Definition: pEqn.H:104
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:45
tmp< surfaceScalarField > surfaceTension(const phaseModel &phase) const
Return the surface tension force.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
Calculate the first temporal derivative.
virtual void correctContinuityError()
Correct the continuity errors.
virtual void correctKinematics()
Correct the kinematics.
stressControl lookup("compactNormalStress") >> compactNormalStress
dynamicFvMesh & mesh
static bool enabled(const fvMesh &mesh)
Return true if LTS is enabled.
Definition: localEulerDdt.C:37
dimensionedScalar cos(const dimensionedScalar &ds)
phaseSystem(const fvMesh &mesh)
Construct from fvMesh.
const dimensionedScalar & b
Wien displacement law constant: default SI units: [m K].
Definition: createFields.H:27
Calculate the gradient of the given field.
A class for handling words, derived from string.
Definition: word.H:59
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static word groupName(Name name, const word &group)
tmp< volVectorField > U() const
Return the mixture velocity.
static autoPtr< blendingMethod > New(const word &modelName, const dictionary &dict, const wordList &phaseNames)
virtual void correctThermo()
Correct the thermodynamics.
const Type & value() const
Return const reference to value.
static const word null
An empty word.
Definition: word.H:77
word timeName
Definition: getTimeIndex.H:3
static const volScalarField & localRDeltaT(const fvMesh &mesh)
Return the reciprocal of the local time-step.
Definition: localEulerDdt.C:46
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
faceListList boundary(nPatches)
const dimensionSet dimPressure
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Definition: pEqn.H:29
tmp< surfaceVectorField > nHatfv(const volScalarField &alpha1, const volScalarField &alpha2) const
Normal to interface between two phases.
Calculate the divergence of the given field.
dimensionedScalar pos0(const dimensionedScalar &ds)
virtual void correct()
Correct the fluid properties other than those listed below.
tmp< volScalarField > rho() const
Return the mixture density.
virtual PtrList< volScalarField > dmdts() const
Return the mass transfer rates for each phase.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
tmp< volScalarField > sumAlphaMoving() const
Return the sum of the phase fractions of the moving phases.
const Mesh & mesh() const
Return mesh.
defineTypeNameAndDebug(combustionModel, 0)
volScalarField sf(fieldObject, mesh)
bool incompressible() const
Return incompressibility.
tmp< volScalarField > byDt(const volScalarField &vf)
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
const dimensionSet dimDensity
virtual void correctReactions()
Correct the reactions.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
List< word > wordList
A List of words.
Definition: fileName.H:54
virtual void correctEnergyTransport()
Correct the energy transport e.g. alphat.
label patchi
tmp< surfaceScalarField > calcPhi(const phaseModelList &phaseModels) const
Calculate and return the mixture flux.
U
Definition: pEqn.H:72
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
static const dimensionSet dimSigma
Surface tension coefficient dimensions.
virtual ~phaseSystem()
Destructor.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:70
virtual bool read()
Read base phaseProperties dictionary.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
phasePairKey()
Construct null.
phaseSystem::phaseModelList & phases
Definition: createFields.H:12
dimensioned< scalar > mag(const dimensioned< Type > &)
Field< vector > vectorField
Specialisation of Field<T> for vector.
void setMixtureU(const volVectorField &Um)
Re-normalise the velocity of the phases.
const doubleScalar e
Elementary charge.
Definition: doubleScalar.H:105
void correctContactAngle(const phaseModel &alpha1, const phaseModel &alpha2, surfaceVectorField::Boundary &nHatb) const
Correction for the boundary condition on the unit normal nHat on.
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
A class for managing temporary objects.
Definition: PtrList.H:53
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
virtual bool implicitPhasePressure() const
Returns true if the phase pressure is treated implicitly.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:45
virtual void correctSpecies()
Correct the species mass fractions.
Namespace for OpenFOAM.
virtual tmp< volScalarField > dmdtf(const phasePairKey &key) const
Return the mass transfer rate for an interface.