db7fac3f24
git-svn-id: https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev@1731 e4e07f05-0c2f-0410-a05a-b8ba57e0c909
46 lines
1 KiB
C
46 lines
1 KiB
C
{
|
|
rho = thermo->rho();
|
|
|
|
rUA = 1.0/UEqn.A();
|
|
H = UEqn.H();
|
|
U = rUA*UEqn.H();
|
|
|
|
phi = fvc::interpolate(rho)
|
|
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
|
|
|
|
// Store pressure for under-relaxation
|
|
p.storePrevIter();
|
|
|
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
|
{
|
|
fvScalarMatrix pEqn
|
|
(
|
|
fvm::ddt(psi, p)
|
|
+ fvc::div(phi)
|
|
- fvm::laplacian(rho*rUA, p)
|
|
);
|
|
|
|
pEqn.solve();
|
|
|
|
if (nonOrth == nNonOrthCorr)
|
|
{
|
|
phi += pEqn.flux();
|
|
}
|
|
}
|
|
|
|
# include "rhoEqn.H"
|
|
# include "compressibleContinuityErrs.H"
|
|
|
|
// Warning:
|
|
// rho does not carry working boundary conditions and needs to be updated
|
|
// strictly according to the thermodynamics package
|
|
// HJ, 22/Aug/2007
|
|
thermo->correct();
|
|
rho = thermo->rho();
|
|
|
|
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|
|
|
|
U -= rUA*fvc::grad(p);
|
|
U.correctBoundaryConditions();
|
|
}
|
|
|