-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from nstauff/example-reorg
Completed reorganization of WATTS examples.
- Loading branch information
Showing
80 changed files
with
454 additions
and
1,151 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# 1App_MOOSE-MultiApp_Simple | ||
|
||
## Purpose | ||
|
||
This example provides a demonstration on how to use WATTS to perform a simple simulation leveraging MOOSE's MultiApps system. | ||
|
||
## Code(s) | ||
|
||
- MOOSE MultiApps | ||
|
||
## Keywords | ||
|
||
- Simple MultiApps | ||
|
||
## File descriptions | ||
|
||
- [__watts_exec.py__](watts_exec.py): Optimization definition with `SciPy`. This is the file to execute to run the problem described above. | ||
- [__main.tmpl__](main.tmpl): Main MOOSE input file for the main application. This input is templated. | ||
- [__main_in.e__](main_in.e): Mesh file for the MOOSE simulation. | ||
- [__sub.i__](sub.i): Input file for the sub-application. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
examples/example5_multiapps/example5a.py → .../1App_MOOSE-MultiApp_Simple/watts_exec.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# MultiApp_SAM-OpenMC_VHTR | ||
|
||
## Purpose | ||
|
||
This example provides a demonstration on how to use WATTS to perform a single SAM run followed by OpenMC, where temperature results from SAM are input to OpenMC. | ||
|
||
## Code(s) | ||
|
||
- SAM | ||
- OpenMC | ||
|
||
## Keywords | ||
|
||
- Information transfer from SAM to OpenMC | ||
- simple VHTR model | ||
|
||
## File descriptions | ||
|
||
- [__watts_exec.py__](watts_exec.py): WATTS workflow for this example. This is the file to execute to run the problem described above. | ||
- [__openmc_template__](openmc_template.py): OpenMC templated model. | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# SPDX-FileCopyrightText: 2022 UChicago Argonne, LLC | ||
# SPDX-License-Identifier: MIT | ||
|
||
""" | ||
This example demonstrates how to use WATTS to perform | ||
OpenMC calculation. This example uses a simple VHTR unit-cell | ||
model with 1 coolant channel surrounded by graphite and fuel. | ||
The demonstration includes the application of unit-conversion | ||
approach in WATTS. OpenMC is executed and the main results are | ||
printed out and stored in the params database. | ||
""" | ||
|
||
from math import cos, pi | ||
import os | ||
import watts | ||
from statistics import mean | ||
from openmc_template import build_openmc_model | ||
from astropy.units import Quantity | ||
|
||
|
||
params = watts.Parameters() | ||
|
||
# Core design params | ||
params['ax_ref'] = 20 # cm | ||
params['num_cool_pins'] = 1*6+2*6+6*2/2 | ||
params['num_fuel_pins'] = 6+6+6+3*6+2*6/2+6/3 | ||
params['Height_FC'] = 2.0 # m | ||
params['Lattice_pitch'] = 2.0 | ||
params['FuelPin_rad'] = 0.90 # cm | ||
params['cool_hole_rad'] = 0.60 # cm | ||
params['Coolant_channel_diam'] = (params['cool_hole_rad'] * 2)/100 # in m | ||
params['Graphite_thickness'] = (params['Lattice_pitch'] - params['FuelPin_rad'] - params['cool_hole_rad']) # cm | ||
params['Assembly_pitch'] = 7.5 * 2 * params['Lattice_pitch'] / (cos(pi/6) * 2) | ||
params['lbp_rad'] = 0.25 # cm | ||
params['mod_ext_rad'] = 0.90 # cm | ||
params['shell_thick'] = 0.05 # FeCrAl | ||
params['liner_thick'] = 0.007 # Cr | ||
params['control_pin_rad'] = Quantity(9.9, "mm") # Automatically converts to 'm' for MOOSE and 'cm' for openmc | ||
|
||
# Control use of S(a,b) tables | ||
params['use_sab'] = True | ||
params['use_sab_BeO'] = True | ||
params['use_sab_YH2'] = False | ||
|
||
# OpenMC params | ||
params['cl'] = params['Height_FC']*100 - 2 * params['ax_ref'] # cm | ||
params['pf'] = 40 # percent | ||
|
||
# get temperature from SAM results | ||
params['temp'] = Quantity(725, "Celsius") | ||
for i in range(1, 6): | ||
params[f'temp_F{i}'] = Quantity(725, "Celsius") | ||
|
||
params.show_summary(show_metadata=False, sort_by='time') | ||
|
||
# Run OpenMC plugin | ||
openmc_plugin = watts.PluginOpenMC(build_openmc_model, show_stderr=True) # show only error | ||
openmc_result = openmc_plugin(params) | ||
print("KEFF = ", openmc_result.keff) | ||
print(openmc_result.inputs) | ||
print(openmc_result.outputs) | ||
print(openmc_result.tallies[0].get_pandas_dataframe()) | ||
|
||
power_fractions = openmc_result.tallies[0].get_values(scores=['nu-fission']).ravel() | ||
for i, power_frac in enumerate(power_fractions): | ||
params[f'Init_P_{i+1}'] = power_frac | ||
|
||
params.show_summary(show_metadata=True, sort_by='time') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# 1App_PyARC_UnitCell | ||
|
||
## Purpose | ||
|
||
This example provides a demonstration on how to use WATTS to perform a single PyARC run and save selected results in the params database. | ||
|
||
## Code(s) | ||
|
||
- PyARC - MCC3 and DIF3D | ||
|
||
## Keywords | ||
|
||
- PyARC execution | ||
- Results extraction | ||
|
||
## File descriptions | ||
|
||
- [__watts_exec.py__](watts_exec.py): WATTS workflow for this example. This is the file to execute to run the problem described above. | ||
- [__pyarc_template__](pyarc_template): PyARC templated input file. | ||
- [__lumped.son__](lumped.son): SON file referenced in PyARC input with description of lumped fission products. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# 1App_SAM_VHTR | ||
|
||
## Purpose | ||
|
||
This example provides a demonstration on how to use WATTS to perform a single SAM run using the MOOSE plugin. | ||
|
||
## Code(s) | ||
|
||
- SAM | ||
|
||
## Keywords | ||
|
||
- SAM execution | ||
- unit-conversion | ||
- simple VHTR model | ||
|
||
## File descriptions | ||
|
||
- [__watts_exec.py__](watts_exec.py): WATTS workflow for this example. This is the file to execute to run the problem described above. | ||
- [__sam_template__](sam_template): SAM templated input file. |
File renamed without changes.
9 changes: 9 additions & 0 deletions
9
examples/example1a_SAM/example1a.py → examples/1App_SAM_VHTR/watts_exec.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# 1App_SAS_SodiumLoop | ||
|
||
## Purpose | ||
|
||
This example provides a demonstration on how to use WATTS for a simple SAS model. | ||
|
||
## Code(s) | ||
|
||
- SAS | ||
- CHANNEL module | ||
- PRIMAR4 module | ||
|
||
## Keywords | ||
|
||
- Sodium Loop | ||
|
||
## File descriptions | ||
|
||
- [__watts_exec.py__](watts_exec.py): This is the file to execute to run the problem described above. | ||
- [__sas_template__](sas_template): Templated SAS input. |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# MultiApp_SAM-OpenMC_VHTR | ||
|
||
## Purpose | ||
|
||
This example provides a demonstration on how to use WATTS to perform a single SAM run followed by OpenMC, where temperature results from SAM are input to OpenMC. | ||
|
||
## Code(s) | ||
|
||
- SAM | ||
- OpenMC | ||
|
||
## Keywords | ||
|
||
- Information transfer from SAM to OpenMC | ||
- simple VHTR model | ||
|
||
## File descriptions | ||
|
||
- [__watts_exec.py__](watts_exec.py): WATTS workflow for this example. This is the file to execute to run the problem described above. | ||
- [__openmc_template__](openmc_template.py): Link to OpenMC templated model. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../1App_OpenMC_VHTR/openmc_template.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# MultiStep_Griffin-BISON-Sockeye_MR | ||
|
||
## Purpose | ||
|
||
This example provides a demonstration on how to use WATTS to model multi-step Workflows for multiphysics simulation involving various MOOSE applications coupled by MOOSE's MultiApps system. | ||
|
||
## Code(s) | ||
|
||
- MOOSE MultiApp | ||
- Sockeye | ||
- BISON | ||
- Griffin | ||
|
||
## Keywords | ||
|
||
- Multi-steps | ||
- MultiApp | ||
- Micro-reactor | ||
- Steady-state | ||
- Transient | ||
|
||
## File descriptions | ||
|
||
- [__watts_exec.py__](watts_exec.py): Workflow definition. This is the file to execute to run the problem described above. | ||
- [__unitcell_nogap_hom_xml_G11_df_MP.xml__](unitcell_nogap_hom_xml_G11_df_MP.xml): ISOXML file containing multigroup XS for Griffin | ||
- [__3D_unit_cell_FY21_level-1_bison.e__](3D_unit_cell_FY21_level-1_bison.e): Mesh file with heat pipe holes for BISON/MOOSE subapplication. | ||
- [__3D_unit_cell_FY21_supersimple.e__](3D_unit_cell_FY21_supersimple.e): Main mesh file used by Griffin parent app. | ||
|
||
### Steady State | ||
- [__MP_ss_griffin.tmpl__](MP_ss_griffin.tmpl): Griffin input at steady-state - this is main template for steady-state. | ||
- [__MP_ss_moose.i__](MP_ss_moose.i): MOOSE input for thermal heat conduction at steady-state. This is sub-app to Griffin. | ||
- [__MP_ss_sockeye.i__](MP_ss_sockeye.i): Sockeye input for heat conduction through heatpipes at steady-state. This is sub-app to MOOSE. | ||
|
||
### Null Transient | ||
- [__MP_trN_griffin.tmpl__](MP_trN_griffin.tmpl): Griffin input during null transient. | ||
- [__MP_trN_moose.i__](MP_trN_moose.i): MOOSE input for thermal heat conduction during null transient. | ||
- [__MP_trN_sockeye.i__](MP_trN_sockeye.i): Sockeye input for heat conduction through heatpipes during null transient. | ||
|
||
### Transinet | ||
- [__MP_tr_griffin.tmpl__](MP_tr_griffin.tmpl): Griffin input during transient. | ||
- [__MP_tr_moose.i__](MP_tr_moose.i): MOOSE input for thermal heat conduction during transient. | ||
- [__MP_tr_sockeye.i__](MP_tr_sockeye.i): Sockeye input for heat conduction through heatpipes during transient. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.