% Units atm = 101325 ; % [Pa] kJ = 1000 ; % [J] % Functions for saturation & absolute humidity p_sat = @(t) 610.5 * exp( 17.269*t / (237.3+t) ) ; % [Pa] t_sat = @(p) 237.3 / ( 17.269/log(p/610.5)-1 ) ; % [°C] w = @(p_vap, p) 0.622 * p_vap / (p-p_vap) ; % [kg_vap/kg_as] p_vap = @(w, p) p / ( 0.622 / w + 1 ) ; % [Pa] % Same pressure p_bu = 1*atm ; p_bs = p_bu ; % Wet & dry bulb temperatures t_bu = 15 ; % [°C] t_bs = 20 ; % [°C] % Quantities for mix enthalpy cp_as = 1.005 * kJ ; % [kJ/(kg K)] cp_vap = 1.875 * kJ ; % [kJ/(kg K)] h_lv = 2501 * kJ ; % [kJ/(kg)] % Wet bulb mix enthalpy p_vap_bu = p_sat(t_bu) w_bu = w(p_vap_bu, p_bu) J_bu = cp_as * t_bu + w_bu * (h_lv + cp_vap * t_bu) % Dry bulb w_bs = (J_bu - cp_as * t_bs) / (h_lv + cp_vap * t_bs) p_vap_bs = p_vap(w_bs, p_bs) phi_bs = p_vap_bs / p_sat(t_bs)