Changeset 2107
- Timestamp:
- 06/11/08 02:41:14 (3 months ago)
- Location:
- trunk
- Files:
-
- 5 modified
-
source/ion_solver.cpp (modified) (2 diffs)
-
source/iso.h (modified) (1 diff)
-
source/iso_ionize_recombine.cpp (modified) (1 diff)
-
source/iso_level.cpp (modified) (5 diffs)
-
tsuite/auto/grid_line_ratios.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/ion_solver.cpp
r2085 r2107 600 600 { 601 601 /* option to print matrix */ 602 /*@-redef@*/603 602 enum {DEBUG_LOC=false}; 604 /*@+redef@*/605 603 if( DEBUG_LOC && nzone==1 && lgPrintIt ) 606 604 { … … 740 738 741 739 { 742 /*@-redef@*/743 740 /* this is to debug following failed assert */ 744 741 enum {DEBUG_LOC=false}; 745 /*@+redef@*/746 742 if( DEBUG_LOC && nelem == ipHYDROGEN ) 747 743 { -
trunk/source/iso.h
r1969 r2107 254 254 multi_arr<double,3> xIsoLevNIonRyd; 255 255 256 /** the ratio fully stripped ion to atom for all hydrogenicspecies257 * HIonSimple is simple estimate, should agree at low density */256 /** the ratio of ion to atom for all iso species 257 * xIonSimple is simple estimate, should agree at low density */ 258 258 double xIonSimple[NISO][LIMELM]; 259 259 -
trunk/source/iso_ionize_recombine.cpp
r1937 r2107 241 241 } 242 242 243 /* fraction of total recomb s due to three body - when most are due to this244 * small changes in temperature can produce large changes in rec coef,243 /* fraction of total recombinations due to three body - when most are due to this 244 * small changes in temperature can produce large changes in recombination coefficient, 245 245 * and so in ionization */ 246 246 iso.RecomCollisFrac[ipISO][nelem] = Recom3Body* dense.eden / ionbal.RateRecomTot[nelem][nelem-ipISO]; 247 247 248 /* get simple estimate of level of ionization*/248 /* get simple estimate of atom to ion ratio */ 249 249 if( ionbal.RateRecomTot[nelem][nelem-ipISO] > 0. ) 250 250 { -
trunk/source/iso_level.cpp
r2099 r2107 11 11 #include "grainvar.h" 12 12 #include "he.h" 13 #include "heavy.h"14 13 #include "helike.h" 15 14 #include "hydrogenic.h" … … 24 23 #include "thirdparty.h" 25 24 #include "trace.h" 26 #include "yield.h"27 25 28 26 /* solve for level populations */ … … 90 88 91 89 /* these two collision rates must be the same or we are in big trouble, 92 * since used interchang eably */90 * since used interchangably */ 93 91 ASSERT( ionbal.CollIonRate_Ground[nelem][nelem-ipISO][0]< SMALLFLOAT || 94 92 fabs( iso.ColIoniz[ipISO][nelem][0]* collider / … … 375 373 #endif 376 374 375 /* derive source/sink terms for ion/rec terms coupling resolved atoms 376 * to lower ionization stages */ 377 377 if( nelem-ipISO >= 1 && ionbal.RateIonizTot[nelem][nelem-ipISO-1] > 0.) 378 378 { 379 double sum_recom =0. , sum_ioniz = 0.; 380 sum_popn_ov_ion = 0.; 381 /* if lower stage of ionization is itself resolved then we must 382 * sum over rates between levels and its continuum, the ion we 383 * are now solving */ 384 if( ipISO+1<NISO ) 385 { 386 for( level=0; level < iso.numLevels_local[ipISO+1][nelem]; level++ ) 387 { 388 sum_popn_ov_ion += StatesElem[ipISO+1][nelem][level].Pop; 389 390 /* sum of all ionization processes from levels to ion we 391 * now consider - use difference in ionization / recombination 392 * since at high densities each of these terms are very 393 * large but nearly cancel */ 394 double one = iso.RateCont2Level[ipISO+1][nelem][level] - 395 StatesElem[ipISO+1][nelem][level].Pop * 396 iso.RateLevel2Cont[ipISO+1][nelem][level]; 397 398 /* sign determines whether this is net ionization or 399 * recombination process. Ground & metastable states have 400 * large departure coefficients so are net ionization, 401 * excited states have departure coefficients that 402 * asymptotically approach unity from below, so are net 403 * recombination */ 404 if( one > 0 ) 405 sum_recom += one; 406 else 407 sum_ioniz -= one; 408 } 409 ASSERT( sum_recom>=0. && sum_ioniz>=0. ); 410 sum_ioniz /= MAX2(SMALLDOUBLE , sum_popn_ov_ion); 411 } 412 else 413 { 414 /* lower stage is not resolved */ 415 sum_ioniz = ionbal.RateIonizTot[nelem][nelem-ipISO-1]; 416 sum_recom = ionbal.RateRecomTot[nelem][nelem-ipISO-1]; 417 } 379 418 /* now add ionization from next lower stage */ 380 source += ionbal.RateIonizTot[nelem][nelem-ipISO-1]*419 source += sum_ioniz* 381 420 dense.xIonDense[nelem][nelem-ipISO-1]; 382 421 383 /* now add recombination to next lower stage ground*/384 sink += ionbal.RateRecomTot[nelem][nelem-ipISO-1];385 } 386 422 /* now add recombination to next lower stage, units are s-1 */ 423 sink += sum_recom; 424 } 425 387 426 creation[0] += source/SDIV(dense.xIonDense[nelem][nelem+1-ipISO]); 388 389 427 for( level=0; level < numlevels_local; level++ ) 390 428 { … … 577 615 578 616 /* all solvers end up here */ 579 /* sum_popn_ov_ion will become the ratio of iso to parent 617 618 /* sum_popn_ov_ion will become the ratio of this atom to parent 580 619 * species, create sum of level pops per ion first */ 581 620 sum_popn_ov_ion = 0.; 582 621 583 /* this is total ionization of this species referenced to the ground state */ 622 /* this is total ionization rate, s-1, of this species referenced to 623 * the total abundance */ 584 624 ionbal.RateIonizTot[nelem][nelem-ipISO] = 0.; 585 586 625 for( level=0; level < numlevels_local; level++ ) 587 626 { -
trunk/tsuite/auto/grid_line_ratios.in
r1864 r2107 2 2 c 3 3 c commands controlling continuum ===== 4 blackbody 4 e4K4 blackbody 40,000K 5 5 ionization parameter -2 6 6 c
