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) 2013-2019 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"
30 
31 #include "MULES.H"
32 #include "subCycle.H"
33 #include "UniformField.H"
34 
35 #include "fvcDdt.H"
36 #include "fvcDiv.H"
37 #include "fvcSnGrad.H"
38 #include "fvcFlux.H"
39 #include "fvcMeshPhi.H"
40 #include "fvcSup.H"
41 
42 #include "fvmDdt.H"
43 #include "fvmLaplacian.H"
44 #include "fvmSup.H"
45 
46 // * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50  defineTypeNameAndDebug(multiphaseSystem, 0);
51  defineRunTimeSelectionTable(multiphaseSystem, dictionary);
52 }
53 
54 const Foam::scalar Foam::multiphaseSystem::convertToRad =
56 
57 
58 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
59 
60 void Foam::multiphaseSystem::calcAlphas()
61 {
62  scalar level = 0.0;
63  alphas_ == 0.0;
64 
65  forAll(phases(), i)
66  {
67  alphas_ += level*phases()[i];
68  level += 1.0;
69  }
70 }
71 
72 
73 void Foam::multiphaseSystem::solveAlphas()
74 {
75  forAll(phases(), phasei)
76  {
77  phases()[phasei].correctBoundaryConditions();
78  }
79 
80  // Calculate the void fraction
81  volScalarField alphaVoid
82  (
83  IOobject
84  (
85  "alphaVoid",
86  mesh_.time().timeName(),
87  mesh_
88  ),
89  mesh_,
90  dimensionedScalar("one", dimless, 1)
91  );
92  forAll(stationaryPhases(), stationaryPhasei)
93  {
94  alphaVoid -= stationaryPhases()[stationaryPhasei];
95  }
96 
97  // Generate face-alphas
98  PtrList<surfaceScalarField> alphafs(phases().size());
99  forAll(phases(), phasei)
100  {
101  phaseModel& phase = phases()[phasei];
102  alphafs.set
103  (
104  phasei,
106  (
107  IOobject::groupName("alphaf", phase.name()),
108  upwind<scalar>(mesh_, phi_).interpolate(phase)
109  )
110  );
111  }
112 
113  // Create correction fluxes
114  PtrList<surfaceScalarField> alphaPhiCorrs(phases().size());
115  forAll(stationaryPhases(), stationaryPhasei)
116  {
117  phaseModel& phase = stationaryPhases()[stationaryPhasei];
118 
119  alphaPhiCorrs.set
120  (
121  phase.index(),
123  (
124  IOobject::groupName("alphaPhiCorr", phase.name()),
125  - upwind<scalar>(mesh_, phi_).flux(phase)
126  )
127  );
128  }
129  forAll(movingPhases(), movingPhasei)
130  {
131  phaseModel& phase = movingPhases()[movingPhasei];
132  volScalarField& alpha = phase;
133 
134  alphaPhiCorrs.set
135  (
136  phase.index(),
138  (
139  IOobject::groupName("alphaPhiCorr", phase.name()),
140  fvc::flux(phi_, phase, "div(phi," + alpha.name() + ')')
141  )
142  );
143 
144  surfaceScalarField& alphaPhiCorr = alphaPhiCorrs[phase.index()];
145 
146  forAll(phases(), phasei)
147  {
148  phaseModel& phase2 = phases()[phasei];
150 
151  if (&phase2 == &phase) continue;
152 
153  surfaceScalarField phir(phase.phi() - phase2.phi());
154 
155  cAlphaTable::const_iterator cAlpha
156  (
157  cAlphas_.find(phasePairKey(phase.name(), phase2.name()))
158  );
159 
160  if (cAlpha != cAlphas_.end())
161  {
163  (
164  (mag(phi_) + mag(phir))/mesh_.magSf()
165  );
166 
167  phir += min(cAlpha()*phic, max(phic))*nHatf(phase, phase2);
168  }
169 
170  word phirScheme
171  (
172  "div(phir," + alpha2.name() + ',' + alpha.name() + ')'
173  );
174 
175  alphaPhiCorr += fvc::flux
176  (
177  -fvc::flux(-phir, phase2, phirScheme),
178  phase,
179  phirScheme
180  );
181  }
182 
183  phase.correctInflowOutflow(alphaPhiCorr);
184 
186  (
187  geometricOneField(),
188  phase,
189  phi_,
190  alphaPhiCorr,
191  zeroField(),
192  zeroField(),
193  min(alphaVoid.primitiveField(), phase.alphaMax())(),
194  zeroField(),
195  true
196  );
197  }
198 
199  // Limit the flux sums, fixing those of the stationary phases
200  labelHashSet fixedAlphaPhiCorrs;
201  forAll(stationaryPhases(), stationaryPhasei)
202  {
203  fixedAlphaPhiCorrs.insert(stationaryPhases()[stationaryPhasei].index());
204  }
205  MULES::limitSum(alphafs, alphaPhiCorrs, fixedAlphaPhiCorrs);
206 
207  // Solve for the moving phase alphas
208  forAll(movingPhases(), movingPhasei)
209  {
210  phaseModel& phase = movingPhases()[movingPhasei];
211  volScalarField& alpha = phase;
212 
213  surfaceScalarField& alphaPhi = alphaPhiCorrs[phase.index()];
214  alphaPhi += upwind<scalar>(mesh_, phi_).flux(phase);
215  phase.correctInflowOutflow(alphaPhi);
216 
218  (
219  IOobject
220  (
221  "Sp",
222  mesh_.time().timeName(),
223  mesh_
224  ),
225  mesh_,
226  dimensionedScalar("zero", dimless/dimTime, 0)
227  );
228 
230  (
231  "Su",
232  min(alpha, scalar(1))*fvc::div(fvc::absolute(phi_, phase.U()))
233  );
234 
235  if (phase.divU().valid())
236  {
237  const scalarField& dgdt = phase.divU()();
238 
239  forAll(dgdt, celli)
240  {
241  if (dgdt[celli] > 0.0)
242  {
243  Sp[celli] -= dgdt[celli];
244  Su[celli] += dgdt[celli];
245  }
246  else if (dgdt[celli] < 0.0)
247  {
248  Sp[celli] +=
249  dgdt[celli]
250  *(1 - alpha[celli])/max(alpha[celli], 1e-4);
251  }
252  }
253  }
254 
255  forAll(phases(), phasej)
256  {
257  const phaseModel& phase2 = phases()[phasej];
258  const volScalarField& alpha2 = phase2;
259 
260  if (&phase2 == &phase) continue;
261 
262  if (phase2.divU().valid())
263  {
264  const scalarField& dgdt2 = phase2.divU()();
265 
266  forAll(dgdt2, celli)
267  {
268  if (dgdt2[celli] < 0.0)
269  {
270  Sp[celli] +=
271  dgdt2[celli]
272  *(1 - alpha2[celli])/max(alpha2[celli], 1e-4);
273 
274  Su[celli] -=
275  dgdt2[celli]
276  *alpha[celli]/max(alpha2[celli], 1e-4);
277  }
278  else if (dgdt2[celli] > 0.0)
279  {
280  Sp[celli] -= dgdt2[celli];
281  }
282  }
283  }
284  }
285 
287  (
288  geometricOneField(),
289  alpha,
290  alphaPhi,
291  Sp,
292  Su
293  );
294 
295  phase.alphaPhiRef() = alphaPhi;
296  }
297 
298  // Report the phase fractions and the phase fraction sum
299  forAll(phases(), phasei)
300  {
301  phaseModel& phase = phases()[phasei];
302 
303  Info<< phase.name() << " fraction, min, max = "
304  << phase.weightedAverage(mesh_.V()).value()
305  << ' ' << min(phase).value()
306  << ' ' << max(phase).value()
307  << endl;
308  }
309 
310  volScalarField sumAlphaMoving
311  (
312  IOobject
313  (
314  "sumAlphaMoving",
315  mesh_.time().timeName(),
316  mesh_
317  ),
318  mesh_,
319  dimensionedScalar("zero", dimless, 0)
320  );
321  forAll(movingPhases(), movingPhasei)
322  {
323  sumAlphaMoving += movingPhases()[movingPhasei];
324  }
325 
326  Info<< "Phase-sum volume fraction, min, max = "
327  << (sumAlphaMoving + 1 - alphaVoid)().weightedAverage(mesh_.V()).value()
328  << ' ' << min(sumAlphaMoving + 1 - alphaVoid).value()
329  << ' ' << max(sumAlphaMoving + 1 - alphaVoid).value()
330  << endl;
331 
332  // Correct the sum of the phase fractions to avoid drift
333  forAll(movingPhases(), movingPhasei)
334  {
335  movingPhases()[movingPhasei] *= alphaVoid/sumAlphaMoving;
336  }
337 }
338 
339 
340 Foam::tmp<Foam::surfaceVectorField> Foam::multiphaseSystem::nHatfv
341 (
342  const volScalarField& alpha1,
343  const volScalarField& alpha2
344 ) const
345 {
346  /*
347  // Cell gradient of alpha
348  volVectorField gradAlpha =
349  alpha2*fvc::grad(alpha1) - alpha1*fvc::grad(alpha2);
350 
351  // Interpolated face-gradient of alpha
352  surfaceVectorField gradAlphaf = fvc::interpolate(gradAlpha);
353  */
354 
355  surfaceVectorField gradAlphaf
356  (
359  );
360 
361  // Face unit interface normal
362  return gradAlphaf/(mag(gradAlphaf) + deltaN_);
363 }
364 
365 
366 Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseSystem::nHatf
367 (
368  const volScalarField& alpha1,
369  const volScalarField& alpha2
370 ) const
371 {
372  // Face unit interface normal flux
373  return nHatfv(alpha1, alpha2) & mesh_.Sf();
374 }
375 
376 
377 // Correction for the boundary condition on the unit normal nHat on
378 // walls to produce the correct contact angle.
379 
380 // The dynamic contact angle is calculated from the component of the
381 // velocity on the direction of the interface, parallel to the wall.
382 
383 void Foam::multiphaseSystem::correctContactAngle
384 (
385  const phaseModel& phase1,
386  const phaseModel& phase2,
387  surfaceVectorField::Boundary& nHatb
388 ) const
389 {
390  const volScalarField::Boundary& gbf
391  = phase1.boundaryField();
392 
393  const fvBoundaryMesh& boundary = mesh_.boundary();
394 
395  forAll(boundary, patchi)
396  {
397  if (isA<alphaContactAngleFvPatchScalarField>(gbf[patchi]))
398  {
399  const alphaContactAngleFvPatchScalarField& acap =
400  refCast<const alphaContactAngleFvPatchScalarField>(gbf[patchi]);
401 
402  vectorField& nHatPatch = nHatb[patchi];
403 
404  vectorField AfHatPatch
405  (
406  mesh_.Sf().boundaryField()[patchi]
407  /mesh_.magSf().boundaryField()[patchi]
408  );
409 
410  alphaContactAngleFvPatchScalarField::thetaPropsTable::
411  const_iterator tp =
412  acap.thetaProps()
413  .find(phasePairKey(phase1.name(), phase2.name()));
414 
415  if (tp == acap.thetaProps().end())
416  {
418  << "Cannot find interface "
419  << phasePairKey(phase1.name(), phase2.name())
420  << "\n in table of theta properties for patch "
421  << acap.patch().name()
422  << exit(FatalError);
423  }
424 
425  bool matched = (tp.key().first() == phase1.name());
426 
427  scalar theta0 = convertToRad*tp().theta0(matched);
428  scalarField theta(boundary[patchi].size(), theta0);
429 
430  scalar uTheta = tp().uTheta();
431 
432  // Calculate the dynamic contact angle if required
433  if (uTheta > SMALL)
434  {
435  scalar thetaA = convertToRad*tp().thetaA(matched);
436  scalar thetaR = convertToRad*tp().thetaR(matched);
437 
438  // Calculated the component of the velocity parallel to the wall
439  vectorField Uwall
440  (
441  phase1.U()().boundaryField()[patchi].patchInternalField()
442  - phase1.U()().boundaryField()[patchi]
443  );
444  Uwall -= (AfHatPatch & Uwall)*AfHatPatch;
445 
446  // Find the direction of the interface parallel to the wall
447  vectorField nWall
448  (
449  nHatPatch - (AfHatPatch & nHatPatch)*AfHatPatch
450  );
451 
452  // Normalise nWall
453  nWall /= (mag(nWall) + SMALL);
454 
455  // Calculate Uwall resolved normal to the interface parallel to
456  // the interface
457  scalarField uwall(nWall & Uwall);
458 
459  theta += (thetaA - thetaR)*tanh(uwall/uTheta);
460  }
461 
462 
463  // Reset nHatPatch to correspond to the contact angle
464 
465  scalarField a12(nHatPatch & AfHatPatch);
466 
467  scalarField b1(cos(theta));
468 
469  scalarField b2(nHatPatch.size());
470 
471  forAll(b2, facei)
472  {
473  b2[facei] = cos(acos(a12[facei]) - theta[facei]);
474  }
475 
476  scalarField det(1 - a12*a12);
477 
478  scalarField a((b1 - a12*b2)/det);
479  scalarField b((b2 - a12*b1)/det);
480 
481  nHatPatch = a*AfHatPatch + b*nHatPatch;
482 
483  nHatPatch /= (mag(nHatPatch) + deltaN_.value());
484  }
485  }
486 }
487 
488 
489 Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::K
490 (
491  const phaseModel& phase1,
492  const phaseModel& phase2
493 ) const
494 {
495  tmp<surfaceVectorField> tnHatfv = nHatfv(phase1, phase2);
496 
497  correctContactAngle(phase1, phase2, tnHatfv.ref().boundaryFieldRef());
498 
499  // Simple expression for curvature
500  return -fvc::div(tnHatfv & mesh_.Sf());
501 }
502 
503 
504 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
505 
507 (
508  const fvMesh& mesh
509 )
510 :
511  phaseSystem(mesh),
512 
513  alphas_
514  (
515  IOobject
516  (
517  "alphas",
518  mesh_.time().timeName(),
519  mesh,
522  ),
523  mesh,
524  dimensionedScalar("zero", dimless, 0)
525  ),
526 
527  cAlphas_(lookup("interfaceCompression")),
528 
529  deltaN_
530  (
531  "deltaN",
532  1e-8/pow(average(mesh_.V()), 1.0/3.0)
533  )
534 {
535  forAll(phases(), phasei)
536  {
537  volScalarField& alphai = phases()[phasei];
538  mesh_.setFluxRequired(alphai.name());
539  }
540 }
541 
542 
543 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
544 
546 {}
547 
548 
549 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
550 
552 (
553  const phaseModel& phase1
554 ) const
555 {
556  tmp<surfaceScalarField> tSurfaceTension
557  (
559  (
560  "surfaceTension",
561  mesh_,
562  dimensionedScalar("zero", dimensionSet(1, -2, -2, 0, 0), 0)
563  )
564  );
565 
566  tSurfaceTension.ref().setOriented();
567 
568  forAll(phases(), phasej)
569  {
570  const phaseModel& phase2 = phases()[phasej];
571 
572  if (&phase2 != &phase1)
573  {
574  phasePairKey key12(phase1.name(), phase2.name());
575 
576  cAlphaTable::const_iterator cAlpha(cAlphas_.find(key12));
577 
578  if (cAlpha != cAlphas_.end())
579  {
580  tSurfaceTension.ref() +=
582  *(
585  );
586  }
587  }
588  }
589 
590  tSurfaceTension->setOriented();
591 
592  return tSurfaceTension;
593 }
594 
595 
598 {
599  tmp<volScalarField> tnearInt
600  (
602  (
603  "nearInterface",
604  mesh_,
605  dimensionedScalar("zero", dimless, 0)
606  )
607  );
608 
609  forAll(phases(), phasei)
610  {
611  tnearInt.ref() = max
612  (
613  tnearInt(),
614  pos0(phases()[phasei] - 0.01)*pos0(0.99 - phases()[phasei])
615  );
616  }
617 
618  return tnearInt;
619 }
620 
621 
623 {
624  const Time& runTime = mesh_.time();
625 
626  const dictionary& alphaControls = mesh_.solverDict("alpha");
627  label nAlphaSubCycles(alphaControls.get<label>("nAlphaSubCycles"));
628 
629  bool LTS = fv::localEulerDdt::enabled(mesh_);
630 
631  if (nAlphaSubCycles > 1)
632  {
633  tmp<volScalarField> trSubDeltaT;
634 
635  if (LTS)
636  {
637  trSubDeltaT =
639  }
640 
641  List<volScalarField*> alphaPtrs(phases().size());
642  PtrList<surfaceScalarField> alphaPhiSums(phases().size());
643 
644  forAll(phases(), phasei)
645  {
648 
649  alphaPtrs[phasei] = &alpha;
650 
651  alphaPhiSums.set
652  (
653  phasei,
655  (
656  IOobject
657  (
658  "phiSum" + alpha.name(),
659  runTime.timeName(),
660  mesh_
661  ),
662  mesh_,
663  dimensionedScalar("zero", dimensionSet(0, 3, -1, 0, 0), 0)
664  )
665  );
666  }
667 
668  for
669  (
670  subCycleTime alphaSubCycle
671  (
672  const_cast<Time&>(runTime),
674  );
675  !(++alphaSubCycle).end();
676  )
677  {
678  solveAlphas();
679 
680  forAll(phases(), phasei)
681  {
682  alphaPhiSums[phasei] += phases()[phasei].alphaPhi();
683  }
684  }
685 
686  forAll(phases(), phasei)
687  {
689  if (phase.stationary()) continue;
690 
691  phase.alphaPhiRef() = alphaPhiSums[phasei]/nAlphaSubCycles;
692  }
693  }
694  else
695  {
696  solveAlphas();
697  }
698 
699  forAll(phases(), phasei)
700  {
702  if (phase.stationary()) continue;
703 
704  phase.alphaRhoPhiRef() =
705  fvc::interpolate(phase.rho())*phase.alphaPhi();
706 
707  phase.clip(0, 1);
708  }
709 
710  calcAlphas();
711 }
712 
713 
714 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::phaseModel
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:57
Foam::fvc::snGrad
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:47
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::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
Foam::multiphaseSystem::~multiphaseSystem
virtual ~multiphaseSystem()
Destructor.
Definition: multiphaseSystem.C:545
Foam::IOobject::AUTO_WRITE
Definition: IOobject.H:129
Foam::dimless
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
Definition: dimensionSets.H:50
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:40
Foam::fvc::grad
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:54
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
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:580
Foam::fv::localEulerDdt::localRSubDeltaT
static tmp< volScalarField > localRSubDeltaT(const fvMesh &mesh, const label nAlphaSubCycles)
Calculate and return the reciprocal of the local sub-cycling.
Definition: localEulerDdt.C:72
Foam::phase
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phase.H:54
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
fvcMeshPhi.H
Calculate the mesh motion flux and convert fluxes from absolute to relative and back.
alpha2
const volScalarField & alpha2
Definition: setRegionFluidFields.H:9
subCycle.H
Foam::defineRunTimeSelectionTable
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
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:258
Foam::Time::timeName
static word timeName(const scalar t, const int precision=precision_)
Definition: Time.C:764
Sp
zeroField Sp
Definition: alphaSuSp.H:2
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:376
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:337
Foam::pos0
dimensionedScalar pos0(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:188
fvcSup.H
Calculate the field for explicit evaluation of implicit and explicit sources.
alpha1
const volScalarField & alpha1
Definition: setRegionFluidFields.H:8
alphafs
PtrList< surfaceScalarField > alphafs(phases.size())
Foam::dictionary::get
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:81
Foam::dimensionSet
Dimension set for the base types.
Definition: dimensionSet.H:65
Foam::multiphaseSystem::surfaceTension
tmp< surfaceScalarField > surfaceTension(const phaseModel &phase) const
Return the surface tension force.
Definition: multiphaseSystem.C:552
Foam::GeometricField::clip
void clip(const dimensioned< MinMax< Type >> &range)
Clip the field to be bounded within the specified range.
Definition: GeometricField.C:1123
nAlphaSubCycles
label nAlphaSubCycles(alphaControls.get< label >("nAlphaSubCycles"))
Foam::subCycleTime
A class for managing sub-cycling times.
Definition: subCycleTime.H:50
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
Foam::phaseModel::divU
virtual tmp< volScalarField > divU() const =0
Return the phase dilatation rate (d(alpha)/dt + div(alpha*phi))
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:290
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::GeometricField< scalar, fvsPatchField, surfaceMesh >::New
static tmp< GeometricField< scalar, fvsPatchField, surfaceMesh > > New(const word &name, const Mesh &mesh, const dimensionSet &ds, const word &patchFieldType=fvsPatchField< scalar >::calculatedType())
Return tmp field from name, mesh, dimensions and patch type.
Definition: GeometricFieldNew.C:34
K
CGAL::Exact_predicates_exact_constructions_kernel K
Definition: CGALTriangulation3DKernel.H:58
Foam::fv::localEulerDdt::enabled
static bool enabled(const fvMesh &mesh)
Return true if LTS is enabled.
Definition: localEulerDdt.C:39
Su
zeroField Su
Definition: alphaSuSp.H:1
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:54
Foam::tmp::ref
T & ref() const
Definition: tmpI.H:258
phir
surfaceScalarField phir(fvc::flux(UdmModel.Udm()))
Foam::label
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:62
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::GeometricField< scalar, fvPatchField, volMesh >::Internal
DimensionedField< scalar, volMesh > Internal
Type of the internal field from which this GeometricField is derived.
Definition: GeometricField.H:107
Foam::cellModeller::lookup
const cellModel * lookup(const word &modelName)
Deprecated(2017-11) equivalent to cellModel::ptr static method.
Definition: cellModeller.H:46
fvmLaplacian.H
Calculate the matrix for the laplacian of the field.
Foam::MULES::limitSum
void limitSum(UPtrList< scalarField > &phiPsiCorrs)
Definition: MULES.C:35
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:43
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:65
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
Foam::phasePairKey
Definition: phasePairKey.H:59
Foam::pow
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Definition: dimensionedScalar.C:75
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
phase2
phaseModel & phase2
Definition: setRegionFluidFields.H:6
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
LTS
bool LTS
Definition: createRDeltaT.H:1
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:115
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::PtrList::set
const T * set(const label i) const
Return const pointer to element (if set) or nullptr.
Definition: PtrListI.H:143
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.
fvmSup.H
Calculate the matrix for implicit and explicit sources.
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::phaseModel::name
const word & name() const
Return the name of this phase.
Definition: phaseModel.C:94
multiphaseSystem.H
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:355
Foam::constant::mathematical::pi
constexpr scalar pi(M_PI)
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:718
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:102
Foam::IOobject::groupName
static word groupName(StringType name, const word &group)
Create dot-delimited name.group.
Foam::acos
dimensionedScalar acos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:268
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
fvcFlux.H
Calculate the face-flux of the given field.
phases
multiphaseSystem::phaseModelList & phases
Definition: createFields.H:12
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.
fvcDdt.H
Calculate the first temporal derivative.
Foam::phaseSystem
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:69
Foam::det
dimensionedScalar det(const dimensionedSphericalTensor &dt)
Definition: dimensionedSphericalTensor.C:62
sigma
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
phase1
phaseModel & phase1
Definition: setRegionFluidFields.H:5
Foam::tmp::valid
bool valid() const noexcept
Definition: tmpI.H:206
Foam::surfaceVectorField
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Definition: surfaceFieldsFwd.H:57
Foam::labelHashSet
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys and label hasher.
Definition: HashSet.H:415
Foam::fvc::flux
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
Definition: fvcFlux.C:34
Foam::GeometricField< scalar, fvPatchField, volMesh >
MULES.H
MULES: Multidimensional universal limiter for explicit solution.
Foam::IOobject::NO_READ
Definition: IOobject.H:123
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::multiphaseSystem::phases
const UPtrList< phaseModel > & phases() const
Return phases.
boundary
faceListList boundary
Definition: createBlockMesh.H:4
Foam::fvc::absolute
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
Definition: fvcMeshPhi.C:190
UniformField.H
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
fvmDdt.H
Calulate the matrix for the first temporal derivative.
Foam::phase::rho
const dimensionedScalar & rho() const
Return const-access to phase1 density.
Definition: phase.H:140
Foam::cos
dimensionedScalar cos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:265
alphaControls
const dictionary & alphaControls
Definition: alphaControls.H:1