Transferred copyright to the OpenFOAM Foundation
[OpenFOAM-2.0.x.git] / applications / solvers / multiphase / interFoam / pEqn.H
blobd75a76766ab21c56a0c8a1e3fbc173a72054297f
2     volScalarField rAU(1.0/UEqn.A());
3     surfaceScalarField rAUf(fvc::interpolate(rAU));
5     U = rAU*UEqn.H();
6     surfaceScalarField phiU
7     (
8         "phiU",
9         (fvc::interpolate(U) & mesh.Sf())
10       + fvc::ddtPhiCorr(rAU, rho, U, phi)
11     );
13     adjustPhi(phiU, U, p_rgh);
15     phi = phiU +
16     (
17         fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
18       - ghf*fvc::snGrad(rho)
19     )*rAUf*mesh.magSf();
21     for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
22     {
23         fvScalarMatrix p_rghEqn
24         (
25             fvm::laplacian(rAUf, p_rgh) == fvc::div(phi)
26         );
28         p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
30         p_rghEqn.solve
31         (
32             mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth)))
33         );
35         if (nonOrth == pimple.nNonOrthCorr())
36         {
37             phi -= p_rghEqn.flux();
38         }
39     }
41     U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
42     U.correctBoundaryConditions();
44     #include "continuityErrs.H"
46     p == p_rgh + rho*gh;
48     if (p_rgh.needReference())
49     {
50         p += dimensionedScalar
51         (
52             "p",
53             p.dimensions(),
54             pRefValue - getRefCellValue(p, pRefCell)
55         );
56         p_rgh = p - rho*gh;
57     }