cloudy
trunk
source
collision.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
4
#include "
cddefines.h
"
5
#include "
collision.h
"
6
7
#include "
dense.h
"
8
#include "
h2.h
"
9
#include "
hmi.h
"
10
11
ColliderList::ColliderList
()
12
{
13
DEBUG_ENTRY
(
" ColliderList::ColliderList()"
);
14
15
list
.resize(
ipNCOLLIDER
);
16
list
[
ipELECTRON
].charge = -1;
17
list
[
ipELECTRON
].mass_amu =
ELECTRON_MASS
/
ATOMIC_MASS_UNIT
;
18
19
list
[
ipPROTON
].charge = 1;
20
list
[
ipPROTON
].mass_amu =
dense
.
AtomicWeight
[0];
21
22
list
[
ipHE_PLUS
].charge = 1;
23
list
[
ipHE_PLUS
].mass_amu =
dense
.
AtomicWeight
[1];
24
25
list
[
ipALPHA
].charge = 2;
26
list
[
ipALPHA
].mass_amu =
dense
.
AtomicWeight
[1];
27
28
list
[
ipATOM_H
].charge = 0;
29
list
[
ipATOM_H
].mass_amu =
dense
.
AtomicWeight
[0];
30
31
list
[
ipATOM_HE
].charge = 0;
32
list
[
ipATOM_HE
].mass_amu =
dense
.
AtomicWeight
[1];
33
34
list
[
ipH2_ORTHO
].charge = 0;
35
list
[
ipH2_ORTHO
].mass_amu = 2.f;
36
37
list
[
ipH2_PARA
].charge = 0;
38
list
[
ipH2_PARA
].mass_amu = 2.f;
39
40
list
[
ipH2
].charge = 0;
41
list
[
ipH2
].mass_amu = 2.f;
42
}
43
44
void
ColliderList::init
()
45
{
46
DEBUG_ENTRY
(
" ColliderList::init()"
);
47
colliders
.
list
[
ipELECTRON
].density = &(
dense
.
EdenHCorr
);
48
colliders
.
list
[
ipPROTON
].density = &(
dense
.
xIonDense
[
ipHYDROGEN
][1]);
49
colliders
.
list
[
ipHE_PLUS
].density = &(
dense
.
xIonDense
[
ipHELIUM
][1]);
50
colliders
.
list
[
ipALPHA
].density = &(
dense
.
xIonDense
[
ipHELIUM
][2]);
51
colliders
.
list
[
ipATOM_H
].density = &(
dense
.
xIonDense
[
ipHYDROGEN
][0]);
52
colliders
.
list
[
ipATOM_HE
].density = &(
dense
.
xIonDense
[
ipHELIUM
][0]);
53
colliders
.
list
[
ipH2_ORTHO
].density = &(
h2
.
ortho_density
);
54
colliders
.
list
[
ipH2_PARA
].density = &(
h2
.
para_density
);
55
colliders
.
list
[
ipH2
].density = &(
hmi
.
H2_total
);
56
}
57
ColliderList
colliders
;
58
59
/*CollisionJunk set all elements of transition struc to dangerous values */
60
void
CollisionJunk
(
const
CollisionProxy
& t )
61
{
62
63
DEBUG_ENTRY
(
"CollisionJunk()"
);
64
65
/* Coll->cooling and Coll->heating due to collisional excitation */
66
t.
cool
() = -FLT_MAX;
67
t.
heat
() = -FLT_MAX;
68
69
/* collision strengths for transition */
70
t.
col_str
() = -FLT_MAX;
71
72
for
(
long
i=0; i<
ipNCOLLIDER
; i++ )
73
t.
rate_coef_ul_set
()[i] = 0.f;
74
75
t.
rate_lu_nontherm_set
() = 0.f;
76
77
return
;
78
}
79
80
/*CollisionZero zeros out the structure */
81
void
CollisionZero
(
const
CollisionProxy
& t )
82
{
83
84
DEBUG_ENTRY
(
"CollisionZero()"
);
85
86
/* Coll->cooling and Coll->heating due to collisional excitation */
87
t.
cool
() = 0.;
88
t.
heat
() = 0.;
89
90
return
;
91
}
92
h2
diatomics h2("h2", 4100., &hmi.H2_total, Yan_H2_CS)
CollisionProxy::cool
double & cool() const
Definition:
collision.h:190
t_dense::EdenHCorr
double EdenHCorr
Definition:
dense.h:216
colliders
ColliderList colliders
Definition:
collision.cpp:57
dense
t_dense dense
Definition:
dense.cpp:24
ipHE_PLUS
@ ipHE_PLUS
Definition:
collision.h:11
ipH2_PARA
@ ipH2_PARA
Definition:
collision.h:16
ipH2_ORTHO
@ ipH2_ORTHO
Definition:
collision.h:15
diatomics::ortho_density
double ortho_density
Definition:
h2_priv.h:319
t_hmi::H2_total
double H2_total
Definition:
hmi.h:16
ipATOM_H
@ ipATOM_H
Definition:
collision.h:13
ipALPHA
@ ipALPHA
Definition:
collision.h:12
ipHYDROGEN
const int ipHYDROGEN
Definition:
cddefines.h:305
ColliderList::ColliderList
ColliderList()
Definition:
collision.cpp:11
ATOMIC_MASS_UNIT
const UNUSED double ATOMIC_MASS_UNIT
Definition:
physconst.h:88
ipPROTON
@ ipPROTON
Definition:
collision.h:10
CollisionProxy::heat
double & heat() const
Definition:
collision.h:194
CollisionProxy::rate_lu_nontherm_set
realnum & rate_lu_nontherm_set() const
Definition:
collision.h:181
CollisionProxy::rate_coef_ul_set
double * rate_coef_ul_set() const
Definition:
collision.h:172
dense.h
CollisionZero
void CollisionZero(const CollisionProxy &t)
Definition:
collision.cpp:81
cddefines.h
ipH2
@ ipH2
Definition:
collision.h:17
diatomics::para_density
double para_density
Definition:
h2_priv.h:321
ipATOM_HE
@ ipATOM_HE
Definition:
collision.h:14
ColliderList::list
vector< t_collider > list
Definition:
collision.h:39
hmi.h
ELECTRON_MASS
const UNUSED double ELECTRON_MASS
Definition:
physconst.h:91
ipNCOLLIDER
@ ipNCOLLIDER
Definition:
collision.h:18
CollisionProxy
Definition:
collision.h:79
CollisionProxy::col_str
realnum & col_str() const
Definition:
collision.h:167
ipELECTRON
@ ipELECTRON
Definition:
collision.h:9
ColliderList::init
void init()
Definition:
collision.cpp:44
t_dense::xIonDense
double xIonDense[LIMELM][LIMELM+1]
Definition:
dense.h:125
ColliderList
Definition:
collision.h:36
t_dense::AtomicWeight
realnum AtomicWeight[LIMELM]
Definition:
dense.h:75
hmi
t_hmi hmi
Definition:
hmi.cpp:5
ipHELIUM
const int ipHELIUM
Definition:
cddefines.h:306
CollisionJunk
void CollisionJunk(const CollisionProxy &t)
Definition:
collision.cpp:60
h2.h
DEBUG_ENTRY
#define DEBUG_ENTRY(funcname)
Definition:
cddefines.h:684
collision.h
Generated by
1.8.17