@@ -69,6 +69,8 @@ module psychrolib
6969 public :: GetDryAirEnthalpy
7070 public :: GetDryAirDensity
7171 public :: GetDryAirVolume
72+ public :: GetTDryBulbFromEnthalpyAndHumRatio
73+ public :: GetHumRatioFromEnthalpyAndTDryBulb
7274 public :: GetSatVapPres
7375 public :: GetSatHumRatio
7476 public :: GetSatAirEnthalpy
@@ -821,6 +823,52 @@ function GetDryAirVolume(TDryBulb, Pressure) result(DryAirVolume)
821823 end if
822824 end function GetDryAirVolume
823825
826+ function GetTDryBulbFromEnthalpyAndHumRatio (MoistAirEnthalpy , HumRatio ) result(TDryBulb)
827+ ! + Return dry bulb temperature from enthalpy and humidity ratio.
828+ ! + Reference:
829+ ! + ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 30
830+ ! + Notes:
831+ ! + Based on the `GetMoistAirEnthalpy` function, rearranged for temperature.
832+
833+ real , intent (in ) :: MoistAirEnthalpy
834+ ! + Moist air enthalpy in Btu lb⁻¹ [IP] or J kg⁻¹
835+ real , intent (in ) :: HumRatio
836+ ! + Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]
837+ real :: TDryBulb
838+ ! + Dry-bulb temperature in °F [IP] or °C [SI]
839+
840+ if (HumRatio < 0.0 ) then
841+ error stop " Error: humidity ratio is negative"
842+ end if
843+
844+ if (isIP()) then
845+ TDryBulb = (MoistAirEnthalpy - 1061.0 * HumRatio) / (0.240 + 0.444 * HumRatio)
846+ else
847+ TDryBulb = (MoistAirEnthalpy / 1000.0 - 2501.0 * HumRatio) / (1.006 + 1.86 * HumRatio)
848+ end if
849+ end function GetTDryBulbFromEnthalpyAndHumRatio
850+
851+ function GetHumRatioFromEnthalpyAndTDryBulb (MoistAirEnthalpy , TDryBulb ) result(HumRatio)
852+ ! + Return humidity ratio from enthalpy and dry-bulb temperature.
853+ ! + Reference:
854+ ! + ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 30
855+ ! + Notes:
856+ ! + Based on the `GetMoistAirEnthalpy` function, rearranged for humidity ratio.
857+
858+ real , intent (in ) :: MoistAirEnthalpy
859+ ! + Moist air enthalpy in Btu lb⁻¹ [IP] or J kg⁻¹
860+ real , intent (in ) :: TDryBulb
861+ ! + Dry-bulb temperature in °F [IP] or °C [SI]
862+ real :: HumRatio
863+ ! + Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]
864+
865+ if (isIP()) then
866+ HumRatio = (MoistAirEnthalpy - 0.240 * TDryBulb) / (1061.0 + 0.444 * TDryBulb)
867+ else
868+ HumRatio = (MoistAirEnthalpy / 1000.0 - 1.006 * TDryBulb) / (2501.0 + 1.86 * TDryBulb)
869+ end if
870+ end function GetHumRatioFromEnthalpyAndTDryBulb
871+
824872
825873 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
826874 ! Saturated Air Calculations
0 commit comments