Removed unneeded lib dependency from mdInitialise
[foam-extend-3.2.git] / applications / solvers / engine / sonicTurbDyMEngineFoam / compressibleCorrectPhi.H
blobf71258e73e919409290d13c2e93a7d19dfacfec8
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     pcorr == p;
28     pcorr.oldTime() == p.oldTime();
30     phi = fvc::interpolate(rho)
31         *((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
33     for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
34     {
35         fvScalarMatrix pcorrEqn
36         (
37             fvm::ddt(psi, pcorr)
38           + fvc::div(phi)
39           - fvm::laplacian(rho*rUA, pcorr)
40         );
42         pcorrEqn.solve();
44         if (nonOrth == nNonOrthCorr)
45         {
46             phi += pcorrEqn.flux();
47         }
48     }