pEqn.H
Go to the documentation of this file.
1 volScalarField rAU(1.0/UEqn.A());
4 (
5  "phiHbyA",
7  + MRF.zeroFilter(fvc::interpolate(rAU)*fvc::ddtCorr(U, phi, Uf))
8 );
9 
10 MRF.makeRelative(phiHbyA);
11 
12 if (p.needReference())
13 {
15  adjustPhi(phiHbyA, U, p);
17 }
18 
19 tmp<volScalarField> rAtU(rAU);
20 
21 if (pimple.consistent())
22 {
23  rAtU = 1.0/max(1.0/rAU - UEqn.H1(), 0.1/rAU);
24  phiHbyA +=
25  fvc::interpolate(rAtU() - rAU)*fvc::snGrad(p)*mesh.magSf();
26  HbyA -= (rAU - rAtU())*fvc::grad(p);
27 }
28 
29 if (pimple.nCorrPiso() <= 1)
30 {
31  tUEqn.clear();
32 }
33 
34 // Update the pressure BCs to ensure flux consistency
36 
37 // Non-orthogonal pressure corrector loop
38 while (pimple.correctNonOrthogonal())
39 {
40  fvScalarMatrix pEqn
41  (
43  );
44 
45  pEqn.setReference
46  (
47  pressureReference.refCell(),
48  pressureReference.refValue()
49  );
50 
51  pEqn.solve();
52 
53  if (pimple.finalNonOrthogonalIter())
54  {
55  phi = phiHbyA - pEqn.flux();
56  }
57 }
58 
59 #include "continuityErrs.H"
60 
61 // Explicitly relax pressure for momentum corrector
62 p.relax();
63 
64 U = HbyA - rAtU*fvc::grad(p);
65 U.correctBoundaryConditions();
67 
68 // Correct Uf if the mesh is moving
70 
71 // Make the fluxes relative to the mesh motion
tmp< volScalarField > rAtU(pimple.consistent() ? volScalarField::New("rAtU", 1.0/(1.0/rAU - UEqn.H1())) :tmp< volScalarField >(nullptr))
rAU
Definition: pEqn.H:1
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
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
pimpleNoLoopControl & pimple
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
tmp< GeometricField< typename flux< Type >::type, fvsPatchField, surfaceMesh > > ddtCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const GeometricField< Type, fvsPatchField, surfaceMesh > &Uf)
Definition: fvcDdt.C:170
MRF makeRelative(fvc::interpolate(rho), phiHbyA)
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:59
fvMesh & mesh
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
p
Definition: pEqn.H:125
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
autoPtr< surfaceVectorField > Uf
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.
phi
Definition: pEqn.H:98
adjustPhi(phiHbyA, Urel, p)
volVectorField & HbyA
Definition: pEqn.H:13
void makeAbsolute(surfaceScalarField &phi, const volVectorField &U)
Make the given flux absolute.
Definition: fvcMeshPhi.C:128
void correctUf(autoPtr< surfaceVectorField > &Uf, const volVectorField &U, const surfaceScalarField &phi, const MRFType &MRF)
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
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:45
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF)
fvVectorMatrix & UEqn
Definition: UEqn.H:13