cloudy
trunk
|
00001 /* This file is part of Cloudy and is copyright (C)1978-2008 by Gary J. Ferland and 00002 * others. For conditions of distribution and use see copyright notice in license.txt */ 00003 /*IonCalci perform ionization balance for calcium */ 00004 #include "cddefines.h" 00005 #include "dense.h" 00006 #include "ca.h" 00007 #include "ionbal.h" 00008 00009 void IonCalci(void) 00010 { 00011 const int NDIM = ipCALCIUM+1; 00012 00013 static const double dicoef[2][NDIM] = { 00014 {3.28e-4,.0584,.122,.132,.133,.126,.139,.0955,.0402,.0419,.0257, 00015 .0445,.0548,.0713,.0903,.110,.0205,.549,.355,0.}, 00016 {.0907,.110,.0174,.132,.114,.162,.0878,.263,.0627,.0616,2.77,2.23, 00017 2.00,1.82,.424,.243,.185,.292,.275,0.} 00018 }; 00019 static const double dite[2][NDIM] = { 00020 {3.46e4,3.84e5,4.08e5,3.82e5,3.53e5,3.19e5,3.22e5,2.47e5,2.29e5,3.73e6, 00021 9.26e5,7.96e5,6.90e5,6.70e5,4.72e5,5.67e5,4.21e5,3.65e7,3.78e7,0.}, 00022 {1.64e4,2.45e5,4.27e5,6.92e5,8.78e5,7.43e5,6.99e5,4.43e5,2.81e5,5.84e6, 00023 4.89e6,4.62e6,4.52e6,3.32e6,1.37e6,4.41e6,2.27e6,7.25e6,7.68e6,0.} 00024 }; 00025 static const double ditcrt[NDIM] = {6e3,2e4,4e4,5e4,7e4,8e4,8e4,3e4, 00026 3e4,3e4,3e4,9e4,4e4,5e4,3e4,9e5,2e5,2e5,2e5,1e20}; 00027 static const double aa[NDIM] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.}; 00028 static const double bb[NDIM] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.}; 00029 static const double cc[NDIM] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.}; 00030 static const double dd[NDIM] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.}; 00031 static const double ff[NDIM] = {0.,0.1,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.}; 00032 00033 DEBUG_ENTRY( "IonCalci()" ); 00034 00035 /* calcium nelem=20 00036 * 00037 * rates from Shull and van Steenberg, Ap.J. Sup 48, 95. */ 00038 00039 /* rates from Shull and van Steenberg, Ap.J. Sup 48, 95. */ 00040 /* Pequignot and Aldrovandi Ast Ap 161, 169. */ 00041 00042 if( !dense.lgElmtOn[ipCALCIUM] ) 00043 { 00044 return; 00045 } 00046 00047 ion_zero(ipCALCIUM); 00048 00049 /* last par is option to print info about photo rates */ 00050 ion_photo(ipCALCIUM,false); 00051 00052 /* >>chng 01 feb 08, had put into charge tranfer array, move to photo array where it 00053 * should have been all along */ 00054 /* Ly-alpha photoionization of Ca+ 00055 * valence shell is reevaluated by ion_photo on every call, so this does not double count */ 00056 long ns = 6, ion = 1, nelem = 19; 00057 ionbal.PhotoRate_Shell[nelem][ion][ns][0] += ca.dstCala; 00058 00059 /* find collisional ionization rates */ 00060 ion_collis(ipCALCIUM); 00061 00062 /* get recombination coefficients */ 00063 ion_recomb(false,(const double*)dicoef,(const double*)dite,ditcrt,aa,bb,cc,dd,ff,ipCALCIUM); 00064 00065 /* >>chng 03 nov 02, rm pl and rec components, were old */ 00066 # if 0 00067 /* correct low temp rad rec coef */ 00068 if( phycon.te < 1e3 ) 00069 { 00070 ionbal.RateRecomTot[ipCALCIUM][1] += ((5.49e-10*(pow(phycon.te,-0.647f)) - 00071 rec[1]*(pow((double)phycon.te,pl[1])))*dense.eden); 00072 } 00073 # endif 00074 00075 /* solve for ionization balance */ 00076 ion_solver(ipCALCIUM,false); 00077 return; 00078 }