00001
00002
00003
00004
00005
00006
00007
00008 #include "cddefines.h"
00009 #include "coolheavy.h"
00010 #include "taulines.h"
00011 #include "dense.h"
00012 #include "phycon.h"
00013 #include "embesq.h"
00014 #include "ligbar.h"
00015 #include "thermal.h"
00016 #include "lines_service.h"
00017 #include "atoms.h"
00018 #include "cooling.h"
00019
00020
00021
00022
00023
00024 STATIC void S2cs(double telog,
00025 double *cs12,
00026 double *cs13,
00027 double *cs14,
00028 double *cs15,
00029 double *cs23,
00030 double *cs24,
00031 double *cs25,
00032 double *cs34,
00033 double *cs35,
00034 double *cs45);
00035
00036 void CoolSulf(void)
00037 {
00038 double cs,
00039 cs2s2p,
00040 cs2s3p,
00041 cs01,
00042 cs02,
00043 cs12,
00044 cs13,
00045 cs14,
00046 cs15,
00047 cs23,
00048 cs24,
00049 cs25,
00050 cs34,
00051 cs35,
00052 cs45,
00053 p[5],
00054 tused,
00055 pump_rate;
00056 realnum
00057 pop2,
00058 rate;
00059 static double gS2[5]={4.,4.,6.,2.,4.};
00060 static double exS2[4]={14851.9,31.5,9640.8,48.6};
00061
00062 static bool lgFirst=true;
00063 long int i;
00064 static long int *ipS4Pump=NULL,
00065 nS4Pump=0;
00066
00067 DEBUG_ENTRY( "CoolSulf()" );
00068
00069
00070
00071
00072 tused = MAX2( 30. , phycon.te );
00073 tused = MIN2( 3000. , phycon.te );
00074 tused /= 100.;
00075
00076
00077 rate = (realnum)(3.3e-8 * dense.eden +
00078
00079
00080 7.5e-10*pow(tused, 0.17 )*dense.xIonDense[ipHYDROGEN][0] );
00081 LineConvRate2CS( &TauLines[ipS1_25m] , rate );
00082
00083
00084 rate = (realnum)(1.2e-8 * dense.eden +
00085
00086
00087 4.2e-10*pow(tused, 0.17 )*dense.xIonDense[ipHYDROGEN][0] );
00088 LineConvRate2CS( &TauLines[ipS1_56m] , rate );
00089
00090 rate = (realnum)(3.3e-8 * dense.eden +
00091
00092
00093 7.1e-10*pow(tused, 0.17 )*dense.xIonDense[ipHYDROGEN][0] );
00094 TauDummy.Hi->g = TauLines[ipS1_56m].Hi->g;
00095 LineConvRate2CS( &TauDummy , rate );
00096
00097 TauDummy.Hi->g = 0.;
00098
00099 atom_level3(&TauLines[ipS1_25m],&TauLines[ipS1_56m],&TauDummy);
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109 S2cs(phycon.alogte,&cs12,&cs13,&cs14,&cs15,&cs23,&cs24,&cs25,&cs34,
00110 &cs35,&cs45);
00111
00112
00113
00114
00115
00116
00117 atom_pop5(gS2,exS2,cs12,cs13,cs14,cs15,cs23,cs24,cs25,cs34,cs35,cs45,
00118 8.82e-4,2.60e-4,9.06e-2,0.225,3.35e-7,0.163,0.133,0.078,0.179,
00119 1.03e-6,p,dense.xIonDense[ipSULPHUR][1]);
00120 CoolHeavy.S6733 = (realnum)(p[1]*8.82e-4*2.96e-12);
00121 CoolHeavy.S6718 = (realnum)(p[2]*2.60e-4*2.962e-12);
00122 CoolHeavy.S4070 = (realnum)(p[4]*0.225*4.89e-12);
00123 CoolHeavy.S4078 = (realnum)(p[3]*0.0906*4.88e-12);
00124 CoolHeavy.S10323 = (realnum)(p[4]*0.179*1.93e-12);
00125 CoolHeavy.S10289 = (realnum)(p[4]*0.133*1.93e-12);
00126 CoolHeavy.S10373 = (realnum)(p[3]*0.078*1.92e-12);
00127 CoolHeavy.S10339 = (realnum)(p[3]*0.163*1.92e-12);
00128 CoolHeavy.c6731 = CoolHeavy.S6733 + CoolHeavy.S6718;
00129 CoolHeavy.c10330 = CoolHeavy.S10323 + CoolHeavy.S10289 + CoolHeavy.S10373 + CoolHeavy.S10339;
00130 thermal.dCooldT += CoolHeavy.c6731*(2.14e4*thermal.tsq1 - thermal.halfte);
00131 thermal.dCooldT += CoolHeavy.c10330*2.58*(3.53e4*thermal.tsq1 - thermal.halfte);
00132 CoolAdd("S 2",6731,CoolHeavy.c6731);
00133 CoolAdd("S 2",10330,CoolHeavy.c10330);
00134 CoolAdd("S 2",4070,CoolHeavy.c10330*1.58);
00135
00136
00137 cs = MIN2(8.46,-4.9416304+47.01064/phycon.alogte);
00138 cs = MAX2(4.466,cs);
00139 PutCS(cs,&TauLines[ipT1256]);
00140 atom_level2(&TauLines[ipT1256]);
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150 if( phycon.te < 5000. )
00151 {
00152 cs12 = 4.44;
00153 cs13 = 1.41;
00154 cs14 = 0.802;
00155 cs15 = 0.129;
00156 cs23 = 8.72;
00157 cs24 = 2.41;
00158 cs25 = 0.388;
00159 cs34 = 4.01;
00160 cs35 = 0.646;
00161 cs45 = 1.31;
00162 }
00163 else if( phycon.te > 1e5 )
00164 {
00165 cs12 = 1.9;
00166 cs13 = 1.24;
00167 cs14 = 0.664;
00168 cs15 = 0.136;
00169 cs23 = 5.13;
00170 cs24 = 1.99;
00171 cs25 = 0.407;
00172 cs34 = 3.32;
00173 cs35 = 0.679;
00174 cs45 = 1.84;
00175 }
00176 else
00177 {
00178 cs12 = 52.47/(phycon.te30/phycon.te02);
00179 cs13 = 1.894/(phycon.te02*phycon.te02);
00180 cs14 = 1.34/(phycon.te05*phycon.te01);
00181 cs15 = 0.109*phycon.te02;
00182 cs23 = 41.3/(phycon.te20/phycon.te02);
00183 cs24 = 4.03/(phycon.te05*phycon.te01);
00184 cs25 = 0.327*phycon.te02;
00185 cs34 = 6.708/(phycon.te05*phycon.te01);
00186 cs35 = 0.545*phycon.te02;
00187 cs45 = 0.501*phycon.te10*phycon.te01;
00188 }
00189
00190 PutCS(cs12,&TauLines[ipTS34]);
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202 PutCS(cs23,&TauLines[ipTS19]);
00203
00204
00205 PutCS(cs13,&TauDummy);
00206 atom_level3(&TauLines[ipTS34],&TauLines[ipTS19],&TauDummy);
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217 CoolHeavy.c6312 = atom_pop3(9.,5.,1.,cs14+cs24+cs34,cs15+cs25+cs35,cs45,7.97e-2,0.807,2.22,
00218 1.55e4,2.28e4,&pop2,dense.xIonDense[ipSULPHUR][2],0.,0.,0.)*2.22*3.15e-12;
00219
00220 CoolHeavy.c9532 = pop2*7.93e-2*2.11e-12;
00221 CoolAdd("S 3",6312,CoolHeavy.c6312);
00222 CoolAdd("S 3",9532,CoolHeavy.c9532);
00223 CoolAdd("S 3",3722,CoolHeavy.c6312*0.59);
00224
00225
00226
00227
00228
00229 if( phycon.te <= 3e4 )
00230 {
00231 cs = 12.04/(phycon.te02*phycon.te02);
00232 }
00233 else if( phycon.te > 3e4 && phycon.te <= 4e4 )
00234 {
00235 cs = 7.97;
00236 }
00237 else
00238 {
00239 cs = 55.42/(phycon.te20/phycon.te02*phycon.te003);
00240 }
00241 PutCS(cs,&TauLines[ipT1194]);
00242 atom_level2(&TauLines[ipT1194]);
00243
00244
00245
00246
00247
00248
00249 if( phycon.te <= 3e4 )
00250 {
00251 cs = 1.786*phycon.te05*phycon.te01*phycon.te001;
00252 }
00253 else
00254 {
00255 cs = 9.392/phycon.te10;
00256 }
00257 PutCS(cs,&TauLines[ipTS1720]);
00258 atom_level2(&TauLines[ipTS1720]);
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277 if( phycon.te < 1e4 )
00278 {
00279 cs = 3.71*phycon.te10/phycon.te01;
00280 }
00281 else
00282 {
00283 cs = MIN2(8.5,19.472/(phycon.te10/phycon.te01));
00284 }
00285 PutCS(cs,&TauLines[ipTS11]);
00286
00287
00288
00289 if( lgFirst && nWindLine )
00290 {
00291 lgFirst = false;
00292 nS4Pump = 0;
00293 for( i=0; i<nWindLine; ++i )
00294 {
00295
00296 if( TauLine2[i].Hi->nelem ==16 && TauLine2[i].Hi->IonStg==4 )
00297 {
00298 ++nS4Pump;
00299 }
00300 }
00301 if( nS4Pump<0 )
00302 TotalInsanity();
00303 else if( nS4Pump > 0 )
00304
00305 ipS4Pump = (long *)MALLOC((unsigned)(nS4Pump)*sizeof(long) );
00306 nS4Pump = 0;
00307 for( i=0; i<nWindLine; ++i )
00308 {
00309
00310 if( TauLine2[i].Hi->nelem ==16 && TauLine2[i].Hi->IonStg==4 )
00311 {
00312 # if 0
00313 DumpLine( &TauLine2[i] );
00314 # endif
00315 ipS4Pump[nS4Pump] = i;
00316 ++nS4Pump;
00317 }
00318 }
00319 }
00320 else
00321
00322 nS4Pump = 0;
00323
00324
00325 pump_rate = 0.;
00326 for( i=0; i<nS4Pump; ++i )
00327 {
00328 pump_rate += TauLine2[ipS4Pump[i]].Emis->pump;
00329 # if 0
00330 fprintf(ioQQQ,"DEBUG C %li %.3e %.3e\n",
00331 i,
00332 TauLine2[ipS4Pump[i]].WLAng , TauLine2[ipS4Pump[i]].pump );
00333 # endif
00334 }
00335
00336
00337
00338
00339 AtomSeqBoron(&TauLines[ipTS11],
00340 &TauLines[ipS4_1405],
00341 &TauLines[ipS4_1398],
00342 &TauLines[ipS4_1424],
00343 &TauLines[ipS4_1417],
00344 &TauLines[ipS4_1407],
00345 1.168 , 3.366 , 2.924 , 7.233 ,
00346 pump_rate , "S 4");
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357 cs = MIN2(1.58,35.372/(phycon.te10*phycon.te10*phycon.te10));
00358 PutCS(cs,&TauLines[ipT1198]);
00359
00360 cs01 = MIN2(1.98,29.625/(phycon.te20*phycon.te05));
00361
00362 cs02 = MIN2(2.26,13.477/(phycon.te10*phycon.te03*phycon.te03*
00363 phycon.te005));
00364
00365 cs12 = MIN2(7.59,63.994/(phycon.te20/phycon.te003));
00366
00367
00368 AtomSeqBeryllium(cs01,cs02,cs12,&TauLines[ipT1198],.066);
00369 embesq.em1198 = (realnum)(atoms.PopLevels[3]*0.066*1.66e-11);
00370
00371
00372
00373
00377 PutCS(8.3,&TauLines[ipT786]);
00378 atom_level2(&TauLines[ipT786]);
00379
00380
00381
00382
00383
00384
00385 cs = 11.9;
00386 PutCS(cs*0.667,&TauLines[ipT933]);
00387 PutCS(cs*0.333,&TauLines[ipT944]);
00388 PutCS(1.0,&TauDummy);
00389
00390 atom_level3(&TauLines[ipT944],&TauDummy,&TauLines[ipT933]);
00391
00392
00393
00394
00395
00396
00397
00398 if(phycon.te < 6.4E5)
00399 {
00400 cs = (realnum)(0.0943*(phycon.te10/(phycon.te01*phycon.te001))*phycon.te0004);
00401 }
00402 else
00403 {
00404 cs = (realnum) (8.1555/(phycon.te20*phycon.te04*phycon.te004*phycon.te0002));
00405 }
00406
00407 PutCS(cs,&TauLines[ipfsS810]);
00408
00409 atom_level2(&TauLines[ipfsS810]);
00410
00411
00412
00413 CoolHeavy.c1715 = atom_pop2(0.4,9.,5.,80.,8.39e4,dense.xIonDense[ipSULPHUR][8])*
00414 1.16e-11;
00415 CoolAdd("S 9",1715,CoolHeavy.c1715);
00416
00417
00418
00419
00420 cs = MIN2(3.10,277.2/(phycon.sqrte/phycon.te003));
00421 PutCS(cs,&TauLines[ipfsS912]);
00422
00423 cs = MIN2(.50,7.940/(phycon.te10*phycon.te10*phycon.te10));
00424 PutCS(cs,&TauLines[ipfsS938]);
00425
00426 cs = MIN2(1.1,195.72/(phycon.sqrte*phycon.te03*phycon.te03*
00427 phycon.te01*phycon.te003*phycon.te001));
00428 PutCS(cs,&TauDummy);
00429
00430 atom_level3(&TauLines[ipfsS912],&TauLines[ipfsS938],&TauDummy);
00431
00432
00433
00434 CoolHeavy.c1213 = atom_pop2(0.131,4.,6.,6.,1.19e5,dense.xIonDense[ipSULPHUR][10-1])*
00435 1.64e-11;
00436 CoolAdd("S 10",1213,CoolHeavy.c1213);
00437
00438
00439
00440 cs = MIN2(0.22,0.0151*phycon.te20*phycon.te03*phycon.te001*
00441 phycon.te001);
00442 PutCS(cs,&TauLines[ipfsS1119]);
00443 cs = MIN2(0.6,0.0168*phycon.te10*phycon.te10*phycon.te10*
00444 phycon.te01);
00445 PutCS(cs,&TauLines[ipfsS1114]);
00446 cs = MIN2(0.15,1.5e-3*phycon.te30*phycon.te10*phycon.te005);
00447 PutCS(cs,&TauDummy);
00448 atom_level3(&TauLines[ipfsS1119],&TauLines[ipfsS1114],&TauDummy);
00449
00450
00451
00452 CoolHeavy.c1826 = atom_pop2(0.3,9.,5.,100.,8.92e4,dense.xIonDense[ipSULPHUR][11-1])*
00453 1.23e-11;
00454 CoolAdd("S 11",1615,CoolHeavy.c1826);
00455
00456
00457
00458
00459
00460 PutCS(0.135,&TauLines[ipfsS1207]);
00461 atom_level2(&TauLines[ipfsS1207]);
00462
00463
00464
00465
00466
00467
00468
00469 PutCS(0.03,&TauLines[ipS12_520]);
00470 atom_level2(&TauLines[ipS12_520]);
00471
00472
00473 CoolHeavy.c488 = atom_pop2(0.11,1.,9.,3.3e5,2.948e5,dense.xIonDense[ipSULPHUR][13-1])*
00474 4.07e-11;
00475 CoolAdd("S 13",488,CoolHeavy.c488);
00476
00477
00478
00479 ligbar(16,&TauLines[ipTSu418],&TauLines[ipTSu30],&cs2s2p,&cs2s3p);
00480 PutCS(cs2s2p,&TauLines[ipTSu418]);
00481 PutCS(cs2s2p*0.5,&TauLines[ipTSu446]);
00482 PutCS(1.0,&TauDummy);
00483 atom_level3(&TauLines[ipTSu446],&TauDummy,&TauLines[ipTSu418]);
00484
00485 PutCS(cs2s3p,&TauLines[ipTSu30]);
00486 atom_level2(&TauLines[ipTSu30]);
00487 return;
00488 }
00489
00490
00491
00492
00493
00494 STATIC void S2cs(double telog,
00495 double *cs12,
00496 double *cs13,
00497 double *cs14,
00498 double *cs15,
00499 double *cs23,
00500 double *cs24,
00501 double *cs25,
00502 double *cs34,
00503 double *cs35,
00504 double *cs45)
00505 {
00506
00507 double a,
00508 b,
00509 c,
00510 telogn1;
00511
00512 DEBUG_ENTRY( "S2cs()" );
00513
00514
00515 telogn1 = MAX2(3.5,telog);
00516 telogn1 = MIN2(telogn1,5.0);
00517
00518
00519 a = 18.335524;
00520 b = -5.1180248;
00521 c = 0.44482438;
00522 *cs35 = MIN2(5.82,a+b*telogn1+c*telogn1*telogn1);
00523 *cs35 = MAX2(3.87,*cs35);
00524
00525
00526 a = 6.690242;
00527 b = -1.061514;
00528 c = 0.034535506;
00529 *cs25 = MIN2(3.38,a+b*telogn1+c*telogn1*telogn1);
00530 *cs25 = MAX2(2.24,*cs25);
00531
00532
00533 a = 4.2250081;
00534 b = -0.46549935;
00535 c = -0.010172139;
00536 *cs34 = MIN2(2.46,a+b*telogn1+c*telogn1*telogn1);
00537 *cs34 = MAX2(1.64,*cs34);
00538
00539
00540 a = 8.274085;
00541 b = -2.6223732;
00542 c = 0.2502924;
00543 *cs24 = MIN2(2.14,a+b*telogn1+c*telogn1*telogn1);
00544 *cs24 = MAX2(1.42,*cs24);
00545
00546
00547 a = -5.1994665;
00548 b = 49.334586;
00549 c = -70.93344;
00550 *cs45 = MIN2(3.07,a+b/telogn1+c/(telogn1*telogn1));
00551 *cs45 = MAX2(1.85,*cs45);
00552
00553
00554 a = -27.497273;
00555 b = 247.27405;
00556 c = -429.9142;
00557 *cs23 = MIN2(8.01,a+b/telogn1+c/(telogn1*telogn1));
00558 *cs23 = MAX2(4.79,*cs23);
00559
00560
00561 a = 2.6106784;
00562 b = -3.2766908e-05;
00563 c = 6.5105436;
00564 *cs15 = a+b*pow(telogn1,c);
00565 *cs15 = MIN2(2.46,*cs15);
00566 *cs15 = MAX2(1.45,*cs15);
00567
00568
00569 *cs14 = 0.5**cs15;
00570
00571
00572 a = 8.1458628;
00573 b = -0.5389108;
00574 c = 1.4486586;
00575 *cs13 = a+b*pow(telogn1,c);
00576 *cs13 = MIN2(4.77,*cs13);
00577 *cs13 = MAX2(2.54,*cs13);
00578
00579
00580 *cs12 = *cs13/1.5;
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596 return;
00597 }