1 if (pressureImplicitPorosity)
12 bool closedVolume = false;
14 if (simple.transonic())
16 surfaceScalarField phid
19 fvc::interpolate(psi)*(fvc::interpolate(U) & mesh.Sf())
21 mrfZones.relativeFlux(fvc::interpolate(psi), phid);
23 for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
25 tmp<fvScalarMatrix> tpEqn;
27 if (pressureImplicitPorosity)
29 tpEqn = (fvc::div(phid, p) - fvm::laplacian(rho*trTU(), p));
33 tpEqn = (fvc::div(phid, p) - fvm::laplacian(rho*trAU(), p));
36 tpEqn().setReference(pRefCell, pRefValue);
40 if (nonOrth == simple.nNonOrthCorr())
42 phi == tpEqn().flux();
48 phi = fvc::interpolate(rho*U) & mesh.Sf();
49 mrfZones.relativeFlux(fvc::interpolate(rho), phi);
51 closedVolume = adjustPhi(phi, U, p);
53 for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
55 tmp<fvScalarMatrix> tpEqn;
57 if (pressureImplicitPorosity)
59 tpEqn = (fvm::laplacian(rho*trTU(), p) == fvc::div(phi));
63 tpEqn = (fvm::laplacian(rho*trAU(), p) == fvc::div(phi));
66 tpEqn().setReference(pRefCell, pRefValue);
70 if (nonOrth == simple.nNonOrthCorr())
72 phi -= tpEqn().flux();
77 #include "incompressible/continuityErrs.H"
79 // Explicitly relax pressure for momentum corrector
82 if (pressureImplicitPorosity)
84 U -= trTU()&fvc::grad(p);
88 U -= trAU()*fvc::grad(p);
91 U.correctBoundaryConditions();
93 // For closed-volume cases adjust the pressure and density levels
94 // to obey overall mass continuity
97 p += (initialMass - fvc::domainIntegrate(psi*p))
98 /fvc::domainIntegrate(psi);
102 rho = max(rho, rhoMin);
103 rho = min(rho, rhoMax);
105 Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;