00001
00002
00003
00004
00005 #include "cddefines.h"
00006 #include "opacity.h"
00007 #include "geometry.h"
00008 #include "lines_service.h"
00009 #include "prt.h"
00010 #include "rt.h"
00011
00012 void RT_line_one_tau_reset(EmLine * t,
00013 double WeightNew)
00014 {
00015 char chSave[11];
00016
00017 DEBUG_ENTRY( "RT_line_one_tau_reset()" );
00018
00019
00020 if( prt.lgPrtMaser &&
00021 ( t->TauTot < -0.01 || t->TauIn < -0.01) )
00022 {
00023 strcpy( chSave, chLineLbl(t) );
00024 fprintf( ioQQQ, " Masing line:%10.10s t(in, out)=%10.2e%10.2e\n",
00025 chSave, t->TauIn, t->TauTot );
00026 }
00027
00028
00029
00030 if( iteration == 1 && (!geometry.lgStatic) )
00031 {
00032
00033
00034
00035
00036 t->TauTot = t->TauIn*rt.DoubleTau;
00037 t->TauIn = MIN2(opac.taumin,t->TauTot/2.f);
00038 }
00039 else if( geometry.lgSphere && geometry.lgStatic )
00040 {
00041
00042 if( iteration == 1 )
00043 {
00044
00045 t->TauTot = 2.f*t->TauIn;
00046 }
00047 else
00048 {
00049 t->TauTot = (float)(t->TauIn*WeightNew + t->TauTot*
00050 (1. - WeightNew));
00051 }
00052 t->TauIn = t->TauTot/2.f;
00053 }
00054 else
00055 {
00056
00057 if( t->TauIn > 0. && t->TauTot > 0. )
00058 {
00059
00060 # if 0
00061 t->TauTot = (float)pow(10.,log10(t->TauTot)*(1. - WeightNew) +
00062 log10(t->TauIn*rt.DoubleTau)*WeightNew);
00063 # endif
00064
00065 t->TauTot = (float)(t->TauTot*(1. - WeightNew) +
00066 t->TauIn*rt.DoubleTau*WeightNew);
00067 t->TauIn = MIN2(opac.taumin,t->TauTot/ 2.f);
00068 }
00069 else
00070 {
00071
00072 t->TauTot = (t->TauIn*rt.DoubleTau + t->TauTot)/2.f;
00073 t->TauIn = MIN2(opac.taumin,t->TauTot/2.f);
00074 }
00075 }
00076
00077
00078 t->Pesc = 0.5f*(1.f + 1.f/MAX2(1.f,t->TauTot));
00079
00080
00081 t->FracInwd = MIN2(1.f,1.5f-t->Pesc);
00082
00083
00084
00085
00086 t->Pdest = 0.;
00087 t->Pelec_esc = 0.;
00088
00089
00090 t->TauCon = opac.taumin;
00091
00092
00093 t->PopLo = 0.;
00094
00095
00096 t->PopHi = 0.;
00097
00098 t->PopOpc = 0.;
00099
00100 t->cool = 0.;
00101 t->heat = 0.;
00102
00103 t->xIntensity = 0.;
00104
00105 t->phots = 0.;
00106
00107 DEBUG_EXIT( "RT_line_one_tau_reset()" );
00108 return;
00109 }
00110