pEqn.H
Go to the documentation of this file.
1 volScalarField rAU(1.0/UEqn.A());
4 
5 if (pimple.ddtCorr())
6 {
7  phiHbyA += MRF.zeroFilter(fvc::interpolate(rAU)*fvc::ddtCorr(U, phi, Uf));
8 }
9 else
10 {
11  phiHbyA += MRF.zeroFilter(fvc::interpolate(rAU));
12 }
13 
14 MRF.makeRelative(phiHbyA);
15 
16 if (p.needReference())
17 {
19  adjustPhi(phiHbyA, U, p);
21 }
22 
23 tmp<volScalarField> rAtU(rAU);
24 
25 if (pimple.consistent())
26 {
27  rAtU = 1.0/max(1.0/rAU - UEqn.H1(), 0.1/rAU);
28  phiHbyA +=
29  fvc::interpolate(rAtU() - rAU)*fvc::snGrad(p)*mesh.magSf();
30  HbyA -= (rAU - rAtU())*fvc::grad(p);
31 }
32 
33 if (pimple.nCorrPISO() <= 1)
34 {
35  tUEqn.clear();
36 }
37 
38 // Update the pressure BCs to ensure flux consistency
40 
41 // Non-orthogonal pressure corrector loop
42 while (pimple.correctNonOrthogonal())
43 {
44  fvScalarMatrix pEqn
45  (
47  );
48 
49  pEqn.setReference(pRefCell, pRefValue);
50 
51  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
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 
65 U.correctBoundaryConditions();
66 fvOptions.correct(U);
67 
68 // Correct Uf if the mesh is moving
70 
71 // Make the fluxes relative to the mesh motion
Foam::constrainHbyA
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:35
Foam::fvc::snGrad
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:47
Foam::fvc::flux
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
phiHbyA
phiHbyA
Definition: pEqn.H:20
Foam::fac::grad
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facGrad.C:56
rAtU
tmp< volScalarField > rAtU(rAU)
Foam::fac::div
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:50
MRF
IOMRFZoneList & MRF
Definition: setRegionFluidFields.H:22
pimple
pimpleControl & pimple
Definition: setRegionFluidFields.H:56
HbyA
HbyA
Definition: pEqn.H:4
tUEqn
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:44
fvOptions
fv::options & fvOptions
Definition: setRegionFluidFields.H:23
Foam::fvc::correctUf
void correctUf(autoPtr< surfaceVectorField > &Uf, const volVectorField &U, const surfaceScalarField &phi)
Definition: fvcMeshPhi.C:225
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
makeRelative
MRF makeRelative(fvc::interpolate(rho), phiHbyA)
ddtCorr
ddtCorr
Definition: readControls.H:9
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
p
p
Definition: pEqn.H:50
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
rAU
volScalarField rAU(1.0/UEqn.A())
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:62
U
U
Definition: pEqn.H:72
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
phi
phi
Definition: pEqn.H:18
UEqn
fvVectorMatrix & UEqn
Definition: UEqn.H:13
Uf
Uf
Definition: pEqn.H:107
Foam::fac::laplacian
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:47
Foam::fvc::makeAbsolute
void makeAbsolute(surfaceScalarField &phi, const volVectorField &U)
Make the given flux absolute.
Definition: fvcMeshPhi.C:116
adjustPhi
adjustPhi(phiHbyA, U, p_rgh)
interpolate
mesh interpolate(rAU)
pRefCell
const label pRefCell
Definition: setRegionFluidFields.H:34
constrainPressure
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)
pRefValue
const scalar pRefValue
Definition: setRegionFluidFields.H:35