cloudy  trunk
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion_potas.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2008 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 /*IonPotas compute ionization equilibrium for Potassium */
4 #include "cddefines.h"
5 #include "dense.h"
6 #include "ionbal.h"
7 
8 void IonPotas(void)
9 {
10  const int NDIM = ipPOTASSIUM+1;
11 
12  static const double dicoef[2][NDIM] = {
13  {3.28e-4,.0584,.122,.132,.133,.126,.139,.0955,.0402,.0419,.0257,
14  .0445,.0548,.0713,.0903,.110,.0205,.549,0.},
15  {.0907,.110,.0174,.132,.114,.162,.0878,.263,.0627,.0616,2.77,2.23,
16  2.00,1.82,.424,.243,.185,.292,0.}
17  };
18  static const double dite[2][NDIM] = {
19  {3.46e4,3.84e5,4.08e5,3.82e5,3.53e5,3.19e5,3.22e5,2.47e5,2.29e5,
20  3.73e6,9.26e5,7.96e5,6.90e5,6.70e5,4.72e5,5.67e5,4.21e5,3.65e7,0.},
21  {1.64e4,2.45e5,4.27e5,6.92e5,8.78e5,7.43e5,6.99e5,4.43e5,2.81e5,
22  5.84e6,4.89e6,4.62e6,4.52e6,3.32e6,1.37e6,4.41e6,2.27e6,7.25e6,0.}
23  };
24  static const double ditcrt[NDIM] = {6e3,2e4,4e4,5e4,7e4,8e4,8e4,3e4,
25  3e4,3e4,3e4,9e4,4e4,5e4,3e4,9e5,2e5,2e5,1e20};
26  static const double aa[NDIM] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
27  static const double bb[NDIM] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
28  static const double cc[NDIM] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
29  static const double dd[NDIM] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
30  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.};
31 
32  DEBUG_ENTRY( "IonPotas()" );
33 
34  /* potassium nelem=19
35  * rec data from calcium
36  *
37  * rates from Shull and van Steenberg, Ap.J. Sup 48, 95. */
38 
39  /* rates from Shull and van Steenberg, Ap.J. Sup 48, 95. */
40  /* Pequignot and Aldrovandi Ast Ap 161, 169. */
41 
42  if( !dense.lgElmtOn[ipPOTASSIUM] )
43  {
44  return;
45  }
46 
48 
49  ion_photo(ipPOTASSIUM,false);
50 
51  /* find collisional ionization rates */
53 
54  /* get recombination coefficients */
55  ion_recomb(false,(const double*)dicoef,(const double*)dite,ditcrt,aa,bb,cc,dd,ff,ipPOTASSIUM);
56 
57  /* >>chng 03 nov 02, rm pl and rec components, were old */
58 # if 0
59  /* correct low temp rad rec coef */
60  if( phycon.te < 1e3 )
61  {
62  ionbal.RateRecomTot[ipPOTASSIUM][1] += ((5.49e-10*(pow(phycon.te,-0.647f)) -
63  rec[1]*(pow((double)phycon.te,pl[1])))*dense.eden);
64  }
65 # endif
66 
67  /* solve for ionization balance */
68  ion_solver(ipPOTASSIUM,false);
69  return;
70 }

Generated for cloudy by doxygen 1.8.3.1