-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathradiation.hxx
147 lines (111 loc) · 3.3 KB
/
radiation.hxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#ifndef __RADIATION_H__
#define __RADIATION_H__
#include <cmath>
#include <vector>
#include <bout_types.hxx>
#include <field3d.hxx>
#include <options.hxx>
class RadiatedPower {
public:
const Field3D power(const Field3D &Te, const Field3D &Ne, const Field3D &Ni);
virtual BoutReal power(BoutReal Te, BoutReal ne, BoutReal ni) {
throw BoutException("power not implemented!");
}
virtual BoutReal ionisation(BoutReal Te) {
throw BoutException("ionisation not implemented!");
}
virtual BoutReal recombination(BoutReal n, BoutReal Te) {
throw BoutException("recombination not implemented!");
}
virtual BoutReal chargeExchange(BoutReal Te) {
throw BoutException("chargeExchange not implemented!");
}
virtual BoutReal excitation(BoutReal Te) {
throw BoutException("excitation not implemented!");
}
private:
};
class InterpRadiatedPower : public RadiatedPower {
public:
InterpRadiatedPower(const string &file);
BoutReal power(BoutReal Te, BoutReal ne, BoutReal ni);
private:
std::vector<BoutReal> te_array; // Te in eV
std::vector<BoutReal> p_array; // Radiative loss rate in Watts m^3
};
/// Rates supplied by Eva Havlicova
class HydrogenRadiatedPower : public RadiatedPower {
public:
BoutReal power(BoutReal Te, BoutReal ne, BoutReal ni);
// Collision rate coefficient <sigma*v> [m3/s]
BoutReal ionisation(const BoutReal Te);
//<sigma*v> [m3/s]
BoutReal recombination(const BoutReal n, const BoutReal Te);
// <sigma*v> [m3/s]
BoutReal chargeExchange(const BoutReal Te);
// <sigma*v> [m3/s]
BoutReal excitation(const BoutReal Te);
private:
};
/*!
* Hydrogen rates, fitted by Hannah Willett May 2015
* University of York
*/
class UpdatedRadiatedPower : public RadiatedPower {
public:
BoutReal power(BoutReal Te, BoutReal ne, BoutReal ni);
// Ionisation rate coefficient <sigma*v> [m3/s]
BoutReal ionisation(BoutReal T);
// Recombination rate coefficient <sigma*v> [m3/s]
BoutReal recombination(BoutReal n, BoutReal T);
// Charge exchange rate coefficient <sigma*v> [m3/s]
BoutReal chargeExchange(BoutReal Te);
BoutReal excitation(BoutReal Te);
private:
};
/// Carbon in coronal equilibrium
/// From I.H.Hutchinson Nucl. Fusion 34 (10) 1337 - 1348 (1994)
class HutchinsonCarbonRadiation : public RadiatedPower {
BoutReal power(BoutReal Te, BoutReal ne, BoutReal ni) {
return ne * ni * 2e-31 * pow(Te / 10., 3) / (1. + pow(Te / 10., 4.5));
}
};
/*
class PostJensen : public RadiatedPower {
public:
BoutReal power(BoutReal Te, BoutReal ne, BoutReal ni) {
if( (Te < Tmin) || (Te > Tmax) )
return 0.0;
return 0.0;
}
protected:
BoutReal Tmin, Tmax;
BoutReal A[6];
struct PJ_Data {
const char* label; // Short name
const char* name; // Long name
BoutReal Tmin, Tmax;
BoutReal data[6];
};
static PJ_Data power_data[] = {
{"C", "Carbon"},
{0}
};
};
*/
class TestingPower : public RadiatedPower {
public:
TestingPower(Options *opt);
BoutReal power(BoutReal Te, BoutReal ne, BoutReal ni);
BoutReal ionisation(BoutReal Te);
BoutReal recombination(BoutReal n, BoutReal Te);
BoutReal chargeExchange(BoutReal Te);
BoutReal excitation(BoutReal Te);
private:
BoutReal _power;
BoutReal _ionisation;
BoutReal _recombination;
BoutReal _chargeExchange;
BoutReal _excitation;
};
#endif // __RADIATION_H__