multiphaseSystem.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2018 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "multiphaseSystem.H"
29 #include "alphaContactAngleFvPatchScalarField.H"
31 #include "Time.H"
32 #include "subCycle.H"
33 #include "MULES.H"
34 #include "surfaceInterpolate.H"
35 #include "fvcGrad.H"
36 #include "fvcSnGrad.H"
37 #include "fvcDiv.H"
38 #include "fvcFlux.H"
39 #include "fvcAverage.H"
40 
41 // * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * //
42 
43 const Foam::scalar Foam::multiphaseSystem::convertToRad =
45 
46 
47 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
48 
49 void Foam::multiphaseSystem::calcAlphas()
50 {
51  scalar level = 0.0;
52  alphas_ == 0.0;
53 
54  for (const phaseModel& phase : phases_)
55  {
56  alphas_ += level * phase;
57  level += 1.0;
58  }
59 }
60 
61 
62 void Foam::multiphaseSystem::solveAlphas()
63 {
64  PtrList<surfaceScalarField> alphaPhiCorrs(phases_.size());
65  int phasei = 0;
66 
67  for (phaseModel& phase : phases_)
68  {
69  volScalarField& alpha1 = phase;
70 
71  alphaPhiCorrs.set
72  (
73  phasei,
75  (
76  "phi" + alpha1.name() + "Corr",
77  fvc::flux
78  (
79  phi_,
80  phase,
81  "div(phi," + alpha1.name() + ')'
82  )
83  )
84  );
85 
86  surfaceScalarField& alphaPhiCorr = alphaPhiCorrs[phasei];
87 
88  for (phaseModel& phase2 : phases_)
89  {
91 
92  if (&phase2 == &phase) continue;
93 
94  surfaceScalarField phir(phase.phi() - phase2.phi());
95 
96  const auto cAlpha = cAlphas_.cfind(interfacePair(phase, phase2));
97 
98  if (cAlpha.found())
99  {
101  (
102  (mag(phi_) + mag(phir))/mesh_.magSf()
103  );
104 
105  phir += min(cAlpha()*phic, max(phic))*nHatf(phase, phase2);
106  }
107 
108  const word phirScheme
109  (
110  "div(phir," + alpha2.name() + ',' + alpha1.name() + ')'
111  );
112 
113  alphaPhiCorr += fvc::flux
114  (
115  -fvc::flux(-phir, phase2, phirScheme),
116  phase,
117  phirScheme
118  );
119  }
120 
121  phase.correctInflowOutflow(alphaPhiCorr);
122 
124  (
125  1.0/mesh_.time().deltaT().value(),
126  geometricOneField(),
127  phase,
128  phi_,
129  alphaPhiCorr,
130  zeroField(),
131  zeroField(),
132  oneField(),
133  zeroField(),
134  true
135  );
136 
137  ++phasei;
138  }
139 
140  MULES::limitSum(alphaPhiCorrs);
141 
142  volScalarField sumAlpha
143  (
144  IOobject
145  (
146  "sumAlpha",
147  mesh_.time().timeName(),
148  mesh_
149  ),
150  mesh_,
151  dimensionedScalar("sumAlpha", dimless, 0)
152  );
153 
154  phasei = 0;
155 
156  for (phaseModel& phase : phases_)
157  {
158  surfaceScalarField& alphaPhi = alphaPhiCorrs[phasei];
159  alphaPhi += upwind<scalar>(mesh_, phi_).flux(phase);
160  phase.correctInflowOutflow(alphaPhi);
161 
163  (
164  geometricOneField(),
165  phase,
166  alphaPhi
167  );
168 
169  phase.alphaPhi() = alphaPhi;
170 
171  Info<< phase.name() << " volume fraction, min, max = "
172  << phase.weightedAverage(mesh_.V()).value()
173  << ' ' << min(phase).value()
174  << ' ' << max(phase).value()
175  << endl;
176 
177  sumAlpha += phase;
178 
179  ++phasei;
180  }
181 
182  Info<< "Phase-sum volume fraction, min, max = "
183  << sumAlpha.weightedAverage(mesh_.V()).value()
184  << ' ' << min(sumAlpha).value()
185  << ' ' << max(sumAlpha).value()
186  << endl;
187 
188  // Correct the sum of the phase-fractions to avoid 'drift'
189  volScalarField sumCorr(1.0 - sumAlpha);
190  for (phaseModel& phase : phases_)
191  {
192  volScalarField& alpha = phase;
193  alpha += alpha*sumCorr;
194  }
195 
196  calcAlphas();
197 }
198 
199 
200 Foam::tmp<Foam::surfaceVectorField> Foam::multiphaseSystem::nHatfv
201 (
202  const volScalarField& alpha1,
203  const volScalarField& alpha2
204 ) const
205 {
206  /*
207  // Cell gradient of alpha
208  volVectorField gradAlpha =
209  alpha2*fvc::grad(alpha1) - alpha1*fvc::grad(alpha2);
210 
211  // Interpolated face-gradient of alpha
212  surfaceVectorField gradAlphaf = fvc::interpolate(gradAlpha);
213  */
214 
215  surfaceVectorField gradAlphaf
216  (
219  );
220 
221  // Face unit interface normal
222  return gradAlphaf/(mag(gradAlphaf) + deltaN_);
223 }
224 
225 
226 Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseSystem::nHatf
227 (
228  const volScalarField& alpha1,
229  const volScalarField& alpha2
230 ) const
231 {
232  // Face unit interface normal flux
233  return nHatfv(alpha1, alpha2) & mesh_.Sf();
234 }
235 
236 
237 // Correction for the boundary condition on the unit normal nHat on
238 // walls to produce the correct contact angle.
239 
240 // The dynamic contact angle is calculated from the component of the
241 // velocity on the direction of the interface, parallel to the wall.
242 
243 void Foam::multiphaseSystem::correctContactAngle
244 (
245  const phaseModel& phase1,
246  const phaseModel& phase2,
247  surfaceVectorField::Boundary& nHatb
248 ) const
249 {
250  const volScalarField::Boundary& gbf
251  = phase1.boundaryField();
252 
253  const fvBoundaryMesh& boundary = mesh_.boundary();
254 
255  forAll(boundary, patchi)
256  {
257  if (isA<alphaContactAngleFvPatchScalarField>(gbf[patchi]))
258  {
259  const alphaContactAngleFvPatchScalarField& acap =
260  refCast<const alphaContactAngleFvPatchScalarField>(gbf[patchi]);
261 
262  vectorField& nHatPatch = nHatb[patchi];
263 
264  vectorField AfHatPatch
265  (
266  mesh_.Sf().boundaryField()[patchi]
267  /mesh_.magSf().boundaryField()[patchi]
268  );
269 
270  const auto tp =
271  acap.thetaProps().cfind(interfacePair(phase1, phase2));
272 
273  if (!tp.found())
274  {
276  << "Cannot find interface " << interfacePair(phase1, phase2)
277  << "\n in table of theta properties for patch "
278  << acap.patch().name()
279  << exit(FatalError);
280  }
281 
282  bool matched = (tp.key().first() == phase1.name());
283 
284  scalar theta0 = convertToRad*tp().theta0(matched);
285  scalarField theta(boundary[patchi].size(), theta0);
286 
287  scalar uTheta = tp().uTheta();
288 
289  // Calculate the dynamic contact angle if required
290  if (uTheta > SMALL)
291  {
292  scalar thetaA = convertToRad*tp().thetaA(matched);
293  scalar thetaR = convertToRad*tp().thetaR(matched);
294 
295  // Calculated the component of the velocity parallel to the wall
296  vectorField Uwall
297  (
298  phase1.U().boundaryField()[patchi].patchInternalField()
299  - phase1.U().boundaryField()[patchi]
300  );
301  Uwall -= (AfHatPatch & Uwall)*AfHatPatch;
302 
303  // Find the direction of the interface parallel to the wall
304  vectorField nWall
305  (
306  nHatPatch - (AfHatPatch & nHatPatch)*AfHatPatch
307  );
308 
309  // Normalise nWall
310  nWall /= (mag(nWall) + SMALL);
311 
312  // Calculate Uwall resolved normal to the interface parallel to
313  // the interface
314  scalarField uwall(nWall & Uwall);
315 
316  theta += (thetaA - thetaR)*tanh(uwall/uTheta);
317  }
318 
319 
320  // Reset nHatPatch to correspond to the contact angle
321 
322  scalarField a12(nHatPatch & AfHatPatch);
323 
324  scalarField b1(cos(theta));
325 
326  scalarField b2(nHatPatch.size());
327 
328  forAll(b2, facei)
329  {
330  b2[facei] = cos(acos(a12[facei]) - theta[facei]);
331  }
332 
333  scalarField det(1.0 - a12*a12);
334 
335  scalarField a((b1 - a12*b2)/det);
336  scalarField b((b2 - a12*b1)/det);
337 
338  nHatPatch = a*AfHatPatch + b*nHatPatch;
339 
340  nHatPatch /= (mag(nHatPatch) + deltaN_.value());
341  }
342  }
343 }
344 
345 
346 Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::K
347 (
348  const phaseModel& phase1,
349  const phaseModel& phase2
350 ) const
351 {
352  tmp<surfaceVectorField> tnHatfv = nHatfv(phase1, phase2);
353 
354  correctContactAngle(phase1, phase2, tnHatfv.ref().boundaryFieldRef());
355 
356  // Simple expression for curvature
357  return -fvc::div(tnHatfv & mesh_.Sf());
358 }
359 
360 
361 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
362 
364 (
365  const volVectorField& U,
366  const surfaceScalarField& phi
367 )
368 :
369  IOdictionary
370  (
371  IOobject
372  (
373  "transportProperties",
374  U.time().constant(),
375  U.db(),
376  IOobject::MUST_READ_IF_MODIFIED,
377  IOobject::NO_WRITE
378  )
379  ),
380 
381  phases_(lookup("phases"), phaseModel::iNew(U.mesh())),
382 
383  mesh_(U.mesh()),
384  phi_(phi),
385 
386  alphas_
387  (
388  IOobject
389  (
390  "alphas",
391  mesh_.time().timeName(),
392  mesh_,
393  IOobject::NO_READ,
394  IOobject::AUTO_WRITE
395  ),
396  mesh_,
397  dimensionedScalar("alphas", dimless, 0.0)
398  ),
399 
400  sigmas_(lookup("sigmas")),
401  dimSigma_(1, 0, -2, 0, 0),
402  cAlphas_(lookup("interfaceCompression")),
403  Cvms_(lookup("virtualMass")),
404  deltaN_
405  (
406  "deltaN",
407  1e-8/cbrt(average(mesh_.V()))
408  )
409 {
410  calcAlphas();
411  alphas_.write();
412 
413  interfaceDictTable dragModelsDict(lookup("drag"));
414 
415  forAllConstIters(dragModelsDict, iter)
416  {
417  dragModels_.set
418  (
419  iter.key(),
421  (
422  iter(),
423  *phases_.lookup(iter.key().first()),
424  *phases_.lookup(iter.key().second())
425  ).ptr()
426  );
427  }
428 
429  for (const phaseModel& phase1 : phases_)
430  {
431  for (const phaseModel& phase2 : phases_)
432  {
433  if (&phase2 == &phase1)
434  {
435  continue;
436  }
437 
438  const interfacePair key(phase1, phase2);
439 
440  if (sigmas_.found(key) && !cAlphas_.found(key))
441  {
443  << "Compression coefficient not specified for phase pair ("
444  << phase1.name() << ' ' << phase2.name()
445  << ") for which a surface tension coefficient is specified"
446  << endl;
447  }
448  }
449  }
450 }
451 
452 
453 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
454 
456 {
457  auto iter = phases_.cbegin();
458 
459  tmp<volScalarField> trho = iter()*iter().rho();
460  volScalarField& rho = trho.ref();
461 
462  for (++iter; iter != phases_.cend(); ++iter)
463  {
464  rho += iter()*iter().rho();
465  }
466 
467  return trho;
468 }
469 
470 
472 Foam::multiphaseSystem::rho(const label patchi) const
473 {
474  auto iter = phases_.cbegin();
475 
476  tmp<scalarField> trho = iter().boundaryField()[patchi]*iter().rho().value();
477  scalarField& rho = trho.ref();
478 
479  for (++iter; iter != phases_.cend(); ++iter)
480  {
481  rho += iter().boundaryField()[patchi]*iter().rho().value();
482  }
483 
484  return trho;
485 }
486 
487 
489 {
490  auto iter = phases_.cbegin();
491 
492  tmp<volScalarField> tmu = iter()*(iter().rho()*iter().nu());
493  volScalarField& mu = tmu.ref();
494 
495  for (++iter; iter != phases_.cend(); ++iter)
496  {
497  mu += iter()*(iter().rho()*iter().nu());
498  }
499 
500  return tmu/rho();
501 }
502 
503 
505 Foam::multiphaseSystem::nu(const label patchi) const
506 {
507  auto iter = phases_.cbegin();
508 
509  tmp<scalarField> tmu =
510  iter().boundaryField()[patchi]
511  *(iter().rho().value()*iter().nu().value());
512  scalarField& mu = tmu.ref();
513 
514  for (++iter; iter != phases_.cend(); ++iter)
515  {
516  mu +=
517  iter().boundaryField()[patchi]
518  *(iter().rho().value()*iter().nu().value());
519  }
520 
521  return tmu/rho(patchi);
522 }
523 
524 
526 (
527  const phaseModel& phase
528 ) const
529 {
530  tmp<volScalarField> tCvm
531  (
532  new volScalarField
533  (
534  IOobject
535  (
536  "Cvm",
537  mesh_.time().timeName(),
538  mesh_
539  ),
540  mesh_,
542  )
543  );
544 
545  for (const phaseModel& phase2 : phases_)
546  {
547  if (&phase2 == &phase)
548  {
549  continue;
550  }
551 
552  auto iterCvm = Cvms_.cfind(interfacePair(phase, phase2));
553 
554  if (iterCvm.found())
555  {
556  tCvm.ref() += iterCvm()*phase2.rho()*phase2;
557  }
558  else
559  {
560  iterCvm = Cvms_.cfind(interfacePair(phase2, phase));
561 
562  if (iterCvm.found())
563  {
564  tCvm.ref() += iterCvm()*phase.rho()*phase2;
565  }
566  }
567  }
568 
569  return tCvm;
570 }
571 
572 
574 (
575  const phaseModel& phase
576 ) const
577 {
578  tmp<volVectorField> tSvm
579  (
580  new volVectorField
581  (
582  IOobject
583  (
584  "Svm",
585  mesh_.time().timeName(),
586  mesh_
587  ),
588  mesh_,
590  (
591  "Svm",
592  dimensionSet(1, -2, -2, 0, 0),
593  Zero
594  )
595  )
596  );
597 
598  for (const phaseModel& phase2 : phases_)
599  {
600  if (&phase2 == &phase)
601  {
602  continue;
603  }
604 
605  auto Cvm = Cvms_.cfind(interfacePair(phase, phase2));
606 
607  if (Cvm.found())
608  {
609  tSvm.ref() += Cvm()*phase2.rho()*phase2*phase2.DDtU();
610  }
611  else
612  {
613  Cvm = Cvms_.cfind(interfacePair(phase2, phase));
614 
615  if (Cvm.found())
616  {
617  tSvm.ref() += Cvm()*phase.rho()*phase2*phase2.DDtU();
618  }
619  }
620  }
621 
622  volVectorField::Boundary& SvmBf =
623  tSvm.ref().boundaryFieldRef();
624 
625  // Remove virtual mass at fixed-flux boundaries
626  forAll(phase.phi().boundaryField(), patchi)
627  {
628  if
629  (
630  isA<fixedValueFvsPatchScalarField>
631  (
632  phase.phi().boundaryField()[patchi]
633  )
634  )
635  {
636  SvmBf[patchi] = Zero;
637  }
638  }
639 
640  return tSvm;
641 }
642 
643 
646 {
647  autoPtr<dragCoeffFields> dragCoeffsPtr(new dragCoeffFields);
648 
649  forAllConstIters(dragModels_, iter)
650  {
651  const dragModel& dm = *iter();
652 
653  volScalarField* Kptr =
654  (
655  max
656  (
657  // fvc::average(dm.phase1()*dm.phase2()),
658  // fvc::average(dm.phase1())*fvc::average(dm.phase2()),
659  dm.phase1()*dm.phase2(),
660  dm.residualPhaseFraction()
661  )
662  *dm.K
663  (
664  max
665  (
666  mag(dm.phase1().U() - dm.phase2().U()),
667  dm.residualSlip()
668  )
669  )
670  ).ptr();
671 
672  volScalarField::Boundary& Kbf = Kptr->boundaryFieldRef();
673 
674  // Remove drag at fixed-flux boundaries
675  forAll(dm.phase1().phi().boundaryField(), patchi)
676  {
677  if
678  (
679  isA<fixedValueFvsPatchScalarField>
680  (
681  dm.phase1().phi().boundaryField()[patchi]
682  )
683  )
684  {
685  Kbf[patchi] = 0.0;
686  }
687  }
688 
689  dragCoeffsPtr().set(iter.key(), Kptr);
690  }
691 
692  return dragCoeffsPtr;
693 }
694 
695 
697 (
698  const phaseModel& phase,
699  const dragCoeffFields& dragCoeffs
700 ) const
701 {
702  tmp<volScalarField> tdragCoeff
703  (
704  new volScalarField
705  (
706  IOobject
707  (
708  "dragCoeff",
709  mesh_.time().timeName(),
710  mesh_
711  ),
712  mesh_,
714  (
715  "dragCoeff",
716  dimensionSet(1, -3, -1, 0, 0),
717  0
718  )
719  )
720  );
721 
722  dragModelTable::const_iterator dmIter = dragModels_.begin();
723  dragCoeffFields::const_iterator dcIter = dragCoeffs.begin();
724  for
725  (
726  ;
727  dmIter.good() && dcIter.good();
728  ++dmIter, ++dcIter
729  )
730  {
731  if
732  (
733  &phase == &dmIter()->phase1()
734  || &phase == &dmIter()->phase2()
735  )
736  {
737  tdragCoeff.ref() += *dcIter();
738  }
739  }
740 
741  return tdragCoeff;
742 }
743 
744 
746 (
747  const phaseModel& phase1
748 ) const
749 {
750  tmp<surfaceScalarField> tSurfaceTension
751  (
753  (
754  IOobject
755  (
756  "surfaceTension",
757  mesh_.time().timeName(),
758  mesh_
759  ),
760  mesh_,
762  (
763  "surfaceTension",
764  dimensionSet(1, -2, -2, 0, 0),
765  0
766  )
767  )
768  );
769  tSurfaceTension.ref().setOriented();
770 
771  for (const phaseModel& phase2 : phases_)
772  {
773  if (&phase2 == &phase1)
774  {
775  continue;
776  }
777 
778  const auto sigma = sigmas_.cfind(interfacePair(phase1, phase2));
779 
780  if (sigma.found())
781  {
782  tSurfaceTension.ref() +=
783  dimensionedScalar("sigma", dimSigma_, *sigma)
785  (
788  );
789  }
790  }
791 
792  return tSurfaceTension;
793 }
794 
795 
798 {
799  tmp<volScalarField> tnearInt
800  (
801  new volScalarField
802  (
803  IOobject
804  (
805  "nearInterface",
806  mesh_.time().timeName(),
807  mesh_
808  ),
809  mesh_,
810  dimensionedScalar("nearInterface", dimless, 0.0)
811  )
812  );
813 
814  for (const phaseModel& phase : phases_)
815  {
816  tnearInt.ref() =
817  max(tnearInt(), pos0(phase - 0.01)*pos0(0.99 - phase));
818  }
819 
820  return tnearInt;
821 }
822 
823 
825 {
826  for (phaseModel& phase : phases_)
827  {
828  phase.correct();
829  }
830 
831  const Time& runTime = mesh_.time();
832 
833  const dictionary& alphaControls = mesh_.solverDict("alpha");
834  label nAlphaSubCycles(alphaControls.get<label>("nAlphaSubCycles"));
835 
836  if (nAlphaSubCycles > 1)
837  {
838  dimensionedScalar totalDeltaT = runTime.deltaT();
839 
840  PtrList<volScalarField> alpha0s(phases_.size());
841  PtrList<surfaceScalarField> alphaPhiSums(phases_.size());
842 
843  label phasei = 0;
844  for (phaseModel& phase : phases_)
845  {
846  volScalarField& alpha = phase;
847 
848  alpha0s.set
849  (
850  phasei,
851  new volScalarField(alpha.oldTime())
852  );
853 
854  alphaPhiSums.set
855  (
856  phasei,
858  (
859  IOobject
860  (
861  "phiSum" + alpha.name(),
862  runTime.timeName(),
863  mesh_
864  ),
865  mesh_,
866  dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0)
867  )
868  );
869 
870  ++phasei;
871  }
872 
873  for
874  (
875  subCycleTime alphaSubCycle
876  (
877  const_cast<Time&>(runTime),
879  );
880  !(++alphaSubCycle).end();
881  )
882  {
883  solveAlphas();
884 
885  label phasei = 0;
886  for (const phaseModel& phase : phases_)
887  {
888  alphaPhiSums[phasei] += phase.alphaPhi()/nAlphaSubCycles;
889 
890  ++phasei;
891  }
892  }
893 
894  phasei = 0;
895  for (phaseModel& phase : phases_)
896  {
897  volScalarField& alpha = phase;
898 
899  phase.alphaPhi() = alphaPhiSums[phasei];
900 
901  // Correct the time index of the field
902  // to correspond to the global time
903  alpha.timeIndex() = runTime.timeIndex();
904 
905  // Reset the old-time field value
906  alpha.oldTime() = alpha0s[phasei];
907  alpha.oldTime().timeIndex() = runTime.timeIndex();
908 
909  ++phasei;
910  }
911  }
912  else
913  {
914  solveAlphas();
915  }
916 }
917 
918 
920 {
921  if (regIOobject::read())
922  {
923  bool readOK = true;
924 
925  PtrList<entry> phaseData(lookup("phases"));
926  label phasei = 0;
927 
928  for (phaseModel& phase : phases_)
929  {
930  readOK &= phase.read(phaseData[phasei++].dict());
931  }
932 
933  lookup("sigmas") >> sigmas_;
934  lookup("interfaceCompression") >> cAlphas_;
935  lookup("virtualMass") >> Cvms_;
936 
937  return readOK;
938  }
939  else
940  {
941  return false;
942  }
943 }
944 
945 
946 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::fvc::snGrad
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:47
Foam::multiphaseSystem::rho
tmp< volScalarField > rho() const
Return the mixture density.
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:52
Foam::multiphaseSystem::nearInterface
tmp< volScalarField > nearInterface() const
Indicator of the proximity of the interface.
Definition: multiphaseSystem.C:597
Foam::dimless
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
Definition: dimensionSets.H:50
Foam::fvc::flux
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
Foam::MULES::explicitSolve
void explicitSolve(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su)
Definition: MULESTemplates.C:41
Foam::fvc::grad
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:54
Foam::multiphaseSystem::solve
virtual void solve()
Solve for the phase fractions.
Definition: multiphaseSystem.C:622
Foam::MULES::limit
void limit(const RdeltaTType &rDeltaT, const RhoType &rho, const volScalarField &psi, const surfaceScalarField &phi, surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su, const PsiMaxType &psiMax, const PsiMinType &psiMin, const bool returnCorr)
Definition: MULESTemplates.C:581
Foam::TimeState::deltaT
dimensionedScalar deltaT() const
Return time step.
Definition: TimeStateI.H:54
Foam::constant::physicoChemical::mu
const dimensionedScalar mu
Atomic mass unit.
Definition: createFieldRefs.H:4
Foam::multiphaseSystem::phase
const phaseModel & phase(const label i) const
Constant access phase model i.
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::multiphaseSystem::phases_
UPtrList< phaseModel > phases_
Unallocated phase list.
Definition: multiphaseSystem.H:69
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::phaseModel::rho
virtual tmp< volScalarField > rho() const =0
Return the density field.
Foam::dimDensity
const dimensionSet dimDensity
alpha2
const volScalarField & alpha2
Definition: setRegionFluidFields.H:9
subCycle.H
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::objectRegistry::time
const Time & time() const
Return time.
Definition: objectRegistry.H:186
fvcSnGrad.H
Calculate the snGrad of the given volField.
Foam::vtk::Tools::zeroField
vtkSmartPointer< vtkFloatArray > zeroField(const word &name, const label size)
Create named field initialized to zero.
Definition: foamVtkToolsTemplates.C:327
Foam::Time::timeName
static word timeName(const scalar t, const int precision=precision_)
Definition: Time.C:785
Foam::regIOobject::read
virtual bool read()
Read object.
Definition: regIOobjectRead.C:202
Foam::multiphaseSystem::dragCoeffs
autoPtr< dragCoeffFields > dragCoeffs() const
Return the drag coefficients for all of the interfaces.
Foam::multiphaseSystem::multiphaseSystem
multiphaseSystem(const fvMesh &mesh)
Construct from fvMesh.
Definition: multiphaseSystem.C:507
fvcDiv.H
Calculate the divergence of the given field.
Foam::dimensioned::name
const word & name() const
Return const reference to name.
Definition: dimensionedType.C:406
Foam::fvc::div
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:49
phasei
label phasei
Definition: pEqn.H:27
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
Foam::pos0
dimensionedScalar pos0(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:188
alpha1
const volScalarField & alpha1
Definition: setRegionFluidFields.H:8
Foam::dictionary::get
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:81
Foam::multiphaseSystem::surfaceTension
tmp< surfaceScalarField > surfaceTension(const phaseModel &phase) const
Return the surface tension force.
Definition: multiphaseSystem.C:552
nAlphaSubCycles
label nAlphaSubCycles(alphaControls.get< label >("nAlphaSubCycles"))
rho
rho
Definition: readInitialConditions.H:88
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::vectorField
Field< vector > vectorField
Specialisation of Field<T> for vector.
Definition: primitiveFieldsFwd.H:54
phic
surfaceScalarField phic(mixture.cAlpha() *mag(alphaPhic/mesh.magSf()))
Foam::dimensionedVector
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Definition: dimensionedVector.H:50
K
CGAL::Exact_predicates_exact_constructions_kernel K
Definition: CGALTriangulation3DKernel.H:58
trho
tmp< volScalarField > trho
Definition: setRegionSolidFields.H:4
Foam::tmp::ref
T & ref() const
Definition: tmpI.H:258
phir
surfaceScalarField phir(fvc::flux(UdmModel.Udm()))
Foam::HashPtrTable::set
bool set(const Key &key, T *ptr)
Assign a new entry, overwriting existing entries.
Definition: HashPtrTableI.H:84
Foam::constant::physicoChemical::b
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
Foam::tanh
dimensionedScalar tanh(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:272
alphaPhi
surfaceScalarField alphaPhi(phi.name()+alpha1.name(), fvc::flux(phi, alpha1, alphaScheme))
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
Foam::phaseModel::DDtU
const volVectorField & DDtU() const
Definition: phaseModel.H:182
Foam::cellModeller::lookup
const cellModel * lookup(const word &modelName)
Deprecated(2017-11) equivalent to cellModel::ptr static method.
Definition: cellModeller.H:46
Foam::MULES::limitSum
void limitSum(UPtrList< scalarField > &phiPsiCorrs)
Definition: MULES.C:35
dragCoeffs
autoPtr< multiphaseSystem::dragCoeffFields > dragCoeffs(fluid.dragCoeffs())
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:43
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
Foam::autoPtr::ptr
T * ptr() noexcept
Same as release().
Definition: autoPtr.H:174
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
Foam::dragModel::New
static autoPtr< dragModel > New(const dictionary &dict, const phasePair &pair)
Definition: newDragModel.C:35
Foam::dictionary::lookup
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionary.C:424
timeName
word timeName
Definition: getTimeIndex.H:3
dict
dictionary dict
Definition: searchingEngine.H:14
fixedValueFvsPatchFields.H
phase2
phaseModel & phase2
Definition: setRegionFluidFields.H:6
Foam::FatalError
error FatalError
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
stdFoam::end
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
Definition: stdFoam.H:121
Foam::fvc::interpolate
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.
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::phaseModel::phi
virtual tmp< surfaceScalarField > phi() const =0
Return the volumetric flux.
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:60
Foam::phaseModel::name
const word & name() const
Return the name of this phase.
Definition: phaseModel.C:95
Time.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
U
U
Definition: pEqn.H:72
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:372
Foam::constant::mathematical::pi
constexpr scalar pi(M_PI)
forAllConstIters
forAllConstIters(mixture.phases(), phase)
Definition: pEqn.H:28
Foam::multiphaseSystem::read
virtual bool read()
Read thermophysical properties dictionary.
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
Foam::GeometricField::ref
Internal & ref(const bool updateAccessTime=true)
Return a reference to the dimensioned internal field.
Definition: GeometricField.C:749
Foam::GeometricField::boundaryFieldRef
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
Definition: GeometricField.C:783
Foam::acos
dimensionedScalar acos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:268
fvcGrad.H
Calculate the gradient of the given field.
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
fvcFlux.H
Calculate the face-flux of the given field.
Foam::constant::electromagnetic::e
const dimensionedScalar e
Elementary charge.
Definition: createFields.H:11
Foam::phaseModel::U
virtual tmp< volVectorField > U() const =0
Return the velocity.
Foam::det
dimensionedScalar det(const dimensionedSphericalTensor &dt)
Definition: dimensionedSphericalTensor.C:62
Foam::multiphaseSystem::Cvm
tmp< volScalarField > Cvm(const phaseModel &phase) const
Return the virtual-mass coefficient for the given phase.
sigma
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
phase1
phaseModel & phase1
Definition: setRegionFluidFields.H:5
Foam::TimeState::timeIndex
label timeIndex() const
Return current time index.
Definition: TimeStateI.H:36
Foam::multiphaseSystem::dragCoeff
tmp< volScalarField > dragCoeff(const phaseModel &phase, const dragCoeffFields &dragCoeffs) const
Return the sum of the drag coefficients for the given phase.
Foam::surfaceVectorField
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Definition: surfaceFieldsFwd.H:57
Foam::HashTable::found
bool found(const Key &key) const
Return true if hashed entry is found in table.
Definition: HashTableI.H:100
Foam::cbrt
dimensionedScalar cbrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:155
fvcAverage.H
Area-weighted average a surfaceField creating a volField.
MULES.H
MULES: Multidimensional universal limiter for explicit solution.
constant
constant condensation/saturation model.
Foam::multiphaseSystem::nu
tmp< volScalarField > nu() const
Return the mixture laminar viscosity.
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:298
boundary
faceListList boundary
Definition: createBlockMesh.H:4
Foam::multiphaseSystem::Svm
tmp< volVectorField > Svm(const phaseModel &phase) const
Return the virtual-mass source for the given phase.
Foam::GeometricField::boundaryField
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Definition: GeometricFieldI.H:62
Foam::average
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
Definition: DimensionedFieldFunctions.C:328
Foam::cos
dimensionedScalar cos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:265
alphaControls
const dictionary & alphaControls
Definition: alphaControls.H:1