twoLiquidMixingFoam, settlingFoam: updated to solve for p - rho*(g.h).
[OpenFOAM-1.6.x.git] / applications / solvers / multiphase / settlingFoam / p_rghEqn.H
blob66f3a42b9b5024a424129c361b3c73ecfcbad32d
1 volScalarField rUA = 1.0/UEqn.A();
3 surfaceScalarField rUAf
5     "(rho*(1|A(U)))",
6     fvc::interpolate(rho)*fvc::interpolate(rUA)
7 );
9 U = rUA*UEqn.H();
10 phi =
11     fvc::interpolate(rho)
12    *(
13        (fvc::interpolate(U) & mesh.Sf())
14      + fvc::ddtPhiCorr(rUA, rho, U, phi)
15     );
17 surfaceScalarField phiU("phiU", phi);
18 phi -= ghf*fvc::snGrad(rho)*rUAf*mesh.magSf();
20 for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
22     fvScalarMatrix p_rghEqn
23     (
24         fvm::laplacian(rUAf, p_rgh) == fvc::ddt(rho) + fvc::div(phi)
25     );
27     p_rghEqn.setReference(p_rghRefCell, p_rghRefValue);
28     p_rghEqn.solve();
30     if (nonOrth == nNonOrthCorr)
31     {
32         phi -= p_rghEqn.flux();
33     }
36 p == p_rgh + rho*gh;
38 if (p_rgh.needReference())
40     p += dimensionedScalar
41     (
42         "p",
43         p.dimensions(),
44         pRefValue - getRefCellValue(p, p_rghRefCell)
45     );
48 #include "rhoEqn.H"
49 #include "compressibleContinuityErrs.H"
51 U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
52 U.correctBoundaryConditions();