cloudy  trunk
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion_silic.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 /*IonSilic determine ionization balance of Silicon */
4 #include "cddefines.h"
5 #include "dense.h"
6 #include "ionbal.h"
7 
8 void IonSilic(void)
9 {
10  const int NDIM = ipSILICON+1;
11 
12  static const double dicoef[2][NDIM] = {
13  {1.10e-3,5.87e-3,5.03e-3,5.43e-3,8.86e-3,1.68e-2,2.49e-2,3.13e-2,
14  4.25e-2,6.18e-2,1.38e-2,.327,.189,0.},
15  {0.,.753,.188,.450,0.,1.80,1.88,2.01,1.22,.303,1.42,.306,.286,0.}
16  };
17  static const double dite[2][NDIM] = {
18  {7.70e4,9.63e4,8.75e4,1.05e6,1.14e6,4.85e5,4.15e5,3.66e5,3.63e5,
19  3.88e5,2.51e5,1.88e7,1.99e7,0.},
20  {0.,6.46e4,4.71e4,7.98e5,0.,1.03e6,1.91e6,2.11e6,2.14e6,1.12e6,
21  3.93e6,3.60e6,4.14e6,0.}
22  };
23  static const double ditcrt[NDIM] = {1.1e4,1.1e4,1.1e4,1.7e5,9.5e4,8.0e4,
24  7.4e4,6.8e4,6.6e4,6.5e4,4.5e4,3.7e6,6.3e6,1e20};
25  static const double aa[NDIM] = {-0.0219,3.2163,0.1203,0.,0.,0.,0.,0.,
26  0.,0.,0.,0.,0.,0.};
27  static const double bb[NDIM] = {0.4364,-12.0571,-2.6900,0.,0.,0.,0.,
28  0.,0.,0.,0.,0.,0.,0.};
29  static const double cc[NDIM] = {0.0684,16.2118,19.1943,0.,0.,0.,0.,
30  0.,0.,0.,0.,0.,0.,0.};
31  static const double dd[NDIM] = {-0.0032,-0.5886,-0.1479,0.,0.,0.,0.,
32  0.,0.,0.,0.,0.,0.,0.};
33  static const double ff[NDIM] = {0.1342,0.5613,0.1118,0.1,0.,0.,0.,0.,
34  0.,0.,0.,0.,0.,0.};
35 
36  bool lgPrtDebug=false;
37 
38  DEBUG_ENTRY( "IonSilic()" );
39 
40  /* silicon, atomic number 14 */
41  if( !dense.lgElmtOn[ipSILICON] )
42  return;
43 
45 
46  ion_photo(ipSILICON,false);
47 
48 # if 0
49  static long nzUsed = -1;
50  static double OldRate = 0.;
51 
52  /* 2008 apr 18, this appears to try to damp out changes in the valence
53  * shell photo rate - perhaps due to Lya oscillations in dust free
54  * environments? */
55  if( nzone > 1 && OldRate > 0. )
56  {
57  if( nzone != nzUsed )
58  {
59  ionbal.PhotoRate_Shell[ipSILICON][0][4][0] =
60  (ionbal.PhotoRate_Shell[ipSILICON][0][4][0] + OldRate)/2.;
61  nzUsed = nzone;
62  }
63  else
64  {
65  ionbal.PhotoRate_Shell[ipSILICON][0][4][0] = OldRate;
66  }
67  }
68  OldRate = ionbal.PhotoRate_Shell[ipSILICON][0][4][0];
69 # endif
70 
71  /* find collisional ionization rates */
73 
74  /* get recombination coefficients */
75  /*lint -e64 type mismatch */
76  ion_recomb(false,(const double*)dicoef,(const double*)dite,ditcrt,aa,bb,cc,dd,ff,ipSILICON);
77  /*lint +e64 type mismatch */
78 
79  /* solve for ionization balance */
80  /*if( nzone>700 ) lgPrtDebug = true;*/
81  ion_solver(ipSILICON,lgPrtDebug);
82 
83 # if 0
84  /* 2008 apr 18, this is all dead code from when co network fed back from
85  * the ionization */
86  if( trace.lgTrace && trace.lgHeavyBug )
87  {
88  fprintf( ioQQQ, " silicon\t%.2f",fnzone );
89  for( int i=0; i <= 10; i++ )
90  {
91  fprintf( ioQQQ, "\t%.3e", dense.xIonDense[ipSILICON][i]);
92  }
93  fprintf( ioQQQ, "\n" );
94  }
95  fprintf( ioQQQ, "DEBUG silicon\t%.2f",fnzone );
96  for( i=0; i < 2; i++ )
97  {
98  fprintf( ioQQQ, "\t%.3e", dense.xIonDense[ipSILICON][i]/dense.gas_phase[ipSILICON]);
99  }
100  fprintf( ioQQQ, "\t%.3e", co.hevmol[ipATSI]/SDIV(co.hevmol[ipSIP]));
101  fprintf( ioQQQ, "\t%.3e", ionbal.RateIonizTot[ipSILICON][0]);
102  fprintf( ioQQQ, "\t%.3e", dense.gas_phase[ipHYDROGEN] );
103  {
104 # include "grainvar.h"
105  fprintf( ioQQQ, "\t%.3e", gv.GrainChTrRate[ipSILICON][1][0] );
106  }
107  fprintf( ioQQQ, "\n" );
108 # endif
109  return;
110 }

Generated for cloudy by doxygen 1.8.1.1