Home > atmlab > h2o > thermodynamics > isentr_conden_temp.m

isentr_conden_temp

PURPOSE ^

ISENTR_CONDEN_TEMP isentropic condensation temperature Tc

SYNOPSIS ^

function Tc = isentr_conden_temp(rh, T, p)

DESCRIPTION ^

 ISENTR_CONDEN_TEMP   isentropic condensation temperature Tc

    isentropic condensation temperature (Tc) is the temperature
    at which saturation is reached when moist air is cooled
    adiabatically with mixing ration (r) held constant.

 FORMAT    Tc = isentr_conden_temp(rh, T, p)
        
 OUT   Tc  isentropic condensation temperature [K]
 IN    rh  relative humidity [%], rh > 0 and 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:
       Tc = isentr_conden_temp(50, 298, 100000)
       Tc = 286.8752

 ACCURACY: 
           ISENTR_CONDEN_TEMP gives a good estimation of Tc

 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: 21, Eq.: 2.33

 2009-06-08   Created by Isaac Moradi.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

isentr_conden_temp.m

SOURCE CODE ^

0001 function Tc = isentr_conden_temp(rh, T, p) 
0002 % ISENTR_CONDEN_TEMP   isentropic condensation temperature Tc
0003 %
0004 %    isentropic condensation temperature (Tc) is the temperature
0005 %    at which saturation is reached when moist air is cooled
0006 %    adiabatically with mixing ration (r) held constant.
0007 %
0008 % FORMAT    Tc = isentr_conden_temp(rh, T, p)
0009 %
0010 % OUT   Tc  isentropic condensation temperature [K]
0011 % IN    rh  relative humidity [%], rh > 0 and can be a scalar or a tensor
0012 %       T   air temperature [K], it can be a scalar or a tensor
0013 %       p   air pressure [Pa], it can be a scalar or a tensor
0014 %
0015 % EXAMPLE:
0016 %       Tc = isentr_conden_temp(50, 298, 100000)
0017 %       Tc = 286.8752
0018 %
0019 % ACCURACY:
0020 %           ISENTR_CONDEN_TEMP gives a good estimation of Tc
0021 %
0022 % Reference: A short course in cloud physics (Chapter II, water vapor and
0023 %            its thermodynamic effects); 1996, By: R. R. Rogers and M. M. Yau
0024 %            page: 21, Eq.: 2.33
0025 %
0026 % 2009-06-08   Created by Isaac Moradi.
0027 
0028 % set constants
0029 A = 2.53e8; % in kPa
0030 B = 5.42e3; % in K
0031 cp=constants('SPECIFIC_HEAT_CONST_PRES');
0032 cv=constants('SPECIFIC_HEAT_CONST_VOL');
0033 k = (cp - cv) / cp; % c is specific heat at constant pressure and volume
0034 eps = constants('GAS_CONST_DRY_AIR') / ...
0035     constants('GAS_CONST_WATER_VAPOR'); 
0036 
0037 % calculate mixing ratio
0038 r = water_vapor_mixing_ratio(rh, T, p)  ;
0039 var1 = A .* eps ./ (r .* (p ./ 1000));
0040 
0041 % set intial values
0042 T1 = T;
0043 Tc = T1;
0044 Tc0 = Tc - 10;
0045 inv_k = 1 ./ k;
0046 
0047 % Tc exists in both side of Eq. 2.33 so we must solve the equation in an
0048 % iteration. Tc is less than T. So the iteration start from Tc = T - 0.5
0049 % and put the current value of Tc (Tc0) into left side and calculate new Tc.
0050 % It will continue until abs(Tc0 - Tc) > 0.5
0051 while abs(Tc0 - Tc) > 0.5
0052     T1 = T1 - 0.5;
0053     Tc0 = Tc;               
0054     var2 = T ./ T1;
0055     Tc = B ./ log(var1 .* power(var2, inv_k));
0056 end
0057

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