pEqn.H
Go to the documentation of this file.
1 tmp<volVectorField> tHbyA;
3 {
4  tHbyA = constrainHbyA(trTU()&UEqn.H(), U, p);
5 }
6 else
7 {
8  tHbyA = constrainHbyA(trAU()*UEqn.H(), U, p);
9 }
11 
12 tUEqn.clear();
14 
15 MRF.makeRelative(phiHbyA);
16 
18 
19 while (simple.correctNonOrthogonal())
20 {
21  tmp<fvScalarMatrix> tpEqn;
22 
24  {
25  tpEqn = (fvm::laplacian(trTU(), p) == fvc::div(phiHbyA));
26  }
27  else
28  {
29  tpEqn = (fvm::laplacian(trAU(), p) == fvc::div(phiHbyA));
30  }
31 
32  fvScalarMatrix pEqn = tpEqn.ref();
33 
34  pEqn.setReference
35  (
36  pressureReference.refCell(),
37  pressureReference.refValue()
38  );
39 
40  pEqn.solve();
41 
42  if (simple.finalNonOrthogonalIter())
43  {
44  phi = phiHbyA - pEqn.flux();
45  }
46 }
47 
48 #include "continuityErrs.H"
49 
50 // Explicitly relax pressure for momentum corrector
51 p.relax();
52 
54 {
55  U = HbyA - (trTU()&fvc::grad(p));
56 }
57 else
58 {
59  U = HbyA - (trAU()*fvc::grad(p));
60 }
61 
62 U.correctBoundaryConditions();
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))
IOMRFZoneList MRF(mesh)
simpleControl simple(mesh)
Switch pressureImplicitPorosity(false)
U
Definition: pEqn.H:72
tmp< volVectorField > tHbyA
Definition: pEqn.H:1
volVectorField & HbyA
Definition: pEqn.H:13
surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(rho) *fvc::flux(HbyA))
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.
tmp< VolField< Type > > laplacian(const VolField< Type > &vf, const word &name)
Definition: fvcLaplacian.C:45
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
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:34
volScalarField & p