Forward compatibility: flex
[foam-extend-3.2.git] / applications / solvers / incompressible / icoDyMSimpleFoam / correctPhi.H
blob69978f0e62b6b7eced913345815f46d618bf2492
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     for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
28     {
29         fvScalarMatrix pcorrEqn
30         (
31             fvm::laplacian(rAU, pcorr) == fvc::div(phi)
32         );
34         pcorrEqn.setReference(pRefCell, pRefValue);
35         pcorrEqn.solve();
37         if (nonOrth == nNonOrthCorr)
38         {
39             phi -= pcorrEqn.flux();
40         }
42         // Fluxes are corrected to absolute velocity and further corrected
43         // later.  HJ, 6/Feb/2009
44     }
47 #include "continuityErrs.H"