Changeset 793
- Timestamp:
- 01/22/07 06:16:29 (1 year ago)
- Files:
-
- trunk/source/cddefines.h (modified) (1 diff)
- trunk/source/iter_startend.cpp (modified) (2 diffs)
- trunk/source/parse_drive.cpp (modified) (1 diff)
- trunk/source/radius_increment.cpp (modified) (21 diffs)
- trunk/source/rt_tau_reset.cpp (modified) (1 diff)
- trunk/source/sanity_check.cpp (modified) (1 diff)
- trunk/source/service.cpp (modified) (1 diff)
- trunk/tsuite/slow/feii_blr_n09_p18_Z20.in (modified) (1 diff)
- trunk/tsuite/slow/feii_blr_n12_p19.in (modified) (1 diff)
- trunk/tsuite/slow/feii_blr_n12_p19_Z20.in (modified) (3 diffs)
- trunk/tsuite/slow/feii_blr_n13_p22.in (modified) (4 diffs)
- trunk/tsuite/slow/feii_blr_n13_p22_Z20.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/source/cddefines.h
r791 r793 858 858 859 859 /**e2 second exponential integral 860 \param t optical depth argument 861 \param t1n exp(-x) - previously stored */ 860 \param t optical depth argument */ 862 861 double e2( 863 double t, 864 double tln); 862 double t ); 865 863 866 864 /**ee1 first exponential integral trunk/source/iter_startend.cpp
r787 r793 417 417 /* e2(tau) in inward direction, up to illuminated face, this is used to get the 418 418 * recombination escape probability */ 419 opac.E2TauAbsFace[i] = (float)e2(opac.TauAbsFace[i] ,opac.ExpmTau[i]);419 opac.E2TauAbsFace[i] = (float)e2(opac.TauAbsFace[i] ); 420 420 } 421 421 … … 1192 1192 1193 1193 /* e2(tau) in inward direction, up to illuminated face */ 1194 opac.E2TauAbsFace[i] = (float)e2(opac.TauAbsFace[i] ,opac.ExpmTau[i]);1194 opac.E2TauAbsFace[i] = (float)e2(opac.TauAbsFace[i]); 1195 1195 rfield.reflin[i] = 0.; 1196 1196 rfield.ConEmitReflec[i] = 0.; trunk/source/parse_drive.cpp
r759 r793 98 98 double tau = pow( 10. , ((double)i/4. - 5.) ); 99 99 fprintf(ioQQQ,"tau\t%.3e\t exp-tau\t%.5e\t e1 tau\t%.5e \t ee2 tau\t%.5e \n", 100 tau , sexp(tau) , ee1(tau) , e2(tau , sexp(tau)) );100 tau , sexp(tau) , ee1(tau) , e2(tau ) ); 101 101 } 102 102 cdEXIT(1); trunk/source/radius_increment.cpp
r759 r793 34 34 #include "rt.h" 35 35 #include "radius.h" 36 /*cmshft - so compton scattering shift of spectrum */36 /*cmshft - so Compton scattering shift of spectrum */ 37 37 static void cmshft(void); 38 38 … … 104 104 * the error can approach 1%, and depends on the convergence criteria. 105 105 * the code does not try to converge these quantities in an absolute sense, 106 * only the quantit es relative to the electron or hydrogen density. so it is not106 * only the quantities relative to the electron or hydrogen density. so it is not 107 107 * safe to do the assert for small values 108 108 * change is to only do this branch if abundance is large enough to be detected by … … 110 110 # define ERR_CHK 1.001 111 111 double err_chk = ERR_CHK; 112 /* >>chng 05 sep 02, when low-T solver used sol n is approximate,112 /* >>chng 05 sep 02, when low-T solver used solution is approximate, 113 113 * and it must not matter (lot-T solver should not be used if it 114 114 * does matter - so use more liberal expectation */ … … 243 243 } 244 244 245 /* H 21 cm equilibrium timescale, H21cm returns H (not e) collisional deexcit rate (not cs) */245 /* H 21 cm equilibrium timescale, H21cm returns H (not e) collisional deexcitation rate (not cs) */ 246 246 t = H21cm_H_atom( phycon.te )* dense.xIonDense[ipHELIUM][ipHYDROGEN] + 247 247 /* >>chng 02 feb 14, add electron term as per discussion in */ … … 381 381 /* only update this if results will be punched */ 382 382 /* tests show that always evaluating this changes fast run of 383 * p arispnfrom 26.7 sec to 35.1 sec */383 * pn_paris from 26.7 sec to 35.1 sec */ 384 384 /* >>chng 05 mar 01, must always update them since used for transmission */ 385 385 if( rfield.lgOpacityFine /*&& rfield.lgPunchOpacityFine*/ ) … … 401 401 for( i=0; i < rfield.nflux-1; i++ ) 402 402 { 403 /* find transmission coef if lower and upper bounds of coarse continuum is within403 /* find transmission coefficient if lower and upper bounds of coarse continuum is within 404 404 * boundaries of fine continuum 405 405 * unity is default */ … … 409 409 for( j=rfield.ipnt_coarse_2_fine[i]; j<rfield.ipnt_coarse_2_fine[i+1]; ++j ) 410 410 { 411 /* find transmission coef for this zone */411 /* find transmission coefficient for this zone */ 412 412 /* here assume continuum transmission is exp(-tau) */ 413 413 /*rfield.trans_coef[i] += … … 460 460 * at the 1% - 5% level.) sphere effects in 461 461 * drNext was set by NEXTDR and will be next dr */ 462 /* compute both total and thompson scat rad acceleration */462 /* compute both total and Thomson scat rad acceleration */ 463 463 rforce += (rfield.flux[i] + rfield.outlin[i] + rfield.outlin_noplot[i]+ rfield.ConInterOut[i])* 464 464 rfield.anu[i]*(opac.opacity_abs[i] + … … 477 477 478 478 /* e2(tau) in inward direction, up to illuminated face */ 479 opac.E2TauAbsFace[i] = (float)e2(opac.TauAbsFace[i] ,opac.ExpmTau[i]);479 opac.E2TauAbsFace[i] = (float)e2(opac.TauAbsFace[i]); 480 480 ASSERT( opac.E2TauAbsFace[i] <= 1. && opac.E2TauAbsFace[i] >= 0. ); 481 481 … … 483 483 if( iteration > 1 ) 484 484 { 485 /* e2 from current position to oute tedge of shell */485 /* e2 from current position to outer edge of shell */ 486 486 float tau = MAX2(SMALLFLOAT , opac.TauAbsTotal[i] - opac.TauAbsFace[i] ); 487 opac.E2TauAbsOut[i] = (float)e2( tau , sexp(tau));487 opac.E2TauAbsOut[i] = (float)e2( tau ); 488 488 } 489 489 … … 504 504 505 505 /* this simulates the behavior in C90 and before, 506 * first attenuate flux accu lumated so far, then506 * first attenuate flux accumulated so far, then 507 507 * add on flux from this zone 508 508 rfield.ConEmitOut[i] *= (float)opfac;*/ … … 538 538 /* ratio of current to incident continuum, converted to optical depth */ 539 539 /* >>chng 99 apr 23, this crashed on alpha due to underflow to zero in argy 540 * to log. defended two tways - above checks that ratio of fluxes is large enough,540 * to log. defended two ways - above checks that ratio of fluxes is large enough, 541 541 * and here convert to double. 542 542 * error found by Peter van Hoof */ … … 546 546 547 547 /* this is computed absorption optical depth to illuminated face */ 548 /* >>chng 06 jul 11, add geometry factor for illumination at an angle - bug fix - should have548 /* >>chng 06 jul 11, add geometry factor for illumination at an angle - bug fix - should have 549 549 * always been there */ 550 550 double tau_true = opac.TauAbsFace[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][0]-1]*geometry.DirectionalCosin; … … 560 560 * incremented in RT_tau_inc */ 561 561 fprintf( ioQQQ, 562 " PROBLEM radius_increment lyman continuum insanity zone %li, effective tau=%g, atomic tau=%g simple tau=%g\n",562 " PROBLEM radius_increment Lyman continuum insanity zone %li, effective tau=%g, atomic tau=%g simple tau=%g\n", 563 563 nzone, 564 564 tau_effec , … … 593 593 } 594 594 595 /* now do slight reshuffling of energy due to compton scattering */595 /* now do slight reshuffling of energy due to Compton scattering */ 596 596 cmshft(); 597 597 598 598 relec *= EN1RYD; 599 599 600 /* radiative acceleration; xMassDensity is gm per cc, eval when PTOT called */600 /* radiative acceleration; xMassDensity is gm per cc, evaluated when PTOT called */ 601 601 t = 1./SPEEDLIGHT/dense.xMassDensity; 602 602 /* >>chng 03 feb 01, lgLineRadPresOn was missing */ … … 632 632 /* sound is sound travel time, sqrt term is sound speed */ 633 633 timesc.sound_speed_isothermal = sqrt(pressure.PresGasCurr/dense.xMassDensity); 634 /* adiabatic sound speed assuming monatomic gas - gam nma is 5/3*/634 /* adiabatic sound speed assuming monatomic gas - gamma is 5/3*/ 635 635 timesc.sound_speed_adiabatic = sqrt(5.*pressure.PresGasCurr/(3.*dense.xMassDensity) ); 636 636 timesc.sound += radius.drad_x_fillfac / timesc.sound_speed_isothermal; … … 659 659 if( opac.TauAbsGeo[0][i] < 30. ) 660 660 { 661 /* ConEmitLocal is diffuse emission per unit vol, fill fac 661 /* ConEmitLocal is diffuse emission per unit vol, fill factor 662 662 * the 1/2 comes from isotropic emission 663 663 * scatsv(i) = (flux(i)+ConInterOut(i))*0.5*scatop(i) 664 * >>chng 97 apr 25, remove fac of 2 to665 * get agreement w th lightman&white664 * >>chng 97 apr 25, remove factor of 2 to 665 * get agreement with Lightman&white 666 666 * Reflec_Diffuse_Cont = (ConEmitLocal(i)+scatsv(i)) * dReff *E2TauAbsFace(i) 667 667 * >>chng 97 may 08, needed 1/2 in front of ConEmitLocal 668 668 * had been there, but also with scatsv, and lost both 669 * when /2 removed to get agreement with lightman and white */669 * when /2 removed to get agreement with Lightman and white */ 670 670 /* >>chng 99 dec 21, add ConLocNoInter to account for rec continua 671 671 * >>chng 01 jul 01, remove ConLocNoInter from code - only had thick brems */ … … 681 681 radius.drad_x_fillfac*opac.E2TauAbsFace[i]*radius.r1r0sq); 682 682 683 /* >>chng 97 apr 25, remove fac of 2 to get684 * agreement w th lightman&white */683 /* >>chng 97 apr 25, remove factor of 2 to get 684 * agreement with Lightman&white */ 685 685 rfield.reflin[i] += (float)(rfield.outlin[i]*opac.opacity_sct[i]* 686 686 radius.drad_x_fillfac*opac.E2TauAbsFace[i]*radius.r1r0sq); … … 772 772 hydro.TexcLya = (float)TexcLine( &EmisLines[ipH_LIKE][ipHYDROGEN][ipH2p][ipH1s] ); 773 773 774 /* count number of times Lya excit temp hotter than gas */774 /* count number of times Lya excitation temp hotter than gas */ 775 775 if( hydro.TexcLya > phycon.te ) 776 776 { … … 844 844 molcol("ADD ",ioQQQ); 845 845 846 /* increment forming the mean ionizati n and temperature */846 /* increment forming the mean ionization and temperature */ 847 847 MeanInc(); 848 848 … … 976 976 977 977 978 /*cmshft - so compton scattering shift of spectrum */978 /*cmshft - so Compton scattering shift of spectrum */ 979 979 static void cmshft(void) 980 980 { trunk/source/rt_tau_reset.cpp
r759 r793 293 293 /* e2( tau across shell), optical depth from ill face to shielded face of cloud 294 294 * not that opac.TauAbsFace is reset to small number just after this */ 295 opac.E2TauAbsTotal[i] = (float)e2( opac.TauAbsTotal[i] , sexp( opac.TauAbsTotal[i] ));295 opac.E2TauAbsTotal[i] = (float)e2( opac.TauAbsTotal[i] ); 296 296 /* TauAbsFace and TauScatFace are abs and sct optical depth to ill face */ 297 297 opac.TauScatFace[i] = opac.taumin; trunk/source/sanity_check.cpp
r785 r793 589 589 590 590 /* check that e2 is ok */ 591 ans1 = e2(x ,exp(-x));591 ans1 = e2(x); 592 592 ans2 = expn( 2 , x ); 593 593 if( fabs(ans1-ans2)/(ans1+ans2) > 1e-6 ) trunk/source/service.cpp
r792 r793 299 299 double e2( 300 300 /* the argument to E2 */ 301 double t, 302 /* exp(-t) - previously stored */ 303 double exp_mt) 301 double t ) 304 302 { 305 303 /* use recurrence relation */ trunk/tsuite/slow/feii_blr_n09_p18_Z20.in
r749 r793 43 43 assert line luminosity "totl" 1402 5.211 //total O IV] 1402 44 44 // 45 assert line luminosity "totl" 1549 5.978 //total of sum of both C IV comp 45 // >>chng 07 jan 20, from 5.978 to 5.953, e2 bug 46 assert line luminosity "totl" 1549 5.953 //total of sum of both C IV comp 46 47 // 47 48 // >>chng 06 nov 29, from 5.394 to 5.415, Badnell DR trunk/tsuite/slow/feii_blr_n12_p19.in
r749 r793 39 39 // >>chng 05 jul 17, from 5.39 to 5.37, first run in 6 mo 40 40 // >>chng 06 aug 09, from 5.37 to 5.51 Meudon 06, Bowen change 41 assert line luminosity "totl" 1549 5.51 error 0.1 41 // >>chng 07 jan 20, from 5.51 to 5.45, e2 bug 42 assert line luminosity "totl" 1549 5.45 error 0.1 42 43 // 43 44 assert line luminosity "he 2" 1640 6.732 //total He II Balmer-alpha 1640 trunk/tsuite/slow/feii_blr_n12_p19_Z20.in
r749 r793 31 31 // 32 32 // >>chng 06 aug 09, from 5.161 to 5.255 Meudon 06, Bowen change 33 assert line luminosity "totl" 1397 5.255 //total of sum of both Si IV comp 33 // >>chng 07 jan 20, from 5.255 to 5.236, e2 bug 34 assert line luminosity "totl" 1397 5.236 //total of sum of both Si IV comp 34 35 // 35 36 // >>chng 06 aub 06, update O+2 & N+2 CT, from 2.932 to 2.978 36 37 // >>chng 06 aug 09, from 2.978 to 3.105 Meudon 06, Bowen change 37 assert line luminosity "totl" 1402 3.105 //total O IV] 1402 38 // >>chng 07 jan 20, from 3.105 to 3.076, e2 bug 39 assert line luminosity "totl" 1402 3.076 //total O IV] 1402 38 40 // 39 41 // >>chng 06 aub 06, update O+2 & N+2 CT, from 5.088 to 5.116 40 42 // >>chng 06 aug 09, from 5.116 to 5.196 Meudon 06, Bowen change 41 43 // >>chng 06 nov 29, from 5.196 to 5.146, Badnell DR 42 assert line luminosity "totl" 1549 5.146 //total of sum of both C IV comp 44 // >>chng 07 jan 20, from 5.146 to 5.108, e2 bug 45 assert line luminosity "totl" 1549 5.108 //total of sum of both C IV comp 43 46 // 44 47 // >>chng 06 aub 06, update O+2 & N+2 CT, from 6.527 to 6.494 … … 47 50 // >>chng 06 aub 06, update O+2 & N+2 CT, from 4.567 to 4.598 48 51 // >>chng 06 aug 09, from 4.597 to 4.671 Meudon 06, Bowen change 49 assert line luminosity "o 3" 1666 4.671 //total O III] 1666 52 // >>chng 07 jan 20, from 4.671 to 4.634, e2 bug 53 assert line luminosity "o 3" 1666 4.634 //total O III] 1666 50 54 // 51 55 // >>chng 06 aug 09, from 4.409 to 4.458 Meudon 06, Bowen change … … 54 58 // >>chng 05 sep 30, from 6.776 to 6.756, update charge transfer // >>chng 06 aub 06, update O+2 & N+2 CT, from 6.756 to 6.791 55 59 // >>chng 06 aug 09, from 6.691 to 6.823 Meudon 06, Bowen change 56 assert line luminosity "totl" 1888 6.823 //total of sum of Si III] 1892+ 60 // >>chng 07 jan 20, from 6.823 to 6.798, e2 bug 61 assert line luminosity "totl" 1888 6.798 //total of sum of Si III] 1892+ 57 62 // 58 63 // >>chng 06 aub 06, update O+2 & N+2 CT, from 6.220 to 6.259 trunk/tsuite/slow/feii_blr_n13_p22.in
r749 r793 37 37 // 38 38 // >>chng 06 aub 06, update O+2 & N+2 CT, from 9.554 to 9.610 39 assert line luminosity "totl" 1397 9.610 //total of sum of both Si IV comp 39 // >>chng 07 jan 20, from 9.610 to 9.593, e2 bug 40 assert line luminosity "totl" 1397 9.593 //total of sum of both Si IV comp 40 41 // 41 42 // >>chng 06 aub 06, update O+2 & N+2 CT, from 8.672 to 8.738 … … 44 45 // 45 46 // >>chng 06 aub 06, update O+2 & N+2 CT, from 9.856 to 9.900 46 assert line luminosity "totl" 1549 9.900 //total of sum of both C IV comp 47 // >>chng 07 jan 20, from 9.900 to 9.876, e2 bug 48 assert line luminosity "totl" 1549 9.876 //total of sum of both C IV comp 47 49 // 48 50 // >>chng 06 aub 06, update O+2 & N+2 CT, from 9.255 to 9.510 … … 68 70 // >>chng 06 jan 14, from 7.019 to 7.039, drift up 69 71 // >>chng 06 aub 06, update O+2 & N+2 CT, from 7.039 to 7.092 70 assert line luminosity "totl" 2326 7.092 72 // >>chng 07 jan 20, from 7.092 to 7.037, e2 bug 73 assert line luminosity "totl" 2326 7.037 71 74 // 72 75 // >>chng 06 aub 06, update O+2 & N+2 CT, from 8.985 to 9.007 … … 85 88 // 86 89 // >>chng 06 aub 06, update O+2 & N+2 CT, from 9.181 to 9.224 87 assert line luminosity "He 1" 584.3 9.224 90 // >>chng 07 jan 20, from 9.224 to 9.243, e2 bug 91 assert line luminosity "He 1" 584.3 9.243 88 92 // 89 93 // >>chng 06 aub 06, update O+2 & N+2 CT, from 9.255 to 9.510 trunk/tsuite/slow/feii_blr_n13_p22_Z20.in
r749 r793 43 43 assert line luminosity "totl" 1402 8.714 //total O IV] 1402 44 44 // 45 assert line luminosity "totl" 1549 9.763 //total of sum of both C IV comp 45 // >>chng 07 jan 20, from 9.763 to 9.740, e2 bug 46 assert line luminosity "totl" 1549 9.740 //total of sum of both C IV comp 46 47 // 47 48 //total He II Balmer-alpha 1640
