00001
00002
00003
00004
00005 #include "cddefines.h"
00006 #include "taulines.h"
00007 #include "coolheavy.h"
00008 #include "hydrogenic.h"
00009 #include "dense.h"
00010 #include "thermal.h"
00011 #include "continuum.h"
00012 #include "geometry.h"
00013 #include "dynamics.h"
00014 #include "rt.h"
00015 #include "iso.h"
00016 #include "rfield.h"
00017 #include "trace.h"
00018 #include "ionbal.h"
00019 #include "lines_service.h"
00020 #include "radius.h"
00021 #include "lines.h"
00022
00023 static void GetMaxhLine(void);
00024
00025 void lines_general(void)
00026 {
00027 long int i,
00028 ipHi,
00029 ipLo,
00030 nelem,
00031 ipnt;
00032
00033 double
00034 EmisFac ,
00035 hbetac,
00036 HeatMetal ,
00037 ee511,
00038 hlalph;
00039
00040 DEBUG_ENTRY( "lines_general()" );
00041
00042 if( trace.lgTrace )
00043 {
00044 fprintf( ioQQQ, " lines_general called\n" );
00045 }
00046
00047
00048 i = StuffComment( "general properties" );
00049 linadd( 0., (float)i , "####", 'i');
00050
00051
00052 if( hydro.lgHydEmiss )
00053 {
00054
00055 EmisFac = 1./dense.eden;
00056 }
00057 else
00058 {
00059 EmisFac = dense.xIonDense[ipHYDROGEN][1];
00060 }
00061
00062 nelem = ipHYDROGEN;
00063 ipHi = 4;
00064 ipLo = ipH2p;
00065 hbetac =
00066 (EmisLines[ipH_LIKE][nelem][ipHi][ipH2s].Aul *
00067 EmisLines[ipH_LIKE][nelem][ipHi][ipH2s].Pesc +
00068 EmisLines[ipH_LIKE][nelem][ipHi][ipH2p].Aul *
00069 EmisLines[ipH_LIKE][nelem][ipHi][ipH2p].Pesc ) *
00070 EmisLines[ipH_LIKE][nelem][ipHi][ipLo].PopHi*
00071 EmisLines[ipH_LIKE][nelem][ipHi][ipLo].EnergyErg*
00072 EmisFac;
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083 rt.fracin = EmisLines[ipH_LIKE][nelem][ipHi][ipH2s].FracInwd;
00084 lindst(hbetac,4861,"TOTL",EmisLines[ipH_LIKE][nelem][ipHi][ipH2s].ipCont,'i',false );
00085 rt.fracin = 0.5;
00086
00087
00088 ipHi = ipH2p;
00089 ipLo = ipH1s;
00090 hlalph =
00091 EmisLines[ipH_LIKE][nelem][ipHi][ipLo].Aul*
00092 EmisLines[ipH_LIKE][nelem][ipHi][ipLo].PopHi*
00093 EmisLines[ipH_LIKE][nelem][ipHi][ipLo].Pesc*
00094 EmisLines[ipH_LIKE][nelem][ipHi][ipLo].EnergyErg*
00095 EmisFac;
00096
00097
00098 rt.fracin = EmisLines[ipH_LIKE][nelem][ipHi][ipLo].FracInwd;
00099 lindst(hlalph,1216,"TOTL",EmisLines[ipH_LIKE][nelem][ipHi][ipLo].ipCont,'i',false );
00100 rt.fracin = 0.5;
00101
00102 continuum.totlsv = continuum.totlsv/radius.dVeff*geometry.covgeo;
00103
00104
00105
00106
00107
00108
00109 linadd(continuum.totlsv,0,"Inci",'i');
00110 continuum.totlsv = continuum.totlsv*radius.dVeff/geometry.covgeo;
00111
00112
00113
00114 if( LineSave.ipass > 0 )
00115 {
00116 continuum.totlsv = 0.;
00117 }
00118
00119
00120 linadd(thermal.htot,0,"TotH",'i');
00121
00122 linadd(thermal.ctot,0,"TotC",'i');
00123
00124
00125 linadd(thermal.heating[0][0],0,"BFH1",'h');
00126
00127
00128
00129 linadd(thermal.heating[0][1],0,"BFHx",'h');
00130
00131
00132 linadd(thermal.heating[0][22],0,"Line",'h');
00133 if( thermal.htot > 0. )
00134 {
00135 if( thermal.heating[0][22]/thermal.htot > thermal.HeatLineMax )
00136 {
00137 thermal.HeatLineMax = (float)(thermal.heating[0][22]/thermal.htot);
00138
00139 GetMaxhLine();
00140 }
00141 }
00142
00143
00144 linadd(thermal.heating[1][0]+thermal.heating[1][1]+thermal.heating[1][2],
00145 0,"BFHe",'h');
00146
00147 HeatMetal = 0.;
00148
00149 for( nelem=2; nelem<LIMELM; ++nelem)
00150 {
00151
00152 for( i=dense.IonLow[nelem]; i < dense.IonHigh[nelem]; i++ )
00153 {
00154
00155 HeatMetal += thermal.heating[nelem][i];
00156 }
00157 }
00158
00159 linadd(HeatMetal,0,"TotM",'h');
00160
00161
00162 linadd(thermal.heating[0][21],0,"pair",'h');
00163
00164
00165
00166 if( LineSave.ipass > 0 )
00167 {
00168
00169 ionbal.CompHeating_Max = MAX2( ionbal.CompHeating_Max , ionbal.CompRecoilHeatLocal/thermal.htot);
00170 }
00171 else
00172 {
00173 ionbal.CompHeating_Max = 0.;
00174 }
00175
00176
00177 linadd(ionbal.CompRecoilHeatLocal,0,"Cbnd",'h');
00178
00179
00180 linadd(rfield.cmheat,0,"ComH",'h');
00181
00182
00183 linadd(CoolHeavy.tccool,0,"ComC",'c');
00184
00185
00186 dynamics.HeatMax = MAX2( dynamics.HeatMax , dynamics.Heat /thermal.htot );
00187
00188 dynamics.CoolMax = MAX2( dynamics.CoolMax , dynamics.Cool /thermal.htot );
00189
00190
00191 linadd(dynamics.Cool , 0 , "advC" , 'i' );
00192
00193 linadd(dynamics.Heat , 0 , "advH" , 'i' );
00194
00195
00196 linadd( thermal.char_tran_heat ,0,"CT H",'h');
00197
00198 linadd( thermal.char_tran_cool ,0,"CT C",'c');
00199
00200
00201 linadd(thermal.heating[1][6],0,"CR H",'h');
00202
00203
00204 linadd(thermal.heating[0][20],0,"extH",'h');
00205
00206
00207 linadd(CoolHeavy.cextxx,0,"extC",'c');
00208
00209
00210 ee511 = (dense.gas_phase[ipHYDROGEN] + 4.*dense.gas_phase[ipHELIUM])*ionbal.PairProducPhotoRate[0]*2.*8.20e-7;
00211 PntForLine(2.427e-2,"e-e+",&ipnt);
00212 lindst(ee511,0,"e-e+",ipnt,'i',true );
00213
00214
00215 linadd(CoolHeavy.expans,0,"Expn",'c');
00216
00217
00218 linadd(iso.RadRecCool[ipH_LIKE][ipHYDROGEN],0,"H FB",'i');
00219
00220
00221 linadd(MAX2(0.,iso.FreeBnd_net_Cool_Rate[ipH_LIKE][ipHYDROGEN]),0,"HFBc",'c');
00222
00223 linadd(MAX2(0.,-iso.FreeBnd_net_Cool_Rate[ipH_LIKE][ipHYDROGEN]),0,"HFBh",'h');
00224
00225
00226 linadd(iso.RecomInducCool_Rate[ipH_LIKE][ipHYDROGEN],0,"Hind",'c');
00227
00228
00229 linadd(CoolHeavy.c3ind,0,"3He2",'c');
00230
00231
00232 linadd(CoolHeavy.cyntrn,0,"Cycn",'c');
00233
00234 DEBUG_EXIT( "lines_general()" );
00235 return;
00236 }
00237
00238
00239 static void GetMaxhLine(void)
00240 {
00241 long int i;
00242 double strong;
00243
00244 DEBUG_ENTRY( "GetMaxhLine()" );
00245
00246
00247 strong = 0.;
00248
00249
00250 thermal.levlmax = 0;
00251
00252 for( i=1; i <= nLevel1; i++ )
00253 {
00254 if( TauLines[i].heat > strong )
00255 {
00256 strong = TauLines[i].heat;
00257 thermal.levlmax = 1;
00258 thermal.ipHeatlmax = i;
00259 }
00260 }
00261 for( i=0; i < nWindLine; i++ )
00262 {
00263 if( TauLine2[i].IonStg < TauLine2[i].nelem+1-NISO )
00264 {
00265 if( TauLine2[i].heat > strong )
00266 {
00267 strong = TauLine2[i].heat;
00268 thermal.levlmax = 2;
00269 thermal.ipHeatlmax = i;
00270 }
00271 }
00272 }
00273 for( i=0; i < nHFLines; i++ )
00274 {
00275 if( HFLines[i].heat > strong )
00276 {
00277 strong = HFLines[i].heat;
00278 thermal.levlmax = 2;
00279 thermal.ipHeatlmax = i;
00280 }
00281 }
00282 for( i=0; i < nCORotate; i++ )
00283 {
00284 if( C12O16Rotate[i].heat > strong )
00285 {
00286 strong = C12O16Rotate[i].heat;
00287 thermal.levlmax = 3;
00288 thermal.ipHeatlmax = i;
00289 }
00290 if( C13O16Rotate[i].heat > strong )
00291 {
00292 strong = C13O16Rotate[i].heat;
00293 thermal.levlmax = 4;
00294 thermal.ipHeatlmax = i;
00295 }
00296 }
00297
00298 DEBUG_EXIT( "GetMaxhLine()" );
00299 return;
00300 }
00301