Compressible and reacting flow solvers: Changed the internal energy pressure work for consistency with enthalpy

The pressure work term for total internal energy is div(U p) which can be
discretised is various ways, given a mass flux field phi it seems logical to
implement it in the form div(phi/interpolate(rho), p) but this is not exactly
consistent with the relationship between enthalpy and internal energy (h = e +
p/rho) and the transport of enthalpy, it would be more consistent to implement
it in the form div(phi, p/rho).  A further improvement in consistency can be
gained by using the same convection scheme for this work term and the convection
term div(phi, e) and for reacting solvers this is easily achieved by using the
multi-variate limiter mvConvection provided for energy and specie convection.

This more consistent total internal energy work term has now been implemented in
all the compressible and reacting flow solvers and provides more accurate
solutions when running with internal energy, particularly for variable density
mixing cases with small pressure variation.

For non-reacting compressible solvers this improvement requires a change to the
corresponding divScheme in fvSchemes:

    div(phiv,p) -> div(phi,(p|rho))

and all the tutorials have been updated accordingly.
This commit is contained in:
Henry Weller
2021-06-11 11:34:38 +01:00
parent 881bbfa591
commit 90831fbb55
32 changed files with 162 additions and 187 deletions

View File

@ -7,12 +7,7 @@
+ betav*fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
hea.name() == "ea"
? fvc::div
(
phi/fvc::interpolate(rho),
p,
"div(phiv,p)"
)
? mvConvection->fvcDiv(fvc::absolute(phi, rho, U), p/rho)
: -betav*dpdt
)
- fvm::laplacian(Db, hea)

View File

@ -8,12 +8,8 @@ if (ign.ignited())
+ (betav*fvc::ddt(rho, K) + fvc::div(phi, K))*rho/thermo.rhou()
+ (
heau.name() == "eau"
? fvc::div
(
phi/fvc::interpolate(rho),
p,
"div(phiv,p)"
)*rho/thermo.rhou()
? mvConvection->fvcDiv(fvc::absolute(phi, rho, U), p/rho)
*rho/thermo.rhou()
: -betav*dpdt*rho/thermo.rhou()
)
- fvm::laplacian(Db, heau)

View File

@ -7,12 +7,7 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
hea.name() == "ea"
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
? mvConvection->fvcDiv(fvc::absolute(phi, rho, U), p/rho)
: -dpdt
)
- fvm::laplacian(thermophysicalTransport->alphaEff(), hea)

View File

@ -8,12 +8,8 @@ if (ign.ignited())
+ (fvc::ddt(rho, K) + fvc::div(phi, K))*rho/thermo.rhou()
+ (
heau.name() == "eau"
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)*rho/thermo.rhou()
? mvConvection->fvcDiv(fvc::absolute(phi, rho, U), p/rho)
*rho/thermo.rhou()
: -dpdt*rho/thermo.rhou()
)
- fvm::laplacian(thermophysicalTransport->alphaEff(), heau)

View File

@ -7,12 +7,7 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
he.name() == "e"
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
? mvConvection->fvcDiv(fvc::absolute(phi, rho, U), p/rho)
: -dpdt
)
+ thermophysicalTransport->divq(he)

View File

@ -7,12 +7,7 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
he.name() == "e"
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
? fvc::div(fvc::absolute(phi, rho, U), p/rho)
: -dpdt
)
+ thermophysicalTransport->divq(he)

View File

@ -7,12 +7,7 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
he.name() == "e"
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
? fvc::div(fvc::absolute(phi, rho, U), p/rho)
: -dpdt
)
+ thermophysicalTransport->divq(he)

View File

@ -12,12 +12,9 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
he.name() == "e"
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
? mvConvection.valid()
? mvConvection->fvcDiv(fvc::absolute(phi, rho, U), p/rho)
: fvc::div(fvc::absolute(phi, rho, U), p/rho)
: -dpdt
)
+ thermophysicalTransport.divq(he)

View File

@ -7,12 +7,7 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
he.name() == "e"
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
? fvc::div(fvc::absolute(phi, rho, U), p/rho)
: -dpdt
)
+ thermophysicalTransport->divq(he)

View File

