Class: Toji::PsychrometryToRelativeHumidity
- Inherits:
-
Object
- Object
- Toji::PsychrometryToRelativeHumidity
- Defined in:
- lib/toji/psychrometry_to_relative_humidity.rb
Overview
乾湿差から相対湿度へ変換
Instance Attribute Summary collapse
-
#k ⇒ Object
readonly
Returns the value of attribute k.
-
#pressure ⇒ Object
readonly
Returns the value of attribute pressure.
-
#swvp ⇒ Object
readonly
Returns the value of attribute swvp.
Instance Method Summary collapse
- #convert(t_wet, t_dry) ⇒ Object
-
#initialize(swvp: Swvp.default, pressure: 1013, k: 0.000662) ⇒ PsychrometryToRelativeHumidity
constructor
A new instance of PsychrometryToRelativeHumidity.
Constructor Details
#initialize(swvp: Swvp.default, pressure: 1013, k: 0.000662) ⇒ PsychrometryToRelativeHumidity
Returns a new instance of PsychrometryToRelativeHumidity.
10 11 12 13 14 |
# File 'lib/toji/psychrometry_to_relative_humidity.rb', line 10 def initialize(swvp: Swvp.default, pressure: 1013, k: 0.000662) @swvp = swvp @pressure = pressure @k = k end |
Instance Attribute Details
#k ⇒ Object (readonly)
Returns the value of attribute k.
8 9 10 |
# File 'lib/toji/psychrometry_to_relative_humidity.rb', line 8 def k @k end |
#pressure ⇒ Object (readonly)
Returns the value of attribute pressure.
7 8 9 |
# File 'lib/toji/psychrometry_to_relative_humidity.rb', line 7 def pressure @pressure end |
#swvp ⇒ Object (readonly)
Returns the value of attribute swvp.
6 7 8 |
# File 'lib/toji/psychrometry_to_relative_humidity.rb', line 6 def swvp @swvp end |
Instance Method Details
#convert(t_wet, t_dry) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/toji/psychrometry_to_relative_humidity.rb', line 16 def convert(t_wet, t_dry) p_wet = swvp.calc(t_wet) p_dry = swvp.calc(t_dry) p_w = p_wet - pressure * k * (t_dry - t_wet) p_w / p_dry end |