cloudy
trunk
source
ion_cx.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
/*IonNelem ionization balance for elements without special cases */
4
#include "
cddefines.h
"
5
#include "
trace.h
"
6
#include "
dense.h
"
7
#include "
ionbal.h
"
8
#include "
mole.h
"
9
#include "
oxy.h
"
10
#include "
atmdat.h
"
11
#include "
hmi.h
"
12
14
void
ion_CX
(
long
nelem )
15
{
16
DEBUG_ENTRY
(
"ion_CX()"
);
17
18
ASSERT
( nelem <
LIMELM
);
19
ASSERT
( nelem > 1 );
20
21
long
limit =
MIN2
(nelem-
NISO
,
dense
.
IonHigh
[nelem]-1);
22
23
for
(
long
ion=0; ion <
dense
.
IonLow
[nelem]; ion++ )
24
ionbal
.
CX_recomb_rate_used
[nelem][ion] = 0;
25
26
// array goes up to [nelem+1] since no ion stage above bare nucleus
27
for
(
long
ion=limit+1; ion <= nelem; ion++ )
28
ionbal
.
CX_recomb_rate_used
[nelem][ion] = 0;
29
30
for
(
long
ion=
dense
.
IonLow
[nelem]; ion <= limit; ion++ )
31
{
32
/* number of bound electrons of the ion after recombination,
33
* for an atom (ion=0) this is equal to nelem+1,
34
* the element on the physical scale, since nelem is
35
* on the C scale, being 5 for carbon */
36
37
ionbal
.
CX_recomb_rate_used
[nelem][ion] = 0.0;
38
for
(
long
nelem1=0; nelem1<
t_atmdat::NCX
; ++nelem1)
39
{
40
long
ipISO=nelem1;
41
ionbal
.
CX_recomb_rate_used
[nelem][ion] +=
42
/* nelem1^0 + ion charge transfer recombination */
43
atmdat
.
CharExcRecTo
[nelem1][nelem][ion]*
44
/* following is density [cm-3] of nelem1^0 */
45
iso_sp
[ipISO][nelem1].
st
[0].Pop();
46
}
47
}
48
49
return
;
50
}
ion_CX
void ion_CX(long nelem)
Definition:
ion_cx.cpp:14
dense
t_dense dense
Definition:
dense.cpp:24
mole.h
trace.h
ASSERT
#define ASSERT(exp)
Definition:
cddefines.h:578
atmdat.h
MIN2
#define MIN2
Definition:
cddefines.h:761
dense.h
cddefines.h
hmi.h
ionbal
t_ionbal ionbal
Definition:
ionbal.cpp:5
LIMELM
const int LIMELM
Definition:
cddefines.h:258
t_atmdat::NCX
@ NCX
Definition:
atmdat.h:144
t_dense::IonLow
long int IonLow[LIMELM+1]
Definition:
dense.h:119
t_iso_sp::st
qList st
Definition:
iso.h:453
t_dense::IonHigh
long int IonHigh[LIMELM+1]
Definition:
dense.h:120
ionbal.h
t_ionbal::CX_recomb_rate_used
double ** CX_recomb_rate_used
Definition:
ionbal.h:206
atmdat
t_atmdat atmdat
Definition:
atmdat.cpp:6
iso_sp
t_iso_sp iso_sp[NISO][LIMELM]
Definition:
iso.cpp:8
t_atmdat::CharExcRecTo
double CharExcRecTo[NCX][LIMELM][LIMELM+1]
Definition:
atmdat.h:153
oxy.h
NISO
const int NISO
Definition:
cddefines.h:261
DEBUG_ENTRY
#define DEBUG_ENTRY(funcname)
Definition:
cddefines.h:684
Generated by
1.8.17