66 lines
1.2 KiB
C
66 lines
1.2 KiB
C
|
rho = thermo->rho();
|
||
|
|
||
|
volScalarField A = UEqn.A();
|
||
|
U = UEqn.H()/A;
|
||
|
|
||
|
if (transonic)
|
||
|
{
|
||
|
surfaceScalarField phid
|
||
|
(
|
||
|
"phid",
|
||
|
fvc::interpolate(thermo->psi())
|
||
|
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U))
|
||
|
);
|
||
|
|
||
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||
|
{
|
||
|
fvScalarMatrix pEqn
|
||
|
(
|
||
|
fvm::ddt(psi, p)
|
||
|
+ fvm::div(phid, p)
|
||
|
- fvm::laplacian(rho/A, p)
|
||
|
==
|
||
|
Sevap
|
||
|
);
|
||
|
|
||
|
pEqn.solve();
|
||
|
|
||
|
if (nonOrth == nNonOrthCorr)
|
||
|
{
|
||
|
phi == pEqn.flux();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
phi = fvc::interpolate(rho)
|
||
|
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
|
||
|
|
||
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||
|
{
|
||
|
fvScalarMatrix pEqn
|
||
|
(
|
||
|
fvm::ddt(psi, p)
|
||
|
+ fvc::div(phi)
|
||
|
- fvm::laplacian(rho/A, p)
|
||
|
==
|
||
|
Sevap
|
||
|
);
|
||
|
|
||
|
pEqn.solve();
|
||
|
|
||
|
if (nonOrth == nNonOrthCorr)
|
||
|
{
|
||
|
phi += pEqn.flux();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#include "rhoEqn.H"
|
||
|
#include "compressibleContinuityErrs.H"
|
||
|
|
||
|
U -= fvc::grad(p)/A;
|
||
|
U.correctBoundaryConditions();
|
||
|
|
||
|
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|