Home > atmlab > h2o > thermodynamics > virtual_temperature.m

virtual_temperature

PURPOSE ^

VIRTUAL_TEMPERATURE virtual temperature

SYNOPSIS ^

function Tv = virtual_temperature(rh, T, p)

DESCRIPTION ^

 VIRTUAL_TEMPERATURE virtual temperature

   Temperature that dry air would have to attain in order to 
   has the same density as the moist air at the same pressure

 FORMAT   Tv = virtual_temperature(rh, T, p)
        
 OUT   Tv  virtual temperature [K]
 IN    rh  relative humidity [%, rh > 0], it can be a scalar or a tensor
       T   air temperature [K], it can be a scalar or a tensor
       p   air pressure [Pa], it can be a scalar or a tensor
 EXAMPLE:
       Tv = virtual_temperature(50, 298, 110000)
       Tv = 299.6178

 ACCURACY: VIRTUAL_TEMPERATURE estimates virtual temperature.
          
 Reference: A short course in cloud physics (Chapter II, water vapor and
             its thermodynamic effects); 1996, By: R. R. Rogers and M. M. Yau
             page: 17, Eq.: 2.21

 2009-08-15   Created by Isaac Moradi.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

virtual_temperature.m

SOURCE CODE ^

0001 function Tv = virtual_temperature(rh, T, p)
0002 % VIRTUAL_TEMPERATURE virtual temperature
0003 %
0004 %   Temperature that dry air would have to attain in order to
0005 %   has the same density as the moist air at the same pressure
0006 %
0007 % FORMAT   Tv = virtual_temperature(rh, T, p)
0008 %
0009 % OUT   Tv  virtual temperature [K]
0010 % IN    rh  relative humidity [%, rh > 0], it can be a scalar or a tensor
0011 %       T   air temperature [K], it can be a scalar or a tensor
0012 %       p   air pressure [Pa], it can be a scalar or a tensor
0013 % EXAMPLE:
0014 %       Tv = virtual_temperature(50, 298, 110000)
0015 %       Tv = 299.6178
0016 %
0017 % ACCURACY: VIRTUAL_TEMPERATURE estimates virtual temperature.
0018 %
0019 % Reference: A short course in cloud physics (Chapter II, water vapor and
0020 %             its thermodynamic effects); 1996, By: R. R. Rogers and M. M. Yau
0021 %             page: 17, Eq.: 2.21
0022 %
0023 % 2009-08-15   Created by Isaac Moradi.
0024 
0025 % set constants
0026 eps = constants('GAS_CONST_DRY_AIR') / constants('GAS_CONST_WATER_VAPOR'); 
0027 
0028 % calculate mixing ratio
0029 r = water_vapor_mixing_ratio(rh, T, p);
0030 
0031 % calculate virtual temperature
0032 Tv = T .* (1 + r ./ eps) ./ (1 + r);            
0033 
0034         
0035

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005