Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / applications / solvers / multiphase / compressibleInterFoam / compressibleInterDyMFoam / correctPhi.H
blobc3b3726d12226076b01b95627ab82cce24ca2638
2     if (mesh.changing())
3     {
4         forAll(U.boundaryField(), patchi)
5         {
6             if (U.boundaryField()[patchi].fixesValue())
7             {
8                 U.boundaryField()[patchi].initEvaluate();
9             }
10         }
12         forAll(U.boundaryField(), patchi)
13         {
14             if (U.boundaryField()[patchi].fixesValue())
15             {
16                 U.boundaryField()[patchi].evaluate();
18                 phi.boundaryField()[patchi] =
19                 U.boundaryField()[patchi] & mesh.Sf().boundaryField()[patchi];
20             }
21         }
22     }
24     #include "continuityErrs.H"
26     volScalarField pcorr
27     (
28         IOobject
29         (
30             "pcorr",
31             runTime.timeName(),
32             mesh,
33             IOobject::NO_READ,
34             IOobject::NO_WRITE
35         ),
36         mesh,
37         dimensionedScalar("pcorr", p.dimensions(), 0.0),
38         pcorrTypes
39     );
41     dimensionedScalar rAUf("(1|A(U))", dimTime/rho.dimensions(), 1.0);
43     adjustPhi(phi, U, pcorr);
45     for(int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
46     {
47         fvScalarMatrix pcorrEqn
48         (
49             fvm::laplacian(rAUf, pcorr) == fvc::div(phi) - divU
50         );
52         pcorrEqn.solve();
54         if (nonOrth == pimple.nNonOrthCorr())
55         {
56             phi -= pcorrEqn.flux();
57         }
58     }
60     #include "continuityErrs.H"