Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / applications / solvers / engine / turbDyMEngineFoam / correctPhi.H
blob0f6422d538bd773d567e9d0e01d91397a80fa013
2     wordList pcorrTypes(p.boundaryField().types());
4     for (label i=0; i<p.boundaryField().size(); i++)
5     {
6         if (p.boundaryField()[i].fixesValue())
7         {
8             pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
9         }
10     }
12     volScalarField pcorr
13     (
14         IOobject
15         (
16             "pcorr",
17             runTime.timeName(),
18             mesh,
19             IOobject::NO_READ,
20             IOobject::NO_WRITE
21         ),
22         mesh,
23         dimensionedScalar("pcorr", p.dimensions(), 0.0),
24         pcorrTypes
25     );
27     phi = (fvc::interpolate(U) & mesh.Sf());
29     for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
30     {
31         fvScalarMatrix pcorrEqn
32         (
33             fvm::laplacian(rUA, pcorr) == fvc::div(phi)
34         );
36         pcorrEqn.setReference(pRefCell, pRefValue);
37         pcorrEqn.solve();
39         if (nonOrth == nNonOrthCorr)
40         {
41             phi -= pcorrEqn.flux();
42         }
43     }
46 #include "continuityErrs.H"