ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / applications / solvers / heatTransfer / buoyantBoussinesqPimpleFoam / pEqn.H
blob8ac13dc93ee3e0673967f35c8e1ac9baeacc0fbd
2     volScalarField rAU("rAU", 1.0/UEqn.A());
3     surfaceScalarField rAUf("(1|A(U))", fvc::interpolate(rAU));
5     U = rAU*UEqn.H();
7     phi = (fvc::interpolate(U) & mesh.Sf())
8         + fvc::ddtPhiCorr(rAU, U, phi);
10     surfaceScalarField buoyancyPhi(rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf());
11     phi -= buoyancyPhi;
13     for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
14     {
15         fvScalarMatrix p_rghEqn
16         (
17             fvm::laplacian(rAUf, p_rgh) == fvc::div(phi)
18         );
20         p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
22         p_rghEqn.solve
23         (
24             mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth)))
25         );
27         if (nonOrth == pimple.nNonOrthCorr())
28         {
29             // Calculate the conservative fluxes
30             phi -= p_rghEqn.flux();
32             // Explicitly relax pressure for momentum corrector
33             p_rgh.relax();
35             // Correct the momentum source with the pressure gradient flux
36             // calculated from the relaxed pressure
37             U -= rAU*fvc::reconstruct((buoyancyPhi + p_rghEqn.flux())/rAUf);
38             U.correctBoundaryConditions();
39         }
40     }
42     #include "continuityErrs.H"
44     p = p_rgh + rhok*gh;
46     if (p_rgh.needReference())
47     {
48         p += dimensionedScalar
49         (
50             "p",
51             p.dimensions(),
52             pRefValue - getRefCellValue(p, pRefCell)
53         );
54         p_rgh = p - rhok*gh;
55     }