-
Notifications
You must be signed in to change notification settings - Fork 16
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
Depcode openmc init #132
Depcode openmc init #132
Conversation
…file and iter_matfile as input parameters but maintain in the DepcodeSerpent class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewer 1 Files Reviewed
Overall looks good. There are some minor things I noticed, but I would say these files look clean. I'm not familiar with OpenMC, so if there are any typos/errors in those input files, I may have missed them.
@gwenchee bump |
I'll review section 3. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review for Part 3
Overall this looks like some really good work @yardasol! I do have some questions about things that seem missing or inconsistent.
iter_inputfile : dict of str to str | ||
Paths to OpenMC input files for OpenMC rerunning. | ||
iter_matfile : str | ||
Path to iterative, rewritable material file for OpenMC | ||
rerunning. This file is modified during the simulation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these still used? I looks like earlier on in the file all mentions of these attributes are removed from the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are used. They used to be function parameters, but since they don't change within a simulation it makes sense to have them as attributes. Not sure where "earlier on in the file" refers to.
def read_depcode_info(self): | ||
"""Parses initial OpenMC simulation info from the OpenMC output files | ||
and stores it in the `Depcode` object's ``sim_info`` attribute. | ||
""" | ||
|
||
def read_depcode_step_param(self): | ||
"""Parses data from OpenMC depletion output for each step and stores | ||
it in `Depcode` object's ``param`` attributes. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these functions supposed to do anything? I don't see any text for them to do anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are uninplemented right now. They must be at least defined because they are abstract funtions in the Depcode
abstract class.
def read_dep_comp(self, read_at_end=False): | ||
"""Reads the depleted material data from the OpenMC depletion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see response above
def write_mat_file(self, dep_dict, dep_end_time): | ||
"""Writes the iteration input file containing the burnable materials |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see response above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @yardasol, overall looks good. I have some comments about some software decisions and documentation. Sorry for the delay
@@ -16,14 +17,24 @@ class Depcode(ABC): | |||
population, active, and inactive cycles. Contains methods to read template | |||
and output files, and write new input files for the depletion code. | |||
|
|||
Attributes | |||
----------- | |||
param : dict of str to type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear what this str or type is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've expanded the docstring.
saltproc/depcode.py
Outdated
iter_matfile : str | ||
Name of iterative, rewritable material file for depletion code | ||
rerunning. This file is modified during the simulation. | ||
template_inputfiles_path: str or dict of str to str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description is also not clear. What str?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
template_inputfiles_path
is a string
or a dict
where the key is a string
and the value is a string
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant that it's not clear what the str is or dict. If str, is it the solver name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've expanded the docstring.
|
||
Attributes: | ||
----------- | ||
param : dict of str to type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, not clear. What str and what type? Could provide more info in the next line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expanded the docstring.
class DepcodeSerpent(Depcode): | ||
r"""Class contains information about input, output, geometry, and | ||
template files for running Serpent2 depletion simulations. | ||
Also contains neutrons population, active, and inactive cycles. | ||
Contains methods to read template and output files, | ||
write new input files for Serpent2. | ||
|
||
Attributes | ||
----------- | ||
param : dict of str to type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment. Not clear what str and type are
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expanded the docstring.
----------- | ||
param : dict of str to type | ||
Holds Serpent depletion step parameter information | ||
sim_info : dict of str to type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment. Not clear what str and type are
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expanded the docstring.
saltproc/depcode.py
Outdated
template_inputfile_path="reactor.serpent", | ||
iter_inputfile="data/saltproc_reactor", | ||
iter_matfile="data/saltproc_mat", | ||
template_inputfiles_path="reactor.serpent", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I second what Amanda said about adding an _ between input and files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay it has been done
import argparse | ||
|
||
|
||
def parse_arguments(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you allowing the XML files to be in different locations? With normal OpenMC runs, users are expected to have XML files in the same path no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just for flexibility. In practice, the user doesn't call this function at all. See the DepcodeOpenMC.run_depcode
function for an example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also an artifact of how I've defined the template_inputfiles_path
variable, which has a path for each input file. Normally OpenMC expects the material, geometry, and settings files to be names materials.xml
, geometry.xml
, and settings.xml
respectively. In order for geometry changing to work, we need to be able to have multiple different geomery files in one directory, so they can't all be names geometry.xml
. Similar, we have an initial material composition that we start the simulation with, but we also have an iteration material file for each depletion step. If both of these had the name materials.xml
, they could overwrite each other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review for part 4.
Looks mostly good and clean. I added some comments for typos and for clarification on the non-critical input parameters that you're removing.
@LukeSeifert @gwenchee @smpark7 @abachma2 now that the CI is working, is this good for merge? |
Actually this should probably be rebased since it's been open for months |
@smpark7 I think I made the requested changes |
Summary of changes
This PR is the first of a series that adds OpenMC support into SaltProc. The scope of this PR is running OpenMC and handiling input files. Specifically, this PR:
iter_inputfile
iter_matfile
template_inputfile_path
input parameter totemplate_inputfiles_path
.app.py
template_inputfiles_path
through use of theallOf
keywork in the input schemadepcode.py
:param
andsim_info
attributes ofDepcode
andDepcodeSerpent
iter_inputfile
anditer_matfile
are now class attributes instead of class parameters for all classes.app.py
DepcodeOpenMC
__init__()
run_depcode()
openmc_deplete.py
, that loads the input files and runs the depletion simulation through OpenMC.switch_to_next_geometry()
write_depcode_input()
write_depletion_settings()
write_openmc_tallies()
Because this is such a large PR, we'll need to split up the review process:
saltproc/input_schema.json
examples/
msbr/msbr_main.json
tap/tap_main.json
saltproc/tests/
integration_tests/
const_repr/tap_main_test.json
no_repro/test_no_reproc_run.py
test.json
test_app.py
test_materialflow.py
test_process.py
test_separator.py
test_simulation.py
test_sparger.py
depcode.py
)saltproc/
input_schema.json
depcode.py
openmc_deplete.py
app.py
depcode.py
, alt)saltproc/
input_schema.json
depcode.py
test_depcode.py
doc/releasenotes/v0.5.0.rst
saltproc/simulation.py
scripts/preprocessors/generate_mat_composition/README.md
Types of changes
Required for Merging
Associated Issues and PRs
Associated Developers
Checklist for Reviewers
Reviewers should use this link to get to the
Review Checklist before they begin their review.