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