mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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/
50 lines
1.1 KiB
C
50 lines
1.1 KiB
C
{
|
|
autoPtr<phaseSystem::heatTransferTable>
|
|
heatTransferPtr(fluid.heatTransfer());
|
|
|
|
phaseSystem::heatTransferTable&
|
|
heatTransfer = heatTransferPtr();
|
|
|
|
{
|
|
tmp<fvScalarMatrix> E1Eqn(phase1.heEqn());
|
|
|
|
if (E1Eqn.valid())
|
|
{
|
|
E1Eqn =
|
|
(
|
|
E1Eqn
|
|
==
|
|
*heatTransfer[phase1.name()]
|
|
+ alpha1*rho1*(U1&g)
|
|
+ fvOptions(alpha1, rho1, phase1.thermo().he())
|
|
);
|
|
|
|
E1Eqn->relax();
|
|
fvOptions.constrain(E1Eqn());
|
|
E1Eqn->solve();
|
|
}
|
|
}
|
|
|
|
{
|
|
tmp<fvScalarMatrix> E2eqn(phase2.heEqn());
|
|
|
|
if (E2eqn.valid())
|
|
{
|
|
E2eqn =
|
|
(
|
|
E2eqn
|
|
==
|
|
*heatTransfer[phase2.name()]
|
|
+ alpha2*rho2*(U2&g)
|
|
+ fvOptions(alpha2, rho2, phase2.thermo().he())
|
|
);
|
|
|
|
E2eqn->relax();
|
|
fvOptions.constrain(E2eqn());
|
|
E2eqn->solve();
|
|
}
|
|
}
|
|
}
|
|
|
|
fluid.correctThermo();
|