4 volScalarField rUA = 1.0/UEqn().A();
5 surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA));
10 phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
11 bool closedVolume = adjustPhi(phi, U, p);
13 surfaceScalarField buoyancyPhi =
14 rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf());
17 for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
21 fvm::laplacian(rhorUAf, p) == fvc::div(phi)
24 pEqn.setReference(pRefCell, pRefValue);
26 // retain the residual from the first iteration
29 eqnResidual = pEqn.solve().initialResidual();
30 maxResidual = max(eqnResidual, maxResidual);
37 if (nonOrth == nNonOrthCorr)
39 // For closed-volume cases adjust the pressure and density levels
40 // to obey overall mass continuity
43 p += (initialMass - fvc::domainIntegrate(psi*p))
44 /fvc::domainIntegrate(psi);
47 // Calculate the conservative fluxes
50 // Explicitly relax pressure for momentum corrector
53 // Correct the momentum source with the pressure gradient flux
54 // calculated from the relaxed pressure
55 U += rUA*fvc::reconstruct((buoyancyPhi - pEqn.flux())/rhorUAf);
56 U.correctBoundaryConditions();
60 #include "continuityErrs.H"
64 Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value()