-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmacro.py
More file actions
55 lines (38 loc) · 1.3 KB
/
Copy pathmacro.py
File metadata and controls
55 lines (38 loc) · 1.3 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 12 01:23:55 2019
@author: Rodrigo
"""
from constants_n_factors import barn_to_cm2
class GroupMacro:
"""
Represents the concept of macroscopic XS, or the attenuation caused by a
nucleon upon an impinging beam.
"""
def __init__(self, lib, isotope, density):
self.micro = getattr(lib, isotope)
self.density = density
self._scatter = self.micro.scatter() * density * barn_to_cm2
self._capture = self.micro.capture() * density * barn_to_cm2
self._fission = self.micro.fission() * density * barn_to_cm2
self._nu_fission = self.micro.nu_fission() * density * barn_to_cm2
self._scatter_angle = 2/(3*self.micro.mass)
def update(self):
pass
def scatter(self):
return self._scatter
def capture(self):
return self._capture
def fission(self):
return self._fission
def absorption(self):
return self.capture() + self.fission()
def total(self):
return self.absorption() + self.scatter()
def nu_fission(self):
return self._nu_fission
def scatter_angle(self):
return self._scatter_angle
# def diffusion(self):
# return 1 / (3 * (self.total() - self.scatter * self.scatter_angle()))