/*widla determine Lya line width for radiation pressure */ #include #include "cddefines.h" #include "pressure.h" #include "touton.h" #include "redis.h" #include "rtescprob.h" #include "phycon.h" #include "widlin.h" #include "widla.h" double widla( double tauin, double tauout, double a, /* answer will be in whatever units vth is in, since only generates * optical depth dependent scale factor */ double vth) { static int lgTonSav; double t, tau, therm, widla_v; # ifdef DEBUG_FUN fputs( "<+>widla()\n", debug_fp ); # endif /* optical depth in outer direction is always defined for la */ lgTonSav = touton.lgTauOutOn; touton.lgTauOutOn = TRUE; /* compute width of la with either complete or incomplete redistribution */ if( strcmp(redis.chRedis,"INCO") == 0 || strcmp(redis.chRedis,"WIND") == 0 ) { widla_v = widlin(tauin,tauout,a,vth); } else if( strcmp(redis.chRedis,"COMP") == 0 ) { tau = tauout/2.; t = MIN2(tauin,tauout-tauin); t = MAX2(0.,t); /* max optical depth is thermalization length */ therm = POW2(3e14/phycon.eden); if( tau > therm ) { tau = therm; pressure.lgPradDen = TRUE; } /* 1st fac in () is SQRT(2*pi); sec is 2/(pi^.25) */ widla_v = vth*(2.5066 + 1.5023*sqrt(a*tau))*(1. - escinc(t,a)); } else { fprintf( ioQQQ,"widla called with insane redistribution function ==%s==\n", redis.chRedis ); puts( "[Stop in widla]" ); exit(1); } /* reset the optical depths flag */ touton.lgTauOutOn = lgTonSav; # ifdef DEBUG_FUN fputs( " <->widla()\n", debug_fp ); # endif return( widla_v ); }