1 volScalarField rUA = 1.0/UEqn().A();
4 phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
5 bool closedVolume = adjustPhi(phi, U, p);
6 phi -= fvc::interpolate(rho*gh*rUA)*fvc::snGrad(rho)*mesh.magSf();
8 for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
12 fvm::laplacian(rho*rUA, pd) == fvc::div(phi)
15 pdEqn.setReference(pdRefCell, pdRefValue);
16 // retain the residual from the first iteration
19 eqnResidual = pdEqn.solve().initialResidual();
20 maxResidual = max(eqnResidual, maxResidual);
27 if (nonOrth == nNonOrthCorr)
33 #include "continuityErrs.H"
35 // Explicitly relax pressure for momentum corrector
38 p = pd + rho*gh + pRef;
40 U -= rUA*(fvc::grad(pd) + fvc::grad(rho)*gh);
41 U.correctBoundaryConditions();
43 // For closed-volume cases adjust the pressure and density levels
44 // to obey overall mass continuity
47 p += (initialMass - fvc::domainIntegrate(thermo->psi()*p))
48 /fvc::domainIntegrate(thermo->psi());
49 pd == p - (rho*gh + pRef);
54 Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;