Humidifier Sizing in Python with Humidity Ratio
Zusammenfassung
Pixel shares a Python humidifier-sizing model that tracks humidity ratio rather than relative humidity, which changes as air heats or cools. Using ASHRAE psychrometric equations, the model calculates moisture load from air leakage and shows why a house may need less humidifier water on the coldest days.
DEV Community
Humidifier Sizing in Python: Track Humidity Ratio, Not RH
Relative humidity is the number everyone reads and the wrong one to compute with. Heat 15°F air at 70% RH to 70°F and it drops to about 8% RH, yet not a single grain of water was added or removed. If your code stores humidity as RH and carries it through a heating step, every downstream number is wrong. The variable that survives heating and cooling is the humidity ratio W: pounds of water per pound of dry air (or grains per pound, 7,000 grains = 1 lb). This post builds a small humidifier-sizing model around W, using the psychrometric equations from the ASHRAE Handbook of Fundamentals, and ends with a result that runs against intuition: on the coldest days a house needs less humidifier water, not more. The model Four functions do all the work: p_ws(t): saturation vapor pressure over water (Hyland-Wexler form from ASHRAE Fundamentals, chapter 1). humidity_ratio(t, rh): W = 0.621945 × p_w / (p − p_w). rh_from_w(t, w): the inverse, for checking what RH a given W means at a new temperature. specific_volume(t, w): ft³ of moist air per lb of dry air, so a volumetric leakage rate can be turned into a mass flow. Then the humidifier load is just a mass balance on the air that leaks in: water [lb/h] = dry air [lb/h] × (W_indoor − W_outdoor)
import math
P_ATM = 14.696 # psia, sea level
def p_ws(t_f):
"""Saturation vapor pressure over liquid water, psia.
Hyland-Wexler form, ASHRAE Handbook - Fundamentals, ch. 1."""
T = t_f + 459.67
C8, C9, C10, C11, C12, C13 = (-1.0440397e4, -1.1294650e1, -2.7022355e-2,
1.2890360e-5, -2.4780681e-9, 6.5459673)
return math.exp(C8/T + C9 + C10T + C11T2 + C12*T3 + C13*math.log(T))
def humidity_ratio(t_f, rh):
"""lb water per lb dry air."""
p_w = rh * p_ws(t_f)
return 0.621945 * p_w / (P_ATM - p_w)
def rh_from_w(t_f, w):
p_w = w * P_ATM / (0.621945 + w)
return p_w / p_ws(t_f)
def specific_volume(t_f, w):
"""ft3 per lb dry air."""
return 0.370486 * (t_f + 459.67) * (1 + 1.607858 * w) / P_ATM
def humidifier_gal_per_day(volume_ft3, ach, t_out, rh_out, t_in, rh_in):
w_out = humidity_ratio(t_out, rh_out)
w_in = humidity_ratio(t_in, rh_in)
dry_air_lb_h = volume_ft3 * ach / specific_volume(t_in, w_in)
water_lb_h = dry_air_lb_h * max(w_in - w_out, 0.0)
return water_lb_h * 24 / 8.34 # 8.34 lb per gallon
w = humidity_ratio(15, 0.70)
print(f"15F/70% outdoors: {w*7000:.1f} gr/lb")
print(f"same air at 70F: {rh_from_w(70, w):.1%} RH")
Winter limits (max indoor RH at 70F by outdoor temp band, mncee.org table)
limits = [(30, 0.40), (15, 0.35), (5, 0.30), (-5, 0.25), (-15, 0.20)]
for t_out, rh_max in limits:
g = humidifier_gal_per_day(16000, 0.35, t_out, 0.70, 70, rh_max)
print(f"{t_out:>4}F target {rh_max:.0%} -> {g:.1f} gal/day")
Output: 15F/70% outdoors: 9.0 gr/lb
same air at 70F: 8.4% RH
30F target 40% -> 4.5 gal/day
15F target 35% -> 5.0 gal/day
5F target 30% -> 4.6 gal/day
- 5F target 25% -> 4.0 gal/day
- 15F target 20% -> 3.3 gal/day
Reading the numbers Heating does not dry air. 15°F outdoor air at 70% RH carries 9.0 grains per pound. Heated to 70°F, the same 9.0 grains read as 8.4% RH. The humidity ratio never changed. Any simulation step that heats air should pass W through untouched and recompute RH at the new temperature, never the other way around. Mass flow, not volume. The example house is 2,000 sq ft with 8 ft ceilings (16,000 ft³). At an assumed 0.35 air changes per hour, 5,600 ft³/h leaks in. Dividing by a specific volume of about 13.5 ft³/lb gives roughly 416 lb of dry air per hour. To hold 35% RH at 70°F (38.0 gr/lb) against 9.0 gr/lb outdoors, the humidifier must add about 29 gr/lb, or 1.7 lb/h, or about 5 gallons a day. At 0.5 ACH it is about 7.1 gallons. The infiltration rate is an assumption; a blower door test gives the real one. The limit is condensation, not comfort. The EPA recommends indoor humidity ideally between 30% and 50% to limit mold....

Powered by Readybot.io