twoPhaseEulerFoam:frictionalStressModel/Schaeffer: Correct mut on processor boundaries
[OpenFOAM-1.7.x.git] / applications / solvers / multiphase / twoLiquidMixingFoam / pEqn.H
blob66711e7be7ecc9b19e68895d8addf349b6cbe6f6
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<=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
29             (
30                 p_rgh.select
31                 (
32                     finalIter
33                  && corr == nCorr-1
34                  && nonOrth == nNonOrthCorr
35                 )
36             )
37         );
39         if (nonOrth == nNonOrthCorr)
40         {
41             phi -= p_rghEqn.flux();
42         }
43     }
45     U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
46     U.correctBoundaryConditions();
48     #include "continuityErrs.H"
50     p == p_rgh + rho*gh;
52     if (p_rgh.needReference())
53     {
54         p += dimensionedScalar
55         (
56             "p",
57             p.dimensions(),
58             pRefValue - getRefCellValue(p, pRefCell)
59         );
60         p_rgh = p - rho*gh;
61     }