Skip to content

Commit 2a60bec

Browse files
committed
fix notes + remove bounded humratio as changes belongs to #24
1 parent 2d44e51 commit 2a60bec

File tree

5 files changed

+12
-17
lines changed

5 files changed

+12
-17
lines changed

src/c/psychrolib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ double GetDryAirVolume // (o) Dry air volume ft³ lb⁻¹ [IP] or in m
612612

613613
// Return dry bulb temperature from enthalpy and humidity ratio.
614614
// Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 30.
615-
// Notes: based on the `GetMoistAirEnthalpy` function, rearranged for humidity ratio.
615+
// Notes: based on the `GetMoistAirEnthalpy` function, rearranged for temperature.
616616
double GetTDryBulbFromEnthalpyAndHumRatio // (o) Dry-bulb temperature in °F [IP] or °C [SI]
617617
( double MoistAirEnthalpy // (i) Moist air enthalpy in Btu lb⁻¹ [IP] or J kg⁻¹
618618
, double HumRatio // (i) Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]
@@ -628,7 +628,7 @@ double GetTDryBulbFromEnthalpyAndHumRatio // (o) Dry-bulb temperature in °F [I
628628

629629
// Return humidity ratio from enthalpy and dry-bulb temperature.
630630
// Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 30.
631-
// Notes: based on the `GetMoistAirEnthalpy` function, rearranged for dry-bulb temperature.
631+
// Notes: based on the `GetMoistAirEnthalpy` function, rearranged for humidity ratio.
632632
double GetHumRatioFromEnthalpyAndTDryBulb // (o) Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]
633633
( double MoistAirEnthalpy // (i) Moist air enthalpy in Btu lb⁻¹ [IP] or J kg⁻¹
634634
, double TDryBulb // (i) Dry-bulb temperature in °F [IP] or °C [SI]

src/fortran/psychrolib.f90

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -828,28 +828,23 @@ function GetTDryBulbFromEnthalpyAndHumRatio(MoistAirEnthalpy, HumRatio) result(T
828828
!+ Reference:
829829
!+ ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 30
830830
!+ Notes:
831-
!+ Based on the `GetMoistAirEnthalpy` function, rearranged for humidity ratio.
831+
!+ Based on the `GetMoistAirEnthalpy` function, rearranged for temperature.
832832

833833
real, intent(in) :: MoistAirEnthalpy
834834
!+ Moist air enthalpy in Btu lb⁻¹ [IP] or J kg⁻¹
835835
real, intent(in) :: HumRatio
836836
!+ Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]
837837
real :: TDryBulb
838838
!+ Dry-bulb temperature in °F [IP] or °C [SI]
839-
real :: BoundedHumRatio
840-
!+ Local function humidity ratio bounded to no less than 1.0E-5 kgH₂O kgAIR⁻¹
841839

842840
if (HumRatio < 0.0) then
843841
error stop "Error: humidity ratio is negative"
844842
end if
845843

846-
! Bound humidity ratio to no less than 1.0E-5 kgH₂O kgAIR⁻¹
847-
BoundedHumRatio = max(HumRatio, 1.0E-5)
848-
849844
if (isIP()) then
850-
TDryBulb = (MoistAirEnthalpy - 1061.0 * BoundedHumRatio) / (0.240 + 0.444 * BoundedHumRatio)
845+
TDryBulb = (MoistAirEnthalpy - 1061.0 * HumRatio) / (0.240 + 0.444 * HumRatio)
851846
else
852-
TDryBulb = (MoistAirEnthalpy / 1000.0 - 2501.0 * BoundedHumRatio) / (1.006 + 1.86 * BoundedHumRatio)
847+
TDryBulb = (MoistAirEnthalpy / 1000.0 - 2501.0 * HumRatio) / (1.006 + 1.86 * HumRatio)
853848
end if
854849
end function GetTDryBulbFromEnthalpyAndHumRatio
855850

@@ -858,7 +853,7 @@ function GetHumRatioFromEnthalpyAndTDryBulb(MoistAirEnthalpy, TDryBulb) result(H
858853
!+ Reference:
859854
!+ ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 30
860855
!+ Notes:
861-
!+ Based on the `GetMoistAirEnthalpy` function, rearranged for dry-bulb temperature.
856+
!+ Based on the `GetMoistAirEnthalpy` function, rearranged for humidity ratio.
862857

863858
real, intent(in) :: MoistAirEnthalpy
864859
!+ Moist air enthalpy in Btu lb⁻¹ [IP] or J kg⁻¹

src/js/psychrolib.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ function Psychrometrics() {
571571

572572
// Return dry bulb temperature from enthalpy and humidity ratio.
573573
// Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 30.
574-
// Notes: based on the `GetMoistAirEnthalpy` function, rearranged for humidity ratio.
574+
// Notes: based on the `GetMoistAirEnthalpy` function, rearranged for temperature.
575575
this.GetTDryBulbFromEnthalpyAndHumRatio = function // (o) Dry-bulb temperature in °F [IP] or °C [SI]
576576
( MoistAirEnthalpy // (i) Moist air enthalpy in Btu lb⁻¹ [IP] or J kg⁻¹
577577
, HumRatio // (i) Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻¹ [SI]
@@ -587,7 +587,7 @@ function Psychrometrics() {
587587

588588
// Return humidity ratio from enthalpy and dry-bulb temperature.
589589
// Reference: ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 30.
590-
// Notes: based on the `GetMoistAirEnthalpy` function, rearranged for dry-bulb temperature.
590+
// Notes: based on the `GetMoistAirEnthalpy` function, rearranged for humidity ratio.
591591
this.GetHumRatioFromEnthalpyAndTDryBulb = function // (o) Humidity ratio in lb_H₂O lb_Air⁻¹ [IP] or kg_H₂O kg_Air⁻
592592
( MoistAirEnthalpy // (i) Moist air enthalpy in Btu lb⁻¹ [IP] or J kg⁻¹
593593
, TDryBulb // (i) Dry-bulb temperature in °F [IP] or °C [SI]

src/python/psychrolib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ def GetTDryBulbFromEnthalpyAndHumRatio(MoistAirEnthalpy: float, HumRatio: float)
816816
ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 30
817817
818818
Notes:
819-
Based on the `GetMoistAirEnthalpy` function, rearranged for humidity ratio.
819+
Based on the `GetMoistAirEnthalpy` function, rearranged for temperature.
820820
821821
"""
822822
if HumRatio < 0:
@@ -844,7 +844,7 @@ def GetHumRatioFromEnthalpyAndTDryBulb(MoistAirEnthalpy: float, TDryBulb: float)
844844
ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 30.
845845
846846
Notes:
847-
Based on the `GetMoistAirEnthalpy` function, rearranged for dry-bulb temperature.
847+
Based on the `GetMoistAirEnthalpy` function, rearranged for humidity ratio.
848848
849849
"""
850850
if isIP():

src/vba/psychrolib.bas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ Function GetTDryBulbFromEnthalpyAndHumRatio(ByVal MoistAirEnthalpy As Variant, B
10811081
' ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 30
10821082
'
10831083
' Notes:
1084-
' Based on the `GetMoistAirEnthalpy` function, rearranged for humidity ratio.
1084+
' Based on the `GetMoistAirEnthalpy` function, rearranged for temperature.
10851085
'
10861086

10871087
On Error GoTo ErrHandler
@@ -1119,7 +1119,7 @@ Function GetHumRatioFromEnthalpyAndTDryBulb(ByVal MoistAirEnthalpy As Variant, B
11191119
' ASHRAE Handbook - Fundamentals (2017) ch. 1 eqn 30
11201120
'
11211121
' Notes:
1122-
' Based on the `GetMoistAirEnthalpy` function, rearranged for dry-bulb temperature.
1122+
' Based on the `GetMoistAirEnthalpy` function, rearranged for humidity ratio.
11231123
'
11241124

11251125
On Error GoTo ErrHandler

0 commit comments

Comments
 (0)