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