ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / applications / solvers / incompressible / pimpleFoam / pimpleDyMFoam / correctPhi.H
blobe112db4621faf2bee4e4df3f9f7ba491747615dd
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     wordList pcorrTypes
25     (
26         p.boundaryField().size(),
27         zeroGradientFvPatchScalarField::typeName
28     );
30     forAll(p.boundaryField(), i)
31     {
32         if (p.boundaryField()[i].fixesValue())
33         {
34             pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
35         }
36     }
38     volScalarField pcorr
39     (
40         IOobject
41         (
42             "pcorr",
43             runTime.timeName(),
44             mesh,
45             IOobject::NO_READ,
46             IOobject::NO_WRITE
47         ),
48         mesh,
49         dimensionedScalar("pcorr", p.dimensions(), 0.0),
50         pcorrTypes
51     );
53     for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
54     {
55         fvScalarMatrix pcorrEqn
56         (
57             fvm::laplacian(rAU, pcorr) == fvc::div(phi)
58         );
60         pcorrEqn.setReference(pRefCell, pRefValue);
61         pcorrEqn.solve();
63         if (nonOrth == pimple.nNonOrthCorr())
64         {
65             phi -= pcorrEqn.flux();
66         }
67     }
70 #include "continuityErrs.H"