Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / applications / solvers / multiphase / interFoam / MRFInterFoam / pEqn.H
blobd281e177c8e02dfe6a112f39a2acf44d13921678
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     );
12     mrfZones.relativeFlux(phiU);
14     adjustPhi(phiU, U, p_rgh);
16     phi = phiU +
17     (
18         fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
19       - ghf*fvc::snGrad(rho)
20     )*rAUf*mesh.magSf();
22     for(int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
23     {
24         fvScalarMatrix p_rghEqn
25         (
26             fvm::laplacian(rAUf, p_rgh) == fvc::div(phi)
27         );
29         p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
31         p_rghEqn.solve
32         (
33             mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth)))
34         );
36         if (nonOrth == pimple.nNonOrthCorr())
37         {
38             phi -= p_rghEqn.flux();
39         }
40     }
42     U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
43     U.correctBoundaryConditions();
45     #include "continuityErrs.H"
47     p == p_rgh + rho*gh;
49     if (p_rgh.needReference())
50     {
51         p += dimensionedScalar
52         (
53             "p",
54             p.dimensions(),
55             pRefValue - getRefCellValue(p, pRefCell)
56         );
57         p_rgh = p - rho*gh;
58     }