Thermodynamics: E-equation generalized to handle mesh motion

This commit is contained in:
Henry 2012-10-08 15:39:29 +01:00
parent 0086cb34d2
commit f897de27b8
20 changed files with 129 additions and 38 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -66,5 +66,5 @@ K = 0.5*magSqr(U);
if (thermo.dpdt()) if (thermo.dpdt())
{ {
dpdt = fvc::ddt(p); dpdt = fvc::ddt(p) - fvc::div(fvc::meshPhi(rho, U), p);
} }

View File

@ -55,7 +55,12 @@ tmp<fv::convectionScheme<scalar> > mvConvection
+ fvc::ddt(rho, K) + fvc::div(phi, K) + fvc::ddt(rho, K) + fvc::div(phi, K)
+ ( + (
he.name() == "e" he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho)) ? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt : -dpdt
) )
- fvm::laplacian(turbulence->alphaEff(), he) - fvm::laplacian(turbulence->alphaEff(), he)

View File

@ -7,7 +7,12 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K) + fvc::ddt(rho, K) + fvc::div(phi, K)
+ ( + (
he.name() == "e" he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho)) ? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt : -dpdt
) )
- fvm::laplacian(turbulence->alphaEff(), he) - fvm::laplacian(turbulence->alphaEff(), he)

View File

@ -7,7 +7,12 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K) + fvc::ddt(rho, K) + fvc::div(phi, K)
+ ( + (
he.name() == "e" he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho)) ? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt : -dpdt
) )
- fvm::laplacian(turbulence->alphaEff(), he) - fvm::laplacian(turbulence->alphaEff(), he)

View File

@ -2,7 +2,8 @@
solve solve
( (
fvm::ddt(rho, e) + fvm::div(phi, e) fvm::ddt(rho, e) + fvm::div(phi, e)
+ fvc::ddt(rho, K) + fvc::div(phi, volScalarField("Ekp", K + p/rho)) + fvc::ddt(rho, K) + fvc::div(phi, K)
+ fvc::div(fvc::absolute(phi/fvc::interpolate(rho), U), p, "div(phiv,p)")
- fvm::laplacian(turbulence->alphaEff(), e) - fvm::laplacian(turbulence->alphaEff(), e)
); );

View File

@ -1,11 +0,0 @@
{
solve
(
fvm::ddt(rho, e) + fvm::div(phi, e)
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ fvc::div(phi/fvc::interpolate(rho) + mesh.phi(), p, "div(phiv,p)")
- fvm::laplacian(turbulence->alphaEff(), e)
);
thermo.correct();
}

View File

@ -7,7 +7,12 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K) + fvc::ddt(rho, K) + fvc::div(phi, K)
+ ( + (
he.name() == "e" he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho)) ? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt : -dpdt
) )
- fvm::laplacian(turb.alphaEff(), he) - fvm::laplacian(turb.alphaEff(), he)

View File

@ -7,7 +7,12 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K) + fvc::ddt(rho, K) + fvc::div(phi, K)
+ ( + (
he.name() == "e" he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho)) ? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt : -dpdt
) )
- fvm::laplacian(turbulence->alphaEff(), he) - fvm::laplacian(turbulence->alphaEff(), he)

View File

@ -7,7 +7,12 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K) + fvc::ddt(rho, K) + fvc::div(phi, K)
+ ( + (
he.name() == "e" he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho)) ? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt : -dpdt
) )
- fvm::laplacian(turbulence->alphaEff(), he) - fvm::laplacian(turbulence->alphaEff(), he)

View File

@ -7,7 +7,12 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K) + fvc::ddt(rho, K) + fvc::div(phi, K)
+ ( + (
he.name() == "e" he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho)) ? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt : -dpdt
) )
- fvm::laplacian(turbulence->alphaEff(), he) - fvm::laplacian(turbulence->alphaEff(), he)

View File

@ -79,5 +79,5 @@ K = 0.5*magSqr(U);
if (thermo.dpdt()) if (thermo.dpdt())
{ {
dpdt = fvc::ddt(p); dpdt = fvc::ddt(p) - fvc::div(fvc::meshPhi(rho, U), p);
} }

View File

