cloudy trunk
|
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 /*DrvContPump local continuum pumping rate radiative transfer for all lines */ 00004 /*con_pump_op routine used to get continuum pumping of lines 00005 * used in DrvContPump in call to qg32 */ 00006 #include "cddefines.h" 00007 #include "rfield.h" 00008 #include "doppvel.h" 00009 #include "radius.h" 00010 #include "continuum.h" 00011 00012 /* damping constant used for pumping */ 00013 static realnum damp; 00014 /* variable used for inward optical depth for pumping */ 00015 static realnum PumpTau; 00016 00017 /*con_pump_op routine used to get continuum pumping of lines 00018 * used in ContPump in call to qg32 */ 00019 STATIC double con_pump_op(double x); 00020 00022 double DrvContPump(transition * t) 00023 { 00024 double a0, 00025 ContPump_v, 00026 tau, 00027 yinc1, 00028 yinc2; 00029 00030 DEBUG_ENTRY( "DrvContPump()" ); 00031 00032 /* fit to results for tau less than 10 */ 00033 # define FITTED(t) ((0.98925439 + 0.084594094*(t))/(1. + (t)*(0.64794212 + (t)*0.44743976))) 00034 00035 if( !rfield.lgInducProcess ) 00036 { 00037 /* option to turn off continuum pumping with no fluorescence */ 00038 ContPump_v = 0.; 00039 } 00040 else 00041 { 00042 /* tau used will be optical depth in center of next zone */ 00043 tau = t->Emis->TauIn + t->Emis->PopOpc * t->Emis->opacity / DoppVel.doppler[t->Hi->nelem-1]*radius.dRNeff; 00044 /* compute pumping probability */ 00045 if( tau <= 10. ) 00046 { 00047 /* for tau<10 a does not matter, and one fit for all */ 00048 ContPump_v = FITTED(tau); 00049 } 00050 else if( tau > 1e6 ) 00051 { 00052 /* this far in winds line opacity well below electron scattering 00053 * so ignore for this problem */ 00054 ContPump_v = 0.; 00055 } 00056 else 00057 { 00058 /* following two are passed on to later subs */ 00059 if( t->Emis->iRedisFun > 0 ) 00060 { 00061 damp = t->Emis->damp; 00062 } 00063 else 00064 { 00065 damp = 0.; 00066 } 00067 PumpTau = (realnum)tau; 00068 a0 = 0.886227*(1. + damp); 00069 # define BREAK_ 3. 00070 yinc1 = qg32(0.,BREAK_,con_pump_op); 00071 yinc2 = qg32(BREAK_,100.,con_pump_op); 00072 ContPump_v = (yinc1 + yinc2)/a0; 00073 } 00074 } 00075 00076 /* EscProb is escape probability, will not allow ContPump to be greater than it 00077 * on second iteration with thick lines, pump prob=1 and esc=0.5 00078 * ContPump = MIN( ContPump , t->t(ipLnEscP) ) 00079 * */ 00080 return( ContPump_v ); 00081 # undef FITTED 00082 } 00083 00084 /*con_pump_op routine used to get continuum pumping of lines 00085 * used in DrvContPump in call to qg32 */ 00086 STATIC double con_pump_op(double x) 00087 { 00088 double opfun_v, 00089 v; 00090 00091 DEBUG_ENTRY( "con_pump_op()" ); 00092 00093 v = vfun(damp,x); 00094 opfun_v = sexp(PumpTau*v)*v; 00095 00096 return( opfun_v ); 00097 }