cloudy trunk
Loading...
Searching...
No Matches
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
14void 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}
t_atmdat atmdat
Definition atmdat.cpp:6
#define ASSERT(exp)
Definition cddefines.h:578
#define MIN2
Definition cddefines.h:761
const int LIMELM
Definition cddefines.h:258
const int NISO
Definition cddefines.h:261
#define DEBUG_ENTRY(funcname)
Definition cddefines.h:684
t_dense dense
Definition dense.cpp:24
void ion_CX(long nelem)
Definition ion_cx.cpp:14
t_ionbal ionbal
Definition ionbal.cpp:5
t_iso_sp iso_sp[NISO][LIMELM]
Definition iso.cpp:8