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  }
13  volVectorField& HbyA = tHbyA.ref();
14 
15  tUEqn.clear();
16 
17  bool closedVolume = false;
18 
19  surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA));
20  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
21 
22  closedVolume = adjustPhi(phiHbyA, U, p);
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
86  if (closedVolume)
87  {
90  }
91 
92  rho = thermo.rho();
93  rho.relax();
94 }
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
U
Definition: pEqn.H:83
dimensionedScalar initialMass
Definition: createFields.H:57
p
Definition: pEqn.H:50
phiHbyA
Definition: pEqn.H:20
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
Calculates and prints the continuity errors.
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
tmp< volTensorField > trTU
Definition: UEqn.H:22
fv::options & fvOptions
tmp< volVectorField > tHbyA
Definition: pEqn.H:1
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
psiReactionThermo & thermo
Definition: createFields.H:31
IOMRFZoneList & MRF
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:33
adjustPhi(phiHbyA, U, p_rgh)
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.
Internal & ref()
Return a reference to the dimensioned internal field.
const dictionary & simple
fvVectorMatrix & UEqn
Definition: UEqn.H:13
phi
Definition: pEqn.H:18
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
Definition: fvcFlux.C:32
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
rho
Definition: pEqn.H:1
Switch pressureImplicitPorosity(false)
tmp< volScalarField > trAU
Definition: UEqn.H:21