Revise to use MPI OpenDeplete

This modifies the depletion codes to use the MPI branch of OpenDeplete.
In addition, memory utilization was optimized such that the SMR
simulation can actually be run.
This commit is contained in:
Colin Josey 2017-05-22 18:32:02 -04:00
parent 41e74fff85
commit 8bf8d9561b
5 changed files with 70 additions and 64 deletions

View file

@ -17,7 +17,7 @@ radius = 0.39218
height = 5.
# Count the number of instances for each cell and material
openmc_geometry.determine_paths()
num_instances = opendeplete.lomem_num_instances(openmc_geometry)
# Extract all cells filled by a fuel material
fuel_cells = openmc_geometry.get_cells_by_name(
@ -25,17 +25,21 @@ fuel_cells = openmc_geometry.get_cells_by_name(
# Assign distribmats for each material
for cell in fuel_cells:
new_materials = []
old_fill = cell.fill.clone()
for i in range(cell.num_instances):
new_materials.append(cell.fill.clone())
n = num_instances[cell.id]
cell.fill = [old_fill.clone() for i in range(n)]
# Store volume of burnable fuel rods cells
new_material.volume = np.pi * radius**2 * height
new_material.depletable = True
new_material.temperature = 300
for i in range(n):
cell.fill[i].volume = np.pi * radius**2 * height
cell.fill[i].depletable = True
cell.fill[i].temperature = 300.0
cell.fill = new_materials
# Set temperature for all cells
cells = openmc_geometry.get_all_cells()
for cell_id in cells:
cells[cell_id].temperature = 300.0
# Create dt vector for 1 month with 5 day timesteps
dt1 = 5*24*60*60 # 5 days
@ -45,7 +49,7 @@ dt = np.repeat([dt1], N)
# Create settings variable
settings = opendeplete.OpenMCSettings()
settings.openmc_call = ["mpirun", "openmc"]
settings.openmc_call = "openmc"
settings.particles = 120000
settings.batches = 20
settings.inactive = 10
@ -61,4 +65,4 @@ settings.output_dir = 'depleted'
op = opendeplete.OpenMCOperator(openmc_geometry, settings)
# Perform simulation using the MCNPX/MCNP6 algorithm
opendeplete.integrate(op, opendeplete.ce_cm_c1)
opendeplete.cecm(op)

View file

@ -17,7 +17,7 @@ radius = 0.39218
height = 5.
# Count the number of instances for each cell and material
openmc_geometry.determine_paths()
num_instances = opendeplete.lomem_num_instances(openmc_geometry)
# Extract all cells filled by a fuel material
fuel_cells = openmc_geometry.get_cells_by_name(
@ -25,17 +25,21 @@ fuel_cells = openmc_geometry.get_cells_by_name(
# Assign distribmats for each material
for cell in fuel_cells:
new_materials = []
old_fill = cell.fill.clone()
for i in range(cell.num_instances):
new_materials.append(cell.fill.clone())
n = num_instances[cell.id]
cell.fill = [old_fill.clone() for i in range(n)]
# Store volume of burnable fuel rods cells
new_material.volume = np.pi * radius**2 * height
new_material.depletable = True
new_material.temperature = 300
for i in range(n):
cell.fill[i].volume = np.pi * radius**2 * height
cell.fill[i].depletable = True
cell.fill[i].temperature = 300.0
cell.fill = new_materials
# Set temperature for all cells
cells = openmc_geometry.get_all_cells()
for cell_id in cells:
cells[cell_id].temperature = 300.0
# Create dt vector for 1 month with 5 day timesteps
dt1 = 5*24*60*60 # 5 days
@ -45,7 +49,7 @@ dt = np.repeat([dt1], N)
# Create settings variable
settings = opendeplete.OpenMCSettings()
settings.openmc_call = ["mpirun", "openmc"]
settings.openmc_call = "openmc"
settings.particles = 120000
settings.batches = 30
settings.inactive = 20
@ -61,4 +65,4 @@ settings.output_dir = 'depleted'
op = opendeplete.OpenMCOperator(openmc_geometry, settings)
# Perform simulation using the MCNPX/MCNP6 algorithm
opendeplete.integrate(op, opendeplete.ce_cm_c1)
opendeplete.cecm(op)

View file

@ -17,7 +17,7 @@ radius = 0.39218
height = 5.
# Count the number of instances for each cell and material
openmc_geometry.determine_paths()
num_instances = opendeplete.lomem_num_instances(openmc_geometry)
# Extract all cells filled by a fuel material
fuel_cells = openmc_geometry.get_cells_by_name(
@ -25,17 +25,21 @@ fuel_cells = openmc_geometry.get_cells_by_name(
# Assign distribmats for each material
for cell in fuel_cells:
new_materials = []
old_fill = cell.fill.clone()
for i in range(cell.num_instances):
new_materials.append(cell.fill.clone())
n = num_instances[cell.id]
cell.fill = [old_fill.clone() for i in range(n)]
# Store volume of burnable fuel rods cells
new_material.volume = np.pi * radius**2 * height
new_material.depletable = True
new_material.temperature = 300
for i in range(n):
cell.fill[i].volume = np.pi * radius**2 * height
cell.fill[i].depletable = True
cell.fill[i].temperature = 300.0
cell.fill = new_materials
# Set temperature for all cells
cells = openmc_geometry.get_all_cells()
for cell_id in cells:
cells[cell_id].temperature = 300.0
# Create dt vector for 1 month with 5 day timesteps
dt1 = 5*24*60*60 # 5 days
@ -45,7 +49,7 @@ dt = np.repeat([dt1], N)
# Create settings variable
settings = opendeplete.OpenMCSettings()
settings.openmc_call = ["mpirun", "openmc"]
settings.openmc_call = "openmc"
settings.particles = 30000
settings.batches = 20
settings.inactive = 10
@ -61,4 +65,4 @@ settings.output_dir = 'depleted'
op = opendeplete.OpenMCOperator(openmc_geometry, settings)
# Perform simulation using the MCNPX/MCNP6 algorithm
opendeplete.integrate(op, opendeplete.ce_cm_c1)
opendeplete.cecm(op)

View file

@ -17,12 +17,7 @@ radius = 0.39218
height = 5.
# Count the number of instances for each cell and material
openmc_geometry.determine_paths()
# Determine the maximum material ID
max_material_id = 0
for material in openmc_geometry.get_all_materials().values():
max_material_id = max(max_material_id, material.id)
num_instances = opendeplete.lomem_num_instances(openmc_geometry)
# Extract all cells filled by a fuel material
fuel_cells = openmc_geometry.get_cells_by_name(
@ -30,20 +25,21 @@ fuel_cells = openmc_geometry.get_cells_by_name(
# Assign distribmats for each material
for cell in fuel_cells:
new_materials = []
old_fill = cell.fill.clone()
for i in range(cell.num_instances):
new_material = copy.deepcopy(cell.fill)
new_material.id = max_material_id + 1
max_material_id += 1
new_materials.append(new_material)
n = num_instances[cell.id]
cell.fill = [old_fill.clone() for i in range(n)]
# Store volume of burnable fuel rods cells
new_material.volume = np.pi * radius**2 * height
new_material.depletable = True
new_material.temperature = 300
for i in range(n):
cell.fill[i].volume = np.pi * radius**2 * height
cell.fill[i].depletable = True
cell.fill[i].temperature = 300.0
cell.fill = new_materials
# Set temperature for all cells
cells = openmc_geometry.get_all_cells()
for cell_id in cells:
cells[cell_id].temperature = 300.0
# Create dt vector for 1 month with 5 day timesteps
dt1 = 5*24*60*60 # 5 days
@ -53,7 +49,7 @@ dt = np.repeat([dt1], N)
# Create settings variable
settings = opendeplete.OpenMCSettings()
settings.openmc_call = ["mpirun", "openmc"]
settings.openmc_call = "openmc"
settings.particles = 10000
settings.batches = 20
settings.inactive = 10
@ -69,4 +65,4 @@ settings.output_dir = 'depleted'
op = opendeplete.OpenMCOperator(openmc_geometry, settings)
# Perform simulation using the MCNPX/MCNP6 algorithm
opendeplete.integrate(op, opendeplete.ce_cm_c1)
opendeplete.cecm(op)

View file

@ -19,7 +19,7 @@ radius = 0.39218
height = 200.
# Count the number of instances for each cell and material
geometry.determine_paths()
num_instances = opendeplete.lomem_num_instances(geometry)
# Extract all cells filled by a fuel material
fuel_cells = geometry.get_cells_by_name(
@ -43,17 +43,15 @@ fuel_cells.extend(geometry.get_cells_by_name(
# Assign distribmats for each material
for cell in fuel_cells:
new_materials = []
old_fill = cell.fill.clone()
for i in range(cell.num_instances):
new_materials.append(cell.fill.clone())
n = num_instances[cell.id]
cell.fill = [old_fill.clone() for i in range(n)]
# Store volume of burnable fuel rods cells
new_material.volume = np.pi * radius**2 * height
new_material.depletable = True
new_material.temperature = 300
cell.fill = new_materials
for i in range(n):
cell.fill[i].volume = np.pi * radius**2 * height
cell.fill[i].depletable = True
cell.fill[i].temperature = 300.0
# Create dt vector for 1 month with 5 day timesteps
dt1 = 5*24*60*60 # 5 days
@ -63,7 +61,7 @@ dt = np.repeat([dt1], N)
# Create settings variable
settings = opendeplete.OpenMCSettings()
settings.openmc_call = ["mpirun", "openmc"]
settings.openmc_call = "openmc"
settings.particles = 1000000
settings.batches = 200
settings.inactive = 100
@ -81,4 +79,4 @@ settings.output_dir = 'depleted'
op = opendeplete.OpenMCOperator(geometry, settings)
# Perform simulation using the MCNPX/MCNP6 algorithm
opendeplete.integrate(op, opendeplete.ce_cm_c1)
opendeplete.cecm(op)