Changeset 2034 for branches/c08_branch/source/iso_ionize_recombine.cpp
- Timestamp:
- 05/10/08 09:03:02 (6 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/c08_branch/source/iso_ionize_recombine.cpp
r1822 r2034 143 143 iso.RateLevel2Cont[ipISO][nelem][level] = iso.gamnc[ipISO][nelem][level] + 144 144 iso.ColIoniz[ipISO][nelem][level]* dense.EdenHCorr + 145 /* >>chng 04 nov 30, also turn off cr ionization with atom h-like collisions off */ 146 /* >>chng 05 aug 17, do not turn off cosmic rays with no collisional ionization 147 * simply leave out crs if this is desired - this allows leiden hacks to work */ 148 secondaries.csupra[nelem][nelem-ipISO]/* *iso.lgColl_ionize[ipISO]*/; 145 secondaries.csupra[nelem][nelem-ipISO]*iso.lgColl_ionize[ipISO]; 149 146 150 147 /* all processes from continuum to level n, units s-1 */ … … 166 163 } 167 164 168 /* all following go into or out of ground state */169 level = 0;170 171 165 /* now charge transfer - all into/from ground, two cases, H and not H */ 172 166 if( nelem==ipHYDROGEN ) … … 174 168 /* charge transfer, hydrogen onto everything else */ 175 169 /* charge exchange ionization, these come out of every level */ 176 for( level= ipH1s; level< iso.numLevels_local[ipISO][nelem]; ++level)170 for( level=0; level< iso.numLevels_local[ipISO][nelem]; ++level) 177 171 { 178 172 iso.RateLevel2Cont[ipISO][nelem][level] += atmdat.HCharExcIonTotal; 179 173 } 180 174 /* charge exchange recombination */ 181 iso.RateCont2Level[ipISO][nelem][ ipH1s] += atmdat.HCharExcRecTotal;175 iso.RateCont2Level[ipISO][nelem][0] += atmdat.HCharExcRecTotal; 182 176 } 183 177 else if( nelem==ipHELIUM && ipISO==ipHE_LIKE ) … … 228 222 Recom3Body = 0.; 229 223 /* >>chng 06 jul 20, level should go to numLevels_local instead of numLevels_max */ 230 for( level= ipH1s; level< iso.numLevels_local[ipISO][nelem]; ++level)224 for( level=0; level< iso.numLevels_local[ipISO][nelem]; ++level) 231 225 { 232 226 … … 238 232 ionbal.RR_rate_coef_used[nelem][nelem-ipISO] += iso.RadRecomb[ipISO][nelem][level][ipRecRad]* 239 233 iso.RadRecomb[ipISO][nelem][level][ipRecNetEsc]; 240 /*if( nelem==ipHELIUM && ipISO==ipH_LIKE )241 fprintf(ioQQQ,"DEBUG rad rec %li %.4e %.4e\n",242 level,243 iso.RadRecomb[ipISO][nelem][level][ipRecRad],244 iso.RadRecomb[ipISO][nelem][level][ipRecNetEsc]);*/245 234 246 235 /* >>chng 05 jul 11, from > to >=, some very opt thick sims did block escape to zero */ … … 251 240 Recom3Body += iso.ColIoniz[ipISO][nelem][level]*dense.EdenHCorr*iso.PopLTE[ipISO][nelem][level]; 252 241 } 253 /*if( nelem==ipHELIUM && ipISO==ipH_LIKE )254 fprintf(ioQQQ,"DEBUG rad rec %.4e\n",ionbal.RR_rate_coef_used[nelem][nelem-ipISO]);*/255 242 256 243 /* fraction of total recombs due to three body - when most are due to this … … 262 249 if( ionbal.RateRecomTot[nelem][nelem-ipISO] > 0. ) 263 250 { 264 # if 0 265 /* >>chng 06 jul 23, this was a temporary hack to force the lot T solver, which forces the 266 * atom to agree with iso.xIonSimple, to synch up with full solln from matrix - this caused 267 * many problems since using ionbal.RateIonizTot includes excited level ionization processes 268 * so matrix soln was called rather than simple. this cause neg pops in ~half a dozen sims */ 269 if( ionbal.RateIonizTot[nelem][nelem-ipISO] >= 0. ) 270 { 271 /* >>chng 06 jul 21, use effective rate, which includes ioniz from excited states, if defined */ 272 iso.xIonSimple[ipISO][nelem] = ionbal.RateIonizTot[nelem][nelem-ipISO]/ionbal.RateRecomTot[nelem][nelem-ipISO]; 273 } 274 else 275 # endif 276 { 277 iso.xIonSimple[ipISO][nelem] = iso.RateLevel2Cont[ipISO][nelem][ipH1s]/ionbal.RateRecomTot[nelem][nelem-ipISO]; 278 } 279 /*fprintf(ioQQQ,"DEBUG iso ion rec %li %li ion %.2e ioniztot %.2e \n" , 280 ipISO, nelem , 281 iso.RateLevel2Cont[ipISO][nelem][ipH1s] , 282 ionbal.RateIonizTot[nelem][nelem-ipISO] );*/ 251 iso.xIonSimple[ipISO][nelem] = iso.RateLevel2Cont[ipISO][nelem][ipH1s]/ionbal.RateRecomTot[nelem][nelem-ipISO]; 283 252 } 284 253 else … … 290 259 { 291 260 fprintf( ioQQQ, " iso_ionize_recombine iso=%2ld Z=%2ld Level2Cont[0] %10.2e RateRecomTot %10.2e xIonSimple %10.2e\n", 292 ipISO, nelem, iso.RateLevel2Cont[ipISO][nelem][ ipH1s], ionbal.RateRecomTot[nelem][nelem-ipISO], iso.xIonSimple[ipISO][nelem] );261 ipISO, nelem, iso.RateLevel2Cont[ipISO][nelem][0], ionbal.RateRecomTot[nelem][nelem-ipISO], iso.xIonSimple[ipISO][nelem] ); 293 262 } 294 263
