From 90ce63f6942d529d2aa6826b4729e78114ecdd4b Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Mon, 14 Aug 2017 08:59:43 +0100 Subject: [PATCH] ThermoParcel: Improved numerical stability of heat transfer term Patch contributed by Timo Niemi, VTT. Resolves bug-report https://bugs.openfoam.org/view.php?id=2655 --- .../parcels/Templates/ThermoParcel/ThermoParcel.C | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C index 46454ec7a..cbb07ee46 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C @@ -282,7 +282,7 @@ Foam::scalar Foam::ThermoParcel::calcHeatTransfer const scalar As = this->areaS(d); scalar ap = Tc_ + Sh/(As*htc); - scalar bp = 6.0*(Sh/As + htc*(Tc_ - T_)); + const scalar bp = 6.0*htc/max(rho*d*Cp_, ROOTVSMALL); if (td.cloud().radiation()) { tetIndices tetIs = this->currentTetIndices(); @@ -294,9 +294,7 @@ Foam::scalar Foam::ThermoParcel::calcHeatTransfer scalar s = epsilon*(Gc/4.0 - sigma*pow4(T_)); ap += s/htc; - bp += 6.0*s; } - bp /= rho*d*Cp_*(ap - T_) + ROOTVSMALL; // Integrate to find the new parcel temperature IntegrationScheme::integrationResult Tres =