2 bool closedVolume = p_rgh.needReference();
3 dimensionedScalar compressibility = fvc::domainIntegrate(psi);
4 bool compressible = (compressibility.value() > SMALL);
8 volScalarField rAU(1.0/UEqn().A());
9 surfaceScalarField rhorAUf("(rho*(1|A(U)))", fvc::interpolate(rho*rAU));
13 surfaceScalarField phiU
17 (fvc::interpolate(U) & mesh.Sf())
18 + fvc::ddtPhiCorr(rAU, rho, U, phi)
22 phi = phiU - rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf();
25 fvScalarMatrix p_rghDDtEqn
27 fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
31 // Thermodynamic density needs to be updated by psi*d(p) after the
32 // pressure solution - done in 2 parts. Part 1:
33 thermo.rho() -= psi*p_rgh;
35 for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
37 fvScalarMatrix p_rghEqn
40 - fvm::laplacian(rhorAUf, p_rgh)
52 && nonOrth == nNonOrthCorr
58 if (nonOrth == nNonOrthCorr)
60 phi += p_rghEqn.flux();
64 // Second part of thermodynamic density update
65 thermo.rho() += psi*p_rgh;
68 // Correct velocity field
69 U += rAU*fvc::reconstruct((phi - phiU)/rhorAUf);
70 U.correctBoundaryConditions();
74 // Update pressure substantive derivative
75 DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
80 // Update continuity errors
81 #include "compressibleContinuityErrors.H"
83 // For closed-volume cases adjust the pressure and density levels
84 // to obey overall mass continuity
85 if (closedVolume && compressible)
87 p += (initialMass - fvc::domainIntegrate(thermo.rho()))
93 // Update thermal conductivity
94 K = thermoFluid[i].Cp()*turb.alphaEff();