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

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

Henry's avatar
Henry committed
9
10
11
12
13
surfaceScalarField phiHbyA
(
    "phiHbyA",
    (fvc::interpolate(HbyA) & mesh.Sf())
);
14

15
16
if (ddtPhiCorr)
{
Henry's avatar
Henry committed
17
    phiHbyA += fvc::ddtPhiCorr(rAU, U, phi);
18
19
}

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

27
while (pimple.correctNonOrthogonal())
28
29
30
{
    fvScalarMatrix pEqn
    (
Henry's avatar
Henry committed
31
        fvm::laplacian(rAU, p) == fvc::div(phiHbyA)
32
33
34
35
    );

    pEqn.setReference(pRefCell, pRefValue);

36
    pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
37

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

#include "continuityErrs.H"

46
// Explicitly relax pressure for momentum corrector
47
48
49
50
51
p.relax();

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

Henry's avatar
Henry committed
52
U = HbyA - rAU*fvc::grad(p);
53
U.correctBoundaryConditions();
54
fvOptions.correct(U);