Cloudy
Spectral Synthesis Code for Astrophysics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ionbal.h
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2023 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 
4 #ifndef IONBAL_H_
5 #define IONBAL_H_
6 
7 #include "module.h"
8 #include "container_classes.h"
9 
10 class dense;
11 
14 void ion_recom_calculate( void );
15 
17 void ion_zero(long int nelem);
18 
22 void ion_collis(
23  long nelem);
24 
29 void ion_solver(long int nelem, bool lgPrintIt);
30 
35 void ion_photo(
36  long int nelem ,
37  bool lgPrintIt );
38 
40 void ion_CX(long nelem );
41 
43 void ion_recomb(bool,long);
44 
46 void ion_recombAGN( FILE * io );
47 
49 void ion_wrapper( long nelem );
50 
54 void Badnell_rec_init( void );
55 
56 /* routines to do heavy element ionization balance */
57 void IonNelem(bool lgPrintIt, long int nelem);
58 void IonHelium( void );
59 
61 static const int NSHELLS = 7;
62 
64 class t_ionbal : public module
65 {
66 public:
67  void alloc();
68 
69  const char* chName() const
70  {
71  return "ionbal";
72  }
73  void zero();
74  void comment(t_warnings&);
75 
83  double trimhi,
84 
87  trimlo;
88 
90  bool lgTrimhiOn;
91 
93  bool lgTrimloOn;
94 
96  bool lgNewTrim;
97 
98  /* ==============================================================
99  * all following deals with ionization processes */
100 
113 
118 
122 
125 
128 
132 
136 
139 
143 
146 
147  /* ==============================================================
148  * following deal with Compton recoil ionization of bound electrons */
149 
154 
157 
160 
163 
166 
169 
172 
177 
181 
185 
187  /* ==============================================================
188  * end Compton recoil ionization of bound electrons */
189 
190  /* ==============================================================
191  * all following deals with recombination */
192 
195 
198 
203 
205 
208 
211 
214 
219 
220  int
223 
226 
228  bool lgDRsup;
229 
232  bool lgNoCota;
233 
236 
238  long int ilt,
239  iltln,
240  ilthn,
241  ihthn,
242  ifail;
243 
245 
246  // find the total ionization rate (including multiple-electron processes)
247  double RateIonizTot( long nelem, long ion ) const;
248 
250  {
251  /* number of electrons in valence shell that can Compton recoil ionize */
252  static const long int nCom[LIMELM] = {
253  1 , 2 , /* K 1s shell */
254  1 , 2 , /* L 2s shell */
255  1 , 2 , 3 , 4 , 5 , 6 , /* L 2p shell */
256  1 , 2 , /* M 3s shell */
257  1 , 2 , 3 , 4 , 5 , 6 , /* M 3p shell */
258  1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , /* M 3d shell */
259  1 , 2 , /* N 4s shell */
260  1 , 2 /* N 4p shell */
261  };
262 
263  for( int nelem=ipHYDROGEN; nelem < LIMELM; ++nelem )
264  {
265  nCompRecoilElec[nelem] = nCom[nelem];
266  }
267  }
268 };
269 
270 extern t_ionbal ionbal;
271 
272 #endif /* IONBAL_H_ */
Definition: warnings.h:11
bool lgTrimhiOn
Definition: ionbal.h:90
multi_arr< double, 2 > CompRecoilIonRate
Definition: ionbal.h:162
long int nCompRecoilElec[LIMELM]
Definition: ionbal.h:184
bool lgNewTrim
Definition: ionbal.h:96
double CosRayHeatNeutralParticles
Definition: ionbal.h:131
const char * chName() const
Definition: ionbal.h:69
long int ilthn
Definition: ionbal.h:238
bool lgPhotoIoniz_On
Definition: ionbal.h:117
multi_arr< double, 2 > UTA_heat_rate
Definition: ionbal.h:176
void IonNelem(bool lgPrintIt, long int nelem)
Definition: ion_nelem.cpp:9
multi_arr< double, 2 > RateRecomTot
Definition: ionbal.h:194
double elecsrc[LIMELM]
Definition: ionbal.h:244
void IonHelium(void)
Definition: ion_helium.cpp:11
multi_arr< double, 3 > CollIonRate_Ground
Definition: ionbal.h:121
double trimhi
Definition: ionbal.h:83
double CosRayIonRate
Definition: ionbal.h:127
multi_arr< double, 2 > RR_Verner_rate_coef
Definition: ionbal.h:213
multi_arr< double, 2 > RR_Badnell_rate_coef
Definition: ionbal.h:200
bool lgRecom_Badnell_print
Definition: ionbal.h:207
void ion_solver(long int nelem, bool lgPrintIt)
Definition: ion_solver.cpp:59
multi_arr< double, 2 > UTA_ionize_rate
Definition: ionbal.h:174
void Badnell_rec_init(void)
Definition: ion_recomb_Badnell.cpp:598
multi_arr< double, 4 > PhotoRate_Shell
Definition: ionbal.h:112
Definition: ionbal.h:64
void comment(t_warnings &)
Definition: ionbal.cpp:122
t_dense dense
Definition: global.cpp:15
double CompHeating_Max
Definition: ionbal.h:186
long int ifail
Definition: ionbal.h:238
double ExtraHeatRate
Definition: ionbal.h:138
void ion_photo(long int nelem, bool lgPrintIt)
Definition: ion_photo.cpp:28
void ion_collis(long nelem)
multi_arr< double, 2 > ExcitationGround
Definition: ionbal.h:124
double CosRayHeatThermalElectrons
Definition: ionbal.h:135
void ion_zero(long int nelem)
Definition: ion_zero.cpp:8
double xNeutronHeatRate
Definition: ionbal.h:142
realnum guess_noise
Definition: ionbal.h:225
double DR_mean_scale[LIMELM]
Definition: ionbal.h:218
static const int NSHELLS
Definition: ionbal.h:61
float realnum
Definition: cddefines.h:127
multi_arr< double, 2 > CompRecoilHeatRate
Definition: ionbal.h:168
multi_arr< double, 2 > RR_rate_coef_used
Definition: ionbal.h:210
t_ionbal ionbal
Definition: ionbal.cpp:8
void zero()
Definition: ionbal.cpp:79
void ion_recombAGN(FILE *io)
Definition: ion_recomb.cpp:216
int lgGrainIonRecom
Definition: ionbal.h:222
void alloc()
Definition: ionbal.cpp:10
void ion_recomb(bool, long)
double CompRecoilHeatLocal
Definition: ionbal.h:156
const int LIMELM
Definition: cddefines.h:318
double elecsnk[LIMELM]
Definition: ionbal.h:244
void ion_wrapper(long nelem)
Definition: ion_solver.cpp:1367
multi_arr< double, 2 > CompRecoilHeatRateSave
Definition: ionbal.h:171
t_ionbal()
Definition: ionbal.h:249
multi_arr< double, 2 > DR_Badnell_suppress_fact
Definition: ionbal.h:204
bool lgCompRecoil
Definition: ionbal.h:153
double RateIonizTot(long nelem, long ion) const
Definition: ionbal.cpp:156
multi_arr< double, 2 > CX_recomb_rate_used
Definition: ionbal.h:200
void ion_CX(long nelem)
Definition: ion_cx.cpp:11
multi_arr< long, 2 > ipCompRecoil
Definition: ionbal.h:159
multi_arr< double, 2 > CompRecoilIonRateSave
Definition: ionbal.h:165
multi_arr< double, 2 > RateRecomIso
Definition: ionbal.h:197
double trimlo
Definition: ionbal.h:83
bool lgNoCota
Definition: ionbal.h:232
double PairProducPhotoRate[3]
Definition: ionbal.h:145
bool lgTrimloOn
Definition: ionbal.h:93
multi_arr< double, 2 > DR_Badnell_rate_coef
Definition: ionbal.h:200
void ion_recom_calculate(void)
Definition: ion_recomb_Badnell.cpp:1309
multi_arr< double, 3 > RateIoniz
Definition: ionbal.h:180
long int ilt
Definition: ionbal.h:238
const int ipHYDROGEN
Definition: cddefines.h:359
bool lgDRsup
Definition: ionbal.h:228
Definition: module.h:26
long int ihthn
Definition: ionbal.h:238
realnum CotaRate[LIMELM]
Definition: ionbal.h:235
long int iltln
Definition: ionbal.h:238