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 /*IonPotas compute ionization equilibrium for Potassium */ 00004 #include "cddefines.h" 00005 #include "dense.h" 00006 #include "ionbal.h" 00007 00008 void IonPotas(void) 00009 { 00010 const int NDIM = ipPOTASSIUM+1; 00011 00012 static const double dicoef[2][NDIM] = { 00013 {3.28e-4,.0584,.122,.132,.133,.126,.139,.0955,.0402,.0419,.0257, 00014 .0445,.0548,.0713,.0903,.110,.0205,.549,0.}, 00015 {.0907,.110,.0174,.132,.114,.162,.0878,.263,.0627,.0616,2.77,2.23, 00016 2.00,1.82,.424,.243,.185,.292,0.} 00017 }; 00018 static const double dite[2][NDIM] = { 00019 {3.46e4,3.84e5,4.08e5,3.82e5,3.53e5,3.19e5,3.22e5,2.47e5,2.29e5, 00020 3.73e6,9.26e5,7.96e5,6.90e5,6.70e5,4.72e5,5.67e5,4.21e5,3.65e7,0.}, 00021 {1.64e4,2.45e5,4.27e5,6.92e5,8.78e5,7.43e5,6.99e5,4.43e5,2.81e5, 00022 5.84e6,4.89e6,4.62e6,4.52e6,3.32e6,1.37e6,4.41e6,2.27e6,7.25e6,0.} 00023 }; 00024 static const double ditcrt[NDIM] = {6e3,2e4,4e4,5e4,7e4,8e4,8e4,3e4, 00025 3e4,3e4,3e4,9e4,4e4,5e4,3e4,9e5,2e5,2e5,1e20}; 00026 static const double aa[NDIM] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.}; 00027 static const double bb[NDIM] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.}; 00028 static const double cc[NDIM] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.}; 00029 static const double dd[NDIM] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.}; 00030 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.}; 00031 00032 DEBUG_ENTRY( "IonPotas()" ); 00033 00034 /* potassium nelem=19 00035 * rec data from calcium 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[ipPOTASSIUM] ) 00043 { 00044 return; 00045 } 00046 00047 ion_zero(ipPOTASSIUM); 00048 00049 ion_photo(ipPOTASSIUM,false); 00050 00051 /* find collisional ionization rates */ 00052 ion_collis(ipPOTASSIUM); 00053 00054 /* get recombination coefficients */ 00055 ion_recomb(false,(const double*)dicoef,(const double*)dite,ditcrt,aa,bb,cc,dd,ff,ipPOTASSIUM); 00056 00057 /* >>chng 03 nov 02, rm pl and rec components, were old */ 00058 # if 0 00059 /* correct low temp rad rec coef */ 00060 if( phycon.te < 1e3 ) 00061 { 00062 ionbal.RateRecomTot[ipPOTASSIUM][1] += ((5.49e-10*(pow(phycon.te,-0.647f)) - 00063 rec[1]*(pow((double)phycon.te,pl[1])))*dense.eden); 00064 } 00065 # endif 00066 00067 /* solve for ionization balance */ 00068 ion_solver(ipPOTASSIUM,false); 00069 return; 00070 }