2 rho = max(rho, rhoMin);
3 rho = min(rho, rhoMax);
6 volScalarField rUA = 1.0/UEqn().A();
10 bool closedVolume = false;
14 surfaceScalarField phid
17 fvc::interpolate(psi)*(fvc::interpolate(U) & mesh.Sf())
20 for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
25 - fvm::laplacian(rho*rUA, p)
28 // Relax the pressure equation to ensure diagonal-dominance
29 pEqn.relax(mesh.solutionDict().relaxationFactor("pEqn"));
31 pEqn.setReference(pRefCell, pRefValue);
33 // retain the residual from the first iteration
36 eqnResidual = pEqn.solve().initialResidual();
37 maxResidual = max(eqnResidual, maxResidual);
44 if (nonOrth == nNonOrthCorr)
52 phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
53 closedVolume = adjustPhi(phi, U, p);
55 for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
59 fvm::laplacian(rho*rUA, p) == fvc::div(phi)
62 pEqn.setReference(pRefCell, pRefValue);
64 // Retain the residual from the first iteration
67 eqnResidual = pEqn.solve().initialResidual();
68 maxResidual = max(eqnResidual, maxResidual);
75 if (nonOrth == nNonOrthCorr)
83 #include "incompressible/continuityErrs.H"
85 // Explicitly relax pressure for momentum corrector
88 U -= rUA*fvc::grad(p);
89 U.correctBoundaryConditions();
91 // For closed-volume cases adjust the pressure and density levels
92 // to obey overall mass continuity
95 p += (initialMass - fvc::domainIntegrate(psi*p))
96 /fvc::domainIntegrate(psi);
100 rho = max(rho, rhoMin);
101 rho = min(rho, rhoMax);
103 Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;