2 bool closedVolume = p.needReference();
6 // Thermodynamic density needs to be updated by psi*d(p) after the
7 // pressure solution - done in 2 parts. Part 1:
10 volScalarField rUA = 1.0/UEqn.A();
11 surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA));
15 surfaceScalarField phiU
19 (fvc::interpolate(U) & mesh.Sf())
20 + fvc::ddtPhiCorr(rUA, rho, U, phi)
24 phi = phiU + rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf());
26 for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
30 fvc::ddt(rho) + psi*correction(fvm::ddt(p))
32 - fvm::laplacian(rhorUAf, p)
35 if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
37 pEqn.solve(mesh.solver(p.name() + "Final"));
41 pEqn.solve(mesh.solver(p.name()));
44 if (nonOrth == nNonOrthCorr)
50 // Second part of thermodynamic density update
51 thermo.rho() += psi*p;
53 U += rUA*fvc::reconstruct((phi - phiU)/rhorUAf);
54 U.correctBoundaryConditions();
56 DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
59 #include "compressibleContinuityErrs.H"
61 // For closed-volume cases adjust the pressure and density levels
62 // to obey overall mass continuity
66 (initialMass - fvc::domainIntegrate(psi*p))
67 /fvc::domainIntegrate(psi);
69 rho += (initialMass - fvc::domainIntegrate(rho))/totalVolume;