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

4
if (pimple.nCorrPISO() <= 1)
henry's avatar
henry committed
5
6
7
8
{
    UEqn.clear();
}

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

Henry's avatar
Henry committed
16
adjustPhi(phiHbyA, U, p);
henry's avatar
henry committed
17

18
sources.relativeFlux(phiHbyA);
19

henry's avatar
henry committed
20
// Non-orthogonal pressure corrector loop
21
while (pimple.correctNonOrthogonal())
henry's avatar
henry committed
22
23
24
25
{
    // Pressure corrector
    fvScalarMatrix pEqn
    (
Henry's avatar
Henry committed
26
        fvm::laplacian(rAU, p) == fvc::div(phiHbyA)
henry's avatar
henry committed
27
28
29
30
    );

    pEqn.setReference(pRefCell, pRefValue);

31
    pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
henry's avatar
henry committed
32

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

#include "continuityErrs.H"

41
42
// Explicitly relax pressure for momentum corrector
p.relax();
henry's avatar
henry committed
43

Henry's avatar
Henry committed
44
U = HbyA - rAU*fvc::grad(p);
henry's avatar
henry committed
45
U.correctBoundaryConditions();
46
sources.correct(U);