- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsource.py
More file actions
Latest commit
51 lines (44 loc) · 1.35 KB
/
Copy pathsource.py
File metadata and controls
51 lines (44 loc) · 1.35 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
importmath
#LIST OF REFERENCES
#[1] AA10 - Accident Analysis Report - Public: Water leakage in Monolith Vessel, ESS-0052199
#[2] ESS - Activity transport and dose calculation models and tools used in safety analyses at ESS, ESS-0092033
definstant_release(x):
"""
Instant release source at time 0.
"""
ifx==0:
return1
else:
return0
defconstant_release(x, tmin=0, tmax=1.4*10**6 ):
"""
Constant release source between tmin e tmax.
Defaults from reference ESS-0052199, 700 kg of water pumped at the rate of 1.80 Kg/hours
"""
ifx<tmax:
return1/(tmax-tmin)
else:
return0
classSource:
"""
Define the class for the radioactivity source. Defaults from ESS-0052199
"""
def__init__(self, name="", half_life=1*10**9, function=constant_release):
self.name=name
self.half_life=half_life
self.function=function
defgetNuclei(self):
"""
Return the number of nuclei of the source
"""
returnint(self.half_life/math.log(2))
defgetDecayConst(self):
"""
Return the decay constant lambda of the source
"""
return0.693/self.half_life
defEval(self, time):
"""
Evaluate the source at a certain time
"""
returnself.function(float(time))