diff --git a/2x2-periodic/build-depleted.py b/2x2-periodic/build-depleted.py index 6498071..e3247fa 100644 --- a/2x2-periodic/build-depleted.py +++ b/2x2-periodic/build-depleted.py @@ -12,7 +12,7 @@ radius = 0.39218 height = 5. # Count the number of instances for each cell and material -num_instances = opendeplete.lomem_num_instances(openmc_geometry) +openmc_geometry.determine_paths(instances_only=True) # Extract all cells filled by a fuel material fuel_cells = openmc_geometry.get_cells_by_name( @@ -20,15 +20,11 @@ fuel_cells = openmc_geometry.get_cells_by_name( # Assign distribmats for each material for cell in fuel_cells: - old_fill = cell.fill.clone() + cell.fill.volume = np.pi * radius**2 * height + cell.fill.depletable = True + cell.fill.temperature = 300.0 - n = num_instances[cell.id] - cell.fill = [old_fill.clone() for i in range(n)] - - 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 = [cell.fill.clone() for i in range(cell.num_instances)] # Set temperature for all cells cells = openmc_geometry.get_all_cells() diff --git a/2x2-reflector/build-depleted.py b/2x2-reflector/build-depleted.py index e63af82..ee96658 100644 --- a/2x2-reflector/build-depleted.py +++ b/2x2-reflector/build-depleted.py @@ -12,7 +12,7 @@ radius = 0.39218 height = 5. # Count the number of instances for each cell and material -num_instances = opendeplete.lomem_num_instances(openmc_geometry) +openmc_geometry.determine_paths(instances_only=True) # Extract all cells filled by a fuel material fuel_cells = openmc_geometry.get_cells_by_name( @@ -20,15 +20,11 @@ fuel_cells = openmc_geometry.get_cells_by_name( # Assign distribmats for each material for cell in fuel_cells: - old_fill = cell.fill.clone() + cell.fill.volume = np.pi * radius**2 * height + cell.fill.depletable = True + cell.fill.temperature = 300.0 - n = num_instances[cell.id] - cell.fill = [old_fill.clone() for i in range(n)] - - 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 = [cell.fill.clone() for i in range(cell.num_instances)] # Set temperature for all cells cells = openmc_geometry.get_all_cells() diff --git a/assembly/build-depleted.py b/assembly/build-depleted.py index a438700..dfcf1d7 100644 --- a/assembly/build-depleted.py +++ b/assembly/build-depleted.py @@ -12,7 +12,7 @@ radius = 0.39218 height = 5. # Count the number of instances for each cell and material -num_instances = opendeplete.lomem_num_instances(openmc_geometry) +openmc_geometry.determine_paths(instances_only=True) # Extract all cells filled by a fuel material fuel_cells = openmc_geometry.get_cells_by_name( @@ -20,15 +20,11 @@ fuel_cells = openmc_geometry.get_cells_by_name( # Assign distribmats for each material for cell in fuel_cells: - old_fill = cell.fill.clone() + cell.fill.volume = np.pi * radius**2 * height + cell.fill.depletable = True + cell.fill.temperature = 300.0 - n = num_instances[cell.id] - cell.fill = [old_fill.clone() for i in range(n)] - - 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 = [cell.fill.clone() for i in range(cell.num_instances)] # Set temperature for all cells cells = openmc_geometry.get_all_cells() diff --git a/pin-cell/build-depleted.py b/pin-cell/build-depleted.py index 21dfe3b..3121ab4 100644 --- a/pin-cell/build-depleted.py +++ b/pin-cell/build-depleted.py @@ -12,7 +12,7 @@ radius = 0.39218 height = 5. # Count the number of instances for each cell and material -num_instances = opendeplete.lomem_num_instances(openmc_geometry) +openmc_geometry.determine_paths(instances_only=True) # Extract all cells filled by a fuel material fuel_cells = openmc_geometry.get_cells_by_name( @@ -20,15 +20,11 @@ fuel_cells = openmc_geometry.get_cells_by_name( # Assign distribmats for each material for cell in fuel_cells: - old_fill = cell.fill.clone() + cell.fill.volume = np.pi * radius**2 * height + cell.fill.depletable = True + cell.fill.temperature = 300.0 - n = num_instances[cell.id] - cell.fill = [old_fill.clone() for i in range(n)] - - 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 = [cell.fill.clone() for i in range(cell.num_instances)] # Set temperature for all cells cells = openmc_geometry.get_all_cells() diff --git a/smr/build-depleted.py b/smr/build-depleted.py index 9701eac..94bd1fb 100644 --- a/smr/build-depleted.py +++ b/smr/build-depleted.py @@ -13,7 +13,7 @@ radius = 0.39218 height = 200. # Count the number of instances for each cell and material -num_instances = opendeplete.lomem_num_instances(geometry) +geometry.determine_paths(instances_only=True) # Extract all cells filled by a fuel material fuel_cells = geometry.get_cells_by_name( @@ -37,15 +37,11 @@ fuel_cells.extend(geometry.get_cells_by_name( # Assign distribmats for each material for cell in fuel_cells: - old_fill = cell.fill.clone() + cell.fill.volume = np.pi * radius**2 * height + cell.fill.depletable = True + cell.fill.temperature = 300.0 - n = num_instances[cell.id] - cell.fill = [old_fill.clone() for i in range(n)] - - 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 = [cell.fill.clone() for i in range(cell.num_instances)] # Create dt vector for 1 month with 5 day timesteps dt1 = 5*24*60*60 # 5 days