00001
00002
00003
00004
00005
00006
00007 #include "cddefines.h"
00008 #include "physconst.h"
00009 #include "dense.h"
00010 #include "called.h"
00011 #include "gammas.h"
00012 #include "colden.h"
00013 #include "thermal.h"
00014 #include "secondaries.h"
00015 #include "h2.h"
00016 #include "mole.h"
00017 #include "radius.h"
00018 #include "doppvel.h"
00019 #include "rfield.h"
00020 #include "ionbal.h"
00021 #include "rt.h"
00022 #include "opacity.h"
00023 #include "iso.h"
00024 #include "conv.h"
00025 #include "phycon.h"
00026 #include "hmi.h"
00027
00028
00029 #if 0
00030 #if !defined(NDEBUG)
00031
00032
00033
00034
00035 #define AUDIT(a) { \
00036 double total, mtotal; \
00037 for( i=0;i<N_H_MOLEC;i++) { \
00038 total = 0.; \
00039 for( j=0;j<N_H_MOLEC;j++) { \
00040 total += c[i][j]*nprot[j]; \
00041 } \
00042 if( fabs(total) > 1e-6*fabs(c[i][i]*nprot[i])) { \
00043 fprintf(ioQQQ,"PROBLEM Subtotal1 %c %.2e\n",a,fabs(total)/fabs(c[i][i]*nprot[i])); \
00044 fprintf(ioQQQ,"Species %li Total %g Diag %g\n",i,total,c[i][i]*nprot[i]); \
00045 } \
00046 } \
00047 total = mtotal = 0.;for( j=0;j<N_H_MOLEC;j++) { total += bvec[j]*nprot[j]; mtotal += fabs(bvec[j]*nprot[j]); }\
00048 if( fabs(total) > 1e-30 && fabs(total) > 1e-10*rtot) { \
00049 fprintf(ioQQQ,"PROBLEM Subtotal2 %c %.2e\n",a,fabs(total)/mtotal); \
00050 fprintf(ioQQQ,"RHS Total %g cf %g\n",total,mtotal); \
00051 } else if( a == '.' && fabs(total) > 1e-7*mtotal) { \
00052 fprintf(ioQQQ,"PROBLEM zone %li Hmole RHS conservation error %.2e of %.2e\n",nzone,total,mtotal); \
00053 fprintf(ioQQQ,"(may be due to high rate equilibrium reactions)\n"); \
00054 } \
00055 }
00056 #else
00057 #define AUDIT
00058 #endif
00059
00060 #endif
00061
00062 void hmole( void )
00063 {
00064 int nFixup, i;
00065 double error;
00066 realnum oxy_error=0.;
00067 static realnum abund0=-BIGFLOAT , abund1=-BIGFLOAT;
00068 realnum save1=dense.xIonDense[ipOXYGEN][1],
00069 save0=dense.xIonDense[ipOXYGEN][0];
00070
00071 DEBUG_ENTRY( "hmole()" );
00072
00073
00074 nFixup = 0;
00075 error = 1.;
00076
00077
00078
00079 if( conv.nTotalIoniz==0 && iteration==0 )
00080 {
00081 realnum pdr_mole_h2[N_H_MOLEC] = {1.00E+00f,
00082 3.18E-05f,
00083 1.95E-11f,
00084 4.00E-08f,
00085 1.08E-14f,
00086 1.08E-20f,
00087 3.85E-07f,
00088 8.04E-14f};
00089
00090
00091 ASSERT( dense.xIonDense[ipHYDROGEN][0]>SMALLFLOAT );
00092
00093 ASSERT( ipMH==0&&
00094 ipMHp == 1&&
00095 ipMHm == 2&&
00096 ipMH2g == 3&&
00097 ipMH2p == 4&&
00098 ipMH3p == 5&&
00099 ipMH2s == 6&&
00100 ipMHeHp== 7&&
00101 N_H_MOLEC==8 );
00102
00103 for( i=0; i<N_H_MOLEC; ++i )
00104 {
00105 hmi.Hmolec[i] = dense.xIonDense[ipHYDROGEN][0]*pdr_mole_h2[i];
00106 }
00107 }
00108
00109
00110 hmole_reactions();
00111
00112
00113 # define BIGERROR 1e-4
00114
00115
00116 # define LIM_LOOP 20
00117
00118 for(i=0; i < LIM_LOOP && ((error > BIGERROR||nFixup || oxy_error>conv.EdenErrorAllowed));i++)
00119 {
00120 {
00121
00122
00123 enum {DEBUG_LOC=false};
00124
00125 if( DEBUG_LOC && (nzone>140) )
00126 {
00127 fprintf(ioQQQ,"DEBUG hmole in \t%.2f\t%.5e\t%.5e",
00128 fnzone,
00129 phycon.te,
00130 dense.eden);
00131 for( i=0; i<N_H_MOLEC; i++ )
00132 fprintf(ioQQQ,"\t%.2e", hmi.Hmolec[i] );
00133 fprintf(ioQQQ,"\n" );
00134 }
00135 }
00136
00137
00138 nFixup = 0;
00139
00140 if( !conv.lgSearch )
00141 {
00142 IonOxyge();
00143 }
00144
00145 save1 = dense.xIonDense[ipOXYGEN][1];
00146 save0 = dense.xIonDense[ipOXYGEN][0];
00147
00148
00149
00150
00151 if( nzone )
00152 {
00153 # define OLD 0.75f
00154 abund0 = abund0*OLD+dense.xIonDense[ipOXYGEN][0]*(1.f-OLD);
00155 abund1 = abund1*OLD+dense.xIonDense[ipOXYGEN][1]*(1.f-OLD);
00156 }
00157 else
00158 {
00159 abund0 = dense.xIonDense[ipOXYGEN][0];
00160 abund1 = dense.xIonDense[ipOXYGEN][1];
00161 }
00162 dense.xIonDense[ipOXYGEN][0] = abund0;
00163
00164 dense.xIonDense[ipOXYGEN][1] = abund1;
00165
00166 oxy_error = (realnum)fabs(save1-abund1)/SDIV(dense.gas_phase[ipOXYGEN]);
00167
00168
00169
00170 hmole_step(&nFixup, &error);
00171 dense.xIonDense[ipOXYGEN][0] = save0;
00172 dense.xIonDense[ipOXYGEN][1] = save1;
00173 {
00174
00175
00176 enum {DEBUG_LOC=false};
00177
00178 if( DEBUG_LOC )
00179 {
00180 fprintf(ioQQQ,"DEBUG hmole out\t%i\t%.2f\t%.5e\t%.5e",
00181 i,
00182 fnzone,
00183 phycon.te,
00184 dense.eden);
00185 fprintf(ioQQQ,
00186 "\terror\t%.4e\tH0\t%.4e\tH+\t%.4e\tsink\t%.4e\t%.4e\tsour\t%.4e\t%.4e\tion\t%.4e\trec\t%.4e",
00187 error,
00188 dense.xIonDense[ipHYDROGEN][0],
00189 dense.xIonDense[ipHYDROGEN][1],
00190 mole.sink[ipHYDROGEN][0],
00191 mole.sink[ipHYDROGEN][1],
00192 mole.source[ipHYDROGEN][0] ,
00193 mole.source[ipHYDROGEN][1] ,
00194 ionbal.RateIonizTot[ipHYDROGEN][0],
00195 ionbal.RateRecomTot[ipHYDROGEN][0]);
00196
00197
00198
00199 fprintf(ioQQQ,"\n" );
00200 }
00201 }
00202 }
00203
00204 if( (i == LIM_LOOP && error > BIGERROR) || nFixup != 0 )
00205 {
00206
00207
00208 conv.lgConvPops = false;
00209
00210 if( !conv.lgSearch && called.lgTalk )
00211 {
00212 fprintf(ioQQQ," PROBLEM hmole, zone %li: %d iters, %d bad; final error: %g lgSearch %i\n",
00213 nzone,
00214 i,
00215 nFixup,
00216 error,
00217 conv.lgSearch);
00218 }
00219 ConvFail( "pops" , "Hmole");
00220 }
00221
00222
00223 if( strcmp( dense.chDenseLaw, "CDEN" )==0 )
00224
00225 ASSERT( fabs( dense.gas_phase[ipHYDROGEN] - dense.den0 )/
00226 dense.gas_phase[ipHYDROGEN]<1e-4 );
00227
00228
00229
00230
00231 dense.xMolecules[ipHYDROGEN] = 0.;
00232 for(i=0;i<N_H_MOLEC;i++)
00233 {
00234 dense.xMolecules[ipHYDROGEN] += hmi.Hmolec[i]*hmi.nProton[i];
00235 }
00236
00237 dense.xMolecules[ipHYDROGEN] -= (hmi.Hmolec[ipMH]+hmi.Hmolec[ipMHp]);
00238
00239
00240 for( i=0; i < mole.num_comole_calc; i++ )
00241 {
00242 dense.xMolecules[ipHYDROGEN] += COmole[i]->hevmol*COmole[i]->nElem[ipHYDROGEN];
00243 }
00244
00245
00246 return;
00247 }
00248
00249
00250 double hmirat(double te)
00251 {
00252 double hmirat_v;
00253
00254 DEBUG_ENTRY( "hmirat()" );
00255
00256
00257 if( te < 31.62 )
00258 {
00259 hmirat_v = 8.934e-18*phycon.sqrte*phycon.te003*phycon.te001*
00260 phycon.te001;
00261 }
00262 else if( te < 90. )
00263 {
00264 hmirat_v = 5.159e-18*phycon.sqrte*phycon.te10*phycon.te03*
00265 phycon.te03*phycon.te003*phycon.te001;
00266 }
00267 else if( te < 1200. )
00268 {
00269 hmirat_v = 2.042e-18*te/phycon.te10/phycon.te03;
00270 }
00271 else if( te < 3800. )
00272 {
00273 hmirat_v = 8.861e-18*phycon.te70/phycon.te03/phycon.te01*
00274 phycon.te003;
00275 }
00276 else if( te <= 1.4e4 )
00277 {
00278
00279 hmirat_v = 8.204e-17*phycon.sqrte/phycon.te10/phycon.te01*
00280 phycon.te003;
00281 }
00282 else
00283 {
00284
00285 hmirat_v = 5.44e-16*phycon.te20/phycon.te01;
00286 }
00287 return( hmirat_v );
00288 }
00289
00290
00291
00292 void hmole_init(void)
00293 {
00294
00295 DEBUG_ENTRY( "hmole_init()" );
00296
00297
00298 strcpy( hmi.chLab[ipMH], "H0 " );
00299 strcpy( hmi.chLab[ipMHp], "H+ " );
00300 strcpy( hmi.chLab[ipMHm], "H- " );
00301 strcpy( hmi.chLab[ipMH2g], "H2g " );
00302 strcpy( hmi.chLab[ipMH2p], "H2+ " );
00303 strcpy( hmi.chLab[ipMH3p], "H3+ " );
00304 strcpy( hmi.chLab[ipMH2s], "H2* " );
00305 strcpy( hmi.chLab[ipMHeHp], "HeH+" );
00306
00307
00308 hmi.rheph2hpheh = 0.;
00309 return;
00310
00311 }
00312
00313
00314 void hmole_reactions( void )
00315 {
00316 static double teused=-1;
00317 double exph2,
00318 exph2s,
00319 exphp,
00320 ex3hp;
00321 long i;
00322 double h2esc,
00323 th2,
00324 cr_H2s ,
00325 cr_H2dis,
00326 cr_H2dis_ELWERT_H2g,
00327 cr_H2dis_ELWERT_H2s;
00328
00329 DEBUG_ENTRY( "hmole_reactions()" );
00330
00331
00332
00333 if( ! fp_equal( phycon.te, teused ) )
00334 {
00335 teused = phycon.te;
00336
00337
00338
00339
00340 hmi.exphmi = sexp(8.745e3/phycon.te);
00341 if( hmi.exphmi > 0. )
00342 {
00343
00344 hmi.rel_pop_LTE_Hmin = SAHA/(phycon.te32*hmi.exphmi)*(1./(2.*2.));
00345 }
00346 else
00347 {
00348 hmi.rel_pop_LTE_Hmin = 0.;
00349 }
00350
00351
00352
00353
00354 if( h2.lgH2ON && hmi.lgBigH2_evaluated && hmi.lgH2_Chemistry_BigH2 )
00355 {
00356
00357 hmi.rel_pop_LTE_H2g = hmi.H2g_LTE_bigH2;
00358 hmi.rel_pop_LTE_H2s = hmi.H2s_LTE_bigH2;
00359 # if 0
00360 exph2 = sexp((5.195e4-hmi.H2_BigH2_H2g_av*T1CM)/phycon.te);
00361
00362 if( exph2 > 0. )
00363 hmi.rel_pop_LTE_H2g = SAHA/SDIV(phycon.te32*exph2)*(1./(2.*2.))*3.634e-5;
00364 else
00365 hmi.rel_pop_LTE_H2g = 0.;
00366
00367
00368
00369
00370
00371 exph2s = sexp((5.195e4-hmi.H2_BigH2_H2s_av * T1CM)/phycon.te);
00372
00373 if( exph2s > 0. )
00374 hmi.rel_pop_LTE_H2s = SAHA/SDIV(phycon.te32*exph2s)*(1./(2.*2.))*3.634e-5;
00375 else
00376 hmi.rel_pop_LTE_H2s = 0.;
00377
00378
00379
00380
00381 # endif
00382 }
00383 else
00384 {
00385
00386
00387 exph2 = sexp((5.195e4)/phycon.te);
00388
00389
00390 if( exph2 > 0. )
00391 {
00392
00393 hmi.rel_pop_LTE_H2g = SAHA/(phycon.te32*exph2)*(1./(2.*2.))*3.634e-5;
00394 }
00395 else
00396 {
00397 hmi.rel_pop_LTE_H2g = 0.;
00398 }
00399
00400
00401
00402
00403
00404 exph2s = sexp(2.178e4/phycon.te);
00405
00406 if( exph2s > 0. )
00407 {
00408
00409 hmi.rel_pop_LTE_H2s = SAHA/(phycon.te32*exph2s)*(1./(2.*2.))*3.634e-5;
00410 }
00411 else
00412 {
00413 hmi.rel_pop_LTE_H2s = 0.;
00414 }
00415 }
00416 {
00417
00418
00419
00420
00421 enum {DEBUG_LOC=false};
00422
00423 if( DEBUG_LOC && nzone>187&& iteration > 1)
00424 {
00425
00426 fprintf(ioQQQ,"ph2lteee\t%.2e\t%.1e\t%.1e\n",
00427 hmi.rel_pop_LTE_H2g,
00428 sexp(2.178e4/phycon.te),
00429 phycon.te);
00430 }
00431 }
00432
00433
00434
00435 exphp = sexp(3.072e4/phycon.te);
00436 if( exphp > 0. )
00437 {
00438
00439
00440 hmi.rel_pop_LTE_H2p = SAHA/(phycon.te32*exphp)*(4./(2.*1.))*3.634e-5;
00441 }
00442 else
00443 {
00444 hmi.rel_pop_LTE_H2p = 0.;
00445 }
00446
00447
00448
00449 ex3hp = sexp(1.882e4/phycon.te);
00450 if( ex3hp > 0. )
00451 {
00452
00453
00454 hmi.rel_pop_LTE_H3p = SAHA/(phycon.te32*ex3hp)*(4./(2.*1.))*3.634e-5;
00455 }
00456 else
00457 {
00458 hmi.rel_pop_LTE_H3p = 0.;
00459 }
00460 }
00461
00462
00463
00464 hmi.hminus_rad_attach = hmirat(phycon.te);
00465
00466 hmi.hmicol = hmi.hminus_rad_attach*EN1RYD*phycon.te*1.15e-5;
00467
00468
00469
00470
00471
00472 hmi.hminus_rad_attach *= dense.eden;
00473 hmi.hmicol *= dense.eden*hmi.Hmolec[ipMH];
00474
00475
00476
00477
00478
00479
00482
00483
00484
00485
00486
00487 hmi.HMinus_photo_rate = GammaBn( hmi.iphmin-1 , iso.ipIsoLevNIonCon[ipHE_LIKE][ipHELIUM][0] , opac.iphmop ,
00488 0.055502 , &hmi.HMinus_induc_rec_rate , &hmi.HMinus_induc_rec_cooling );
00489
00490
00491 hmi.HMinus_photo_heat = thermal.HeatNet;
00492
00493 {
00494
00495
00496 enum {DEBUG_LOC=false};
00497
00498 if( DEBUG_LOC)
00499 {
00500 fprintf(ioQQQ,"hminphoto\t%li\t%li\t%.2e\n", nzone, conv.nPres2Ioniz , hmi.HMinus_photo_rate );
00501 }
00502 }
00503
00504
00505 hmi.HMinus_induc_rec_rate *= hmi.rel_pop_LTE_Hmin*dense.eden;
00506
00507
00509 hmi.HMinus_induc_rec_cooling *= hmi.rel_pop_LTE_Hmin*dense.eden*hmi.Hmolec[ipMH];
00510
00511 {
00512
00513
00514 enum {DEBUG_LOC=false};
00515
00516 if( DEBUG_LOC && nzone>400)
00517 {
00518 fprintf(ioQQQ,"hmoledebugg %.2f ",fnzone);
00519 GammaPrt(
00520 hmi.iphmin-1 , iso.ipIsoLevNIonCon[ipHE_LIKE][ipHELIUM][0] , opac.iphmop ,
00521
00522 ioQQQ,
00523
00524 hmi.HMinus_photo_rate,
00525
00526 hmi.HMinus_photo_rate*0.05);
00527 }
00528 }
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540 hmi.UV_Cont_rel2_Habing_TH85_depth = 0.;
00541
00542
00543
00544
00545
00546 for( i=rfield.ipG0_TH85_lo; i < rfield.ipG0_TH85_hi; ++i )
00547 {
00548 hmi.UV_Cont_rel2_Habing_TH85_depth += (rfield.flux[i-1] + rfield.ConInterOut[i-1]+
00549 rfield.outlin[i-1]+ rfield.outlin_noplot[i-1])*rfield.anu[i-1];
00550 }
00551
00552
00553
00554
00555
00556 hmi.UV_Cont_rel2_Habing_TH85_depth = (realnum)(hmi.UV_Cont_rel2_Habing_TH85_depth*EN1RYD/1.6e-3);
00557
00558 if( nzone<=1 )
00559 {
00560 hmi.UV_Cont_rel2_Habing_TH85_face = hmi.UV_Cont_rel2_Habing_TH85_depth;
00561 }
00562
00563
00564
00565 hmi.UV_Cont_rel2_Habing_spec_depth = 0.;
00566 for( i=rfield.ipG0_spec_lo; i < rfield.ipG0_spec_hi; ++i )
00567 {
00568 hmi.UV_Cont_rel2_Habing_spec_depth += (rfield.flux[i-1] + rfield.ConInterOut[i-1]+
00569 rfield.outlin[i-1]+ rfield.outlin_noplot[i-1])*rfield.anu[i-1];
00570 }
00571 hmi.UV_Cont_rel2_Habing_spec_depth = (realnum)(hmi.UV_Cont_rel2_Habing_spec_depth*EN1RYD/1.6e-3);
00572
00573
00574
00575 if( hmi.UV_Cont_rel2_Draine_DB96_face ==0 )
00576 {
00577
00578 for( i=rfield.ipG0_DB96_lo; i < rfield.ipG0_DB96_hi; ++i )
00579 {
00580 hmi.UV_Cont_rel2_Draine_DB96_face += (rfield.flux[i-1] + rfield.ConInterOut[i-1]+
00581 rfield.outlin[i-1]+ rfield.outlin_noplot[i-1]);
00582 }
00583
00584
00585
00586
00587
00588
00589
00590
00591 hmi.UV_Cont_rel2_Draine_DB96_face = hmi.UV_Cont_rel2_Draine_DB96_face/(1.232e7f * 1.71f);
00592 }
00593
00594
00595
00596
00597 hmi.H2Opacity = (realnum)(1.2e-14*(1e5/DoppVel.doppler[LIMELM+2]));
00598
00599 th2 = (colden.colden[ipCOL_H2g]+ colden.colden[ipCOL_H2s])*hmi.H2Opacity;
00600
00601
00602 h2esc = esc_PRD_1side(th2,1e-4);
00603
00604
00605
00606
00607
00608
00609
00610 hmi.H2_Solomon_dissoc_rate_TH85_H2g = 3.4e-11 * hmi.UV_Cont_rel2_Habing_TH85_depth * h2esc;
00611 hmi.H2_Solomon_dissoc_rate_TH85_H2s = 3.4e-11 * hmi.UV_Cont_rel2_Habing_TH85_depth * h2esc;
00612 hmi.H2_H2g_to_H2s_rate_TH85 = hmi.H2_Solomon_dissoc_rate_TH85_H2g*9.;
00613
00614
00615 hmi.H2_Solomon_dissoc_rate_BHT90_H2g = 3.4e-11 * hmi.UV_Cont_rel2_Habing_TH85_depth * h2esc;
00616 hmi.H2_Solomon_dissoc_rate_BHT90_H2s = 3.4e-11 * hmi.UV_Cont_rel2_Habing_TH85_depth * h2esc;
00617 hmi.H2_H2g_to_H2s_rate_BHT90 = hmi.H2_Solomon_dissoc_rate_BHT90_H2g*9.;
00618
00619 {
00620
00621
00622
00623
00624 double x = (colden.colden[ipCOL_H2g]+colden.colden[ipCOL_H2s]) / 5e14;
00625 double sqrtx = sqrt(1.+x);
00626
00627 double b5 = DoppVel.doppler[LIMELM+2]/1e5;
00628
00629 double fshield = 0.965/POW2(1.+x/b5) + 0.035/sqrtx *
00630 sexp(8.5e-4*sqrtx);
00631
00632
00633
00634
00635
00636
00637 hmi.UV_Cont_rel2_Draine_DB96_depth = hmi.UV_Cont_rel2_Draine_DB96_face *
00638 (realnum)(sexp( opac.TauAbsFace[rfield.ip1000A-1] )/radius.r1r0sq);
00639
00640
00641
00642
00643 if( co.lgUMISTrates )
00644 {
00645
00646 hmi.H2_Solomon_dissoc_rate_BD96_H2g = 4.6e-11 * hmi.UV_Cont_rel2_Draine_DB96_depth * fshield;
00647 hmi.H2_Solomon_dissoc_rate_BD96_H2s = 4.6e-11 * hmi.UV_Cont_rel2_Draine_DB96_depth * fshield;
00648 }
00649 else
00650 {
00651
00652 hmi.H2_Solomon_dissoc_rate_BD96_H2g = 5.18e-11* (hmi.UV_Cont_rel2_Habing_TH85_face/1.66f)
00653 *sexp(3.02*rfield.extin_mag_V_point)* fshield;
00654 hmi.H2_Solomon_dissoc_rate_BD96_H2s = 5.18e-11* (hmi.UV_Cont_rel2_Habing_TH85_face/1.66f)
00655 *sexp(3.02*rfield.extin_mag_V_point)* fshield;
00656 }
00657
00658
00659
00660
00661
00662 hmi.H2_H2g_to_H2s_rate_BD96 = 5.67* hmi.H2_Solomon_dissoc_rate_BD96_H2g;
00663 }
00664
00665
00666 if( hmi.UV_Cont_rel2_Draine_DB96_face > SMALLFLOAT )
00667 {
00668
00669
00670
00671
00672
00673 double b5 = DoppVel.doppler[LIMELM+2]/1e5;
00674
00675
00676
00677
00678
00679
00680
00681 double x_H2g, x_H2s,
00682 fshield_H2g, fshield_H2s,
00683 f_H2s;
00684 static double a_H2g, a_H2s,
00685 e1_H2g, e1_H2s,
00686 e2_H2g,
00687 b_H2g,
00688 sl_H2g, sl_H2s,
00689 k_f_H2s,
00690 k_H2g_to_H2s,
00691 log_G0_face = -1;
00692
00693
00694
00695
00696
00697
00698
00699
00700 {
00701 if(hmi.UV_Cont_rel2_Draine_DB96_face <= 1.)
00702 {
00703 log_G0_face = 0.;
00704 }
00705 else if(hmi.UV_Cont_rel2_Draine_DB96_face >= 1e7)
00706 {
00707 log_G0_face = 7.;
00708 }
00709 else
00710 {
00711 log_G0_face = log10(hmi.UV_Cont_rel2_Draine_DB96_face);
00712 }
00713
00714
00715
00716
00717 a_H2g = 0.06 * log_G0_face + 1.32;
00718 a_H2s = 0.375 * log_G0_face + 2.125;
00719
00720 e1_H2g = -0.05 * log_G0_face + 2.25;
00721 e1_H2s = -0.125 * log_G0_face + 2.625;
00722
00723 e2_H2g = -0.005 * log_G0_face + 0.625;
00724
00725 b_H2g = -4.0e-3 * log_G0_face + 3.2e-2;
00726
00727
00728 sl_H2g = 4.0e14;
00729 sl_H2s = 9.0e15;
00730
00731
00732 k_f_H2s = MAX2(0.1,2.375 * log_G0_face - 1.875 );
00733
00734
00735 k_H2g_to_H2s = MAX2(1.,-1.75 * log_G0_face + 11.25);
00736
00737
00738
00739
00740 }
00741
00742
00743 f_H2s = k_f_H2s * pow((double)hmi.UV_Cont_rel2_Draine_DB96_depth, 0.2 );
00744
00745
00746 x_H2g = (colden.colden[ipCOL_H2g]) / sl_H2g;
00747 x_H2s = (colden.colden[ipCOL_H2s]) / sl_H2s;
00748
00749
00750 fshield_H2g = 0.965/pow(1.+x_H2g/b5,e1_H2g) + b_H2g/pow(1.+x_H2g/b5,e2_H2g);
00751 fshield_H2s = 0.965/pow(1.+x_H2s/b5,e1_H2s);
00752
00753
00754 hmi.H2_Solomon_dissoc_rate_ELWERT_H2g = a_H2g * 4.6e-11 * fshield_H2g * hmi.UV_Cont_rel2_Draine_DB96_depth;
00755 hmi.H2_Solomon_dissoc_rate_ELWERT_H2s = a_H2s * 4.6e-11 * fshield_H2s * (hmi.UV_Cont_rel2_Draine_DB96_depth + f_H2s);
00756
00757
00758 hmi.H2_H2g_to_H2s_rate_ELWERT = k_H2g_to_H2s * hmi.H2_Solomon_dissoc_rate_ELWERT_H2g;
00759
00760
00761
00762
00763 hmi.H2_photodissoc_ELWERT_H2s = hmi.UV_Cont_rel2_Draine_DB96_depth*1e-11;
00764 hmi.H2_photodissoc_ELWERT_H2g = hmi.H2_photodissoc_ELWERT_H2s * 1.0e-10;
00765 }
00766 else
00767 {
00768 hmi.H2_Solomon_dissoc_rate_ELWERT_H2g = 0.;
00769 hmi.H2_Solomon_dissoc_rate_ELWERT_H2s = 0.;
00770 hmi.H2_photodissoc_ELWERT_H2s = 0.;
00771 hmi.H2_photodissoc_ELWERT_H2g = 0.;
00772 }
00773
00774
00775 hmi.H2_photodissoc_TH85 = hmi.UV_Cont_rel2_Habing_TH85_depth*1e-11;
00776
00777
00778 hmi.H2_photodissoc_BHT90 = hmi.UV_Cont_rel2_Habing_TH85_depth*1e-11;
00779
00780
00781
00782
00783
00784
00785 cr_H2s = secondaries.x12tot*0.9 / 2. * hmi.lgLeidenCRHack;
00786
00787
00788 cr_H2dis = secondaries.x12tot*0.1 / 2. * hmi.lgLeidenCRHack;
00789
00790
00791
00792
00793
00794 cr_H2dis_ELWERT_H2g = secondaries.x12tot*5e-8 * hmi.lgLeidenCRHack;
00795 cr_H2dis_ELWERT_H2s = secondaries.x12tot*4e-2 * hmi.lgLeidenCRHack;
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807 if( h2.lgH2ON && hmi.lgBigH2_evaluated && hmi.lgH2_Chemistry_BigH2 )
00808 {
00809
00810
00811
00812
00813
00814
00815 hmi.H2_Solomon_dissoc_rate_used_H2g = hmi.H2_Solomon_dissoc_rate_BigH2_H2g;
00816 if( hmi.H2_Solomon_dissoc_rate_used_H2g <= 0. )
00817 {
00818
00819 hmi.H2_Solomon_dissoc_rate_used_H2g = hmi.H2_Solomon_dissoc_rate_TH85_H2g;
00820 }
00821
00822 hmi.H2_Solomon_dissoc_rate_used_H2s = hmi.H2_Solomon_dissoc_rate_BigH2_H2s;
00823 if( hmi.H2_Solomon_dissoc_rate_used_H2s <= 0. )
00824 hmi.H2_Solomon_dissoc_rate_used_H2s = hmi.H2_Solomon_dissoc_rate_TH85_H2g;
00825
00826
00827 hmi.H2_H2g_to_H2s_rate_used = hmi.H2_H2g_to_H2s_rate_BigH2;
00828 if( hmi.H2_H2g_to_H2s_rate_used <= 0. )
00829 hmi.H2_H2g_to_H2s_rate_used = hmi.H2_H2g_to_H2s_rate_TH85;
00830
00831
00832
00833
00834
00835 hmi.H2_photodissoc_used_H2s = hmi.H2_photodissoc_BigH2_H2s;
00836 if( hmi.H2_photodissoc_used_H2s <= 0. )
00837 hmi.H2_photodissoc_used_H2s = hmi.H2_photodissoc_TH85;
00838
00839
00840 hmi.H2_photodissoc_used_H2g = hmi.H2_photodissoc_BigH2_H2g;
00841 if( hmi.H2_photodissoc_used_H2g <= 0. )
00842 hmi.H2_photodissoc_used_H2g = hmi.H2_photodissoc_TH85*1.0e-10f;
00843 }
00844 else if( hmi.chH2_small_model_type == 'T' )
00845 {
00846
00847
00848 hmi.H2_Solomon_dissoc_rate_used_H2g = hmi.H2_Solomon_dissoc_rate_TH85_H2g + cr_H2dis;
00849
00850 hmi.H2_Solomon_dissoc_rate_used_H2s = hmi.H2_Solomon_dissoc_rate_TH85_H2s + cr_H2dis;
00851 hmi.H2_H2g_to_H2s_rate_used = hmi.H2_H2g_to_H2s_rate_TH85 + cr_H2s;
00852
00853
00854
00855 hmi.H2_photodissoc_used_H2s = hmi.H2_photodissoc_TH85;
00856
00857
00858 hmi.H2_photodissoc_used_H2g = hmi.H2_photodissoc_TH85*1.0e-10f;
00859 }
00860
00861 else if( hmi.chH2_small_model_type == 'H' )
00862 {
00863
00864
00865
00866 hmi.H2_Solomon_dissoc_rate_used_H2g = hmi.H2_Solomon_dissoc_rate_BHT90_H2g + cr_H2dis;
00867
00868 hmi.H2_Solomon_dissoc_rate_used_H2s = hmi.H2_Solomon_dissoc_rate_BHT90_H2s + cr_H2dis;
00869 hmi.H2_H2g_to_H2s_rate_used = hmi.H2_H2g_to_H2s_rate_BHT90 + cr_H2s;
00870
00871
00872
00873 hmi.H2_photodissoc_used_H2s = hmi.H2_photodissoc_BHT90;
00874
00875
00876 hmi.H2_photodissoc_used_H2g = hmi.H2_photodissoc_BHT90*1.0e-10f;
00877 }
00878
00879 else if( hmi.chH2_small_model_type == 'B' )
00880 {
00881
00882
00883 hmi.H2_Solomon_dissoc_rate_used_H2g = hmi.H2_Solomon_dissoc_rate_BD96_H2g + cr_H2dis;
00884
00885 hmi.H2_Solomon_dissoc_rate_used_H2s = hmi.H2_Solomon_dissoc_rate_BD96_H2s + cr_H2dis;
00886
00887 hmi.H2_H2g_to_H2s_rate_used = hmi.H2_H2g_to_H2s_rate_BD96 + cr_H2s;
00888
00889
00890
00891
00892 hmi.H2_photodissoc_used_H2s = hmi.H2_photodissoc_TH85;
00893
00894
00895 hmi.H2_photodissoc_used_H2g = hmi.H2_photodissoc_TH85*1.0e-10f;
00896 }
00897 else if( hmi.chH2_small_model_type == 'E' )
00898 {
00899
00900
00901 hmi.H2_Solomon_dissoc_rate_used_H2g = hmi.H2_Solomon_dissoc_rate_ELWERT_H2g + cr_H2dis_ELWERT_H2g;
00902 hmi.H2_Solomon_dissoc_rate_used_H2s = hmi.H2_Solomon_dissoc_rate_ELWERT_H2s + cr_H2dis_ELWERT_H2s;
00903 hmi.H2_H2g_to_H2s_rate_used = hmi.H2_H2g_to_H2s_rate_ELWERT + cr_H2s;
00904
00905
00906
00907
00908 hmi.H2_photodissoc_used_H2s = hmi.H2_photodissoc_ELWERT_H2s;
00909 hmi.H2_photodissoc_used_H2g = hmi.H2_photodissoc_ELWERT_H2g;
00910 }
00911 else
00912 TotalInsanity();
00913
00914 {
00915
00916 enum {DEBUG_LOC=false};
00917
00918 if( DEBUG_LOC && h2.lgH2ON )
00919 {
00920 fprintf(ioQQQ," Solomon H2 dest rates: TH85 %.2e BD96 %.2e Big %.2e excit rates: TH85 %.2e Big %.2e\n",
00921 hmi.H2_Solomon_dissoc_rate_TH85_H2g,
00922 hmi.H2_Solomon_dissoc_rate_BD96_H2g,
00923 hmi.H2_Solomon_dissoc_rate_BigH2_H2g ,
00924 hmi.H2_H2g_to_H2s_rate_TH85 ,
00925 hmi.H2_H2g_to_H2s_rate_BigH2);
00926 }
00927 }
00928 return;
00929 }
00930