Changeset 1838 for branches/newmole/source
- Timestamp:
- 03/09/08 16:59:05 (9 months ago)
- Location:
- branches/newmole/source
- Files:
-
- 4 modified
-
ion_solver.cpp (modified) (3 diffs)
-
iso_level.cpp (modified) (4 diffs)
-
mole_co_atom.cpp (modified) (1 diff)
-
mole_eval_balance.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/newmole/source/ion_solver.cpp
r1835 r1838 378 378 * matrix is singular */ 379 379 totsrc = 0.; 380 /*>>chng 06 nov 28 only include source from molecules if we have an estimated first 381 * solution - first test is that we have called mole at least twice, 382 * second test is that we are on a later iteration */ 383 if( conv.nTotalIoniz > 1 || iteration > 1 ) 384 { 385 386 for( i=0; i<ion_range;i++ ) 387 { 388 ion = i+ion_low; 389 390 /* these are the external source and sink terms */ 391 /* need negative sign to get positive pops */ 392 source[i] -= mole.source[nelem][ion]; 393 totsrc += mole.source[nelem][ion]; 394 MAT( xmat, i, i ) -= mole.sink[nelem][ion]; 395 } 380 381 for( i=0; i<ion_range;i++ ) 382 { 383 ion = i+ion_low; 384 385 /* these are the external source and sink terms */ 386 /* need negative sign to get positive pops */ 387 source[i] -= mole.source[nelem][ion]; 388 totsrc += mole.source[nelem][ion]; 389 MAT( xmat, i, i ) -= mole.sink[nelem][ion]; 396 390 } 397 391 … … 1030 1024 fprintf( ioQQQ, "\n" ); 1031 1025 1026 /* grain ionization - not total rate but should be dominant process */ 1027 fprintf( ioQQQ, " %s ion xfr mol " ,elementnames.chElementSym[nelem]); 1028 for( ion=0; ion < dense.IonHigh[nelem]; ion++ ) 1029 { 1030 fprintf( ioQQQ, " %9.2e", mole.xMoleChTrRate[nelem][ion][ion+1] ); 1031 } 1032 fprintf( ioQQQ, "\n" ); 1033 1032 1034 /* charge exchange ionization */ 1033 1035 fprintf( ioQQQ, " %s chr trn ion " ,elementnames.chElementSym[nelem] ); … … 1080 1082 { 1081 1083 fprintf( ioQQQ, " %9.2e", gv.GrainChTrRate[nelem][ion+1][ion] ); 1084 } 1085 fprintf( ioQQQ, "\n" ); 1086 1087 fprintf( ioQQQ, " %s rec xfr mol " ,elementnames.chElementSym[nelem]); 1088 for( ion=0; ion < dense.IonHigh[nelem]; ion++ ) 1089 { 1090 fprintf( ioQQQ, " %9.2e", mole.xMoleChTrRate[nelem][ion+1][ion] ); 1082 1091 } 1083 1092 fprintf( ioQQQ, "\n" ); -
branches/newmole/source/iso_level.cpp
r1834 r1838 71 71 /* now do the 2D array */ 72 72 z.alloc(numlevels_local,numlevels_local); 73 z.zero(); 73 74 74 75 /* >>chng 03 may 01, move defn of these two up here, before entering matrix */ … … 235 236 /* all process depopulating level and placing into the continuum 236 237 * this does NOT include grain charge transfer ionization, added below */ 237 z[level][level] = iso.RateLevel2Cont[ipISO][nelem][level];238 z[level][level] += iso.RateLevel2Cont[ipISO][nelem][level]; 238 239 239 240 if( ipISO == ipHE_LIKE && level == ipHe2s3S ) … … 271 272 272 273 z[ipLo][ipLo] += coll_up + pump ; 273 z[ipLo][level] = - ( coll_up + pump );274 z[ipLo][level] -= coll_up + pump ; 274 275 275 276 double pump_down = pump * … … 278 279 279 280 z[level][level] += RadDecay + pump_down + coll_down; 280 z[level][ipLo] = - (RadDecay + pump_down + coll_down);281 z[level][ipLo] -= RadDecay + pump_down + coll_down; 281 282 282 283 if( ipISO == ipHE_LIKE ) -
branches/newmole/source/mole_co_atom.cpp
r1780 r1838 333 333 (*Rotate)[j].Emis->ColOvTot = 0.0; 334 334 else 335 (*Rotate)[j].Emis->ColOvTot = (realnum)(CollRate[j][j+1]/ (CollRate[j][j+1]+(*Rotate)[j].Emis->pump) );335 (*Rotate)[j].Emis->ColOvTot = (realnum)(CollRate[j][j+1]/SDIV(CollRate[j][j+1]+(*Rotate)[j].Emis->pump) ); 336 336 337 337 /* two cases - collisionally excited (usual case) or -
branches/newmole/source/mole_eval_balance.cpp
r1836 r1838 94 94 95 95 for(i=0;i<rate->nreactants;i++) 96 { 96 { 97 sp = rate->reactants[i]; 97 98 if (rate->rvector[i] == NULL) 98 99 { 99 sp = rate->reactants[i];100 100 mole.zone[sp->index].snk += rate_deriv[i]; 101 101 if (sp == debug_species) … … 112 112 for( nelem=0; nelem< LIMELM; ++nelem ) 113 113 { 114 if ( rate->reactants[i]->nElem[nelem] != 0)114 if (sp->nElem[nelem] != 0) 115 115 { 116 mole.xMoleChTrRate[nelem][ rate->reactants[i]->charge][rate->rvector[i]->charge] += rate_deriv[i];116 mole.xMoleChTrRate[nelem][sp->charge][rate->rvector[i]->charge] += rate_deriv[i]; 117 117 break; 118 118 } … … 123 123 for(i=0;i<rate->nproducts;i++) 124 124 { 125 sp = rate->products[i]; 125 126 if (rate->pvector[i] == NULL) 126 127 { 127 sp = rate->products[i];128 128 mole.zone[sp->index].src += rate_tot; 129 129 if (sp == debug_species)
