Skip to content
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

Prepare Simulation and App classes for OpenMC support, rework input file structure #98

Merged
merged 120 commits into from
Feb 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
9da4e00
add codename parameter to App.py
yardasol Jan 10, 2022
4c493f2
typo fixes
yardasol Jan 10, 2022
3cfd4b0
update test and example input files
yardasol Jan 10, 2022
4168ce4
remove un needed codename parameter
yardasol Jan 10, 2022
833969f
fix throw to raise
yardasol Jan 10, 2022
95a6131
fix typos in test input file
yardasol Jan 10, 2022
c7a2ac1
add test for codename
yardasol Jan 10, 2022
25e0b60
fix overlength line
yardasol Jan 10, 2022
0a0bb5f
pep8 fixes
yardasol Jan 12, 2022
538bbfc
more pep8 fixes
yardasol Jan 12, 2022
d7531a9
update Simulation docstring
yardasol Jan 13, 2022
b2af45c
update __init__ docstring
yardasol Jan 13, 2022
21b1fa3
h5_file -> db_path
yardasol Jan 13, 2022
c27c82b
compression -> compression_params
yardasol Jan 13, 2022
826e119
update run_sim_no_reproc docstring
yardasol Jan 13, 2022
5bedb32
update store_after_reproc docstring
yardasol Jan 13, 2022
b321e2c
dts -> dep_step in app.py
yardasol Jan 13, 2022
6399e59
update store_mat_data docstring
yardasol Jan 13, 2022
18c3599
dts, d_step -> dep_step in simulation.py
yardasol Jan 13, 2022
ac606b7
moment -> store_at_end (int -> bool); make necesary changes in other …
yardasol Jan 13, 2022
e2f1b6c
started writing tests for remaining simulation.py functions
yardasol Jan 13, 2022
e360c6c
rework + finish test_store_mat_data
yardasol Jan 14, 2022
2554e63
add test_store_run_init_info; restructure test_store_mat_data
yardasol Jan 14, 2022
aac559e
fix up test_write_store_run_init_info
yardasol Jan 14, 2022
d51cd78
Added test_store_run_step_info
yardasol Jan 14, 2022
4035363
added test_check_switch_geo_trigger
yardasol Jan 14, 2022
639cf22
typo fixes
yardasol Jan 14, 2022
47a8af6
make code consistnet w/ docstrings
yardasol Jan 14, 2022
ee689ea
Added test_store_after_reproc
yardasol Jan 15, 2022
56473bc
consistency fixes
yardasol Jan 15, 2022
4fd2c74
docstring edits
yardasol Jan 15, 2022
0ca64c6
(serpent->depcode in app.py (loose end))
yardasol Jan 17, 2022
88fea3d
start making input file a json input schema
yardasol Jan 25, 2022
949c524
fix merge conflict
yardasol Jan 25, 2022
c5d16e4
adjust docstrings of app.py
yardasol Jan 25, 2022
e7cdc1a
make test input file use JSON schema
yardasol Jan 25, 2022
19fcbf3
create actual JSON schema for input file; move comments to input_sche…
yardasol Jan 25, 2022
d1e6e08
add jsonschema package to environment.yml
yardasol Jan 25, 2022
2e1ad87
apply JSON schema input file changes to app.py
yardasol Jan 25, 2022
863a840
rename input_path -> rerun_path in depcode.py; doc adjustments
yardasol Jan 25, 2022
6117605
move check_restart from app.py to simulation.py
yardasol Jan 25, 2022
7d0f3ff
move integration test function to the integration tests
yardasol Jan 25, 2022
0431fd4
remove iter_matfile from simulation.py
yardasol Jan 25, 2022
72c49cf
input_file->iter_input_file; move iter_input_file and iter_matfile to…
yardasol Jan 25, 2022
5fdef26
update unit tests to show where we need to fix them
yardasol Jan 25, 2022
72a1816
typo fixes in app.py
yardasol Jan 25, 2022
4b7356c
make unit + integration tests work with new input format + varnames
yardasol Jan 26, 2022
2117221
fix first integration test failing
yardasol Jan 26, 2022
1feb332
rename input parmaeters
yardasol Jan 26, 2022
3447d20
add validation keywords to input_schema.json
yardasol Jan 26, 2022
62f9c1f
template_path -> input_template_path
yardasol Jan 26, 2022
fea00cd
template_path->input_template_path
yardasol Jan 26, 2022
b727840
typo fixes in input_schema.json
yardasol Jan 26, 2022
6cdacfb
added saltprocjsonschema package to store the input schema
yardasol Jan 26, 2022
54f993f
input_template_path -> template_inputfile_path; iter_input_file->iter…
yardasol Jan 26, 2022
ff63dda
apply variable changes to the test suite
yardasol Jan 26, 2022
eed34c8
add input_schema.json to the package
yardasol Jan 26, 2022
5148fc5
apply input changes to const_repr integration test; typo fixes in app.py
yardasol Jan 26, 2022
7af5547
add adjust_geo and restart_flag setting to simulation object in app.py
yardasol Jan 26, 2022
37955ce
added jsonschema to installation instructions and requirements.txt
yardasol Jan 27, 2022
f556fab
make the input path global
yardasol Jan 27, 2022
11f1d5f
update test_const_reproc_run.py to reflect new outpur dir
yardasol Jan 27, 2022
84f10d0
typo fix
yardasol Jan 27, 2022
c6d46f3
typo fix
yardasol Jan 27, 2022
e00c55b
update msbr input file
yardasol Jan 27, 2022
0397f4e
update tap_main.json
yardasol Jan 27, 2022
67c031e
update input_schema.json
yardasol Jan 27, 2022
42c07a6
remove saltprocinputschema.py
yardasol Jan 27, 2022
8aaf281
typo fix in msbr_main.json
yardasol Jan 27, 2022
03b9c54
+ test_switch_to_next_geometry to test_depcode.py
yardasol Jan 28, 2022
f694973
+ switch_to_next_geometry to depcode.py
yardasol Jan 28, 2022
7b4526a
Add abstract function for switch_to_next_geometry
yardasol Jan 28, 2022
d44e8a8
Add abstract function for read_depcode_sim_info
yardasol Jan 28, 2022
daf86f2
added abstract method for read_depcode_step_info
yardasol Jan 28, 2022
c420c14
add psudocode for generalizing store_info and store_step_info methods
yardasol Jan 28, 2022
234f2d1
import shutil in test_depcode.py
yardasol Jan 28, 2022
e99c2cc
get test_switch_to_next_geometry working in test_depcode.py
yardasol Jan 28, 2022
0e32b6d
remove switch_to_next_geometry from simulation.py
yardasol Jan 28, 2022
2fb9199
simulation.switch_to_next_geometry -> depcode.switch_to_next_geometry…
yardasol Jan 28, 2022
961dfe8
add Step_info class to Depcode
yardasol Jan 28, 2022
8806c3c
Step_info -> self.sim_depcode.Step_info
yardasol Jan 28, 2022
97a481c
fix indentation in Depcode.Step_info
yardasol Jan 28, 2022
51a005f
undo adding Step_info to Depcode
yardasol Jan 28, 2022
96846ba
add 'depcode_name' field to 'sim_info_dtype'; serpent->depcode in sim…
yardasol Jan 28, 2022
7bdbd1a
add depcode_name field to read_depcode_info; consistency changes
yardasol Jan 28, 2022
e181e47
typo fix in simulation.py
yardasol Jan 28, 2022
6d09517
typo fix in simulation.py
yardasol Jan 28, 2022
8a7ac98
typo fix in depcode.py
yardasol Jan 28, 2022
0d964bd
update test_read_depcode_info
yardasol Jan 28, 2022
f99c5d9
update test_store_run_init_info
yardasol Jan 28, 2022
a5d7058
add db.close statements to except blocks in test_simulation.py
yardasol Jan 28, 2022
03ae0ab
Add more except blocks to tests in test_simulation.py
yardasol Jan 28, 2022
617588c
remove machine specific paths in msbr example
yardasol Jan 28, 2022
7b4a34a
remove some machine specifc paths in tap.serpent and tap_plot.serpent
yardasol Jan 28, 2022
3878c54
pep8 fixes
yardasol Jan 28, 2022
4e7e820
more pep8 fixes; remove cruft
yardasol Jan 28, 2022
a773119
even more pep8 fixes
yardasol Jan 28, 2022
b33b247
fix extra line
yardasol Jan 28, 2022
a6eb03b
remove cruft from depcode.py
yardasol Jan 28, 2022
6cacd06
Merge branch 'master' into generalize-simulation
yardasol Jan 28, 2022
849f186
remove reference to serpent in App.parse_arguments
yardasol Feb 2, 2022
83a8e17
typo fix in docstring of test_check_switch_geo_trigger
yardasol Feb 4, 2022
ad86976
make nsteps in runsim_no_reproc match its docstring definition
yardasol Feb 4, 2022
cb2c556
remove requirement for depsteps to match implied behavior in app.py
yardasol Feb 4, 2022
2d83302
fix comment referring to cores as nodes
yardasol Feb 4, 2022
ca5a8c4
docstring format fixes
yardasol Feb 4, 2022
ae7e20a
print 'database' instead of 'DB'
yardasol Feb 4, 2022
781f76f
fix typo in input_schema.json
yardasol Feb 4, 2022
fdc4842
input params: depsteps->num_depstes, depl_hist -> dep_step_length_cum…
yardasol Feb 4, 2022
1fafe34
fix typo in test_app.py
yardasol Feb 4, 2022
a272b56
apply changes from fdc4842 to test.json
yardasol Feb 4, 2022
4676880
sss_meta_zzz -> convert_nuclide_name_serpent_to_zam
yardasol Feb 4, 2022
3527e7d
get_tra_or_dec -> create_nuclide_name_map_zam_to_serpent
yardasol Feb 4, 2022
a285361
fix missing '{' in input_schema.json
yardasol Feb 4, 2022
0774592
read_depcode_template -> read_plaintext_file
yardasol Feb 4, 2022
4c8fce1
pep8 fixes
yardasol Feb 4, 2022
3082496
more pep8 fixes
yardasol Feb 4, 2022
a44d419
update docstring for create_nuclide_name_map_zam_to_serpent
yardasol Feb 4, 2022
7d75b04
Revert "make nsteps in runsim_no_reproc match its docstring definition"
yardasol Feb 7, 2022
98e90c6
3step -> 2step
yardasol Feb 7, 2022
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
2 changes: 2 additions & 0 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ SaltProc has the following dependencies:
#. `PyTables`_
#. `NetworkX`_
#. `PyDotPlus`_
#. `jsonschema`_

