Merge branch 'master' of ssh://repo.or.cz/srv/git/OpenFOAM-1.6.x
[OpenFOAM-1.6.x.git] / applications / solvers / multiphase / twoLiquidMixingFoam / pEqn.H
blob7ba3cdba8a6a2badce20af6292008e62487f23b7
2     volScalarField rUA = 1.0/UEqn.A();
3     surfaceScalarField rUAf = fvc::interpolate(rUA);
5     U = rUA*UEqn.H();
7     surfaceScalarField phiU
8     (
9         "phiU",
10         (fvc::interpolate(U) & mesh.Sf())
11       + fvc::ddtPhiCorr(rUA, rho, U, phi)
12     );
14     phi = phiU + fvc::interpolate(rho)*(g & mesh.Sf())*rUAf;
16     for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
17     {
18         fvScalarMatrix pEqn
19         (
20             fvm::laplacian(rUAf, p) == fvc::div(phi)
21         );
23         pEqn.setReference(pRefCell, pRefValue);
25         if
26         (
27             corr == nCorr-1
28          && nonOrth == nNonOrthCorr
29         )
30         {
31             pEqn.solve(mesh.solver(p.name() + "Final"));
32         }
33         else
34         {
35             pEqn.solve(mesh.solver(p.name()));
36         }
38         if (nonOrth == nNonOrthCorr)
39         {
40             phi -= pEqn.flux();
41         }
42     }
44     U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
45     U.correctBoundaryConditions();