Changeset 1804 for branches/newmole/source
- Timestamp:
- 02/19/08 15:23:09 (9 months ago)
- Location:
- branches/newmole/source
- Files:
-
- 3 modified
-
ion_solver.cpp (modified) (1 diff)
-
iso_ionize_recombine.cpp (modified) (3 diffs)
-
iso_level.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/newmole/source/ion_solver.cpp
r1780 r1804 246 246 low = dense.IonLow[nelem]; 247 247 248 for( ion_to=low; ion_to <= limit; ion_to++ )248 for( ion_to=low; ion_to <= dense.IonHigh[nelem]; ion_to++ ) 249 249 { 250 250 for( ion_from=dense.IonLow[nelem]; ion_from <= dense.IonHigh[nelem]; ++ion_from ) -
branches/newmole/source/iso_ionize_recombine.cpp
r1800 r1804 7 7 #include "atmdat.h" 8 8 #include "dense.h" 9 #include "grainvar.h"10 9 #include "hmi.h" 11 10 #include "mole.h" … … 115 114 long int nelem ) 116 115 { 117 long int level, 118 ion; 119 double Recom3Body, 120 sum; 116 long int level; 117 double Recom3Body; 121 118 122 119 DEBUG_ENTRY( "iso_ionize_recombine()" ); … … 167 164 /* all following go into or out of ground state */ 168 165 level = 0; 169 170 /* grain charge transfer recombination and ionization,171 * assume goes into and comes from ground state */172 /* first grain surface losses - both to lower and higher stages of ionization */173 sum = 0.;174 for(ion=0; ion<nelem+1; ++ion )175 if( ion!=nelem-ipISO )176 sum += gv.GrainChTrRate[nelem][nelem-ipISO][ion];177 /*>>chng 04 sep 08, replaced grain ct rate from old sum with current sum */178 iso.RateLevel2Cont[ipISO][nelem][level] += sum;179 180 /* >>chng 04 apr 10, add formally correct grain surface ionization and recombination -181 * this HAD NOT been included for H-like species */182 /* >>chng 04 sep 08, use explicit term from higher stage of ionization - note that added183 * GrainCreat[nelem][nelem-ipISO] for case of atomic He incorrectly added two-stage recombination184 * to existing matrix logic */185 /*iso.RateCont2Level[ipISO][nelem][level] += ionbal.GrainCreat[nelem][nelem-ipISO];*/186 iso.RateCont2Level[ipISO][nelem][level] += gv.GrainChTrRate[nelem][nelem+1-ipISO][nelem-ipISO];187 188 for(ion=0; ion<nelem+1; ++ion)189 if ( ion < nelem-ipISO )190 iso.RateLevel2Cont[ipISO][nelem][level] += mole.xMoleChTrRate[nelem][nelem-ipISO][ion];191 else if ( ion > nelem-ipISO )192 iso.RateCont2Level[ipISO][nelem][level] += mole.xMoleChTrRate[nelem][ion][nelem-ipISO];193 166 194 167 /* now charge transfer - all into/from ground, two cases, H and not H */ -
branches/newmole/source/iso_level.cpp
r1800 r1804 9 9 #include "dynamics.h" 10 10 #include "elementnames.h" 11 #include "grainvar.h" 11 12 #include "he.h" 12 13 #include "helike.h" … … 246 247 { 247 248 /* all process depopulating level and placing into the continuum 248 * this includes grain charge transfer ionization*/249 * this does NOT include grain charge transfer ionization, added below */ 249 250 z[level][level] = iso.RateLevel2Cont[ipISO][nelem][level]; 250 251 251 252 if( ipISO == ipHE_LIKE && level == ipHe2s3S ) 252 253 /* >>chng 05 dec 21, rm eden to make into rate coefficient */ … … 353 354 z[1+ipISO][1+ipISO] += iso.TwoNu_induc_dn[ipISO][nelem]*iso.lgInd2nu_On; 354 355 356 /* grain charge transfer recombination and ionization to ALL other stages */ 357 for( long ion=0; ion<=nelem+1; ++ion ) 358 { 359 if( ion!=nelem-ipISO ) 360 { 361 /* recombination must be multiplied by a ratio of densities to get proper rate. */ 362 creation[0] += gv.GrainChTrRate[nelem][ion][nelem-ipISO] * 363 dense.xIonDense[nelem][ion] / SDIV(dense.xIonDense[nelem][nelem+1-ipISO]); 364 z[0][0] += gv.GrainChTrRate[nelem][nelem-ipISO][ion]; 365 } 366 } 367 355 368 /* >>chng 02 Sep 06 rjrw -- all elements have these terms */ 356 369 /*>>>chng 02 oct 01, only include if lgAdvection is set */ … … 372 385 373 386 /* add in source and sink terms from molecular network. */ 374 if( nelem == ipISO && conv.nTotalIoniz ) 375 { 376 /* these are the external source and sink terms */ 377 /* source first */ 387 if( conv.nTotalIoniz && nelem-ipISO < N_MOLE_ION) 388 { 378 389 creation[0] += mole.source[nelem][nelem-ipISO]/SDIV(dense.xIonDense[nelem][nelem+1-ipISO]); 379 380 390 for( ipLo=0; ipLo<numlevels_local; ++ipLo ) 381 391 { 382 392 z[ipLo][ipLo] += mole.sink[nelem][nelem-ipISO]; 393 } 394 395 for( long ion=0; ion<N_MOLE_ION; ++ion ) 396 { 397 if( ion!=nelem-ipISO && ion < nelem+1 ) 398 { 399 /* recombination must be multiplied by a ratio of densities to get proper rate. */ 400 creation[0] += mole.xMoleChTrRate[nelem][ion][nelem-ipISO] * 401 dense.xIonDense[nelem][ion] / SDIV(dense.xIonDense[nelem][nelem+1-ipISO]); 402 for( ipLo=0; ipLo<numlevels_local; ++ipLo ) 403 { 404 z[ipLo][ipLo] += mole.xMoleChTrRate[nelem][nelem-ipISO][ion]; 405 } 406 } 383 407 } 384 408 }
