Skip to content

Commit

Permalink
Merge pull request #65 from idaholab/PR_bc_sampp
Browse files Browse the repository at this point in the history
Use SamApp for sam inputs
  • Loading branch information
GiudGiud authored Feb 23, 2022
2 parents 0980e73 + 3335893 commit 74e073a
Show file tree
Hide file tree
Showing 36 changed files with 295 additions and 101 deletions.
2 changes: 1 addition & 1 deletion apps/blue_crab
Submodule blue_crab updated from 18637f to 22c713
6 changes: 3 additions & 3 deletions doc/content/pbfhr/reflector.md
Original file line number Diff line number Diff line change
Expand Up @@ -619,11 +619,11 @@ in the graphite and steel.
Next, the [MultiApps](https://mooseframework.inl.gov/syntax/MultiApps/index.html)
and [Transfers](https://mooseframework.inl.gov/syntax/Transfers/index.html)
blocks describe the interaction between Cardinal
and MOOSE. The MOOSE heat conduction module is here run as the master application, with
and MOOSE. The MOOSE heat conduction module is here run as the main application, with
the nekRS wrapping run as the sub-application. We specify that MOOSE will run first on each
time step. Allowing sub-cycling means that, if the MOOSE time step is 0.05 seconds, but
the nekRS time step is 0.02 seconds, that for every MOOSE time step, nekRS will perform
three time steps, of length 0.02, 0.02, and 0.01 seconds to "catch up" to the MOOSE master
three time steps, of length 0.02, 0.02, and 0.01 seconds to "catch up" to the MOOSE main
application. If sub-cycling is turned off, then the smallest time step among all the various
applications is used.

Expand Down Expand Up @@ -762,7 +762,7 @@ The input consists of blocks and parameters. The `[GENERAL]` block describes the
time stepping, simulation end control, and the polynomial order. Here, a time step
of 0.025 (non-dimensional) is used; a nekRS output file is written every 100 time steps.
Because nekRS is run as a sub-application to MOOSE, the `stopAt` and `numSteps`
fields are actually ignored, so that the steady state tolerance in the MOOSE master
fields are actually ignored, so that the steady state tolerance in the MOOSE main
application dictates when a simulation terminates. Because the purpose of this
simulation is only to obtain a reasonable initial condition, a low polynomial order
of 2 is used.
Expand Down
4 changes: 2 additions & 2 deletions doc/content/pbfhr/steady/griffin.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Griffin steady state input

We will first cover the input for the master application, Griffin, which tackles the neutronics
We will first cover the input for the main application, Griffin, which tackles the neutronics
problem. While the Griffin manual is ultimately the most complete reference on this input, we will
try to provide enough details here for a complete comprehension of this input.

Expand Down Expand Up @@ -162,7 +162,7 @@ types:
useful for easily importing then plotting the simulation results using Python or Matlab.

- checkpoint files. [Checkpoint](https://mooseframework.inl.gov/source/outputs/Checkpoint.html) files are used solely for restarting simulations. Unlike Exodus files, they also
contain all the subapp information, so only the master app checkpoint files are necessary. Checkpoint files are
contain all the subapp information, so only the main app checkpoint files are necessary. Checkpoint files are
output at a regular interval, specified by the `num_files` field.


Expand Down
1 change: 1 addition & 0 deletions htgr/mhtgr/tests
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
input = 'MHTGR.i'
check_input = True
executable_pattern = 'sam*|blue_crab*'
cli_args = '--app SamApp'
[]
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
time,Decay_heat_tot,FRR_avg,Fiss_power_tot,NI_avg,NXe_avg,T_fuel_avg,T_mod_avg,T_ref_avg,Tt_pow,Tt_pow_check,eigenvalue,flux0_avg,flux1_avg,iodine_yield_avg,power_density_max,power_scaling,scaled_fast_flux_max,scaled_thermal_flux_max,xenon_yield_avg
0,25704000,1.5245216104979e+17,374296000,0,0,900,700,700,400000000,400000000,1,9.0972125609476e+17,9.0972125609476e+17,0,0,2.9898536896588e+18,0,0,0
1,25704000,1.5244890404514e+17,374296000,0.33228066245312,0.069961311140756,900,700,700,400000000,400000000,0.97812617654251,9.4869507187592e+17,9.1709749412722e+17,0.063862452014911,6307002.4191342,3.0283398832533e+18,1.2239880893765e+18,1.6641083271698e+18,0.0043609085076789
7 changes: 7 additions & 0 deletions htgr/pbmr400/steady/gold/oecd_pbmr400_ss1_phtn_flow_path.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
time,T_fluid_avg,T_fuel_avg,T_mod_avg,T_solid_avg,Tt_mfr_core_out,Tt_mfr_in,Tt_mfr_out,Tt_normalized_pow,Tt_pow,time_step_pp
0,773.15,900,700,773.15,252.33485276416,-192.69977534233,123.11785397528,0,0,0
0.01,773.15,900,700,773.15,86.611982323528,-173.4297978081,56.869583415037,0,0,0.01
0.05,773.15,900,700,773.15,154.92155962714,-173.4297978081,99.771257151472,0,0,0.04
0.21,773.15,900,700,773.15,187.21563454771,-173.4297978081,120.0497586682,0,0,0.16
0.85,773.14999999554,900,700,773.1499999949,192.52245741576,-173.4297978081,123.38201449603,0,0,0.64
3.41,773.1498033553,900,700,773.14978393211,192.76392310825,-173.4297978081,123.53362948339,0,0,2.56
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
time,fuel_average_temp,moderator_average_temp,pebble_core_average_temp,pebble_surface_temp
0,0,0,0,0
1e+15,0,0,0,0
2e+15,0,0,0,0
13 changes: 5 additions & 8 deletions htgr/pbmr400/steady/oecd_pbmr400_ss0_rsnk_eigen_value_ix_dep.i
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ==============================================================================
# PBMR-400 steady-state phase 1 exercise 3, NEA/NSC/DOC(2013)10.
# MASTER0 Neutron kinetic model, T_fuel and T_mod feedback supplied by TH subapp.
# MAIN0 Neutron kinetic model, T_fuel and T_mod feedback supplied by TH subapp.
# FENIX input file
# ------------------------------------------------------------------------------
# Idaho Falls, INL, 02/22/2020
Expand Down Expand Up @@ -640,7 +640,7 @@ fis_fract = ${fparse 1 - dh_fract} # Fission power fraction at t = 0.
n_delay_groups = 6
family = LAGRANGE
order = FIRST
fission_source_as_material = true
fission_source_aux = true
assemble_scattering_jacobian = true
assemble_fission_jacobian = true
diffusion_kernel_type = tensor
Expand All @@ -656,8 +656,8 @@ fis_fract = ${fparse 1 - dh_fract} # Fission power fraction at t = 0.
[]

[Executioner]
type = PicardEigen # Picard iteration to reach stable NK+TH solution.
solve_type = 'PJFNK'
type = Eigenvalue # Picard iteration to reach stable NK+TH solution.
solve_type = 'PJFNKMO'
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart'
petsc_options_value = 'hypre boomeramg 50'
line_search = none
Expand All @@ -677,10 +677,7 @@ fis_fract = ${fparse 1 - dh_fract} # Fission power fraction at t = 0.
[]

# Power iterations.
free_power_iterations = 2
extra_free_pi = 2
output_after_power_iterations = false
output_before_normalization = false
free_power_iterations = 4

# Multiphysics coupling iterationa.
fixed_point_abs_tol = 1e-7
Expand Down
6 changes: 3 additions & 3 deletions htgr/pbmr400/steady/oecd_pbmr400_ss1_phtn_flow_path.i
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# ==============================================================================
# PBMR-400 steady-state phase 1 exercise 3, NEA/NSC/DOC(2013)10.
# SUBAPP1 MASTER1 thermal-hydraulics model, power supplied by NK MASTER0 app.
# SUBAPP1 MAIN1 thermal-hydraulics model, power supplied by NK MAIN0 app.
# FENIX input file
# ------------------------------------------------------------------------------
# Idaho Falls, Idaho National Laboratory, 02/03/2020
# Author(s): Dr. Paolo Balestra, Dr. Sebastian Schunert
# ==============================================================================
# - ss1: Steady state simulation master app level 1
# - ss1: Steady state simulation main app level 1
# - phth: ProngHorn for thermal hydraulics
# - lgcy: Legacy kernels
# - supmix: Mixed superficial variables
Expand Down Expand Up @@ -904,7 +904,7 @@ riser_superficial_rho_v = ${fparse reactor_total_mfr/riser_free_flow_are
[barrel_to_rpv]
type = GapHeatTransfer
variable = T_solid
emissivity_master = ${global_emissivity}
emissivity_primary = ${global_emissivity}
emissivity_secondary = ${global_emissivity}
gap_geometry_type = CYLINDER
primary = barrel_rpv_gap_outer
Expand Down
8 changes: 4 additions & 4 deletions htgr/pbmr400/steady/oecd_pbmr400_ss2_mhtr_pebble_triso.i
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ==============================================================================
# PBMR-400 pebble/TRISO 1-D model, NEA/NSC/DOC(2013)10
# SUBAPP2 Pebble/TRISO 1-D model, Pebble surface temp and power density supplied
# by TH MASTER1 TH app.
# by TH MAIN TH app.
# FENIX input file
# ------------------------------------------------------------------------------
# Idaho Falls, INL, 01/20/2020
Expand Down Expand Up @@ -285,7 +285,7 @@ pebble_bed_porosity = 0.39 # Pebble bed porosity (//)
line_search = l2

# Problem time parameters.
dt = 1e+15 # Let the master app control time steps.
dt = 1e+15 # Let the main app control time steps.

# Linear/nonlinear iterations.
nl_abs_tol = 1e-8
Expand All @@ -303,12 +303,12 @@ pebble_bed_porosity = 0.39 # Pebble bed porosity (//)
execute_on = 'LINEAR'
[]

# Feedbacks from the master.
# Feedbacks from the main app
[pebble_surface_temp]
type = Receiver
[]

# Feedbacks to the master.
# Feedbacks to the main app
[moderator_average_temp]
type = ElementAverageValue
variable = T_pebble
Expand Down
113 changes: 102 additions & 11 deletions htgr/pbmr400/steady/tests
Original file line number Diff line number Diff line change
@@ -1,44 +1,135 @@
[Tests]
[multiphysics]
# Individual steady syntax checks
[neutronics_syntax_only]
type = RunApp
input = 'oecd_pbmr400_ss0_rsnk_eigen_value_ix_dep.i'
executable_pattern = 'blue_crab*|fenix*'
cli_args = 'Executioner/fixed_point_max_its=1'
check_input = True
executable_pattern = 'griffin*|blue_crab*|dire_wolf*|fenix*'
cli_args = "MultiApps/active='' Transfers/active=''"
method = 'opt' # see Griffin #230
min_parallel = 4
[]
[neutronics]
[fluid_flow_syntax_only]
type = RunApp
input = 'oecd_pbmr400_ss1_phtn_flow_path.i'
check_input = True
executable_pattern = 'pronghorn*|blue_crab*|fenix*'
cli_args = "MultiApps/active='' Transfers/active=''"
[]
[fuel_performance_syntax_only]
type = RunApp
input = 'oecd_pbmr400_ss2_mhtr_pebble_triso.i'
check_input = True
executable_pattern = 'pronghorn*|blue_crab*|fenix*'
cli_args = 'Executioner/num_steps=1'
[]

# Steady regression tests
# Run these before so they dont overwrite the good checkpoint file for transients
[neutronics_only]
type = CSVDiff
input = 'oecd_pbmr400_ss0_rsnk_eigen_value_ix_dep.i'
csvdiff = 'oecd_pbmr400_ss0_rsnk_eigen_value_ix_dep.csv'
executable_pattern = 'griffin*|blue_crab*|dire_wolf*|fenix*'
cli_args = "MultiApps/active='' Transfers/active='' Executioner/nl_abs_tol=0.1"
method = 'opt' # see Griffin #230
[]
[fluid_flow_only]
type = CSVDiff
input = 'oecd_pbmr400_ss1_phtn_flow_path.i'
csvdiff = 'oecd_pbmr400_ss1_phtn_flow_path.csv'
executable_pattern = 'pronghorn*|blue_crab*|fenix*'
cli_args = "MultiApps/active='' Transfers/active='' Executioner/num_steps=5"
[]
[fuel_performance_only]
type = CSVDiff
input = 'oecd_pbmr400_ss2_mhtr_pebble_triso.i'
csvdiff = 'oecd_pbmr400_ss2_mhtr_pebble_triso.csv'
executable_pattern = 'pronghorn*|blue_crab*|fenix*'
cli_args = 'Executioner/num_steps=2 Outputs/csv=true'
[]

# Individual transient syntax checks
[transient_neutronics_syntax_only]
type = RunApp
working_directory = '../transient'
input = 'oecd_pbmr400_tr0_pplofc_rsnk_keff_calc.i'
check_input = True
executable_pattern = 'griffin*|blue_crab*|dire_wolf*|fenix*'
cli_args = "MultiApps/active='' Transfers/active=''"
prereq = 'neutronics_only'
method = 'opt' # see Griffin #230
[]
[fluid_flow]
[transient_fluid_flow_syntax_only]
type = RunApp
input = 'oecd_pbmr400_ss1_phtn_flow_path.i'
working_directory = '../transient'
input = 'oecd_pbmr400_tr1_pplofc_phtn_flow_path.i'
check_input = True
executable_pattern = 'pronghorn*|blue_crab*|fenix*'
cli_args = "MultiApps/active='' Transfers/active=''"
prereq = 'fluid_flow_only'
[]
[fuel_performance]
[transient_fuel_performance_syntax_only]
type = RunApp
input = 'oecd_pbmr400_ss2_mhtr_pebble_triso.i'
working_directory = '../transient'
input = 'oecd_pbmr400_tr2_pplofc_mhtr_pebble_triso.i'
check_input = True
executable_pattern = 'pronghorn*|blue_crab*|fenix*'
cli_args = 'Executioner/num_steps=1'
[]

# Run simulation, no results checking
[steady_multiphysics]
type = RunApp
input = 'oecd_pbmr400_ss0_rsnk_eigen_value_ix_dep.i'
executable_pattern = 'blue_crab*|fenix*'
cli_args = 'Executioner/fixed_point_max_its=1'
method = 'opt' # see Griffin #230
min_parallel = 8
# require the others so the restart files dont get overwritten
prereq = 'transient_neutronics_only transient_fluid_flow_only'
[]

# This will fail until:
# - griffin can load restart binary files from another folder
# - the issue with cross sections (tensor diffusion coef) is fixed
[transient_multiphysics]
type = RunApp
working_directory = '../transient'
input = 'oecd_pbmr400_tr0_pplofc_rsnk_keff_calc.i'
executable_pattern = 'blue_crab*|fenix*'
cli_args = 'Executioner/fixed_point_max_its=2 Executioner/num_steps=1 MultiApps/th_sub/cli_args=Executioner/end_time=800'
method = 'opt' # see Griffin #230
# Checkpoint file must have been generated with same number of ranks
prereq = 'steady_multiphysics'
min_parallel = 8
[]

# Transient regression tests
[transient_neutronics_only]
type = CSVDiff
working_directory = '../transient'
cli_args = 'Executioner/num_steps=1'
prereq = 'multiphysics'
input = 'oecd_pbmr400_tr0_pplofc_rsnk_keff_calc.i'
csvdiff = 'oecd_pbmr400_tr0_pplofc_rsnk_keff_calc.csv'
executable_pattern = 'griffin*|blue_crab*|dire_wolf*|fenix*'
cli_args = "MultiApps/active='' Transfers/active='' Executioner/num_steps=2"
method = 'opt' # see Griffin #230
prereq = 'neutronics_only'
[]
[transient_fluid_flow_only]
type = CSVDiff
working_directory = '../transient'
input = 'oecd_pbmr400_tr1_pplofc_phtn_flow_path.i'
csvdiff = 'oecd_pbmr400_tr1_pplofc_phtn_flow_path.csv'
executable_pattern = 'pronghorn*|blue_crab*|fenix*'
cli_args = "MultiApps/active='' Transfers/active='' Executioner/num_steps=5"
prereq = 'fluid_flow_only'
[]
[transient_fuel_performance_only]
type = CSVDiff
working_directory = '../transient'
input = 'oecd_pbmr400_tr2_pplofc_mhtr_pebble_triso.i'
csvdiff = 'oecd_pbmr400_tr2_lf40_mhtr_pebble_triso.csv'
executable_pattern = 'pronghorn*|blue_crab*|fenix*'
cli_args = 'Executioner/num_steps=2 Outputs/csv=true'
[]
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
time,Decay_heat_tot,FRR_avg,Fiss_power_tot,NI_avg,NXe_avg,T_fuel_avg,T_fuel_max,T_fuel_max_kernel,T_mod_avg,Transient_decay_heat_tot,Tt_pow,decay_heat_scaling_factor,flux0_avg,flux1_avg,power_scaling,reactor_total_power_check,time_step_pp
0,25704000,1.5244890404514e+17,374296000,0.33228066245312,0.069961311140756,900,900,0,700,25704000,400000000,1,9.4869507187592e+17,9.1709749412722e+17,3.2394800939706e+19,400000000,0
180000,25704000,6409553311.883,15.735388296098,0.052952307182353,0.072892712857253,900,900,0,700,1658411.7984,16.815983388652,0.0645196,42311929996.041,37836922204.61,3.2394800939706e+19,1658427.5337883,180000
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
time,T_fluid_avg,T_fuel_avg,T_mod_avg,T_solid_avg,Tt_pow,courant_condition,he_mass_tt,he_temp_avg,he_vol_tt,min_courant_num,pressure_avg,switch,time_step_pp,timestep_pp,trip_valve
0,773.1498033553,900,700,773.14978393211,0,0,836.50797263881,773.14984879563,149.30377617162,0,9123075.3591948,0,2.56,0,0
0.01,773.1498027685,900,700,773.14978393061,0,15.711136829381,836.41363257775,773.14984830227,149.30377617162,0.00063649117874777,9122032.367246,598.23363415754,0.01,0.99930769230769,0
0.03,773.14980201063,900,700,773.14978392579,0,31.432365530089,836.11986334573,773.14984757067,149.30377617162,0.00063628682291999,9118784.2577271,598.23363415754,0.02,0.99792307692308,0
0.07,773.14980125397,900,700,773.14978391241,0,62.819249715482,835.36053328338,773.14984668849,149.30377617162,0.00063674749668559,9110388.341142,598.23363415754,0.04,0.99515384615385,0
0.15,773.14980066824,900,700,773.14978387987,0,125.227342945,833.6547602585,773.1498458941,149.30377617162,0.00063883811728828,9091528.0226786,598.23363415754,0.08,0.98961538461538,0
0.31,773.14980021172,900,700,773.14978380665,0,248.50089688814,830.12409596089,773.14984534562,149.30377617162,0.00064386085524683,9052493.5251907,598.23363415754,0.16,0.97853846153846,0
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
time,fuel_average_temp,moderator_average_temp,pebble_core_average_temp,pebble_core_center_temp,pebble_surface_temp
0,0,0,0,0,0
1e+15,0,0,0,0,0
2e+15,0,0,0,0,0
17 changes: 8 additions & 9 deletions htgr/pbmr400/transient/oecd_pbmr400_tr0_pplofc_rsnk_keff_calc.i
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ==============================================================================
# PBMR-400 steady-state phase 1 exercise 3, NEA/NSC/DOC(2013)10.
# MASTER0 Neutron kinetic model, T_fuel and T_mod feedback supplied by TH subapp.
# MAIN0 Neutron kinetic model, T_fuel and T_mod feedback supplied by TH subapp.
# FENIX input file
# ------------------------------------------------------------------------------
# Idaho Falls, INL, 02/22/2020
Expand Down Expand Up @@ -141,11 +141,11 @@ fis_fract = ${fparse 1 - dh_fract} # Fission power fraction at t = 0.
133 133 133 133 155 116 113 113 113 113 113 135 164 144 144 152 152 152 189 190 '
[]
[cartesian_mesh_ids]
type = SubdomainElementIDs
type = SubdomainExtraElementIDGenerator
input = cartesian_mesh
subdomains = ${all_bloks}
equivalence_ids = ${all_bloks}
material_ids = ${material_ids}
subdomains = ${all_bloks}
extra_element_id_names = 'material_id equivalence_id'
extra_element_ids = '${material_ids}; ${all_bloks}'
[]
uniform_refine = 0
[]
Expand Down Expand Up @@ -673,7 +673,7 @@ fis_fract = ${fparse 1 - dh_fract} # Fission power fraction at t = 0.
n_delay_groups = 6
family = LAGRANGE
order = FIRST
fission_source_as_material = true
fission_source_aux = true
assemble_scattering_jacobian = true
assemble_fission_jacobian = true
diffusion_kernel_type = tensor
Expand All @@ -695,7 +695,7 @@ fis_fract = ${fparse 1 - dh_fract} # Fission power fraction at t = 0.

# end_time = 6000.0
end_time = 180000.0
dt = 1e+15 # Let the master app control time steps.
dt = 1e+15 # Let the fluid control time steps.

l_tol = 1e-4
nl_rel_tol = 1e-7
Expand Down Expand Up @@ -724,10 +724,9 @@ fis_fract = ${fparse 1 - dh_fract} # Fission power fraction at t = 0.
[MultiApps]
[th_sub]
type = TransientMultiApp
app_type = FenixApp
input_files = 'oecd_pbmr400_tr1_pplofc_phtn_flow_path.i'
positions = '0.0 -2.8500 0.0' # Vertical offset between the two meshes.
# sub_cycling = true
sub_cycling = true
[]
[]

Expand Down
Loading

0 comments on commit 74e073a

Please sign in to comment.