initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / solvers / multiphase / multiphaseInterFoam / pEqn.H
blob4bec77f950d54fadbefe8507abe3ed8699476c54
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()) + fvc::ddtPhiCorr(rUA, rho, U, phi)
11     );
13     adjustPhi(phiU, U, p);
15     phi = phiU +
16         (
17             mixture.surfaceTensionForce()*mesh.magSf()
18           + fvc::interpolate(rho)*(g & mesh.Sf())
19         )*rUAf;
21     for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
22     {
23         fvScalarMatrix pEqn
24         (
25             fvm::laplacian(rUAf, p) == fvc::div(phi)
26         );
28         pEqn.setReference(pRefCell, pRefValue);
30         if (corr == nCorr-1)
31         {
32             pEqn.solve(mesh.solver(p.name() + "Final"));
33         }
34         else
35         {
36             pEqn.solve(mesh.solver(p.name()));
37         }
39         if (nonOrth == nNonOrthCorr)
40         {
41             phi -= pEqn.flux();
42         }
43     }
45     U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
46     U.correctBoundaryConditions();