OpenFOAM-4.x/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/EEqn.H
Henry Weller d5c8a45f5c 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/
2015-07-01 10:53:37 +01:00

38 lines
792 B
C

{
volScalarField& he = thermo.he();
fvScalarMatrix EEqn
(
fvm::ddt(rho, he) + fvm::div(phi, he)
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
he.name() == "e"
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt
)
- fvm::laplacian(turb.alphaEff(), he)
==
rho*(U&g)
+ rad.Sh(thermo)
+ fvOptions(rho, he)
);
EEqn.relax();
fvOptions.constrain(EEqn);
EEqn.solve(mesh.solver(he.select(finalIter)));
fvOptions.correct(he);
thermo.correct();
rad.correct();
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
<< max(thermo.T()).value() << endl;
}