cloudy trunk
Loading...
Searching...
No Matches
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
12{
13 DEBUG_ENTRY(" ColliderList::ColliderList()");
14
15 list.resize( ipNCOLLIDER );
16 list[ipELECTRON].charge = -1;
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
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}
58
59/*CollisionJunk set all elements of transition struc to dangerous values */
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 */
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
const int ipHELIUM
Definition cddefines.h:306
const int ipHYDROGEN
Definition cddefines.h:305
#define DEBUG_ENTRY(funcname)
Definition cddefines.h:684
vector< t_collider > list
Definition collision.h:39
double & cool() const
Definition collision.h:190
realnum & col_str() const
Definition collision.h:167
double & heat() const
Definition collision.h:194
realnum & rate_lu_nontherm_set() const
Definition collision.h:181
double * rate_coef_ul_set() const
Definition collision.h:172
ColliderList colliders
Definition collision.cpp:57
void CollisionJunk(const CollisionProxy &t)
Definition collision.cpp:60
void CollisionZero(const CollisionProxy &t)
Definition collision.cpp:81
@ ipATOM_H
Definition collision.h:13
@ ipALPHA
Definition collision.h:12
@ ipH2_ORTHO
Definition collision.h:15
@ ipHE_PLUS
Definition collision.h:11
@ ipH2_PARA
Definition collision.h:16
@ ipH2
Definition collision.h:17
@ ipPROTON
Definition collision.h:10
@ ipNCOLLIDER
Definition collision.h:18
@ ipELECTRON
Definition collision.h:9
@ ipATOM_HE
Definition collision.h:14
ColliderList colliders
Definition collision.cpp:57
t_dense dense
Definition dense.cpp:24
diatomics h2("h2", 4100., &hmi.H2_total, Yan_H2_CS)
t_hmi hmi
Definition hmi.cpp:5
UNUSED const double ELECTRON_MASS
Definition physconst.h:91
UNUSED const double ATOMIC_MASS_UNIT
Definition physconst.h:88