cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion_nelem.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2017 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 /*IonNelem ionization balance for elements without special cases */
4 #include "cddefines.h"
5 #include "trace.h"
6 #include "ionbal.h"
7 #include "dense.h"
8 
9 void IonNelem(
10  /* this is debug flag */
11  bool lgPrintIt,
12  /* nelem is the atomic number on the C scale, 0 for H */
13  long int nelem)
14 {
15  DEBUG_ENTRY( "IonNelem()" );
16 
17  if( dense.lgElmtOn[nelem] )
18  {
19  ion_zero(nelem);
20 
21  ion_photo(nelem,lgPrintIt);
22 
23  // collisional ionization rates
24  ion_collis(nelem);
25 
26  // charge exchange
27  ion_CX( nelem );
28 
29  // total recombination
30  ion_recomb(lgPrintIt,nelem);
31 
32  /* solve for ionization balance */
33  ion_solver(nelem,lgPrintIt);
34 
35  if( trace.lgTrace && trace.lgHeavyBug /*|| nelem==ipNICKEL*/ )
36  {
37  fprintf( ioQQQ, " IonNelem nelem\t%li\tfnzone\t%6.2f\tfrac\t",
38  nelem, fnzone );
39  for( int i=0; i < nelem+2; i++ )
40  {
41  fprintf( ioQQQ, "\t%10.3e", dense.xIonDense[nelem][i]/
42  dense.gas_phase[nelem] );
43  }
44  fprintf( ioQQQ, "\n" );
45  }
46  }
47 
48  return;
49 }
bool lgHeavyBug
Definition: trace.h:21
void ion_solver(long int nelem, bool lgPrintIt)
Definition: ion_solver.cpp:59
FILE * ioQQQ
Definition: cddefines.cpp:7
void IonNelem(bool lgPrintIt, long int nelem)
Definition: ion_nelem.cpp:9
t_dense dense
Definition: global.cpp:15
double xIonDense[LIMELM][LIMELM+1]
Definition: dense.h:135
void ion_zero(long int nelem)
Definition: ion_zero.cpp:8
t_trace trace
Definition: trace.cpp:5
void ion_photo(long int nelem, bool lgPrintIt)
Definition: ion_photo.cpp:27
bool lgTrace
Definition: trace.h:12
void ion_CX(long nelem)
Definition: ion_cx.cpp:11
void ion_collis(long int nelem)
Definition: ion_collis.cpp:12
void ion_recomb(bool lgPrintIt, long int nelem)
Definition: ion_recomb.cpp:20
bool lgElmtOn[LIMELM]
Definition: dense.h:160
realnum gas_phase[LIMELM]
Definition: dense.h:76
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:729
int fprintf(const Output &stream, const char *format,...)
Definition: service.cpp:1217
double fnzone
Definition: cddefines.cpp:15