Skip to content

RCCA Insertion Planes #8

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

Merged
merged 7 commits into from
Jul 10, 2025
Merged
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
6 changes: 2 additions & 4 deletions models/openmc/beavrs/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@
class BEAVRS(object):
""" Main BEAVRS class"""

def __init__(self, boron_ppm=c.nominalBoronPPM, is_symmetric=False, is_2d=False):
def __init__(self, boron_ppm=c.nominalBoronPPM, is_symmetric=False, is_2d=False, rcca_z = c.rcca_bank_steps_withdrawn_default):
""" We build the entire geometry in memory in the constructor """

# TODO: make the control rod bank insertion heights attributes

# Setup the materials
self.mats = openmc_materials(ppm=boron_ppm)

self.pincells = Pincells(self.mats)
self.pincells = Pincells(self.mats, rcca_z)
self.assemblies = Assemblies(self.pincells, self.mats)
self.baffle = Baffle(self.assemblies, self.mats)
self.core = Core(self.pincells, self.assemblies, self.baffle, is_symmetric=is_symmetric)
Expand Down
5 changes: 2 additions & 3 deletions models/openmc/beavrs/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@
############## Geometry paramters ##############

## Steps withdrawn for each RCCA bank
rcca_bank_steps_withdrawn = {
rcca_bank_steps_withdrawn_default = {
'A': 228,
'B': 228,
'C': 228,
'D': 0, # bite position is bank D at 213 steps withdrawn
'D': 213, # bite position is bank D at 213 steps withdrawn
'SA': 228,
'SB': 228,
'SC': 228,
'SD': 228,
'SE': 228,
}
rcca_banks = rcca_bank_steps_withdrawn.keys()

## pincell parameters
pelletOR = 0.39218 #
Expand Down
10 changes: 6 additions & 4 deletions models/openmc/beavrs/pincells.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@

class Pincells(object):

def __init__(self, mats):
def __init__(self, mats, rcca_insertion_steps):
""" Creates BEAVRS pincell universes """

self.mats = mats

self.rcca_z = rcca_insertion_steps

self._add_structural_axials()
self._add_dummy_universe()
self._add_grid_pincells()
Expand Down Expand Up @@ -364,8 +366,8 @@ def _add_rcca_pincells(self):
self.s_rcca_b4c_top = {}
self.s_rcca_spacer_top = {}
self.s_rcca_plenum_top = {}
for b in sorted(c.rcca_banks):
d = c.rcca_bank_steps_withdrawn[b]*c.rcca_StepWidth
for b in sorted(self.rcca_z):
d = self.rcca_z[b]*c.rcca_StepWidth
self.s_rcca_rod_bot[b] = openmc.ZPlane(name='Bottom of RCCA rod bank {0}'.format(b), z0=c.rcca_Rod_bot + d)
self.s_rcca_lowerFitting_top[b] = openmc.ZPlane(name='Top of RCCA rod lower fitting bank {0}'.format(b), z0=c.rcca_LowerFitting_top + d)
self.s_rcca_aic_top[b] = openmc.ZPlane(name='Top of RCCA rod AIC bank {0}'.format(b), z0=c.rcca_AIC_top + d)
Expand Down Expand Up @@ -402,7 +404,7 @@ def _add_rcca_pincells(self):
# RCCA rod axial stack

self.u_rcca = {}
for b in sorted(c.rcca_banks):
for b in sorted(self.rcca_z):
self.u_rcca[b] = AxialPinCell(name='RCCA bank {0}'.format(b))
self.u_rcca[b].add_axial_section(self.s_struct_supportPlate_bot, self.mats['Borated Water'])
self.u_rcca[b].add_axial_section(self.s_struct_lowerNozzle_top, self.mats['Water SPN'])
Expand Down
45 changes: 32 additions & 13 deletions models/openmc/make_beavrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,45 @@

import os
from beavrs.builder import BEAVRS
from optparse import OptionParser
import beavrs.constants as c
from argparse import ArgumentParser

try:
os.mkdir('build')
except OSError: pass
os.chdir('build')

usage = """usage: %prog [options]"""
p = OptionParser(usage=usage)
p.add_option('-d', '--2d', action='store_true', dest='is_2d',
default=False, help='Create 2D BEAVRS input files,' \
+ ' 3D by default')
p.add_option('-s', '--symmetric', action='store_true', dest='is_symmetric',
default=False, help='Create octant-symmetric input files,' \
+ ' not symmetric by default')
(options, args) = p.parse_args()
p = ArgumentParser()
p.add_argument('-d', '--2d', action='store_true', dest='is_2d', default=False, \
help='Create 2D BEAVRS input files, 3D by default.')
p.add_argument('-s', '--symmetric', action='store_true', dest='is_symmetric', \
default=False, help='Create octant-symmetric input files,' \
+ ' not symmetric by default.')
p.add_argument("--rcca-insertion", dest='rcca', nargs='*', default='', \
help='RCCA insertion steps, provided as key-value pairs,' \
+ ' where even arguments are banks (keys) and odd arguments'
+ ' are insertion steps (values).' \
+ ' Valid keys are \'A\', \'B\', \'C\', \'D\', \'SA\',' \
+ ' \'SB\', \'SC\', \'SD\', and \'SE\'. Valid values are' \
+ ' integers between 0 and 228 (inclusive). All banks default' \
+ ' to fully withdrawn except for bank D, which is withdrawn to' \
+ ' the bite position (step 213).')
args = p.parse_args()

if not len(args) == 0:
p.print_help()
insertions = c.rcca_bank_steps_withdrawn_default

b = BEAVRS(is_symmetric=options.is_symmetric, is_2d=options.is_2d)
# Error handle the RCCA insertion steps.
rcca_args = dict(zip(args.rcca[::2], args.rcca[1::2]))
for k in rcca_args:
if k not in insertions.keys():
raise Exception(f'{k} is not a valid RCCA bank! Valid options are \'A\',' + \
' \'B\', \'C\', \'D\', \'SA\', \'SB\', \'SC\', \'SD\', and \'SE\'.')
if rcca_args[k].isdigit() and (0 <= int(rcca_args[k]) and int(rcca_args[k]) <= 228):
insertions[k] = int(rcca_args[k])
else:
raise Exception(f'Invalid RCCA insertion step {rcca_args[k]}! Valid insertion' \
+ ' steps are integers between 0 and 228 (inclusive).')

b = BEAVRS(is_symmetric=args.is_symmetric, is_2d=args.is_2d, rcca_z=insertions)
b.write_openmc_model()