Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / applications / solvers / multiphase / interPhaseChangeFoam / correctPhi.H
blobed5ccc9a70eba47b04969ee54bd6e2ba85aa5407
2 #   include "continuityErrs.H"
4     wordList pcorrTypes
5     (
6         pd.boundaryField().size(),
7         zeroGradientFvPatchScalarField::typeName
8     );
10     for (label i=0; i<pd.boundaryField().size(); i++)
11     {
12         if (pd.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", pd.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(pdRefCell, pdRefValue);
45         pcorrEqn.solve();
47         if (nonOrth == nNonOrthCorr)
48         {
49             phi -= pcorrEqn.flux();
50         }
51     }
53 #   include "continuityErrs.H"