-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathconstants.py
More file actions
314 lines (253 loc) · 9.97 KB
/
constants.py
File metadata and controls
314 lines (253 loc) · 9.97 KB
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
IOTTY = 6
"""Standard output unit identifier"""
NOUT = 11
"""Output file unit identifier"""
MFILE = 13
"""Machine-optimised output file unit"""
ELECTRON_CHARGE = 1.602176634e-19
"""Electron / elementary charge [C]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/cuu/Value?e|search_for=electron+charge
"""
ELECTRON_VOLT = ELECTRON_CHARGE
"""Electron volt [J]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/cuu/Value?evj|search_for=electron+volt
"""
KILOELECTRON_VOLT = ELECTRON_VOLT * 1e3
"""Kiloelectron volt [kJ]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/cuu/Value?evj|search_for=electron+volt
"""
ATOMIC_MASS_UNIT = 1.66053906892e-27
"""Unified atomic mass unit [kg]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/cuu/Value?u|search_for=atomic+mass+constant
"""
ELECTRON_MASS = 9.1093837139e-31
"""Electron mass [kg]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/cuu/Value?me|search_for=ELECTRON+MASS
"""
PROTON_MASS = 1.67262192595e-27
"""Proton mass [kg]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/cuu/Value?mp|search_for=PROTON+MASS
"""
M_PROTON_AMU = 1.0072764665789
"""Proton mass [amu]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/cuu/Value?mpu
"""
M_PROTIUM_AMU = 1.00782503223
"""Protium atomic mass [amu]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/Compositions/stand_alone.pl?ele=1
"""
DEUTERON_MASS = 3.3435837768e-27
"""Deuteron mass [kg]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/cuu/Value?md|search_for=DEUTERON+MASS
"""
M_DEUTERON_AMU = 2.013553212544
"""Deuteron mass [amu]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/cuu/Value?mdu
"""
TRITON_MASS = 5.0073567512e-27
"""Triton mass [kg]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/cuu/Value?mt|search_for=TRITON+MASS
"""
M_TRITON_AMU = 3.01550071597
"""Triton mass [amu]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/cuu/Value?art
"""
NEUTRON_MASS = 1.67492750056e-27
"""Neutron mass [kg]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/cuu/Value?mn|search_for=NEUTRON+MASS
"""
ALPHA_MASS = 6.6446573450e-27
"""Alpha particle mass [kg]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/cuu/Value?mal|search_for=alpha+mass
"""
M_ALPHA_AMU = 4.001506179129
"""Alpha particle mass [amu]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/cuu/Value?malu
"""
M_HELIUM_AMU = 4.002602
"""Average Helium atom mass [amu]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/Compositions/stand_alone.pl?ele=He
"""
HELION_MASS = 5.0064127862e-27
"""Helion (3He) mass [kg]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/cuu/Value?mh|search_for=HELION
"""
M_HELION_AMU = 3.014932246932
"""Helion (3He) mass [amu]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/cuu/Value?arh
"""
M_BERYLLIUM_AMU = 9.0121831
"""Beryllium atom (4Be) mass [amu]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/Compositions/stand_alone.pl?ele=Be
"""
M_CARBON_AMU = 12.0096
"""Average Carbon atom mass [amu]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/Compositions/stand_alone.pl?ele=C
"""
M_NITROGEN_AMU = 14.00643
"""Average Nitrogen atom mass [amu]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/Compositions/stand_alone.pl?ele=N
"""
M_OXYGEN_AMU = 15.99903
"""Average Oxygen atom mass [amu]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/Compositions/stand_alone.pl?ele=O
"""
M_NEON_AMU = 20.1797
"""Average Neon atom mass [amu]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/Compositions/stand_alone.pl?ele=Ne
"""
M_SILICON_AMU = 28.084
"""Average Silicon atom mass [amu]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/Compositions/stand_alone.pl?ele=Si
"""
M_ARGON_AMU = 39.948
"""Average Argon atom mass [amu]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/Compositions/stand_alone.pl?ele=Ar
"""
M_IRON_AMU = 55.845
"""Average Iron atom mass [amu]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/Compositions/stand_alone.pl?ele=Fe
"""
M_NICKEL_AMU = 58.6934
"""Average Nickel atom mass [amu]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/Compositions/stand_alone.pl?ele=Ni
"""
M_KRYPTON_AMU = 83.798
"""Average Krypton atom mass [amu]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/Compositions/stand_alone.pl?ele=Kr
"""
M_XENON_AMU = 131.293
"""Average Xenon atom mass [amu]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/Compositions/stand_alone.pl?ele=Xe
"""
M_TUNGSTEN_AMU = 183.84
"""Average Tungsten atom mass [amu]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/Compositions/stand_alone.pl?ele=W
"""
SPEED_LIGHT = 299792458
"""Speed of light in vacuum (c) [m/s]
Reference: National Institute of Standards and Technology (NIST)
https://physics.nist.gov/cgi-bin/cuu/Value?c|search_for=light
"""
D_T_ENERGY = (
(DEUTERON_MASS + TRITON_MASS) - (ALPHA_MASS + NEUTRON_MASS)
) * SPEED_LIGHT**2
"""Deuterium - Tritium reaction energy [J]
Find the mass difference in the reactancts and products of the D-T reaction
Multiply by the speed of light squared to get the energy released
"""
D_HELIUM_ENERGY = (
(DEUTERON_MASS + HELION_MASS) - (ALPHA_MASS + PROTON_MASS)
) * SPEED_LIGHT**2
"""Deuterium - Helion (3He) reaction energy [J]
Find the mass difference in the reactancts and products of the D-3He reaction
Multiply by the speed of light squared to get the energy released
"""
DD_HELIUM_ENERGY = (
(DEUTERON_MASS + DEUTERON_MASS) - (HELION_MASS + NEUTRON_MASS)
) * SPEED_LIGHT**2
"""Deuterium - Deuterium (3He producing) reaction energy [J]
Find the mass difference in the reactancts and products of the D-D reaction
Multiply by the speed of light squared to get the energy released
"""
DD_TRITON_ENERGY = (
(DEUTERON_MASS + DEUTERON_MASS) - (TRITON_MASS + PROTON_MASS)
) * SPEED_LIGHT**2
"""Deuterium - Deuterium (Triton producing) reaction energy [J]
Find the mass difference in the reactancts and products of the D-D reaction
Multiply by the speed of light squared to get the energy released
"""
DT_NEUTRON_ENERGY_FRACTION = ALPHA_MASS / (NEUTRON_MASS + ALPHA_MASS)
"""Deuterium - Tritium reaction energy fraction carried by neutron
Assuming centre of mass frame as the momenta of the fusion products exceed
those of the fusion reagents by many orders of magnitude. Assumed to be non-relativistic.
Roughly 79.867% of the energy is carried by the neutron
"""
DT_ALPHA_ENERGY = (1.0 - DT_NEUTRON_ENERGY_FRACTION) * D_T_ENERGY
"""Deuterium - Tritium reaction energy carried by alpha particle neutron [J]
Assuming centre of mass frame as the momenta of the fusion products exceed
those of the fusion reagents by many orders of magnitude. Assumed to be non-relativistic.
Roughly 3.5 MeV of the energy is carried by the alpha particle
"""
DD_NEUTRON_ENERGY_FRACTION = HELION_MASS / (NEUTRON_MASS + HELION_MASS)
"""Deuterium - Deuterium (3He producing) reaction energy fraction carried by neutron
Assuming centre of mass frame as the momenta of the fusion products exceed
those of the fusion reagents by many orders of magnitude. Assumed to be non-relativistic.
Roughly 74.935% of the energy is carried by the neutron
"""
DD_PROTON_ENERGY_FRACTION = TRITON_MASS / (PROTON_MASS + TRITON_MASS)
"""Deuterium - Deuterium (Triton producing) reaction energy fraction carried by proton
Assuming centre of mass frame as the momenta of the fusion products exceed
those of the fusion reagents by many orders of magnitude. Assumed to be non-relativistic.
Roughly 74.960% of the energy is carried by the proton
"""
DHELIUM_PROTON_ENERGY_FRACTION = ALPHA_MASS / (PROTON_MASS + ALPHA_MASS)
"""Deuterium - Helion (3He) reaction energy fraction carried by proton
Assuming centre of mass frame as the momenta of the fusion products exceed
those of the fusion reagents by many orders of magnitude. Assumed to be non-relativistic.
Roughly 79.889% of the energy is carried by the proton
"""
DEN_TUNGSTEN = 19250.0
"""Density of Tungsten [kg/m3]"""
TEMP_ROOM = 293.15
""" Room temperature in Kelvin
Assume the room is at 20 degrees Celsius
"""
RMU0 = 1.256637062e-6
"""permeability of free space [H/m]"""
UMASS = 1.660538921e-27
"""unified atomic mass unit [kg]"""
EPSILON0 = 8.85418781e-12
"""permittivity of free space [Farad/m]"""
CPH2O = 4180.0
"""specific heat capacity of water (J/kg/K)"""
den_copper: float = None
"""density of copper (kg/m3)"""
den_aluminium: float = None
"""density of aluminium (kg/m3)"""
DENH2O = 985.0
"""density of water (kg/m3)"""
K_COPPER = 330.0
"""Copper thermal conductivity (W/m/K)"""
KH2O = 0.651
"""thermal conductivity of water (W/m/K)"""
MUH2O = 4.71e-4
"""water dynamic viscosity (kg/m/s)"""
N_DAY_YEAR = 365.2425
"""Average number of days in a year"""
ACCELERATION_GRAVITY = 9.81
"""Acceleration due to gravity [m/s2]"""
def init_constants():
global den_copper, den_aluminium
den_copper = 8900.0
den_aluminium = 2700.0