Skip to content
Snippets Groups Projects
Commit d0f15d4e authored by Henry Weller's avatar Henry Weller
Browse files

EEqn: Added rho*(U&g) source term

Generally this term has a VERY small effect on temperature, it is only
important for low-speed buoyancy-dominated flows.

Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1755

See also http://cfd.direct/openfoam/energy-equation/
parent b0719c35
Branches
Tags
No related merge requests found
Showing
with 50 additions and 33 deletions
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
) )
- fvm::laplacian(turbulence->alphaEff(), he) - fvm::laplacian(turbulence->alphaEff(), he)
== ==
reaction->Sh() rho*(U&g)
+ reaction->Sh()
+ fvOptions(rho, he) + fvOptions(rho, he)
); );
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
) )
- fvm::laplacian(turbulence->alphaEff(), he) - fvm::laplacian(turbulence->alphaEff(), he)
== ==
radiation->Sh(thermo) rho*(U&g)
+ radiation->Sh(thermo)
+ fvOptions(rho, he) + fvOptions(rho, he)
); );
......
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
) )
- fvm::laplacian(turbulence->alphaEff(), he) - fvm::laplacian(turbulence->alphaEff(), he)
== ==
radiation->Sh(thermo) rho*(U&g)
+ radiation->Sh(thermo)
+ fvOptions(rho, he) + fvOptions(rho, he)
); );
......
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
) )
- fvm::laplacian(turb.alphaEff(), he) - fvm::laplacian(turb.alphaEff(), he)
== ==
rad.Sh(thermo) rho*(U&g)
+ rad.Sh(thermo)
+ fvOptions(rho, he) + fvOptions(rho, he)
); );
......
...@@ -29,5 +29,7 @@ ...@@ -29,5 +29,7 @@
const bool frozenFlow = frozenFlowFluid[i]; const bool frozenFlow = frozenFlowFluid[i];
volScalarField& p_rgh = p_rghFluid[i]; volScalarField& p_rgh = p_rghFluid[i];
const dimensionedVector& g = gFluid[i];
const volScalarField& gh = ghFluid[i]; const volScalarField& gh = ghFluid[i];
const surfaceScalarField& ghf = ghfFluid[i]; const surfaceScalarField& ghf = ghfFluid[i];
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
) )
- fvm::laplacian(turb.alphaEff(), he) - fvm::laplacian(turb.alphaEff(), he)
== ==
rad.Sh(thermo) rho*(U&g)
+ rad.Sh(thermo)
+ fvOptions(rho, he) + fvOptions(rho, he)
); );
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
const volScalarField& psi = thermo.psi(); const volScalarField& psi = thermo.psi();
volScalarField& p_rgh = p_rghFluid[i]; volScalarField& p_rgh = p_rghFluid[i];
const dimensionedVector& g = gFluid[i];
const volScalarField& gh = ghFluid[i]; const volScalarField& gh = ghFluid[i];
const surfaceScalarField& ghf = ghfFluid[i]; const surfaceScalarField& ghf = ghfFluid[i];
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
) )
- fvm::laplacian(turbulence->alphaEff(), he) - fvm::laplacian(turbulence->alphaEff(), he)
== ==
combustion->Sh() rho*(U&g)
+ combustion->Sh()
+ coalParcels.Sh(he) + coalParcels.Sh(he)
+ limestoneParcels.Sh(he) + limestoneParcels.Sh(he)
+ radiation->Sh(thermo) + radiation->Sh(thermo)
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
) )
- fvm::laplacian(turbulence->alphaEff(), he) - fvm::laplacian(turbulence->alphaEff(), he)
== ==
parcels.Sh(he) rho*(U&g)
+ parcels.Sh(he)
+ surfaceFilm.Sh() + surfaceFilm.Sh()
+ radiation->Sh(thermo) + radiation->Sh(thermo)
+ combustion->Sh() + combustion->Sh()
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
) )
- fvm::laplacian(turbulence->alphaEff(), he) - fvm::laplacian(turbulence->alphaEff(), he)
== ==
parcels.Sh(he) rho*(U&g)
+ parcels.Sh(he)
+ radiation->Sh(thermo) + radiation->Sh(thermo)
+ combustion->Sh() + combustion->Sh()
+ fvOptions(rho, he) + fvOptions(rho, he)
......
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
) )
- fvm::laplacian(turbulence->alphaEff(), he) - fvm::laplacian(turbulence->alphaEff(), he)
== ==
parcels.Sh(he) rho*(U&g)
+ parcels.Sh(he)
+ radiation->Sh(thermo) + radiation->Sh(thermo)
+ combustion->Sh() + combustion->Sh()
+ fvOptions(rho, he) + fvOptions(rho, he)
......
...@@ -6,40 +6,42 @@ ...@@ -6,40 +6,42 @@
heatTransfer = heatTransferPtr(); heatTransfer = heatTransferPtr();
{ {
tmp<fvScalarMatrix> he1Eqn(phase1.heEqn()); tmp<fvScalarMatrix> E1Eqn(phase1.heEqn());
if (he1Eqn.valid()) if (E1Eqn.valid())
{ {
he1Eqn = E1Eqn =
( (
he1Eqn E1Eqn
== ==
*heatTransfer[phase1.name()] *heatTransfer[phase1.name()]
+ alpha1*rho1*(U1&g)
+ fvOptions(alpha1, rho1, phase1.thermo().he()) + fvOptions(alpha1, rho1, phase1.thermo().he())
); );
he1Eqn->relax(); E1Eqn->relax();
fvOptions.constrain(he1Eqn()); fvOptions.constrain(E1Eqn());
he1Eqn->solve(); E1Eqn->solve();
} }
} }
{ {
tmp<fvScalarMatrix> he2Eqn(phase2.heEqn()); tmp<fvScalarMatrix> E2eqn(phase2.heEqn());
if (he2Eqn.valid()) if (E2eqn.valid())
{ {
he2Eqn = E2eqn =
( (
he2Eqn E2eqn
== ==
*heatTransfer[phase2.name()] *heatTransfer[phase2.name()]
+ alpha2*rho2*(U2&g)
+ fvOptions(alpha2, rho2, phase2.thermo().he()) + fvOptions(alpha2, rho2, phase2.thermo().he())
); );
he2Eqn->relax(); E2eqn->relax();
fvOptions.constrain(he2Eqn()); fvOptions.constrain(E2eqn());
he2Eqn->solve(); E2eqn->solve();
} }
} }
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
volScalarField Kh(fluid.Kh()); volScalarField Kh(fluid.Kh());
fvScalarMatrix he1Eqn fvScalarMatrix E1Eqn
( (
fvm::ddt(alpha1, rho1, he1) + fvm::div(alphaRhoPhi1, he1) fvm::ddt(alpha1, rho1, he1) + fvm::div(alphaRhoPhi1, he1)
- fvm::Sp(contErr1, he1) - fvm::Sp(contErr1, he1)
...@@ -28,17 +28,18 @@ ...@@ -28,17 +28,18 @@
) )
); );
he1Eqn.relax(); E1Eqn.relax();
he1Eqn -= E1Eqn -=
( (
Kh*(thermo2.T() - thermo1.T()) Kh*(thermo2.T() - thermo1.T())
+ Kh*he1/Cpv1 + Kh*he1/Cpv1
- fvm::Sp(Kh/Cpv1, he1) - fvm::Sp(Kh/Cpv1, he1)
+ alpha1*rho1*(U1&g)
+ fvOptions(alpha1, rho1, he1) + fvOptions(alpha1, rho1, he1)
); );
fvScalarMatrix he2Eqn fvScalarMatrix E2Eqn
( (
fvm::ddt(alpha2, rho2, he2) + fvm::div(alphaRhoPhi2, he2) fvm::ddt(alpha2, rho2, he2) + fvm::div(alphaRhoPhi2, he2)
- fvm::Sp(contErr2, he2) - fvm::Sp(contErr2, he2)
...@@ -59,21 +60,22 @@ ...@@ -59,21 +60,22 @@
) )
); );
he2Eqn.relax(); E2Eqn.relax();
he2Eqn -= E2Eqn -=
( (
Kh*(thermo1.T() - thermo2.T()) Kh*(thermo1.T() - thermo2.T())
+ Kh*he2/Cpv2 + Kh*he2/Cpv2
- fvm::Sp(Kh/Cpv2, he2) - fvm::Sp(Kh/Cpv2, he2)
+ alpha2*rho2*(U2&g)
+ fvOptions(alpha2, rho2, he2) + fvOptions(alpha2, rho2, he2)
); );
fvOptions.constrain(he1Eqn); fvOptions.constrain(E1Eqn);
he1Eqn.solve(); E1Eqn.solve();
fvOptions.constrain(he2Eqn); fvOptions.constrain(E2Eqn);
he2Eqn.solve(); E2Eqn.solve();
thermo1.correct(); thermo1.correct();
Info<< "min " << thermo1.T().name() Info<< "min " << thermo1.T().name()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment