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  + fvOptions(psi, p, rho.name())
38  ==
40  );
41  }
42  else
43  {
44  tpEqn =
45  (
47  + fvOptions(psi, p, rho.name())
48  ==
50  );
51  }
52 
53  fvScalarMatrix& pEqn = tpEqn.ref();
54 
55  pEqn.setReference
56  (
57  pressureControl.refCell(),
58  pressureControl.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();
84  fvOptions.correct(U);
85 
86  pressureControl.limit(p);
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 }
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
fv::options & fvOptions
rho
Definition: pEqn.H:1
dimensionedScalar initialMass
Definition: createFields.H:69
p
Definition: pEqn.H:50
IOMRFZoneList & MRF
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)
rhoReactionThermo & thermo
Definition: createFields.H:28
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:58
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
phi
Definition: pEqn.H:104
tmp< volVectorField > tHbyA
Definition: pEqn.H:1
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
pressureControl & pressureControl
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)==fvOptions(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.
Internal & ref()
Return a reference to the dimensioned internal field.
phiHbyA
Definition: pEqn.H:32
adjustPhi(phiHbyA, Urel, p)
U
Definition: pEqn.H:72
fvVectorMatrix & UEqn
Definition: UEqn.H:11
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
simpleControl simple(mesh)