Put clone function in smr/materials.py

This commit is contained in:
Paul Romano 2022-06-06 22:07:36 -05:00
parent f62a9c610f
commit 3bdd23096a
5 changed files with 14 additions and 39 deletions

View file

@ -1,7 +1,6 @@
#!/usr/bin/env python3
import argparse
import copy
from math import pi, isclose
from pathlib import Path
@ -9,10 +8,9 @@ import numpy as np
from tqdm import tqdm
import openmc
from smr.materials import materials, mats
from smr.materials import materials, clone
from smr.surfaces import surfs, lattice_pitch, pin_pitch, bottom_fuel_stack, \
top_active_core, pellet_OR, clad_OR, clad_IR, guide_tube_IR, guide_tube_OR, \
active_fuel_length
top_active_core, pellet_OR, active_fuel_length
from smr.pins import pin_universes, make_stack
@ -101,13 +99,6 @@ for halfspace in surfs['lat grid box inner']:
# Define geometry with a single assembly
geometry = openmc.Geometry(root_universe)
def clone(material):
"""Perform copy of material but share nuclide densities"""
shared_mat = copy.copy(material)
shared_mat.id = None
return shared_mat
h = active_fuel_length / args.axial
fuel_mats = {}

View file

@ -1,7 +1,6 @@
#!/usr/bin/env python3
import argparse
import copy
from math import pi, isclose
from pathlib import Path
@ -9,7 +8,7 @@ import numpy as np
from tqdm import tqdm
import openmc
from smr.materials import materials, mats
from smr.materials import materials, clone
from smr.surfaces import surfs, lattice_pitch, pin_pitch, bottom_fuel_stack, \
top_active_core, pellet_OR, clad_OR, clad_IR, guide_tube_IR, guide_tube_OR
from smr.pins import pin_universes
@ -85,14 +84,6 @@ for halfspace in surfs['lat grid box inner']:
# Define geometry with a single assembly
geometry = openmc.Geometry(root_universe)
def clone(material):
"""Perform copy of material but share nuclide densities"""
shared_mat = copy.copy(material)
shared_mat.id = None
return shared_mat
#### "Differentiate" the geometry if using distribmats
h = 10.0*pin_pitch / args.axial
if args.tallies == 'mat':

View file

@ -1,14 +1,13 @@
#!/usr/bin/env python3
import argparse
import copy
from pathlib import Path
import numpy as np
from tqdm import tqdm
import openmc
from smr.materials import materials
from smr.materials import materials, clone
from smr.surfaces import surfs, lattice_pitch, bottom_fuel_stack, top_active_core, pellet_OR
from smr.assemblies import assembly_universes
from smr.plots import assembly_plots
@ -58,14 +57,6 @@ main_cell = openmc.Cell(
root_univ = openmc.Universe(cells=[main_cell])
geometry = openmc.Geometry(root_univ)
def clone(material):
"""Perform copy of material but share nuclide densities"""
shared_mat = copy.copy(material)
shared_mat.id = None
return shared_mat
#### "Differentiate" the geometry if using distribmats
if args.tallies == 'mat':
# Count the number of instances for each cell and material

View file

@ -9,20 +9,13 @@ import numpy as np
import openmc
from tqdm import tqdm
from smr.materials import materials
from smr.materials import materials, clone
from smr.surfaces import lattice_pitch, bottom_fuel_stack, top_active_core, \
pellet_OR, active_fuel_length
from smr.core import core_geometry
from smr import inlet_temperature
def clone(material):
"""Perform copy of material but share nuclide densities"""
shared_mat = copy.copy(material)
shared_mat.id = None
return shared_mat
# Define command-line options
parser = argparse.ArgumentParser()
parser.add_argument('--multipole', action='store_true',

View file

@ -1,5 +1,7 @@
"""Instantiate the OpenMC Materials needed by the core model."""
import copy
import openmc
from openmc.data import atomic_weight, atomic_mass, water_density
@ -252,3 +254,10 @@ mats['UO2 3.1 depleted'] = mat
# Construct a collection of Materials to export to XML
materials = openmc.Materials(mats.values())
def clone(material):
"""Perform copy of material but share nuclide densities"""
shared_mat = copy.copy(material)
shared_mat.id = None
return shared_mat