pEqn.H
Go to the documentation of this file.
1 {
2  const volScalarField& psi = thermo.psi();
3 
4  volVectorField HbyA("HbyA", U);
5 
7  {
8  HbyA = trTU() & UEqn().H();
9  }
10  else
11  {
12  HbyA = trAU()*UEqn().H();
13  }
14 
15  UEqn.clear();
16 
17  bool closedVolume = false;
18 
20  (
21  "phiHbyA",
22  fvc::interpolate(rho*HbyA) & mesh.Sf()
23  );
24 
25  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
26 
27  closedVolume = adjustPhi(phiHbyA, U, p);
28 
29  while (simple.correctNonOrthogonal())
30  {
31  tmp<fvScalarMatrix> tpEqn;
32 
34  {
35  tpEqn =
36  (
38  + fvOptions(psi, p, rho.name())
39  ==
41  );
42  }
43  else
44  {
45  tpEqn =
46  (
48  + fvOptions(psi, p, rho.name())
49  ==
51  );
52  }
53 
54  tpEqn().setReference(pRefCell, pRefValue);
55 
56  tpEqn().solve();
57 
58  if (simple.finalNonOrthogonalIter())
59  {
60  phi = phiHbyA - tpEqn().flux();
61  }
62  }
63 
65 
66  // Explicitly relax pressure for momentum corrector
67  p.relax();
68 
70  {
71  U = HbyA - (trTU() & fvc::grad(p));
72  }
73  else
74  {
75  U = HbyA - trAU()*fvc::grad(p);
76  }
77 
78  U.correctBoundaryConditions();
79  fvOptions.correct(U);
80 
81  // For closed-volume cases adjust the pressure and density levels
82  // to obey overall mass continuity
83  if (closedVolume)
84  {
87  }
88 
89  rho = thermo.rho();
90  rho = max(rho, rhoMin);
91  rho = min(rho, rhoMax);
92  rho.relax();
93  Info<< "rho max/min : "
94  << max(rho).value() << " "
95  << min(rho).value() << endl;
96 }
phi
Definition: pEqn.H:20
tmp< volTensorField > trTU
Definition: UEqn.H:21
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
messageStream Info
tmp< surfaceScalarField > interpolate(const RhoType &rho)
dynamicFvMesh & mesh
p
Definition: pEqn.H:59
fv::IOoptionList & fvOptions
const scalar pRefValue
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
IOMRFZoneList & MRF
fvVectorMatrix UEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
phiHbyA
Definition: pEqn.H:21
Switch pressureImplicitPorosity(false)
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
adjustPhi(phiHbyA, U, p_rgh)
dimensionedScalar initialMass
Definition: createFields.H:83
PtrList< dimensionedScalar > rhoMin(fluidRegions.size())
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
const label pRefCell
const dictionary & simple
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
rho
Definition: pEqn.H:1
psiReactionThermo & thermo
Definition: createFields.H:32
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
PtrList< dimensionedScalar > rhoMax(fluidRegions.size())
tmp< volScalarField > trAU
Definition: UEqn.H:20
U
Definition: pEqn.H:82
HbyA
Definition: pEqn.H:7
Calculates and prints the continuity errors.