00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "cddefines.h"
00013 #include "physconst.h"
00014 #include "dense.h"
00015 #include "coolheavy.h"
00016 #include "taulines.h"
00017 #include "phycon.h"
00018 #include "iso.h"
00019 #include "conv.h"
00020 #include "trace.h"
00021 #include "hydrogenic.h"
00022 #include "ligbar.h"
00023 #include "cooling.h"
00024 #include "thermal.h"
00025 #include "lines_service.h"
00026 #include "atoms.h"
00027 #include "atomfeii.h"
00028 #include "fe.h"
00029
00030
00031 STATIC void Fe11Lev5(void);
00032
00033
00034 STATIC void Fe13Lev5(void);
00035
00036
00037 STATIC void fe14cs(double te1,
00038 double *csfe14);
00039
00040
00041 STATIC void Fe7Lev8(void);
00042
00043
00044 STATIC void Fe3Lev14(void);
00045
00046
00047 STATIC void Fe4Lev12(void);
00048
00049
00050 STATIC double Fe_10_11_13_cs(
00051
00052 int ion,
00053
00054
00055 int init,
00056 int final )
00057 {
00058 const int N = 10;
00059 static double Fe10cs[6][6][2];
00060 static double Fe11cs[6][6][2];
00061 static double Fe13cs[6][6][2];
00062 int i, j;
00063 double cs;
00064 int index = 0;
00065 double temp_max, temp_min = 4;
00066 double temp_log = phycon.alogte;
00067 static bool lgFirstTime = true;
00068
00069 DEBUG_ENTRY( "Fe_10_11_13_cs()" );
00070
00071 if( lgFirstTime )
00072 {
00073
00074 double aFe10[N] = {10.859,-1.1541,11.593,22.333,-0.4283,7.5663,3.087,1.0937,0.8261,59.678};
00075 double bFe10[N] = {-1.4804,0.4956,-2.1096,-4.1288,0.1929,-1.3525,-0.5531,-0.1748,-0.1286,-11.081};
00076 double aFe11[N] = {5.7269,1.2885,4.0877,0.4571,1.2911,2.2339,0.3621,0.7972,0.2225,1.1021};
00077 double bFe11[N] = {-0.7559,-0.1671,-0.5678,-0.0653,-0.1589,-0.2924,-0.0506,-0.1038,-0.0302,-0.1062};
00078 double aFe13[N] = {2.9102,1.8682,-0.353,0.0622,14.229,-4.3845,0.0375,-6.9222,0.688,-0.0609};
00079 double bFe13[N] = {-0.4158,-0.242,0.1417,0.0023,-2.0643,1.2573,0.0286,2.0919,-0.083,0.1487};
00080
00081
00082 for( i=0; i < 6; i++ )
00083 {
00084 for( j=0; j < 6; j++ )
00085 {
00086 set_NaN( Fe10cs[i][j], 2L );
00087 set_NaN( Fe11cs[i][j], 2L );
00088 set_NaN( Fe13cs[i][j], 2L );
00089 }
00090 }
00091
00092
00093 for( i=1; i < 6; i++ )
00094 {
00095 for( j=i+1; j < 6; j++ )
00096 {
00097 Fe10cs[i][j][0] = aFe10[index];
00098 Fe10cs[i][j][1] = bFe10[index];
00099 Fe11cs[i][j][0] = aFe11[index];
00100 Fe11cs[i][j][1] = bFe11[index];
00101 Fe13cs[i][j][0] = aFe13[index];
00102 Fe13cs[i][j][1] = bFe13[index];
00103 index++;
00104 }
00105 }
00106 lgFirstTime = false;
00107 }
00108
00109
00110
00111 if( init >= final )
00112 {
00113 cs = -1;
00114 }
00115
00116 else if( init < 1 || init > 4 || final < 2 || final > 5 )
00117 {
00118 cs = -1;
00119 }
00120 else
00121 {
00122
00123
00124 if( ion == 10 )
00125 {
00126 temp_max = 5;
00127 temp_log = MAX2(temp_log, temp_min);
00128 temp_log = MIN2(temp_log, temp_max);
00129 cs = Fe10cs[init][final][0] + Fe10cs[init][final][1]*temp_log;
00130 }
00131 else if( ion == 11 )
00132 {
00133 temp_max = 6.7;
00134 temp_log = MAX2(temp_log, temp_min);
00135 temp_log = MIN2(temp_log, temp_max);
00136 cs = Fe11cs[init][final][0] + Fe11cs[init][final][1]*temp_log;
00137 }
00138 else if( ion ==13 )
00139 {
00140 temp_max = 5;
00141 temp_log = MAX2(temp_log, temp_min);
00142 temp_log = MIN2(temp_log, temp_max);
00143 cs = Fe13cs[init][final][0] + Fe13cs[init][final][1]*temp_log;
00144 }
00145 else
00146
00147 TotalInsanity();
00148 }
00149
00150 return cs;
00151 }
00152
00153
00154 STATIC void Fe2_cooling( void )
00155 {
00156 const int NLFE2 = 6;
00157 long int i, j;
00158 int nNegPop;
00159
00160 static double **AulPump,
00161 **CollRate,
00162 **AulEscp,
00163 **col_str ,
00164 **AulDest,
00165 *depart,
00166 *pops,
00167 *destroy,
00168 *create;
00169
00170 static bool lgFirst=true;
00171 bool lgZeroPop;
00172
00173
00174 static double gFe2[NLFE2]={1.,1.,1.,1.,1.,1.};
00175
00176 static double ex[NLFE2]={0.,3.32e4,5.68e4,6.95e4,1.15e5,1.31e5};
00177
00178
00179
00180 static double TUsed = 0.;
00181 static realnum AbunUsed = 0.;
00182
00183 static long int nZUsed=-1,
00184
00185 nCall=0;
00186
00187 DEBUG_ENTRY( "Fe2_cooling()" );
00188
00189
00190 if( dense.xIonDense[ipIRON][1] == 0. )
00191 {
00192
00193
00194 FeII.Fe2_large_cool = 0.;
00195 FeII.Fe2_large_heat = 0.;
00196 FeII.ddT_Fe2_large_cool = 0.;
00197
00198
00199 FeII.Fe2_UVsimp_cool = 0.;
00200 FeII.ddT_Fe2_UVsimp_cool = 0.;
00201
00202
00203 FeIIIntenZero();
00204 return;
00205 }
00206
00207
00208
00209
00210
00211
00212
00213
00214 if( FeII.lgSlow ||
00215 conv.lgFirstSweepThisZone || conv.lgLastSweepThisZone ||
00216
00217 ( !fp_equal( phycon.te, TUsed ) && fabs(FeII.Fe2_large_cool/thermal.ctot) > 0.002 &&
00218 fabs(dense.xIonDense[ipIRON][1]-AbunUsed)/SDIV(AbunUsed) > 0.002 ) ||
00219 ( !fp_equal( phycon.te, TUsed ) && fabs(FeII.Fe2_large_cool/thermal.ctot) > 0.01) )
00220 {
00221
00222 if( conv.lgFirstSweepThisZone )
00223
00224 nCall = 0;
00225 else
00226
00227
00228 ++nCall;
00229
00230
00231 if( trace.nTrConvg >= 5 )
00232 {
00233 fprintf( ioQQQ, " CoolIron5 calling FeIILevelPops since ");
00234 if( conv.lgFirstSweepThisZone )
00235 {
00236 fprintf( ioQQQ,
00237 "first sweep this zone." );
00238 }
00239 else if( ! fp_equal( phycon.te, TUsed ) )
00240 {
00241 fprintf( ioQQQ,
00242 "temperature changed, old new are %g %g, nCall %li ",
00243 TUsed, phycon.te , nCall);
00244 }
00245 else if( nzone != nZUsed )
00246 {
00247 fprintf( ioQQQ,
00248 "new zone, nCall %li ", nCall );
00249 }
00250 else if( FeII.lgSlow )
00251 {
00252 fprintf( ioQQQ,
00253 "FeII.lgSlow set %li", nCall );
00254 }
00255 else if( conv.lgSearch )
00256 {
00257 fprintf( ioQQQ,
00258 " in search phase %li", nCall );
00259 }
00260 else if( nCall < 2 )
00261 {
00262 fprintf( ioQQQ,
00263 "not second nCall %li " , nCall );
00264 }
00265 else if( ! fp_equal( phycon.te, TUsed ) && FeII.Fe2_large_cool/thermal.ctot > 0.001 )
00266 {
00267 fprintf( ioQQQ,
00268 "temp or cooling changed, new are %g %g nCall %li ",
00269 phycon.te, FeII.Fe2_large_cool, nCall );
00270 }
00271 else
00272 {
00273 fprintf(ioQQQ, "????");
00274 }
00275 fprintf(ioQQQ, "\n");
00276 }
00277
00278
00279 TUsed = phycon.te;
00280 AbunUsed = dense.xIonDense[ipIRON][1];
00281 nZUsed = nzone;
00282
00283
00284 if( FeII.lgPrint )
00285 {
00286 fprintf(ioQQQ,
00287 " FeIILevelPops called zone %4li te %5f abun %10e c(fe/tot):%6f nCall %li\n",
00288 nzone,phycon.te,AbunUsed,FeII.Fe2_large_cool/thermal.ctot,nCall);
00289 }
00290
00291
00292
00293
00294
00295
00296
00297
00298 FeII_RT_Make();
00299 FeIILevelPops();
00300 {
00301 enum{DEBUG_LOC=false};
00302 if( DEBUG_LOC && iteration > 1 && nzone >=4 )
00303 {
00304 fprintf(ioQQQ,"DEBUG1\t%li\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\n",
00305 nzone,
00306 phycon.te,
00307 dense.gas_phase[ipHYDROGEN],
00308 dense.eden,
00309 FeII.Fe2_large_cool ,
00310 FeII.ddT_Fe2_large_cool ,
00311 FeII.Fe2_large_cool/dense.eden/dense.gas_phase[ipHYDROGEN] ,
00312 thermal.ctot );
00313 }
00314 }
00315
00316 if( trace.nTrConvg >= 5 || FeII.lgPrint)
00317 {
00318
00319 fprintf( ioQQQ, " FeIILevelPops5 returned cool=%.2e heat=%.2e derivative=%.2e\n",
00320 FeII.Fe2_large_cool,FeII.Fe2_large_heat ,FeII.ddT_Fe2_large_cool);
00321 }
00322
00323 }
00324 else if( ! fp_equal( dense.xIonDense[ipIRON][1], AbunUsed ) )
00325 {
00326 realnum ratio;
00327
00328
00329
00330 if( trace.nTrConvg >= 5 )
00331 {
00332 fprintf( ioQQQ,
00333 " CoolIron rescaling FeIILevelPops since small change, CFe2=%.2e CTOT=%.2e\n",
00334 FeII.Fe2_large_cool,thermal.ctot);
00335 }
00336 ratio = dense.xIonDense[ipIRON][1]/AbunUsed;
00337 FeII.Fe2_large_cool *= ratio;
00338 FeII.ddT_Fe2_large_cool *= ratio;
00339 FeII.Fe2_large_heat *= ratio;
00340 AbunUsed = dense.xIonDense[ipIRON][1];
00341 }
00342 else
00343 {
00344
00345 if( trace.nTrConvg >= 5 )
00346 {
00347 fprintf( ioQQQ, " CoolIron NOT calling FeIILevelPops\n");
00348 }
00349 }
00350
00351
00352
00353
00354 CoolAdd("Fe 2",0,MAX2(0.,FeII.Fe2_large_cool));
00355
00356
00357 thermal.heating[25][27] = MAX2(0.,FeII.Fe2_large_heat);
00358
00359
00360 if( FeII.Fe2_large_cool > 0. )
00361 {
00362
00363 thermal.dCooldT += 3.*FeII.ddT_Fe2_large_cool;
00364 }
00365
00366 if( trace.lgTrace && trace.lgCoolTr )
00367 {
00368 fprintf( ioQQQ, " Large FeII returns te, cooling, dc=%11.3e%11.3e%11.3e\n",
00369 phycon.te, FeII.Fe2_large_cool, FeII.ddT_Fe2_large_cool );
00370 }
00371
00372
00373 if( !FeII.lgFeIILargeOn )
00374 {
00375
00376
00377
00378
00379
00380
00381 if( lgFirst )
00382 {
00383
00384 lgFirst = false;
00385
00386 pops = (double *)MALLOC( sizeof(double)*(NLFE2) );
00387 create = (double *)MALLOC( sizeof(double)*(NLFE2) );
00388 destroy = (double *)MALLOC( sizeof(double)*(NLFE2) );
00389 depart = (double *)MALLOC( sizeof(double)*(NLFE2) );
00390
00391 AulPump = ((double **)MALLOC((NLFE2)*sizeof(double *)));
00392 CollRate = ((double **)MALLOC((NLFE2)*sizeof(double *)));
00393 AulDest = ((double **)MALLOC((NLFE2)*sizeof(double *)));
00394 AulEscp = ((double **)MALLOC((NLFE2)*sizeof(double *)));
00395 col_str = ((double **)MALLOC((NLFE2)*sizeof(double *)));
00396
00397 for( i=0; i < NLFE2; ++i )
00398 {
00399 AulPump[i] = ((double *)MALLOC((NLFE2)*sizeof(double )));
00400 CollRate[i] = ((double *)MALLOC((NLFE2)*sizeof(double )));
00401 AulDest[i] = ((double *)MALLOC((NLFE2)*sizeof(double )));
00402 AulEscp[i] = ((double *)MALLOC((NLFE2)*sizeof(double )));
00403 col_str[i] = ((double *)MALLOC((NLFE2)*sizeof(double )));
00404 }
00405 }
00406
00407
00408 for( i=0; i < NLFE2; i++ )
00409 {
00410 create[i] = 0.;
00411 destroy[i] = 0.;
00412 for( j=0; j < NLFE2; j++ )
00413 {
00414
00415 col_str[j][i] = 0.;
00416 AulEscp[j][i] = 0.;
00417 AulDest[j][i] = 0.;
00418 AulPump[j][i] = 0.;
00419 }
00420 }
00421
00422
00423 AulEscp[1][0] = 1.;
00424 AulEscp[2][0] = ( TauLines[ipTuv3].Emis->Pesc + TauLines[ipTuv3].Emis->Pelec_esc)*TauLines[ipTuv3].Emis->Aul;
00425 AulDest[2][0] = TauLines[ipTuv3].Emis->Pdest*TauLines[ipTuv3].Emis->Aul;
00426 AulPump[0][2] = TauLines[ipTuv3].Emis->pump;
00427
00428 AulEscp[5][0] = (TauLines[ipTFe16].Emis->Pesc + TauLines[ipTFe16].Emis->Pelec_esc)*TauLines[ipTFe16].Emis->Aul;
00429 AulDest[5][0] = TauLines[ipTFe16].Emis->Pdest*TauLines[ipTFe16].Emis->Aul;
00430
00431 AulPump[0][5] = TauLines[ipTFe16].Emis->pump;
00432
00433
00434 double PumpLyaFeII = StatesElemNEW[ipHYDROGEN][ipHYDROGEN-ipH_LIKE][ipH2p].Pop*
00435 Transitions[ipH_LIKE][ipHYDROGEN][ipH2p][ipH1s].Emis->Aul*
00436 hydro.dstfe2lya/SDIV(dense.xIonDense[ipIRON][1]);
00437
00438 AulPump[0][5] += PumpLyaFeII;
00439
00440 AulEscp[2][1] = (TauLines[ipTr48].Emis->Pesc + TauLines[ipTr48].Emis->Pelec_esc)*TauLines[ipTr48].Emis->Aul;
00441 AulDest[2][1] = TauLines[ipTr48].Emis->Pdest*TauLines[ipTr48].Emis->Aul;
00442 AulPump[1][2] = TauLines[ipTr48].Emis->pump;
00443
00444 AulEscp[5][1] = (TauLines[ipTFe26].Emis->Pesc + TauLines[ipTFe26].Emis->Pelec_esc)*TauLines[ipTFe26].Emis->Aul;
00445 AulDest[5][1] = TauLines[ipTFe26].Emis->Pdest*TauLines[ipTFe26].Emis->Aul;
00446 AulPump[1][5] = TauLines[ipTFe26].Emis->pump;
00447
00448 AulEscp[3][2] = (TauLines[ipTFe34].Emis->Pesc + TauLines[ipTFe34].Emis->Pelec_esc)*TauLines[ipTFe34].Emis->Aul;
00449 AulDest[3][2] = TauLines[ipTFe34].Emis->Pdest*TauLines[ipTFe34].Emis->Aul;
00450 AulPump[2][3] = TauLines[ipTFe34].Emis->pump;
00451
00452 AulEscp[4][2] = (TauLines[ipTFe35].Emis->Pesc + TauLines[ipTFe35].Emis->Pelec_esc)*TauLines[ipTFe35].Emis->Aul;
00453 AulDest[4][2] = TauLines[ipTFe35].Emis->Pdest*TauLines[ipTFe35].Emis->Aul;
00454 AulPump[2][4] = TauLines[ipTFe35].Emis->pump;
00455
00456 AulEscp[5][3] = (TauLines[ipTFe46].Emis->Pesc + TauLines[ipTFe46].Emis->Pelec_esc)*TauLines[ipTFe46].Emis->Aul;
00457 AulDest[5][3] = TauLines[ipTFe46].Emis->Pdest*TauLines[ipTFe46].Emis->Aul;
00458 AulPump[3][5] = TauLines[ipTFe46].Emis->pump;
00459
00460 AulEscp[5][4] = (TauLines[ipTFe56].Emis->Pesc + TauLines[ipTFe56].Emis->Pelec_esc)*TauLines[ipTFe56].Emis->Aul;
00461 AulDest[5][4] = TauLines[ipTFe56].Emis->Pdest*TauLines[ipTFe56].Emis->Aul;
00462 AulPump[4][5] = TauLines[ipTFe56].Emis->pump;
00463
00464
00465 col_str[1][0] = 1.;
00466 col_str[2][0] = 12.;
00467 col_str[3][0] = 1.;
00468 col_str[4][0] = 1.;
00469 col_str[5][0] = 12.;
00470 col_str[2][1] = 6.;
00471 col_str[3][1] = 1.;
00472 col_str[4][1] = 1.;
00473 col_str[5][1] = 12.;
00474 col_str[3][2] = 6.;
00475 col_str[4][2] = 12.;
00476 col_str[5][2] = 1.;
00477 col_str[4][3] = 1.;
00478 col_str[5][3] = 12.;
00479 col_str[5][4] = 6.;
00480
00481
00482
00483 atom_levelN(NLFE2,
00484 dense.xIonDense[ipIRON][1],
00485 gFe2,
00486 ex,
00487 'K',
00488 pops,
00489 depart,
00490 &AulEscp ,
00491 &col_str,
00492 &AulDest,
00493 &AulPump,
00494 &CollRate,
00495 create,
00496 destroy,
00497 false,
00498
00499 &FeII.Fe2_UVsimp_cool,
00500 &FeII.ddT_Fe2_UVsimp_cool,
00501 "FeII",
00502 &nNegPop,
00503 &lgZeroPop,
00504 false );
00505
00506
00507 if( nNegPop > 0 )
00508 {
00509 fprintf(ioQQQ," PROBLEM, atom_levelN returned negative population for simple UV FeII.\n");
00510 }
00511
00512 ;
00513 CoolAdd("Fe 2",0,MAX2(0.,FeII.Fe2_UVsimp_cool));
00514 thermal.heating[25][27] = MAX2(0.,-FeII.Fe2_UVsimp_cool);
00515 thermal.dCooldT += FeII.ddT_Fe2_UVsimp_cool;
00516
00517
00518 ASSERT( NLFE2 <= LIMLEVELN );
00519 for( i=0; i < NLFE2; ++i )
00520 {
00521 atoms.PopLevels[i] = pops[i];
00522 atoms.DepLTELevels[i] = depart[i];
00523 }
00524
00525 TauLines[ipTuv3].Lo->Pop = pops[0];
00526 TauLines[ipTuv3].Hi->Pop = pops[2];
00527 TauLines[ipTuv3].Emis->PopOpc = (pops[0] - pops[2]);
00528 TauLines[ipTuv3].Emis->phots = pops[2]*AulEscp[2][0];
00529 TauLines[ipTuv3].Emis->xIntensity =
00530 TauLines[ipTuv3].Emis->phots*TauLines[ipTuv3].EnergyErg;
00531
00532 TauLines[ipTr48].Lo->Pop = pops[1];
00533 TauLines[ipTr48].Hi->Pop = pops[2];
00534 TauLines[ipTr48].Emis->PopOpc = (pops[1] - pops[2]);
00535 TauLines[ipTr48].Emis->phots = pops[2]*AulEscp[2][1];
00536 TauLines[ipTr48].Emis->xIntensity =
00537 TauLines[ipTr48].Emis->phots*TauLines[ipTr48].EnergyErg;
00538
00539 FeII.for7 = pops[1]*AulEscp[1][0]*4.65e-12;
00540
00541 TauLines[ipTFe16].Lo->Pop = pops[0];
00542 TauLines[ipTFe16].Hi->Pop = pops[5];
00543
00544
00545
00546
00547 TauLines[ipTFe16].Emis->PopOpc = (pops[0] - pops[5]);
00548 TauLines[ipTFe16].Emis->phots = pops[5]*AulEscp[5][0];
00549 TauLines[ipTFe16].Emis->xIntensity =
00550 TauLines[ipTFe16].Emis->phots*TauLines[ipTFe16].EnergyErg;
00551
00552 TauLines[ipTFe26].Lo->Pop = pops[1];
00553 TauLines[ipTFe26].Hi->Pop = pops[5];
00554 TauLines[ipTFe26].Emis->PopOpc = (pops[1] - pops[5]);
00555 TauLines[ipTFe26].Emis->phots = pops[5]*AulEscp[5][1];
00556 TauLines[ipTFe26].Emis->xIntensity =
00557 TauLines[ipTFe26].Emis->phots*TauLines[ipTFe26].EnergyErg;
00558
00559 TauLines[ipTFe34].Lo->Pop = pops[2];
00560 TauLines[ipTFe34].Hi->Pop = pops[3];
00561 TauLines[ipTFe34].Emis->PopOpc = (pops[2] - pops[3]);
00562 TauLines[ipTFe34].Emis->phots = pops[3]*AulEscp[3][2];
00563 TauLines[ipTFe34].Emis->xIntensity =
00564 TauLines[ipTFe34].Emis->phots*TauLines[ipTFe34].EnergyErg;
00565
00566 TauLines[ipTFe35].Lo->Pop = pops[2];
00567 TauLines[ipTFe35].Hi->Pop = pops[4];
00568 TauLines[ipTFe35].Emis->PopOpc = (pops[2] - pops[4]);
00569 TauLines[ipTFe35].Emis->phots = pops[4]*AulEscp[4][2];
00570 TauLines[ipTFe35].Emis->xIntensity =
00571 TauLines[ipTFe35].Emis->phots*TauLines[ipTFe35].EnergyErg;
00572
00573 TauLines[ipTFe46].Lo->Pop = pops[3];
00574 TauLines[ipTFe46].Hi->Pop = pops[5];
00575 TauLines[ipTFe46].Emis->PopOpc = (pops[3] - pops[5]);
00576 TauLines[ipTFe46].Emis->phots = pops[5]*AulEscp[5][3];
00577 TauLines[ipTFe46].Emis->xIntensity =
00578 TauLines[ipTFe46].Emis->phots*TauLines[ipTFe46].EnergyErg;
00579
00580 TauLines[ipTFe56].Lo->Pop = pops[4];
00581 TauLines[ipTFe56].Hi->Pop = pops[5];
00582 TauLines[ipTFe56].Emis->PopOpc = (pops[4] - pops[5]);
00583 TauLines[ipTFe56].Emis->phots = pops[5]*AulEscp[5][4];
00584 TauLines[ipTFe56].Emis->xIntensity =
00585 TauLines[ipTFe56].Emis->phots*TauLines[ipTFe56].EnergyErg;
00586
00587
00588
00589
00590 PutCS(10.,&TauLines[ipT191]);
00591 atom_level2(&TauLines[ipT191]);
00592 }
00593
00594 {
00595
00596 enum{DEBUG_LOC=false};
00597
00598 if( DEBUG_LOC && iteration > 1 && nzone >=4 )
00599 {
00600 fprintf(ioQQQ,"DEBUG2\t%.2e\t%.2e\t%.2e\n",
00601 phycon.te,
00602 FeII.Fe2_large_cool ,
00603 FeII.Fe2_UVsimp_cool );
00604 }
00605 }
00606
00607 return;
00608
00609 }
00610
00611
00612 void CoolIron(void)
00613 {
00614 long int i;
00615 double cs ,
00616 cs12, cs13, cs23,
00617 cs2s2p,
00618 cs2s3p;
00619 realnum p2,
00620 rate;
00621
00622 DEBUG_ENTRY( "CoolIron()" );
00623
00624
00625
00629
00630
00631 rate = (realnum)(1.2e-7 * dense.eden +
00632
00633
00634 8.0e-10*pow((phycon.te/100.), 0.17 )*dense.xIonDense[ipHYDROGEN][0]);
00635 LineConvRate2CS( &TauLines[ipFe1_24m] , rate );
00636
00637 rate = (realnum)(9.3e-8 * dense.eden +
00638
00639
00640 5.3e-10*pow((phycon.te/100.), 0.17 )*dense.xIonDense[ipHYDROGEN][0]);
00641 LineConvRate2CS( &TauLines[ipFe1_35m] , rate );
00642
00643 rate = (realnum)(1.2e-7 * dense.eden +
00644
00645
00646 6.9e-10*pow((phycon.te/100.), 0.17 )*dense.xIonDense[ipHYDROGEN][0]);
00647 TauDummy.Hi->g = TauLines[ipFe1_35m].Hi->g;
00648 LineConvRate2CS( &TauDummy , rate );
00649
00650 TauDummy.Hi->g = 0.;
00651
00652 atom_level3(&TauLines[ipFe1_24m],&TauLines[ipFe1_35m],&TauDummy);
00653
00654
00655
00656
00657 MakeCS(&TauLines[ipFeI3884]);
00658 atom_level2(&TauLines[ipFeI3884]);
00659
00660
00661 MakeCS(&TauLines[ipFeI3729]);
00662 atom_level2(&TauLines[ipFeI3729]);
00663
00664
00665 MakeCS(&TauLines[ipFeI3457]);
00666 atom_level2(&TauLines[ipFeI3457]);
00667
00668
00669 MakeCS(&TauLines[ipFeI3021]);
00670 atom_level2(&TauLines[ipFeI3021]);
00671
00672
00673 MakeCS(&TauLines[ipFeI2966]);
00674 atom_level2(&TauLines[ipFeI2966]);
00675
00676
00677 Fe2_cooling();
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691 PutCS(25.,&TauLines[ipT1122]);
00692 atom_level2(&TauLines[ipT1122]);
00693
00694
00695 Fe3Lev14();
00696
00697
00698 Fe4Lev12();
00699
00700
00701 CoolHeavy.c3892 = atom_pop2(7.4,25.,5.,0.6,3.7e4,dense.xIonDense[ipIRON][4])*
00702 5.11e-12;
00703 CoolAdd("Fe 5",3892,CoolHeavy.c3892);
00704
00705
00706
00707
00708 CoolHeavy.c5177 = atom_pop2(1.9,28.,18.,0.52,2.78e4,dense.xIonDense[ipIRON][5])*
00709 3.84e-12;
00710 CoolAdd("Fe 6",5177,CoolHeavy.c5177);
00711
00712
00713 Fe7Lev8();
00714
00715
00716
00717
00718
00719 PutCS(0.123,&TauLines[ipT245]);
00720
00721
00722 AtomSeqBeryllium(.087,.038,.188,&TauLines[ipT245],71.);
00723
00724 CoolHeavy.c242 = atoms.PopLevels[3]*8.22e-11*71.;
00725
00726
00727
00728
00729
00730
00731
00732
00733
00739
00740
00741
00742
00743
00744
00745
00746
00747
00748
00749
00750
00751
00752
00753 cs = Fe_10_11_13_cs(
00754
00755 10,
00756
00757
00758 1,
00759 2 );
00760
00761 PutCS(cs,&TauLines[ipFe106375]);
00762 atom_level2(&TauLines[ipFe106375]);
00763
00764
00765
00766
00767
00768 cs = 0.85*sexp(0.045*1.259e6/phycon.te);
00769 cs = MAX2(0.05,cs);
00770 PutCS(cs,&TauLines[ipT352]);
00771 atom_level2(&TauLines[ipT352]);
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807
00808
00809 Fe11Lev5();
00810
00811
00812
00813
00814
00815
00816 CoolHeavy.c2568 = atom_pop3(4.,10.,6.,0.72,0.69,2.18,8.1e4,1.84e6,1.33e6,
00817 6.37e4,4.91e4,&p2,dense.xIonDense[ipIRON][12-1],0.,0.,0.)*1.33e6*6.79e-12;
00818 CoolAdd("Fe12",2568,CoolHeavy.c2568);
00819 CoolHeavy.c1242 = CoolHeavy.c2568*2.30*1.38;
00820 CoolAdd("Fe12",1242,CoolHeavy.c1242);
00821 CoolHeavy.c2170 = p2*8.09e4*8.82e-12;
00822 CoolAdd("Fe12",2170,CoolHeavy.c2170);
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849 Fe13Lev5();
00850
00851
00852
00853 fe14cs(phycon.alogte,&cs);
00854
00855
00856
00857
00858
00859
00860 CoolHeavy.c5303 = atom_pop2(cs,2.,4.,59.7,2.71e4,dense.xIonDense[ipIRON][14-1])*
00861 3.75e-12;
00862 thermal.dCooldT += CoolHeavy.c5303*2.71e4*thermal.tsq1;
00863 CoolAdd("Fe14",5303,CoolHeavy.c5303);
00864
00865
00866 atom_level2(&TauLines[ipFe17_17]);
00867
00868
00869
00870
00871
00872
00873 if( phycon.te < 1.29E6 )
00874 {
00875 cs = (realnum)(0.3465/((phycon.te10/phycon.te01)*phycon.te001*phycon.te0003));
00876 }
00877 else if( phycon.te < 5.135E6 )
00878 {
00879 cs = (realnum)((1.1062E-02)*phycon.te10*phycon.te05*phycon.te003*phycon.te0005);
00880 }
00881 else
00882 {
00883 cs = (realnum)((60.5728)/(phycon.te40*phycon.te003*phycon.te0001*phycon.te0005));
00884 }
00885
00886 PutCS(cs,&TauLines[ipFe18975]);
00887 atom_level2(&TauLines[ipFe18975]);
00888
00889
00890
00891 cs12 = 0.0627 / phycon.te03;
00892 cs13 = 0.692 /(phycon.te10*phycon.te01);
00893 cs23 = 0.04;
00894
00895
00896 CoolHeavy.c7082 = atom_pop3(5.,1.,3.,cs12,cs13,cs23,0.505,1.46e4,
00897 41.2,1.083e5,2.03e4,&p2,dense.xIonDense[ipIRON][19-1],0.,0.,0.)*41.2*
00898 2.81e-12;
00899 CoolHeavy.c1118 = CoolHeavy.c7082*354.4*6.335;
00900 CoolHeavy.c1328 = p2*0.505*1.50e-11;
00901 CoolAdd("Fe19",7082,CoolHeavy.c7082);
00902 CoolAdd("Fe19",1118,CoolHeavy.c1118);
00903 CoolAdd("Fe19",1328,CoolHeavy.c1328);
00904
00905 CoolHeavy.c592 = atom_pop2(0.0913,9.,5.,1.64e4,2.428e5,dense.xIonDense[ipIRON][19-1])*
00906 3.36e-11;
00907 CoolAdd("Fe19",592,CoolHeavy.c592);
00908
00909
00910
00911
00912
00913
00914 cs = 1.17 /(phycon.te20/phycon.te01);
00915 PutCS(cs , &TauLines[ipTFe20_721]);
00916 cs = 0.248 /(phycon.te10/phycon.te01);
00917 PutCS(cs , &TauLines[ipTFe20_578]);
00918 cs = 0.301 /(phycon.te10/phycon.te02);
00919 PutCS(cs , &TauDummy);
00920 atom_level3(&TauLines[ipTFe20_721],&TauLines[ipTFe20_578],&TauDummy);
00921
00922
00923
00924
00925 PutCS(0.072,&TauLines[ipTFe13]);
00926 PutCS(0.269,&TauLines[ipTFe23]);
00927 PutCS(0.055,&TauDummy);
00928 atom_level3(&TauLines[ipTFe13],&TauLines[ipTFe23],&TauDummy);
00929
00930
00931
00932
00933 static vector< pair<transition*,double> > Fe22Pump;
00934 Fe22Pump.reserve(96);
00935
00936
00937 if( Fe22Pump.empty() )
00938 {
00939
00940 for( i=0; i < nWindLine; ++i )
00941 {
00942
00943 if( TauLine2[i].Hi->nelem == 26 && TauLine2[i].Hi->IonStg == 22 )
00944 {
00945 # if 0
00946 DumpLine( &TauLine2[i] );
00947 # endif
00948 double branch_ratio;
00949
00950
00951 if( fp_equal( TauLine2[i].Hi->g, realnum(2.) ) )
00952 branch_ratio = 2./3.;
00953 else if( fp_equal( TauLine2[i].Hi->g, realnum(6.) ) )
00954 branch_ratio = 1./2.;
00955 else if( fp_equal( TauLine2[i].Hi->g, realnum(10.) ) )
00956 branch_ratio = 1./6.;
00957 else
00958 TotalInsanity();
00959 pair<transition*,double> pp2( &TauLine2[i], branch_ratio );
00960 Fe22Pump.push_back( pp2 );
00961 }
00962 }
00963 }
00964
00965
00966 double Fe22_pump_rate = 0.;
00967 vector< pair<transition*,double> >::const_iterator fe22p;
00968 for( fe22p=Fe22Pump.begin(); fe22p != Fe22Pump.end(); ++fe22p )
00969 {
00970 const transition* t = fe22p->first;
00971 double branch_ratio = fe22p->second;
00972 Fe22_pump_rate += t->Emis->pump*branch_ratio;
00973 # if 0
00974 dprintf( ioQQQ, "Fe XXII %.3e %.3e\n",
00975 t->WLAng , t->Emis->pump*branch_ratio );
00976 # endif
00977 }
00978
00979
00980
00981
00982 AtomSeqBoron(&TauLines[ipFe22_846],
00983 &TauLines[ipFe22_247],
00984 &TauLines[ipFe22_217],
00985 &TauLines[ipFe22_348],
00986 &TauLines[ipFe22_292],
00987 &TauLines[ipFe22_253],
00988
00989
00990
00991
00992 0.00670 , 0.0614 , 0.0438 , 0.122 , Fe22_pump_rate ,"Fe22");
00993
00994
00995
00996
00997
00998
00999
01001
01002
01003
01004 CoolHeavy.c263 = atom_pop2(0.04,1.,9.,1.6e7,5.484e5,dense.xIonDense[ipIRON][23-1])*
01005 7.58e-11;
01006 CoolAdd("Fe23",262,CoolHeavy.c263);
01007
01008
01009
01010 ligbar(26,&TauLines[ipT192],&TauLines[ipT11],&cs2s2p,&cs2s3p);
01011
01012 PutCS(cs2s2p,&TauLines[ipT192]);
01013 atom_level2(&TauLines[ipT192]);
01014
01015
01016 PutCS(cs2s2p*0.376,&TauLines[ipT255]);
01017 atom_level2(&TauLines[ipT255]);
01018
01019 PutCS(cs2s3p,&TauLines[ipT11]);
01020 atom_level2(&TauLines[ipT11]);
01021
01023 TauLines[ipT353].Emis->PopOpc = dense.xIonDense[ipIRON][11-1];
01024 TauLines[ipT353].Lo->Pop = dense.xIonDense[ipIRON][11-1];
01025 TauLines[ipT353].Hi->Pop = 0.;
01026 TauLines[ipT347].Emis->PopOpc = dense.xIonDense[ipIRON][14-1];
01027 TauLines[ipT347].Lo->Pop = dense.xIonDense[ipIRON][14-1];
01028 TauLines[ipT347].Hi->Pop = 0.;
01029
01030 return;
01031 }
01032
01033
01034
01035
01036
01037 STATIC void fe14cs(double te1,
01038 double *csfe14)
01039 {
01040 double a,
01041 b,
01042 c,
01043 d,
01044 telog1,
01045 telog2,
01046 telog3;
01047
01048 DEBUG_ENTRY( "fe14cs()" );
01049
01050
01051 telog1 = te1;
01052 telog1 = MIN2(9.0,telog1);
01053 telog1 = MAX2(4.0,telog1);
01054
01055
01056 telog2 = telog1*telog1;
01057 telog3 = telog2*telog1;
01058
01059
01060
01061 if( telog1 <= 5.0 )
01062 {
01063 a = 557.05536;
01064 b = -324.56109;
01065 c = 63.437974;
01066 d = -4.1365147;
01067 *csfe14 = a + b*telog1 + c*telog2 + d*telog3;
01068 }
01069 else
01070 {
01071 a = 0.19515493;
01072 b = 2.9404407;
01073 c = 4.9578944;
01074 d = 0.79887506;
01075 *csfe14 = a + b*exp(-0.5*((telog1-c)*(telog1-c)/d));
01076 }
01077 return;
01078 }
01079
01080
01081 STATIC void Fe4Lev12(void)
01082 {
01083 const int NLFE4 = 12;
01084 bool lgZeroPop;
01085 int nNegPop;
01086 long int i,
01087 j;
01088 static bool lgFirst=true;
01089
01090 double dfe4dt;
01091
01092
01093 static double
01094 **AulEscp,
01095 **col_str,
01096 **AulDest,
01097 depart[NLFE4],
01098 pops[NLFE4],
01099 destroy[NLFE4],
01100 create[NLFE4],
01101 **CollRate,
01102 **AulPump;
01103
01104 static const double Fe4A[NLFE4][NLFE4] = {
01105 {0.,0.,0.,1.e-5,0.,1.368,.89,0.,1.3e-3,1.8e-4,.056,.028},
01106 {0.,0.,2.6e-8,0.,0.,0.,0.,0.,1.7e-7,0.,0.,0.},
01107 {0.,0.,0.,0.,3.5e-7,6.4e-10,0.,0.,6.315e-4,0.,6.7e-7,0.},
01108 {0.,0.,0.,0.,1.1e-6,6.8e-5,8.6e-6,3.4e-10,7.6e-5,1.e-7,5.8e-4,2.8e-4},
01109 {0.,0.,0.,0.,0.,1.5e-5,1.3e-9,0.,7.6e-4,0.,1.1e-6,6.0e-7},
01110 {0.,0.,0.,0.,0.,0.,1.1e-5,1.2e-13,.038,9.9e-7,.022,.018},
01111 {0.,0.,0.,0.,0.,0.,0.,3.7e-5,2.9e-6,.034,3.5e-3,.039},
01112 {0.,0.,0.,0.,0.,0.,0.,0.,0.,.058,3.1e-6,1.4e-3},
01113 {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,1.3e-4,3.1e-14},
01114 {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,1.9e-19,1.0e-5},
01115 {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,1.3e-7},
01116 {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.}
01117 };
01118 static const double Fe4CS[NLFE4][NLFE4] = {
01119 {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.},
01120 {0.98,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.},
01121 {0.8167,3.72,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.},
01122 {0.49,0.0475,0.330,0.,0.,0.,0.,0.,0.,0.,0.,0.},
01123 {0.6533,0.473,2.26,1.64,0.,0.,0.,0.,0.,0.,0.,0.},
01124 {0.45,0.686,0.446,0.106,0.254,0.,0.,0.,0.,0.,0.,0.},
01125 {0.30,0.392,0.152,0.269,0.199,0.605,0.,0.,0.,0.,0.,0.},
01126 {0.15,0.0207,0.190,0.0857,0.166,0.195,0.327,0.,0.,0.,0.,0.},
01127 {0.512,1.23,0.733,0.174,0.398,0.623,0.335,0.102,0.,0.,0.,0.},
01128 {0.128,0.0583,0.185,0.200,0.188,0.0835,0.127,0.0498,0.0787,0.,0.,0.},
01129 {0.384,0.578,0.534,0.363,0.417,0.396,0.210,0.171,0.810,0.101,0.,0.},
01130 {0.256,0.234,0.306,0.318,0.403,0.209,0.195,0.112,0.195,0.458,0.727,0.}
01131 };
01132
01133 static const double gfe4[NLFE4]={6.,12.,10.,6.,8.,6.,4.,2.,8.,2.,6.,4.};
01134
01135
01136
01137
01138
01139
01140 static const double excit_wn[NLFE4]={0.,32245.5,32292.8,32301.2,32305.7,35253.8,
01141 35333.3,35406.6,38779.4,38896.7,38935.1,38938.2};
01142
01143 DEBUG_ENTRY( "Fe4Lev12()" );
01144
01145 if( lgFirst )
01146 {
01147
01148 lgFirst = false;
01149
01150
01151 AulPump = ((double **)MALLOC((NLFE4)*sizeof(double *)));
01152 CollRate = ((double **)MALLOC((NLFE4)*sizeof(double *)));
01153 AulDest = ((double **)MALLOC((NLFE4)*sizeof(double *)));
01154 AulEscp = ((double **)MALLOC((NLFE4)*sizeof(double *)));
01155 col_str = ((double **)MALLOC((NLFE4)*sizeof(double *)));
01156 for( i=0; i < NLFE4; ++i )
01157 {
01158 AulPump[i] = ((double *)MALLOC((NLFE4)*sizeof(double )));
01159 CollRate[i] = ((double *)MALLOC((NLFE4)*sizeof(double )));
01160 AulDest[i] = ((double *)MALLOC((NLFE4)*sizeof(double )));
01161 AulEscp[i] = ((double *)MALLOC((NLFE4)*sizeof(double )));
01162 col_str[i] = ((double *)MALLOC((NLFE4)*sizeof(double )));
01163 }
01164 }
01165
01166
01167 if( dense.xIonDense[ipIRON][3] <= 0. )
01168 {
01169 fe.Fe4CoolTot = 0.;
01170 fe.fe40401 = 0.;
01171 fe.fe42836 = 0.;
01172 fe.fe42829 = 0.;
01173 fe.fe42567 = 0.;
01174 fe.fe41207 = 0.;
01175 fe.fe41206 = 0.;
01176 fe.fe41106 = 0.;
01177 fe.fe41007 = 0.;
01178 fe.fe41008 = 0.;
01179 fe.fe40906 = 0.;
01180 CoolAdd("Fe 4",0,0.);
01181
01182
01183
01184 ASSERT( NLFE4 <= LIMLEVELN);
01185 for( i=0; i < NLFE4; i++ )
01186 {
01187 atoms.PopLevels[i] = 0.;
01188 atoms.DepLTELevels[i] = 1.;
01189 }
01190 return;
01191 }
01192
01193
01194
01195
01196
01197
01198
01199
01200
01201
01202
01203
01204
01205
01206
01207
01208
01209 for( i=0; i < NLFE4; i++ )
01210 {
01211 create[i] = 0.;
01212 destroy[i] = 0.;
01213 for( j=0; j < NLFE4; j++ )
01214 {
01215
01216 col_str[j][i] = 0.;
01217 AulEscp[j][i] = 0.;
01218 AulDest[j][i] = 0.;
01219 AulPump[j][i] = 0.;
01220 }
01221 }
01222
01223
01224 for( i=0; i < NLFE4; i++ )
01225 {
01226 for( j=i+1; j < NLFE4; j++ )
01227 {
01228
01229 AulEscp[j][i] = Fe4A[i][j];
01230
01231 col_str[j][i] = Fe4CS[j][i];
01232 }
01233 }
01234
01235
01236
01237
01238 atom_levelN(NLFE4,
01239 dense.xIonDense[ipIRON][3],
01240 gfe4,
01241 excit_wn,
01242 'w',
01243 pops,
01244 depart,
01245 &AulEscp ,
01246 &col_str ,
01247 &AulDest,
01248 &AulPump,
01249 &CollRate,
01250 create,
01251 destroy,
01252
01253 false,
01254 &fe.Fe4CoolTot,
01255 &dfe4dt,
01256 "FeIV",
01257
01258 &nNegPop,
01259 &lgZeroPop,
01260 false );
01261
01262
01263 ASSERT( NLFE4 <= LIMLEVELN );
01264 for( i=0; i < NLFE4; ++i )
01265 {
01266 atoms.PopLevels[i] = pops[i];
01267 atoms.DepLTELevels[i] = depart[i];
01268 }
01269
01270 if( nNegPop > 0 )
01271 {
01272 fprintf( ioQQQ, " fe4levl2 found negative populations\n" );
01273 ShowMe();
01274 cdEXIT(EXIT_FAILURE);
01275 }
01276
01277 CoolAdd("Fe 4",0,fe.Fe4CoolTot);
01278
01279 thermal.dCooldT += dfe4dt;
01280
01281
01282
01283 fe.fe40401 = (pops[3]*Fe4A[0][3]*(excit_wn[3] - excit_wn[0]) +
01284 pops[4]*Fe4A[0][4]*(excit_wn[4] - excit_wn[0]) )*T1CM*BOLTZMANN;
01285
01286 fe.fe42836 = pops[5]*Fe4A[0][5]*(excit_wn[5] - excit_wn[0])*T1CM*BOLTZMANN;
01287
01288 fe.fe42829 = pops[6]*Fe4A[0][6]*(excit_wn[5] - excit_wn[0])*T1CM*BOLTZMANN;
01289
01290 fe.fe42567 = (pops[10]*Fe4A[0][10]*(excit_wn[10] - excit_wn[0]) +
01291 pops[11]*Fe4A[0][11]*(excit_wn[10] - excit_wn[0]))*T1CM*BOLTZMANN;
01292
01293 fe.fe41207 = pops[11]*Fe4A[6][11]*(excit_wn[11] - excit_wn[6])*T1CM*BOLTZMANN;
01294 fe.fe41206 = pops[11]*Fe4A[5][11]*(excit_wn[11] - excit_wn[5])*T1CM*BOLTZMANN;
01295 fe.fe41106 = pops[10]*Fe4A[5][10]*(excit_wn[10] - excit_wn[5])*T1CM*BOLTZMANN;
01296 fe.fe41007 = pops[9]*Fe4A[6][9]*(excit_wn[9] - excit_wn[6])*T1CM*BOLTZMANN;
01297 fe.fe41008 = pops[9]*Fe4A[7][9]*(excit_wn[9] - excit_wn[7])*T1CM*BOLTZMANN;
01298 fe.fe40906 = pops[8]*Fe4A[5][8]*(excit_wn[8] - excit_wn[5])*T1CM*BOLTZMANN;
01299 return;
01300 }
01301
01302
01303 STATIC void Fe7Lev8(void)
01304 {
01305 bool lgZeroPop;
01306 int nNegPop;
01307 double scale;
01308 long int i,
01309 j;
01310 static bool lgFirst=true;
01311 static long int ipPump=-1;
01312
01313 double dfe7dt,
01314 FUV_pump;
01315
01316 long int ihi , ilo;
01317 static double
01318 *depart,
01319 *pops,
01320 *destroy,
01321 *create ,
01322 **AulDest,
01323 **CollRate,
01324 **AulPump,
01325 **AulNet,
01326 **col_str;
01327
01328
01329
01330
01331
01332
01333
01334
01335
01336
01337
01338
01339
01340
01341
01342
01343
01344
01345
01346 static double gfe7[NLFE7]={5.,7.,9.,5.,1.,3.,5.,9.};
01347
01348
01349
01350
01351
01352
01353
01354 static double excit_wn[NLFE7]={0. , 1051.5 , 2331.5 , 17475.5 , 20040.3 , 20430.1 , 21278.6 , 28927.3 };
01355
01356 DEBUG_ENTRY( "Fe7Lev8()" );
01357
01358 if( lgFirst )
01359 {
01360
01361 lgFirst = false;
01362
01363
01364 depart = ((double *)MALLOC((NLFE7)*sizeof(double)));
01365 pops = ((double *)MALLOC((NLFE7)*sizeof(double)));
01366 destroy = ((double *)MALLOC((NLFE7)*sizeof(double)));
01367 create = ((double *)MALLOC((NLFE7)*sizeof(double)));
01368
01369 fe.Fe7_wl = ((double **)MALLOC((NLFE7)*sizeof(double *)));
01370 fe.Fe7_emiss = ((double **)MALLOC((NLFE7)*sizeof(double *)));
01371 AulNet = ((double **)MALLOC((NLFE7)*sizeof(double *)));
01372 col_str = ((double **)MALLOC((NLFE7)*sizeof(double *)));
01373 AulPump = ((double **)MALLOC((NLFE7)*sizeof(double *)));
01374 CollRate = ((double **)MALLOC((NLFE7)*sizeof(double *)));
01375 AulDest = ((double **)MALLOC((NLFE7)*sizeof(double *)));
01376 for( i=0; i < NLFE7; ++i )
01377 {
01378 fe.Fe7_wl[i] = ((double *)MALLOC((NLFE7)*sizeof(double )));
01379 fe.Fe7_emiss[i] = ((double *)MALLOC((NLFE7)*sizeof(double )));
01380 AulNet[i] = ((double *)MALLOC((NLFE7)*sizeof(double )));
01381 col_str[i] = ((double *)MALLOC((NLFE7)*sizeof(double )));
01382 AulPump[i] = ((double *)MALLOC((NLFE7)*sizeof(double )));
01383 CollRate[i] = ((double *)MALLOC((NLFE7)*sizeof(double )));
01384 AulDest[i] = ((double *)MALLOC((NLFE7)*sizeof(double )));
01385 }
01386
01387
01388 for( i=0; i < NLFE7; ++i )
01389 {
01390 create[i] = 0.;
01391 destroy[i] = 0.;
01392 for( j=0; j < NLFE7; ++j )
01393 {
01394 AulNet[i][j] = 0.;
01395 col_str[i][j] = 0.;
01396 CollRate[i][j] = 0.;
01397 AulDest[i][j] = 0.;
01398 AulPump[i][j] = 0.;
01399 fe.Fe7_wl[i][j] = 0.;
01400 fe.Fe7_emiss[i][j] = 0.;
01401 }
01402 }
01403 set_NaN( fe.Fe7_wl[2][1] );
01404 set_NaN( fe.Fe7_emiss[2][1] );
01405 set_NaN( fe.Fe7_wl[1][0] );
01406 set_NaN( fe.Fe7_emiss[1][0] );
01407
01408
01409 for( ilo=0; ilo < NLFE7-1; ++ilo )
01410 {
01411
01412 for( ihi=MAX2(3,ilo+1); ihi < NLFE7; ++ihi )
01413 {
01414 fe.Fe7_wl[ihi][ilo] = 1e8/(excit_wn[ihi]-excit_wn[ilo]) / RefIndex( excit_wn[ihi]-excit_wn[ilo] );
01415 }
01416 }
01417
01418
01419
01420 AulNet[1][0] = 0.0325;
01421 AulNet[2][0] = 0.167e-8;
01422
01423 AulNet[3][0] = 0.372;
01424 AulNet[4][0] = 0.135;
01425 AulNet[5][0] = 0.502e-1;
01426
01427 AulNet[6][0] = 0.0150;
01428 AulNet[7][0] = 0.959e-3;
01429
01430 AulNet[2][1] = 0.466e-1;
01431 AulNet[3][1] = 0.603;
01432 AulNet[5][1] = 0.762e-1;
01433 AulNet[6][1] = 0.697e-1;
01434 AulNet[7][1] = 0.343;
01435
01436 AulNet[3][2] = 0.139e-2;
01437 AulNet[6][2] = 0.735e-1;
01438 AulNet[7][2] = 0.503;
01439
01440 AulNet[4][3] = 0.472e-6;
01441 AulNet[5][3] = 0.572e-1;
01442
01443 AulNet[6][3] = 0.182;
01444 AulNet[7][3] = 0.414e-2;
01445
01446 AulNet[5][4] = 0.115e-2;
01447 AulNet[6][4] = 0.139e-7;
01448
01449 AulNet[6][5] = 0.743e-2;
01450
01451 AulNet[7][6] = 0.454e-4;
01452
01453
01455
01456 # if 0
01457 if( fudge(-1) )
01458 {
01459 fprintf(ioQQQ,"DEBUG fudge call cool_iron\n");
01460 scale = fudge(0);
01461 }
01462 else
01463 # endif
01464 scale = 1.;
01465
01466 col_str[1][0] = 3.35;
01467 col_str[2][0] = 1.17;
01468 col_str[3][0] = 0.959;
01469 col_str[4][0] = 0.299;
01470 col_str[5][0] = 0.633;
01471 col_str[6][0] = 0.549;
01472 col_str[7][0] = 1.24*scale;
01473
01474 col_str[2][1] = 4.11;
01475 col_str[3][1] = 1.29;
01476 col_str[4][1] = 0.235;
01477 col_str[5][1] = 0.833;
01478 col_str[6][1] = 1.06;
01479 col_str[7][1] = 1.74*scale;
01480
01481 col_str[3][2] = 1.60;
01482 col_str[4][2] = 0.187;
01483 col_str[5][2] = 0.690;
01484 col_str[6][2] = 1.94;
01485 col_str[7][2] = 2.25*scale;
01486
01487 col_str[4][3] = 0.172;
01488 col_str[5][3] = 0.531;
01489 col_str[6][3] = 1.06;
01490 col_str[7][3] = 2.02;
01491
01492 col_str[5][4] = 0.370;
01493 col_str[6][4] = 0.324;
01494 col_str[7][4] = 0.164;
01495
01496 col_str[6][5] = 1.17;
01497 col_str[7][5] = 0.495;
01498
01499 col_str[7][6] = 0.903;
01500
01501
01502
01503 if( nWindLine > 0 )
01504 {
01505 ipPump = -1;
01506 for( i=0; i < nWindLine; ++i )
01507 {
01508
01509 if( TauLine2[i].Hi->nelem == 26 && TauLine2[i].Hi->IonStg == 7 &&
01510
01511
01512
01513
01514 (TauLine2[i].EnergyWN-4.27360E+05) < 0. )
01515 {
01516 ipPump = i;
01517 break;
01518 }
01519 }
01520 if( ipPump < 0 )
01521 {
01522 fprintf(ioQQQ,"PROBLEM Fe7Lev8 cannot identify the FUV driving line.\n");
01523 TotalInsanity();
01524 }
01525 }
01526 else
01527 {
01528 ipPump = 0;
01529 }
01530 }
01531
01532
01533 if( dense.xIonDense[ipIRON][6] <= 0. )
01534 {
01535 CoolAdd("Fe 7",0,0.);
01536
01537 fe.Fe7CoolTot = 0.;
01538 for( ilo=0; ilo < NLFE7-1; ++ilo )
01539 {
01540
01541 for( ihi=MAX2(3,ilo+1); ihi < NLFE7; ++ihi )
01542 {
01543 fe.Fe7_emiss[ihi][ilo] = 0.;
01544 }
01545 }
01546 TauLines[ipFe0795].Lo->Pop = 0.;
01547 TauLines[ipFe0795].Emis->PopOpc = 0.;
01548 TauLines[ipFe0795].Hi->Pop = 0.;
01549 TauLines[ipFe0795].Emis->xIntensity = 0.;
01550 TauLines[ipFe0795].Coll.cool = 0.;
01551 TauLines[ipFe0795].Emis->phots = 0.;
01552 TauLines[ipFe0795].Emis->ColOvTot = 0.;
01553 TauLines[ipFe0795].Coll.heat = 0.;
01554 CoolAdd( "Fe 7", TauLines[ipFe0795].WLAng , 0.);
01555 TauLines[ipFe0778].Lo->Pop = 0.;
01556 TauLines[ipFe0778].Emis->PopOpc = 0.;
01557 TauLines[ipFe0778].Hi->Pop = 0.;
01558 TauLines[ipFe0778].Emis->xIntensity = 0.;
01559 TauLines[ipFe0778].Coll.cool = 0.;
01560 TauLines[ipFe0778].Emis->phots = 0.;
01561 TauLines[ipFe0778].Emis->ColOvTot = 0.;
01562 TauLines[ipFe0778].Coll.heat = 0.;
01563 CoolAdd( "Fe 7", TauLines[ipFe0778].WLAng , 0.);
01564
01565
01566 ASSERT( NLFE7 <= LIMLEVELN);
01567 for( i=0; i < NLFE7; i++ )
01568 {
01569 atoms.PopLevels[i] = 0.;
01570 atoms.DepLTELevels[i] = 1.;
01571 }
01572 return;
01573 }
01574
01575
01576 if( ipPump )
01577 {
01578 FUV_pump = TauLine2[ipPump].Emis->pump * 0.3 /(0.3+TauLine2[ipPump].Emis->Pesc);
01579 }
01580 else
01581 {
01582 FUV_pump = 0.;
01583 }
01584
01585
01586
01587 AulPump[0][4] = FUV_pump;
01588 AulPump[1][4] = FUV_pump;
01589 AulPump[2][4] = FUV_pump;
01590 AulPump[0][5] = FUV_pump;
01591 AulPump[1][5] = FUV_pump;
01592 AulPump[2][5] = FUV_pump;
01593 AulPump[0][6] = FUV_pump;
01594 AulPump[1][6] = FUV_pump;
01595 AulPump[2][6] = FUV_pump;
01596
01597
01598 AulPump[4][0] = 0;
01599 AulPump[4][1] = 0;
01600 AulPump[4][2] = 0;
01601 AulPump[5][0] = 0;
01602 AulPump[5][1] = 0;
01603 AulPump[5][2] = 0;
01604 AulPump[6][0] = 0;
01605 AulPump[6][1] = 0;
01606 AulPump[6][2] = 0;
01607
01608
01609 AulNet[1][0] = TauLines[ipFe0795].Emis->Aul*(TauLines[ipFe0795].Emis->Pesc + TauLines[ipFe0795].Emis->Pelec_esc);
01610 AulDest[1][0] = TauLines[ipFe0795].Emis->Aul*TauLines[ipFe0795].Emis->Pdest;
01611 AulPump[0][1] = TauLines[ipFe0795].Emis->pump;
01612 AulPump[1][0] = 0.;
01613
01614 AulNet[2][1] = TauLines[ipFe0778].Emis->Aul*(TauLines[ipFe0778].Emis->Pesc + TauLines[ipFe0778].Emis->Pelec_esc);
01615 AulDest[2][1] = TauLines[ipFe0778].Emis->Aul*TauLines[ipFe0778].Emis->Pdest;
01616 AulPump[1][2] = TauLines[ipFe0778].Emis->pump;
01617 AulPump[2][1] = 0.;
01618
01619
01620 atom_levelN(
01621
01622 NLFE7,
01623
01624 dense.xIonDense[ipIRON][6],
01625
01626 gfe7,
01627
01628 excit_wn,
01629
01630 'w',
01631
01632 pops,
01633
01634 depart,
01635
01636 &AulNet ,
01637
01638 &col_str ,
01639
01640 &AulDest,
01641
01642 &AulPump,
01643
01644 &CollRate,
01645
01646 create,
01647
01648 destroy,
01649
01650 false,
01651 &fe.Fe7CoolTot,
01652 &dfe7dt,
01653 "Fe 7",
01654 &nNegPop,
01655 &lgZeroPop,
01656 false );
01657
01658
01659 ASSERT( NLFE7 <= LIMLEVELN );
01660 for( i=0; i < NLFE7; ++i )
01661 {
01662 atoms.PopLevels[i] = pops[i];
01663 atoms.DepLTELevels[i] = depart[i];
01664 }
01665
01666 if( lgZeroPop )
01667 {
01668
01669
01670 PutCS(col_str[1][0],&TauLines[ipFe0795]);
01671 PutCS(col_str[2][1],&TauLines[ipFe0778]);
01672 PutCS(col_str[2][0],&TauDummy);
01673 atom_level3(&TauLines[ipFe0795],&TauLines[ipFe0778],&TauDummy);
01674 atoms.PopLevels[0] = TauLines[ipFe0795].Lo->Pop;
01675 atoms.PopLevels[1] = TauLines[ipFe0795].Hi->Pop;
01676 atoms.PopLevels[2] = TauLines[ipFe0778].Hi->Pop;
01677 for( ilo=0; ilo < NLFE7-1; ++ilo )
01678 {
01679
01680 for( ihi=MAX2(3,ilo+1); ihi < NLFE7; ++ihi )
01681 {
01682 fe.Fe7_emiss[ihi][ilo] = 0.;
01683 }
01684 }
01685 }
01686 else
01687 {
01688
01689 TauLines[ipFe0795].Lo->Pop = atoms.PopLevels[0];
01690 TauLines[ipFe0795].Hi->Pop = atoms.PopLevels[1];
01691 TauLines[ipFe0795].Emis->PopOpc = (pops[0] - pops[1]*gfe7[0]/gfe7[1]);
01692 TauLines[ipFe0795].Emis->xIntensity = TauLines[ipFe0795].Emis->phots*TauLines[ipFe0795].EnergyErg;
01693 TauLines[ipFe0795].Emis->phots = TauLines[ipFe0795].Emis->Aul*(TauLines[ipFe0795].Emis->Pesc + TauLines[ipFe0795].Emis->Pelec_esc)*pops[1];
01694 TauLines[ipFe0795].Emis->ColOvTot = CollRate[0][1]/(CollRate[0][1]+TauLines[ipFe0795].Emis->pump);
01695 TauLines[ipFe0795].Coll.cool = 0.;
01696 TauLines[ipFe0795].Coll.heat = 0.;
01697
01698 TauLines[ipFe0778].Lo->Pop = atoms.PopLevels[1];
01699 TauLines[ipFe0778].Hi->Pop = atoms.PopLevels[2];
01700 TauLines[ipFe0778].Emis->PopOpc = (pops[1] - pops[2]*gfe7[1]/gfe7[2]);
01701 TauLines[ipFe0778].Emis->xIntensity = TauLines[ipFe0778].Emis->phots*TauLines[ipFe0778].EnergyErg;
01702 TauLines[ipFe0778].Emis->phots = TauLines[ipFe0778].Emis->Aul*(TauLines[ipFe0778].Emis->Pesc + TauLines[ipFe0778].Emis->Pelec_esc)*pops[2];
01703 TauLines[ipFe0778].Emis->ColOvTot = CollRate[1][2]/(CollRate[1][2]+TauLines[ipFe0778].Emis->pump);
01704 TauLines[ipFe0778].Coll.heat = 0.;
01705 TauLines[ipFe0778].Coll.cool = 0.;
01706 }
01707
01708 if( nNegPop > 0 )
01709 {
01710 fprintf( ioQQQ, "PROBLEM Fe7Lev8 found negative populations\n" );
01711 ShowMe();
01712 cdEXIT(EXIT_FAILURE);
01713 }
01714
01715
01716 CoolAdd("Fe 7",0,fe.Fe7CoolTot);
01717
01718 thermal.dCooldT += dfe7dt;
01719
01720
01721 for( ilo=0; ilo < NLFE7-1; ++ilo )
01722 {
01723
01724 for( ihi=MAX2(3,ilo+1); ihi < NLFE7; ++ihi )
01725 {
01726
01727 fe.Fe7_emiss[ihi][ilo] = pops[ihi]*AulNet[ihi][ilo]*(excit_wn[ihi] - excit_wn[ilo])*ERG1CM;
01728 }
01729 }
01730 return;
01731 }
01732
01733
01734
01735
01736
01737 STATIC void Fe3Lev14(void)
01738 {
01739 bool lgZeroPop;
01740 int nNegPop;
01741 long int i,
01742 j;
01743 static bool lgFirst=true;
01744
01745 double dfe3dt;
01746
01747 long int ihi , ilo;
01748 static double
01749 *depart,
01750 *pops,
01751 *destroy,
01752 *create ,
01753 **AulDest,
01754 **CollRate,
01755 **AulPump,
01756 **AulNet,
01757 **col_str;
01758
01759
01760 static double gfe3[NLFE3]={9.,7.,5.,3.,1.,5.,13.,11.,9.,3.,1.,9.,7.,5.};
01761
01762
01763
01764
01765
01766 static double excit_wn[NLFE3]={
01767 0.0 , 436.2, 738.9, 932.4, 1027.3,
01768 19404.8, 20051.1, 20300.8, 20481.9, 20688.4,
01769 21208.5, 21462.2, 21699.9, 21857.2 };
01770
01771 DEBUG_ENTRY( "Fe3Lev14()" );
01772
01773 if( lgFirst )
01774 {
01775
01776 lgFirst = false;
01777
01778
01779 depart = ((double *)MALLOC((NLFE3)*sizeof(double)));
01780 pops = ((double *)MALLOC((NLFE3)*sizeof(double)));
01781 destroy = ((double *)MALLOC((NLFE3)*sizeof(double)));
01782 create = ((double *)MALLOC((NLFE3)*sizeof(double)));
01783
01784 fe.Fe3_wl = ((double **)MALLOC((NLFE3)*sizeof(double *)));
01785 fe.Fe3_emiss = ((double **)MALLOC((NLFE3)*sizeof(double *)));
01786 AulNet = ((double **)MALLOC((NLFE3)*sizeof(double *)));
01787 col_str = ((double **)MALLOC((NLFE3)*sizeof(double *)));
01788 AulPump = ((double **)MALLOC((NLFE3)*sizeof(double *)));
01789 CollRate = ((double **)MALLOC((NLFE3)*sizeof(double *)));
01790 AulDest = ((double **)MALLOC((NLFE3)*sizeof(double *)));
01791 for( i=0; i < NLFE3; ++i )
01792 {
01793 fe.Fe3_wl[i] = ((double *)MALLOC((NLFE3)*sizeof(double )));
01794 fe.Fe3_emiss[i] = ((double *)MALLOC((NLFE3)*sizeof(double )));
01795 AulNet[i] = ((double *)MALLOC((NLFE3)*sizeof(double )));
01796 col_str[i] = ((double *)MALLOC((NLFE3)*sizeof(double )));
01797 AulPump[i] = ((double *)MALLOC((NLFE3)*sizeof(double )));
01798 CollRate[i] = ((double *)MALLOC((NLFE3)*sizeof(double )));
01799 AulDest[i] = ((double *)MALLOC((NLFE3)*sizeof(double )));
01800 }
01801
01802
01803 for( i=0; i < NLFE3; ++i )
01804 {
01805 create[i] = 0.;
01806 destroy[i] = 0.;
01807 for( j=0; j < NLFE3; ++j )
01808 {
01809 AulNet[i][j] = 0.;
01810 col_str[i][j] = 0.;
01811 CollRate[i][j] = 0.;
01812 AulDest[i][j] = 0.;
01813 AulPump[i][j] = 0.;
01814 fe.Fe3_wl[i][j] = 0.;
01815 fe.Fe3_emiss[i][j] = 0.;
01816 }
01817 }
01818
01819
01820 for( ihi=1; ihi < NLFE3; ++ihi )
01821 {
01822 for( ilo=0; ilo < ihi; ++ilo )
01823 {
01824 fe.Fe3_wl[ihi][ilo] = 1e8/(excit_wn[ihi]-excit_wn[ilo]) /
01825 RefIndex( (excit_wn[ihi]-excit_wn[ilo]) );
01826 }
01827 }
01828
01829
01830
01831 AulNet[1][0] = 2.8e-3;
01832 AulNet[7][0] = 4.9e-6;
01833 AulNet[8][0] = 5.7e-3;
01834 AulNet[11][0] = 4.5e-1;
01835 AulNet[12][0] = 4.2e-2;
01836
01837 AulNet[2][1] = 1.8e-3;
01838 AulNet[5][1] = 4.2e-1;
01839 AulNet[8][1] = 1.0e-3;
01840 AulNet[11][1] = 8.4e-2;
01841 AulNet[12][1] = 2.5e-1;
01842 AulNet[13][1] = 2.7e-2;
01843
01844 AulNet[3][2] = 7.0e-4;
01845 AulNet[5][2] = 5.1e-5;
01846 AulNet[9][2] = 5.4e-1;
01847 AulNet[12][2] = 8.5e-2;
01848 AulNet[13][2] = 9.8e-2;
01849
01850 AulNet[4][3] = 1.4e-4;
01851 AulNet[5][3] = 3.9e-2;
01852 AulNet[9][3] = 4.1e-5;
01853 AulNet[10][3] = 7.0e-1;
01854 AulNet[13][3] = 4.7e-2;
01855
01856 AulNet[9][4] = 9.3e-2;
01857
01858 AulNet[9][5] = 4.7e-2;
01859 AulNet[12][5] = 2.5e-6;
01860 AulNet[13][5] = 1.7e-5;
01861
01862 AulNet[7][6] = 2.7e-4;
01863
01864 AulNet[8][7] = 1.2e-4;
01865 AulNet[11][7] = 6.6e-4;
01866
01867 AulNet[11][8] = 1.6e-3;
01868 AulNet[12][8] = 7.8e-4;
01869
01870 AulNet[10][9] = 8.4e-3;
01871 AulNet[13][9] = 2.8e-7;
01872
01873 AulNet[12][11] = 3.0e-4;
01874
01875 AulNet[13][12] = 1.4e-4;
01876
01877
01879
01880 col_str[1][0] = 2.92;
01881 col_str[2][0] = 1.24;
01882 col_str[3][0] = 0.595;
01883 col_str[4][0] = 0.180;
01884 col_str[5][0] = 0.580;
01885 col_str[6][0] = 1.34;
01886 col_str[7][0] = 0.489;
01887 col_str[8][0] = 0.0926;
01888 col_str[9][0] = 0.165;
01889 col_str[10][0] = 0.0213;
01890 col_str[11][0] = 1.07;
01891 col_str[12][0] = 0.435;
01892 col_str[13][0] = 0.157;
01893
01894 col_str[2][1] = 2.06;
01895 col_str[3][1] = 0.799;
01896 col_str[4][1] = 0.225;
01897 col_str[5][1] = 0.335;
01898 col_str[6][1] = 0.555;
01899 col_str[7][1] = 0.609;
01900 col_str[8][1] = 0.367;
01901 col_str[9][1] = 0.195;
01902 col_str[10][1] = 0.0698;
01903 col_str[11][1] = 0.538;
01904 col_str[12][1] = 0.484;
01905 col_str[13][1] = 0.285;
01906
01907 col_str[3][2] = 1.29;
01908 col_str[4][2] = 0.312;
01909 col_str[5][2] = 0.173;
01910 col_str[6][2] = 0.178;
01911 col_str[7][2] = 0.430;
01912 col_str[8][2] = 0.486;
01913 col_str[9][2] = 0.179;
01914 col_str[10][2] = 0.0741;
01915 col_str[11][2] = 0.249;
01916 col_str[12][2] = 0.362;
01917 col_str[13][2] = 0.324;
01918
01919 col_str[4][3] = 0.493;
01920 col_str[5][3] = 0.0767;
01921 col_str[6][3] = 0.0348;
01922 col_str[7][3] = 0.223;
01923 col_str[8][3] = 0.401;
01924 col_str[9][3] = 0.126;
01925 col_str[10][3] = 0.0528;
01926 col_str[11][3] = 0.101;
01927 col_str[12][3] = 0.207;
01928 col_str[13][3] = 0.253;
01929
01930 col_str[5][4] = 0.0211;
01931 col_str[6][4] = 0.00122;
01932 col_str[7][4] = 0.0653;
01933 col_str[8][4] = 0.154;
01934 col_str[9][4] = 0.0453;
01935 col_str[10][4] = 0.0189;
01936 col_str[11][4] = 0.0265;
01937 col_str[12][4] = 0.0654;
01938 col_str[13][4] = 0.0950;
01939
01940 col_str[6][5] = 0.403;
01941 col_str[7][5] = 0.213;
01942 col_str[8][5] = 0.0939;
01943 col_str[9][5] = 1.10;
01944 col_str[10][5] = 0.282;
01945 col_str[11][5] = 0.942;
01946 col_str[12][5] = 0.768;
01947 col_str[13][5] = 0.579;
01948
01949 col_str[7][6] = 2.84;
01950 col_str[8][6] = 0.379;
01951 col_str[9][6] = 0.0876;
01952 col_str[10][6] = 0.00807;
01953 col_str[11][6] = 1.85;
01954 col_str[12][6] = 0.667;
01955 col_str[13][6] = 0.0905;
01956
01957 col_str[8][7] = 3.07;
01958 col_str[9][7] = 0.167;
01959 col_str[10][7] = 0.0526;
01960 col_str[11][7] = 0.814;
01961 col_str[12][7] = 0.837;
01962 col_str[13][7] = 0.626;
01963
01964 col_str[9][8] = 0.181;
01965 col_str[10][8] = 0.0854;
01966 col_str[11][8] = 0.180;
01967 col_str[12][8] = 0.778;
01968 col_str[13][8] = 0.941;
01969
01970 col_str[10][9] = 0.377;
01971 col_str[11][9] = 0.603;
01972 col_str[12][9] = 0.472;
01973 col_str[13][9] = 0.302;
01974
01975 col_str[11][10] = 0.216;
01976 col_str[12][10] = 0.137;
01977 col_str[13][10] = 0.106;
01978
01979 col_str[12][11] = 1.25;
01980 col_str[13][11] = 0.292;
01981
01982 col_str[13][12] = 1.10;
01983 }
01984
01985
01986 if( dense.xIonDense[ipIRON][2] <= 0. )
01987 {
01988 CoolAdd("Fe 3",0,0.);
01989
01990 fe.Fe3CoolTot = 0.;
01991 for( ihi=1; ihi < NLFE3; ++ihi )
01992 {
01993 for( ilo=0; ilo < ihi; ++ilo )
01994 {
01995 fe.Fe3_emiss[ihi][ilo] = 0.;
01996 }
01997 }
01998
01999
02000 ASSERT( NLFE3 <= LIMLEVELN);
02001 for( i=0; i < NLFE3; i++ )
02002 {
02003 atoms.PopLevels[i] = 0.;
02004 atoms.DepLTELevels[i] = 1.;
02005 }
02006 return;
02007 }
02008
02009
02010 atom_levelN(
02011
02012 NLFE3,
02013
02014 dense.xIonDense[ipIRON][2],
02015
02016 gfe3,
02017
02018 excit_wn,
02019 'w',
02020
02021 pops,
02022
02023 depart,
02024
02025 &AulNet ,
02026
02027 &col_str ,
02028
02029 &AulDest,
02030
02031 &AulPump,
02032
02033 &CollRate,
02034
02035 create,
02036
02037 destroy,
02038
02039 false,
02040 &fe.Fe3CoolTot,
02041 &dfe3dt,
02042 "Fe 3",
02043 &nNegPop,
02044 &lgZeroPop,
02045 false );
02046
02047
02048 ASSERT( NLFE3 <= LIMLEVELN );
02049 for( i=0; i < NLFE3; ++i )
02050 {
02051 atoms.PopLevels[i] = pops[i];
02052 atoms.DepLTELevels[i] = depart[i];
02053 }
02054
02055 if( nNegPop > 0 )
02056 {
02057 fprintf( ioQQQ, " Fe3Lev14 found negative populations\n" );
02058 ShowMe();
02059 cdEXIT(EXIT_FAILURE);
02060 }
02061
02062
02063 CoolAdd("Fe 3",0,fe.Fe3CoolTot);
02064
02065 thermal.dCooldT += dfe3dt;
02066
02067
02068 for( ihi=1; ihi < NLFE3; ++ihi )
02069 {
02070 for( ilo=0; ilo < ihi; ++ilo )
02071 {
02072
02073 fe.Fe3_emiss[ihi][ilo] = pops[ihi]*AulNet[ihi][ilo]*(excit_wn[ihi] - excit_wn[ilo])*T1CM*BOLTZMANN;
02074 }
02075 }
02076 return;
02077 }
02078
02079
02080 STATIC void Fe11Lev5(void)
02081 {
02082 bool lgZeroPop;
02083 int nNegPop;
02084 long int i,
02085 j;
02086 static bool lgFirst=true;
02087
02088 double dCool_dT;
02089
02090 long int ihi , ilo;
02091 static double
02092 *depart,
02093 *pops,
02094 *destroy,
02095 *create ,
02096 **AulDest,
02097 **CollRate,
02098 **AulPump,
02099 **AulNet,
02100 **col_str ,
02101 TeUsed=-1.;
02102
02103
02104 static double stat_wght[NLFE11]={5.,3.,1.,5.,1.};
02105
02106
02107
02108
02109
02110 static double excit_wn[NLFE11]={
02111 0.0 , 12667.9 , 14312. , 37743.6 , 80814.7 };
02112
02113 DEBUG_ENTRY( "Fe11Lev5()" );
02114
02115 if( lgFirst )
02116 {
02117
02118 lgFirst = false;
02119
02120
02121 depart = ((double *)MALLOC((NLFE11)*sizeof(double)));
02122 pops = ((double *)MALLOC((NLFE11)*sizeof(double)));
02123 destroy = ((double *)MALLOC((NLFE11)*sizeof(double)));
02124 create = ((double *)MALLOC((NLFE11)*sizeof(double)));
02125
02126 fe.Fe11_wl = ((double **)MALLOC((NLFE11)*sizeof(double *)));
02127 fe.Fe11_emiss = ((double **)MALLOC((NLFE11)*sizeof(double *)));
02128 AulNet = ((double **)MALLOC((NLFE11)*sizeof(double *)));
02129 col_str = ((double **)MALLOC((NLFE11)*sizeof(double *)));
02130 AulPump = ((double **)MALLOC((NLFE11)*sizeof(double *)));
02131 CollRate = ((double **)MALLOC((NLFE11)*sizeof(double *)));
02132 AulDest = ((double **)MALLOC((NLFE11)*sizeof(double *)));
02133 for( i=0; i < NLFE11; ++i )
02134 {
02135 fe.Fe11_wl[i] = ((double *)MALLOC((NLFE11)*sizeof(double )));
02136 fe.Fe11_emiss[i] = ((double *)MALLOC((NLFE11)*sizeof(double )));
02137 AulNet[i] = ((double *)MALLOC((NLFE11)*sizeof(double )));
02138 col_str[i] = ((double *)MALLOC((NLFE11)*sizeof(double )));
02139 AulPump[i] = ((double *)MALLOC((NLFE11)*sizeof(double )));
02140 CollRate[i] = ((double *)MALLOC((NLFE11)*sizeof(double )));
02141 AulDest[i] = ((double *)MALLOC((NLFE11)*sizeof(double )));
02142 }
02143
02144
02145 for( i=0; i < NLFE11; ++i )
02146 {
02147 create[i] = 0.;
02148 destroy[i] = 0.;
02149 for( j=0; j < NLFE11; ++j )
02150 {
02151 AulNet[i][j] = 0.;
02152 col_str[i][j] = 0.;
02153 CollRate[i][j] = 0.;
02154 AulDest[i][j] = 0.;
02155 AulPump[i][j] = 0.;
02156 fe.Fe11_wl[i][j] = 0.;
02157 fe.Fe11_emiss[i][j] = 0.;
02158 }
02159 }
02160
02161
02162 for( ihi=1; ihi < NLFE11; ++ihi )
02163 {
02164 for( ilo=0; ilo < ihi; ++ilo )
02165 {
02166 fe.Fe11_wl[ihi][ilo] = 1e8/(excit_wn[ihi]-excit_wn[ilo]) /
02167 RefIndex( (excit_wn[ihi]-excit_wn[ilo]) );
02168 }
02169 }
02170
02171
02172 AulNet[4][0] = 1.7;
02173 AulNet[4][1] = 990.;
02174 AulNet[4][3] = 8.3;
02175 AulNet[3][0] = 92.3;
02176 AulNet[3][1] = 9.44;
02177 AulNet[3][2] = 1.4e-3;
02178 AulNet[2][0] = 9.9e-3;
02179 AulNet[1][0] = 43.7;
02180 AulNet[2][1] = 0.226;
02181
02182 }
02183
02184
02185 if( dense.xIonDense[ipIRON][10] <= 0. )
02186 {
02187 CoolAdd("Fe11",0,0.);
02188
02189 fe.Fe11CoolTot = 0.;
02190 for( ihi=1; ihi < NLFE11; ++ihi )
02191 {
02192 for( ilo=0; ilo < ihi; ++ilo )
02193 {
02194 fe.Fe11_emiss[ihi][ilo] = 0.;
02195 }
02196 }
02197
02198
02199 ASSERT( NLFE11 <= LIMLEVELN);
02200 for( i=0; i < NLFE11; i++ )
02201 {
02202 atoms.PopLevels[i] = 0.;
02203 atoms.DepLTELevels[i] = 1.;
02204 }
02205 return;
02206 }
02207
02208
02209 if( !fp_equal(phycon.te,TeUsed) )
02210 {
02211 TeUsed = phycon.te;
02212
02213
02214 for( ihi=1; ihi < NLFE11; ++ihi )
02215 {
02216 for( ilo=0; ilo < ihi; ++ilo )
02217 {
02218 col_str[ihi][ilo] = Fe_10_11_13_cs( 11 , ilo+1 , ihi+1 );
02219 ASSERT( col_str[ihi][ilo] > 0. );
02220 }
02221 }
02222 }
02223
02224
02225 atom_levelN(
02226
02227 NLFE11,
02228
02229 dense.xIonDense[ipIRON][10],
02230
02231 stat_wght,
02232
02233 excit_wn,
02234 'w',
02235
02236 pops,
02237
02238 depart,
02239
02240 &AulNet ,
02241
02242 &col_str ,
02243
02244 &AulDest,
02245
02246 &AulPump,
02247
02248 &CollRate,
02249
02250 create,
02251
02252 destroy,
02253
02254 false,
02255 &fe.Fe11CoolTot,
02256 &dCool_dT,
02257 "Fe11",
02258 &nNegPop,
02259 &lgZeroPop,
02260 false );
02261
02262
02263 ASSERT( NLFE11 <= LIMLEVELN );
02264 for( i=0; i < NLFE11; ++i )
02265 {
02266 atoms.PopLevels[i] = pops[i];
02267 atoms.DepLTELevels[i] = depart[i];
02268 }
02269
02270 if( nNegPop > 0 )
02271 {
02272 fprintf( ioQQQ, " Fe11Lev5 found negative populations\n" );
02273 ShowMe();
02274 cdEXIT(EXIT_FAILURE);
02275 }
02276
02277
02278 CoolAdd("Fe11",0,fe.Fe11CoolTot);
02279
02280 thermal.dCooldT += dCool_dT;
02281
02282
02283 for( ihi=1; ihi < NLFE11; ++ihi )
02284 {
02285 for( ilo=0; ilo < ihi; ++ilo )
02286 {
02287
02288 fe.Fe11_emiss[ihi][ilo] = pops[ihi]*AulNet[ihi][ilo]*
02289 (excit_wn[ihi] - excit_wn[ilo])*T1CM*BOLTZMANN;
02290 }
02291 }
02292 return;
02293 }
02294
02295
02296 STATIC void Fe13Lev5(void)
02297 {
02298 bool lgZeroPop;
02299 int nNegPop;
02300 long int i,
02301 j;
02302 static bool lgFirst=true;
02303
02304 double dCool_dT;
02305
02306 long int ihi , ilo;
02307 static double
02308 *depart,
02309 *pops,
02310 *destroy,
02311 *create ,
02312 **AulDest,
02313 **CollRate,
02314 **AulPump,
02315 **AulNet,
02316 **col_str ,
02317 TeUsed=-1.;
02318
02319
02320 static double stat_wght[NLFE13]={1.,3.,5.,5.,1.};
02321
02322
02323
02324 static double excit_wn[NLFE13]={
02325 0.0 , 9302.5 , 18561.0 , 48068. , 91508. };
02326
02327 DEBUG_ENTRY( "Fe13Lev5()" );
02328
02329 if( lgFirst )
02330 {
02331
02332 lgFirst = false;
02333
02334
02335 depart = ((double *)MALLOC((NLFE13)*sizeof(double)));
02336 pops = ((double *)MALLOC((NLFE13)*sizeof(double)));
02337 destroy = ((double *)MALLOC((NLFE13)*sizeof(double)));
02338 create = ((double *)MALLOC((NLFE13)*sizeof(double)));
02339
02340 fe.Fe13_wl = ((double **)MALLOC((NLFE13)*sizeof(double *)));
02341 fe.Fe13_emiss = ((double **)MALLOC((NLFE13)*sizeof(double *)));
02342 AulNet = ((double **)MALLOC((NLFE13)*sizeof(double *)));
02343 col_str = ((double **)MALLOC((NLFE13)*sizeof(double *)));
02344 AulPump = ((double **)MALLOC((NLFE13)*sizeof(double *)));
02345 CollRate = ((double **)MALLOC((NLFE13)*sizeof(double *)));
02346 AulDest = ((double **)MALLOC((NLFE13)*sizeof(double *)));
02347 for( i=0; i < NLFE13; ++i )
02348 {
02349 fe.Fe13_wl[i] = ((double *)MALLOC((NLFE13)*sizeof(double )));
02350 fe.Fe13_emiss[i] = ((double *)MALLOC((NLFE13)*sizeof(double )));
02351 AulNet[i] = ((double *)MALLOC((NLFE13)*sizeof(double )));
02352 col_str[i] = ((double *)MALLOC((NLFE13)*sizeof(double )));
02353 AulPump[i] = ((double *)MALLOC((NLFE13)*sizeof(double )));
02354 CollRate[i] = ((double *)MALLOC((NLFE13)*sizeof(double )));
02355 AulDest[i] = ((double *)MALLOC((NLFE13)*sizeof(double )));
02356 }
02357
02358
02359 for( i=0; i < NLFE13; ++i )
02360 {
02361 create[i] = 0.;
02362 destroy[i] = 0.;
02363 for( j=0; j < NLFE13; ++j )
02364 {
02365 AulNet[i][j] = 0.;
02366 col_str[i][j] = 0.;
02367 CollRate[i][j] = 0.;
02368 AulDest[i][j] = 0.;
02369 AulPump[i][j] = 0.;
02370 fe.Fe13_wl[i][j] = 0.;
02371 fe.Fe13_emiss[i][j] = 0.;
02372 }
02373 }
02374
02375
02376 for( ihi=1; ihi < NLFE13; ++ihi )
02377 {
02378 for( ilo=0; ilo < ihi; ++ilo )
02379 {
02380 fe.Fe13_wl[ihi][ilo] = 1e8/(excit_wn[ihi]-excit_wn[ilo]) /
02381 RefIndex( (excit_wn[ihi]-excit_wn[ilo]) );
02382 }
02383 }
02384
02385
02386 AulNet[4][1] = 1010.;
02387 AulNet[4][2] = 3.8;
02388 AulNet[4][3] = 8.1;
02389 AulNet[3][1] = 45.7;
02390 AulNet[3][2] = 57.6;
02391 AulNet[2][0] = 0.0063;
02392 AulNet[1][0] = 14.0;
02393 AulNet[2][1] = 9.87;
02394
02395 }
02396
02397
02398 if( dense.xIonDense[ipIRON][12] <= 0. )
02399 {
02400 CoolAdd("Fe13",0,0.);
02401
02402 fe.Fe13CoolTot = 0.;
02403 for( ihi=1; ihi < NLFE13; ++ihi )
02404 {
02405 for( ilo=0; ilo < ihi; ++ilo )
02406 {
02407 fe.Fe13_emiss[ihi][ilo] = 0.;
02408 }
02409 }
02410
02411
02412 ASSERT( NLFE13 <= LIMLEVELN);
02413 for( i=0; i < NLFE13; i++ )
02414 {
02415 atoms.PopLevels[i] = 0.;
02416 atoms.DepLTELevels[i] = 1.;
02417 }
02418 return;
02419 }
02420
02421
02422 if( !fp_equal(phycon.te,TeUsed) )
02423 {
02424 TeUsed = phycon.te;
02425
02426
02427 for( ihi=1; ihi < NLFE13; ++ihi )
02428 {
02429 for( ilo=0; ilo < ihi; ++ilo )
02430 {
02431 col_str[ihi][ilo] = Fe_10_11_13_cs( 13 , ilo+1 , ihi+1 );
02432 ASSERT( col_str[ihi][ilo] > 0. );
02433 }
02434 }
02435 }
02436
02437
02438
02439
02440
02441
02442 atom_levelN(
02443
02444 NLFE13,
02445
02446 dense.xIonDense[ipIRON][12],
02447
02448 stat_wght,
02449
02450 excit_wn,
02451 'w',
02452
02453 pops,
02454
02455 depart,
02456
02457 &AulNet ,
02458
02459 &col_str ,
02460
02461 &AulDest,
02462
02463 &AulPump,
02464
02465 &CollRate,
02466
02467 create,
02468
02469 destroy,
02470
02471 false,
02472 &fe.Fe13CoolTot,
02473 &dCool_dT,
02474 "Fe13",
02475 &nNegPop,
02476 &lgZeroPop,
02477 false );
02478
02479
02480 ASSERT( NLFE13 <= LIMLEVELN );
02481 for( i=0; i < NLFE13; ++i )
02482 {
02483 atoms.PopLevels[i] = pops[i];
02484 atoms.DepLTELevels[i] = depart[i];
02485 }
02486
02487 if( nNegPop > 0 )
02488 {
02489 fprintf( ioQQQ, " Fe13Lev5 found negative populations\n" );
02490 ShowMe();
02491 cdEXIT(EXIT_FAILURE);
02492 }
02493
02494
02495 CoolAdd("Fe13",0,fe.Fe13CoolTot);
02496
02497 thermal.dCooldT += dCool_dT;
02498
02499
02500 for( ihi=1; ihi < NLFE13; ++ihi )
02501 {
02502 for( ilo=0; ilo < ihi; ++ilo )
02503 {
02504
02505 fe.Fe13_emiss[ihi][ilo] = pops[ihi]*AulNet[ihi][ilo]*(excit_wn[ihi] - excit_wn[ilo])*T1CM*BOLTZMANN;
02506 }
02507 }
02508 return;
02509 }