cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion_helium.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2022 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 /*IonHelium solve ionization balance for helium */
4 #include "cddefines.h"
5 #include "trace.h"
6 #include "conv.h"
7 #include "iso.h"
8 #include "ionbal.h"
9 #include "dense.h"
10 
11 void IonHelium( void )
12 {
13  bool lgDebugPrint=false;
14 
15  DEBUG_ENTRY( "IonHelium()" );
16 
17  /* option to "turn off" helium */
18  if( !dense.lgElmtOn[ipHELIUM] )
19  {
20  dense.xIonDense[ipHELIUM][0] = 0.;
21  dense.xIonDense[ipHELIUM][1] = 0.;
22  dense.xIonDense[ipHELIUM][2] = 0.;
23  return;
24  }
25 
26  /* populations */
27  /* >>chng 01 may 09, add option to set ionization with element name ioniz cmnd */
29  {
33  }
34 
35  lgDebugPrint = false;
36 # if 0
37  if( nzone > 197 )
38  lgDebugPrint = true;
39 # endif
40 
41  /* find ionization balance */
42  ion_solver( ipHELIUM , lgDebugPrint );
43 
44  if( trace.lgHeBug )
45  {
46  fprintf( ioQQQ, " %li IonHelium returns; nzone %ld He0:%.4e He+:%.4e He+2:%.4e\n",
48  nzone,
52 
53  fprintf( ioQQQ, " He+ /He0:%s smp:%.4e rec:%.4e ion:%.4e rad rec:%.4e 1s Pop:%.4e\n",
54  iso_sp[ipHE_LIKE][ipHELIUM].chTypeAtomUsed,
55  iso_sp[ipHE_LIKE][ipHELIUM].xIonSimple,
59  iso_sp[ipHE_LIKE][ipHELIUM].st[0].Pop() );
60 
61  fprintf( ioQQQ, " He+2/He+:%s smp:%.4e rec:%.4e ion:%.4e rad rec:%.4e\n",
62  iso_sp[ipH_LIKE][ipHELIUM].chTypeAtomUsed,
63  iso_sp[ipH_LIKE][ipHELIUM].xIonSimple ,
67 
68  fprintf( ioQQQ, "\n" );
69  }
70  return;
71 }
qList st
Definition: iso.h:482
const int ipHE_LIKE
Definition: iso.h:65
bool lgHeBug
Definition: trace.h:79
realnum SetIoniz[LIMELM][LIMELM+1]
Definition: dense.h:172
void ion_solver(long int nelem, bool lgPrintIt)
Definition: ion_solver.cpp:59
t_conv conv
Definition: conv.cpp:5
bool lgSetIoniz[LIMELM]
Definition: dense.h:167
FILE * ioQQQ
Definition: cddefines.cpp:7
long int nzone
Definition: cddefines.cpp:14
t_dense dense
Definition: global.cpp:15
t_iso_sp iso_sp[NISO][LIMELM]
Definition: iso.cpp:11
double ** RateRecomTot
Definition: ionbal.h:194
double xIonDense[LIMELM][LIMELM+1]
Definition: dense.h:135
t_trace trace
Definition: trace.cpp:5
t_ionbal ionbal
Definition: ionbal.cpp:8
long int nTotalIoniz
Definition: conv.h:159
bool lgElmtOn[LIMELM]
Definition: dense.h:160
realnum gas_phase[LIMELM]
Definition: dense.h:76
const int ipH_LIKE
Definition: iso.h:64
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:723
const int ipHELIUM
Definition: cddefines.h:350
double RateIonizTot(long nelem, long ion) const
Definition: ionbal.cpp:224
int fprintf(const Output &stream, const char *format,...)
Definition: service.cpp:1121
void IonHelium(void)
Definition: ion_helium.cpp:11
double ** RR_rate_coef_used
Definition: ionbal.h:210