


AIR_DENS: computes computes the density of moist air.
rhoa=AIR_DENS(Ta,RH,Pa) computes the density of moist air.
Air pressure is optional.
INPUT: Ta - air temperature Ta [C]
RH - relative humidity [%]
Pa - air pressure (optional) [mb]
OUTPUT: rhoa - air density [kg/m^3]

0001 function rhoa=air_dens(Ta,RH,Pa) 0002 % AIR_DENS: computes computes the density of moist air. 0003 % rhoa=AIR_DENS(Ta,RH,Pa) computes the density of moist air. 0004 % Air pressure is optional. 0005 % 0006 % INPUT: Ta - air temperature Ta [C] 0007 % RH - relative humidity [%] 0008 % Pa - air pressure (optional) [mb] 0009 % 0010 % OUTPUT: rhoa - air density [kg/m^3] 0011 0012 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0013 % 4/7/99: version 1.2 (contributed by AA) 0014 % 8/5/99: version 2.0 0015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0016 0017 % load constants 0018 as_consts; 0019 0020 if nargin == 2 0021 Pa = P_default; 0022 end 0023 0024 o61 = 1/eps_air-1; % 0.61 (moisture correction for temp.) 0025 Q = (0.01.*RH).*qsat(Ta,Pa); % specific humidity of air [kg/kg] 0026 T = Ta+CtoK; % convert to K 0027 Tv = T.*(1 + o61*Q); % air virtual temperature 0028 rhoa = (100*Pa)./(gas_const_R*Tv); % air density [kg/m^3] 0029