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/
29 lines
570 B
C
29 lines
570 B
C
{
|
|
volScalarField& he = thermo.he();
|
|
|
|
fvScalarMatrix EEqn
|
|
(
|
|
fvm::div(phi, he)
|
|
+ (
|
|
he.name() == "e"
|
|
? fvc::div(phi, volScalarField("Ekp", 0.5*magSqr(U) + p/rho))
|
|
: fvc::div(phi, volScalarField("K", 0.5*magSqr(U)))
|
|
)
|
|
- fvm::laplacian(turbulence->alphaEff(), he)
|
|
==
|
|
rho*(U&g)
|
|
+ radiation->Sh(thermo)
|
|
+ fvOptions(rho, he)
|
|
);
|
|
|
|
EEqn.relax();
|
|
|
|
fvOptions.constrain(EEqn);
|
|
|
|
EEqn.solve();
|
|
|
|
fvOptions.correct(he);
|
|
|
|
thermo.correct();
|
|
radiation->correct();
|
|
}
|