00001 /* This file is part of Cloudy and is copyright (C)1978-2008 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 00013 void RT_line_one_tauinc(transition * t , 00014 /* following four are flags to generate info if some species has extreme maser */ 00015 long int maser_flag_species, 00016 long int maser_flag_ion, 00017 long int maser_flag_hi, 00018 long int maser_flag_lo ) 00019 00020 { 00021 DEBUG_ENTRY( "RT_line_one_tauinc()" ); 00022 00023 /* routine increments optical depths for static or expanding atmosphere */ 00024 00025 /* this is line center frequency, including bulk motion of gas */ 00026 long int ipLineCenter = t->Emis->ipFine + rfield.ipFineConVelShift; 00027 double OpacityEffective, EffectiveThickness; 00028 realnum dTau_total; 00029 00030 /* find line center opacity - use fine opacity if array indices are OK */ 00031 if( t->Emis->ipFine>=0 && ipLineCenter>0 && ipLineCenter<rfield.nfine && rfield.lgOpacityFine ) 00032 { 00033 /* use fine opacities fine grid fine mesh to get optical depth 00034 * to continuum source */ 00035 /* total line center optical depth, all overlapping lines included */ 00036 OpacityEffective = rfield.fine_opac_zone[ipLineCenter]; 00037 } 00038 else 00039 { 00040 OpacityEffective = t->Emis->PopOpc * t->Emis->opacity / DoppVel.doppler[ t->Hi->nelem -1]; 00041 } 00042 00043 /* use cumulated fine optical depth for both d-critical and static, 00044 * for d-critical speeds are only roughly sonic 00045 * optical depth is computed including velocity shift */ 00046 if( wind.windv <= 0. ) 00047 { 00048 /* static and negative velocity solutions */ 00049 00050 EffectiveThickness = radius.drad_x_fillfac; 00051 dTau_total = (realnum)(OpacityEffective * EffectiveThickness); 00052 00053 t->Emis->TauIn += dTau_total; 00054 t->Emis->TauCon += dTau_total; 00055 00056 } 00057 00058 else 00059 { 00060 /* this is effective length scale for Sobolev or LVG approximation. 00061 * This is equation 3 of 00062 * >>refer RT wind Castor, J.I., Abbott, D.C., & Klein, R.I., 1975, ApJ, 195, 157 00063 */ 00064 00065 /* dv/dr (s-1), equal to dv/dt / v */ 00066 realnum dvdr = fabs(wind.AccelTot) / wind.windv; 00067 /* depth (cm) over which wind accelerates by one velocity width 00068 * include filling factor */ 00069 EffectiveThickness = DoppVel.doppler[ t->Hi->nelem -1] / SDIV(dvdr) * 00070 geometry.FillFac; 00071 00072 /* min2 is to not let the physical scale exceed the current depth */ 00073 EffectiveThickness = MIN2( radius.depth, EffectiveThickness ); 00074 dTau_total = (realnum)(OpacityEffective * EffectiveThickness); 00075 00076 t->Emis->TauIn = dTau_total; 00077 t->Emis->TauCon = dTau_total; 00078 t->Emis->TauTot = dTau_total; 00079 } 00080 00081 /* keep track of any masers */ 00082 if( dTau_total < rt.dTauMase ) 00083 { 00084 rt.dTauMase = dTau_total; 00085 rt.mas_species = maser_flag_species; 00086 rt.mas_ion = maser_flag_ion; 00087 rt.mas_hi = maser_flag_hi; 00088 rt.mas_lo = maser_flag_lo; 00089 if( rt.dTauMase < -1. ) 00090 rt.lgMaserCapHit = true; 00091 } 00092 00093 return; 00094 }