Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / applications / solvers / multiphase / interFoam / correctPhi.H
blobcb3503e7b8d385f4cf6110cc4c2d57beb3c246f2
2     #include "continuityErrs.H"
4     wordList pcorrTypes
5     (
6         p_rgh.boundaryField().size(),
7         zeroGradientFvPatchScalarField::typeName
8     );
10     forAll (p_rgh.boundaryField(), i)
11     {
12         if (p_rgh.boundaryField()[i].fixesValue())
13         {
14             pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
15         }
16     }
18     volScalarField pcorr
19     (
20         IOobject
21         (
22             "pcorr",
23             runTime.timeName(),
24             mesh,
25             IOobject::NO_READ,
26             IOobject::NO_WRITE
27         ),
28         mesh,
29         dimensionedScalar("pcorr", p_rgh.dimensions(), 0.0),
30         pcorrTypes
31     );
33     dimensionedScalar rAUf("(1|A(U))", dimTime/rho.dimensions(), 1.0);
35     adjustPhi(phi, U, pcorr);
37     for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
38     {
39         fvScalarMatrix pcorrEqn
40         (
41             fvm::laplacian(rAUf, pcorr) == fvc::div(phi)
42         );
44         pcorrEqn.setReference(pRefCell, pRefValue);
45         pcorrEqn.solve();
47         if (nonOrth == pimple.nNonOrthCorr())
48         {
49             phi -= pcorrEqn.flux();
50         }
51     }
53     #include "continuityErrs.H"