.. _Serpent: http://montecarlo.vtt.fi
.. _PyNE: http://pyne.io
Expand All @@ -24,6 +25,7 @@ SaltProc has the following dependencies:
.. _matplotlib: http://matplotlib.org
.. _ViTables: http://vitables.org
.. _GitHub: http://github.com/arfc/saltproc
.. _jsonschema: https://github.com/Julian/jsonschema
.. _conda package manager: https://docs.conda.io/en/latest/
.. _mamba: https://github.com/mamba-org/mamba

Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ dependencies:
- networkx
- pydotplus
- pytest
- jsonschema
- pip:
- argparse==1.4.0
6 changes: 3 additions & 3 deletions examples/msbr/msbr.serpent
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ therm gr 900 gre7.18t gre7.20t % 900K C-nat
set title "MSBR Saltproc long-term, 91% removal, BOL, fresh fuel, ENDF"


set acelib "/home/andrei2/serpent/xsdata/endfb7/sss_endfb7.xsdata"
set declib "/home/andrei2/serpent/xsdata/endfb7/sss_endfb7.dec"
set nfylib "/home/andrei2/serpent/xsdata/endfb7/sss_endfb7.nfy"
set acelib "sss_endfb7.xsdata"
set declib "sss_endfb7.dec"
set nfylib "sss_endfb7.nfy"
Comment on lines +54 to +56
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't have any issues with finding these files? Would this need to be changed if it were run on a different machine?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These files are discoverable if the user sets their path variables correctly, which they'll need to do if they want serpent to run properly. I think I added a section in the docs pointing to the serpent wiki, but it may be worth repeating on our own docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added some details about this in issue #109


