; ;jeff snider, univeristy of wyoming, march 2006 ; ;calculate the satruation ratio at the droplet/air boundary ;input values are wet size, temperature, salt type, and dry size ;use the thermo data in Tang and Munkelwitz (1994) and in Tang (1996) ; pro sratio_bdry, crit_flag, wet_size, salt_size, insoluble_size, sratio, loop_count, mw_on_mtot, rho_solution, $ water_activity, molality, wgtf, sigma, kelvin ; common constants, gascon, rho_h2o, mw_nh42so4, rho_nh42so4, sigma_0, $ sigma_t, dsigmadmolality_nh42so4, dsigmadmolality_nacl, mw_h2o, $ mw_nacl, rho_nacl, tkmelt, c_nh42so4, a_nh42so4, c_nacl, a_nacl, $ cp_air_o, cp_h2o_o, mw_air, gravity, p0, alpha, beta_local, $ gascon_h2o, cw_h2o_o, tk_o, lv_o, ew_o, tk_aerosol, salt_type, $ epsilon, c_twomey, k_twomey, aerosol_type, right_tail, $ gascon_air, tc_base, tk_base, p_base, h_start, hmax, $ r0, dt, rmin, rmax, coef, epsilon_aerosol, specific_volume_meas, $ nchan, mw_salt, rho_salt, a_salt, c_salt, specific_volume_base, $ dsigmadmolality_salt, rho_insoluble, volume_insoluble_to_soluble, $ mixrat_tot_1,r_1,geo_sigma_1,mixrat_tot_2,r_2,geo_sigma_2, $ tk_start,p_start,sratio_start,mixrat_tot_3,r_3,geo_sigma_3 ; tk = tk_aerosol ; ;reject requests with unrealistic values of wet_size ; if wet_size lt (salt_size^3.d + insoluble_size^3.d)^(1.d/3.d) then begin print,'*sratio_bdry* particle evaporated', salt_size, insoluble_size, wet_size, crit_flag stop endif else if wet_size gt 60.d-6 and crit_flag eq 0 then begin print,'*sratio_bdry* particle too large',salt_size, insoluble_size, wet_size, crit_flag stop endif ; ; there is one unknown, the weight percent composition (wgtp). ; relate this to the solution density and solve for density iteratively ; using Tang (1996) and Tang and Munkelwitz (1994) parameterizations ; ; note: there is no temperature-dependent correction for activity ; and the Tang data is only good for 298.15, but, the composition ; variables are independent of temperature. Accounting for ; temperature requires that the temp dependence of rho and ; activity be parameterized...currently unavailable ; ; Include the temperature correction for surface tension of pure water ; sigma_at_tk = sigma_0 + sigma_t * (tkmelt - tk) ; ; initilization ; solution_size = (wet_size^3.d - insoluble_size^3.d)^(1.d/3.d) rho = rho_h2o*1.5d ;note change from *2.0 due to problem with rapidly growing droplets??? wgtp = (100.d*rho_salt*salt_size^3.d/(rho*solution_size^3.d)) funct = rho * wgtp / 100.d loop_count = 0 ; while (abs(funct) gt 0.0000001d*rho_salt*salt_size^3.d/solution_size^3.d) and (loop_count lt 80) do begin loop_count = loop_count + 1 funct = 10.d*(0.9971d*wgtp + a_salt(0)*wgtp^2.d + a_salt(1)*wgtp^3.d + a_salt(2)*wgtp^4.d + $ a_salt(3)*wgtp^5.d)-rho_salt*salt_size^3.d/solution_size^3.d dfunctdwgtp = 10.d*(0.9971d + 2.d*a_salt(0)*wgtp + 3.d*a_salt(1)*wgtp^2.d + $ 4.d*a_salt(2)*wgtp^3.d + 5.d*a_salt(3)*wgtp^4.d) wgtp_new = wgtp - funct / dfunctdwgtp ; if (wgtp_new gt 100.d) then begin print, '*sratio_bdry* wgtp_new>100%',wgtp,wgtp_new,loop_count,salt_size,wet_size wgtp_new = wgtp * 1.2d endif else if (wgtp_new lt 0.d) then begin print, '*sratio_bdry* wgtp_new< 0%',wgtp,wgtp_new,loop_count,salt_size,wet_size wgtp_new = wgtp * 0.8d endif ; wgtp = wgtp_new ; endwhile ; rho = 1000.d*(0.9971d + a_salt(0)*wgtp + a_salt(1)*wgtp^2.d + a_salt(2)*wgtp^3.d + a_salt(3)*wgtp^4.d) wgtf = wgtp / 100.d molality = wgtf / (mw_salt*(1.d - wgtf)) sigma = sigma_at_tk + dsigmadmolality_salt * molality drho_dwgtp = 1000.d*(a_salt(0) + 2.d*a_salt(1)*wgtp + 3.d*a_salt(2)*wgtp^2.d + $ 4.d*a_salt(3)*wgtp^3.d) dvdm_h2o = 1.d / rho + wgtp * (1.d / rho^2.d) * drho_dwgtp ;kelvin = exp (2.d*dvdm_h2o*sigma*mw_h2o/(gascon*tk*wet_size)) kelvin = exp (2.d*sigma*mw_h2o/(gascon*rho*tk*wet_size)) water_activity = 1.0d + c_salt(0)*wgtp + c_salt(1)*wgtp^2.d + c_salt(2)*wgtp^3.d + c_salt(3)*wgtp^4.d sratio = water_activity * kelvin mw_on_mtot = 1.d - wgtf rho_solution = rho ; ;check that passed sratio larger than crystalization relative humidity ;this is the limit of the Tang data ; if salt_type eq 'nacl' and sratio lt 0.48d then begin print, '*sratio_bdry* ',salt_type,' requested sratio too small',sratio,salt_size,wet_size return endif else if salt_type eq 'nh42so4' and sratio lt 0.40d then begin print, '*sratio_bdry* ',salt_type,' requested sratio too small',sratio,salt_size,wet_size return endif ; if sratio gt 1.4d then begin print, '*sratio_bdry* ',sratio,' requested sratio too large' stop endif ; return ; end ;