00001
00002
00003
00004 #include "cddefines.h"
00005 #include "physconst.h"
00006 #include "embesq.h"
00007 #include "phycon.h"
00008 #include "taulines.h"
00009 #include "dense.h"
00010 #include "hmi.h"
00011 #include "h2.h"
00012 #include "mole.h"
00013 #include "ligbar.h"
00014 #include "thermal.h"
00015 #include "colden.h"
00016 #include "lines_service.h"
00017 #include "atoms.h"
00018 #include "carb.h"
00019 #include "cooling.h"
00020
00021 void CoolCarb(void)
00022 {
00023 double SaveAbun,
00024 a21,
00025 a31,
00026 a32,
00027 cs,
00028 cs01,
00029 cs02,
00030 cs12,
00031 cs13,
00032 cs23,
00033 cs2s2p,
00034 cs2s3p ,
00035 ortho_frac ,
00036 popup,
00037 popratio,
00038 pump_rate;
00039
00040
00041
00042 double cse01,
00043 cse12,
00044 cse02,
00045 csh01,
00046 csh12,
00047 csh02,
00048 csp01,
00049 csp12,
00050 csp02,
00051 csh201,
00052 csh212,
00053 csh202 ,
00054 csh2p01,
00055 csh2p12,
00056 csh2p02,
00057 csh2o01,
00058 csh2o12,
00059 csh2o02,
00060 temp;
00061 double cs_c2_h12=-1.;
00062 float pciexc ,
00063 sum;
00064 int i;
00065 static bool lgFirst=true;
00066 static long int *ipC2Pump=NULL,
00067 nC2Pump=0;
00068
00069 DEBUG_ENTRY( "CoolCarb()" );
00070
00071
00072
00073
00074
00075
00076
00077
00078 PutCS(7.3, &TauLines[ipT1656] );
00079 atom_level2(&TauLines[ipT1656]);
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089 if( phycon.te<=3.0e3 )
00090 {
00091
00092
00093 cse01 = MAX2(4.80E-06*phycon.te*phycon.te20/phycon.te03,
00094 8.24E-07*phycon.te32/phycon.te01);
00095
00096 cse12 = MAX2(7.67E-05*phycon.te/phycon.te10/phycon.te03,
00097 1.47E-06*phycon.te32*phycon.te10/phycon.te03);
00098
00099 cse02 = MAX2(4.72E-05*phycon.te70*phycon.te03,
00100 3.05E-07*phycon.te32*phycon.te10);
00101 }
00102 else
00103 {
00104
00105
00106 cse01 = MIN2(8.24E-07*phycon.te32/phycon.te01,
00107 0.0035*phycon.sqrte*phycon.te01);
00108
00109 cse12 = MIN2(1.47E-06*phycon.te32*phycon.te10/phycon.te03,
00110 0.0088*phycon.sqrte*phycon.te01*phycon.te005);
00111
00112 cse02 = MIN2(3.05E-07*phycon.te32*phycon.te10,
00113 0.00448*phycon.sqrte/phycon.te10*phycon.te03*phycon.te005);
00114 }
00115
00116
00117
00118
00119
00120
00121
00122
00123 csh01 = MAX2(1.61e-10,5.66e-11*phycon.te20);
00124
00125
00126 csh12 = MAX2(1.93e-10*phycon.te05*phycon.te03,
00127 5.64e-11*phycon.te30*phycon.te02);
00128
00129
00130 csh02 = MAX2(1.08e-10/phycon.te03,
00131 1.67e-11*phycon.te30*phycon.te02*phycon.te02);
00132
00133
00134
00135
00136
00137 if( phycon.te < 25. )
00138 temp = 25.;
00139 else if( phycon.te >20000. )
00140 temp = 20000.;
00141 else
00142 temp = phycon.te;
00143 csp01 = 1e-9*pow((4.3671821 - 14.39018/log(temp)),2)*(1./3.)*exp(16.4*T1CM/temp);
00144 csp12 = 1e-9*exp(3.2823932 - 60.99754*(log(temp)/temp))*(1./5.)*exp(37.1*T1CM/temp);
00145 csp02 = 1e-9/(0.033932579+ (1503.4042/pow(temp,1.5)))*(3./5.)*exp(43.5*T1CM/temp);
00146
00147
00148
00149
00150
00151
00152
00153
00154 ortho_frac = h2.ortho_density/SDIV(hmi.H2_total);
00155
00156
00157
00158
00159
00160 if( phycon.te<=30. )
00161 {
00162 csh2p01 = MIN2(8.38E-11*phycon.te05*phycon.te01,
00163 2.12e-10/phycon.te20/phycon.te05/phycon.te01);
00164
00165 csh2o01 = MIN2(5.17E-11*phycon.te10*phycon.te05,
00166 1.07e-10/phycon.te10*phycon.te01);
00167 }
00168 else if( phycon.te<=150. )
00169 {
00170 csh2p01 = MAX2(6.60e-11,
00171 2.12e-10/phycon.te20/phycon.te05/phycon.te01);
00172
00173 csh2o01 = MAX2(7.10e-11,
00174 1.07e-10/phycon.te10*phycon.te01);
00175 }
00176 else
00177 {
00178
00179
00180 csh2p01 = MAX2(6.60e-11,3.38e-11*phycon.te10*phycon.te03);
00181 csh2p01 = MIN2(8.10e-11,csh2p01);
00182
00183 csh2o01 = MAX2(7.1e-11,3.37e-11*phycon.te10*phycon.te02*phycon.te02);
00184 csh2o01 = MIN2(8.57e-11,csh2o01);
00185 }
00186
00187
00188 csh201 = ortho_frac*csh2o01 + (1.-ortho_frac)*csh2p01;
00189 if( phycon.te<=30. )
00190 {
00191 csh2p12 = MIN2(1.48E-10*phycon.te05*phycon.te02,
00192 2.25e-10/phycon.te03/phycon.te03);
00193 }
00194 else if( phycon.te <= 100. )
00195 {
00196 csh2p12 = MAX2(1.75e-10,
00197 2.25e-10/phycon.te03/phycon.te03);
00198 }
00199 else
00200 {
00201 csh2p12 = MAX2(1.75e-10,6.23e-11*phycon.te20*phycon.te01);
00202 csh2p12 = MIN2(2.61e-10,csh2p12);
00203 }
00204
00205 csh2o12 = MIN2(2.83e-10,4.46e-11*phycon.te30/phycon.te03);
00206 {
00207
00208 csh212 = ortho_frac*csh2o12 + (1.-ortho_frac)*csh2p12;
00209 }
00210
00211 if( phycon.te<=30 )
00212 {
00213 csh2p02 = MIN2(8.67E-11*phycon.te02*phycon.te02,
00214 1.35e-10/phycon.te10);
00215 }
00216 else if( phycon.te<=150. )
00217 {
00218 csh2p02 = MAX2(8.40e-11,
00219 1.35e-10/phycon.te10);
00220 }
00221 else
00222 {
00223 csh2p02 = MAX2(8.4e-11,4.04e-11*phycon.te10*phycon.te02*phycon.te02);
00224 csh2p02 = MIN2(1.04e-10,csh2p02);
00225 }
00226
00227 csh2o02 = MIN2(1.11e-10,3.16e-11*phycon.te20/phycon.te02);
00228
00229 csh202 = ortho_frac*csh2o02 + (1.-ortho_frac)*csh2p02;
00230
00233
00234
00235
00236
00237 cs01 = cse01 + 3.*(csh01*(dense.xIonDense[ipHYDROGEN][0]+dense.xIonDense[ipHELIUM][0]) + csp01*dense.xIonDense[ipHYDROGEN][1] + csh201*hmi.H2_total)/dense.cdsqte;
00238 cs12 = cse12 + 5.*(csh12*(dense.xIonDense[ipHYDROGEN][0]+dense.xIonDense[ipHELIUM][0]) + csp12*dense.xIonDense[ipHYDROGEN][1] + csh212*hmi.H2_total)/dense.cdsqte;
00239 cs02 = cse02 + 5.*(csh02*(dense.xIonDense[ipHYDROGEN][0]+dense.xIonDense[ipHELIUM][0]) + csp02*dense.xIonDense[ipHYDROGEN][1] + csh202*hmi.H2_total)/dense.cdsqte;
00240
00241 PutCS( cs01 , &TauLines[ipT610] );
00242 PutCS( cs12 , &TauLines[ipT370] );
00243 PutCS( cs02 , &TauDummy );
00244
00245
00246
00247 atom_level3(
00248 &TauLines[ipT610],
00249 &TauLines[ipT370],
00250 &TauDummy);
00251
00252
00253 for( i=0; i<3; ++i)
00254 {
00255
00256 colden.C1Pops[i] = (float)atoms.PopLevels[i];
00257 }
00258
00259
00260
00261
00262 if( dense.xIonDense[ipCARBON][0] > 0. && phycon.te < 40000. )
00263 {
00264 cs12 = 1.156e-4*phycon.te*(1.09 - 7.5e-6*phycon.te - 2.1e-10*
00265 phycon.te*phycon.te);
00266 cs13 = 2.8e-3*phycon.sqrte;
00267 cs23 = 2.764e-3*phycon.sqrte;
00268
00269 a21 = 3.26e-4*TauLines[ipT9830].Pesc;
00270 a31 = 2.73e-3;
00271 a32 = 0.528*TauLines[ipT8727].Pesc;
00273 carb.c8727 = atom_pop3(9.,5.,1.,cs12,cs13,cs23,a21,a31,a32,
00274 1.417e4,1.255e4,&pciexc,dense.xIonDense[ipCARBON][0],0.,0.,0.)*a32*
00275 2.28e-12;
00276 TauLines[ipT9830].PopOpc = dense.xIonDense[ipCARBON][0];
00277 TauLines[ipT9830].PopLo = dense.xIonDense[ipCARBON][0];
00278 TauLines[ipT9830].PopHi = 0.;
00279 TauLines[ipT9830].cs = (float)cs12;
00280 TauLines[ipT8727].PopOpc = (carb.c8727/(a32*2.28e-12));
00281 TauLines[ipT8727].PopLo = (carb.c8727/(a32*2.28e-12));
00282 TauLines[ipT8727].PopHi = 0.;
00283 TauLines[ipT8727].cs = (float)cs23;
00284
00285 carb.c9850 = pciexc*a21*2.02e-12;
00286 thermal.dCooldT += carb.c9850*(1.468e4*thermal.tsq1 + thermal.halfte);
00287 thermal.dCooldT += carb.c8727*(1.255e4*thermal.tsq1 + thermal.halfte);
00288
00289
00290 carb.r9850 = (float)(a21/(a21 + cs12/5.*COLL_CONST/phycon.sqrte*dense.eden));
00291 }
00292
00293 else
00294 {
00295 carb.c9850 = 0.;
00296 carb.c8727 = 0.;
00297 carb.r9850 = 0.;
00298 TauLines[ipT9830].PopOpc = 0.;
00299 TauLines[ipT9830].PopLo = 0.;
00300 TauLines[ipT9830].PopHi = 0.;
00301 TauLines[ipT8727].PopOpc = 0.;
00302 TauLines[ipT8727].PopLo = 0.;
00303 TauLines[ipT8727].PopHi = 0.;
00304 }
00305 CoolAdd("C 1",8727,carb.c8727);
00306 CoolAdd("C 1",9850,carb.c9850);
00307
00308
00309 if( lgFirst && nWindLine )
00310 {
00311 lgFirst = false;
00312 nC2Pump = 0;
00313 for( i=0; i<nWindLine; ++i )
00314 {
00315
00316 if( TauLine2[i].nelem ==6 && TauLine2[i].IonStg==2 )
00317 {
00318 ++nC2Pump;
00319 }
00320 }
00321 if( nC2Pump<0 )
00322 TotalInsanity();
00323 else if( nC2Pump > 0 )
00324
00325 ipC2Pump = (long *)MALLOC((unsigned)(nC2Pump)*sizeof(long) );
00326 nC2Pump = 0;
00327 for( i=0; i<nWindLine; ++i )
00328 {
00329
00330 if( TauLine2[i].nelem ==6 && TauLine2[i].IonStg==2 )
00331 {
00332 # if 0
00333 DumpLine( &TauLine2[i] );
00334 # endif
00335 ipC2Pump[nC2Pump] = i;
00336 ++nC2Pump;
00337 }
00338 }
00339 }
00340 else
00341
00342 nC2Pump = 0;
00343
00344
00345 pump_rate = 0.;
00346 for( i=0; i<nC2Pump; ++i )
00347 {
00348 pump_rate += TauLine2[ipC2Pump[i]].pump;
00349 # if 0
00350 fprintf(ioQQQ,"DEBUG C %li %.3e %.3e\n",
00351 i,
00352 TauLine2[ipC2Pump[i]].WLAng , TauLine2[ipC2Pump[i]].pump );
00353 # endif
00354 }
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370 cse12 = MIN2(2.20,0.403*phycon.te20/phycon.te02*phycon.te001*phycon.te001);
00371
00372
00373
00374
00375
00376
00377
00378 temp = MIN2(2e3, phycon.te);
00379
00380
00381
00382 cs_c2_h12 = 1e-10*(4.4716028+ 0.69658785*pow(temp, 0.31692387));
00383
00384 if(phycon.te > 2e3)
00385 {
00386
00387 cs_c2_h12 *= pow(phycon.te/2e3, 0.31692387);
00388 }
00389
00390
00391 cs_c2_h12 *= 4.*(dense.xIonDense[ipHYDROGEN][0] + hmi.Hmolec[ipMH2g])/dense.cdsqte;
00392
00393
00394 ASSERT( fabs(dense.eden + dense.xIonDense[ipHYDROGEN][0]*1.7e-4 * dense.HCorrFac -dense.EdenHCorr )/
00395 dense.EdenHCorr < 1e-8 );
00396
00397 PutCS( cse12+cs_c2_h12 ,&TauLines[ipT157]);
00398
00399
00400
00401
00402 cs = MIN2(6.73,2.316*phycon.te10);
00403 PutCS(cs,&TauLines[ipT1335]);
00404 atom_level2(&TauLines[ipT1335]);
00405
00406
00407
00408
00409
00410
00411 AtomSeqBoron(&TauLines[ipT157],
00412 &TauLines[ipC2_2325],
00413 &TauLines[ipC2_2324],
00414 &TauLines[ipC2_2329],
00415 &TauLines[ipC2_2328],
00416 &TauLines[ipC2_2327],
00417 0.2349 , 0.8237 , 0.8533 , 1.9818 , pump_rate , "C 2");
00418 {
00419
00420 enum {DEBUG_LOC=false};
00421 if( DEBUG_LOC && nzone > 80 )
00422 {
00423 fprintf(ioQQQ,"DEBUG\t%.2f\t%.3e\t%.3e\t%.2e\t%.2e\t%.2e\t%.2e\n",
00424 fnzone ,
00425 phycon.te,
00426 TauLines[ipT157].cool ,
00427 cse12,
00428 csh12,
00429 dense.eden,
00430 (dense.xIonDense[ipHYDROGEN][0] + hmi.Hmolec[ipMH2g])/dense.cdsqte);
00431 }
00432 }
00433
00434 sum = 0.;
00435
00436 for( i=0; i<5; ++i)
00437 {
00438 colden.C2Pops[i] = (float)atoms.PopLevels[i];
00439 sum += colden.C2Pops[i];
00440 }
00441 ASSERT( fabs(sum-dense.xIonDense[ipCARBON][1])/SDIV(dense.xIonDense[ipCARBON][1]) < 1e-4 );
00442
00443
00444 PutCS(.1,&TauLines[ipT386]);
00445 atom_level2(&TauLines[ipT386]);
00446
00447 PutCS(.1,&TauLines[ipT310]);
00448 atom_level2(&TauLines[ipT310]);
00449
00450 PutCS(.1,&TauLines[ipT291]);
00451 atom_level2(&TauLines[ipT291]);
00452
00453 PutCS(.1,&TauLines[ipT280]);
00454 atom_level2(&TauLines[ipT280]);
00455
00456 PutCS(.1,&TauLines[ipT274]);
00457 atom_level2(&TauLines[ipT274]);
00458
00459 PutCS(.1,&TauLines[ipT270]);
00460 atom_level2(&TauLines[ipT270]);
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472 cs = MIN2(1.1,2.67/phycon.te10);
00473 a21 = 5.149e-3;
00474 PutCS(cs,&TauLines[ipT1909]);
00475
00476
00477
00478
00479 AtomSeqBeryllium(.96,.73,2.8,&TauLines[ipT1909],a21);
00480 embesq.em1908 = (float)(atoms.PopLevels[3]*a21*1.04e-11);
00481
00482
00483
00484
00485
00486
00487 a21 = 6.87e-4;
00488
00489
00490 cs = 2.8*dense.cdsqte/5.*1.667;
00491 popratio = cs/(cs + a21);;
00492 embesq.em13C1910 = (float)(a21 * atoms.PopLevels[1]*popratio* 1.04e-11 / co.RatioC12O16_2_C13O16);
00493
00494
00495
00496
00497 popup = 0.;
00498 colden.C3Pops[0] = (float)atoms.PopLevels[0];
00499 for( i=1; i<4; ++i)
00500 {
00501 popup += atoms.PopLevels[i];
00502 colden.C3Pops[i] = (float)atoms.PopLevels[i];
00503 }
00504
00505 SaveAbun = dense.xIonDense[ipCARBON][2];
00506 dense.xIonDense[ipCARBON][2] = (float)popup;
00507
00508
00509
00510 cs = MIN2(30.,4.806*phycon.te10*phycon.te05/phycon.te01/phycon.te003);
00511 PutCS(18.45,&TauLines[ipc31175]);
00512 atom_level2(&TauLines[ipc31175]);
00513 dense.xIonDense[ipCARBON][2] = (float)SaveAbun;
00514
00515
00516
00517 cs = MIN2(7.0,1.556*phycon.te10);
00518 PutCS(cs,&TauLines[ipT977]);
00519 atom_level2(&TauLines[ipT977]);
00520
00521
00522
00523 ligbar(
00524 6,
00525 &TauLines[ipT1548],
00526 &TauLines[ipT312],
00527 &cs2s2p,&cs2s3p);
00528 PutCS(cs2s2p,&TauLines[ipT1548]);
00529 PutCS(cs2s2p*0.5,&TauLines[ipT1550]);
00530 PutCS(1.0,&TauDummy);
00531 atom_level3(
00532 &TauLines[ipT1550],
00533 &TauDummy,
00534 &TauLines[ipT1548]);
00535
00536 PutCS(cs2s3p,&TauLines[ipT312]);
00537 atom_level2(&TauLines[ipT312]);
00538
00539 DEBUG_EXIT( "CoolCarb()" );
00540 return;
00541 }
00542