-
Notifications
You must be signed in to change notification settings - Fork 2
/
SmearAssembly.py
92 lines (78 loc) · 5.11 KB
/
SmearAssembly.py
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
import fridge.Assembly.Assembly as Assembly
import fridge.Constituent.Smear as Smeared
import fridge.Constituent.LowerCoolant as Lowercoolant
import fridge.Constituent.OuterShell as Outershell
import fridge.Constituent.UpperCoolant as Uppercoolant
import fridge.Constituent.EveryThingElse as Everythingelse
import fridge.utilities.utilities as utilities
class SmearAssembly(Assembly.Assembly):
"""
Subclass of base assembly for a smear assembly.
.82c assemblies consist of a smear region and upper/lower sodium region. All information for assembly is read
in from an assembly yaml file.
"""
def __init__(self, assembly_information):
super().__init__(assembly_information)
self.assemblyUniverse = 0
self.smearRegionHeight = 0
self.smearRegion = None
self.lowerCoolant = None
self.upperCoolant = None
self.smearMaterial = None
self.innerDuct = None
self.duct = None
self.assemblyShell = None
self.everythingElse = None
self.position = []
self.assemblyCellList = []
self.assemblySurfaceList = []
self.assemblyMaterialList = []
self.get_smear_assembly_data()
self.build_smear_assembly()
def get_smear_assembly_data(self):
"""Assign assembly data for the smear assembly."""
self.get_assembly_data(self.inputs)
self.smearMaterial = self.inputs['Smear Materials']
self.smearRegionHeight = self.inputs['Smear Height']
# Update for perturbations
if bool(self.globalVars.assembly_perturbations):
self.update_perturbations()
def build_smear_assembly(self):
"""Build the cell, surface, and material cards for the smear assembly."""
self.assemblyUniverse = self.universe
excess_coolant_height = (self.assemblyHeight - self.smearRegionHeight) / 2
bottom_coolant_position = utilities.get_position_for_hex_lattice(self.assemblyPosition, self.assemblyPitch,
self.zPosition - excess_coolant_height)
bottom_smear_position = utilities.get_position_for_hex_lattice(self.assemblyPosition, self.assemblyPitch,
self.zPosition)
upper_smear_assembly_position = utilities.get_position_for_hex_lattice(self.assemblyPosition,
self.assemblyPitch,
self.smearRegionHeight + self.zPosition)
self.smearRegion = Smeared.Smear([[self.assemblyUniverse, self.cellNum, self.surfaceNum,
self.smearMaterial, self.xcSet, bottom_smear_position, self.materialNum],
[self.ductOuterFlatToFlatMCNPEdge, self.smearRegionHeight], 'Smear Region'],
void_material=self.coolantMaterial, void_percent=self.voidPercent)
self.update_global_identifiers(False)
self.lowerCoolant = Lowercoolant.LowerCoolant([[self.assemblyUniverse, self.cellNum, self.surfaceNum,
self.coolantMaterial, self.xcSet, bottom_coolant_position,
self.materialNum],
[excess_coolant_height, self.ductOuterFlatToFlatMCNPEdge]],
void_percent=self.voidPercent)
self.update_global_identifiers(False)
self.upperCoolant = Uppercoolant.UpperCoolant([[self.assemblyUniverse, self.cellNum, self.surfaceNum,
self.coolantMaterial, self.xcSet, upper_smear_assembly_position,
self.materialNum],
[excess_coolant_height, self.ductOuterFlatToFlatMCNPEdge]],
void_percent=self.voidPercent)
self.update_global_identifiers(False)
self.assemblyShell = Outershell.OuterShell([[self.assemblyUniverse, self.cellNum, self.surfaceNum,
self.coolantMaterial, self.xcSet, bottom_coolant_position,
self.materialNum],
[self.assemblyHeight, self.ductOuterFlatToFlat]])
self.assemblyCellList = [self.smearRegion, self.lowerCoolant, self.upperCoolant, self.assemblyShell]
self.assemblySurfaceList = [self.smearRegion, self.lowerCoolant, self.upperCoolant, self.assemblyShell]
self.assemblyMaterialList = [self.smearRegion, self.lowerCoolant, self.upperCoolant, self.assemblyShell]
if 'Single' in self.globalVars.input_type:
self.update_global_identifiers(False)
self.everythingElse = Everythingelse.EveryThingElse([self.cellNum, self.assemblyShell.surfaceNum])
self.assemblyCellList.append(self.everythingElse)