ENH: patchCloud: return pTraits<Type>::max for unfound points
[OpenFOAM-1.7.x.git] / applications / solvers / multiphase / interFoam / correctPhi.H
blob3fff2dc7d9fba4baf4bfc79cdf43b67f4a542ef4
2     #include "continuityErrs.H"
4     wordList pcorrTypes
5     (
6         p_rgh.boundaryField().size(),
7         zeroGradientFvPatchScalarField::typeName
8     );
10     for (label i=0; i<p_rgh.boundaryField().size(); 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<=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 == nNonOrthCorr)
48         {
49             phi -= pcorrEqn.flux();
50         }
51     }
53     #include "continuityErrs.H"