rhoSimpleFoam: Added support for transonic flow of liquids and real gases

Both stardard SIMPLE and the SIMPLEC (using the 'consistent' option in
fvSolution) are now supported for both subsonic and transonic flow of all
fluid types.
This commit is contained in:
Henry Weller
2017-02-24 16:20:06 +00:00
parent a1c8cde310
commit 7d6845defa
3 changed files with 19 additions and 17 deletions

View File

@ -8,20 +8,23 @@
if (simple.transonic()) if (simple.transonic())
{ {
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA));
surfaceScalarField rhof(fvc::interpolate(rho));
MRF.makeRelative(rhof, phiHbyA);
surfaceScalarField phid surfaceScalarField phid
( (
"phid", "phid",
fvc::interpolate(psi) (fvc::interpolate(psi)/rhof)*phiHbyA
*fvc::flux(HbyA)
); );
phiHbyA -= fvc::interpolate(p)*phid;
MRF.makeRelative(fvc::interpolate(psi), phid);
while (simple.correctNonOrthogonal()) while (simple.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
fvm::div(phid, p) fvc::div(phiHbyA)
+ fvm::div(phid, p)
- fvm::laplacian(rhorAUf, p) - fvm::laplacian(rhorAUf, p)
== ==
fvOptions(psi, p, rho.name()) fvOptions(psi, p, rho.name())
@ -40,7 +43,7 @@
if (simple.finalNonOrthogonalIter()) if (simple.finalNonOrthogonalIter())
{ {
phi == pEqn.flux(); phi = phiHbyA + pEqn.flux();
} }
} }
} }

View File

@ -7,20 +7,19 @@ bool closedVolume = false;
if (simple.transonic()) if (simple.transonic())
{ {
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA));
surfaceScalarField rhof(fvc::interpolate(rho));
MRF.makeRelative(rhof, phiHbyA);
surfaceScalarField phid surfaceScalarField phid
( (
"phid", "phid",
fvc::interpolate(psi) (fvc::interpolate(psi)/rhof)*phiHbyA
*fvc::flux(HbyA)
); );
MRF.makeRelative(fvc::interpolate(psi), phid); phiHbyA +=
surfaceScalarField phic
(
"phic",
fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf() fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf()
); - fvc::interpolate(p)*phid;
HbyA -= (rAU - rAtU)*fvc::grad(p); HbyA -= (rAU - rAtU)*fvc::grad(p);
@ -31,7 +30,7 @@ if (simple.transonic())
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
fvm::div(phid, p) fvm::div(phid, p)
+ fvc::div(phic) + fvc::div(phiHbyA)
- fvm::laplacian(rhorAtU, p) - fvm::laplacian(rhorAtU, p)
== ==
fvOptions(psi, p, rho.name()) fvOptions(psi, p, rho.name())
@ -50,7 +49,7 @@ if (simple.transonic())
if (simple.finalNonOrthogonalIter()) if (simple.finalNonOrthogonalIter())
{ {
phi == phic + pEqn.flux(); phi = phiHbyA + pEqn.flux();
} }
} }
} }

View File

@ -40,7 +40,7 @@ SIMPLE
{ {
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
pMinFactor 0.1; pMinFactor 0.1;
pMaxFactor 1.5; pMaxFactor 2;
transonic yes; transonic yes;
consistent yes; consistent yes;