00001
00002
00003
00004 #include "cddefines.h"
00005 #include "taulines.h"
00006 #include "coolheavy.h"
00007 #include "hydrogenic.h"
00008 #include "dense.h"
00009 #include "thermal.h"
00010 #include "continuum.h"
00011 #include "geometry.h"
00012 #include "dynamics.h"
00013 #include "rt.h"
00014 #include "iso.h"
00015 #include "rfield.h"
00016 #include "trace.h"
00017 #include "ionbal.h"
00018 #include "lines_service.h"
00019 #include "radius.h"
00020 #include "lines.h"
00021
00022 void lines_general(void)
00023 {
00024 long int i,
00025 ipHi,
00026 ipLo,
00027 nelem,
00028 ipnt;
00029
00030 double
00031 hbetac,
00032 HeatMetal ,
00033 ee511,
00034 hlalph;
00035
00036 DEBUG_ENTRY( "lines_general()" );
00037
00038 if( trace.lgTrace )
00039 {
00040 fprintf( ioQQQ, " lines_general called\n" );
00041 }
00042
00043 i = StuffComment( "general properties" );
00044 linadd( 0., (realnum)i , "####", 'i',
00045 " start of general properties");
00046
00047
00048 nelem = ipHYDROGEN;
00049 ipLo = ipH2p;
00050
00051
00052
00053 ASSERT( iso_sp[ipH_LIKE][nelem].n_HighestResolved_max >=3 );
00054
00055 if( iso_sp[ipH_LIKE][nelem].n_HighestResolved_max >= 4 )
00056 {
00057 ipHi = ipH4p;
00058 hbetac =
00059 (iso_sp[ipH_LIKE][nelem].trans(ipH4p,ipH2s).Emis().Aul() *
00060 (iso_sp[ipH_LIKE][nelem].trans(ipH4p,ipH2s).Emis().Pesc() +
00061 iso_sp[ipH_LIKE][nelem].trans(ipH4p,ipH2s).Emis().Pelec_esc() ) *
00062 iso_sp[ipH_LIKE][nelem].st[ipH4p].Pop() +
00063 iso_sp[ipH_LIKE][nelem].trans(ipH4s,ipH2p).Emis().Aul() *
00064 (iso_sp[ipH_LIKE][nelem].trans(ipH4s,ipH2p).Emis().Pesc() +
00065 iso_sp[ipH_LIKE][nelem].trans(ipH4s,ipH2p).Emis().Pelec_esc() ) *
00066 iso_sp[ipH_LIKE][nelem].st[ipH4s].Pop() +
00067 iso_sp[ipH_LIKE][nelem].trans(ipH4d,ipH2p).Emis().Aul() *
00068 (iso_sp[ipH_LIKE][nelem].trans(ipH4d,ipH2p).Emis().Pesc() +
00069 iso_sp[ipH_LIKE][nelem].trans(ipH4d,ipH2p).Emis().Pelec_esc() ) *
00070 iso_sp[ipH_LIKE][nelem].st[ipH4d].Pop()) *
00071 iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo).EnergyErg();
00072 }
00073 else
00074 {
00075
00076 ASSERT( iso_sp[ipH_LIKE][nelem].n_HighestResolved_max == 3 );
00077 ipHi = 6;
00078 hbetac =
00079 (iso_sp[ipH_LIKE][nelem].trans(ipHi,ipH2s).Emis().Aul() *
00080 (iso_sp[ipH_LIKE][nelem].trans(ipHi,ipH2s).Emis().Pesc() +
00081 iso_sp[ipH_LIKE][nelem].trans(ipHi,ipH2s).Emis().Pelec_esc() ) +
00082 iso_sp[ipH_LIKE][nelem].trans(ipHi,ipH2p).Emis().Aul() *
00083 (iso_sp[ipH_LIKE][nelem].trans(ipHi,ipH2p).Emis().Pesc() +
00084 iso_sp[ipH_LIKE][nelem].trans(ipHi,ipH2p).Emis().Pelec_esc() ) ) *
00085 iso_sp[ipH_LIKE][nelem].st[ipHi].Pop() *
00086 iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo).EnergyErg();
00087 }
00088
00089
00090
00091
00092
00093 rt.fracin = iso_sp[ipH_LIKE][nelem].trans(ipHi,ipH2s).Emis().FracInwd();
00094 lindst(hbetac,iso_sp[ipH_LIKE][nelem].trans(ipHi,ipH2s).WLAng(),"TOTL",
00095 iso_sp[ipH_LIKE][nelem].trans(ipHi,ipH2s).ipCont(),'i',false,
00096 " H I Balmer beta predicted by model atom " );
00097 rt.fracin = 0.5;
00098
00099 if( iso_sp[ipH_LIKE][nelem].n_HighestResolved_max < 4 )
00100 {
00101
00102 lindst(hbetac,iso_sp[ipH_LIKE][nelem].trans(ipHi,ipH2s).WLAng(),"H 1",
00103 iso_sp[ipH_LIKE][nelem].trans(ipHi,ipH2s).ipCont(),'i',false,
00104 " H I Balmer beta predicted by model atom " );
00105
00106 lindst(hbetac/2.,iso_sp[ipH_LIKE][nelem].trans(ipHi,ipH2s).WLAng(),"Inwd",
00107 iso_sp[ipH_LIKE][nelem].trans(ipHi,ipH2s).ipCont(),'i',false,
00108 " H I Balmer beta predicted by model atom " );
00109 }
00110
00111
00112 ipHi = ipH2p;
00113 ipLo = ipH1s;
00114 hlalph =
00115 iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo).Emis().Aul()*
00116 iso_sp[ipH_LIKE][nelem].st[ipHi].Pop()*
00117 (iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo).Emis().Pesc() +
00118 iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo).Emis().Pelec_esc() )*
00119 iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo).EnergyErg();
00120
00121 rt.fracin = iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo).Emis().FracInwd();
00122 lindst(hlalph,iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo).WLAng(),"TOTL",
00123 iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo).ipCont(),'i',false ,
00124 " H I Lya predicted from model atom ");
00125 rt.fracin = 0.5;
00126
00127
00128 if( geometry.iEmissPower == 2 )
00129 {
00130 linadd(continuum.totlsv/radius.dVeffAper,0,"Inci",'i',
00131 "total luminosity in incident continuum");
00132
00133
00134 if( LineSave.ipass > 0 )
00135 {
00136 continuum.totlsv = 0.;
00137 }
00138 }
00139
00140 linadd(thermal.htot,0,"TotH",'i',
00141 " total heating, all forms, information since individuals added later ");
00142
00143 linadd(thermal.ctot,0,"TotC",'i',
00144 " total cooling, all forms, information since individuals added later ");
00145
00146 linadd(thermal.heating[0][0],0,"BFH1",'h',
00147 " hydrogen photoionization heating, ground state only ");
00148
00149 linadd(thermal.heating[0][1],0,"BFHx",'h',
00150 " net hydrogen photoionization heating less rec cooling, all excited states normally zero, positive if excited states are net heating ");
00151
00152 linadd(thermal.heating[0][22],0,"Line",'h',
00153 " heating due to induced lines absorption of continuum ");
00154 if( thermal.htot > 0. )
00155 {
00156 if( thermal.heating[0][22]/thermal.htot > thermal.HeatLineMax )
00157 {
00158 thermal.HeatLineMax = (realnum)(thermal.heating[0][22]/thermal.htot);
00159 }
00160 }
00161
00162 linadd(thermal.heating[1][0]+thermal.heating[1][1]+thermal.heating[1][2],0,"BFHe",'h',
00163 " total helium photoionization heating, all stages ");
00164
00165 HeatMetal = 0.;
00166
00167 for( nelem=2; nelem<LIMELM; ++nelem)
00168 {
00169
00170 for( i=dense.IonLow[nelem]; i < dense.IonHigh[nelem]; i++ )
00171 {
00172 ASSERT( i < LIMELM );
00173
00174 HeatMetal += thermal.heating[nelem][i];
00175 }
00176 }
00177
00178 linadd(HeatMetal,0,"TotM",'h',
00179 " total heavy element photoionization heating, all stages ");
00180
00181 linadd(thermal.heating[0][21],0,"pair",'h',
00182 " heating due to pair production ");
00183
00184
00185
00186 if( LineSave.ipass > 0 )
00187 {
00188
00189 ionbal.CompHeating_Max = MAX2( ionbal.CompHeating_Max , ionbal.CompRecoilHeatLocal/thermal.htot);
00190 }
00191 else
00192 {
00193 ionbal.CompHeating_Max = 0.;
00194 }
00195
00196 linadd(ionbal.CompRecoilHeatLocal,0,"Cbnd",'h',
00197 " heating due to bound compton scattering ");
00198
00199 linadd(rfield.cmheat,0,"ComH",'h',
00200 " Compton heating ");
00201
00202 linadd(CoolHeavy.tccool,0,"ComC",'c',
00203 " total Compton cooling ");
00204
00205
00206 dynamics.HeatMax = MAX2( dynamics.HeatMax , dynamics.Heat() /thermal.htot );
00207
00208 dynamics.CoolMax = MAX2( dynamics.CoolMax , dynamics.Cool() /thermal.htot );
00209
00210 linadd(dynamics.Cool() , 0 , "advC" , 'i',
00211 " cooling due to advection " );
00212
00213 linadd(dynamics.Heat() , 0 , "advH" , 'i' ,
00214 " heating due to advection ");
00215
00216 linadd( thermal.char_tran_heat ,0,"CT H",'h',
00217 " heating due to charge transfer ");
00218
00219 linadd( thermal.char_tran_cool ,0,"CT C",'c',
00220 " cooling due to charge transfer ");
00221
00222 linadd(thermal.heating[1][6],0,"CR H",'h',
00223 " cosmic ray heating ");
00224
00225 linadd(thermal.heating[0][20],0,"extH",'h',
00226 " extra heat added to this zone, from HEXTRA command ");
00227
00228 linadd(CoolHeavy.cextxx,0,"extC",'c',
00229 " extra cooling added to this zone, from CEXTRA command ");
00230
00231
00232
00233 ee511 = (dense.gas_phase[ipHYDROGEN] + 4.*dense.gas_phase[ipHELIUM])*ionbal.PairProducPhotoRate[0]*2.*8.20e-7;
00234 PntForLine(2.427e-2,"e-e+",&ipnt);
00235 lindst(ee511,(realnum)2.427e-2,"e-e+",ipnt,'r',true,
00236 " 511keV annihilation line " );
00237
00238 linadd(CoolHeavy.expans,0,"Expn",'c',
00239 " expansion cooling, only non-zero for wind ");
00240
00241 linadd(iso_sp[ipH_LIKE][ipHYDROGEN].RadRecCool,0,"H FB",'i',
00242 " H radiative recombination cooling ");
00243
00244 linadd(MAX2(0.,iso_sp[ipH_LIKE][ipHYDROGEN].FreeBnd_net_Cool_Rate),0,"HFBc",'c',
00245 " net free-bound cooling ");
00246
00247 linadd(MAX2(0.,-iso_sp[ipH_LIKE][ipHYDROGEN].FreeBnd_net_Cool_Rate),0,"HFBh",'h',
00248 " net free-bound heating ");
00249
00250 linadd(iso_sp[ipH_LIKE][ipHYDROGEN].RecomInducCool_Rate,0,"Hind",'c',
00251 " cooling due to induced rec of hydrogen ");
00252
00253 linadd(CoolHeavy.cyntrn,0,"Cycn",'c',
00254 " cyclotron cooling ");
00255
00256
00257 for( long ipSpecies=0; ipSpecies<nSpecies; ipSpecies++ )
00258 {
00259
00260 char chLabel[5];
00261 strncpy( chLabel, dBaseStates[ipSpecies][0].chLabel(), 4 );
00262 chLabel[4] = '\0';
00263
00264
00265 linadd(dBaseSpecies[ipSpecies].CoolTotal,0, chLabel,'i',
00266 " net cooling due to database species");
00267 }
00268
00269 return;
00270 }
00271