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/
32 lines
652 B
C
32 lines
652 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(turb.alphaEff(), he)
|
|
==
|
|
rho*(U&g)
|
|
+ rad.Sh(thermo)
|
|
+ fvOptions(rho, he)
|
|
);
|
|
|
|
EEqn.relax();
|
|
|
|
fvOptions.constrain(EEqn);
|
|
|
|
EEqn.solve();
|
|
|
|
fvOptions.correct(he);
|
|
|
|
thermo.correct();
|
|
rad.correct();
|
|
|
|
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
|
|
<< max(thermo.T()).value() << endl;
|
|
}
|