Transferred copyright to the OpenFOAM Foundation
[OpenFOAM-2.0.x.git] / applications / solvers / multiphase / twoLiquidMixingFoam / pEqn.H
blob01b6442e9dff45ec0938ccd2fd9d714aafa11d7d
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 - ghf*fvc::snGrad(rho)*rAUf*mesh.magSf();
17     for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
18     {
19         fvScalarMatrix p_rghEqn
20         (
21             fvm::laplacian(rAUf, p_rgh) == fvc::div(phi)
22         );
24         p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
26         p_rghEqn.solve
27         (
28             mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth)))
29         );
31         if (nonOrth == pimple.nNonOrthCorr())
32         {
33             phi -= p_rghEqn.flux();
34         }
35     }
37     U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
38     U.correctBoundaryConditions();
40     #include "continuityErrs.H"
42     p == p_rgh + rho*gh;
44     if (p_rgh.needReference())
45     {
46         p += dimensionedScalar
47         (
48             "p",
49             p.dimensions(),
50             pRefValue - getRefCellValue(p, pRefCell)
51         );
52         p_rgh = p - rho*gh;
53     }