pEqn.H
Go to the documentation of this file.
1volScalarField rAU(1.0/UEqn.A());
2volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
3surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA));
4
5if (pimple.ddtCorr())
6{
7 phiHbyA += MRF.zeroFilter(fvc::interpolate(rAU)*fvc::ddtCorr(U, phi, Uf));
8}
9
10
11MRF.makeRelative(phiHbyA);
12
13if (p.needReference())
14{
15 fvc::makeRelative(phiHbyA, U);
17 fvc::makeAbsolute(phiHbyA, U);
18}
19
20tmp<volScalarField> rAtU(rAU);
21
22if (pimple.consistent())
23{
24 rAtU = 1.0/max(1.0/rAU - UEqn.H1(), 0.1/rAU);
25 phiHbyA +=
26 fvc::interpolate(rAtU() - rAU)*fvc::snGrad(p)*mesh.magSf();
27 HbyA -= (rAU - rAtU())*fvc::grad(p);
28}
29
30if (pimple.nCorrPISO() <= 1)
31{
32 tUEqn.clear();
33}
34
35// Update the pressure BCs to ensure flux consistency
37
38// Non-orthogonal pressure corrector loop
39while (pimple.correctNonOrthogonal())
40{
41 fvScalarMatrix pEqn
42 (
43 fvm::laplacian(rAtU(), p) == fvc::div(phiHbyA)
44 );
45
46 pEqn.setReference(pRefCell, pRefValue);
47
48 pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
49
50 if (pimple.finalNonOrthogonalIter())
51 {
52 phi = phiHbyA - pEqn.flux();
53 }
54}
55
56#include "continuityErrs.H"
57
58// Explicitly relax pressure for momentum corrector
59p.relax();
60
61U = HbyA - rAtU*fvc::grad(p);
62U.correctBoundaryConditions();
63fvOptions.correct(U);
64
65// Correct Uf if the mesh is moving
66fvc::correctUf(Uf, U, phi);
67
68// Make the fluxes relative to the mesh motion
69fvc::makeRelative(phi, U);
Y[inertIndex] max(0.0)
fv::options & fvOptions
surfaceScalarField & phi
const scalar pRefValue
const label pRefCell
IOMRFZoneList & MRF
pimpleControl & pimple
U
Definition: pEqn.H:72
volScalarField & p
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
autoPtr< surfaceVectorField > Uf
adjustPhi(phiHbyA, U, p_rgh)
tmp< volScalarField > rAtU(rAU)
tmp< volScalarField > rAU
Definition: initCorrectPhi.H:1