Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mix HCPB Materials using fusion-materials-db #26

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 176 additions & 0 deletions examples/HCPB_Build_Dict.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
import openmc
from radial_build_tools import ToroidalModel, RadialBuildPlot
from openmc_Materials_Object_from_json import *

with open('mixedPureFusionMatsHCPB_libv1.json', 'r') as mixed_mat_json:
mixed_mat = json.load(mixed_mat_json)

major_radius = 800
minor_radius_z = 114
minor_radius_xy = 114
scoring_layer_thickness = 0.5

make_mat = Make_Material(mixed_mat)
# openmc Materials object:
materials = Make_All_Materials(make_mat)

build_dict = {
"sol": {
"thickness": 5,
"composition": {"Void": 1.0},
"colour": "#E0E0E0", # Light grey

},
"fw_armor": {
"thickness": 0.2,
#"composition": mixed_materials["FWWArmor"]["vol_fracs"],
"material_name": "fw_armor",
"colour": "#FFD700", # Gold
"scores": ["heating"],
},
"fw": {
"thickness": 3.8,
#"composition": mixed_materials["FW"]["vol_fracs"],
"material_name": "fw",
"colour": "#DAA520", # Goldenrod
"scores": ["fast_fluence", "he_prod", "fe_dpa", "heating"],
},
"breeder": {
"thickness": 50,
"composition": {"BreederHCPB": 1.0},
"material_name": "breeder",
"description": "Thickness Varies",
"colour": "#B22222", # Firebrick
"scores": ["tbr", "heating"],
},
"bw": {
"thickness": 10,
"composition": {"BWHCPB": 1.0},
"material_name": "bw",
"colour": "#8B0000", # Dark red
"scores": ["tbr", "heating","fast_fluence"],
},
"manifold_front_plate": {
"thickness": 5,
"composition": {"EUROFER97": 1.0},
"material_name": "manifold_front_plate",
"colour": "#4682B4", # Steel blue
"scores": ["heating"],
},
"manifold": {
"thickness": 10,
"composition": {"HeT410P80": 1.0},
"material_name": "manifold",
"colour": "#5F9EA0", # Cadet blue
},
"manifold_back_plate": {
"thickness": 5,
"composition": {"EUROFER97": 1.0},
"material_name": "manifold_back_plate",
"colour": "#4682B4", # Steel blue
"scores": ["heating"],
},
"hts_front_plate": {
"thickness": scoring_layer_thickness,
"material_name": "hts_front_plate",
#"description": "for scoring, same composition as HTS",
"colour": "#32CD32", # Lime green
"scores": ["fast_fluence", "he_prod", "fe_dpa", "heating"],
},
"hts": {
"thickness": 9,
#"composition": mixed_materials["FNSFIBSR"]["vol_fracs"],
"material_name": "hts",
"description": "Thickness Varies",
"colour": "#00FF00", # Green
"scores": ["heating"],
},
"hts_back_plate": {
"thickness": scoring_layer_thickness,
"material_name": "hts_back_plate",
#"description": "for scoring, same composition as HTS",
"colour": "#32CD32", # Lime green
"scores": ["fast_fluence", "he_prod", "fe_dpa", "heating"],
},
"gap_1": {
"thickness": 1,
"composition": {"Void": 1.0},
"colour": "#F5F5F5", # White smoke
},
"vv_front_plate": {
"thickness": 2,
#"composition": mixed_materials["VVFill"]["vol_fracs"],
"material_name": "vv_front_plate",
"colour": "#A9A9A9", # Dark grey
"scores": ["fast_fluence", "he_prod", "fe_dpa", "heating"],
},
"vv_fill": {
"thickness": 6,
"composition": {"VVFill": 1.0},
"material_name": "vv_fill",
"colour": "#778899", # Light slate grey
"scores": ["heating"],
},
"vv_back_plate": {
"thickness": 2,
"composition": {"SS316L": 1.0},
"material_name": "vv_back_plate",
"colour": "#A9A9A9", # Dark grey
"scores": ["fast_fluence", "he_prod", "fe_dpa", "heating"],
},
"gap_2": {
"thickness": 2,
"composition": {"AirSTP": 1.0},
"material_name": "gap_2",
"colour": "#E0FFFF", # Light cyan
},
"lts_front_plate": {
"thickness": scoring_layer_thickness,
#"composition": {"LTS": 1.0},
"material_name": "lts_front_plate",
#"description": "For scoring, same composition as LTS",
"colour": "#7FFFD4", # Aquamarine
"scores": ["fast_fluence", "he_prod", "fe_dpa", "heating"],
},
"lts": {
"thickness": 9,
"composition": {"LTS": 1.0},
"material_name": "lts",
"description": "Thickness Varies",
"colour": "#00FA9A", # Medium spring green
"scores": ["heating"],
},
"lts_back_plate": {
"thickness": scoring_layer_thickness,
#"composition": {"LTS": 1.0},
"material_name": "lts_back_plate",
#"description": "For scoring, same composition as LTS",
"colour": "#7FFFD4", # Aquamarine
"scores": ["fast_fluence", "he_prod", "fe_dpa", "heating"],
},
"thermal_insulator": {
"thickness": 10,
"composition": {"AirSTP": 1.0},
"material_name": "thermal_insulator",
"colour": "#B0E0E6", # Powder blue
"scores": ["heating"],
},
"coil_pack_front_plate": {
"thickness": scoring_layer_thickness,
"material_name": "coil_pack_front_plate",
#"description": "cell for scoring peak values, same composition as coil_pack",
"colour": "#FF6347", # Tomato
"scores": ["fast_fluence", "cu_dpa", "heating"],
},
"coil_pack": {
"thickness": 52,
"composition": {"coils": 1.0},
"material_name": "coil_pack",
"colour": "#FF4500", # Orange red
"scores": ["heating"],
},
}

