diff --git a/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C b/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C index a6f6b3ca889c8a277a1bed2b326416df57b9c154..509c7d70cc6000c3d271dc65222099e8511ba741 100644 --- a/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C +++ b/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C @@ -82,20 +82,20 @@ void Foam::porousMedia::fixedTemperature::addEnthalpySource scalarField& hDiag = hEqn.diag(); scalarField& hSource = hEqn.source(); - tmp<volScalarField> Cp = thermo.Cp(); + const scalarField T(hDiag.size(), T_); - // TODO: generalize for non-fixedTemperature methods const scalar rate = 1e6; forAll(zones, zoneI) { const labelList& cells = mesh.cellZones()[zones[zoneI]]; + tmp<scalarField> h = thermo.h(T, cells); forAll(cells, i) { hDiag[cells[i]] += rate*V[cells[i]]*rho[cells[i]]; hSource[cells[i]] += - rate*V[cells[i]]*rho[cells[i]]*Cp()[cells[i]]*T_; + rate*V[cells[i]]*rho[cells[i]]*h()[cells[i]]; } } }