pEqn.H 944 Bytes
Newer Older
Henry's avatar
Henry committed
1
volVectorField HbyA("HbyA", U);
andy's avatar
andy committed
2
HbyA = rAU*UEqn().H();
3

4
if (pimple.nCorrPISO() <= 1)
5
6
7
8
{
    UEqn.clear();
}

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

if (p.needReference())
{
Henry's avatar
Henry committed
18
19
20
    fvc::makeRelative(phiHbyA, U);
    adjustPhi(phiHbyA, U, p);
    fvc::makeAbsolute(phiHbyA, U);
21
22
}

23
while (pimple.correctNonOrthogonal())
24
25
26
{
    fvScalarMatrix pEqn
    (
Henry's avatar
Henry committed
27
        fvm::laplacian(rAU, p) == fvc::div(phiHbyA)
28
29
30
31
    );

    pEqn.setReference(pRefCell, pRefValue);

32
    pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
33

34
    if (pimple.finalNonOrthogonalIter())
35
    {
Henry's avatar
Henry committed
36
        phi = phiHbyA - pEqn.flux();
37
38
39
40
41
    }
}

#include "continuityErrs.H"

42
// Explicitly relax pressure for momentum corrector
43
44
45
46
47
p.relax();

// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);

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