pEqn.H 1.12 KB
Newer Older
1
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
2

Henry's avatar
Henry committed
3
volVectorField HbyA("HbyA", U);
andy's avatar
andy committed
4
HbyA = rAU*UEqn().H();
5

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

Henry's avatar
Henry committed
11
12
13
14
surfaceScalarField phiHbyA
(
    "phiHbyA",
    (fvc::interpolate(HbyA) & mesh.Sf())
15
  + rAUf*fvc::ddtCorr(U, Uf)
Henry's avatar
Henry committed
16
);
17
18
19

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

25
while (pimple.correctNonOrthogonal())
26
27
28
{
    fvScalarMatrix pEqn
    (
29
        fvm::laplacian(rAUf, p) == fvc::div(phiHbyA)
30
31
32
33
    );

    pEqn.setReference(pRefCell, pRefValue);

34
    pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
35

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

#include "continuityErrs.H"

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

Henry's avatar
Henry committed
47
U = HbyA - rAU*fvc::grad(p);
48
U.correctBoundaryConditions();
49
fvOptions.correct(U);
50
51
52
53
54
55
56
57
58

{
    Uf = fvc::interpolate(U);
    surfaceVectorField n(mesh.Sf()/mesh.magSf());
    Uf += mesh.Sf()*(phi - (mesh.Sf() & Uf))/sqr(mesh.magSf());
}

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