toroidal_model = ToroidalModel(
build_dict, major_radius, minor_radius_z, minor_radius_xy, materials
)
80 changes: 80 additions & 0 deletions examples/HCPB_Mix_Materials.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import openmc
import json
import material_db_tools as mdbt

'''
This script specifies the composition of each HCPB component and its corresponding citation.
mdbt.mix_by_volume is called to mix individual materials and generate a new .json file.
'''

with open('PureFusionMaterials_libv1.json', 'r') as pure_mat_json:
pure_mat = json.load(pure_mat_json)

mat_data = {}

#Volume fractions of constituent materials
material_comp = {
'fw_armor' : {"W": 1.00},
'fw' : {"W": 0.1, "EUROFER97" : 0.9},
'breeder' : {"Li4SiO4Li60.0":0.65, "Li2TiO3Li60.0":0.35}, #need to convert mol% to vol%
'bw' : {"MF82H" : 0.8, "HeNIST" : 0.2},
'manifold_front_plate' : {"EUROFER97": 1.0},
'manifold' : {"HeT410P80": 1.00},
'manifold_back_plate' : {"HeT410P80": 1.00},
'hts_front_plate' : {"MF82H": 0.20, "HeNIST": 0.28, "BMF82H" : 0.52},
'hts': {"MF82H": 0.20, "HeNIST": 0.28, "BMF82H" : 0.52},
'hts_back_plate' : {"MF82H": 0.20, "HeNIST": 0.28, "BMF82H" : 0.52},
'vv_front_plate' : {"HeNIST" : 0.4, "Cr3FS" : 0.6}, #changed from SS316L in corresponding build_dict
'vv_fill' : {"HeNIST" : 0.4, "Cr3FS" : 0.6},
'vv_back_plate' : {"HeNIST" : 0.4, "Cr3FS" : 0.6}, #changed from SS316L in corresponding build_dict
'gap_2' : {"AirSTP": 1.0},
'lts_front_plate' : {"Cr3FS": 0.39, "BMF82H": 0.29, "Water": 0.32},
'lts' : {"Cr3FS": 0.39, "BMF82H": 0.29, "Water": 0.32},
'lts_back_plate' : {"Cr3FS": 0.39, "BMF82H": 0.29, "Water": 0.32},
'thermal_insulator' : {'AirSTP': 1.0},
'coil_pack_front_plate' : {"JK2LBSteel": 0.3, "Cu": 0.25, "TernaryNb3Sn" : 0.25, "Eins" : 0.1, "HeNIST" : 0.1},
'coil_pack' : {"JK2LBSteel": 0.3, "Cu": 0.25, "TernaryNb3Sn" : 0.25, "Eins" : 0.1, "HeNIST" : 0.1},
}

citation_list = {
'fw_armor' : "ZhouEUDEMOHCPB_2023",
'fw' : "ZhouEUDEMOHCPB_2023",
'breeder' : "ZhouEUDEMOHCPB_2023",
'bw' : "DavisFusEngDes_2018",
'manifold_front_plate' : "DavisFusEngDes_2018",
'manifold' : "DavisFusEngDes_2018",
'manifold_back_plate' : "DavisFusEngDes_2018",
'hts_front_plate' : "DavisFusEngDes_2018",
'hts' : "DavisFusEngDes_2018",
'hts_back_plate' : "DavisFusEngDes_2018",
'vv_front_plate' : "DavisFusEngDes_2018",
'vv_fill' : "DavisFusEngDes_2018",
'vv_back_plate' : "DavisFusEngDes_2018",
'gap_2' : "ZhouEUDEMOHCPB_2023" ,
'lts_front_plate' : "DavisFusEngDes_2018",
'lts' : "DavisFusEngDes_2018",
'lts_back_plate' : "DavisFusEngDes_2018",
'thermal_insulator' : "ZhouEUDEMOHCPB_2023",
'coil_pack_front_plate' : "DavisFusEngDes_2018",
'coil_pack' : "DavisFusEngDes_2018",
}

for mat_name, comp in material_comp.items():
mat_data[mat_name] = {
"vol_fracs": comp,
"mixture_citation" : citation_list[mat_name],
}

# Load material library
mat_lib = mdbt.MaterialLibrary()
mat_lib.from_json("PureFusionMaterials_libv1.json")

# create material library object
mixmat_lib = mdbt.MaterialLibrary()
for mat_name, mat_input in mat_data.items():
mixmat_lib[mat_name] = mdbt.mix_by_volume(
mat_lib, mat_input["vol_fracs"], mat_input["mixture_citation"]
)

# write HCPB material library
mixmat_lib.write_json("mixedPureFusionMatsHCPB_libv1.json")
27 changes: 27 additions & 0 deletions examples/openmc_Materials_Object_from_json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import json
import openmc

"This script makes openmc.Material and openmc.Materials objects using .json files created with fusion-material-db"

def Make_Material(mixed_mat_data):
'''
Makes openmc.Material objects for each material in .json file (specified when called).
Adds density & nuclide information to each Material object
'''
mat_list = []
for material, mat_property in mixed_mat_data.items():
mat_openmc = openmc.Material(name=f"{material}")
mat_list.append(mat_openmc)
mat_openmc.set_density('g/cm3', mat_property.get("density"))
comp_list = mat_property.get("comp")
for element, fraction in comp_list.items():
mat_openmc.add_nuclide(element, fraction)
return mat_list

def Make_All_Materials(material_list):
'''
Makes openmc.Materials object using output of Make_Material()
'''
all_materials = openmc.Materials(material_list)
all_materials.cross_sections = '../fendl-3.2-hdf5/cross_sections.xml'
return all_materials