%set acelib "sss_jeff312.xsdata"
%set declib "sss_jeff33.dec"
Expand Down
43 changes: 27 additions & 16 deletions examples/msbr/msbr_main.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
{
"Path to Serpent executable": "sss2",
"File containing processing system objects": "msbr_objects.json",
"Graph file containing processing system structure": "msbr.dot",
"User's Serpent input file with reactor model": "msbr.serpent",
"Path output data storing folder": "../../saltproc/data/",
"Output HDF5 database file name": "msbr_kl_100_saltproc.h5",
"Number of neutrons per generation": 50,
"Number of active generations": 20,
"Number of inactive generations": 20,
"Restart simulation from the step when it stopped?": false,
"Geometry file/files to use in Serpent runs": "geometry/msbr_full.ini",
"Switch to another geometry when keff drops below 1?": false,
"Salt mass flow rate throughout reactor core (g/s)": 9920000,
"Number of steps for constant power and depletion interval case": 12,
"Depletion step interval or Cumulative time (end of step) (d)": 3,
"Reactor power or power step list during depletion step (W)": 2250000000
"proc_input_file": "msbr_objects.json",
"dot_input_file": "msbr.dot",
"output_path": "./data",
"num_depsteps": 12,
"depcode": {
"codename": "serpent",
"exec_path": "sss2",
"template_inputfile_path": "./msbr.serpent",
"iter_inputfile": "saltproc_serpent",
"iter_matfile": "saltproc_mat",
"npop": 50,
"active_cycles": 20,
"inactive_cycles": 20,
"geo_file_paths": ["./geometry/msbr_full.ini"]
},
"simulation": {
"sim_name": "msbr_example_simulation",
"db_name": "msbr_kl_100_saltproc.h5",
"restart_flag": false,
"adjust_geo": false
},
"reactor": {
"volume": 1.0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come the volume is listed as 1? The volume listed in "mats/msbr_saltproc_prepr_comp.ini" is 4.871E7.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. In v0.3.0, themsr object of type Reactor in app.py was hardcoded with a volume of 1.0:

     msr = Reactor(
         volume=1.0,
         mass_flowrate=core_massflow_rate,
         power_levels=power_hist,
         depl_hist=depl_hist)

but the volume attribute never seems to be used anywhere in the code. Maybe @andrewryh can provide some insight?

"mass_flowrate": 9920000,
"power_levels": [ 2250000000 ],
"dep_step_length_cumulative": [ 3 ]
}
}
6 changes: 3 additions & 3 deletions examples/tap/tap.serpent
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ include "mats/non_burnable_mats.ini"
set title "TAP MSR test 5-d step"

