- execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.
Default:TIMESTEP_END
C++ Type:ExecFlagEnum
Controllable:No
Description:The list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- tally_scoreScore to report the relative error. If there is just a single score, this defaults to that value
C++ Type:MultiMooseEnum
Controllable:No
Description:Score to report the relative error. If there is just a single score, this defaults to that value
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
- value_typemaxWhether to give the maximum or minimum tally relative error
Default:max
C++ Type:MooseEnum
Controllable:No
Description:Whether to give the maximum or minimum tally relative error
TallyRelativeError
Extract the maximum/minimum tally relative error
Description
This postprocessor evaluates the maximum, minimum, or average relative error in the tally created by OpenMCCellAverageProblem. This postprocessor can be used to monitor statistical convergence of the tally.
Example Input Syntax
Below, the max_rel_err
, min_rel_err
and avg_rel_err
postprocessors are used to evaluate the maximum, minimum and average tally relative error, respectively.
[Postprocessors]
[max_rel_err]
type = TallyRelativeError
value_type = max
[]
[min_rel_err]
type = TallyRelativeError
value_type = min
[]
[avg_rel_err]
type = TallyRelativeError
value_type = average
[]
[power_1]
type = PointValue
variable = kappa_fission
point = '0 0 0'
[]
[power_2]
type = PointValue
variable = kappa_fission
point = '0 0 4'
[]
[power_3]
type = PointValue
variable = kappa_fission
point = '0 0 8'
[]
[std_dev_1]
type = PointValue
variable = kappa_fission_std_dev
point = '0 0 0'
[]
[std_dev_2]
type = PointValue
variable = kappa_fission_std_dev
point = '0 0 4'
[]
[std_dev_3]
type = PointValue
variable = kappa_fission_std_dev
point = '0 0 8'
[]
[]
(test/tests/postprocessors/fission_tally_relative_error/openmc.i)Input Parameters
- allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
Default:False
C++ Type:bool
Controllable:No
Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
Default:0
C++ Type:int
Controllable:No
Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
- force_postauxFalseForces the UserObject to be executed in POSTAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in POSTAUX
- force_preauxFalseForces the UserObject to be executed in PREAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREAUX
- force_preicFalseForces the UserObject to be executed in PREIC during initial setup
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREIC during initial setup
- outputsVector of output names where you would like to restrict the output of variables(s) associated with this object
C++ Type:std::vector<OutputName>
Controllable:No
Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
Input Files
- (test/tests/neutronics/triggers/tally_rel_err.i)
- (tutorials/lwr_solid/openmc_um.i)
- (tutorials/gas_compact_multiphysics/openmc_nek.i)
- (test/tests/postprocessors/fission_tally_relative_error/multi.i)
- (test/tests/neutronics/triggers/ignore_zeros/ignore_zero.i)
- (test/tests/neutronics/triggers/multi_rel_err.i)
- (tutorials/msfr/openmc.i)
- (tutorials/gas_compact/openmc.i)
- (test/tests/postprocessors/fission_tally_relative_error/ratio.i)
- (test/tests/openmc_errors/incorrect_problem/openmc.i)
- (test/tests/neutronics/tallies/reaction_rates/openmc.i)
- (tutorials/tokamak/openmc.i)
- (test/tests/neutronics/feedback/triso/openmc.i)
- (tutorials/lwr_solid/openmc.i)
- (tutorials/gas_assembly/openmc.i)
- (test/tests/neutronics/tallies/tritium/openmc.i)
- (tutorials/pincell_multiphysics/openmc.i)
- (test/tests/neutronics/triggers/mesh_tally_rel_err.i)
- (test/tests/postprocessors/fission_tally_relative_error/openmc.i)
- (tutorials/pebbles/openmc_um.i)
- (tutorials/gas_compact_multiphysics/openmc_thm.i)
- (tutorials/pebbles/openmc.i)
(test/tests/postprocessors/fission_tally_relative_error/openmc.i)
[Mesh]
[sphere]
type = FileMeshGenerator
file = ../../neutronics/meshes/sphere.e
[]
[solid]
type = CombinerGenerator
inputs = sphere
positions = '0 0 0
0 0 4
0 0 8'
[]
[solid_ids]
type = SubdomainIDGenerator
input = solid
subdomain_id = '100'
[]
[]
[Problem]
type = OpenMCCellAverageProblem
power = 100.0
temperature_blocks = '100'
cell_level = 0
check_tally_sum = false
initial_properties = xml
[Tallies]
[Cell]
type = CellTally
blocks = '100'
# this outputs the fission tally standard deviation in space
output = 'unrelaxed_tally_std_dev'
[]
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Postprocessors]
[max_rel_err]
type = TallyRelativeError
value_type = max
[]
[min_rel_err]
type = TallyRelativeError
value_type = min
[]
[avg_rel_err]
type = TallyRelativeError
value_type = average
[]
[power_1]
type = PointValue
variable = kappa_fission
point = '0 0 0'
[]
[power_2]
type = PointValue
variable = kappa_fission
point = '0 0 4'
[]
[power_3]
type = PointValue
variable = kappa_fission
point = '0 0 8'
[]
[std_dev_1]
type = PointValue
variable = kappa_fission_std_dev
point = '0 0 0'
[]
[std_dev_2]
type = PointValue
variable = kappa_fission_std_dev
point = '0 0 4'
[]
[std_dev_3]
type = PointValue
variable = kappa_fission_std_dev
point = '0 0 8'
[]
[]
[Outputs]
csv = true
[]
(test/tests/neutronics/triggers/tally_rel_err.i)
[Mesh]
[sphere]
type = FileMeshGenerator
file = ../meshes/sphere.e
[]
[solid]
type = CombinerGenerator
inputs = sphere
positions = '0 0 0
0 0 4
0 0 8'
[]
[solid_ids]
type = SubdomainIDGenerator
input = solid
subdomain_id = '100'
[]
[]
[Problem]
type = OpenMCCellAverageProblem
power = 100.0
cell_level = 0
normalize_by_global_tally = false
max_batches = 200
[Tallies]
[Cell]
type = CellTally
blocks = '100'
trigger = rel_err
trigger_threshold = 2e-2
[]
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Postprocessors]
[max_tally_err]
type = TallyRelativeError
[]
[]
[Outputs]
csv = true
[]
(tutorials/lwr_solid/openmc_um.i)
[Mesh]
[file]
type = FileMeshGenerator
file = mesh_in.e
[]
allow_renumbering = false
[]
[AuxVariables]
[cell_temperature]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[cell_temperature]
type = CellTemperatureAux
variable = cell_temperature
[]
[]
[Problem]
type = OpenMCCellAverageProblem
verbose = true
power = ${fparse 3000e6 / 273 / (17 * 17)}
temperature_blocks = '1 2 3'
normalize_by_global_tally = false
cell_level = 0
particles = 20000
inactive_batches = 500
batches = 10000
[Tallies]
[heat_source]
type = MeshTally
name = heat_source
[]
[]
[]
[Executioner]
type = Transient
[]
[Outputs]
exodus = true
csv = true
[]
[Postprocessors]
[heat_source]
type = ElementIntegralVariablePostprocessor
variable = heat_source
[]
[max_tally_rel_err]
type = TallyRelativeError
[]
[max_heat_source]
type = ElementExtremeValue
variable = heat_source
[]
[]
(tutorials/gas_compact_multiphysics/openmc_nek.i)
# This input file runs coupled OpenMC Monte Carlo transport, MOOSE heat
# conduction, and NekRS fluid flow and heat transfer.
# This input should be run with:
#
# cardinal-opt -i common_input.i openmc_nek.i
num_layers_for_THM = 150
density_blocks = 'coolant'
temperature_blocks = 'graphite compacts compacts_trimmer_tri'
fuel_blocks = 'compacts compacts_trimmer_tri'
unit_cell_power = ${fparse power / (n_bundles * n_coolant_channels_per_block) * unit_cell_height / height}
U_ref = ${fparse mdot / (n_bundles * n_coolant_channels_per_block) / fluid_density / (pi * channel_diameter * channel_diameter / 4.0)}
t0 = ${fparse channel_diameter / U_ref}
nek_dt = 6e-3
N = 1000
[Mesh]
[solid]
type = FileMeshGenerator
file = solid_mesh_in.e
[]
[]
[AuxVariables]
[cell_temperature]
family = MONOMIAL
order = CONSTANT
[]
[cell_density]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[cell_temperature]
type = CellTemperatureAux
variable = cell_temperature
[]
[cell_density]
type = CellDensityAux
variable = cell_density
[]
[density]
type = FluidDensityAux
variable = density
p = ${outlet_P}
T = nek_temp
fp = helium
execute_on = 'timestep_begin'
[]
[]
[FluidProperties]
[helium]
type = IdealGasFluidProperties
molar_mass = 4e-3
gamma = 1.668282 # should correspond to Cp = 5189 J/kg/K
k = 0.2556
mu = 3.22639e-5
[]
[]
[ICs]
[temp]
type = FunctionIC
variable = nek_temp
function = temp_ic
[]
[solid_temp]
type = FunctionIC
variable = solid_temp
function = temp_ic
[]
[]
[Functions]
[temp_ic]
type = ParsedFunction
expression = '${inlet_T} + z / ${unit_cell_height} * ${unit_cell_power} / (${mdot} / ${n_bundles} / ${n_coolant_channels_per_block}) / ${fluid_Cp}'
[]
[]
[Problem]
type = OpenMCCellAverageProblem
power = ${unit_cell_power}
scaling = 100.0
density_blocks = ${density_blocks}
cell_level = 1
relaxation = robbins_monro
temperature_variables = 'solid_temp; nek_temp'
temperature_blocks = '${temperature_blocks}; ${density_blocks}'
k_trigger = std_dev
k_trigger_threshold = 7.5e-4
batches = 40
max_batches = 100
batch_interval = 5
[Tallies]
[heat_source]
type = CellTally
blocks = ${fuel_blocks}
name = heat_source
check_equal_mapped_tally_volumes = true
trigger = rel_err
trigger_threshold = 1e-2
output = 'unrelaxed_tally_std_dev'
[]
[]
[]
[Executioner]
type = Transient
dt = ${fparse N * nek_dt * t0}
# This is somewhat loose, and you should use a tighter tolerance for production runs;
# we use 1e-2 to obtain a faster tutorial
steady_state_detection = true
check_aux = true
steady_state_tolerance = 1e-2
[]
[MultiApps]
[bison]
type = TransientMultiApp
input_files = 'solid_nek.i'
execute_on = timestep_end
sub_cycling = true
[]
[]
[Transfers]
[solid_temp_to_openmc]
type = MultiAppGeometricInterpolationTransfer
source_variable = T
variable = solid_temp
from_multi_app = bison
[]
[source_to_bison]
type = MultiAppGeneralFieldShapeEvaluationTransfer
source_variable = heat_source
variable = power
to_multi_app = bison
from_postprocessors_to_be_preserved = heat_source
to_postprocessors_to_be_preserved = power
[]
[temp_from_nek]
type = MultiAppGeneralFieldShapeEvaluationTransfer
source_variable = nek_bulk_temp
from_multi_app = bison
variable = nek_temp
[]
[]
[Postprocessors]
[heat_source]
type = ElementIntegralVariablePostprocessor
variable = heat_source
execute_on = 'transfer initial timestep_end'
[]
[max_tally_err]
type = TallyRelativeError
value_type = max
[]
[k]
type = KEigenvalue
[]
[k_std_dev]
type = KStandardDeviation
[]
[min_power]
type = ElementExtremeValue
variable = heat_source
value_type = min
block = ${fuel_blocks}
[]
[max_power]
type = ElementExtremeValue
variable = heat_source
value_type = max
block = ${fuel_blocks}
[]
[]
[UserObjects]
[average_power_axial]
type = LayeredAverage
variable = heat_source
direction = z
num_layers = ${num_layers_for_plots}
block = ${fuel_blocks}
[]
[]
[VectorPostprocessors]
[power_avg]
type = SpatialUserObjectVectorPostprocessor
userobject = average_power_axial
[]
[]
[Outputs]
[out]
type = Exodus
hide = 'solid_temp nek_temp'
[]
[csv]
type = CSV
file_base = 'csv_nek/openmc_nek'
[]
[]
(test/tests/postprocessors/fission_tally_relative_error/multi.i)
[Mesh]
[sphere]
type = FileMeshGenerator
file = ../../neutronics/meshes/sphere.e
[]
[solid]
type = CombinerGenerator
inputs = sphere
positions = '0 0 0
0 0 4
0 0 8'
[]
[solid_ids]
type = SubdomainIDGenerator
input = solid
subdomain_id = '100'
[]
[]
[Problem]
type = OpenMCCellAverageProblem
power = 100.0
temperature_blocks = '100'
cell_level = 0
check_tally_sum = false
initial_properties = xml
[Tallies]
[Cell]
type = CellTally
blocks = '100'
score = 'heating kappa_fission'
# this outputs the fission tally standard deviation in space
output = 'unrelaxed_tally_std_dev'
[]
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Postprocessors]
[max_rel_err_ht]
type = TallyRelativeError
value_type = max
tally_score = 'heating'
[]
[min_rel_err_ht]
type = TallyRelativeError
value_type = min
tally_score = 'heating'
[]
[avg_rel_err_ht]
type = TallyRelativeError
value_type = average
tally_score = 'heating'
[]
[max_rel_err_kf]
type = TallyRelativeError
value_type = max
tally_score = 'kappa_fission'
[]
[min_rel_err_kf]
type = TallyRelativeError
value_type = min
tally_score = 'kappa_fission'
[]
[avg_rel_err_kf]
type = TallyRelativeError
value_type = average
tally_score = 'kappa_fission'
[]
[]
[Outputs]
csv = true
[]
(test/tests/neutronics/triggers/ignore_zeros/ignore_zero.i)
[Mesh]
[sphere]
type = FileMeshGenerator
file = ../../meshes/sphere.e
[]
[solid]
type = CombinerGenerator
inputs = sphere
positions = '0 0 0
0 0 4
0 0 8'
[]
[solid_ids]
type = SubdomainIDGenerator
input = solid
subdomain_id = '100'
[]
[fluid]
type = FileMeshGenerator
file = ../../heat_source/stoplight.exo
[]
[fluid_ids]
type = SubdomainIDGenerator
input = fluid
subdomain_id = '200'
[]
[combine]
type = CombinerGenerator
inputs = 'solid_ids fluid_ids'
[]
[]
[Problem]
type = OpenMCCellAverageProblem
source_strength = 1e6
verbose = true
temperature_blocks = '100 200'
density_blocks = '200'
cell_level = 0
initial_properties = xml
max_batches = 200
[Tallies]
[Cell]
type = CellTally
score = 'H3_production'
blocks = '100 200'
trigger = 'rel_err'
# If tally bins with zeros are ignored, this will fire immediately since
# the fluid region doesn't have a tritium production score.
trigger_threshold = '1.0'
trigger_ignore_zeros = 'true'
[]
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[max_err]
type = TallyRelativeError
tally_score = 'H3_production'
[]
[]
[Outputs]
execute_on = final
csv = true
[]
(test/tests/neutronics/triggers/multi_rel_err.i)
[Mesh]
[sphere]
type = FileMeshGenerator
file = ../meshes/sphere.e
[]
[solid]
type = CombinerGenerator
inputs = sphere
positions = '0 0 0
0 0 4
0 0 8'
[]
[solid_ids]
type = SubdomainIDGenerator
input = solid
subdomain_id = '100'
[]
[]
[Problem]
type = OpenMCCellAverageProblem
power = 100.0
batches = 20
cell_level = 0
normalize_by_global_tally = false
max_batches = 200
[Tallies]
[Cell]
type = CellTally
blocks = '100'
score = 'damage_energy kappa_fission'
trigger = 'rel_err rel_err'
trigger_threshold = '2e-2 2e-2'
[]
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Postprocessors]
[max_err_kf]
type = TallyRelativeError
tally_score = 'kappa_fission'
[]
[max_err_de]
type = TallyRelativeError
tally_score = 'damage_energy'
[]
[]
[Outputs]
csv = true
[]
(tutorials/msfr/openmc.i)
[Mesh]
[mesh]
type = FileMeshGenerator
file = msr.e
[]
[]
[ICs]
[temp]
type = ConstantIC
variable = temp
value = 948.0
[]
[density]
type = ConstantIC
variable = density
value = ${fparse -0.882*948+4983.6}
[]
[]
[AuxVariables]
[cell_temperature]
family = MONOMIAL
order = CONSTANT
[]
[cell_density]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[cell_temperature]
type = CellTemperatureAux
variable = cell_temperature
[]
[cell_density]
type = CellDensityAux
variable = cell_density
[]
[density]
type = ParsedAux
variable = density
expression = '-0.882*temp+4983.6'
coupled_variables = temp
execute_on = timestep_begin
[]
[]
[Problem]
type = OpenMCCellAverageProblem
verbose = true
# this will start each Picard iteration from the fission source from the previous one
reuse_source = true
scaling = 100.0
density_blocks = '1'
temperature_blocks = '1'
cell_level = 0
power = 300.0e6
relaxation = dufek_gudowski
first_iteration_particles = 5000
skinner = moab
[Tallies]
[heat_source]
type = MeshTally
mesh_template = msr.e
output = unrelaxed_tally_std_dev
[]
[]
[]
nb = 15.0
tmin = 800.0
tmax = 1150.0
[UserObjects]
[moab]
type = MoabSkinner
temperature = temp
n_temperature_bins = ${nb}
temperature_min = ${tmin}
temperature_max = ${tmax}
density = density
n_density_bins = ${nb}
density_min = ${fparse -0.882*tmax+4983.6}
density_max = ${fparse -0.882*tmin+4983.6}
build_graveyard = true
output_skins = true
[]
[]
[MultiApps]
[nek]
type = TransientMultiApp
input_files = 'nek.i'
sub_cycling = true
execute_on = timestep_end
[]
[]
[Transfers]
[temp_to_openmc]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = nek
variable = temp
source_variable = temp
[]
[power_to_nek]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = nek
source_variable = kappa_fission
variable = heat_source
[]
[power_integral_to_nek]
type = MultiAppPostprocessorTransfer
to_postprocessor = source_integral
from_postprocessor = power
to_multi_app = nek
[]
[synchronize_in]
type = MultiAppPostprocessorTransfer
to_postprocessor = transfer_in
from_postprocessor = synchronize
to_multi_app = nek
[]
[]
[Postprocessors]
[power]
type = ElementIntegralVariablePostprocessor
variable = kappa_fission
[]
[k]
type = KEigenvalue
[]
[k_std_dev]
type = KStandardDeviation
[]
[max_tally_err]
type = TallyRelativeError
[]
[max_T]
type = ElementExtremeValue
variable = temp
[]
[avg_T]
type = ElementAverageValue
variable = temp
[]
[max_q]
type = ElementExtremeValue
variable = kappa_fission
[]
[synchronize]
type = Receiver
default = 1.0
[]
[]
t_nek = ${fparse 2e-4 * 7.669}
[Executioner]
type = Transient
dt = ${fparse 2000 * t_nek}
[]
[Outputs]
exodus = true
csv = true
hide = 'synchronize'
[]
(tutorials/gas_compact/openmc.i)
height = 1.60 # height of the unit cell (m)
fluid_Cp = 5189.0 # fluid isobaric specific heat (J/kg/K)
inlet_T = 598.0 # inlet fluid temperature (K)
power = 30e3 # unit cell power (W)
mdot = 0.011 # fluid mass flowrate (kg/s)
[Mesh]
[solid]
type = FileMeshGenerator
file = mesh_in.e
[]
[]
[AuxVariables]
[cell_temperature]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[cell_temperature]
type = CellTemperatureAux
variable = cell_temperature
[]
[]
[ICs]
[temp]
type = FunctionIC
variable = temp
function = temp_ic
[]
[]
[Functions]
[temp_ic]
type = ParsedFunction
expression = '${inlet_T} + z / ${height} * ${power} / ${mdot} / ${fluid_Cp}'
[]
[]
[Problem]
type = OpenMCCellAverageProblem
power = ${power}
scaling = 100.0
temperature_blocks = 'graphite compacts compacts_trimmer_tri'
cell_level = 1
[Tallies]
[heat_source]
type = CellTally
name = heat_source
blocks = 'compacts compacts_trimmer_tri'
check_equal_mapped_tally_volumes = true
output = 'unrelaxed_tally_std_dev'
[]
[]
[]
[MultiApps]
[solid]
type = TransientMultiApp
input_files = 'solid.i'
execute_on = timestep_end
[]
[]
[Transfers]
[heat_source_to_solid]
type = MultiAppGeneralFieldShapeEvaluationTransfer
to_multi_app = solid
variable = power
source_variable = heat_source
from_postprocessors_to_be_preserved = heat_source
to_postprocessors_to_be_preserved = power
[]
[temperature_to_openmc]
type = MultiAppGeneralFieldShapeEvaluationTransfer
from_multi_app = solid
variable = temp
source_variable = T
[]
[]
[Postprocessors]
[heat_source]
type = ElementIntegralVariablePostprocessor
variable = heat_source
execute_on = 'transfer initial timestep_end'
[]
[max_tally_rel_err]
type = TallyRelativeError
value_type = max
[]
[max_power]
type = ElementExtremeValue
variable = heat_source
value_type = max
block = 'compacts compacts_trimmer_tri'
[]
[min_power]
type = ElementExtremeValue
variable = heat_source
value_type = min
block = 'compacts compacts_trimmer_tri'
[]
[]
[UserObjects]
[avg_power]
type = NearestPointLayeredAverage
variable = heat_source
points = '0.0 0.0 0.0'
num_layers = 30
direction = z
block = 'compacts compacts_trimmer_tri'
[]
[avg_std_dev]
type = NearestPointLayeredAverage
variable = heat_source_std_dev
points = '0.0 0.0 0.0'
num_layers = 30
direction = z
block = 'compacts compacts_trimmer_tri'
[]
[]
[VectorPostprocessors]
[avg_q]
type = SpatialUserObjectVectorPostprocessor
userobject = avg_power
[]
[stdev]
type = SpatialUserObjectVectorPostprocessor
userobject = avg_std_dev
[]
[]
[Executioner]
type = Transient
num_steps = 4
[]
[Outputs]
exodus = true
csv = true
[]
(test/tests/postprocessors/fission_tally_relative_error/ratio.i)
[Mesh]
[sphere]
type = FileMeshGenerator
file = ../../neutronics/meshes/sphere.e
[]
[solid]
type = CombinerGenerator
inputs = sphere
positions = '0 0 0
0 0 4
0 0 8'
[]
[]
[Problem]
type = OpenMCCellAverageProblem
power = 100.0
cell_level = 0
check_tally_sum = false
initial_properties = xml
[Tallies]
[Cell]
type = CellTally
blocks = '1'
score = 'heating kappa_fission'
output = 'unrelaxed_tally_std_dev'
[]
[]
[]
# the ratio of the std_dev variable and the output tally should give
# the relative error in the tallies.out
[AuxVariables]
[heating_rel_err]
family = MONOMIAL
order = CONSTANT
[]
[kappa_fission_rel_err]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[heating]
type = ParsedAux
variable = heating_rel_err
expression = 'heating_std_dev / heating'
coupled_variables = 'heating_std_dev heating'
[]
[kappa_fission]
type = ParsedAux
variable = kappa_fission_rel_err
expression = 'kappa_fission_std_dev / kappa_fission'
coupled_variables = 'kappa_fission_std_dev kappa_fission'
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Postprocessors]
[heating_max]
type = ElementExtremeValue
value_type = max
variable = heating_rel_err
[]
[heating_min]
type = ElementExtremeValue
value_type = min
variable = heating_rel_err
[]
[kf_max]
type = ElementExtremeValue
value_type = max
variable = kappa_fission_rel_err
[]
[kf_min]
type = ElementExtremeValue
value_type = min
variable = kappa_fission_rel_err
[]
[max_ht]
type = TallyRelativeError
value_type = max
tally_score = 'heating'
[]
[min_ht]
type = TallyRelativeError
value_type = min
tally_score = 'heating'
[]
[avg_ht]
type = TallyRelativeError
value_type = average
tally_score = 'heating'
[]
[max_kf]
type = TallyRelativeError
value_type = max
tally_score = 'kappa_fission'
[]
[min_kf]
type = TallyRelativeError
value_type = min
tally_score = 'kappa_fission'
[]
[avg_kf]
type = TallyRelativeError
value_type = average
tally_score = 'kappa_fission'
[]
[]
[Outputs]
csv = true
[]
(test/tests/openmc_errors/incorrect_problem/openmc.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
[]
[Variables]
[u]
[]
[]
[Kernels]
[dummy]
type = Diffusion
variable = u
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Postprocessors]
[max_tally_rel_err]
type = TallyRelativeError
value_type = max
[]
[]
[Outputs]
exodus = true
[]
(test/tests/neutronics/tallies/reaction_rates/openmc.i)
[Mesh]
[sphere]
type = FileMeshGenerator
file = ../../meshes/sphere.e
[]
[solid]
type = CombinerGenerator
inputs = sphere
positions = '0 0 0
0 0 4
0 0 8'
[]
[solid_ids]
type = SubdomainIDGenerator
input = solid
subdomain_id = '100'
[]
[fluid]
type = FileMeshGenerator
file = ../../heat_source/stoplight.exo
[]
[fluid_ids]
type = SubdomainIDGenerator
input = fluid
subdomain_id = '200'
[]
[combine]
type = CombinerGenerator
inputs = 'solid_ids fluid_ids'
[]
[]
[Problem]
type = OpenMCCellAverageProblem
verbose = true
source_strength = 1e6
temperature_blocks = '100 200'
density_blocks = '200'
cell_level = 0
initial_properties = xml
[Tallies]
[Cell]
type = CellTally
score = 'absorption fission scatter total'
blocks = '100 200'
[]
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[total_abs]
type = ElementIntegralVariablePostprocessor
variable = absorption
[]
[fluid_abs]
type = PointValue
variable = absorption
point = '0.0 0.0 2.0'
[]
[pebble1_abs]
type = PointValue
variable = absorption
point = '0.0 0.0 0.0'
[]
[pebble2_abs]
type = PointValue
variable = absorption
point = '0.0 0.0 4.0'
[]
[pebble3_abs]
type = PointValue
variable = absorption
point = '0.0 0.0 8.0'
[]
[max_err_abs]
type = TallyRelativeError
tally_score = 'absorption'
[]
[total_fis]
type = ElementIntegralVariablePostprocessor
variable = fission
[]
[fluid_fis]
type = PointValue
variable = fission
point = '0.0 0.0 2.0'
[]
[pebble1_fis]
type = PointValue
variable = fission
point = '0.0 0.0 0.0'
[]
[pebble2_fis]
type = PointValue
variable = fission
point = '0.0 0.0 4.0'
[]
[pebble3_fis]
type = PointValue
variable = fission
point = '0.0 0.0 8.0'
[]
[max_err_fis]
type = TallyRelativeError
tally_score = 'fission'
[]
[total_sca]
type = ElementIntegralVariablePostprocessor
variable = scatter
[]
[fluid_sca]
type = PointValue
variable = scatter
point = '0.0 0.0 2.0'
[]
[pebble1_sca]
type = PointValue
variable = scatter
point = '0.0 0.0 0.0'
[]
[pebble2_sca]
type = PointValue
variable = scatter
point = '0.0 0.0 4.0'
[]
[pebble3_sca]
type = PointValue
variable = scatter
point = '0.0 0.0 8.0'
[]
[max_err_sca]
type = TallyRelativeError
tally_score = 'scatter'
[]
[total_tot]
type = ElementIntegralVariablePostprocessor
variable = total
[]
[fluid_tot]
type = PointValue
variable = total
point = '0.0 0.0 2.0'
[]
[pebble1_tot]
type = PointValue
variable = total
point = '0.0 0.0 0.0'
[]
[pebble2_tot]
type = PointValue
variable = total
point = '0.0 0.0 4.0'
[]
[pebble3_tot]
type = PointValue
variable = total
point = '0.0 0.0 8.0'
[]
[max_err_tot]
type = TallyRelativeError
tally_score = 'total'
[]
[]
[Outputs]
execute_on = final
csv = true
[]
(tutorials/tokamak/openmc.i)
[Mesh]
[file]
type = FileMeshGenerator
file = tokamak.e
[]
[]
[AuxVariables]
[cell_temperature]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[cell_temperature]
type = CellTemperatureAux
variable = cell_temperature
[]
[]
[Problem]
type = OpenMCCellAverageProblem
scaling = 100.0
source_strength = 2e18
cell_level = 0
temperature_blocks = 'plasma_facing multiplier breeder divertor vacuum_vessel'
# this is a low number of particles; you will want to increase in order to obtain
# high-quality results
first_iteration_particles = 1000
relaxation = dufek_gudowski
skinner = moab
[Tallies]
[tokamak]
type = MeshTally
mesh_template = tokamak.e
score = 'heating_local H3_production'
output = unrelaxed_tally_std_dev
[]
[]
[]
[UserObjects]
[moab]
type = MoabSkinner
temperature_min = 0
temperature_max = 2000
n_temperature_bins = 40
temperature = temp
build_graveyard = true
output_skins = true
[]
[]
[Postprocessors]
[heating]
type = ElementIntegralVariablePostprocessor
variable = heating_local
[]
[tritium_production]
type = ElementIntegralVariablePostprocessor
variable = H3_production
[]
[tritium_error]
type = TallyRelativeError
tally_score = H3_production
value_type = average
[]
[heating_error]
type = TallyRelativeError
tally_score = heating_local
value_type = average
[]
[]
[Executioner]
type = Transient
[]
[Outputs]
exodus = true
csv = true
[]
(test/tests/neutronics/feedback/triso/openmc.i)
[Mesh]
[solid]
type = FileMeshGenerator
file = solid.e
[]
[]
[AuxVariables]
[cell_temperature]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[cell_temperature]
type = CellTemperatureAux
variable = cell_temperature
[]
[]
[ICs]
[temp]
type = FunctionIC
variable = temp
function = temp_ic
[]
[]
[Functions]
[temp_ic]
type = ParsedFunction
expression = '500.0'
[]
[]
[Problem]
type = OpenMCCellAverageProblem
verbose = true
identical_cell_fills = '2'
check_identical_cell_fills = true
power = 100.0
scaling = 100.0
temperature_blocks = '1 2'
cell_level = 1
[Tallies]
[Cell]
type = CellTally
blocks = '2'
check_equal_mapped_tally_volumes = true
[]
[]
[]
[Postprocessors]
[k]
type = KEigenvalue
[]
[max_tally_rel_err]
type = TallyRelativeError
value_type = max
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
exodus = true
# get a smaller gold file
hide = 'temp'
[]
(tutorials/lwr_solid/openmc.i)
[Mesh]
[file]
type = FileMeshGenerator
file = mesh_in.e
[]
[]
[AuxVariables]
[cell_temperature]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[cell_temperature]
type = CellTemperatureAux
variable = cell_temperature
[]
[]
[Problem]
type = OpenMCCellAverageProblem
verbose = true
power = ${fparse 3000e6 / 273 / (17 * 17)}
temperature_blocks = '1 2 3'
cell_level = 0
volume_calculation = vol
[Tallies]
[heat_source]
type = CellTally
blocks = '2 3'
name = heat_source
[]
[]
[]
[UserObjects]
[vol]
type = OpenMCVolumeCalculation
n_samples = 100000
[]
[]
[Executioner]
type = Transient
[]
[Outputs]
exodus = true
csv = true
[]
[Postprocessors]
[heat_source]
type = ElementIntegralVariablePostprocessor
variable = heat_source
[]
[max_tally_rel_err]
type = TallyRelativeError
[]
[max_heat_source]
type = ElementExtremeValue
variable = heat_source
[]
[]
(tutorials/gas_assembly/openmc.i)
num_layers_for_THM = 50 # number of elements in the THM model; for the converged
# case, we set this to 150
[Mesh]
# mesh mirror for the solid regions
[solid]
type = FileMeshGenerator
file = solid_mesh_in.e
[]
# create a mesh for a single coolant channel; because we will receive uniform
# temperatures and densities from THM on each x-y plane, we can use a very coarse
# mesh in the radial direction
[coolant_face]
type = AnnularMeshGenerator
nr = 1
nt = 8
rmin = 0.0
rmax = ${fparse channel_diameter / 2.0}
[]
[extrude]
type = AdvancedExtruderGenerator
input = coolant_face
num_layers = ${num_layers_for_THM}
direction = '0 0 1'
heights = '${height}'
top_boundary = '300' # inlet
bottom_boundary = '400' # outlet
[]
[rename]
type = RenameBlockGenerator
input = extrude
old_block = '1'
new_block = '101'
[]
# repeat the coolant channels and then combine together to get a combined mesh mirror
[repeat]
type = CombinerGenerator
inputs = rename
positions_file = coolant_channel_positions.txt
[]
[add]
type = CombinerGenerator
inputs = 'solid repeat'
[]
[]
[AuxVariables]
[material_id]
family = MONOMIAL
order = CONSTANT
[]
[cell_temperature]
family = MONOMIAL
order = CONSTANT
[]
[cell_density]
family = MONOMIAL
order = CONSTANT
[]
[thm_temp_wall]
block = '101'
[]
[flux]
[]
# just for postprocessing purposes
[thm_pressure]
block = '101'
[]
[thm_velocity]
block = '101'
[]
[z]
family = MONOMIAL
order = CONSTANT
block = 'compacts'
[]
[]
[AuxKernels]
[material_id]
type = CellMaterialIDAux
variable = material_id
[]
[cell_temperature]
type = CellTemperatureAux
variable = cell_temperature
[]
[cell_density]
type = CellDensityAux
variable = cell_density
[]
[density]
type = FluidDensityAux
variable = density
p = ${outlet_P}
T = thm_temp
fp = helium
execute_on = 'timestep_begin linear'
[]
[z]
type = ParsedAux
variable = z
use_xyzt = true
expression = 'z'
[]
[]
[ICs]
[fluid_temp_wall]
type = FunctionIC
variable = thm_temp_wall
function = temp_ic
[]
[fluid_temp]
type = FunctionIC
variable = thm_temp
function = temp_ic
[]
[heat_source]
type = ConstantIC
variable = heat_source
block = 'compacts'
value = ${fparse power / (n_bundles * n_fuel_compacts_per_block) / (pi * compact_diameter * compact_diameter / 4.0 * height)}
[]
[]
[Functions]
[temp_ic]
type = ParsedFunction
expression = '${inlet_T} + (${height} - z) / ${height} * ${power} / ${mdot} / ${fluid_Cp}'
[]
[]
[FluidProperties]
[helium]
type = IdealGasFluidProperties
molar_mass = 4e-3
gamma = 1.668282 # should correspond to Cp = 5189 J/kg/K
k = 0.2556
mu = 3.22639e-5
[]
[]
[Problem]
type = OpenMCCellAverageProblem
identical_cell_fills = '2'
power = ${fparse power / n_bundles}
scaling = 100.0
cell_level = 1
relaxation = constant
relaxation_factor = 0.5
# to get a faster-running tutorial, we use only 1000 particles per batch; converged
# results are instead obtained by increasing this parameter to 10000. We also use fewer
# batches to speed things up; the converged results were obtained with 500 inactive batches
# and 2000 active batches
particles = 1000
inactive_batches = 200
batches = 1000
# we will read temperature from THM (for the fluid) and MOOSE (for the solid)
# into variables we name as 'solid_temp' and 'thm_temp'. This syntax will automatically
# create those variabes for us
temperature_variables = 'solid_temp; thm_temp'
temperature_blocks = '1 2 4; 101'
density_blocks = '101'
[Tallies]
[heat_source]
type = CellTally
blocks = '2'
name = heat_source
check_equal_mapped_tally_volumes = true
output = 'unrelaxed_tally_std_dev'
[]
[]
[]
[MultiApps]
[bison]
type = TransientMultiApp
input_files = 'solid.i'
execute_on = timestep_begin
[]
[thm]
type = FullSolveMultiApp
input_files = 'thm.i'
execute_on = timestep_end
max_procs_per_app = 1
bounding_box_padding = '0.1 0.1 0'
positions_file = coolant_channel_positions.txt
output_in_position = true
[]
[]
[Transfers]
[solid_temp_to_openmc]
type = MultiAppGeometricInterpolationTransfer
source_variable = T
variable = solid_temp
from_multi_app = bison
[]
[heat_flux_to_openmc]
type = MultiAppGeneralFieldNearestLocationTransfer
source_variable = flux
variable = flux
from_multi_app = bison
from_boundaries = 'fluid_solid_interface'
to_boundaries = 'fluid_solid_interface'
from_postprocessors_to_be_preserved = flux_integral
to_postprocessors_to_be_preserved = flux_integral
[]
[source_to_bison]
type = MultiAppGeneralFieldShapeEvaluationTransfer
source_variable = heat_source
variable = power
to_multi_app = bison
from_postprocessors_to_be_preserved = heat_source
to_postprocessors_to_be_preserved = power
[]
[thm_temp_to_bison]
type = MultiAppGeometricInterpolationTransfer
source_variable = thm_temp_wall
variable = thm_temp
to_multi_app = bison
[]
[q_wall_to_thm]
type = MultiAppGeneralFieldUserObjectTransfer
variable = q_wall
to_multi_app = thm
source_user_object = q_wall_avg
[]
[T_wall_from_thm]
type = MultiAppGeneralFieldNearestLocationTransfer
source_variable = T_wall
from_multi_app = thm
variable = thm_temp_wall
to_boundaries = 'fluid_solid_interface'
[]
[T_bulk_from_thm]
type = MultiAppGeneralFieldNearestLocationTransfer
source_variable = T
from_multi_app = thm
variable = thm_temp
[]
# just for postprocessing purposes
[pressure_from_thm]
type = MultiAppGeneralFieldNearestLocationTransfer
source_variable = p
from_multi_app = thm
variable = thm_pressure
[]
[velocity_from_thm]
type = MultiAppGeneralFieldNearestLocationTransfer
source_variable = vel_z
from_multi_app = thm
variable = thm_velocity
[]
[]
[UserObjects]
[q_wall_avg]
type = NearestPointLayeredSideAverage
boundary = 'fluid_solid_interface'
variable = flux
# Note: make this to match the num_elems in the channel
direction = z
num_layers = ${num_layers_for_THM}
points_file = coolant_channel_positions.txt
direction_min = 0.0
direction_max = ${height}
[]
[average_power_axial]
type = LayeredAverage
variable = heat_source
direction = z
num_layers = ${num_layers_for_plots}
block = 'compacts'
[]
[average_fluid_axial]
type = LayeredAverage
variable = thm_temp
direction = z
num_layers = ${num_layers_for_plots}
block = '101'
[]
[average_pressure]
type = LayeredAverage
variable = thm_pressure
direction = z
num_layers = ${num_layers_for_plots}
block = '101'
[]
[average_axial_velocity]
type = LayeredAverage
variable = thm_velocity
direction = z
num_layers = ${num_layers_for_plots}
block = '101'
[]
[]
[VectorPostprocessors]
[power_avg]
type = SpatialUserObjectVectorPostprocessor
userobject = average_power_axial
[]
[fluid_avg]
type = SpatialUserObjectVectorPostprocessor
userobject = average_fluid_axial
[]
[pressure_avg]
type = SpatialUserObjectVectorPostprocessor
userobject = average_pressure
[]
[velocity_avg]
type = SpatialUserObjectVectorPostprocessor
userobject = average_axial_velocity
[]
[]
[Postprocessors]
[flux_integral]
type = SideIntegralVariablePostprocessor
variable = flux
boundary = 'fluid_solid_interface'
execute_on = 'transfer linear'
[]
[heat_source]
type = ElementIntegralVariablePostprocessor
variable = heat_source
execute_on = 'transfer initial timestep_end'
[]
[max_tally_rel_err]
type = TallyRelativeError
value_type = max
[]
[k]
type = KEigenvalue
[]
[k_std_dev]
type = KStandardDeviation
[]
[min_power]
type = ElementExtremeValue
variable = heat_source
value_type = min
block = 'compacts'
[]
[max_power]
type = ElementExtremeValue
variable = heat_source
value_type = max
block = 'compacts'
[]
[z_max_power]
type = ElementExtremeValue
proxy_variable = heat_source
variable = z
block = 'compacts'
[]
[max_Tf]
type = ElementExtremeValue
variable = thm_temp
block = '101'
[]
[P_in]
type = SideAverageValue
variable = thm_pressure
boundary = '300'
[]
[pressure_drop]
type = LinearCombinationPostprocessor
pp_names = 'P_in'
pp_coefs = '1.0'
b = '${fparse -outlet_P}'
[]
[]
[Executioner]
type = Transient
num_steps = 10
[]
[Outputs]
exodus = true
csv = true
hide = 'P_in flux_integral z'
[]
(test/tests/neutronics/tallies/tritium/openmc.i)
[Mesh]
[sphere]
type = FileMeshGenerator
file = ../../meshes/sphere.e
[]
[solid]
type = CombinerGenerator
inputs = sphere
positions = '0 0 0
0 0 4
0 0 8'
[]
[solid_ids]
type = SubdomainIDGenerator
input = solid
subdomain_id = '100'
[]
[fluid]
type = FileMeshGenerator
file = ../../heat_source/stoplight.exo
[]
[fluid_ids]
type = SubdomainIDGenerator
input = fluid
subdomain_id = '200'
[]
[combine]
type = CombinerGenerator
inputs = 'solid_ids fluid_ids'
[]
[]
[Problem]
type = OpenMCCellAverageProblem
source_strength = 1e6
verbose = true
temperature_blocks = '100 200'
density_blocks = '200'
cell_level = 0
initial_properties = xml
[Tallies]
[Cell]
type = CellTally
score = 'H3_production'
blocks = '100 200'
[]
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[total_H3]
type = ElementIntegralVariablePostprocessor
variable = H3_production
[]
[fluid_H3]
type = PointValue
variable = H3_production
point = '0.0 0.0 2.0'
[]
[pebble1_H3]
type = PointValue
variable = H3_production
point = '0.0 0.0 0.0'
[]
[pebble2_H3]
type = PointValue
variable = H3_production
point = '0.0 0.0 4.0'
[]
[pebble3_H3]
type = PointValue
variable = H3_production
point = '0.0 0.0 8.0'
[]
[vol_fluid]
type = VolumePostprocessor
block = '200'
[]
[vol_solid]
type = VolumePostprocessor
block = '100'
[]
[max_err]
type = TallyRelativeError
tally_score = 'H3_production'
[]
[]
[Outputs]
execute_on = final
csv = true
exodus = true
[]
(tutorials/pincell_multiphysics/openmc.i)
inlet_T = 573.0 # inlet temperature
power = 1e3 # total power (W)
Re = 500.0 # Reynolds number
outlet_P = 1e6
height = 0.5 # total height of the domain
Df = 0.825e-2 # fuel diameter
pin_diameter = 0.97e-2 # pin outer diameter
pin_pitch = 1.28e-2 # pin pitch
mu = 8.8e-5 # fluid dynamic viscosity
rho = 723.6 # fluid density
Cp = 5512.0 # fluid isobaric specific heat capacity
Rf = ${fparse Df / 2.0}
flow_area = ${fparse pin_pitch * pin_pitch - pi * pin_diameter * pin_diameter / 4.0}
wetted_perimeter = ${fparse pi * pin_diameter}
hydraulic_diameter = ${fparse 4.0 * flow_area / wetted_perimeter}
U_ref = ${fparse Re * mu / rho / hydraulic_diameter}
mdot = ${fparse rho * U_ref * flow_area}
dT = ${fparse power / mdot / Cp}
[Mesh]
[solid]
type = FileMeshGenerator
file = solid_in.e
[]
[]
[AuxVariables]
# These auxiliary variables are all just for visualizing the solution and
# the mapping - none of these are part of the calculation sequence
[material_id]
family = MONOMIAL
order = CONSTANT
[]
[cell_temperature]
family = MONOMIAL
order = CONSTANT
[]
[cell_density]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[material_id]
type = CellMaterialIDAux
variable = material_id
[]
[cell_temperature]
type = CellTemperatureAux
variable = cell_temperature
[]
[cell_density]
type = CellDensityAux
variable = cell_density
[]
[density]
type = FluidDensityAux
variable = density
p = ${outlet_P}
T = nek_temp
fp = sodium
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[FluidProperties]
[sodium]
type = SodiumSaturationFluidProperties
[]
[]
[ICs]
[nek_temp]
type = FunctionIC
variable = nek_temp
function = temp_ic
[]
[solid_temp]
type = FunctionIC
variable = solid_temp
function = temp_ic
[]
[heat_source]
type = ConstantIC
variable = heat_source
block = '2'
value = ${fparse power / (pi * Rf * Rf * height)}
[]
[]
[Functions]
[temp_ic]
type = ParsedFunction
expression = '${inlet_T} + z / ${height} * ${dT}'
[]
[]
[Problem]
type = OpenMCCellAverageProblem
power = ${power}
scaling = 100.0
density_blocks = '1'
cell_level = 0
# This automatically creates these variables and will read from the non-default choice of 'temp'
temperature_variables = 'solid_temp; nek_temp'
temperature_blocks = '2 3; 1'
relaxation = robbins_monro
# Set some parameters for when we terminate the OpenMC solve in each iteration;
# this will run a minimum of 30 batches, and after that, terminate once reaching
# the specified std. dev. of k and rel. err. of the fission tally
inactive_batches = 20
batches = 30
k_trigger = std_dev
k_trigger_threshold = 7.5e-4
batch_interval = 50
max_batches = 1000
[Tallies]
[heat_source]
type = CellTally
blocks = '2'
name = heat_source
check_equal_mapped_tally_volumes = true
trigger = rel_err
trigger_threshold = 2e-2
output = unrelaxed_tally_std_dev
[]
[]
[]
[MultiApps]
[bison]
type = TransientMultiApp
input_files = 'bison.i'
execute_on = timestep_begin
sub_cycling = true
[]
[]
[Transfers]
[solid_temp_to_openmc]
type = MultiAppGeneralFieldShapeEvaluationTransfer
source_variable = T
variable = solid_temp
from_multi_app = bison
[]
[source_to_bison]
type = MultiAppCopyTransfer
source_variable = heat_source
variable = power
to_multi_app = bison
[]
[temp_from_nek]
type = MultiAppGeneralFieldShapeEvaluationTransfer
source_variable = nek_temp
from_multi_app = bison
variable = nek_temp
[]
[]
[Outputs]
exodus = true
csv = true
[]
[Executioner]
type = Transient
dt = 0.5
num_steps = 10
[]
[Postprocessors]
[max_tally_rel_err]
type = TallyRelativeError
value_type = max
[]
[k]
type = KEigenvalue
[]
[k_std_dev]
type = KStandardDeviation
[]
[]
(test/tests/neutronics/triggers/mesh_tally_rel_err.i)
[Mesh]
[sphere]
type = FileMeshGenerator
file = ../meshes/sphere.e
[]
[solid]
type = CombinerGenerator
inputs = sphere
positions = '0 0 0
0 0 4
0 0 8'
[]
[solid_ids]
type = SubdomainIDGenerator
input = solid
subdomain_id = '100'
[]
allow_renumbering = false
[]
[Problem]
type = OpenMCCellAverageProblem
verbose = true
power = 100.0
normalize_by_global_tally = false
particles = 1000
max_batches = 200
[Tallies]
[Mesh]
type = MeshTally
mesh_template = '../meshes/sphere.e'
mesh_translations = '0 0 0
0 0 4
0 0 8'
trigger = rel_err
trigger_threshold = 5e-1
[]
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Postprocessors]
[max_tally_err]
type = TallyRelativeError
[]
[]
[Outputs]
csv = true
[]
(test/tests/postprocessors/fission_tally_relative_error/openmc.i)
[Mesh]
[sphere]
type = FileMeshGenerator
file = ../../neutronics/meshes/sphere.e
[]
[solid]
type = CombinerGenerator
inputs = sphere
positions = '0 0 0
0 0 4
0 0 8'
[]
[solid_ids]
type = SubdomainIDGenerator
input = solid
subdomain_id = '100'
[]
[]
[Problem]
type = OpenMCCellAverageProblem
power = 100.0
temperature_blocks = '100'
cell_level = 0
check_tally_sum = false
initial_properties = xml
[Tallies]
[Cell]
type = CellTally
blocks = '100'
# this outputs the fission tally standard deviation in space
output = 'unrelaxed_tally_std_dev'
[]
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Postprocessors]
[max_rel_err]
type = TallyRelativeError
value_type = max
[]
[min_rel_err]
type = TallyRelativeError
value_type = min
[]
[avg_rel_err]
type = TallyRelativeError
value_type = average
[]
[power_1]
type = PointValue
variable = kappa_fission
point = '0 0 0'
[]
[power_2]
type = PointValue
variable = kappa_fission
point = '0 0 4'
[]
[power_3]
type = PointValue
variable = kappa_fission
point = '0 0 8'
[]
[std_dev_1]
type = PointValue
variable = kappa_fission_std_dev
point = '0 0 0'
[]
[std_dev_2]
type = PointValue
variable = kappa_fission_std_dev
point = '0 0 4'
[]
[std_dev_3]
type = PointValue
variable = kappa_fission_std_dev
point = '0 0 8'
[]
[]
[Outputs]
csv = true
[]
(tutorials/pebbles/openmc_um.i)
[Mesh]
[pebble]
type = FileMeshGenerator
file = mesh_in.e
[]
[repeat]
type = CombinerGenerator
inputs = pebble
positions = '0 0 0.02
0 0 0.06
0 0 0.10'
[]
allow_renumbering = false
[]
[AuxVariables]
[cell_temperature]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[cell_temperature]
type = CellTemperatureAux
variable = cell_temperature
[]
[]
[Problem]
type = OpenMCCellAverageProblem
verbose = true
power = 1500.0
temperature_blocks = '0'
normalize_by_global_tally = false
cell_level = 1
scaling = 100.0
[Tallies]
[heat_source]
type = MeshTally
mesh_translations = '0 0 0.02
0 0 0.06
0 0 0.10'
mesh_template = mesh_in.e
name = heat_source
[]
[]
[]
[Executioner]
type = Transient
[]
[Outputs]
exodus = true
csv = true
[]
[Postprocessors]
[heat_source]
type = ElementIntegralVariablePostprocessor
variable = heat_source
[]
[max_tally_rel_err]
type = TallyRelativeError
[]
[k]
type = KEigenvalue
[]
[]
(tutorials/gas_compact_multiphysics/openmc_thm.i)
# This input file runs coupled OpenMC Monte Carlo transport, MOOSE heat
# conduction, and THM fluid flow and heat transfer.
# This input should be run with:
#
# cardinal-opt -i common_input.i openmc_thm.i
num_layers_for_THM = 150
num_layers = 50
density_blocks = 'coolant'
temperature_blocks = 'graphite compacts compacts_trimmer_tri'
fuel_blocks = 'compacts compacts_trimmer_tri'
unit_cell_power = ${fparse power / (n_bundles * n_coolant_channels_per_block) * unit_cell_height / height}
[Mesh]
[solid]
type = FileMeshGenerator
file = solid_mesh_in.e
[]
[]
[AuxVariables]
[cell_temperature]
family = MONOMIAL
order = CONSTANT
[]
[cell_density]
family = MONOMIAL
order = CONSTANT
[]
[thm_temp_wall]
family = MONOMIAL
order = CONSTANT
block = ${density_blocks}
[]
[flux]
[]
[]
[AuxKernels]
[cell_temperature]
type = CellTemperatureAux
variable = cell_temperature
[]
[cell_density]
type = CellDensityAux
variable = cell_density
[]
[density]
type = FluidDensityAux
variable = density
p = ${outlet_P}
T = thm_temp
fp = helium
execute_on = 'timestep_begin linear'
[]
[]
[FluidProperties]
[helium]
type = IdealGasFluidProperties
molar_mass = 4e-3
gamma = 1.668282 # should correspond to Cp = 5189 J/kg/K
k = 0.2556
mu = 3.22639e-5
[]
[]
[ICs]
[fluid_temp_wall]
type = FunctionIC
variable = thm_temp_wall
function = temp_ic
[]
[fluid_temp]
type = FunctionIC
variable = thm_temp
function = temp_ic
[]
[heat_source]
type = ConstantIC
variable = heat_source
block = ${fuel_blocks}
value = ${fparse unit_cell_power / (2.0 * pi * compact_diameter * compact_diameter / 4.0 * unit_cell_height)}
[]
[]
[Functions]
[temp_ic]
type = ParsedFunction
expression = '${inlet_T} + z / ${unit_cell_height} * ${unit_cell_power} / (${mdot} / ${n_bundles} / ${n_coolant_channels_per_block}) / ${fluid_Cp}'
[]
[]
[Problem]
type = OpenMCCellAverageProblem
power = ${unit_cell_power}
scaling = 100.0
density_blocks = ${density_blocks}
cell_level = 1
relaxation = robbins_monro
temperature_variables = 'solid_temp; thm_temp'
temperature_blocks = '${temperature_blocks}; ${density_blocks}'
k_trigger = std_dev
k_trigger_threshold = 7.5e-4
batches = 40
max_batches = 100
batch_interval = 5
[Tallies]
[heat_source]
type = CellTally
blocks = ${fuel_blocks}
name = heat_source
check_equal_mapped_tally_volumes = true
trigger = rel_err
trigger_threshold = 1e-2
output = 'unrelaxed_tally_std_dev'
[]
[]
[]
[Executioner]
type = Transient
# We use a fairly loose tolerance here for a tutorial; you may consider increasing this
# for production runs
steady_state_detection = true
check_aux = true
steady_state_tolerance = 5e-3
[]
[MultiApps]
[bison]
type = TransientMultiApp
input_files = 'solid_thm.i'
execute_on = timestep_begin
[]
[thm]
type = FullSolveMultiApp
input_files = 'thm.i'
execute_on = timestep_end
max_procs_per_app = 1
bounding_box_padding = '0.1 0.1 0'
[]
[]
[Transfers]
[solid_temp_to_openmc]
type = MultiAppGeometricInterpolationTransfer
source_variable = T
variable = solid_temp
from_multi_app = bison
[]
[heat_flux_to_openmc]
type = MultiAppGeneralFieldNearestLocationTransfer
source_variable = flux
variable = flux
from_multi_app = bison
from_boundaries = 'fluid_solid_interface'
to_boundaries = 'fluid_solid_interface'
from_postprocessors_to_be_preserved = flux_integral
to_postprocessors_to_be_preserved = flux_integral
[]
[source_to_bison]
type = MultiAppGeneralFieldShapeEvaluationTransfer
source_variable = heat_source
variable = power
to_multi_app = bison
from_postprocessors_to_be_preserved = heat_source
to_postprocessors_to_be_preserved = power
[]
[thm_temp_to_bison]
type = MultiAppGeometricInterpolationTransfer
source_variable = thm_temp_wall
variable = fluid_temp
to_multi_app = bison
[]
[q_wall_to_thm]
type = MultiAppGeneralFieldUserObjectTransfer
variable = q_wall
to_multi_app = thm
source_user_object = q_wall_avg
[]
[T_wall_from_thm]
type = MultiAppGeneralFieldNearestLocationTransfer
source_variable = T_wall
from_multi_app = thm
variable = thm_temp_wall
[]
[T_bulk_from_thm]
type = MultiAppGeneralFieldNearestLocationTransfer
source_variable = T
from_multi_app = thm
variable = thm_temp
[]
[]
[Postprocessors]
[flux_integral]
type = SideIntegralVariablePostprocessor
variable = flux
boundary = 'fluid_solid_interface'
execute_on = 'transfer'
[]
[heat_source]
type = ElementIntegralVariablePostprocessor
variable = heat_source
execute_on = 'transfer initial timestep_end'
[]
[max_tally_err]
type = TallyRelativeError
value_type = max
[]
[k]
type = KEigenvalue
[]
[k_std_dev]
type = KStandardDeviation
[]
[min_power]
type = ElementExtremeValue
variable = heat_source
value_type = min
block = ${fuel_blocks}
[]
[max_power]
type = ElementExtremeValue
variable = heat_source
value_type = max
block = ${fuel_blocks}
[]
[]
[AuxVariables]
[q_wall]
[]
[]
[AuxKernels]
[q_wall]
type = SpatialUserObjectAux
variable = q_wall
user_object = q_wall_avg
[]
[]
[UserObjects]
[q_wall_avg]
type = LayeredSideAverage
boundary = fluid_solid_interface
variable = flux
# Note: make this to match the num_elems in the channel
direction = z
num_layers = ${num_layers_for_THM}
direction_min = 0.0
direction_max = ${unit_cell_height}
[]
[average_power_axial]
type = LayeredAverage
variable = heat_source
direction = z
num_layers = ${num_layers}
block = ${fuel_blocks}
[]
[]
[VectorPostprocessors]
[power_avg]
type = SpatialUserObjectVectorPostprocessor
userobject = average_power_axial
[]
[]
[Outputs]
exodus = true
[csv]
type = CSV
file_base = 'csv_thm/openmc_thm'
[]
[]
(tutorials/pebbles/openmc.i)
[Mesh]
[pebble]
type = SphereMeshGenerator
nr = 2
radius = 0.015
[]
[repeat]
type = CombinerGenerator
inputs = pebble
positions = '0 0 0.02
0 0 0.06
0 0 0.10'
[]
[]
[AuxVariables]
[cell_temperature]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[cell_temperature]
type = CellTemperatureAux
variable = cell_temperature
[]
[]
[Problem]
type = OpenMCCellAverageProblem
verbose = true
power = 1500.0
temperature_blocks = '0'
cell_level = 1
scaling = 100.0
[Tallies]
[heat_source]
type = CellTally
blocks = '0'
name = heat_source
[]
[]
[]
[Executioner]
type = Transient
[]
[Outputs]
exodus = true
csv = true
[]
[Postprocessors]
[heat_source]
type = ElementIntegralVariablePostprocessor
variable = heat_source
[]
[max_tally_rel_err]
type = TallyRelativeError
[]
[k]
type = KEigenvalue
[]
[]