function GetMoistAirEnthalpy(TDryBulb, HumRatio) result(MoistAirEnthalpy)
!+ Return moist air enthalpy given dry-bulb temperature and humidity ratio.
!+ Reference:
!+ ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 30
real, intent(in) :: TDryBulb
!+ Dry-bulb temperature in °F [IP] or °C [SI]
real, intent(in) :: HumRatio
!+ Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]
real :: MoistAirEnthalpy
!+ Moist air enthalpy in Btu lb⁻¹ [IP] or J kg⁻¹
real :: BoundedHumRatio
!+ Humidity ratio bounded to MIN_HUM_RATIO
if (HumRatio < 0.0) then
error stop "Error: humidity ratio is negative"
end if
BoundedHumRatio = max(HumRatio, MIN_HUM_RATIO)
if (isIP()) then
MoistAirEnthalpy = 0.240 * TDryBulb + BoundedHumRatio * (1061.0 + 0.444 * TDryBulb)
else
MoistAirEnthalpy = (1.006 * TDryBulb + BoundedHumRatio * (2501.0 + 1.86 * TDryBulb)) * 1000.0
end if
end function GetMoistAirEnthalpy