%therm zrh_h 900 hzr05.32t hzr06.32t % 900K H-Zr
%set acelib "/home/andrei2/serpent/xsdata/endfb7/sss_endfb7.xsdata"
%set declib "/home/andrei2/serpent/xsdata/endfb7/sss_endfb7.dec"
%set nfylib "/home/andrei2/serpent/xsdata/endfb7/sss_endfb7.nfy"
%set acelib "sss_endfb7.xsdata"
%set declib "sss_endfb7.dec"
%set nfylib "sss_endfb7.nfy"

set acelib "sss_jeff312.xsdata"
set declib "sss_jeff33.dec"
Expand Down
75 changes: 43 additions & 32 deletions examples/tap/tap_main.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,45 @@
{
LukeSeifert marked this conversation as resolved.
Show resolved Hide resolved
"Path to Serpent executable": "sss2",
"File containing processing system objects": "tap_objects.json",
"Graph file containing processing system structure": "tap.dot",
"User's Serpent input file with reactor model": "tap.serpent",
"Path output data storing folder": "../../saltproc/data/",
"Output HDF5 database file name": "db_saltproc.h5",
"Number of neutrons per generation": 50,
"Number of active generations": 20,
"Number of inactive generations": 20,
"Restart simulation from the step when it stopped?": false,
"Geometry file/files to use in Serpent runs": [
"geometry/347_base.ini",
"geometry/406.ini",
"geometry/427.ini",
"geometry/505.ini",
"geometry/576.ini",
"geometry/633.ini",
"geometry/681.ini",
"geometry/840.ini",
"geometry/880.ini",
"geometry/900.ini",
"geometry/988.ini",
"geometry/1126.ini",
"geometry/1338.ini",
"geometry/1498.ini",
"geometry/1668_all.ini"
],
"Switch to another geometry when keff drops below 1?": true,
"Salt mass flow rate throughout reactor core (g/s)": 9920000,
"Number of steps for constant power and depletion interval case": 3,
"Depletion step interval or Cumulative time (end of step) (d)": 2,
"Reactor power or power step list during depletion step (W)": 1250000000
"proc_input_file": "tap_objects.json",
"dot_input_file": "tap.dot",
"output_path": "./data",
"num_depsteps": 3,
"depcode": {
"codename": "serpent",
"exec_path": "sss2",
"template_inputfile_path": "./tap.serpent",
"iter_inputfile": "saltproc_serpent",
"iter_matfile": "saltproc_mat",
"npop": 50,
"active_cycles": 20,
"inactive_cycles": 20,
"geo_file_paths": [
"./geometry/347_base.ini",
"./geometry/406.ini",
"./geometry/427.ini",
"./geometry/505.ini",
"./geometry/576.ini",
"./geometry/633.ini",
"./geometry/681.ini",
"./geometry/840.ini",
"./geometry/880.ini",
"./geometry/900.ini",
"./geometry/988.ini",
"./geometry/1126.ini",
"./geometry/1338.ini",
"./geometry/1498.ini",
"./geometry/1668_all.ini"
]
},
"simulation": {
"sim_name": "test_simulation",
"db_name": "db_saltproc.h5",
"restart_flag": false,
"adjust_geo": true
},
"reactor": {
"volume": 1.0,
"mass_flowrate": 9920000,
"power_levels": [ 1250000000 ],
"dep_step_length_cumulative": [ 2 ]
}
}
6 changes: 3 additions & 3 deletions examples/tap/tap_plot.serpent
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ include "geometry/347_base.ini"
set title "TAP MSR test 5-d step"

%therm zrh_h 900 hzr05.32t hzr06.32t % 900K H-Zr
%set acelib "/home/andrei2/serpent/xsdata/endfb7/sss_endfb7.xsdata"
%set declib "/home/andrei2/serpent/xsdata/endfb7/sss_endfb7.dec"
%set nfylib "/home/andrei2/serpent/xsdata/endfb7/sss_endfb7.nfy"
%set acelib "sss_endfb7.xsdata"
%set declib "sss_endfb7.dec"
%set nfylib "sss_endfb7.nfy"

set acelib "sss_jeff312.xsdata"
set declib "sss_jeff33.dec"
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pyne
numpy
scipy
json
jsonschema
pytables
networkx
pydotplus
Loading