pEqn.H 881 Bytes
Newer Older
Henry's avatar
Henry committed
1
volScalarField rAUrel(1.0/UrelEqn().A());
Henry's avatar
Henry committed
2
volVectorField HbyA("HbyA", Urel);
andy's avatar
andy committed
3
HbyA = rAUrel*UrelEqn().H();
4

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

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

Henry's avatar
Henry committed
17
adjustPhi(phiHbyA, Urel, p);
18
19

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

    pEqn.setReference(pRefCell, pRefValue);

30
    pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
31

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

#include "continuityErrs.H"

p.relax();

// Momentum corrector
Henry's avatar
Henry committed
43
Urel = HbyA - rAUrel*fvc::grad(p);
44
Urel.correctBoundaryConditions();
45
fvOptions.correct(Urel);