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  (
21  "phiHbyA",
23  );
24  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
25 
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
91  {
94  p.correctBoundaryConditions();
95  }
96 
97  rho = thermo.rho();
98  rho.relax();
99 }
bool constrain(fvMatrix< Type > &eqn) const
Apply constraints to an equation.
tmp< volTensorField > trTU
Definition: UEqn.H:20
tmp< fvVectorMatrix > tUEqn(fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevTau(U)==fvModels.source(rho, U))
tmp< volScalarField > trAU
Definition: UEqn.H:19
fvVectorMatrix & UEqn
Definition: UEqn.H:11
Calculates and prints the continuity errors.
Foam::fvConstraints & fvConstraints(Foam::fvConstraints::New(mesh))
Foam::fvModels & fvModels(Foam::fvModels::New(mesh))
IOMRFZoneList MRF(mesh)
simpleControl simple(mesh)
Switch pressureImplicitPorosity(false)
const volScalarField & psi
U
Definition: pEqn.H:72
rho
Definition: pEqn.H:1
dimensionedScalar initialMass
Definition: createFields.H:68
tmp< volVectorField > tHbyA
Definition: pEqn.H:1
volVectorField & HbyA
Definition: pEqn.H:13
surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(rho) *fvc::flux(HbyA))
bool closedVolume
Definition: pEqn.H:17
adjustPhi(phiHbyA, U, p)
tmp< SurfaceField< typename innerProduct< vector, Type >::type > > flux(const VolField< Type > &vf)
Return the face-flux field obtained from the given volVectorField.
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
tmp< VolField< Type > > laplacian(const VolField< Type > &vf, const word &name)
Definition: fvcLaplacian.C:45
dimensioned< Type > domainIntegrate(const VolField< Type > &vf)
tmp< VolField< typename outerProduct< vector, Type >::type > > grad(const SurfaceField< Type > &ssf)
Definition: fvcGrad.C:46
tmp< VolField< Type > > div(const SurfaceField< Type > &ssf)
Definition: fvcDiv.C:47
VolField< vector > volVectorField
Definition: volFieldsFwd.H:62
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
SurfaceField< scalar > surfaceScalarField
VolField< scalar > volScalarField
Definition: volFieldsFwd.H:61
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:34
volScalarField & p
fluidMulticomponentThermo & thermo
Definition: createFields.H:31