68 lines
1.3 KiB
C++
68 lines
1.3 KiB
C++
rho = thermo.rho();
|
|
|
|
volScalarField rUA = 1.0/UEqn.A();
|
|
U = invA & UEqn.H();
|
|
|
|
if (piso.transonic())
|
|
{
|
|
surfaceScalarField phid
|
|
(
|
|
"phid",
|
|
fvc::interpolate(psi)
|
|
*(
|
|
(fvc::interpolate(U) & mesh.Sf())
|
|
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
|
|
)
|
|
);
|
|
|
|
while (piso.correctNonOrthogonal())
|
|
{
|
|
fvScalarMatrix pEqn
|
|
(
|
|
betav*fvm::ddt(psi, p)
|
|
+ fvm::div(phid, p)
|
|
- fvm::laplacian(rho*invA, p)
|
|
);
|
|
|
|
pEqn.solve();
|
|
|
|
if (piso.finalNonOrthogonalIter())
|
|
{
|
|
phi == pEqn.flux();
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
phi =
|
|
fvc::interpolate(rho)*
|
|
(
|
|
(fvc::interpolate(U) & mesh.Sf())
|
|
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
|
|
);
|
|
|
|
while (piso.correctNonOrthogonal())
|
|
{
|
|
fvScalarMatrix pEqn
|
|
(
|
|
betav*fvm::ddt(psi, p)
|
|
+ fvc::div(phi)
|
|
- fvm::laplacian(rho*invA, p)
|
|
);
|
|
|
|
pEqn.solve();
|
|
|
|
if (piso.finalNonOrthogonalIter())
|
|
{
|
|
phi += pEqn.flux();
|
|
}
|
|
}
|
|
}
|
|
|
|
#include "rhoEqn.H"
|
|
#include "continuityErrs.H"
|
|
|
|
U -= invA & (betav*fvc::grad(p));
|
|
U.correctBoundaryConditions();
|
|
|
|
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|