diff --git a/doc/content/bib/journal-publications.bib b/doc/content/bib/journal-publications.bib index e74cb1bc38..9264194243 100644 --- a/doc/content/bib/journal-publications.bib +++ b/doc/content/bib/journal-publications.bib @@ -1,39 +1,3 @@ -@article{park_verification_2022, - title = {Verification of moltres for multiphysics simulations of fast-spectrum molten salt reactors}, - volume = {173}, - issn = {03064549}, - url = {https://linkinghub.elsevier.com/retrieve/pii/S0306454922001463}, - doi = {10.1016/j.anucene.2022.109111}, - abstract = {Modeling strongly coupled neutronics and thermal–hydraulics in liquid-fueled MSRs requires robust and flexible multiphysics software for accurate simulations at reasonable computational costs. In this paper, we present Moltres and its neutronics and thermal–hydraulics modeling capabilities relevant to multiphysics reactor analysis. As a MOOSE-based application, Moltres provides various multiphysics coupling schemes and time-stepping methods, including fully coupled solves with implicit time-stepping. We verified Moltres’ MSR modeling capabilities against a multiphysics numerical benchmark developed for software dedicated to modeling fast-spectrum MSRs. The results show that Moltres performed comparably to participating software packages in the benchmark; the majority of the relevant quantities fell within one standard deviation of the benchmark average. Among the participating multiphysics tools in the benchmark, Moltres agrees closest to the multiphysics tool from the Delft University of Technology due to similarities in the numerical solution techniques and meshing schemes.}, - language = {en}, - urldate = {2022-04-26}, - journal = {Annals of Nuclear Energy}, - author = {Park, Sun Myung and Munk, Madicken}, - month = aug, - year = {2022}, - pages = {109111}, - file = {Park and Munk - 2022 - Verification of moltres for multiphysics simulatio.pdf:C\:\\Users\\Sun Myung\\Zotero\\storage\\PHNTVU4R\\Park and Munk - 2022 - Verification of moltres for multiphysics simulatio.pdf:application/pdf}, -} - -@article{lindsay_introduction_2018, - title = {Introduction to {Moltres}: {An} application for simulation of {Molten} {Salt} {Reactors}}, - volume = {114}, - issn = {0306-4549}, - shorttitle = {Introduction to {Moltres}}, - url = {https://linkinghub.elsevier.com/retrieve/pii/S0306454917304760}, - doi = {10.1016/j.anucene.2017.12.025}, - abstract = {Moltres is a new physics application for modeling coupled physics in fluid-fuelled, molten salt reactors. This paper describes its neutronics model, thermal hydraulics model, and their coupling in the MOOSE framework. Neutron and precursor equations are implemented using an action system that allows use of an arbitrary number of groups with no change in the input card. Results for many-channel configurations in 2D-axisymmetric and 3D coordinates are presented and compared against other coupled models as well as the Molten Salt Reactor Experiment.}, - language = {en}, - urldate = {2018-01-08}, - journal = {Annals of Nuclear Energy}, - author = {Lindsay, Alexander and Ridley, Gavin and Rykhlevskii, Andrei and Huff, Kathryn}, - month = apr, - year = {2018}, - keywords = {agent based modeling, Finite elements, Hydrologic contaminant transport, MOOSE, Multiphysics, nuclear engineering, Nuclear fuel cycle, Object orientation, Parallel computing, Reactor physics, repository, Simulation, Systems analysis}, - pages = {530--540}, - annote = {2d prescribed}, - file = {Lindsay et al. - 2018 - Introduction to Moltres An application for simula.pdf:C\:\\Users\\Sun Myung\\Zotero\\storage\\RCWUNGTP\\Lindsay et al. - 2018 - Introduction to Moltres An application for simula.pdf:application/pdf;Lindsay et al. - 2018 - Introduction to Moltres An application for simula.pdf:C\:\\Users\\Sun Myung\\Zotero\\storage\\3GEC6NQ9\\Lindsay et al. - 2018 - Introduction to Moltres An application for simula.pdf:application/pdf;Moltres.pdf:C\:\\Users\\Sun Myung\\Zotero\\storage\\4XDXRICB\\Moltres.pdf:application/pdf;ScienceDirect Full Text PDF:C\:\\Users\\Sun Myung\\Zotero\\storage\\E2T9U5IX\\Lindsay et al. - 2018 - Introduction to Moltres An application for simula.pdf:application/pdf;ScienceDirect Snapshot:C\:\\Users\\Sun Myung\\Zotero\\storage\\3DT9TEY3\\S0306454917304760.html:text/html}, -} @article{lindsay_moltres_2018, title = {Moltres: finite element based simulation of molten salt reactors}, @@ -77,3 +41,39 @@ @article{lindsay_moltres_2018 pages = {1--2}, file = {Full Text PDF:C\:\\Users\\Sun Myung\\Zotero\\storage\\MJIZZW4P\\Lindsay and Huff - 2018 - Moltres finite element based simulation of molten.pdf:application/pdf;Snapshot:C\:\\Users\\Sun Myung\\Zotero\\storage\\E3ARQ46H\\joss.html:text/html}, } + +@article{lindsay_introduction_2018, + title = {Introduction to {Moltres}: {An} application for simulation of {Molten} {Salt} {Reactors}}, + volume = {114}, + issn = {0306-4549}, + shorttitle = {Introduction to {Moltres}}, + url = {https://linkinghub.elsevier.com/retrieve/pii/S0306454917304760}, + doi = {10.1016/j.anucene.2017.12.025}, + abstract = {Moltres is a new physics application for modeling coupled physics in fluid-fuelled, molten salt reactors. This paper describes its neutronics model, thermal hydraulics model, and their coupling in the MOOSE framework. Neutron and precursor equations are implemented using an action system that allows use of an arbitrary number of groups with no change in the input card. Results for many-channel configurations in 2D-axisymmetric and 3D coordinates are presented and compared against other coupled models as well as the Molten Salt Reactor Experiment.}, + language = {en}, + urldate = {2018-01-08}, + journal = {Annals of Nuclear Energy}, + author = {Lindsay, Alexander and Ridley, Gavin and Rykhlevskii, Andrei and Huff, Kathryn}, + month = apr, + year = {2018}, + keywords = {Reactor physics, Parallel computing, agent based modeling, Finite elements, Hydrologic contaminant transport, MOOSE, Multiphysics, nuclear engineering, Nuclear fuel cycle, Object orientation, repository, Simulation, Systems analysis}, + pages = {530--540}, + file = {Lindsay et al. - 2018 - Introduction to Moltres An application for simula.pdf:C\:\\Users\\Sun Myung\\Zotero\\storage\\RCWUNGTP\\Lindsay et al. - 2018 - Introduction to Moltres An application for simula.pdf:application/pdf;Lindsay et al. - 2018 - Introduction to Moltres An application for simula.pdf:C\:\\Users\\Sun Myung\\Zotero\\storage\\3GEC6NQ9\\Lindsay et al. - 2018 - Introduction to Moltres An application for simula.pdf:application/pdf;Moltres.pdf:C\:\\Users\\Sun Myung\\Zotero\\storage\\4XDXRICB\\Moltres.pdf:application/pdf;ScienceDirect Full Text PDF:C\:\\Users\\Sun Myung\\Zotero\\storage\\E2T9U5IX\\Lindsay et al. - 2018 - Introduction to Moltres An application for simula.pdf:application/pdf;ScienceDirect Snapshot:C\:\\Users\\Sun Myung\\Zotero\\storage\\3DT9TEY3\\S0306454917304760.html:text/html}, +} + +@article{park_verification_2022, + title = {Verification of moltres for multiphysics simulations of fast-spectrum molten salt reactors}, + volume = {173}, + issn = {03064549}, + url = {https://linkinghub.elsevier.com/retrieve/pii/S0306454922001463}, + doi = {10.1016/j.anucene.2022.109111}, + abstract = {Modeling strongly coupled neutronics and thermal–hydraulics in liquid-fueled MSRs requires robust and flexible multiphysics software for accurate simulations at reasonable computational costs. In this paper, we present Moltres and its neutronics and thermal–hydraulics modeling capabilities relevant to multiphysics reactor analysis. As a MOOSE-based application, Moltres provides various multiphysics coupling schemes and time-stepping methods, including fully coupled solves with implicit time-stepping. We verified Moltres’ MSR modeling capabilities against a multiphysics numerical benchmark developed for software dedicated to modeling fast-spectrum MSRs. The results show that Moltres performed comparably to participating software packages in the benchmark; the majority of the relevant quantities fell within one standard deviation of the benchmark average. Among the participating multiphysics tools in the benchmark, Moltres agrees closest to the multiphysics tool from the Delft University of Technology due to similarities in the numerical solution techniques and meshing schemes.}, + language = {en}, + urldate = {2022-04-26}, + journal = {Annals of Nuclear Energy}, + author = {Park, Sun Myung and Munk, Madicken}, + month = aug, + year = {2022}, + pages = {109111}, + file = {Park and Munk - 2022 - Verification of moltres for multiphysics simulatio.pdf:C\:\\Users\\Sun Myung\\Zotero\\storage\\PHNTVU4R\\Park and Munk - 2022 - Verification of moltres for multiphysics simulatio.pdf:application/pdf}, +} diff --git a/doc/content/bib/theses.bib b/doc/content/bib/theses.bib index 37f74032a5..011b385b8d 100644 --- a/doc/content/bib/theses.bib +++ b/doc/content/bib/theses.bib @@ -1,4 +1,17 @@ +@mastersthesis{park_advancement_2020, + address = {Urbana, IL}, + title = {Advancement and {Verification} of {Moltres} for {Molten} {Salt} {Reactor} {Safety} {Analysis}}, + copyright = {Copyright 2020 Sun Myung Park}, + url = {https://www.ideals.illinois.edu/handle/2142/108542}, + language = {English}, + school = {University of Illinois at Urbana-Champaign}, + author = {Park, Sun Myung}, + month = aug, + year = {2020}, + file = {Park - 2020 - Advancement and Verification of Moltres for Molten.pdf:C\:\\Users\\Sun Myung\\Zotero\\storage\\JYYYTBJ7\\Park - 2020 - Advancement and Verification of Moltres for Molten.pdf:application/pdf}, +} + @mastersthesis{fairhurst-agosta_multi-physics_2020, address = {Urbana, IL}, title = {Multi-{Physics} and {Technical} {Analysis} of {High}-{Temperature} {Gas}-{Cooled} {Reactors} for {Hydrogen} {Production}}, @@ -33,19 +46,6 @@ @mastersthesis{lee_neutronics_2020 file = {Lee - 2020 - Neutronics and Thermal-Hydraulics Analysis of Tran.pdf:C\:\\Users\\Sun Myung\\Zotero\\storage\\73JPRPQ3\\Lee - 2020 - Neutronics and Thermal-Hydraulics Analysis of Tran.pdf:application/pdf}, } -@mastersthesis{park_advancement_2020, - address = {Urbana, IL}, - title = {Advancement and {Verification} of {Moltres} for {Molten} {Salt} {Reactor} {Safety} {Analysis}}, - copyright = {Copyright 2020 Sun Myung Park}, - url = {https://www.ideals.illinois.edu/handle/2142/108542}, - language = {English}, - school = {University of Illinois at Urbana-Champaign}, - author = {Park, Sun Myung}, - month = aug, - year = {2020}, - file = {Park - 2020 - Advancement and Verification of Moltres for Molten.pdf:C\:\\Users\\Sun Myung\\Zotero\\storage\\JYYYTBJ7\\Park - 2020 - Advancement and Verification of Moltres for Molten.pdf:application/pdf}, -} - @mastersthesis{pater_multiphysics_2019, title = {Multiphysics simulations of {Molten} {Salt} {Reactors} using the {Moltres} code}, copyright = {http://creativecommons.org/licenses/by-nc-sa/3.0/es/}, @@ -61,3 +61,17 @@ @mastersthesis{pater_multiphysics_2019 keywords = {Àrees temàtiques de la UPC::Física, Nuclear engineering--Safety measures, Reactors nuclears -- Mesures de seguretat -- Simulació per ordinador}, file = {Full Text PDF:C\:\\Users\\Sun Myung\\Zotero\\storage\\NWWJN9XA\\Pater - 2019 - Multiphysics simulations of Molten Salt Reactors u.pdf:application/pdf;Snapshot:C\:\\Users\\Sun Myung\\Zotero\\storage\\QZJV3C6Z\\173747.html:text/html}, } + +@phdthesis{chee_fluoride-salt-cooled_2022, + address = {Urbana, IL}, + type = {Dissertation}, + title = {Fluoride-{Salt}-{Cooled} {High} {Temperature} {Reactor} {Design} {Optimization} with {Evolutionary} {Algorithms}}, + copyright = {Copyright 2021 Gwendolyn Jin Yi Chee}, + url = {https://github.com/arfc/2022-chee-dissertation}, + abstract = {Additive manufacturing of reactor core components removes the geometric constraints required by conventional manufacturing, such as slabs as fuel planks and cylinders as fuel rods. Due to the expansion of the potential design space facilitated through additive manufacturing, reactor designers need to find methods, such as generative design, to explore the design space efficiently. In this defense, I will show that I successfully applied evolutionary algorithms to conduct generative reactor design optimization for a fluoride-salt-cooled high-temperature reactor (FHR). I achieved this through three distinct research efforts: 1) furthering our understanding of the FHR design’s complexities through neutronics and temperature modeling, 2) creating an open-source tool that enables generative design reactor optimization with evolutionary algorithms, and 3) applying the tool to the FHR to optimize for non-conventional geometries and fuel distributions}, + school = {University of Illinois at Urbana-Champaign}, + author = {Chee, Gwendolyn Jin Yi}, + month = aug, + year = {2022}, + file = {2022-chee-dissertation-pres.pdf:C\:\\Users\\Sun Myung\\Zotero\\storage\\Y93FYTHR\\2022-chee-dissertation-pres.pdf:application/pdf;Chee - 2021 - Fluoride-Salt-Cooled High Temperature Reactor Desi.pdf:C\:\\Users\\Sun Myung\\Zotero\\storage\\EXF7M46A\\Chee - 2021 - Fluoride-Salt-Cooled High Temperature Reactor Desi.pdf:application/pdf}, +} diff --git a/doc/content/css/moltres.css b/doc/content/css/moltres.css index bfe363c964..ad593956c9 100644 --- a/doc/content/css/moltres.css +++ b/doc/content/css/moltres.css @@ -68,3 +68,10 @@ footer.page-footer{ color: var(--uiuc-blue); font-weight:400; } + +@media (prefers-color-scheme: dark), (prefers-dark-interface) { + .dropdown-content li > a, .dropdown-content li > span { + background-color: var(--darkmode-navigator); + color: var(--darkmode-fore); + } +} diff --git a/doc/content/getting_started/eigenvalue.md b/doc/content/getting_started/eigenvalue.md new file mode 100644 index 0000000000..3fae3451bf --- /dev/null +++ b/doc/content/getting_started/eigenvalue.md @@ -0,0 +1,29 @@ +# Eigenvalue Calculation with NtAction + +The input files associated with this tutorial are +[moltres/tutorial/eigenvalue/nts.i](https://github.com/arfc/moltres/blob/devel/tutorial/eigenvalue/nts.i) and +[moltres/tutorial/eigenvalue/nts-action.i](https://github.com/arfc/moltres/blob/devel/tutorial/eigenvalue/nts-action.i). +Refer to [Tutorial 2a](getting_started/input_syntax.md) for an introduction on the input file +syntax and in-depth descriptions of every input parameter. + +As mentioned in Tutorial 2a, this example involves a simple 2-D axisymmetric core model of the +Molten Salt Reactor Experiment (MSRE) that was developed at Oak Ridge National Laboratory. The +figure below shows the 2-D MSRE model for this tutorial. It is a 70.8 cm by 169 cm rectangle that +is axisymmetric about the left boundary. The domain consists of 14 fuel channels, alternating with +14 solid graphite moderator regions, represented in the figure by gray and red rectangles, +respectively. + +!media media/msre_2d.png + id=msre-2d + caption=2-D axisymmetric model of the MSRE + style=width:35%;text-align:center;margin-left:auto;margin-right:auto; + +For multiplication factor ($k$) eigenvalue calculations, Moltres relies on the +`InversePowerMethod` or `NonlinearEigen` executioners from MOOSE. These executioners solve the +neutron diffusion equations set up as an eigenvalue problem to find $k$ and the neutron flux +distribution, which occur as the absolute minimum eigenvalue $1/k$ and the corresponding +eigenvector of the system. The mathematical background and documentation for these executioners can +be found [here](https://mooseframework.inl.gov/source/executioners/InversePowerMethod.html). This +tutorial uses the `InversePowerMethod` executioner which applies the inverse power method. + + diff --git a/doc/content/getting_started/input_syntax.md b/doc/content/getting_started/input_syntax.md new file mode 100644 index 0000000000..984900c37f --- /dev/null +++ b/doc/content/getting_started/input_syntax.md @@ -0,0 +1,611 @@ +# Introduction to the Moltres Input File Syntax + +The input file example documented here is taken from +[`moltres/tutorial/eigenvalue/nts.i`](https://github.com/arfc/moltres/blob/devel/tutorial/eigenvalue/nts.i) for the Eigenvalue Calculation tutorial. +This is a simple 2-D axisymmetric core model of the Molten Salt Reactor Experiment (MSRE) +that was developed at Oak Ridge National Laboratory and was operated from 1965 +through 1969. Simulation results from a similar 2-D model are documented in the +article, +[Introduction to Moltres: An application for simulation of Molten Salt Reactors](http://arfc.github.io/papers/lindsay_introduction_2018.pdf), +which discusses simulation results, and compares them to a 3-D Moltres model of +the MSRE and to MSRE data and calculated results. + +Assuming that Moltres has been successfully compiled, to execute this input file +from the command line, run the following from a terminal window, substituting +`$moltres_root` with the path to the Moltres root directory: + +``` +cd $moltres_root/tutorial/eigenvalue +../../moltres-opt -i nts.i +``` + +In serial, this job takes around 9 seconds on a 4.3 GHz machine. To run the job in +parallel, execute: + +``` +mpirun -n 2 ../../moltres-opt -i nts.i +``` + +where the number of processors can be changed from 2 to however many processes +you want to run. The parallel performance of the job depends on the number of +degrees of freedom in the problem and the preconditioner used. A general rule of +thumb for optimal scaling is not to go below 10k degrees of freedom per +processor, otherwise communication becomes a performance drag. Additionally many +preconditioners do not perform as well when spread over multiple processes as +they lose access to "new" information. (See +http://www.mcs.anl.gov/petsc/documentation/faq.html#slowerparallel for more +discussion of this). This particular input file (`nts.i`) only has +9,308 degrees of freedom so communication is a factor; we can get faster solution +time with more processors, albeit at sublinear scaling. On the same 4.3 GHz machine, the +solution times for 1-4 processors are given below. + +- Single processor solution time: 9.1 seconds +- Two processors: 5.4 seconds +- Four processors: 3.6 seconds + +The Exodus output file corresponding to the input file under discussion will be generated as +`nts.e` after running the input file. The most common application for visualizing Exodus files is +[ParaView](https://www.paraview.org/), although +[VisIt](https://wci.llnl.gov/simulation/computer-codes/visit/) or [yt](http://yt-project.org/) may +also be used. + +## Model Geometry id=model-geom + +The figure below shows the domain for the 2-D MSRE model. It is a +72.2 cm by 165 cm rectangle that is axisymmetric about the left boundary. +The domain consists of 14 fuel channels, alternating with +14 solid graphite moderator regions, represented in the figure by +gray and red rectangles, respectively. + +!media media/msre_2d.png + id=msre-2d + caption=2-D axisymmetric model of the MSRE + style=width:35%;text-align:center;margin-left:auto;margin-right:auto; + +## File Format id=file-format + +Moltres is built on top of the MOOSE framework, and the input file uses the "hierarchical +input text format" (hit) input format adopted by MOOSE. A brief description of the +input syntax is presented +[here](https://www.mooseframework.org/application_usage/input_syntax.html). +This is a relatively simple file format that uses `[names in brackets]` to mark the +start of input blocks. Empty brackets `[]` are used to indicate +the end of a block. *Note that block names and parameter names are generally case +sensitive in the input file.* In addition, in Moltres/MOOSE input files, the `#` +symbol is used to mark the start of a comment. Comments may start anywhere on a line. + +## Substitution Variables id=sub-var + +Root level variables can be used as substitution variables throughout the document +by using the syntax `${varname}`. Starting at the top of the input file, the +following substitution variables are defined: + +``` +flow_velocity=17.55 # cm/s +``` + +`flow_velocity` is used to set the upward flow velocity of the fuel/molten +salt in this model. Comments can be added after the `#` character for inline documentation. + +You may set the flow velocity to zero to obtain the multiplication factor of this +system without delayed neutron precursor (DNP) drift. Note that this input file does not model the +looping of DNPs back into the core after flowing through out-of-core components. Therefore, all +DNPs flowing out of the core are considered lost. + +## GlobalParams Block id=global-params + +Following the substitution variable definitions, we have the `GlobalParams` block: + +``` +[GlobalParams] + num_groups = 2 + num_precursor_groups = 6 + use_exp_form = false + group_fluxes = 'group1 group2' + temperature = temp + sss2_input = true + pre_concs = 'pre1 pre2 pre3 pre4 pre5 pre6' + account_delayed = true +[] +``` + +In `GlobalParams`, parameters like `num_groups` can be globally set to a +value. Consequently any class (e.g. the kernel class `GroupDiffusion`) that has +the parameter `num_groups` will read in a value of `2` unless it is overridden +locally in its input block. It should be noted that the `GlobalParams` +block and any other MOOSE input block can be placed anywhere in the input file. +At execution time each block will be read when it is needed. Below is a description +of the parameters included in the GlobalParams section: + +- `num_groups`: The number of energy groups for neutron diffusion +- `num_precursor_groups`: The number of delayed neutron precursor groups +- `use_exp_form`: Whether the actual neutron/precursor fluxes/concentrations + should be represented by $u$ or $e^u$ where $u$ is the actual variable + value +- `group_fluxes`: The names of the neutron group fluxes +- `temperature`: The name of the temperature variable. Some of the kernel or boundary + condition variables require an input named `temperature` which specifies the + variable used to represent temperature. The variable `temp` will be specified + below in the `[Variables]` block. +- `sss2_input`: True if the macroscopic group constants were generated by + Serpent 2 or OpenMC. False otherwise +- `pre_concs`: The names of the precursor concentration variables +- `account_delayed`: Whether to account for delayed neutron production. Modifies + the neutron source term + +## Mesh Block id=mesh + +Next in our input file we have the `Mesh` block. The two most commonly used `Mesh` +types are `FileMesh` and `GeneratedMesh`. The `Mesh` input block by default assumes +type `FileMesh` and takes a parameter argument `file = `. + +``` +[Mesh] + coord_type = RZ + [mesh] + type = FileMeshGenerator + file = 'mesh.e' + [] +[] +``` + +We use `coord_type` to indicate to Moltres that this is a 2-D axisymmetric problem. +By default, it takes a xy-coordinate mesh and considers the y-axis (x=0) to be the +axis of symmetry. + +MOOSE has an extensive `MeshGenerators` system for generating simple meshes or making simple edits. +We refer the reader +[here](https://mooseframework.inl.gov/syntax/Mesh/index.html#c5bbb23b-df10-499b-93c5-3c6380133731) +for more information about the system. The `mesh.i` file uses this system to generate the mesh for +the parallel channel structure of the 2-D MSRE model. +The 'mesh.e' file for this tutorial can be generated by running the following command: + +``` +../../moltres-opt -i mesh.i --mesh-only mesh.e +``` + +Many MOOSE users generate more complex meshes using +Cubit/Trelis. For national lab employees this software is free; however, +academic or industry users must pay. Consequently, many of Moltres meshes to date have +been generated using `MeshGenerators` or the open-source software [gmsh](http://gmsh.info/). +Gmsh binaries for Windows, Mac, and Linux as well as source code can be +downloaded [here](http://gmsh.info/#Download). Ubuntu users may also install +Gmsh using `sudo apt-get install gmsh`. We will not go into the details of +using Gmsh but the interested user should peruse its +[documentation](http://gmsh.info/doc/texinfo/gmsh.html). There are many example +Gmsh input files in the Moltres repository (denoted by the `.geo` +extension). To generate a mesh for use with Moltres, a typical bash command is +`gmsh -2 -o file_name.msh file_name.geo` where `2` should be replaced with the +dimension of the mesh, the argument following `-o` is the name of the output +`.msh` file, and the last argument is the input `.geo` file. + +## Variables Block id=variables + +The `Variables` block is used to indicate the primary solution variables, or +equivalently, to indicate the number of partial differential equations (PDEs) +that will be defined in the [Kernels](#Kernels) and [BCs](#BCs) blocks. For this +model, the `group1` and `group2` neutron fluxes are the system variables that are +being solved for by the +PDEs. In the [Kernels](#Kernels) and [BCs](#BCs) blocks described below, each +kernel and BC term must be associated with one primary variable from the +`Variables` list below to indicate which PDE the term is included in. + +``` +[Variables] + [group1] + order = FIRST + family = LAGRANGE + initial_condition = 1 + [] + [group2] + order = FIRST + family = LAGRANGE + initial_condition = 1 + [] +[] +``` + +Sub-blocks are initialized with `[]` and closed with `[]`. The +`[group1]` sub-block creates a `MooseVariable` object with the name `group1`. +The parameters purpose of the parameter is as follows: + +- `family` describes the shape function type used to form the + approximate finite element solution. +- `order` denotes the polynomial order of the shape functions. +- `initial_condition` is an optional parameter that can be used to set a spatially + uniform initial value for the variable. +- `scaling` is another optional parameter that can be used to scale the residual + of the corresponding variable; this is usually done when different + variables have residuals of different orders of magnitude. + +## Precursors Block id=precursors + +Whereas all the other blocks that have been introduced are standard MOOSE +blocks, `Precursors` is a custom input file block unique to Moltres. The +`Precursors` action sets up the delayed neutron precursor concentration equations: + +!equation +\frac{\partial C_i}{\partial t} + \bar{u} \cdot \nabla C_i + \lambda_i C_i + - \sum_{g'=1}^{G} \beta_i \nu \Sigma_{g'}^f \phi_{g'} = 0 + +The precursor variables, kernels, and boundary conditions necessary for solving +the precursor governing equations are all instantiated by the `Precursors` action. +Six precursor groups (symbolized by the index i in the equation above) +are modeled, as specified via the `num_precursor_groups` in the +[`GlobalParams`](#global-params) block. $G$ is the number of neutron flux energy +groups, and $g'$ is the index associated with the energy groups. For this problem +two energy groups are modeled, with the equations configured explicitly in the +[Kernels](#Kernels) and [BCs](#BCs) blocks documented after this section. + +``` +[Precursors] + [./pres] + var_name_base = pre + family = MONOMIAL + order = CONSTANT + block = 'fuel' + outlet_boundaries = 'fuel_top' + constant_velocity_values = true + u_def = 0 + v_def = ${flow_velocity} + w_def = 0 + nt_exp_form = false + loop_precursors = false + transient = false + eigen = true + [../] +[] +``` + +Parameter descriptions: + +- `var_name_base`: The prefix for the precursor variable names. Name suffixes are + numbers, e.g. `pre1, pre2, ...` +- `block`: This is a parameter ubiquitous to many MOOSE classes such as kernels + and materials. By specifying a value for `block` the user is asking that in + this case, precursors and their associated governing equations only be + solved for in the `fuel` mesh subdomains +- `outlet_boundaries`: The mesh boundaries from which the precursors flow out +- `u_def, v_def, w_def`: The x, y, and z components of velocity, or in the case + of an RZ simulation, `u_def` is the r velocity component, `v_def` is the + z-component, and `w_def` has no meaning +- `nt_exp_form`: Whether the neutron group fluxes have their concentrations in + an exponential form. If `use_exp_form` is false in the `GlobalParams` block, + this should also be false +- `loop_precursors`: Whether the DNPs are looped back into the core through the flow inlet +- `transient`: Whether this is a transient or time-independent simulation +- `eigen`: Whether this is an eigenvalue problem + +## Kernels Block id=kernels + +The `Kernels` block is used to construct PDEs that are included in the system of +equations that are solved. Each PDE has a primary variable that is being solved for, +and the list of variables being solved for is defined in the [Variables](#variables) +block shown above. There is an additional PDE solved as part of the system of +PDEs for each variable defined in the `Variables` section. In this case, three +solution variables were defined in the variable section: + +- The `group1` fast group neutron flux. +- The `group2` thermal group neutron flux. + +Note that additional precursor variables are automatically defined by the +[`Precursors`](#precursors) block. + +The `Kernels` section defines a set of "Kernels", where a "Kernel" represents a +single term included in a PDE. A PDE is constructed by specifying the set of terms +(or Kernels) that will be included in the PDE in the `Kernels` block, and by +specifying which PDE the kernel is associated with. This is done by indicating +which of the above three variables the kernel is associated with (i.e., `group1` +or `group2`). + +Thus, each entry in the `Kernels` block specifies a term to include in one of +PDEs that are solved. The `type = ` parameter associated with a +kernel entry identifies the term (or Kernel) that will be included in the PDE, +and the `variable = ` value indicates the primary solution +variable (from the [Variables](#Variables) block) associated with the term, or +equivalently which PDE the term will be included in. MOOSE provides several +standard kernels that can be included in a PDE. Moltres defines an additional set +of kernels that are useful in modeling neutron flux and associated phenomenon in +molten salt reactors. The mathematical form of each Moltres kernel can be found +its corresponding documentation webpage on [Moltres Syntax](syntax/index.md). + +Kernels can be optionally restricted to specific subdomains within the model by setting +`block = `. Note that this implies that the form of the equation +that is solved may differ in different mesh regions. The equations that are modeled +are represented below, followed by the input required to construct these equations. +In the `group1` and `group2` neutron flux equations below and in the input that +follows, notice that the fission kernel (`CoupledFissionEigenKernel`) +is only included in the fuel region ('0'), and is not included in the moderator region ('1') +since there is no fuel in the moderator region. Also, the `DelayedNeutronEigenSource` +kernel, which contributes neutrons from the precursor group equations, is only +included as part of the `group1` or fast group equation. + ++Neutron Diffusion Equation for the *k*-Eigenvalue Problem with `group1` and `group2` Variables +(g = 1 or 2)+ + +!equation +\underbrace{\frac{1}{v_g}\frac{\partial \phi_g}{\partial t}}_{NtTimeDerivative} + + \underbrace{\Sigma_g^r \phi_g}_{SigmaR} + - \underbrace{\nabla \cdot D_g \nabla \phi_g}_{GroupDiffusion} + - \underbrace{\sum_{g \ne g'}^G \Sigma_{g'\rightarrow g}^s \phi_{g'}}_{InScatter} + - \underbrace{\chi_g^p \sum_{g' = 1}^G (1 - \beta) \nu \Sigma_{f,g'} \phi_{g'}}_{\substack{CoupledFissionKernel\\ \textrm{'Fuel' region only}}} + - \underbrace{\chi_g^d \sum_i^I \lambda_i C_i}_{\substack{DelayedNeutronSource\\ \textrm{'Fuel' region only} \\ \textrm{Not in group2 Eqn}}} + = 0 + +``` +[Kernels] + #--------------------------------------------------------------------- + # Group 1 Neutronics + #--------------------------------------------------------------------- + [sigma_r_group1] + type = SigmaR + variable = group1 + group_number = 1 + [] + [diff_group1] + type = GroupDiffusion + variable = group1 + group_number = 1 + [] + [inscatter_group1] + type = InScatter + variable = group1 + group_number = 1 + [] + [fission_source_group1] + type = CoupledFissionEigenKernel + variable = group1 + group_number = 1 + block = '0' + [] + [delayed_group1] + type = DelayedNeutronEigenSource + variable = group1 + block = '0' + group_number = 1 + [] + + #--------------------------------------------------------------------- + # Group 2 Neutronics + #--------------------------------------------------------------------- + [sigma_r_group2] + type = SigmaR + variable = group2 + group_number = 2 + [] + [diff_group2] + type = GroupDiffusion + variable = group2 + group_number = 2 + [] + [fission_source_group2] + type = CoupledFissionEigenKernel + variable = group2 + group_number = 2 + block = '0' + [] + [inscatter_group2] + type = InScatter + variable = group2 + group_number = 2 + [] +[] +``` + +## BCs Block id=bcs + +The `BCs` block is very similar to the `Kernels` block except the +`boundary = ` parameter must be specified to indicate where the boundary +conditions should be applied. Documentation for the BCs can be also found on +the [Moltres Syntax](syntax/index.md) page. + +``` +[BCs] + [vacuum_group1] + type = VacuumConcBC + boundary = 'fuel_bottom fuel_top mod_bottom mod_top right' + variable = group1 + [] + [vacuum_group2] + type = VacuumConcBC + boundary = 'fuel_bottom fuel_top mod_bottom mod_top right' + variable = group2 + [] +[] +``` + +## Materials Block id=materials + +In the `Materials` block, we specify materials that live on a mesh +subdomain. Any given subdomain can have as many material definitions as desired, so long as a +property is not multiply defined. We use +`MoltresJsonMaterial` here which is used to parse the JSON-based group constant +data file. + +``` +[Materials] + [fuel] + type = MoltresJsonMaterial + block = '0' + base_file = 'xsdata.json' + material_key = 'fuel' + interp_type = LINEAR + prop_names ='' + prop_values = '' + [] + [graphite] + type = MoltresJsonMaterial + block = '1' + base_file = 'xsdata.json' + material_key = 'graphite' + interp_type = LINEAR + prop_names ='' + prop_values = '' + [] +[] +``` + +Materials within the `Materials` block support the following parameters: + +- `base_file`: The relative/absolute path and name of the JSON file containing the + macroscopic group constants that define neutron interactions in this material. +- `material_key`: The name of the material in the JSON file that corresponds to this `Material` + object. + +- `interp_type`: The type of fitting/interpolation to be carried out on the + temperature grid. Options are: + + - `spline`: Cubic spline interpolation + - `linear`: Linear spline interpolation + - `monotone_cubic`: Monotone cubic interpolation + - `none`: Only should be used when single values for constants are supplied + at a single temperature + +- `prop_names, prop_values`: name-value pairs used to define material property + values from the input file. For example, the density $\rho$, thermal conductivity + $k$, and the specific heat capacity $c_p$ may be defined for simulations + involving a temperature variable. + +## Executioner and Preconditioning Blocks id=executioner + +The `Executioner` and `Preconditioning` blocks are essential for setting the +method used to solve the system of non-linear equations created by finite +element discretization of our molten salt reactor governing +equations. `Executioner` and `Preconditioning` documentation can be found +[here](https://www.mooseframework.org/syntax/Executioner/index.html) and +[here](https://www.mooseframework.org/syntax/Preconditioning/index.html) +respectively. You may also refer to our [guide](getting_started/recommended) for +basic instructions. + +``` +[Executioner] + type = InversePowerMethod + max_power_iterations = 50 + + normalization = 'powernorm' + normal_factor = 8e6 + + xdiff = 'group1diff' + bx_norm = 'bnorm' + k0 = 1. + l_max_its = 100 + eig_check_tol = 1e-7 + + automatic_scaling = true + compute_scaling_once = false + resid_vs_jac_scaling_param = 0.1 + off_diagonals_in_auto_scaling = false + + solve_type = 'NEWTON' + petsc_options = '-snes_converged_reason -ksp_converged_reason -snes_linesearch_monitor' + petsc_options_iname = '-pc_type -pc_factor_shift_type' + petsc_options_value = 'lu NONZERO' + + line_search = none +[] + +[Preconditioning] + [./SMP] + type = SMP + full = true + [../] +[] +``` + +## Postprocessors Block id=postprocessors + +A `PostProcessor` computes a single scalar value during the simulations. +General postprocessor documentation can be found +[here](https://www.mooseframework.org/syntax/Postprocessors/index.html). + +The `bnorm`, `tot_fissions`, and `powernorm` parameters calculate the total number of fission +neutrons, fission interactions, and fission heat, respectively. The `bnorm` parameter is required +by the `InversePowerMethod` executioner as a normalization term for inverse power iterations. The +other two may be used to normalize the flux solution at the end of the calculation through the +`normalization` and `normal_factor` parameters in the `Executioner` block. The `group1diff` +postprocessor is also required by the `InversePowerMethod` executioner for Chebyshev acceleration. +The rest of the postprocessors calculate the integral sum or maximum values of the `group1` and +`group2` flux variables. + +``` +[Postprocessors] + [bnorm] + type = ElmIntegTotFissNtsPostprocessor + execute_on = linear + [] + [tot_fissions] + type = ElmIntegTotFissPostprocessor + execute_on = linear + [] + [powernorm] + type = ElmIntegTotFissHeatPostprocessor + execute_on = linear + [] + [group1norm] + type = ElementIntegralVariablePostprocessor + variable = group1 + execute_on = linear + [] + [group1max] + type = NodalExtremeValue + value_type = max + variable = group1 + execute_on = timestep_end + [] + [group1diff] + type = ElementL2Diff + variable = group1 + execute_on = 'linear timestep_end' + [] + [group2norm] + type = ElementIntegralVariablePostprocessor + variable = group2 + execute_on = linear + [] + [group2max] + type = NodalExtremeValue + value_type = max + variable = group2 + execute_on = timestep_end + [] + [group2diff] + type = ElementL2Diff + variable = group2 + execute_on = 'linear timestep_end' + [] +[] +``` + +## Outputs Block id=outputs + +In the `Outputs` block, we can control the settings for various data output formats. +`Outputs` documentation is +[here](https://www.mooseframework.org/syntax/Outputs/index.html). In this input file, the Exodus +and CSV output formats are enabled with default settings associated with each output type. +`print_graph` prints various computational performance information in the console (e.g., time +taken in each section of the simulation). `print_linear_residuals` prints all linear residual +values during the simulation, which may be desired when running test runs. + +``` +[Outputs] + print_graph = true + print_linear_residuals = true + [exodus] + type = Exodus + [] + [csv] + type = CSV + [] +[] +``` + +## Debug Block id=debug + +This simply tells Moltres to print the variable residual norms during the +non-linear solve. + +``` +[Debug] + show_var_residual_norms = true +[] +``` diff --git a/doc/content/getting_started/moltres_xs.md b/doc/content/getting_started/moltres_xs.md new file mode 100644 index 0000000000..36c5cc4760 --- /dev/null +++ b/doc/content/getting_started/moltres_xs.md @@ -0,0 +1,106 @@ +# Group Constant File Generation With `moltres_xs.py` + +## Example problem: Godiva Sphere + +In this tutorial, we demonstrate how to use OpenMC to generate group constants for Moltres using +`moltres_xs.py`. + +The relevant files for this tutorial may be found in the +[`godiva`](https://github.com/arfc/moltres/tree/devel/tutorial/) tutorial directory. +To run these input files and subsequent group constant generation scripts, the user must install +[OpenMC](https://github.com/openmc-dev/openmc/) version 0.13.2 or later. + +### Step 1: Generating Group Constants with OpenMC + +In this directory, there are 2 OpenMC input files for 900K and 1200K simulations: +`godiva_openmc_900.py` and `godiva_openmc_1200.py`. Unlike Scale or Serpent, OpenMC does not have +a notion of branches to generate group constants for different temperatures and burnups. Thus, +separate input files for different temperatures is required. + +The user must include the `openmc_xs.generate_openmc_tallies_xml()` function in the OpenMC input +file to generate a `domain_dict`. The function sets up the OpenMC tallies required for the group +constant generation. This is necessary because unlike Serpent, OpenMC does not generate all the +group constant data with any simulation, the user must specify what they want. The user may define +domains as either openmc.Material or openmc.Cell. + +For this tutorial, we also provide the OpenMC output files obtained after running the input files: +`statepoint_900_openmc.100.h5`, `statepoint_1200_openmc.100.h5`, `summary_900.h5`, and +`summary_1200.h5`. Each OpenMC simulation generates a statepoint and summary file. Both output +files are required for the group constant generation. + +### Step 2: Parsing OpenMC Output Files with moltres_xs.py + +`godiva_openmc.inp` is the input file that informs `moltres_xs.py` how to parse the various OpenMC +output files to generate Moltres group constants. The structure of the input file is as follows: + +``` +[TITLE] + *name of output json file* + +[MAT] + *number of materials* + *names of materials listed* + +[BRANCH] + *number of branches* + *material name* *temperature* *file index* *burnup index* *universe index* *branch index* + +[FILES] + *number of files* + *statepoint file name* *openmc* *openmc input file* *summary file* +``` + +For OpenMC, since we do not utilize the burnup and branch indexes, users must indicate both index +values as "1" so that `moltres_xs.py` correctly parses the input file. For OpenMC, we also add +additional openmc input files and summary files. The universe index must correspond to the material +or cell id defined in the OpenMC input file. + +To generate the Moltres group constants, the user runs: +``` +python ../../python/moltres_xs.py godiva_openmc.inp +``` +This will output `godiva_openmc.json` containing the Moltres group constants. An example of this +output file can be found in `../../python/test/gold/godiva.json`. + +## OpenMC Group Constant Generation + +This table outlines the OpenMC methods used by `moltres_xs.py` to calculate the group constants for Moltres. + +| Group Constant | Description | OpenMC Tally Used | Units | +| --- | --- | --- | --- | +| BETA_EFF | Delayed neutron fraction | mgxs.Beta() | - | +| CHI_T | Fission spectrum (total) | mgxs.Chi() | - | +| CHI_P | Fission spectrum (prompt neutrons) | mgxs.Chi(prompt=True) | - | +| CHI_D | Fission spectrum (delayed neutrons) | mgxs.ChiDelayed() | - | +| DECAY_CONSTANT | Decay rate for delayed neutron precursors | mgxs.DecayRate() | 1/s | +| DIFFCOEF | Diffusion coefficient multi-group cross section | mgxs.DiffusionCoefficient() | cm | +| FISSE | Average deposited fission energy | mgxs.KappaFissionXS() / mgxs.FissionXS() | MeV | +| FISSXS | Fission cross section | mgxs.FissionXS() | 1/cm | +| GTRANSFXS | Scattering production XS Matrix | mgxs.ScatterProbabilityMatrix() * mgxs.ScatterXS() | 1/cm | +| NSF | Fission neutron production cross section | nu-fission / flux | 1/cm | +| RECIPVEL | Inverse neutron speed | mgxs.InverseVelocity() | s/cm | +| REMXS | Removal cross section (out scatter + absorption) | mgxs.ScatterProbabilityMatrix() * mgxs.ScatterXS() + mgxs.AbsorptionXS() | 1/cm | + +## Serpent Comparison + +We cross verified the group constants generated by OpenMC with group constants generated by +Serpent. `godiva_serpent` and `godiva_serpent_res.m` are the Serpent input and output files for the +Godiva sphere. `godiva_serpent.inp` generates the group constants with `moltres_xs.py`. Note the +minor differences between `godiva_openmc.inp` and `godiva_serpent.inp` arising from the use of +`branch` and `coef` cards to set up various reactor states at various temperatures in +[Serpent](https://serpent.vtt.fi/mediawiki/index.php/Input_syntax_manual). Serpent condenses +multi-temperature group constant data from the various branches into one `*_res.m` output file. + +The only difference in syntax format for Serpent-based `*.inp` files lies in the `[FILES]` section +as follows: + +``` +[FILES] + *number of files* + *serpent _res.m file name* *serpent* +``` + +The group constant values generated by both Serpent and OpenMC are similar in values and orders +of magnitude. The only notable difference is in the FISSE group constant value. Serpent outputs +FISSE values of ~193 MeV, while OpenMC outputs FISSE values of ~202 MeV. A possible reason for this +discrepancy is that Serpent includes neutrino energies while OpenMC does not. diff --git a/doc/content/getting_started/recommended.md b/doc/content/getting_started/recommended.md new file mode 100644 index 0000000000..5b4ba8963d --- /dev/null +++ b/doc/content/getting_started/recommended.md @@ -0,0 +1,161 @@ +# Recommended Executioner and Preconditioning Settings + +This page provides recommended `Executioner` and `Preconditioning` +settings for new Moltres users who already have basic proficiency with MOOSE. The +following sections provide recommendations on the solve type, automatic scaling, time +integration scheme, and preconditioning settings. + +Moltres, like all MOOSE-based apps, rely on PETSc for preconditioning. Refer to MOOSE's +documentation +[here](https://mooseframework.inl.gov/syntax/Preconditioning/index.html) for +basic information on preconditioning in MOOSE. You may also refer to the example input file +[here](http://arfc.github.io/software/moltres/wiki/input_example/) for an introduction +to the Moltres input file format. + +## Solve Type + +Previous experiences have shown that Moltres simulations usually require the `NEWTON` +solve type with all off-diagonal Jacobian entries enabled because reactor neutronics +problems are very non-linear from the strong coupling between the neutron group flux +and delayed neutron precursor concentration variables. Users may use these settings by +setting `solve_type = NEWTON` and `full = true` in the `Executioner` and +`Preconditioning` blocks, respectively, in the input file. + +## Automatic Scaling + +Relevant variables in a Moltres simulation include neutron group fluxes, delayed neutron +precursor concentrations, temperature, and velocity components. These variables differ +significantly in magnitude, especially between the neutronics and thermal-hydraulics +variables. We recommend applying scaling factors to the variables so that: 1) +final residual norm values are on similar orders of magnitudes to ensure that every +variable is converged at the end of each step, and 2) the Jacobian is well-conditioned. + +Users may manually set the scaling factor for each variable using the `scaling` parameter +when defining the variable. Alternatively, we recommend using the `automatic_scaling` +feature from MOOSE. This feature automatically calculates the appropriate scaling factor +for each variable. + +We recommend using the following parameters to set automatic scaling in the `Executioner` block. + +``` +automatic_scaling = true +resid_vs_jac_scaling_param = 0.2 +scaling_group_variables = 'group1 group2; pre1 pre2 pre3 pre4 pre5 pre6 pre7 pre8; temp' +compute_scaling_once = false +off_diagonals_in_auto_scaling = true +``` + +- `automatic_scaling`: Turns on automatic scaling. +- `resid_vs_jac_scaling_param`: Determines whether the scaling factor is based on + the residual or Jacobian entries; `0` corresponds to pure Jacobian scaling and `1` corresponds + to pure residual scaling while all values in between correspond to hybrid scaling. The ideal + value for this parameter depends heavily on the type of simulation. Most Moltres simulations run + faster with this parameter at 0.1~0.3. +- `scaling_group_variables`: Groups variables which share the same scaling factor. + The MOOSE team recommends grouping variables derived from the same physics for stability. +- `compute_scaling_once`: Whether Moltres calculates the scaling factors once at the beginning + of the simulation (`true`) or at the beginning of every timestep (`false`). +- `off_diagonals_in_auto_scaling`: Whether to consider off-diagonals when determining automatic + scaling factors. + +## Time Integration Scheme + +We recommend using either `ImplicitEuler` or `BDF2` based on the first and second order backward +differentiation formula time integration schemes. The `BDF2` scheme is more accurate +(higher-order) and has a +[superior convergence rate](https://mooseframework.inl.gov/workshop/#/33/4). + +All multi-stage time integration schemes from MOOSE are incompatible with Moltres simulations. + +To set the time integration scheme, include the following line in the `Executioner` block. + +``` +scheme = bdf2 # or implicit-euler for ImplicitEuler +``` + +## Preconditioning + +Our discussions on preconditioning here relate to the `NEWTON` solve type which relies on PETSc +routines to solve the system of linear equations in each Newton iteration. + +Users can pick their preferred linear system solver and the associated settings in PETSc for their +problem through the `petsc_options_iname` and `petsc_options_value` parameters in the +`Executioner` block. + +#### LU + +The most reliable "preconditioner" type for Moltres simulations is `lu`. `lu` is actually a direct +solver based on LU +factorization. As a direct solver, it is very accurate as long as the user provides the correct +Jacobian formulations in their kernels. PETSc's default `lu` implementation is serial and thus, +it does not scale over multiple processors. `lu` requires the `superlu_dist` parallel library to +be effective over multiple processors. However, `superlu_dist` does not scale as well as the `asm` +option in the next section. As such, we recommend only using `superlu_dist` for smaller problems +(<100k DOFs). + +`lu` on a single process: + +``` +petsc_options_iname = '-pc_type -pc_factor_shift_type' +petsc_options_value = 'lu NONZERO' +``` + +`lu` with `superlu_dist` on multiple MPI processes: + +``` +petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_type' +petsc_options_value = 'lu NONZERO superlu_dist' +``` + +#### ASM + +Direct solvers like `lu` do not scale well with problem size. Iterative methods are recommended +for large problems. The best performing preconditioner type for large problems in Moltres is +`asm`. `asm` is based on the Additive Schwarz Method (ASM) for generating preconditioners for the +GMRES iterative method. Moltres simulations also require a strong subsolver like `lu` for solving +each subdomain. + +`asm` on multiple MPI processes: + +``` +petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap -ksp_gmres_restart' +petsc_options_value = 'asm lu NONZERO 1 200' +``` + +#### Preconditioner Recommendations + +Here are the recommended preconditioner settings for the following problem sizes: + +Small problems (<10k DOFs) + +- Number of MPI processes: 1-4 +- Preconditioner options: + - `lu` on 1 process + - `lu` with `superlu_dist` on multiple processes + - `asm` on multiple processes + +Medium problems (<100k DOFs) + +- Number of MPI processes: 4-16 +- Preconditioner options: + - `lu` with `superlu_dist` on multiple processes + - `asm` on multiple processes + +Large problems (>100k DOFs) + +- Number of MPI processes: Up to 1 MPI process per 10k DOFs +- Preconditioner options: + - `asm` on multiple processes + +## General tips + +- `lu` is faster than `asm` for small problems. +- `l_tol = 1e-5` is the default linear tolerance value. `l_tol` can be raised to 1e-4 or 1e-3 for + large problems without much impact on performance if the problem requires too many linear + iterations (>400) on every nonlinear iteration. +- Automatic scaling may not scale correctly on the first timestep when restarting a Moltres + simulation using MOOSE's `Restart` functionality. Thus, the simulation may fail to converge on + the first timestep. +- When using `asm`, the number of linear iterations required per nonlinear iteration scales + linearly with the number of subdomains (i.e. number of MPI processes). As such, increasing the + number of processors beyond a certain threshold increases the solve time. diff --git a/doc/content/getting_started/sss2_gc.md b/doc/content/getting_started/sss2_gc.md new file mode 100644 index 0000000000..303da86b3f --- /dev/null +++ b/doc/content/getting_started/sss2_gc.md @@ -0,0 +1,55 @@ +# Group Constant File Generation With `extractSerpent2GCs.py` + +## Example problem: Two-region MSRE model + +Here, group constants are taken from an example Serpent output using PyNE. These will be used to +generate text-based group constant files using `extractSerpent2GCs.py`. The relevant files for this +tutorial may be found in the +[`MSRE_group_constants`](https://github.com/arfc/moltres/tree/devel/tutorial) tutorial directory. + +Moltres is *not* a spatially homogenized diffusion code. MOOSE is made for running +big+, +intense+ +problems, using modern HPC. Because there is no desire to homogenize spatially here, the materials +that the user would like used in Moltres should each fill their own infinite universe. Then, this +universe should have its group constants generated using the `set gcu ` +option in Serpent 2. + +It's important that universe 0, the main universe, is not included. Serpent takes tallies for group +constants in the first universe it identifies, so including 0 means that no further universes will +be included in GC generation. (please double check this on the +[serpent forum](https://ttuki.vtt.fi/serpent)). + +### Step 1: Generating Group Constants with Serpent 2 + +In this directory, we provide a Serpent input file for simulating ORNL's Molten Salt Reactor +Experiment, documented largely on websites like [this](http://www.energyfromthorium.com/pdf/). + +For group constant generation, Cole Gentry found that a 4 group structure with three thermal groups +and one fast group works well in the graphite moderated FHR. There is also an available recommended +13-group structure commented out in the `gentryGroups.serp` file +The PDF of these findings can be found [here](http://trace.tennessee.edu/utk_graddiss/3695/). + +The "fuel" file contains "cards" (a relic term referring to the fortran-dominated reactor physics +ages of yore) that will generate group constants at a few temperatures, and likewise for the +"moder" file. Like a cooking show, we have prepared the important results for you in the +`fuel.coe` and `moder.coe` files, which get parsed by `serpentTools` in the `extractSerpent2GCs` +script. `serpentTools` is a suite of parsers designed by GATech for parsing `SERPENT` output files. +More information can be found at [here](http://serpent-tools.readthedocs.io/en/latest/). + +### Step 2: Parsing Serpent 2 Output Files with extractSerpent2GCs.py + +The command to run in order to generate the Moltres-compatible group constants is: + +``` +$MOLTRES/python/extractSerpent2GCs.py MSREProperties msre_gentry_4g tempMapping.txt secBranch.txt universeMapping.txt +``` + +where $MOLTRES is an environment variable leading to the install location of Moltres. An +alternative would be to just add the $MOLTRES/python directory to your path. + +The input syntax requires a directory name you'd like to create, a file base name that Moltres +will look at, a file that maps primary branch names to temperatures, a file that lists the +secondary branch names, and lastly a file that maps universe numbers from Serpent to material +names. Group constants will be extracted for all materials listed in the last file. + +The ```secBranch.txt``` file should be blank if no secondary branches were used, i.e. there is only +one branch variation per burnup step. diff --git a/doc/content/getting_started/transient.md b/doc/content/getting_started/transient.md new file mode 100644 index 0000000000..8678d825fb --- /dev/null +++ b/doc/content/getting_started/transient.md @@ -0,0 +1,3 @@ +# Time-Dependent Simulation with Thermal-Hydraulic Coupling and Precursor Looping + +Tutorial to come at a later date. diff --git a/doc/content/getting_started/tutorials.md b/doc/content/getting_started/tutorials.md index 3fb8876a9d..ad5958a547 100644 --- a/doc/content/getting_started/tutorials.md +++ b/doc/content/getting_started/tutorials.md @@ -1,3 +1,53 @@ # Tutorials -TODO: Add tutorials +The *two-step procedure* is a common approach for multiphysics full-core nuclear reactor analysis. +These steps are: + ++Step 1:+ Generate neutron group constant data with a lattice or full-core reactor model on a +high-fidelity, continuous/fine-energy neutronics software at various reactor states. + ++Step 2:+ Use an intermediate-fidelity, computationally cheaper neutronics software with the +neutron group constant data to perform multiphysics reactor analysis. + +Moltres falls under Step 2 of the two-step procedure. The following sections cover +various tutorials for group constant file generation and running various types of reactor +simulations with Moltres. The tutorials assume that readers have a basic understanding of reactor +analysis, molten salt reactors, and the [MOOSE framework](https://mooseframework.inl.gov/). + +## 1. Group Constant File Generation + +Moltres requires group constants in compatible text- or JSON-based format to run reactor +simulations. The Moltres GitHub repository provides Python scripts that can automatically parse +output files from OpenMC, Serpent 2 and NEWT (in SCALE) and generate the requisite .txt or .json +files. The newer [`moltres_xs.py`](https://github.com/arfc/moltres/blob/devel/python/moltres_xs.py) +script supports group constant file generation with all three listed neutron transport software, +while the older +[`extractSerpent2GCs.py`](https://github.com/arfc/moltres/blob/devel/python/extractSerpent2GCs.py) +script supports Serpent 2 only. + ++1a.+ [Group Constant File Generation with moltres_xs.py (Recommended)](moltres_xs.md) + ++1b.+ [Group Constant File Generation with extractSerpent2GCs.py](sss2_gc.md) + +## 2. Multiphysics Reactor Simulations + +Moltres supports various capabilities for reactor simulations including eigenvalue calculation, +neutronics/thermal-hydraulics coupling, precursor drift, and out-of-core precursor decay. Moltres +can couple different physics/components through full coupling or iterative tight +coupling. + +This tutorial webpage is currently a work in progress. Feel free to post on our GitHub +[Discussions](https://github.com/arfc/moltres/discussions) page if your use case is not covered by +the existing tutorials below. + ++2a.+ [Introduction to the Moltres Input File Syntax](getting_started/input_syntax.md) + ++2b.+ [Eigenvalue Calculation](getting_started/eigenvalue.md) + ++2c.+ [Time-dependent Simulation with Thermal-Hydraulic Coupling and Precursor Looping](getting_started/transient.md) + ++Tip:+ [Recommended Executioner and Preconditioning Settings](getting_started/recommended.md) + +## 3. Data Postprocessing and Analysis + +Tutorials to come at a later date. diff --git a/doc/content/media/msre_2d.png b/doc/content/media/msre_2d.png new file mode 100644 index 0000000000..b64231a194 Binary files /dev/null and b/doc/content/media/msre_2d.png differ diff --git a/doc/content/publications.md b/doc/content/publications.md index cff94d3543..a35d0b401b 100644 --- a/doc/content/publications.md +++ b/doc/content/publications.md @@ -1,7 +1,8 @@ # List of Publications -Here is a non-exhaustive list of publications and theses using Moltres -If you have a publication that uses moltres, please submit a pull request and add it here! We'd love to see your work. +Here is a non-exhaustive list of publications and theses using Moltres. +If you have a publication that uses Moltres, please submit a pull request and add it here! We'd +love to see your work. ## Journal Publications diff --git a/doc/content/source/bcs/CoupledOutflowBC.md b/doc/content/source/bcs/CoupledOutflowBC.md index 8fac1591d1..59b33b6294 100644 --- a/doc/content/source/bcs/CoupledOutflowBC.md +++ b/doc/content/source/bcs/CoupledOutflowBC.md @@ -1,16 +1,16 @@ # CoupledOutflowBC -!alert construction title=Undocumented Class -The CoupledOutflowBC has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /BCs/CoupledOutflowBC ## Overview -!! Replace these lines with information regarding the CoupledOutflowBC object. +This object adds the outflow boundary condition for the delayed neutron precursor equation if +[CoupledScalarAdvection](CoupledScalarAdvection.md) is used (i.e. integration by parts and +divergence theorem). The weak form for this boundary +condition is: + +!equation +\int_{\partial V}\psi C_i\vec{u}\cdot\hat{n}\ dS. ## Example Input File Syntax diff --git a/doc/content/source/bcs/CoupledScalarAdvectionNoBCBC.md b/doc/content/source/bcs/CoupledScalarAdvectionNoBCBC.md index 9625724732..27d7419f1a 100644 --- a/doc/content/source/bcs/CoupledScalarAdvectionNoBCBC.md +++ b/doc/content/source/bcs/CoupledScalarAdvectionNoBCBC.md @@ -1,16 +1,11 @@ # CoupledScalarAdvectionNoBCBC -!alert construction title=Undocumented Class -The CoupledScalarAdvectionNoBCBC has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /BCs/CoupledScalarAdvectionNoBCBC ## Overview -!! Replace these lines with information regarding the CoupledScalarAdvectionNoBCBC object. +This object adds the "No Boundary Condition" outflow boundary condition devised by +[Griffiths](https://www.researchgate.net/publication/264456900_The_No_Boundary_Condition_Outflow_Boundary_Condition). ## Example Input File Syntax diff --git a/doc/content/source/bcs/PostprocessorCoupledInflowBC.md b/doc/content/source/bcs/PostprocessorCoupledInflowBC.md index 5d60cc6d58..9e95b4b98a 100644 --- a/doc/content/source/bcs/PostprocessorCoupledInflowBC.md +++ b/doc/content/source/bcs/PostprocessorCoupledInflowBC.md @@ -1,16 +1,18 @@ # PostprocessorCoupledInflowBC -!alert construction title=Undocumented Class -The PostprocessorCoupledInflowBC has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /BCs/PostprocessorCoupledInflowBC ## Overview -!! Replace these lines with information regarding the PostprocessorCoupledInflowBC object. +This object adds the inflow boundary condition for the delayed neutron precursor equation if +[CoupledScalarAdvection](/CoupledScalarAdvection.md) is used (i.e. integration by parts and +divergence theorem). The weak form for this boundary condition is: + +!equation +\int_{\partial V} \psi C_{inlet} \vec{u}\cdot\hat{n}\ dS + +where $C_{inlet}$ is the precursor concentration at the inlet and defined by the `postprocessor` +input parameter. ## Example Input File Syntax diff --git a/doc/content/source/bcs/VacuumConcBC.md b/doc/content/source/bcs/VacuumConcBC.md index 3ab9c48a25..8d20ba5d27 100644 --- a/doc/content/source/bcs/VacuumConcBC.md +++ b/doc/content/source/bcs/VacuumConcBC.md @@ -1,16 +1,15 @@ # VacuumConcBC -!alert construction title=Undocumented Class -The VacuumConcBC has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /BCs/VacuumConcBC ## Overview -!! Replace these lines with information regarding the VacuumConcBC object. +This object adds the $\frac{\phi}{4}-\frac{D_g}{2}\hat{n}\cdot\nabla\phi_g = 0$ vacuum boundary +condition of the multigroup neutron diffusion equations. The weak form after applying integration +by parts to the neutron diffusion term ([GroupDiffusion](/GroupDiffusion.md)) is: + +!equation +\int_{\partial V}\psi D_g\nabla\phi_g\cdot\hat{n}\ dS = \int_{\partial V}\psi\frac{\phi_g}{2}\ dS ## Example Input File Syntax diff --git a/doc/content/source/kernels/CoupledFissionEigenKernel.md b/doc/content/source/kernels/CoupledFissionEigenKernel.md index a465c91230..7aa1c54ff1 100644 --- a/doc/content/source/kernels/CoupledFissionEigenKernel.md +++ b/doc/content/source/kernels/CoupledFissionEigenKernel.md @@ -1,16 +1,14 @@ # CoupledFissionEigenKernel -!alert construction title=Undocumented Class -The CoupledFissionEigenKernel has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /Kernels/CoupledFissionEigenKernel ## Overview -!! Replace these lines with information regarding the CoupledFissionEigenKernel object. +This object adds the $\frac{\chi_g^p}{k} \sum_{g' = 1}^G (1 - \beta) \nu \Sigma_{g'}^f \phi_{g'}$ +neutron source term of the multigroup neutron diffusion equations for the $k$-eigenvalue problem. +If `account_delayed=false` (i.e. +no delayed neutron precursor modeling), the $\frac{\chi_g^t}{k} \sum_{g' = 1}^G \nu \Sigma_{g'}^f +\phi_{g'}$ form is used instead. ## Example Input File Syntax diff --git a/doc/content/source/kernels/CoupledFissionKernel.md b/doc/content/source/kernels/CoupledFissionKernel.md index bcc65cbbf3..f74974cf61 100644 --- a/doc/content/source/kernels/CoupledFissionKernel.md +++ b/doc/content/source/kernels/CoupledFissionKernel.md @@ -1,16 +1,13 @@ # CoupledFissionKernel -!alert construction title=Undocumented Class -The CoupledFissionKernel has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /Kernels/CoupledFissionKernel ## Overview -!! Replace these lines with information regarding the CoupledFissionKernel object. +This object adds the $\chi_g^p \sum_{g' = 1}^G (1 - \beta) \nu \Sigma_{g'}^f \phi_{g'}$ +neutron source term of the multigroup neutron diffusion equations. If `account_delayed=false` (i.e. +no delayed neutron precursor modeling), the $\chi_g^t \sum_{g' = 1}^G \nu \Sigma_{g'}^f \phi_{g'}$ +form is used instead. ## Example Input File Syntax diff --git a/doc/content/source/kernels/CoupledScalarAdvection.md b/doc/content/source/kernels/CoupledScalarAdvection.md index 6d78c3faa0..4a0f33b374 100644 --- a/doc/content/source/kernels/CoupledScalarAdvection.md +++ b/doc/content/source/kernels/CoupledScalarAdvection.md @@ -1,16 +1,22 @@ # CoupledScalarAdvection -!alert construction title=Undocumented Class -The CoupledScalarAdvection has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /Kernels/CoupledScalarAdvection ## Overview -!! Replace these lines with information regarding the CoupledScalarAdvection object. +This object adds the $\vec{u}\cdot\nabla C_i$ advection term of the delayed neutron precursor +equation. $\vec{u}$ can be either constant velocity values defined using the `u_def`, `v_def`, and +`w_def` input parameters or coupled velocity variables using the `u`, `v`, and `w` input +parameters. Note that we applied the product rule and integration by parts to obtain the following +weak form: + +!equation +-\int\nabla\psi \cdot \vec{u} C_i\ dV + +This form is only valid if the divergence of the velocity is zero, $\nabla \cdot \vec{u} = 0$. +Boundary conditions at the outlet must be defined using [OutflowBC](/OutflowBC.md), +[CoupledOutflowBC](/CoupledOutflowBC.md), or +[CoupledScalarAdvectionNoBCBC](/CoupledScalarAdvectionNoBCBC.md). ## Example Input File Syntax diff --git a/doc/content/source/kernels/DecayHeatSource.md b/doc/content/source/kernels/DecayHeatSource.md index 79043a63b6..fa23de4879 100644 --- a/doc/content/source/kernels/DecayHeatSource.md +++ b/doc/content/source/kernels/DecayHeatSource.md @@ -1,16 +1,11 @@ # DecayHeatSource -!alert construction title=Undocumented Class -The DecayHeatSource has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /Kernels/DecayHeatSource ## Overview -!! Replace these lines with information regarding the DecayHeatSource object. +This object adds the $-\sum^J_j \omega_j$ decay heat source term of the energy balance equation for +temperature. ## Example Input File Syntax diff --git a/doc/content/source/kernels/DelayedNeutronSource.md b/doc/content/source/kernels/DelayedNeutronSource.md index 05c1704da0..3658dfd131 100644 --- a/doc/content/source/kernels/DelayedNeutronSource.md +++ b/doc/content/source/kernels/DelayedNeutronSource.md @@ -1,16 +1,11 @@ # DelayedNeutronSource -!alert construction title=Undocumented Class -The DelayedNeutronSource has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /Kernels/DelayedNeutronSource ## Overview -!! Replace these lines with information regarding the DelayedNeutronSource object. +This object adds the $\chi_g^d \sum_i^I \lambda_i C_i$ delayed neutron source term of the +multigroup neutron diffusion equations. ## Example Input File Syntax diff --git a/doc/content/source/kernels/DivFreeCoupledScalarAdvection.md b/doc/content/source/kernels/DivFreeCoupledScalarAdvection.md index 8bd3c3b6da..ff0d032a53 100644 --- a/doc/content/source/kernels/DivFreeCoupledScalarAdvection.md +++ b/doc/content/source/kernels/DivFreeCoupledScalarAdvection.md @@ -1,16 +1,13 @@ # DivFreeCoupledScalarAdvection -!alert construction title=Undocumented Class -The DivFreeCoupledScalarAdvection has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /Kernels/DivFreeCoupledScalarAdvection ## Overview -!! Replace these lines with information regarding the DivFreeCoupledScalarAdvection object. +This object adds the $\vec{u}\cdot\nabla C_i$ advection term of the delayed neutron precursor +equation. $\vec{u}$ can be either constant velocity values defined using the `u_def`, `v_def`, and +`w_def` input parameters or coupled velocity variables using the `u`, `v`, and `w` input +parameters. ## Example Input File Syntax diff --git a/doc/content/source/kernels/FissionHeatSource.md b/doc/content/source/kernels/FissionHeatSource.md index 4080a2e516..62f4ae9e2d 100644 --- a/doc/content/source/kernels/FissionHeatSource.md +++ b/doc/content/source/kernels/FissionHeatSource.md @@ -1,16 +1,17 @@ # FissionHeatSource -!alert construction title=Undocumented Class -The FissionHeatSource has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /Kernels/FissionHeatSource ## Overview -!! Replace these lines with information regarding the FissionHeatSource object. +This object adds the $\frac{P}{\int_V \sum_{g' = 1}^G \epsilon_{g'} \Sigma_{g'}^f \phi_{g'} dV} \sum_{g' = 1}^G \epsilon_{g'} \Sigma_{g'}^f \phi_{g'}$ heat source term of the steady-state temperature +advection-diffusion equation with coupled neutron fluxes from a $k$-eigenvalue calculation. The +`power` input parameter allows the user to set a fixed thermal power output regardless of the +neutron flux normalization factor. Alternatively, one may choose to normalize the neutron flux +instead using the `normalization` and `normal_factor` parameters for the +[InversePowerMethod](https://mooseframework.inl.gov/source/executioners/InversePowerMethod.html) or +[NonlinearEigen](https://mooseframework.inl.gov/source/executioners/NonlinearEigen.html) +executioners. ## Example Input File Syntax diff --git a/doc/content/source/kernels/GammaHeatSource.md b/doc/content/source/kernels/GammaHeatSource.md index e100481d45..2cc6f6df08 100644 --- a/doc/content/source/kernels/GammaHeatSource.md +++ b/doc/content/source/kernels/GammaHeatSource.md @@ -1,16 +1,13 @@ # GammaHeatSource -!alert construction title=Undocumented Class -The GammaHeatSource has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /Kernels/GammaHeatSource ## Overview -!! Replace these lines with information regarding the GammaHeatSource object. +This object adds the $\gamma \sum_{g=1}^G \epsilon_g\Sigma_{f,g}\phi_g$ gamma heat source term of +the temperature advection-diffusion +equation where $\gamma$ is a factor represeting heat deposition by gamma and neutron irradiation in +the moderator. ## Example Input File Syntax diff --git a/doc/content/source/kernels/GroupDiffusion.md b/doc/content/source/kernels/GroupDiffusion.md index 6ba81653d8..ddd346edfb 100644 --- a/doc/content/source/kernels/GroupDiffusion.md +++ b/doc/content/source/kernels/GroupDiffusion.md @@ -1,20 +1,17 @@ # GroupDiffusion -!alert construction title=Undocumented Class -The GroupDiffusion has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /Kernels/GroupDiffusion ## Overview -!! Replace these lines with information regarding the GroupDiffusion object. +This object adds the $- \nabla \cdot D_g \nabla \phi_g$ diffusion term of the multigroup neutron +diffusion equations. Note that we have applied integration by parts to obtain the following weak +form: -## Example Input File Syntax +!equation +\int \nabla \psi \cdot D_g \nabla \phi_g\ dV -!! Describe and include an example of how to use the GroupDiffusion object. +!!## Example Input File Syntax !syntax parameters /Kernels/GroupDiffusion diff --git a/doc/content/source/kernels/HeatPrecursorDecay.md b/doc/content/source/kernels/HeatPrecursorDecay.md index 2a161c2f49..e118470cd1 100644 --- a/doc/content/source/kernels/HeatPrecursorDecay.md +++ b/doc/content/source/kernels/HeatPrecursorDecay.md @@ -1,16 +1,10 @@ # HeatPrecursorDecay -!alert construction title=Undocumented Class -The HeatPrecursorDecay has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /Kernels/HeatPrecursorDecay ## Overview -!! Replace these lines with information regarding the HeatPrecursorDecay object. +This object adds the $-\lambda_j\omega_j$ decay term of the decay heat equation. ## Example Input File Syntax diff --git a/doc/content/source/kernels/HeatPrecursorSource.md b/doc/content/source/kernels/HeatPrecursorSource.md index db2f017cc4..f20b00e9d8 100644 --- a/doc/content/source/kernels/HeatPrecursorSource.md +++ b/doc/content/source/kernels/HeatPrecursorSource.md @@ -1,16 +1,11 @@ # HeatPrecursorSource -!alert construction title=Undocumented Class -The HeatPrecursorSource has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /Kernels/HeatPrecursorSource ## Overview -!! Replace these lines with information regarding the HeatPrecursorSource object. +This object adds the $f_j\lambda_j\sum^G_{g=1} \epsilon_g\Sigma^f_g\phi_g$ source term of the decay +heat equation where $f_j$ is the fraction of total power attributable to decay heat group $j$. ## Example Input File Syntax diff --git a/doc/content/source/kernels/InScatter.md b/doc/content/source/kernels/InScatter.md index f0b14dbe38..e33e3a2005 100644 --- a/doc/content/source/kernels/InScatter.md +++ b/doc/content/source/kernels/InScatter.md @@ -1,16 +1,11 @@ # InScatter -!alert construction title=Undocumented Class -The InScatter has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /Kernels/InScatter ## Overview -!! Replace these lines with information regarding the InScatter object. +This object adds the $\sum_{g \neq g'}^G \Sigma_{g'\rightarrow g}^s \phi_{g'}$ in-scatter term of +the multigroup neutron diffusion equations. ## Example Input File Syntax diff --git a/doc/content/source/kernels/NtTimeDerivative.md b/doc/content/source/kernels/NtTimeDerivative.md index d8cb2dad3e..c8297a58bf 100644 --- a/doc/content/source/kernels/NtTimeDerivative.md +++ b/doc/content/source/kernels/NtTimeDerivative.md @@ -1,16 +1,11 @@ # NtTimeDerivative -!alert construction title=Undocumented Class -The NtTimeDerivative has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /Kernels/NtTimeDerivative ## Overview -!! Replace these lines with information regarding the NtTimeDerivative object. +This object adds the $\frac{1}{v_g}\frac{\partial \phi_g}{\partial t}$ time derivative term of the +multigroup neutron diffusion equations. ## Example Input File Syntax diff --git a/doc/content/source/kernels/PrecursorDecay.md b/doc/content/source/kernels/PrecursorDecay.md index d6d842dcfb..15117c92a1 100644 --- a/doc/content/source/kernels/PrecursorDecay.md +++ b/doc/content/source/kernels/PrecursorDecay.md @@ -1,16 +1,10 @@ # PrecursorDecay -!alert construction title=Undocumented Class -The PrecursorDecay has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /Kernels/PrecursorDecay ## Overview -!! Replace these lines with information regarding the PrecursorDecay object. +This object adds the $-\lambda_i C_i$ decay term of the delayed neutron precursor equation. ## Example Input File Syntax diff --git a/doc/content/source/kernels/PrecursorSource.md b/doc/content/source/kernels/PrecursorSource.md index 5018e4a336..d6884d8340 100644 --- a/doc/content/source/kernels/PrecursorSource.md +++ b/doc/content/source/kernels/PrecursorSource.md @@ -1,16 +1,11 @@ # PrecursorSource -!alert construction title=Undocumented Class -The PrecursorSource has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /Kernels/PrecursorSource ## Overview -!! Replace these lines with information regarding the PrecursorSource object. +This object adds the $\sum_{g'= 1}^G \beta_i \nu \Sigma_{g'}^f \phi_{g'}$ source term of the +delayed neutron precursor equation. ## Example Input File Syntax diff --git a/doc/content/source/kernels/ScalarAdvectionArtDiff.md b/doc/content/source/kernels/ScalarAdvectionArtDiff.md index 6512edc6d5..4570ac1826 100644 --- a/doc/content/source/kernels/ScalarAdvectionArtDiff.md +++ b/doc/content/source/kernels/ScalarAdvectionArtDiff.md @@ -1,16 +1,21 @@ # ScalarAdvectionArtDiff -!alert construction title=Undocumented Class -The ScalarAdvectionArtDiff has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /Kernels/ScalarAdvectionArtDiff ## Overview -!! Replace these lines with information regarding the ScalarAdvectionArtDiff object. +This object adds an isotropic artificial diffusion term where: + +!equation +\gamma = \frac{|\vec{u}|h}{2D} + +and + +!equation +\tau=\frac{1}{\tanh\gamma}-\frac{1}{\gamma}. + +This scheme is not recommended for most simulations because it tends to produce overly diffusive +results. ## Example Input File Syntax diff --git a/doc/content/source/kernels/ScalarTransportTimeDerivative.md b/doc/content/source/kernels/ScalarTransportTimeDerivative.md index 827b755c5e..5416c9ee27 100644 --- a/doc/content/source/kernels/ScalarTransportTimeDerivative.md +++ b/doc/content/source/kernels/ScalarTransportTimeDerivative.md @@ -1,16 +1,11 @@ # ScalarTransportTimeDerivative -!alert construction title=Undocumented Class -The ScalarTransportTimeDerivative has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /Kernels/ScalarTransportTimeDerivative ## Overview -!! Replace these lines with information regarding the ScalarTransportTimeDerivative object. +This object adds the $\frac{\partial C_i}{\partial t}$ time derivative term of the delayed neutron +precursor or decay heat equations. ## Example Input File Syntax diff --git a/doc/content/source/kernels/SigmaR.md b/doc/content/source/kernels/SigmaR.md index a321302b51..98d7daebd1 100644 --- a/doc/content/source/kernels/SigmaR.md +++ b/doc/content/source/kernels/SigmaR.md @@ -1,16 +1,11 @@ # SigmaR -!alert construction title=Undocumented Class -The SigmaR has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /Kernels/SigmaR ## Overview -!! Replace these lines with information regarding the SigmaR object. +This object adds the $\Sigma_g^r \phi_g$ removal term of the multigroup neutron diffusion +equations. ## Example Input File Syntax diff --git a/doc/content/source/kernels/TransientFissionHeatSource.md b/doc/content/source/kernels/TransientFissionHeatSource.md index 793b32c5f3..3f8b41f62d 100644 --- a/doc/content/source/kernels/TransientFissionHeatSource.md +++ b/doc/content/source/kernels/TransientFissionHeatSource.md @@ -1,16 +1,12 @@ # TransientFissionHeatSource -!alert construction title=Undocumented Class -The TransientFissionHeatSource has not been documented. The content listed below should be used as a starting point for -documenting the class, which includes the typical automatic documentation associated with a -MooseObject; however, what is contained is ultimately determined by what is necessary to make the -documentation clear for users. - !syntax description /Kernels/TransientFissionHeatSource ## Overview -!! Replace these lines with information regarding the TransientFissionHeatSource object. +This object adds the $\sum_{g=1}^G \epsilon_g\Sigma_{f,g}\phi_g$ heat source term of the +time-dependent temperature advection-diffusion equation with coupled neutron fluxes from a +time-dependent multigroup neutron diffusion calculation. ## Example Input File Syntax diff --git a/tutorial/eigenvalue/mesh.e b/tutorial/eigenvalue/mesh.e new file mode 100644 index 0000000000..71f57bdd40 Binary files /dev/null and b/tutorial/eigenvalue/mesh.e differ diff --git a/tutorial/eigenvalue/mesh.i b/tutorial/eigenvalue/mesh.i new file mode 100644 index 0000000000..a033de51cb --- /dev/null +++ b/tutorial/eigenvalue/mesh.i @@ -0,0 +1,119 @@ +[Mesh] + [./fuel_left] + type = GeneratedMeshGenerator + dim = 2 + xmin = 0 + xmax = 0.625 + ymin = 0 + ymax = 150 + nx = 2 + ny = 15 + [] + [./fuel_right] + type = GeneratedMeshGenerator + dim = 2 + xmin = 4.375 + xmax = 5 + ymin = 0 + ymax = 150 + nx = 2 + ny = 15 + [] + [./moderator] + type = GeneratedMeshGenerator + dim = 2 + xmin = 0.625 + xmax = 4.375 + ymin = 0 + ymax = 150 + nx = 6 + ny = 15 + [] + [./unit_mesh] + type = StitchedMeshGenerator + inputs = 'fuel_left moderator fuel_right' + stitch_boundaries_pairs = 'right left; + right left; + right left' + [] + [./mod_block] + type = SubdomainBoundingBoxGenerator + input = unit_mesh + block_id = 1 + bottom_left = '0.625 0 0' + top_right = '4.375 150 0' + [] + [./patterned_mesh] + type = PatternedMeshGenerator + inputs = 'mod_block' + pattern = '0 0 0 0 0 0 0 0 0 0 0 0 0' + x_width = 5 + [] + [./fuel_last] + type = GeneratedMeshGenerator + dim = 2 + xmin = 65 + xmax = 65.625 + ymin = 0 + ymax = 150 + nx = 2 + ny = 15 + [] + [./mod_last] + type = GeneratedMeshGenerator + dim = 2 + xmin = 65.625 + xmax = 69.375 + ymin = 0 + ymax = 150 + nx = 6 + ny = 15 + [] + [./full_mesh] + type = StitchedMeshGenerator + inputs = 'patterned_mesh fuel_last mod_last' + stitch_boundaries_pairs = 'right left; + right left; + right left' + [] + [./mod_last_block] + type = SubdomainBoundingBoxGenerator + input = full_mesh + block_id = 1 + bottom_left = '65.625 0 0' + top_right = '69.375 150 0' + [] + [./fuel_top_boundary] + type = SideSetsAroundSubdomainGenerator + input = mod_last_block + block = 0 + new_boundary = 'fuel_top' + normal = '0 1 0' + [] + [./mod_top_boundary] + type = SideSetsAroundSubdomainGenerator + input = fuel_top_boundary + block = 1 + new_boundary = 'mod_top' + normal = '0 1 0' + [] + [./fuel_bottom_boundary] + type = SideSetsAroundSubdomainGenerator + input = mod_top_boundary + block = 0 + new_boundary = 'fuel_bottom' + normal = '0 -1 0' + [] + [./mod_bottom_boundary] + type = SideSetsAroundSubdomainGenerator + input = fuel_bottom_boundary + block = 1 + new_boundary = 'mod_bottom' + normal = '0 -1 0' + [] + [./delete_boundaries] + type = BoundaryDeletionGenerator + input = mod_bottom_boundary + boundary_names = 'top bottom' + [] +[] diff --git a/tutorial/eigenvalue/nts-action.i b/tutorial/eigenvalue/nts-action.i new file mode 100644 index 0000000000..000cd8ebea --- /dev/null +++ b/tutorial/eigenvalue/nts-action.i @@ -0,0 +1,185 @@ +[GlobalParams] + num_groups = 2 + num_precursor_groups = 6 + use_exp_form = false + group_fluxes = 'group1 group2' + pre_concs = 'pre1 pre2 pre3 pre4 pre5 pre6' + temperature = 900 + sss2_input = true + account_delayed = true +[] + +[Mesh] + [mesh] + type = FileMeshGenerator + file = 'mesh.e' + [] +[] + +[Problem] + coord_type = RZ +[] + +[Nt] + var_name_base = group + vacuum_boundaries = 'fuel_bottom mod_bottom right fuel_top mod_top' + pre_blocks = '0' + create_temperature_var = false + eigen = true +[] + +[Precursors] + [pres] + var_name_base = pre + family = MONOMIAL + order = CONSTANT + block = 0 + outlet_boundaries = 'fuel_top' + constant_velocity_values = true + u_def = 0 + v_def = 18.085 + w_def = 0 + nt_exp_form = false + loop_precursors = false + transient = false + eigen = true + [] +[] + +[Materials] + [fuel] + type = MoltresJsonMaterial + block = '0' + base_file = 'xsdata.json' + material_key = 'fuel' + interp_type = LINEAR + prop_names ='' + prop_values = '' + [] + [graphite] + type = MoltresJsonMaterial + block = '1' + base_file = 'xsdata.json' + material_key = 'graphite' + interp_type = LINEAR + prop_names ='' + prop_values = '' + [] +[] + +[Executioner] + type = InversePowerMethod + max_power_iterations = 50 + + # normalization = 'powernorm' + # normal_factor = 8e6 + + xdiff = 'group1diff' + bx_norm = 'bnorm' + k0 = 1. + l_max_its = 100 + eig_check_tol = 1e-7 + + automatic_scaling = true + compute_scaling_once = false + resid_vs_jac_scaling_param = 0.1 + + solve_type = 'NEWTON' + petsc_options = '-snes_converged_reason -ksp_converged_reason -snes_linesearch_monitor' + petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_package' + petsc_options_value = 'lu NONZERO superlu_dist' + + line_search = none +[] + +[Preconditioning] + [SMP] + type = SMP + full = true + [] +[] + +[Postprocessors] + [bnorm] + type = ElmIntegTotFissNtsPostprocessor + execute_on = linear + [] + [tot_fissions] + type = ElmIntegTotFissPostprocessor + execute_on = linear + [] + [powernorm] + type = ElmIntegTotFissHeatPostprocessor + execute_on = linear + [] + [group1norm] + type = ElementIntegralVariablePostprocessor + variable = group1 + execute_on = linear + [] + [group1max] + type = NodalExtremeValue + value_type = max + variable = group1 + execute_on = timestep_end + [] + [group1diff] + type = ElementL2Diff + variable = group1 + execute_on = 'linear timestep_end' + use_displaced_mesh = false + [] + [group2norm] + type = ElementIntegralVariablePostprocessor + variable = group2 + execute_on = linear + [] + [group2max] + type = NodalExtremeValue + value_type = max + variable = group2 + execute_on = timestep_end + [] + [group2diff] + type = ElementL2Diff + variable = group2 + execute_on = 'linear timestep_end' + use_displaced_mesh = false + [] +[] + +[VectorPostprocessors] + [centerline_flux] + type = LineValueSampler + variable = 'group1 group2' + start_point = '0 0 0' + end_point = '0 150 0' + num_points = 151 + sort_by = y + execute_on = FINAL + [] + [midplane_flux] + type = LineValueSampler + variable = 'group1 group2' + start_point = '0 75 0' + end_point = '69.375 75 0' + num_points = 100 + sort_by = x + execute_on = FINAL + [] +[] + +[Outputs] + perf_graph = true + print_linear_residuals = true + [exodus] + type = Exodus + [] + [csv] + type = CSV + [] +[] + +[Debug] + show_var_residual_norms = true +[] diff --git a/tutorial/eigenvalue/nts.i b/tutorial/eigenvalue/nts.i new file mode 100644 index 0000000000..538db97685 --- /dev/null +++ b/tutorial/eigenvalue/nts.i @@ -0,0 +1,261 @@ +[GlobalParams] + num_groups = 2 + num_precursor_groups = 6 + use_exp_form = false + group_fluxes = 'group1 group2' + pre_concs = 'pre1 pre2 pre3 pre4 pre5 pre6' + temperature = 900 + sss2_input = true + account_delayed = true +[] + +[Mesh] + [mesh] + type = FileMeshGenerator + file = 'mesh.e' + [] +[] + +[Problem] + coord_type = RZ +[] + +[Variables] + [group1] + order = FIRST + family = LAGRANGE + initial_condition = 1 + [] + [group2] + order = FIRST + family = LAGRANGE + initial_condition = 1 + [] +[] + +[Precursors] + [pres] + var_name_base = pre + family = MONOMIAL + order = CONSTANT + block = 0 + outlet_boundaries = 'fuel_top' + constant_velocity_values = true + u_def = 0 + v_def = 18.085 + w_def = 0 + nt_exp_form = false + loop_precursors = false + transient = false + eigen = true + [] +[] + +[Kernels] + #--------------------------------------------------------------------- + # Group 1 Neutronics + #--------------------------------------------------------------------- + [sigma_r_group1] + type = SigmaR + variable = group1 + group_number = 1 + [] + [diff_group1] + type = GroupDiffusion + variable = group1 + group_number = 1 + [] + [inscatter_group1] + type = InScatter + variable = group1 + group_number = 1 + [] + [fission_source_group1] + type = CoupledFissionEigenKernel + variable = group1 + group_number = 1 + block = '0' + [] + [delayed_group1] + type = DelayedNeutronEigenSource + variable = group1 + block = '0' + group_number=1 + [] + + #--------------------------------------------------------------------- + # Group 2 Neutronics + #--------------------------------------------------------------------- + [sigma_r_group2] + type = SigmaR + variable = group2 + group_number = 2 + [] + [diff_group2] + type = GroupDiffusion + variable = group2 + group_number = 2 + [] + [fission_source_group2] + type = CoupledFissionEigenKernel + variable = group2 + group_number = 2 + block = '0' + [] + [inscatter_group2] + type = InScatter + variable = group2 + group_number = 2 + [] +[] + +[BCs] + [vacuum_group1] + type = VacuumConcBC + boundary = 'fuel_bottom fuel_top mod_bottom mod_top right' + variable = group1 + [] + [vacuum_group2] + type = VacuumConcBC + boundary = 'fuel_bottom fuel_top mod_bottom mod_top right' + variable = group2 + [] +[] + +[Materials] + [fuel] + type = MoltresJsonMaterial + block = '0' + base_file = 'xsdata.json' + material_key = 'fuel' + interp_type = LINEAR + prop_names ='' + prop_values = '' + [] + [graphite] + type = MoltresJsonMaterial + block = '1' + base_file = 'xsdata.json' + material_key = 'graphite' + interp_type = LINEAR + prop_names ='' + prop_values = '' + [] +[] + +[Executioner] + type = InversePowerMethod + max_power_iterations = 50 + + # normalization = 'powernorm' + # normal_factor = 8e6 + + xdiff = 'group1diff' + bx_norm = 'bnorm' + k0 = 1. + l_max_its = 100 + eig_check_tol = 1e-7 + + automatic_scaling = true + compute_scaling_once = false + resid_vs_jac_scaling_param = 0.1 + + solve_type = 'NEWTON' + petsc_options = '-snes_converged_reason -ksp_converged_reason -snes_linesearch_monitor' + petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_package' + petsc_options_value = 'lu NONZERO superlu_dist' + + line_search = none +[] + +[Preconditioning] + [SMP] + type = SMP + full = true + [] +[] + +[Postprocessors] + [bnorm] + type = ElmIntegTotFissNtsPostprocessor + execute_on = linear + [] + [tot_fissions] + type = ElmIntegTotFissPostprocessor + execute_on = linear + [] + [powernorm] + type = ElmIntegTotFissHeatPostprocessor + execute_on = linear + [] + [group1norm] + type = ElementIntegralVariablePostprocessor + variable = group1 + execute_on = linear + [] + [group1max] + type = NodalExtremeValue + value_type = max + variable = group1 + execute_on = timestep_end + [] + [group1diff] + type = ElementL2Diff + variable = group1 + execute_on = 'linear timestep_end' + use_displaced_mesh = false + [] + [group2norm] + type = ElementIntegralVariablePostprocessor + variable = group2 + execute_on = linear + [] + [group2max] + type = NodalExtremeValue + value_type = max + variable = group2 + execute_on = timestep_end + [] + [group2diff] + type = ElementL2Diff + variable = group2 + execute_on = 'linear timestep_end' + use_displaced_mesh = false + [] +[] + +[VectorPostprocessors] + [centerline_flux] + type = LineValueSampler + variable = 'group1 group2' + start_point = '0 0 0' + end_point = '0 150 0' + num_points = 151 + sort_by = y + execute_on = FINAL + [] + [midplane_flux] + type = LineValueSampler + variable = 'group1 group2' + start_point = '0 75 0' + end_point = '69.375 75 0' + num_points = 100 + sort_by = x + execute_on = FINAL + [] +[] + +[Outputs] + perf_graph = true + print_linear_residuals = true + [exodus] + type = Exodus + [] + [csv] + type = CSV + [] +[] + +[Debug] + show_var_residual_norms = true +[] diff --git a/tutorial/eigenvalue/openmc/lattice-openmc-1200.py b/tutorial/eigenvalue/openmc/lattice-openmc-1200.py new file mode 100644 index 0000000000..d5ad1b3742 --- /dev/null +++ b/tutorial/eigenvalue/openmc/lattice-openmc-1200.py @@ -0,0 +1,111 @@ +import openmc +import sys +import os +import matplotlib.pyplot as plt +import numpy as np +sys.path.insert(1, '/home/smpark/projects/moltres/python') +from moltres_xs import openmc_xs # noqa: E402 + +# %% Materials + +fuel = openmc.Material(material_id=101) +# Fuel composition at initial criticality (U235 = 65.25kg) +fuel_dens = 2.1838 +fuel.set_density('g/cm3', fuel_dens) +fuel_elements = {'Li7': 507.27 * .99995, + 'Li6': 507.27 * .00005, + 'Be': 293.96, + 'F': 3103.22, + 'Zr': 513.97, + 'U234': .67, + 'U235': 65.25, + 'U236': .27, + 'U238': 141.91} +total_fuel_weight = sum(fuel_elements.values()) +for i in fuel_elements.keys(): + if i == 'Zr' or i == 'F' or i == 'Be': + fuel.add_element(i, fuel_elements[i]/total_fuel_weight, 'wo') + else: + fuel.add_nuclide(i, fuel_elements[i]/total_fuel_weight, 'wo') +fuel.add_s_alpha_beta('c_Be') +fuel.temperature = 1200 + +graphite = openmc.Material(material_id=102) +graphite_dens = 1.85 +graphite.set_density('g/cm3', graphite_dens) +graphite.add_nuclide('C0', 1, 'wo') +graphite.add_s_alpha_beta('c_Graphite') +graphite.temperature = 1200 + +mats = openmc.Materials((fuel, graphite)) + +# %% Geometry + +bot_plane = openmc.YPlane(y0=0, boundary_type="reflective") +top_plane = openmc.YPlane(y0=1, boundary_type="reflective") +left_plane = openmc.XPlane(x0=0, boundary_type="reflective") +right_plane = openmc.XPlane(x0=5, boundary_type="reflective") +itf1_plane = openmc.XPlane(x0=.625, boundary_type="transmission") +itf2_plane = openmc.XPlane(x0=4.325, boundary_type="transmission") + +all_cells = [] + +left_fuel_cell = openmc.Cell(fill=fuel, cell_id=101) +left_fuel_cell.region = -top_plane & +bot_plane & +left_plane & -itf1_plane +all_cells.append(left_fuel_cell) + +graphite_cell = openmc.Cell(fill=graphite, cell_id=102) +graphite_cell.region = -top_plane & +bot_plane & +itf1_plane & -itf2_plane +all_cells.append(graphite_cell) + +right_fuel_cell = openmc.Cell(fill=fuel, cell_id=103) +right_fuel_cell.region = -top_plane & +bot_plane & +itf2_plane & -right_plane +all_cells.append(right_fuel_cell) + +universe = openmc.Universe(cells=all_cells) + +# %% Plot +universe.plot(origin=(2.5, 0.5, 0), + width=(5, 1), + color_by="material", + colors={fuel: "red", + graphite: "grey"}) + +# %% settings +batches = 100 +inactive = 20 +particles = 5000 + +settings = openmc.Settings() +box = openmc.stats.Box((0, 0, 0), (5, 1, 0)) +src = openmc.Source(space=box) +settings.source = src +settings.batches = batches +settings.inactive = inactive +settings.particles = particles +settings.output = {'tallies': False} +settings.temperature = {'multipole': True, + 'method': 'interpolation', + 'default': 1200.} + +# %% Moltres group constants +tallies_file = openmc.Tallies() +mats_id = [] +for m in mats: + mats_id.append(m.id) +domain_dict = openmc_xs.generate_openmc_tallies_xml( + [1e-5, 1e0, 1e8], + list(range(1, 7)), + mats, + mats_id, + tallies_file, +) + +# generate XML +mats.export_to_xml() + +geom = openmc.Geometry(universe) +geom.export_to_xml() + +settings.export_to_xml() +tallies_file.export_to_xml() diff --git a/tutorial/eigenvalue/openmc/lattice-openmc-900.py b/tutorial/eigenvalue/openmc/lattice-openmc-900.py new file mode 100644 index 0000000000..fa8f375631 --- /dev/null +++ b/tutorial/eigenvalue/openmc/lattice-openmc-900.py @@ -0,0 +1,111 @@ +import openmc +import sys +import os +import matplotlib.pyplot as plt +import numpy as np +sys.path.insert(1, '/home/smpark/projects/moltres/python') +from moltres_xs import openmc_xs # noqa: E402 + +# %% Materials + +fuel = openmc.Material(material_id=101) +# Fuel composition at initial criticality (U235 = 65.25kg) +fuel_dens = 2.3275 +fuel.set_density('g/cm3', 2.3275) +fuel_elements = {'Li7': 507.27 * .99995, + 'Li6': 507.27 * .00005, + 'Be': 293.96, + 'F': 3103.22, + 'Zr': 513.97, + 'U234': .67, + 'U235': 65.25, + 'U236': .27, + 'U238': 141.91} +total_fuel_weight = sum(fuel_elements.values()) +for i in fuel_elements.keys(): + if i == 'Zr' or i == 'F' or i == 'Be': + fuel.add_element(i, fuel_elements[i]/total_fuel_weight, 'wo') + else: + fuel.add_nuclide(i, fuel_elements[i]/total_fuel_weight, 'wo') +fuel.add_s_alpha_beta('c_Be') +fuel.temperature = 900 + +graphite = openmc.Material(material_id=102) +graphite_dens = 1.86 +graphite.set_density('g/cm3', graphite_dens) +graphite.add_nuclide('C0', 1, 'wo') +graphite.add_s_alpha_beta('c_Graphite') +graphite.temperature = 900 + +mats = openmc.Materials((fuel, graphite)) + +# %% Geometry + +bot_plane = openmc.YPlane(y0=0, boundary_type="reflective") +top_plane = openmc.YPlane(y0=1, boundary_type="reflective") +left_plane = openmc.XPlane(x0=0, boundary_type="reflective") +right_plane = openmc.XPlane(x0=5, boundary_type="reflective") +itf1_plane = openmc.XPlane(x0=.625, boundary_type="transmission") +itf2_plane = openmc.XPlane(x0=4.325, boundary_type="transmission") + +all_cells = [] + +left_fuel_cell = openmc.Cell(fill=fuel, cell_id=101) +left_fuel_cell.region = -top_plane & +bot_plane & +left_plane & -itf1_plane +all_cells.append(left_fuel_cell) + +graphite_cell = openmc.Cell(fill=graphite, cell_id=102) +graphite_cell.region = -top_plane & +bot_plane & +itf1_plane & -itf2_plane +all_cells.append(graphite_cell) + +right_fuel_cell = openmc.Cell(fill=fuel, cell_id=103) +right_fuel_cell.region = -top_plane & +bot_plane & +itf2_plane & -right_plane +all_cells.append(right_fuel_cell) + +universe = openmc.Universe(cells=all_cells) + +# %% Plot +universe.plot(origin=(2.5, 0.5, 0), + width=(5, 1), + color_by="material", + colors={fuel: "red", + graphite: "grey"}) + +# %% settings +batches = 100 +inactive = 20 +particles = 5000 + +settings = openmc.Settings() +box = openmc.stats.Box((0, 0, 0), (5, 1, 0)) +src = openmc.Source(space=box) +settings.source = src +settings.batches = batches +settings.inactive = inactive +settings.particles = particles +settings.output = {'tallies': False} +settings.temperature = {'multipole': True, + 'method': 'interpolation', + 'default': 900.} + +# %% Moltres group constants +tallies_file = openmc.Tallies() +mats_id = [] +for m in mats: + mats_id.append(m.id) +domain_dict = openmc_xs.generate_openmc_tallies_xml( + [1e-5, 1e0, 1e8], + list(range(1, 7)), + mats, + mats_id, + tallies_file, +) + +# generate XML +mats.export_to_xml() + +geom = openmc.Geometry(universe) +geom.export_to_xml() + +settings.export_to_xml() +tallies_file.export_to_xml() diff --git a/tutorial/eigenvalue/openmc/xsdata.inp b/tutorial/eigenvalue/openmc/xsdata.inp new file mode 100644 index 0000000000..bf4fcb394b --- /dev/null +++ b/tutorial/eigenvalue/openmc/xsdata.inp @@ -0,0 +1,21 @@ +[TITLE] + xsdata.json + +[MAT] + 2 + fuel graphite + +[BRANCH] + 6 + fuel 600 1 1 101 1 + fuel 900 2 1 101 1 + fuel 1200 3 1 101 1 + graphite 600 1 1 102 1 + graphite 900 2 1 102 1 + graphite 1200 3 1 102 1 + +[FILES] + 3 + statepoint-600.100.h5 openmc lattice-openmc-600.py summary-600.h5 + statepoint-900.100.h5 openmc lattice-openmc-900.py summary-900.h5 + statepoint-1200.100.h5 openmc lattice-openmc-1200.py summary-1200.h5 diff --git a/tutorial/eigenvalue/tests b/tutorial/eigenvalue/tests new file mode 100644 index 0000000000..3736080aaa --- /dev/null +++ b/tutorial/eigenvalue/tests @@ -0,0 +1,14 @@ +[Tests] + [nts] + type = RunApp + input = nts.i + check_input = True + method = opt + [] + [nts_action] + type = RunApp + input = 'nts-action.i' + check_input = True + method = opt + [] +[] diff --git a/tutorial/eigenvalue/xsdata.json b/tutorial/eigenvalue/xsdata.json new file mode 100644 index 0000000000..79a40f30e5 --- /dev/null +++ b/tutorial/eigenvalue/xsdata.json @@ -0,0 +1,254 @@ +{ + "fuel": { + "1200": { + "BETA_EFF": [ + 0.0002277457985755817, + 0.001175953936287144, + 0.001122899686947293, + 0.0025185457823096763, + 0.0010335262005859403, + 0.000432906891914749 + ], + "CHI_D": [ + 1.0, + 0.0 + ], + "CHI_P": [ + 1.000000000000002, + 0.0 + ], + "CHI_T": [ + 1.000000000000002, + 0.0 + ], + "DECAY_CONSTANT": [ + 0.013336173738466496, + 0.03273766318534082, + 0.12078297428985452, + 0.3028119739528521, + 0.8496285271699455, + 2.853461589180639 + ], + "DIFFCOEF": [ + 1.2373577015652222, + 1.209254649126858 + ], + "FISSE": [ + 193.42838568727154, + 193.40539888327484 + ], + "FISSXS": [ + 0.0011336859306396857, + 0.015903113816825003 + ], + "GTRANSFXS": [ + 0.28232658460727145, + 0.0023315741959214153, + 0.0008067853992223988, + 0.26489528474094126 + ], + "NSF": [ + 0.002765832066202944, + 0.038751115727496586 + ], + "RECIPVEL": [ + 8.835315199414271e-08, + 1.7815658522622594e-06 + ], + "REMXS": [ + 0.006249461369997742, + 0.02097858754400914 + ] + }, + "900": { + "BETA_EFF": [ + 0.00022774706889848199, + 0.0011759746253987118, + 0.0011229276137116257, + 0.0025186405498976347, + 0.0010335988292853528, + 0.00043293613210359735 + ], + "CHI_D": [ + 1.0, + 0.0 + ], + "CHI_P": [ + 1.0000000000000024, + 0.0 + ], + "CHI_T": [ + 1.0000000000000022, + 0.0 + ], + "DECAY_CONSTANT": [ + 0.01333617987864215, + 0.03273761603829335, + 0.12078307902431046, + 0.3028131001377893, + 0.8496334014889568, + 2.8534778342055067 + ], + "DIFFCOEF": [ + 1.1627818933613308, + 1.1278195077234483 + ], + "FISSE": [ + 193.42849450302552, + 193.4053988478859 + ], + "FISSXS": [ + 0.001199911896890515, + 0.01882352584300716 + ], + "GTRANSFXS": [ + 0.30086849301151936, + 0.002276926569587877, + 0.0005664067999404495, + 0.2817132268671983 + ], + "NSF": [ + 0.0029274165561535307, + 0.04586728338630509 + ], + "RECIPVEL": [ + 8.683303370845724e-08, + 1.959654853362906e-06 + ], + "REMXS": [ + 0.006341844392102427, + 0.024374437086619367 + ] + }, + "temp": [ + 900, + 1200 + ] + }, + "graphite": { + "1200": { + "BETA_EFF": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "CHI_D": [ + 0.0, + 0.0 + ], + "CHI_P": [ + 0.0, + 0.0 + ], + "CHI_T": [ + 0.0, + 0.0 + ], + "DECAY_CONSTANT": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "DIFFCOEF": [ + 0.8919731960038182, + 0.7661053068301372 + ], + "FISSE": [ + 0.0, + 0.0 + ], + "FISSXS": [ + 0.0, + 0.0 + ], + "GTRANSFXS": [ + 0.395683317823888, + 0.004554671253125907, + 0.0013296487931512056, + 0.4493198271747635 + ], + "NSF": [ + 0.0, + 0.0 + ], + "RECIPVEL": [ + 9.07328074109551e-08, + 1.7949388813637412e-06 + ], + "REMXS": [ + 0.0045677578726348155, + 0.001471147927082403 + ] + }, + "900": { + "BETA_EFF": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "CHI_D": [ + 0.0, + 0.0 + ], + "CHI_P": [ + 0.0, + 0.0 + ], + "CHI_T": [ + 0.0, + 0.0 + ], + "DECAY_CONSTANT": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "DIFFCOEF": [ + 0.8869600591072024, + 0.7613360009743724 + ], + "FISSE": [ + 0.0, + 0.0 + ], + "FISSXS": [ + 0.0, + 0.0 + ], + "GTRANSFXS": [ + 0.3983062941158192, + 0.004217636182651994, + 0.0008270293820712829, + 0.45098273321628635 + ], + "NSF": [ + 0.0, + 0.0 + ], + "RECIPVEL": [ + 8.920874121462355e-08, + 1.977592154310938e-06 + ], + "REMXS": [ + 0.0042306445561037034, + 0.0009837700248775591 + ] + }, + "temp": [ + 900, + 1200 + ] + } +} \ No newline at end of file diff --git a/tutorial/godiva/godiva_serpent.inp b/tutorial/godiva/godiva_serpent.inp index dff9fd42fb..130a42901a 100644 --- a/tutorial/godiva/godiva_serpent.inp +++ b/tutorial/godiva/godiva_serpent.inp @@ -12,4 +12,4 @@ [FILES] 1 - godiva_serpent_res.m serpent 1 + godiva_serpent_res.m serpent diff --git a/tutorial/transient/tests b/tutorial/transient/tests new file mode 100644 index 0000000000..f8b21fc464 --- /dev/null +++ b/tutorial/transient/tests @@ -0,0 +1,8 @@ +[Tests] + [transient] + type = RunApp + input = transient.i + check_input = True + method = opt + [] +[] diff --git a/tutorial/transient/transient.i b/tutorial/transient/transient.i new file mode 100644 index 0000000000..7a0161a93d --- /dev/null +++ b/tutorial/transient/transient.i @@ -0,0 +1,324 @@ +[GlobalParams] + num_groups = 2 + num_precursor_groups = 6 + use_exp_form = false + group_fluxes = 'group1 group2' + pre_concs = 'pre1 pre2 pre3 pre4 pre5 pre6' + temperature = temp + sss2_input = true + account_delayed = true +[] + +[Mesh] + [mesh] + type = FileMeshGenerator + file = '../eigenvalue/mesh.e' + [] +[] + +[Problem] + coord_type = RZ +[] + +[Variables] + [group1] + order = FIRST + family = LAGRANGE + [] + [group2] + order = FIRST + family = LAGRANGE + [] + [temp] + order = FIRST + family = LAGRANGE + initial_condition = 1000 + [] +[] + +[Precursors] + [pres] + var_name_base = pre + family = MONOMIAL + order = CONSTANT + block = 0 + outlet_boundaries = 'fuel_top' + constant_velocity_values = true + u_def = 0 + v_def = 18.085 + w_def = 0 + nt_exp_form = false + loop_precursors = false + transient = true + [] +[] + +[Kernels] + #--------------------------------------------------------------------- + # Group 1 Neutronics + #--------------------------------------------------------------------- + [time_group1] + type = NtTimeDerivative + variable = group1 + group_number = 1 + [] + [sigma_r_group1] + type = SigmaR + variable = group1 + group_number = 1 + [] + [diff_group1] + type = GroupDiffusion + variable = group1 + group_number = 1 + [] + [inscatter_group1] + type = InScatter + variable = group1 + group_number = 1 + [] + [fission_source_group1] + type = CoupledFissionKernel + variable = group1 + group_number = 1 + block = '0' + [] + [delayed_group1] + type = DelayedNeutronSource + variable = group1 + block = '0' + group_number=1 + [] + + #--------------------------------------------------------------------- + # Group 2 Neutronics + #--------------------------------------------------------------------- + [time_group2] + type = NtTimeDerivative + variable = group2 + group_number = 2 + [] + [sigma_r_group2] + type = SigmaR + variable = group2 + group_number = 2 + [] + [diff_group2] + type = GroupDiffusion + variable = group2 + group_number = 2 + [] + [fission_source_group2] + type = CoupledFissionKernel + variable = group2 + group_number = 2 + block = '0' + [] + [inscatter_group2] + type = InScatter + variable = group2 + group_number = 2 + [] + + #--------------------------------------------------------------------- + # Temperature + #--------------------------------------------------------------------- + [temp_time_derivative] + type = INSTemperatureTimeDerivative + variable = temp + [] + [temp_advection_fuel] + type = ConservativeTemperatureAdvection + variable = temp + velocity = '0 18.085 0' + block = '0' + [] + [temp_diffusion] + type = MatDiffusion + variable = temp + diffusivity = 'k' + [] + [temp_source_fuel] + type = TransientFissionHeatSource + variable = temp + block = '0' + [] +[] + +[BCs] + [vacuum_group1] + type = VacuumConcBC + boundary = 'fuel_bottom fuel_top mod_bottom mod_top right' + variable = group1 + [] + [vacuum_group2] + type = VacuumConcBC + boundary = 'fuel_bottom fuel_top mod_bottom mod_top right' + variable = group2 + [] + [temp_inlet_bc] + type = FunctionDirichletBC + variable = temp + boundary = 'fuel_bottom mod_bottom right' + function = 'temp_bc_func' + [] + [temp_outlet_bc] + type = TemperatureOutflowBC + variable = temp + boundary = 'fuel_top' + velocity = '0 18.085 0' + [] +[] + +[ICs] + [group1_ic] + type = FunctionIC + variable = group1 + function = ic_func + [] + [group2_ic] + type = FunctionIC + variable = group2 + function = ic_func + [] +[] + +[Functions] + [temp_bc_func] + type = ParsedFunction + value = '1000 - (1000-965) * tanh(t/1)' + [] + [dt_func] + type = ParsedFunction + value = 'if(t<50, if(t<30, .4, 5), 10)' + [] + [ic_func] + type = ParsedFunction + value = '1e5 * (-x^2+70^2) * (-y * (y-150))' + [] +[] + +[Materials] + [fuel] + type = MoltresJsonMaterial + block = '0' + base_file = '../eigenvalue/xsdata.json' + material_key = 'fuel' + interp_type = LINEAR + prop_names ='rho k cp' + prop_values = '2.146e-3 .0553 1967' + [] + [graphite] + type = MoltresJsonMaterial + block = '1' + base_file = '../eigenvalue/xsdata.json' + material_key = 'graphite' + interp_type = LINEAR + prop_names ='rho k cp' + prop_values = '1.86e-3 .312 1760' + [] +[] + +[Executioner] + type = Transient + end_time = 200 + + nl_rel_tol = 1e-6 + nl_abs_tol = 1e-1 + + automatic_scaling = true + compute_scaling_once = false + resid_vs_jac_scaling_param = 0.1 + scaling_group_variables = 'group1 group2; pre1 pre2 pre3 pre4 pre5 pre6; temp' + + solve_type = 'NEWTON' + petsc_options = '-snes_converged_reason -ksp_converged_reason -snes_linesearch_monitor' + petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_package' + petsc_options_value = 'lu NONZERO superlu_dist' + + line_search = none + + dtmin = 1e-3 + dtmax = 10 + [TimeStepper] + type = FunctionDT + function = dt_func + [] +# [TimeStepper] +# type = IterationAdaptiveDT +# dt = .2 +# cutback_factor = 0.4 +# growth_factor = 1.2 +# optimal_iterations = 20 +# [] +[] + +[Preconditioning] + [SMP] + type = SMP + full = true + [] +[] + +[Postprocessors] + [tot_fissions] + type = ElmIntegTotFissPostprocessor + execute_on = linear + [] + [powernorm] + type = ElmIntegTotFissHeatPostprocessor + execute_on = linear + [] + [average_temp] + type = ElementAverageValue + variable = temp + execute_on = linear + [] + [inlet_temp] + type = SideAverageValue + variable = temp + boundary = fuel_bottom + [] + [outlet_temp] + type = SideAverageValue + variable = temp + boundary = fuel_top + [] +[] + +[VectorPostprocessors] + [centerline_flux] + type = LineValueSampler + variable = 'group1 group2' + start_point = '0 0 0' + end_point = '0 150 0' + num_points = 151 + sort_by = y + execute_on = FINAL + [] + [midplane_flux] + type = LineValueSampler + variable = 'group1 group2' + start_point = '0 75 0' + end_point = '69.375 75 0' + num_points = 100 + sort_by = x + execute_on = FINAL + [] +[] + +[Outputs] + perf_graph = true +# print_linear_residuals = true + [exodus] + type = Exodus + [] + [csv] + type = CSV + execute_on = FINAL + [] +[] + +[Debug] +# show_var_residual_norms = true +[]