pEqn.H 994 Bytes
Newer Older
1
volScalarField rAU(1.0/UEqn().A());
Henry's avatar
Henry committed
2
surfaceScalarField rAUf("Dp", fvc::interpolate(rAU));
3

Henry's avatar
Henry committed
4
volVectorField HbyA("HbyA", U);
andy's avatar
andy committed
5
HbyA = rAU*UEqn().H();
6
7
8
9
10
11

if (pimple.nCorrPISO() <= 1)
{
    UEqn.clear();
}

Henry's avatar
Henry committed
12
13
14
15
16
17
surfaceScalarField phiHbyA
(
    "phiHbyA",
    (fvc::interpolate(HbyA) & mesh.Sf())
  + fvc::ddtPhiCorr(rAU, U, phi)
);
18

Henry's avatar
Henry committed
19
adjustPhi(phiHbyA, U, p_gh);
20

andy's avatar
andy committed
21
fvOptions.relativeFlux(phiHbyA);
22
23
24

// Non-orthogonal pressure corrector loop
while (pimple.correctNonOrthogonal())
Henry's avatar
Henry committed
25
{
26
27
    fvScalarMatrix p_ghEqn
    (
Henry's avatar
Henry committed
28
        fvm::laplacian(rAUf, p_gh) == fvc::div(phiHbyA)
29
30
31
32
33
34
35
36
    );

    p_ghEqn.setReference(p_ghRefCell, p_ghRefValue);

    p_ghEqn.solve(mesh.solver(p_gh.select(pimple.finalInnerIter())));

    if (pimple.finalNonOrthogonalIter())
    {
Henry's avatar
Henry committed
37
        phi = phiHbyA - p_ghEqn.flux();
38
39
40
41
42
43
44
45
    }
}

#include "continuityErrs.H"

// Explicitly relax pressure for momentum corrector
p_gh.relax();

46
p = p_gh + (g & mesh.C());
47

Henry's avatar
Henry committed
48
U = HbyA - rAU*fvc::grad(p_gh);
49
U.correctBoundaryConditions();
50
fvOptions.correct(U);