@ -32,7 +32,6 @@ divSchemes
div(phi,K) Gauss upwind;
div(phid,p) Gauss upwind;
div(meshPhi,p) Gauss upwind;
div(phiv,p) Gauss upwind;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,R) Gauss upwind;

View File

@ -27,17 +27,17 @@ gradSchemes
divSchemes
{
default none;
default none;
div(phi,U) Gauss linearUpwind grad(U);
div(phi,e) Gauss linearUpwind grad(e);
div(phi,U) Gauss linearUpwind grad(U);
div(phi,e) Gauss linearUpwind grad(e);
div(phiv,p) Gauss linear;
div(phi,K) Gauss linear;
div(meshPhi,p) Gauss linear;
div(phi,(p|rho)) Gauss linear;
div(phi,K) Gauss linear;
div(meshPhi,p) Gauss linear;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -32,7 +32,6 @@ divSchemes
div(phi,U) Gauss upwind;
div(phid,p) Gauss upwind;
div(phi,K) Gauss linear;
div(phiv,p) Gauss upwind;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(U) Gauss linear;

View File

@ -32,7 +32,6 @@ divSchemes
div(phi,U) Gauss upwind;
div(phid,p) Gauss upwind;
div(phi,K) Gauss upwind;
div(phiv,p) Gauss upwind;
div(phi,e) Gauss upwind;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;

View File

@ -31,7 +31,6 @@ divSchemes
div(phi,U) Gauss upwind;
div(phid,p) Gauss upwind;
div(phi,K) Gauss upwind;
div(phiv,p) Gauss upwind;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,omega) Gauss upwind;

View File

@ -31,7 +31,6 @@ divSchemes
div(phi,U) Gauss upwind;
div(phid,p) Gauss upwind;
div(phi,K) Gauss upwind;
div(phiv,p) Gauss upwind;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,omega) Gauss upwind;

View File

