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