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 
20  (
21  "phiHbyA",
23  );
24  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
25 
26  closedVolume = adjustPhi(phiHbyA, U, p);
27 
28  while (simple.correctNonOrthogonal())
29  {
30  tmp<fvScalarMatrix> tpEqn;
31 
33  {
34  tpEqn =
35  (
37  + fvModels.source(psi, p, rho.name())
38  ==
40  );
41  }
42  else
43  {
44  tpEqn =
45  (
47  + fvModels.source(psi, p, rho.name())
48  ==
50  );
51  }
52 
53  fvScalarMatrix& pEqn = tpEqn.ref();
54 
55  pEqn.setReference
56  (
57  pressureReference.refCell(),
58  pressureReference.refValue()
59  );
60 
61  pEqn.solve();
62 
63  if (simple.finalNonOrthogonalIter())
64  {
65  phi = phiHbyA - pEqn.flux();
66  }
67  }
68 
70 
71  // Explicitly relax pressure for momentum corrector
72  p.relax();
73 
75  {
76  U = HbyA - (trTU() & fvc::grad(p));
77  }
78  else
79  {
80  U = HbyA - trAU()*fvc::grad(p);
81  }
82 
83  U.correctBoundaryConditions();
85 
87 
88  // For closed-volume cases adjust the pressure and density levels
89  // to obey overall mass continuity
90  if (closedVolume)
91  {
94  p.correctBoundaryConditions();
95  }
96 
97  rho = thermo.rho();
98  rho.relax();
99 }
pressureReference & pressureReference
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
fluidReactionThermo & thermo
Definition: createFields.H:28
dimensionedScalar initialMass
Definition: createFields.H:68
U
Definition: pEqn.H:72
mixture MRF().makeRelative(phiHbyA)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
Calculates and prints the continuity errors.
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:59
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
p
Definition: pEqn.H:125
tmp< volVectorField > tHbyA
Definition: pEqn.H:1
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:58
phiHbyA
Definition: pEqn.H:30
Foam::fvConstraints & fvConstraints
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:34
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevTau(U)==fvModels.source(rho, U))
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.
bool constrain(fvMatrix< Type > &eqn) const
Apply constraints to an equation.
Internal & ref()
Return a reference to the dimensioned internal field.
Foam::fvModels & fvModels
phi
Definition: pEqn.H:98
adjustPhi(phiHbyA, Urel, p)
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
Switch pressureImplicitPorosity(false)
tmp< volScalarField > trAU
Definition: UEqn.H:21
rho
Definition: pEqn.H:1
simpleControl simple(mesh)
fvVectorMatrix & UEqn
Definition: UEqn.H:13