- value0The value
Default:0
C++ Type:Real
Unit:(no unit assumed)
Controllable:Yes
Description:The value
ConstantPostprocessor
Postprocessor that holds a constant value
Overview
The ConstantPostprocessor is used to hold a constant value. This postprocessor may be useful as a general controllable postprocessor for the Controls system.
Example Input File Syntax
In this example, the value of the ConstantPostprocessor recv is controlled by a RealFunctionControl.
[Controls<<<{"href": "../../syntax/Controls/index.html"}>>>]
[func_control]
type = RealFunctionControl<<<{"description": "Sets the value of a 'Real' input parameters to the value of a provided function.", "href": "../controls/RealFunctionControl.html"}>>>
parameter<<<{"description": "The input parameter(s) to control. Specify a single parameter name and all parameters in all objects matching the name will be updated"}>>> = 'Postprocessors/recv/value'
function<<<{"description": "The function to use for controlling the specified parameter."}>>> = 'val'
execute_on<<<{"description": "The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html."}>>> = 'timestep_begin'
[]
[]
[Functions<<<{"href": "../../syntax/Functions/index.html"}>>>]
[val]
type = ParsedFunction<<<{"description": "Function created by parsing a string", "href": "../functions/MooseParsedFunction.html"}>>>
expression<<<{"description": "The user defined function."}>>> = '1 + 2*t'
[]
[]
[Postprocessors<<<{"href": "../../syntax/Postprocessors/index.html"}>>>]
[recv]
type = ConstantPostprocessor<<<{"description": "Postprocessor that holds a constant value", "href": "ConstantPostprocessor.html"}>>>
[]
[](test/tests/postprocessors/constant/receiver.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).
- execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
Default:TIMESTEP_END
C++ Type:ExecFlagEnum
Options:XFEM_MARK, FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, LINEAR_CONVERGENCE, NONLINEAR, NONLINEAR_CONVERGENCE, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, MULTIAPP_FIXED_POINT_CONVERGENCE, MULTISYSTEM_FIXED_POINT_ITERATION_END, FINAL, CUSTOM, TRANSFER
Controllable:No
Description:The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
- 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
Execution Scheduling Parameters
- 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.
- 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
- 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
Unit:(no unit assumed)
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.
- 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.
Material Property Retrieval Parameters
Input Files
- (test/tests/transfers/multiapp_reporter_transfer/dist_vector/sub_dist.i)
- (modules/reactor/test/tests/materials/2d_z_rotation.i)
- (modules/stochastic_tools/test/tests/auxkernels/surrogate_aux/model.i)
- (test/tests/convergence/default_multiapp_fixed_point_convergence/pp.i)
- (python/TestHarness/tests/resultsstore/content/testharness_results/validation/validation.i)
- (modules/xfem/test/tests/mesh_cut_2D_fracture/inclined_center_crack.i)
- (modules/combined/test/tests/czm_pressure_sidesets/czm_pressure_sideset_cavity.i)
- (test/tests/reporters/parsed_reporters/vectorMath.i)
- (test/tests/convergence/parsed_convergence/base.i)
- (test/tests/outputs/csv/csv_scientific_notation.i)
- (modules/thermal_hydraulics/test/tests/components/volume_junction_coupled_flux_1phase/child.i)
- (modules/optimization/test/tests/reporters/multiExperiment/forward.i)
- (test/tests/restart/receiver/receiver_initial.i)
- (modules/stochastic_tools/examples/optimization/annulus_shape/annulus_displaced_mesh.i)
- (modules/subchannel/validation/EBR-II/XX09_SCM_TR45R.i)
- (modules/stochastic_tools/test/tests/web_server_control/vpp_general.i)
- (test/tests/scalar_kernels/ad_scalar_kernel/ad_functor_scalar_test_kernel.i)
- (modules/porous_flow/test/tests/physics/coupled_injection_production_physics/sub.i)
- (modules/subchannel/validation/EBR-II/XX09_SCM_TR17.i)
- (modules/stochastic_tools/test/tests/multiapps/batch_commandline_control/sub_input_variable.i)
- (test/tests/parser/param_duplicate_check/input_b.i)
- (modules/thermal_hydraulics/test/tests/actioncomponents/injection_production_wells/sub.i)
- (test/tests/chaincontrols/set_value_chain_control/set_real_value_chain_control.i)
- (test/tests/functors/get_functor/get_functor.i)
- (test/tests/materials/torchscript_material/test.i)
- (test/tests/postprocessors/parsed_postprocessor/parsed_pp_control.i)
- (test/tests/postprocessors/constant/receiver.i)
(test/tests/postprocessors/constant/receiver.i)
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 1
[]
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Transient
num_steps = 3
dt = 1
[]
[Controls]
[func_control]
type = RealFunctionControl
parameter = 'Postprocessors/recv/value'
function = 'val'
execute_on = 'timestep_begin'
[]
[]
[Functions]
[val]
type = ParsedFunction
expression = '1 + 2*t'
[]
[]
[Postprocessors]
[recv]
type = ConstantPostprocessor
[]
[]
[Outputs]
csv = true
[]
(test/tests/transfers/multiapp_reporter_transfer/dist_vector/sub_dist.i)
[Mesh/generate]
type = GeneratedMeshGenerator
dim = 1
[]
[Problem]
kernel_coverage_check = false
solve = false
[]
[Reporters]
[sub_rep]
type = TestDeclareReporter
distributed_vector_name = dis_vec
[]
[]
[Postprocessors]
[sub]
type = ConstantPostprocessor
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
[out]
type = JSON
execute_system_information_on = NONE
execute_on = TIMESTEP_END
[]
[]
(modules/reactor/test/tests/materials/2d_z_rotation.i)
[Mesh]
[2d_circle]
type = ConcentricCircleMeshGenerator
num_sectors = 8
radii = '2 3 5'
rings = '2 1 2'
has_outer_square = false
preserve_volumes = true
[]
[2d_circle2]
type = ConcentricCircleMeshGenerator
num_sectors = 6
radii = '2 3 5'
rings = '2 1 2'
has_outer_square = false
preserve_volumes = true
[]
[combine]
type = CombinerGenerator
inputs = '2d_circle 2d_circle2'
positions = '0 0 0 11 0 0'
[]
[]
[Problem]
kernel_coverage_check = false
material_coverage_check = false
solve = false
[]
[AuxVariables]
[prop]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[set_prop]
type = MaterialRealAux
block = '2 3'
variable = prop
property = k
execute_on = timestep_end
[]
[]
[Functions]
[func]
type = ParsedFunction
expression = 11.25
[]
[]
[Postprocessors]
[pp]
type = ConstantPostprocessor
value = 30
[]
[]
[Materials]
[segment_properties]
type = GenericConstantMaterial
block = '2 3'
prop_names = 'seg1 seg2 seg3 seg4'
prop_values = '100 200 300 400'
[]
[rotate_mat]
type = ControlDrumMaterial
block = '2 3'
drum_material_properties = k
rotation_centers = '0 0 0 11 0 0'
rotation_angle_functors = 'func pp'
segment_angles = '45 90 180 45'
segment_material_properties = 'seg1 seg2 seg3 seg4'
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[]
(modules/stochastic_tools/test/tests/auxkernels/surrogate_aux/model.i)
[StochasticTools]
[]
[Postprocessors]
[x1]
type = ConstantPostprocessor
value = 0
[]
[x2]
type = ConstantPostprocessor
value = 0
[]
[x3]
type = ConstantPostprocessor
value = 0
[]
[x4]
type = ConstantPostprocessor
value = 0
[]
[val]
type = ParsedPostprocessor
expression = '1 + x1 + x2 + x3 + x4 +
x1*x1 + x1*x2 + x1*x3 + x1*x4 +
x2*x2 + x2*x3 + x2*x4 +
x3*x3 + x3*x4 +
x4*x4'
pp_names = 'x1 x2 x3 x4'
[]
[]
[Controls/receiver]
type = SamplerReceiver
[]
[Outputs]
console = false
[]
(test/tests/convergence/default_multiapp_fixed_point_convergence/pp.i)
!include ../parent.i
[Convergence]
[fp_conv]
type = DefaultMultiAppFixedPointConvergence
fixed_point_max_its = 15
custom_pp = small_value
direct_pp_value = true
custom_abs_tol = 1e-8
[]
[]
[Postprocessors]
[small_value]
type = ConstantPostprocessor
value = 1e-10
execute_on = 'INITIAL'
[]
[]
[Outputs]
file_base = pp
[]
(python/TestHarness/tests/resultsstore/content/testharness_results/validation/validation.i)
[Mesh/gmg]
type = GeneratedMeshGenerator
dim = 1
[]
[Postprocessors/value]
type = ConstantPostprocessor
value = 2
execute_on = INITIAL
[]
[Problem]
solve = False
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(modules/xfem/test/tests/mesh_cut_2D_fracture/inclined_center_crack.i)
# Center inclined crack. To run convergence study, run angles for theta=0-90 and refinement mesh_h=201,401,801
#
# @article{moes1999finite,
# title={A finite element method for crack growth without remeshing},
# author={Mo{\"e}s, Nicolas and Dolbow, John and Belytschko, Ted},
# journal={International journal for numerical methods in engineering},
# volume={46},
# number={1},
# pages={131--150},
# year={1999},
# publisher={Wiley Online Library}
# }
# @article{richardson2011xfem,
# title={An XFEM method for modeling geometrically elaborate crack propagation in brittle materials},
# author={Richardson, Casey L and Hegemann, Jan and Sifakis, Eftychios and Hellrung, Jeffrey and Teran, Joseph M},
# journal={International Journal for Numerical Methods in Engineering},
# volume={88},
# number={10},
# pages={1042--1065},
# year={2011},
# publisher={Wiley Online Library}
# }
H = 40
W = 40
a = 1
theta = 20 #measured from x-axis
poissons = 0.3
youngs = 30e6
stress_load = 10000
mesh_h=201
[GlobalParams]
displacements = 'disp_x disp_y'
volumetric_locking_correction = true
[]
[Mesh]
[cutter_mesh]
type = PolyLineMeshGenerator
points = '-${fparse a*cos(theta*pi/180)} -${fparse a*sin(theta*pi/180)} 0
${fparse a*cos(theta*pi/180)} ${fparse a*sin(theta*pi/180)} 0'
loop = false
num_edges_between_points = 2
save_with_name = cut_mesh
[]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = ${mesh_h}
ny = ${mesh_h}
xmin = -${fparse W/2}
xmax = ${fparse W/2}
ymin = -${fparse H/2}
ymax = ${fparse H/2}
elem_type = QUAD4
[]
[center_block]
type = SubdomainBoundingBoxGenerator
input = gen
block_id = 10
bottom_left = '-${fparse 1.5*a} -${fparse 1.5*a} 0'
top_right = '${fparse 1.5*a} ${fparse 1.5*a} 0'
[]
[center_left_node]
type = ExtraNodesetGenerator
coord = '-${fparse W/2} 0 0'
input = gen
new_boundary = 'center_left_node'
use_closest_node = true
[]
[center_right_node]
type = ExtraNodesetGenerator
coord = '${fparse W/2} 0 0'
input = center_left_node
new_boundary = 'center_right_node'
use_closest_node = true
[]
final_generator = 'center_right_node'
[]
#### - adaptivity causes segfault, see #31714
# [AuxVariables]
# [constant_refine]
# initial_condition = 2
# order = CONSTANT
# family = MONOMIAL
# block = 10
# []
# []
# [Adaptivity]
# initial_marker = constant_refine
# max_h_level = 2
# initial_steps = 2
# []
[XFEM]
geometric_cut_userobjects = 'cut_mesh'
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[cut_mesh]
type = MeshCut2DFractureUserObject
mesh_generator_name = 'cut_mesh'
growth_increment = 0.05
ki_vectorpostprocessor = "II_KI_1"
kii_vectorpostprocessor = "II_KII_1"
k_critical = 1000 # big, don't want to grow
[]
[]
[DomainIntegral]
integrals = 'Jintegral InteractionIntegralKI InteractionIntegralKII'
displacements = 'disp_x disp_y'
crack_front_points_provider = cut_mesh
2d = true
number_points_from_provider = 2
crack_direction_method = CurvedCrackFront
radius_inner = '0.2'
radius_outer = '0.8'
poissons_ratio = ${poissons}
youngs_modulus = ${youngs}
block = 0
incremental = false
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = SMALL
incremental = false
planar_formulation = plane_strain
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress max_principal_stress'
add_variables = true
[]
[]
[Postprocessors]
[theta]
type = ConstantPostprocessor
value = ${theta}
[]
[stress_load]
type = ConstantPostprocessor
value = ${stress_load}
[]
[ki_analytic]
type = ParsedPostprocessor
expression = '(${fparse stress_load*sqrt(pi*a)*cos(theta*pi/180)*cos(theta*pi/180)})'
[]
[kii_analytic]
type = ParsedPostprocessor
expression = '(${fparse stress_load*sqrt(pi*a)*cos(theta*pi/180)*sin(theta*pi/180)})'
[]
[]
[BCs]
[left_x]
type = DirichletBC
boundary = 'center_left_node'
variable = disp_x
value = 0
[]
[left_y]
type = DirichletBC
boundary = 'center_left_node'
variable = disp_y
value = 0
[]
[right_y]
type = DirichletBC
boundary = 'center_right_node'
variable = disp_y
value = 0
[]
[bottom_load]
type = NeumannBC
boundary = 'bottom'
variable = disp_y
value = -${stress_load}
[]
[top_load]
type = NeumannBC
boundary = 'top'
variable = disp_y
value = ${stress_load}
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = ${youngs}
poissons_ratio = ${poissons}
[]
[stress]
type = ComputeLinearElasticStress
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = ' lu superlu_dist NONZERO 1e-20'
line_search = 'none'
nl_abs_tol = 1e-7
start_time = 0.0
dt = 1.0
end_time = 1
max_xfem_update = 0
[]
[Outputs]
csv = true
# uncomment for convergence study
# file_base = inclined_crack/results_theta_${theta}_h_${mesh_h}
[]
(modules/combined/test/tests/czm_pressure_sidesets/czm_pressure_sideset_cavity.i)
# Pressurization of the sidesets built by MortarCZMDebondedBoundaryUpdater. The
# czm_pressure_sideset.i test is repeated here while the upper block also
# slides tangentially, so the faces paired in the undisplaced configuration are no
# longer aligned. Once the whole interface has failed the blocks carry no load, so the void between
# the two sidesets must equal the integral of the prescribed opening, opening * t * (1 - x / 2),
# over x in [0, 1], which is 3 / 4 * opening * t.
#
# The void is a cavity, connected to an unmeshed plenum of volume Vp, whose gas pressure follows
# the ideal gas law, p (V + Vp) = n R T, and acts on both sidesets, which is only possible if the
# pressure boundary condition picks up the faces added during the run. Gas is injected at a constant
# rate from full separation at t = 0.8 until t = 1, so the pressure first rises, and then falls as
# the peel keeps enlarging the void. Each block is in uniaxial compression, sigma_yy = -p, so that
# - the vertical reactions on lower_bottom and upper_top are +p and -p times the interface length;
# - the lower block displaces by u_y = -p / E * (y + 0.5), and the upper block by
# p / E * (0.5 - y) in addition to the imposed peel;
# - the void area is V = V0 + p / E, with V0 = 3 / 4 * opening * t, as each block of height 0.5
# shortens by p / (2 E).
# These fields are linear, so the elements reproduce them exactly. Substituting V into the gas law
# gives p^2 / E + W p - n R T = 0 with W = V0 + Vp, whose positive root is
# p = E / 2 * (sqrt(W^2 + 4 n R T / E) - W).
opening = 0.1
slide = 0.02
youngs_modulus = 1e9
gas_constant = 8.314
gas_temperature = 300
# Plenum volume, of the order of the void area, which keeps the gas volume positive while the void
# is still closed
plenum_volume = 0.05
# Injection rate chosen so that the pressure peaks near 1e7 at t = 1; p / E = 0.01 is large enough
# to see in the displacements
gas_rate = 2700
[Mesh]
# The interface lies on y = 0, so the void integrand -y n_y vanishes on the vertical closing
# segment at the crack front, which belongs to neither sideset.
[lower]
type = GeneratedMeshGenerator
dim = 2
xmax = 1
ymin = -0.5
ymax = 0
nx = 4
ny = 1
boundary_name_prefix = lower
[]
[lower_id]
type = SubdomainIDGenerator
input = lower
subdomain_id = 1
[]
[upper]
type = GeneratedMeshGenerator
dim = 2
xmax = 1
ymin = 0
ymax = 0.5
nx = 3
ny = 1
boundary_name_prefix = upper
boundary_id_offset = 10
[]
[upper_id]
type = SubdomainIDGenerator
input = upper
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'lower_id upper_id'
[]
[secondary]
type = LowerDBlockFromSidesetGenerator
new_block_id = 10001
new_block_name = secondary_lower
sidesets = lower_top
input = combined
[]
[primary]
type = LowerDBlockFromSidesetGenerator
new_block_id = 10000
new_block_name = primary_lower
sidesets = upper_bottom
input = secondary
[]
add_sideset_names = 'czm_pressure_primary czm_pressure_secondary'
add_sideset_ids = '1000 1001'
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Problem]
extra_tag_vectors = 'ref'
[]
[Physics/SolidMechanics/QuasiStatic/all]
strain = SMALL
add_variables = true
use_automatic_differentiation = true
extra_vector_tags = 'ref'
block = '1 2'
[]
[AuxVariables]
[damage]
[]
[react_y]
block = '1 2'
[]
[]
[AuxKernels]
[damage]
type = CohesiveZoneMortarUserObjectAux
variable = damage
user_object = czm_uo
cohesive_zone_quantity = cohesive_damage
[]
[react_y]
type = ReactionForceAux
vector_tag = 'ref'
v = disp_y
variable = react_y
block = '1 2'
[]
[]
[Functions]
[gas_moles]
type = ParsedFunction
expression = '${gas_rate} * max(min(t, 1) - 0.8, 0)'
[]
[expected_pressure]
type = ParsedFunction
expression = 'W := 0.75 * ${opening} * t + ${plenum_volume};
n := ${gas_rate} * max(min(t, 1) - 0.8, 0);
${youngs_modulus} / 2 * (sqrt(W^2 + 4 * n * ${gas_constant} * ${gas_temperature} / ${youngs_modulus}) - W)'
[]
[]
[BCs]
[fix_x]
type = DirichletBC
boundary = lower_bottom
variable = disp_x
value = 0
[]
[fix_y]
type = DirichletBC
boundary = lower_bottom
variable = disp_y
value = 0
[]
[slide_x]
type = FunctionDirichletBC
boundary = upper_top
variable = disp_x
function = '${slide} * t'
[]
[peel_y]
type = FunctionDirichletBC
boundary = upper_top
variable = disp_y
function = '${opening} * t * (1 - x / 2)'
[]
[CavityPressure]
[void]
boundary = 'czm_pressure_primary czm_pressure_secondary'
R = ${gas_constant}
temperature = gas_temperature
volume = void_area
material_input = gas_moles
additional_volumes = plenum_volume
temperature_of_additional_volumes = gas_temperature
output = cavity_pressure
use_automatic_differentiation = true
# Act on the undisplaced faces so that the load stays purely normal to the interface and the
# solution above is exact
use_displaced_mesh = false
[]
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = ${youngs_modulus}
poissons_ratio = 0
block = '1 2'
[]
[stress]
type = ADComputeLinearElasticStress
block = '1 2'
[]
[normal_strength]
type = GenericConstantMaterial
prop_names = normal_strength
prop_values = 1e4
[]
[shear_strength]
type = GenericConstantMaterial
prop_names = shear_strength
prop_values = 1e4
[]
[]
[UserObjects]
[czm_uo]
type = BilinearMixedModeCohesiveZoneModel
primary_boundary = upper_bottom
secondary_boundary = lower_top
primary_subdomain = primary_lower
secondary_subdomain = secondary_lower
disp_x = disp_x
disp_y = disp_y
secondary_variable = disp_x
use_physical_gap = true
correct_edge_dropping = true
normal_strength = normal_strength
shear_strength = shear_strength
penalty_stiffness = 1e12
power_law_parameter = 2
# Fully separated (damage = 1) once the opening exceeds 2 GI_c / normal_strength = 4e-2, which
# is much larger than the 1e-5 elastic stretch of the blocks at peak traction, so the response
# does not snap back
GI_c = 200
GII_c = 200
[]
[]
[Constraints]
[x]
type = NormalMortarMechanicalContact
primary_boundary = upper_bottom
secondary_boundary = lower_top
primary_subdomain = primary_lower
secondary_subdomain = secondary_lower
secondary_variable = disp_x
component = x
use_displaced_mesh = true
compute_lm_residuals = false
weighted_gap_uo = czm_uo
[]
[y]
type = NormalMortarMechanicalContact
primary_boundary = upper_bottom
secondary_boundary = lower_top
primary_subdomain = primary_lower
secondary_subdomain = secondary_lower
secondary_variable = disp_y
component = y
use_displaced_mesh = true
compute_lm_residuals = false
weighted_gap_uo = czm_uo
[]
[c_x]
type = MortarGenericTraction
primary_boundary = upper_bottom
secondary_boundary = lower_top
primary_subdomain = primary_lower
secondary_subdomain = secondary_lower
secondary_variable = disp_x
component = x
use_displaced_mesh = true
compute_lm_residuals = false
cohesive_zone_uo = czm_uo
[]
[c_y]
type = MortarGenericTraction
primary_boundary = upper_bottom
secondary_boundary = lower_top
primary_subdomain = primary_lower
secondary_subdomain = secondary_lower
secondary_variable = disp_y
component = y
use_displaced_mesh = true
compute_lm_residuals = false
cohesive_zone_uo = czm_uo
[]
[]
[MeshModifiers]
[pressure_sideset_updater]
type = MortarCZMDebondedBoundaryUpdater
block = secondary_lower
damage_variable = damage
cohesive_zone_userobject = czm_uo
primary_boundary = upper_bottom
secondary_boundary = lower_top
primary_subdomain = primary_lower
secondary_subdomain = secondary_lower
debonded_boundary_primary = czm_pressure_primary
debonded_boundary_secondary = czm_pressure_secondary
execute_on = TIMESTEP_END
# Run before the default group so that the postprocessors see faces promoted this step
execution_order_group = -1
[]
[]
[Postprocessors]
# Undisplaced length and first moment of each sideset
[primary_length]
type = AreaPostprocessor
boundary = czm_pressure_primary
[]
[secondary_length]
type = AreaPostprocessor
boundary = czm_pressure_secondary
[]
[primary_moment]
type = FunctionSideIntegral
boundary = czm_pressure_primary
function = x
[]
[secondary_moment]
type = FunctionSideIntegral
boundary = czm_pressure_secondary
function = x
[]
# Area between the two sidesets in the current configuration, which is the cavity volume
[void_area]
type = InternalVolume
boundary = 'czm_pressure_primary czm_pressure_secondary'
component = 1
execute_on = 'initial linear timestep_end'
[]
[expected_void_area_separated]
type = ParsedPostprocessor
expression = '0.75 * ${opening} * t + expected_pressure / ${youngs_modulus}'
pp_names = 'expected_pressure'
use_t = true
[]
# Cavity inputs
[gas_moles]
type = FunctionValuePostprocessor
function = gas_moles
execute_on = 'initial linear timestep_end'
[]
[gas_temperature]
type = ConstantPostprocessor
value = ${gas_temperature}
execute_on = 'initial linear timestep_end'
[]
[plenum_volume]
type = ConstantPostprocessor
value = ${plenum_volume}
execute_on = 'initial linear timestep_end'
[]
# Pressure checks, valid after full separation
[lower_reaction_y]
type = NodalSum
variable = react_y
boundary = lower_bottom
[]
[upper_reaction_y]
type = NodalSum
variable = react_y
boundary = upper_top
[]
[expected_pressure]
type = FunctionValuePostprocessor
function = expected_pressure
[]
# The lower block moves only because of the pressure
[lower_disp_y]
type = PointValue
variable = disp_y
point = '0.5 -0.25 0'
[]
[expected_lower_disp_y]
type = ParsedPostprocessor
expression = '-expected_pressure / ${youngs_modulus} * 0.25'
pp_names = 'expected_pressure'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu superlu_dist'
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
dt = 0.1
end_time = 1.2
[]
[Outputs]
csv = true
[]
(test/tests/reporters/parsed_reporters/vectorMath.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Reporters]
[dataFromVofV]
type = VectorOfVectorTestReporter
name = v_of_v
vector_of_vectors = '101 201; 102 202; 103 203'
outputs = none
[]
[vecvec_sum]
type = ParsedVectorVectorRealReductionReporter
name = sum
vector_of_vector_reporter_name = 'dataFromVofV/v_of_v'
initial_reduction_value = 0
expression = 'reduction_value+indexed_value'
[]
[vecvec_sqsum]
type = ParsedVectorVectorRealReductionReporter
name = sqsum
vector_of_vector_reporter_name = 'dataFromVofV/v_of_v'
initial_reduction_value = 0
expression = 'reduction_value+indexed_value*indexed_value'
[]
[vecvec_multiply]
type = ParsedVectorVectorRealReductionReporter
name = multiply
vector_of_vector_reporter_name = 'dataFromVofV/v_of_v'
initial_reduction_value = 1
expression = 'reduction_value*indexed_value'
[]
[vecvec_max]
type = ParsedVectorVectorRealReductionReporter
name = max
vector_of_vector_reporter_name = 'dataFromVofV/v_of_v'
initial_reduction_value = -100000
expression = 'max(reduction_value,indexed_value)'
[]
[vecs]
type = ConstantReporter
real_vector_names = 'vec_a vec_b vec_c vec_d'
real_vector_values = '1 2 3; 10 20 30; 100 10 1; 1 2 3 4'
real_names = 'a b c'
real_values = '1 10 100'
outputs = none
[]
[vectorOperation]
type = ParsedVectorReporter
name = inner
vector_reporter_names = 'vecs/vec_a vecs/vec_b vecs/vec_c'
vector_reporter_symbols = 'a b c'
scalar_reporter_names = 'scalar_pp/value'
scalar_reporter_symbols = 'scalar_pp'
constant_names = 'constant1 constant2'
constant_expressions = '10 20'
expression = '(a+b)*c+constant1+constant2+scalar_pp'
[]
[scalarOperation]
type = ParsedScalarReporter
name = inner
scalar_reporter_names = 'vecs/a vecs/b vecs/c'
scalar_reporter_symbols = 'a b c'
constant_names = 'constant1 constant2'
constant_expressions = '10 20'
expression = '(a+b)*c+constant1+constant2'
[]
[vec_d]
type = ConstantReporter
real_vector_names = 'vec_d'
real_vector_values = '1 2 3 4'
outputs = none
[]
[vector_sum]
type = ParsedVectorRealReductionReporter
name = sum
vector_reporter_name = vec_d/vec_d
initial_reduction_value = 0
expression = 'reduction_value+indexed_value'
[]
[vector_sqsum]
type = ParsedVectorRealReductionReporter
name = sqsum
vector_reporter_name = vec_d/vec_d
initial_reduction_value = 0
expression = 'reduction_value+indexed_value*indexed_value'
[]
[vector_multiply]
type = ParsedVectorRealReductionReporter
name = multiply
vector_reporter_name = vec_d/vec_d
initial_reduction_value = 1
expression = 'reduction_value*indexed_value'
[]
[vector_max]
type = ParsedVectorRealReductionReporter
name = max
vector_reporter_name = vec_d/vec_d
initial_reduction_value = -100000
expression = 'max(reduction_value,indexed_value)'
[]
[]
[Postprocessors]
[scalar_pp]
type = ConstantPostprocessor
value = 5
outputs = none
[]
[]
[Outputs]
csv = true
[]
(test/tests/convergence/parsed_convergence/base.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Functions]
[test_fn]
type = ConstantFunction
value = 0
[]
[]
[Postprocessors]
[test_pp]
type = ConstantPostprocessor
value = -1e-6
[]
[num_nl_iterations]
type = NumNonlinearIterations
execute_on = 'TIMESTEP_END'
[]
[]
[Convergence]
[parsed_conv]
type = ParsedConvergence
convergence_expression = 'fn | (supplied & abs(pp) < tol)'
symbol_names = 'supplied pp tol fn'
symbol_values = 'supplied_conv test_pp 1e-5 test_fn'
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type'
petsc_options_value = 'hypre'
nonlinear_convergence = parsed_conv
[]
[Outputs]
csv = true
show = 'num_nl_iterations'
execute_on = 'FINAL'
[]
(test/tests/outputs/csv/csv_scientific_notation.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Postprocessors]
[small]
type = ConstantPostprocessor
value = 1.234e-20
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
file_base = 'csv_scientific_notation_out'
[csv]
type = CSV
execute_on = 'TIMESTEP_END'
precision = 6
scientific_notation = true
[]
[]
(modules/thermal_hydraulics/test/tests/components/volume_junction_coupled_flux_1phase/child.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[Postprocessors]
[p_test]
type = ConstantPostprocessor
value = 0.9e5
[]
[T_test]
type = ConstantPostprocessor
value = 300
[]
[mass_rate_test]
type = Receiver
[]
[energy_rate_test]
type = Receiver
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
end_time = 0.5
dt = 0.1
[]
[Outputs]
csv = true
[]
(modules/optimization/test/tests/reporters/multiExperiment/forward.i)
omega = 1
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Functions]
[obj_func]
type = ParsedOptimizationFunction
expression = 'pow(x_val + 2 * y_val - ${omega}-5, 2) + pow(2 * x_val + y_val - ${omega}, 2)'
param_symbol_names = 'x_val y_val'
param_vector_name = vals/vals
[]
[df_dx]
type = ParsedOptimizationFunction
expression = '2 * (x_val + 2 * y_val - ${omega}-5) + 4 * (2 * x_val + y_val - ${omega})'
param_symbol_names = 'x_val y_val'
param_vector_name = vals/vals
[]
[df_dy]
type = ParsedOptimizationFunction
expression = '4 * (x_val + 2 * y_val - ${omega}-5) + 2 * (2 * x_val + y_val - ${omega})'
param_symbol_names = 'x_val y_val'
param_vector_name = vals/vals
[]
[]
[Postprocessors]
[obj_pp]
type = FunctionValuePostprocessor
function = obj_func
execute_on = 'INITIAL TIMESTEP_END'
[]
[df_dx]
type = FunctionValuePostprocessor
function = df_dx
[]
[df_dy]
type = FunctionValuePostprocessor
function = df_dy
[]
[omega]
type = ConstantPostprocessor
value = ${omega}
[]
[]
[VectorPostprocessors]
[grad_f]
type = VectorOfPostprocessors
postprocessors = 'df_dx df_dy'
[]
[]
[Reporters]
[vals]
type = ConstantReporter
real_vector_names = 'vals'
real_vector_values = '0 0'
[]
[]
[Outputs]
console = false
[]
(test/tests/restart/receiver/receiver_initial.i)
[Mesh/gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 1
[]
[Postprocessors/constant]
type = ConstantPostprocessor
value = 5
execute_on = initial
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
checkpoint = true
[]
(modules/stochastic_tools/examples/optimization/annulus_shape/annulus_displaced_mesh.i)
[Mesh]
[disk]
type = ConcentricCircleMeshGenerator
has_outer_square = false
preserve_volumes = false
radii = '1 2'
rings = '16 16'
num_sectors = 16
[]
[ring]
type = BlockDeletionGenerator
input = disk
block = 1
new_boundary = inner
[]
[]
[Variables]
[T]
[]
[]
[Kernels]
[diffusion]
type = ADMatDiffusion
variable = T
diffusivity = k
use_displaced_mesh = true
[]
[src]
type = ADBodyForce
variable = T
value = 1
use_displaced_mesh = true
[]
[]
[BCs]
[convection]
type = ADMatNeumannBC
boundary = inner
variable = T
boundary_material = convection
value = 1
use_displaced_mesh = true
[]
[]
[Materials]
[conductivity]
type = ADGenericConstantMaterial
prop_names = 'k'
prop_values = '1'
[]
[convection]
type = ADParsedMaterial
expression = 'h * (100 - T)'
coupled_variables = 'T'
postprocessor_names = 'h'
property_name = convection
use_displaced_mesh = true
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[AuxVariables]
[disp_x]
[]
[disp_y]
[]
[]
[AuxKernels]
[disp_x_aux]
type = ParsedAux
variable = disp_x
expression = 'r:=sqrt(x * x + y * y);theta:=atan(y / x);
dr:=r * (thickness - 1) + inner_radius - thickness;
dr * cos(theta)'
functor_names = 'inner_radius thickness'
use_xyzt = true
execute_on = 'timestep_begin'
use_displaced_mesh = false
[]
[disp_y_aux]
type = ParsedAux
variable = disp_y
expression = 'r:=sqrt(x * x + y * y);theta:=atan(y / x);
dr:=r * (thickness - 1) + inner_radius - thickness;
dr * sin(theta)'
functor_names = 'inner_radius thickness'
use_xyzt = true
execute_on = 'timestep_begin'
use_displaced_mesh = false
[]
[]
[Postprocessors]
[inner_radius]
type = ConstantPostprocessor
value = 6
execute_on = 'timestep_begin'
force_preaux = true
[]
[thickness]
type = ConstantPostprocessor
value = 4
execute_on = 'timestep_begin'
force_preaux = true
[]
[h]
type = ParsedPostprocessor
expression = '${fparse 10 / pi} / inner_radius^3'
pp_names = 'inner_radius'
execute_on = 'timestep_begin'
[]
[Tmax]
type = NodalExtremeValue
variable = T
[]
[volume]
type = VolumePostprocessor
use_displaced_mesh = true
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
line_search = none
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
nl_abs_tol = 1e-11
[]
(modules/subchannel/validation/EBR-II/XX09_SCM_TR45R.i)
# Following Benchmark Specifications and Data Requirements for EBR-II Shutdown Heat Removal Tests SHRT-17 and SHRT-45R
# Available at: https://publications.anl.gov/anlpubs/2012/06/73647.pdf
# Transient subchannel calculation
###################################################
# Thermal-hydraulics parameters
###################################################
T_in = 616.4 #Kelvin
Total_Surface_Area = 0.000854322 #m3
mass_flux_in = '${fparse 2.427 / Total_Surface_Area}'
P_out = 2.0e5
Power_initial = 379800 #W (Page 26,35 of ANL document)
###################################################
# Geometric parameters
###################################################
scale_factor = 0.01
fuel_pin_pitch = '${fparse 0.5664*scale_factor}'
fuel_pin_diameter = '${fparse 0.4419*scale_factor}'
wire_z_spacing = '${fparse 15.24*scale_factor}'
wire_diameter = '${fparse 0.1244*scale_factor}'
inner_duct_in = '${fparse 4.64*scale_factor}'
n_rings = 5
heated_length = '${fparse 34.3*scale_factor}'
unheated_length_exit = '${fparse 26.9*scale_factor}'
###################################################
[TriSubChannelMesh]
[subchannel]
type = SCMTriAssemblyMeshGenerator
nrings = ${n_rings}
n_cells = 50
flat_to_flat = ${inner_duct_in}
unheated_length_exit = ${unheated_length_exit}
heated_length = ${heated_length}
pin_diameter = ${fuel_pin_diameter}
pitch = ${fuel_pin_pitch}
dwire = ${wire_diameter}
hwire = ${wire_z_spacing}
spacer_z = '0.0'
spacer_k = '0.0'
[]
[]
[FluidProperties]
[sodium]
type = PBSodiumFluidProperties
[]
[]
[AuxVariables]
[q_prime_init]
block = fuel_pins
[]
[power_history_field]
block = fuel_pins
[]
[q_prime]
block = fuel_pins
[]
[]
[SubChannel]
type = TriSubChannel1PhaseProblem
fp = sodium
n_blocks = 1
P_out = ${P_out}
compute_density = true
compute_viscosity = true
compute_power = true
P_tol = 1.0e-4
T_tol = 1.0e-4
implicit = true
segregated = false
interpolation_scheme = 'upwind'
pin_HTC_closure = 'gnielinski'
friction_closure = 'Chen'
full_output = true
mixing_closure = 'Chen_Todreas'
[]
[SCMClosures]
[Chen]
type = SCMFrictionChenTodreas
[]
[gnielinski]
type = SCMHTCGnielinski
[]
[Chen_Todreas]
type = SCMMixingChenTodreas
CT = 2.6
[]
[]
[ICs]
[q_prime_IC]
type = SCMTriPowerIC
variable = q_prime_init
power = ${Power_initial}
filename = "pin_power_profile61_uniform.txt"
[]
[T_ic]
type = ConstantIC
variable = T
value = ${T_in}
[]
[P_ic]
type = ConstantIC
variable = P
value = 0.0
[]
[DP_ic]
type = ConstantIC
variable = DP
value = 0.0
[]
[Viscosity_ic]
type = ViscosityIC
variable = mu
p = ${P_out}
T = T
fp = sodium
[]
[rho_ic]
type = RhoFromPressureTemperatureIC
variable = rho
p = ${P_out}
T = T
fp = sodium
[]
[h_ic]
type = SpecificEnthalpyFromPressureTemperatureIC
variable = h
p = ${P_out}
T = T
fp = sodium
[]
[mdot_ic]
type = ConstantIC
variable = mdot
value = 0.0
[]
[]
[Functions]
[power_func]
type = PiecewiseLinear
data_file = 'power_history_SHRT45.csv'
format = "columns"
scale_factor = 1.0
[]
[mass_flux_in]
type = PiecewiseLinear
data_file = 'massflow_SHRT45.csv'
format = "columns"
scale_factor = '${fparse mass_flux_in / 2.427}'
[]
[dts]
type = PiecewiseLinear
xy_data = '0.0 0.1
5.0 2.0
100 2.0
110 20.0
900 20.0'
[]
[]
[Controls]
[mass_flux_ctrl]
type = RealFunctionControl
parameter = 'Postprocessors/mass_flux_PP/value'
function = 'mass_flux_in'
execute_on = 'initial timestep_begin'
[]
[]
[AuxKernels]
[T_in_bc]
type = ConstantAux
variable = T
boundary = inlet
value = ${T_in}
execute_on = 'timestep_begin'
block = subchannel
[]
[mdot_in_bc]
type = SCMMassFlowRateAux
variable = mdot
boundary = inlet
area = S
mass_flux = mass_flux_PP
execute_on = 'timestep_begin'
[]
[populate_power_history]
type = FunctionAux
variable = power_history_field
function = 'power_func'
execute_on = 'INITIAL TIMESTEP_BEGIN'
[]
[change_q_prime]
type = ParsedAux
variable = q_prime
coupled_variables = 'q_prime_init power_history_field'
expression = 'q_prime_init*power_history_field'
execute_on = 'INITIAL TIMESTEP_BEGIN'
[]
[]
[Outputs]
csv = true
[]
[Postprocessors]
[report_pressure_outlet]
type = Receiver
default = ${P_out}
[]
[TTC-31]
type = SubChannelPointValue
variable = T
index = 0
execute_on = 'initial timestep_end'
height = 0.322
[]
[post_func]
type = ElementIntegralVariablePostprocessor
block = fuel_pins
variable = q_prime
execute_on = 'INITIAL TIMESTEP_BEGIN'
[]
[mass_flux_PP]
type = ConstantPostprocessor
value = ${mass_flux_in}
[]
[mass_flow_PP]
type = ParsedPostprocessor
expression = '${Total_Surface_Area} * mass_flux_PP'
pp_names = 'mass_flux_PP'
[]
[]
[Executioner]
type = Transient
start_time = -1
end_time = 900.0
[TimeStepper]
type = FunctionDT
function = dts
min_dt = 0.1
growth_factor = 2.0
[]
dtmax = 20
# num_steps = 15
[]
################################################################################
# A multiapp that projects data to a detailed mesh
################################################################################
[MultiApps]
[viz]
type = TransientMultiApp
input_files = '3d_SCM_TR.i'
execute_on = 'INITIAL TIMESTEP_END'
catch_up = true
[]
[]
[Transfers]
[subchannel_transfer]
type = SCMSolutionTransfer
to_multi_app = viz
variable = 'mdot SumWij P DP h T rho mu S'
[]
[pin_transfer]
type = SCMSolutionTransfer
transfer_type = pin
to_multi_app = viz
variable = 'Tpin q_prime'
[]
[]
(modules/stochastic_tools/test/tests/web_server_control/vpp_general.i)
mesh_samples = 1
mesh_outer = 3
mesh_specified=1
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = ${fparse mesh_outer}
nx = ${fparse max(mesh_samples,mesh_specified)}
[]
[]
[Variables]
[temperature]
initial_condition = 650
[]
[]
[Functions]
[src]
type = ParsedFunction
expression = '3*x'
[]
[]
[Kernels]
[heat_conduction_solid]
type = MatDiffusion
diffusivity = thermal_conductivity
variable = temperature
[]
[heat_source]
type = BodyForce
variable = temperature
function = src
[]
[]
[BCs]
[heat_DRV_outer]
type = DirichletBC
boundary = right
variable = temperature
value = 300
[]
[]
[Materials]
[Matrix]
type = ParsedMaterial
property_name = thermal_conductivity
coupled_variables = temperature
constant_expressions = '8.314'
constant_names = 'R'
postprocessor_names = 'frequency_factor activation_energy'
expression = 'frequency_factor * exp(-activation_energy / R / temperature)'
[]
[]
[Postprocessors]
[activation_energy]
type = ConstantPostprocessor
value = 27700.0
[]
[frequency_factor]
type = ConstantPostprocessor
value = 385478.35767
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
line_search = none
start_time = 0.0
end_time = 100
dt = 100
[]
[Positions]
[SR_pos]
type = ElementCentroidPositions
auto_sort = True
[]
[ring_poss]
type = ReporterPositions
reporters = 'SR_pos/positions_1d'
[]
[]
[VectorPostprocessors]
[temp]
type = PositionsFunctorValueSampler
functors = 'temperature'
positions = ring_poss
sort_by = x
execute_on = FINAL
outputs = csv
discontinuous = true
[]
[]
[Outputs]
console = false
exodus = false
[]
(test/tests/scalar_kernels/ad_scalar_kernel/ad_functor_scalar_test_kernel.i)
# Solves du/dt = (2 * t + x) + 1 + 2 + w and dw/dt = 1 with implicit Euler, where the right-hand
# sides are sums of functors that an ADScalarKernel evaluates at points given in the input:
# - the function 2 * t + x at x = 1,
# - a functor material with value 1,
# - a postprocessor with value 2, and
# - the scalar variable w.
# The exact solution at the end of each step n (dt = 1) is w_n = n and
# u_n = 3 * n * (n + 1) / 2 + 4 * n, so u (postprocessor u_value) is 7, 17, and 30 at steps 1, 2,
# and 3.
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[Variables]
[u]
family = SCALAR
order = FIRST
initial_condition = 0
[]
[w]
family = SCALAR
order = FIRST
initial_condition = 0
[]
[]
[Functions]
[ramp]
type = ParsedFunction
expression = '2 * t + x'
[]
[]
[FunctorMaterials]
[fmat]
type = ADGenericConstantFunctorMaterial
prop_names = prop
prop_values = 1
[]
[]
[ScalarKernels]
[time]
type = ADScalarTimeDerivative
variable = u
[]
[ramp_source]
type = ADFunctorScalarTestKernel
variable = u
functor = ramp
point = '1 0 0'
[]
[constant_source]
type = ADFunctorScalarTestKernel
variable = u
functor = prop
[]
[pp_source]
type = ADFunctorScalarTestKernel
variable = u
functor = source_pp
[]
[scalar_source]
type = ADFunctorScalarTestKernel
variable = u
functor = w
[]
[time_w]
type = ADScalarTimeDerivative
variable = w
[]
[w_source]
type = ADFunctorScalarTestKernel
variable = w
functor = prop
[]
[]
[Postprocessors]
[source_pp]
type = ConstantPostprocessor
value = 2
[]
[u_value]
type = ScalarVariable
variable = u
execute_on = 'initial timestep_end'
[]
[]
[Executioner]
type = Transient
scheme = implicit-euler
dt = 1
num_steps = 3
solve_type = NEWTON
nl_abs_tol = 1e-12
[]
[Outputs]
csv = true
show = 'u_value'
[]
(modules/porous_flow/test/tests/physics/coupled_injection_production_physics/sub.i)
e_source = 1e5
mass_rate_inj1 = 0.5
energy_rate_inj1 = ${fparse mass_rate_inj1 * e_source}
mass_rate_pro1 = -0.5
energy_rate_pro1 = ${fparse mass_rate_pro1 * e_source}
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[Postprocessors]
[mass_rate_inj1]
type = ConstantPostprocessor
value = ${mass_rate_inj1}
[]
[energy_rate_inj1]
type = ConstantPostprocessor
value = ${energy_rate_inj1}
[]
[p_inj1]
type = Receiver
[]
[T_inj1]
type = Receiver
[]
[mass_rate_pro1]
type = ConstantPostprocessor
value = ${mass_rate_pro1}
[]
[energy_rate_pro1]
type = ConstantPostprocessor
value = ${energy_rate_pro1}
[]
[p_pro1]
type = Receiver
[]
[T_pro1]
type = Receiver
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
end_time = 5.0
dt = 1.0
[]
(modules/subchannel/validation/EBR-II/XX09_SCM_TR17.i)
# Following Benchmark Specifications and Data Requirements for EBR-II Shutdown Heat Removal Tests SHRT-17 and SHRT-45R
# Available at: https://publications.anl.gov/anlpubs/2012/06/73647.pdf
# Transient subchannel calculation
###################################################
# Thermal-hydraulics parameters
###################################################
T_in = 624.7 #Kelvin
Total_Surface_Area = 0.000854322 #m3
mass_flux_in = '${fparse 2.45 / Total_Surface_Area}'
P_out = 2.0e5
Power_initial = 486200 #W (Page 26,35 of ANL document)
###################################################
# Geometric parameters
###################################################
scale_factor = 0.01
fuel_pin_pitch = '${fparse 0.5664*scale_factor}'
fuel_pin_diameter = '${fparse 0.4419*scale_factor}'
wire_z_spacing = '${fparse 15.24*scale_factor}'
wire_diameter = '${fparse 0.1244*scale_factor}'
inner_duct_in = '${fparse 4.64*scale_factor}'
n_rings = 5
heated_length = '${fparse 34.3*scale_factor}'
unheated_length_exit = '${fparse 26.9*scale_factor}'
###################################################
[TriSubChannelMesh]
[subchannel]
type = SCMTriAssemblyMeshGenerator
nrings = ${n_rings}
n_cells = 50
flat_to_flat = ${inner_duct_in}
unheated_length_exit = ${unheated_length_exit}
heated_length = ${heated_length}
pin_diameter = ${fuel_pin_diameter}
pitch = ${fuel_pin_pitch}
dwire = ${wire_diameter}
hwire = ${wire_z_spacing}
spacer_z = '0.0'
spacer_k = '0.0'
[]
[]
[FluidProperties]
[sodium]
type = PBSodiumFluidProperties
[]
[]
[AuxVariables]
[q_prime_init]
block = fuel_pins
[]
[power_history_field]
block = fuel_pins
[]
[q_prime]
block = fuel_pins
[]
[]
[SubChannel]
type = TriSubChannel1PhaseProblem
fp = sodium
n_blocks = 1
P_out = ${P_out}
compute_density = true
compute_viscosity = true
compute_power = true
P_tol = 1.0e-4
T_tol = 1.0e-4
implicit = true
segregated = false
interpolation_scheme = 'upwind'
pin_HTC_closure = 'gnielinski'
friction_closure = 'Chen'
full_output = true
mixing_closure = 'Chen_Todreas'
[]
[SCMClosures]
[Chen]
type = SCMFrictionChenTodreas
[]
[gnielinski]
type = SCMHTCGnielinski
[]
[Chen_Todreas]
type = SCMMixingChenTodreas
CT = 2.6
[]
[]
[ICs]
[q_prime_IC]
type = SCMTriPowerIC
variable = q_prime_init
power = ${Power_initial}
filename = "pin_power_profile61_uniform.txt"
[]
[T_ic]
type = ConstantIC
variable = T
value = ${T_in}
[]
[P_ic]
type = ConstantIC
variable = P
value = 0.0
[]
[DP_ic]
type = ConstantIC
variable = DP
value = 0.0
[]
[Viscosity_ic]
type = ViscosityIC
variable = mu
p = ${P_out}
T = T
fp = sodium
[]
[rho_ic]
type = RhoFromPressureTemperatureIC
variable = rho
p = ${P_out}
T = T
fp = sodium
[]
[h_ic]
type = SpecificEnthalpyFromPressureTemperatureIC
variable = h
p = ${P_out}
T = T
fp = sodium
[]
[mdot_ic]
type = ConstantIC
variable = mdot
value = 0.0
[]
[]
[Functions]
[power_func]
type = PiecewiseLinear
data_file = 'power_history_SHRT17.csv'
format = "columns"
scale_factor = 1.0
[]
[mass_flux_in]
type = PiecewiseLinear
data_file = 'massflow_SHRT17.csv'
format = "columns"
scale_factor = '${fparse mass_flux_in / 2.45}'
[]
[time_step_limiting]
type = PiecewiseLinear
xy_data = '0.1 0.1
10.0 10.0'
[]
[]
[Controls]
[mass_flux_ctrl]
type = RealFunctionControl
parameter = 'Postprocessors/mass_flux_PP/value'
function = 'mass_flux_in'
execute_on = 'initial timestep_begin'
[]
[]
[AuxKernels]
[T_in_bc]
type = ConstantAux
variable = T
boundary = inlet
value = ${T_in}
execute_on = 'timestep_begin'
block = subchannel
[]
[mdot_in_bc]
type = SCMMassFlowRateAux
variable = mdot
boundary = inlet
area = S
mass_flux = mass_flux_PP
execute_on = 'timestep_begin'
[]
[populate_power_history]
type = FunctionAux
variable = power_history_field
function = 'power_func'
execute_on = 'INITIAL TIMESTEP_BEGIN'
[]
[change_q_prime]
type = ParsedAux
variable = q_prime
coupled_variables = 'q_prime_init power_history_field'
expression = 'q_prime_init*power_history_field'
execute_on = 'INITIAL TIMESTEP_BEGIN'
[]
[]
[Outputs]
csv = true
[]
[Postprocessors]
[report_pressure_outlet]
type = Receiver
default = ${P_out}
[]
[TTC-31]
type = SubChannelPointValue
variable = T
index = 0
execute_on = 'initial timestep_end'
height = 0.322
[]
[post_func]
type = ElementIntegralVariablePostprocessor
block = fuel_pins
variable = q_prime
execute_on = 'INITIAL TIMESTEP_BEGIN'
[]
[mass_flux_PP]
type = ConstantPostprocessor
value = ${mass_flux_in}
[]
[mass_flow_PP]
type = ParsedPostprocessor
expression = '${Total_Surface_Area} * mass_flux_PP'
pp_names = 'mass_flux_PP'
[]
[]
[Executioner]
type = Transient
start_time = -1.0
end_time = 900.0
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.1
iteration_window = 5
optimal_iterations = 6
growth_factor = 1.1
cutback_factor = 0.8
timestep_limiting_function = 'time_step_limiting'
[]
dtmax = 20
[]
################################################################################
# A multiapp that projects data to a detailed mesh
################################################################################
[MultiApps]
[viz]
type = TransientMultiApp
input_files = '3d_SCM_TR.i'
execute_on = 'INITIAL TIMESTEP_END'
catch_up = true
[]
[]
[Transfers]
[subchannel_transfer]
type = SCMSolutionTransfer
to_multi_app = viz
variable = 'mdot SumWij P DP h T rho mu S'
[]
[pin_transfer]
type = SCMSolutionTransfer
transfer_type = pin
to_multi_app = viz
variable = 'Tpin q_prime'
[]
[]
(modules/stochastic_tools/test/tests/multiapps/batch_commandline_control/sub_input_variable.i)
var1 = 1
var2 = '${fparse var1 / 10}'
[StochasticTools]
[]
[Postprocessors]
[var1]
type = ConstantPostprocessor
value = ${var1}
execute_on = initial
[]
[var2]
type = ConstantPostprocessor
value = ${var2}
execute_on = initial
[]
[]
[UserObjects]
[check]
type = Terminator
expression = 'var1 < 1 | var2 > 1'
error_level = ERROR
[]
[]
(test/tests/parser/param_duplicate_check/input_b.i)
[Postprocessors]
[test_pp]
type = ConstantPostprocessor
value = 3.0
[]
[test_pp]
type = ConstantPostprocessor
value = 10.0
[]
[]
(modules/thermal_hydraulics/test/tests/actioncomponents/injection_production_wells/sub.i)
p_value = 1e5
T_value = 300
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[Postprocessors]
# inj1
[p_inj1]
type = ConstantPostprocessor
value = ${p_value}
[]
[T_inj1]
type = ConstantPostprocessor
value = ${T_value}
[]
[mass_rate_inj2]
type = Receiver
[]
[energy_rate_inj2]
type = Receiver
[]
# inj2
[p_inj2]
type = ConstantPostprocessor
value = ${p_value}
[]
[T_inj2]
type = ConstantPostprocessor
value = ${T_value}
[]
[mass_rate_inj1]
type = Receiver
[]
[energy_rate_inj1]
type = Receiver
[]
# pro1
[p_pro1]
type = ConstantPostprocessor
value = ${p_value}
[]
[T_pro1]
type = ConstantPostprocessor
value = ${T_value}
[]
[mass_rate_pro2]
type = Receiver
[]
[energy_rate_pro2]
type = Receiver
[]
# pro2
[p_pro2]
type = ConstantPostprocessor
value = ${p_value}
[]
[T_pro2]
type = ConstantPostprocessor
value = ${T_value}
[]
[mass_rate_pro1]
type = Receiver
[]
[energy_rate_pro1]
type = Receiver
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
dt = 1
[]
(test/tests/chaincontrols/set_value_chain_control/set_real_value_chain_control.i)
# Tests SetRealValueChainControl
#
# The following test function is used:
# f(t) = t + 5
# Note controls execute BEFORE post-processors, except for INITIAL, so here
# the initial PP value is incorrect, but the others are correct:
# INITIAL:
# test_pp <- test_pp:value = 0
# get_fn_ctrl:value <- f(0) = 5
# set_value_ctrl: test_pp:value <- get_fn_ctrl:value = 5
# TIMESTEP_END (t = 1):
# get_fn_ctrl:value <- f(1) = 6
# set_value_ctrl: test_pp:value <- get_fn_ctrl:value = 6
# test_pp <- test_pp:value = 6
!include base.i
[ChainControls]
[get_fn_ctrl]
type = GetFunctionValueChainControl
function = test_fn
point = '1 0 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[set_value_ctrl]
type = SetRealValueChainControl
parameter = Postprocessors/test_pp/value
value = get_fn_ctrl:value
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Postprocessors]
[test_pp]
type = ConstantPostprocessor
value = 0
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
(test/tests/functors/get_functor/get_functor.i)
[GlobalParams]
execute_on = 'INITIAL'
[]
[Mesh]
type = GeneratedMesh
dim = 1
nx = 5
[]
[AuxVariables]
[testvar]
[]
[testppdot]
family = MONOMIAL
order = CONSTANT
[]
[testppdiv]
[]
[]
[AuxKernels]
[testvar_auxkern]
type = FunctionAux
variable = testvar
function = testvar_fn
execute_on = 'INITIAL'
[]
[testppdot_auxkern]
type = TimeDerivativeAux
variable = testppdot
functor = testpp
[]
[testppdiv_auxkern]
type = DivergenceAux
variable = testppdiv
u = testpp
v = testpp
w = testpp
[]
[]
[FunctorMaterials]
[testfmat]
type = GenericFunctorMaterial
prop_names = 'testfmprop'
prop_values = 'testfmat_fn'
[]
[]
[Functions]
[testvar_fn]
type = ParsedFunction
expression = '10*x'
[]
[testfmat_fn]
type = ParsedFunction
expression = '50*x'
[]
[testfn]
type = ParsedFunction
expression = '25*x'
[]
[]
[Postprocessors]
[testpp]
type = ConstantPostprocessor
value = 2
[]
[get_var]
type = ElementIntegralFunctorPostprocessor
functor = testvar
[]
[get_fn]
type = ElementExtremeFunctorValue
functor = testfn
value_type = max
[]
[get_fmprop]
type = ElementExtremeFunctorValue
functor = testfmprop
value_type = max
[]
[get_pp]
type = ElementExtremeFunctorValue
functor = testpp
value_type = max
execution_order_group = 1
[]
[get_ppdiv]
type = ElementAverageValue
variable = testppdiv
[]
[get_ppdot]
type = ElementAverageValue
variable = testppdot
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(test/tests/materials/torchscript_material/test.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 10
[]
[]
[UserObjects]
[my_net]
type = TorchScriptUserObject
filename = "my_net.pt"
load_during_construction = true
execute_on = INITIAL
[]
[]
[Materials]
[net_material]
type = TorchScriptMaterial
prop_names = diff_coeff
input_names = 'pp1 pp2 pp3'
torch_script_userobject = my_net
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = MatDiffusion
diffusivity = diff_coeff
variable = u
[]
[source]
type = BodyForce
value = 50
variable = u
[]
[]
[BCs]
[dir_left]
type = DirichletBC
value = 10
boundary = left
variable = u
[]
[]
[Postprocessors]
[pp1]
type = ConstantPostprocessor
value = 0
[]
[pp2]
type = ConstantPostprocessor
value = 0.1
[]
[pp3]
type = ConstantPostprocessor
value = 0.2
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
[exo]
type = Exodus
output_material_properties = true
[]
[]
(test/tests/postprocessors/parsed_postprocessor/parsed_pp_control.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Postprocessors]
# A controllable constant Real; used by the ParsedPostprocessor
[./c]
type = ConstantPostprocessor
value = 1.0
[../]
# ParsedPostprocessor whose expression is now controllable.
# It uses the constant postprocessor 'c' and time 't'.
[./parsed]
type = ParsedPostprocessor
expression = 'c + t'
pp_names = 'c'
use_t = true
[../]
[]
[Controls/web_server]
type = WebServerControl
execute_on = 'initial timestep_begin'
initial_client_timeout = 5
client_timeout = 5
[]
[Executioner]
type = Transient
num_steps = 2
dt = 1.0
nl_abs_tol = 1e-8
solve_type = PJFNK
[]
[Outputs]
csv = true
execute_on = 'timestep_end'
[]
(test/tests/postprocessors/constant/receiver.i)
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 1
[]
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Transient
num_steps = 3
dt = 1
[]
[Controls]
[func_control]
type = RealFunctionControl
parameter = 'Postprocessors/recv/value'
function = 'val'
execute_on = 'timestep_begin'
[]
[]
[Functions]
[val]
type = ParsedFunction
expression = '1 + 2*t'
[]
[]
[Postprocessors]
[recv]
type = ConstantPostprocessor
[]
[]
[Outputs]
csv = true
[]