2 volScalarField rUA = 1.0/UEqn.A();
4 surfaceScalarField psisf = fvc::interpolate(psis);
5 surfaceScalarField rhof = fvc::interpolate(rho);
7 // Needs to be outside of loop since p is changing, but psi and rho are not.
8 surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
10 for (int corr = 0; corr < nCorr; corr++)
14 // Calculate phi for boundary conditions
15 phi = rhof*fvc::interpolate(U) & mesh.Sf();
17 surfaceScalarField phid2 = rhoReff/rhof*phi;
19 surfaceScalarField phid("phid", psisf/rhof*phi);
21 // Make fluxes relative within the MRF zone
22 mrfZones.relativeFlux(rhoReff, phi);
23 mrfZones.relativeFlux(psisf, phid);
24 mrfZones.relativeFlux(rhoReff, phid2);
28 for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
35 - fvm::laplacian(rho*rUA, p)
38 // Retain the residual from the first pressure solution
39 eqnResidual = pEqn.solve().initialResidual();
41 if (corr == 0 && nonOrth == 0)
43 maxResidual = max(eqnResidual, maxResidual);
47 if (nonOrth == nNonOrthCorr)
49 phi = phid2 + pEqn.flux();
53 # include "compressibleContinuityErrs.H"
58 U -= rUA*fvc::grad(p);
59 U.correctBoundaryConditions();
63 if (min(p) < pMin || max(p) > pMax)
67 p.correctBoundaryConditions();
71 volScalarField magU = mag(U);
75 volScalarField Ulimiter = pos(magU - UMax)*UMax/(magU + smallU)
77 Ulimiter.max(scalar(0));
78 Ulimiter.min(scalar(1));
81 U.correctBoundaryConditions();