pEqn.H
Go to the documentation of this file.
1 {
2  const volScalarField& psi = thermo.psi();
3 
4  tmp<volVectorField> tHbyA;
6  {
7  tHbyA = constrainHbyA(trTU()&UEqn.H(), U, p);
8  }
9  else
10  {
11  tHbyA = constrainHbyA(trAU()*UEqn.H(), U, p);
12  }
14 
15  tUEqn.clear();
16 
17  bool closedVolume = false;
18 
20  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
21 
23 
24  while (simple.correctNonOrthogonal())
25  {
26  tmp<fvScalarMatrix> tpEqn;
27 
29  {
30  tpEqn =
31  (
33  + fvOptions(psi, p, rho.name())
34  ==
36  );
37  }
38  else
39  {
40  tpEqn =
41  (
43  + fvOptions(psi, p, rho.name())
44  ==
46  );
47  }
48 
49  fvScalarMatrix& pEqn = tpEqn.ref();
50 
51  pEqn.setReference
52  (
53  pressureControl.refCell(),
54  pressureControl.refValue()
55  );
56 
57  pEqn.solve();
58 
59  if (simple.finalNonOrthogonalIter())
60  {
61  phi = phiHbyA - pEqn.flux();
62  }
63  }
64 
66 
67  // Explicitly relax pressure for momentum corrector
68  p.relax();
69 
71  {
72  U = HbyA - (trTU() & fvc::grad(p));
73  }
74  else
75  {
76  U = HbyA - trAU()*fvc::grad(p);
77  }
78 
79  U.correctBoundaryConditions();
80  fvOptions.correct(U);
81 
82  pressureControl.limit(p);
83 
84  // For closed-volume cases adjust the pressure and density levels
85  // to obey overall mass continuity
87  {
90  }
91 
92  rho = thermo.rho();
93  rho.relax();
94 }
Foam::constrainHbyA
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:35
trTU
tmp< volTensorField > trTU
Definition: UEqn.H:22
simple
const dictionary & simple
Definition: readFluidMultiRegionSIMPLEControls.H:1
Foam::fvc::flux
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
pressureImplicitPorosity
bool pressureImplicitPorosity(false)
Foam::fvc::domainIntegrate
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition: fvcVolumeIntegrate.C:88
phiHbyA
phiHbyA
Definition: pEqn.H:20
Foam::fac::grad
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facGrad.C:56
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
continuityErrs.H
Calculates and prints the continuity errors.
Foam::fac::div
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:50
MRF
IOMRFZoneList & MRF
Definition: setRegionFluidFields.H:22
HbyA
HbyA
Definition: pEqn.H:4
tUEqn
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:44
fvOptions
fv::options & fvOptions
Definition: setRegionFluidFields.H:23
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
p
p
Definition: pEqn.H:50
tHbyA
tmp< volVectorField > tHbyA
Definition: pEqn.H:1
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:62
U
U
Definition: pEqn.H:72
trAU
tmp< volScalarField > trAU
Definition: UEqn.H:21
pressureControl
const pressureControl & pressureControl
Definition: setRegionFluidFields.H:69
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
phi
phi
Definition: pEqn.H:18
initialMass
dimensionedScalar initialMass
Definition: createFields.H:57
closedVolume
bool closedVolume
Definition: pEqn.H:10
UEqn
fvVectorMatrix & UEqn
Definition: UEqn.H:13
Foam::fac::laplacian
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:47
psi
const volScalarField & psi
Definition: createFieldRefs.H:1
adjustPhi
adjustPhi(phiHbyA, U, p_rgh)
rho
rho
Definition: pEqn.H:1
interpolate
mesh interpolate(rAU)