00001 /* This file is part of Cloudy and is copyright (C)1978-2010 by Gary J. Ferland and 00002 * others. For conditions of distribution and use see copyright notice in license.txt */ 00003 /*RT_line_one_tauinc increment optical depths for all heavy element lines, zone by zone, 00004 * mainly called by RT_tau_inc, but also by FeII */ 00005 #include "cddefines.h" 00006 #include "doppvel.h" 00007 #include "geometry.h" 00008 #include "rfield.h" 00009 #include "radius.h" 00010 #include "wind.h" 00011 #include "rt.h" 00012 #include "physconst.h" 00013 #include "cosmology.h" 00014 #include "transition.h" 00015 00016 void RT_line_one_tauinc(transition * t , 00017 /* following four are flags to generate info if some species has extreme maser */ 00018 long int maser_flag_species, 00019 long int maser_flag_ion, 00020 long int maser_flag_hi, 00021 long int maser_flag_lo, 00022 realnum DopplerWidth ) 00023 00024 { 00025 DEBUG_ENTRY( "RT_line_one_tauinc()" ); 00026 00027 /* routine increments optical depths for static or expanding atmosphere */ 00028 00029 /* this is line center frequency, including bulk motion of gas */ 00030 long int ipLineCenter = t->Emis->ipFine + rfield.ipFineConVelShift; 00031 double OpacityEffective, EffectiveThickness; 00032 realnum dTau_total; 00033 00034 /* find line center opacity - use fine opacity if array indices are OK */ 00035 if( t->Emis->ipFine>=0 && ipLineCenter>0 && ipLineCenter<rfield.nfine && rfield.lgOpacityFine ) 00036 { 00037 /* use fine opacities fine grid fine mesh to get optical depth 00038 * to continuum source */ 00039 /* total line center optical depth, all overlapping lines included */ 00040 OpacityEffective = rfield.fine_opac_zone[ipLineCenter]; 00041 } 00042 else 00043 { 00044 OpacityEffective = t->Emis->PopOpc * t->Emis->opacity / DopplerWidth; 00045 } 00046 00047 #if 0 00048 if( rfield.anu[ t->ipCont-1 ] < rfield.plsfrq ) 00049 { 00050 /* transition is below plasma frequency - make optical depth huge */ 00051 dTau_total = 1.e10; 00052 00053 t->Emis->TauIn = dTau_total; 00054 t->Emis->TauCon = dTau_total; 00055 t->Emis->TauTot = dTau_total; 00056 } 00057 else 00058 #endif 00059 if( cosmology.lgDo ) 00060 { 00061 /* dv/dr (s-1), equal to dv/dt / v */ 00062 /* in this case, dv/dr is just the Hubble factor */ 00063 wind.dvdr = GetHubbleFactor(cosmology.redshift_current); 00064 00065 fixit(); //This doppler width is sqrt(2kt/m), but Seager et al use sqrt(3kt/m). Resolve 00066 EffectiveThickness = DopplerWidth / wind.dvdr; 00067 dTau_total = (realnum)(OpacityEffective * EffectiveThickness); 00068 00069 t->Emis->TauIn = dTau_total; 00070 t->Emis->TauCon = dTau_total; 00071 t->Emis->TauTot = dTau_total; 00072 } 00073 00074 /* use cumulated fine optical depth for both d-critical and static, 00075 * for d-critical speeds are only roughly sonic 00076 * optical depth is computed including velocity shift */ 00077 else if( ! wind.lgBallistic() ) 00078 { 00079 /* static and negative velocity solutions */ 00080 EffectiveThickness = radius.drad_x_fillfac; 00081 dTau_total = (realnum)(OpacityEffective * EffectiveThickness); 00082 00083 t->Emis->TauIn += dTau_total; 00084 t->Emis->TauCon += dTau_total; 00085 00086 } 00087 00088 else 00089 { 00090 /* ballistic outflowing wind 00091 * effective length scale for Sobolev or LVG approximation, eqn 3 of 00092 * >>refer RT wind Castor, J.I., Abbott, D.C., & Klein, R.I., 1975, ApJ, 195, 157 00093 */ 00094 00095 /* dv/dr (s-1), equal to dv/dt / v */ 00096 wind.dvdr = fabs(wind.AccelTotalOutward - wind.AccelGravity) / wind.windv; 00097 /* depth (cm) over which wind accelerates by one velocity width 00098 * include filling factor */ 00099 EffectiveThickness = DopplerWidth / SDIV(wind.dvdr) * geometry.FillFac; 00100 00101 /* min2 is to not let the physical scale exceed the current depth */ 00102 EffectiveThickness = MIN2( radius.depth, EffectiveThickness ); 00103 dTau_total = (realnum)(OpacityEffective * EffectiveThickness); 00104 00105 t->Emis->TauIn = dTau_total; 00106 t->Emis->TauCon = dTau_total; 00107 t->Emis->TauTot = dTau_total; 00108 } 00109 00110 /* keep track of any masers */ 00111 if( dTau_total < rt.dTauMase ) 00112 { 00113 rt.dTauMase = dTau_total; 00114 rt.mas_species = maser_flag_species; 00115 rt.mas_ion = maser_flag_ion; 00116 rt.mas_hi = maser_flag_hi; 00117 rt.mas_lo = maser_flag_lo; 00118 if( rt.dTauMase < -1. ) 00119 rt.lgMaserCapHit = true; 00120 } 00121 00122 return; 00123 }