@ -148,4 +148,39 @@ void Foam::fvc::makeAbsolute
} }
Foam::tmp<Foam::surfaceScalarField> Foam::fvc::absolute
(
const tmp<surfaceScalarField>& tphi,
const volVectorField& U
)
{
if (tphi().mesh().moving())
{
return tphi + fvc::meshPhi(U);
}
else
{
return tphi;
}
}
Foam::tmp<Foam::surfaceScalarField> Foam::fvc::absolute
(
const tmp<surfaceScalarField>& tphi,
const volScalarField& rho,
const volVectorField& U
)
{
if (tphi().mesh().moving())
{
return tphi + fvc::meshPhi(rho, U);
}
else
{
return tphi;
}
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -116,6 +116,22 @@ namespace fvc
const volScalarField& rho, const volScalarField& rho,
const volVectorField& U const volVectorField& U
); );
//- Return the given relative flux in absolute form
tmp<surfaceScalarField> absolute
(
const tmp<surfaceScalarField>& tphi,
const volVectorField& U
);
//- Return the given relative flux in absolute form
tmp<surfaceScalarField> absolute
(
const tmp<surfaceScalarField>& tphi,
const volScalarField& rho,
const volVectorField& U
);
} }

View File

@ -24,6 +24,7 @@ thermoType
equationOfState perfectGas; equationOfState perfectGas;
specie specie; specie specie;
energy absoluteEnthalpy; energy absoluteEnthalpy;
//energy absoluteInternalEnergy;
} }
stoichiometricAirFuelMassRatio stoichiometricAirFuelMassRatio [ 0 0 0 0 0 0 0 ] 15.0336; stoichiometricAirFuelMassRatio stoichiometricAirFuelMassRatio [ 0 0 0 0 0 0 0 ] 15.0336;

View File

@ -31,6 +31,8 @@ divSchemes
div(phi,U) Gauss upwind; div(phi,U) Gauss upwind;
div(phi,K) Gauss upwind; div(phi,K) Gauss upwind;
div(phid,p) Gauss upwind; div(phid,p) Gauss upwind;
div(meshPhi,p) Gauss upwind;
div(phiv,p) Gauss upwind;
div(phi,k) Gauss upwind; div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind; div(phi,epsilon) Gauss upwind;
div(phi,R) Gauss upwind; div(phi,R) Gauss upwind;
@ -45,6 +47,8 @@ divSchemes
b limitedLinear01 1; b limitedLinear01 1;
ha limitedLinear 1; ha limitedLinear 1;
hau limitedLinear 1; hau limitedLinear 1;
ea limitedLinear 1;
eau limitedLinear 1;
}; };
div(U) Gauss linear; div(U) Gauss linear;
div((Su*grad(b))) Gauss linear; div((Su*grad(b))) Gauss linear;
@ -54,17 +58,7 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default none; default Gauss linear limited 0.5;
laplacian(muEff,U) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear limited 0.5;
laplacian(DepsilonEff,epsilon) Gauss linear limited 0.5;
laplacian(DREff,R) Gauss linear limited 0.5;
laplacian((rho*(1|A(U))),p) Gauss linear limited 0.5;
laplacian(alphaEff,b) Gauss linear limited 0.5;
laplacian(muEff,ft) Gauss linear limited 0.5;
laplacian(alphaEff,ha) Gauss linear limited 0.5;
laplacian(alphaEff,hau) Gauss linear limited 0.5;
laplacian(alphaEff,ft) Gauss linear limited 0.5;
} }
interpolationSchemes interpolationSchemes

View File

@ -47,14 +47,14 @@ solvers
relTol 0; relTol 0;
} }
"(U|Xi|hau|ft|b|ha|k|epsilon)" "(U|Xi|hau|eau|ft|b|ha|ea|k|epsilon)"
{ {
solver PBiCG; solver PBiCG;
preconditioner DILU; preconditioner DILU;
tolerance 1e-05; tolerance 1e-05;
relTol 0.1; relTol 0.1;
} }
"(U|ft|Xi|hau|b|ha|k|epsilon)Final" "(U|ft|Xi|hau|eau|b|ha|ea|k|epsilon)Final"
{ {
$U; $U;
tolerance 1e-05; tolerance 1e-05;