pEqn.H
Go to the documentation of this file.
1{
2 volScalarField rAU("rAU", 1.0/UEqn.A());
3 surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
4 volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
5
6 surfaceScalarField phig(-rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf());
7
8 surfaceScalarField phiHbyA
9 (
10 "phiHbyA",
11 fvc::flux(HbyA)
12 + MRF.zeroFilter(rAUf*fvc::ddtCorr(U, phi))
13 + phig
14 );
15
16 MRF.makeRelative(phiHbyA);
17
18 // Update the pressure BCs to ensure flux consistency
20
21 while (pimple.correctNonOrthogonal())
22 {
23 fvScalarMatrix p_rghEqn
24 (
25 fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
26 );
27
28 p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
29
30 p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
31
32 if (pimple.finalNonOrthogonalIter())
33 {
34 // Calculate the conservative fluxes
35 phi = phiHbyA - p_rghEqn.flux();
36
37 // Explicitly relax pressure for momentum corrector
38 p_rgh.relax();
39
40 // Correct the momentum source with the pressure gradient flux
41 // calculated from the relaxed pressure
42 U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
43 U.correctBoundaryConditions();
44 fvOptions.correct(U);
45
46 // Correct Uf if the mesh is moving
47 fvc::correctUf(Uf, U, phi);
48
49 // Make the fluxes relative to the mesh motion
50 fvc::makeRelative(phi, U);
51 }
52 }
53
54 #include "continuityErrs.H"
55
57
58 if (p_rgh.needReference())
59 {
60 p += dimensionedScalar
61 (
62 "p",
63 p.dimensions(),
64 pRefValue - getRefCellValue(p, pRefCell)
65 );
66 p_rgh = p - rhok*gh;
67 }
68}
volScalarField & p_rgh
fv::options & fvOptions
surfaceScalarField & phi
const scalar pRefValue
const surfaceScalarField & ghf
const label pRefCell
IOMRFZoneList & MRF
const volScalarField & gh
pimpleControl & pimple
U
Definition: pEqn.H:72
volScalarField & p
surfaceScalarField phig("phig", -rhorAUf *ghf *fvc::snGrad(rho) *mesh.magSf())
fvVectorMatrix & UEqn
Definition: UEqn.H:13
phiHbyA
Definition: pcEqn.H:73
HbyA
Definition: pcEqn.H:74
dynamicFvMesh & mesh
autoPtr< surfaceVectorField > Uf
rhok
Definition: TEqn.H:27
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU))
tmp< volScalarField > rAU
Definition: initCorrectPhi.H:1
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:82