2 // From buoyantSimpleFoam
6 volScalarField rUA = 1.0/UEqn().A();
7 surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA));
12 phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
13 bool closedVolume = adjustPhi(phi, U, p);
15 surfaceScalarField buoyancyPhi =
16 rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf());
20 for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
24 fvm::laplacian(rhorUAf, p) == fvc::div(phi)
27 pEqn.setReference(pRefCell, pRefValue);
29 // retain the residual from the first iteration
32 eqnResidual = pEqn.solve().initialResidual();
33 maxResidual = max(eqnResidual, maxResidual);
40 if (nonOrth == nNonOrthCorr)
42 // For closed-volume cases adjust the pressure and density levels
43 // to obey overall mass continuity
46 p += (initialMass - fvc::domainIntegrate(psi*p))
47 /fvc::domainIntegrate(psi);
50 // Calculate the conservative fluxes
53 // Explicitly relax pressure for momentum corrector
56 // Correct the momentum source with the pressure gradient flux
57 // calculated from the relaxed pressure
58 U += rUA*fvc::reconstruct((buoyancyPhi - pEqn.flux())/rhorUAf);
59 U.correctBoundaryConditions();
64 #include "continuityErrs.H"
69 Info<< "Min/max rho:" << min(rho).value() << ' '
70 << max(rho).value() << endl;
72 // Update thermal conductivity
73 K = thermo.Cp()*turb.alphaEff();