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 tUEqn.clear();
7
8 surfaceScalarField phig(-rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf());
9
10 surfaceScalarField phiHbyA
11 (
12 "phiHbyA",
13 fvc::flux(HbyA)
14 );
15
16 MRF.makeRelative(phiHbyA);
17
19
21
22 // Update the pressure BCs to ensure flux consistency
24
25 while (simple.correctNonOrthogonal())
26 {
27 fvScalarMatrix p_rghEqn
28 (
29 fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
30 );
31
32 p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
33
34 p_rghEqn.solve();
35
36 if (simple.finalNonOrthogonalIter())
37 {
38 // Calculate the conservative fluxes
39 phi = phiHbyA - p_rghEqn.flux();
40
41 // Explicitly relax pressure for momentum corrector
42 p_rgh.relax();
43
44 // Correct the momentum source with the pressure gradient flux
45 // calculated from the relaxed pressure
46 U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
47 U.correctBoundaryConditions();
48 fvOptions.correct(U);
49 }
50 }
51
52 #include "continuityErrs.H"
53
55
56 if (p_rgh.needReference())
57 {
58 p += dimensionedScalar
59 (
60 "p",
61 p.dimensions(),
62 pRefValue - getRefCellValue(p, pRefCell)
63 );
64 p_rgh = p - rhok*gh;
65 }
66}
volScalarField & p_rgh
fv::options & fvOptions
surfaceScalarField & phi
const scalar pRefValue
const surfaceScalarField & ghf
const label pRefCell
IOMRFZoneList & MRF
const volScalarField & gh
U
Definition: pEqn.H:72
volScalarField & p
surfaceScalarField phig("phig", -rhorAUf *ghf *fvc::snGrad(rho) *mesh.magSf())
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
fvVectorMatrix & UEqn
Definition: UEqn.H:13
phiHbyA
Definition: pcEqn.H:73
HbyA
Definition: pcEqn.H:74
dynamicFvMesh & mesh
rhok
Definition: TEqn.H:27
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU))
adjustPhi(phiHbyA, U, p_rgh)
tmp< volScalarField > rAU
Definition: initCorrectPhi.H:1
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:82
const dictionary & simple