@ -27,15 +27,17 @@ gradSchemes
divSchemes
{
default none;
div(phi,U) Gauss LUST grad(U);
div(phi,e) Gauss LUST grad(e);
div(phi,K) Gauss linear;
div(phiv,p) Gauss linear;
div(phi,k) Gauss limitedLinear 1;
div(phi,B) Gauss limitedLinear 1;
div(phi,muTilda) Gauss limitedLinear 1;
div(B) Gauss linear;
default none;
div(phi,U) Gauss LUST grad(U);
div(phi,e) Gauss LUST grad(e);
div(phi,K) Gauss linear;
div(phi,(p|rho)) Gauss linear;
div(phi,k) Gauss limitedLinear 1;
div(phi,B) Gauss limitedLinear 1;
div(phi,muTilda) Gauss limitedLinear 1;
div(B) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -31,24 +31,24 @@ gradSchemes
divSchemes
{
default none;
default none;
div(phi,U) Gauss linearUpwind limited;
div(phi,U) Gauss linearUpwind limited;
turbulence Gauss linearUpwind limited;
energy Gauss linearUpwind limited;
turbulence Gauss linearUpwind limited;
energy Gauss linearUpwind limited;
div(phi,k) $turbulence;
div(phi,omega) $turbulence;
div(phi,k) $turbulence;
div(phi,omega) $turbulence;
div(phi,e) $energy;
div(phi,K) $energy;
div(phi,Ekp) $energy;
div(phi,e) $energy;
div(phi,K) $energy;
div(phi,Ekp) $energy;
div(phi,(p|rho)) $energy;
div(phiv,p) Gauss upwind;
div((phi|interpolate(rho)),p) Gauss upwind;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes

View File

@ -27,19 +27,22 @@ gradSchemes
divSchemes
{
default none;
div(phi,U) bounded Gauss upwind;
div(phid,p) bounded Gauss upwind;
div(phiv,p) bounded Gauss linear;
div(phi,K) bounded Gauss linear;
div(phi,e) bounded Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
div(phi,R) bounded Gauss upwind;
div(phi,omega) bounded Gauss upwind;
div((rho*R)) Gauss linear;
div(R) Gauss linear;
div(U) Gauss linear;
default none;
div(phi,U) bounded Gauss upwind;
div(phid,p) bounded Gauss upwind;
div(phi,(p|rho)) bounded Gauss upwind;
div(phi,K) bounded Gauss linear;
div(phi,e) bounded Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
div(phi,R) bounded Gauss upwind;
div(phi,omega) bounded Gauss upwind;
div((rho*R)) Gauss linear;
div(R) Gauss linear;
div(U) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -27,14 +27,16 @@ gradSchemes
divSchemes
{
default none;
div(phi,U) Gauss limitedLinearV 1;
div(phi,e) Gauss limitedLinear 1;
div(phid,p) Gauss limitedLinear 1;
div(phi,K) Gauss limitedLinear 1;
div(phiv,p) Gauss limitedLinear 1;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
default none;
div(phi,U) Gauss limitedLinearV 1;
div(phi,e) Gauss limitedLinear 1;
div(phid,p) Gauss limitedLinear 1;
div(phi,K) Gauss limitedLinear 1;
div(phi,(p|rho)) Gauss limitedLinear 1;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -27,14 +27,16 @@ gradSchemes
divSchemes
{
default none;
div(phi,U) Gauss limitedLinearV 1;
div(phi,e) Gauss limitedLinear 1;
div(phid,p) Gauss limitedLinear 1;
div(phi,K) Gauss limitedLinear 1;
div(phiv,p) Gauss limitedLinear 1;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
default none;
div(phi,U) Gauss limitedLinearV 1;
div(phi,e) Gauss limitedLinear 1;
div(phid,p) Gauss limitedLinear 1;
div(phi,K) Gauss limitedLinear 1;
div(phi,(p|rho)) Gauss limitedLinear 1;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -36,7 +36,7 @@ divSchemes
div(phi,epsilon) Gauss linearUpwind limited;
div(phi,k) Gauss linearUpwind limited;
div(phi,K) Gauss linearUpwind limited;
div(phiv,p) Gauss linearUpwind limited;
div(phi,(p|rho)) Gauss linearUpwind limited;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -29,11 +29,13 @@ gradSchemes
divSchemes
{
default none;
div(phi,U) Gauss linearUpwind limited;
div(phi,e) Gauss linearUpwind limited;
div(phi,tracer) Gauss linearUpwind limited;
div(phi,K) Gauss linear;
div(phiv,p) Gauss linear;
div(phi,(p|rho)) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -27,13 +27,13 @@ gradSchemes
divSchemes
{
default none;
default none;
div(phi,U) Gauss limitedLinearV 1;
div(phid,p) Gauss limitedLinear 1;
div(phi,e) Gauss limitedLinear 1;
div(phi,K) Gauss limitedLinear 1;
div(phiv,p) Gauss limitedLinear 1;
div(phi,U) Gauss limitedLinearV 1;
div(phid,p) Gauss limitedLinear 1;
div(phi,e) Gauss limitedLinear 1;
div(phi,K) Gauss limitedLinear 1;
div(phi,(p|rho)) Gauss limitedLinear 1;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -27,12 +27,13 @@ gradSchemes
divSchemes
{
default none;
div(phi,U) Gauss upwind;
div(phid,p) Gauss limitedLinear 1;
div(phi,e) Gauss limitedLinear 1;
div(phi,K) Gauss limitedLinear 1;
div(phiv,p) Gauss limitedLinear 1;
default none;
div(phi,U) Gauss upwind;
div(phid,p) Gauss limitedLinear 1;
div(phi,e) Gauss limitedLinear 1;
div(phi,K) Gauss limitedLinear 1;
div(phi,(p|rho)) Gauss limitedLinear 1;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -27,11 +27,13 @@ gradSchemes
divSchemes
{
default none;
div(phi,U) Gauss limitedLinearV 1;
div(phi,e) Gauss limitedLinear 1;
div(phi,K) Gauss limitedLinear 1;
div(phiv,p) Gauss limitedLinear 1;
default none;
div(phi,U) Gauss limitedLinearV 1;
div(phi,e) Gauss limitedLinear 1;
div(phi,K) Gauss limitedLinear 1;
div(phi,(p|rho)) Gauss limitedLinear 1;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -27,12 +27,14 @@ gradSchemes
divSchemes
{
default none;
div(phi,U) Gauss upwind;
div(phid,p) Gauss limitedLinear 1;
div(phi,e) Gauss limitedLinear 1;
div(phi,K) Gauss limitedLinear 1;
div(phiv,p) Gauss limitedLinear 1;
default none;
div(phi,U) Gauss upwind;
div(phid,p) Gauss limitedLinear 1;
div(phi,e) Gauss limitedLinear 1;
div(phi,K) Gauss limitedLinear 1;
div(phi,(p|rho)) Gauss limitedLinear 1;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -27,17 +27,17 @@ gradSchemes
divSchemes
{
default none;
default none;
div(phi,U) Gauss linearUpwind grad(U);
div(phi,e) Gauss limitedLinear 1;
div(phi,U) Gauss linearUpwind grad(U);
div(phi,e) Gauss limitedLinear 1;
turbulence Gauss limitedLinear 1;
div(phi,k) $turbulence;
div(phi,epsilon) $turbulence;
turbulence Gauss limitedLinear 1;
div(phi,k) $turbulence;
div(phi,epsilon) $turbulence;
div(phiv,p) Gauss linear;
div(phi,K) Gauss linear;
div(phi,(p|rho)) Gauss limitedLinear 1;
div(phi,K) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -27,16 +27,16 @@ gradSchemes
divSchemes
{
default none;
default none;
div(phi,U) Gauss upwind;
div(phi,e) Gauss upwind;
div(phi,U) Gauss upwind;
div(phi,e) Gauss upwind;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phiv,p) Gauss linear;
div(phi,K) Gauss linear;
div(phi,(p|rho)) Gauss linear;
div(phi,K) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -31,17 +31,17 @@ gradSchemes
divSchemes
{
default none;
default none;
div(phi,U) Gauss linearUpwind limited;
div(phi,U) Gauss linearUpwind limited;
turbulence Gauss limitedLinear 1;
div(phi,k) $turbulence;
div(phi,omega) $turbulence;
div(phi,e) $turbulence;
div(phi,K) $turbulence;
turbulence Gauss limitedLinear 1;
div(phi,k) $turbulence;
div(phi,omega) $turbulence;
div(phi,e) $turbulence;
div(phi,K) $turbulence;
div(phi,(p|rho)) $turbulence;
div(phiv,p) Gauss upwind;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -28,14 +28,16 @@ gradSchemes
divSchemes
{
default none;
div(phi,U) bounded Gauss upwind;
div(phi,h) bounded Gauss upwind;
div(phi,e) bounded Gauss upwind;
div(phi,K) bounded Gauss upwind;
div(phiv,p) Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
default none;
div(phi,U) bounded Gauss upwind;
div(phi,h) bounded Gauss upwind;
div(phi,e) bounded Gauss upwind;
div(phi,K) bounded Gauss upwind;
div(phi,(p|rho)) Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -26,14 +26,16 @@ gradSchemes
divSchemes
{
default none;
div(phi,U) bounded Gauss upwind;
div(phi,h) bounded Gauss upwind;
div(phi,e) bounded Gauss upwind;
div(phiv,p) Gauss upwind;
div(phi,K) bounded Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
default none;
div(phi,U) bounded Gauss upwind;
div(phi,h) bounded Gauss upwind;
div(phi,e) bounded Gauss upwind;
div(phi,(p|rho)) bounded Gauss upwind;
div(phi,K) bounded Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -27,14 +27,15 @@ gradSchemes
divSchemes
{
default none;
default none;
div(phi,U) Gauss linearUpwind grad(U);
div(phi,Yi_h) Gauss limitedLinear 1;
div(phi,k) Gauss linearUpwind limitedGrad;
div(phi,epsilon) Gauss linearUpwind limitedGrad;
div(phi,K) Gauss linear;
div(phi,(p|rho)) Gauss linear;
div(phi,U) Gauss linearUpwind grad(U);
div(phi,Yi_h) Gauss limitedLinear 1;
div(phi,k) Gauss linearUpwind limitedGrad;
div(phi,epsilon) Gauss linearUpwind limitedGrad;
div(phi,K) Gauss linear;
div(phiv,p) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}