initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / solvers / multiphase / interPhaseChangeFoam / correctPhi.H
blob17377302f0ecd97c2ee04e98cea8bcfc88ab4921
2     #include "continuityErrs.H"
4     wordList pcorrTypes
5     (
6         p.boundaryField().size(),
7         zeroGradientFvPatchScalarField::typeName
8     );
10     for (label i=0; i<p.boundaryField().size(); i++)
11     {
12         if (p.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.dimensions(), 0.0),
30         pcorrTypes
31     );
33     dimensionedScalar rUAf("(1|A(U))", dimTime/rho.dimensions(), 1.0);
35     adjustPhi(phi, U, pcorr);
37     for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
38     {
39         fvScalarMatrix pcorrEqn
40         (
41             fvm::laplacian(rUAf, pcorr) == fvc::div(phi)
42         );
44         pcorrEqn.setReference(pRefCell, pRefValue);
45         pcorrEqn.solve();
47         if (nonOrth == nNonOrthCorr)
48         {
49             phi -= pcorrEqn.flux();
50         }
51     }
53 #   include "continuityErrs.H"