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 }
10 volVectorField& HbyA = tHbyA.ref();
11 
12 tUEqn.clear();
13 surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA));
14 
15 MRF.makeRelative(phiHbyA);
16 
17 adjustPhi(phiHbyA, U, p);
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();
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
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
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
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))
bool constrain(fvMatrix< Type > &eqn) const
Apply constraints to an equation.
Internal & ref()
Return a reference to the dimensioned internal field.
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
simpleControl simple(mesh)
fvVectorMatrix & UEqn
Definition: UEqn.H:13