00001 /* This file is part of Cloudy and is copyright (C)1978-2007 by Gary J. Ferland 00002 * For conditions of distribution and use see copyright notice in license.txt */ 00003 /*ion_collis fill in collisional ionization rates, and resulting cooling */ 00004 #include "cddefines.h" 00005 #include "physconst.h" 00006 #include "phycon.h" 00007 #include "rfield.h" 00008 #include "heavy.h" 00009 #include "dense.h" 00010 #include "atmdat.h" 00011 #include "ionbal.h" 00012 00013 void ion_collis( 00014 /* element number on c scale, H is 0 */ 00015 long int nelem ) 00016 { 00017 long int ion, 00018 limit; 00019 double DimaRate, crate; 00020 00021 DEBUG_ENTRY( "ion_collis()" ); 00022 00023 /* compute collisional ionization rate */ 00024 00025 /* CollidRate[nelem][ion][0] is collisional ionization rate, s-1 00026 * CollidRate[nelem][ion][1] is collisional ionization cooling, erg/s 00027 */ 00028 00029 /* zero out rates below lowest ionization stage we will consider */ 00030 for( ion=0; ion < (dense.IonLow[nelem] - 1); ion++ ) 00031 { 00032 ionbal.CollIonRate_Ground[nelem][ion][0] = 0.; 00033 ionbal.CollIonRate_Ground[nelem][ion][1] = 0.; 00034 } 00035 00036 /* chng logic changed to be precisely same as ion_solver */ 00037 /* >>chng 02 nov 08, change 2 to NISO */ 00038 /*limit = MIN2(nelem-2,dense.IonHigh[nelem]-1);*/ 00039 limit = MIN2(nelem-NISO,dense.IonHigh[nelem]-1); 00040 00041 for( ion=dense.IonLow[nelem]; ion <= limit; ion++ ) 00042 { 00043 /* 00044 * collisional ionization by thermal electrons 00045 * >>chng 97 mar 19, to Dima's new routine using 00046 * >>refer all coll_ion Voronov G.S., 1997, At. Data Nucl. Data Tables 65, 1 00047 */ 00048 DimaRate = t_ADfA::Inst().coll_ion( nelem+1, nelem+1-ion , phycon.te ); 00049 00050 crate = DimaRate*dense.EdenHCorr; 00051 00052 /* total collisional ionization rate 00053 * with only thermal suprathermal electrons */ 00054 ionbal.CollIonRate_Ground[nelem][ion][0] = crate; 00055 00056 /* cooling due to collisional ionization, which only includes thermal */ 00057 ionbal.CollIonRate_Ground[nelem][ion][1] = (crate* 00058 rfield.anu[Heavy.ipHeavy[nelem][ion]-1]* EN1RYD); 00059 } 00060 00061 for( ion=dense.IonHigh[nelem]; ion <= nelem; ion++ ) 00062 { 00063 ionbal.CollIonRate_Ground[nelem][ion][0] = 0.; 00064 ionbal.CollIonRate_Ground[nelem][ion][1] = 0.; 00065 } 00066 00067 /* check not rates are negative - in release mode this loop will optimize out */ 00068 for( ion=0; ion <= nelem; ion++ ) 00069 { 00070 /* there can be no negative rates */ 00071 ASSERT( ionbal.CollIonRate_Ground[nelem][ion][0] >= 0. ); 00072 } 00073 00074 DEBUG_EXIT( "ion_collis()" ); 00075 return; 00076 }