cloudy
trunk
source
ion_helium.cpp
Go to the documentation of this file.
1
/* This file is part of Cloudy and is copyright (C)1978-2013 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 "
dense.h
"
6
#include "
trace.h
"
7
#include "
conv.h
"
8
#include "
iso.h
"
9
#include "
ionbal.h
"
10
#include "
taulines.h
"
11
12
void
IonHelium
(
void
)
13
{
14
bool
lgDebugPrint=
false
;
15
16
DEBUG_ENTRY
(
"IonHelium()"
);
17
18
/* option to "turn off" helium */
19
if
( !
dense
.
lgElmtOn
[
ipHELIUM
] )
20
{
21
dense
.
xIonDense
[
ipHELIUM
][0] = 0.;
22
dense
.
xIonDense
[
ipHELIUM
][1] = 0.;
23
dense
.
xIonDense
[
ipHELIUM
][2] = 0.;
24
return
;
25
}
26
27
/* populations */
28
/* >>chng 01 may 09, add option to set ionization with element name ioniz cmnd */
29
if
(
dense
.
lgSetIoniz
[
ipHELIUM
] )
30
{
31
dense
.
xIonDense
[
ipHELIUM
][2] =
dense
.
SetIoniz
[
ipHELIUM
][2]*
dense
.
gas_phase
[
ipHELIUM
];
32
dense
.
xIonDense
[
ipHELIUM
][1] =
dense
.
SetIoniz
[
ipHELIUM
][1]*
dense
.
gas_phase
[
ipHELIUM
];
33
dense
.
xIonDense
[
ipHELIUM
][0] =
dense
.
SetIoniz
[
ipHELIUM
][0]*
dense
.
gas_phase
[
ipHELIUM
];
34
}
35
36
lgDebugPrint =
false
;
37
# if 0
38
if
(
nzone
> 197 )
39
lgDebugPrint =
true
;
40
# endif
41
42
/* find ionization balance */
43
ion_solver
(
ipHELIUM
, lgDebugPrint );
44
45
if
(
trace
.
lgHeBug
)
46
{
47
fprintf(
ioQQQ
,
" %li IonHelium returns; nzone %ld He0:%.4e He+:%.4e He+2:%.4e\n"
,
48
conv
.
nTotalIoniz
,
49
nzone
,
50
dense
.
xIonDense
[
ipHELIUM
][0]/
dense
.
gas_phase
[
ipHELIUM
] ,
51
dense
.
xIonDense
[
ipHELIUM
][1]/
dense
.
gas_phase
[
ipHELIUM
] ,
52
dense
.
xIonDense
[
ipHELIUM
][2]/
dense
.
gas_phase
[
ipHELIUM
] );
53
54
fprintf(
ioQQQ
,
" He+ /He0:%s smp:%.4e rec:%.4e ion:%.4e rad rec:%.4e 1s Pop:%.4e\n"
,
55
iso_sp
[
ipHE_LIKE
][
ipHELIUM
].chTypeAtomUsed,
56
iso_sp
[
ipHE_LIKE
][
ipHELIUM
].xIonSimple,
57
ionbal
.
RateRecomTot
[
ipHELIUM
][0],
58
ionbal
.
RateIonizTot
(
ipHELIUM
,0),
59
ionbal
.
RR_rate_coef_used
[
ipHELIUM
][0],
60
iso_sp
[
ipHE_LIKE
][
ipHELIUM
].
st
[0].Pop() );
61
62
fprintf(
ioQQQ
,
" He+2/He+:%s smp:%.4e rec:%.4e ion:%.4e rad rec:%.4e\n"
,
63
iso_sp
[
ipH_LIKE
][
ipHELIUM
].chTypeAtomUsed,
64
iso_sp
[
ipH_LIKE
][
ipHELIUM
].xIonSimple ,
65
ionbal
.
RateRecomTot
[
ipHELIUM
][1],
66
ionbal
.
RateIonizTot
(
ipHELIUM
,1),
67
ionbal
.
RR_rate_coef_used
[
ipHELIUM
][1] );
68
69
fprintf(
ioQQQ
,
"\n"
);
70
}
71
return
;
72
}
t_trace::lgHeBug
bool lgHeBug
Definition:
trace.h:82
ipHE_LIKE
const int ipHE_LIKE
Definition:
iso.h:63
IonHelium
void IonHelium(void)
Definition:
ion_helium.cpp:12
dense
t_dense dense
Definition:
dense.cpp:24
ioQQQ
FILE * ioQQQ
Definition:
cddefines.cpp:7
conv.h
t_ionbal::RateRecomTot
double ** RateRecomTot
Definition:
ionbal.h:198
t_dense::lgElmtOn
bool lgElmtOn[LIMELM]
Definition:
dense.h:146
t_ionbal::RR_rate_coef_used
double ** RR_rate_coef_used
Definition:
ionbal.h:212
trace.h
t_dense::gas_phase
realnum gas_phase[LIMELM]
Definition:
dense.h:71
iso.h
nzone
long int nzone
Definition:
cddefines.cpp:14
dense.h
trace
t_trace trace
Definition:
trace.cpp:5
cddefines.h
ion_solver
void ion_solver(long int nelem, bool lgPrintIt)
Definition:
ion_solver.cpp:62
ionbal
t_ionbal ionbal
Definition:
ionbal.cpp:5
t_iso_sp::st
qList st
Definition:
iso.h:453
t_dense::xIonDense
double xIonDense[LIMELM][LIMELM+1]
Definition:
dense.h:125
t_conv::nTotalIoniz
long int nTotalIoniz
Definition:
conv.h:166
ionbal.h
conv
t_conv conv
Definition:
conv.cpp:5
t_ionbal::RateIonizTot
double RateIonizTot(long nelem, long ion)
Definition:
ionbal.h:254
ipHELIUM
const int ipHELIUM
Definition:
cddefines.h:306
taulines.h
t_dense::lgSetIoniz
bool lgSetIoniz[LIMELM]
Definition:
dense.h:149
t_dense::SetIoniz
realnum SetIoniz[LIMELM][LIMELM+1]
Definition:
dense.h:154
iso_sp
t_iso_sp iso_sp[NISO][LIMELM]
Definition:
iso.cpp:8
DEBUG_ENTRY
#define DEBUG_ENTRY(funcname)
Definition:
cddefines.h:684
ipH_LIKE
const int ipH_LIKE
Definition:
iso.h:62
Generated by
1.8.17