initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / tutorials / multiphase / interFoam / MRFInterFoam / MRFInterFoam / pEqn.H
blob5a67dd0497b150c4a46f62f306afdf814cfe17aa
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     );
13     mrfZones.relativeFlux(phiU);
15     phi = phiU +
16         (
17             fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)*mesh.magSf()
18           + fvc::interpolate(rho)*(g & mesh.Sf())
19         )*rUAf;
20     adjustPhi(phi, U, p);
22     for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
23     {
24         fvScalarMatrix pEqn
25         (
26             fvm::laplacian(rUAf, p) == fvc::div(phi)
27         );
29         pEqn.setReference(pRefCell, pRefValue);
31         if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
32         {
33             pEqn.solve(mesh.solver(p.name() + "Final"));
34         }
35         else
36         {
37             pEqn.solve(mesh.solver(p.name()));
38         }
40         if (nonOrth == nNonOrthCorr)
41         {
42             phi -= pEqn.flux();
43         }
44     }
46     U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
47     U.correctBoundaryConditions();