- expressionfunction expression
C++ Type:FunctionExpression
Unit:(no unit assumed)
Controllable:No
Description:function expression
 
ParsedPostprocessor
Computes a parsed expression with post-processors
The "expression" to parse may only include other postprocessors, the time variable and constants from the input file. The expression may use post-processor names directly, or the user may specify "pp_symbols" to associate a symbol for each of the post-processors in "pp_names" to use in the expression.
Derivatives and integrals are not natively supported by the parsing operation, unless the postprocessors in the parsed expression are already the derivatives / integrals of interest.
Example Input File Syntax
In this test input file, we compute various quantities using ParsedPostprocessors. First, we look at the ratio of two postprocessors:
[Postprocessors<<<{"href": "../../syntax/Postprocessors/index.html"}>>>]
  [parsed]
    type = ParsedPostprocessor<<<{"description": "Computes a parsed expression with post-processors", "href": "ParsedPostprocessor.html"}>>>
    expression<<<{"description": "function expression"}>>> = 'L2_norm / L1_norm'
    pp_names<<<{"description": "Post-processors arguments"}>>> = 'L2_norm L1_norm'
  []
[](test/tests/postprocessors/parsed_postprocessor/parsed_pp.i)Then we add a time dependence to the postprocessor result:
[Postprocessors<<<{"href": "../../syntax/Postprocessors/index.html"}>>>]
  [parsed_with_t]
    type = ParsedPostprocessor<<<{"description": "Computes a parsed expression with post-processors", "href": "ParsedPostprocessor.html"}>>>
    expression<<<{"description": "function expression"}>>> = 'L2_norm + L1_norm + t'
    pp_names<<<{"description": "Post-processors arguments"}>>> = 'L2_norm L1_norm'
    use_t<<<{"description": "Make time (t) variable available in the function expression."}>>> = true
  []
[](test/tests/postprocessors/parsed_postprocessor/parsed_pp.i)And finally we introduce constants from the input file in the parsed expression:
[Postprocessors<<<{"href": "../../syntax/Postprocessors/index.html"}>>>]
  [parsed_with_constants]
    type = ParsedPostprocessor<<<{"description": "Computes a parsed expression with post-processors", "href": "ParsedPostprocessor.html"}>>>
    expression<<<{"description": "function expression"}>>> = 'L2_norm + 3*L1_norm + mu'
    pp_names<<<{"description": "Post-processors arguments"}>>> = 'L2_norm L1_norm'
    constant_names<<<{"description": "Vector of constants used in the parsed function (use this for kB etc.)"}>>> = 'mu'
    constant_expressions<<<{"description": "Vector of values for the constants in constant_names (can be an FParser expression)"}>>> = '4'
  []
[](test/tests/postprocessors/parsed_postprocessor/parsed_pp.i)Input Parameters
- constant_expressionsVector of values for the constants in constant_names (can be an FParser expression)
C++ Type:std::vector<std::string>
Controllable:No
Description:Vector of values for the constants in constant_names (can be an FParser expression)
 - constant_namesVector of constants used in the parsed function (use this for kB etc.)
C++ Type:std::vector<std::string>
Controllable:No
Description:Vector of constants used in the parsed function (use this for kB etc.)
 - epsilon0Fuzzy comparison tolerance
Default:0
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Fuzzy comparison tolerance
 - pp_namesPost-processors arguments
C++ Type:std::vector<PostprocessorName>
Unit:(no unit assumed)
Controllable:No
Description:Post-processors arguments
 - pp_symbolsSymbol associated with each post-processor argument
C++ Type:std::vector<std::string>
Controllable:No
Description:Symbol associated with each post-processor argument
 - use_tFalseMake time (t) variable available in the function expression.
Default:False
C++ Type:bool
Controllable:No
Description:Make time (t) variable available in the function expression.
 
Optional 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, 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
- disable_fpoptimizerFalseDisable the function parser algebraic optimizer
Default:False
C++ Type:bool
Controllable:No
Description:Disable the function parser algebraic optimizer
 - enable_ad_cacheTrueEnable caching of function derivatives for faster startup time
Default:True
C++ Type:bool
Controllable:No
Description:Enable caching of function derivatives for faster startup time
 - enable_auto_optimizeTrueEnable automatic immediate optimization of derivatives
Default:True
C++ Type:bool
Controllable:No
Description:Enable automatic immediate optimization of derivatives
 - enable_jitTrueEnable just-in-time compilation of function expressions for faster evaluation
Default:True
C++ Type:bool
Controllable:No
Description:Enable just-in-time compilation of function expressions for faster evaluation
 - evalerror_behaviornanWhat to do if evaluation error occurs. Options are to pass a nan, pass a nan with a warning, throw a error, or throw an exception
Default:nan
C++ Type:MooseEnum
Options:nan, nan_warning, error, exception
Controllable:No
Description:What to do if evaluation error occurs. Options are to pass a nan, pass a nan with a warning, throw a error, or throw an exception
 
Parsed Expression 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
- (modules/heat_transfer/test/tests/gap_heat_transfer_mortar/large_gap_heat_transfer_test_cylinder_mortar_error.i)
 - (modules/thermal_hydraulics/tutorials/single_phase_flow/05_secondary_side.i)
 - (modules/thermal_hydraulics/test/tests/components/hs_boundary_external_app_heat_flux/main.i)
 - (modules/navier_stokes/test/tests/postprocessors/pressure_drop/drop_insfv.i)
 - (test/tests/restep/transient.i)
 - (test/tests/tag/old_eigen_tag.i)
 - (modules/thermal_hydraulics/test/tests/problems/brayton_cycle/closed_brayton_cycle.i)
 - (modules/optimization/test/tests/executioners/constrained/inequality/forward_and_adjoint.i)
 - (modules/porous_flow/test/tests/sinks/s02.i)
 - (modules/combined/examples/optimization/multi-load/square_subapp_one.i)
 - (modules/stochastic_tools/examples/optimization/annulus_shape/annulus_displaced_mesh.i)
 - (modules/combined/examples/optimization/multi-load/single_subapp_one.i)
 - (modules/heat_transfer/test/tests/fvbcs/fv_marshak_bc/rad_istothermal_medium_2d.i)
 - (test/tests/coord_type/coord_type_rz_general.i)
 - (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/hydraulic-separators/separator-no-jump.i)
 - (test/tests/auxkernels/divergence_aux/test_fv.i)
 - (modules/heat_transfer/test/tests/view_factors/view_factor_3d_non_planar_face.i)
 - (modules/subchannel/validation/EBR-II/XX09_SCM_TR45R.i)
 - (modules/combined/test/tests/optimization/compliance_sensitivity/three_materials_thermal.i)
 - (test/tests/postprocessors/element_extreme_functor_value/extreme_abs_value.i)
 - (modules/porous_flow/test/tests/sinks/s04.i)
 - (modules/navier_stokes/examples/laser-welding/2d-fv.i)
 - (modules/navier_stokes/examples/flow-over-circle/postprocessors.i)
 - (modules/solid_mechanics/test/tests/strain_adjusted_density/exact_2drz.i)
 - (test/tests/postprocessors/side_average_value/side_average_functor_test.i)
 - (modules/heat_transfer/test/tests/gap_heat_transfer_balance/large_gap_heat_transfer_test_cylinder.i)
 - (modules/electromagnetics/test/tests/kernels/vector_helmholtz/microwave_heating.i)
 - (modules/porous_flow/test/tests/sinks/s06.i)
 - (modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/vector_azim_magnetic_time_deriv.i)
 - (modules/combined/examples/optimization/multi-load/single_main.i)
 - (modules/porous_flow/test/tests/sinks/s07.i)
 - (modules/thermal_hydraulics/test/tests/components/hs_coupler_2d2d_radiation/energy_conservation.i)
 - (modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/lid-driven-fsp.i)
 - (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/2d-rc-no-slip.i)
 - (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/formloss/formloss_multiple.i)
 - (modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_conduction_current.i)
 - (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/formloss/formloss_single.i)
 - (modules/thermal_hydraulics/tutorials/single_phase_flow/03_upper_loop.i)
 - (modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/lid-driven.i)
 - (test/tests/convergence/reference_residual_convergence/abs_ref_acceptable.i)
 - (modules/combined/examples/optimization/multi-load/single_subapp_two.i)
 - (test/tests/problems/reference_residual_problem/ad_abs_ref.i)
 - (modules/navier_stokes/test/tests/finite_volume/wcns/materials/enthalpy_computation.i)
 - (modules/navier_stokes/test/tests/finite_volume/wcns/materials/2d-steady-wall-balance.i)
 - (modules/thermal_hydraulics/tutorials/single_phase_flow/01_flow_channel.i)
 - (modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/scalar_azim_magnetic_time_deriv.i)
 - (test/tests/problems/reference_residual_problem/abs_ref.i)
 - (modules/porous_flow/test/tests/sinks/s08.i)
 - (modules/navier_stokes/test/tests/finite_element/ins/cg-dg-hybrid/lid-driven/hybrid-cg-dg.i)
 - (modules/solid_mechanics/test/tests/strain_adjusted_density/exact_rspherical.i)
 - (modules/thermal_hydraulics/tutorials/single_phase_flow/04_loop.i)
 - (modules/navier_stokes/test/tests/finite_element/ins/energy-conservation/q2q1.i)
 - (modules/combined/test/tests/optimization/thermal_sensitivity/2d_root.i)
 - (modules/subchannel/validation/EBR-II/XX09_SCM_TR17.i)
 - (modules/porous_flow/test/tests/sinks/s05.i)
 - (modules/combined/test/tests/subchannel_thm_coupling/subchannel.i)
 - (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_interface_area_model/pressure_driven_growth_transient.i)
 - (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/channel-drift-flux-physics.i)
 - (modules/heat_transfer/test/tests/gap_heat_transfer_mortar/large_gap_heat_transfer_test_sphere_mortar_error.i)
 - (modules/thermal_hydraulics/test/tests/components/simple_turbine_1phase/phy.conservation.i)
 - (modules/combined/examples/optimization/helmholtz_multimat_strip.i)
 - (test/tests/postprocessors/postprocessor_restore/lag_time.i)
 - (modules/solid_mechanics/test/tests/rom_stress_update/nonad_verification.i)
 - (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/channel-advection-slip-physics.i)
 - (test/tests/convergence/reference_residual_convergence/no_ref.i)
 - (test/tests/constraints/equal_value_embedded_constraint/two_var_embedded_constraint.i)
 - (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/1d-scalar/channel-transient-physics.i)
 - (modules/combined/examples/optimization/thermomechanical/structural_sub.i)
 - (modules/thermal_hydraulics/tutorials/single_phase_flow/06_custom_closures.i)
 - (modules/combined/test/tests/optimization/compliance_sensitivity/paper_three_materials_test.i)
 - (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/segregated/channel-drift-flux-physics.i)
 - (modules/electromagnetics/test/tests/auxkernels/heating/aux_current_source_heating.i)
 - (modules/combined/test/tests/subchannel_thm_coupling/THM_SCM_coupling_pump.i)
 - (modules/heat_transfer/test/tests/gap_heat_transfer_mortar/gap_heat_transfer_sphere3D.i)
 - (modules/navier_stokes/test/tests/finite_element/ins/energy-conservation/q1q1.i)
 - (modules/thermal_hydraulics/test/tests/problems/brayton_cycle/open_brayton_cycle.i)
 - (modules/heat_transfer/test/tests/fvbcs/fv_marshak_bc/rad_istothermal_medium_1d.i)
 - (test/tests/convergence/reference_residual_convergence/abs_ref.i)
 - (modules/optimization/test/tests/vectorpostprocessors/element_reaction_inner_product/element_reaction_inner_product.i)
 - (modules/combined/examples/optimization/multi-load/square_subapp_two.i)
 - (modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/sc-lid-driven.i)
 - (test/tests/misc/rename-parameters/rename-postprocessor.i)
 - (modules/heat_transfer/test/tests/gap_heat_transfer_mortar/large_gap_heat_transfer_test_sphere_mortar.i)
 - (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/channel-drift-flux-transient.i)
 - (test/tests/problems/reference_residual_problem/abs_ref_acceptable.i)
 - (modules/thermal_hydraulics/tutorials/single_phase_flow/02_core.i)
 - (modules/combined/test/tests/optimization/compliance_sensitivity/thermal_test.i)
 - (modules/heat_transfer/test/tests/gap_heat_transfer_mortar/large_gap_heat_transfer_test_cylinder_mortar.i)
 - (modules/solid_mechanics/test/tests/lagrangian/cartesian/total/rates/shear.i)
 - (test/tests/problems/reference_residual_problem/no_ref.i)
 - (modules/combined/examples/optimization/helmholtz_multimat_nostrip.i)
 - (modules/stochastic_tools/test/tests/auxkernels/surrogate_aux/model.i)
 - (modules/navier_stokes/test/tests/finite_volume/wcns/materials/1d_test_cpT.i)
 - (modules/heat_transfer/test/tests/gap_heat_transfer_mortar/gap_heat_transfer_3D.i)
 - (modules/heat_transfer/test/tests/gap_heat_transfer_radiation/cylinder.i)
 - (modules/heat_transfer/test/tests/gap_heat_transfer_mortar/large_gap_heat_transfer_test_cylinder.i)
 - (modules/heat_transfer/test/tests/gap_heat_transfer_balance/large_gap_heat_transfer_test_sphere.i)
 - (modules/heat_transfer/test/tests/gap_heat_transfer_mortar/gap_heat_transfer_3D_mortar.i)
 - (modules/heat_transfer/test/tests/gap_heat_transfer_mortar/gap_heat_transfer_sphere3D_mortar.i)
 - (modules/combined/test/tests/electromagnetic_joule_heating/microwave_heating.i)
 - (modules/combined/examples/optimization/thermomechanical/thermomechanical_main.i)
 - (modules/navier_stokes/test/tests/postprocessors/pressure_drop/drop_insad.i)
 - (modules/solid_mechanics/test/tests/rom_stress_update/ad_verification.i)
 - (modules/solid_mechanics/test/tests/strain_adjusted_density/exact_3D.i)
 - (modules/heat_transfer/test/tests/gap_heat_transfer_mortar/large_gap_heat_transfer_test_rz_cylinder_mortar.i)
 - (modules/combined/examples/optimization/multi-load/square_main.i)
 - (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/segregated/channel-drift-flux.i)
 - (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_interface_area_model/pressure_driven_growth.i)
 - (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/1d-scalar/channel-conservation-physics.i)
 - (modules/thermal_hydraulics/test/tests/problems/brayton_cycle/recuperated_brayton_cycle.i)
 - (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/channel-drift-flux-w-interface-area.i)
 - (modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_ADmaterial_wave_reaction.i)
 - (modules/combined/examples/optimization/thermomechanical/thermal_sub.i)
 - (modules/heat_transfer/test/tests/gap_heat_transfer_radiation/sphere.i)
 - (modules/heat_transfer/test/tests/gap_heat_transfer_mortar/large_gap_heat_transfer_test_sphere.i)
 - (modules/subchannel/validation/ORNL_19_pin/ORNL_19.i)
 - (modules/combined/test/tests/subchannel_thm_coupling/THM_SCM_coupling.i)
 - (modules/xfem/test/tests/mesh_cut_2D_fracture/inclined_center_crack.i)
 - (modules/combined/test/tests/electromagnetic_joule_heating/aux_microwave_heating.i)
 - (test/tests/postprocessors/parsed_postprocessor/parsed_pp.i)
 - (test/tests/convergence/reference_residual_convergence/ad_abs_ref.i)
 - (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/channel-drift-flux.i)
 - (modules/heat_transfer/test/tests/gap_heat_transfer_mortar/large_gap_heat_transfer_test_rz_cylinder.i)
 - (test/tests/auxkernels/divergence_aux/test_fe.i)
 - (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/channel-advection-slip.i)
 - (modules/optimization/test/tests/executioners/constrained/shape_optimization/forward.i)
 - (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/hydraulic-separators/separator-jump.i)
 - (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_interface_area_model/turbulent_driven_growth.i)
 - (modules/electromagnetics/test/tests/auxkernels/heating/aux_microwave_heating.i)
 - (modules/combined/examples/optimization/three_materials.i)
 - (modules/heat_transfer/test/tests/gap_heat_transfer_balance/large_gap_heat_transfer_test_rz_cylinder.i)
 
expression
C++ Type:FunctionExpression
Unit:(no unit assumed)
Controllable:No
Description:function expression
pp_symbols
C++ Type:std::vector<std::string>
Controllable:No
Description:Symbol associated with each post-processor argument
pp_names
C++ Type:std::vector<PostprocessorName>
Unit:(no unit assumed)
Controllable:No
Description:Post-processors arguments
(test/tests/postprocessors/parsed_postprocessor/parsed_pp.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
  [../]
[]
[Postprocessors]
  [./L2_norm]
    type = ElementL2Norm
    variable = u
  [../]
  [./L2:norm]
    type = ElementL2Norm
    variable = u
  [../]
  [L1_norm]
    type = ElementL1Error
    function = 0
    variable = u
  []
  [parsed]
    type = ParsedPostprocessor
    expression = 'L2_norm / L1_norm'
    pp_names = 'L2_norm L1_norm'
  []
  [parsed_with_t]
    type = ParsedPostprocessor
    expression = 'L2_norm + L1_norm + t'
    pp_names = 'L2_norm L1_norm'
    use_t = true
  []
  [parsed_with_constants]
    type = ParsedPostprocessor
    expression = 'L2_norm + 3*L1_norm + mu'
    pp_names = 'L2_norm L1_norm'
    constant_names = 'mu'
    constant_expressions = '4'
  []
[]
[Executioner]
  type = Transient
  num_steps = 4
  nl_abs_tol = 1e-8
  solve_type = PJFNK
  petsc_options_iname = '-pc_type -pc_hypre_type'
  petsc_options_value = 'hypre boomeramg'
  line_search = 'none'
[]
[Outputs]
  csv = true
[]
(test/tests/postprocessors/parsed_postprocessor/parsed_pp.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
  [../]
[]
[Postprocessors]
  [./L2_norm]
    type = ElementL2Norm
    variable = u
  [../]
  [./L2:norm]
    type = ElementL2Norm
    variable = u
  [../]
  [L1_norm]
    type = ElementL1Error
    function = 0
    variable = u
  []
  [parsed]
    type = ParsedPostprocessor
    expression = 'L2_norm / L1_norm'
    pp_names = 'L2_norm L1_norm'
  []
  [parsed_with_t]
    type = ParsedPostprocessor
    expression = 'L2_norm + L1_norm + t'
    pp_names = 'L2_norm L1_norm'
    use_t = true
  []
  [parsed_with_constants]
    type = ParsedPostprocessor
    expression = 'L2_norm + 3*L1_norm + mu'
    pp_names = 'L2_norm L1_norm'
    constant_names = 'mu'
    constant_expressions = '4'
  []
[]
[Executioner]
  type = Transient
  num_steps = 4
  nl_abs_tol = 1e-8
  solve_type = PJFNK
  petsc_options_iname = '-pc_type -pc_hypre_type'
  petsc_options_value = 'hypre boomeramg'
  line_search = 'none'
[]
[Outputs]
  csv = true
[]
(test/tests/postprocessors/parsed_postprocessor/parsed_pp.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
  [../]
[]
[Postprocessors]
  [./L2_norm]
    type = ElementL2Norm
    variable = u
  [../]
  [./L2:norm]
    type = ElementL2Norm
    variable = u
  [../]
  [L1_norm]
    type = ElementL1Error
    function = 0
    variable = u
  []
  [parsed]
    type = ParsedPostprocessor
    expression = 'L2_norm / L1_norm'
    pp_names = 'L2_norm L1_norm'
  []
  [parsed_with_t]
    type = ParsedPostprocessor
    expression = 'L2_norm + L1_norm + t'
    pp_names = 'L2_norm L1_norm'
    use_t = true
  []
  [parsed_with_constants]
    type = ParsedPostprocessor
    expression = 'L2_norm + 3*L1_norm + mu'
    pp_names = 'L2_norm L1_norm'
    constant_names = 'mu'
    constant_expressions = '4'
  []
[]
[Executioner]
  type = Transient
  num_steps = 4
  nl_abs_tol = 1e-8
  solve_type = PJFNK
  petsc_options_iname = '-pc_type -pc_hypre_type'
  petsc_options_value = 'hypre boomeramg'
  line_search = 'none'
[]
[Outputs]
  csv = true
[]
(modules/heat_transfer/test/tests/gap_heat_transfer_mortar/large_gap_heat_transfer_test_cylinder_mortar_error.i)
rpv_core_gap_size = 0.15
core_outer_radius = 2
rpv_inner_radius = ${fparse 2 + rpv_core_gap_size}
rpv_outer_radius = ${fparse 2.5 + rpv_core_gap_size}
rpv_outer_htc = 10 # W/m^2/K
rpv_outer_Tinf = 300 # K
core_blocks = '1'
rpv_blocks = '3'
[Mesh]
  [core_gap_rpv]
    type = ConcentricCircleMeshGenerator
    num_sectors = 10
    radii = '${core_outer_radius} ${rpv_inner_radius} ${rpv_outer_radius}'
    rings = '2 1 2'
    has_outer_square = false
    preserve_volumes = true
    portion = full
  []
  [rename_core_bdy]
    type = SideSetsBetweenSubdomainsGenerator
    input = core_gap_rpv
    primary_block = 1
    paired_block = 2
    new_boundary = 'core_outer'
  []
  [rename_inner_rpv_bdy]
    type = SideSetsBetweenSubdomainsGenerator
    input = rename_core_bdy
    primary_block = 3
    paired_block = 2
    new_boundary = 'rpv_inner'
  []
  [2d_mesh]
    type = BlockDeletionGenerator
    input = rename_inner_rpv_bdy
    block = 2
  []
  [secondary]
    type = LowerDBlockFromSidesetGenerator
    sidesets = 'rpv_inner'
    new_block_id = 10001
    new_block_name = 'secondary_lower'
    input = 2d_mesh
  []
  [primary]
    type = LowerDBlockFromSidesetGenerator
    sidesets = 'core_outer'
    new_block_id = 10000
    new_block_name = 'primary_lower'
    input = secondary
  []
  allow_renumbering = false
[]
[Variables]
  [Tsolid]
    initial_condition = 500
  []
  [lm]
    order = FIRST
    family = LAGRANGE
    block = 'secondary_lower'
  []
[]
[Kernels]
  [heat_source]
    type = CoupledForce
    variable = Tsolid
    block = '${core_blocks}'
    v = power_density
  []
  [heat_conduction]
    type = HeatConduction
    variable = Tsolid
  []
[]
[BCs]
  [RPV_out_BC] # k \nabla T = h (T- T_inf) at RPV outer boundary
    type = ConvectiveFluxFunction # (Robin BC)
    variable = Tsolid
    boundary = 'outer' # outer RPV
    coefficient = ${rpv_outer_htc}
    T_infinity = ${rpv_outer_Tinf}
  []
[]
[UserObjects]
  [radiation]
    type = GapFluxModelRadiation
    temperature = Tsolid
    boundary = 'rpv_inner'
    primary_emissivity = 0.8
    secondary_emissivity = 0.8
  []
  [conduction]
    type = GapFluxModelConduction
    temperature = Tsolid
    boundary = 'rpv_inner'
    gap_conductivity = 0.1
  []
[]
[Constraints]
  [ced]
    type = ModularGapConductanceConstraint
    variable = lm
    secondary_variable = Tsolid
    primary_boundary = 'core_outer'
    primary_subdomain = 10000
    secondary_boundary = 'rpv_inner'
    secondary_subdomain = 10001
    gap_flux_models = 'radiation conduction'
    gap_geometry_type = 'CYLINDER'
    cylinder_axis_point_2 = '0 0 5'
  []
[]
[AuxVariables]
  [power_density]
    block = '${core_blocks}'
    initial_condition = 50e3
  []
[]
[Materials]
  [simple_mat]
    type = HeatConductionMaterial
    thermal_conductivity = 34.6 # W/m/K
  []
[]
[Postprocessors]
  [Tcore_avg]
    type = ElementAverageValue
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Tcore_max]
    type = ElementExtremeValue
    value_type = max
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Tcore_min]
    type = ElementExtremeValue
    value_type = min
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Trpv_avg]
    type = ElementAverageValue
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [Trpv_max]
    type = ElementExtremeValue
    value_type = max
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [Trpv_min]
    type = ElementExtremeValue
    value_type = min
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [ptot]
    type = ElementIntegralVariablePostprocessor
    variable = power_density
    block = '${core_blocks}'
  []
  [rpv_convective_out]
    type = ConvectiveHeatTransferSideIntegral
    T_solid = Tsolid
    boundary = 'outer' # outer RVP
    T_fluid = ${rpv_outer_Tinf}
    htc = ${rpv_outer_htc}
  []
  [heat_balance] # should be equal to 0 upon convergence
    type = ParsedPostprocessor
    expression = '(rpv_convective_out - ptot) / ptot'
    pp_names = 'rpv_convective_out ptot'
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[VectorPostprocessors]
  [NodalTemperature]
    type = NodalValueSampler
    sort_by = id
    boundary = 'rpv_inner core_outer'
    variable = 'Tsolid'
  []
[]
[Executioner]
  type = Steady
  petsc_options = '-snes_converged_reason -pc_svd_monitor'
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package -mat_mffd_err -pc_factor_shift_type '
                        '-pc_factor_shift_amount'
  petsc_options_value = ' lu       superlu_dist                  1e-5          NONZERO               '
                        '1e-15'
  snesmf_reuse_base = false
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-10
  l_max_its = 100
  line_search = none
[]
[Outputs]
  exodus = false
  csv = true
[]
(modules/thermal_hydraulics/tutorials/single_phase_flow/05_secondary_side.i)
T_in = 300. # K
m_dot_in = 1e-2 # kg/s
press = 10e5 # Pa
# core parameters
core_length = 1. # m
core_n_elems = 25
core_dia = '${units 2. cm -> m}'
core_pitch = '${units 8.7 cm -> m}'
A_core = '${fparse core_pitch^2 - 0.25 *pi * core_dia^2}'
P_wet_core = '${fparse 4*core_pitch + pi * core_dia}'
Dh_core = '${fparse 4 * A_core / P_wet_core}'
# pipe parameters
pipe_dia = '${units 10. cm -> m}'
A_pipe = '${fparse 0.25 * pi * pipe_dia^2}'
tot_power = 2000 # W
# heat exchanger parameters
hx_dia_inner = '${units 12. cm -> m}'
hx_wall_thickness = '${units 5. mm -> m}'
hx_dia_outer = '${units 50. cm -> m}'
hx_radius_wall = '${fparse hx_dia_inner / 2. + hx_wall_thickness}'
hx_length = 1.5 # m
hx_n_elems = 25
m_dot_sec_in = 1. # kg/s
[GlobalParams]
  initial_p = ${press}
  initial_vel = 0.0001
  initial_T = ${T_in}
  initial_vel_x = 0
  initial_vel_y = 0
  initial_vel_z = 0
  gravity_vector = '0 0 0'
  rdg_slope_reconstruction = minmod
  scaling_factor_1phase = '1 1e-2 1e-4'
  scaling_factor_rhoV = 1
  scaling_factor_rhouV = 1e-2
  scaling_factor_rhovV = 1e-2
  scaling_factor_rhowV = 1e-2
  scaling_factor_rhoEV = 1e-4
  closures = thm_closures
  fp = he
[]
[Functions]
  [m_dot_sec_fn]
    type = PiecewiseLinear
    xy_data = '
      0    0
      10 ${m_dot_sec_in}'
  []
[]
[FluidProperties]
  [he]
    type = IdealGasFluidProperties
    molar_mass = 4e-3
    gamma = 1.67
    k = 0.2556
    mu = 3.22639e-5
  []
  [water]
    type = StiffenedGasFluidProperties
    gamma = 2.35
    cv = 1816.0
    q = -1.167e6
    p_inf = 1.0e9
    q_prime = 0
  []
[]
[Closures]
  [thm_closures]
    type = Closures1PhaseTHM
  []
[]
[SolidProperties]
  [steel]
    type = ThermalFunctionSolidProperties
    rho = 8050
    k = 45
    cp = 466
  []
[]
[Components]
  [total_power]
    type = TotalPower
    power = ${tot_power}
  []
  [up_pipe_1]
    type = FlowChannel1Phase
    position = '0 0 0'
    orientation = '0 0 1'
    length = 0.5
    n_elems = 15
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct1]
    type = JunctionParallelChannels1Phase
    position = '0 0 0.5'
    connections = 'up_pipe_1:out core_chan:in'
    volume = 1e-5
  []
  [core_chan]
    type = FlowChannel1Phase
    position = '0 0 0.5'
    orientation = '0 0 1'
    length = ${core_length}
    n_elems = ${core_n_elems}
    roughness = .0001
    A = ${A_core}
    D_h = ${Dh_core}
  []
  [core_hs]
    type = HeatStructureCylindrical
    position = '0 0 0.5'
    orientation = '0 0 1'
    length = ${core_length}
    n_elems = ${core_n_elems}
    names = 'block'
    widths = '${fparse core_dia / 2.}'
    solid_properties = 'steel'
    solid_properties_T_ref = '300'
    n_part_elems = 3
  []
  [core_heating]
    type = HeatSourceFromTotalPower
    hs = core_hs
    regions = block
    power = total_power
  []
  [core_ht]
    type = HeatTransferFromHeatStructure1Phase
    flow_channel = core_chan
    hs = core_hs
    hs_side = outer
    P_hf = '${fparse pi * core_dia}'
  []
  [jct2]
    type = JunctionParallelChannels1Phase
    position = '0 0 1.5'
    connections = 'core_chan:out up_pipe_2:in'
    volume = 1e-5
  []
  [up_pipe_2]
    type = FlowChannel1Phase
    position = '0 0 1.5'
    orientation = '0 0 1'
    length = 0.5
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct3]
    type = JunctionOneToOne1Phase
    connections = 'up_pipe_2:out top_pipe_1:in'
  []
  [top_pipe_1]
    type = FlowChannel1Phase
    position = '0 0 2'
    orientation = '1 0 0'
    length = 0.5
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [top_pipe_2]
    type = FlowChannel1Phase
    position = '0.5 0 2'
    orientation = '1 0 0'
    length = 0.5
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct4]
    type = VolumeJunction1Phase
    position = '0.5 0 2'
    volume = 1e-5
    connections = 'top_pipe_1:out top_pipe_2:in press_pipe:in'
  []
  [press_pipe]
    type = FlowChannel1Phase
    position = '0.5 0 2'
    orientation = '0 1 0'
    length = 0.2
    n_elems = 5
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [pressurizer]
    type = InletStagnationPressureTemperature1Phase
    p0 = ${press}
    T0 = ${T_in}
    input = press_pipe:out
  []
  [jct5]
    type = JunctionOneToOne1Phase
    connections = 'top_pipe_2:out down_pipe_1:in'
  []
  [down_pipe_1]
    type = FlowChannel1Phase
    position = '1 0 2'
    orientation = '0 0 -1'
    length = 0.25
    A = ${A_pipe}
    n_elems = 5
  []
  [jct6]
    type = JunctionParallelChannels1Phase
    position = '1 0 1.75'
    connections = 'down_pipe_1:out hx/pri:in'
    volume = 1e-5
  []
  [hx]
    [pri]
      type = FlowChannel1Phase
      position = '1 0 1.75'
      orientation = '0 0 -1'
      length = ${hx_length}
      n_elems = ${hx_n_elems}
      roughness = 1e-5
      A = '${fparse pi * hx_dia_inner * hx_dia_inner / 4.}'
      D_h = ${hx_dia_inner}
    []
    [ht_pri]
      type = HeatTransferFromHeatStructure1Phase
      hs = hx/wall
      hs_side = inner
      flow_channel = hx/pri
      P_hf = '${fparse pi * hx_dia_inner}'
    []
    [wall]
      type = HeatStructureCylindrical
      position = '1 0 1.75'
      orientation = '0 0 -1'
      length = ${hx_length}
      n_elems = ${hx_n_elems}
      widths = '${hx_wall_thickness}'
      n_part_elems = '3'
      solid_properties = 'steel'
      solid_properties_T_ref = '300'
      names = '0'
      inner_radius = '${fparse hx_dia_inner / 2.}'
    []
    [ht_sec]
      type = HeatTransferFromHeatStructure1Phase
      hs = hx/wall
      hs_side = outer
      flow_channel = hx/sec
      P_hf = '${fparse 2 * pi * hx_radius_wall}'
    []
    [sec]
      type = FlowChannel1Phase
      position = '${fparse 1 + hx_wall_thickness} 0 0.25'
      orientation = '0 0 1'
      length = ${hx_length}
      n_elems = ${hx_n_elems}
      A = '${fparse pi * (hx_dia_outer * hx_dia_outer / 4. - hx_radius_wall * hx_radius_wall)}'
      D_h = '${fparse hx_dia_outer - (2 * hx_radius_wall)}'
      fp = water
      initial_T = 300
    []
  []
  [jct7]
    type = JunctionParallelChannels1Phase
    position = '1 0 0.5'
    connections = 'hx/pri:out down_pipe_2:in'
    volume = 1e-5
  []
  [down_pipe_2]
    type = FlowChannel1Phase
    position = '1 0 0.25'
    orientation = '0 0 -1'
    length = 0.25
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct8]
    type = JunctionOneToOne1Phase
    connections = 'down_pipe_2:out bottom_1:in'
  []
  [bottom_1]
    type = FlowChannel1Phase
    position = '1 0 0'
    orientation = '-1 0 0'
    length = 0.5
    n_elems = 5
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [pump]
    type = Pump1Phase
    position = '0.5 0 0'
    connections = 'bottom_1:out bottom_2:in'
    volume = 1e-4
    A_ref = ${A_pipe}
    head = 0
  []
  [bottom_2]
    type = FlowChannel1Phase
    position = '0.5 0 0'
    orientation = '-1 0 0'
    length = 0.5
    n_elems = 5
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct9]
    type = JunctionOneToOne1Phase
    connections = 'bottom_2:out up_pipe_1:in'
  []
  [inlet_sec]
    type = InletMassFlowRateTemperature1Phase
    input = 'hx/sec:in'
    m_dot = 0
    T = 300
  []
  [outlet_sec]
    type = Outlet1Phase
    input = 'hx/sec:out'
    p = 1e5
  []
[]
[ControlLogic]
  [set_point]
    type = GetFunctionValueControl
    function = ${m_dot_in}
  []
  [pid]
    type = PIDControl
    initial_value = 0.0
    set_point = set_point:value
    input = m_dot_pump
    K_p = 1.
    K_i = 4.
    K_d = 0
  []
  [set_pump_head]
    type = SetComponentRealValueControl
    component = pump
    parameter = head
    value = pid:output
  []
  [m_dot_sec_inlet_ctrl]
    type = GetFunctionValueControl
    function = m_dot_sec_fn
  []
  [set_m_dot_sec_ctrl]
    type = SetComponentRealValueControl
    component = inlet_sec
    parameter = m_dot
    value = m_dot_sec_inlet_ctrl:value
  []
[]
[Postprocessors]
  [power_to_coolant]
    type = ADHeatRateConvection1Phase
    block = core_chan
    P_hf = '${fparse pi *core_dia}'
  []
  [m_dot_pump]
    type = ADFlowJunctionFlux1Phase
    boundary = core_chan:in
    connection_index = 1
    equation = mass
    junction = jct7
  []
  [core_T_out]
    type = SideAverageValue
    boundary = core_chan:out
    variable = T
  []
  [core_p_in]
    type = SideAverageValue
    boundary = core_chan:in
    variable = p
  []
  [core_p_out]
    type = SideAverageValue
    boundary = core_chan:out
    variable = p
  []
  [core_delta_p]
    type = ParsedPostprocessor
    pp_names = 'core_p_in core_p_out'
    expression = 'core_p_in - core_p_out'
  []
  [hx_pri_T_out]
    type = SideAverageValue
    boundary = hx/pri:out
    variable = T
  []
  [hx_sec_T_in]
    type = SideAverageValue
    boundary = inlet_sec
    variable = T
  []
  [hx_sec_T_out]
    type = SideAverageValue
    boundary = outlet_sec
    variable = T
  []
  [m_dot_sec]
    type = ADFlowBoundaryFlux1Phase
    boundary = inlet_sec
    equation = mass
  []
[]
[Preconditioning]
  [pc]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  start_time = 0
  [TimeStepper]
    type = IterationAdaptiveDT
    dt = 1
  []
  dtmax = 5
  end_time = 500
  line_search = basic
  solve_type = NEWTON
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 0
  nl_abs_tol = 1e-8
  nl_max_its = 25
[]
[Outputs]
  exodus = true
  [console]
    type = Console
    max_rows = 1
    outlier_variable_norms = false
  []
  print_linear_residuals = false
[]
(modules/thermal_hydraulics/test/tests/components/hs_boundary_external_app_heat_flux/main.i)
# Main input file.
#
# Run mesh.i first to produce a mesh file that this input uses:
#
#   thermal_hydraulics-opt -i mesh.i --mesh-only mesh.e
length = 5.0
n_elems_axial = 10
rho_name = density
cp_name = specific_heat
k_name = thermal_conductivity
rho = 8000.0
cp = 500.0
k = 15.0
T_initial = 500.0
power = 1000.0
[Mesh]
  type = FileMesh
  file = mesh.e
[]
[Variables]
  [T_solid]
  []
[]
[ICs]
  [T_ic]
    type = ConstantIC
    variable = T_solid
    value = ${T_initial}
  []
[]
[Kernels]
  [time_derivative]
    type = ADHeatConductionTimeDerivative
    variable = T_solid
    density_name = ${rho_name}
    specific_heat = ${cp_name}
  []
  [heat_conduction]
    type = ADHeatConduction
    variable = T_solid
    thermal_conductivity = ${k_name}
  []
[]
[BCs]
  [bc]
    type = FunctorNeumannBC
    variable = T_solid
    boundary = 'inner'
    functor = heat_flux_fn
    flux_is_inward = false
  []
[]
[Materials]
  [ad_constant_mat]
    type = ADGenericConstantMaterial
    prop_names = '${rho_name} ${cp_name} ${k_name}'
    prop_values = '${rho} ${cp} ${k}'
  []
[]
[Functions]
  [heat_flux_fn]
    type = ParsedFunction
    symbol_names = 'S'
    symbol_values = 'inner_surface_area'
    expression = '${power} / S'
  []
[]
[Postprocessors]
  [inner_surface_area]
    type = AreaPostprocessor
    boundary = 'inner'
    execute_on = 'INITIAL'
  []
  [inner_perimeter]
    type = ParsedPostprocessor
    pp_names = 'inner_surface_area'
    expression = 'inner_surface_area / ${length}'
    execute_on = 'INITIAL'
  []
[]
[MultiApps]
  [sub]
    type = TransientMultiApp
    app_type = ThermalHydraulicsApp
    input_files = 'sub.i'
    positions = '0 0 0'
    max_procs_per_app = 1
    output_in_position = true
    execute_on = 'TIMESTEP_END'
  []
[]
[UserObjects]
  [layered_average_heat_flux]
    type = NearestPointLayeredSideAverageFunctor
    direction = z
    points='0 0 0'
    num_layers = ${n_elems_axial}
    functor = heat_flux_fn
    boundary = 'inner'
    execute_on = 'TIMESTEP_END'
  []
[]
[Transfers]
  [heat_flux_transfer]
    type = MultiAppGeneralFieldUserObjectTransfer
    to_multi_app = sub
    source_user_object = layered_average_heat_flux
    variable = q_ext
    error_on_miss = true
  []
  [perimeter_transfer]
    type = MultiAppPostprocessorTransfer
    to_multi_app = sub
    from_postprocessor = inner_perimeter
    to_postprocessor = P_ext
  []
[]
[Preconditioning]
  [pc]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  scheme = bdf2
  dt = 10.0
  num_steps = 1
  abort_on_solve_fail = true
  solve_type = NEWTON
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-8
  nl_max_its = 10
  l_tol = 1e-3
  l_max_its = 10
[]
(modules/navier_stokes/test/tests/postprocessors/pressure_drop/drop_insfv.i)
mu=1
rho=1
advected_interp_method='average'
velocity_interp_method='rc'
[GlobalParams]
  rhie_chow_user_object = 'rc'
  advected_interp_method = ${advected_interp_method}
  velocity_interp_method = ${velocity_interp_method}
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = u
    v = v
    pressure = pressure
  []
[]
[Mesh]
  inactive = 'mesh internal_boundary_bot internal_boundary_top'
  [mesh]
    type = CartesianMeshGenerator
    dim = 2
    dx = '1'
    dy = '1 1 1'
    ix = '5'
    iy = '5 5 5'
    subdomain_id = '1
                    2
                    3'
  []
  [internal_boundary_bot]
    type = SideSetsBetweenSubdomainsGenerator
    input = mesh
    new_boundary = 'internal_bot'
    primary_block = 1
    paired_block = 2
  []
  [internal_boundary_top]
    type = SideSetsBetweenSubdomainsGenerator
    input = internal_boundary_bot
    new_boundary = 'internal_top'
    primary_block = 2
    paired_block = 3
  []
  [diverging_mesh]
    type = FileMeshGenerator
    file = 'expansion_quad.e'
  []
[]
[Variables]
  [u]
    type = INSFVVelocityVariable
    initial_condition = 0
  []
  [v]
    type = INSFVVelocityVariable
    initial_condition = 1
  []
  [pressure]
    type = INSFVPressureVariable
  []
  [temperature]
    type = INSFVEnergyVariable
  []
[]
[AuxVariables]
  [advected_density]
    type = MooseVariableFVReal
    initial_condition = ${rho}
  []
[]
[FVKernels]
  [mass]
    type = INSFVMassAdvection
    variable = pressure
    rho = ${rho}
  []
  [u_advection]
    type = INSFVMomentumAdvection
    variable = u
    rho = ${rho}
    momentum_component = 'x'
  []
  [u_viscosity]
    type = INSFVMomentumDiffusion
    variable = u
    mu = ${mu}
    force_boundary_execution = true
    momentum_component = 'x'
  []
  [u_pressure]
    type = INSFVMomentumPressure
    variable = u
    momentum_component = 'x'
    pressure = pressure
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = v
    rho = ${rho}
    momentum_component = 'y'
  []
  [v_viscosity]
    type = INSFVMomentumDiffusion
    variable = v
    mu = ${mu}
    force_boundary_execution = true
    momentum_component = 'y'
  []
  [v_pressure]
    type = INSFVMomentumPressure
    variable = v
    momentum_component = 'y'
    pressure = pressure
  []
  [temp_advection]
    type = INSFVEnergyAdvection
    variable = temperature
    advected_interp_method = 'upwind'
  []
  [temp_source]
    type = FVBodyForce
    variable = temperature
    function = 10
    block = 1
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'bottom'
    variable = u
    functor = 0
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'bottom'
    variable = v
    functor = 1
  []
  [noslip-u]
    type = INSFVNoSlipWallBC
    boundary = 'right'
    variable = u
    function = 0
  []
  [noslip-v]
    type = INSFVNoSlipWallBC
    boundary = 'right'
    variable = v
    function = 0
  []
  [axis-u]
    type = INSFVSymmetryVelocityBC
    boundary = 'left'
    variable = u
    u = u
    v = v
    mu = ${mu}
    momentum_component = x
  []
  [axis-v]
    type = INSFVSymmetryVelocityBC
    boundary = 'left'
    variable = v
    u = u
    v = v
    mu = ${mu}
    momentum_component = y
  []
  [axis-p]
    type = INSFVSymmetryPressureBC
    boundary = 'left'
    variable = pressure
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'top'
    variable = pressure
    function = 0
  []
  [inlet_temp]
    type = FVNeumannBC
    boundary = 'bottom'
    variable = temperature
    value = 300
  []
[]
[FunctorMaterials]
  [ins_fv]
    type = INSFVEnthalpyFunctorMaterial
    temperature = 'temperature'
    rho = ${rho}
  []
  [advected_material_property]
    type = ADGenericFunctorMaterial
    prop_names = 'advected_rho cp'
    prop_values ='${rho} 1'
  []
  [vel_functor]
    type = ADGenericVectorFunctorMaterial
    prop_names = 'velocity'
    prop_values = 'u v 0'
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -sub_pc_factor_shift_type'
  petsc_options_value = 'asm      200                lu           NONZERO'
  line_search = 'none'
  nl_rel_tol = 1e-12
[]
[Postprocessors]
  [pdrop_total]
    type = PressureDrop
    pressure = pressure
    upstream_boundary = 'bottom'
    downstream_boundary = 'top'
    boundary = 'top bottom'
  []
  [pdrop_mid1]
    type = PressureDrop
    pressure = pressure
    upstream_boundary = 'bottom'
    downstream_boundary = 'internal_bot'
    boundary = 'bottom internal_bot'
  []
  [pdrop_mid2]
    type = PressureDrop
    pressure = pressure
    upstream_boundary = 'internal_bot'
    downstream_boundary = 'internal_top'
    boundary = 'internal_top internal_bot'
  []
  [pdrop_mid3]
    type = PressureDrop
    pressure = pressure
    upstream_boundary = 'internal_top'
    downstream_boundary = 'top'
    boundary = 'top internal_top'
  []
  [sum_drops]
    type = ParsedPostprocessor
    expression = 'pdrop_mid1 + pdrop_mid2 + pdrop_mid3'
    pp_names = 'pdrop_mid1 pdrop_mid2 pdrop_mid3'
  []
  [p_upstream]
    type = SideAverageValue
    variable = pressure
    boundary = 'bottom'
  []
  [p_downstream]
    type = SideAverageValue
    variable = pressure
    boundary = 'top'
  []
[]
[Outputs]
  csv = true
[]
(test/tests/restep/transient.i)
[Mesh]
  [gmg]
    type = GeneratedMeshGenerator
    dim = 1
    nx = 10
  []
[]
[Variables]
  [u]
  []
[]
[Kernels]
  [time]
    type = TimeDerivative
    variable = u
  []
  [diff]
    type = Diffusion
    variable = u
  []
  [src]
    type = BodyForce
    variable = u
    value = 1
  []
[]
[BCs]
  [left]
    type = DirichletBC
    boundary = left
    variable = u
    value = 0
  []
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  petsc_options_iname = '-pc_type -pc_hypre_type'
  petsc_options_value = 'hypre    boomeramg'
[]
restep_step = 1e12
[Postprocessors]
  [num_calls]
    type = GeneralSetupInterfaceCount
    count_type = INITIALIZE
  []
  [timestep]
    type = NumTimeSteps
  []
  [diff]
    type = ParsedPostprocessor
    expression = 'abs(num_calls - if(timestep < ${restep_step}, timestep, timestep + 1))'
    pp_names = 'num_calls timestep'
  []
  [diff_total]
    type = TimeIntegratedPostprocessor
    value = diff
  []
[]
[UserObjects]
  [terminate]
    type = Terminator
    expression = 'diff_total > 1e-12'
    error_level = ERROR
    message = 'Restep did not occur when expected.'
    execute_on = 'FINAL'
  []
[]
(test/tests/tag/old_eigen_tag.i)
[Mesh/gmg]
  type = GeneratedMeshGenerator
  dim = 2
  nx = 5
  ny = 5
[]
[Variables]
  [u]
  []
  [v]
  []
[]
[AuxVariables]
  [u_vec_tag_diff]
  []
  [u_vec_tag_rhs]
  []
  [u_mat_tag_diff]
  []
  [u_mat_tag_rhs]
  []
  [u_mat_savein_rhs]
  []
  [v_vec_tag_diff]
  []
  [v_vec_tag_rhs]
  []
  [v_mat_tag_diff]
  []
  [v_mat_tag_rhs]
  []
[]
[Kernels]
  [diff_u]
    type = Diffusion
    variable = u
    extra_vector_tags = 'tag_diff'
    extra_matrix_tags = 'tag_diff'
  []
  [rhs_u]
    type = MassEigenKernel
    variable = u
    extra_vector_tags = 'tag_rhs'
    extra_matrix_tags = 'tag_rhs'
    diag_save_in = 'u_mat_savein_rhs'
  []
  [diff_v]
    type = Diffusion
    variable = v
    extra_vector_tags = 'tag_diff'
    extra_matrix_tags = 'tag_diff'
  []
  [rhs_v]
    type = MassEigenKernel
    variable = v
    extra_vector_tags = 'tag_rhs'
    extra_matrix_tags = 'tag_rhs'
  []
  [rhs_uv]
    type = CoupledEigenKernel
    variable = u
    v = v
    extra_vector_tags = 'tag_rhs'
    extra_matrix_tags = 'tag_rhs'
  []
  [rhs_vu]
    type = CoupledEigenKernel
    variable = v
    v = u
    extra_vector_tags = 'tag_rhs'
    extra_matrix_tags = 'tag_rhs'
  []
[]
[AuxKernels]
  [u_vec_tag_diff]
    type = TagVectorAux
    variable = u_vec_tag_diff
    v = u
    vector_tag = tag_diff
  []
  [u_vec_tag_rhs]
    type = TagVectorAux
    variable = u_vec_tag_rhs
    v = u
    vector_tag = tag_rhs
  []
  [u_mat_tag_diff]
    type = TagVectorAux
    variable = u_mat_tag_diff
    v = u
    vector_tag = tag_diff
  []
  [u_mat_tag_rhs]
    type = TagVectorAux
    variable = u_mat_tag_diff
    v = u
    vector_tag = tag_rhs
  []
  [v_vec_tag_diff]
    type = TagVectorAux
    variable = v_vec_tag_diff
    v = v
    vector_tag = tag_diff
  []
  [v_vec_tag_rhs]
    type = TagVectorAux
    variable = v_vec_tag_rhs
    v = v
    vector_tag = tag_rhs
  []
  [v_mat_tag_diff]
    type = TagVectorAux
    variable = v_mat_tag_diff
    v = v
    vector_tag = tag_diff
  []
  [v_mat_tag_rhs]
    type = TagVectorAux
    variable = v_mat_tag_diff
    v = v
    vector_tag = tag_rhs
  []
[]
[BCs]
  [homogeneous_u]
    type = DirichletBC
    boundary = 'top right bottom left'
    variable = u
    value = 0
  []
  [homogeneous_v]
    type = DirichletBC
    boundary = 'top right bottom left'
    variable = v
    value = 0
  []
[]
[Problem]
  extra_tag_vectors = 'tag_diff tag_rhs'
  extra_tag_matrices = 'tag_diff tag_rhs'
  use_hash_table_matrix_assembly = true
[]
[Postprocessors]
  [unorm]
    type = NodalL2Norm
    variable = u
    execute_on = linear
  []
  [vnorm]
    type = NodalL2Norm
    variable = v
    execute_on = linear
  []
  [uvnorm]
    type = ParsedPostprocessor
    expression = 'sqrt(unorm*unorm + vnorm*vnorm)'
    pp_names = 'unorm vnorm'
    execute_on = linear
  []
[]
[Preconditioning/smp]
  type = SMP
  full = true
[]
[Executioner]
  type = NonlinearEigen
  bx_norm = uvnorm
  free_l_tol = 1e-8
  nl_abs_tol = 1e-12
[]
[Outputs]
  exodus = true
[]
(modules/thermal_hydraulics/test/tests/problems/brayton_cycle/closed_brayton_cycle.i)
# This input file is used to demonstrate a simple closed, air Brayton cycle using
# a compressor, turbine, shaft, motor, and generator.
# The flow length is divided into 6 segments as illustrated below, where
#   - "(C)" denotes the compressor
#   - "(T)" denotes the turbine
#   - "*" denotes a fictitious junction
#
#                Heated section               Cooled section
# *-----(C)-----*--------------*-----(T)-----*--------------*
#    1       2         3          4       5         6
#
# Initially the fluid is at rest at ambient conditions, the shaft speed is zero,
# and no heat transfer occurs with the system.
# The transient is controlled as follows:
#   * 0   - 100 s: motor ramps up torque linearly from zero
#   * 100 - 200 s: motor ramps down torque linearly to zero, HTC ramps up linearly from zero.
#   * 200 - 300 s: (no changes; should approach steady condition)
I_motor = 1.0
motor_torque_max = 400.0
I_generator = 1.0
generator_torque_per_shaft_speed = -0.00025
motor_ramp_up_duration = 100.0
motor_ramp_down_duration = 100.0
post_motor_time = 100.0
t1 = ${motor_ramp_up_duration}
t2 = ${fparse t1 + motor_ramp_down_duration}
t3 = ${fparse t2 + post_motor_time}
D1 = 0.15
D2 = ${D1}
D3 = ${D1}
D4 = ${D1}
D5 = ${D1}
D6 = ${D1}
A1 = ${fparse 0.25 * pi * D1^2}
A2 = ${fparse 0.25 * pi * D2^2}
A3 = ${fparse 0.25 * pi * D3^2}
A4 = ${fparse 0.25 * pi * D4^2}
A5 = ${fparse 0.25 * pi * D5^2}
A6 = ${fparse 0.25 * pi * D6^2}
L1 = 10.0
L2 = ${L1}
L3 = ${L1}
L4 = ${L1}
L5 = ${L1}
L6 = ${L1}
x1 = 0.0
x2 = ${fparse x1 + L1}
x3 = ${fparse x2 + L2}
x4 = ${fparse x3 + L3}
x5 = ${fparse x4 + L4}
x6 = ${fparse x5 + L5}
x2_minus = ${fparse x2 - 0.001}
x2_plus = ${fparse x2 + 0.001}
x5_minus = ${fparse x5 - 0.001}
x5_plus = ${fparse x5 + 0.001}
n_elems1 = 10
n_elems2 = ${n_elems1}
n_elems3 = ${n_elems1}
n_elems4 = ${n_elems1}
n_elems5 = ${n_elems1}
n_elems6 = ${n_elems1}
A_ref_comp = ${fparse 0.5 * (A1 + A2)}
V_comp = ${fparse A_ref_comp * 1.0}
I_comp = 1.0
A_ref_turb = ${fparse 0.5 * (A4 + A5)}
V_turb = ${fparse A_ref_turb * 1.0}
I_turb = 1.0
c0_rated_comp = 351.6925137
rho0_rated_comp = 1.146881112
rated_mfr = 0.25
speed_rated_rpm = 96000
speed_rated = ${fparse speed_rated_rpm * 2 * pi / 60.0}
speed_initial = 0
eff_comp = 0.79
eff_turb = 0.843
T_hot = 1000
T_cold = 300
T_ambient = 300
p_ambient = 1e5
[GlobalParams]
  orientation = '1 0 0'
  gravity_vector = '0 0 0'
  initial_p = ${p_ambient}
  initial_T = ${T_ambient}
  initial_vel = 0
  initial_vel_x = 0
  initial_vel_y = 0
  initial_vel_z = 0
  fp = fp_air
  closures = closures
  f = 0
  scaling_factor_1phase = '1 1 1e-5'
  scaling_factor_rhoV = 1
  scaling_factor_rhouV = 1
  scaling_factor_rhovV = 1
  scaling_factor_rhowV = 1
  scaling_factor_rhoEV = 1e-5
  rdg_slope_reconstruction = none
[]
[Functions]
  [motor_torque_fn]
    type = PiecewiseLinear
    x = '0 ${t1} ${t2}'
    y = '0 ${motor_torque_max} 0'
  []
  [motor_power_fn]
    type = ParsedFunction
    expression = 'torque * speed'
    symbol_names = 'torque speed'
    symbol_values = 'motor_torque shaft:omega'
  []
  [generator_torque_fn]
    type = ParsedFunction
    expression = 'slope * t'
    symbol_names = 'slope'
    symbol_values = '${generator_torque_per_shaft_speed}'
  []
  [generator_power_fn]
    type = ParsedFunction
    expression = 'torque * speed'
    symbol_names = 'torque speed'
    symbol_values = 'generator_torque shaft:omega'
  []
  [htc_wall_fn]
    type = PiecewiseLinear
    x = '0 ${t1} ${t2}'
    y = '0 0 1e3'
  []
[]
[FluidProperties]
  [fp_air]
    type = IdealGasFluidProperties
    emit_on_nan = none
  []
[]
[Closures]
  [closures]
    type = Closures1PhaseSimple
  []
[]
[Components]
  [shaft]
    type = Shaft
    connected_components = 'motor compressor turbine generator'
    initial_speed = ${speed_initial}
    scaling_factor_omega = 1e-3
  []
  [motor]
    type = ShaftConnectedMotor
    inertia = ${I_motor}
    torque = 0 # controlled
  []
  [generator]
    type = ShaftConnectedMotor
    inertia = ${I_generator}
    torque = generator_torque_fn
  []
  [pipe1]
    type = FlowChannel1Phase
    position = '${x1} 0 0'
    length = ${L1}
    n_elems = ${n_elems1}
    A = ${A1}
  []
  [compressor]
    type = ShaftConnectedCompressor1Phase
    position = '${x2} 0 0'
    inlet = 'pipe1:out'
    outlet = 'pipe2:in'
    A_ref = ${A_ref_comp}
    volume = ${V_comp}
    omega_rated = ${speed_rated}
    mdot_rated = ${rated_mfr}
    c0_rated = ${c0_rated_comp}
    rho0_rated = ${rho0_rated_comp}
    speeds = '0.5208 0.6250 0.7292 0.8333 0.9375'
    Rp_functions = 'rp_comp1 rp_comp2 rp_comp3 rp_comp4 rp_comp5'
    eff_functions = 'eff_comp1 eff_comp2 eff_comp3 eff_comp4 eff_comp5'
    min_pressure_ratio = 1.0
    speed_cr_I = 0
    inertia_const = ${I_comp}
    inertia_coeff = '${I_comp} 0 0 0'
    # assume no shaft friction
    speed_cr_fr = 0
    tau_fr_const = 0
    tau_fr_coeff = '0 0 0 0'
  []
  [pipe2]
    type = FlowChannel1Phase
    position = '${x2} 0 0'
    length = ${L2}
    n_elems = ${n_elems2}
    A = ${A2}
  []
  [junction2_3]
    type = JunctionOneToOne1Phase
    connections = 'pipe2:out pipe3:in'
  []
  [pipe3]
    type = FlowChannel1Phase
    position = '${x3} 0 0'
    length = ${L3}
    n_elems = ${n_elems3}
    A = ${A3}
  []
  [junction3_4]
    type = JunctionOneToOne1Phase
    connections = 'pipe3:out pipe4:in'
  []
  [pipe4]
    type = FlowChannel1Phase
    position = '${x4} 0 0'
    length = ${L4}
    n_elems = ${n_elems4}
    A = ${A4}
  []
  [turbine]
    type = ShaftConnectedCompressor1Phase
    position = '${x5} 0 0'
    inlet = 'pipe4:out'
    outlet = 'pipe5:in'
    A_ref = ${A_ref_turb}
    volume = ${V_turb}
    treat_as_turbine = true
    omega_rated = ${speed_rated}
    mdot_rated = ${rated_mfr}
    c0_rated = ${c0_rated_comp}
    rho0_rated = ${rho0_rated_comp}
    speeds = '0 0.5208 0.6250 0.7292 0.8333 0.9375'
    Rp_functions = 'rp_turb0 rp_turb1 rp_turb2 rp_turb3 rp_turb4 rp_turb5'
    eff_functions = 'eff_turb1 eff_turb1 eff_turb2 eff_turb3 eff_turb4 eff_turb5'
    min_pressure_ratio = 1.0
    speed_cr_I = 0
    inertia_const = ${I_turb}
    inertia_coeff = '${I_turb} 0 0 0'
    # assume no shaft friction
    speed_cr_fr = 0
    tau_fr_const = 0
    tau_fr_coeff = '0 0 0 0'
  []
  [pipe5]
    type = FlowChannel1Phase
    position = '${x5} 0 0'
    length = ${L5}
    n_elems = ${n_elems5}
    A = ${A5}
  []
  [junction5_6]
    type = JunctionOneToOne1Phase
    connections = 'pipe5:out pipe6:in'
  []
  [pipe6]
    type = FlowChannel1Phase
    position = '${x6} 0 0'
    length = ${L6}
    n_elems = ${n_elems6}
    A = ${A6}
  []
  [junction6_1]
    type = JunctionOneToOne1Phase
    connections = 'pipe6:out pipe1:in'
  []
  [heating]
    type = HeatTransferFromSpecifiedTemperature1Phase
    flow_channel = pipe3
    T_wall = ${T_hot}
    Hw = htc_wall_fn
  []
  [cooling]
    type = HeatTransferFromSpecifiedTemperature1Phase
    flow_channel = pipe6
    T_wall = ${T_cold}
    Hw = htc_wall_fn
  []
[]
[ControlLogic]
  [motor_ctrl]
    type = TimeFunctionComponentControl
    component = motor
    parameter = torque
    function = motor_torque_fn
  []
[]
[Postprocessors]
  [heating_rate]
    type = ADHeatRateConvection1Phase
    block = 'pipe3'
    T = T
    T_wall = T_wall
    Hw = Hw
    P_hf = P_hf
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [cooling_rate]
    type = ADHeatRateConvection1Phase
    block = 'pipe6'
    T = T
    T_wall = T_wall
    Hw = Hw
    P_hf = P_hf
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [motor_torque]
    type = RealComponentParameterValuePostprocessor
    component = motor
    parameter = torque
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [motor_power]
    type = FunctionValuePostprocessor
    function = motor_power_fn
    execute_on = 'INITIAL TIMESTEP_END'
    indirect_dependencies = 'motor_torque shaft:omega'
  []
  [generator_torque]
    type = ShaftConnectedComponentPostprocessor
    quantity = torque
    shaft_connected_component_uo = generator:shaftconnected_uo
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [generator_power]
    type = FunctionValuePostprocessor
    function = generator_power_fn
    execute_on = 'INITIAL TIMESTEP_END'
    indirect_dependencies = 'generator_torque shaft:omega'
  []
  [shaft_speed]
    type = ScalarVariable
    variable = 'shaft:omega'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [p_in_comp]
    type = PointValue
    variable = p
    point = '${x2_minus} 0 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [p_out_comp]
    type = PointValue
    variable = p
    point = '${x2_plus} 0 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [p_ratio_comp]
    type = ParsedPostprocessor
    pp_names = 'p_in_comp p_out_comp'
    expression = 'p_out_comp / p_in_comp'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [p_in_turb]
    type = PointValue
    variable = p
    point = '${x5_minus} 0 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [p_out_turb]
    type = PointValue
    variable = p
    point = '${x5_plus} 0 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [p_ratio_turb]
    type = ParsedPostprocessor
    pp_names = 'p_in_turb p_out_turb'
    expression = 'p_in_turb / p_out_turb'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [mfr_comp]
    type = ADFlowJunctionFlux1Phase
    boundary = pipe1:out
    connection_index = 0
    equation = mass
    junction = compressor
  []
  [mfr_turb]
    type = ADFlowJunctionFlux1Phase
    boundary = pipe4:out
    connection_index = 0
    equation = mass
    junction = turbine
  []
[]
[Preconditioning]
  [pc]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  scheme = 'bdf2'
  end_time = ${t3}
  dt = 0.1
  solve_type = NEWTON
  nl_rel_tol = 1e-50
  nl_abs_tol = 1e-10
  nl_max_its = 15
  l_tol = 1e-4
  l_max_its = 10
[]
[Outputs]
  [csv]
    type = CSV
    file_base = 'closed_brayton_cycle'
    execute_vector_postprocessors_on = 'INITIAL'
  []
  [console]
    type = Console
    show = 'shaft_speed p_ratio_comp p_ratio_turb compressor:pressure_ratio turbine:pressure_ratio'
  []
[]
[Functions]
  # compressor pressure ratio
  [rp_comp1]
    type = PiecewiseLinear
    data_file = 'rp_comp1.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_comp2]
    type = PiecewiseLinear
    data_file = 'rp_comp2.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_comp3]
    type = PiecewiseLinear
    data_file = 'rp_comp3.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_comp4]
    type = PiecewiseLinear
    data_file = 'rp_comp4.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_comp5]
    type = PiecewiseLinear
    data_file = 'rp_comp5.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  # compressor efficiency
  [eff_comp1]
    type = ConstantFunction
    value = ${eff_comp}
  []
  [eff_comp2]
    type = ConstantFunction
    value = ${eff_comp}
  []
  [eff_comp3]
    type = ConstantFunction
    value = ${eff_comp}
  []
  [eff_comp4]
    type = ConstantFunction
    value = ${eff_comp}
  []
  [eff_comp5]
    type = ConstantFunction
    value = ${eff_comp}
  []
  # turbine pressure ratio
  [rp_turb0]
    type = ConstantFunction
    value = 1
  []
  [rp_turb1]
    type = PiecewiseLinear
    data_file = 'rp_turb1.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_turb2]
    type = PiecewiseLinear
    data_file = 'rp_turb2.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_turb3]
    type = PiecewiseLinear
    data_file = 'rp_turb3.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_turb4]
    type = PiecewiseLinear
    data_file = 'rp_turb4.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_turb5]
    type = PiecewiseLinear
    data_file = 'rp_turb5.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  # turbine efficiency
  [eff_turb1]
    type = ConstantFunction
    value = ${eff_turb}
  []
  [eff_turb2]
    type = ConstantFunction
    value = ${eff_turb}
  []
  [eff_turb3]
    type = ConstantFunction
    value = ${eff_turb}
  []
  [eff_turb4]
    type = ConstantFunction
    value = ${eff_turb}
  []
  [eff_turb5]
    type = ConstantFunction
    value = ${eff_turb}
  []
[]
(modules/optimization/test/tests/executioners/constrained/inequality/forward_and_adjoint.i)
[Mesh]
  [gmg]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 10
    ny = 20
    xmax = 1
    ymax = 1
  []
[]
[Problem]
  nl_sys_names = 'nl0 adjoint'
  kernel_coverage_check = false
[]
[Variables]
  [temperature]
  []
  [temperature_adjoint]
    solver_sys = adjoint
  []
[]
[Kernels]
  [heat_conduction]
    type = MatDiffusion
    variable = temperature
    diffusivity = thermal_conductivity
  []
[]
[BCs]
  [left]
    type = FunctionNeumannBC
    variable = temperature
    boundary = left
    function = left_function
  []
  [bottom]
    type = DirichletBC
    variable = temperature
    boundary = bottom
    value = 200
  []
  [top]
    type = DirichletBC
    variable = temperature
    boundary = top
    value = 100
  []
[]
[Functions]
  [left_function]
    type = ParsedOptimizationFunction
    expression = 'a + b*y'
    param_symbol_names = 'a b'
    param_vector_name = 'params/left'
  []
  [dc_db]
    type = ParsedFunction
    expression = 'y'
  []
[]
[Materials]
  [steel]
    type = GenericConstantMaterial
    prop_names = thermal_conductivity
    prop_values = 5
  []
[]
[Preconditioning]
  [nl0]
    type = SMP
    nl_sys = 'nl0'
    petsc_options_iname = '-pc_type'
    petsc_options_value = 'lu'
  []
  [adjoint]
    type = SMP
    nl_sys = 'adjoint'
    petsc_options_iname = '-pc_type'
    petsc_options_value = 'lu'
  []
[]
[Executioner]
  type = SteadyAndAdjoint
  forward_system = nl0
  adjoint_system = adjoint
  line_search = none
  nl_rel_tol = 1e-12
  l_tol = 1e-12
[]
[DiracKernels]
  [pt]
    type = ReporterPointSource
    variable = temperature_adjoint
    x_coord_name = measure_data/measurement_xcoord
    y_coord_name = measure_data/measurement_ycoord
    z_coord_name = measure_data/measurement_zcoord
    value_name = measure_data/misfit_values
  []
[]
[VectorPostprocessors]
  [grad_bc_left]
    type = SideOptimizationNeumannFunctionInnerProduct
    variable = temperature_adjoint
    function = left_function
    boundary = left
    execute_on = ADJOINT_TIMESTEP_END
  []
[]
[Postprocessors]
  [sum]
    type = FunctionSideIntegral
    boundary = left
    function = left_function
  []
[]
[Reporters]
  [measure_data]
    type = OptimizationData
    variable = temperature
    objective_name = objective_value
  []
  [params]
    type = ConstantReporter
    real_vector_names = 'left'
    real_vector_values = '0 0' # Dummy
    execute_on = NONE
  []
[]
[Outputs]
  console = false
  exodus = false
  json = true
[]
#---------Inequality constraints------------#
[VectorPostprocessors]
  [gradient_c]
    type = VectorOfPostprocessors
    postprocessors = 'dc_da dc_db'
  []
  [ineq]
    type = VectorOfPostprocessors
    postprocessors = 'constraint'
  []
[]
[Postprocessors]
  [constraint]
    type = ParsedPostprocessor
    expression = '150 - sum' # 150 is the constraint we want to satisfy
    pp_names = sum
  []
  [dc_da]
    type = FunctionSideIntegral
    boundary = left
    function = -1
  []
  [dc_db]
    type = FunctionSideIntegral
    boundary = left
    function = '-y'
  []
[]
(modules/porous_flow/test/tests/sinks/s02.i)
# apply a sink flux with use_mobility=true and observe the correct behavior
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = 0
  xmax = 1
  ymin = 0
  ymax = 1
  zmin = 0
  zmax = 2
[]
[GlobalParams]
  PorousFlowDictator = dictator
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = 'pp'
    number_fluid_phases = 1
    number_fluid_components = 1
  []
  [pc]
    type = PorousFlowCapillaryPressureVG
    m = 0.5
    alpha = 1
  []
[]
[Variables]
  [pp]
  []
[]
[ICs]
  [pp]
    type = FunctionIC
    variable = pp
    function = y+1
  []
[]
[Kernels]
  [mass0]
    type = PorousFlowMassTimeDerivative
    fluid_component = 0
    variable = pp
  []
[]
[FluidProperties]
  [simple_fluid]
    type = SimpleFluidProperties
    bulk_modulus = 1.3
    density0 = 1.1
    thermal_expansion = 0
    viscosity = 1.1
  []
[]
[Materials]
  [temperature]
    type = PorousFlowTemperature
  []
  [ppss]
    type = PorousFlow1PhaseP
    porepressure = pp
    capillary_pressure = pc
  []
  [massfrac]
    type = PorousFlowMassFraction
  []
  [simple_fluid]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid
    phase = 0
  []
  [porosity]
    type = PorousFlowPorosityConst
    porosity = 0.1
  []
  [permeability]
    type = PorousFlowPermeabilityConst
    permeability = '0.2 0 0 0 0.1 0 0 0 0.1'
  []
  [relperm]
    type = PorousFlowRelativePermeabilityCorey
    n = 2
    phase = 0
  []
[]
[AuxVariables]
  [flux_out]
  []
  [xval]
  []
  [yval]
  []
[]
[ICs]
  [xval]
    type = FunctionIC
    variable = xval
    function = x
  []
  [yval]
    type = FunctionIC
    variable = yval
    function = y
  []
[]
[Postprocessors]
  [p00]
    type = PointValue
    point = '0 0 0'
    variable = pp
    execute_on = 'initial timestep_end'
  []
  [m00]
    type = ParsedPostprocessor
    expression = 'vol*por*dens0*exp(p00/bulk)'
    constant_names = 'vol por dens0 bulk'
    constant_expressions = '0.25 0.1 1.1 1.3'
    pp_names = 'p00'
    execute_on = 'initial timestep_end'
  []
  [dm00]
    type = ChangeOverTimePostprocessor
    postprocessor = m00
    outputs = none
  []
  [m00_prev]
    type = ParsedPostprocessor
    expression = 'm00 - dm00'
    pp_names = 'm00 dm00'
    outputs = 'console'
  []
  [del_m00]
    type = ParsedPostprocessor
    expression = 'fcn*perm*dens0*exp(p00/bulk)/visc*area*dt'
    constant_names = 'fcn perm dens0 bulk visc area dt'
    constant_expressions = '6   0.2  1.1 1.3  1.1  0.5  1E-3'
    pp_names = 'p00'
    outputs = 'console'
  []
  [m00_expect]
    type = ParsedPostprocessor
    expression = 'm00_prev - del_m00'
    pp_names = 'm00_prev del_m00'
  []
  [p10]
    type = PointValue
    point = '1 0 0'
    variable = pp
    execute_on = 'initial timestep_end'
  []
  [p01]
    type = PointValue
    point = '0 1 0'
    variable = pp
    execute_on = 'initial timestep_end'
  []
  [m01]
    type = ParsedPostprocessor
    expression = 'vol*por*dens0*exp(p01/bulk)'
    constant_names = 'vol por dens0 bulk'
    constant_expressions = '0.25 0.1 1.1 1.3'
    pp_names = 'p01'
    execute_on = 'initial timestep_end'
  []
  [dm01]
    type = ChangeOverTimePostprocessor
    postprocessor = m01
    outputs = none
  []
  [m01_prev]
    type = ParsedPostprocessor
    expression = 'm01 - dm01'
    pp_names = 'm01 dm01'
    outputs = 'console'
  []
  [del_m01]
    type = ParsedPostprocessor
    expression = 'fcn*perm*dens0*exp(p01/bulk)/visc*area*dt'
    constant_names = 'fcn perm dens0 bulk visc area dt'
    constant_expressions = '6   0.2  1.1 1.3  1.1  0.5  1E-3'
    pp_names = 'p01'
    outputs = 'console'
  []
  [m01_expect]
    type = ParsedPostprocessor
    expression = 'm01_prev - del_m01'
    pp_names = 'm01_prev del_m01'
  []
  [p11]
    type = PointValue
    point = '1 1 0'
    variable = pp
    execute_on = 'initial timestep_end'
  []
[]
[BCs]
  [flux]
    type = PorousFlowSink
    boundary = 'left'
    variable = pp
    use_mobility = true
    use_relperm = true
    fluid_phase = 0
    flux_function = 6
    save_in = flux_out
  []
[]
[Preconditioning]
  [andy]
    type = SMP
    full = true
    petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -snes_max_it -sub_pc_factor_shift_type -pc_asm_overlap'
    petsc_options_value = 'gmres asm lu 10000 NONZERO 2'
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  dt = 1E-3
  end_time = 0.03
  nl_rel_tol = 1E-12
  nl_abs_tol = 1E-12
[]
[Outputs]
  file_base = s02
  [console]
    type = Console
    execute_on = 'nonlinear linear'
    time_step_interval = 30
  []
  [csv]
    type = CSV
    execute_on = 'timestep_end'
    time_step_interval = 3
  []
[]
(modules/combined/examples/optimization/multi-load/square_subapp_one.i)
power = 1.0
E0 = 1.0
Emin = 1.0e-6
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Mesh]
  [Bottom]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 100
    ny = 100
    xmin = 0
    xmax = 150
    ymin = 0
    ymax = 150
  []
  [left_load]
    type = ExtraNodesetGenerator
    input = Bottom
    new_boundary = left_load
    coord = '0 150 0'
  []
  [right_load]
    type = ExtraNodesetGenerator
    input = left_load
    new_boundary = right_load
    coord = '150 150 0'
  []
  [left_support]
    type = ExtraNodesetGenerator
    input = right_load
    new_boundary = left_support
    coord = '0 0 0'
  []
  [right_support]
    type = ExtraNodesetGenerator
    input = left_support
    new_boundary = right_support
    coord = '150 0 0'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
[]
[AuxVariables]
  [Dc]
    family = MONOMIAL
    order = SECOND
    initial_condition = -1.0
  []
  [Cc]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = -1.0
  []
  [mat_den]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = 0.25
  []
  [sensitivity_var]
    family = MONOMIAL
    order = SECOND
    initial_condition = -1.0
  []
[]
[AuxKernels]
  [sensitivity_kernel]
    type = MaterialRealAux
    property = sensitivity
    variable = sensitivity_var
    check_boundary_restricted = false
    execute_on = 'TIMESTEP_END'
  []
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    strain = SMALL
    add_variables = true
    incremental = false
  []
[]
[BCs]
  [no_y]
    type = DirichletBC
    variable = disp_y
    boundary = left_support
    value = 0.0
  []
  [no_x]
    type = DirichletBC
    variable = disp_x
    boundary = left_support
    value = 0.0
  []
  [no_y_right]
    type = DirichletBC
    variable = disp_y
    boundary = right_support
    value = 0.0
  []
  [no_x_right]
    type = DirichletBC
    variable = disp_x
    boundary = right_support
    value = 0.0
  []
[]
[NodalKernels]
  [push_left]
    type = NodalGravity
    variable = disp_y
    boundary = left_load
    gravity_value = -1e-3
    mass = 1
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeVariableIsotropicElasticityTensor
    youngs_modulus = E_phys
    poissons_ratio = poissons_ratio
    args = 'mat_den'
  []
  [E_phys]
    type = DerivativeParsedMaterial
    # Emin + (density^penal) * (E0 - Emin)
    expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
    coupled_variables = 'mat_den'
    property_name = E_phys
  []
  [poissons_ratio]
    type = GenericConstantMaterial
    prop_names = poissons_ratio
    prop_values = 0.3
  []
  [stress]
    type = ComputeLinearElasticStress
  []
  [dc]
    type = ComplianceSensitivity
    design_density = mat_den
    youngs_modulus = E_phys
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[UserObjects]
  # We do averaging in subapps
  [rad_avg]
    type = RadialAverage
    radius = 8
    weights = linear
    prop_name = sensitivity
    force_preaux = true
    execute_on = 'TIMESTEP_END'
  []
  # Provides Dc
  [calc_sense]
    type = SensitivityFilter
    density_sensitivity = Dc
    design_density = mat_den
    filter_UO = rad_avg
    force_postaux = true
    execute_on = 'TIMESTEP_END'
  []
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu superlu_dist'
  nl_abs_tol = 1e-10
  dt = 1.0
  num_steps = 10
[]
[Outputs]
  exodus = true
  [out]
    type = CSV
    execute_on = 'TIMESTEP_END'
  []
  print_linear_residuals = false
[]
[Postprocessors]
  [mesh_volume]
    type = VolumePostprocessor
    execute_on = 'initial timestep_end'
  []
  [total_vol]
    type = ElementIntegralVariablePostprocessor
    variable = mat_den
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [vol_frac]
    type = ParsedPostprocessor
    expression = 'total_vol / mesh_volume'
    pp_names = 'total_vol mesh_volume'
  []
  [sensitivity]
    type = ElementIntegralMaterialProperty
    mat_prop = sensitivity
    execute_on = 'TIMESTEP_BEGIN TIMESTEP_END NONLINEAR'
  []
  [objective]
    type = ElementIntegralMaterialProperty
    mat_prop = strain_energy_density
    execute_on = 'INITIAL TIMESTEP_END'
  []
[]
(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/combined/examples/optimization/multi-load/single_subapp_one.i)
power = 2
E0 = 1.0
Emin = 1.0e-6
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Mesh]
  # final_generator = 'MoveRight'
  [Bottom]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 80
    ny = 40
    xmin = 0
    xmax = 150
    ymin = 0
    ymax = 75
  []
  [left_load]
    type = ExtraNodesetGenerator
    input = Bottom
    new_boundary = left_load
    coord = '37.5 75 0'
  []
  [right_load]
    type = ExtraNodesetGenerator
    input = left_load
    new_boundary = right_load
    coord = '112.5 75 0'
  []
  [left_support]
    type = ExtraNodesetGenerator
    input = right_load
    new_boundary = left_support
    coord = '0 0 0'
  []
  [right_support]
    type = ExtraNodesetGenerator
    input = left_support
    new_boundary = right_support
    coord = '150 0 0'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
[]
[AuxVariables]
  [Dc]
    family = MONOMIAL
    order = SECOND
    initial_condition = -1.0
  []
  [Cc]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = -1.0
  []
  [mat_den]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = 0.1
  []
  [sensitivity_var]
    family = MONOMIAL
    order = SECOND
    initial_condition = -1.0
  []
[]
[AuxKernels]
  [sensitivity_kernel]
    type = MaterialRealAux
    property = sensitivity
    variable = sensitivity_var
    check_boundary_restricted = false
    execute_on = 'TIMESTEP_END'
  []
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    strain = SMALL
    add_variables = true
    incremental = false
  []
[]
[BCs]
  [no_y]
    type = DirichletBC
    variable = disp_y
    boundary = left_support
    value = 0.0
  []
  [no_x]
    type = DirichletBC
    variable = disp_x
    boundary = left_support
    value = 0.0
  []
  [no_y_right]
    type = DirichletBC
    variable = disp_y
    boundary = right_support
    value = 0.0
  []
[]
[NodalKernels]
  [push_left]
    type = NodalGravity
    variable = disp_y
    boundary = left_load
    gravity_value = -1e-3
    mass = 1
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeVariableIsotropicElasticityTensor
    youngs_modulus = E_phys
    poissons_ratio = poissons_ratio
    args = 'mat_den'
  []
  [E_phys]
    type = DerivativeParsedMaterial
    # Emin + (density^penal) * (E0 - Emin)
    expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
    coupled_variables = 'mat_den'
    property_name = E_phys
  []
  [poissons_ratio]
    type = GenericConstantMaterial
    prop_names = poissons_ratio
    prop_values = 0.0
  []
  [stress]
    type = ComputeLinearElasticStress
  []
  [dc]
    type = ComplianceSensitivity
    design_density = mat_den
    youngs_modulus = E_phys
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[UserObjects]
  [rad_avg]
    type = RadialAverage
    radius = 3
    weights = linear
    prop_name = sensitivity
    force_preaux = true
    execute_on = 'TIMESTEP_END'
  []
  # No SIMP optimization in subapp
  [calc_sense]
    type = SensitivityFilter
    density_sensitivity = Dc
    design_density = mat_den
    filter_UO = rad_avg
    force_postaux = true
    execute_on = 'TIMESTEP_END'
  []
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu superlu_dist'
  nl_abs_tol = 1e-10
  dt = 1.0
  num_steps = 25
[]
[Outputs]
  exodus = true
  [out]
    type = CSV
    execute_on = 'TIMESTEP_END'
  []
  print_linear_residuals = false
[]
[Postprocessors]
  [mesh_volume]
    type = VolumePostprocessor
    execute_on = 'initial timestep_end'
  []
  [total_vol]
    type = ElementIntegralVariablePostprocessor
    variable = mat_den
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [vol_frac]
    type = ParsedPostprocessor
    expression = 'total_vol / mesh_volume'
    pp_names = 'total_vol mesh_volume'
  []
  [sensitivity]
    type = ElementIntegralMaterialProperty
    mat_prop = sensitivity
    execute_on = 'TIMESTEP_BEGIN TIMESTEP_END NONLINEAR'
  []
  [objective]
    type = ElementIntegralMaterialProperty
    mat_prop = strain_energy_density
    execute_on = 'INITIAL TIMESTEP_END'
  []
[]
(modules/heat_transfer/test/tests/fvbcs/fv_marshak_bc/rad_istothermal_medium_2d.i)
# The test gurantees that Marshak BCs yield the expected constant 2D solution
diffusion_coef = 1e-12
opacity = 1.0
temperature_radiation = 100.0
wall_temperature = ${fparse temperature_radiation / (4^(1/4))}
G_bc = 1.0
sigma = 5.670374419e-8
[Mesh]
  [mesh]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 20
    ny = 20
  []
[]
[Variables]
  [G]
    type = MooseVariableFVReal
    initial_condition = 1
  []
[]
[FVKernels]
  [G_diffusion]
    type = FVDiffusion
    variable = G
    coeff = ${diffusion_coef}
  []
  [source_and_sink]
    type = FVThermalRadiationSourceSink
    variable = G
    temperature_radiation = ${temperature_radiation}
    opacity = ${opacity}
  []
[]
[FVBCs]
  [boundaries_bc]
    type = FVMarshakRadiativeBC
    boundary = 'left right'
    variable = G
    temperature_radiation = ${wall_temperature}
    coeff_diffusion = ${diffusion_coef}
    boundary_emissivity = 0.5
  []
[]
[Functions]
  [analytical_sol]
    type = ParsedFunction
    symbol_names = 'a'
    symbol_values = '${fparse sqrt(opacity / diffusion_coef)}'
    expression = '${G_bc} * cosh(a*x) / cosh(a) + ${sigma} * ${temperature_radiation}^4 * (1.0 - cosh(a*x) / cosh(a))'
  []
[]
[Postprocessors]
  [mean_value]
    type = ElementIntegralFunctorPostprocessor
    functor = G
  []
  [max_value]
    type = ElementExtremeFunctorValue
    functor = G
  []
  [relative_difference]
    type = ParsedPostprocessor
    pp_names = 'mean_value max_value'
    expression = '(max_value / mean_value - 1.0) / mean_value'
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -pc_factor_shift_type'
  petsc_options_value = 'lu NONZERO'
  nl_abs_tol = 1e-12
[]
[Outputs]
  exodus = false
  csv = true
[]
(test/tests/coord_type/coord_type_rz_general.i)
# Tests using different coordinate systems in different blocks:
#   block1: XYZ translated by (0,-1,0)
#   block2: RZ with origin=(0,0,0) and direction=(0,1,0)
#   block3: RZ with origin=(0,0,1) and direction=(1,0,0)
#   block4: RZ with origin=(-1,-2,-3) and direction=(1,1,0)
#
# A transient heat conduction equation is solved with uniform properties.
# The same power is applied to each block via a uniform heat flux boundary
# condition on the outer cylindrical surface (top surface for block1).
# Conservation is checked for each via post-processors.
# Blocks block2, block3, and block4 should have identical solutions.
rho = 1000.0
cp = 500.0
k = 15.0
length = 1.5
radius = 0.5
perimeter = ${fparse 2 * pi * radius}
nz = 10
nr = 5
power = 1e3
heat_flux = ${fparse power / (perimeter * length)}
[Mesh]
  # block1
  [genmesh1]
    type = GeneratedMeshGenerator
    dim = 2
    nx = ${nz}
    ny = ${nr}
    xmin = 0.0
    xmax = ${length}
    ymin = -1.0
    ymax = ${fparse -1.0 + radius}
    boundary_id_offset = 10
  []
  [renumberblock1]
    type = RenameBlockGenerator
    input = genmesh1
    old_block = 0
    new_block = 1
  []
  [renameblock1]
    type = RenameBlockGenerator
    input = renumberblock1
    old_block = 1
    new_block = block1
  []
  [renameboundary1]
    type = RenameBoundaryGenerator
    input = renameblock1
    old_boundary = '10 11 12 13'
    new_boundary = 'bottom1 right1 top1 left1'
  []
  # block2
  [genmesh2]
    type = GeneratedMeshGenerator
    dim = 2
    nx = ${nr}
    ny = ${nz}
    xmin = 0.0
    xmax = ${radius}
    ymin = 0
    ymax = ${length}
    boundary_id_offset = 20
  []
  [renumberblock2]
    type = RenameBlockGenerator
    input = genmesh2
    old_block = 0
    new_block = 2
  []
  [renameblock2]
    type = RenameBlockGenerator
    input = renumberblock2
    old_block = 2
    new_block = block2
  []
  [renameboundary2]
    type = RenameBoundaryGenerator
    input = renameblock2
    old_boundary = '20 21 22 23'
    new_boundary = 'bottom2 right2 top2 left2'
  []
  # block3
  [genmesh3]
    type = GeneratedMeshGenerator
    dim = 2
    nx = ${nz}
    ny = ${nr}
    xmin = 0.0
    xmax = ${length}
    ymin = 0
    ymax = ${radius}
    boundary_id_offset = 30
  []
  [translate3]
    type = TransformGenerator
    input = genmesh3
    transform = TRANSLATE
    vector_value = '0 0 1'
  []
  [renumberblock3]
    type = RenameBlockGenerator
    input = translate3
    old_block = 0
    new_block = 3
  []
  [renameblock3]
    type = RenameBlockGenerator
    input = renumberblock3
    old_block = 3
    new_block = block3
  []
  [renameboundary3]
    type = RenameBoundaryGenerator
    input = renameblock3
    old_boundary = '30 31 32 33'
    new_boundary = 'bottom3 right3 top3 left3'
  []
  # block4
  [genmesh4]
    type = GeneratedMeshGenerator
    dim = 2
    nx = ${nz}
    ny = ${nr}
    xmin = 0.0
    xmax = ${length}
    ymin = 0
    ymax = ${radius}
    boundary_id_offset = 40
  []
  [rotate4]
    type = TransformGenerator
    input = genmesh4
    transform = ROTATE
    vector_value = '45 0 0'
  []
  [translate4]
    type = TransformGenerator
    input = rotate4
    transform = TRANSLATE
    vector_value = '-1 -2 -3'
  []
  [renumberblock4]
    type = RenameBlockGenerator
    input = translate4
    old_block = 0
    new_block = 4
  []
  [renameblock4]
    type = RenameBlockGenerator
    input = renumberblock4
    old_block = 4
    new_block = block4
  []
  [renameboundary4]
    type = RenameBoundaryGenerator
    input = renameblock4
    old_boundary = '40 41 42 43'
    new_boundary = 'bottom4 right4 top4 left4'
  []
  [combiner]
    type = CombinerGenerator
    inputs = 'renameboundary1 renameboundary2 renameboundary3 renameboundary4'
  []
  coord_block = 'block1 block2 block3 block4'
  coord_type = 'XYZ RZ RZ RZ'
  rz_coord_blocks = 'block2 block3 block4'
  rz_coord_origins = '0 0 0
                      0 0 1
                      -1 -2 -3'
  rz_coord_directions = '0 1 0
                         1 0 0
                         1 1 0'
[]
[Variables]
  [T]
    family = LAGRANGE
    order = FIRST
  []
[]
[Functions]
  [T_ic_fn]
    type = ParsedFunction
    expression = 'x'
  []
  [theoretical_energy_added_fn]
    type = ParsedFunction
    expression = '${power} * t'
  []
[]
[ICs]
  [T_ic]
    type = FunctionIC
    variable = T
    function = T_ic_fn
  []
[]
[Kernels]
  [time_derivative]
    type = ADTimeDerivative
    variable = T
  []
  [heat_conduction]
    type = CoefDiffusion
    variable = T
    coef = ${fparse k / (rho * cp)}
  []
[]
[BCs]
  [heat_flux_bc]
    type = ADFunctionNeumannBC
    variable = T
    boundary = 'top1 right2 top3 top4'
    # The heat conduction equation has been divided by rho*cp
    function = '${fparse heat_flux / (rho * cp)}'
  []
[]
[Postprocessors]
  [theoretical_energy_change]
    type = FunctionValuePostprocessor
    function = theoretical_energy_added_fn
    execute_on = 'INITIAL TIMESTEP_END'
  []
  # block1 conservation
  [T_integral1]
    type = ElementIntegralVariablePostprocessor
    variable = T
    block = 'block1'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [energy1]
    type = ParsedPostprocessor
    pp_names = 'T_integral1'
    expression = 'T_integral1 * ${rho} * ${cp} * ${perimeter}'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [energy_change1]
    type = ChangeOverTimePostprocessor
    postprocessor = energy1
    change_with_respect_to_initial = true
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [energy_change_error1]
    type = RelativeDifferencePostprocessor
    value1 = energy_change1
    value2 = theoretical_energy_change
    execute_on = 'INITIAL TIMESTEP_END'
  []
  # block2 conservation
  [T_integral2]
    type = ElementIntegralVariablePostprocessor
    variable = T
    block = 'block2'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [energy2]
    type = ParsedPostprocessor
    pp_names = 'T_integral2'
    expression = 'T_integral2 * ${rho} * ${cp}'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [energy_change2]
    type = ChangeOverTimePostprocessor
    postprocessor = energy2
    change_with_respect_to_initial = true
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [energy_change_error2]
    type = RelativeDifferencePostprocessor
    value1 = energy_change2
    value2 = theoretical_energy_change
    execute_on = 'INITIAL TIMESTEP_END'
  []
  # block3 conservation
  [T_integral3]
    type = ElementIntegralVariablePostprocessor
    variable = T
    block = 'block3'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [energy3]
    type = ParsedPostprocessor
    pp_names = 'T_integral3'
    expression = 'T_integral3 * ${rho} * ${cp}'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [energy_change3]
    type = ChangeOverTimePostprocessor
    postprocessor = energy3
    change_with_respect_to_initial = true
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [energy_change_error3]
    type = RelativeDifferencePostprocessor
    value1 = energy_change3
    value2 = theoretical_energy_change
    execute_on = 'INITIAL TIMESTEP_END'
  []
  # block4 conservation
  [T_integral4]
    type = ElementIntegralVariablePostprocessor
    variable = T
    block = 'block4'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [energy4]
    type = ParsedPostprocessor
    pp_names = 'T_integral4'
    expression = 'T_integral4 * ${rho} * ${cp}'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [energy_change4]
    type = ChangeOverTimePostprocessor
    postprocessor = energy4
    change_with_respect_to_initial = true
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [energy_change_error4]
    type = RelativeDifferencePostprocessor
    value1 = energy_change4
    value2 = theoretical_energy_change
    execute_on = 'INITIAL TIMESTEP_END'
  []
[]
[Preconditioning]
  [pc]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  scheme = bdf2
  dt = 1.0
  num_steps = 10
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-10
[]
[Outputs]
  file_base = 'coord_type_rz_general'
  [console]
    type = Console
    show = 'energy_change_error1 energy_change_error2 energy_change_error3 energy_change_error4'
  []
  [exodus]
    type = Exodus
    show = 'T energy_change_error1 energy_change_error2 energy_change_error3 energy_change_error4'
  []
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/hydraulic-separators/separator-no-jump.i)
# This test describes a test where three parallel channels are
# separated using flow separators that act as slip boundary conditions.
# The different channels have different friction factors
# meaning that we expect different pressure drops.
# Channel 1 expected drop (analytic, Forchheimer only): 5.50E-03 Pa
# Channel 2 expected drop (analytic, Forchheimer only): 4.40E-02 Pa
# Channel 3 expected drop (analytic, Forchheimer only): 1.49E-01 Pa
rho=1.1
mu=1.1
advected_interp_method='average'
velocity_interp_method='rc'
[Mesh]
  [mesh]
    type = CartesianMeshGenerator
    dim = 2
    dx = '1'
    dy = '0.25 0.25 0.25'
    ix = '5'
    iy = '2 2 2'
    subdomain_id = '1 2 3'
  []
  [separator-1]
    type = SideSetsBetweenSubdomainsGenerator
    new_boundary = 'separator-1'
    primary_block = 1
    paired_block = 2
    input = mesh
  []
  [separator-2]
    type = SideSetsBetweenSubdomainsGenerator
    new_boundary = 'separator-2'
    primary_block = 2
    paired_block = 3
    input = separator-1
  []
  [inlet-1]
    type = ParsedGenerateSideset
    input = separator-2
    combinatorial_geometry = 'y < 0.25 & x < 0.00001'
    replace = true
    new_sideset_name = inlet-1
  []
  [inlet-2]
    type = ParsedGenerateSideset
    input = inlet-1
    combinatorial_geometry = 'y > 0.25 & y < 0.5 & x < 0.00001'
    replace = true
    new_sideset_name = inlet-2
  []
  [inlet-3]
    type = ParsedGenerateSideset
    input = inlet-2
    combinatorial_geometry = 'y > 0.5 & x < 0.00001'
    replace = true
    new_sideset_name = inlet-3
  []
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
  porosity = porosity
[]
[UserObjects]
  [rc]
    type = PINSFVRhieChowInterpolator
    u = superficial_vel_x
    v = superficial_vel_y
    pressure = pressure
  []
[]
[Variables]
  [superficial_vel_x]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = 0.1
  []
  [superficial_vel_y]
    type = PINSFVSuperficialVelocityVariable
  []
  [pressure]
    type = BernoulliPressureVariable
    u = u
    v = v
    rho = ${rho}
  []
[]
[FVKernels]
  [mass]
    type = PINSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
  []
  [u_advection]
    type = PINSFVMomentumAdvection
    variable = superficial_vel_x
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'x'
  []
  [u_viscosity]
    type = PINSFVMomentumDiffusion
    variable = superficial_vel_x
    momentum_component = 'x'
    mu = ${mu}
  []
  [u_pressure]
    type = PINSFVMomentumPressure
    variable = superficial_vel_x
    pressure = pressure
    momentum_component = 'x'
  []
  [u_friction]
    type = PINSFVMomentumFriction
    variable = superficial_vel_x
    momentum_component = 'x'
    Forchheimer_name = 'Forchheimer_coefficient'
    rho = ${rho}
    speed = speed
  []
  [v_advection]
    type = PINSFVMomentumAdvection
    variable = superficial_vel_y
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'y'
  []
  [v_viscosity]
    type = PINSFVMomentumDiffusion
    variable = superficial_vel_y
    momentum_component = 'y'
    mu = ${mu}
  []
  [v_pressure]
    type = PINSFVMomentumPressure
    variable = superficial_vel_y
    pressure = pressure
    momentum_component = 'y'
  []
  [v_friction]
    type = PINSFVMomentumFriction
    variable = superficial_vel_y
    momentum_component = 'y'
    Forchheimer_name = 'Forchheimer_coefficient'
    rho = ${rho}
    speed = speed
  []
[]
[FVBCs]
  [inlet-u-1]
    type = INSFVInletVelocityBC
    boundary = 'inlet-1'
    variable = superficial_vel_x
    functor = '0.1'
  []
  [inlet-u-2]
    type = INSFVInletVelocityBC
    boundary = 'inlet-2'
    variable = superficial_vel_x
    functor = '0.2'
  []
  [inlet-u-3]
    type = INSFVInletVelocityBC
    boundary = 'inlet-3'
    variable = superficial_vel_x
    functor = '0.3'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'inlet-1 inlet-2 inlet-3'
    variable = superficial_vel_y
    functor = 0
  []
  [walls-u]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top bottom'
    variable = superficial_vel_x
    momentum_component = 'x'
  []
  [walls-v]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top bottom'
    variable = superficial_vel_y
    momentum_component = 'y'
  []
  [separator-u]
    type = INSFVVelocityHydraulicSeparatorBC
    boundary = 'separator-1 separator-2'
    variable = superficial_vel_x
    momentum_component = 'x'
  []
  [separator-v]
    type = INSFVVelocityHydraulicSeparatorBC
    boundary = 'separator-1 separator-2'
    variable = superficial_vel_y
    momentum_component = 'y'
  []
  [separator-p]
    type = INSFVScalarFieldSeparatorBC
    boundary = 'separator-1 separator-2'
    variable = pressure
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = 0.4
  []
[]
[FunctorMaterials]
  [const]
    type = ADGenericFunctorMaterial
    prop_names = 'porosity'
    prop_values = '1.0'
  []
  [darcy-1]
    type = ADGenericVectorFunctorMaterial
    prop_names = 'Forchheimer_coefficient'
    prop_values = '1.0 1.0 1.0'
    block = 1
  []
  [darcy-2]
    type = ADGenericVectorFunctorMaterial
    prop_names = 'Forchheimer_coefficient'
    prop_values = '2.0 2.0 2.0'
    block = 2
  []
  [darcy-3]
    type = ADGenericVectorFunctorMaterial
    prop_names = 'Forchheimer_coefficient'
    prop_values = '3.0 3.0 3.0'
    block = 3
  []
  [speed]
    type = PINSFVSpeedFunctorMaterial
    superficial_vel_x = superficial_vel_x
    superficial_vel_y = superficial_vel_y
    porosity = porosity
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
  petsc_options_value = ' lu       NONZERO               1e-10'
  line_search = 'none'
  nl_rel_tol = 1e-10
  nl_max_its = 10
[]
[Postprocessors]
  [inlet_p1]
    type = SideAverageValue
    variable = 'pressure'
    boundary = 'inlet-1'
  []
  [inlet_p2]
    type = SideAverageValue
    variable = 'pressure'
    boundary = 'inlet-2'
  []
  [inlet_p3]
    type = SideAverageValue
    variable = 'pressure'
    boundary = 'inlet-3'
  []
  [drop-1]
    type = ParsedPostprocessor
    expression = 'inlet_p1 - outlet'
    pp_names = 'inlet_p1'
    constant_names = 'outlet'
    constant_expressions = '0.4'
  []
  [drop-2]
    type = ParsedPostprocessor
    expression = 'inlet_p2 - outlet'
    pp_names = 'inlet_p2'
    constant_names = 'outlet'
    constant_expressions = '0.4'
  []
  [drop-3]
    type = ParsedPostprocessor
    expression = 'inlet_p3 - outlet'
    pp_names = 'inlet_p3'
    constant_names = 'outlet'
    constant_expressions = '0.4'
  []
[]
[Outputs]
  csv = true
  execute_on = final
[]
(test/tests/auxkernels/divergence_aux/test_fv.i)
[Mesh]
  [cmg]
    type = CartesianMeshGenerator
    dim = 2
    dx = '1.5 1 0.1'
    dy = '1.3 1 0.9'
    ix = '2 4 1'
    iy = '2 3 3'
    subdomain_id = '1 1 1
                    1 2 1
                    1 1 1'
  []
  [add_inner_boundaries_top]
    type = SideSetsAroundSubdomainGenerator
    input = cmg
    new_boundary = 'block_2_top'
    block = 2
    normal = '0 1 0'
  []
  [add_inner_boundaries_bot]
    type = SideSetsAroundSubdomainGenerator
    input = add_inner_boundaries_top
    new_boundary = 'block_2_bot'
    block = 2
    normal = '0 -1 0'
  []
  [add_inner_boundaries_right]
    type = SideSetsAroundSubdomainGenerator
    input = add_inner_boundaries_bot
    new_boundary = 'block_2_right'
    block = 2
    normal = '1 0 0'
  []
  [add_inner_boundaries_left]
    type = SideSetsAroundSubdomainGenerator
    input = add_inner_boundaries_right
    new_boundary = 'block_2_left'
    block = 2
    normal = '-1 0 0'
  []
[]
[Variables]
  [u]
    type = MooseVariableFVReal
  []
  [v]
    type = MooseVariableFVReal
  []
[]
[FVKernels]
  [diff_u]
    type = FVDiffusion
    variable = u
    coeff = 1
  []
  [reaction_u]
    type = FVReaction
    variable = u
  []
  [diff_v]
    type = FVDiffusion
    variable = v
    coeff = 2
  []
  [reaction_v]
    type = FVReaction
    variable = v
  []
[]
[AuxVariables]
  [div]
    type = MooseVariableFVReal
  []
[]
[AuxKernels]
  [divergence]
    type = ADDivergenceAux
    variable = div
    u = 'u'
    v = 'v'
  []
[]
[FVBCs]
  [left]
    type = FVDirichletBC
    variable = u
    boundary = left
    value = 2
  []
  [right]
    type = FVDirichletBC
    variable = u
    boundary = right
    value = 1
  []
  [top]
    type = FVDirichletBC
    variable = v
    boundary = top
    value = 2
  []
  [bottom]
    type = FVDirichletBC
    variable = v
    boundary = bottom
    value = 1
  []
[]
[Executioner]
  type = Steady
  solve_type = PJFNK
  petsc_options_iname = '-pc_type -pc_hypre_type'
  petsc_options_value = 'hypre boomeramg'
[]
[Postprocessors]
  [int_divergence]
    type = ElementL1Error
    block = 2
    variable = div
    function = 0
  []
  [sum_surface_current]
    type = ParsedPostprocessor
    expression = 's1 - s2 + s3 - s4'
    pp_names = 's1 s2 s3 s4'
  []
  [s1]
    type = ADSideIntegralFunctorPostprocessor
    boundary = 'block_2_right'
    functor = 'u'
  []
  [s2]
    type = ADSideIntegralFunctorPostprocessor
    boundary = 'block_2_left'
    functor = 'u'
  []
  [s3]
    type = ADSideIntegralFunctorPostprocessor
    boundary = 'block_2_top'
    functor = 'v'
  []
  [s4]
    type = ADSideIntegralFunctorPostprocessor
    boundary = 'block_2_bot'
    functor = 'v'
  []
[]
[Outputs]
  csv = true
  hide = 's1 s2 s3 s4'
[]
(modules/heat_transfer/test/tests/view_factors/view_factor_3d_non_planar_face.i)
[GlobalParams]
  view_factor_object_name = rt_vf
[]
[Mesh]
  [with_a_non_planar]
    type = ElementGenerator
    nodal_positions = '-1 -1 0
                       1 -1 0
                       1 1 0
                       -1 1 0
                       -1 -1 2
                       1 -1 2
                       1 1 2
                       -1 1 1'
    element_connectivity = '0 1 2 3 4 5 6 7'
    elem_type = 'HEX8'
  []
  [sides]
    type = AllSideSetsByNormalsGenerator
    input = with_a_non_planar
  []
  [rename]
    type = RenameBoundaryGenerator
    input = sides
    old_boundary = '1 2 3 4 5 6'
    new_boundary = 'bottom front left back right top'
  []
[]
[UserObjects]
  [vf_study]
    type = ViewFactorRayStudy
    execute_on = INITIAL
    boundary = 'bottom front left back right top'
    face_order = CONSTANT
    polar_quad_order = 3
    azimuthal_quad_order = 200
    face_type = GAUSS
    warn_non_planar = false
  []
  [rt_vf]
    type = RayTracingViewFactor
    boundary = 'bottom front left back right top'
    execute_on = INITIAL
    ray_study_name = vf_study
    normalize_view_factor = false
  []
[]
[RayBCs]
  [vf]
    type = ViewFactorRayBC
    boundary = 'left right front back bottom top'
  []
[]
## For convenience, the "view_factor_object_name" for these
## PPs are set in global params for switching between methods
[Postprocessors]
  [top_bottom]
    type = ViewFactorPP
    from_boundary = top
    to_boundary = bottom
  []
  [top_left]
    type = ViewFactorPP
    from_boundary = top
    to_boundary = left
  []
  [top_right]
    type = ViewFactorPP
    from_boundary = top
    to_boundary = right
  []
  [top_front]
    type = ViewFactorPP
    from_boundary = top
    to_boundary = front
  []
  [top_back]
    type = ViewFactorPP
    from_boundary = top
    to_boundary = back
  []
  [sum]
    type = ParsedPostprocessor
    expression = 'top_back + top_bottom + top_front + top_right + top_left'
    pp_names = 'top_back top_bottom top_front top_right top_left'
  []
[]
[Problem]
  solve = false
[]
[Executioner]
  type = Steady
  [Quadrature] # higher order quadrature for unobstructed
    order = SECOND
  []
[]
[Outputs]
  csv = true
[]
(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 = SCMTriSubChannelMeshGenerator
    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'
  []
  [fuel_pins]
    type = SCMTriPinMeshGenerator
    input = subchannel
    nrings = ${n_rings}
    n_cells = 50
    unheated_length_exit = ${unheated_length_exit}
    heated_length = ${heated_length}
    pitch = ${fuel_pin_pitch}
  []
[]
[AuxVariables]
  [mdot]
    block = subchannel
  []
  [SumWij]
    block = subchannel
  []
  [P]
    block = subchannel
  []
  [DP]
    block = subchannel
  []
  [h]
    block = subchannel
  []
  [T]
    block = subchannel
  []
  [rho]
    block = subchannel
  []
  [S]
    block = subchannel
  []
  [w_perim]
    block = subchannel
  []
  [mu]
    block = subchannel
  []
  [q_prime_init]
    block = fuel_pins
  []
  [power_history_field]
    block = fuel_pins
  []
  [q_prime]
    block = fuel_pins
  []
  [Tpin]
    block = fuel_pins
  []
  [Dpin]
    block = fuel_pins
  []
  [displacement]
    block = subchannel
  []
[]
[FluidProperties]
  [sodium]
    type = PBSodiumFluidProperties
  []
[]
[Problem]
  type = TriSubChannel1PhaseProblem
  fp = sodium
  n_blocks = 1
  P_out = ${P_out}
  CT = 2.6
  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'
[]
[ICs]
  [S_IC]
    type = SCMTriFlowAreaIC
    variable = S
  []
  [w_perim_IC]
    type = SCMTriWettedPerimIC
    variable = w_perim
  []
  [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}
  []
  [Dpin_ic]
    type = ConstantIC
    variable = Dpin
    value = ${fuel_pin_diameter}
  []
  [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 = SCMPinSolutionTransfer
    to_multi_app = viz
    variable = 'Tpin q_prime'
  []
[]
(modules/combined/test/tests/optimization/compliance_sensitivity/three_materials_thermal.i)
vol_frac = 0.4
cost_frac = 0.4
power = 4
# Stiffness (not optimized in this test)
E0 = 1.0e-6
E1 = 0.2
E2 = 0.6
E3 = 1.0
# Densities
rho0 = 1.0e-6
rho1 = 0.4
rho2 = 0.7
rho3 = 1.0
# Costs
C0 = 1.0e-6
C1 = 0.5
C2 = 0.8
C3 = 1.0
# Thermal conductivity
TC0 = 1.0e-6
TC1 = 0.2
TC2 = 0.6
TC3 = 1.0
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Mesh]
  [MeshGenerator]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 40
    ny = 40
    xmin = 0
    xmax = 40
    ymin = 0
    ymax = 40
  []
  [node]
    type = ExtraNodesetGenerator
    input = MeshGenerator
    new_boundary = hold
    nodes = 0
  []
  [push_left]
    type = ExtraNodesetGenerator
    input = node
    new_boundary = push_left
    coord = '20 0 0'
  []
  [push_center]
    type = ExtraNodesetGenerator
    input = push_left
    new_boundary = push_center
    coord = '40 0 0'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [temp]
    initial_condition = 100.0
  []
[]
[AuxVariables]
  [Dc]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = -1.0
  []
  [Cc]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = -1.0
  []
  [Tc]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = -1.0
  []
  [Cost]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = -1.0
  []
  [mat_den]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = ${vol_frac}
  []
  [thermal_compliance]
    order = CONSTANT
    family = MONOMIAL
  []
[]
# [ICs]
#   [mat_den]
#     type = RandomIC
#     seed = 4
#     variable = mat_den
#     max = '${fparse vol_frac+0.25}'
#     min = '${fparse vol_frac-0.25}'
#   []
# []
[AuxKernels]
  [Cost]
    type = MaterialRealAux
    variable = Cost
    property = Cost_mat
  []
  [thermal_compliance]
    type = MaterialRealAux
    property = thermal_compliance
    variable = thermal_compliance
    execute_on = timestep_end
  []
[]
[Kernels]
  [heat_conduction]
    type = HeatConduction
    variable = temp
    diffusion_coefficient = thermal_cond
  []
  [heat_source]
    type = HeatSource
    value = 1e-2 # W/m^3
    variable = temp
  []
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    strain = SMALL
    add_variables = true
    incremental = false
  []
[]
[BCs]
  [no_y]
    type = DirichletBC
    variable = disp_y
    boundary = hold
    value = 0.0
  []
  [no_x_symm]
    type = DirichletBC
    variable = disp_x
    boundary = right
    value = 0.0
  []
  [top]
    type = DirichletBC
    variable = temp
    boundary = top
    value = 0
  []
  [bottom]
    type = DirichletBC
    variable = temp
    boundary = bottom
    value = 0
  []
  [right]
    type = DirichletBC
    variable = temp
    boundary = right
    value = 0
  []
  [left]
    type = DirichletBC
    variable = temp
    boundary = left
    value = 0
  []
[]
[NodalKernels]
  [push_left]
    type = NodalGravity
    variable = disp_y
    boundary = push_left
    gravity_value = -1e-6 # -3
    mass = 1
  []
  [push_center]
    type = NodalGravity
    variable = disp_y
    boundary = push_center
    gravity_value = -1e-6 # -3
    mass = 1
  []
[]
[Materials]
  [thermal_cond]
    type = DerivativeParsedMaterial
    # ordered multimaterial simp
    expression = "A1:=(${TC0}-${TC1})/(${rho0}^${power}-${rho1}^${power}); "
                 "B1:=${TC0}-A1*${rho0}^${power}; TC1:=A1*mat_den^${power}+B1; "
                 "A2:=(${TC1}-${TC2})/(${rho1}^${power}-${rho2}^${power}); "
                 "B2:=${TC1}-A2*${rho1}^${power}; TC2:=A2*mat_den^${power}+B2; "
                 "A3:=(${TC2}-${TC3})/(${rho2}^${power}-${rho3}^${power}); "
                 "B3:=${TC2}-A3*${rho2}^${power}; TC3:=A3*mat_den^${power}+B3; "
                 "if(mat_den<${rho1},TC1,if(mat_den<${rho2},TC2,TC3))"
    coupled_variables = 'mat_den'
    property_name = thermal_cond
  []
  [thermal_compliance]
    type = ThermalCompliance
    temperature = temp
    thermal_conductivity = thermal_cond
  []
  [elasticity_tensor]
    type = ComputeVariableIsotropicElasticityTensor
    youngs_modulus = E_phys
    poissons_ratio = poissons_ratio
    args = 'mat_den'
  []
  [E_phys]
    type = DerivativeParsedMaterial
    # ordered multimaterial simp
    expression = "A1:=(${E0}-${E1})/(${rho0}^${power}-${rho1}^${power}); "
                 "B1:=${E0}-A1*${rho0}^${power}; E1:=A1*mat_den^${power}+B1; "
                 "A2:=(${E1}-${E2})/(${rho1}^${power}-${rho2}^${power}); "
                 "B2:=${E1}-A2*${rho1}^${power}; E2:=A2*mat_den^${power}+B2; "
                 "A3:=(${E2}-${E3})/(${rho2}^${power}-${rho3}^${power}); "
                 "B3:=${E2}-A3*${rho2}^${power}; E3:=A3*mat_den^${power}+B3; "
                 "if(mat_den<${rho1},E1,if(mat_den<${rho2},E2,E3))"
    coupled_variables = 'mat_den'
    property_name = E_phys
  []
  [Cost_mat]
    type = DerivativeParsedMaterial
    # ordered multimaterial simp
    expression = "A1:=(${C0}-${C1})/(${rho0}^(1/${power})-${rho1}^(1/${power})); "
                 "B1:=${C0}-A1*${rho0}^(1/${power}); C1:=A1*mat_den^(1/${power})+B1; "
                 "A2:=(${C1}-${C2})/(${rho1}^(1/${power})-${rho2}^(1/${power})); "
                 "B2:=${C1}-A2*${rho1}^(1/${power}); C2:=A2*mat_den^(1/${power})+B2; "
                 "A3:=(${C2}-${C3})/(${rho2}^(1/${power})-${rho3}^(1/${power})); "
                 "B3:=${C2}-A3*${rho2}^(1/${power}); C3:=A3*mat_den^(1/${power})+B3; "
                 "if(mat_den<${rho1},C1,if(mat_den<${rho2},C2,C3))"
    coupled_variables = 'mat_den'
    property_name = Cost_mat
  []
  [CostDensity]
    type = ParsedMaterial
    property_name = CostDensity
    coupled_variables = 'mat_den Cost'
    expression = 'mat_den*Cost'
  []
  [poissons_ratio]
    type = GenericConstantMaterial
    prop_names = poissons_ratio
    prop_values = 0.3
  []
  [stress]
    type = ComputeLinearElasticStress
  []
  [dc]
    type = ComplianceSensitivity
    design_density = mat_den
    youngs_modulus = E_phys
  []
  [cc]
    type = CostSensitivity
    design_density = mat_den
    cost = Cost_mat
  []
  [tc]
    type = ThermalSensitivity
    design_density = mat_den
    thermal_conductivity = thermal_cond
    temperature = temp
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[UserObjects]
  [rad_avg]
    type = RadialAverage
    radius = 4
    weights = linear
    prop_name = sensitivity
    execute_on = TIMESTEP_END
    force_preaux = true
  []
  [rad_avg_cost]
    type = RadialAverage
    radius = 4
    weights = linear
    prop_name = cost_sensitivity
    execute_on = TIMESTEP_END
    force_preaux = true
  []
  [rad_avg_thermal]
    type = RadialAverage
    radius = 4
    weights = linear
    prop_name = thermal_sensitivity
    execute_on = TIMESTEP_END
    force_preaux = true
  []
  [update]
    type = DensityUpdateTwoConstraints
    density_sensitivity = Dc
    cost_density_sensitivity = Cc
    cost = Cost
    cost_fraction = ${cost_frac}
    design_density = mat_den
    volume_fraction = ${vol_frac}
    bisection_lower_bound = 0
    bisection_upper_bound = 1.0e12 # 100
    use_thermal_compliance = true
    thermal_sensitivity = Tc
    # Only account for thermal optimizxation
    weight_mechanical_thermal = '0 1'
    relative_tolerance = 1.0e-8
    bisection_move = 0.05
    adaptive_move = false
    execute_on = TIMESTEP_BEGIN
  []
  # Provides Dc
  [calc_sense]
    type = SensitivityFilter
    density_sensitivity = Dc
    design_density = mat_den
    filter_UO = rad_avg
    execute_on = TIMESTEP_END
    force_postaux = true
  []
  # Provides Cc
  [calc_sense_cost]
    type = SensitivityFilter
    density_sensitivity = Cc
    design_density = mat_den
    filter_UO = rad_avg_cost
    execute_on = TIMESTEP_END
    force_postaux = true
  []
  # Provides Tc
  [calc_sense_thermal]
    type = SensitivityFilter
    density_sensitivity = Tc
    design_density = mat_den
    filter_UO = rad_avg_thermal
    execute_on = TIMESTEP_END
    force_postaux = true
  []
[]
[Executioner]
  type = Transient
  solve_type = PJFNK
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu superlu_dist'
  nl_abs_tol = 1e-10
  dt = 1.0
  num_steps = 12
[]
[Outputs]
  [out]
    type = CSV
    execute_on = 'TIMESTEP_END'
  []
  print_linear_residuals = false
[]
[Postprocessors]
  [right_flux]
    type = SideDiffusiveFluxAverage
    variable = temp
    boundary = right
    diffusivity = 10
  []
  [mesh_volume]
    type = VolumePostprocessor
    execute_on = 'initial timestep_end'
  []
  [total_vol]
    type = ElementIntegralVariablePostprocessor
    variable = mat_den
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [vol_frac]
    type = ParsedPostprocessor
    expression = 'total_vol / mesh_volume'
    pp_names = 'total_vol mesh_volume'
  []
  [sensitivity]
    type = ElementIntegralMaterialProperty
    mat_prop = sensitivity
  []
  [cost_sensitivity]
    type = ElementIntegralMaterialProperty
    mat_prop = cost_sensitivity
  []
  [cost]
    type = ElementIntegralMaterialProperty
    mat_prop = CostDensity
  []
  [cost_frac]
    type = ParsedPostprocessor
    expression = 'cost / mesh_volume'
    pp_names = 'cost mesh_volume'
  []
  [objective]
    type = ElementIntegralMaterialProperty
    mat_prop = strain_energy_density
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [objective_thermal]
    type = ElementIntegralMaterialProperty
    mat_prop = thermal_compliance
    execute_on = 'INITIAL TIMESTEP_END'
  []
[]
(test/tests/postprocessors/element_extreme_functor_value/extreme_abs_value.i)
[Mesh]
  [gmg]
    type = GeneratedMeshGenerator
    dim = 1
    xmax = 4
    nx = 36
  []
[]
[Functions]
  [f1]
    type = PiecewiseLinear
    x = '0   0.5 1.5  2.5  3.5 4'
    y = '0.0 0.5 0.0 -1.5 -0.5 0.0'
    axis = X
  []
  [f2]
    type = PiecewiseLinear
    x = '0   0.5 1.5  2.5  3.5 4'
    y = '1.0 0.0 -1.0 0.0  0.5 1.0'
    axis = X
  []
[]
[Postprocessors]
  [f1_max]
    type = ElementExtremeFunctorValue
    functor = f1
    value_type = MAX_ABS
    execute_on = 'initial timestep_end'
  []
  [f2_proxy_max]
    type = ElementExtremeFunctorValue
    functor = f2
    proxy_functor = f1
    value_type = MAX_ABS
    execute_on = 'initial timestep_end'
  []
  [test]
    type = ParsedPostprocessor
    expression = 'abs(f1_max + 1.5) + abs(f2_proxy_max)'
    pp_names = 'f1_max f2_proxy_max'
    execute_on = 'initial timestep_end'
  []
[]
[UserObjects]
  [kill]
    type = Terminator
    expression = 'test > 0'
    error_level = ERROR
    fail_mode = HARD
  []
[]
[Problem]
  solve = false
[]
[Executioner]
  type = Steady
[]
(modules/porous_flow/test/tests/sinks/s04.i)
# apply a piecewise-linear sink flux and observe the correct behavior
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = 0
  xmax = 1
  ymin = 0
  ymax = 1
  zmin = 0
  zmax = 2
[]
[GlobalParams]
  PorousFlowDictator = dictator
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = 'pp'
    number_fluid_phases = 1
    number_fluid_components = 1
  []
  [pc]
    type = PorousFlowCapillaryPressureVG
    m = 0.5
    alpha = 1
  []
[]
[Variables]
  [pp]
  []
[]
[ICs]
  [pp]
    type = FunctionIC
    variable = pp
    function = y+1
  []
[]
[Kernels]
  [mass0]
    type = PorousFlowMassTimeDerivative
    fluid_component = 0
    variable = pp
  []
[]
[FluidProperties]
  [simple_fluid]
    type = SimpleFluidProperties
    bulk_modulus = 1.3
    density0 = 1.1
    thermal_expansion = 0
    viscosity = 1.1
  []
[]
[Materials]
  [temperature]
    type = PorousFlowTemperature
  []
  [ppss]
    type = PorousFlow1PhaseP
    porepressure = pp
    capillary_pressure = pc
  []
  [massfrac]
    type = PorousFlowMassFraction
  []
  [simple_fluid]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid
    phase = 0
  []
  [porosity]
    type = PorousFlowPorosityConst
    porosity = 0.1
  []
  [permeability]
    type = PorousFlowPermeabilityConst
    permeability = '1E-5 0 0 0 1E-5 0 0 0 1E-5'
  []
  [relperm]
    type = PorousFlowRelativePermeabilityCorey
    n = 2
    phase = 0
  []
[]
[AuxVariables]
  [flux_out]
  []
  [xval]
  []
  [yval]
  []
  [pt_shift]
    initial_condition = 0.3
  []
[]
[ICs]
  [xval]
    type = FunctionIC
    variable = xval
    function = x
  []
  [yval]
    type = FunctionIC
    variable = yval
    function = y
  []
[]
[Postprocessors]
  [p00]
    type = PointValue
    point = '0 0 0'
    variable = pp
    execute_on = 'initial timestep_end'
  []
  [p10]
    type = PointValue
    point = '1 0 0'
    variable = pp
    execute_on = 'initial timestep_end'
  []
  [m10]
    type = ParsedPostprocessor
    expression = 'vol*por*dens0*exp(p10/bulk)'
    constant_names = 'vol por dens0 bulk'
    constant_expressions = '0.25 0.1 1.1 1.3'
    pp_names = p10
    execute_on = 'initial timestep_end'
  []
  [dm10]
    type = ChangeOverTimePostprocessor
    postprocessor = m10
    outputs = none
  []
  [m10_prev]
    type = ParsedPostprocessor
    expression = 'm10 - dm10'
    pp_names = 'm10 dm10'
    outputs = 'console'
  []
  [m10_rate]
    type = ParsedPostprocessor
    expression = 'fcn*if(p10>0.8,1,if(p10<0.3,0.5,0.2+p10))'
    constant_names = 'fcn'
    constant_expressions = '8'
    pp_names = 'p10'
  []
  [m10_expect]
    type = ParsedPostprocessor
    expression = 'm10_prev-m10_rate*area*dt'
    constant_names = 'area dt'
    constant_expressions = '0.5 1E-3'
    pp_names = 'm10_prev m10_rate'
  []
  [p01]
    type = PointValue
    point = '0 1 0'
    variable = pp
    execute_on = 'initial timestep_end'
  []
  [p11]
    type = PointValue
    point = '1 1 0'
    variable = pp
    execute_on = 'initial timestep_end'
  []
  [m11]
    type = ParsedPostprocessor
    expression = 'vol*por*dens0*exp(p11/bulk)'
    constant_names = 'vol por dens0 bulk'
    constant_expressions = '0.25 0.1 1.1 1.3'
    pp_names = 'p11'
    execute_on = 'initial timestep_end'
  []
  [dm11]
    type = ChangeOverTimePostprocessor
    postprocessor = m11
    outputs = none
  []
  [m11_prev]
    type = ParsedPostprocessor
    expression = 'm11 - dm11'
    pp_names = 'm11 dm11'
    outputs = 'console'
  []
  [m11_rate]
    type = ParsedPostprocessor
    expression = 'fcn*if(p11>0.8,1,if(p11<0.3,0.5,0.2+p11))'
    constant_names = 'fcn'
    constant_expressions = '8'
    pp_names = 'p11'
  []
  [m11_expect]
    type = ParsedPostprocessor
    expression = 'm11_prev-m11_rate*area*dt'
    constant_names = 'area dt'
    constant_expressions = '0.5 1E-3'
    pp_names = 'm11_prev m11_rate'
  []
[]
[BCs]
  [flux]
    type = PorousFlowPiecewiseLinearSink
    boundary = 'right'
    PT_shift = pt_shift
    pt_vals = '0.0 0.5'
    multipliers = '0.5 1'
    variable = pp
    use_mobility = false
    use_relperm = false
    fluid_phase = 0
    flux_function = 8
    save_in = flux_out
  []
[]
[Preconditioning]
  [andy]
    type = SMP
    full = true
    petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -snes_max_it -sub_pc_factor_shift_type -pc_asm_overlap'
    petsc_options_value = 'gmres asm lu 10000 NONZERO 2'
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  dt = 1E-3
  end_time = 1E-2
  nl_rel_tol = 1E-12
  nl_abs_tol = 1E-12
[]
[Outputs]
  file_base = s04
  [console]
    type = Console
    execute_on = 'nonlinear linear'
  []
  [csv]
    type = CSV
    execute_on = 'timestep_end'
  []
[]
(modules/navier_stokes/examples/laser-welding/2d-fv.i)
period=.2e-4 # s
endtime=${fparse 3 * period} # s
timestep=${fparse period / 100} # s
surfacetemp=2700 # K
bottomtemp=2700 # K
sb=5.67e-8 # W/(m^2 K^4)
advected_interp_method='upwind'
velocity_interp_method='rc'
rho='rho'
mu='mu'
[GlobalParams]
  rhie_chow_user_object = 'rc'
[]
[Mesh]
  type = GeneratedMesh
  dim = 2
  xmin = -.7e-3 # m
  xmax = 0.7e-3 # m
  ymin = -.35e-3 # m
  ymax = 0
  nx = 75
  ny = 20
  displacements = 'disp_x disp_y'
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = vel_x
    v = vel_y
    pressure = pressure
    use_displaced_mesh = true
    disp_x = disp_x
    disp_y = disp_y
  []
[]
[Problem]
  extra_tag_vectors = 'e_time e_advection e_conduction e_laser e_radiation e_mesh_advection'
[]
[AuxVariables]
  [mu_out]
    type = MooseVariableFVReal
  []
  [e_time]
    type = MooseVariableFVReal
  []
  [e_advection]
    type = MooseVariableFVReal
  []
  [e_mesh_advection]
    type = MooseVariableFVReal
  []
  [e_conduction]
    type = MooseVariableFVReal
  []
  [e_laser]
    type = MooseVariableFVReal
  []
  [e_radiation]
    type = MooseVariableFVReal
  []
[]
[AuxKernels]
  [mu_out]
    type = FunctorAux
    functor = mu
    variable = mu_out
    execute_on = timestep_end
  []
  [e_time]
    type = TagVectorAux
    variable = e_time
    vector_tag = e_time
    v = T
  []
  [e_advection]
    type = TagVectorAux
    variable = e_advection
    vector_tag = e_advection
    v = T
  []
  [e_mesh_advection]
    type = TagVectorAux
    variable = e_mesh_advection
    vector_tag = e_mesh_advection
    v = T
  []
  [e_conduction]
    type = TagVectorAux
    variable = e_conduction
    vector_tag = e_conduction
    v = T
  []
  [e_laser]
    type = TagVectorAux
    variable = e_laser
    vector_tag = e_laser
    v = T
  []
  [e_radiation]
    type = TagVectorAux
    variable = e_radiation
    vector_tag = e_radiation
    v = T
  []
[]
[Variables]
  [vel_x]
    type = INSFVVelocityVariable
  []
  [vel_y]
    type = INSFVVelocityVariable
  []
  [T]
    type = INSFVEnergyVariable
  []
  [pressure]
    type = INSFVPressureVariable
  []
  [disp_x]
  []
  [disp_y]
  []
[]
[ICs]
  [T]
    type = FunctionIC
    variable = T
    function = '${surfacetemp} + ((${surfacetemp} - ${bottomtemp}) / .35e-3) * y'
  []
[]
[Kernels]
  [disp_x]
    type = MatDiffusion
    variable = disp_x
    diffusivity = 1e6
  []
  [disp_y]
    type = MatDiffusion
    variable = disp_y
    diffusivity = 1e6
  []
[]
[FVKernels]
  # pressure equation
  [mass]
    type = INSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    use_displaced_mesh = true
    boundaries_to_force = top
  []
  # momentum equations
  # u equation
  [u_time]
    type = INSFVMomentumTimeDerivative
    variable = vel_x
    rho = ${rho}
    momentum_component = 'x'
    use_displaced_mesh = true
  []
  [u_advection]
    type = INSFVMomentumAdvection
    variable = vel_x
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'x'
    use_displaced_mesh = true
  []
  [u_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_x
    mu = ${mu}
    momentum_component = 'x'
    use_displaced_mesh = true
  []
  [u_pressure]
    type = INSFVMomentumPressureFlux
    variable = vel_x
    momentum_component = 'x'
    pressure = pressure
    use_displaced_mesh = true
  []
  [u_mesh_advection_volumetric]
    type = INSFVMomentumMeshAdvection
    variable = vel_x
    momentum_component = 'x'
    rho = ${rho}
    disp_x = disp_x
    disp_y = disp_y
    add_to_a = false
    use_displaced_mesh = true
  []
  # v equation
  [v_time]
    type = INSFVMomentumTimeDerivative
    variable = vel_y
    rho = ${rho}
    momentum_component = 'y'
    use_displaced_mesh = true
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = vel_y
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'y'
    use_displaced_mesh = true
  []
  [v_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_y
    mu = ${mu}
    momentum_component = 'y'
    use_displaced_mesh = true
  []
  [v_pressure]
    type = INSFVMomentumPressureFlux
    variable = vel_y
    momentum_component = 'y'
    pressure = pressure
    use_displaced_mesh = true
  []
  [v_mesh_advection_volumetric]
    type = INSFVMomentumMeshAdvection
    variable = vel_y
    momentum_component = 'y'
    rho = ${rho}
    disp_x = disp_x
    disp_y = disp_y
    add_to_a = false
    use_displaced_mesh = true
  []
  # energy equation
  [temperature_time]
    type = INSFVEnergyTimeDerivative
    variable = T
    rho = ${rho}
    dh_dt = dh_dt
    use_displaced_mesh = true
    extra_vector_tags = 'e_time'
  []
  [temperature_advection]
    type = INSFVEnergyAdvection
    variable = T
    use_displaced_mesh = true
    extra_vector_tags = 'e_advection'
  []
  [temperature_conduction]
    type = FVDiffusion
    coeff = 'k'
    variable = T
    use_displaced_mesh = true
    extra_vector_tags = 'e_conduction'
  []
  [temperature_mesh_advection_volumetric]
    type = INSFVMeshAdvection
    variable = T
    rho = ${rho}
    disp_x = disp_x
    disp_y = disp_y
    advected_quantity = 'h'
    use_displaced_mesh = true
    extra_vector_tags = 'e_mesh_advection'
  []
[]
[FVBCs]
  # momentum boundary conditions
  [no_slip_x]
    type = INSFVNoSlipWallBC
    variable = vel_x
    boundary = 'bottom right left'
    function = 0
  []
  [no_slip_y]
    type = INSFVNoSlipWallBC
    variable = vel_y
    boundary = 'bottom right left'
    function = 0
  []
  [vapor_recoil_x]
    type = INSFVVaporRecoilPressureMomentumFluxBC
    variable = vel_x
    boundary = 'top'
    momentum_component = 'x'
    rc_pressure = rc_pressure
    use_displaced_mesh = true
  []
  [vapor_recoil_y]
    type = INSFVVaporRecoilPressureMomentumFluxBC
    variable = vel_y
    boundary = 'top'
    momentum_component = 'y'
    rc_pressure = rc_pressure
    use_displaced_mesh = true
  []
  # energy boundary conditions
  [T_cold]
    type = FVDirichletBC
    variable = T
    boundary = 'bottom'
    value = '${bottomtemp}'
  []
  [radiation_flux]
    type = FVFunctorRadiativeBC
    variable = T
    boundary = 'top'
    emissivity = '1'
    Tinfinity = 300
    stefan_boltzmann_constant = ${sb}
    use_displaced_mesh = true
    extra_vector_tags = 'e_radiation'
  []
  [weld_flux]
    type = FVGaussianEnergyFluxBC
    variable = T
    boundary = 'top'
    P0 = 159.96989792079225
    R = 1.25e-4
    x_beam_coord = '2e-4 * sin(t * 2 * pi / ${period})'
    y_beam_coord = 0
    z_beam_coord = 0
    use_displaced_mesh = true
    extra_vector_tags = 'e_laser'
  []
[]
[BCs]
  # displacement boundary conditions
  [x_no_disp]
    type = DirichletBC
    variable = disp_x
    boundary = 'bottom'
    value = 0
  []
  [y_no_disp]
    type = DirichletBC
    variable = disp_y
    boundary = 'bottom'
    value = 0
  []
  [displace_x_top]
    type = INSADDisplaceBoundaryBC
    boundary = 'top'
    variable = 'disp_x'
    velocity = 'vel'
    component = 0
    associated_subdomain = 0
  []
  [displace_y_top]
    type = INSADDisplaceBoundaryBC
    boundary = 'top'
    variable = 'disp_y'
    velocity = 'vel'
    component = 1
    associated_subdomain = 0
  []
  [displace_x_top_dummy]
    type = INSADDummyDisplaceBoundaryIntegratedBC
    boundary = 'top'
    variable = 'disp_x'
    velocity = 'vel'
    component = 0
  []
  [displace_y_top_dummy]
    type = INSADDummyDisplaceBoundaryIntegratedBC
    boundary = 'top'
    variable = 'disp_y'
    velocity = 'vel'
    component = 1
  []
[]
[FunctorMaterials]
  [steel]
    type = AriaLaserWeld304LStainlessSteelFunctorMaterial
    temperature = T
    beta = 1e7
  []
  [disp_vec_value_and_dot]
    type = ADGenericVectorFunctorMaterial
    prop_names = 'disp_vec'
    prop_values = 'disp_x disp_y 0'
  []
  [vel]
    type = ADGenericVectorFunctorMaterial
    prop_names = 'vel'
    prop_values = 'vel_x vel_y 0'
  []
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
    petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_type -mat_mffd_err'
    petsc_options_value = 'lu       NONZERO               strumpack                  1e-6'
  []
[]
[Executioner]
  type = Transient
  end_time = ${endtime}
  dtmin = 1e-8
  dtmax = ${timestep}
  petsc_options = '-snes_converged_reason -ksp_converged_reason -options_left'
  solve_type = 'PJFNK'
  line_search = 'none'
  nl_max_its = 12
  l_max_its = 100
  [TimeStepper]
    type = IterationAdaptiveDT
    optimal_iterations = 7
    dt = ${timestep}
    linear_iteration_ratio = 1e6
    growth_factor = 1.1
  []
[]
[Outputs]
  exodus = true
  csv = true
[]
[Debug]
  show_var_residual_norms = true
[]
[Postprocessors]
  [laser_flux]
    type = TagVectorSum
    vector = 'e_laser'
  []
  [volume_rho_cp_dT]
    type = TagVectorSum
    vector = 'e_time'
  []
  [conduction]
    type = TagVectorSum
    vector = 'e_conduction'
  []
  [advection]
    type = TagVectorSum
    vector = 'e_advection'
  []
  [mesh_advection]
    type = TagVectorSum
    vector = 'e_mesh_advection'
  []
  [radiation]
    type = TagVectorSum
    vector = 'e_radiation'
  []
  [total_sum]
    type = ParsedPostprocessor
    expression = 'laser_flux + volume_rho_cp_dT + advection + mesh_advection + conduction + radiation'
    pp_names = 'laser_flux volume_rho_cp_dT advection mesh_advection conduction radiation'
  []
[]
(modules/navier_stokes/examples/flow-over-circle/postprocessors.i)
[Postprocessors]
  [Re]
    type = ParsedPostprocessor
    expression = 'rho * U * D / mu'
    constant_names = 'rho U D mu'
    constant_expressions = '${rho} ${fparse 2/3*inlet_velocity} ${fparse 2*circle_radius} ${mu}'
  []
  [point_vel_x]
    type = PointValue
    point = '${fparse (x_max-x_min)/2} ${fparse (y_max-y_min)/2} 0'
    variable = 'vel_x'
  []
  [point_vel_y]
    type = PointValue
    point = '${fparse (x_max-x_min)/2} ${fparse (y_max-y_min)/2} 0'
    variable = 'vel_y'
  []
  [drag_force]
    type = IntegralDirectedSurfaceForce
    vel_x = vel_x
    vel_y = vel_y
    mu = ${mu}
    pressure = pressure
    principal_direction = '1 0 0'
    boundary = 'circle'
    outputs = none
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [drag_coeff]
    type = ParsedPostprocessor
    expression = '2*drag_force/rho/(avgvel*avgvel)/D'
    constant_names = 'rho avgvel D'
    constant_expressions = '${rho} ${fparse 2/3*inlet_velocity} ${fparse 2*circle_radius}'
    pp_names = 'drag_force'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [lift_force]
    type = IntegralDirectedSurfaceForce
    vel_x = vel_x
    vel_y = vel_y
    mu = ${mu}
    pressure = pressure
    principal_direction = '0 1 0'
    boundary = 'circle'
    outputs = none
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [lift_coeff]
    type = ParsedPostprocessor
    expression = '2*lift_force/rho/(avgvel*avgvel)/D'
    constant_names = 'rho avgvel D'
    constant_expressions = '${rho} ${fparse 2/3*inlet_velocity} ${fparse 2*circle_radius}'
    pp_names = 'lift_force'
    execute_on = 'INITIAL TIMESTEP_END'
  []
[]
(modules/solid_mechanics/test/tests/strain_adjusted_density/exact_2drz.i)
x_length = 0.2
y_length = 0.1
[Mesh]
  [mesh]
    type = ExamplePatchMeshGenerator
    dim = 2
    x_length = ${x_length}
    y_length = ${y_length}
  []
  coord_type = 'RZ'
[]
[Problem]
  solve = false
[]
[AuxVariables]
  [disp_r]
    initial_condition = 0
  []
  [disp_z]
    initial_condition = 0
  []
[]
[AuxKernels]
  [disp_r_aux]
    type = ParsedAux
    variable = disp_r
    expression = 't * 1e-2 * x'
    use_xyzt = true
  []
  [disp_z_aux]
    type = ParsedAux
    variable = disp_z
    expression = 't * 2e-2 * y'
    use_xyzt = true
  []
[]
[Materials]
  [some_density]
    type = ParsedMaterial
    property_name = some_density
    expression = t
    extra_symbols = t
    outputs = all
  []
  [density]
    type = StrainAdjustedDensity
    strain_free_density = some_density
    displacements = 'disp_r disp_z'
    outputs = all
  []
[]
[Executioner]
  type = Transient
  num_steps = 10
[]
[Postprocessors]
  [disp_r]
    type = SideAverageValue
    variable = disp_r
    boundary = right
  []
  [disp_z]
    type = SideAverageValue
    variable = disp_z
    boundary = top
  []
  [some_density]
    type = ElementAverageValue
    variable = some_density
  []
  [density]
    type = ElementAverageValue
    variable = density
  []
  [density_exact]
    type = ParsedPostprocessor
    pp_names = 'disp_r disp_z'
    expression = 't / (1 + disp_r / ${x_length})^2 / (1 + disp_z / ${y_length})'
    use_t = true
    outputs = console
  []
  [density_diff]
    type = ParsedPostprocessor
    expression = '(density_exact - density) / density_exact'
    pp_names = 'density density_exact'
    outputs = console
  []
  [density_diff_max]
    type = TimeExtremeValue
    postprocessor = density_diff
    value_type = ABS_MAX
  []
[]
[Outputs]
  csv = true
[]
(test/tests/postprocessors/side_average_value/side_average_functor_test.i)
[Mesh]
  inactive = 'refine'
  # U-shaped domains to have internal boundaries in
  # a variety of directions
  [cmg]
    type = CartesianMeshGenerator
    dim = 2
    dx = '1 1 1'
    dy = '3 1'
    ix = '4 5 3'
    iy = '12 4'
    subdomain_id = '1 2 1
                    1 1 1'
  []
  [internal_boundary_dir1]
    type = SideSetsBetweenSubdomainsGenerator
    input = cmg
    primary_block = 1
    paired_block = 2
    new_boundary = 'inside_1'
  []
  [internal_boundary_dir2]
    type = SideSetsBetweenSubdomainsGenerator
    input = internal_boundary_dir1
    primary_block = 2
    paired_block = 1
    new_boundary = 'inside_2'
  []
  [refine]
    type = RefineBlockGenerator
    input = internal_boundary_dir2
    block = '1 2'
    refinement = '2 1'
  []
[]
[Variables]
  [u]
    type = MooseVariableFVReal
    block = 1
  []
[]
[AuxVariables]
  [v1]
    type = MooseVariableFVReal
    block = 1
    [FVInitialCondition]
      type = FVFunctionIC
      function = 'x + y'
    []
  []
  [v2]
    type = MooseVariableFVReal
    block = 2
    [FVInitialCondition]
      type = FVFunctionIC
      function = '2*x*x - y'
    []
  []
[]
[Functions]
  [f1]
    type = ParsedFunction
    expression = 'exp(x - y)'
  []
[]
[FunctorMaterials]
  [m1]
    type = ADGenericFunctorMaterial
    prop_names = 'm1'
    prop_values = 'f1'
  []
  [m2]
    type = ADPiecewiseByBlockFunctorMaterial
    prop_name = 'm2'
    subdomain_to_prop_value = '1 12
                               2 4'
  []
[]
[FVKernels]
  [diff]
    type = FVDiffusion
    variable = u
    coeff = '1'
  []
[]
[FVBCs]
  [left]
    type = FVDirichletBC
    variable = u
    boundary = 3
    value = 0
  []
  [right]
    type = FVDirichletBC
    variable = u
    boundary = 1
    value = 1
  []
[]
[Executioner]
  type = Steady
  solve_type = 'PJFNK'
[]
[Postprocessors]
  # Mesh external boundaries integration
  [ext_u]
    type = SideAverageFunctorPostprocessor
    boundary = 'left top right'
    functor = u
    restrict_to_functors_domain = true
  []
  [ext_u_int]
    type = ADSideIntegralFunctorPostprocessor
    boundary = 'left top right'
    functor = u
    restrict_to_functors_domain = true
  []
  [ext_u_area]
    type = AreaPostprocessor
    boundary = 'left top right'
  []
  [ext_u_diff]
    type = ParsedPostprocessor
    pp_names = 'ext_u ext_u_int ext_u_area'
    expression = 'ext_u - ext_u_int/ext_u_area'
  []
  [ext_v1]
    type = SideAverageFunctorPostprocessor
    boundary = 'left right'
    functor = v1
  []
  [ext_v2]
    type = SideAverageFunctorPostprocessor
    boundary = 'top'
    functor = v2
    restrict_to_functors_domain = true
  []
  [ext_f1]
    type = SideAverageFunctorPostprocessor
    boundary = 'left top right'
    functor = f1
    prefactor = f1
  []
  [ext_m1]
    type = SideAverageFunctorPostprocessor
    boundary = 'left top right'
    functor = m1
    restrict_to_functors_domain = true
  []
  [ext_m2]
    type = SideAverageFunctorPostprocessor
    boundary = 'left top right'
    functor = m2
    restrict_to_functors_domain = true
  []
  # Internal to the mesh, but a side to the variables
  # With orientation of normal 1->2
  [int_s1_u]
    type = SideAverageFunctorPostprocessor
    boundary = inside_1
    functor = u
  []
  [int_s1_v1]
    type = SideAverageFunctorPostprocessor
    boundary = inside_1
    functor = v1
  []
  [int_s1_f1]
    type = SideAverageFunctorPostprocessor
    boundary = inside_1
    functor = f1
  []
  [int_s1_m1]
    type = SideAverageFunctorPostprocessor
    boundary = inside_1
    functor = m1
  []
  [int_s1_m2]
    type = SideAverageFunctorPostprocessor
    boundary = inside_1
    functor = m2
  []
  # With orientation of normal 2->1
  [int_s2_v2]
    type = SideAverageFunctorPostprocessor
    boundary = inside_2
    functor = v2
  []
  [int_s2_f1]
    type = SideAverageFunctorPostprocessor
    boundary = inside_2
    functor = f1
  []
  [int_s2_m1]
    type = SideAverageFunctorPostprocessor
    boundary = inside_2
    functor = m1
  []
  [int_s2_m2]
    type = SideAverageFunctorPostprocessor
    boundary = inside_2
    functor = m2
  []
[]
[Outputs]
  csv = true
  exodus = true
[]
[Problem]
  kernel_coverage_check = false
[]
(modules/heat_transfer/test/tests/gap_heat_transfer_balance/large_gap_heat_transfer_test_cylinder.i)
rpv_core_gap_size = 0.15
core_outer_radius = 2
rpv_inner_radius = ${fparse 2 + rpv_core_gap_size}
rpv_outer_radius = ${fparse 2.5 + rpv_core_gap_size}
rpv_outer_htc = 10 # W/m^2/K
rpv_outer_Tinf = 300 # K
core_blocks = '1'
rpv_blocks = '3'
[Mesh]
  [core_gap_rpv]
    type = ConcentricCircleMeshGenerator
    num_sectors = 10
    radii = '${core_outer_radius} ${rpv_inner_radius} ${rpv_outer_radius}'
    rings = '2 1 2'
    has_outer_square = false
    preserve_volumes = true
    portion = full
  []
  [rename_core_bdy]
    type = SideSetsBetweenSubdomainsGenerator
    input = core_gap_rpv
    primary_block = 1
    paired_block = 2
    new_boundary = 'core_outer'
  []
  [rename_inner_rpv_bdy]
    type = SideSetsBetweenSubdomainsGenerator
    input = rename_core_bdy
    primary_block = 3
    paired_block = 2
    new_boundary = 'rpv_inner'
  []
  [2d_mesh]
    type = BlockDeletionGenerator
    input = rename_inner_rpv_bdy
    block = 2
  []
[]
[Variables]
  [Tsolid]
    initial_condition = 500
  []
[]
[Kernels]
  [heat_source]
    type = CoupledForce
    variable = Tsolid
    block = '${core_blocks}'
    v = power_density
  []
  [heat_conduction]
    type = HeatConduction
    variable = Tsolid
  []
[]
[BCs]
  [RPV_out_BC] # k \nabla T = h (T- T_inf) at RPV outer boundary
    type = ConvectiveFluxFunction # (Robin BC)
    variable = Tsolid
    boundary = 'outer' # outer RPV
    coefficient = ${rpv_outer_htc}
    T_infinity = ${rpv_outer_Tinf}
  []
[]
[ThermalContact]
  [RPV_gap]
    type = GapHeatTransfer
    gap_geometry_type = 'CYLINDER'
    emissivity_primary = 0.8
    emissivity_secondary = 0.8
    variable = Tsolid
    primary = 'core_outer'
    secondary = 'rpv_inner'
    gap_conductivity = 0.1
    quadrature = true
    cylinder_axis_point_1 = '0 0 0'
    cylinder_axis_point_2 = '0 0 5'
  []
[]
[AuxVariables]
  [power_density]
    block = '${core_blocks}'
    initial_condition = 50e3
  []
[]
[Materials]
  [simple_mat]
    type = HeatConductionMaterial
    thermal_conductivity = 34.6 # W/m/K
  []
[]
[Postprocessors]
  [Tcore_avg]
    type = ElementAverageValue
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Tcore_max]
    type = ElementExtremeValue
    value_type = max
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Tcore_min]
    type = ElementExtremeValue
    value_type = min
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Trpv_avg]
    type = ElementAverageValue
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [Trpv_max]
    type = ElementExtremeValue
    value_type = max
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [Trpv_min]
    type = ElementExtremeValue
    value_type = min
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [ptot]
    type = ElementIntegralVariablePostprocessor
    variable = power_density
    block = '${core_blocks}'
  []
  [rpv_convective_out]
    type = ConvectiveHeatTransferSideIntegral
    T_solid = Tsolid
    boundary = 'outer' # outer RVP
    T_fluid = ${rpv_outer_Tinf}
    htc = ${rpv_outer_htc}
  []
  [heat_balance] # should be equal to 0 upon convergence
    type = ParsedPostprocessor
    expression = '(rpv_convective_out - ptot) / ptot'
    pp_names = 'rpv_convective_out ptot'
  []
[]
[Executioner]
  type = Steady
  automatic_scaling = true
  compute_scaling_once = false
  petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart '
  petsc_options_value = 'hypre boomeramg 100'
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-10
  l_max_its = 100
  [Quadrature]
    side_order = seventh
  []
  line_search = none
[]
[Outputs]
  exodus = false
  csv = true
[]
(modules/electromagnetics/test/tests/kernels/vector_helmholtz/microwave_heating.i)
# Test for EMJouleHeatingSource
# Manufactured solution: E_real = cos(pi*y) * x_hat - cos(pi*x) * y_hat
#                        E_imag = sin(pi*y) * x_hat - sin(pi*x) * y_hat
#                        n = x^2*y^2
[Mesh]
  [gmg]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 5
    ny = 5
    xmin = -1
    ymin = -1
    elem_type = QUAD9
  []
[]
[Functions]
  #The exact solution for the heated species and electric field real and imag. component
  [exact_real]
    type = ParsedVectorFunction
    expression_x = 'cos(pi*y)'
    expression_y = '-cos(pi*x)'
  []
  [exact_imag]
    type = ParsedVectorFunction
    expression_x = 'sin(pi*y)'
    expression_y = '-sin(pi*x)'
  []
  [exact_n]
    type = ParsedFunction
    expression = 'x^2*y^2'
  []
  #The forcing terms for the heated species and electric field real and imag. component
  [source_real]
    type = ParsedVectorFunction
    symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
    symbol_values = 'omega   mu   epsilon   sigma   omega   mu   epsilon   sigma'
    expression_x = '-epsilon_i*mu_i*omega_i^2*cos(pi*y) - 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*y) + epsilon_i*mu_i*omega_r^2*cos(pi*y) - epsilon_i*mu_r*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_r*omega_r^2*sin(pi*y) - epsilon_r*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_r*mu_i*omega_r^2*sin(pi*y) + epsilon_r*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_r*omega_r^2*cos(pi*y) + mu_i*omega_i*sigma_i*cos(pi*y) + mu_i*omega_i*sigma_r*sin(pi*y) + mu_i*omega_r*sigma_i*sin(pi*y) - mu_i*omega_r*sigma_r*cos(pi*y) + mu_r*omega_i*sigma_i*sin(pi*y) - mu_r*omega_i*sigma_r*cos(pi*y) - mu_r*omega_r*sigma_i*cos(pi*y) - mu_r*omega_r*sigma_r*sin(pi*y) + pi^2*cos(pi*y)'
    expression_y = 'epsilon_i*mu_i*omega_i^2*cos(pi*x) + 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*x) - epsilon_i*mu_i*omega_r^2*cos(pi*x) + epsilon_i*mu_r*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_r*omega_r^2*sin(pi*x) + epsilon_r*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_r*mu_i*omega_r^2*sin(pi*x) - epsilon_r*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_r*omega_r^2*cos(pi*x) - mu_i*omega_i*sigma_i*cos(pi*x) - mu_i*omega_i*sigma_r*sin(pi*x) - mu_i*omega_r*sigma_i*sin(pi*x) + mu_i*omega_r*sigma_r*cos(pi*x) - mu_r*omega_i*sigma_i*sin(pi*x) + mu_r*omega_i*sigma_r*cos(pi*x) + mu_r*omega_r*sigma_i*cos(pi*x) + mu_r*omega_r*sigma_r*sin(pi*x) - pi^2*cos(pi*x)'
  []
  [source_imag]
    type = ParsedVectorFunction
    symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
    symbol_values = 'omega   mu   epsilon   sigma   omega   mu   epsilon   sigma'
    expression_x = '-epsilon_i*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_i*omega_r^2*sin(pi*y) + epsilon_i*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_i*mu_r*omega_r^2*cos(pi*y) + epsilon_r*mu_i*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_i*omega_r^2*cos(pi*y) + epsilon_r*mu_r*omega_i^2*sin(pi*y) - 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*y) - epsilon_r*mu_r*omega_r^2*sin(pi*y) + mu_i*omega_i*sigma_i*sin(pi*y) - mu_i*omega_i*sigma_r*cos(pi*y) - mu_i*omega_r*sigma_i*cos(pi*y) - mu_i*omega_r*sigma_r*sin(pi*y) - mu_r*omega_i*sigma_i*cos(pi*y) - mu_r*omega_i*sigma_r*sin(pi*y) - mu_r*omega_r*sigma_i*sin(pi*y) + mu_r*omega_r*sigma_r*cos(pi*y) + pi^2*sin(pi*y)'
    expression_y = 'epsilon_i*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_i*omega_r^2*sin(pi*x) - epsilon_i*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_i*mu_r*omega_r^2*cos(pi*x) - epsilon_r*mu_i*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_i*omega_r^2*cos(pi*x) - epsilon_r*mu_r*omega_i^2*sin(pi*x) + 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*x) + epsilon_r*mu_r*omega_r^2*sin(pi*x) - mu_i*omega_i*sigma_i*sin(pi*x) + mu_i*omega_i*sigma_r*cos(pi*x) + mu_i*omega_r*sigma_i*cos(pi*x) + mu_i*omega_r*sigma_r*sin(pi*x) + mu_r*omega_i*sigma_i*cos(pi*x) + mu_r*omega_i*sigma_r*sin(pi*x) + mu_r*omega_r*sigma_i*sin(pi*x) - mu_r*omega_r*sigma_r*cos(pi*x) - pi^2*sin(pi*x)'
  []
  [source_n]
    type = ParsedFunction
    symbol_names = 'sigma_r'
    symbol_values = 'sigma'
    expression = '-2*x^2 - 2*y^2 - 0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
  []
  #Material Coefficients
  [omega]
    type = ParsedFunction
    expression = '2.0'
  []
  [mu]
    type = ParsedFunction
    expression = '1.0'
  []
  [epsilon]
    type = ParsedFunction
    expression = '3.0'
  []
  [sigma]
    type = ParsedFunction
    expression = '4.0'
    #expression = 'x^2*y^2'
  []
[]
[Materials]
  [WaveCoeff]
    type = WaveEquationCoefficient
    eps_rel_imag = eps_imag
    eps_rel_real = eps_real
    k_real = k_real
    k_imag = k_imag
    mu_rel_imag = mu_imag
    mu_rel_real = mu_real
  []
  [eps_real]
    type = ADGenericFunctionMaterial
    prop_names = eps_real
    prop_values = epsilon
  []
  [eps_imag]
    type = ADGenericFunctionMaterial
    prop_names = eps_imag
    prop_values = epsilon
  []
  [mu_real]
    type = ADGenericFunctionMaterial
    prop_names = mu_real
    prop_values = mu
  []
  [mu_imag]
    type = ADGenericFunctionMaterial
    prop_names = mu_imag
    prop_values = mu
  []
  [k_real]
    type = ADGenericFunctionMaterial
    prop_names = k_real
    prop_values = omega
  []
  [k_imag]
    type = ADGenericFunctionMaterial
    prop_names = k_imag
    prop_values = omega
  []
  [cond_real]
    type = ADGenericFunctionMaterial
    prop_names = cond_real
    prop_values = sigma
  []
  [cond_imag]
    type = ADGenericFunctionMaterial
    prop_names = cond_imag
    prop_values = sigma
  []
[]
[Variables]
  [n]
    family = LAGRANGE
    order = FIRST
  []
  [E_real]
    family = NEDELEC_ONE
    order = FIRST
  []
  [E_imag]
    family = NEDELEC_ONE
    order = FIRST
  []
[]
[Kernels]
  [curl_curl_real]
    type = CurlCurlField
    variable = E_real
  []
  [coeff_real]
    type = ADMatWaveReaction
    variable = E_real
    field_real =  E_real
    field_imag =  E_imag
    wave_coef_real = wave_equation_coefficient_real
    wave_coef_imag = wave_equation_coefficient_imaginary
    component = real
  []
  [conduction_real]
    type = ADConductionCurrent
    variable = E_real
    field_imag =  E_imag
    field_real =  E_real
    conductivity_real = cond_real
    conductivity_imag = cond_imag
    ang_freq_real = k_real
    ang_freq_imag = k_imag
    permeability_real = mu_real
    permeability_imag = mu_imag
    component = real
  []
  [body_force_real]
    type = VectorBodyForce
    variable = E_real
    function = source_real
  []
  [curl_curl_imag]
    type = CurlCurlField
    variable = E_imag
  []
  [coeff_imag]
    type = ADMatWaveReaction
    variable = E_imag
    field_real =  E_real
    field_imag =  E_imag
    wave_coef_real = wave_equation_coefficient_real
    wave_coef_imag = wave_equation_coefficient_imaginary
    component = imaginary
  []
  [conduction_imag]
    type = ADConductionCurrent
    variable = E_imag
    field_imag =  E_imag
    field_real =  E_real
    conductivity_real = cond_real
    conductivity_imag = cond_imag
    ang_freq_real = k_real
    ang_freq_imag = k_imag
    permeability_real = mu_real
    permeability_imag = mu_imag
    component = imaginary
  []
  [body_force_imag]
    type = VectorBodyForce
    variable = E_imag
    function = source_imag
  []
  [n_diffusion]
    type = Diffusion
    variable = n
  []
  [microwave_heating]
    type = EMJouleHeatingSource
    variable = n
    E_imag = E_imag
    E_real = E_real
    conductivity = cond_real
  []
  [body_force_n]
    type = BodyForce
    variable = n
    function = source_n
  []
[]
[BCs]
  [sides_real]
    type = VectorCurlPenaltyDirichletBC
    variable = E_real
    function = exact_real
    penalty = 1e8
    boundary = 'left right top bottom'
  []
  [sides_imag]
    type = VectorCurlPenaltyDirichletBC
    variable = E_imag
    function = exact_imag
    penalty = 1e8
    boundary = 'left right top bottom'
  []
  [sides_n]
    type = FunctorDirichletBC
    variable = n
    boundary = 'left right top bottom'
    functor = exact_n
    preset = false
  []
[]
[Postprocessors]
  [error_real]
    type = ElementVectorL2Error
    variable = E_real
    function = exact_real
  []
  [error_imag]
    type = ElementVectorL2Error
    variable = E_imag
    function = exact_imag
  []
  [error_n]
    type = ElementL2Error
    variable = n
    function = exact_n
  []
  [h]
    type = AverageElementSize
  []
  [h_squared]
    type = ParsedPostprocessor
    pp_names = 'h'
    expression = 'h * h'
  []
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-12
[]
[Outputs]
  exodus = true
  csv = true
[]
(modules/porous_flow/test/tests/sinks/s06.i)
# apply a half-cubic sink flux and observe the correct behavior
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = 0
  xmax = 1
  ymin = 0
  ymax = 1
  zmin = 0
  zmax = 2
[]
[GlobalParams]
  PorousFlowDictator = dictator
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = 'pp'
    number_fluid_phases = 1
    number_fluid_components = 1
  []
  [pc]
    type = PorousFlowCapillaryPressureVG
    m = 0.5
    alpha = 1.1
  []
[]
[Variables]
  [pp]
  []
[]
[ICs]
  [pp]
    type = FunctionIC
    variable = pp
    function = x*(y+1)
  []
[]
[Kernels]
  [mass0]
    type = PorousFlowMassTimeDerivative
    fluid_component = 0
    variable = pp
  []
[]
[FluidProperties]
  [simple_fluid]
    type = SimpleFluidProperties
    bulk_modulus = 1.3
    density0 = 1.1
    thermal_expansion = 0
    viscosity = 1.1
  []
[]
[Materials]
  [temperature]
    type = PorousFlowTemperature
  []
  [ppss]
    type = PorousFlow1PhaseP
    porepressure = pp
    capillary_pressure = pc
  []
  [massfrac]
    type = PorousFlowMassFraction
  []
  [simple_fluid]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid
    phase = 0
  []
  [porosity]
    type = PorousFlowPorosityConst
    porosity = 0.1
  []
  [permeability]
    type = PorousFlowPermeabilityConst
    permeability = '1E-5 0 0 0 1E-5 0 0 0 1E-5'
  []
  [relperm]
    type = PorousFlowRelativePermeabilityCorey
    n = 2
    phase = 0
  []
[]
[AuxVariables]
  [flux_out]
  []
[]
[Postprocessors]
  [flux00]
    type = PointValue
    variable = flux_out
    point = '0 0 0'
  []
  [flux01]
    type = PointValue
    variable = flux_out
    point = '0 1 0'
  []
  [flux10]
    type = PointValue
    variable = flux_out
    point = '1 0 0'
  []
  [flux11]
    type = PointValue
    variable = flux_out
    point = '1 1 0'
  []
  [p00]
    type = PointValue
    point = '0 0 0'
    variable = pp
    execute_on = 'initial timestep_end'
  []
  [p10]
    type = PointValue
    point = '1 0 0'
    variable = pp
    execute_on = 'initial timestep_end'
  []
  [m10]
    type = ParsedPostprocessor
    expression = 'vol*por*dens0*exp(p10/bulk)*if(p10>=0,1,pow(1+pow(-al*p10,1.0/(1-m)),-m))'
    constant_names = 'vol por dens0 bulk al m'
    constant_expressions = '0.25 0.1 1.1 1.3 1.1 0.5'
    pp_names = 'p10'
    execute_on = 'initial timestep_end'
  []
  [dm10]
    type = ChangeOverTimePostprocessor
    postprocessor = m10
    outputs = none
  []
  [m10_prev]
    type = ParsedPostprocessor
    expression = 'm10 - dm10'
    pp_names = 'm10 dm10'
    outputs = 'console'
  []
  [m10_rate]
    type = ParsedPostprocessor
    expression = 'fcn*if(p10>center,m,if(p10<themin,0,m/c/c/c*(2*(p10-center)+c)*((p10-center)-c)*((p10-center)-c)))'
    constant_names = 'm fcn center sd themin c'
    constant_expressions = '2 3 0.9 0.5 0.1 -0.8'
    pp_names = 'p10'
  []
  [m10_expect]
    type = ParsedPostprocessor
    expression = 'm10_prev-m10_rate*area*dt'
    constant_names = 'area dt'
    constant_expressions = '0.5 2E-3'
    pp_names = 'm10_prev m10_rate'
  []
  [p01]
    type = PointValue
    point = '0 1 0'
    variable = pp
    execute_on = 'initial timestep_end'
  []
  [p11]
    type = PointValue
    point = '1 1 0'
    variable = pp
    execute_on = 'initial timestep_end'
  []
  [m11]
    type = ParsedPostprocessor
    expression = 'vol*por*dens0*exp(p11/bulk)*if(p11>=0,1,pow(1+pow(-al*p11,1.0/(1-m)),-m))'
    constant_names = 'vol por dens0 bulk al m'
    constant_expressions = '0.25 0.1 1.1 1.3 1.1 0.5'
    pp_names = 'p11'
    execute_on = 'initial timestep_end'
  []
  [dm11]
    type = ChangeOverTimePostprocessor
    postprocessor = m11
    outputs = none
  []
  [m11_prev]
    type = ParsedPostprocessor
    expression = 'm11 - dm11'
    pp_names = 'm11 dm11'
    outputs = 'console'
  []
  [m11_rate]
    type = ParsedPostprocessor
    expression = 'fcn*if(p11>center,m,if(p11<themin,0,m/c/c/c*(2*(p11-center)+c)*((p11-center)-c)*((p11-center)-c)))'
    constant_names = 'm fcn center sd themin c'
    constant_expressions = '2 3 0.9 0.5 0.1 -0.8'
    pp_names = 'p11'
  []
  [m11_expect]
    type = ParsedPostprocessor
    expression = 'm11_prev-m11_rate*area*dt'
    constant_names = 'area dt'
    constant_expressions = '0.5 2E-3'
    pp_names = 'm11_prev m11_rate'
  []
[]
[BCs]
  [flux]
    type = PorousFlowHalfCubicSink
    boundary = 'left right'
    max = 2
    cutoff = -0.8
    center = 0.9
    variable = pp
    use_mobility = false
    use_relperm = false
    fluid_phase = 0
    flux_function = 3
    save_in = flux_out
  []
[]
[Preconditioning]
  [andy]
    type = SMP
    full = true
    petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -snes_max_it -sub_pc_factor_shift_type -pc_asm_overlap'
    petsc_options_value = 'gmres asm lu 10000 NONZERO 2'
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  dt = 2E-3
  end_time = 6E-2
  nl_rel_tol = 1E-12
  nl_abs_tol = 1E-12
[]
[Outputs]
  file_base = s06
  [console]
    type = Console
    execute_on = 'nonlinear linear'
    time_step_interval = 5
  []
  [csv]
    type = CSV
    execute_on = 'timestep_end'
    time_step_interval = 3
  []
[]
(modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/vector_azim_magnetic_time_deriv.i)
# Test for AzimuthMagneticTimeDerivRZ with a vector input
# Manufactured solution: E_real = y^2 * x_hat - x^2 * y_hat
#                        E_imag = y^2 * x_hat - x^2 * y_hat
#                        dB_theta_real / dt = -(2*y + 2*x)
[Mesh]
  [gmg]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 5
    ny = 5
    xmax = 1
    xmin = 0
    ymax = 1
    ymin = -1
    elem_type = QUAD9
  []
  coord_type = RZ
  rz_coord_axis = Y
[]
[Functions]
  #The exact solution for the heated species and electric field real and imag. component
  [exact_real]
    type = ParsedVectorFunction
    expression_x = 'y^2'
    expression_y = '-x^2'
  []
  [exact_imag]
    type = ParsedVectorFunction
    expression_x = 'y^2'
    expression_y = '-x^2'
  []
  #The forcing terms for the heated species and electric field real and imag. component
  [source_real]
    type = ParsedVectorFunction
    expression_x = '-y^2 - cos(pi*y) - 2'
    expression_y = 'x^2 + cos(pi*x) + 4 + 2*y/x'
  []
  [source_imag]
    type = ParsedVectorFunction
    expression_x = '-y^2 + sin(pi*y) - 2'
    expression_y = 'x^2 - sin(pi*x) + 4 + 2*y/x'
  []
  [current_real]
    type = ParsedVectorFunction
    expression_x = 'sin(pi*y)'
    expression_y = '-sin(pi*x)'
  []
  [current_imag]
    type = ParsedVectorFunction
    expression_x = 'cos(pi*y)'
    expression_y = '-cos(pi*x)'
  []
  [azim_dB_dt_func]
    type = ParsedFunction
    expression = '-(2*y + 2*x)'
  []
[]
[Materials]
  [WaveCoeff]
    type = WaveEquationCoefficient
    eps_rel_real = 1.0
    eps_rel_imag = 0.0
    k_real = 1.0
    k_imag = 0.0
    mu_rel_real = 1.0
    mu_rel_imag = 0.0
  []
[]
[Variables]
  [E_real]
    family = NEDELEC_ONE
    order = FIRST
  []
  [E_imag]
    family = NEDELEC_ONE
    order = FIRST
  []
[]
[Kernels]
  [curl_curl_real]
    type = CurlCurlField
    variable = E_real
  []
  [coeff_real]
    type = ADMatWaveReaction
    variable = E_real
    field_real =  E_real
    field_imag =  E_imag
    wave_coef_real = wave_equation_coefficient_real
    wave_coef_imag = wave_equation_coefficient_imaginary
    component = real
  []
  [current_real]
    type = VectorCurrentSource
    variable = E_real
    source_real = current_real
    source_imag = current_imag
    component = real
  []
  [body_force_real]
    type = VectorBodyForce
    variable = E_real
    function = source_real
  []
  [curl_curl_imag]
    type = CurlCurlField
    variable = E_imag
  []
  [coeff_imag]
    type = ADMatWaveReaction
    variable = E_imag
    field_real =  E_real
    field_imag =  E_imag
    wave_coef_real = wave_equation_coefficient_real
    wave_coef_imag = wave_equation_coefficient_imaginary
    component = imaginary
  []
  [current_imag]
    type = VectorCurrentSource
    variable = E_imag
    source_real = current_real
    source_imag = current_imag
    component = imaginary
  []
  [body_force_imag]
    type = VectorBodyForce
    variable = E_imag
    function = source_imag
  []
[]
[AuxVariables]
  [azim_dB_dt_term_vector]
    family = MONOMIAL
    order = FIRST
  []
[]
[AuxKernels]
  [aux_azim_dB_dt_vector]
    type = AzimuthMagneticTimeDerivRZ
    Efield = E_real
    variable = azim_dB_dt_term_vector
  []
[]
[BCs]
  [sides_real]
    type = VectorCurlPenaltyDirichletBC
    variable = E_real
    function = exact_real
    penalty = 1e8
    boundary = 'left right top bottom'
  []
  [sides_imag]
    type = VectorCurlPenaltyDirichletBC
    variable = E_imag
    function = exact_imag
    penalty = 1e8
    boundary = 'left right top bottom'
  []
[]
[Postprocessors]
  [error_real]
    type = ElementVectorL2Error
    variable = E_real
    function = exact_real
  []
  [error_imag]
    type = ElementVectorL2Error
    variable = E_imag
    function = exact_imag
  []
  [error_azim_dB_dt_vector]
    type = ElementL2Error
    variable = azim_dB_dt_term_vector
    function = azim_dB_dt_func
  []
  [h]
    type = AverageElementSize
  []
  [h_squared]
    type = ParsedPostprocessor
    pp_names = 'h'
    expression = 'h * h'
  []
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-16
[]
[Outputs]
  exodus = true
  csv = true
[]
(modules/combined/examples/optimization/multi-load/single_main.i)
vol_frac = 0.3
power = 1.1
E0 = 1.0
Emin = 1.0e-6
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Mesh]
  # final_generator = 'MoveRight'
  [Bottom]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 80
    ny = 40
    xmin = 0
    xmax = 150
    ymin = 0
    ymax = 75
  []
  [left_load]
    type = ExtraNodesetGenerator
    input = Bottom
    new_boundary = left_load
    coord = '37.5 75 0'
  []
  [right_load]
    type = ExtraNodesetGenerator
    input = left_load
    new_boundary = right_load
    coord = '112.5 75 0'
  []
  [left_support]
    type = ExtraNodesetGenerator
    input = right_load
    new_boundary = left_support
    coord = '0 0 0'
  []
  [right_support]
    type = ExtraNodesetGenerator
    input = left_support
    new_boundary = right_support
    coord = '150 0 0'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
[]
[AuxVariables]
  [mat_den]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = 0.02
  []
  [sensitivity_one]
    family = MONOMIAL
    order = SECOND
    initial_condition = -1.0
  []
  [sensitivity_two]
    family = MONOMIAL
    order = SECOND
    initial_condition = -1.0
  []
  [total_sensitivity]
    family = MONOMIAL
    order = SECOND
    initial_condition = -1.0
  []
[]
[AuxKernels]
  [total_sensitivity]
    type = ParsedAux
    variable = total_sensitivity
    expression = '0.5*sensitivity_one + 0.5*sensitivity_two'
    coupled_variables = 'sensitivity_one sensitivity_two'
    execute_on = 'LINEAR TIMESTEP_END'
  []
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    strain = SMALL
    add_variables = true
    incremental = false
  []
[]
[BCs]
  [no_y]
    type = DirichletBC
    variable = disp_y
    boundary = left_support
    value = 0.0
  []
  [no_x]
    type = DirichletBC
    variable = disp_x
    boundary = left_support
    value = 0.0
  []
  [no_y_right]
    type = DirichletBC
    variable = disp_y
    boundary = right_support
    value = 0.0
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeVariableIsotropicElasticityTensor
    youngs_modulus = E_phys
    poissons_ratio = poissons_ratio
    args = 'mat_den'
  []
  [E_phys]
    type = DerivativeParsedMaterial
    # Emin + (density^penal) * (E0 - Emin)
    expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
    coupled_variables = 'mat_den'
    property_name = E_phys
  []
  [poissons_ratio]
    type = GenericConstantMaterial
    prop_names = poissons_ratio
    prop_values = 0.0
  []
  [stress]
    type = ComputeLinearElasticStress
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[UserObjects]
  # We do filtering in the subapps
  [update]
    type = DensityUpdate
    density_sensitivity = total_sensitivity
    design_density = mat_den
    volume_fraction = ${vol_frac}
    execute_on = MULTIAPP_FIXED_POINT_BEGIN
  []
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu superlu_dist'
  nl_abs_tol = 1e-10
  dt = 1.0
  num_steps = 25
[]
[Outputs]
  exodus = true
  [out]
    type = CSV
    execute_on = 'TIMESTEP_END'
  []
  print_linear_residuals = false
[]
[Postprocessors]
  [mesh_volume]
    type = VolumePostprocessor
    execute_on = 'initial timestep_end'
  []
  [total_vol]
    type = ElementIntegralVariablePostprocessor
    variable = mat_den
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [vol_frac]
    type = ParsedPostprocessor
    expression = 'total_vol / mesh_volume'
    pp_names = 'total_vol mesh_volume'
  []
  [sensitivity]
    type = ElementIntegralVariablePostprocessor
    variable = total_sensitivity
  []
[]
[MultiApps]
  [sub_app_one]
    type = TransientMultiApp
    input_files = single_subapp_one.i
  []
  [sub_app_two]
    type = TransientMultiApp
    input_files = single_subapp_two.i
  []
[]
[Transfers]
  # First SUB-APP
  # To subapp densities
  [subapp_one_density]
    type = MultiAppCopyTransfer
    to_multi_app = sub_app_one
    source_variable = mat_den # Here
    variable = mat_den
  []
  # From subapp sensitivity
  [subapp_one_sensitivity]
    type = MultiAppCopyTransfer
    from_multi_app = sub_app_one
    source_variable = Dc # sensitivity_var
    variable = sensitivity_one # Here
  []
  # Second SUB-APP
  # To subapp densities
  [subapp_two_density]
    type = MultiAppCopyTransfer
    to_multi_app = sub_app_two
    source_variable = mat_den # Here
    variable = mat_den
  []
  # From subapp sensitivity
  [subapp_two_sensitivity]
    type = MultiAppCopyTransfer
    from_multi_app = sub_app_two
    source_variable = Dc # sensitivity_var
    variable = sensitivity_two # Here
  []
[]
(modules/porous_flow/test/tests/sinks/s07.i)
# apply a sink flux on just one component of a 3-component system and observe the correct behavior
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = 0
  xmax = 1
  ymin = 0
  ymax = 1
  zmin = 0
  zmax = 2
[]
[GlobalParams]
  PorousFlowDictator = dictator
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = 'pp frac0 frac1'
    number_fluid_phases = 1
    number_fluid_components = 3
  []
  [pc]
    type = PorousFlowCapillaryPressureVG
    m = 0.5
    alpha = 1.1
  []
[]
[Variables]
  [pp]
  []
  [frac0]
    initial_condition = 0.1
  []
  [frac1]
    initial_condition = 0.6
  []
[]
[ICs]
  [pp]
    type = FunctionIC
    variable = pp
    function = y
  []
[]
[Kernels]
  [mass0]
    type = PorousFlowMassTimeDerivative
    fluid_component = 0
    variable = frac0
  []
  [mass1]
    type = PorousFlowMassTimeDerivative
    fluid_component = 1
    variable = frac1
  []
  [mass2]
    type = PorousFlowMassTimeDerivative
    fluid_component = 2
    variable = pp
  []
[]
[FluidProperties]
  [simple_fluid]
    type = SimpleFluidProperties
    bulk_modulus = 1.3
    density0 = 1.1
    thermal_expansion = 0
    viscosity = 1.1
  []
[]
[Materials]
  [temperature]
    type = PorousFlowTemperature
  []
  [ppss]
    type = PorousFlow1PhaseP
    porepressure = pp
    capillary_pressure = pc
  []
  [massfrac]
    type = PorousFlowMassFraction
    mass_fraction_vars = 'frac0 frac1'
  []
  [simple_fluid]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid
    phase = 0
  []
  [porosity]
    type = PorousFlowPorosityConst
    porosity = 0.1
  []
  [permeability]
    type = PorousFlowPermeabilityConst
    permeability = '0.2 0 0 0 0.1 0 0 0 0.1'
  []
  [relperm]
    type = PorousFlowRelativePermeabilityCorey
    n = 2
    phase = 0
  []
[]
[AuxVariables]
  [flux_out]
  []
[]
[Postprocessors]
  [f1_00]
    type = PointValue
    point = '0 0 0'
    variable = frac1
    execute_on = 'initial timestep_end'
  []
  [flux_00]
    type = PointValue
    point = '0 0 0'
    variable = flux_out
    execute_on = 'initial timestep_end'
  []
  [p00]
    type = PointValue
    point = '0 0 0'
    variable = pp
    execute_on = 'initial timestep_end'
  []
  [m1_00]
    type = ParsedPostprocessor
    expression = 'f1_00*vol*por*dens0*exp(p00/bulk)*pow(1+pow(-al*p00,1.0/(1-m)),-m)'
    constant_names = 'vol por dens0 bulk al m'
    constant_expressions = '0.25 0.1 1.1 1.3 1.1 0.5'
    pp_names = 'f1_00 p00'
    execute_on = 'initial timestep_end'
  []
  [dm1_00]
    type = ChangeOverTimePostprocessor
    postprocessor = m1_00
    outputs = none
  []
  [m1_00_prev]
    type = ParsedPostprocessor
    expression = 'm1_00 - dm1_00'
    pp_names = 'm1_00 dm1_00'
    outputs = 'console'
  []
  [del_m1_00]
    type = ParsedPostprocessor
    expression = 'f1_00*fcn*area*dt'
    constant_names = 'fcn area dt'
    constant_expressions = '6  0.5  1E-3'
    pp_names = 'f1_00'
    outputs = 'console'
  []
  [m1_00_expect]
    type = ParsedPostprocessor
    expression = 'm1_00_prev-del_m1_00'
    pp_names = 'm1_00_prev del_m1_00'
  []
  [f1_01]
    type = PointValue
    point = '0 1 0'
    variable = frac1
    execute_on = 'initial timestep_end'
  []
  [flux_01]
    type = PointValue
    point = '0 1 0'
    variable = flux_out
    execute_on = 'initial timestep_end'
  []
  [p01]
    type = PointValue
    point = '0 1 0'
    variable = pp
    execute_on = 'initial timestep_end'
  []
  [m1_01]
    type = ParsedPostprocessor
    expression = 'f1_01*vol*por*dens0*exp(p01/bulk)*pow(1+pow(-al*p01,1.0/(1-m)),-m)'
    constant_names = 'vol por dens0 bulk al m'
    constant_expressions = '0.25 0.1 1.1 1.3 1.1 0.5'
    pp_names = 'f1_01 p01'
    execute_on = 'initial timestep_end'
  []
  [dm1_01]
    type = ChangeOverTimePostprocessor
    postprocessor = m1_01
    outputs = none
  []
  [m1_01_prev]
    type = ParsedPostprocessor
    expression = 'm1_01 - dm1_01'
    pp_names = 'm1_01 dm1_01'
    outputs = 'console'
  []
  [del_m1_01]
    type = ParsedPostprocessor
    expression = 'f1_01*fcn*area*dt'
    constant_names = 'fcn area dt'
    constant_expressions = '6  0.5  1E-3'
    pp_names = 'f1_01'
    outputs = 'console'
  []
  [m1_01_expect]
    type = ParsedPostprocessor
    expression = 'm1_01_prev-del_m1_01'
    pp_names = 'm1_01_prev del_m1_01'
  []
  [f1_11]
    type = PointValue
    point = '1 1 0'
    variable = frac1
    execute_on = 'initial timestep_end'
  []
  [flux_11]
    type = PointValue
    point = '1 1 0'
    variable = flux_out
    execute_on = 'initial timestep_end'
  []
  [p11]
    type = PointValue
    point = '1 1 0'
    variable = pp
    execute_on = 'initial timestep_end'
  []
[]
[BCs]
  [flux]
    type = PorousFlowSink
    boundary = 'left'
    variable = frac1
    use_mobility = false
    use_relperm = false
    mass_fraction_component = 1
    fluid_phase = 0
    flux_function = 6
    save_in = flux_out
  []
[]
[Preconditioning]
  [andy]
    type = SMP
    full = true
    petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -snes_max_it -sub_pc_factor_shift_type -pc_asm_overlap'
    petsc_options_value = 'gmres asm lu 10 NONZERO 2'
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  dt = 1E-3
  end_time = 0.01
  nl_rel_tol = 1E-12
  nl_abs_tol = 1E-12
[]
[Outputs]
  file_base = s07
  [console]
    type = Console
    execute_on = 'nonlinear linear'
  []
  [csv]
    type = CSV
    execute_on = 'timestep_end'
  []
[]
(modules/thermal_hydraulics/test/tests/components/hs_coupler_2d2d_radiation/energy_conservation.i)
# This input file is used to test that HSCoupler2D2DRadiation conserves
# energy for a problem where 3 cylindrical heat structures (surfaces 1, 2, and 3)
# are enclosed by an annular heat structure (surface 4). Note that the mesh
# positions used in this input file do not reflect the real positions for this
# configuration, for convenience of viewing solutions.
emissivity1 = 0.8
emissivity2 = 0.5
emissivity3 = 0.2
emissivity4 = 0.9
orientation = '0 0 1'
length = 0.5
n_axial_elems = 10
radius_123 = 0.1
inner_radius_4 = 0.2
outer_radius_4 = 0.25
thickness_4 = ${fparse outer_radius_4 - inner_radius_4}
n_radial_elems_123 = 10
n_radial_elems_4 = 5
initial_T1 = 1200
initial_T2 = 1000
initial_T3 = 800
initial_T4 = 300
T_ref = 300
y_shift = 0.5
position1 = '0 0 0'
position2 = '0 ${y_shift} 0'
position3 = '0 ${fparse 2*y_shift} 0'
position4 = '0 ${fparse 3*y_shift} 0'
view_factor_12 = 0.15 # guessed some number < 1/6
view_factor_14 = ${fparse 1.0 - 2 * view_factor_12}
view_factor_41 = ${fparse radius_123 / inner_radius_4 * view_factor_14}
view_factor_44 = ${fparse 1.0 - 3 * view_factor_41}
[SolidProperties]
  [hs_mat]
    type = ThermalFunctionSolidProperties
    k = 15
    cp = 500
    rho = 8000
  []
[]
[Components]
  [hs1]
    type = HeatStructureCylindrical
    position = ${position1}
    orientation = ${orientation}
    length = ${length}
    n_elems = ${n_axial_elems}
    names = 'body'
    widths = '${radius_123}'
    n_part_elems = '${n_radial_elems_123}'
    solid_properties = 'hs_mat'
    solid_properties_T_ref = '${T_ref}'
    initial_T = ${initial_T1}
  []
  [hs2]
    type = HeatStructureCylindrical
    position = ${position2}
    orientation = ${orientation}
    length = ${length}
    n_elems = ${n_axial_elems}
    names = 'body'
    widths = '${radius_123}'
    n_part_elems = '${n_radial_elems_123}'
    solid_properties = 'hs_mat'
    solid_properties_T_ref = '${T_ref}'
    initial_T = ${initial_T2}
  []
  [hs3]
    type = HeatStructureCylindrical
    position = ${position3}
    orientation = ${orientation}
    length = ${length}
    n_elems = ${n_axial_elems}
    names = 'body'
    widths = '${radius_123}'
    n_part_elems = '${n_radial_elems_123}'
    solid_properties = 'hs_mat'
    solid_properties_T_ref = '${T_ref}'
    initial_T = ${initial_T3}
  []
  [hs4]
    type = HeatStructureCylindrical
    position = ${position4}
    orientation = ${orientation}
    length = ${length}
    n_elems = ${n_axial_elems}
    inner_radius = ${inner_radius_4}
    names = 'body'
    widths = '${thickness_4}'
    n_part_elems = '${n_radial_elems_4}'
    solid_properties = 'hs_mat'
    solid_properties_T_ref = '${T_ref}'
    initial_T = ${initial_T4}
  []
  [hs_coupler]
    type = HSCoupler2D2DRadiation
    heat_structures = 'hs1 hs2 hs3 hs4'
    boundaries = 'hs1:outer hs2:outer hs3:outer hs4:inner'
    emissivities = '${emissivity1} ${emissivity2} ${emissivity3} ${emissivity4}'
    include_environment = false
    view_factors = '
      0 ${view_factor_12} ${view_factor_12} ${view_factor_14};
      ${view_factor_12} 0 ${view_factor_12} ${view_factor_14};
      ${view_factor_12} ${view_factor_12} 0 ${view_factor_14};
      ${view_factor_41} ${view_factor_41} ${view_factor_41} ${view_factor_44}'
  []
[]
[Preconditioning]
  [pc]
    type = SMP
    full = true
  []
[]
[Postprocessors]
  [E_hs1]
    type = ADHeatStructureEnergyRZ
    block = 'hs1:body'
    axis_dir = ${orientation}
    axis_point = ${position1}
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [E_hs2]
    type = ADHeatStructureEnergyRZ
    block = 'hs2:body'
    axis_dir = ${orientation}
    axis_point = ${position2}
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [E_hs3]
    type = ADHeatStructureEnergyRZ
    block = 'hs3:body'
    axis_dir = ${orientation}
    axis_point = ${position3}
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [E_hs4]
    type = ADHeatStructureEnergyRZ
    block = 'hs4:body'
    axis_dir = ${orientation}
    axis_point = ${position4}
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [E_tot]
    type = ParsedPostprocessor
    expression = 'E_hs1 + E_hs2 + E_hs3 + E_hs4'
    pp_names = 'E_hs1 E_hs2 E_hs3 E_hs4'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [E_tot_err]
    type = ChangeOverTimePostprocessor
    postprocessor = E_tot
    take_absolute_value = true
    change_with_respect_to_initial = true
    execute_on = 'INITIAL TIMESTEP_END'
  []
[]
[Executioner]
  type = Transient
  scheme = 'bdf2'
  start_time = 0
  dt = 10
  num_steps = 10
  abort_on_solve_fail = true
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-10
  nl_max_its = 10
  l_tol = 1e-4
  l_max_its = 10
[]
[Outputs]
  file_base = 'energy_conservation'
  [csv]
    type = CSV
    show = 'E_tot_err'
    execute_on = 'FINAL'
  []
[]
(modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/lid-driven-fsp.i)
mu = 1
rho = 1
l = 1
U = 1e3
n = 200
gamma = 1e5
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = ${l}
    ymin = 0
    ymax = ${l}
    nx = ${n}
    ny = ${n}
    elem_type = TRI6
  []
[]
[Problem]
  type = NavierStokesProblem
  extra_tag_matrices = 'mass'
  mass_matrix = 'mass'
  use_pressure_mass_matrix = true
[]
[Variables]
  [vel_x]
    family = MONOMIAL
    order = FIRST
  []
  [vel_y]
    family = MONOMIAL
    order = FIRST
  []
  [pressure]
    family = MONOMIAL
    order = CONSTANT
  []
  [vel_bar_x]
    family = SIDE_HIERARCHIC
    order = FIRST
  []
  [vel_bar_y]
    family = SIDE_HIERARCHIC
    order = FIRST
  []
  [pressure_bar]
    family = SIDE_HIERARCHIC
    order = FIRST
  []
[]
[HDGKernels]
  [momentum_x_convection]
    type = AdvectionIPHDGKernel
    variable = vel_x
    face_variable = vel_bar_x
    velocity = 'velocity'
    coeff = ${rho}
  []
  [momentum_x_diffusion]
    type = NavierStokesStressIPHDGKernel
    variable = vel_x
    face_variable = vel_bar_x
    diffusivity = 'mu'
    alpha = 6
    pressure_variable = pressure
    pressure_face_variable = pressure_bar
    component = 0
  []
  [momentum_y_convection]
    type = AdvectionIPHDGKernel
    variable = vel_y
    face_variable = vel_bar_y
    velocity = 'velocity'
    coeff = ${rho}
  []
  [momentum_y_diffusion]
    type = NavierStokesStressIPHDGKernel
    variable = vel_y
    face_variable = vel_bar_y
    diffusivity = 'mu'
    alpha = 6
    pressure_variable = pressure
    pressure_face_variable = pressure_bar
    component = 1
  []
  [pressure_convection]
    type = AdvectionIPHDGKernel
    variable = pressure
    face_variable = pressure_bar
    velocity = 'velocity'
    coeff = '${fparse -rho}'
    self_advection = false
  []
[]
[Kernels]
  [mass_matrix_pressure]
    type = MassMatrix
    variable = pressure
    matrix_tags = 'mass'
    density = '${fparse -1/gamma}'
  []
  [grad_div_x]
    type = GradDiv
    variable = vel_x
    u = vel_x
    v = vel_y
    gamma = ${gamma}
    component = 0
  []
  [grad_div_y]
    type = GradDiv
    variable = vel_y
    u = vel_x
    v = vel_y
    gamma = ${gamma}
    component = 1
  []
[]
[DGKernels]
  [pb_mass]
    type = MassMatrixDGKernel
    variable = pressure_bar
    matrix_tags = 'mass'
    density = '${fparse -1/gamma}'
  []
  [u_jump]
    type = MassFluxPenalty
    variable = vel_x
    u = vel_x
    v = vel_y
    component = 0
    gamma = ${gamma}
  []
  [v_jump]
    type = MassFluxPenalty
    variable = vel_y
    u = vel_x
    v = vel_y
    component = 1
    gamma = ${gamma}
  []
[]
[BCs]
  [momentum_x_diffusion_walls]
    type = NavierStokesStressIPHDGDirichletBC
    boundary = 'left bottom right'
    variable = vel_x
    face_variable = vel_bar_x
    pressure_variable = pressure
    pressure_face_variable = pressure_bar
    alpha = 6
    functor = '0'
    diffusivity = 'mu'
    component = 0
  []
  [momentum_x_diffusion_top]
    type = NavierStokesStressIPHDGDirichletBC
    boundary = 'top'
    variable = vel_x
    face_variable = vel_bar_x
    pressure_variable = pressure
    pressure_face_variable = pressure_bar
    alpha = 6
    functor = '${U}'
    diffusivity = 'mu'
    component = 0
  []
  [momentum_y_diffusion_all]
    type = NavierStokesStressIPHDGDirichletBC
    boundary = 'left bottom right top'
    variable = vel_y
    face_variable = vel_bar_y
    pressure_variable = pressure
    pressure_face_variable = pressure_bar
    alpha = 6
    functor = '0'
    diffusivity = 'mu'
    component = 1
  []
  [mass_convection]
    type = AdvectionIPHDGPrescribedFluxBC
    face_variable = pressure_bar
    variable = pressure
    velocity = 'velocity'
    coeff = '${fparse -rho}'
    self_advection = false
    boundary = 'left bottom top right'
    prescribed_normal_flux = 0
  []
  [pb_mass]
    type = MassMatrixIntegratedBC
    variable = pressure_bar
    matrix_tags = 'mass'
    boundary = 'left right bottom top'
    density = '${fparse -1/gamma}'
  []
  [u_jump_walls]
    type = MassFluxPenaltyBC
    variable = vel_x
    u = vel_x
    v = vel_y
    component = 0
    boundary = 'left right bottom'
    gamma = ${gamma}
    dirichlet_value = 'walls'
  []
  [v_jump_walls]
    type = MassFluxPenaltyBC
    variable = vel_y
    u = vel_x
    v = vel_y
    component = 1
    boundary = 'left right bottom'
    gamma = ${gamma}
    dirichlet_value = 'walls'
  []
  [u_jump_top]
    type = MassFluxPenaltyBC
    variable = vel_x
    u = vel_x
    v = vel_y
    component = 0
    boundary = 'top'
    gamma = ${gamma}
    dirichlet_value = 'top'
  []
  [v_jump_top]
    type = MassFluxPenaltyBC
    variable = vel_y
    u = vel_x
    v = vel_y
    component = 1
    boundary = 'top'
    gamma = ${gamma}
    dirichlet_value = 'top'
  []
[]
[Functions]
  [top]
    type = ParsedVectorFunction
    value_x = ${U}
    value_y = 0
  []
  [walls]
    type = ParsedVectorFunction
    value_x = 0
    value_y = 0
  []
[]
[Materials]
  [const]
    type = ADGenericConstantMaterial
    prop_names = 'rho mu'
    prop_values = '${rho} ${mu}'
  []
  [vel]
    type = ADVectorFromComponentVariablesMaterial
    vector_prop_name = 'velocity'
    u = vel_x
    v = vel_y
  []
[]
[Preconditioning]
  [FSP]
    type = FSP
    topsplit = 'up'
    [up]
      splitting = 'u p'
      splitting_type = schur
      petsc_options_iname = '-pc_fieldsplit_schur_fact_type  -pc_fieldsplit_schur_precondition -ksp_gmres_restart -ksp_type -ksp_pc_side -ksp_rtol'
      petsc_options_value = 'full                            self                              300                fgmres    right        1e-4'
    []
    [u]
      vars = 'vel_x vel_y vel_bar_x vel_bar_y'
      petsc_options = '-ksp_converged_reason'
      petsc_options_iname = '-pc_type -ksp_type -ksp_rtol -ksp_gmres_restart -ksp_pc_side -pc_factor_mat_solver_type'
      petsc_options_value = 'ilu      gmres     1e-2      300                right        strumpack'
    []
    [p]
      vars = 'pressure pressure_bar'
      petsc_options = '-ksp_converged_reason'
      petsc_options_iname = '-ksp_type -ksp_gmres_restart -ksp_rtol -pc_type -ksp_pc_side'
      petsc_options_value = 'gmres     300                1e-2      ilu      right'
    []
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
[]
[Outputs]
  active = ''
  [out]
    type = Exodus
    hide = 'pressure_average vel_bar_x vel_bar_y pressure_bar'
  []
[]
[Postprocessors]
  [Re]
    type = ParsedPostprocessor
    pp_names = ''
    expression = '${rho} * ${U} * ${l} / ${mu}'
  []
  [pressure_average]
    type = ElementAverageValue
    variable = pressure
  []
[]
[Correctors]
  [set_pressure]
    type = NSPressurePin
    pin_type = 'average'
    variable = pressure
    pressure_average = 'pressure_average'
  []
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/2d-rc-no-slip.i)
mu = 1.1
rho = 1.1
l = 2
U = 1
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[GlobalParams]
  rhie_chow_user_object = 'rc'
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = vel_x
    v = vel_y
    pressure = pressure
  []
[]
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 10
    ymin = ${fparse -l / 2}
    ymax = ${fparse l / 2}
    nx = 100
    ny = 20
  []
  uniform_refine = 0
[]
[Variables]
  [vel_x]
    type = INSFVVelocityVariable
    initial_condition = 1
  []
  [vel_y]
    type = INSFVVelocityVariable
    initial_condition = 1
  []
  [pressure]
    type = INSFVPressureVariable
  []
[]
[FVKernels]
  [mass]
    type = INSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
  []
  [u_advection]
    type = INSFVMomentumAdvection
    variable = vel_x
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'x'
  []
  [u_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_x
    mu = ${mu}
    momentum_component = 'x'
  []
  [u_pressure]
    type = INSFVMomentumPressure
    variable = vel_x
    momentum_component = 'x'
    pressure = pressure
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = vel_y
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'y'
  []
  [v_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_y
    mu = ${mu}
    momentum_component = 'y'
  []
  [v_pressure]
    type = INSFVMomentumPressure
    variable = vel_y
    momentum_component = 'y'
    pressure = pressure
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_x
    functor = '${U}'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_y
    functor = '0'
  []
  [walls-u]
    type = INSFVNoSlipWallBC
    boundary = 'top bottom'
    variable = vel_x
    function = 0
  []
  [walls-v]
    type = INSFVNoSlipWallBC
    boundary = 'top bottom'
    variable = vel_y
    function = 0
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = '0'
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  nl_rel_tol = 1e-12
[]
[Preconditioning]
  active = FSP
  [FSP]
    type = FSP
    # It is the starting point of splitting
    topsplit = 'up' # 'up' should match the following block name
    [up]
      splitting = 'u p' # 'u' and 'p' are the names of subsolvers
      splitting_type  = schur
      # Splitting type is set as schur, because the pressure part of Stokes-like systems
      # is not diagonally dominant. CAN NOT use additive, multiplicative and etc.
      #
      # Original system:
      #
      # | Auu Aup | | u | = | f_u |
      # | Apu 0   | | p |   | f_p |
      #
      # is factorized into
      #
      # |I             0 | | Auu  0|  | I  Auu^{-1}*Aup | | u | = | f_u |
      # |Apu*Auu^{-1}  I | | 0   -S|  | 0  I            | | p |   | f_p |
      #
      # where
      #
      # S = Apu*Auu^{-1}*Aup
      #
      # The preconditioning is accomplished via the following steps
      #
      # (1) p* = f_p - Apu*Auu^{-1}f_u,
      # (2) p = (-S)^{-1} p*
      # (3) u = Auu^{-1}(f_u-Aup*p)
      petsc_options_iname = '-pc_fieldsplit_schur_fact_type  -pc_fieldsplit_schur_precondition -ksp_gmres_restart -ksp_rtol -ksp_type'
      petsc_options_value = 'full                            selfp                             300                1e-4      fgmres'
    []
    [u]
      vars = 'vel_x vel_y'
      petsc_options_iname = '-pc_type -pc_hypre_type -ksp_type -ksp_rtol -ksp_gmres_restart -ksp_pc_side'
      petsc_options_value = 'hypre    boomeramg      gmres    5e-1      300                 right'
    []
    [p]
      vars = 'pressure'
      petsc_options_iname = '-ksp_type -ksp_gmres_restart -ksp_rtol -pc_type -ksp_pc_side'
      petsc_options_value = 'gmres    300                5e-1      jacobi    right'
    []
  []
  [SMP]
    type = SMP
    full = true
    petsc_options_iname = '-pc_type -pc_factor_shift_type'
    petsc_options_value = 'lu       NONZERO'
  []
[]
[Outputs]
  print_linear_residuals = true
  print_nonlinear_residuals = true
  [out]
    type = Exodus
    hide = 'Re lin cum_lin'
  []
  [perf]
    type = PerfGraphOutput
  []
[]
[Postprocessors]
  [Re]
    type = ParsedPostprocessor
    expression = '${rho} * ${l} * ${U}'
  []
  [lin]
    type = NumLinearIterations
  []
  [cum_lin]
    type = CumulativeValuePostprocessor
    postprocessor = lin
  []
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/formloss/formloss_multiple.i)
# The expected pressure drop from textbook correlations for this example is: 1081.468315
[Mesh]
  [gen]
      type = CartesianMeshGenerator
      dim = 2
      dx = '1.0 1.0 1.0 1.0 1.0 1.0'
      dy = '1.0'
      subdomain_id = '1 2 3 3 4 5'
  []
  [area_change_1]
    type = SideSetsAroundSubdomainGenerator
    input = gen
    block = 1
    normal = '1 0 0'
    new_boundary = 'area_change_1'
  []
  [area_change_2]
    type = SideSetsAroundSubdomainGenerator
    input = area_change_1
    block = 4
    normal = '1 0 0'
    new_boundary = 'area_change_2'
  []
[]
[Variables]
  [pressure]
    type = BernoulliPressureVariable
    pressure_drop_sidesets = 'area_change_1 area_change_2'
    pressure_drop_form_factors = '0.2973 0.25'
    porosity = porosity
    u = superficial_vel_x
    v = superficial_vel_y
    rho = 988.0
    initial_condition = 1.01e5
    block = '1 2 3 4 5'
  []
[]
[Materials]
  [all_constant_props]
    type = ADGenericConstantFunctorMaterial
    prop_names = 'u rho  mu   '
    prop_values = '0.50 988  1e-3 '
  []
  [porosityMat]
      type = ADPiecewiseByBlockFunctorMaterial
      prop_name = porosity
      subdomain_to_prop_value = '1 1.00
                                  2 0.50
                                  3 0.50
                                  4 0.50
                                  5 1.00'
  []
[]
[Modules]
  [NavierStokesFV]
    block = '1 2 3 4 5'
    compressibility = 'weakly-compressible'
    porous_medium_treatment = true
    # Material property parameters
    density = rho
    dynamic_viscosity = mu
    pressure_variable = pressure
    # Porous medium parameters
    porosity = porosity
    porosity_interface_pressure_treatment = 'bernoulli'
    # Boundary conditions
    inlet_boundaries = 'left'
    outlet_boundaries = 'right'
    momentum_inlet_types = fixed-velocity
    momentum_inlet_functors = '1.0 0.0'
    momentum_outlet_types = fixed-pressure
    pressure_functors = '1.01e5'
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -pc_factor_shift_type'
  petsc_options_value = 'lu NONZERO'
  nl_rel_tol = 1e-6
  l_max_its = 100
  nl_max_its = 100
  automatic_scaling = true
  off_diagonals_in_auto_scaling = true
  line_search = none
[]
[Postprocessors]
  [inlet_pressure]
    type = ElementAverageValue
    variable = pressure
    block = 1
  []
  [middle_pressure]
    type = ElementAverageValue
    variable = pressure
    block = 2
  []
  [outlet_pressure]
    type = ElementAverageValue
    variable = pressure
    block = 5
  []
  [pressure_drop]
    type = ParsedPostprocessor
    pp_names = 'inlet_pressure outlet_pressure'
    expression = 'inlet_pressure - outlet_pressure'
  []
[]
[Outputs]
  csv = true
  execute_on = FINAL
[]
(modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_conduction_current.i)
# Test for ADConductionCurrent
# Manufactured solution: field_real =  y^2 * x_hat - x^2 * y_hat
#                        E_imag = y^2 * x_hat - x^2 * y_hat
[Mesh]
  [gmg]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 5
    ny = 5
    xmin = -1
    ymin = -1
    elem_type = QUAD9
  []
[]
[Functions]
  #The exact solution for both the real and imag. component
  [exact]
    type = ParsedVectorFunction
    expression_x = 'y*y'
    expression_y = '-x*x'
  []
  #The forcing terms for the real and imag. component
  [source_real]
    type = ParsedVectorFunction
    symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
    symbol_values = 'omega   mu   epsilon   sigma   omega   mu   epsilon   sigma'
    expression_x = '-epsilon_i*mu_i*omega_i^2*y^2 - 2*epsilon_i*mu_i*omega_i*omega_r*y^2 + epsilon_i*mu_i*omega_r^2*y^2 - epsilon_i*mu_r*omega_i^2*y^2 + 2*epsilon_i*mu_r*omega_i*omega_r*y^2 + epsilon_i*mu_r*omega_r^2*y^2 - epsilon_r*mu_i*omega_i^2*y^2 + 2*epsilon_r*mu_i*omega_i*omega_r*y^2 + epsilon_r*mu_i*omega_r^2*y^2 + epsilon_r*mu_r*omega_i^2*y^2 + 2*epsilon_r*mu_r*omega_i*omega_r*y^2 - epsilon_r*mu_r*omega_r^2*y^2 + mu_i*omega_i*sigma_i*y^2 + mu_i*omega_i*sigma_r*y^2 + mu_i*omega_r*sigma_i*y^2 - mu_i*omega_r*sigma_r*y^2 + mu_r*omega_i*sigma_i*y^2 - mu_r*omega_i*sigma_r*y^2 - mu_r*omega_r*sigma_i*y^2 - mu_r*omega_r*sigma_r*y^2 - 2'
    expression_y = 'epsilon_i*mu_i*omega_i^2*x^2 + 2*epsilon_i*mu_i*omega_i*omega_r*x^2 - epsilon_i*mu_i*omega_r^2*x^2 + epsilon_i*mu_r*omega_i^2*x^2 - 2*epsilon_i*mu_r*omega_i*omega_r*x^2 - epsilon_i*mu_r*omega_r^2*x^2 + epsilon_r*mu_i*omega_i^2*x^2 - 2*epsilon_r*mu_i*omega_i*omega_r*x^2 - epsilon_r*mu_i*omega_r^2*x^2 - epsilon_r*mu_r*omega_i^2*x^2 - 2*epsilon_r*mu_r*omega_i*omega_r*x^2 + epsilon_r*mu_r*omega_r^2*x^2 - mu_i*omega_i*sigma_i*x^2 - mu_i*omega_i*sigma_r*x^2 - mu_i*omega_r*sigma_i*x^2 + mu_i*omega_r*sigma_r*x^2 - mu_r*omega_i*sigma_i*x^2 + mu_r*omega_i*sigma_r*x^2 + mu_r*omega_r*sigma_i*x^2 + mu_r*omega_r*sigma_r*x^2 + 2'
  []
  [source_imag]
    type = ParsedVectorFunction
    symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
    symbol_values = 'omega   mu   epsilon   sigma   omega   mu   epsilon   sigma'
    expression_x = '-epsilon_i*mu_i*omega_i^2*y^2 + 2*epsilon_i*mu_i*omega_i*omega_r*y^2 + epsilon_i*mu_i*omega_r^2*y^2 + epsilon_i*mu_r*omega_i^2*y^2 + 2*epsilon_i*mu_r*omega_i*omega_r*y^2 - epsilon_i*mu_r*omega_r^2*y^2 + epsilon_r*mu_i*omega_i^2*y^2 + 2*epsilon_r*mu_i*omega_i*omega_r*y^2 - epsilon_r*mu_i*omega_r^2*y^2 + epsilon_r*mu_r*omega_i^2*y^2 - 2*epsilon_r*mu_r*omega_i*omega_r*y^2 - epsilon_r*mu_r*omega_r^2*y^2 + mu_i*omega_i*sigma_i*y^2 - mu_i*omega_i*sigma_r*y^2 - mu_i*omega_r*sigma_i*y^2 - mu_i*omega_r*sigma_r*y^2 - mu_r*omega_i*sigma_i*y^2 - mu_r*omega_i*sigma_r*y^2 - mu_r*omega_r*sigma_i*y^2 + mu_r*omega_r*sigma_r*y^2 - 2'
    expression_y = 'epsilon_i*mu_i*omega_i^2*x^2 - 2*epsilon_i*mu_i*omega_i*omega_r*x^2 - epsilon_i*mu_i*omega_r^2*x^2 - epsilon_i*mu_r*omega_i^2*x^2 - 2*epsilon_i*mu_r*omega_i*omega_r*x^2 + epsilon_i*mu_r*omega_r^2*x^2 - epsilon_r*mu_i*omega_i^2*x^2 - 2*epsilon_r*mu_i*omega_i*omega_r*x^2 + epsilon_r*mu_i*omega_r^2*x^2 - epsilon_r*mu_r*omega_i^2*x^2 + 2*epsilon_r*mu_r*omega_i*omega_r*x^2 + epsilon_r*mu_r*omega_r^2*x^2 - mu_i*omega_i*sigma_i*x^2 + mu_i*omega_i*sigma_r*x^2 + mu_i*omega_r*sigma_i*x^2 + mu_i*omega_r*sigma_r*x^2 + mu_r*omega_i*sigma_i*x^2 + mu_r*omega_i*sigma_r*x^2 + mu_r*omega_r*sigma_i*x^2 - mu_r*omega_r*sigma_r*x^2 + 2'
  []
  #Material Coefficients
  [omega]
    type = ParsedFunction
    expression = '2.0'
  []
  [mu]
    type = ParsedFunction
    expression = '1.0'
  []
  [epsilon]
    type = ParsedFunction
    expression = '3.0'
  []
  [sigma]
    type = ParsedFunction
    expression = '4.0'
  []
[]
[Materials]
  [WaveCoeff]
    type = WaveEquationCoefficient
    eps_rel_imag = eps_imag
    eps_rel_real = eps_real
    k_real = k_real
    k_imag = k_imag
    mu_rel_imag = mu_imag
    mu_rel_real = mu_real
  []
  [eps_real]
    type = ADGenericFunctionMaterial
    prop_names = eps_real
    prop_values = epsilon
  []
  [eps_imag]
    type = ADGenericFunctionMaterial
    prop_names = eps_imag
    prop_values = epsilon
  []
  [mu_real]
    type = ADGenericFunctionMaterial
    prop_names = mu_real
    prop_values = mu
  []
  [mu_imag]
    type = ADGenericFunctionMaterial
    prop_names = mu_imag
    prop_values = mu
  []
  [k_real]
    type = ADGenericFunctionMaterial
    prop_names = k_real
    prop_values = omega
  []
  [k_imag]
    type = ADGenericFunctionMaterial
    prop_names = k_imag
    prop_values = omega
  []
  [cond_real]
    type = ADGenericFunctionMaterial
    prop_names = cond_real
    prop_values = sigma
  []
  [cond_imag]
    type = ADGenericFunctionMaterial
    prop_names = cond_imag
    prop_values = sigma
  []
[]
[Variables]
  [E_real]
    family = NEDELEC_ONE
    order = FIRST
  []
  [E_imag]
    family = NEDELEC_ONE
    order = FIRST
  []
[]
[Kernels]
  [curl_curl_real]
    type = CurlCurlField
    variable = E_real
  []
  [coeff_real]
    type = ADMatWaveReaction
    variable = E_real
    field_real =  E_real
    field_imag =  E_imag
    wave_coef_real = wave_equation_coefficient_real
    wave_coef_imag = wave_equation_coefficient_imaginary
    component = real
  []
  [conduction_real]
    type = ADConductionCurrent
    variable = E_real
    field_imag =  E_imag
    field_real =  E_real
    conductivity_real = cond_real
    conductivity_imag = cond_imag
    ang_freq_real = k_real
    ang_freq_imag = k_imag
    permeability_real = mu_real
    permeability_imag = mu_imag
    component = real
  []
  [body_force_real]
    type = VectorBodyForce
    variable = E_real
    function = source_real
  []
  [curl_curl_imag]
    type = CurlCurlField
    variable = E_imag
  []
  [coeff_imag]
    type = ADMatWaveReaction
    variable = E_imag
    field_real =  E_real
    field_imag =  E_imag
    wave_coef_real = wave_equation_coefficient_real
    wave_coef_imag = wave_equation_coefficient_imaginary
    component = imaginary
  []
  [conduction_imag]
    type = ADConductionCurrent
    variable = E_imag
    field_imag =  E_imag
    field_real =  E_real
    conductivity_real = cond_real
    conductivity_imag = cond_imag
    ang_freq_real = k_real
    ang_freq_imag = k_imag
    permeability_real = mu_real
    permeability_imag = mu_imag
    component = imaginary
  []
  [body_force_imag]
    type = VectorBodyForce
    variable = E_imag
    function = source_imag
  []
[]
[BCs]
  [sides_real]
    type = VectorCurlPenaltyDirichletBC
    variable = E_real
    function_x = 'y*y'
    function_y = '-x*x'
    penalty = 1e8
    boundary = 'left right top bottom'
  []
  [sides_imag]
    type = VectorCurlPenaltyDirichletBC
    variable = E_imag
    function_x = 'y*y'
    function_y = '-x*x'
    penalty = 1e8
    boundary = 'left right top bottom'
  []
[]
[Postprocessors]
  [error_real]
    type = ElementVectorL2Error
    variable = E_real
    function = exact
  []
  [error_imag]
    type = ElementVectorL2Error
    variable = E_imag
    function = exact
  []
  [h]
    type = AverageElementSize
  []
  [h_squared]
    type = ParsedPostprocessor
    pp_names = 'h'
    expression = 'h * h'
  []
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
[]
[Outputs]
  exodus = true
  csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/formloss/formloss_single.i)
# The expected pressure increase from textbook correlations for an expansion is: -355.68 Pa
# The form loss coefficient is computed with the following expression:
#
# K = (1-\beta)^2 = 0.25,
#
# where $\beta$ is the area ratio (0.5 in our case). With this, the total pressure drop
# can be computed using:
#
# \Delta p = 0.5 * K * \rho * v_upstream^2 + 0.5 * \rho * (v_downstream^2 - v_upstream^2)
#
# The expected pressure drop from textbook correlations for a contraction is: 2980.03437 Pa
# The form loss coefficient is computed with the following expression:
#
# K = 0.5*(1-/beta)^0.75 = 0.29730,
#
# where $\beta$ is the area ratio (0.5 in our case). With this, the total pressure drop
# can be computed using:
#
# \Delta p = 0.5 * K * rho * v_downstream^2 + 0.5 * \rho * (v_downstream^2 - v_upstream^2)
#
# Every velocity in these expressions is interstitial normal velocity to the surface.
[Mesh]
  [gen]
    type = CartesianMeshGenerator
    dim = 2
    dx = '1.0 1.0'
    dy = '1.0'
    subdomain_id = '1 2'
  []
  [area_change]
    type = SideSetsAroundSubdomainGenerator
    input = gen
    block = 1
    normal = '1 0 0'
    new_boundary = 'area_change'
  []
[]
[Materials]
  [all_constant_props]
    type = ADGenericConstantFunctorMaterial
    prop_names = 'rho  mu   '
    prop_values = '988  1e-3 '
  []
  [porosity]
    type = ADPiecewiseByBlockFunctorMaterial
    prop_name = porosity
    subdomain_to_prop_value = '1 0.50
                               2 1.00'
  []
[]
[Physics]
  [NavierStokes]
    [Flow]
      [flow]
        block = '1 2'
        compressibility = 'weakly-compressible'
        porous_medium_treatment = true
        # Material property parameters
        density = rho
        dynamic_viscosity = mu
        # Porous medium parameters
        porosity = porosity
        porosity_interface_pressure_treatment = 'bernoulli'
        pressure_drop_sidesets = 'area_change'
        pressure_drop_form_factors = '0.25'
        # Boundary conditions
        inlet_boundaries = 'left'
        outlet_boundaries = 'right'
        momentum_inlet_types = fixed-velocity
        momentum_inlet_functors = '0.6 0.0'
        momentum_outlet_types = fixed-pressure
        pressure_functors = '1.01e5'
      []
    []
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -pc_factor_shift_type'
  petsc_options_value = 'lu NONZERO'
  nl_rel_tol = 1e-12
[]
[Postprocessors]
  [inlet_pressure]
    type = ElementAverageValue
    variable = pressure
    block = 1
    outputs = none
  []
  [outlet_pressure]
    type = ElementAverageValue
    variable = pressure
    block = 2
    outputs = none
  []
  [pressure_drop]
    type = ParsedPostprocessor
    pp_names = 'inlet_pressure outlet_pressure'
    expression = 'inlet_pressure - outlet_pressure'
  []
[]
[Outputs]
  csv = true
  execute_on = FINAL
[]
(modules/thermal_hydraulics/tutorials/single_phase_flow/03_upper_loop.i)
T_in = 300. # K
m_dot_in = 1e-2 # kg/s
press = 10e5 # Pa
# core parameters
core_length = 1. # m
core_n_elems = 25
core_dia = '${units 2. cm -> m}'
core_pitch = '${units 8.7 cm -> m}'
A_core = '${fparse core_pitch^2 - 0.25 *pi * core_dia^2}'
P_wet_core = '${fparse 4*core_pitch + pi * core_dia}'
Dh_core = '${fparse 4 * A_core / P_wet_core}'
# pipe parameters
pipe_dia = '${units 10. cm -> m}'
A_pipe = '${fparse 0.25 * pi * pipe_dia^2}'
tot_power = 2000 # W
[GlobalParams]
  initial_p = ${press}
  initial_vel = 0.0001
  initial_T = ${T_in}
  initial_vel_x = 0
  initial_vel_y = 0
  initial_vel_z = 0
  gravity_vector = '0 0 0'
  rdg_slope_reconstruction = minmod
  scaling_factor_1phase = '1 1e-2 1e-4'
  scaling_factor_rhoV = 1
  scaling_factor_rhouV = 1e-2
  scaling_factor_rhovV = 1e-2
  scaling_factor_rhowV = 1e-2
  scaling_factor_rhoEV = 1e-4
  closures = thm_closures
  fp = he
[]
[FluidProperties]
  [he]
    type = IdealGasFluidProperties
    molar_mass = 4e-3
    gamma = 1.67
    k = 0.2556
    mu = 3.22639e-5
  []
[]
[Closures]
  [thm_closures]
    type = Closures1PhaseTHM
  []
[]
[SolidProperties]
  [steel]
    type = ThermalFunctionSolidProperties
    rho = 8050
    k = 45
    cp = 466
  []
[]
[Components]
  [total_power]
    type = TotalPower
    power = ${tot_power}
  []
  [inlet]
    type = InletMassFlowRateTemperature1Phase
    input = 'up_pipe_1:in'
    m_dot = ${m_dot_in}
    T = ${T_in}
  []
  [up_pipe_1]
    type = FlowChannel1Phase
    position = '0 0 0'
    orientation = '0 0 1'
    length = 0.5
    n_elems = 15
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct1]
    type = JunctionParallelChannels1Phase
    position = '0 0 0.5'
    connections = 'up_pipe_1:out core_chan:in'
    volume = 1e-5
  []
  [core_chan]
    type = FlowChannel1Phase
    position = '0 0 0.5'
    orientation = '0 0 1'
    length = ${core_length}
    n_elems = ${core_n_elems}
    roughness = .0001
    A = '${A_core}'
    D_h = ${Dh_core}
  []
  [core_hs]
    type = HeatStructureCylindrical
    position = '0 0 0.5'
    orientation = '0 0 1'
    length = ${core_length}
    n_elems = ${core_n_elems}
    names = 'block'
    widths = '${fparse core_dia / 2.}'
    solid_properties = 'steel'
    solid_properties_T_ref = '300'
    n_part_elems = 3
  []
  [core_heating]
    type = HeatSourceFromTotalPower
    hs = core_hs
    regions = block
    power = total_power
  []
  [core_ht]
    type = HeatTransferFromHeatStructure1Phase
    flow_channel = core_chan
    hs = core_hs
    hs_side = outer
    P_hf = '${fparse pi * core_dia}'
  []
  [jct2]
    type = JunctionParallelChannels1Phase
    position = '0 0 1.5'
    connections = 'core_chan:out up_pipe_2:in'
    volume = 1e-5
  []
  [up_pipe_2]
    type = FlowChannel1Phase
    position = '0 0 1.5'
    orientation = '0 0 1'
    length = 0.5
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct3]
    type = JunctionOneToOne1Phase
    connections = 'up_pipe_2:out top_pipe:in'
  []
  [top_pipe]
    type = FlowChannel1Phase
    position = '0 0 2'
    orientation = '1 0 0'
    length = 1
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct4]
    type = JunctionOneToOne1Phase
    connections = 'top_pipe:out down_pipe_1:in'
  []
  [down_pipe_1]
    type = FlowChannel1Phase
    position = '1 0 2'
    orientation = '0 0 -1'
    length = 0.25
    A = ${A_pipe}
    n_elems = 5
  []
  [jct5]
    type = JunctionOneToOne1Phase
    connections = 'down_pipe_1:out cooling_pipe:in'
  []
  [cooling_pipe]
    type = FlowChannel1Phase
    position = '1 0 1.75'
    orientation = '0 0 -1'
    length = 1.5
    n_elems = 25
    A = ${A_pipe}
  []
  [cold_wall]
    type = HeatTransferFromSpecifiedTemperature1Phase
    flow_channel = cooling_pipe
    T_wall = 300
    P_hf = '${fparse pi * pipe_dia}'
  []
  [jct6]
    type = JunctionOneToOne1Phase
    connections = 'cooling_pipe:out down_pipe_2:in'
  []
  [down_pipe_2]
    type = FlowChannel1Phase
    position = '1 0 0.25'
    orientation = '0 0 -1'
    length = 0.25
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [outlet]
    type = Outlet1Phase
    input = 'down_pipe_2:out'
    p = ${press}
  []
[]
[Postprocessors]
  [power_to_coolant]
    type = ADHeatRateConvection1Phase
    block = core_chan
    P_hf = '${fparse pi *core_dia}'
  []
  [core_T_out]
    type = SideAverageValue
    boundary = core_chan:out
    variable = T
  []
  [core_p_in]
    type = SideAverageValue
    boundary = core_chan:in
    variable = p
  []
  [core_p_out]
    type = SideAverageValue
    boundary = core_chan:out
    variable = p
  []
  [core_delta_p]
    type = ParsedPostprocessor
    pp_names = 'core_p_in core_p_out'
    expression = 'core_p_in - core_p_out'
  []
  [hx_pri_T_out]
    type = SideAverageValue
    boundary = cooling_pipe:out
    variable = T
  []
[]
[Preconditioning]
  [pc]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  start_time = 0
  [TimeStepper]
    type = IterationAdaptiveDT
    dt = 1
  []
  end_time = 500
  line_search = basic
  solve_type = NEWTON
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-8
  nl_max_its = 25
[]
[Outputs]
  exodus = true
  [console]
    type = Console
    max_rows = 1
    outlier_variable_norms = false
  []
  print_linear_residuals = false
[]
(modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/lid-driven.i)
mu = 1
rho = 1
l = 1
U = 100
n = 8
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = ${l}
    ymin = 0
    ymax = ${l}
    nx = ${n}
    ny = ${n}
    elem_type = TRI6
  []
[]
[Variables]
  [vel_x]
    family = L2_HIERARCHIC
    order = SECOND
  []
  [vel_y]
    family = L2_HIERARCHIC
    order = SECOND
  []
  [pressure]
    family = L2_HIERARCHIC
    order = FIRST
  []
  [vel_bar_x]
    family = SIDE_HIERARCHIC
    order = SECOND
  []
  [vel_bar_y]
    family = SIDE_HIERARCHIC
    order = SECOND
  []
  [pressure_bar]
    family = SIDE_HIERARCHIC
    order = FIRST
  []
  [lambda]
    family = SCALAR
    order = FIRST
  []
[]
[HDGKernels]
  [momentum_x_convection]
    type = AdvectionIPHDGKernel
    variable = vel_x
    face_variable = vel_bar_x
    velocity = 'velocity'
    coeff = ${rho}
  []
  [momentum_x_diffusion]
    type = NavierStokesStressIPHDGKernel
    variable = vel_x
    face_variable = vel_bar_x
    diffusivity = 'mu'
    alpha = 6
    pressure_variable = pressure
    pressure_face_variable = pressure_bar
    component = 0
  []
  [momentum_y_convection]
    type = AdvectionIPHDGKernel
    variable = vel_y
    face_variable = vel_bar_y
    velocity = 'velocity'
    coeff = ${rho}
  []
  [momentum_y_diffusion]
    type = NavierStokesStressIPHDGKernel
    variable = vel_y
    face_variable = vel_bar_y
    diffusivity = 'mu'
    alpha = 6
    pressure_variable = pressure
    pressure_face_variable = pressure_bar
    component = 1
  []
  [pressure_convection]
    type = AdvectionIPHDGKernel
    variable = pressure
    face_variable = pressure_bar
    velocity = 'velocity'
    coeff = '${fparse -rho}'
    self_advection = false
  []
[]
[Kernels]
  [mean_zero_pressure]
    type = ScalarLagrangeMultiplier
    variable = pressure
    lambda = lambda
  []
[]
[ScalarKernels]
  [mean_zero_pressure_lm]
    type = AverageValueConstraint
    variable = lambda
    pp_name = pressure_integral
    value = 0
  []
[]
[BCs]
  [momentum_x_diffusion_walls]
    type = NavierStokesStressIPHDGDirichletBC
    boundary = 'left bottom right'
    variable = vel_x
    face_variable = vel_bar_x
    pressure_variable = pressure
    pressure_face_variable = pressure_bar
    alpha = 6
    functor = '0'
    diffusivity = 'mu'
    component = 0
  []
  [momentum_x_diffusion_top]
    type = NavierStokesStressIPHDGDirichletBC
    boundary = 'top'
    variable = vel_x
    face_variable = vel_bar_x
    pressure_variable = pressure
    pressure_face_variable = pressure_bar
    alpha = 6
    functor = '${U}'
    diffusivity = 'mu'
    component = 0
  []
  [momentum_y_diffusion_all]
    type = NavierStokesStressIPHDGDirichletBC
    boundary = 'left bottom right top'
    variable = vel_y
    face_variable = vel_bar_y
    pressure_variable = pressure
    pressure_face_variable = pressure_bar
    alpha = 6
    functor = '0'
    diffusivity = 'mu'
    component = 1
  []
  [mass_convection]
    type = AdvectionIPHDGPrescribedFluxBC
    face_variable = pressure_bar
    variable = pressure
    velocity = 'velocity'
    coeff = '${fparse -rho}'
    self_advection = false
    boundary = 'left bottom top right'
    prescribed_normal_flux = 0
  []
[]
[Materials]
  [const]
    type = ADGenericConstantMaterial
    prop_names = 'rho mu'
    prop_values = '${rho} ${mu}'
  []
  [vel]
    type = ADVectorFromComponentVariablesMaterial
    vector_prop_name = 'velocity'
    u = vel_x
    v = vel_y
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -pc_factor_shift_type'
  petsc_options_value = 'lu       NONZERO'
  nl_rel_tol = 1e-12
[]
[Outputs]
  [out]
    type = Exodus
    hide = 'lambda pressure_integral vel_bar_x vel_bar_y pressure_bar'
  []
[]
[Postprocessors]
  [Re]
    type = ParsedPostprocessor
    pp_names = ''
    expression = '${rho} * ${U} * ${l} / ${mu}'
  []
  [pressure_integral]
    type = ElementIntegralVariablePostprocessor
    variable = pressure
    execute_on = linear
  []
[]
(test/tests/convergence/reference_residual_convergence/abs_ref_acceptable.i)
[Mesh]
  type = GeneratedMesh
  dim = 1
  nx = 10
[]
[GlobalParams]
  absolute_value_vector_tags = 'absref'
[]
[Problem]
  extra_tag_vectors = 'absref'
[]
[Variables]
  [u][]
  [v]
    scaling = 1e-6
  []
[]
[Functions]
  [ramp]
    type = ParsedFunction
    expression = 'if(t < 5, t - 5, 0) * x'
  []
[]
[Kernels]
  [u_dt]
    type = TimeDerivative
    variable = u
  []
  [u_coupled_rx]
    type = CoupledForce
    variable = u
    v = v
    coef = 1
  []
  [v_dt]
    type = TimeDerivative
    variable = v
  []
  [v_neg_force]
    type = BodyForce
    variable = v
    value = ${fparse -1 / 2}
    function = ramp
  []
  [v_force]
    type = BodyForce
    variable = v
    value = 1
    function = ramp
  []
[]
[Postprocessors]
  [u_avg]
    type = ElementAverageValue
    variable = u
    execute_on = 'TIMESTEP_END INITIAL'
  []
  [v_avg]
    type = ElementAverageValue
    variable = v
    execute_on = 'TIMESTEP_END INITIAL'
  []
  [timestep]
    type = TimePostprocessor
    outputs = 'none'
  []
  [v_old]
    type = ElementAverageValue
    variable = v
    execute_on = TIMESTEP_BEGIN
    outputs = none
  []
  [u_old]
    type = ElementAverageValue
    variable = u
    execute_on = TIMESTEP_BEGIN
    outputs = none
  []
  [v_exact]
    type = ParsedPostprocessor
    pp_names = 'timestep v_old'
    expression = 't := if(timestep > 5, 5, timestep); (t^2 - 9 * t) / 8'
  []
  [u_exact]
    type = ParsedPostprocessor
    pp_names = 'u_old v_exact'
    expression = 'u_old + v_exact'
  []
[]
[Convergence]
  [conv]
    type = ReferenceResidualConvergence
    reference_vector = 'absref'
    acceptable_iterations = 1
    acceptable_multiplier = 1e6
  []
[]
[Executioner]
  type = Transient
  petsc_options = '-snes_converged_reason'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  line_search = none
  num_steps = 3
  nl_rel_tol = 1e-06
  nonlinear_convergence = conv
  verbose = true
[]
[Outputs]
  csv = true
  perf_graph = true
[]
(modules/combined/examples/optimization/multi-load/single_subapp_two.i)
power = 2
E0 = 1.0
Emin = 1.0e-6
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Mesh]
  [Bottom]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 80
    ny = 40
    xmin = 0
    xmax = 150
    ymin = 0
    ymax = 75
  []
  [left_load]
    type = ExtraNodesetGenerator
    input = Bottom
    new_boundary = left_load
    coord = '37.5 75 0'
  []
  [right_load]
    type = ExtraNodesetGenerator
    input = left_load
    new_boundary = right_load
    coord = '112.5 75 0'
  []
  [left_support]
    type = ExtraNodesetGenerator
    input = right_load
    new_boundary = left_support
    coord = '0 0 0'
  []
  [right_support]
    type = ExtraNodesetGenerator
    input = left_support
    new_boundary = right_support
    coord = '150 0 0'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
[]
[AuxVariables]
  [Dc]
    family = MONOMIAL
    order = SECOND
    initial_condition = -1.0
  []
  [Cc]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = -1.0
  []
  [mat_den]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = 0.1
  []
  [sensitivity_var]
    family = MONOMIAL
    order = SECOND
    initial_condition = -1.0
  []
[]
[AuxKernels]
  [sensitivity_kernel]
    type = MaterialRealAux
    check_boundary_restricted = false
    property = sensitivity
    variable = sensitivity_var
    execute_on = 'TIMESTEP_END'
  []
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    strain = SMALL
    add_variables = true
    incremental = false
  []
[]
[BCs]
  [no_y]
    type = DirichletBC
    variable = disp_y
    boundary = left_support
    value = 0.0
  []
  [no_x]
    type = DirichletBC
    variable = disp_x
    boundary = left_support
    value = 0.0
  []
  [no_y_right]
    type = DirichletBC
    variable = disp_y
    boundary = right_support
    value = 0.0
  []
[]
[NodalKernels]
  [push_right]
    type = NodalGravity
    variable = disp_y
    boundary = right_load
    gravity_value = -1e-3
    mass = 1
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeVariableIsotropicElasticityTensor
    youngs_modulus = E_phys
    poissons_ratio = poissons_ratio
    args = 'mat_den'
  []
  [E_phys]
    type = DerivativeParsedMaterial
    # Emin + (density^penal) * (E0 - Emin)
    expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
    coupled_variables = 'mat_den'
    property_name = E_phys
  []
  [poissons_ratio]
    type = GenericConstantMaterial
    prop_names = poissons_ratio
    prop_values = 0.0
  []
  [stress]
    type = ComputeLinearElasticStress
  []
  [dc]
    type = ComplianceSensitivity
    design_density = mat_den
    youngs_modulus = E_phys
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[UserObjects]
  [rad_avg]
    type = RadialAverage
    radius = 3
    weights = linear
    prop_name = sensitivity
    execute_on = TIMESTEP_END
    force_preaux = true
  []
  # No SIMP optimization in subapp
  [calc_sense]
    type = SensitivityFilter
    density_sensitivity = Dc
    design_density = mat_den
    filter_UO = rad_avg
    execute_on = TIMESTEP_END
    force_postaux = true
  []
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu superlu_dist'
  nl_abs_tol = 1e-10
  dt = 1.0
  num_steps = 25
[]
[Outputs]
  exodus = true
  [out]
    type = CSV
    execute_on = 'TIMESTEP_END'
  []
  print_linear_residuals = false
[]
[Postprocessors]
  [mesh_volume]
    type = VolumePostprocessor
    execute_on = 'initial timestep_end'
  []
  [total_vol]
    type = ElementIntegralVariablePostprocessor
    variable = mat_den
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [vol_frac]
    type = ParsedPostprocessor
    expression = 'total_vol / mesh_volume'
    pp_names = 'total_vol mesh_volume'
  []
  [sensitivity]
    type = ElementIntegralMaterialProperty
    mat_prop = sensitivity
    execute_on = 'TIMESTEP_BEGIN TIMESTEP_END NONLINEAR'
  []
  [objective]
    type = ElementIntegralMaterialProperty
    mat_prop = strain_energy_density
    execute_on = 'INITIAL TIMESTEP_END'
  []
[]
(test/tests/problems/reference_residual_problem/ad_abs_ref.i)
[Mesh]
  type = GeneratedMesh
  dim = 1
  nx = 10
[]
[GlobalParams]
  absolute_value_vector_tags = 'absref'
[]
[Problem]
  type = ReferenceResidualProblem
  reference_vector = 'absref'
  extra_tag_vectors = 'absref'
[]
[Variables]
  [u][]
  [v]
    scaling = 1e-6
  []
[]
[Functions]
  [ramp]
    type = ParsedFunction
    expression = 'if(t < 5, t - 5, 0) * x'
  []
[]
[Kernels]
  [u_dt]
    type = ADTimeDerivative
    variable = u
  []
  [u_coupled_rx]
    type = ADCoupledForce
    variable = u
    v = v
    coef = 1
  []
  [v_dt]
    type = ADTimeDerivative
    variable = v
  []
  [v_neg_force]
    type = ADBodyForce
    variable = v
    value = ${fparse -1 / 2}
    function = ramp
  []
  [v_force]
    type = ADBodyForce
    variable = v
    value = 1
    function = ramp
  []
[]
[Postprocessors]
  [u_avg]
    type = ElementAverageValue
    variable = u
    execute_on = 'TIMESTEP_END INITIAL'
  []
  [v_avg]
    type = ElementAverageValue
    variable = v
    execute_on = 'TIMESTEP_END INITIAL'
  []
  [timestep]
    type = TimePostprocessor
    outputs = 'none'
  []
  [v_old]
    type = ElementAverageValue
    variable = v
    execute_on = TIMESTEP_BEGIN
    outputs = none
  []
  [u_old]
    type = ElementAverageValue
    variable = u
    execute_on = TIMESTEP_BEGIN
    outputs = none
  []
  [v_exact]
    type = ParsedPostprocessor
    pp_names = 'timestep v_old'
    expression = 't := if(timestep > 5, 5, timestep); (t^2 - 9 * t) / 8'
  []
  [u_exact]
    type = ParsedPostprocessor
    pp_names = 'u_old v_exact'
    expression = 'u_old + v_exact'
  []
[]
[Executioner]
  type = Transient
  petsc_options = '-snes_converged_reason'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  line_search = none
  num_steps = 10
  nl_rel_tol = 1e-06
  verbose = true
[]
[Outputs]
  csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/materials/enthalpy_computation.i)
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 2
    ymin = 0
    ymax = 1
    nx = 5
    ny = 5
  []
[]
[AuxVariables]
  [pressure]
    type = INSFVPressureVariable
  []
  [T_fluid]
    type = INSFVEnergyVariable
  []
[]
[FVICs]
  [p]
    type = FVFunctionIC
    variable = 'pressure'
    function = '1e5 + 1e4 * x + 5e3 * y'
  []
  [T]
    type = FVFunctionIC
    variable = T_fluid
    function = '300 + 20 * x + 100 * y'
  []
[]
[FluidProperties]
  [fp]
    type = LeadBismuthFluidProperties
  []
[]
[FunctorMaterials]
  [fluid_props_to_mat_props]
    type = GeneralFunctorFluidProps
    fp = fp
    pressure = 'pressure'
    T_fluid = 'T_fluid'
    speed = '1'
    # For porous flow
    characteristic_length = 2
    porosity = 1
  []
  [compute_cp]
    type = INSFVEnthalpyFunctorMaterial
    # Use these for non constant cp
    # fp = fp
    # pressure = 'pressure'
    temperature = 'T_fluid'
    cp = 'cp'
    rho = 'rho'
  []
[]
T_mo = 398
[Postprocessors]
  [min_T]
    type = ElementExtremeFunctorValue
    value_type = 'min'
    functor = 'T_fluid'
  []
  [max_T]
    type = ElementExtremeFunctorValue
    functor = 'T_fluid'
  []
  [min_h]
    type = ElementExtremeFunctorValue
    value_type = 'min'
    functor = 'h'
  []
  [max_h]
    type = ElementExtremeFunctorValue
    value_type = 'max'
    functor = 'h'
  []
  [min_rho_h]
    type = ElementExtremeFunctorValue
    value_type = 'min'
    functor = 'rho_h'
  []
  [max_rho_h]
    type = ElementExtremeFunctorValue
    value_type = 'max'
    functor = 'rho_h'
  []
  [expected_min_h]
    type = ParsedPostprocessor
    expression = '164.8 * (min_T - T_mo) - 1.97e-2 * (min_T * min_T - T_mo * T_mo) +
         (1.25e-5 / 3) * (min_T * min_T * min_T - T_mo * T_mo * T_mo) + 4.56e+5 * (1. / min_T - 1. / T_mo)'
    pp_names = 'min_T'
    constant_names = 'T_mo'
    constant_expressions = '${T_mo}'
  []
  [expected_max_h]
    type = ParsedPostprocessor
    expression = '164.8 * (max_T - T_mo) - 1.97e-2 * (max_T * max_T - T_mo * T_mo) +
         (1.25e-5 / 3) * (max_T * max_T * max_T - T_mo * T_mo * T_mo) + 4.56e+5 * (1. / max_T - 1. / T_mo)'
    pp_names = 'max_T'
    constant_names = 'T_mo'
    constant_expressions = '${T_mo}'
  []
[]
[Executioner]
  type = Transient
  end_time = 0.1
  dt = 0.1
[]
[Outputs]
  csv = true
  hide = 'min_T max_T'
[]
[Problem]
  solve = false
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/materials/2d-steady-wall-balance.i)
L = 30
bulk_u = 0.01
p_ref = 101325.0
T_in = 860
q_source = 50000
q2_wall = 10000
A_cp = 976.78
B_cp = 1.0634
rho = 2000
advected_interp_method = 'upwind'
[Mesh]
  [gmg]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = ${L}
    ymin = 1
    ymax = 2.5
    nx = 10
  []
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
  advected_interp_method = ${advected_interp_method}
  velocity_interp_method = 'rc'
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = vel_x
    v = vel_y
    pressure = pressure
  []
[]
[Variables]
  [vel_x]
    type = INSFVVelocityVariable
    initial_condition = ${bulk_u}
    two_term_boundary_expansion = false
  []
  [vel_y]
    type = INSFVVelocityVariable
    initial_condition = 0
    two_term_boundary_expansion = false
  []
  [pressure]
    type = INSFVPressureVariable
    initial_condition = ${p_ref}
    two_term_boundary_expansion = false
  []
  [T]
    type = INSFVEnergyVariable
    two_term_boundary_expansion = false
    initial_condition = ${T_in}
  []
[]
[FVKernels]
  [mass]
    type = WCNSFVMassAdvection
    variable = pressure
    rho = 'rho'
  []
  [u_advection]
    type = INSFVMomentumAdvection
    variable = vel_x
    rho = 'rho'
    momentum_component = 'x'
  []
  [u_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_x
    mu = 'mu'
    momentum_component = 'x'
  []
  [u_pressure]
    type = INSFVMomentumPressure
    variable = vel_x
    momentum_component = 'x'
    pressure = pressure
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = vel_y
    rho = 'rho'
    momentum_component = 'y'
  []
  [v_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_y
    mu = 'mu'
    momentum_component = 'y'
  []
  [v_pressure]
    type = INSFVMomentumPressure
    variable = vel_y
    momentum_component = 'y'
    pressure = pressure
  []
  [temp_conduction]
    type = FVDiffusion
    coeff = 'k'
    variable = T
  []
  [temp_advection]
    type = INSFVEnergyAdvection
    variable = T
  []
  [source]
    type = FVBodyForce
    variable = T
    function = source_func
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_x
    functor = ${bulk_u}
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_y
    functor = 0
  []
  [inlet_T]
    type = FVDirichletBC
    variable = T
    boundary = 'left'
    value = ${T_in}
  []
  [incoming_heat]
    type = FVNeumannBC
    variable = T
    value = ${q2_wall}
    boundary = 'top'
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = ${p_ref}
  []
[]
[Functions]
  [source_func]
    type = ParsedFunction
    expression = '${q_source}'
  []
[]
[FunctorMaterials]
  [converter_to_regular_T]
    type = FunctorADConverter
    ad_props_in = 'T'
    reg_props_out = 'T_nAD'
  []
  [ins_fv]
    type = INSFVEnthalpyFunctorMaterial
    temperature = 'T'
    rho = 'rho'
    cp = 'cp'
    assumed_constant_cp = false
    h_in = 'h'
    # fp = 'fp'
    # pressure = 'pressure'
  []
  [rho]
    type = ADParsedFunctorMaterial
    property_name = 'rho'
    expression = '${rho}'
  []
  [mu]
    type = ADParsedFunctorMaterial
    property_name = 'mu'
    expression = '4.5e-3'
  []
  [k]
    type = ADParsedFunctorMaterial
    property_name = 'k'
    expression = '0.7'
  []
  [h]
    type = ADParsedFunctorMaterial
    property_name = 'h'
    functor_names = 'T ${A_cp} ${B_cp}'
    functor_symbols = 'T A_cp B_cp'
    expression = 'A_cp * T + B_cp * T * T / 2'
  []
  [cp]
    type = ADParsedFunctorMaterial
    property_name = 'cp'
    functor_names = 'T ${A_cp} ${B_cp}'
    functor_symbols = 'T A_cp B_cp'
    expression = 'A_cp+B_cp*T'
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -pc_factor_shift_type'
  petsc_options_value = 'lu       NONZERO'
  nl_abs_tol = 1e-9
  nl_max_its = 50
  line_search = 'none'
  automatic_scaling = true
  off_diagonals_in_auto_scaling = true
[]
[Postprocessors]
  [H_in]
    type = VolumetricFlowRate
    vel_x = 'vel_x'
    advected_quantity = 'rho_h'
    boundary = 'left'
  []
  [H_out]
    type = VolumetricFlowRate
    vel_x = 'vel_x'
    advected_quantity = 'rho_h'
    boundary = 'right'
  []
  [Q]
    type = FunctionElementIntegral
    function = 'source_func'
    execute_on = 'initial'
  []
  [Q_wall]
    type = FunctionSideIntegral
    function = ${q2_wall}
    boundary = 'top'
  []
  [balance_in_percent]
    type = ParsedPostprocessor
    expression = '(H_out + H_in - Q - Q_wall) / H_in * 100'
    pp_names = 'H_in H_out Q Q_wall'
  []
[]
[Outputs]
  csv = true
[]
(modules/thermal_hydraulics/tutorials/single_phase_flow/01_flow_channel.i)
T_in = 300. # K
m_dot_in = 1e-2 # kg/s
press = 10e5 # Pa
[GlobalParams]
  initial_p = ${press}
  initial_vel = 0.0001
  initial_T = ${T_in}
  gravity_vector = '0 0 0'
  rdg_slope_reconstruction = minmod
  scaling_factor_1phase = '1 1e-2 1e-4'
  closures = thm_closures
  fp = he
[]
[FluidProperties]
  [he]
    type = IdealGasFluidProperties
    molar_mass = 4e-3
    gamma = 1.67
    k = 0.2556
    mu = 3.22639e-5
  []
[]
[Closures]
  [thm_closures]
    type = Closures1PhaseTHM
  []
[]
[Components]
  [inlet]
    type = InletMassFlowRateTemperature1Phase
    input = 'core_chan:in'
    m_dot = ${m_dot_in}
    T = ${T_in}
  []
  [core_chan]
    type = FlowChannel1Phase
    position = '0 0 0'
    orientation = '0 0 1'
    length = 1
    n_elems = 25
    A = 7.2548e-3
    D_h = 7.0636e-2
  []
  [outlet]
    type = Outlet1Phase
    input = 'core_chan:out'
    p = ${press}
  []
[]
[Postprocessors]
  [core_p_in]
    type = SideAverageValue
    boundary = core_chan:in
    variable = p
  []
  [core_p_out]
    type = SideAverageValue
    boundary = core_chan:out
    variable = p
  []
  [core_delta_p]
    type = ParsedPostprocessor
    pp_names = 'core_p_in core_p_out'
    expression = 'core_p_in - core_p_out'
  []
[]
[Preconditioning]
  [pc]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  line_search = basic
  start_time = 0
  end_time = 1000
  dt = 10
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-8
  nl_max_its = 25
[]
[Outputs]
  exodus = true
  [console]
    type = Console
    max_rows = 1
    outlier_variable_norms = false
  []
  print_linear_residuals = false
[]
(modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/scalar_azim_magnetic_time_deriv.i)
# Test for AzimuthMagneticTimeDerivRZ with scalar inputs
# Manufactured solution: E_real = y^2 * x_hat - x^2 * y_hat
#                        E_imag = y^2 * x_hat - x^2 * y_hat
#                        dB_theta_real / dt = -(2*y + 2*x)
[Mesh]
  [gmg]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 5
    ny = 5
    xmax = 1
    xmin = 0
    ymax = 1
    ymin = -1
    elem_type = QUAD9
  []
  coord_type = RZ
  rz_coord_axis = Y
[]
[Functions]
  #The exact solution for the heated species and electric field real and imag. component
  [exact_real]
    type = ParsedVectorFunction
    expression_x = 'y^2'
    expression_y = '-x^2'
  []
  [exact_imag]
    type = ParsedVectorFunction
    expression_x = 'y^2'
    expression_y = '-x^2'
  []
  #The forcing terms for the heated species and electric field real and imag. component
  [source_real]
    type = ParsedVectorFunction
    expression_x = '-y^2 - cos(pi*y) - 2'
    expression_y = 'x^2 + cos(pi*x) + 4 + 2*y/x'
  []
  [source_imag]
    type = ParsedVectorFunction
    expression_x = '-y^2 + sin(pi*y) - 2'
    expression_y = 'x^2 - sin(pi*x) + 4 + 2*y/x'
  []
  [current_real]
    type = ParsedVectorFunction
    expression_x = 'sin(pi*y)'
    expression_y = '-sin(pi*x)'
  []
  [current_imag]
    type = ParsedVectorFunction
    expression_x = 'cos(pi*y)'
    expression_y = '-cos(pi*x)'
  []
  [azim_dB_dt_func]
    type = ParsedFunction
    expression = '-(2*y + 2*x)'
  []
[]
[Materials]
  [WaveCoeff]
    type = WaveEquationCoefficient
    eps_rel_real = 1.0
    eps_rel_imag = 0.0
    k_real = 1.0
    k_imag = 0.0
    mu_rel_real = 1.0
    mu_rel_imag = 0.0
  []
[]
[Variables]
  [E_real]
    family = NEDELEC_ONE
    order = FIRST
  []
  [E_imag]
    family = NEDELEC_ONE
    order = FIRST
  []
[]
[Kernels]
  [curl_curl_real]
    type = CurlCurlField
    variable = E_real
  []
  [coeff_real]
    type = ADMatWaveReaction
    variable = E_real
    field_real =  E_real
    field_imag =  E_imag
    wave_coef_real = wave_equation_coefficient_real
    wave_coef_imag = wave_equation_coefficient_imaginary
    component = real
  []
  [current_real]
    type = VectorCurrentSource
    variable = E_real
    source_real = current_real
    source_imag = current_imag
    component = real
  []
  [body_force_real]
    type = VectorBodyForce
    variable = E_real
    function = source_real
  []
  [curl_curl_imag]
    type = CurlCurlField
    variable = E_imag
  []
  [coeff_imag]
    type = ADMatWaveReaction
    variable = E_imag
    field_real =  E_real
    field_imag =  E_imag
    wave_coef_real = wave_equation_coefficient_real
    wave_coef_imag = wave_equation_coefficient_imaginary
    component = imaginary
  []
  [current_imag]
    type = VectorCurrentSource
    variable = E_imag
    source_real = current_real
    source_imag = current_imag
    component = imaginary
  []
  [body_force_imag]
    type = VectorBodyForce
    variable = E_imag
    function = source_imag
  []
[]
[AuxVariables]
  [aux_E_real_x]
    family = MONOMIAL
    order = FIRST
  []
  [aux_E_real_y]
    family = MONOMIAL
    order = FIRST
  []
  [azim_dB_dt_term_scalar]
    family = MONOMIAL
    order = FIRST
  []
[]
[AuxKernels]
  [aux_E_real_x]
    type = VectorVariableComponentAux
    variable = aux_E_real_x
    vector_variable = E_real
    component = X
  []
  [aux_E_real_y]
    type = VectorVariableComponentAux
    variable = aux_E_real_y
    vector_variable = E_real
    component = Y
  []
  [aux_azim_dB_dt_scalar]
    type = AzimuthMagneticTimeDerivRZ
    Efield_X = aux_E_real_x
    Efield_Y = aux_E_real_y
    variable = azim_dB_dt_term_scalar
  []
[]
[BCs]
  [sides_real]
    type = VectorCurlPenaltyDirichletBC
    variable = E_real
    function = exact_real
    penalty = 1e8
    boundary = 'left right top bottom'
  []
  [sides_imag]
    type = VectorCurlPenaltyDirichletBC
    variable = E_imag
    function = exact_imag
    penalty = 1e8
    boundary = 'left right top bottom'
  []
[]
[Postprocessors]
  [error_real]
    type = ElementVectorL2Error
    variable = E_real
    function = exact_real
  []
  [error_imag]
    type = ElementVectorL2Error
    variable = E_imag
    function = exact_imag
  []
  [error_azim_dB_dt_scalar]
    type = ElementL2Error
    variable = azim_dB_dt_term_scalar
    function = azim_dB_dt_func
  []
  [h]
    type = AverageElementSize
  []
  [h_squared]
    type = ParsedPostprocessor
    pp_names = 'h'
    expression = 'h * h'
  []
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-16
[]
[Outputs]
  exodus = true
  csv = true
[]
(test/tests/problems/reference_residual_problem/abs_ref.i)
[Mesh]
  type = GeneratedMesh
  dim = 1
  nx = 10
[]
[GlobalParams]
  absolute_value_vector_tags = 'absref'
[]
[Problem]
  type = ReferenceResidualProblem
  reference_vector = 'absref'
  extra_tag_vectors = 'absref'
[]
[Variables]
  [u][]
  [v]
    scaling = 1e-6
  []
[]
[Functions]
  [ramp]
    type = ParsedFunction
    expression = 'if(t < 5, t - 5, 0) * x'
  []
[]
[Kernels]
  [u_dt]
    type = TimeDerivative
    variable = u
  []
  [u_coupled_rx]
    type = CoupledForce
    variable = u
    v = v
    coef = 1
  []
  [v_dt]
    type = TimeDerivative
    variable = v
  []
  [v_neg_force]
    type = BodyForce
    variable = v
    value = ${fparse -1 / 2}
    function = ramp
  []
  [v_force]
    type = BodyForce
    variable = v
    value = 1
    function = ramp
  []
[]
[Postprocessors]
  [u_avg]
    type = ElementAverageValue
    variable = u
    execute_on = 'TIMESTEP_END INITIAL'
  []
  [v_avg]
    type = ElementAverageValue
    variable = v
    execute_on = 'TIMESTEP_END INITIAL'
  []
  [timestep]
    type = TimePostprocessor
    outputs = 'none'
  []
  [v_old]
    type = ElementAverageValue
    variable = v
    execute_on = TIMESTEP_BEGIN
    outputs = none
  []
  [u_old]
    type = ElementAverageValue
    variable = u
    execute_on = TIMESTEP_BEGIN
    outputs = none
  []
  [v_exact]
    type = ParsedPostprocessor
    pp_names = 'timestep v_old'
    expression = 't := if(timestep > 5, 5, timestep); (t^2 - 9 * t) / 8'
  []
  [u_exact]
    type = ParsedPostprocessor
    pp_names = 'u_old v_exact'
    expression = 'u_old + v_exact'
  []
[]
[Executioner]
  type = Transient
  petsc_options = '-snes_converged_reason'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  line_search = none
  num_steps = 10
  nl_rel_tol = 1e-06
  verbose = true
[]
[Outputs]
  csv = true
[]
(modules/porous_flow/test/tests/sinks/s08.i)
# apply a sink flux on just one component of a 3-component, 2-phase system and observe the correct behavior
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = 0
  xmax = 1
  ymin = 0
  ymax = 1
  zmin = 0
  zmax = 2
[]
[GlobalParams]
  PorousFlowDictator = dictator
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = 'pwater frac_ph0_c0 pgas'
    number_fluid_phases = 2
    number_fluid_components = 3
  []
  [pc]
    type = PorousFlowCapillaryPressureVG
    m = 0.5
    alpha = 1.1
  []
[]
[Variables]
  [pwater]
  []
  [frac_ph0_c0]
    initial_condition = 0.3
  []
  [pgas]
  []
[]
[ICs]
  [pwater]
    type = FunctionIC
    variable = pwater
    function = y
  []
  [pgas]
    type = FunctionIC
    variable = pgas
    function = y+3
  []
[]
[Kernels]
  [mass_c0]
    type = PorousFlowMassTimeDerivative
    fluid_component = 0
    variable = frac_ph0_c0
  []
  [mass_c1]
    type = PorousFlowMassTimeDerivative
    fluid_component = 1
    variable = pwater
  []
  [mass_c2]
    type = PorousFlowMassTimeDerivative
    fluid_component = 2
    variable = pgas
  []
[]
[FluidProperties]
  [simple_fluid0]
    type = SimpleFluidProperties
    bulk_modulus = 2.3
    density0 = 1.5
    thermal_expansion = 0
    viscosity = 2.1
  []
  [simple_fluid1]
    type = SimpleFluidProperties
    bulk_modulus = 1.3
    density0 = 1.1
    thermal_expansion = 0
    viscosity = 1.1
  []
[]
[Materials]
  [temperature]
    type = PorousFlowTemperature
  []
  [ppss]
    type = PorousFlow2PhasePP
    phase0_porepressure = pwater
    phase1_porepressure = pgas
    capillary_pressure = pc
  []
  [massfrac]
    type = PorousFlowMassFraction
    mass_fraction_vars = 'frac_ph0_c0 frac_ph0_c1 frac_ph1_c0 frac_ph1_c1'
  []
  [simple_fluid0]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid0
    phase = 0
  []
  [simple_fluid1]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid1
    phase = 1
  []
  [porosity]
    type = PorousFlowPorosityConst
    porosity = 0.1
  []
  [permeability]
    type = PorousFlowPermeabilityConst
    permeability = '0.2 0 0 0 0.1 0 0 0 0.1'
  []
  [relperm0]
    type = PorousFlowRelativePermeabilityCorey
    n = 1
    phase = 0
  []
  [relperm1]
    type = PorousFlowRelativePermeabilityCorey
    n = 2
    phase = 1
  []
[]
[AuxVariables]
  [flux_out]
  []
  [frac_ph0_c1]
    initial_condition = 0.35
  []
  [frac_ph1_c0]
    initial_condition = 0.1
  []
  [frac_ph1_c1]
    initial_condition = 0.8
  []
[]
[Postprocessors]
  [total_mass_comp0]
    type = PorousFlowFluidMass
    fluid_component = 0
  []
  [total_mass_comp1]
    type = PorousFlowFluidMass
    fluid_component = 1
  []
  [total_mass_comp2]
    type = PorousFlowFluidMass
    fluid_component = 2
  []
  [frac_ph1_c1_00]
    type = PointValue
    point = '0 0 0'
    variable = frac_ph1_c1
    execute_on = 'initial timestep_end'
  []
  [frac_ph0_c1_00]
    type = PointValue
    point = '0 0 0'
    variable = frac_ph0_c1
    execute_on = 'initial timestep_end'
  []
  [flux_00]
    type = PointValue
    point = '0 0 0'
    variable = flux_out
    execute_on = 'initial timestep_end'
  []
  [pgas_00]
    type = PointValue
    point = '0 0 0'
    variable = pgas
    execute_on = 'initial timestep_end'
  []
  [pwater_00]
    type = PointValue
    point = '0 0 0'
    variable = pwater
    execute_on = 'initial timestep_end'
  []
  [m1_00]
    type = ParsedPostprocessor
    expression = 'frac_ph1_c1_00*vol*por*dens0gas*exp(pgas_00/bulkgas)*(1-pow(1+pow(al*(pgas_00-pwater_00),1.0/(1-m)),-m))+frac_ph0_c1_00*vol*por*dens0water*exp(pwater_00/bulkwater)*(pow(1+pow(al*(pgas_00-pwater_00),1.0/(1-m)),-m))'
    constant_names = 'vol  por dens0gas bulkgas al m dens0water bulkwater'
    constant_expressions = '0.25 0.1 1.1 1.3 1.1 0.5 1.5 2.3'
    pp_names = 'pgas_00 pwater_00 frac_ph1_c1_00 frac_ph0_c1_00'
    execute_on = 'initial timestep_end'
  []
  [dm1_00]
    type = ChangeOverTimePostprocessor
    postprocessor = m1_00
    outputs = none
  []
  [m1_00_prev]
    type = ParsedPostprocessor
    expression = 'm1_00 - dm1_00'
    pp_names = 'm1_00 dm1_00'
    outputs = 'console'
  []
  [del_m1_00]
    type = ParsedPostprocessor
    expression = 'frac_ph1_c1_00*fcn*area*dt*pow(1-pow(1+pow(al*(pgas_00-pwater_00),1.0/(1-m)),-m), 2)'
    constant_names = 'fcn area dt al m'
    constant_expressions = '100 0.5 1E-3 1.1 0.5'
    pp_names = 'frac_ph1_c1_00 pgas_00 pwater_00'
    outputs = 'console'
  []
  [m1_00_expect]
    type = ParsedPostprocessor
    expression = 'm1_00_prev - del_m1_00'
    pp_names = 'm1_00_prev del_m1_00'
  []
[]
[BCs]
  [flux_ph1_c1]
    type = PorousFlowSink
    boundary = 'left'
    variable = pwater # sink applied to the mass_c1 Kernel
    use_mobility = false
    use_relperm = true
    mass_fraction_component = 1
    fluid_phase = 1
    flux_function = 100
    save_in = flux_out
  []
[]
[Preconditioning]
  [andy]
    type = SMP
    full = true
    petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -snes_max_it -sub_pc_factor_shift_type -pc_asm_overlap'
    petsc_options_value = 'gmres asm lu 100 NONZERO 2'
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  dt = 1E-3
  end_time = 0.01
  nl_rel_tol = 1E-12
  nl_abs_tol = 1E-12
[]
[Outputs]
  file_base = s08
  exodus = true
  [console]
    type = Console
    execute_on = 'nonlinear linear'
  []
  [csv]
    type = CSV
    execute_on = 'timestep_end'
  []
[]
(modules/navier_stokes/test/tests/finite_element/ins/cg-dg-hybrid/lid-driven/hybrid-cg-dg.i)
mu = 1
rho = 1
l = 200
U = 1
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = ${l}
    ymin = 0
    ymax = ${l}
    nx = 20
    ny = 20
  []
  [corner_node]
    type = ExtraNodesetGenerator
    new_boundary = 'pinned_node'
    nodes = '0'
    input = gen
  []
[]
[Variables]
  [u]
    family = MONOMIAL
  []
  [v]
    family = MONOMIAL
  []
  [pressure][]
[]
[Kernels]
  [momentum_x_convection]
    type = ADConservativeAdvection
    variable = u
    velocity = 'velocity'
    advected_quantity = 'rhou'
  []
  [momentum_x_diffusion]
    type = MatDiffusion
    variable = u
    diffusivity = 'mu'
  []
  [momentum_x_pressure]
    type = PressureGradient
    integrate_p_by_parts = false
    variable = u
    pressure = pressure
    component = 0
  []
  [momentum_y_convection]
    type = ADConservativeAdvection
    variable = v
    velocity = 'velocity'
    advected_quantity = 'rhov'
  []
  [momentum_y_diffusion]
    type = MatDiffusion
    variable = v
    diffusivity = 'mu'
  []
  [momentum_y_pressure]
    type = PressureGradient
    integrate_p_by_parts = false
    variable = v
    pressure = pressure
    component = 1
  []
  [mass]
    type = ADConservativeAdvection
    variable = pressure
    velocity = velocity
    advected_quantity = -1
  []
[]
[DGKernels]
  [momentum_x_convection]
    type = ADDGAdvection
    variable = u
    velocity = 'velocity'
    advected_quantity = 'rhou'
  []
  [momentum_x_diffusion]
    type = DGDiffusion
    variable = u
    sigma = 6
    epsilon = -1
    diff = 'mu'
  []
  [momentum_y_convection]
    type = ADDGAdvection
    variable = v
    velocity = 'velocity'
    advected_quantity = 'rhov'
  []
  [momentum_y_diffusion]
    type = DGDiffusion
    variable = v
    sigma = 6
    epsilon = -1
    diff = 'mu'
  []
[]
[BCs]
  [u_walls]
    type = DGFunctionDiffusionDirichletBC
    boundary = 'left bottom right'
    variable = u
    sigma = 6
    epsilon = -1
    function = '0'
    diff = 'mu'
  []
  [v_walls]
    type = DGFunctionDiffusionDirichletBC
    boundary = 'left bottom right top'
    variable = v
    sigma = 6
    epsilon = -1
    function = '0'
    diff = 'mu'
  []
  [u_top]
    type = DGFunctionDiffusionDirichletBC
    boundary = 'top'
    variable = u
    sigma = 6
    epsilon = -1
    function = '${U}'
    diff = 'mu'
  []
  [pressure_pin]
    type = DirichletBC
    variable = pressure
    boundary = 'pinned_node'
    value = 0
  []
[]
[Materials]
  [const]
    type = ADGenericConstantMaterial
    prop_names = 'rho'
    prop_values = '${rho}'
  []
  [const_reg]
    type = GenericConstantMaterial
    prop_names = 'mu'
    prop_values = '${mu}'
  []
  [vel]
    type = ADVectorFromComponentVariablesMaterial
    vector_prop_name = 'velocity'
    u = u
    v = v
  []
  [rhou]
    type = ADParsedMaterial
    property_name = 'rhou'
    coupled_variables = 'u'
    material_property_names = 'rho'
    expression = 'rho*u'
  []
  [rhov]
    type = ADParsedMaterial
    property_name = 'rhov'
    coupled_variables = 'v'
    material_property_names = 'rho'
    expression = 'rho*v'
  []
[]
[AuxVariables]
  [vel_x]
    family = MONOMIAL
    order = CONSTANT
  []
  [vel_y]
    family = MONOMIAL
    order = CONSTANT
  []
  [p]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [vel_x]
    type = ProjectionAux
    variable = vel_x
    v = u
  []
  [vel_y]
    type = ProjectionAux
    variable = vel_y
    v = v
  []
  [p]
    type = ProjectionAux
    variable = p
    v = pressure
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -pc_factor_shift_type'
  petsc_options_value = 'lu       NONZERO'
  nl_rel_tol = 1e-12
[]
[Outputs]
  exodus = true
[]
[Postprocessors]
  [Re]
    type = ParsedPostprocessor
    expression = '${rho} * ${U} * ${l} / ${mu}'
  []
[]
(modules/solid_mechanics/test/tests/strain_adjusted_density/exact_rspherical.i)
x_length = 0.2
[Mesh]
  [mesh]
    type = GeneratedMeshGenerator
    dim = 1
    nx = 3
    xmax = ${x_length}
  []
  coord_type = RSPHERICAL
[]
[Problem]
  solve = false
[]
[AuxVariables]
  [disp_r]
    initial_condition = 0
  []
[]
[AuxKernels]
  [disp_r_aux]
    type = ParsedAux
    variable = disp_r
    expression = 't * 1e-2 * x'
    use_xyzt = true
  []
[]
[Materials]
  [some_density]
    type = ParsedMaterial
    property_name = some_density
    expression = t
    extra_symbols = t
    outputs = all
  []
  [density]
    type = StrainAdjustedDensity
    strain_free_density = some_density
    displacements = 'disp_r'
    outputs = all
  []
[]
[Executioner]
  type = Transient
  num_steps = 10
[]
[Postprocessors]
  [disp_r]
    type = SideAverageValue
    variable = disp_r
    boundary = right
  []
  [some_density]
    type = ElementAverageValue
    variable = some_density
  []
  [density]
    type = ElementAverageValue
    variable = density
  []
  [density_exact]
    type = ParsedPostprocessor
    pp_names = 'disp_r'
    expression = 't / (1 + disp_r / ${x_length})^3'
    use_t = true
    outputs = console
  []
  [density_diff]
    type = ParsedPostprocessor
    expression = '(density_exact - density) / density_exact'
    pp_names = 'density density_exact'
    outputs = console
  []
  [density_diff_max]
    type = TimeExtremeValue
    postprocessor = density_diff
    value_type = ABS_MAX
  []
[]
[Outputs]
  csv = true
[]
(modules/thermal_hydraulics/tutorials/single_phase_flow/04_loop.i)
T_in = 300. # K
m_dot_in = 1e-2 # kg/s
press = 10e5 # Pa
# core parameters
core_length = 1. # m
core_n_elems = 25
core_dia = '${units 2. cm -> m}'
core_pitch = '${units 8.7 cm -> m}'
# pipe parameters
pipe_dia = '${units 10. cm -> m}'
A_pipe = '${fparse 0.25 * pi * pipe_dia^2}'
A_core = '${fparse core_pitch^2 - 0.25 *pi * core_dia^2}'
P_wet_core = '${fparse 4*core_pitch + pi * core_dia}'
Dh_core = '${fparse 4 * A_core / P_wet_core}'
tot_power = 2000 # W
[GlobalParams]
  initial_p = ${press}
  initial_vel = 0.0001
  initial_T = ${T_in}
  initial_vel_x = 0
  initial_vel_y = 0
  initial_vel_z = 0
  gravity_vector = '0 0 0'
  rdg_slope_reconstruction = minmod
  scaling_factor_1phase = '1 1e-2 1e-4'
  scaling_factor_rhoV = 1
  scaling_factor_rhouV = 1e-2
  scaling_factor_rhovV = 1e-2
  scaling_factor_rhowV = 1e-2
  scaling_factor_rhoEV = 1e-4
  closures = simple_closures
  fp = he
[]
[FluidProperties]
  [he]
    type = IdealGasFluidProperties
    molar_mass = 4e-3
    gamma = 1.67
    k = 0.2556
    mu = 3.22639e-5
  []
[]
[Closures]
  [simple_closures]
    type = Closures1PhaseTHM
  []
[]
[SolidProperties]
  [steel]
    type = ThermalFunctionSolidProperties
    rho = 8050
    k = 45
    cp = 466
  []
[]
[Components]
  [total_power]
    type = TotalPower
    power = ${tot_power}
  []
  [up_pipe_1]
    type = FlowChannel1Phase
    position = '0 0 0'
    orientation = '0 0 1'
    length = 0.5
    n_elems = 15
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct1]
    type = JunctionParallelChannels1Phase
    position = '0 0 0.5'
    connections = 'up_pipe_1:out core_chan:in'
    volume = 1e-5
  []
  [core_chan]
    type = FlowChannel1Phase
    position = '0 0 0.5'
    orientation = '0 0 1'
    length = ${core_length}
    n_elems = ${core_n_elems}
    roughness = .0001
    A = '${A_core}'
    D_h = ${Dh_core}
  []
  [core_hs]
    type = HeatStructureCylindrical
    position = '0 0 0.5'
    orientation = '0 0 1'
    length = ${core_length}
    n_elems = ${core_n_elems}
    names = 'block'
    widths = '${fparse core_dia / 2.}'
    solid_properties = 'steel'
    solid_properties_T_ref = '300'
    n_part_elems = 3
  []
  [core_heating]
    type = HeatSourceFromTotalPower
    hs = core_hs
    regions = block
    power = total_power
  []
  [core_ht]
    type = HeatTransferFromHeatStructure1Phase
    flow_channel = core_chan
    hs = core_hs
    hs_side = outer
    P_hf = '${fparse pi * core_dia}'
  []
  [jct2]
    type = JunctionParallelChannels1Phase
    position = '0 0 1.5'
    connections = 'core_chan:out up_pipe_2:in'
    volume = 1e-5
  []
  [up_pipe_2]
    type = FlowChannel1Phase
    position = '0 0 1.5'
    orientation = '0 0 1'
    length = 0.5
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct3]
    type = JunctionOneToOne1Phase
    connections = 'up_pipe_2:out top_pipe_1:in'
  []
  [top_pipe_1]
    type = FlowChannel1Phase
    position = '0 0 2'
    orientation = '1 0 0'
    length = 0.5
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [top_pipe_2]
    type = FlowChannel1Phase
    position = '0.5 0 2'
    orientation = '1 0 0'
    length = 0.5
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct4]
    type = VolumeJunction1Phase
    position = '0.5 0 2'
    volume = 1e-5
    connections = 'top_pipe_1:out top_pipe_2:in press_pipe:in'
  []
  [press_pipe]
    type = FlowChannel1Phase
    position = '0.5 0 2'
    orientation = '0 0 1'
    length = 0.2
    n_elems = 5
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [pressurizer]
    type = InletStagnationPressureTemperature1Phase
    p0 = ${press}
    T0 = ${T_in}
    input = press_pipe:out
  []
  [jct5]
    type = JunctionOneToOne1Phase
    connections = 'top_pipe_2:out down_pipe_1:in'
  []
  [down_pipe_1]
    type = FlowChannel1Phase
    position = '1 0 2'
    orientation = '0 0 -1'
    length = 0.25
    A = ${A_pipe}
    n_elems = 5
  []
  [jct6]
    type = JunctionOneToOne1Phase
    connections = 'down_pipe_1:out cooling_pipe:in'
  []
  [cooling_pipe]
    type = FlowChannel1Phase
    position = '1 0 1.75'
    orientation = '0 0 -1'
    length = 1.5
    n_elems = 25
    A = ${A_pipe}
  []
  [cold_wall]
    type = HeatTransferFromSpecifiedTemperature1Phase
    flow_channel = cooling_pipe
    T_wall = 300
    P_hf = '${fparse pi * pipe_dia}'
  []
  [jct7]
    type = JunctionOneToOne1Phase
    connections = 'cooling_pipe:out down_pipe_2:in'
  []
  [down_pipe_2]
    type = FlowChannel1Phase
    position = '1 0 0.25'
    orientation = '0 0 -1'
    length = 0.25
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct8]
    type = JunctionOneToOne1Phase
    connections = 'down_pipe_2:out bottom_1:in'
  []
  [bottom_1]
    type = FlowChannel1Phase
    position = '1 0 0'
    orientation = '-1 0 0'
    length = 0.5
    n_elems = 5
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [pump]
    type = Pump1Phase
    position = '0.5 0 0'
    connections = 'bottom_1:out bottom_2:in'
    volume = 1e-4
    A_ref = ${A_pipe}
    head = 0
  []
  [bottom_2]
    type = FlowChannel1Phase
    position = '0.5 0 0'
    orientation = '-1 0 0'
    length = 0.5
    n_elems = 5
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct10]
    type = JunctionOneToOne1Phase
    connections = 'bottom_2:out up_pipe_1:in'
  []
[]
[ControlLogic]
  [set_point]
    type = GetFunctionValueControl
    function = ${m_dot_in}
  []
  [pid]
    type = PIDControl
    initial_value = 0
    set_point = set_point:value
    input = m_dot_pump
    K_p = 1.
    K_i = 4.
    K_d = 0
  []
  [set_pump_head]
    type = SetComponentRealValueControl
    component = pump
    parameter = head
    value = pid:output
  []
[]
[Postprocessors]
  [power_to_coolant]
    type = ADHeatRateConvection1Phase
    block = core_chan
    P_hf = '${fparse pi *core_dia}'
  []
  [m_dot_pump]
    type = ADFlowJunctionFlux1Phase
    boundary = core_chan:in
    connection_index = 1
    equation = mass
    junction = jct7
  []
  [core_T_out]
    type = SideAverageValue
    boundary = core_chan:out
    variable = T
  []
  [core_p_in]
    type = SideAverageValue
    boundary = core_chan:in
    variable = p
  []
  [core_p_out]
    type = SideAverageValue
    boundary = core_chan:out
    variable = p
  []
  [core_delta_p]
    type = ParsedPostprocessor
    pp_names = 'core_p_in core_p_out'
    expression = 'core_p_in - core_p_out'
  []
  [hx_pri_T_out]
    type = SideAverageValue
    boundary = cooling_pipe:out
    variable = T
  []
  [pump_head]
    type = RealComponentParameterValuePostprocessor
    component = pump
    parameter = head
  []
[]
[Preconditioning]
  [pc]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  start_time = 0
  [TimeStepper]
    type = IterationAdaptiveDT
    dt = 1
  []
  dtmax = 5
  end_time = 500
  line_search = basic
  solve_type = NEWTON
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 0
  nl_abs_tol = 1e-8
  nl_max_its = 25
[]
[Outputs]
  exodus = true
  [console]
    type = Console
    max_rows = 1
    outlier_variable_norms = false
  []
  print_linear_residuals = false
[]
(modules/navier_stokes/test/tests/finite_element/ins/energy-conservation/q2q1.i)
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    nx = 10
    ny = 10
    dim = 2
  []
  [subdomain]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '0.5 0 0'
    top_right = '1 1 0'
    block_id = 1
    input = gen
  []
  [break_boundary]
    input = subdomain
    type = BreakBoundaryOnSubdomainGenerator
    boundaries = 'bottom top'
  []
  [sideset]
    type = SideSetsBetweenSubdomainsGenerator
    input = break_boundary
    primary_block = '1'
    paired_block = '0'
    new_boundary = 'fluid_left'
  []
  coord_type = RZ
  second_order = true
[]
[Variables]
  [T]
    order = SECOND
  []
  [velocity]
    family = LAGRANGE_VEC
    order = SECOND
    block = 1
  []
  [pressure]
    block = 1
  []
[]
[Kernels]
  [mass]
    type = INSADMass
    variable = pressure
    block = 1
  []
  [momentum_convection]
    type = INSADMomentumAdvection
    variable = velocity
    block = 1
  []
  [momentum_viscous]
    type = INSADMomentumViscous
    variable = velocity
    block = 1
  []
  [momentum_pressure]
    type = INSADMomentumPressure
    variable = velocity
    pressure = pressure
    integrate_p_by_parts = true
    block = 1
  []
  [momentum_supg]
    type = INSADMomentumSUPG
    variable = velocity
    velocity = velocity
    block = 1
  []
  [temperature_advection]
    type = INSADEnergyAdvection
    variable = T
     block = 1
  []
  [temperature_supg]
    type = INSADEnergySUPG
    variable = T
    velocity = velocity
    block = 1
  []
  [temperature_conduction]
    type = ADHeatConduction
    variable = T
    thermal_conductivity = 'k'
  []
  [heat_source]
    type = BodyForce
    variable = T
    block = 0
    function = 'x + y'
  []
[]
[BCs]
  [velocity_inlet]
    type = VectorFunctionDirichletBC
    variable = velocity
    function_y = 1
    boundary = 'bottom_to_1'
  []
  [wall]
    type = VectorFunctionDirichletBC
    variable = velocity
    boundary = 'fluid_left right'
  []
  [convective_heat_transfer]
    type = ConvectiveHeatFluxBC
    variable = T
    T_infinity = 0
    heat_transfer_coefficient = 1
    boundary = 'right'
  []
[]
[Materials]
  [constant]
    type = ADGenericConstantMaterial
    prop_names = 'cp rho k mu'
    prop_values = '1 1   1 1'
  []
  [ins]
    type = INSADStabilized3Eqn
    pressure = pressure
    velocity = velocity
    temperature = T
    block = 1
  []
[]
[Executioner]
  type = Steady
  solve_type = NEWTON
  petsc_options_iname = '-pc_type -pc_factor_shift_type'
  petsc_options_value = 'lu       NONZERO'
[]
[Outputs]
  csv = true
[]
[Postprocessors]
  [convective_heat_transfer]
    type = ConvectiveHeatTransferSideIntegral
    T_solid = T
    T_fluid = 0
    htc = 1
    boundary = 'right'
  []
  [advection]
    type = INSADElementIntegralEnergyAdvection
    temperature = T
    velocity = velocity
    cp = cp
    rho = rho
    block = 1
  []
  [source]
    type = FunctionElementIntegral
    function = 'x + y'
    block = 0
  []
  [energy_balance]
    type = ParsedPostprocessor
    expression = 'convective_heat_transfer + advection - source'
    pp_names = 'convective_heat_transfer advection source'
  []
[]
(modules/combined/test/tests/optimization/thermal_sensitivity/2d_root.i)
vol_frac = 0.5
E0 = 1
Emin = 1e-4
power = 1
[Mesh]
  [MeshGenerator]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 20
    ny = 20
    xmin = 0
    xmax = 40
    ymin = 0
    ymax = 40
  []
[]
[Variables]
  [T]
    initial_condition = 100
  []
[]
[AuxVariables]
  [Dc]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = -1.0
  []
  [mat_den]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = ${vol_frac}
  []
[]
[Kernels]
  [heat]
    type = HeatConduction
    diffusion_coefficient = k
    variable = T
  []
  [heat_source]
    type = HeatSource
    function = 1e-2
    variable = T
  []
[]
[DiracKernels]
  [src]
    type = ConstantPointSource
    variable = T
    point = '0 5 0'
    value = 10
  []
[]
[BCs]
  [no_x]
    type = DirichletBC
    variable = T
    boundary = 'right top bottom'
    value = 0.0
  []
[]
[Materials]
  [k]
    type = DerivativeParsedMaterial
    # Emin + (density^penal) * (E0 - Emin)
    expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
    coupled_variables = 'mat_den'
    property_name = k
  []
  [dc]
    type = ThermalSensitivity
    temperature = T
    design_density = mat_den
    thermal_conductivity = k
  []
  #only needed for objective function output in postprocessor
  [thermal_compliance]
    type = ThermalCompliance
    temperature = T
    thermal_conductivity = k
  []
[]
[UserObjects]
  [rad_avg]
    type = RadialAverage
    radius = 3
    weights = linear
    prop_name = thermal_sensitivity
    execute_on = TIMESTEP_END
    force_preaux = true
  []
  [update]
    type = DensityUpdate
    density_sensitivity = Dc
    design_density = mat_den
    volume_fraction = ${vol_frac}
    execute_on = TIMESTEP_BEGIN
  []
  [calc_sense]
    type = SensitivityFilter
    density_sensitivity = Dc
    design_density = mat_den
    filter_UO = rad_avg
    execute_on = TIMESTEP_END
    force_postaux = true
  []
[]
[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'
  nl_abs_tol = 1e-8
  dt = 1.0
  dtmin = 1.0
  num_steps = 20
[]
[Outputs]
  [out]
    type = CSV
    execute_on = 'FINAL'
  []
  print_linear_residuals = false
[]
[Postprocessors]
  [mesh_volume]
    type = VolumePostprocessor
    execute_on = 'initial timestep_end'
  []
  [total_vol]
    type = ElementIntegralVariablePostprocessor
    variable = mat_den
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [vol_frac]
    type = ParsedPostprocessor
    expression = 'total_vol / mesh_volume'
    pp_names = 'total_vol mesh_volume'
  []
  [sensitivity]
    type = ElementIntegralMaterialProperty
    mat_prop = thermal_sensitivity
  []
  [objective_thermal]
    type = ElementIntegralMaterialProperty
    mat_prop = thermal_compliance
    execute_on = 'INITIAL TIMESTEP_END'
  []
[]
(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 = SCMTriSubChannelMeshGenerator
    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'
  []
  [fuel_pins]
    type = SCMTriPinMeshGenerator
    input = subchannel
    nrings = ${n_rings}
    n_cells = 50
    unheated_length_exit = ${unheated_length_exit}
    heated_length = ${heated_length}
    pitch = ${fuel_pin_pitch}
  []
[]
[AuxVariables]
  [mdot]
    block = subchannel
  []
  [SumWij]
    block = subchannel
  []
  [P]
    block = subchannel
  []
  [DP]
    block = subchannel
  []
  [h]
    block = subchannel
  []
  [T]
    block = subchannel
  []
  [rho]
    block = subchannel
  []
  [S]
    block = subchannel
  []
  [w_perim]
    block = subchannel
  []
  [mu]
    block = subchannel
  []
  [q_prime_init]
    block = fuel_pins
  []
  [power_history_field]
    block = fuel_pins
  []
  [q_prime]
    block = fuel_pins
  []
  [Tpin]
    block = fuel_pins
  []
  [Dpin]
    block = fuel_pins
  []
  [displacement]
    block = subchannel
  []
[]
[FluidProperties]
  [sodium]
    type = PBSodiumFluidProperties
  []
[]
[Problem]
  type = TriSubChannel1PhaseProblem
  fp = sodium
  n_blocks = 1
  P_out = ${P_out}
  CT = 2.6
  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'
[]
[ICs]
  [S_IC]
    type = SCMTriFlowAreaIC
    variable = S
  []
  [w_perim_IC]
    type = SCMTriWettedPerimIC
    variable = w_perim
  []
  [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}
  []
  [Dpin_ic]
    type = ConstantIC
    variable = Dpin
    value = ${fuel_pin_diameter}
  []
  [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 = SCMPinSolutionTransfer
    to_multi_app = viz
    variable = 'Tpin q_prime'
  []
[]
(modules/porous_flow/test/tests/sinks/s05.i)
# apply a half-gaussian sink flux and observe the correct behavior
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = 0
  xmax = 1
  ymin = 0
  ymax = 1
  zmin = 0
  zmax = 2
[]
[GlobalParams]
  PorousFlowDictator = dictator
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = 'pp'
    number_fluid_phases = 1
    number_fluid_components = 1
  []
  [pc]
    type = PorousFlowCapillaryPressureVG
    m = 0.5
    alpha = 1.1
  []
[]
[Variables]
  [pp]
  []
[]
[ICs]
  [pp]
    type = FunctionIC
    variable = pp
    function = y+1.4
  []
[]
[Kernels]
  [mass0]
    type = PorousFlowMassTimeDerivative
    fluid_component = 0
    variable = pp
  []
[]
[FluidProperties]
  [simple_fluid]
    type = SimpleFluidProperties
    bulk_modulus = 1.3
    density0 = 1.1
    thermal_expansion = 0
    viscosity = 1.1
  []
[]
[Materials]
  [temperature]
    type = PorousFlowTemperature
  []
  [ppss]
    type = PorousFlow1PhaseP
    porepressure = pp
    capillary_pressure = pc
  []
  [massfrac]
    type = PorousFlowMassFraction
  []
  [simple_fluid]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid
    phase = 0
  []
  [porosity]
    type = PorousFlowPorosityConst
    porosity = 0.1
  []
  [permeability]
    type = PorousFlowPermeabilityConst
    permeability = '1E-5 0 0 0 1E-5 0 0 0 1E-5'
  []
  [relperm]
    type = PorousFlowRelativePermeabilityCorey
    n = 2
    phase = 0
  []
[]
[AuxVariables]
  [flux_out]
  []
[]
[Postprocessors]
  [flux10]
    type = PointValue
    variable = flux_out
    point = '1 0 0'
  []
  [p00]
    type = PointValue
    point = '0 0 0'
    variable = pp
    execute_on = 'initial timestep_end'
  []
  [p10]
    type = PointValue
    point = '1 0 0'
    variable = pp
    execute_on = 'initial timestep_end'
  []
  [m10]
    type = ParsedPostprocessor
    expression = 'vol*por*dens0*exp(p10/bulk)*if(p10>=0,1,pow(1+pow(-al*p10,1.0/(1-m)),-m))'
    constant_names = 'vol por dens0 bulk al m'
    constant_expressions = '0.25 0.1 1.1 1.3 1.1 0.5'
    pp_names = 'p10'
    execute_on = 'initial timestep_end'
  []
  [dm10]
    type = ChangeOverTimePostprocessor
    postprocessor = m10
    outputs = none
  []
  [m10_prev]
    type = ParsedPostprocessor
    expression = 'm10 - dm10'
    pp_names = 'm10 dm10'
    outputs = 'console'
  []
  [m10_rate]
    type = ParsedPostprocessor
    expression = 'if(p10>center,fcn,fcn*exp(-0.5*(p10-center)*(p10-center)/sd/sd))'
    constant_names = 'fcn center sd'
    constant_expressions = '6 0.9 0.5'
    pp_names = 'p10'
  []
  [m10_expect]
    type = ParsedPostprocessor
    expression = 'm10_prev-m10_rate*area*dt'
    constant_names = 'area dt'
    constant_expressions = '0.5 2E-3'
    pp_names = 'm10_prev m10_rate'
  []
  [p01]
    type = PointValue
    point = '0 1 0'
    variable = pp
    execute_on = 'initial timestep_end'
  []
  [p11]
    type = PointValue
    point = '1 1 0'
    variable = pp
    execute_on = 'initial timestep_end'
  []
  [m11]
    type = ParsedPostprocessor
    expression = 'vol*por*dens0*exp(p11/bulk)*if(p11>=0,1,pow(1+pow(-al*p11,1.0/(1-m)),-m))'
    constant_names = 'vol por dens0 bulk al m'
    constant_expressions = '0.25 0.1 1.1 1.3 1.1 0.5'
    pp_names = 'p11'
    execute_on = 'initial timestep_end'
  []
  [dm11]
    type = ChangeOverTimePostprocessor
    postprocessor = m11
    outputs = none
  []
  [m11_prev]
    type = ParsedPostprocessor
    expression = 'm11 - dm11'
    pp_names = 'm11 dm11'
    outputs = 'console'
  []
  [m11_rate]
    type = ParsedPostprocessor
    expression = 'if(p11>center,fcn,fcn*exp(-0.5*(p11-center)*(p11-center)/sd/sd))'
    constant_names = 'fcn center sd'
    constant_expressions = '6 0.9 0.5'
    pp_names = 'p11'
  []
  [m11_expect]
    type = ParsedPostprocessor
    expression = 'm11_prev-m11_rate*area*dt'
    constant_names = 'area dt'
    constant_expressions = '0.5 2E-3'
    pp_names = 'm11_prev m11_rate'
  []
[]
[BCs]
  [flux]
    type = PorousFlowHalfGaussianSink
    boundary = 'right'
    max = 6
    sd = 0.5
    center = 0.9
    variable = pp
    use_mobility = false
    use_relperm = false
    fluid_phase = 0
    flux_function = 1
    save_in = flux_out
  []
[]
[Preconditioning]
  [andy]
    type = SMP
    full = true
    petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -snes_max_it -sub_pc_factor_shift_type -pc_asm_overlap'
    petsc_options_value = 'gmres asm lu 10000 NONZERO 2'
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  dt = 2E-3
  end_time = 6E-2
  nl_rel_tol = 1E-12
  nl_abs_tol = 1E-12
[]
[Outputs]
  file_base = s05
  [console]
    type = Console
    execute_on = 'nonlinear linear'
    time_step_interval = 5
  []
  [csv]
    type = CSV
    execute_on = 'timestep_end'
    time_step_interval = 3
  []
[]
(modules/combined/test/tests/subchannel_thm_coupling/subchannel.i)
# Based on M. Fontana, et al. this arbitrary subassembly is used for THM-SC coupling
T_in = 583.0 #K
flow_area = 0.0004980799633447909 #m2
mass_flux_in = '${fparse 1.0/flow_area}'
P_out = 2e5 # Pa
###################################################
# Geometric parameters
###################################################
n_cells = 25
n_rings = 3
fuel_pin_pitch = 7.26e-3
fuel_pin_diameter = 5.84e-3
wire_z_spacing = 0.3048
wire_diameter = 1.42e-3
inner_duct_in = 3.41e-2
heated_length = 1.0
###################################################
[TriSubChannelMesh]
  [subchannel]
    type = SCMTriSubChannelMeshGenerator
    nrings = ${n_rings}
    n_cells = ${n_cells}
    flat_to_flat = ${inner_duct_in}
    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'
  []
  [fuel_pins]
    type = SCMTriPinMeshGenerator
    input = subchannel
    nrings = ${n_rings}
    n_cells = ${n_cells}
    heated_length = ${heated_length}
    pitch = ${fuel_pin_pitch}
  []
[]
[AuxVariables]
  [mdot]
    block = subchannel
  []
  [SumWij]
    block = subchannel
  []
  [P]
    block = subchannel
  []
  [DP]
    block = subchannel
  []
  [h]
    block = subchannel
  []
  [T]
    block = subchannel
  []
  [rho]
    block = subchannel
  []
  [S]
    block = subchannel
  []
  [w_perim]
    block = subchannel
  []
  [mu]
    block = subchannel
  []
  [displacement]
    block = subchannel
  []
  [q_prime]
    block = fuel_pins
  []
  [Tpin]
    block = fuel_pins
  []
  [Dpin]
    block = fuel_pins
  []
[]
[FluidProperties]
  [Sodium]
    type = PBSodiumFluidProperties
  []
[]
[Problem]
  type = TriSubChannel1PhaseProblem
  fp = Sodium
  n_blocks = 1
  P_out = report_pressure_outlet
  CT = 2.6
  compute_density = true
  compute_viscosity = true
  compute_power = true
  P_tol = 1.0e-3
  T_tol = 1.0e-3
  implicit = true
  segregated = false
  staggered_pressure = false
  monolithic_thermal = false
  verbose_multiapps = true
  verbose_subchannel = false
  interpolation_scheme = 'upwind'
[]
[ICs]
  [S_IC]
    type = SCMTriFlowAreaIC
    variable = S
  []
  [w_perim_IC]
    type = SCMTriWettedPerimIC
    variable = w_perim
  []
  [q_prime_IC]
    type = SCMTriPowerIC
    variable = q_prime
    power = 10000 #W
    filename = "pin_power_profile19.txt"
  []
  [T_ic]
    type = ConstantIC
    variable = T
    value = ${T_in}
  []
  [Dpin_ic]
    type = ConstantIC
    variable = Dpin
    value = ${fuel_pin_diameter}
  []
  [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
  []
[]
[AuxKernels]
  [T_in_bc]
    type = FunctorAux
    functor = report_temperature_inlet
    variable = T
    boundary = inlet
    execute_on = 'timestep_begin'
    block = subchannel
  []
  [mdot_in_bc]
    type = SCMMassFlowRateAux
    variable = mdot
    boundary = inlet
    area = S
    mass_flux = report_mass_flux_inlet
    execute_on = 'timestep_begin'
    block = subchannel
  []
[]
[Outputs]
  csv = true
[]
[Executioner]
  type = Steady
[]
[Postprocessors]
  [total_pressure_drop_SC]
    type = SubChannelDelta
    variable = P
    execute_on = "timestep_end"
  []
  [total_pressure_drop_SC_limited]
    type = ParsedPostprocessor
    pp_names = 'total_pressure_drop_SC'
    expression = 'min(total_pressure_drop_SC, 1e6)'
    execute_on = "timestep_end"
  []
  [Total_power]
    type = ElementIntegralVariablePostprocessor
    variable = q_prime
    block = fuel_pins
  []
  [report_mass_flux_inlet]
    type = Receiver
    default = ${mass_flux_in}
  []
  [report_temperature_inlet]
    type = Receiver
    default = ${T_in}
    force_preaux = true
  []
  [report_pressure_outlet]
    type = Receiver
    default = ${P_out}
  []
[]
################################################################################
# A multiapp that projects data to a detailed mesh
################################################################################
[MultiApps]
  [viz]
    type = FullSolveMultiApp
    input_files = '3D.i'
    execute_on = 'FINAL'
  []
[]
[Transfers]
  [subchannel_transfer]
    type = SCMSolutionTransfer
    to_multi_app = viz
    variable = 'mdot SumWij P DP h T rho mu S'
  []
  [pin_transfer]
    type = SCMPinSolutionTransfer
    to_multi_app = viz
    variable = 'Dpin Tpin q_prime'
  []
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_interface_area_model/pressure_driven_growth_transient.i)
###############################################################################
# Validation test based on Hibiki and Ishii experiment [1] reported in Figure 3
# [1] Hibiki, T., & Ishii, M. (2000). One-group interfacial area transport of bubbly flows in vertical round tubes.
# International Journal of Heat and Mass Transfer, 43(15), 2711-2726.
###############################################################################
mu = 1.0
rho = 1000.0
mu_d = 1.0
rho_d = 1.0
l = ${fparse 50.8/1000.0}
U = 0.491230114
dp = 0.001
inlet_phase_2 = 0.049
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
mass_exchange_coeff = 0.0
inlet_interface_area = ${fparse 6.0*inlet_phase_2/dp}
outlet_pressure = 1e6
[GlobalParams]
  rhie_chow_user_object = 'rc'
  density_interp_method = 'average'
  mu_interp_method = 'average'
[]
[Problem]
  identify_variable_groups_in_nl = false
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = vel_x
    v = vel_y
    pressure = pressure
  []
[]
[Mesh]
  coord_type = 'RZ'
  rz_coord_axis = 'X'
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = '${fparse l * 60}'
    ymin = 0
    ymax = '${fparse l / 2}'
    nx = 20
    ny = 5
  []
  uniform_refine = 0
[]
[Variables]
  [vel_x]
    type = INSFVVelocityVariable
    initial_condition = 0
  []
  [vel_y]
    type = INSFVVelocityVariable
    initial_condition = 0
  []
  [pressure]
    type = INSFVPressureVariable
  []
  [phase_2]
    type = INSFVScalarFieldVariable
    initial_condition = ${inlet_phase_2}
  []
  [interface_area]
    type = INSFVScalarFieldVariable
    initial_condition = ${inlet_interface_area}
  []
[]
[FVKernels]
  [mass]
    type = INSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
  []
  [u_time]
    type = INSFVMomentumTimeDerivative
    variable = vel_x
    rho = 'rho_mixture'
    momentum_component = 'x'
  []
  [u_advection]
    type = INSFVMomentumAdvection
    variable = vel_x
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = 'rho_mixture'
    momentum_component = 'x'
  []
  [u_drift]
    type = WCNSFV2PMomentumDriftFlux
    variable = vel_x
    rho_d = ${rho_d}
    fd = 'rho_mixture_var'
    u_slip = 'vel_slip_x'
    v_slip = 'vel_slip_y'
    momentum_component = 'x'
  []
  [u_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_x
    mu = 'mu_mixture'
    limit_interpolation = true
    momentum_component = 'x'
  []
  [u_pressure]
    type = INSFVMomentumPressure
    variable = vel_x
    momentum_component = 'x'
    pressure = pressure
  []
  [v_time]
    type = INSFVMomentumTimeDerivative
    variable = vel_y
    rho = 'rho_mixture'
    momentum_component = 'y'
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = vel_y
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = 'rho_mixture'
    momentum_component = 'y'
  []
  [v_drift]
    type = WCNSFV2PMomentumDriftFlux
    variable = vel_y
    rho_d = ${rho_d}
    fd = 'rho_mixture_var'
    u_slip = 'vel_slip_x'
    v_slip = 'vel_slip_y'
    momentum_component = 'y'
  []
  [v_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_y
    mu = 'mu_mixture'
    limit_interpolation = true
    momentum_component = 'y'
  []
  [v_pressure]
    type = INSFVMomentumPressure
    variable = vel_y
    momentum_component = 'y'
    pressure = pressure
  []
  [phase_2_time]
    type = FVFunctorTimeKernel
    variable = phase_2
    functor = phase_2
  []
  [phase_2_advection]
    type = INSFVScalarFieldAdvection
    variable = phase_2
    u_slip = 'vel_x'
    v_slip = 'vel_y'
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = 'upwind'
  []
  [phase_2_diffusion]
    type = FVDiffusion
    variable = phase_2
    coeff = 1.0
  []
  [phase_2_src]
    type = NSFVMixturePhaseInterface
    variable = phase_2
    phase_coupled = phase_1
    alpha = ${mass_exchange_coeff}
  []
  [interface_area_time]
    type = FVFunctorTimeKernel
    variable = interface_area
    functor = interface_area
  []
  [interface_area_advection]
    type = INSFVScalarFieldAdvection
    variable = interface_area
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = 'upwind'
  []
  [interface_area_diffusion]
    type = FVDiffusion
    variable = interface_area
    coeff = 0.1
  []
  [interface_area_source_sink]
    type = WCNSFV2PInterfaceAreaSourceSink
    variable = interface_area
    u = 'vel_x'
    v = 'vel_y'
    L = ${fparse l/2}
    rho = 'rho_mixture'
    rho_d = 'rho'
    pressure = 'pressure'
    k_c = '${fparse mass_exchange_coeff}'
    fd = 'phase_2'
    sigma = 1e-3
    cutoff_fraction = 0.0
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_x
    functor = '${U}'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_y
    functor = '0'
  []
  [walls-u]
    type = INSFVNoSlipWallBC
    boundary = 'top'
    variable = vel_x
    function = 0
  []
  [walls-v]
    type = INSFVNoSlipWallBC
    boundary = 'top'
    variable = vel_y
    function = 0
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = '${outlet_pressure}'
  []
  [inlet_phase_2]
    type = FVDirichletBC
    boundary = 'left'
    variable = phase_2
    value = ${inlet_phase_2}
  []
  [inlet_interface_area]
    type = FVDirichletBC
    boundary = 'left'
    variable = interface_area
    value = ${inlet_interface_area}
  []
  [symmetry-u]
    type = PINSFVSymmetryVelocityBC
    boundary = 'bottom'
    variable = vel_x
    u = vel_x
    v = vel_y
    mu = 'mu_mixture'
    momentum_component = 'x'
  []
  [symmetry-v]
    type = PINSFVSymmetryVelocityBC
    boundary = 'bottom'
    variable = vel_y
    u = vel_x
    v = vel_y
    mu = 'mu_mixture'
    momentum_component = 'y'
  []
  [symmetry-p]
    type = INSFVSymmetryPressureBC
    boundary = 'bottom'
    variable = pressure
  []
  [symmetry-phase-2]
    type = INSFVSymmetryScalarBC
    boundary = 'bottom'
    variable = phase_2
  []
  [symmetry-interface-area]
    type = INSFVSymmetryScalarBC
    boundary = 'bottom'
    variable = interface_area
  []
[]
[AuxVariables]
  [drag_coefficient]
    type = MooseVariableFVReal
  []
  [rho_mixture_var]
    type = MooseVariableFVReal
  []
  [mu_mixture_var]
    type = MooseVariableFVReal
  []
[]
[AuxKernels]
  [populate_cd]
    type = FunctorAux
    variable = drag_coefficient
    functor = 'Darcy_coefficient'
  []
  [populate_rho_mixture_var]
    type = FunctorAux
    variable = rho_mixture_var
    functor = 'rho_mixture'
  []
  [populate_mu_mixture_var]
    type = FunctorAux
    variable = mu_mixture_var
    functor = 'mu_mixture'
  []
[]
[FluidProperties]
  [fp]
    type = IdealGasFluidProperties
  []
[]
[FunctorMaterials]
  [bubble_properties]
    type = GeneralFunctorFluidProps
    fp = 'fp'
    pressure = 'pressure'
    T_fluid = 300.0
    speed = 1.0
    characteristic_length = 1.0
    porosity = 1.0
    output_properties = 'rho'
    outputs = 'out'
  []
  [populate_u_slip]
    type = WCNSFV2PSlipVelocityFunctorMaterial
    slip_velocity_name = 'vel_slip_x'
    momentum_component = 'x'
    u = 'vel_x'
    v = 'vel_y'
    rho = ${rho}
    mu = 'mu_mixture'
    rho_d = ${rho_d}
    particle_diameter = ${dp}
    linear_coef_name = 'Darcy_coefficient'
  []
  [populate_v_slip]
    type = WCNSFV2PSlipVelocityFunctorMaterial
    slip_velocity_name = 'vel_slip_y'
    momentum_component = 'y'
    u = 'vel_x'
    v = 'vel_y'
    rho = ${rho}
    mu = 'mu_mixture'
    rho_d = ${rho_d}
    particle_diameter = ${dp}
    linear_coef_name = 'Darcy_coefficient'
  []
  [compute_phase_1]
    type = ADParsedFunctorMaterial
    property_name = phase_1
    functor_names = 'phase_2'
    expression = '1 - phase_2'
  []
  [CD]
    type = NSFVDispersePhaseDragFunctorMaterial
    rho = 'rho_mixture'
    mu = mu_mixture
    u = 'vel_x'
    v = 'vel_y'
    particle_diameter = ${dp}
  []
  [mixing_material]
    type = NSFVMixtureFunctorMaterial
    phase_2_names = '${rho} ${mu}'
    phase_1_names = 'rho ${mu_d}'
    prop_names = 'rho_mixture mu_mixture'
    phase_1_fraction = 'phase_2'
  []
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  nl_abs_tol = 1e-7
  dt = 0.1
  end_time = 1.0
  nl_max_its = 10
  line_search = 'none'
[]
[Debug]
  show_var_residual_norms = true
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
    petsc_options_iname = '-pc_type -pc_factor_shift_type'
    petsc_options_value = 'lu       NONZERO'
  []
[]
[Outputs]
  [out]
    type = Exodus
  []
[]
[Postprocessors]
  [Re]
    type = ParsedPostprocessor
    expression = '${rho} * ${l} * ${U}'
    pp_names = ''
  []
  [rho_outlet]
    type = SideAverageValue
    boundary = 'right'
    variable = 'rho_mixture_var'
  []
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/channel-drift-flux-physics.i)
mu = 1.0
rho = 10.0
mu_d = 0.1
rho_d = 1.0
l = 2
U = 1
dp = 0.01
inlet_phase_2 = 0.1
advected_interp_method = 'average'
velocity_interp_method = 'rc'
# TODO remove need for those
cp = 1
k = 1
cp_d = 1
k_d = 1
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = '${fparse l * 5}'
    ymin = '${fparse -l / 2}'
    ymax = '${fparse l / 2}'
    nx = 10
    ny = 4
  []
  uniform_refine = 0
[]
[Physics]
  [NavierStokes]
    [Flow]
      [flow]
        compressibility = 'incompressible'
        density = 'rho_mixture'
        dynamic_viscosity = 'mu_mixture'
        # Initial conditions
        initial_velocity = '0 0 0'
        initial_pressure = 0
        # Boundary conditions
        inlet_boundaries = 'left'
        momentum_inlet_types = 'fixed-velocity'
        momentum_inlet_functors = '${U} 0'
        wall_boundaries = 'top bottom'
        momentum_wall_types = 'noslip noslip'
        outlet_boundaries = 'right'
        momentum_outlet_types = 'fixed-pressure'
        pressure_functors = '0'
        # Friction is done in drift flux term
        friction_types = "Darcy"
        friction_coeffs = "Darcy_coefficient_vec"
        standard_friction_formulation = true
        mass_advection_interpolation = '${advected_interp_method}'
        momentum_advection_interpolation = '${advected_interp_method}'
        velocity_interpolation = '${velocity_interp_method}'
        mu_interp_method = 'average'
      []
    []
    [TwoPhaseMixture]
      [mixture]
        phase_1_fraction_name = 'phase_1'
        phase_2_fraction_name = 'phase_2'
        # Phase transport equation
        add_phase_transport_equation = true
        alpha_exchange = 0.1
        phase_advection_interpolation = 'upwind'
        # see flow for inlet boundaries
        phase_fraction_inlet_type = 'fixed-value'
        phase_fraction_inlet_functors = '${inlet_phase_2}'
        # Needed for some reason
        ghost_layers = 5
        # Drift flux parameters
        add_drift_flux_momentum_terms = true
        density_interp_method = 'average'
        # This has to be consistent with the friction model
        slip_linear_friction_name = 'Darcy_coefficient'
        # Base phase material properties
        phase_1_density_name = ${rho}
        phase_1_viscosity_name = ${mu}
        phase_1_specific_heat_name = ${cp}
        phase_1_thermal_conductivity_name = ${k}
        # Not used because the 'slip_linear_friction_name' is set
        use_dispersed_phase_drag_model = true
        particle_diameter = ${dp}
        # Other phase material properties
        phase_2_density_name = ${rho_d}
        phase_2_viscosity_name = ${mu_d}
        phase_2_specific_heat_name = ${cp_d}
        phase_2_thermal_conductivity_name = ${k_d}
        output_all_properties = true
      []
    []
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  nl_rel_tol = 1e-10
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
    petsc_options_iname = '-pc_type -pc_factor_shift_type'
    petsc_options_value = 'lu       NONZERO'
  []
[]
[Outputs]
  print_linear_residuals = true
  print_nonlinear_residuals = true
  dofmap = true
  [out]
    type = Exodus
    hide = 'Re lin cum_lin dp'
  []
  [perf]
    type = PerfGraphOutput
  []
[]
[Postprocessors]
  [Re]
    type = ParsedPostprocessor
    expression = '${rho} * ${l} * ${U}'
  []
  [lin]
    type = NumLinearIterations
  []
  [cum_lin]
    type = CumulativeValuePostprocessor
    postprocessor = lin
  []
  [dp]
    type = PressureDrop
    pressure = 'pressure'
    upstream_boundary = 'left'
    downstream_boundary = 'right'
    boundary = 'left right'
  []
[]
(modules/heat_transfer/test/tests/gap_heat_transfer_mortar/large_gap_heat_transfer_test_sphere_mortar_error.i)
sphere_outer_htc = 10 # W/m^2/K
sphere_outer_Tinf = 300 # K
[GlobalParams]
  order = SECOND
  family = LAGRANGE
[]
[Problem]
  kernel_coverage_check = false
  material_coverage_check = false
[]
[Mesh]
  [file]
    type = FileMeshGenerator
    file = cyl2D.e
  []
  [secondary]
    type = LowerDBlockFromSidesetGenerator
    sidesets = '2'
    new_block_id = 10001
    new_block_name = 'secondary_lower'
    input = file
  []
  [primary]
    type = LowerDBlockFromSidesetGenerator
    sidesets = '3'
    new_block_id = 10000
    new_block_name = 'primary_lower'
    input = secondary
  []
  allow_renumbering = false
  coord_type = RZ
[]
[Functions]
  [temp]
    type = PiecewiseLinear
    x = '0   1'
    y = '100 200'
  []
[]
[Variables]
  [temp]
    initial_condition = 500
  []
  [lm]
    order = SECOND
    family = LAGRANGE
    block = 'secondary_lower'
  []
[]
[AuxVariables]
  [power_density]
    block = 'fuel'
    initial_condition = 50e3
  []
[]
[Kernels]
  [heat_conduction]
    type = HeatConduction
    variable = temp
    block = '1 2'
  []
  [heat_source]
    type = CoupledForce
    variable = temp
    block = 'fuel'
    v = power_density
  []
[]
[Materials]
  [heat1]
    type = HeatConductionMaterial
    block = '1 2'
    specific_heat = 1.0
    thermal_conductivity = 34.6
  []
[]
[UserObjects]
  [radiation]
    type = GapFluxModelRadiation
    temperature = temp
    boundary = 2
    primary_emissivity = 0.0
    secondary_emissivity = 0.0
  []
  [conduction]
    type = GapFluxModelConduction
    temperature = temp
    boundary = 2
    gap_conductivity = 5.0
  []
[]
[Constraints]
  [ced]
    type = ModularGapConductanceConstraint
    variable = lm
    secondary_variable = temp
    primary_boundary = 3
    primary_subdomain = 10000
    secondary_boundary = 2
    secondary_subdomain = 10001
    gap_flux_models = 'radiation conduction'
    gap_geometry_type = SPHERE
  []
[]
[BCs]
  [RPV_out_BC] # k \nabla T = h (T- T_inf) at RPV outer boundary
    type = ConvectiveFluxFunction # (Robin BC)
    variable = temp
    boundary = '4' # outer RPV
    coefficient = ${sphere_outer_htc}
    T_infinity = ${sphere_outer_Tinf}
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu       superlu_dist'
  dt = 1
  dtmin = 0.01
  end_time = 1
  nl_rel_tol = 1e-12
  nl_abs_tol = 1e-7
[]
[Outputs]
  exodus = true
  csv = true
  [Console]
    type = Console
  []
[]
[VectorPostprocessors]
  [NodalTemperature]
    type = NodalValueSampler
    sort_by = id
    boundary = '2 3'
    variable = temp
  []
[]
[Postprocessors]
  [temp_left]
    type = SideAverageValue
    boundary = 2
    variable = temp
  []
  [temp_right]
    type = SideAverageValue
    boundary = 3
    variable = temp
  []
  [flux_left]
    type = SideDiffusiveFluxIntegral
    variable = temp
    boundary = 2
    diffusivity = thermal_conductivity
  []
  [flux_right]
    type = SideDiffusiveFluxIntegral
    variable = temp
    boundary = 3
    diffusivity = thermal_conductivity
  []
  [ptot]
    type = ElementIntegralVariablePostprocessor
    variable = power_density
    block = 'fuel'
  []
  [sphere_convective_out]
    type = ConvectiveHeatTransferSideIntegral
    T_solid = temp
    boundary = '4' # outer RVP
    T_fluid = ${sphere_outer_Tinf}
    htc = ${sphere_outer_htc}
  []
  [heat_balance] # should be equal to 0 upon convergence
    type = ParsedPostprocessor
    expression = '(sphere_convective_out - ptot) / ptot'
    pp_names = 'sphere_convective_out ptot'
  []
[]
(modules/thermal_hydraulics/test/tests/components/simple_turbine_1phase/phy.conservation.i)
[GlobalParams]
  initial_p = 1e6
  initial_T = 517
  initial_vel = 4.3
  initial_vel_x = 4.3
  initial_vel_y = 0
  initial_vel_z = 0
  fp = fp
  closures = simple_closures
  f = 0
  rdg_slope_reconstruction = minmod
  gravity_vector = '0 0 0'
  scaling_factor_1phase = '1 1 1e-5'
[]
[FluidProperties]
  [fp]
    type = IdealGasFluidProperties
    gamma = 1.4
    molar_mass = 0.01
  []
[]
[Closures]
  [simple_closures]
    type = Closures1PhaseSimple
  []
[]
[Components]
  [inlet]
    type = InletMassFlowRateTemperature1Phase
    input = 'pipe1:in'
    m_dot = 10
    T = 517
  []
  [pipe1]
    type = FlowChannel1Phase
    position = '0 0 0'
    orientation = '1 0 0'
    length = 1
    n_elems = 10
    A = 1
  []
  [turbine]
    type = SimpleTurbine1Phase
    connections = 'pipe1:out pipe2:in'
    position = '1 0 0'
    volume = 1
    A_ref = 1.0
    K = 0
    on = true
    power = 1000
  []
  [pipe2]
    type = FlowChannel1Phase
    position = '1. 0 0'
    orientation = '1 0 0'
    length = 1
    n_elems = 10
    A = 1
  []
  [outlet]
    type = Outlet1Phase
    input = 'pipe2:out'
    p = 1e6
  []
[]
[Postprocessors]
  [mass_in]
    type = ADFlowBoundaryFlux1Phase
    equation = mass
    boundary = inlet
  []
  [mass_out]
    type = ADFlowBoundaryFlux1Phase
    equation = mass
    boundary = outlet
  []
  [mass_diff]
    type = LinearCombinationPostprocessor
    pp_coefs = '1 -1'
    pp_names = 'mass_in mass_out'
  []
  [p_in]
    type = SideAverageValue
    boundary = pipe1:in
    variable = p
  []
  [vel_in]
    type = SideAverageValue
    boundary = pipe1:in
    variable = vel_x
  []
  [momentum_in]
    type = ADFlowBoundaryFlux1Phase
    equation = momentum
    boundary = inlet
  []
  [momentum_out]
    type = ADFlowBoundaryFlux1Phase
    equation = momentum
    boundary = outlet
  []
  [dP]
    type = ParsedPostprocessor
    pp_names = 'p_in W_dot'
    expression = 'p_in * (1 - (1-W_dot/(10*2910.06*517))^(1.4/0.4))'
  []
  [momentum_diff]
    type = LinearCombinationPostprocessor
    pp_coefs = '1 -1 -1'
    pp_names = 'momentum_in momentum_out dP' # momentum source = -dP * A and A=1
  []
  [energy_in]
    type = ADFlowBoundaryFlux1Phase
    equation = energy
    boundary = inlet
  []
  [energy_out]
    type = ADFlowBoundaryFlux1Phase
    equation = energy
    boundary = outlet
  []
  [W_dot]
    type = ElementAverageValue
    variable = W_dot
    block = 'turbine'
  []
  [energy_diff]
    type = LinearCombinationPostprocessor
    pp_coefs = '1 -1 -1'
    pp_names = 'energy_in energy_out W_dot'
  []
[]
[Preconditioning]
  [pc]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  scheme = bdf2
  start_time = 0
  end_time = 10
  dt = 0.5
  abort_on_solve_fail = true
  solve_type = 'newton'
  petsc_options_iname = '-pc_type'
  petsc_options_value = ' lu'
  nl_rel_tol = 0
  nl_abs_tol = 2e-6
  nl_max_its = 10
  l_tol = 1e-3
  # automatic_scaling = true
  # compute_scaling_once = false
  # off_diagonals_in_auto_scaling = true
[]
[Outputs]
  [csv]
    type = CSV
    show = 'mass_diff energy_diff momentum_diff'
    execute_on = 'final'
  []
[]
(modules/combined/examples/optimization/helmholtz_multimat_strip.i)
vol_frac = 0.35
power = 1.1
Emin = 1.0e-6
Ess = 0.475 # ss
Et = 1.0 # w
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Mesh]
  # final_generator = 'MoveRight'
  [Bottom]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 320
    ny = 30
    xmin = 0
    xmax = 150
    ymin = 0
    ymax = 15
  []
  [RenameBottom]
    type = RenameBoundaryGenerator
    input = Bottom
    old_boundary = 'top bottom right left'
    new_boundary = 'top_bottom bottom_bottom right_bottom left_bottom'
  []
  [Middle]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 320
    ny = 6
    xmin = 0
    xmax = 150
    ymin = 0
    ymax = 3
  []
  [MoveMiddle]
    type = TransformGenerator
    input = Middle
    transform = TRANSLATE
    vector_value = '0 15 0'
  []
  [RenameMiddle]
    type = RenameBoundaryGenerator
    input = MoveMiddle
    old_boundary = 'top bottom right left'
    new_boundary = 'top_middle bottom_middle right_middle left_middle'
  []
  [Top]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 320
    ny = 30
    xmin = 0
    xmax = 150
    ymin = 0
    ymax = 15
  []
  [MoveTop]
    type = TransformGenerator
    input = Top
    transform = TRANSLATE
    vector_value = '0 18 0'
  []
  [RenameTop]
    type = RenameBoundaryGenerator
    input = MoveTop
    old_boundary = 'top bottom right left'
    new_boundary = 'top_top bottom_top right_top left_top'
  []
  [bottom_gen]
    type = ParsedSubdomainMeshGenerator
    input = RenameBottom
    combinatorial_geometry = 'y <= 15'
    block_id = 1
  []
  [middle_gen]
    type = ParsedSubdomainMeshGenerator
    input = RenameMiddle
    combinatorial_geometry = 'y <= 18 & y > 15'
    block_id = 2
  []
  [top_gen]
    type = ParsedSubdomainMeshGenerator
    input = RenameTop
    combinatorial_geometry = 'y > 18'
    block_id = 3
  []
  [stitch]
    type = StitchedMeshGenerator
    inputs = 'bottom_gen middle_gen top_gen'
    stitch_boundaries_pairs = 'top_bottom bottom_middle; top_middle bottom_top'
  []
  [left_load]
    type = ExtraNodesetGenerator
    input = stitch
    new_boundary = left_load
    coord = '37.5 33 0'
  []
  [right_load]
    type = ExtraNodesetGenerator
    input = left_load
    new_boundary = right_load
    coord = '112.5 33 0'
  []
  [left_support]
    type = ExtraNodesetGenerator
    input = right_load
    new_boundary = left_support
    coord = '0 0 0'
  []
  [right_support]
    type = ExtraNodesetGenerator
    input = left_support
    new_boundary = right_support
    coord = '150 0 0'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [Dc]
    initial_condition = -1.0
  []
[]
[AuxVariables]
  [Cc]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = -1.0
  []
  [mat_den]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = ${vol_frac}
  []
  [sensitivity]
    family = MONOMIAL
    order = FIRST
    initial_condition = -1.0
    [AuxKernel]
      type = MaterialRealAux
      variable = sensitivity
      property = sensitivity
      execute_on = LINEAR
    []
    block = '1 2 3'
  []
  [mat_den_nodal]
    family = L2_LAGRANGE
    order = FIRST
    initial_condition = ${vol_frac}
    [AuxKernel]
      type = SelfAux
      execute_on = TIMESTEP_END
      variable = mat_den_nodal
      v = mat_den
    []
  []
  [Dc_elem]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = -1.0
    [AuxKernel]
      type = SelfAux
      variable = Dc_elem
      v = Dc
      execute_on = 'TIMESTEP_END'
    []
  []
[]
[Kernels]
  [diffusion]
    type = FunctionDiffusion
    variable = Dc
    function = 4.0
  []
  [potential]
    type = Reaction
    variable = Dc
  []
  [source]
    type = CoupledForce
    variable = Dc
    v = sensitivity
  []
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    strain = SMALL
    add_variables = true
    incremental = false
  []
[]
[BCs]
  [no_y]
    type = DirichletBC
    variable = disp_y
    boundary = left_support
    value = 0.0
  []
  [no_x]
    type = DirichletBC
    variable = disp_x
    boundary = left_support
    value = 0.0
  []
  [no_y_right]
    type = DirichletBC
    variable = disp_y
    boundary = right_support
    value = 0.0
  []
  [boundary_penalty]
    type = ADRobinBC
    variable = Dc
    boundary = 'bottom_bottom right_bottom left_bottom top_top right_top left_top left_middle '
               'right_middle'
    coefficient = 10
  []
[]
[NodalKernels]
  [left_down]
    type = NodalGravity
    variable = disp_y
    boundary = left_load
    gravity_value = -1e-3
    mass = 1
  []
  [right_down]
    type = NodalGravity
    variable = disp_y
    boundary = right_load
    gravity_value = -1e-3
    mass = 1
  []
[]
[Materials]
  [sensitivity]
    type = ParsedMaterial
    property_name = 'sensitivity'
    block = '2'
    expression = '0'
  []
  [elasticity_tensor_one]
    type = ComputeVariableIsotropicElasticityTensor
    youngs_modulus = E_phys_one
    poissons_ratio = poissons_ratio
    args = 'mat_den'
    block = '1'
  []
  [elasticity_tensor_three]
    type = ComputeVariableIsotropicElasticityTensor
    youngs_modulus = E_phys_three
    poissons_ratio = poissons_ratio
    args = 'mat_den'
    block = '3'
  []
  [elasticity_tensor_two]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 1.0
    poissons_ratio = 0.3
    block = '2'
  []
  # One: Tungsten
  [E_phys_one]
    type = DerivativeParsedMaterial
    # Emin + (density^penal) * (E0 - Emin)
    expression = '${Emin} + (mat_den ^ ${power}) * (${Et}-${Emin})'
    coupled_variables = 'mat_den'
    property_name = E_phys_one
    block = '1'
    outputs = 'exodus'
  []
  # Three: SS316
  [E_phys_three]
    type = DerivativeParsedMaterial
    # Emin + (density^penal) * (E0 - Emin)
    expression = '${Emin} + (mat_den ^ ${power}) * (${Ess}-${Emin})'
    coupled_variables = 'mat_den'
    property_name = E_phys_three
    block = '3'
    outputs = 'exodus'
  []
  [poissons_ratio]
    type = GenericConstantMaterial
    prop_names = poissons_ratio
    prop_values = 0.3
  []
  [stress]
    type = ComputeLinearElasticStress
  []
  [dc_one]
    type = ComplianceSensitivity
    design_density = mat_den
    youngs_modulus = E_phys_one
    block = '1'
  []
  [dc_three]
    type = ComplianceSensitivity
    design_density = mat_den
    youngs_modulus = E_phys_three
    block = '3'
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[UserObjects]
  [update_one]
    type = DensityUpdate
    density_sensitivity = Dc_elem
    design_density = mat_den
    volume_fraction = ${vol_frac}
    execute_on = TIMESTEP_BEGIN
    block = '1'
  []
  [update_three]
    type = DensityUpdate
    density_sensitivity = Dc_elem
    design_density = mat_den
    volume_fraction = ${vol_frac}
    execute_on = TIMESTEP_BEGIN
    block = '3'
  []
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu superlu_dist'
  nl_abs_tol = 1e-10
  dt = 1.0
  num_steps = 90
[]
[Outputs]
  exodus = true
  [out]
    type = CSV
    execute_on = 'TIMESTEP_END'
  []
  print_linear_residuals = false
[]
[Postprocessors]
  [mesh_volume]
    type = VolumePostprocessor
    execute_on = 'initial timestep_end'
  []
  [total_vol]
    type = ElementIntegralVariablePostprocessor
    variable = mat_den
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [vol_frac]
    type = ParsedPostprocessor
    expression = 'total_vol / mesh_volume'
    pp_names = 'total_vol mesh_volume'
  []
  [sensitivity]
    type = ElementIntegralMaterialProperty
    mat_prop = sensitivity
    block = '1 3'
  []
  [objective_one]
    type = ElementIntegralMaterialProperty
    mat_prop = strain_energy_density
    execute_on = 'INITIAL TIMESTEP_END'
    block = '1'
  []
  [objective_three]
    type = ElementIntegralMaterialProperty
    mat_prop = strain_energy_density
    execute_on = 'INITIAL TIMESTEP_END'
    block = '3'
  []
[]
(test/tests/postprocessors/postprocessor_restore/lag_time.i)
[Mesh]
  [gmg]
    type = GeneratedMeshGenerator
    dim = 1
  []
[]
[Variables]
  [u]
  []
[]
[Kernels]
  [dt]
    type = TimeDerivative
    variable = u
  []
  [source]
    type = BodyForce
    variable = u
  []
[]
[Postprocessors]
  [time]
    type = TimePostprocessor
    execute_on = 'nonlinear'
  []
  [time_lag]
    type = ParsedPostprocessor
    expression = 'time'
    pp_names = 'time'
    execute_on = 'timestep_begin'
  []
[]
[Executioner]
  type = Transient
  end_time = 5
[]
[Problem]
  type = FailingProblem
  fail_steps = 5
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/rom_stress_update/nonad_verification.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[AuxVariables]
  [temperature]
  []
[]
[AuxKernels]
  [temp_aux]
    type = FunctionAux
    variable = temperature
    function = temp_fcn
    execute_on = 'initial timestep_begin'
  []
[]
[Functions]
  [rhom_fcn]
    type = PiecewiseConstant
    data_file = ss316_verification_data.csv
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    xy_in_file_only = false
    direction = LEFT_INCLUSIVE
  []
  [rhoi_fcn]
    type = PiecewiseConstant
    data_file = ss316_verification_data.csv
    x_index_in_file = 0
    y_index_in_file = 2
    format = columns
    xy_in_file_only = false
    direction = LEFT_INCLUSIVE
  []
  [vmJ2_fcn]
    type = PiecewiseConstant
    data_file = ss316_verification_data.csv
    x_index_in_file = 0
    y_index_in_file = 3
    format = columns
    xy_in_file_only = false
    direction = LEFT_INCLUSIVE
  []
  [evm_fcn]
    type = PiecewiseConstant
    data_file = ss316_verification_data.csv
    x_index_in_file = 0
    y_index_in_file = 4
    format = columns
    xy_in_file_only = false
    direction = LEFT_INCLUSIVE
  []
  [temp_fcn]
    type = PiecewiseConstant
    data_file = ss316_verification_data.csv
    x_index_in_file = 0
    y_index_in_file = 5
    format = columns
    xy_in_file_only = false
    direction = LEFT_INCLUSIVE
  []
  [rhom_soln_fcn]
    type = PiecewiseConstant
    data_file = ss316_verification_data.csv
    x_index_in_file = 0
    y_index_in_file = 7
    format = columns
    xy_in_file_only = false
    direction = LEFT_INCLUSIVE
  []
  [rhoi_soln_fcn]
    type = PiecewiseConstant
    data_file = ss316_verification_data.csv
    x_index_in_file = 0
    y_index_in_file = 8
    format = columns
    xy_in_file_only = false
    direction = LEFT_INCLUSIVE
  []
  [creep_rate_soln_fcn]
    type = PiecewiseConstant
    data_file = ss316_verification_data.csv
    x_index_in_file = 0
    y_index_in_file = 10
    format = columns
    xy_in_file_only = false
    direction = LEFT_INCLUSIVE
  []
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    strain = FINITE
    add_variables = true
    generate_output = 'vonmises_stress'
  []
[]
[BCs]
  [symmx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0
  []
  [symmy]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0
  []
  [symmz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  []
  [pull_x]
    type = DirichletBC
    variable = disp_x
    boundary = right
    value = 1e-5 # This is required to make a non-zero effective trial stress so radial return is engaged
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    shear_modulus = 1e13
    poissons_ratio = 0.3
  []
  [stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = rom_stress_prediction
  []
  [rom_stress_prediction]
    type =  SS316HLAROMANCEStressUpdateTest
    temperature = temperature
    effective_inelastic_strain_name = effective_creep_strain
    internal_solve_full_iteration_history = true
    apply_strain = false
    outputs = all
    wall_dislocation_density_forcing_function = rhoi_fcn
    cell_dislocation_density_forcing_function = rhom_fcn
    old_creep_strain_forcing_function = evm_fcn
    wall_input_window_low_failure = ERROR
    wall_input_window_high_failure = ERROR
    cell_input_window_low_failure = ERROR
    cell_input_window_high_failure = ERROR
    temperature_input_window_low_failure = ERROR
    temperature_input_window_high_failure = ERROR
    stress_input_window_low_failure = ERROR
    stress_input_window_high_failure = ERROR
    old_strain_input_window_low_failure = ERROR
    old_strain_input_window_high_failure = ERROR
    environment_input_window_low_failure = ERROR
    environment_input_window_high_failure = ERROR
    effective_stress_forcing_function = vmJ2_fcn
  []
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_abs_tol = 1e-1 # Nothing is really being solved here, so loose tolerances are okay
  dt = 1e-3
  end_time = 1e-2
  timestep_tolerance = 1e-3
[]
[Postprocessors]
  [extrapolation]
    type = ElementAverageValue
    variable = ROM_extrapolation
    outputs = console
  []
  [old_strain_in]
    type = FunctionValuePostprocessor
    function = evm_fcn
    execute_on = 'TIMESTEP_END initial'
    outputs = console
  []
  [temperature]
    type = ElementAverageValue
    variable = temperature
    outputs = console
  []
  [rhom]
    type = ElementAverageValue
    variable = cell_dislocations
  []
  [rhoi]
    type = ElementAverageValue
    variable = wall_dislocations
  []
  [creep_rate]
    type = ElementAverageValue
    variable = creep_rate
  []
  [rhom_in]
    type = FunctionValuePostprocessor
    function = rhom_fcn
    execute_on = 'TIMESTEP_END initial'
    outputs = console
  []
  [rhoi_in]
    type = FunctionValuePostprocessor
    function = rhoi_fcn
    execute_on = 'TIMESTEP_END initial'
    outputs = console
  []
  [vmJ2_in]
    type = FunctionValuePostprocessor
    function = vmJ2_fcn
    execute_on = 'TIMESTEP_END initial'
    outputs = console
  []
  [rhom_soln]
    type = FunctionValuePostprocessor
    function = rhom_soln_fcn
    outputs = console
  []
  [rhoi_soln]
    type = FunctionValuePostprocessor
    function = rhoi_soln_fcn
    outputs = console
  []
  [creep_rate_soln]
    type = FunctionValuePostprocessor
    function = creep_rate_soln_fcn
  []
  [rhom_diff]
    type = ParsedPostprocessor
    pp_names = 'rhom_soln rhom'
    expression = '(rhom_soln - rhom) / rhom_soln'
    outputs = console
  []
  [rhoi_diff]
    type = ParsedPostprocessor
    pp_names = 'rhoi_soln rhoi'
    expression = '(rhoi_soln - rhoi) / rhoi_soln'
    outputs = console
  []
  [creep_rate_diff]
    type = ParsedPostprocessor
    pp_names = 'creep_rate creep_rate_soln'
    expression = '(creep_rate_soln - creep_rate) / creep_rate_soln'
    outputs = console
  []
  [z_rhom_max_diff]
    type = TimeExtremeValue
    postprocessor = rhom_diff
    value_type = abs_max
  []
  [z_rhoi_max_diff]
    type = TimeExtremeValue
    postprocessor = rhoi_diff
    value_type = abs_max
  []
  [z_creep_rate_max_diff]
    type = TimeExtremeValue
    postprocessor = creep_rate_diff
    value_type = abs_max
  []
[]
[Outputs]
  csv = true
  execute_on = 'INITIAL TIMESTEP_END FINAL'
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/channel-advection-slip-physics.i)
mu = 1.0
rho = 10.0
mu_d = 0.1
rho_d = 1.0
l = 2
U = 1
dp = 0.01
inlet_phase_2 = 0.1
advected_interp_method = 'average'
velocity_interp_method = 'rc'
# TODO remove need for those
cp = 1
k = 1
cp_d = 1
k_d = 1
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = '${fparse l * 5}'
    ymin = '${fparse -l / 2}'
    ymax = '${fparse l / 2}'
    nx = 10
    ny = 6
  []
  uniform_refine = 0
[]
[Physics]
  [NavierStokes]
    [Flow]
      [flow]
        compressibility = 'incompressible'
        density = 'rho_mixture'
        dynamic_viscosity = 'mu_mixture'
        # Initial conditions
        initial_velocity = '0 0 0'
        initial_pressure = 0
        # Boundary conditions
        inlet_boundaries = 'left'
        momentum_inlet_types = 'fixed-velocity'
        momentum_inlet_functors = '${U} 0'
        wall_boundaries = 'top bottom'
        momentum_wall_types = 'noslip noslip'
        outlet_boundaries = 'right'
        momentum_outlet_types = 'fixed-pressure'
        pressure_functors = '0'
        # Friction is done in drift flux term
        friction_types = "Darcy"
        friction_coeffs = "Darcy_coefficient_vec"
        standard_friction_formulation = true
        mass_advection_interpolation = '${advected_interp_method}'
        momentum_advection_interpolation = '${advected_interp_method}'
        velocity_interpolation = '${velocity_interp_method}'
        mu_interp_method = 'average'
      []
    []
    [TwoPhaseMixture]
      [mixture]
        phase_1_fraction_name = 'phase_1'
        phase_2_fraction_name = 'phase_2'
        add_phase_transport_equation = true
        alpha_exchange = 0.1
        phase_advection_interpolation = 'upwind'
        # see flow for inlet boundaries
        phase_fraction_inlet_type = 'fixed-value'
        phase_fraction_inlet_functors = '${inlet_phase_2}'
        ghost_layers = 7
        add_advection_slip_term = true
        # Base phase material properties
        phase_1_density_name = ${rho}
        phase_1_viscosity_name = ${mu}
        phase_1_specific_heat_name = ${cp}
        phase_1_thermal_conductivity_name = ${k}
        # Other phase material properties
        phase_2_density_name = ${rho_d}
        phase_2_viscosity_name = ${mu_d}
        phase_2_specific_heat_name = ${cp_d}
        phase_2_thermal_conductivity_name = ${k_d}
        use_dispersed_phase_drag_model = true
        particle_diameter = ${dp}
        output_all_properties = true
      []
    []
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  nl_rel_tol = 1e-10
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
    petsc_options_iname = '-pc_type -pc_factor_shift_type'
    petsc_options_value = 'lu       NONZERO'
  []
[]
[Outputs]
  print_linear_residuals = true
  print_nonlinear_residuals = true
  dofmap = true
  [out]
    type = Exodus
    hide = 'Re lin cum_lin'
  []
  [perf]
    type = PerfGraphOutput
  []
[]
[Postprocessors]
  [Re]
    type = ParsedPostprocessor
    expression = '${rho} * ${l} * ${U}'
  []
  [lin]
    type = NumLinearIterations
  []
  [cum_lin]
    type = CumulativeValuePostprocessor
    postprocessor = lin
  []
[]
(test/tests/convergence/reference_residual_convergence/no_ref.i)
[Mesh]
  type = GeneratedMesh
  dim = 1
  nx = 10
[]
[Variables]
  [u][]
  [v]
    scaling = 1e-6
  []
[]
[Functions]
  [ramp]
    type = ParsedFunction
    expression = 'if(t < 5, t - 5, 0) * x'
  []
[]
[Kernels]
  [u_dt]
    type = TimeDerivative
    variable = u
  []
  [u_coupled_rx]
    type = CoupledForce
    variable = u
    v = v
    coef = 1
  []
  [v_dt]
    type = TimeDerivative
    variable = v
  []
  [v_neg_force]
    type = BodyForce
    variable = v
    value = ${fparse -1 / 2}
    function = ramp
  []
  [v_force]
    type = BodyForce
    variable = v
    value = 1
    function = ramp
  []
[]
[Postprocessors]
  [u_avg]
    type = ElementAverageValue
    variable = u
    execute_on = 'TIMESTEP_END INITIAL'
  []
  [v_avg]
    type = ElementAverageValue
    variable = v
    execute_on = 'TIMESTEP_END INITIAL'
  []
  [timestep]
    type = TimePostprocessor
    outputs = 'none'
  []
  [v_old]
    type = ElementAverageValue
    variable = v
    execute_on = TIMESTEP_BEGIN
    outputs = none
  []
  [u_old]
    type = ElementAverageValue
    variable = u
    execute_on = TIMESTEP_BEGIN
    outputs = none
  []
  [v_exact]
    type = ParsedPostprocessor
    pp_names = 'timestep v_old'
    expression = 't := if(timestep > 5, 5, timestep); (t^2 - 9 * t) / 8'
  []
  [u_exact]
    type = ParsedPostprocessor
    pp_names = 'u_old v_exact'
    expression = 'u_old + v_exact'
  []
[]
[Convergence]
  [conv]
    type = ReferenceResidualConvergence
    nl_rel_tol = 1e-6
  []
[]
[Executioner]
  type = Transient
  petsc_options = '-snes_converged_reason'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  line_search = none
  num_steps = 10
  nonlinear_convergence = conv
  verbose = true
[]
[Outputs]
  csv = true
  perf_graph = true
[]
(test/tests/constraints/equal_value_embedded_constraint/two_var_embedded_constraint.i)
###########################################################
# This is a test that demonstrates a user-defined
# constraint. It forces variables in overlapping portion of
# two blocks to have the same value
###########################################################
[Mesh]
  file=gold/2D_2D.e
[]
[Problem]
  use_hash_table_matrix_assembly = true
[]
[Variables]
  [phi]
    order = FIRST
    family = LAGRANGE
  []
  [phi1]
    order = FIRST
    family = LAGRANGE
    block = 1
    scaling = .001
  []
  [phi2]
    order = FIRST
    family = LAGRANGE
    block = 2
    scaling = 10000
  []
[]
[Kernels]
  [diffusion]
    type = Diffusion
    variable = phi
  []
  [diffusion1]
    type = Diffusion
    variable = phi1
    block = 1
  []
  [diffusion2]
    type = Diffusion
    variable = phi2
    block = 2
  []
[]
[BCs]
  [top]
    type = DirichletBC
    variable = phi
    boundary = 1
    value = 10.0
  []
  [bottom]
    type = DirichletBC
    variable = phi
    boundary = 2
    value = 0.0
  []
  [left]
    type = DirichletBC
    variable = phi
    boundary = 3
    value = 10.0
  []
  [right]
    type = DirichletBC
    variable = phi
    boundary = 4
    value = 0.0
  []
  [top_block1]
    type = DirichletBC
    variable = phi1
    boundary = 1
    value = 10.0
  []
  [bottom_block1]
    type = DirichletBC
    variable = phi1
    boundary = 2
    value = 0.0
  []
  [left_block2]
    type = DirichletBC
    variable = phi2
    boundary = 3
    value = 10.0
  []
  [right_block2]
    type = DirichletBC
    variable = phi2
    boundary = 4
    value = 0.0
  []
[]
[Constraints]
  [equal]
    type = ADEqualValueEmbeddedConstraint
    secondary = 2
    primary = 1
    penalty = 1e3
    primary_variable = phi
    variable = phi
    formulation = penalty
  []
  [equal_phi1_phi2]
    type = ADEqualValueEmbeddedConstraint
    secondary = 2
    primary = 1
    penalty = 1e3
    primary_variable = phi1
    variable = phi2
    formulation = penalty
  []
[]
[Postprocessors]
  [l2_difference_block_1]
    type = ElementL2Difference
    variable = phi
    other_variable = phi1
    block = 1
  []
  [l2_difference_block_2]
    type = ElementL2Difference
    variable = phi
    other_variable = phi2
    block = 2
  []
  [compare]
    type = ParsedPostprocessor
    expression = 'abs(l2_difference_block_1)+abs(l2_difference_block_2)'
    pp_names = 'l2_difference_block_1 l2_difference_block_2'
  []
[]
[UserObjects]
  [terminate]
    type = Terminator
    expression = 'compare > 1e-10'
    error_level = ERROR
    message = 'Two variable solution does match single variable solution to requried tolerance.'
  []
[]
[Executioner]
  type = Steady
  solve_type = NEWTON
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  line_search = none
  nl_rel_tol = 1e-12
  nl_abs_tol = 1e-8
  l_max_its = 100
  nl_max_its = 10
[]
[Outputs]
  print_linear_residuals = false
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/1d-scalar/channel-transient-physics.i)
mu = 2.6
rho = 1.0
advected_interp_method = 'upwind'
k1 = 0.1
k2 = 0.2
[Mesh]
  [mesh]
    type = CartesianMeshGenerator
    dim = 1
    dx = '0.25 0.25'
    ix = '5 5'
    subdomain_id = '0 1'
  []
[]
[Problem]
  linear_sys_names = 'u_system pressure_system s1_system s2_system'
[]
[Physics]
  [NavierStokes]
    [FlowSegregated]
      [flow]
        velocity_variable = 'vel_x'
        pressure_variable = 'pressure'
        initial_velocity = '0.5 0 0'
        initial_pressure = '0.2'
        density = ${rho}
        dynamic_viscosity = ${mu}
        # use inlet for moving wall to match the reference input
        # we could also use a noslip BC with a velocity wall functor
        inlet_boundaries = 'left'
        momentum_inlet_types = 'fixed-velocity'
        momentum_inlet_functors = '1.1'
        outlet_boundaries = 'right'
        momentum_outlet_types = 'fixed-pressure'
        pressure_functors = '1.4'
        orthogonality_correction = false
        pressure_two_term_bc_expansion = false
        momentum_two_term_bc_expansion = false
        momentum_advection_interpolation = ${advected_interp_method}
      []
    []
    [ScalarTransportSegregated]
      [scalar]
        passive_scalar_names = 'scalar1 scalar2'
        system_names = 's1_system s2_system'
        initial_scalar_variables = '1.1 3'
        passive_scalar_diffusivity = '${k1} ${k2}'
        passive_scalar_inlet_types = 'fixed-value fixed-value'
        passive_scalar_inlet_functors = '1; 2'
        passive_scalar_advection_interpolation = ${advected_interp_method}
        passive_scalar_two_term_bc_expansion = false
        use_nonorthogonal_correction = false
      []
    []
  []
[]
[Executioner]
  type = PIMPLE
  momentum_l_abs_tol = 1e-13
  pressure_l_abs_tol = 1e-13
  passive_scalar_l_abs_tol = 1e-13
  momentum_l_tol = 0
  pressure_l_tol = 0
  passive_scalar_l_tol = 0
  rhie_chow_user_object = 'ins_rhie_chow_interpolator'
  momentum_systems = 'u_system'
  pressure_system = 'pressure_system'
  passive_scalar_systems = 's1_system s2_system'
  momentum_equation_relaxation = 0.4
  passive_scalar_equation_relaxation = '0.9 0.9'
  pressure_variable_relaxation = 0.3
  # We need to converge the problem to show conservation
  num_iterations = 1000
  pressure_absolute_tolerance = 1e-10
  momentum_absolute_tolerance = 1e-10
  passive_scalar_absolute_tolerance = '1e-9 1e-9'
  momentum_petsc_options_iname = '-pc_type' # -pc_hypre_type'
  momentum_petsc_options_value = 'lu'
  pressure_petsc_options_iname = '-pc_type' # -pc_hypre_type'
  pressure_petsc_options_value = 'lu' #hypre boomeramg'
  passive_scalar_petsc_options_iname = '-pc_type' # -pc_hypre_type'
  passive_scalar_petsc_options_value = 'lu' #hypre boomeramg'
  print_fields = false
  continue_on_max_its = true
  # Time stepping parameters
  end_time = 5
  dt = 1
[]
[Outputs]
  exodus = false
  execute_on = timestep_end
  [csv]
    type = CSV
    hide = 'balance_s1 balance_s2'
  []
[]
[GlobalParams]
  rhie_chow_user_object = 'ins_rhie_chow_interpolator'
  subtract_mesh_velocity = false
  advected_interp_method = ${advected_interp_method}
[]
[Postprocessors]
  [s1_in]
    type = VolumetricFlowRate
    boundary = left
    vel_x = vel_x
    advected_quantity = 'scalar1'
  []
  [s2_in]
    type = VolumetricFlowRate
    boundary = left
    vel_x = vel_x
    advected_quantity = 'scalar2'
  []
  [s1_out]
    type = VolumetricFlowRate
    boundary = right
    vel_x = vel_x
    advected_quantity = 'scalar1'
  []
  [s2_out]
    type = VolumetricFlowRate
    boundary = right
    vel_x = vel_x
    advected_quantity = 'scalar2'
  []
  [balance_s1]
    type = ParsedPostprocessor
    expression = 's1_out + s1_in'
    pp_names = 's1_in s1_out'
  []
  [balance_s2]
    type = ParsedPostprocessor
    expression = 's2_out + s2_in'
    pp_names = 's2_in s2_out'
  []
[]
(modules/combined/examples/optimization/thermomechanical/structural_sub.i)
vol_frac = 0.4
power = 2.0
E0 = 1.0e-6
E1 = 1.0
rho0 = 0.0
rho1 = 1.0
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Mesh]
  [MeshGenerator]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 40
    ny = 40
    xmin = 0
    xmax = 40
    ymin = 0
    ymax = 40
  []
  [node]
    type = ExtraNodesetGenerator
    input = MeshGenerator
    new_boundary = hold
    nodes = 0
  []
  [push_left]
    type = ExtraNodesetGenerator
    input = node
    new_boundary = push_left
    coord = '16 0 0'
  []
  [push_center]
    type = ExtraNodesetGenerator
    input = push_left
    new_boundary = push_center
    coord = '24 0 0'
  []
  [extra]
    type = SideSetsFromBoundingBoxGenerator
    input = push_center
    bottom_left = '-0.01 17.999  0'
    top_right = '5 22.001  0'
    boundary_new = n1
    included_boundaries = left
  []
  [dirichlet_bc]
    type = SideSetsFromNodeSetsGenerator
    input = extra
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
[]
[AuxVariables]
  [Dc]
    family = MONOMIAL
    order = FIRST
    initial_condition = -1.0
  []
  [mat_den]
    family = MONOMIAL
    order = FIRST
    initial_condition = ${vol_frac}
  []
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    strain = SMALL
    add_variables = true
    incremental = false
  []
[]
[BCs]
  [no_y]
    type = DirichletBC
    variable = disp_y
    boundary = hold
    value = 0.0
  []
  [no_x_symm]
    type = DirichletBC
    variable = disp_x
    boundary = right
    value = 0.0
  []
[]
[NodalKernels]
  [push_left]
    type = NodalGravity
    variable = disp_y
    boundary = push_left
    gravity_value = -1.0e-3
    mass = 1
  []
  [push_center]
    type = NodalGravity
    variable = disp_y
    boundary = push_center
    gravity_value = -1.0e-3
    mass = 1
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeVariableIsotropicElasticityTensor
    youngs_modulus = E_phys
    poissons_ratio = poissons_ratio
    args = 'mat_den'
  []
  [E_phys]
    type = DerivativeParsedMaterial
    expression = "A1:=(${E0}-${E1})/(${rho0}^${power}-${rho1}^${power}); "
                 "B1:=${E0}-A1*${rho0}^${power}; E1:=A1*mat_den^${power}+B1; E1"
    coupled_variables = 'mat_den'
    property_name = E_phys
  []
  [poissons_ratio]
    type = GenericConstantMaterial
    prop_names = poissons_ratio
    prop_values = 0.3
  []
  [stress]
    type = ComputeLinearElasticStress
  []
  [dc]
    type = ComplianceSensitivity
    design_density = mat_den
    youngs_modulus = E_phys
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[UserObjects]
  [rad_avg]
    type = RadialAverage
    radius = 1.2
    weights = linear
    prop_name = sensitivity
    execute_on = TIMESTEP_END
    force_preaux = true
  []
  [calc_sense]
    type = SensitivityFilter
    density_sensitivity = Dc
    design_density = mat_den
    filter_UO = rad_avg
    execute_on = TIMESTEP_END
    force_postaux = true
  []
[]
[Executioner]
  type = Transient
  solve_type = PJFNK
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu superlu_dist'
  nl_abs_tol = 1e-12
  dt = 1.0
  num_steps = 500
[]
[Outputs]
  exodus = true
  [out]
    type = CSV
    execute_on = 'TIMESTEP_END'
  []
  print_linear_residuals = false
[]
[Postprocessors]
  [mesh_volume]
    type = VolumePostprocessor
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [total_vol]
    type = ElementIntegralVariablePostprocessor
    variable = mat_den
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [vol_frac]
    type = ParsedPostprocessor
    expression = 'total_vol / mesh_volume'
    pp_names = 'total_vol mesh_volume'
  []
  [sensitivity]
    type = ElementIntegralMaterialProperty
    mat_prop = sensitivity
  []
  [objective]
    type = ElementIntegralMaterialProperty
    mat_prop = strain_energy_density
    execute_on = 'INITIAL TIMESTEP_END'
  []
[]
(modules/thermal_hydraulics/tutorials/single_phase_flow/06_custom_closures.i)
T_in = 300. # K
m_dot_in = 1e-2 # kg/s
press = 10e5 # Pa
# core parameters
core_length = 1. # m
core_n_elems = 25
core_dia = '${units 2. cm -> m}'
core_pitch = '${units 8.7 cm -> m}'
A_core = '${fparse core_pitch^2 - 0.25 *pi * core_dia^2}'
P_wet_core = '${fparse 4*core_pitch + pi * core_dia}'
Dh_core = '${fparse 4 * A_core / P_wet_core}'
# pipe parameters
pipe_dia = '${units 10. cm -> m}'
A_pipe = '${fparse 0.25 * pi * pipe_dia^2}'
tot_power = 2000 # W
# heat exchanger parameters
hx_dia_inner = '${units 12. cm -> m}'
hx_wall_thickness = '${units 5. mm -> m}'
hx_dia_outer = '${units 50. cm -> m}'
hx_radius_wall = '${fparse hx_dia_inner / 2. + hx_wall_thickness}'
hx_length = 1.5 # m
hx_n_elems = 25
m_dot_sec_in = 1. # kg/s
[GlobalParams]
  initial_p = ${press}
  initial_vel = 0.0001
  initial_T = ${T_in}
  initial_vel_x = 0
  initial_vel_y = 0
  initial_vel_z = 0
  gravity_vector = '0 0 0'
  rdg_slope_reconstruction = minmod
  scaling_factor_1phase = '1 1e-2 1e-4'
  scaling_factor_rhoV = 1
  scaling_factor_rhouV = 1e-2
  scaling_factor_rhovV = 1e-2
  scaling_factor_rhowV = 1e-2
  scaling_factor_rhoEV = 1e-4
  closures = thm_closures
  fp = he
[]
[Functions]
  [m_dot_sec_fn]
    type = PiecewiseLinear
    xy_data = '
      0    0
      10 ${m_dot_sec_in}'
  []
[]
[FluidProperties]
  [he]
    type = IdealGasFluidProperties
    molar_mass = 4e-3
    gamma = 1.67
    k = 0.2556
    mu = 3.22639e-5
  []
  [water]
    type = StiffenedGasFluidProperties
    gamma = 2.35
    cv = 1816.0
    q = -1.167e6
    p_inf = 1.0e9
    q_prime = 0
  []
[]
[Closures]
  [thm_closures]
    type = Closures1PhaseTHM
  []
[]
[Materials]
  [Re_mat]
    type = ADReynoldsNumberMaterial
    Re = Re
    rho = rho
    vel = vel
    D_h = D_h
    mu = mu
    block = hx/pri
  []
  [f_mat]
    type = ADParsedMaterial
    property_name = f_D
    constant_names = 'a b c'
    constant_expressions = '1 0.1 -0.5'
    material_property_names = 'Re'
    expression = 'a + b * Re^c'
    block = hx/pri
  []
  [Pr_mat]
    type = ADPrandtlNumberMaterial
    Pr = Pr
    cp = cp
    mu = mu
    k = k
    block = hx/pri
  []
  [Nu_mat]
    type = ADParsedMaterial
    property_name = 'Nu'
    constant_names = 'a b c'
    constant_expressions = '0.03 0.9 0.5'
    material_property_names = 'Re Pr'
    expression = 'a * Re ^b * Pr^c'
    block = hx/pri
  []
  [Hw_mat]
    type = ADConvectiveHeatTransferCoefficientMaterial
    D_h = D_h
    k = k
    Nu = Nu
    Hw = Hw
    block = hx/pri
  []
[]
[SolidProperties]
  [steel]
    type = ThermalFunctionSolidProperties
    rho = 8050
    k = 45
    cp = 466
  []
[]
[Components]
  [total_power]
    type = TotalPower
    power = ${tot_power}
  []
  [up_pipe_1]
    type = FlowChannel1Phase
    position = '0 0 0'
    orientation = '0 0 1'
    length = 0.5
    n_elems = 15
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct1]
    type = JunctionParallelChannels1Phase
    position = '0 0 0.5'
    connections = 'up_pipe_1:out core_chan:in'
    volume = 1e-5
  []
  [core_chan]
    type = FlowChannel1Phase
    position = '0 0 0.5'
    orientation = '0 0 1'
    length = ${core_length}
    n_elems = ${core_n_elems}
    roughness = .0001
    A = ${A_core}
    D_h = ${Dh_core}
  []
  [core_hs]
    type = HeatStructureCylindrical
    position = '0 0 0.5'
    orientation = '0 0 1'
    length = ${core_length}
    n_elems = ${core_n_elems}
    names = 'block'
    widths = '${fparse core_dia / 2.}'
    solid_properties = 'steel'
    solid_properties_T_ref = '300'
    n_part_elems = 3
  []
  [core_heating]
    type = HeatSourceFromTotalPower
    hs = core_hs
    regions = block
    power = total_power
  []
  [core_ht]
    type = HeatTransferFromHeatStructure1Phase
    flow_channel = core_chan
    hs = core_hs
    hs_side = outer
    P_hf = '${fparse pi * core_dia}'
  []
  [jct2]
    type = JunctionParallelChannels1Phase
    position = '0 0 1.5'
    connections = 'core_chan:out up_pipe_2:in'
    volume = 1e-5
  []
  [up_pipe_2]
    type = FlowChannel1Phase
    position = '0 0 1.5'
    orientation = '0 0 1'
    length = 0.5
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct3]
    type = JunctionOneToOne1Phase
    connections = 'up_pipe_2:out top_pipe_1:in'
  []
  [top_pipe_1]
    type = FlowChannel1Phase
    position = '0 0 2'
    orientation = '1 0 0'
    length = 0.5
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [top_pipe_2]
    type = FlowChannel1Phase
    position = '0.5 0 2'
    orientation = '1 0 0'
    length = 0.5
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct4]
    type = VolumeJunction1Phase
    position = '0.5 0 2'
    volume = 1e-5
    connections = 'top_pipe_1:out top_pipe_2:in press_pipe:in'
  []
  [press_pipe]
    type = FlowChannel1Phase
    position = '0.5 0 2'
    orientation = '0 1 0'
    length = 0.2
    n_elems = 5
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [pressurizer]
    type = InletStagnationPressureTemperature1Phase
    p0 = ${press}
    T0 = ${T_in}
    input = press_pipe:out
  []
  [jct5]
    type = JunctionOneToOne1Phase
    connections = 'top_pipe_2:out down_pipe_1:in'
  []
  [down_pipe_1]
    type = FlowChannel1Phase
    position = '1 0 2'
    orientation = '0 0 -1'
    length = 0.25
    A = ${A_pipe}
    n_elems = 5
  []
  [jct6]
    type = JunctionParallelChannels1Phase
    position = '1 0 1.75'
    connections = 'down_pipe_1:out hx/pri:in'
    volume = 1e-5
  []
  [hx]
    [pri]
      type = FlowChannel1Phase
      position = '1 0 1.75'
      orientation = '0 0 -1'
      length = ${hx_length}
      n_elems = ${hx_n_elems}
      roughness = 1e-5
      A = '${fparse pi * hx_dia_inner * hx_dia_inner / 4.}'
      D_h = ${hx_dia_inner}
      closures = ''
    []
    [ht_pri]
      type = HeatTransferFromHeatStructure1Phase
      hs = hx/wall
      hs_side = inner
      flow_channel = hx/pri
      P_hf = '${fparse pi * hx_dia_inner}'
    []
    [wall]
      type = HeatStructureCylindrical
      position = '1 0 1.75'
      orientation = '0 0 -1'
      length = ${hx_length}
      n_elems = ${hx_n_elems}
      widths = '${hx_wall_thickness}'
      n_part_elems = '3'
      solid_properties = 'steel'
      solid_properties_T_ref = '300'
      names = '0'
      inner_radius = '${fparse hx_dia_inner / 2.}'
    []
    [ht_sec]
      type = HeatTransferFromHeatStructure1Phase
      hs = hx/wall
      hs_side = outer
      flow_channel = hx/sec
      P_hf = '${fparse 2 * pi * hx_radius_wall}'
    []
    [sec]
      type = FlowChannel1Phase
      position = '${fparse 1 + hx_wall_thickness} 0 0.25'
      orientation = '0 0 1'
      length = ${hx_length}
      n_elems = ${hx_n_elems}
      A = '${fparse pi * (hx_dia_outer * hx_dia_outer / 4. - hx_radius_wall * hx_radius_wall)}'
      D_h = '${fparse hx_dia_outer - (2 * hx_radius_wall)}'
      fp = water
      initial_T = 300
    []
  []
  [jct7]
    type = JunctionParallelChannels1Phase
    position = '1 0 0.5'
    connections = 'hx/pri:out down_pipe_2:in'
    volume = 1e-5
  []
  [down_pipe_2]
    type = FlowChannel1Phase
    position = '1 0 0.25'
    orientation = '0 0 -1'
    length = 0.25
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct8]
    type = JunctionOneToOne1Phase
    connections = 'down_pipe_2:out bottom_1:in'
  []
  [bottom_1]
    type = FlowChannel1Phase
    position = '1 0 0'
    orientation = '-1 0 0'
    length = 0.5
    n_elems = 5
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [pump]
    type = Pump1Phase
    position = '0.5 0 0'
    connections = 'bottom_1:out bottom_2:in'
    volume = 1e-4
    A_ref = ${A_pipe}
    head = 0
  []
  [bottom_2]
    type = FlowChannel1Phase
    position = '0.5 0 0'
    orientation = '-1 0 0'
    length = 0.5
    n_elems = 5
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct9]
    type = JunctionOneToOne1Phase
    connections = 'bottom_2:out up_pipe_1:in'
  []
  [inlet_sec]
    type = InletMassFlowRateTemperature1Phase
    input = 'hx/sec:in'
    m_dot = 0
    T = 300
  []
  [outlet_sec]
    type = Outlet1Phase
    input = 'hx/sec:out'
    p = 1e5
  []
[]
[ControlLogic]
  [set_point]
    type = GetFunctionValueControl
    function = ${m_dot_in}
  []
  [pid]
    type = PIDControl
    initial_value = 0.0
    set_point = set_point:value
    input = m_dot_pump
    K_p = 1.
    K_i = 4.
    K_d = 0
  []
  [set_pump_head]
    type = SetComponentRealValueControl
    component = pump
    parameter = head
    value = pid:output
  []
  [m_dot_sec_inlet_ctrl]
    type = GetFunctionValueControl
    function = m_dot_sec_fn
  []
  [set_m_dot_sec_ctrl]
    type = SetComponentRealValueControl
    component = inlet_sec
    parameter = m_dot
    value = m_dot_sec_inlet_ctrl:value
  []
[]
[Postprocessors]
  [power_to_coolant]
    type = ADHeatRateConvection1Phase
    block = core_chan
    P_hf = '${fparse pi *core_dia}'
  []
  [m_dot_pump]
    type = ADFlowJunctionFlux1Phase
    boundary = core_chan:in
    connection_index = 1
    equation = mass
    junction = jct7
  []
  [core_T_out]
    type = SideAverageValue
    boundary = core_chan:out
    variable = T
  []
  [core_p_in]
    type = SideAverageValue
    boundary = core_chan:in
    variable = p
  []
  [core_p_out]
    type = SideAverageValue
    boundary = core_chan:out
    variable = p
  []
  [core_delta_p]
    type = ParsedPostprocessor
    pp_names = 'core_p_in core_p_out'
    expression = 'core_p_in - core_p_out'
  []
  [hx_pri_T_out]
    type = SideAverageValue
    boundary = hx/pri:out
    variable = T
  []
  [hx_sec_T_in]
    type = SideAverageValue
    boundary = inlet_sec
    variable = T
  []
  [hx_sec_T_out]
    type = SideAverageValue
    boundary = outlet_sec
    variable = T
  []
  [m_dot_sec]
    type = ADFlowBoundaryFlux1Phase
    boundary = inlet_sec
    equation = mass
  []
  [Hw_hx_pri]
    type = ADElementAverageMaterialProperty
    mat_prop = Hw
    block = hx/pri
  []
  [fD_hx_pri]
    type = ADElementAverageMaterialProperty
    mat_prop = f_D
    block = hx/pri
  []
[]
[Preconditioning]
  [pc]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  start_time = 0
  [TimeStepper]
    type = IterationAdaptiveDT
    dt = 1
  []
  dtmax = 5
  end_time = 500
  line_search = basic
  solve_type = NEWTON
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-8
  nl_max_its = 25
[]
[Outputs]
  exodus = true
  [console]
    type = Console
    max_rows = 1
    outlier_variable_norms = false
  []
  print_linear_residuals = false
[]
(modules/combined/test/tests/optimization/compliance_sensitivity/paper_three_materials_test.i)
vol_frac = 0.4
cost_frac = 0.2 #0.283 # Change back to 0.4
power = 4
E0 = 1.0e-6
E1 = 0.2
E2 = 0.6
E3 = 1.0
rho0 = 1.0e-6
rho1 = 0.4
rho2 = 0.7
rho3 = 1.0
C0 = 1.0e-6
C1 = 0.5
C2 = 0.8
C3 = 1.0
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Mesh]
  [MeshGenerator]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 50
    ny = 50
    xmin = 0
    xmax = 50
    ymin = 0
    ymax = 50
  []
  [node]
    type = ExtraNodesetGenerator
    input = MeshGenerator
    new_boundary = hold
    nodes = 0
  []
  [push_left]
    type = ExtraNodesetGenerator
    input = node
    new_boundary = push_left
    coord = '25 0 0'
  []
  [push_center]
    type = ExtraNodesetGenerator
    input = push_left
    new_boundary = push_center
    coord = '50 0 0'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
[]
[AuxVariables]
  [Dc]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = -1.0
  []
  [Cc]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = -1.0
  []
  [Cost]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = -1.0
  []
  [mat_den]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = ${vol_frac}
  []
[]
[AuxKernels]
  [Cost]
    type = MaterialRealAux
    variable = Cost
    property = Cost_mat
  []
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    strain = SMALL
    add_variables = true
    incremental = false
  []
[]
[BCs]
  [no_y]
    type = DirichletBC
    variable = disp_y
    boundary = hold
    value = 0.0
  []
  [no_x_symm]
    type = DirichletBC
    variable = disp_x
    boundary = right
    value = 0.0
  []
[]
[NodalKernels]
  [push_left]
    type = NodalGravity
    variable = disp_y
    boundary = push_left
    gravity_value = -1e-3
    mass = 1
  []
  [push_center]
    type = NodalGravity
    variable = disp_y
    boundary = push_center
    gravity_value = -1e-3
    mass = 1
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeVariableIsotropicElasticityTensor
    youngs_modulus = E_phys
    poissons_ratio = poissons_ratio
    args = 'mat_den'
  []
  [E_phys]
    type = DerivativeParsedMaterial
    # ordered multimaterial simp
    expression = "A1:=(${E0}-${E1})/(${rho0}^${power}-${rho1}^${power}); "
                 "B1:=${E0}-A1*${rho0}^${power}; E1:=A1*mat_den^${power}+B1; "
                 "A2:=(${E1}-${E2})/(${rho1}^${power}-${rho2}^${power}); "
                 "B2:=${E1}-A2*${rho1}^${power}; E2:=A2*mat_den^${power}+B2; "
                 "A3:=(${E2}-${E3})/(${rho2}^${power}-${rho3}^${power}); "
                 "B3:=${E2}-A3*${rho2}^${power}; E3:=A3*mat_den^${power}+B3; "
                 "if(mat_den<${rho1},E1,if(mat_den<${rho2},E2,E3))"
    coupled_variables = 'mat_den'
    property_name = E_phys
    epsilon = 1e-12
  []
  [Cost_mat]
    type = DerivativeParsedMaterial
    # ordered multimaterial simp
    expression = "A1:=(${C0}-${C1})/(${rho0}^(1/${power})-${rho1}^(1/${power})); "
                 "B1:=${C0}-A1*${rho0}^(1/${power}); C1:=A1*mat_den^(1/${power})+B1; "
                 "A2:=(${C1}-${C2})/(${rho1}^(1/${power})-${rho2}^(1/${power})); "
                 "B2:=${C1}-A2*${rho1}^(1/${power}); C2:=A2*mat_den^(1/${power})+B2; "
                 "A3:=(${C2}-${C3})/(${rho2}^(1/${power})-${rho3}^(1/${power})); "
                 "B3:=${C2}-A3*${rho2}^(1/${power}); C3:=A3*mat_den^(1/${power})+B3; "
                 "if(mat_den<${rho1},C1,if(mat_den<${rho2},C2,C3))"
    coupled_variables = 'mat_den'
    property_name = Cost_mat
    epsilon = 1e-12
  []
  [CostDensity]
    type = ParsedMaterial
    property_name = CostDensity
    coupled_variables = 'mat_den Cost'
    expression = 'mat_den*Cost'
  []
  [poissons_ratio]
    type = GenericConstantMaterial
    prop_names = poissons_ratio
    prop_values = 0.3
  []
  [stress]
    type = ComputeLinearElasticStress
  []
  [dc]
    type = ComplianceSensitivity
    design_density = mat_den
    youngs_modulus = E_phys
  []
  [cc]
    type = CostSensitivity
    design_density = mat_den
    cost = Cost_mat
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[UserObjects]
  [rad_avg]
    type = RadialAverage
    radius = 2
    weights = linear
    prop_name = sensitivity
    execute_on = TIMESTEP_END
    force_preaux = true
  []
  [rad_avg_cost]
    type = RadialAverage
    radius = 2
    weights = linear
    prop_name = cost_sensitivity
    execute_on = TIMESTEP_END
    force_preaux = true
  []
  [update]
    type = DensityUpdateTwoConstraints
    # This is
    density_sensitivity = Dc
    cost_density_sensitivity = Cc
    cost = Cost
    cost_fraction = ${cost_frac}
    design_density = mat_den
    volume_fraction = ${vol_frac}
    bisection_lower_bound = 0
    bisection_upper_bound = 1.0e16 # 100
    relative_tolerance = 1.0e-3
    bisection_move = 0.02
    execute_on = TIMESTEP_BEGIN
  []
  # Provides Dc
  [calc_sense]
    type = SensitivityFilter
    density_sensitivity = Dc
    design_density = mat_den
    filter_UO = rad_avg
    execute_on = TIMESTEP_END
    force_postaux = true
  []
  # Provides Cc
  [calc_sense_cost]
    type = SensitivityFilter
    density_sensitivity = Cc
    design_density = mat_den
    filter_UO = rad_avg_cost
    execute_on = TIMESTEP_END
    force_postaux = true
  []
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu superlu_dist'
  nl_abs_tol = 1e-10
  dt = 1.0
  num_steps = 25
[]
[Outputs]
  [out]
    type = CSV
    execute_on = 'TIMESTEP_END'
  []
  print_linear_residuals = false
[]
[Postprocessors]
  [mesh_volume]
    type = VolumePostprocessor
    execute_on = 'initial timestep_end'
  []
  [total_vol]
    type = ElementIntegralVariablePostprocessor
    variable = mat_den
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [vol_frac]
    type = ParsedPostprocessor
    expression = 'total_vol / mesh_volume'
    pp_names = 'total_vol mesh_volume'
  []
  [sensitivity]
    type = ElementIntegralMaterialProperty
    mat_prop = sensitivity
  []
  [cost_sensitivity]
    type = ElementIntegralMaterialProperty
    mat_prop = cost_sensitivity
  []
  [cost]
    type = ElementIntegralMaterialProperty
    mat_prop = CostDensity
  []
  [cost_frac]
    type = ParsedPostprocessor
    expression = 'cost / mesh_volume'
    pp_names = 'cost mesh_volume'
  []
  [objective]
    type = ElementIntegralMaterialProperty
    mat_prop = strain_energy_density
    execute_on = 'INITIAL TIMESTEP_END'
  []
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/segregated/channel-drift-flux-physics.i)
mu = 1.0
rho = 10.0
mu_d = 0.1
rho_d = 1.0
l = 2
U = 1
dp = 0.01
inlet_phase_2 = 0.1
# 'average' leads to slight oscillations, upwind may be preferred
advected_interp_method = 'average'
# TODO remove need for those
cp = 1
k = 1
cp_d = 1
k_d = 1
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = '${fparse l * 5}'
    ymin = '${fparse -l / 2}'
    ymax = '${fparse l / 2}'
    nx = 10
    ny = 4
  []
  uniform_refine = 0
[]
[Problem]
  linear_sys_names = 'u_system v_system pressure_system phi_system'
[]
[Physics]
  [NavierStokes]
    [FlowSegregated]
      [flow]
        compressibility = 'incompressible'
        density = 'rho_mixture'
        dynamic_viscosity = 'mu_mixture'
        # Initial conditions
        initial_velocity = '${U} 0 0'
        initial_pressure = 0
        # Boundary conditions
        inlet_boundaries = 'left'
        momentum_inlet_types = 'fixed-velocity'
        momentum_inlet_functors = '${U} 0'
        wall_boundaries = 'top bottom'
        momentum_wall_types = 'noslip noslip'
        outlet_boundaries = 'right'
        momentum_outlet_types = 'fixed-pressure'
        pressure_functors = '0'
        # Friction is done in drift flux term
        friction_types = "Darcy"
        friction_coeffs = "Darcy_coefficient_vec"
        standard_friction_formulation = true
        momentum_advection_interpolation = '${advected_interp_method}'
        orthogonality_correction = false
        # To match reference better
        pressure_two_term_bc_expansion = true
        momentum_two_term_bc_expansion = true
      []
    []
    [TwoPhaseMixtureSegregated]
      [mixture]
        system_names = 'phi_system'
        phase_1_fraction_name = 'phase_1'
        phase_2_fraction_name = 'phase_2'
        # Phase transport equation
        add_phase_transport_equation = true
        alpha_exchange = 0.1
        phase_advection_interpolation = 'upwind'
        # see flow for inlet boundaries
        phase_fraction_inlet_type = 'fixed-value'
        phase_fraction_inlet_functors = '${inlet_phase_2}'
        # Drift flux parameters
        add_drift_flux_momentum_terms = true
        density_interp_method = 'average'
        # This has to be consistent with the friction model
        slip_linear_friction_name = 'Darcy_coefficient'
        # Base phase material properties
        phase_1_density_name = ${rho}
        phase_1_viscosity_name = ${mu}
        phase_1_specific_heat_name = ${cp}
        phase_1_thermal_conductivity_name = ${k}
        # Other phase material properties
        phase_2_density_name = ${rho_d}
        phase_2_viscosity_name = ${mu_d}
        phase_2_specific_heat_name = ${cp_d}
        phase_2_thermal_conductivity_name = ${k_d}
        output_all_properties = true
        # Friction model
        use_dispersed_phase_drag_model = true
        particle_diameter = ${dp}
        add_advection_slip_term = false
      []
    []
  []
[]
[Executioner]
  type = SIMPLE
  rhie_chow_user_object = 'ins_rhie_chow_interpolator'
  # Systems
  momentum_systems = 'u_system v_system'
  pressure_system = 'pressure_system'
  active_scalar_systems = 'phi_system'
  momentum_equation_relaxation = 0.8
  active_scalar_equation_relaxation = '0.7'
  pressure_variable_relaxation = 0.3
  # We need to converge the problem to show conservation
  num_iterations = 200
  pressure_absolute_tolerance = 1e-10
  momentum_absolute_tolerance = 1e-10
  active_scalar_absolute_tolerance = '1e-10'
  momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
  momentum_petsc_options_value = 'hypre boomeramg'
  pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
  pressure_petsc_options_value = 'hypre boomeramg'
  active_scalar_petsc_options_iname = '-pc_type -pc_hypre_type'
  active_scalar_petsc_options_value = 'hypre boomeramg'
  momentum_l_abs_tol = 1e-13
  pressure_l_abs_tol = 1e-13
  active_scalar_l_abs_tol = 1e-13
  momentum_l_tol = 0
  pressure_l_tol = 0
  active_scalar_l_tol = 0
  # print_fields = true
  continue_on_max_its = true
[]
[Outputs]
  print_linear_residuals = true
  print_nonlinear_residuals = true
  csv = true
  [out]
    type = Exodus
    hide = 'Re dp'
  []
  execute_on = 'INITIAL TIMESTEP_END'
[]
[Postprocessors]
  [Re]
    type = ParsedPostprocessor
    expression = '${rho} * ${l} * ${U}'
  []
  [dp]
    type = PressureDrop
    pressure = 'pressure'
    upstream_boundary = 'left'
    downstream_boundary = 'right'
    boundary = 'left right'
  []
  [average_phase2]
    type = ElementAverageValue
    variable = 'phase_2'
  []
  [max_phase2]
    type = ElementExtremeValue
    variable = 'phase_2'
  []
[]
(modules/electromagnetics/test/tests/auxkernels/heating/aux_current_source_heating.i)
# Test for SourceCurrentHeating
# Manufactured solution: E_real = cos(pi*y) * x_hat - cos(pi*x) * y_hat
#                        E_imag = sin(pi*y) * x_hat - sin(pi*x) * y_hat
#                        heating = 'sin(x*pi)*cos(x*pi) + sin(y*pi)*cos(y*pi)'
[Mesh]
  [gmg]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 5
    ny = 5
    xmin = -1
    ymin = -1
    elem_type = QUAD9
  []
[]
[Functions]
  #The exact solution for the heated species and electric field real and imag. component
  [exact_real]
    type = ParsedVectorFunction
    expression_x = 'cos(pi*y)'
    expression_y = '-cos(pi*x)'
  []
  [exact_imag]
    type = ParsedVectorFunction
    expression_x = 'sin(pi*y)'
    expression_y = '-sin(pi*x)'
  []
  #The forcing terms for the heated species and electric field real and imag. component
  [source_real]
    type = ParsedVectorFunction
    expression_x = '-2*cos(pi*y) + pi^2*cos(pi*y)'
    expression_y = '-pi^2*cos(pi*x) + 2*cos(pi*x)'
  []
  [source_imag]
    type = ParsedVectorFunction
    expression_x = 'pi^2*sin(pi*y)'
    expression_y = '-pi^2*sin(pi*x)'
  []
  [current_real]
    type = ParsedVectorFunction
    expression_x = 'sin(pi*y)'
    expression_y = '-sin(pi*x)'
  []
  [current_imag]
    type = ParsedVectorFunction
    expression_x = 'cos(pi*y)'
    expression_y = '-cos(pi*x)'
  []
  [heating_func]
    type = ParsedFunction
    expression = '1.0*sin(x*pi)*cos(x*pi) + 1.0*sin(y*pi)*cos(y*pi)'
  []
[]
[Materials]
  [WaveCoeff]
    type = WaveEquationCoefficient
    eps_rel_real = 1.0
    eps_rel_imag = 0.0
    k_real = 1.0
    k_imag = 0.0
    mu_rel_real = 1.0
    mu_rel_imag = 0.0
  []
[]
[Variables]
  [E_real]
    family = NEDELEC_ONE
    order = FIRST
  []
  [E_imag]
    family = NEDELEC_ONE
    order = FIRST
  []
[]
[Kernels]
  [curl_curl_real]
    type = CurlCurlField
    variable = E_real
  []
  [coeff_real]
    type = ADMatWaveReaction
    variable = E_real
    field_real =  E_real
    field_imag =  E_imag
    wave_coef_real = wave_equation_coefficient_real
    wave_coef_imag = wave_equation_coefficient_imaginary
    component = real
  []
  [current_real]
    type = VectorCurrentSource
    variable = E_real
    source_real = current_real
    source_imag = current_imag
    component = real
  []
  [body_force_real]
    type = VectorBodyForce
    variable = E_real
    function = source_real
  []
  [curl_curl_imag]
    type = CurlCurlField
    variable = E_imag
  []
  [coeff_imag]
    type = ADMatWaveReaction
    variable = E_imag
    field_real =  E_real
    field_imag =  E_imag
    wave_coef_real = wave_equation_coefficient_real
    wave_coef_imag = wave_equation_coefficient_imaginary
    component = imaginary
  []
  [current_imag]
    type = VectorCurrentSource
    variable = E_imag
    source_real = current_real
    source_imag = current_imag
    component = imaginary
  []
  [body_force_imag]
    type = VectorBodyForce
    variable = E_imag
    function = source_imag
  []
[]
[AuxVariables]
  [current_heating_term]
    family = MONOMIAL
    order = FIRST
  []
[]
[AuxKernels]
  [aux_current_heating]
    type = SourceCurrentHeating
    variable = current_heating_term
    E_real = E_real
    E_imag = E_imag
    source_real = current_real
    source_imag = current_imag
  []
[]
[BCs]
  [sides_real]
    type = VectorCurlPenaltyDirichletBC
    variable = E_real
    function = exact_real
    penalty = 1e8
    boundary = 'left right top bottom'
  []
  [sides_imag]
    type = VectorCurlPenaltyDirichletBC
    variable = E_imag
    function = exact_imag
    penalty = 1e8
    boundary = 'left right top bottom'
  []
[]
[Postprocessors]
  [error_real]
    type = ElementVectorL2Error
    variable = E_real
    function = exact_real
  []
  [error_imag]
    type = ElementVectorL2Error
    variable = E_imag
    function = exact_imag
  []
  [error_aux_heating]
    type = ElementL2Error
    variable = current_heating_term
    function = heating_func
  []
  [h]
    type = AverageElementSize
  []
  [h_squared]
    type = ParsedPostprocessor
    pp_names = 'h'
    expression = 'h * h'
  []
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-12
[]
[Outputs]
  exodus = true
  csv = true
[]
(modules/combined/test/tests/subchannel_thm_coupling/THM_SCM_coupling_pump.i)
# THM file based on https://mooseframework.inl.gov/modules/thermal_hydraulics/tutorials/single_phase_flow/step05.html
# Used to loosely couple THM with SCM
# This is a simple closed loop with a pump providing pressure head, core, pressurizer and HX.
# THM sends massflux and temperature at the inlet of the core, and pressure at the outlet of the core
# to subchannel. Subchannel returns total pressure drop of the assembly and total power to THM and THM calculates an
# average friction factor for the core region.
T_in = 583.0 # K
press = 2e5 # Pa
SC_core = 0.0004980799633447909 #m2
# core parameters
core_length = 1. # m
core_n_elems = 1
A_core = 0.005 #dummy
# pipe parameters
pipe_dia = '${units 10. cm -> m}'
A_pipe = '${fparse 0.25 * pi * pipe_dia^2}'
# heat exchanger parameters
hx_dia_inner = '${units 12. cm -> m}'
hx_wall_thickness = '${units 5. mm -> m}'
hx_dia_outer = '${units 50. cm -> m}'
hx_radius_wall = '${fparse hx_dia_inner / 2. + hx_wall_thickness}'
hx_length = 1.5 # m
hx_n_elems = 25
m_dot_sec_in = 1. # kg/s
[GlobalParams]
  initial_p = ${press}
  initial_vel = 0.0001
  initial_T = ${T_in}
  initial_vel_x = 0
  initial_vel_y = 0
  initial_vel_z = 0
  gravity_vector = '0 0 0'
  rdg_slope_reconstruction = minmod
  scaling_factor_1phase = '1 1e-2 1e-4'
  scaling_factor_rhoV = 1
  scaling_factor_rhouV = 1e-2
  scaling_factor_rhovV = 1e-2
  scaling_factor_rhowV = 1e-2
  scaling_factor_rhoEV = 1e-4
  closures = thm_closures
  fp = sodium_eos
[]
[Functions]
  [q_wall_fn]
    type = ParsedFunction
    symbol_names = 'core_power length'
    symbol_values = 'core_power  ${core_length}'
    expression = 'core_power/length'
  []
[]
[FluidProperties]
  [water]
    type = StiffenedGasFluidProperties
    gamma = 2.35
    cv = 1816.0
    q = -1.167e6
    p_inf = 1.0e9
    q_prime = 0
  []
  [sodium_eos]
    type = StiffenedGasFluidProperties
    gamma = 1.24
    cv = 1052.8
    q = -2.6292e+05
    p_inf = 1.1564e+08
    q_prime = 0
    mu = 3.222e-04
    k = 73.82
  []
[]
[Closures]
  [thm_closures]
    type = Closures1PhaseTHM
  []
  [none_closures]
    type = Closures1PhaseNone
  []
[]
[Materials]
  [f_mat]
    type = ADParsedMaterial
    property_name = f_D
    postprocessor_names = 'core_f'
    expression = 'core_f'
    block = 'core_chan'
  []
[]
[HeatStructureMaterials]
  [steel]
    type = SolidMaterialProperties
    rho = 8050
    k = 45
    cp = 466
  []
[]
[Components]
  [up_pipe_1]
    type = FlowChannel1Phase
    position = '0 0 -0.5'
    orientation = '0 0 1'
    length = 0.5
    n_elems = 15
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct1]
    type = JunctionParallelChannels1Phase
    position = '0 0 0'
    connections = 'up_pipe_1:out core_chan:in'
    volume = 1e-5
  []
  [core_chan]
    type = FlowChannel1Phase
    position = '0 0 0'
    orientation = '0 0 1'
    length = ${core_length}
    n_elems = ${core_n_elems}
    A = ${A_core}
    closures = none_closures
  []
  [core_ht]
    type = HeatTransferFromHeatFlux1Phase
    flow_channel = core_chan
    q_wall = q_wall_fn
    P_hf = 1
  []
  [jct2]
    type = JunctionParallelChannels1Phase
    position = '0 0 1'
    connections = 'core_chan:out up_pipe_2:in'
    volume = 1e-5
  []
  [up_pipe_2]
    type = FlowChannel1Phase
    position = '0 0 1'
    orientation = '0 0 1'
    length = 0.5
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct3]
    type = JunctionOneToOne1Phase
    connections = 'up_pipe_2:out top_pipe_1:in'
  []
  [top_pipe_1]
    type = FlowChannel1Phase
    position = '0 0 1.5'
    orientation = '1 0 0'
    length = 0.5
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [top_pipe_2]
    type = FlowChannel1Phase
    position = '0.5 0 1.5'
    orientation = '1 0 0'
    length = 0.5
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct4]
    type = VolumeJunction1Phase
    position = '0.5 0 1.5'
    volume = 1e-5
    connections = 'top_pipe_1:out top_pipe_2:in press_pipe:in'
  []
  [press_pipe]
    type = FlowChannel1Phase
    position = '0.5 0 1.5'
    orientation = '0 1 0'
    length = 0.2
    n_elems = 5
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [pressurizer]
    type = InletStagnationPressureTemperature1Phase
    p0 = ${press}
    T0 = 580
    input = press_pipe:out
  []
  [jct5]
    type = JunctionOneToOne1Phase
    connections = 'top_pipe_2:out down_pipe_1:in'
  []
  [down_pipe_1]
    type = FlowChannel1Phase
    position = '1 0 1.5'
    orientation = '0 0 -1'
    length = 0.25
    A = ${A_pipe}
    n_elems = 5
  []
  [jct6]
    type = JunctionParallelChannels1Phase
    position = '1 0 1.25'
    connections = 'down_pipe_1:out hx/pri:in'
    volume = 1e-5
  []
  [hx]
    [pri]
      type = FlowChannel1Phase
      position = '1 0 1.25'
      orientation = '0 0 -1'
      length = ${hx_length}
      n_elems = ${hx_n_elems}
      roughness = 1e-5
      A = '${fparse pi * hx_dia_inner * hx_dia_inner / 4.}'
      D_h = ${hx_dia_inner}
    []
    [ht_pri]
      type = HeatTransferFromHeatStructure1Phase
      hs = hx/wall
      hs_side = inner
      flow_channel = hx/pri
      P_hf = '${fparse pi * hx_dia_inner}'
    []
    [wall]
      type = HeatStructureCylindrical
      position = '1 0 1.25'
      orientation = '0 0 -1'
      length = ${hx_length}
      n_elems = ${hx_n_elems}
      widths = '${hx_wall_thickness}'
      n_part_elems = '3'
      materials = 'steel'
      names = '0'
      inner_radius = '${fparse hx_dia_inner / 2.}'
    []
    [ht_sec]
      type = HeatTransferFromHeatStructure1Phase
      hs = hx/wall
      hs_side = outer
      flow_channel = hx/sec
      P_hf = '${fparse 2 * pi * hx_radius_wall}'
    []
    [sec]
      type = FlowChannel1Phase
      position = '${fparse 1 + hx_wall_thickness} 0 -0.25'
      orientation = '0 0 1'
      length = ${hx_length}
      n_elems = ${hx_n_elems}
      A = '${fparse pi * (hx_dia_outer * hx_dia_outer / 4. - hx_radius_wall * hx_radius_wall)}'
      D_h = '${fparse hx_dia_outer - (2 * hx_radius_wall)}'
      fp = water
      initial_T = 300
    []
  []
  [jct7]
    type = JunctionParallelChannels1Phase
    position = '1 0 -0.25'
    connections = 'hx/pri:out down_pipe_2:in'
    volume = 1e-5
  []
  [down_pipe_2]
    type = FlowChannel1Phase
    position = '1 0 -0.25'
    orientation = '0 0 -1'
    length = 0.25
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct8]
    type = JunctionOneToOne1Phase
    connections = 'down_pipe_2:out bottom_1:in'
  []
  [bottom_1]
    type = FlowChannel1Phase
    position = '1 0 -0.5'
    orientation = '-1 0 0'
    length = 0.5
    n_elems = 5
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [pump]
    type = Pump1Phase
    position = '0.5 0 -0.5'
    connections = 'bottom_1:out bottom_2:in'
    volume = 1e-4
    A_ref = ${A_pipe}
    head = 3.56
  []
  [bottom_2]
    type = FlowChannel1Phase
    position = '0.5 0 -0.5'
    orientation = '-1 0 0'
    length = 0.5
    n_elems = 5
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct9]
    type = JunctionOneToOne1Phase
    connections = 'bottom_2:out up_pipe_1:in'
  []
  [inlet_sec]
    type = InletMassFlowRateTemperature1Phase
    input = 'hx/sec:in'
    m_dot = ${m_dot_sec_in}
    T = 300
  []
  [outlet_sec]
    type = Outlet1Phase
    input = 'hx/sec:out'
    p = 1e5
  []
[]
[Postprocessors]
  [power_to_coolant]
    type = ADHeatRateDirectFlowChannel
    q_wall_prop = q_wall
    block = core_chan
    P_hf = 1
  []
  [core_T_out]
    type = SideAverageValue
    boundary = core_chan:out
    variable = T
  []
  [T_out]
    type = SideAverageValue
    boundary = bottom_1:out
    variable = T
  []
  [core_p_in]
    type = SideAverageValue
    boundary = up_pipe_1:out
    variable = p
  []
  [core_p_out]
    type = SideAverageValue
    boundary = up_pipe_2:in
    variable = p
  []
  [core_delta_p]
    type = ParsedPostprocessor
    pp_names = 'core_p_in core_p_out'
    expression = 'core_p_in - core_p_out'
  []
  [hx_pri_T_out]
    type = SideAverageValue
    boundary = hx/pri:out
    variable = T
  []
  [hx_sec_T_in]
    type = SideAverageValue
    boundary = inlet_sec
    variable = T
  []
  [hx_sec_T_out]
    type = SideAverageValue
    boundary = outlet_sec
    variable = T
  []
  [m_dot_sec]
    type = ADFlowBoundaryFlux1Phase
    boundary = inlet_sec
    equation = mass
  []
  ############## Friction Factor Calculation #############
  [av_rhouA]
    type = ElementAverageValue
    variable = 'rhouA'
    block = 'core_chan'
  []
  [av_rho]
    type = ElementAverageValue
    variable = 'rho'
    block = 'core_chan'
  []
  [Kloss]
    type = ParsedPostprocessor
    pp_names = 'core_delta_p_tgt av_rhouA av_rho'
    expression = '2.0 * core_delta_p_tgt * av_rho * ${A_core} * ${A_core} / (av_rhouA * av_rhouA)'
  []
  [Dh]
    type = ADElementAverageMaterialProperty
    mat_prop = D_h
    block = core_chan
  []
  [core_f]
    type = ParsedPostprocessor
    pp_names = 'Kloss Dh'
    expression = 'Kloss * Dh / ${core_length}'
  []
  ### INFO to send to SC
  [outlet_pressure]
    type = SideAverageValue
    boundary = up_pipe_2:in
    variable = p
  []
  [inlet_mass_flow_rate]
    type = ADFlowJunctionFlux1Phase
    boundary = up_pipe_1:out
    connection_index = 0
    equation = mass
    junction = jct1
  []
  [inlet_temperature]
    type = SideAverageValue
    boundary = up_pipe_1:out
    variable = T
  []
  [inlet_mass_flux]
    type = ParsedPostprocessor
    pp_names = 'inlet_mass_flow_rate'
    expression = 'abs(inlet_mass_flow_rate/${SC_core})'
  []
  #####
  ##### Info received from subchannel
  [core_delta_p_tgt]
    type = Receiver
    default = 100
  []
  [core_power]
    type = Receiver
    default = 100
  []
[]
[Preconditioning]
  [pc]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  start_time = 0
  [TimeStepper]
    type = IterationAdaptiveDT
    dt = 2
  []
  dtmax = 50
  end_time = 10
  line_search = basic
  solve_type = NEWTON
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-7
  nl_abs_tol = 1e-7
  nl_max_its = 25
  fixed_point_min_its = 1
  fixed_point_max_its = 5
  accept_on_max_fixed_point_iteration = true
  auto_advance = true
  relaxation_factor = 0.5
[]
[Outputs]
  csv = true
  [console]
    type = Console
    max_rows = 1
    outlier_variable_norms = false
  []
  print_linear_residuals = false
[]
################################################################################
# A multiapp that couples THM to subchannel
################################################################################
[MultiApps]
  # active = ''
  [subchannel]
    type = FullSolveMultiApp
    input_files = 'subchannel.i'
    execute_on = 'timestep_end'
    positions = '0 0 0'
    max_procs_per_app = 1
    output_in_position = true
    bounding_box_padding = '0 0 0.1'
  []
[]
[Transfers]
  # active = ''
  [pressure_drop_transfer] # Get pressure drop to THM from subchannel
    type = MultiAppPostprocessorTransfer
    from_multi_app = subchannel
    from_postprocessor = total_pressure_drop_SC
    to_postprocessor = core_delta_p_tgt
    reduction_type = average
    execute_on = 'timestep_end'
  []
  [power_transfer] # Get Total power to THM from subchannel
    type = MultiAppPostprocessorTransfer
    from_multi_app = subchannel
    from_postprocessor = Total_power
    to_postprocessor = core_power
    reduction_type = average
    execute_on = 'timestep_end'
  []
  [mass_flux_tranfer] # Send mass_flux at the inlet of THM core to subchannel
    type = MultiAppPostprocessorTransfer
    to_multi_app = subchannel
    from_postprocessor = inlet_mass_flux
    to_postprocessor = report_mass_flux_inlet
    execute_on = 'timestep_end'
  []
  [outlet_pressure_tranfer] # Send pressure at the outlet of THM core to subchannel
    type = MultiAppPostprocessorTransfer
    to_multi_app = subchannel
    from_postprocessor = outlet_pressure
    to_postprocessor = report_pressure_outlet
    execute_on = 'timestep_end'
  []
  [inlet_temperature_transfer]
    type = MultiAppPostprocessorTransfer
    to_multi_app = subchannel
    from_postprocessor = inlet_temperature
    to_postprocessor = report_temperature_inlet
    execute_on = 'timestep_end'
  []
[]
(modules/heat_transfer/test/tests/gap_heat_transfer_mortar/gap_heat_transfer_sphere3D.i)
sphere_outer_htc = 10 # W/m^2/K
sphere_outer_Tinf = 300 # K
[GlobalParams]
  order = SECOND
  family = LAGRANGE
[]
[Mesh]
  file = sphere3D.e
[]
[Functions]
  [temp]
    type = PiecewiseLinear
    x = '0   1'
    y = '100 200'
  []
[]
[Variables]
  [temp]
    initial_condition = 500
  []
[]
[AuxVariables]
  [gap_conductance]
    order = CONSTANT
    family = MONOMIAL
  []
  [power_density]
    block = 'fuel'
    initial_condition = 50e3
  []
[]
[Kernels]
  [heat_conduction]
    type = HeatConduction
    variable = temp
  []
  [heat_source]
    type = CoupledForce
    variable = temp
    block = 'fuel'
    v = power_density
  []
[]
[AuxKernels]
  [gap_cond]
    type = MaterialRealAux
    property = gap_conductance
    variable = gap_conductance
    boundary = 2
  []
[]
[Materials]
  [heat1]
    type = HeatConductionMaterial
    block = '1 2'
    specific_heat = 1.0
    thermal_conductivity = 34.6
  []
[]
[ThermalContact]
  [thermal_contact]
    type = GapHeatTransfer
    variable = temp
    primary = 3
    secondary = 2
    emissivity_primary = 0
    emissivity_secondary = 0
    gap_conductivity = 5
    gap_geometry_type = SPHERE
    sphere_origin = '0 0 0'
  []
[]
[BCs]
  [RPV_out_BC] # k \nabla T = h (T- T_inf) at RPV outer boundary
    type = ConvectiveFluxFunction # (Robin BC)
    variable = temp
    boundary = '4' # outer RPV
    coefficient = ${sphere_outer_htc}
    T_infinity = ${sphere_outer_Tinf}
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu       superlu_dist'
  dt = 1
  dtmin = 0.01
  end_time = 1
  nl_rel_tol = 1e-12
  nl_abs_tol = 1e-7
  [Quadrature]
    order = fifth
    side_order = seventh
  []
[]
[Outputs]
  exodus = true
  csv = true
  [Console]
    type = Console
  []
[]
[Postprocessors]
  [temp_left]
    type = SideAverageValue
    boundary = 2
    variable = temp
  []
  [temp_right]
    type = SideAverageValue
    boundary = 3
    variable = temp
  []
  [flux_left]
    type = SideDiffusiveFluxIntegral
    variable = temp
    boundary = 2
    diffusivity = thermal_conductivity
  []
  [flux_right]
    type = SideDiffusiveFluxIntegral
    variable = temp
    boundary = 3
    diffusivity = thermal_conductivity
  []
  [ptot]
    type = ElementIntegralVariablePostprocessor
    variable = power_density
    block = 'fuel'
  []
  [sphere_convective_out]
    type = ConvectiveHeatTransferSideIntegral
    T_solid = temp
    boundary = '4' # outer RVP
    T_fluid = ${sphere_outer_Tinf}
    htc = ${sphere_outer_htc}
  []
  [heat_balance] # should be equal to 0 upon convergence
    type = ParsedPostprocessor
    expression = '(sphere_convective_out - ptot) / ptot'
    pp_names = 'sphere_convective_out ptot'
  []
[]
[VectorPostprocessors]
  [NodalTemperature]
    type = NodalValueSampler
    sort_by = id
    boundary = '2 3'
    variable = temp
  []
[]
(modules/navier_stokes/test/tests/finite_element/ins/energy-conservation/q1q1.i)
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    nx = 10
    ny = 10
    dim = 2
  []
  [subdomain]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '0.5 0 0'
    top_right = '1 1 0'
    block_id = 1
    input = gen
  []
  [break_boundary]
    input = subdomain
    type = BreakBoundaryOnSubdomainGenerator
    boundaries = 'bottom top'
  []
  [sideset]
    type = SideSetsBetweenSubdomainsGenerator
    input = break_boundary
    primary_block = '1'
    paired_block = '0'
    new_boundary = 'fluid_left'
  []
  coord_type = RZ
[]
[Variables]
  [T][]
  [velocity]
    family = LAGRANGE_VEC
    block = 1
  []
  [pressure]
    block = 1
  []
[]
[Kernels]
  [mass]
    type = INSADMass
    variable = pressure
    block = 1
  []
  [pspg]
    type = INSADMassPSPG
    variable = pressure
    block = 1
  []
  [momentum_convection]
    type = INSADMomentumAdvection
    variable = velocity
    block = 1
  []
  [momentum_viscous]
    type = INSADMomentumViscous
    variable = velocity
    block = 1
  []
  [momentum_pressure]
    type = INSADMomentumPressure
    variable = velocity
    pressure = pressure
    integrate_p_by_parts = true
    block = 1
  []
  [momentum_supg]
    type = INSADMomentumSUPG
    variable = velocity
    velocity = velocity
    block = 1
  []
  [temperature_advection]
    type = INSADEnergyAdvection
    variable = T
     block = 1
  []
  [temperature_supg]
    type = INSADEnergySUPG
    variable = T
    velocity = velocity
    block = 1
  []
  [temperature_conduction]
    type = ADHeatConduction
    variable = T
    thermal_conductivity = 'k'
  []
  [heat_source]
    type = BodyForce
    variable = T
    block = 0
    function = 'x + y'
  []
[]
[BCs]
  [velocity_inlet]
    type = VectorFunctionDirichletBC
    variable = velocity
    function_y = 1
    boundary = 'bottom_to_1'
  []
  [wall]
    type = VectorFunctionDirichletBC
    variable = velocity
    boundary = 'fluid_left right'
  []
  [convective_heat_transfer]
    type = ConvectiveHeatFluxBC
    variable = T
    T_infinity = 0
    heat_transfer_coefficient = 1
    boundary = 'right'
  []
[]
[Materials]
  [constant]
    type = ADGenericConstantMaterial
    prop_names = 'cp rho k mu'
    prop_values = '1 1   1 1'
  []
  [ins]
    type = INSADStabilized3Eqn
    pressure = pressure
    velocity = velocity
    temperature = T
    block = 1
  []
[]
[Executioner]
  type = Steady
  solve_type = NEWTON
  petsc_options_iname = '-pc_type -pc_factor_shift_type'
  petsc_options_value = 'lu       NONZERO'
[]
[Outputs]
  csv = true
[]
[Postprocessors]
  [convective_heat_transfer]
    type = ConvectiveHeatTransferSideIntegral
    T_solid = T
    T_fluid = 0
    htc = 1
    boundary = 'right'
  []
  [advection]
    type = INSADElementIntegralEnergyAdvection
    temperature = T
    velocity = velocity
    cp = cp
    rho = rho
    block = 1
  []
  [source]
    type = FunctionElementIntegral
    function = 'x + y'
    block = 0
  []
  [energy_balance]
    type = ParsedPostprocessor
    expression = 'convective_heat_transfer + advection - source'
    pp_names = 'convective_heat_transfer advection source'
  []
[]
(modules/thermal_hydraulics/test/tests/problems/brayton_cycle/open_brayton_cycle.i)
# This input file is used to demonstrate a simple open-air Brayton cycle using
# a compressor, turbine, shaft, motor, and generator.
# The flow length is divided into 5 segments as illustrated below, where
#   - "(I)" denotes the inlet
#   - "(C)" denotes the compressor
#   - "(T)" denotes the turbine
#   - "(O)" denotes the outlet
#   - "*" denotes a fictitious junction
#
#                  Heated section
# (I)-----(C)-----*--------------*-----(T)-----(O)
#      1       2         3          4       5
#
# Initially the fluid is at rest at ambient conditions, the shaft speed is zero,
# and no heat transfer occurs with the system.
# The transient is controlled as follows:
#   * 0   - 100 s: motor ramps up torque linearly from zero
#   * 100 - 200 s: motor ramps down torque linearly to zero, HTC ramps up linearly from zero.
#   * 200 - 300 s: (no changes; should approach steady condition)
I_motor = 1.0
motor_torque_max = 400.0
I_generator = 1.0
generator_torque_per_shaft_speed = -0.00025
motor_ramp_up_duration = 100.0
motor_ramp_down_duration = 100.0
post_motor_time = 100.0
t1 = ${motor_ramp_up_duration}
t2 = ${fparse t1 + motor_ramp_down_duration}
t3 = ${fparse t2 + post_motor_time}
D1 = 0.15
D2 = ${D1}
D3 = ${D1}
D4 = ${D1}
D5 = ${D1}
A1 = ${fparse 0.25 * pi * D1^2}
A2 = ${fparse 0.25 * pi * D2^2}
A3 = ${fparse 0.25 * pi * D3^2}
A4 = ${fparse 0.25 * pi * D4^2}
A5 = ${fparse 0.25 * pi * D5^2}
L1 = 10.0
L2 = ${L1}
L3 = ${L1}
L4 = ${L1}
L5 = ${L1}
x1 = 0.0
x2 = ${fparse x1 + L1}
x3 = ${fparse x2 + L2}
x4 = ${fparse x3 + L3}
x5 = ${fparse x4 + L4}
x2_minus = ${fparse x2 - 0.001}
x2_plus = ${fparse x2 + 0.001}
x5_minus = ${fparse x5 - 0.001}
x5_plus = ${fparse x5 + 0.001}
n_elems1 = 10
n_elems2 = ${n_elems1}
n_elems3 = ${n_elems1}
n_elems4 = ${n_elems1}
n_elems5 = ${n_elems1}
A_ref_comp = ${fparse 0.5 * (A1 + A2)}
V_comp = ${fparse A_ref_comp * 1.0}
I_comp = 1.0
A_ref_turb = ${fparse 0.5 * (A4 + A5)}
V_turb = ${fparse A_ref_turb * 1.0}
I_turb = 1.0
c0_rated_comp = 351.6925137
rho0_rated_comp = 1.146881112
rated_mfr = 0.25
speed_rated_rpm = 96000
speed_rated = ${fparse speed_rated_rpm * 2 * pi / 60.0}
speed_initial = 0
eff_comp = 0.79
eff_turb = 0.843
T_hot = 1000
T_ambient = 300
p_ambient = 1e5
[GlobalParams]
  orientation = '1 0 0'
  gravity_vector = '0 0 0'
  initial_p = ${p_ambient}
  initial_T = ${T_ambient}
  initial_vel = 0
  initial_vel_x = 0
  initial_vel_y = 0
  initial_vel_z = 0
  fp = fp_air
  closures = closures
  f = 0
  scaling_factor_1phase = '1 1 1e-5'
  scaling_factor_rhoV = 1
  scaling_factor_rhouV = 1
  scaling_factor_rhovV = 1
  scaling_factor_rhowV = 1
  scaling_factor_rhoEV = 1e-5
  rdg_slope_reconstruction = none
[]
[Functions]
  [motor_torque_fn]
    type = PiecewiseLinear
    x = '0 ${t1} ${t2}'
    y = '0 ${motor_torque_max} 0'
  []
  [motor_power_fn]
    type = ParsedFunction
    expression = 'torque * speed'
    symbol_names = 'torque speed'
    symbol_values = 'motor_torque shaft:omega'
  []
  [generator_torque_fn]
    type = ParsedFunction
    expression = 'slope * t'
    symbol_names = 'slope'
    symbol_values = '${generator_torque_per_shaft_speed}'
  []
  [generator_power_fn]
    type = ParsedFunction
    expression = 'torque * speed'
    symbol_names = 'torque speed'
    symbol_values = 'generator_torque shaft:omega'
  []
  [htc_wall_fn]
    type = PiecewiseLinear
    x = '0 ${t1} ${t2}'
    y = '0 0 1e3'
  []
[]
[FluidProperties]
  [fp_air]
    type = IdealGasFluidProperties
    emit_on_nan = none
  []
[]
[Closures]
  [closures]
    type = Closures1PhaseSimple
  []
[]
[Components]
  [shaft]
    type = Shaft
    connected_components = 'motor compressor turbine generator'
    initial_speed = ${speed_initial}
  []
  [motor]
    type = ShaftConnectedMotor
    inertia = ${I_motor}
    torque = 0 # controlled
  []
  [generator]
    type = ShaftConnectedMotor
    inertia = ${I_generator}
    torque = generator_torque_fn
  []
  [inlet]
    type = InletStagnationPressureTemperature1Phase
    input = 'pipe1:in'
    p0 = ${p_ambient}
    T0 = ${T_ambient}
  []
  [pipe1]
    type = FlowChannel1Phase
    position = '${x1} 0 0'
    length = ${L1}
    n_elems = ${n_elems1}
    A = ${A1}
  []
  [compressor]
    type = ShaftConnectedCompressor1Phase
    position = '${x2} 0 0'
    inlet = 'pipe1:out'
    outlet = 'pipe2:in'
    A_ref = ${A_ref_comp}
    volume = ${V_comp}
    omega_rated = ${speed_rated}
    mdot_rated = ${rated_mfr}
    c0_rated = ${c0_rated_comp}
    rho0_rated = ${rho0_rated_comp}
    speeds = '0.5208 0.6250 0.7292 0.8333 0.9375'
    Rp_functions = 'rp_comp1 rp_comp2 rp_comp3 rp_comp4 rp_comp5'
    eff_functions = 'eff_comp1 eff_comp2 eff_comp3 eff_comp4 eff_comp5'
    min_pressure_ratio = 1.0
    speed_cr_I = 0
    inertia_const = ${I_comp}
    inertia_coeff = '${I_comp} 0 0 0'
    # assume no shaft friction
    speed_cr_fr = 0
    tau_fr_const = 0
    tau_fr_coeff = '0 0 0 0'
  []
  [pipe2]
    type = FlowChannel1Phase
    position = '${x2} 0 0'
    length = ${L2}
    n_elems = ${n_elems2}
    A = ${A2}
  []
  [junction2_3]
    type = JunctionOneToOne1Phase
    connections = 'pipe2:out pipe3:in'
  []
  [pipe3]
    type = FlowChannel1Phase
    position = '${x3} 0 0'
    length = ${L3}
    n_elems = ${n_elems3}
    A = ${A3}
  []
  [junction3_4]
    type = JunctionOneToOne1Phase
    connections = 'pipe3:out pipe4:in'
  []
  [pipe4]
    type = FlowChannel1Phase
    position = '${x4} 0 0'
    length = ${L4}
    n_elems = ${n_elems4}
    A = ${A4}
  []
  [turbine]
    type = ShaftConnectedCompressor1Phase
    position = '${x5} 0 0'
    inlet = 'pipe4:out'
    outlet = 'pipe5:in'
    A_ref = ${A_ref_turb}
    volume = ${V_turb}
    treat_as_turbine = true
    omega_rated = ${speed_rated}
    mdot_rated = ${rated_mfr}
    c0_rated = ${c0_rated_comp}
    rho0_rated = ${rho0_rated_comp}
    speeds = '0 0.5208 0.6250 0.7292 0.8333 0.9375'
    Rp_functions = 'rp_turb0 rp_turb1 rp_turb2 rp_turb3 rp_turb4 rp_turb5'
    eff_functions = 'eff_turb1 eff_turb1 eff_turb2 eff_turb3 eff_turb4 eff_turb5'
    min_pressure_ratio = 1.0
    speed_cr_I = 0
    inertia_const = ${I_turb}
    inertia_coeff = '${I_turb} 0 0 0'
    # assume no shaft friction
    speed_cr_fr = 0
    tau_fr_const = 0
    tau_fr_coeff = '0 0 0 0'
  []
  [pipe5]
    type = FlowChannel1Phase
    position = '${x5} 0 0'
    length = ${L5}
    n_elems = ${n_elems5}
    A = ${A5}
  []
  [outlet]
    type = Outlet1Phase
    input = 'pipe5:out'
    p = ${p_ambient}
  []
  [heating]
    type = HeatTransferFromSpecifiedTemperature1Phase
    flow_channel = pipe3
    T_wall = ${T_hot}
    Hw = htc_wall_fn
  []
[]
[ControlLogic]
  [motor_ctrl]
    type = TimeFunctionComponentControl
    component = motor
    parameter = torque
    function = motor_torque_fn
  []
[]
[Postprocessors]
  [heating_rate]
    type = ADHeatRateConvection1Phase
    block = 'pipe3'
    T = T
    T_wall = T_wall
    Hw = Hw
    P_hf = P_hf
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [motor_torque]
    type = RealComponentParameterValuePostprocessor
    component = motor
    parameter = torque
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [motor_power]
    type = FunctionValuePostprocessor
    function = motor_power_fn
    execute_on = 'INITIAL TIMESTEP_END'
    indirect_dependencies = 'motor_torque shaft:omega'
  []
  [generator_torque]
    type = ShaftConnectedComponentPostprocessor
    quantity = torque
    shaft_connected_component_uo = generator:shaftconnected_uo
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [generator_power]
    type = FunctionValuePostprocessor
    function = generator_power_fn
    execute_on = 'INITIAL TIMESTEP_END'
    indirect_dependencies = 'generator_torque shaft:omega'
  []
  [shaft_speed]
    type = ScalarVariable
    variable = 'shaft:omega'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [p_in_comp]
    type = PointValue
    variable = p
    point = '${x2_minus} 0 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [p_out_comp]
    type = PointValue
    variable = p
    point = '${x2_plus} 0 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [p_ratio_comp]
    type = ParsedPostprocessor
    pp_names = 'p_in_comp p_out_comp'
    expression = 'p_out_comp / p_in_comp'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [p_in_turb]
    type = PointValue
    variable = p
    point = '${x5_minus} 0 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [p_out_turb]
    type = PointValue
    variable = p
    point = '${x5_plus} 0 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [p_ratio_turb]
    type = ParsedPostprocessor
    pp_names = 'p_in_turb p_out_turb'
    expression = 'p_in_turb / p_out_turb'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [mfr_comp]
    type = ADFlowJunctionFlux1Phase
    boundary = pipe1:out
    connection_index = 0
    equation = mass
    junction = compressor
  []
  [mfr_turb]
    type = ADFlowJunctionFlux1Phase
    boundary = pipe4:out
    connection_index = 0
    equation = mass
    junction = turbine
  []
[]
[Preconditioning]
  [pc]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  scheme = 'bdf2'
  end_time = ${t3}
  dt = 0.1
  abort_on_solve_fail = true
  solve_type = NEWTON
  nl_rel_tol = 1e-50
  nl_abs_tol = 1e-11
  nl_max_its = 15
  l_tol = 1e-4
  l_max_its = 10
[]
[Outputs]
  [csv]
    type = CSV
    file_base = 'open_brayton_cycle'
    execute_vector_postprocessors_on = 'INITIAL'
  []
  [console]
    type = Console
    show = 'shaft_speed p_ratio_comp p_ratio_turb compressor:pressure_ratio turbine:pressure_ratio'
  []
[]
[Functions]
  # compressor pressure ratio
  [rp_comp1]
    type = PiecewiseLinear
    data_file = 'rp_comp1.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_comp2]
    type = PiecewiseLinear
    data_file = 'rp_comp2.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_comp3]
    type = PiecewiseLinear
    data_file = 'rp_comp3.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_comp4]
    type = PiecewiseLinear
    data_file = 'rp_comp4.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_comp5]
    type = PiecewiseLinear
    data_file = 'rp_comp5.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  # compressor efficiency
  [eff_comp1]
    type = ConstantFunction
    value = ${eff_comp}
  []
  [eff_comp2]
    type = ConstantFunction
    value = ${eff_comp}
  []
  [eff_comp3]
    type = ConstantFunction
    value = ${eff_comp}
  []
  [eff_comp4]
    type = ConstantFunction
    value = ${eff_comp}
  []
  [eff_comp5]
    type = ConstantFunction
    value = ${eff_comp}
  []
  # turbine pressure ratio
  [rp_turb0]
    type = ConstantFunction
    value = 1
  []
  [rp_turb1]
    type = PiecewiseLinear
    data_file = 'rp_turb1.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_turb2]
    type = PiecewiseLinear
    data_file = 'rp_turb2.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_turb3]
    type = PiecewiseLinear
    data_file = 'rp_turb3.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_turb4]
    type = PiecewiseLinear
    data_file = 'rp_turb4.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_turb5]
    type = PiecewiseLinear
    data_file = 'rp_turb5.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  # turbine efficiency
  [eff_turb1]
    type = ConstantFunction
    value = ${eff_turb}
  []
  [eff_turb2]
    type = ConstantFunction
    value = ${eff_turb}
  []
  [eff_turb3]
    type = ConstantFunction
    value = ${eff_turb}
  []
  [eff_turb4]
    type = ConstantFunction
    value = ${eff_turb}
  []
  [eff_turb5]
    type = ConstantFunction
    value = ${eff_turb}
  []
[]
(modules/heat_transfer/test/tests/fvbcs/fv_marshak_bc/rad_istothermal_medium_1d.i)
# The test gurantees that Marshak BCs yield the expected constant 1D solution
diffusion_coef = 1e-12
opacity = 1.0
temperature_radiation = 100.0
wall_temperature = ${fparse temperature_radiation / (4^(1/4))}
G_bc = 1.0
sigma = 5.670374419e-8
[Mesh]
  [mesh]
    type = GeneratedMeshGenerator
    dim = 1
    nx = 50
  []
[]
[Variables]
  [G]
    type = MooseVariableFVReal
    initial_condition = 1
  []
[]
[FVKernels]
  [G_diffusion]
    type = FVDiffusion
    variable = G
    coeff = ${diffusion_coef}
  []
  [source_and_sink]
    type = FVThermalRadiationSourceSink
    variable = G
    temperature_radiation = ${temperature_radiation}
    opacity = ${opacity}
  []
[]
[FVBCs]
  [right_bc]
    type = FVMarshakRadiativeBC
    boundary = 'right'
    variable = G
    temperature_radiation = ${wall_temperature}
    coeff_diffusion = ${diffusion_coef}
    boundary_emissivity = 1.0
  []
[]
[Functions]
  [analytical_sol]
    type = ParsedFunction
    symbol_names = 'a'
    symbol_values = '${fparse sqrt(opacity / diffusion_coef)}'
    expression = '${G_bc} * cosh(a*x) / cosh(a) + ${sigma} * ${temperature_radiation}^4 * (1.0 - cosh(a*x) / cosh(a))'
  []
[]
[Postprocessors]
  [mean_value]
    type = ElementIntegralFunctorPostprocessor
    functor = G
  []
  [max_value]
    type = ElementExtremeFunctorValue
    functor = G
  []
  [relative_difference]
    type = ParsedPostprocessor
    pp_names = 'mean_value max_value'
    expression = '(max_value / mean_value - 1.0) / mean_value'
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -pc_factor_shift_type'
  petsc_options_value = 'lu NONZERO'
  nl_abs_tol = 1e-12
[]
[Outputs]
  exodus = false
  csv = true
[]
(test/tests/convergence/reference_residual_convergence/abs_ref.i)
[Mesh]
  type = GeneratedMesh
  dim = 1
  nx = 10
[]
[GlobalParams]
  absolute_value_vector_tags = 'absref'
[]
[Problem]
  extra_tag_vectors = 'absref'
[]
[Variables]
  [u][]
  [v]
    scaling = 1e-6
  []
[]
[Functions]
  [ramp]
    type = ParsedFunction
    expression = 'if(t < 5, t - 5, 0) * x'
  []
[]
[Kernels]
  [u_dt]
    type = TimeDerivative
    variable = u
  []
  [u_coupled_rx]
    type = CoupledForce
    variable = u
    v = v
    coef = 1
  []
  [v_dt]
    type = TimeDerivative
    variable = v
  []
  [v_neg_force]
    type = BodyForce
    variable = v
    value = ${fparse -1 / 2}
    function = ramp
  []
  [v_force]
    type = BodyForce
    variable = v
    value = 1
    function = ramp
  []
[]
[Postprocessors]
  [u_avg]
    type = ElementAverageValue
    variable = u
    execute_on = 'TIMESTEP_END INITIAL'
  []
  [v_avg]
    type = ElementAverageValue
    variable = v
    execute_on = 'TIMESTEP_END INITIAL'
  []
  [timestep]
    type = TimePostprocessor
    outputs = 'none'
  []
  [v_old]
    type = ElementAverageValue
    variable = v
    execute_on = TIMESTEP_BEGIN
    outputs = none
  []
  [u_old]
    type = ElementAverageValue
    variable = u
    execute_on = TIMESTEP_BEGIN
    outputs = none
  []
  [v_exact]
    type = ParsedPostprocessor
    pp_names = 'timestep v_old'
    expression = 't := if(timestep > 5, 5, timestep); (t^2 - 9 * t) / 8'
  []
  [u_exact]
    type = ParsedPostprocessor
    pp_names = 'u_old v_exact'
    expression = 'u_old + v_exact'
  []
[]
[Convergence]
  [conv]
    type = ReferenceResidualConvergence
    reference_vector = 'absref'
  []
[]
[Executioner]
  type = Transient
  petsc_options = '-snes_converged_reason'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  line_search = none
  num_steps = 10
  nl_rel_tol = 1e-06
  nonlinear_convergence = conv
  verbose = true
[]
[Outputs]
  csv = true
[]
(modules/optimization/test/tests/vectorpostprocessors/element_reaction_inner_product/element_reaction_inner_product.i)
[Mesh]
  [gmg]
    type = GeneratedMeshGenerator
    dim = 1
    nx = 10
  []
[]
[AuxVariables]
  [u]
  []
  [v]
    initial_condition = 1
  []
  [dp1]
  []
  [dp2]
  []
[]
p1 = 3.14
p2 = 2.72
[Reporters]
  [params]
    type = ConstantReporter
    real_vector_names = 'p'
    real_vector_values = '${p1} ${p2}'
  []
[]
[Functions]
  [p_fun]
    type = ParsedOptimizationFunction
    expression = 'p_1*x + p_2*p_2'
    param_symbol_names = 'p_1 p_2'
    param_vector_name = params/p
  []
  [u_fun]
    type = ParsedFunction
    expression = 'x'
  []
  [dp1_fun]
    type = ParsedFunction
    expression = 'x'
    symbol_names = 'p_1 p_2'
    symbol_values = '${p1} ${p2}'
  []
  [dp2_fun]
    type = ParsedFunction
    expression = '2*p_2'
    symbol_names = 'p_1 p_2'
    symbol_values = '${p1} ${p2}'
  []
[]
[ICs]
  [u_ic]
    type = FunctionIC
    variable = u
    function = u_fun
  []
  [dp1_ic]
    type = FunctionIC
    variable = dp1
    function = dp1_fun
  []
  [dp2_ic]
    type = FunctionIC
    variable = dp2
    function = dp2_fun
  []
[]
[VectorPostprocessors]
  [inner_product]
    type = ElementOptimizationReactionFunctionInnerProduct
    forward_variable = u
    variable = v
    function = p_fun
    execute_on = initial
  []
[]
[Postprocessors]
  [udp1v]
    type = VectorPostprocessorComponent
    vectorpostprocessor = inner_product
    vector_name = inner_product
    index = 0
  []
  [udp2v]
    type = VectorPostprocessorComponent
    vectorpostprocessor = inner_product
    vector_name = inner_product
    index = 1
  []
  [udp1v_exact]
    type = VariableInnerProduct
    variable = u
    second_variable = dp1
  []
  [udp2v_exact]
    type = VariableInnerProduct
    variable = u
    second_variable = dp2
  []
  [compare]
    type = ParsedPostprocessor
    expression = 'abs(udp1v + udp1v_exact) + abs(udp2v + udp2v_exact)'
    pp_names = 'udp1v udp2v udp1v_exact udp2v_exact'
  []
[]
[UserObjects]
  [terminate]
    type = Terminator
    expression = 'compare > 1e-8'
    error_level = ERROR
  []
[]
[Problem]
  solve = false
[]
[Executioner]
  type = Steady
[]
(modules/combined/examples/optimization/multi-load/square_subapp_two.i)
power = 1.0
E0 = 1.0
Emin = 1.0e-6
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Mesh]
  [Bottom]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 100
    ny = 100
    xmin = 0
    xmax = 150
    ymin = 0
    ymax = 150
  []
  [left_load]
    type = ExtraNodesetGenerator
    input = Bottom
    new_boundary = left_load
    coord = '0 150 0'
  []
  [right_load]
    type = ExtraNodesetGenerator
    input = left_load
    new_boundary = right_load
    coord = '150 150 0'
  []
  [left_support]
    type = ExtraNodesetGenerator
    input = right_load
    new_boundary = left_support
    coord = '0 0 0'
  []
  [right_support]
    type = ExtraNodesetGenerator
    input = left_support
    new_boundary = right_support
    coord = '150 0 0'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
[]
[AuxVariables]
  [Dc]
    family = MONOMIAL
    order = SECOND
    initial_condition = -1.0
  []
  [Cc]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = -1.0
  []
  [mat_den]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = 0.25
  []
  [sensitivity_var]
    family = MONOMIAL
    order = SECOND
    initial_condition = -1.0
  []
[]
[AuxKernels]
  [sensitivity_kernel]
    type = MaterialRealAux
    check_boundary_restricted = false
    property = sensitivity
    variable = sensitivity_var
    execute_on = 'TIMESTEP_END'
  []
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    strain = SMALL
    add_variables = true
    incremental = false
  []
[]
[BCs]
  [no_y]
    type = DirichletBC
    variable = disp_y
    boundary = left_support
    value = 0.0
  []
  [no_x]
    type = DirichletBC
    variable = disp_x
    boundary = left_support
    value = 0.0
  []
  [no_y_right]
    type = DirichletBC
    variable = disp_y
    boundary = right_support
    value = 0.0
  []
  [no_x_right]
    type = DirichletBC
    variable = disp_x
    boundary = right_support
    value = 0.0
  []
[]
[NodalKernels]
  [push_right]
    type = NodalGravity
    variable = disp_y
    boundary = right_load
    gravity_value = 1e-3
    mass = 1
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeVariableIsotropicElasticityTensor
    youngs_modulus = E_phys
    poissons_ratio = poissons_ratio
    args = 'mat_den'
  []
  [E_phys]
    type = DerivativeParsedMaterial
    # Emin + (density^penal) * (E0 - Emin)
    expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
    coupled_variables = 'mat_den'
    property_name = E_phys
  []
  [poissons_ratio]
    type = GenericConstantMaterial
    prop_names = poissons_ratio
    prop_values = 0.3
  []
  [stress]
    type = ComputeLinearElasticStress
  []
  [dc]
    type = ComplianceSensitivity
    design_density = mat_den
    youngs_modulus = E_phys
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[UserObjects]
  # We do averaging in subapps
  [rad_avg]
    type = RadialAverage
    radius = 8
    weights = linear
    prop_name = sensitivity
    execute_on = TIMESTEP_END
    force_preaux = true
  []
  [calc_sense]
    type = SensitivityFilter
    density_sensitivity = Dc
    design_density = mat_den
    filter_UO = rad_avg
    execute_on = TIMESTEP_END
    force_postaux = true
  []
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu superlu_dist'
  nl_abs_tol = 1e-10
  dt = 1.0
  num_steps = 10
[]
[Outputs]
  exodus = true
  [out]
    type = CSV
    execute_on = 'TIMESTEP_END'
  []
  print_linear_residuals = false
[]
[Postprocessors]
  [mesh_volume]
    type = VolumePostprocessor
    execute_on = 'initial timestep_end'
  []
  [total_vol]
    type = ElementIntegralVariablePostprocessor
    variable = mat_den
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [vol_frac]
    type = ParsedPostprocessor
    expression = 'total_vol / mesh_volume'
    pp_names = 'total_vol mesh_volume'
  []
  [sensitivity]
    type = ElementIntegralMaterialProperty
    mat_prop = sensitivity
    execute_on = 'TIMESTEP_BEGIN TIMESTEP_END NONLINEAR'
  []
  [objective]
    type = ElementIntegralMaterialProperty
    mat_prop = strain_energy_density
    execute_on = 'INITIAL TIMESTEP_END'
  []
[]
(modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/sc-lid-driven.i)
mu = 1
rho = 1
l = 1
U = 100
n = 8
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = ${l}
    ymin = 0
    ymax = ${l}
    nx = ${n}
    ny = ${n}
    elem_type = TRI6
  []
[]
[Variables]
  [vel_x]
    family = L2_HIERARCHIC
    order = SECOND
  []
  [vel_y]
    family = L2_HIERARCHIC
    order = SECOND
  []
  [pressure]
    family = L2_HIERARCHIC
    order = FIRST
  []
  [vel_bar_x]
    family = SIDE_HIERARCHIC
    order = SECOND
  []
  [vel_bar_y]
    family = SIDE_HIERARCHIC
    order = SECOND
  []
  [pressure_bar]
    family = SIDE_HIERARCHIC
    order = FIRST
  []
  [lambda]
    family = SCALAR
    order = FIRST
  []
[]
[HDGKernels]
  [momentum_x_advection]
    type = AdvectionIPHDGKernel
    variable = vel_x
    face_variable = vel_bar_x
    velocity = 'velocity'
    coeff = ${rho}
  []
  [momentum_x_diffusion]
    type = NavierStokesStressIPHDGKernel
    variable = vel_x
    face_variable = vel_bar_x
    diffusivity = 'mu'
    alpha = 6
    pressure_variable = pressure
    pressure_face_variable = pressure_bar
    component = 0
  []
  [momentum_y_advection]
    type = AdvectionIPHDGKernel
    variable = vel_y
    face_variable = vel_bar_y
    velocity = 'velocity'
    coeff = ${rho}
  []
  [momentum_y_diffusion]
    type = NavierStokesStressIPHDGKernel
    variable = vel_y
    face_variable = vel_bar_y
    diffusivity = 'mu'
    alpha = 6
    pressure_variable = pressure
    pressure_face_variable = pressure_bar
    component = 1
  []
  [mass_advection]
    type = AdvectionIPHDGKernel
    variable = pressure
    face_variable = pressure_bar
    velocity = 'velocity'
    coeff = '${fparse -rho}'
    self_advection = false
  []
[]
[Kernels]
  [mean_zero_pressure]
    type = ScalarLagrangeMultiplier
    variable = pressure
    lambda = lambda
  []
[]
[ScalarKernels]
  [mean_zero_pressure_lm]
    type = AverageValueConstraint
    variable = lambda
    pp_name = pressure_integral
    value = 0
  []
[]
[BCs]
  [momentum_x_diffusion_walls]
    type = NavierStokesStressIPHDGDirichletBC
    boundary = 'left bottom right'
    variable = vel_x
    face_variable = vel_bar_x
    pressure_variable = pressure
    pressure_face_variable = pressure_bar
    alpha = 6
    functor = '0'
    diffusivity = 'mu'
    component = 0
  []
  [momentum_x_diffusion_top]
    type = NavierStokesStressIPHDGDirichletBC
    boundary = 'top'
    variable = vel_x
    face_variable = vel_bar_x
    pressure_variable = pressure
    pressure_face_variable = pressure_bar
    alpha = 6
    functor = '${U}'
    diffusivity = 'mu'
    component = 0
  []
  [momentum_y_diffusion_all]
    type = NavierStokesStressIPHDGDirichletBC
    boundary = 'left bottom right top'
    variable = vel_y
    face_variable = vel_bar_y
    pressure_variable = pressure
    pressure_face_variable = pressure_bar
    alpha = 6
    functor = '0'
    diffusivity = 'mu'
    component = 1
  []
  [mass_advection]
    type = AdvectionIPHDGPrescribedFluxBC
    face_variable = pressure_bar
    variable = pressure
    velocity = 'velocity'
    coeff = '${fparse -rho}'
    self_advection = false
    boundary = 'left bottom top right'
    prescribed_normal_flux = 0
  []
[]
[Materials]
  [const]
    type = ADGenericConstantMaterial
    prop_names = 'rho mu'
    prop_values = '${rho} ${mu}'
  []
  [vel]
    type = ADVectorFromComponentVariablesMaterial
    vector_prop_name = 'velocity'
    u = vel_x
    v = vel_y
  []
[]
[Preconditioning]
  [sc]
    type = StaticCondensation
    petsc_options_iname = '-pc_type -pc_factor_shift_type -ksp_view_pmat'
    petsc_options_value = 'lu       NONZERO               binary'
  []
[]
[Executioner]
  type = Steady
  nl_rel_tol = 1e-12
  petsc_options_iname = '-ksp_type'
  petsc_options_value = 'preonly'
[]
[Outputs]
  [out]
    type = Exodus
    hide = 'lambda pressure_integral symmetric vel_bar_x vel_bar_y pressure_bar'
  []
  [csv]
    type = CSV
    hide = 'lambda pressure_integral'
  []
[]
[Postprocessors]
  [Re]
    type = ParsedPostprocessor
    pp_names = ''
    expression = '${rho} * ${U} * ${l} / ${mu}'
  []
  [symmetric]
    type = MatrixSymmetryCheck
    mat = binaryoutput
    mat_number_to_load = 2
  []
  [pressure_integral]
    type = ElementIntegralVariablePostprocessor
    variable = pressure
    execute_on = linear
  []
[]
(test/tests/misc/rename-parameters/rename-postprocessor.i)
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    nx = 20
    dim = 1
  []
[]
[Variables]
  [u][]
[]
[Kernels]
  [diff]
    type = RenamedPostprocessorDiffusion
    variable = u
    diffusion_postprocessor = 'parsed'
  []
  [rxn]
    type = Reaction
    rate = 2
    variable = u
  []
[]
[BCs]
  [left]
    type = DirichletBC
    variable = u
    boundary = left
    value = 1
  []
  [right]
    type = DirichletBC
    variable = u
    boundary = right
    value = 0
  []
[]
[Executioner]
  type = Steady
[]
[Postprocessors]
  [parsed]
    type = ParsedPostprocessor
    expression = '2'
    execute_on = 'initial'
  []
  [avg_u]
    type = ElementAverageValue
    variable = u
  []
[]
[Outputs]
  [out]
    type = CSV
    hide = 'parsed'
  []
[]
(modules/heat_transfer/test/tests/gap_heat_transfer_mortar/large_gap_heat_transfer_test_sphere_mortar.i)
sphere_outer_htc = 10 # W/m^2/K
sphere_outer_Tinf = 300 # K
[GlobalParams]
  order = SECOND
  family = LAGRANGE
[]
[Problem]
  kernel_coverage_check = false
  material_coverage_check = false
[]
[Mesh]
  [file]
    type = FileMeshGenerator
    file = cyl2D.e
  []
  [secondary]
    type = LowerDBlockFromSidesetGenerator
    sidesets = '2'
    new_block_id = 10001
    new_block_name = 'secondary_lower'
    input = file
  []
  [primary]
    type = LowerDBlockFromSidesetGenerator
    sidesets = '3'
    new_block_id = 10000
    new_block_name = 'primary_lower'
    input = secondary
  []
  allow_renumbering = false
  coord_type = RZ
[]
[Functions]
  [temp]
    type = PiecewiseLinear
    x = '0   1'
    y = '100 200'
  []
[]
[Variables]
  [temp]
    initial_condition = 500
  []
  [lm]
    order = SECOND
    family = LAGRANGE
    block = 'secondary_lower'
  []
[]
[AuxVariables]
  [power_density]
    block = 'fuel'
    initial_condition = 50e3
  []
[]
[Kernels]
  [heat_conduction]
    type = HeatConduction
    variable = temp
    block = '1 2'
  []
  [heat_source]
    type = CoupledForce
    variable = temp
    block = 'fuel'
    v = power_density
  []
[]
[Materials]
  [heat1]
    type = HeatConductionMaterial
    block = '1 2'
    specific_heat = 1.0
    thermal_conductivity = 34.6
  []
[]
[UserObjects]
  [radiation]
    type = GapFluxModelRadiation
    temperature = temp
    boundary = 2
    primary_emissivity = 0.0
    secondary_emissivity = 0.0
  []
  [conduction]
    type = GapFluxModelConduction
    temperature = temp
    boundary = 2
    gap_conductivity = 5.0
  []
[]
[Constraints]
  [ced]
    type = ModularGapConductanceConstraint
    variable = lm
    secondary_variable = temp
    primary_boundary = 3
    primary_subdomain = 10000
    secondary_boundary = 2
    secondary_subdomain = 10001
    gap_flux_models = 'radiation conduction'
    gap_geometry_type = SPHERE
    sphere_origin = '0 0 0'
  []
[]
[BCs]
  [RPV_out_BC] # k \nabla T = h (T- T_inf) at RPV outer boundary
    type = ConvectiveFluxFunction # (Robin BC)
    variable = temp
    boundary = '4' # outer RPV
    coefficient = ${sphere_outer_htc}
    T_infinity = ${sphere_outer_Tinf}
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu       superlu_dist'
  dt = 1
  dtmin = 0.01
  end_time = 1
  nl_rel_tol = 1e-12
  nl_abs_tol = 1e-7
[]
[Outputs]
  exodus = true
  csv = true
  [Console]
    type = Console
  []
[]
[VectorPostprocessors]
  [NodalTemperature]
    type = NodalValueSampler
    sort_by = id
    boundary = '2 3'
    variable = temp
  []
[]
[Postprocessors]
  [temp_left]
    type = SideAverageValue
    boundary = 2
    variable = temp
  []
  [temp_right]
    type = SideAverageValue
    boundary = 3
    variable = temp
  []
  [flux_left]
    type = SideDiffusiveFluxIntegral
    variable = temp
    boundary = 2
    diffusivity = thermal_conductivity
  []
  [flux_right]
    type = SideDiffusiveFluxIntegral
    variable = temp
    boundary = 3
    diffusivity = thermal_conductivity
  []
  [ptot]
    type = ElementIntegralVariablePostprocessor
    variable = power_density
    block = 'fuel'
  []
  [sphere_convective_out]
    type = ConvectiveHeatTransferSideIntegral
    T_solid = temp
    boundary = '4' # outer RVP
    T_fluid = ${sphere_outer_Tinf}
    htc = ${sphere_outer_htc}
  []
  [heat_balance] # should be equal to 0 upon convergence
    type = ParsedPostprocessor
    expression = '(sphere_convective_out - ptot) / ptot'
    pp_names = 'sphere_convective_out ptot'
  []
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/channel-drift-flux-transient.i)
mu = 1.0
rho = 10.0
mu_d = 0.1
rho_d = 1.0
l = 2
U = 1
dp = 0.01
inlet_phase_2 = 0.1
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[GlobalParams]
  rhie_chow_user_object = 'rc'
  density_interp_method = 'average'
  mu_interp_method = 'average'
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = vel_x
    v = vel_y
    pressure = pressure
  []
[]
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = '${fparse l * 5}'
    ymin = '${fparse -l / 2}'
    ymax = '${fparse l / 2}'
    nx = 10
    ny = 4
  []
  uniform_refine = 0
[]
[Variables]
  [vel_x]
    type = INSFVVelocityVariable
    initial_condition = 0
  []
  [vel_y]
    type = INSFVVelocityVariable
    initial_condition = 0
  []
  [pressure]
    type = INSFVPressureVariable
  []
  [phase_2]
    type = INSFVScalarFieldVariable
  []
[]
[FVKernels]
  [mass]
    type = INSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = 'rho_mixture'
  []
  [u_time]
    type = INSFVMomentumTimeDerivative
    variable = vel_x
    rho = 'rho_mixture'
    momentum_component = 'x'
  []
  [u_advection]
    type = INSFVMomentumAdvection
    variable = vel_x
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = 'rho_mixture'
    momentum_component = 'x'
  []
  [u_drift]
    type = WCNSFV2PMomentumDriftFlux
    variable = vel_x
    rho_d = ${rho_d}
    fd = 'phase_2'
    u_slip = 'vel_slip_x'
    v_slip = 'vel_slip_y'
    momentum_component = 'x'
  []
  [u_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_x
    mu = 'mu_mixture'
    limit_interpolation = true
    momentum_component = 'x'
  []
  [u_pressure]
    type = INSFVMomentumPressure
    variable = vel_x
    momentum_component = 'x'
    pressure = pressure
  []
  [u_friction]
    type = PINSFVMomentumFriction
    Darcy_name = Darcy_coefficient_vec
    is_porous_medium = false
    momentum_component = x
    mu = mu_mixture
    rho = rho_mixture
    variable = vel_x
  []
  [v_time]
    type = INSFVMomentumTimeDerivative
    variable = vel_y
    rho = 'rho_mixture'
    momentum_component = 'y'
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = vel_y
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = 'rho_mixture'
    momentum_component = 'y'
  []
  [v_drift]
    type = WCNSFV2PMomentumDriftFlux
    variable = vel_y
    rho_d = ${rho_d}
    fd = 'phase_2'
    u_slip = 'vel_slip_x'
    v_slip = 'vel_slip_y'
    momentum_component = 'y'
  []
  [v_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_y
    mu = 'mu_mixture'
    limit_interpolation = true
    momentum_component = 'y'
  []
  [v_pressure]
    type = INSFVMomentumPressure
    variable = vel_y
    momentum_component = 'y'
    pressure = pressure
  []
  [v_friction]
    type = PINSFVMomentumFriction
    Darcy_name = Darcy_coefficient_vec
    is_porous_medium = false
    momentum_component = y
    mu = mu_mixture
    rho = rho_mixture
    variable = vel_y
  []
  [phase_2_time]
    type = FVFunctorTimeKernel
    variable = phase_2
    functor = phase_2
  []
  [phase_2_advection]
    type = INSFVScalarFieldAdvection
    variable = phase_2
    u_slip = 'vel_slip_x'
    v_slip = 'vel_slip_y'
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = 'upwind'
  []
  [phase_2_src]
    type = NSFVMixturePhaseInterface
    variable = phase_2
    phase_coupled = phase_1
    alpha = 0.1
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_x
    functor = '${U}'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_y
    functor = '0'
  []
  [walls-u]
    type = INSFVNoSlipWallBC
    boundary = 'top bottom'
    variable = vel_x
    function = 0
  []
  [walls-v]
    type = INSFVNoSlipWallBC
    boundary = 'top bottom'
    variable = vel_y
    function = 0
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = '0'
  []
  [inlet_phase_2]
    type = FVDirichletBC
    boundary = 'left'
    variable = phase_2
    value = ${inlet_phase_2}
  []
[]
[AuxVariables]
  [drag_coefficient]
    type = MooseVariableFVReal
  []
  [rho_mixture_var]
    type = MooseVariableFVReal
  []
  [mu_mixture_var]
    type = MooseVariableFVReal
  []
  [vel_slip_x_var]
    type = MooseVariableFVReal
  []
  [vel_slip_y_var]
    type = MooseVariableFVReal
  []
[]
[AuxKernels]
  [populate_cd]
    type = FunctorAux
    variable = drag_coefficient
    functor = 'Darcy_coefficient'
  []
  [populate_rho_mixture_var]
    type = FunctorAux
    variable = rho_mixture_var
    functor = 'rho_mixture'
  []
  [populate_mu_mixture_var]
    type = FunctorAux
    variable = mu_mixture_var
    functor = 'mu_mixture'
  []
  [populate_vx_slip_var]
    type = FunctorAux
    variable = vel_slip_x_var
    functor = 'vel_slip_x'
  []
  [populate_vy_slip_var]
    type = FunctorAux
    variable = vel_slip_y_var
    functor = 'vel_slip_y'
  []
[]
[FunctorMaterials]
  [populate_u_slip]
    type = WCNSFV2PSlipVelocityFunctorMaterial
    slip_velocity_name = 'vel_slip_x'
    momentum_component = 'x'
    u = 'vel_x'
    v = 'vel_y'
    rho = ${rho}
    mu = 'mu_mixture'
    rho_d = ${rho_d}
    particle_diameter = ${dp}
    linear_coef_name = 'Darcy_coefficient'
  []
  [populate_v_slip]
    type = WCNSFV2PSlipVelocityFunctorMaterial
    slip_velocity_name = 'vel_slip_y'
    momentum_component = 'y'
    u = 'vel_x'
    v = 'vel_y'
    rho = ${rho}
    mu = 'mu_mixture'
    rho_d = ${rho_d}
    particle_diameter = ${dp}
    linear_coef_name = 'Darcy_coefficient'
  []
  [compute_phase_1]
    type = ADParsedFunctorMaterial
    property_name = phase_1
    functor_names = 'phase_2'
    expression = '1 - phase_2'
  []
  [CD]
    type = NSFVDispersePhaseDragFunctorMaterial
    rho = 'rho_mixture'
    mu = mu_mixture
    u = 'vel_x'
    v = 'vel_y'
    particle_diameter = ${dp}
  []
  [mixing_material]
    type = NSFVMixtureFunctorMaterial
    phase_2_names = '${rho} ${mu}'
    phase_1_names = '${rho_d} ${mu_d}'
    prop_names = 'rho_mixture mu_mixture'
    phase_1_fraction = 'phase_2'
  []
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  nl_rel_tol = 1e-10
  dt = 0.1
  end_time = 1.0
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
    petsc_options_iname = '-pc_type -pc_factor_shift_type'
    petsc_options_value = 'lu       NONZERO'
  []
[]
[Outputs]
  exodus = false
  [CSV]
    type = CSV
    execute_on = 'TIMESTEP_END'
  []
[]
[Postprocessors]
  [Re]
    type = ParsedPostprocessor
    expression = '${rho} * ${l} * ${U}'
  []
  [rho_outlet]
    type = SideAverageValue
    boundary = 'right'
    variable = 'rho_mixture_var'
  []
  [vslip_x]
    type = SideExtremeValue
    boundary = 'left'
    variable = 'vel_slip_x_var'
  []
  [vslip_y]
    type = SideExtremeValue
    boundary = 'left'
    variable = 'vel_slip_y_var'
  []
  [vslip_value]
    type = ParsedPostprocessor
    expression = 'sqrt(vslip_x*vslip_x + vslip_y*vslip_y)*vslip_x/abs(vslip_x)'
    pp_names = 'vslip_x vslip_y'
  []
[]
(test/tests/problems/reference_residual_problem/abs_ref_acceptable.i)
[Mesh]
  type = GeneratedMesh
  dim = 1
  nx = 10
[]
[GlobalParams]
  absolute_value_vector_tags = 'absref'
[]
[Problem]
  type = ReferenceResidualProblem
  reference_vector = 'absref'
  extra_tag_vectors = 'absref'
  acceptable_iterations = 1
  acceptable_multiplier = 1e6
[]
[Variables]
  [u][]
  [v]
    scaling = 1e-6
  []
[]
[Functions]
  [ramp]
    type = ParsedFunction
    expression = 'if(t < 5, t - 5, 0) * x'
  []
[]
[Kernels]
  [u_dt]
    type = TimeDerivative
    variable = u
  []
  [u_coupled_rx]
    type = CoupledForce
    variable = u
    v = v
    coef = 1
  []
  [v_dt]
    type = TimeDerivative
    variable = v
  []
  [v_neg_force]
    type = BodyForce
    variable = v
    value = ${fparse -1 / 2}
    function = ramp
  []
  [v_force]
    type = BodyForce
    variable = v
    value = 1
    function = ramp
  []
[]
[Postprocessors]
  [u_avg]
    type = ElementAverageValue
    variable = u
    execute_on = 'TIMESTEP_END INITIAL'
  []
  [v_avg]
    type = ElementAverageValue
    variable = v
    execute_on = 'TIMESTEP_END INITIAL'
  []
  [timestep]
    type = TimePostprocessor
    outputs = 'none'
  []
  [v_old]
    type = ElementAverageValue
    variable = v
    execute_on = TIMESTEP_BEGIN
    outputs = none
  []
  [u_old]
    type = ElementAverageValue
    variable = u
    execute_on = TIMESTEP_BEGIN
    outputs = none
  []
  [v_exact]
    type = ParsedPostprocessor
    pp_names = 'timestep v_old'
    expression = 't := if(timestep > 5, 5, timestep); (t^2 - 9 * t) / 8'
  []
  [u_exact]
    type = ParsedPostprocessor
    pp_names = 'u_old v_exact'
    expression = 'u_old + v_exact'
  []
[]
[Executioner]
  type = Transient
  petsc_options = '-snes_converged_reason'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  line_search = none
  num_steps = 3
  nl_rel_tol = 1e-06
  verbose = true
[]
[Outputs]
  csv = true
  perf_graph = true
[]
(modules/thermal_hydraulics/tutorials/single_phase_flow/02_core.i)
T_in = 300. # K
m_dot_in = 1e-2 # kg/s
press = 10e5 # Pa
# core parameters
core_length = 1. # m
core_n_elems = 25
core_dia = '${units 2. cm -> m}'
core_pitch = '${units 8.7 cm -> m}'
A_core = '${fparse core_pitch^2 - 0.25 *pi * core_dia^2}'
P_wet_core = '${fparse 4*core_pitch + pi * core_dia}'
Dh_core = '${fparse 4 * A_core / P_wet_core}'
tot_power = 2000 # W
[GlobalParams]
  initial_p = ${press}
  initial_vel = 0.0001
  initial_T = ${T_in}
  gravity_vector = '0 0 0'
  rdg_slope_reconstruction = minmod
  scaling_factor_1phase = '1 1e-2 1e-4'
  closures = thm_closures
  fp = he
[]
[FluidProperties]
  [he]
    type = IdealGasFluidProperties
    molar_mass = 4e-3
    gamma = 1.67
    k = 0.2556
    mu = 3.22639e-5
  []
[]
[Closures]
  [thm_closures]
    type = Closures1PhaseTHM
  []
[]
[SolidProperties]
  [steel]
    type = ThermalFunctionSolidProperties
    rho = 8050
    k = 45
    cp = 466
  []
[]
[Components]
  [total_power]
    type = TotalPower
    power = ${tot_power}
  []
  [inlet]
    type = InletMassFlowRateTemperature1Phase
    input = 'core_chan:in'
    m_dot = ${m_dot_in}
    T = ${T_in}
  []
  [core_chan]
    type = FlowChannel1Phase
    position = '0 0 0'
    orientation = '0 0 1'
    length = ${core_length}
    n_elems = ${core_n_elems}
    roughness = .0001
    A = '${A_core}'
    D_h = ${Dh_core}
  []
  [core_hs]
    type = HeatStructureCylindrical
    position = '0 0 0'
    orientation = '0 0 1'
    length = ${core_length}
    n_elems = ${core_n_elems}
    names = 'block'
    widths = '${fparse core_dia / 2.}'
    solid_properties = 'steel'
    solid_properties_T_ref = '300'
    n_part_elems = 3
  []
  [core_heating]
    type = HeatSourceFromTotalPower
    hs = core_hs
    regions = block
    power = total_power
  []
  [core_ht]
    type = HeatTransferFromHeatStructure1Phase
    flow_channel = core_chan
    hs = core_hs
    hs_side = outer
    P_hf = '${fparse pi * core_dia}'
  []
  [outlet]
    type = Outlet1Phase
    input = 'core_chan:out'
    p = ${press}
  []
[]
[Postprocessors]
  [power_to_coolant]
    type = ADHeatRateConvection1Phase
    block = core_chan
    P_hf = '${fparse pi *core_dia}'
  []
  [core_T_out]
    type = SideAverageValue
    boundary = core_chan:out
    variable = T
  []
  [core_p_in]
    type = SideAverageValue
    boundary = core_chan:in
    variable = p
  []
  [core_p_out]
    type = SideAverageValue
    boundary = core_chan:out
    variable = p
  []
  [core_delta_p]
    type = ParsedPostprocessor
    pp_names = 'core_p_in core_p_out'
    expression = 'core_p_in - core_p_out'
  []
[]
[Preconditioning]
  [pc]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  start_time = 0
  [TimeStepper]
    type = IterationAdaptiveDT
    dt = 10
  []
  end_time = 5000
  line_search = basic
  solve_type = NEWTON
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-8
  nl_max_its = 25
[]
[Outputs]
  exodus = true
  [console]
    type = Console
    max_rows = 1
    outlier_variable_norms = false
  []
  print_linear_residuals = false
[]
(modules/combined/test/tests/optimization/compliance_sensitivity/thermal_test.i)
vol_frac = 0.4
cost_frac = 10.0
power = 2.0
E0 = 1.0e-6
E1 = 1.0
rho0 = 0.0
rho1 = 1.0
C0 = 1.0e-6
C1 = 1.0
TC0 = 1.0e-16
TC1 = 1.0
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Mesh]
  [MeshGenerator]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 10
    ny = 10
    xmin = 0
    xmax = 40
    ymin = 0
    ymax = 40
  []
  [node]
    type = ExtraNodesetGenerator
    input = MeshGenerator
    new_boundary = hold
    nodes = 0
  []
  [push_left]
    type = ExtraNodesetGenerator
    input = node
    new_boundary = push_left
    coord = '16 0 0'
  []
  [push_center]
    type = ExtraNodesetGenerator
    input = push_left
    new_boundary = push_center
    coord = '24 0 0'
  []
  [extra]
    type = SideSetsFromBoundingBoxGenerator
    input = push_center
    bottom_left = '-0.01 17.999  0'
    top_right = '5 22.001  0'
    boundary_new = n1
    included_boundaries = left
  []
  [dirichlet_bc]
    type = SideSetsFromNodeSetsGenerator
    input = extra
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [temp]
    initial_condition = 100.0
  []
[]
[AuxVariables]
  [Dc]
    family = MONOMIAL
    order = FIRST
    initial_condition = -1.0
  []
  [Cc]
    family = MONOMIAL
    order = FIRST
    initial_condition = -1.0
  []
  [Tc]
    family = MONOMIAL
    order = FIRST
    initial_condition = -1.0
  []
  [Cost]
    family = MONOMIAL
    order = FIRST
    initial_condition = -1.0
  []
  [mat_den]
    family = MONOMIAL
    order = FIRST
    initial_condition = ${vol_frac}
  []
[]
[AuxKernels]
  [Cost]
    type = MaterialRealAux
    variable = Cost
    property = Cost_mat
  []
[]
[Kernels]
  [heat_conduction]
    type = HeatConduction
    variable = temp
    diffusion_coefficient = thermal_cond
  []
  [heat_source]
    type = HeatSource
    value = 1e-2 # W/m^3
    variable = temp
  []
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    strain = SMALL
    add_variables = true
    incremental = false
  []
[]
[BCs]
  [no_y]
    type = DirichletBC
    variable = disp_y
    boundary = hold
    value = 0.0
  []
  [no_x_symm]
    type = DirichletBC
    variable = disp_x
    boundary = right
    value = 0.0
  []
  [left_n1]
    type = DirichletBC
    variable = temp
    boundary = n1
    value = 0.0
  []
  [top]
    type = NeumannBC
    variable = temp
    boundary = top
    value = 0
  []
  [bottom]
    type = NeumannBC
    variable = temp
    boundary = bottom
    value = 0
  []
  [right]
    type = NeumannBC
    variable = temp
    boundary = right
    value = 0
  []
  [left]
    type = NeumannBC
    variable = temp
    boundary = left
    value = 0
  []
[]
[NodalKernels]
  [push_left]
    type = NodalGravity
    variable = disp_y
    boundary = push_left
    gravity_value = 0.0 # -1e-8
    mass = 1
  []
  [push_center]
    type = NodalGravity
    variable = disp_y
    boundary = push_center
    gravity_value = 0.0 # -1e-8
    mass = 1
  []
[]
[Materials]
  [thermal_cond]
    type = DerivativeParsedMaterial
    # ordered multimaterial simp
    expression = "A1:=(${TC0}-${TC1})/(${rho0}^${power}-${rho1}^${power}); "
                 "B1:=${TC0}-A1*${rho0}^${power}; TC1:=A1*mat_den^${power}+B1; TC1"
    coupled_variables = 'mat_den'
    property_name = thermal_cond
    outputs = 'exodus'
  []
  [thermal_compliance]
    type = ThermalCompliance
    temperature = temp
    thermal_conductivity = thermal_cond
    outputs = 'exodus'
  []
  [elasticity_tensor]
    type = ComputeVariableIsotropicElasticityTensor
    youngs_modulus = E_phys
    poissons_ratio = poissons_ratio
    args = 'mat_den'
  []
  [E_phys]
    type = DerivativeParsedMaterial
    # ordered multimaterial simp
    expression = "A1:=(${E0}-${E1})/(${rho0}^${power}-${rho1}^${power}); "
                 "B1:=${E0}-A1*${rho0}^${power}; E1:=A1*mat_den^${power}+B1; E1"
    coupled_variables = 'mat_den'
    property_name = E_phys
  []
  [Cost_mat]
    type = DerivativeParsedMaterial
    # ordered multimaterial simp
    expression = "A1:=(${C0}-${C1})/(${rho0}^(1/${power})-${rho1}^(1/${power})); "
                 "B1:=${C0}-A1*${rho0}^(1/${power}); C1:=A1*mat_den^(1/${power})+B1; C1"
    coupled_variables = 'mat_den'
    property_name = Cost_mat
  []
  [CostDensity]
    type = ParsedMaterial
    property_name = CostDensity
    coupled_variables = 'mat_den Cost'
    expression = 'mat_den*Cost'
  []
  [poissons_ratio]
    type = GenericConstantMaterial
    prop_names = poissons_ratio
    prop_values = 0.3
  []
  [stress]
    type = ComputeLinearElasticStress
  []
  [dc]
    type = ComplianceSensitivity
    design_density = mat_den
    youngs_modulus = E_phys
  []
  [cc]
    type = CostSensitivity
    design_density = mat_den
    cost = Cost_mat
    outputs = 'exodus'
  []
  [tc]
    type = ThermalSensitivity
    design_density = mat_den
    thermal_conductivity = thermal_cond
    temperature = temp
    outputs = 'exodus'
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[UserObjects]
  [rad_avg]
    type = RadialAverage
    radius = 0.1
    weights = linear
    prop_name = sensitivity
    execute_on = TIMESTEP_END
    force_preaux = true
  []
  [rad_avg_cost]
    type = RadialAverage
    radius = 0.1
    weights = linear
    prop_name = cost_sensitivity
    execute_on = TIMESTEP_END
    force_preaux = true
  []
  [rad_avg_thermal]
    type = RadialAverage
    radius = 0.1
    weights = linear
    prop_name = thermal_sensitivity
    execute_on = TIMESTEP_END
    force_preaux = true
  []
  [update]
    type = DensityUpdateTwoConstraints
    density_sensitivity = Dc
    cost_density_sensitivity = Cc
    cost = Cost
    cost_fraction = ${cost_frac}
    design_density = mat_den
    volume_fraction = ${vol_frac}
    bisection_lower_bound = 0
    bisection_upper_bound = 1.0e12 # 100
    use_thermal_compliance = true
    thermal_sensitivity = Tc
    weight_mechanical_thermal = '0 1'
    relative_tolerance = 1.0e-12
    bisection_move = 0.015
    adaptive_move = false
    execute_on = TIMESTEP_BEGIN
  []
  # Provides Dc
  [calc_sense]
    type = SensitivityFilter
    density_sensitivity = Dc
    design_density = mat_den
    filter_UO = rad_avg
    execute_on = TIMESTEP_END
    force_postaux = true
  []
  # Provides Cc
  [calc_sense_cost]
    type = SensitivityFilter
    density_sensitivity = Cc
    design_density = mat_den
    filter_UO = rad_avg_cost
    execute_on = TIMESTEP_END
    force_postaux = true
  []
  # Provides Tc
  [calc_sense_thermal]
    type = SensitivityFilter
    density_sensitivity = Tc
    design_density = mat_den
    filter_UO = rad_avg_thermal
    execute_on = TIMESTEP_END
    force_postaux = true
  []
[]
[Executioner]
  type = Transient
  solve_type = PJFNK
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu superlu_dist'
  nl_abs_tol = 1e-12
  dt = 1.0
  num_steps = 5
[]
[Outputs]
  exodus = true
  [out]
    type = CSV
    execute_on = 'TIMESTEP_END'
  []
  print_linear_residuals = false
[]
[Postprocessors]
  [right_flux]
    type = SideDiffusiveFluxAverage
    variable = temp
    boundary = right
    diffusivity = 10
  []
  [mesh_volume]
    type = VolumePostprocessor
    execute_on = 'initial timestep_end'
  []
  [total_vol]
    type = ElementIntegralVariablePostprocessor
    variable = mat_den
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [vol_frac]
    type = ParsedPostprocessor
    expression = 'total_vol / mesh_volume'
    pp_names = 'total_vol mesh_volume'
  []
  [sensitivity]
    type = ElementIntegralMaterialProperty
    mat_prop = sensitivity
  []
  [cost_sensitivity]
    type = ElementIntegralMaterialProperty
    mat_prop = cost_sensitivity
  []
  [cost]
    type = ElementIntegralMaterialProperty
    mat_prop = CostDensity
  []
  [cost_frac]
    type = ParsedPostprocessor
    expression = 'cost / mesh_volume'
    pp_names = 'cost mesh_volume'
  []
  [objective]
    type = ElementIntegralMaterialProperty
    mat_prop = strain_energy_density
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [objective_thermal]
    type = ElementIntegralMaterialProperty
    mat_prop = thermal_compliance
    execute_on = 'INITIAL TIMESTEP_END'
  []
[]
(modules/heat_transfer/test/tests/gap_heat_transfer_mortar/large_gap_heat_transfer_test_cylinder_mortar.i)
rpv_core_gap_size = 0.15
core_outer_radius = 2
rpv_inner_radius = '${fparse 2 + rpv_core_gap_size}'
rpv_outer_radius = '${fparse 2.5 + rpv_core_gap_size}'
rpv_outer_htc = 10 # W/m^2/K
rpv_outer_Tinf = 300 # K
core_blocks = '1'
rpv_blocks = '3'
[Mesh]
  [core_gap_rpv]
    type = ConcentricCircleMeshGenerator
    num_sectors = 10
    radii = '${core_outer_radius} ${rpv_inner_radius} ${rpv_outer_radius}'
    rings = '2 1 2'
    has_outer_square = false
    preserve_volumes = true
    portion = full
  []
  [rename_core_bdy]
    type = SideSetsBetweenSubdomainsGenerator
    input = core_gap_rpv
    primary_block = 1
    paired_block = 2
    new_boundary = 'core_outer'
  []
  [rename_inner_rpv_bdy]
    type = SideSetsBetweenSubdomainsGenerator
    input = rename_core_bdy
    primary_block = 3
    paired_block = 2
    new_boundary = 'rpv_inner'
  []
  [2d_mesh]
    type = BlockDeletionGenerator
    input = rename_inner_rpv_bdy
    block = 2
  []
  [secondary]
    type = LowerDBlockFromSidesetGenerator
    sidesets = 'rpv_inner'
    new_block_id = 10001
    new_block_name = 'secondary_lower'
    input = 2d_mesh
  []
  [primary]
    type = LowerDBlockFromSidesetGenerator
    sidesets = 'core_outer'
    new_block_id = 10000
    new_block_name = 'primary_lower'
    input = secondary
  []
  allow_renumbering = false
[]
[Variables]
  [Tsolid]
    initial_condition = 500
  []
  [lm]
    order = FIRST
    family = LAGRANGE
    block = 'secondary_lower'
  []
[]
[Kernels]
  [heat_source]
    type = CoupledForce
    variable = Tsolid
    block = '${core_blocks}'
    v = power_density
  []
  [heat_conduction]
    type = HeatConduction
    variable = Tsolid
  []
[]
[BCs]
  [RPV_out_BC] # k \nabla T = h (T- T_inf) at RPV outer boundary
    type = ConvectiveFluxFunction # (Robin BC)
    variable = Tsolid
    boundary = 'outer' # outer RPV
    coefficient = ${rpv_outer_htc}
    T_infinity = ${rpv_outer_Tinf}
  []
[]
[UserObjects]
  [radiation]
    type = GapFluxModelRadiation
    temperature = Tsolid
    boundary = 'rpv_inner'
    primary_emissivity = 0.8
    secondary_emissivity = 0.8
  []
  [conduction]
    type = GapFluxModelConduction
    temperature = Tsolid
    boundary = 'rpv_inner'
    gap_conductivity = 0.1
  []
[]
[Constraints]
  [ced]
    type = ModularGapConductanceConstraint
    variable = lm
    secondary_variable = Tsolid
    primary_boundary = 'core_outer'
    primary_subdomain = 10000
    secondary_boundary = 'rpv_inner'
    secondary_subdomain = 10001
    gap_flux_models = 'radiation conduction'
    gap_geometry_type = 'CYLINDER'
  []
[]
[AuxVariables]
  [power_density]
    block = '${core_blocks}'
    initial_condition = 50e3
  []
[]
[Materials]
  [simple_mat]
    type = HeatConductionMaterial
    thermal_conductivity = 34.6 # W/m/K
  []
[]
[Postprocessors]
  [Tcore_avg]
    type = ElementAverageValue
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Tcore_max]
    type = ElementExtremeValue
    value_type = max
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Tcore_min]
    type = ElementExtremeValue
    value_type = min
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Trpv_avg]
    type = ElementAverageValue
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [Trpv_max]
    type = ElementExtremeValue
    value_type = max
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [Trpv_min]
    type = ElementExtremeValue
    value_type = min
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [ptot]
    type = ElementIntegralVariablePostprocessor
    variable = power_density
    block = '${core_blocks}'
  []
  [rpv_convective_out]
    type = ConvectiveHeatTransferSideIntegral
    T_solid = Tsolid
    boundary = 'outer' # outer RVP
    T_fluid = ${rpv_outer_Tinf}
    htc = ${rpv_outer_htc}
  []
  [heat_balance] # should be equal to 0 upon convergence
    type = ParsedPostprocessor
    expression = '(rpv_convective_out - ptot) / ptot'
    pp_names = 'rpv_convective_out ptot'
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[VectorPostprocessors]
  [NodalTemperature]
    type = NodalValueSampler
    sort_by = id
    boundary = 'rpv_inner core_outer'
    variable = 'Tsolid'
  []
[]
[Executioner]
  type = Steady
  petsc_options = '-snes_converged_reason -pc_svd_monitor'
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
  petsc_options_value = ' lu       superlu_dist                  1e-5          NONZERO               1e-15'
  snesmf_reuse_base = false
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-10
  l_max_its = 100
  line_search = none
[]
[Outputs]
  exodus = false
  csv = true
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/rates/shear.i)
# shear modulus
G = 5000
[Mesh]
  [msh]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 1
    ny = 1
    nz = 1
  []
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  large_kinematics = true
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [disp_z]
  []
[]
[Kernels]
  [sdx]
    type = TotalLagrangianStressDivergence
    variable = disp_x
    component = 0
  []
  [sdy]
    type = TotalLagrangianStressDivergence
    variable = disp_y
    component = 1
  []
  [sdz]
    type = TotalLagrangianStressDivergence
    variable = disp_z
    component = 2
  []
[]
[AuxVariables]
  [stress_xx]
    order = CONSTANT
    family = MONOMIAL
    [AuxKernel]
      type = RankTwoAux
      rank_two_tensor = cauchy_stress
      index_i = 0
      index_j = 0
      execute_on = 'INITIAL TIMESTEP_END'
    []
  []
  [stress_yy]
    order = CONSTANT
    family = MONOMIAL
    [AuxKernel]
      type = RankTwoAux
      rank_two_tensor = cauchy_stress
      index_i = 1
      index_j = 1
      execute_on = 'INITIAL TIMESTEP_END'
    []
  []
  [stress_xy]
    order = CONSTANT
    family = MONOMIAL
    [AuxKernel]
      type = RankTwoAux
      rank_two_tensor = cauchy_stress
      index_i = 0
      index_j = 1
      execute_on = 'INITIAL TIMESTEP_END'
    []
  []
[]
[BCs]
  [x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'top bottom' # This contains all 8 nodes in the patch
    function = 't*y'
  []
  [y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'top bottom' # This contains all 8 nodes in the patch
    function = '0'
  []
  [z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'top bottom' # This contains all 8 nodes in the patch
    function = '0'
  []
[]
[Materials]
  [elastic_tensor]
    type = ComputeIsotropicElasticityTensor
    lambda = ${G}
    shear_modulus = ${G}
  []
  [compute_stress]
    type = ComputeLagrangianLinearElasticStress
  []
  [compute_strain]
    type = ComputeLagrangianStrain
  []
[]
[Postprocessors]
  [sxx]
    type = ElementAverageValue
    variable = stress_xx
    execute_on = 'INITIAL TIMESTEP_BEGIN'
    outputs = none
  []
  [sxx0]
    type = ParsedPostprocessor
    pp_names = 'sxx'
    expression = 'sxx/${G}'
    execute_on = 'INITIAL TIMESTEP_BEGIN'
  []
  [syy]
    type = ElementAverageValue
    variable = stress_yy
    execute_on = 'INITIAL TIMESTEP_BEGIN'
    outputs = none
  []
  [syy0]
    type = ParsedPostprocessor
    pp_names = 'syy'
    expression = 'syy/${G}'
    execute_on = 'INITIAL TIMESTEP_BEGIN'
  []
  [sxy]
    type = ElementAverageValue
    variable = stress_xy
    execute_on = 'INITIAL TIMESTEP_BEGIN'
    outputs = none
  []
  [sxy0]
    type = ParsedPostprocessor
    pp_names = 'sxy'
    expression = 'sxy/${G}'
    execute_on = 'INITIAL TIMESTEP_BEGIN'
  []
[]
[Executioner]
  type = Transient
  dt = 0.05
  solve_type = NEWTON
  petsc_options_iname = -pc_type
  petsc_options_value = lu
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
  end_time = 20
[]
[Outputs]
  csv = true
[]
(test/tests/problems/reference_residual_problem/no_ref.i)
[Mesh]
  type = GeneratedMesh
  dim = 1
  nx = 10
[]
[Problem]
  type = ReferenceResidualProblem
  # reference_vector = 'absref'
  # extra_tag_vectors = 'absref'
[]
[Variables]
  [u][]
  [v]
    scaling = 1e-6
  []
[]
[Functions]
  [ramp]
    type = ParsedFunction
    expression = 'if(t < 5, t - 5, 0) * x'
  []
[]
[Kernels]
  [u_dt]
    type = TimeDerivative
    variable = u
  []
  [u_coupled_rx]
    type = CoupledForce
    variable = u
    v = v
    coef = 1
  []
  [v_dt]
    type = TimeDerivative
    variable = v
  []
  [v_neg_force]
    type = BodyForce
    variable = v
    value = ${fparse -1 / 2}
    function = ramp
  []
  [v_force]
    type = BodyForce
    variable = v
    value = 1
    function = ramp
  []
[]
[Postprocessors]
  [u_avg]
    type = ElementAverageValue
    variable = u
    execute_on = 'TIMESTEP_END INITIAL'
  []
  [v_avg]
    type = ElementAverageValue
    variable = v
    execute_on = 'TIMESTEP_END INITIAL'
  []
  [timestep]
    type = TimePostprocessor
    outputs = 'none'
  []
  [v_old]
    type = ElementAverageValue
    variable = v
    execute_on = TIMESTEP_BEGIN
    outputs = none
  []
  [u_old]
    type = ElementAverageValue
    variable = u
    execute_on = TIMESTEP_BEGIN
    outputs = none
  []
  [v_exact]
    type = ParsedPostprocessor
    pp_names = 'timestep v_old'
    expression = 't := if(timestep > 5, 5, timestep); (t^2 - 9 * t) / 8'
  []
  [u_exact]
    type = ParsedPostprocessor
    pp_names = 'u_old v_exact'
    expression = 'u_old + v_exact'
  []
[]
[Executioner]
  type = Transient
  petsc_options = '-snes_converged_reason'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  line_search = none
  num_steps = 10
  nl_rel_tol = 1e-06
  verbose = true
[]
[Outputs]
  csv = true
  perf_graph = true
[]
(modules/combined/examples/optimization/helmholtz_multimat_nostrip.i)
vol_frac = 0.35
power = 1.1
Emin = 1.0e-6
Ess = 0.475 # ss
Et = 1.0 # w
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Mesh]
  # final_generator = 'MoveRight'
  [Bottom]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 320
    ny = 30
    xmin = 0
    xmax = 150
    ymin = 0
    ymax = 15
  []
  [RenameBottom]
    type = RenameBoundaryGenerator
    input = Bottom
    old_boundary = 'top bottom right left'
    new_boundary = 'top_bottom bottom_bottom right_bottom left_bottom'
  []
  [Top]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 320
    ny = 30
    xmin = 0
    xmax = 150
    ymin = 0
    ymax = 15
  []
  [MoveTop]
    type = TransformGenerator
    input = Top
    transform = TRANSLATE
    vector_value = '0 15 0'
  []
  [RenameTop]
    type = RenameBoundaryGenerator
    input = MoveTop
    old_boundary = 'top bottom right left'
    new_boundary = 'top_top bottom_top right_top left_top'
  []
  [bottom_gen]
    type = ParsedSubdomainMeshGenerator
    input = RenameBottom
    combinatorial_geometry = 'y <= 15'
    block_id = 1
  []
  [top_gen]
    type = ParsedSubdomainMeshGenerator
    input = RenameTop
    combinatorial_geometry = 'y > 15'
    block_id = 3
  []
  [stitch]
    type = StitchedMeshGenerator
    inputs = 'bottom_gen top_gen'
    stitch_boundaries_pairs = 'top_bottom bottom_top'
  []
  [left_load]
    type = ExtraNodesetGenerator
    input = stitch
    new_boundary = left_load
    coord = '37.5 30 0'
  []
  [right_load]
    type = ExtraNodesetGenerator
    input = left_load
    new_boundary = right_load
    coord = '112.5 30 0'
  []
  [left_support]
    type = ExtraNodesetGenerator
    input = right_load
    new_boundary = left_support
    coord = '0 0 0'
  []
  [right_support]
    type = ExtraNodesetGenerator
    input = left_support
    new_boundary = right_support
    coord = '150 0 0'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [Dc]
    initial_condition = -1.0
  []
[]
[AuxVariables]
  [Cc]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = -1.0
  []
  [mat_den]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = ${vol_frac}
  []
  [sensitivity]
    family = MONOMIAL
    order = FIRST
    initial_condition = -1.0
    [AuxKernel]
      type = MaterialRealAux
      variable = sensitivity
      property = sensitivity
      execute_on = LINEAR
    []
  []
  [mat_den_nodal]
    family = L2_LAGRANGE
    order = FIRST
    initial_condition = ${vol_frac}
    [AuxKernel]
      type = SelfAux
      execute_on = TIMESTEP_END
      variable = mat_den_nodal
      v = mat_den
    []
  []
  [Dc_elem]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = -1.0
    [AuxKernel]
      type = SelfAux
      variable = Dc_elem
      v = Dc
      execute_on = 'TIMESTEP_END'
    []
  []
[]
[Kernels]
  [diffusion]
    type = FunctionDiffusion
    variable = Dc
    function = 4.0
  []
  [potential]
    type = Reaction
    variable = Dc
  []
  [source]
    type = CoupledForce
    variable = Dc
    v = sensitivity
  []
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    strain = SMALL
    add_variables = true
    incremental = false
  []
[]
[BCs]
  [no_y]
    type = DirichletBC
    variable = disp_y
    boundary = left_support
    value = 0.0
  []
  [no_x]
    type = DirichletBC
    variable = disp_x
    boundary = left_support
    value = 0.0
  []
  [no_y_right]
    type = DirichletBC
    variable = disp_y
    boundary = right_support
    value = 0.0
  []
  [boundary_penalty]
    type = ADRobinBC
    variable = Dc
    boundary = 'bottom_bottom right_bottom left_bottom top_top right_top left_top'
    coefficient = 10
  []
[]
[NodalKernels]
  [left_down]
    type = NodalGravity
    variable = disp_y
    boundary = left_load
    gravity_value = -1e-3
    mass = 1
  []
  [right_down]
    type = NodalGravity
    variable = disp_y
    boundary = right_load
    gravity_value = -1e-3
    mass = 1
  []
[]
[Materials]
  [elasticity_tensor_one]
    type = ComputeVariableIsotropicElasticityTensor
    youngs_modulus = E_phys_one
    poissons_ratio = poissons_ratio
    args = 'mat_den'
    block = '1'
  []
  [elasticity_tensor_three]
    type = ComputeVariableIsotropicElasticityTensor
    youngs_modulus = E_phys_three
    poissons_ratio = poissons_ratio
    args = 'mat_den'
    block = '3'
  []
  # One: Tungsten
  [E_phys_one]
    type = DerivativeParsedMaterial
    # Emin + (density^penal) * (E0 - Emin)
    expression = '${Emin} + (mat_den ^ ${power}) * (${Et}-${Emin})'
    coupled_variables = 'mat_den'
    property_name = E_phys_one
    block = '1'
    outputs = 'exodus'
  []
  # Three: SS316
  [E_phys_three]
    type = DerivativeParsedMaterial
    # Emin + (density^penal) * (E0 - Emin)
    expression = '${Emin} + (mat_den ^ ${power}) * (${Ess}-${Emin})'
    coupled_variables = 'mat_den'
    property_name = E_phys_three
    block = '3'
    outputs = 'exodus'
  []
  [poissons_ratio]
    type = GenericConstantMaterial
    prop_names = poissons_ratio
    prop_values = 0.3
  []
  [stress]
    type = ComputeLinearElasticStress
  []
  [dc_one]
    type = ComplianceSensitivity
    design_density = mat_den
    youngs_modulus = E_phys_one
    block = '1'
  []
  [dc_three]
    type = ComplianceSensitivity
    design_density = mat_den
    youngs_modulus = E_phys_three
    block = '3'
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[UserObjects]
  [update_one]
    type = DensityUpdate
    density_sensitivity = Dc_elem
    design_density = mat_den
    volume_fraction = ${vol_frac}
    execute_on = TIMESTEP_BEGIN
    block = '1'
  []
  [update_three]
    type = DensityUpdate
    density_sensitivity = Dc_elem
    design_density = mat_den
    volume_fraction = ${vol_frac}
    execute_on = TIMESTEP_BEGIN
    block = '3'
  []
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu superlu_dist'
  nl_abs_tol = 1e-10
  dt = 1.0
  num_steps = 90
[]
[Outputs]
  exodus = true
  [out]
    type = CSV
    execute_on = 'TIMESTEP_END'
  []
  print_linear_residuals = false
[]
[Postprocessors]
  [mesh_volume]
    type = VolumePostprocessor
    execute_on = 'initial timestep_end'
  []
  [total_vol]
    type = ElementIntegralVariablePostprocessor
    variable = mat_den
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [vol_frac]
    type = ParsedPostprocessor
    expression = 'total_vol / mesh_volume'
    pp_names = 'total_vol mesh_volume'
  []
  [sensitivity]
    type = ElementIntegralMaterialProperty
    mat_prop = sensitivity
    block = '1 3'
  []
  [objective_one]
    type = ElementIntegralMaterialProperty
    mat_prop = strain_energy_density
    execute_on = 'INITIAL TIMESTEP_END'
    block = '1'
  []
  [objective_three]
    type = ElementIntegralMaterialProperty
    mat_prop = strain_energy_density
    execute_on = 'INITIAL TIMESTEP_END'
    block = '3'
  []
[]
(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
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/materials/1d_test_cpT.i)
L = 30
bulk_u = 0.01
p_ref = 101325.0
T_in = 860
q_source = 50000
A_cp = 976.78
B_cp = 1.0634
rho = 2000
advected_interp_method = 'upwind'
[Mesh]
  [gmg]
    type = GeneratedMeshGenerator
    dim = 1
    xmin = 0
    xmax = ${L}
    nx = 10
  []
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
  advected_interp_method = ${advected_interp_method}
  velocity_interp_method = 'rc'
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = vel_x
    pressure = pressure
  []
[]
[Variables]
  [vel_x]
    type = INSFVVelocityVariable
    initial_condition = ${bulk_u}
    two_term_boundary_expansion = false
  []
  [pressure]
    type = INSFVPressureVariable
    initial_condition = ${p_ref}
    two_term_boundary_expansion = false
  []
  [T]
    type = INSFVEnergyVariable
    two_term_boundary_expansion = false
    initial_condition = ${T_in}
  []
[]
[FVKernels]
  [mass]
    type = WCNSFVMassAdvection
    variable = pressure
    rho = 'rho'
  []
  [u_advection]
    type = INSFVMomentumAdvection
    variable = vel_x
    rho = 'rho'
    momentum_component = 'x'
  []
  [u_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_x
    mu = 'mu'
    momentum_component = 'x'
  []
  [u_pressure]
    type = INSFVMomentumPressure
    variable = vel_x
    momentum_component = 'x'
    pressure = pressure
  []
  [temp_conduction]
    type = FVDiffusion
    coeff = 'k'
    variable = T
  []
  [temp_advection]
    type = INSFVEnergyAdvection
    variable = T
  []
  [source]
    type = FVBodyForce
    variable = T
    function = source_func
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_x
    functor = ${bulk_u}
  []
  [inlet_T]
    type = FVDirichletBC
    variable = T
    boundary = 'left'
    value = ${T_in}
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = ${p_ref}
  []
[]
[Functions]
  [source_func]
    type = ParsedFunction
    expression = '${q_source}'
  []
[]
[FunctorMaterials]
  [converter_to_regular_T]
    type = FunctorADConverter
    ad_props_in = 'T'
    reg_props_out = 'T_nAD'
  []
  [ins_fv]
    type = INSFVEnthalpyFunctorMaterial
    temperature = 'T'
    rho = 'rho'
    cp = 'cp'
    assumed_constant_cp = false
    h_in = 'h'
    # Alternative to providing 'h': set the fluid property and the pressure parameter
    # fp = 'fp'
    # pressure = 'pressure'
  []
  [rho]
    type = ADParsedFunctorMaterial
    property_name = 'rho'
    expression = '${rho}'
  []
  [mu]
    type = ADParsedFunctorMaterial
    property_name = 'mu'
    expression = '4.5e-3'
  []
  [k]
    type = ADParsedFunctorMaterial
    property_name = 'k'
    expression = '0.7'
  []
  [h]
    type = ADParsedFunctorMaterial
    property_name = 'h'
    functor_names = 'T ${A_cp} ${B_cp}'
    functor_symbols = 'T A_cp B_cp'
    expression = 'A_cp * T + B_cp * T * T / 2'
  []
  [cp]
    type = ADParsedFunctorMaterial
    property_name = 'cp'
    functor_names = 'T ${A_cp} ${B_cp}'
    functor_symbols = 'T A_cp B_cp'
    expression = 'A_cp+B_cp*T'
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -pc_factor_shift_type'
  petsc_options_value = 'lu       NONZERO'
  nl_abs_tol = 1e-9
  nl_max_its = 50
  line_search = 'none'
  automatic_scaling = true
  off_diagonals_in_auto_scaling = true
[]
[Postprocessors]
  [H_in]
    type = VolumetricFlowRate
    vel_x = 'vel_x'
    advected_quantity = 'rho_h'
    boundary = 'left'
  []
  [H_out]
    type = VolumetricFlowRate
    vel_x = 'vel_x'
    advected_quantity = 'rho_h'
    boundary = 'right'
  []
  [Q]
    type = FunctionElementIntegral
    function = 'source_func'
    execute_on = 'initial'
  []
  [balance_in_percent]
    type = ParsedPostprocessor
    expression = '(H_out + H_in - Q) / H_in * 100'
    pp_names = 'H_in H_out Q'
  []
  [T_out]
    type = SideAverageValue
    variable = T
    boundary = 'right'
  []
  [T_analytical_outlet]
    type = Receiver
    default = ${fparse (-A_cp+sqrt(A_cp^2-2*B_cp*(-q_source/rho/bulk_u*L-A_cp*T_in-B_cp/2*T_in*T_in)))/B_cp}
  []
  [error_T]
    type = ParsedPostprocessor
    expression = 'T_out - T_analytical_outlet'
    pp_names = 'T_out T_analytical_outlet'
  []
[]
[Outputs]
  csv = true
[]
(modules/heat_transfer/test/tests/gap_heat_transfer_mortar/gap_heat_transfer_3D.i)
outer_htc = 10 # W/m^2/K
outer_Tinf = 300 # K
[GlobalParams]
  order = SECOND
  family = LAGRANGE
[]
[Mesh]
  [left_block]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 3
    ny = 6
    nz = 6
    xmin = -1
    xmax = -0.5
    ymin = -0.5
    ymax = 0.5
    zmin = -0.5
    zmax = 0.5
    elem_type = HEX27
  []
  [left_block_sidesets]
    type = RenameBoundaryGenerator
    input = left_block
    old_boundary = '0 1 2 3 4 5'
    new_boundary = 'left_bottom left_back left_right left_front left_left left_top'
  []
  [left_block_id]
    type = SubdomainIDGenerator
    input = left_block_sidesets
    subdomain_id = 1
  []
  [right_block]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 4
    ny = 8
    nz = 8
    xmin = 0.5
    xmax = 1
    ymin = -0.5
    ymax = 0.5
    zmin = -0.5
    zmax = 0.5
    elem_type = HEX27
  []
  [right_block_sidesets]
    type = RenameBoundaryGenerator
    input = right_block
    old_boundary = '0 1 2 3 4 5'
    # new_boundary = 'right_bottom right_back right_right right_front right_left right_top'
    new_boundary = '100 101 102 103 104 105'
  []
  [right_block_sidesets_rename]
    type = RenameBoundaryGenerator
    input = right_block_sidesets
    old_boundary = '100 101 102 103 104 105'
    new_boundary = 'right_bottom right_back right_right right_front right_left right_top'
  []
  [right_block_id]
    type = SubdomainIDGenerator
    input = right_block_sidesets_rename
    subdomain_id = 2
  []
  [combined_mesh]
    type = MeshCollectionGenerator
    inputs = 'left_block_id right_block_id'
  []
[]
[Functions]
  [temp]
    type = PiecewiseLinear
    x = '0   1'
    y = '100 200'
  []
[]
[Variables]
  [temp]
    initial_condition = 500
  []
[]
[AuxVariables]
  [gap_conductance]
    order = CONSTANT
    family = MONOMIAL
  []
  [power_density]
    block = 1
    initial_condition = 50e3
  []
[]
[Kernels]
  [heat_conduction]
    type = HeatConduction
    variable = temp
  []
  [heat_source]
    type = CoupledForce
    variable = temp
    block = 1
    v = power_density
  []
[]
[AuxKernels]
  [gap_cond]
    type = MaterialRealAux
    property = gap_conductance
    variable = gap_conductance
    boundary = 'left_right'
  []
[]
[Materials]
  [heat1]
    type = HeatConductionMaterial
    block = '1 2'
    specific_heat = 1.0
    thermal_conductivity = 34.6
  []
[]
[ThermalContact]
  [thermal_contact]
    type = GapHeatTransfer
    variable = temp
    primary = 'right_left'
    secondary = 'left_right'
    emissivity_primary = 0
    emissivity_secondary = 0
    gap_conductivity = 5
    gap_geometry_type = PLATE
  []
[]
[BCs]
  [RPV_out_BC] # k \nabla T = h (T- T_inf) at RPV outer boundary
    type = ConvectiveFluxFunction # (Robin BC)
    variable = temp
    boundary = 'right_right' # outer RPV
    coefficient = ${outer_htc}
    T_infinity = ${outer_Tinf}
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu       superlu_dist'
  dt = 1
  dtmin = 0.01
  end_time = 1
  nl_rel_tol = 1e-12
  nl_abs_tol = 1e-8
  [Quadrature]
    order = fifth
    side_order = seventh
  []
[]
[Outputs]
  exodus = true
  csv = true
  [Console]
    type = Console
  []
[]
[Postprocessors]
  [temp_left]
    type = SideAverageValue
    boundary = 'left_right'
    variable = temp
  []
  [temp_right]
    type = SideAverageValue
    boundary = 'right_left'
    variable = temp
  []
  [flux_left]
    type = SideDiffusiveFluxIntegral
    variable = temp
    boundary = 'left_right'
    diffusivity = thermal_conductivity
  []
  [flux_right]
    type = SideDiffusiveFluxIntegral
    variable = temp
    boundary = 'right_left'
    diffusivity = thermal_conductivity
  []
  [ptot]
    type = ElementIntegralVariablePostprocessor
    variable = power_density
    block = 1
  []
  [convective_out]
    type = ConvectiveHeatTransferSideIntegral
    T_solid = temp
    boundary = 'right_right' # outer RVP
    T_fluid = ${outer_Tinf}
    htc = ${outer_htc}
  []
  [heat_balance] # should be equal to 0 upon convergence
    type = ParsedPostprocessor
    expression = '(convective_out - ptot) / ptot'
    pp_names = 'convective_out ptot'
  []
[]
[VectorPostprocessors]
  [NodalTemperature]
    type = NodalValueSampler
    sort_by = id
    boundary = 'left_right right_left'
    variable = temp
  []
[]
(modules/heat_transfer/test/tests/gap_heat_transfer_radiation/cylinder.i)
#
# This problem is one of radiation boundary conditions between two
# cylindrical surfaces.
#
#            S(T1^4 - T2^4)                       R1
# flux1 = - ---------------- and flux2 = -flux1 * --
#           1    1 - e2   R1                      R2
#           -- + ------ * --
#           e1     e2     R2
#
# where S is the Stefan Boltzmann constant         5.67e-8 W/m^2/K^4
#       T1 is the temperature on the left surface  278 K
#       T2 is the temperature on the right surface 333 K
#       e1 is the emissivity for the left surface  0.8
#       e2 is the emissivity for the left surface  0.9
#       R1 is the radius of the inner surface      0.1 m
#       R2 is the radius of the outer surface      0.11 m
#
# Flux1:
# Exact           Code
# -------------   -------------
# -265.29 W/m^2   -265.26 W/m^2
#
# Flux2:
# Exact           Code
# -------------   -------------
#  241.26 W/m^2    241.15 W/m^2
#
thick = 0.01
R1 = 0.1
R2 = 0.11
[GlobalParams]
  order = second
  family = lagrange
[]
[Mesh]
  coord_type = RZ
  [mesh1]
    type = GeneratedMeshGenerator
    dim = 2
    elem_type = quad8
    nx = 4
    ny = 1
    xmin = '${fparse R1 - thick}'
    xmax = '${R1}'
    ymin = 0
    ymax = '${R1}'
    boundary_name_prefix = left
  []
  [mesh2]
    type = GeneratedMeshGenerator
    dim = 2
    elem_type = quad8
    nx = 4
    ny = 1
    xmin = '${R2}'
    xmax = '${fparse R2 + thick}'
    ymin = 0
    ymax = '${R1}'
    boundary_id_offset = 4
    boundary_name_prefix = right
  []
  [final]
    type = CombinerGenerator
    inputs = 'mesh1 mesh2'
  []
[]
[Variables]
  [temperature]
  []
[]
[Kernels]
  [heat_conduction]
    type = HeatConduction
    variable = temperature
  []
[]
[BCs]
  [left]
    type = DirichletBC
    variable = temperature
    boundary = left_left
    value = 278
  []
  [right]
    type = DirichletBC
    variable = temperature
    boundary = right_right
    value = 333
  []
[]
[Materials]
  [heat]
    type = HeatConductionMaterial
    thermal_conductivity = 200 # W/m/K
    specific_heat = 4.2e5
  []
[]
[ThermalContact]
  [thermal_contact]
    type = GapHeatTransfer
    variable = temperature
    primary = left_right
    secondary = right_left
    emissivity_primary = 0.8
    emissivity_secondary = 0.9
    quadrature = true
    gap_conductivity = 1e-40 # requires a positive value
    gap_geometry_type = cylinder
  []
[]
[Functions]
  [analytic_flux_1]
    type = ParsedFunction
    symbol_names = 'S        T1  T2  e1  e2  R1    R2'
    symbol_values = '5.67e-8 278 333 0.8 0.9 ${R1} ${R2}'
    expression = 'T14 := T1*T1*T1*T1;
                  T24 := T2*T2*T2*T2;
                  S*(T14-T24)/(1/e1+(1-e2)/e2*R1/R2)'
  []
  [analytic_flux_2]
    type = ParsedFunction
    symbol_names = 'S        T1  T2  e1  e2  R1    R2'
    symbol_values = '5.67e-8 278 333 0.8 0.9 ${R1} ${R2}'
    expression = 'T14 := T1*T1*T1*T1;
                  T24 := T2*T2*T2*T2;
                  -S*(T14-T24)/(1/e1+(1-e2)/e2*R1/R2)*R1/R2'
  []
[]
[Postprocessors]
  [code_flux_1]
    type = SideDiffusiveFluxAverage
    variable = temperature
    boundary = left_right
    diffusivity = thermal_conductivity
    execute_on = 'initial timestep_end'
  []
  [analytic_flux_1]
    type = FunctionValuePostprocessor
    function = analytic_flux_1
    execute_on = 'initial timestep_end'
  []
  [error_1]
    type = ParsedPostprocessor
    pp_names = 'code_flux_1 analytic_flux_1'
    expression = '(analytic_flux_1 - code_flux_1)/analytic_flux_1*100'
    execute_on = 'initial timestep_end'
  []
  [code_flux_2]
    type = SideDiffusiveFluxAverage
    variable = temperature
    boundary = right_left
    diffusivity = thermal_conductivity
    execute_on = 'initial timestep_end'
  []
  [analytic_flux_2]
    type = FunctionValuePostprocessor
    function = analytic_flux_2
    execute_on = 'initial timestep_end'
  []
  [error_2]
    type = ParsedPostprocessor
    pp_names = 'code_flux_2 analytic_flux_2'
    expression = '(analytic_flux_2 - code_flux_2)/analytic_flux_2*100'
    execute_on = 'initial timestep_end'
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = newton
  num_steps = 1
  dt = 1
  end_time = 1
  nl_abs_tol = 1e-12
  nl_rel_tol = 1e-10
[]
[Outputs]
  csv = true
[]
(modules/heat_transfer/test/tests/gap_heat_transfer_mortar/large_gap_heat_transfer_test_cylinder.i)
rpv_core_gap_size = 0.15
core_outer_radius = 2
rpv_inner_radius = '${fparse 2 + rpv_core_gap_size}'
rpv_outer_radius = '${fparse 2.5 + rpv_core_gap_size}'
rpv_outer_htc = 10 # W/m^2/K
rpv_outer_Tinf = 300 # K
core_blocks = '1'
rpv_blocks = '3'
[Mesh]
  [core_gap_rpv]
    type = ConcentricCircleMeshGenerator
    num_sectors = 10
    radii = '${core_outer_radius} ${rpv_inner_radius} ${rpv_outer_radius}'
    rings = '2 1 2'
    has_outer_square = false
    preserve_volumes = true
    portion = full
  []
  [rename_core_bdy]
    type = SideSetsBetweenSubdomainsGenerator
    input = core_gap_rpv
    primary_block = 1
    paired_block = 2
    new_boundary = 'core_outer'
  []
  [rename_inner_rpv_bdy]
    type = SideSetsBetweenSubdomainsGenerator
    input = rename_core_bdy
    primary_block = 3
    paired_block = 2
    new_boundary = 'rpv_inner'
  []
  [2d_mesh]
    type = BlockDeletionGenerator
    input = rename_inner_rpv_bdy
    block = 2
  []
  allow_renumbering = false
[]
[Variables]
  [Tsolid]
    initial_condition = 500
  []
[]
[Kernels]
  [heat_source]
    type = CoupledForce
    variable = Tsolid
    block = '${core_blocks}'
    v = power_density
  []
  [heat_conduction]
    type = HeatConduction
    variable = Tsolid
  []
[]
[BCs]
  [RPV_out_BC] # k \nabla T = h (T- T_inf) at RPV outer boundary
    type = ConvectiveFluxFunction # (Robin BC)
    variable = Tsolid
    boundary = 'outer' # outer RPV
    coefficient = ${rpv_outer_htc}
    T_infinity = ${rpv_outer_Tinf}
  []
[]
[ThermalContact]
  [RPV_gap]
    type = GapHeatTransfer
    gap_geometry_type = 'CYLINDER'
    emissivity_primary = 0.8
    emissivity_secondary = 0.8
    variable = Tsolid
    primary = 'core_outer'
    secondary = 'rpv_inner'
    gap_conductivity = 0.1
    quadrature = true
    cylinder_axis_point_1 = '0 0 0'
    cylinder_axis_point_2 = '0 0 5'
  []
[]
[AuxVariables]
  [power_density]
    block = '${core_blocks}'
    initial_condition = 50e3
  []
[]
[Materials]
  [simple_mat]
    type = HeatConductionMaterial
    thermal_conductivity = 34.6 # W/m/K
  []
[]
[Postprocessors]
  [Tcore_avg]
    type = ElementAverageValue
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Tcore_max]
    type = ElementExtremeValue
    value_type = max
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Tcore_min]
    type = ElementExtremeValue
    value_type = min
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Trpv_avg]
    type = ElementAverageValue
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [Trpv_max]
    type = ElementExtremeValue
    value_type = max
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [Trpv_min]
    type = ElementExtremeValue
    value_type = min
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [ptot]
    type = ElementIntegralVariablePostprocessor
    variable = power_density
    block = '${core_blocks}'
  []
  [rpv_convective_out]
    type = ConvectiveHeatTransferSideIntegral
    T_solid = Tsolid
    boundary = 'outer' # outer RVP
    T_fluid = ${rpv_outer_Tinf}
    htc = ${rpv_outer_htc}
  []
  [heat_balance] # should be equal to 0 upon convergence
    type = ParsedPostprocessor
    expression = '(rpv_convective_out - ptot) / ptot'
    pp_names = 'rpv_convective_out ptot'
  []
[]
[VectorPostprocessors]
  [NodalTemperature]
    type = NodalValueSampler
    sort_by = id
    boundary = 'rpv_inner core_outer'
    variable = Tsolid
  []
[]
[Executioner]
  type = Steady
  automatic_scaling = true
  compute_scaling_once = false
  petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart '
  petsc_options_value = 'hypre boomeramg 100'
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-10
  l_max_its = 100
  [Quadrature]
    side_order = seventh
  []
  line_search = none
[]
[Outputs]
  exodus = false
  csv = true
[]
(modules/heat_transfer/test/tests/gap_heat_transfer_balance/large_gap_heat_transfer_test_sphere.i)
sphere_outer_htc = 10 # W/m^2/K
sphere_outer_Tinf = 300 # K
[GlobalParams]
  order = SECOND
  family = LAGRANGE
[]
[Mesh]
  [file]
    type = FileMeshGenerator
    file = cyl2D.e
  []
  coord_type = RZ
[]
[Functions]
  [temp]
    type = PiecewiseLinear
    x = '0   1'
    y = '100 200'
  []
[]
[Variables]
  [temp]
    initial_condition = 500
  []
[]
[AuxVariables]
  [gap_conductance]
    order = CONSTANT
    family = MONOMIAL
  []
  [power_density]
    block = 'fuel'
    initial_condition = 50e3
  []
[]
[Kernels]
  [heat_conduction]
    type = HeatConduction
    variable = temp
  []
  [heat_source]
    type = CoupledForce
    variable = temp
    block = 'fuel'
    v = power_density
  []
[]
[AuxKernels]
  [gap_cond]
    type = MaterialRealAux
    property = gap_conductance
    variable = gap_conductance
    boundary = 2
  []
[]
[Materials]
  [heat1]
    type = HeatConductionMaterial
    block = '1 2'
    specific_heat = 1.0
    thermal_conductivity = 34.6
  []
[]
[ThermalContact]
  [thermal_contact]
    type = GapHeatTransfer
    variable = temp
    primary = 3
    secondary = 2
    emissivity_primary = 0.8
    emissivity_secondary = 0.8
    gap_conductivity = 0.1
    quadrature = true
    gap_geometry_type = SPHERE
    sphere_origin = '0 0 0'
  []
[]
[BCs]
  [RPV_out_BC] # k \nabla T = h (T- T_inf) at RPV outer boundary
    type = ConvectiveFluxFunction # (Robin BC)
    variable = temp
    boundary = '4' # outer RPV
    coefficient = ${sphere_outer_htc}
    T_infinity = ${sphere_outer_Tinf}
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu       superlu_dist'
  dt = 1
  dtmin = 0.01
  end_time = 1
  nl_rel_tol = 1e-12
  nl_abs_tol = 1e-7
  [Quadrature]
    order = fifth
    side_order = seventh
  []
[]
[Outputs]
  exodus = false
  csv = true
  [Console]
    type = Console
  []
[]
[Postprocessors]
  [temp_left]
    type = SideAverageValue
    boundary = 2
    variable = temp
  []
  [temp_right]
    type = SideAverageValue
    boundary = 3
    variable = temp
  []
  [flux_left]
    type = SideDiffusiveFluxIntegral
    variable = temp
    boundary = 2
    diffusivity = thermal_conductivity
  []
  [flux_right]
    type = SideDiffusiveFluxIntegral
    variable = temp
    boundary = 3
    diffusivity = thermal_conductivity
  []
  [ptot]
    type = ElementIntegralVariablePostprocessor
    variable = power_density
    block = 'fuel'
  []
  [sphere_convective_out]
    type = ConvectiveHeatTransferSideIntegral
    T_solid = temp
    boundary = '4' # outer RVP
    T_fluid = ${sphere_outer_Tinf}
    htc = ${sphere_outer_htc}
  []
  [heat_balance] # should be equal to 0 upon convergence
    type = ParsedPostprocessor
    expression = '(sphere_convective_out - ptot) / ptot'
    pp_names = 'sphere_convective_out ptot'
  []
[]
(modules/heat_transfer/test/tests/gap_heat_transfer_mortar/gap_heat_transfer_3D_mortar.i)
outer_htc = 10 # W/m^2/K
outer_Tinf = 300 # K
[GlobalParams]
  order = SECOND
  family = LAGRANGE
[]
[Problem]
  kernel_coverage_check = false
  material_coverage_check = false
[]
[Mesh]
  [left_block]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 3
    ny = 6
    nz = 6
    xmin = -1
    xmax = -0.5
    ymin = -0.5
    ymax = 0.5
    zmin = -0.5
    zmax = 0.5
    elem_type = HEX27
  []
  [left_block_sidesets]
    type = RenameBoundaryGenerator
    input = left_block
    old_boundary = '0 1 2 3 4 5'
    new_boundary = 'left_bottom left_back left_right left_front left_left left_top'
  []
  [left_block_id]
    type = SubdomainIDGenerator
    input = left_block_sidesets
    subdomain_id = 1
  []
  [right_block]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 4
    ny = 8
    nz = 8
    xmin = 0.5
    xmax = 1
    ymin = -0.5
    ymax = 0.5
    zmin = -0.5
    zmax = 0.5
    elem_type = HEX27
  []
  [right_block_sidesets]
    type = RenameBoundaryGenerator
    input = right_block
    old_boundary = '0 1 2 3 4 5'
    # new_boundary = 'right_bottom right_back right_right right_front right_left right_top'
    new_boundary = '100 101 102 103 104 105'
  []
  [right_block_sidesets_rename]
    type = RenameBoundaryGenerator
    input = right_block_sidesets
    old_boundary = '100 101 102 103 104 105'
    new_boundary = 'right_bottom right_back right_right right_front right_left right_top'
  []
  [right_block_id]
    type = SubdomainIDGenerator
    input = right_block_sidesets_rename
    subdomain_id = 2
  []
  [combined_mesh]
    type = MeshCollectionGenerator
    inputs = 'left_block_id right_block_id'
  []
  [left_lower]
    type = LowerDBlockFromSidesetGenerator
    input = combined_mesh
    sidesets = 'left_right'
    new_block_id = '10001'
    new_block_name = 'secondary_lower'
  []
  [right_lower]
    type = LowerDBlockFromSidesetGenerator
    input = left_lower
    sidesets = 'right_left'
    new_block_id = '10000'
    new_block_name = 'primary_lower'
  []
[]
[Functions]
  [temp]
    type = PiecewiseLinear
    x = '0   1'
    y = '100 200'
  []
[]
[Variables]
  [temp]
    initial_condition = 500
  []
  [lm]
    order = SECOND
    family = LAGRANGE
    block = 'secondary_lower'
  []
[]
[AuxVariables]
  [power_density]
    block = 1
    initial_condition = 50e3
  []
[]
[Kernels]
  [heat_conduction]
    type = HeatConduction
    variable = temp
    block = '1 2'
  []
  [heat_source]
    type = CoupledForce
    variable = temp
    block = '1'
    v = power_density
  []
[]
[Materials]
  [heat1]
    type = HeatConductionMaterial
    block = '1 2'
    specific_heat = 1.0
    thermal_conductivity = 34.6
  []
[]
[UserObjects]
  [radiation]
    type = GapFluxModelRadiation
    temperature = temp
    boundary = 'left_right'
    primary_emissivity = 0.0
    secondary_emissivity = 0.0
  []
  [conduction]
    type = GapFluxModelConduction
    temperature = temp
    boundary = 'left_right'
    gap_conductivity = 5.0
  []
[]
[Constraints]
  [ced]
    type = ModularGapConductanceConstraint
    variable = lm
    secondary_variable = temp
    primary_boundary = 'right_left'
    primary_subdomain = 'primary_lower'
    secondary_boundary = 'left_right'
    secondary_subdomain = 'secondary_lower'
    gap_flux_models = 'radiation conduction'
    gap_geometry_type = PLATE
  []
[]
[BCs]
  [RPV_out_BC] # k \nabla T = h (T- T_inf) at RPV outer boundary
    type = ConvectiveFluxFunction # (Robin BC)
    variable = temp
    boundary = 'right_right' # outer RPV
    coefficient = ${outer_htc}
    T_infinity = ${outer_Tinf}
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu       superlu_dist'
  dt = 1
  dtmin = 0.01
  end_time = 1
  nl_rel_tol = 1e-12
  nl_abs_tol = 1e-8
[]
[Outputs]
  exodus = true
  csv = true
  [Console]
    type = Console
  []
[]
[Postprocessors]
  [temp_left]
    type = SideAverageValue
    boundary = 'left_right'
    variable = temp
  []
  [temp_right]
    type = SideAverageValue
    boundary = 'right_left'
    variable = temp
  []
  [flux_left]
    type = SideDiffusiveFluxIntegral
    variable = temp
    boundary = 'left_right'
    diffusivity = thermal_conductivity
  []
  [flux_right]
    type = SideDiffusiveFluxIntegral
    variable = temp
    boundary = 'right_left'
    diffusivity = thermal_conductivity
  []
  [ptot]
    type = ElementIntegralVariablePostprocessor
    variable = power_density
    block = 1
  []
  [convective_out]
    type = ConvectiveHeatTransferSideIntegral
    T_solid = temp
    boundary = 'right_right' # outer RVP
    T_fluid = ${outer_Tinf}
    htc = ${outer_htc}
  []
  [heat_balance] # should be equal to 0 upon convergence
    type = ParsedPostprocessor
    expression = '(convective_out - ptot) / ptot'
    pp_names = 'convective_out ptot'
  []
[]
[VectorPostprocessors]
  [NodalTemperature]
    type = NodalValueSampler
    sort_by = id
    boundary = 'left_right right_left'
    variable = temp
  []
[]
(modules/heat_transfer/test/tests/gap_heat_transfer_mortar/gap_heat_transfer_sphere3D_mortar.i)
sphere_outer_htc = 10 # W/m^2/K
sphere_outer_Tinf = 300 # K
[GlobalParams]
  order = SECOND
  family = LAGRANGE
[]
[Problem]
  kernel_coverage_check = false
  material_coverage_check = false
[]
[Mesh]
  [file]
    type = FileMeshGenerator
    file = sphere3D.e
  []
  [secondary]
    type = LowerDBlockFromSidesetGenerator
    sidesets = '2'
    new_block_id = 10001
    new_block_name = 'secondary_lower'
    input = file
  []
  [primary]
    type = LowerDBlockFromSidesetGenerator
    sidesets = '3'
    new_block_id = 10000
    new_block_name = 'primary_lower'
    input = secondary
  []
[]
[Functions]
  [temp]
    type = PiecewiseLinear
    x = '0   1'
    y = '100 200'
  []
[]
[Variables]
  [temp]
    initial_condition = 500
  []
  [lm]
    order = FIRST
    family = LAGRANGE
    block = 'secondary_lower'
  []
[]
[AuxVariables]
  # [gap_conductance]
  #   order = CONSTANT
  #   family = MONOMIAL
  # []
  [power_density]
    block = 'fuel'
    initial_condition = 50e3
  []
[]
[Kernels]
  [heat_conduction]
    type = HeatConduction
    variable = temp
    block = '1 2'
  []
  [heat_source]
    type = CoupledForce
    variable = temp
    block = 'fuel'
    v = power_density
  []
[]
# [AuxKernels]
#   [gap_cond]
#     type = MaterialRealAux
#     property = gap_conductance
#     variable = gap_conductance
#     boundary = 2
#   []
# []
[Materials]
  [heat1]
    type = HeatConductionMaterial
    block = '1 2'
    specific_heat = 1.0
    thermal_conductivity = 34.6
  []
[]
[UserObjects]
  [radiation]
    type = GapFluxModelRadiation
    temperature = temp
    boundary = 2
    primary_emissivity = 0.0
    secondary_emissivity = 0.0
  []
  [conduction]
    type = GapFluxModelConduction
    temperature = temp
    boundary = 2
    gap_conductivity = 5.0
  []
[]
[Constraints]
  [ced]
    type = ModularGapConductanceConstraint
    variable = lm
    secondary_variable = temp
    primary_boundary = 3
    primary_subdomain = 10000
    secondary_boundary = 2
    secondary_subdomain = 10001
    gap_flux_models = 'radiation conduction'
    gap_geometry_type = SPHERE
    sphere_origin = '0 0 0'
  []
[]
[BCs]
  [RPV_out_BC] # k \nabla T = h (T- T_inf) at RPV outer boundary
    type = ConvectiveFluxFunction # (Robin BC)
    variable = temp
    boundary = '4' # outer RPV
    coefficient = ${sphere_outer_htc}
    T_infinity = ${sphere_outer_Tinf}
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu       superlu_dist'
  dt = 1
  dtmin = 0.01
  end_time = 1
  nl_rel_tol = 1e-12
  nl_abs_tol = 1e-7
[]
[Outputs]
  exodus = true
  csv = true
  [Console]
    type = Console
  []
[]
[Postprocessors]
  [temp_left]
    type = SideAverageValue
    boundary = 2
    variable = temp
  []
  [temp_right]
    type = SideAverageValue
    boundary = 3
    variable = temp
  []
  [flux_left]
    type = SideDiffusiveFluxIntegral
    variable = temp
    boundary = 2
    diffusivity = thermal_conductivity
  []
  [flux_right]
    type = SideDiffusiveFluxIntegral
    variable = temp
    boundary = 3
    diffusivity = thermal_conductivity
  []
  [ptot]
    type = ElementIntegralVariablePostprocessor
    variable = power_density
    block = 'fuel'
  []
  [sphere_convective_out]
    type = ConvectiveHeatTransferSideIntegral
    T_solid = temp
    boundary = '4' # outer RVP
    T_fluid = ${sphere_outer_Tinf}
    htc = ${sphere_outer_htc}
  []
  [heat_balance] # should be equal to 0 upon convergence
    type = ParsedPostprocessor
    expression = '(sphere_convective_out - ptot) / ptot'
    pp_names = 'sphere_convective_out ptot'
  []
[]
[VectorPostprocessors]
  [NodalTemperature]
    type = NodalValueSampler
    sort_by = id
    boundary = '2 3'
    variable = temp
  []
[]
(modules/combined/test/tests/electromagnetic_joule_heating/microwave_heating.i)
# Test for ADJouleHeatingSource
#
# This test utilizes the method of manufactured solutions, such that
# all terms of the PDE's and all supplied parameter are are non-zero.
# The exact PDE's are the following:
#
#   curl(curl(E)) - mu*omega^2*epsilon*E + j*mu*omega*sigma*E = F_E_supplied
#   div(-grad(n)) - 0.5*Re(sigma*E * E^*) = F_n_supplied
#
# Where:
#   - E is the electric field
#   - mu is the permeability
#   - omega is the angular frequency of the system
#   - epsilon is the permittivity
#   - j is the sqrt(-1)
#   - sigma is the electric conductivity
#   - F_E_supplied is the forcing term of the electric field MMS
#   - n is the energy density of a species
#       (this is analogous to the electron energy density in plasma physics)
#   - E^* is the complex conjugate of the electric field
#   - F_n_supplied is the forcing term of the energy density MMS
#
# All boundary conditions in this test are Dirichlet BCs. The manufactured
# solutions are as follow:
#
# Manufactured solution: E_real = cos(pi*y) * x_hat - cos(pi*x) * y_hat
#                        E_imag = sin(pi*y) * x_hat - sin(pi*x) * y_hat
#                        n = x^2*y^2
[Mesh]
  [gmg]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 5
    ny = 5
    xmin = -1
    ymin = -1
    elem_type = QUAD9
  []
[]
[Functions]
  #The exact solution for the heated species and electric field real and imag. component
  [exact_real]
    type = ParsedVectorFunction
    expression_x = 'cos(pi*y)'
    expression_y = '-cos(pi*x)'
  []
  [exact_imag]
    type = ParsedVectorFunction
    expression_x = 'sin(pi*y)'
    expression_y = '-sin(pi*x)'
  []
  [exact_n]
    type = ParsedFunction
    expression = 'x^2*y^2'
  []
  #The forcing terms for the heated species and electric field real and imag. component
  [source_real]
    type = ParsedVectorFunction
    symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
    symbol_values = 'omega   mu   epsilon   sigma   omega   mu   epsilon   sigma'
    expression_x = '-epsilon_i*mu_i*omega_i^2*cos(pi*y) - 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*y) + epsilon_i*mu_i*omega_r^2*cos(pi*y) - epsilon_i*mu_r*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_r*omega_r^2*sin(pi*y) - epsilon_r*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_r*mu_i*omega_r^2*sin(pi*y) + epsilon_r*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_r*omega_r^2*cos(pi*y) + mu_i*omega_i*sigma_i*cos(pi*y) + mu_i*omega_i*sigma_r*sin(pi*y) + mu_i*omega_r*sigma_i*sin(pi*y) - mu_i*omega_r*sigma_r*cos(pi*y) + mu_r*omega_i*sigma_i*sin(pi*y) - mu_r*omega_i*sigma_r*cos(pi*y) - mu_r*omega_r*sigma_i*cos(pi*y) - mu_r*omega_r*sigma_r*sin(pi*y) + pi^2*cos(pi*y)'
    expression_y = 'epsilon_i*mu_i*omega_i^2*cos(pi*x) + 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*x) - epsilon_i*mu_i*omega_r^2*cos(pi*x) + epsilon_i*mu_r*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_r*omega_r^2*sin(pi*x) + epsilon_r*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_r*mu_i*omega_r^2*sin(pi*x) - epsilon_r*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_r*omega_r^2*cos(pi*x) - mu_i*omega_i*sigma_i*cos(pi*x) - mu_i*omega_i*sigma_r*sin(pi*x) - mu_i*omega_r*sigma_i*sin(pi*x) + mu_i*omega_r*sigma_r*cos(pi*x) - mu_r*omega_i*sigma_i*sin(pi*x) + mu_r*omega_i*sigma_r*cos(pi*x) + mu_r*omega_r*sigma_i*cos(pi*x) + mu_r*omega_r*sigma_r*sin(pi*x) - pi^2*cos(pi*x)'
  []
  [source_imag]
    type = ParsedVectorFunction
    symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
    symbol_values = 'omega   mu   epsilon   sigma   omega   mu   epsilon   sigma'
    expression_x = '-epsilon_i*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_i*omega_r^2*sin(pi*y) + epsilon_i*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_i*mu_r*omega_r^2*cos(pi*y) + epsilon_r*mu_i*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_i*omega_r^2*cos(pi*y) + epsilon_r*mu_r*omega_i^2*sin(pi*y) - 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*y) - epsilon_r*mu_r*omega_r^2*sin(pi*y) + mu_i*omega_i*sigma_i*sin(pi*y) - mu_i*omega_i*sigma_r*cos(pi*y) - mu_i*omega_r*sigma_i*cos(pi*y) - mu_i*omega_r*sigma_r*sin(pi*y) - mu_r*omega_i*sigma_i*cos(pi*y) - mu_r*omega_i*sigma_r*sin(pi*y) - mu_r*omega_r*sigma_i*sin(pi*y) + mu_r*omega_r*sigma_r*cos(pi*y) + pi^2*sin(pi*y)'
    expression_y = 'epsilon_i*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_i*omega_r^2*sin(pi*x) - epsilon_i*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_i*mu_r*omega_r^2*cos(pi*x) - epsilon_r*mu_i*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_i*omega_r^2*cos(pi*x) - epsilon_r*mu_r*omega_i^2*sin(pi*x) + 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*x) + epsilon_r*mu_r*omega_r^2*sin(pi*x) - mu_i*omega_i*sigma_i*sin(pi*x) + mu_i*omega_i*sigma_r*cos(pi*x) + mu_i*omega_r*sigma_i*cos(pi*x) + mu_i*omega_r*sigma_r*sin(pi*x) + mu_r*omega_i*sigma_i*cos(pi*x) + mu_r*omega_i*sigma_r*sin(pi*x) + mu_r*omega_r*sigma_i*sin(pi*x) - mu_r*omega_r*sigma_r*cos(pi*x) - pi^2*sin(pi*x)'
  []
  [source_n]
    type = ParsedFunction
    symbol_names = 'sigma_r'
    symbol_values = 'sigma'
    expression = '-2*x^2 - 2*y^2 - 0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
  []
  #Material Coefficients
  [omega]
    type = ParsedFunction
    expression = '2.0'
  []
  [mu]
    type = ParsedFunction
    expression = '1.0'
  []
  [epsilon]
    type = ParsedFunction
    expression = '3.0'
  []
  [sigma]
    type = ParsedFunction
    expression = '4.0'
    #expression = 'x^2*y^2'
  []
[]
[Materials]
  [WaveCoeff]
    type = WaveEquationCoefficient
    eps_rel_imag = eps_imag
    eps_rel_real = eps_real
    k_real = k_real
    k_imag = k_imag
    mu_rel_imag = mu_imag
    mu_rel_real = mu_real
  []
  [eps_real]
    type = ADGenericFunctionMaterial
    prop_names = eps_real
    prop_values = epsilon
  []
  [eps_imag]
    type = ADGenericFunctionMaterial
    prop_names = eps_imag
    prop_values = epsilon
  []
  [mu_real]
    type = ADGenericFunctionMaterial
    prop_names = mu_real
    prop_values = mu
  []
  [mu_imag]
    type = ADGenericFunctionMaterial
    prop_names = mu_imag
    prop_values = mu
  []
  [k_real]
    type = ADGenericFunctionMaterial
    prop_names = k_real
    prop_values = omega
  []
  [k_imag]
    type = ADGenericFunctionMaterial
    prop_names = k_imag
    prop_values = omega
  []
  [cond_real]
    type = ADGenericFunctionMaterial
    prop_names = cond_real
    prop_values = sigma
  []
  [cond_imag]
    type = ADGenericFunctionMaterial
    prop_names = cond_imag
    prop_values = sigma
  []
  [ElectromagneticMaterial]
    type = ElectromagneticHeatingMaterial
    electric_field = E_real
    complex_electric_field = E_imag
    electric_field_heating_name = electric_field_heating
    electrical_conductivity = cond_real
    formulation = FREQUENCY
    solver = ELECTROMAGNETIC
  []
[]
[Variables]
  [n]
    family = LAGRANGE
    order = FIRST
  []
  [E_real]
    family = NEDELEC_ONE
    order = FIRST
  []
  [E_imag]
    family = NEDELEC_ONE
    order = FIRST
  []
[]
[Kernels]
  [curl_curl_real]
    type = CurlCurlField
    variable = E_real
  []
  [coeff_real]
    type = ADMatWaveReaction
    variable = E_real
    field_real =  E_real
    field_imag =  E_imag
    wave_coef_real = wave_equation_coefficient_real
    wave_coef_imag = wave_equation_coefficient_imaginary
    component = real
  []
  [conduction_real]
    type = ADConductionCurrent
    variable = E_real
    field_imag =  E_imag
    field_real =  E_real
    conductivity_real = cond_real
    conductivity_imag = cond_imag
    ang_freq_real = k_real
    ang_freq_imag = k_imag
    permeability_real = mu_real
    permeability_imag = mu_imag
    component = real
  []
  [body_force_real]
    type = VectorBodyForce
    variable = E_real
    function = source_real
  []
  [curl_curl_imag]
    type = CurlCurlField
    variable = E_imag
  []
  [coeff_imag]
    type = ADMatWaveReaction
    variable = E_imag
    field_real =  E_real
    field_imag =  E_imag
    wave_coef_real = wave_equation_coefficient_real
    wave_coef_imag = wave_equation_coefficient_imaginary
    component = imaginary
  []
  [conduction_imag]
    type = ADConductionCurrent
    variable = E_imag
    field_imag =  E_imag
    field_real =  E_real
    conductivity_real = cond_real
    conductivity_imag = cond_imag
    ang_freq_real = k_real
    ang_freq_imag = k_imag
    permeability_real = mu_real
    permeability_imag = mu_imag
    component = imaginary
  []
  [body_force_imag]
    type = VectorBodyForce
    variable = E_imag
    function = source_imag
  []
  [n_diffusion]
    type = Diffusion
    variable = n
  []
  [microwave_heating]
    type = ADJouleHeatingSource
    variable = n
    heating_term = 'electric_field_heating'
  []
  [body_force_n]
    type = BodyForce
    variable = n
    function = source_n
  []
[]
[BCs]
  [sides_real]
    type = VectorCurlPenaltyDirichletBC
    variable = E_real
    function = exact_real
    penalty = 1e8
    boundary = 'left right top bottom'
  []
  [sides_imag]
    type = VectorCurlPenaltyDirichletBC
    variable = E_imag
    function = exact_imag
    penalty = 1e8
    boundary = 'left right top bottom'
  []
  [sides_n]
    type = FunctorDirichletBC
    variable = n
    boundary = 'left right top bottom'
    functor = exact_n
    preset = false
  []
[]
[Postprocessors]
  [error_real]
    type = ElementVectorL2Error
    variable = E_real
    function = exact_real
  []
  [error_imag]
    type = ElementVectorL2Error
    variable = E_imag
    function = exact_imag
  []
  [error_n]
    type = ElementL2Error
    variable = n
    function = exact_n
  []
  [h]
    type = AverageElementSize
  []
  [h_squared]
    type = ParsedPostprocessor
    pp_names = 'h'
    expression = 'h * h'
  []
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-12
[]
[Outputs]
  exodus = true
  csv = true
[]
(modules/combined/examples/optimization/thermomechanical/thermomechanical_main.i)
vol_frac = 0.4
power = 2.0
E0 = 1.0e-6
E1 = 1.0
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Mesh]
  [MeshGenerator]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 40
    ny = 40
    xmin = 0
    xmax = 40
    ymin = 0
    ymax = 40
  []
  [node]
    type = ExtraNodesetGenerator
    input = MeshGenerator
    new_boundary = hold
    nodes = 0
  []
  [push_left]
    type = ExtraNodesetGenerator
    input = node
    new_boundary = push_left
    coord = '16 0 0'
  []
  [push_center]
    type = ExtraNodesetGenerator
    input = push_left
    new_boundary = push_center
    coord = '24 0 0'
  []
  [extra]
    type = SideSetsFromBoundingBoxGenerator
    input = push_center
    bottom_left = '-0.01 17.999  0'
    top_right = '5 22.001  0'
    boundary_new = n1
    included_boundaries = left
  []
  [dirichlet_bc]
    type = SideSetsFromNodeSetsGenerator
    input = extra
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
[]
[AuxVariables]
  [mat_den]
    family = MONOMIAL
    order = FIRST
    initial_condition = 0.02
  []
  [sensitivity_one]
    family = MONOMIAL
    order = FIRST
    initial_condition = -1.0
  []
  [sensitivity_two]
    family = MONOMIAL
    order = FIRST
    initial_condition = -1.0
  []
  [total_sensitivity]
    family = MONOMIAL
    order = FIRST
    initial_condition = -1.0
  []
[]
[AuxKernels]
  [total_sensitivity]
    type = ParsedAux
    variable = total_sensitivity
    expression = '(1-1.0e-7)*sensitivity_one + 1.0e-7*sensitivity_two'
    coupled_variables = 'sensitivity_one sensitivity_two'
    execute_on = 'LINEAR TIMESTEP_END'
  []
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    strain = SMALL
    add_variables = true
    incremental = false
  []
[]
[BCs]
  [no_y]
    type = DirichletBC
    variable = disp_y
    boundary = hold
    value = 0.0
  []
  [no_x_symm]
    type = DirichletBC
    variable = disp_x
    boundary = right
    value = 0.0
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeVariableIsotropicElasticityTensor
    youngs_modulus = E_phys
    poissons_ratio = poissons_ratio
    args = 'mat_den'
  []
  [E_phys]
    type = DerivativeParsedMaterial
    # Emin + (density^penal) * (E0 - Emin)
    expression = '${E1} + (mat_den ^ ${power}) * (${E1}-${E0})'
    coupled_variables = 'mat_den'
    property_name = E_phys
  []
  [poissons_ratio]
    type = GenericConstantMaterial
    prop_names = poissons_ratio
    prop_values = 0.3
  []
  [stress]
    type = ComputeLinearElasticStress
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[UserObjects]
  # We do filtering in the subapps
  [update]
    type = DensityUpdate
    density_sensitivity = total_sensitivity
    design_density = mat_den
    volume_fraction = ${vol_frac}
    execute_on = MULTIAPP_FIXED_POINT_BEGIN
  []
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu superlu_dist'
  nl_abs_tol = 1e-8
  dt = 1.0
  num_steps = 2
[]
[Outputs]
  [out]
    type = CSV
    execute_on = 'TIMESTEP_END'
  []
  print_linear_residuals = false
  exodus = true
[]
[Postprocessors]
  [mesh_volume]
    type = VolumePostprocessor
    execute_on = 'initial timestep_end'
  []
  [total_vol]
    type = ElementIntegralVariablePostprocessor
    variable = mat_den
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [vol_frac]
    type = ParsedPostprocessor
    expression = 'total_vol / mesh_volume'
    pp_names = 'total_vol mesh_volume'
  []
  [sensitivity]
    type = ElementIntegralVariablePostprocessor
    variable = total_sensitivity
  []
[]
[MultiApps]
  [sub_app_one]
    type = TransientMultiApp
    input_files = structural_sub.i
  []
  [sub_app_two]
    type = TransientMultiApp
    input_files = thermal_sub.i
  []
[]
[Transfers]
  # First SUB-APP: STRUCTURAL
  # To subapp densities
  [subapp_one_density]
    type = MultiAppCopyTransfer
    to_multi_app = sub_app_one
    source_variable = mat_den # Here
    variable = mat_den
  []
  # From subapp sensitivity
  [subapp_one_sensitivity]
    type = MultiAppCopyTransfer
    from_multi_app = sub_app_one
    source_variable = Dc # sensitivity_var
    variable = sensitivity_one # Here
  []
  # Second SUB-APP: HEAT CONDUCTIVITY
  # To subapp densities
  [subapp_two_density]
    type = MultiAppCopyTransfer
    to_multi_app = sub_app_two
    source_variable = mat_den # Here
    variable = mat_den
  []
  # From subapp sensitivity
  [subapp_two_sensitivity]
    type = MultiAppCopyTransfer
    from_multi_app = sub_app_two
    source_variable = Tc # sensitivity_var
    variable = sensitivity_two # Here
  []
[]
(modules/navier_stokes/test/tests/postprocessors/pressure_drop/drop_insad.i)
[Mesh]
  second_order = true
  inactive = 'mesh internal_boundary_bot internal_boundary_top'
  [mesh]
    type = CartesianMeshGenerator
    dim = 2
    dx = '1'
    dy = '1 1 1'
    ix = '5'
    iy = '5 5 5'
    subdomain_id = '1
                    2
                    3'
  []
  [internal_boundary_bot]
    type = SideSetsBetweenSubdomainsGenerator
    input = mesh
    new_boundary = 'internal_bot'
    primary_block = 1
    paired_block = 2
  []
  [internal_boundary_top]
    type = SideSetsBetweenSubdomainsGenerator
    input = internal_boundary_bot
    new_boundary = 'internal_top'
    primary_block = 2
    paired_block = 3
  []
  [diverging_mesh]
    type = FileMeshGenerator
    file = 'expansion_quad.e'
  []
[]
[Modules]
  [IncompressibleNavierStokes]
    equation_type = steady-state
    # no slip BCs
    velocity_boundary = 'bottom right left'
    velocity_function = '0 1    0 0   0 0'
    pressure_boundary = 'top'
    pressure_function = '1'
    density_name = rho
    dynamic_viscosity_name = mu
    integrate_p_by_parts = false
    order = SECOND
  []
[]
[Materials]
  [const]
    type = GenericConstantMaterial
    block = '1 2 3'
    prop_names = 'rho mu'
    prop_values = '1  1'
  []
[]
[FunctorMaterials]
  [ADconst]
    type = ADGenericFunctorMaterial
    block = '1 2 3'
    prop_names = 'rho_ad'
    prop_values = '1'
  []
  [vel_functor]
    type = ADGenericVectorFunctorMaterial
    prop_names = 'velocity'
    prop_values = 'vel_x vel_y 0'
  []
[]
[Preconditioning]
  [SMP_PJFNK]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Steady
  solve_type = PJFNK
  petsc_options_iname = '-ksp_gmres_restart -pc_type -sub_pc_type -sub_pc_factor_levels'
  petsc_options_value = '300                bjacobi  ilu          4'
  line_search = none
  nl_rel_tol = 1e-12
  nl_max_its = 6
  l_tol = 1e-6
  l_max_its = 300
[]
[Postprocessors]
  [pdrop_total]
    type = PressureDrop
    pressure = p
    upstream_boundary = 'bottom'
    downstream_boundary = 'top'
    boundary = 'top bottom'
  []
  [pdrop_mid1]
    type = PressureDrop
    pressure = p
    upstream_boundary = 'bottom'
    downstream_boundary = 'internal_bot'
    boundary = 'bottom internal_bot'
  []
  [pdrop_mid2]
    type = PressureDrop
    pressure = p
    upstream_boundary = 'internal_bot'
    downstream_boundary = 'internal_top'
    boundary = 'internal_top internal_bot'
  []
  [pdrop_mid3]
    type = PressureDrop
    pressure = p
    upstream_boundary = 'internal_top'
    downstream_boundary = 'top'
    boundary = 'top internal_top'
  []
  [sum_drops]
    type = ParsedPostprocessor
    expression = 'pdrop_mid1 + pdrop_mid2 + pdrop_mid3'
    pp_names = 'pdrop_mid1 pdrop_mid2 pdrop_mid3'
  []
  [p_upstream]
    type = SideAverageValue
    variable = p
    boundary = 'bottom'
  []
  [p_downstream]
    type = SideAverageValue
    variable = p
    boundary = 'top'
  []
[]
[Outputs]
  exodus = false
  csv = true
[]
(modules/solid_mechanics/test/tests/rom_stress_update/ad_verification.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[AuxVariables]
  [temperature]
  []
[]
[AuxKernels]
  [temp_aux]
    type = FunctionAux
    variable = temperature
    function = temp_fcn
    execute_on = 'initial timestep_begin'
  []
[]
[Functions]
  [rhom_fcn]
    type = PiecewiseConstant
    data_file = ss316_verification_data.csv
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    xy_in_file_only = false
    direction = LEFT_INCLUSIVE
  []
  [rhoi_fcn]
    type = PiecewiseConstant
    data_file = ss316_verification_data.csv
    x_index_in_file = 0
    y_index_in_file = 2
    format = columns
    xy_in_file_only = false
    direction = LEFT_INCLUSIVE
  []
  [vmJ2_fcn]
    type = PiecewiseConstant
    data_file = ss316_verification_data.csv
    x_index_in_file = 0
    y_index_in_file = 3
    format = columns
    xy_in_file_only = false
    direction = LEFT_INCLUSIVE
  []
  [evm_fcn]
    type = PiecewiseConstant
    data_file = ss316_verification_data.csv
    x_index_in_file = 0
    y_index_in_file = 4
    format = columns
    xy_in_file_only = false
    direction = LEFT_INCLUSIVE
  []
  [temp_fcn]
    type = PiecewiseConstant
    data_file = ss316_verification_data.csv
    x_index_in_file = 0
    y_index_in_file = 5
    format = columns
    xy_in_file_only = false
    direction = LEFT_INCLUSIVE
  []
  [rhom_soln_fcn]
    type = PiecewiseConstant
    data_file = ss316_verification_data.csv
    x_index_in_file = 0
    y_index_in_file = 7
    format = columns
    xy_in_file_only = false
    direction = LEFT_INCLUSIVE
  []
  [rhoi_soln_fcn]
    type = PiecewiseConstant
    data_file = ss316_verification_data.csv
    x_index_in_file = 0
    y_index_in_file = 8
    format = columns
    xy_in_file_only = false
    direction = LEFT_INCLUSIVE
  []
  [creep_rate_soln_fcn]
    type = PiecewiseConstant
    data_file = ss316_verification_data.csv
    x_index_in_file = 0
    y_index_in_file = 10
    format = columns
    xy_in_file_only = false
    direction = LEFT_INCLUSIVE
  []
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    strain = FINITE
    add_variables = true
    generate_output = 'vonmises_stress'
    use_automatic_differentiation = true
  []
[]
[BCs]
  [symmx]
    type = ADDirichletBC
    variable = disp_x
    boundary = left
    value = 0
  []
  [symmy]
    type = ADDirichletBC
    variable = disp_y
    boundary = bottom
    value = 0
  []
  [symmz]
    type = ADDirichletBC
    variable = disp_z
    boundary = back
    value = 0
  []
  [pull_x]
    type = ADDirichletBC
    variable = disp_x
    boundary = right
    value = 1e-5 # This is required to make a non-zero effective trial stress so radial return is engaged
  []
[]
[Materials]
  [elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    shear_modulus = 1e13
    poissons_ratio = 0.3
  []
  [stress]
    type = ADComputeMultipleInelasticStress
    inelastic_models = rom_stress_prediction
  []
  [rom_stress_prediction]
    type = ADSS316HLAROMANCEStressUpdateTest
    temperature = temperature
    effective_inelastic_strain_name = effective_creep_strain
    internal_solve_full_iteration_history = true
    apply_strain = false
    outputs = all
    wall_dislocation_density_forcing_function = rhoi_fcn
    cell_dislocation_density_forcing_function = rhom_fcn
    old_creep_strain_forcing_function = evm_fcn
    wall_input_window_low_failure = ERROR
    wall_input_window_high_failure = ERROR
    cell_input_window_low_failure = ERROR
    cell_input_window_high_failure = ERROR
    temperature_input_window_low_failure = ERROR
    temperature_input_window_high_failure = ERROR
    stress_input_window_low_failure = ERROR
    stress_input_window_high_failure = ERROR
    old_strain_input_window_low_failure = ERROR
    old_strain_input_window_high_failure = ERROR
    environment_input_window_low_failure = ERROR
    environment_input_window_high_failure = ERROR
    effective_stress_forcing_function = vmJ2_fcn
  []
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_abs_tol = 1e-1 # Nothing is really being solved here, so loose tolerances are okay
  dt = 1e-3
  end_time = 1e-2
  timestep_tolerance = 1e-3
[]
[Postprocessors]
  [extrapolation]
    type = ElementAverageValue
    variable = ROM_extrapolation
    outputs = console
  []
  [old_strain_in]
    type = FunctionValuePostprocessor
    function = evm_fcn
    execute_on = 'TIMESTEP_END initial'
    outputs = console
  []
  [temperature]
    type = ElementAverageValue
    variable = temperature
    outputs = console
  []
  [rhom]
    type = ElementAverageValue
    variable = cell_dislocations
  []
  [rhoi]
    type = ElementAverageValue
    variable = wall_dislocations
  []
  [creep_rate]
    type = ElementAverageValue
    variable = creep_rate
  []
  [rhom_in]
    type = FunctionValuePostprocessor
    function = rhom_fcn
    execute_on = 'TIMESTEP_END initial'
    outputs = console
  []
  [rhoi_in]
    type = FunctionValuePostprocessor
    function = rhoi_fcn
    execute_on = 'TIMESTEP_END initial'
    outputs = console
  []
  [vmJ2_in]
    type = FunctionValuePostprocessor
    function = vmJ2_fcn
    execute_on = 'TIMESTEP_END initial'
    outputs = console
  []
  [rhom_soln]
    type = FunctionValuePostprocessor
    function = rhom_soln_fcn
    outputs = console
  []
  [rhoi_soln]
    type = FunctionValuePostprocessor
    function = rhoi_soln_fcn
    outputs = console
  []
  [creep_rate_soln]
    type = FunctionValuePostprocessor
    function = creep_rate_soln_fcn
  []
  [rhom_diff]
    type = ParsedPostprocessor
    pp_names = 'rhom_soln rhom'
    expression = '(rhom_soln - rhom) / rhom_soln'
    outputs = console
  []
  [rhoi_diff]
    type = ParsedPostprocessor
    pp_names = 'rhoi_soln rhoi'
    expression = '(rhoi_soln - rhoi) / rhoi_soln'
    outputs = console
  []
  [creep_rate_diff]
    type = ParsedPostprocessor
    pp_names = 'creep_rate creep_rate_soln'
    expression = '(creep_rate_soln - creep_rate) / creep_rate_soln'
    outputs = console
  []
  [z_rhom_max_diff]
    type = TimeExtremeValue
    postprocessor = rhom_diff
    value_type = abs_max
  []
  [z_rhoi_max_diff]
    type = TimeExtremeValue
    postprocessor = rhoi_diff
    value_type = abs_max
  []
  [z_creep_rate_max_diff]
    type = TimeExtremeValue
    postprocessor = creep_rate_diff
    value_type = abs_max
  []
[]
[Outputs]
  csv = true
  execute_on = 'INITIAL TIMESTEP_END FINAL'
[]
(modules/solid_mechanics/test/tests/strain_adjusted_density/exact_3D.i)
x_length = 0.2
y_length = 0.1
z_length = 0.3
[Mesh]
  [mesh]
    type = ExamplePatchMeshGenerator
    dim = 3
    x_length = ${x_length}
    y_length = ${y_length}
    z_length = ${z_length}
  []
[]
[Problem]
  solve = false
[]
[AuxVariables]
  [disp_x]
    initial_condition = 0
  []
  [disp_y]
    initial_condition = 0
  []
  [disp_z]
    initial_condition = 0
  []
[]
[AuxKernels]
  [disp_x_aux]
    type = ParsedAux
    variable = disp_x
    expression = 't * 1e-2 * x'
    use_xyzt = true
  []
  [disp_y_aux]
    type = ParsedAux
    variable = disp_y
    expression = 't * 2e-2 * y'
    use_xyzt = true
  []
  [disp_z_aux]
    type = ParsedAux
    variable = disp_z
    expression = 't * 3e-2 * z'
    use_xyzt = true
  []
[]
[Materials]
  [some_density]
    type = ParsedMaterial
    property_name = some_density
    expression = t
    extra_symbols = t
    outputs = all
  []
  [density]
    type = StrainAdjustedDensity
    strain_free_density = some_density
    displacements = 'disp_x disp_y disp_z'
    outputs = all
  []
[]
[Executioner]
  type = Transient
  num_steps = 10
[]
[Postprocessors]
  [disp_x]
    type = SideAverageValue
    variable = disp_x
    boundary = right
  []
  [disp_y]
    type = SideAverageValue
    variable = disp_y
    boundary = top
  []
  [disp_z]
    type = SideAverageValue
    variable = disp_z
    boundary = front
  []
  [some_density]
    type = ElementAverageValue
    variable = some_density
  []
  [density]
    type = ElementAverageValue
    variable = density
  []
  [density_exact]
    type = ParsedPostprocessor
    pp_names = 'disp_x disp_y disp_z'
    expression = 't / (1 + disp_x / ${x_length}) / (1 + disp_y / ${y_length}) / (1 + disp_z / ${z_length})'
    use_t = true
    outputs = console
  []
  [density_diff]
    type = ParsedPostprocessor
    expression = '(density_exact - density) / density_exact'
    pp_names = 'density density_exact'
    outputs = console
  []
  [density_diff_max]
    type = TimeExtremeValue
    postprocessor = density_diff
    value_type = ABS_MAX
  []
[]
[Outputs]
  csv = true
[]
(modules/heat_transfer/test/tests/gap_heat_transfer_mortar/large_gap_heat_transfer_test_rz_cylinder_mortar.i)
rpv_core_gap_size = 0.2
core_outer_radius = 2
rpv_inner_radius = '${fparse 2 + rpv_core_gap_size}'
rpv_outer_radius = '${fparse 2.5 + rpv_core_gap_size}'
rpv_width = '${fparse rpv_outer_radius - rpv_inner_radius}'
rpv_outer_htc = 10 # W/m^2/K
rpv_outer_Tinf = 300 # K
core_blocks = '1'
rpv_blocks = '3'
[Mesh]
  [gmg]
    type = CartesianMeshGenerator
    dim = 2
    dx = '${core_outer_radius} ${rpv_core_gap_size} ${rpv_width}'
    ix = '400 1 100'
    dy = 1
    iy = '5'
  []
  [set_block_id1]
    type = SubdomainBoundingBoxGenerator
    input = gmg
    bottom_left = '0 0 0'
    top_right = '${core_outer_radius} 1 0'
    block_id = 1
    location = INSIDE
  []
  [rename_core_bdy]
    type = SideSetsBetweenSubdomainsGenerator
    input = set_block_id1
    primary_block = 1
    paired_block = 0
    new_boundary = 'core_outer'
  []
  [set_block_id3]
    type = SubdomainBoundingBoxGenerator
    input = rename_core_bdy
    bottom_left = '${rpv_inner_radius} 0 0'
    top_right = '${rpv_outer_radius} 1 0'
    block_id = 3
    location = INSIDE
  []
  [rename_inner_rpv_bdy]
    type = SideSetsBetweenSubdomainsGenerator
    input = set_block_id3
    primary_block = 3
    paired_block = 0
    new_boundary = 'rpv_inner'
  []
  # comment out for test without gap
  [2d_mesh]
    type = BlockDeletionGenerator
    input = rename_inner_rpv_bdy
    block = 0
  []
  [secondary]
    type = LowerDBlockFromSidesetGenerator
    sidesets = 'rpv_inner'
    new_block_id = 10001
    new_block_name = 'secondary_lower'
    input = 2d_mesh
  []
  [primary]
    type = LowerDBlockFromSidesetGenerator
    sidesets = 'core_outer'
    new_block_id = 10000
    new_block_name = 'primary_lower'
    input = secondary
  []
  allow_renumbering = false
  coord_type = RZ
[]
[Variables]
  [Tsolid]
    initial_condition = 500
  []
    [lm]
      order = FIRST
      family = LAGRANGE
      block = 'secondary_lower'
    []
[]
[Kernels]
  [heat_source]
    type = CoupledForce
    variable = Tsolid
    block = '${core_blocks}'
    v = power_density
  []
  [heat_conduction]
    type = HeatConduction
    variable = Tsolid
  []
[]
[BCs]
  [RPV_out_BC] # k \nabla T = h (T- T_inf) at RPV outer boundary
    type = ConvectiveFluxFunction # (Robin BC)
    variable = Tsolid
    boundary = 'right' # outer RPV
    coefficient = ${rpv_outer_htc}
    T_infinity = ${rpv_outer_Tinf}
  []
[]
[UserObjects]
  [radiation]
    type = GapFluxModelRadiation
    temperature = Tsolid
    boundary = 'rpv_inner'
    primary_emissivity = 0.8
    secondary_emissivity = 0.8
  []
  [conduction]
    type = GapFluxModelConduction
    temperature = Tsolid
    boundary = 'rpv_inner'
    gap_conductivity = 0.1
  []
[]
[Constraints]
  [ced]
    type = ModularGapConductanceConstraint
    variable = lm
    secondary_variable = Tsolid
    primary_boundary = 'core_outer'
    primary_subdomain = 10000
    secondary_boundary = 'rpv_inner'
    secondary_subdomain = 10001
    gap_flux_models = 'radiation conduction'
    gap_geometry_type = 'CYLINDER'
  []
[]
[AuxVariables]
  [power_density]
    block = '${core_blocks}'
    initial_condition = 50e3
  []
[]
[Materials]
  [simple_mat]
    type = HeatConductionMaterial
    thermal_conductivity = 34.6 # W/m/K
  []
[]
[Postprocessors]
  [Tcore_avg]
    type = ElementAverageValue
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Tcore_max]
    type = ElementExtremeValue
    value_type = max
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Tcore_min]
    type = ElementExtremeValue
    value_type = min
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Trpv_avg]
    type = ElementAverageValue
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [Trpv_max]
    type = ElementExtremeValue
    value_type = max
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [Trpv_min]
    type = ElementExtremeValue
    value_type = min
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [ptot]
    type = ElementIntegralVariablePostprocessor
    variable = power_density
    block = '${core_blocks}'
  []
  [rpv_convective_out]
    type = ConvectiveHeatTransferSideIntegral
    T_solid = Tsolid
    boundary = 'right' # outer RVP
    T_fluid = ${rpv_outer_Tinf}
    htc = ${rpv_outer_htc}
  []
  [heat_balance] # should be equal to 0 upon convergence
    type = ParsedPostprocessor
    expression = '(rpv_convective_out - ptot) / ptot'
    pp_names = 'rpv_convective_out ptot'
  []
  [flux_from_core] # converges to ptot as the mesh is refined
    type = SideDiffusiveFluxIntegral
    variable = Tsolid
    boundary = core_outer
    diffusivity = thermal_conductivity
  []
  [flux_into_rpv] # converges to rpv_convective_out as the mesh is refined
    type = SideDiffusiveFluxIntegral
    variable = Tsolid
    boundary = rpv_inner
    diffusivity = thermal_conductivity
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[VectorPostprocessors]
  [NodalTemperature]
    type = NodalValueSampler
    sort_by = id
    boundary = 'rpv_inner core_outer'
    variable = Tsolid
  []
[]
[Executioner]
  type = Steady
  petsc_options = '-snes_converged_reason -pc_svd_monitor'
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package -mat_mffd_err -pc_factor_shift_type '
                        '-pc_factor_shift_amount'
  petsc_options_value = ' lu       superlu_dist                  1e-5          NONZERO               '
                        '1e-15'
  snesmf_reuse_base = false
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-10
  l_max_its = 100
  line_search = none
[]
[Outputs]
  exodus = false
  csv = true
[]
(modules/combined/examples/optimization/multi-load/square_main.i)
# This example is intended to reproduce a 2D example with opposing horizontal
# loads (see [1]). This test has an undefined solution if reguar SIMP is applied.
# Using multi-loads SIMP, on the other hand, generates a structure that optimizes
# the response to both loads individually,
# [1]. Lat. Am. j. solids struct. 12 (5), May 2015
# Topological derivative-based topology optimization of structures subject to multiple load-cases
vol_frac = 0.5
power = 1.0
E0 = 1.0
Emin = 1.0e-6
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Mesh]
  [Bottom]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 100
    ny = 100
    xmin = 0
    xmax = 150
    ymin = 0
    ymax = 150
  []
  [left_load]
    type = ExtraNodesetGenerator
    input = Bottom
    new_boundary = left_load
    coord = '0 150 0'
  []
  [right_load]
    type = ExtraNodesetGenerator
    input = left_load
    new_boundary = right_load
    coord = '150 150 0'
  []
  [left_support]
    type = ExtraNodesetGenerator
    input = right_load
    new_boundary = left_support
    coord = '0 0 0'
  []
  [right_support]
    type = ExtraNodesetGenerator
    input = left_support
    new_boundary = right_support
    coord = '150 0 0'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
[]
[AuxVariables]
  [mat_den]
    family = MONOMIAL
    order = CONSTANT
  []
  [sensitivity_one]
    family = MONOMIAL
    order = SECOND
    initial_condition = -1.0
  []
  [sensitivity_two]
    family = MONOMIAL
    order = SECOND
    initial_condition = -1.0
  []
  [total_sensitivity]
    family = MONOMIAL
    order = SECOND
    initial_condition = -1.0
  []
[]
[ICs]
  [mat_den]
    type = RandomIC
    seed = 7
    variable = mat_den
    max = '${fparse vol_frac+0.35}'
    min = '${fparse vol_frac-0.35}'
  []
[]
[AuxKernels]
  [total_sensitivity]
    type = ParsedAux
    variable = total_sensitivity
    expression = '0.5*sensitivity_one + 0.5*sensitivity_two'
    coupled_variables = 'sensitivity_one sensitivity_two'
    execute_on = 'LINEAR TIMESTEP_END'
  []
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    strain = SMALL
    add_variables = true
    incremental = false
  []
[]
[BCs]
  [no_y]
    type = DirichletBC
    variable = disp_y
    boundary = left_support
    value = 0.0
  []
  [no_x]
    type = DirichletBC
    variable = disp_x
    boundary = left_support
    value = 0.0
  []
  [no_y_right]
    type = DirichletBC
    variable = disp_y
    boundary = right_support
    value = 0.0
  []
  [no_x_right]
    type = DirichletBC
    variable = disp_x
    boundary = right_support
    value = 0.0
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeVariableIsotropicElasticityTensor
    youngs_modulus = E_phys
    poissons_ratio = poissons_ratio
    args = 'mat_den'
  []
  [E_phys]
    type = DerivativeParsedMaterial
    # Emin + (density^penal) * (E0 - Emin)
    expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
    coupled_variables = 'mat_den'
    property_name = E_phys
  []
  [poissons_ratio]
    type = GenericConstantMaterial
    prop_names = poissons_ratio
    prop_values = 0.3
  []
  [stress]
    type = ComputeLinearElasticStress
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[UserObjects]
  [update]
    type = DensityUpdate
    density_sensitivity = total_sensitivity
    design_density = mat_den
    volume_fraction = ${vol_frac}
    execute_on = MULTIAPP_FIXED_POINT_BEGIN
  []
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu superlu_dist'
  nl_abs_tol = 1e-10
  dt = 1.0
  num_steps = 10
[]
[Outputs]
  exodus = true
  [out]
    type = CSV
    execute_on = 'TIMESTEP_END'
  []
  print_linear_residuals = false
[]
[Postprocessors]
  [mesh_volume]
    type = VolumePostprocessor
    execute_on = 'initial timestep_end'
  []
  [total_vol]
    type = ElementIntegralVariablePostprocessor
    variable = mat_den
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [vol_frac]
    type = ParsedPostprocessor
    expression = 'total_vol / mesh_volume'
    pp_names = 'total_vol mesh_volume'
  []
  [sensitivity]
    type = ElementIntegralVariablePostprocessor
    variable = total_sensitivity
  []
[]
[MultiApps]
  [sub_app_one]
    type = TransientMultiApp
    input_files = square_subapp_one.i
  []
  [sub_app_two]
    type = TransientMultiApp
    input_files = square_subapp_two.i
  []
[]
[Transfers]
  # First SUB-APP
  # To subapp densities
  [subapp_one_density]
    type = MultiAppCopyTransfer
    to_multi_app = sub_app_one
    source_variable = mat_den # Here
    variable = mat_den
  []
  # From subapp sensitivity
  [subapp_one_sensitivity]
    type = MultiAppCopyTransfer
    from_multi_app = sub_app_one
    source_variable = Dc # sensitivity_var
    variable = sensitivity_one # Here
  []
  # Second SUB-APP
  # To subapp densities
  [subapp_two_density]
    type = MultiAppCopyTransfer
    to_multi_app = sub_app_two
    source_variable = mat_den # Here
    variable = mat_den
  []
  # From subapp sensitivity
  [subapp_two_sensitivity]
    type = MultiAppCopyTransfer
    from_multi_app = sub_app_two
    source_variable = Dc # sensitivity_var
    variable = sensitivity_two # Here
  []
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/segregated/channel-drift-flux.i)
mu = 1.0
rho = 10.0
mu_d = 0.1
rho_d = 1.0
l = 2
# 'average' leads to slight oscillations, upwind may be preferred
# This method is selected for consistency with the original nonlinear input
advected_interp_method = 'average'
# TODO remove need for those
cp = 1
k = 1
cp_d = 1
k_d = 1
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = '${fparse l * 5}'
    ymin = '${fparse -l / 2}'
    ymax = '${fparse l / 2}'
    nx = 10
    ny = 4
  []
  uniform_refine = 0
[]
[Problem]
  linear_sys_names = 'u_system v_system pressure_system phi_system'
  previous_nl_solution_required = true
[]
[Variables]
  [vel_x]
    type = MooseLinearVariableFVReal
    solver_sys = u_system
    initial_condition = 1
  []
  [vel_y]
    type = MooseLinearVariableFVReal
    solver_sys = v_system
  []
  [pressure]
    type = MooseLinearVariableFVReal
    solver_sys = pressure_system
  []
  [phase_2]
    type = MooseLinearVariableFVReal
    solver_sys = phi_system
  []
[]
[LinearFVKernels]
  [flow_p_diffusion]
    type = LinearFVAnisotropicDiffusion
    diffusion_tensor = Ainv
    use_nonorthogonal_correction = false
    variable = pressure
  []
  [flow_HbyA_divergence]
    type = LinearFVDivergence
    face_flux = HbyA
    force_boundary_execution = true
    variable = pressure
  []
  [flow_ins_momentum_flux_x]
    type = LinearWCNSFVMomentumFlux
    advected_interp_method = ${advected_interp_method}
    momentum_component = x
    mu = mu_mixture
    rhie_chow_user_object = ins_rhie_chow_interpolator
    u = vel_x
    use_deviatoric_terms = false
    use_nonorthogonal_correction = false
    v = vel_y
    variable = vel_x
  []
  [flow_ins_momentum_flux_y]
    type = LinearWCNSFVMomentumFlux
    advected_interp_method = ${advected_interp_method}
    momentum_component = y
    mu = mu_mixture
    rhie_chow_user_object = ins_rhie_chow_interpolator
    u = vel_x
    use_deviatoric_terms = false
    use_nonorthogonal_correction = false
    v = vel_y
    variable = vel_y
  []
  [mixture_drift_flux_x]
    type = LinearWCNSFV2PMomentumDriftFlux
    density_interp_method = average
    fraction_dispersed = phase_2
    momentum_component = x
    rhie_chow_user_object = ins_rhie_chow_interpolator
    rho_d = ${rho_d}
    u_slip = vel_slip_x
    v_slip = vel_slip_y
    variable = vel_x
  []
  [mixture_drift_flux_y]
    type = LinearWCNSFV2PMomentumDriftFlux
    density_interp_method = average
    fraction_dispersed = phase_2
    momentum_component = y
    rhie_chow_user_object = ins_rhie_chow_interpolator
    rho_d = ${rho_d}
    u_slip = vel_slip_x
    v_slip = vel_slip_y
    variable = vel_y
  []
  [flow_ins_momentum_pressure_x]
    type = LinearFVMomentumPressure
    momentum_component = x
    pressure = pressure
    variable = vel_x
  []
  [flow_ins_momentum_pressure_y]
    type = LinearFVMomentumPressure
    momentum_component = y
    pressure = pressure
    variable = vel_y
  []
  [flow_momentum_friction_0_x]
    type = LinearFVMomentumFriction
    Darcy_name = Darcy_coefficient_vec
    momentum_component = x
    mu = mu_mixture
    variable = vel_x
  []
  [flow_momentum_friction_0_y]
    type = LinearFVMomentumFriction
    Darcy_name = Darcy_coefficient_vec
    momentum_component = y
    mu = mu_mixture
    variable = vel_y
  []
  # Mixture phase equation
  [mixture_ins_phase_2_advection]
    type = LinearFVScalarAdvection
    advected_interp_method = upwind
    rhie_chow_user_object = ins_rhie_chow_interpolator
    u_slip = vel_slip_x
    v_slip = vel_slip_y
    variable = phase_2
  []
  [mixture_phase_interface_reaction]
    type = LinearFVReaction
    coeff = 0.1
    variable = phase_2
  []
  [mixture_phase_interface_source]
    type = LinearFVSource
    scaling_factor = 0.1
    source_density = phase_1
    variable = phase_2
  []
[]
[LinearFVBCs]
  [vel_x_left]
    type = LinearFVAdvectionDiffusionFunctorDirichletBC
    boundary = left
    functor = 1
    variable = vel_x
  []
  [vel_y_left]
    type = LinearFVAdvectionDiffusionFunctorDirichletBC
    boundary = left
    functor = 0
    variable = vel_y
  []
  [pressure_extrapolation_inlet_left]
    type = LinearFVExtrapolatedPressureBC
    boundary = left
    use_two_term_expansion = true
    variable = pressure
  []
  [vel_x_right]
    type = LinearFVAdvectionDiffusionOutflowBC
    boundary = right
    use_two_term_expansion = true
    variable = vel_x
  []
  [vel_y_right]
    type = LinearFVAdvectionDiffusionOutflowBC
    boundary = right
    use_two_term_expansion = true
    variable = vel_y
  []
  [pressure_right]
    type = LinearFVAdvectionDiffusionFunctorDirichletBC
    boundary = right
    functor = 0
    variable = pressure
  []
  [vel_x_bottom]
    type = LinearFVAdvectionDiffusionFunctorDirichletBC
    boundary = bottom
    functor = 0
    variable = vel_x
  []
  [vel_y_bottom]
    type = LinearFVAdvectionDiffusionFunctorDirichletBC
    boundary = bottom
    functor = 0
    variable = vel_y
  []
  [vel_x_top]
    type = LinearFVAdvectionDiffusionFunctorDirichletBC
    boundary = top
    functor = 0
    variable = vel_x
  []
  [vel_y_top]
    type = LinearFVAdvectionDiffusionFunctorDirichletBC
    boundary = top
    functor = 0
    variable = vel_y
  []
  [pressure_extrapolation_top_bottom]
    type = LinearFVExtrapolatedPressureBC
    boundary = 'top bottom'
    use_two_term_expansion = true
    variable = pressure
  []
  [phase_2_left]
    type = LinearFVAdvectionDiffusionFunctorDirichletBC
    boundary = left
    functor = 0.1
    variable = phase_2
  []
  [phase_2_right]
    type = LinearFVAdvectionDiffusionOutflowBC
    boundary = right
    use_two_term_expansion = true
    variable = phase_2
  []
[]
[FunctorMaterials]
  [flow_ins_speed_material]
    type = ADVectorMagnitudeFunctorMaterial
    execute_on = ALWAYS
    outputs = none
    vector_magnitude_name = speed
    x_functor = vel_x
    y_functor = vel_y
  []
  [mixture_phase_1_fraction]
    type = ParsedFunctorMaterial
    execute_on = ALWAYS
    expression = '1 - phase_2'
    functor_names = phase_2
    output_properties = phase_1
    outputs = all
    property_name = phase_1
  []
  [mixture_mixture_material]
    type = WCNSLinearFVMixtureFunctorMaterial
    execute_on = ALWAYS
    limit_phase_fraction = true
    outputs = all
    phase_1_fraction = phase_2
    phase_1_names = '${rho_d} ${mu_d} ${cp_d} ${k_d}'
    phase_2_names = '${rho}   ${mu}   ${cp}   ${k}'
    prop_names = 'rho_mixture mu_mixture cp_mixture k_mixture'
  []
  [mixture_slip_x]
    type = WCNSFV2PSlipVelocityFunctorMaterial
    execute_on = ALWAYS
    gravity = '0 0 0'
    linear_coef_name = Darcy_coefficient
    momentum_component = x
    mu = mu_mixture
    outputs = all
    particle_diameter = 0.01
    rho = ${rho}
    rho_d = ${rho_d}
    slip_velocity_name = vel_slip_x
    u = vel_x
    v = vel_y
  []
  [mixture_slip_y]
    type = WCNSFV2PSlipVelocityFunctorMaterial
    execute_on = ALWAYS
    gravity = '0 0 0'
    linear_coef_name = Darcy_coefficient
    momentum_component = y
    mu = mu_mixture
    outputs = all
    particle_diameter = 0.01
    rho = ${rho}
    rho_d = ${rho_d}
    slip_velocity_name = vel_slip_y
    u = vel_x
    v = vel_y
  []
  [mixture_dispersed_drag]
    type = NSFVDispersePhaseDragFunctorMaterial
    drag_coef_name = Darcy_coefficient
    execute_on = ALWAYS
    mu = mu_mixture
    outputs = all
    particle_diameter = 0.01
    rho = rho_mixture
    u = vel_x
    v = vel_y
  []
[]
[UserObjects]
  [ins_rhie_chow_interpolator]
    type = RhieChowMassFlux
    p_diffusion_kernel = flow_p_diffusion
    pressure = pressure
    rho = rho_mixture
    u = vel_x
    v = vel_y
  []
[]
[Executioner]
  type = SIMPLE
  rhie_chow_user_object = 'ins_rhie_chow_interpolator'
  # Systems
  momentum_systems = 'u_system v_system'
  pressure_system = 'pressure_system'
  active_scalar_systems = 'phi_system'
  momentum_equation_relaxation = 0.8
  active_scalar_equation_relaxation = '0.7'
  pressure_variable_relaxation = 0.3
  # We need to converge the problem to show conservation
  num_iterations = 200
  pressure_absolute_tolerance = 1e-10
  momentum_absolute_tolerance = 1e-10
  active_scalar_absolute_tolerance = '1e-10'
  momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
  momentum_petsc_options_value = 'hypre boomeramg'
  pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
  pressure_petsc_options_value = 'hypre boomeramg'
  active_scalar_petsc_options_iname = '-pc_type -pc_hypre_type'
  active_scalar_petsc_options_value = 'hypre boomeramg'
  momentum_l_abs_tol = 1e-13
  pressure_l_abs_tol = 1e-13
  active_scalar_l_abs_tol = 1e-13
  momentum_l_tol = 0
  pressure_l_tol = 0
  active_scalar_l_tol = 0
  # print_fields = true
  continue_on_max_its = true
[]
[Outputs]
  csv = true
[]
[Postprocessors]
  [Re]
    type = ParsedPostprocessor
    expression = '10.0 * 2 * 1'
  []
  [average_phase2]
    type = ElementAverageValue
    variable = phase_2
  []
  [dp]
    type = PressureDrop
    boundary = 'left right'
    downstream_boundary = right
    pressure = pressure
    upstream_boundary = left
  []
  [max_phase2]
    type = ElementExtremeValue
    variable = phase_2
  []
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_interface_area_model/pressure_driven_growth.i)
###############################################################################
# Validation test based on Hibiki and Ishii experiment [1] reported in Figure 3
# [1] Hibiki, T., & Ishii, M. (2000). One-group interfacial area transport of bubbly flows in vertical round tubes.
# International Journal of Heat and Mass Transfer, 43(15), 2711-2726.
###############################################################################
mu = 1.0
rho = 1000.0
mu_d = 1.0
rho_d = 1.0
l = ${fparse 50.8/1000.0}
U = 0.491230114
dp = 0.001
inlet_phase_2 = 0.049
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
mass_exchange_coeff = 0.0
inlet_interface_area = ${fparse 6.0*inlet_phase_2/dp}
outlet_pressure = 1e5
[GlobalParams]
  rhie_chow_user_object = 'rc'
  density_interp_method = 'average'
  mu_interp_method = 'average'
[]
[Problem]
  identify_variable_groups_in_nl = false
  previous_nl_solution_required = true
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = vel_x
    v = vel_y
    pressure = pressure
  []
[]
[Mesh]
  coord_type = 'RZ'
  rz_coord_axis = 'X'
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = '${fparse l * 60}'
    ymin = 0
    ymax = '${fparse l / 2}'
    nx = 20
    ny = 5
  []
  uniform_refine = 0
[]
[Variables]
  [vel_x]
    type = INSFVVelocityVariable
    initial_condition = 0
  []
  [vel_y]
    type = INSFVVelocityVariable
    initial_condition = 0
  []
  [pressure]
    type = INSFVPressureVariable
  []
  [phase_2]
    type = INSFVScalarFieldVariable
    initial_condition = ${inlet_phase_2}
  []
  [interface_area]
    type = INSFVScalarFieldVariable
    initial_condition = ${inlet_interface_area}
  []
[]
[FVKernels]
  [mass]
    type = INSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
  []
  [u_advection]
    type = INSFVMomentumAdvection
    variable = vel_x
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = 'rho_mixture'
    momentum_component = 'x'
  []
  [u_drift]
    type = WCNSFV2PMomentumDriftFlux
    variable = vel_x
    rho_d = ${rho_d}
    fd = 'rho_mixture_var'
    u_slip = 'vel_slip_x'
    v_slip = 'vel_slip_y'
    momentum_component = 'x'
  []
  [u_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_x
    mu = 'mu_mixture'
    limit_interpolation = true
    momentum_component = 'x'
  []
  [u_pressure]
    type = INSFVMomentumPressure
    variable = vel_x
    momentum_component = 'x'
    pressure = pressure
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = vel_y
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = 'rho_mixture'
    momentum_component = 'y'
  []
  [v_drift]
    type = WCNSFV2PMomentumDriftFlux
    variable = vel_y
    rho_d = ${rho_d}
    fd = 'rho_mixture_var'
    u_slip = 'vel_slip_x'
    v_slip = 'vel_slip_y'
    momentum_component = 'y'
  []
  [v_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_y
    mu = 'mu_mixture'
    limit_interpolation = true
    momentum_component = 'y'
  []
  [v_pressure]
    type = INSFVMomentumPressure
    variable = vel_y
    momentum_component = 'y'
    pressure = pressure
  []
  [phase_2_advection]
    type = INSFVScalarFieldAdvection
    variable = phase_2
    u_slip = 'vel_x'
    v_slip = 'vel_y'
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = 'upwind'
  []
  [phase_2_diffusion]
    type = FVDiffusion
    variable = phase_2
    coeff = 1.0
  []
  [phase_2_src]
    type = NSFVMixturePhaseInterface
    variable = phase_2
    phase_coupled = phase_1
    alpha = ${mass_exchange_coeff}
  []
  [interface_area_advection]
    type = INSFVScalarFieldAdvection
    variable = interface_area
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = 'upwind'
  []
  [interface_area_diffusion]
    type = FVDiffusion
    variable = interface_area
    coeff = 0.1
  []
  [interface_area_source_sink]
    type = WCNSFV2PInterfaceAreaSourceSink
    variable = interface_area
    u = 'vel_x'
    v = 'vel_y'
    L = ${fparse l/2}
    rho = 'rho_mixture'
    rho_d = 'rho'
    pressure = 'pressure'
    k_c = '${fparse mass_exchange_coeff}'
    fd = 'phase_2'
    sigma = 1e-3
    cutoff_fraction = 0.0
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_x
    functor = '${U}'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_y
    functor = '0'
  []
  [walls-u]
    type = INSFVNoSlipWallBC
    boundary = 'top'
    variable = vel_x
    function = 0
  []
  [walls-v]
    type = INSFVNoSlipWallBC
    boundary = 'top'
    variable = vel_y
    function = 0
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = '${outlet_pressure}'
  []
  [inlet_phase_2]
    type = FVDirichletBC
    boundary = 'left'
    variable = phase_2
    value = ${inlet_phase_2}
  []
  [inlet_interface_area]
    type = FVDirichletBC
    boundary = 'left'
    variable = interface_area
    value = ${inlet_interface_area}
  []
  [symmetry-u]
    type = PINSFVSymmetryVelocityBC
    boundary = 'bottom'
    variable = vel_x
    u = vel_x
    v = vel_y
    mu = 'mu_mixture'
    momentum_component = 'x'
  []
  [symmetry-v]
    type = PINSFVSymmetryVelocityBC
    boundary = 'bottom'
    variable = vel_y
    u = vel_x
    v = vel_y
    mu = 'mu_mixture'
    momentum_component = 'y'
  []
  [symmetry-p]
    type = INSFVSymmetryPressureBC
    boundary = 'bottom'
    variable = pressure
  []
  [symmetry-phase-2]
    type = INSFVSymmetryScalarBC
    boundary = 'bottom'
    variable = phase_2
  []
  [symmetry-interface-area]
    type = INSFVSymmetryScalarBC
    boundary = 'bottom'
    variable = interface_area
  []
[]
[AuxVariables]
  [drag_coefficient]
    type = MooseVariableFVReal
  []
  [rho_mixture_var]
    type = MooseVariableFVReal
  []
  [mu_mixture_var]
    type = MooseVariableFVReal
  []
[]
[AuxKernels]
  [populate_cd]
    type = FunctorAux
    variable = drag_coefficient
    functor = 'Darcy_coefficient'
  []
  [populate_rho_mixture_var]
    type = FunctorAux
    variable = rho_mixture_var
    functor = 'rho_mixture'
  []
  [populate_mu_mixture_var]
    type = FunctorAux
    variable = mu_mixture_var
    functor = 'mu_mixture'
  []
[]
[FluidProperties]
  [fp]
    type = IdealGasFluidProperties
  []
[]
[FunctorMaterials]
  [bubble_properties]
    type = GeneralFunctorFluidProps
    fp = 'fp'
    pressure = 'pressure'
    T_fluid = 300.0
    speed = 1.0
    characteristic_length = 1.0
    porosity = 1.0
    output_properties = 'rho'
    outputs = 'out'
  []
  [populate_u_slip]
    type = WCNSFV2PSlipVelocityFunctorMaterial
    slip_velocity_name = 'vel_slip_x'
    momentum_component = 'x'
    u = 'vel_x'
    v = 'vel_y'
    rho = ${rho}
    mu = 'mu_mixture'
    rho_d = ${rho_d}
    particle_diameter = ${dp}
    linear_coef_name = 'Darcy_coefficient'
  []
  [populate_v_slip]
    type = WCNSFV2PSlipVelocityFunctorMaterial
    slip_velocity_name = 'vel_slip_y'
    momentum_component = 'y'
    u = 'vel_x'
    v = 'vel_y'
    rho = ${rho}
    mu = 'mu_mixture'
    rho_d = ${rho_d}
    particle_diameter = ${dp}
    linear_coef_name = 'Darcy_coefficient'
  []
  [compute_phase_1]
    type = ADParsedFunctorMaterial
    property_name = phase_1
    functor_names = 'phase_2'
    expression = '1 - phase_2'
  []
  [CD]
    type = NSFVDispersePhaseDragFunctorMaterial
    rho = 'rho_mixture'
    mu = mu_mixture
    u = 'vel_x'
    v = 'vel_y'
    particle_diameter = ${dp}
  []
  [mixing_material]
    type = NSFVMixtureFunctorMaterial
    phase_2_names = '${rho} ${mu}'
    phase_1_names = 'rho ${mu_d}'
    prop_names = 'rho_mixture mu_mixture'
    phase_1_fraction = 'phase_2'
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  nl_rel_tol = 1e-10
  line_search = 'none'
[]
[Debug]
  show_var_residual_norms = true
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
    petsc_options_iname = '-pc_type -pc_factor_shift_type'
    petsc_options_value = 'lu       NONZERO'
  []
[]
[Outputs]
  [out]
    type = Exodus
  []
[]
[Postprocessors]
  [Re]
    type = ParsedPostprocessor
    expression = '${rho} * ${l} * ${U}'
    pp_names = ''
  []
  [rho_outlet]
    type = SideAverageValue
    boundary = 'right'
    variable = 'rho_mixture_var'
  []
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/1d-scalar/channel-conservation-physics.i)
mu = 2.6
rho = 1.0
advected_interp_method = 'upwind'
# A large diffusion term makes the balance worse
# because some scalar diffuses to the inlet/outlet and
# the postprocessors are only measuring the advective term
k1 = 0
k2 = 0
[Mesh]
  [mesh]
    type = CartesianMeshGenerator
    dim = 1
    dx = '1 1 1'
    ix = '10 10 10'
    subdomain_id = '0 1 0'
  []
[]
[Problem]
  linear_sys_names = 'u_system pressure_system s1_system s2_system'
[]
[Physics]
  [NavierStokes]
    [FlowSegregated]
      [flow]
        velocity_variable = 'vel_x'
        pressure_variable = 'pressure'
        initial_velocity = '0.5 0 0'
        initial_pressure = '0.2'
        density = ${rho}
        dynamic_viscosity = ${mu}
        # use inlet for moving wall to match the reference input
        # we could also use a noslip BC with a velocity wall functor
        inlet_boundaries = 'left'
        momentum_inlet_types = 'fixed-velocity'
        momentum_inlet_functors = '1'
        outlet_boundaries = 'right'
        momentum_outlet_types = 'fixed-pressure'
        pressure_functors = '1.4'
        orthogonality_correction = false
        pressure_two_term_bc_expansion = false
        momentum_two_term_bc_expansion = false
        momentum_advection_interpolation = ${advected_interp_method}
      []
    []
    [ScalarTransportSegregated]
      [scalar]
        passive_scalar_names = 'scalar1 scalar2'
        system_names = 's1_system s2_system'
        initial_scalar_variables = '1.1 3'
        passive_scalar_diffusivity = '${k1} ${k2}'
        passive_scalar_coupled_source = 'q1; q2'
        passive_scalar_inlet_types = 'fixed-value fixed-value'
        passive_scalar_inlet_functors = '1; 2'
        passive_scalar_advection_interpolation = ${advected_interp_method}
        passive_scalar_two_term_bc_expansion = false
        use_nonorthogonal_correction = false
      []
    []
  []
[]
# Note, we do not block restrict these source variables because
# there is not passive_scalar_coupled_source_blocks parameter at this time
[AuxVariables]
  [q1]
    type = MooseLinearVariableFVReal
  []
  [q2]
    type = MooseLinearVariableFVReal
  []
[]
[FVICs]
  [q1]
    type = FVConstantIC
    variable = q1
    value = 1
    block = 1
  []
  [q2]
    type = FVConstantIC
    variable = q2
    value = 2
    block = 1
  []
[]
[Executioner]
  type = SIMPLE
  momentum_l_abs_tol = 1e-13
  pressure_l_abs_tol = 1e-13
  passive_scalar_l_abs_tol = 1e-13
  momentum_l_tol = 0
  pressure_l_tol = 0
  passive_scalar_l_tol = 0
  rhie_chow_user_object = 'ins_rhie_chow_interpolator'
  momentum_systems = 'u_system'
  pressure_system = 'pressure_system'
  passive_scalar_systems = 's1_system s2_system'
  momentum_equation_relaxation = 0.4
  pressure_variable_relaxation = 0.3
  passive_scalar_equation_relaxation = '0.9 0.9'
  # We need to converge the problem to show conservation
  num_iterations = 200
  pressure_absolute_tolerance = 1e-10
  momentum_absolute_tolerance = 1e-10
  passive_scalar_absolute_tolerance = '1e-9 1e-9'
  momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
  momentum_petsc_options_value = 'hypre boomeramg'
  pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
  pressure_petsc_options_value = 'hypre boomeramg'
  passive_scalar_petsc_options_iname = '-pc_type -pc_hypre_type'
  passive_scalar_petsc_options_value = 'hypre boomeramg'
  print_fields = false
  continue_on_max_its = true
[]
[Outputs]
  exodus = true
  execute_on = timestep_end
  # hide = 'pressure vel_x'
  [csv]
    type = CSV
    hide = 'balance_s1 balance_s2'
  []
[]
[GlobalParams]
  rhie_chow_user_object = 'ins_rhie_chow_interpolator'
  subtract_mesh_velocity = false
  advected_interp_method = ${advected_interp_method}
[]
[Postprocessors]
  [s1_in]
    type = VolumetricFlowRate
    boundary = left
    vel_x = vel_x
    advected_quantity = 'scalar1'
  []
  [s2_in]
    type = VolumetricFlowRate
    boundary = left
    vel_x = vel_x
    advected_quantity = 'scalar2'
  []
  [s1_out]
    type = VolumetricFlowRate
    boundary = right
    vel_x = vel_x
    advected_quantity = 'scalar1'
  []
  [s2_out]
    type = VolumetricFlowRate
    boundary = right
    vel_x = vel_x
    advected_quantity = 'scalar2'
  []
  [balance_s1]
    type = ParsedPostprocessor
    expression = 's1_out + s1_in - 1'
    pp_names = 's1_in s1_out'
  []
  [balance_s2]
    type = ParsedPostprocessor
    expression = 's2_out + s2_in - 2'
    pp_names = 's2_in s2_out'
  []
[]
(modules/thermal_hydraulics/test/tests/problems/brayton_cycle/recuperated_brayton_cycle.i)
# This input file models an open, recuperated Brayton cycle with a PID
# controlled start up using a coupled motor.
#
# Heat is supplied to the system by a volumetric heat source, and a second heat
# source is used to model a recuperator. The recuperator transfers heat from the
# turbine exhaust gas to the compressor outlet gas.
#
# Initially the fluid and heat structures are at rest at ambient conditions,
# and the shaft speed is zero.
# The transient is controlled as follows:
#   * 0   - 2000 s: Motor increases shaft speed to approx. 85,000 RPM by PID control
#   * 1000 - 8600 s: Power in main heat source increases from 0 - 104 kW
#   * 2000 - 200000 s: Torque supplied by turbine increases to steady state level
#                      as working fluid temperature increases. Torque supplied by
#                      the motor is ramped down to 0 N-m transitioning shaft control
#                      to the turbine at its rated speed of 96,000 RPM.
I_motor = 1.0
I_generator = 1.0
generator_torque_per_shaft_speed = -0.00025
motor_ramp_up_duration = 3605
motor_ramp_down_duration = 1800
post_motor_time = 2160000
t1 = ${motor_ramp_up_duration}
t2 = ${fparse t1 + motor_ramp_down_duration}
t3 = ${fparse t2 + post_motor_time}
D1 = 0.15
D2 = ${D1}
D3 = ${D1}
D4 = ${D1}
D5 = ${D1}
D6 = ${D1}
D7 = ${D1}
D8 = ${D1}
A1 = ${fparse 0.25 * pi * D1^2}
A2 = ${fparse 0.25 * pi * D2^2}
A3 = ${fparse 0.25 * pi * D3^2}
A4 = ${fparse 0.25 * pi * D4^2}
A5 = ${fparse 0.25 * pi * D5^2}
A6 = ${fparse 0.25 * pi * D6^2}
A7 = ${fparse 0.25 * pi * D7^2}
A8 = ${fparse 0.25 * pi * D8^2}
recuperator_width = 0.15
L1 = 5.0
L2 = ${L1}
L3 = ${fparse 2 * L1}
L4 = ${fparse 2 * L1}
L5 = ${L1}
L6 = ${L1}
L7 = ${fparse L1 + recuperator_width}
L8 = ${L1}
x1 = 0.0
x2 = ${fparse x1 + L1}
x3 = ${fparse x2 + L2}
x4 = ${x3}
x5 = ${fparse x4 - L4}
x6 = ${x5}
x7 = ${fparse x6 + L6}
x8 = ${fparse x7 + L7}
y1 = 0
y2 = ${y1}
y3 = ${y2}
y4 = ${fparse y3 - L3}
y5 = ${y4}
y6 = ${fparse y5 + L5}
y7 = ${y6}
y8 = ${y7}
x1_out = ${fparse x1 + L1 - 0.001}
x2_in = ${fparse x2 + 0.001}
y5_in = ${fparse y5 + 0.001}
x6_out = ${fparse x6 + L6 - 0.001}
x7_in = ${fparse x7 + 0.001}
y8_in = ${fparse y8 + 0.001}
y8_out = ${fparse y8 + L8 - 0.001}
hot_leg_in = ${y8_in}
hot_leg_out = ${y8_out}
cold_leg_in = ${fparse y3 - 0.001}
cold_leg_out = ${fparse y3 - (L3/2) - 0.001}
n_elems1 = 5
n_elems2 = ${n_elems1}
n_elems3 = ${fparse 2 * n_elems1}
n_elems4 = ${fparse 2 * n_elems1}
n_elems5 = ${n_elems1}
n_elems6 = ${n_elems1}
n_elems7 = ${n_elems1}
n_elems8 = ${n_elems1}
A_ref_comp = ${fparse 0.5 * (A1 + A2)}
V_comp = ${fparse A_ref_comp * 1.0}
I_comp = 1.0
A_ref_turb = ${fparse 0.5 * (A4 + A5)}
V_turb = ${fparse A_ref_turb * 1.0}
I_turb = 1.0
c0_rated_comp = 351.6925137
rho0_rated_comp = 1.146881112
rated_mfr = 0.25
speed_rated_rpm = 96000
speed_rated = ${fparse speed_rated_rpm * 2 * pi / 60.0}
speed_initial = 0
eff_comp = 0.79
eff_turb = 0.843
T_ambient = 300
p_ambient = 1e5
hs_power = 105750
[GlobalParams]
  gravity_vector = '0 0 0'
  initial_p = ${p_ambient}
  initial_T = ${T_ambient}
  initial_vel = 0
  initial_vel_x = 0
  initial_vel_y = 0
  initial_vel_z = 0
  fp = fp_air
  closures = closures
  f = 0
  scaling_factor_1phase = '1 1 1e-5'
  scaling_factor_rhoV = 1
  scaling_factor_rhouV = 1e-2
  scaling_factor_rhovV = 1e-2
  scaling_factor_rhowV = 1e-2
  scaling_factor_rhoEV = 1e-5
  scaling_factor_temperature = 1e-2
  rdg_slope_reconstruction = none
[]
[FluidProperties]
  [fp_air]
    type = IdealGasFluidProperties
    emit_on_nan = none
  []
[]
[SolidProperties]
  [steel]
    type = ThermalFunctionSolidProperties
    rho = 8050
    k = 45
    cp = 466
  []
[]
[Closures]
  [closures]
    type = Closures1PhaseSimple
  []
[]
[Functions]
  ##########################
  # Motor
  ##########################
  # Functions for control logic that determines when to shut off the PID system
  [is_tripped_fn]
    type = ParsedFunction
    symbol_names = 'motor_torque turbine_torque'
    symbol_values = 'motor_torque turbine_torque'
    expression = 'turbine_torque > motor_torque'
  []
  [PID_tripped_constant_value]
    type = ConstantFunction
    value = 1
  []
  [PID_tripped_status_fn]
    type = ParsedFunction
    symbol_values = 'PID_trip_status'
    symbol_names = 'PID_trip_status'
    expression = 'PID_trip_status'
  []
  [time_fn]
    type = ParsedFunction
    expression = t
  []
  # Shutdown function which ramps down the motor once told by the control logic
  [motor_torque_fn_shutdown]
    type = ParsedFunction
    symbol_values = 'PID_trip_status time_trip'
    symbol_names = 'PID_trip_status time_trip'
    expression = 'if(PID_trip_status = 1, max(2.4 - (2.4 * ((t - time_trip) / 35000)),0.0), 1)'
  []
  # Generates motor power curve
  [motor_power_fn]
    type = ParsedFunction
    expression = 'torque * speed'
    symbol_names = 'torque speed'
    symbol_values = 'motor_torque shaft:omega'
  []
  ##########################
  # Generator
  ##########################
  # Generates generator torque curve
  [generator_torque_fn]
    type = ParsedFunction
    expression = 'slope * t'
    symbol_names = 'slope'
    symbol_values = '${generator_torque_per_shaft_speed}'
  []
  # Generates generator power curve
  [generator_power_fn]
    type = ParsedFunction
    expression = 'torque * speed'
    symbol_names = 'torque speed'
    symbol_values = 'generator_torque shaft:omega'
  []
  ##########################
  # Reactor
  ##########################
  # Ramps up reactor power when activated by control logic
  [power_fn]
    type = PiecewiseLinear
    x = '0 1000 8600'
    y = '0 0 ${hs_power}'
  []
  ##########################
  # Compressor
  ##########################
  # compressor pressure ratios
  [rp_comp1]
    type = PiecewiseLinear
    data_file = 'rp_comp1.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_comp2]
    type = PiecewiseLinear
    data_file = 'rp_comp2.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_comp3]
    type = PiecewiseLinear
    data_file = 'rp_comp3.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_comp4]
    type = PiecewiseLinear
    data_file = 'rp_comp4.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_comp5]
    type = PiecewiseLinear
    data_file = 'rp_comp5.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  # compressor efficiencies
  [eff_comp1]
    type = ConstantFunction
    value = ${eff_comp}
  []
  [eff_comp2]
    type = ConstantFunction
    value = ${eff_comp}
  []
  [eff_comp3]
    type = ConstantFunction
    value = ${eff_comp}
  []
  [eff_comp4]
    type = ConstantFunction
    value = ${eff_comp}
  []
  [eff_comp5]
    type = ConstantFunction
    value = ${eff_comp}
  []
  ##########################
  # Turbine
  ##########################
  # turbine pressure ratios
  [rp_turb0]
    type = ConstantFunction
    value = 1
  []
  [rp_turb1]
    type = PiecewiseLinear
    data_file = 'rp_turb1.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_turb2]
    type = PiecewiseLinear
    data_file = 'rp_turb2.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_turb3]
    type = PiecewiseLinear
    data_file = 'rp_turb3.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_turb4]
    type = PiecewiseLinear
    data_file = 'rp_turb4.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  [rp_turb5]
    type = PiecewiseLinear
    data_file = 'rp_turb5.csv'
    x_index_in_file = 0
    y_index_in_file = 1
    format = columns
    extrap = true
  []
  # turbine efficiency
  [eff_turb1]
    type = ConstantFunction
    value = ${eff_turb}
  []
  [eff_turb2]
    type = ConstantFunction
    value = ${eff_turb}
  []
  [eff_turb3]
    type = ConstantFunction
    value = ${eff_turb}
  []
  [eff_turb4]
    type = ConstantFunction
    value = ${eff_turb}
  []
  [eff_turb5]
    type = ConstantFunction
    value = ${eff_turb}
  []
[]
[Components]
  # system inlet pulling air from the open atmosphere
  [inlet]
    type = InletStagnationPressureTemperature1Phase
    input = 'pipe1:in'
    p0 = ${p_ambient}
    T0 = ${T_ambient}
  []
  # Inlet pipe
  [pipe1]
    type = FlowChannel1Phase
    position = '${x1} ${y1} 0'
    orientation = '1 0 0'
    length = ${L1}
    n_elems = ${n_elems1}
    A = ${A1}
  []
  # Compressor as defined in MAGNET PCU document (Guillen 2020)
  [compressor]
    type = ShaftConnectedCompressor1Phase
    position = '${x2} ${y2} 0'
    inlet = 'pipe1:out'
    outlet = 'pipe2:in'
    A_ref = ${A_ref_comp}
    volume = ${V_comp}
    omega_rated = ${speed_rated}
    mdot_rated = ${rated_mfr}
    c0_rated = ${c0_rated_comp}
    rho0_rated = ${rho0_rated_comp}
    # Determines which compression ratio curve and efficiency curve to use depending on ratio of speed/rated_speed
    speeds = '0.5208 0.6250 0.7292 0.8333 0.9375'
    Rp_functions = 'rp_comp1 rp_comp2 rp_comp3 rp_comp4 rp_comp5'
    eff_functions = 'eff_comp1 eff_comp2 eff_comp3 eff_comp4 eff_comp5'
    min_pressure_ratio = 1.0
    speed_cr_I = 0
    inertia_const = ${I_comp}
    inertia_coeff = '${I_comp} 0 0 0'
    # assume no shaft friction
    speed_cr_fr = 0
    tau_fr_const = 0
    tau_fr_coeff = '0 0 0 0'
  []
  # Outlet pipe from the compressor
  [pipe2]
    type = FlowChannel1Phase
    position = '${x2} ${y2} 0'
    orientation = '1 0 0'
    length = ${L2}
    n_elems = ${n_elems2}
    A = ${A2}
  []
  # 90 degree connection between pipe 2 and 3
  [junction2_cold_leg]
    type = VolumeJunction1Phase
    connections = 'pipe2:out cold_leg:in'
    position = '${x3} ${y3} 0'
    volume = ${fparse A2*0.1}
  []
  # Cold leg of the recuperator
  [cold_leg]
    type = FlowChannel1Phase
    position = '${x3} ${y3} 0'
    orientation = '0 -1 0'
    length = ${fparse L3/2}
    n_elems = ${fparse n_elems3/2}
    A = ${A3}
  []
  # Recuperator which transfers heat from exhaust gas to reactor inlet gas to improve thermal efficency
  [recuperator]
    type = HeatStructureCylindrical
    orientation = '0 -1 0'
    position = '${x3} ${y3} 0'
    length = ${fparse L3/2}
    widths = ${recuperator_width}
    n_elems = ${fparse n_elems3/2}
    n_part_elems = 2
    names = recuperator
    solid_properties = steel
    solid_properties_T_ref = '300'
    inner_radius = ${D1}
  []
  # heat transfer from recuperator to cold leg
  [heat_transfer_cold_leg]
    type = HeatTransferFromHeatStructure1Phase
    flow_channel = cold_leg
    hs = recuperator
    hs_side = OUTER
    Hw = 10000
  []
  # heat transfer from hot leg to recuperator
  [heat_transfer_hot_leg]
    type = HeatTransferFromHeatStructure1Phase
    flow_channel = hot_leg
    hs = recuperator
    hs_side = INNER
    Hw = 10000
  []
  [junction_cold_leg_3]
    type = JunctionOneToOne1Phase
    connections = 'cold_leg:out pipe3:in'
  []
  [pipe3]
    type = FlowChannel1Phase
    position = '${x3} ${fparse y3 - (L3/2)} 0'
    orientation = '0 -1 0'
    length = ${fparse L3/2}
    n_elems = ${fparse n_elems3/2}
    A = ${A3}
  []
  # 90 degree connection between pipe 3 and 4
  [junction3_4]
    type = VolumeJunction1Phase
    connections = 'pipe3:out pipe4:in'
    position = '${x4} ${y4} 0'
    volume = ${fparse A3*0.1}
  []
  # Pipe through the "reactor core"
  [pipe4]
    type = FlowChannel1Phase
    position = '${x4} ${y4} 0'
    orientation = '-1 0 0'
    length = ${L4}
    n_elems = ${n_elems4}
    A = ${A4}
  []
  # "Reactor Core" and it's associated heat transfer to pipe 4
  [reactor]
    type = HeatStructureCylindrical
    orientation = '-1 0 0'
    position = '${x4} ${y4} 0'
    length = ${L4}
    widths = 0.15
    n_elems = ${n_elems4}
    n_part_elems = 2
    names = core
    solid_properties = steel
    solid_properties_T_ref = '300'
  []
  [total_power]
    type = TotalPower
    power = 0
  []
  [heat_generation]
    type = HeatSourceFromTotalPower
    power = total_power
    hs = reactor
    regions = core
  []
  [heat_transfer]
    type = HeatTransferFromHeatStructure1Phase
    flow_channel = pipe4
    hs = reactor
    hs_side = OUTER
    Hw = 10000
  []
  # 90 degree connection between pipe 4 and 5
  [junction4_5]
    type = VolumeJunction1Phase
    connections = 'pipe4:out pipe5:in'
    position = '${x5} ${y5} 0'
    volume = ${fparse A4*0.1}
  []
  # Pipe carrying hot gas back to the PCU
  [pipe5]
    type = FlowChannel1Phase
    position = '${x5} ${y5} 0'
    orientation = '0 1 0'
    length = ${L5}
    n_elems = ${n_elems5}
    A = ${A5}
  []
  # 90 degree connection between pipe 5 and 6
  [junction5_6]
    type = VolumeJunction1Phase
    connections = 'pipe5:out pipe6:in'
    position = '${x6} ${y6} 0'
    volume = ${fparse A5*0.1}
  []
  # Inlet pipe to the turbine
  [pipe6]
    type = FlowChannel1Phase
    position = '${x6} ${y6} 0'
    orientation = '1 0 0'
    length = ${L6}
    n_elems = ${n_elems6}
    A = ${A6}
  []
  # Turbine as defined in MAGNET PCU document (Guillen 2020) and (Wright 2006)
  [turbine]
    type = ShaftConnectedCompressor1Phase
    position = '${x7} ${y7} 0'
    inlet = 'pipe6:out'
    outlet = 'pipe7:in'
    A_ref = ${A_ref_turb}
    volume = ${V_turb}
    # A turbine is treated as an "inverse" compressor, this value determines if component is to be treated as turbine or compressor
    # If treat_as_turbine is omitted, code automatically assumes it is a compressor
    treat_as_turbine = true
    omega_rated = ${speed_rated}
    mdot_rated = ${rated_mfr}
    c0_rated = ${c0_rated_comp}
    rho0_rated = ${rho0_rated_comp}
    # Determines which compression ratio curve and efficiency curve to use depending on ratio of speed/rated_speed
    speeds = '0 0.5208 0.6250 0.7292 0.8333 0.9375'
    Rp_functions = 'rp_turb0 rp_turb1 rp_turb2 rp_turb3 rp_turb4 rp_turb5'
    eff_functions = 'eff_turb1 eff_turb1 eff_turb2 eff_turb3 eff_turb4 eff_turb5'
    min_pressure_ratio = 1.0
    speed_cr_I = 0
    inertia_const = ${I_turb}
    inertia_coeff = '${I_turb} 0 0 0'
    # assume no shaft friction
    speed_cr_fr = 0
    tau_fr_const = 0
    tau_fr_coeff = '0 0 0 0'
  []
  # Outlet pipe from turbine
  [pipe7]
    type = FlowChannel1Phase
    position = '${x7} ${y7} 0'
    orientation = '1 0 0'
    length = ${L7}
    n_elems = ${n_elems7}
    A = ${A7}
  []
  # 90 degree connection between pipe 7 and 8
  [junction7_hot_leg]
    type = VolumeJunction1Phase
    connections = 'pipe7:out hot_leg:in'
    position = '${x8} ${y8} 0'
    volume = ${fparse A7*0.1}
  []
  # Hot leg of the recuperator
  [hot_leg]
    type = FlowChannel1Phase
    position = '${x8} ${y8} 0'
    orientation = '0 1 0'
    length = ${L8}
    n_elems = ${n_elems8}
    A = ${A8}
  []
  # System outlet dumping exhaust gas to the atmosphere
  [outlet]
    type = Outlet1Phase
    input = 'hot_leg:out'
    p = ${p_ambient}
  []
  # Roatating shaft connecting motor, compressor, turbine, and generator
  [shaft]
    type = Shaft
    connected_components = 'motor compressor turbine generator'
    initial_speed = ${speed_initial}
  []
  # 3-Phase electircal motor used for system start-up, controlled by PID
  [motor]
    type = ShaftConnectedMotor
    inertia = ${I_motor}
    torque = 0 # controlled
  []
  # Electric generator supplying power to the grid
  [generator]
    type = ShaftConnectedMotor
    inertia = ${I_generator}
    torque = generator_torque_fn
  []
[]
# Control logics which govern startup of the motor, startup of the "reactor core", and shutdown of the motor
[ControlLogic]
  # Sets desired shaft speed to be reached by motor NOTE: SHOULD BE SET LOWER THAN RATED TURBINE RPM
  [set_point]
    type = GetFunctionValueControl
    function = ${fparse speed_rated_rpm - 9000}
  []
  # PID with gains determined by iterative process NOTE: Gain values are system specific
  [initial_motor_PID]
    type = PIDControl
    set_point = set_point:value
    input = shaft_RPM
    initial_value = 0
    K_p = 0.0011
    K_i = 0.00000004
    K_d = 0
  []
  # Determines when the PID system should be running and when it should begin the shutdown cycle. If needed: PID output, else: shutdown function
  [logic]
    type = ParsedFunctionControl
    function = 'if(motor+0.5 > turb, PID, shutdown_fn)'
    symbol_names = 'motor turb PID shutdown_fn'
    symbol_values = 'motor_torque turbine_torque initial_motor_PID:output motor_torque_fn_shutdown'
  []
  # Takes the output generated in [logic] and applies it to the motor torque
  [motor_PID]
    type = SetComponentRealValueControl
    component = motor
    parameter = torque
    value = logic:value
  []
  # Determines when to turn on heat source
  [power_logic]
    type = ParsedFunctionControl
    function = 'power_fn'
    symbol_names = 'power_fn'
    symbol_values = 'power_fn'
  []
  # Applies heat source to the total_power block
  [power_applied]
    type = SetComponentRealValueControl
    component = total_power
    parameter = power
    value = power_logic:value
  []
[]
[Controls]
  # Enables set_PID_tripped
  [PID_trip_status]
    type = ConditionalFunctionEnableControl
    conditional_function = is_tripped_fn
    enable_objects = 'AuxScalarKernels::PID_trip_status_aux'
    execute_on = 'TIMESTEP_END'
  []
  # Enables set_time_PID
  [time_PID]
    type = ConditionalFunctionEnableControl
    conditional_function = PID_tripped_status_fn
    disable_objects = 'AuxScalarKernels::time_trip_aux'
    execute_on = 'TIMESTEP_END'
  []
[]
[AuxVariables]
  # Creates a variable that will later be set to the time when tau_turbine > tau_motor
  [time_trip]
    order = FIRST
    family = SCALAR
  []
  # Creates variable which indicates if tau_turbine > tau_motor....... If tau_motor > tau_turbine, 0, else 1
  [PID_trip_status]
    order = FIRST
    family = SCALAR
    initial_condition = 0
  []
[]
[AuxScalarKernels]
  # Creates variable from time_fn which indicates when tau_turbine > tau_motor
  [time_trip_aux]
    type = FunctionScalarAux
    function = time_fn
    variable = time_trip
    execute_on = 'TIMESTEP_END'
  []
  # Overwrites variable PID_trip_status to the value from PID_tripped_constant_value (changes 0 to 1)
  [PID_trip_status_aux]
    type = FunctionScalarAux
    function = PID_tripped_constant_value
    variable = PID_trip_status
    execute_on = 'TIMESTEP_END'
    enable = false
  []
[]
[Postprocessors]
  # Indicates when tau_turbine > tau_motor
  [trip_time]
    type = ScalarVariable
    variable = time_trip
    execute_on = 'TIMESTEP_END'
  []
  ##########################
  # Motor
  ##########################
  [motor_torque]
    type = RealComponentParameterValuePostprocessor
    component = motor
    parameter = torque
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [motor_power]
    type = FunctionValuePostprocessor
    function = motor_power_fn
    execute_on = 'INITIAL TIMESTEP_END'
  []
  ##########################
  # generator
  ##########################
  [generator_torque]
    type = ShaftConnectedComponentPostprocessor
    quantity = torque
    shaft_connected_component_uo = generator:shaftconnected_uo
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [generator_power]
    type = FunctionValuePostprocessor
    function = generator_power_fn
    execute_on = 'INITIAL TIMESTEP_END'
  []
  ##########################
  # Shaft
  ##########################
  # Speed in rad/s
  [shaft_speed]
    type = ScalarVariable
    variable = 'shaft:omega'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  # speed in RPM
  [shaft_RPM]
    type = ParsedPostprocessor
    pp_names = 'shaft_speed'
    expression = '(shaft_speed * 60) /( 2 * ${fparse pi})'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  ##########################
  # Compressor
  ##########################
  [comp_dissipation_torque]
    type = ElementAverageValue
    variable = dissipation_torque
    block = 'compressor'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [comp_isentropic_torque]
    type = ElementAverageValue
    variable = isentropic_torque
    block = 'compressor'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [comp_friction_torque]
    type = ElementAverageValue
    variable = friction_torque
    block = 'compressor'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [compressor_torque]
    type = ParsedPostprocessor
    pp_names = 'comp_dissipation_torque comp_isentropic_torque comp_friction_torque'
    expression = 'comp_dissipation_torque + comp_isentropic_torque + comp_friction_torque'
  []
  [p_in_comp]
    type = PointValue
    variable = p
    point = '${x1_out} ${y1} 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [p_out_comp]
    type = PointValue
    variable = p
    point = '${x2_in} ${y2} 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [p_ratio_comp]
    type = ParsedPostprocessor
    pp_names = 'p_in_comp p_out_comp'
    expression = 'p_out_comp / p_in_comp'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [T_in_comp]
    type = PointValue
    variable = T
    point = '${x1_out} ${y1} 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [T_out_comp]
    type = PointValue
    variable = T
    point = '${x2_in} ${y2} 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [T_ratio_comp]
    type = ParsedPostprocessor
    pp_names = 'T_in_comp T_out_comp'
    expression = '(T_out_comp - T_in_comp) / T_out_comp'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [mfr_comp]
    type = ADFlowJunctionFlux1Phase
    boundary = pipe1:out
    connection_index = 0
    equation = mass
    junction = compressor
  []
  ##########################
  # turbine
  ##########################
  [turb_dissipation_torque]
    type = ElementAverageValue
    variable = dissipation_torque
    block = 'turbine'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [turb_isentropic_torque]
    type = ElementAverageValue
    variable = isentropic_torque
    block = 'turbine'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [turb_friction_torque]
    type = ElementAverageValue
    variable = friction_torque
    block = 'turbine'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [turbine_torque]
    type = ParsedPostprocessor
    pp_names = 'turb_dissipation_torque turb_isentropic_torque turb_friction_torque'
    expression = 'turb_dissipation_torque + turb_isentropic_torque + turb_friction_torque'
  []
  [p_in_turb]
    type = PointValue
    variable = p
    point = '${x6_out} ${y6} 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [p_out_turb]
    type = PointValue
    variable = p
    point = '${x7_in} ${y7} 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [p_ratio_turb]
    type = ParsedPostprocessor
    pp_names = 'p_in_turb p_out_turb'
    expression = 'p_in_turb / p_out_turb'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [T_in_turb]
    type = PointValue
    variable = T
    point = '${x6_out} ${y6} 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [T_out_turb]
    type = PointValue
    variable = T
    point = '${x7_in} ${y7} 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [mfr_turb]
    type = ADFlowJunctionFlux1Phase
    boundary = pipe6:out
    connection_index = 0
    equation = mass
    junction = turbine
  []
  ##########################
  # Recuperator
  ##########################
  [cold_leg_in]
    type = PointValue
    variable = T
    point = '${x3} ${cold_leg_in} 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [cold_leg_out]
    type = PointValue
    variable = T
    point = '${x3} ${cold_leg_out} 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [hot_leg_in]
    type = PointValue
    variable = T
    point = '${x8} ${hot_leg_in} 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [hot_leg_out]
    type = PointValue
    variable = T
    point = '${x8} ${hot_leg_out} 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  ##########################
  # Reactor
  ##########################
  [reactor_inlet]
    type = PointValue
    variable = T
    point = '${x4} ${y4} 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [reactor_outlet]
    type = PointValue
    variable = T
    point = '${x5} ${y5_in} 0'
    execute_on = 'INITIAL TIMESTEP_END'
  []
[]
[Executioner]
  type = Transient
  scheme = 'bdf2'
  end_time = ${t3}
  [TimeStepper]
    type = IterationAdaptiveDT
    dt = 0.01
    growth_factor = 1.1
    cutback_factor = 0.9
  []
  dtmin = 1e-5
  dtmax = 1000
  steady_state_detection = true
  steady_state_start_time = 200000
  solve_type = NEWTON
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-8
  nl_max_its = 15
  l_tol = 1e-4
  l_max_its = 10
  petsc_options_iname  = '-pc_type'
  petsc_options_value  = ' lu     '
[]
[Outputs]
  [e]
    type = Exodus
    file_base = 'recuperated_brayton_cycle_out'
  []
  [csv]
    type = CSV
    file_base = 'recuperated_brayton_cycle'
    execute_vector_postprocessors_on = 'INITIAL'
  []
  [console]
    type = Console
    show = 'shaft_speed p_ratio_comp p_ratio_turb pressure_ratio pressure_ratio'
  []
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/channel-drift-flux-w-interface-area.i)
mu = 10.0
rho = 100.0
mu_d = 1.0
rho_d = 1.0
l = 2
U = 1
dp = 0.01
inlet_phase_2 = 0.0
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
mass_exchange_coeff = 0.01
[GlobalParams]
  rhie_chow_user_object = 'rc'
  density_interp_method = 'average'
  mu_interp_method = 'average'
[]
[Problem]
  identify_variable_groups_in_nl = false
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = vel_x
    v = vel_y
    pressure = pressure
  []
[]
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = '${fparse l * 5}'
    ymin = '${fparse -l / 2}'
    ymax = '${fparse l / 2}'
    nx = 20
    ny = 5
  []
  uniform_refine = 0
[]
[Variables]
  [vel_x]
    type = INSFVVelocityVariable
    initial_condition = 0
  []
  [vel_y]
    type = INSFVVelocityVariable
    initial_condition = 0
  []
  [pressure]
    type = INSFVPressureVariable
  []
  [phase_2]
    type = INSFVScalarFieldVariable
  []
  [interface_area]
    type = INSFVScalarFieldVariable
  []
[]
[FVKernels]
  inactive = 'u_time v_time phase_2_time interface_area_time'
  [mass]
    type = INSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
  []
  [u_time]
    type = INSFVMomentumTimeDerivative
    variable = vel_x
    rho = 'rho_mixture'
    momentum_component = 'x'
  []
  [u_advection]
    type = INSFVMomentumAdvection
    variable = vel_x
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = 'rho_mixture'
    momentum_component = 'x'
  []
  [u_drift]
    type = WCNSFV2PMomentumDriftFlux
    variable = vel_x
    rho_d = ${rho_d}
    fd = 'rho_mixture_var'
    u_slip = 'vel_slip_x'
    v_slip = 'vel_slip_y'
    momentum_component = 'x'
  []
  [u_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_x
    mu = 'mu_mixture'
    limit_interpolation = true
    momentum_component = 'x'
  []
  [u_pressure]
    type = INSFVMomentumPressure
    variable = vel_x
    momentum_component = 'x'
    pressure = pressure
  []
  [v_time]
    type = INSFVMomentumTimeDerivative
    variable = vel_y
    rho = 'rho_mixture'
    momentum_component = 'y'
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = vel_y
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = 'rho_mixture'
    momentum_component = 'y'
  []
  [v_drift]
    type = WCNSFV2PMomentumDriftFlux
    variable = vel_y
    rho_d = ${rho_d}
    fd = 'rho_mixture_var'
    u_slip = 'vel_slip_x'
    v_slip = 'vel_slip_y'
    momentum_component = 'y'
  []
  [v_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_y
    mu = 'mu_mixture'
    limit_interpolation = true
    momentum_component = 'y'
  []
  [v_pressure]
    type = INSFVMomentumPressure
    variable = vel_y
    momentum_component = 'y'
    pressure = pressure
  []
  [phase_2_time]
    type = FVFunctorTimeKernel
    variable = phase_2
    functor = phase_2
  []
  [phase_2_advection]
    type = INSFVScalarFieldAdvection
    variable = phase_2
    u_slip = 'vel_slip_x'
    v_slip = 'vel_slip_y'
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = 'upwind'
  []
  [phase_2_diffusion]
    type = FVDiffusion
    variable = phase_2
    coeff = 1.0
  []
  [phase_2_src]
    type = NSFVMixturePhaseInterface
    variable = phase_2
    phase_coupled = phase_1
    alpha = ${mass_exchange_coeff}
  []
  [interface_area_time]
    type = FVFunctorTimeKernel
    variable = interface_area
    functor = interface_area
  []
  [interface_area_advection]
    type = INSFVScalarFieldAdvection
    variable = interface_area
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = 'upwind'
  []
  [interface_area_diffusion]
    type = FVDiffusion
    variable = interface_area
    coeff = 0.1
  []
  [interface_area_source_sink]
    type = WCNSFV2PInterfaceAreaSourceSink
    variable = interface_area
    u = 'vel_x'
    v = 'vel_y'
    L = 1.0
    rho = 'rho_mixture'
    rho_d = ${rho_d}
    pressure = 'pressure'
    k_c = ${fparse mass_exchange_coeff * 100.0}
    fd = 'phase_2'
    sigma = 1e-3
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_x
    functor = '${U}'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_y
    functor = '0'
  []
  [walls-u]
    type = INSFVNoSlipWallBC
    boundary = 'top bottom'
    variable = vel_x
    function = 0
  []
  [walls-v]
    type = INSFVNoSlipWallBC
    boundary = 'top bottom'
    variable = vel_y
    function = 0
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = '0'
  []
  [inlet_phase_2]
    type = FVDirichletBC
    boundary = 'left'
    variable = phase_2
    value = ${inlet_phase_2}
  []
  [inlet_interface_area]
    type = FVDirichletBC
    boundary = 'left'
    variable = interface_area
    value = 0.0
  []
[]
[AuxVariables]
  [drag_coefficient]
    type = MooseVariableFVReal
  []
  [rho_mixture_var]
    type = MooseVariableFVReal
  []
  [mu_mixture_var]
    type = MooseVariableFVReal
  []
[]
[AuxKernels]
  [populate_cd]
    type = FunctorAux
    variable = drag_coefficient
    functor = 'Darcy_coefficient'
  []
  [populate_rho_mixture_var]
    type = FunctorAux
    variable = rho_mixture_var
    functor = 'rho_mixture'
  []
  [populate_mu_mixture_var]
    type = FunctorAux
    variable = mu_mixture_var
    functor = 'mu_mixture'
  []
[]
[FunctorMaterials]
  [populate_u_slip]
    type = WCNSFV2PSlipVelocityFunctorMaterial
    slip_velocity_name = 'vel_slip_x'
    momentum_component = 'x'
    u = 'vel_x'
    v = 'vel_y'
    rho = ${rho}
    mu = 'mu_mixture'
    rho_d = ${rho_d}
    particle_diameter = ${dp}
    linear_coef_name = 'Darcy_coefficient'
  []
  [populate_v_slip]
    type = WCNSFV2PSlipVelocityFunctorMaterial
    slip_velocity_name = 'vel_slip_y'
    momentum_component = 'y'
    u = 'vel_x'
    v = 'vel_y'
    rho = ${rho}
    mu = 'mu_mixture'
    rho_d = ${rho_d}
    particle_diameter = ${dp}
    linear_coef_name = 'Darcy_coefficient'
  []
  [compute_phase_1]
    type = ADParsedFunctorMaterial
    property_name = phase_1
    functor_names = 'phase_2'
    expression = '1 - phase_2'
  []
  [CD]
    type = NSFVDispersePhaseDragFunctorMaterial
    rho = 'rho_mixture'
    mu = mu_mixture
    u = 'vel_x'
    v = 'vel_y'
    particle_diameter = ${dp}
  []
  [mixing_material]
    type = NSFVMixtureFunctorMaterial
    phase_2_names = '${rho} ${mu}'
    phase_1_names = '${rho_d} ${mu_d}'
    prop_names = 'rho_mixture mu_mixture'
    phase_1_fraction = 'phase_2'
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  nl_rel_tol = 1e-10
  # dt = 0.1
  # end_time = 1.0
  # nl_max_its = 10
[]
[Debug]
  show_var_residual_norms = true
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
    petsc_options_iname = '-pc_type -pc_factor_shift_type'
    petsc_options_value = 'lu       NONZERO'
  []
[]
[Outputs]
  exodus = true
[]
[Postprocessors]
  [Re]
    type = ParsedPostprocessor
    expression = '${rho} * ${l} * ${U}'
    pp_names = ''
  []
  [rho_outlet]
    type = SideAverageValue
    boundary = 'right'
    variable = 'rho_mixture_var'
  []
[]
(modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_ADmaterial_wave_reaction.i)
# Test for ADMatWaveReaction
# Manufactured solution: E_real = y^2 * x_hat - x^2 * y_hat
#                        E_imag = y^2 * x_hat - x^2 * y_hat
[Mesh]
  [gmg]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 5
    ny = 5
    xmin = -1
    ymin = -1
    elem_type = QUAD9
  []
[]
[Functions]
  #The exact solution for both the real and imag. component
  [exact]
    type = ParsedVectorFunction
    expression_x = 'y*y'
    expression_y = '-x*x'
  []
  #The forcing terms for the real and imag. component
  [source_real]
    type = ParsedVectorFunction
    symbol_names = 'omega_r mu_r epsilon_r omega_i mu_i epsilon_i'
    symbol_values = 'omega   mu   epsilon   omega   mu   epsilon'
    expression_x = '-epsilon_i*mu_i*omega_i^2*y^2 - 2*epsilon_i*mu_i*omega_i*omega_r*y^2 + epsilon_i*mu_i*omega_r^2*y^2 - epsilon_i*mu_r*omega_i^2*y^2 + 2*epsilon_i*mu_r*omega_i*omega_r*y^2 + epsilon_i*mu_r*omega_r^2*y^2 - epsilon_r*mu_i*omega_i^2*y^2 + 2*epsilon_r*mu_i*omega_i*omega_r*y^2 + epsilon_r*mu_i*omega_r^2*y^2 + epsilon_r*mu_r*omega_i^2*y^2 + 2*epsilon_r*mu_r*omega_i*omega_r*y^2 - epsilon_r*mu_r*omega_r^2*y^2 - 2'
    expression_y = 'epsilon_i*mu_i*omega_i^2*x^2 + 2*epsilon_i*mu_i*omega_i*omega_r*x^2 - epsilon_i*mu_i*omega_r^2*x^2 + epsilon_i*mu_r*omega_i^2*x^2 - 2*epsilon_i*mu_r*omega_i*omega_r*x^2 - epsilon_i*mu_r*omega_r^2*x^2 + epsilon_r*mu_i*omega_i^2*x^2 - 2*epsilon_r*mu_i*omega_i*omega_r*x^2 - epsilon_r*mu_i*omega_r^2*x^2 - epsilon_r*mu_r*omega_i^2*x^2 - 2*epsilon_r*mu_r*omega_i*omega_r*x^2 + epsilon_r*mu_r*omega_r^2*x^2 + 2'
  []
  [source_imag]
    type = ParsedVectorFunction
    symbol_names = 'omega_r mu_r epsilon_r omega_i mu_i epsilon_i'
    symbol_values = 'omega   mu   epsilon   omega   mu   epsilon'
    expression_x = '-epsilon_i*mu_i*omega_i^2*y^2 + 2*epsilon_i*mu_i*omega_i*omega_r*y^2 + epsilon_i*mu_i*omega_r^2*y^2 + epsilon_i*mu_r*omega_i^2*y^2 + 2*epsilon_i*mu_r*omega_i*omega_r*y^2 - epsilon_i*mu_r*omega_r^2*y^2 + epsilon_r*mu_i*omega_i^2*y^2 + 2*epsilon_r*mu_i*omega_i*omega_r*y^2 - epsilon_r*mu_i*omega_r^2*y^2 + epsilon_r*mu_r*omega_i^2*y^2 - 2*epsilon_r*mu_r*omega_i*omega_r*y^2 - epsilon_r*mu_r*omega_r^2*y^2 - 2'
    expression_y = 'epsilon_i*mu_i*omega_i^2*x^2 - 2*epsilon_i*mu_i*omega_i*omega_r*x^2 - epsilon_i*mu_i*omega_r^2*x^2 - epsilon_i*mu_r*omega_i^2*x^2 - 2*epsilon_i*mu_r*omega_i*omega_r*x^2 + epsilon_i*mu_r*omega_r^2*x^2 - epsilon_r*mu_i*omega_i^2*x^2 - 2*epsilon_r*mu_i*omega_i*omega_r*x^2 + epsilon_r*mu_i*omega_r^2*x^2 - epsilon_r*mu_r*omega_i^2*x^2 + 2*epsilon_r*mu_r*omega_i*omega_r*x^2 + epsilon_r*mu_r*omega_r^2*x^2 + 2'
  []
  #Material Coefficients
  [omega]
    type = ParsedFunction
    expression = '2.0'
  []
  [mu]
    type = ParsedFunction
    expression = '1.0'
  []
  [epsilon]
    type = ParsedFunction
    expression = '3.0'
  []
[]
[Materials]
  [WaveCoeff]
    type = WaveEquationCoefficient
    eps_rel_imag = eps_imag
    eps_rel_real = eps_real
    k_real = k_real
    k_imag = k_imag
    mu_rel_imag = mu_imag
    mu_rel_real = mu_real
  []
  [eps_real]
    type = ADGenericFunctionMaterial
    prop_names = eps_real
    prop_values = epsilon
  []
  [eps_imag]
    type = ADGenericFunctionMaterial
    prop_names = eps_imag
    prop_values = epsilon
  []
  [mu_real]
    type = ADGenericFunctionMaterial
    prop_names = mu_real
    prop_values = mu
  []
  [mu_imag]
    type = ADGenericFunctionMaterial
    prop_names = mu_imag
    prop_values = mu
  []
  [k_real]
    type = ADGenericFunctionMaterial
    prop_names = k_real
    prop_values = omega
  []
  [k_imag]
    type = ADGenericFunctionMaterial
    prop_names = k_imag
    prop_values = omega
  []
[]
[Variables]
  [E_real]
    family = NEDELEC_ONE
    order = FIRST
  []
  [E_imag]
    family = NEDELEC_ONE
    order = FIRST
  []
[]
[Kernels]
  [curl_curl_real]
    type = CurlCurlField
    variable = E_real
  []
  [coeff_real]
    type = ADMatWaveReaction
    variable = E_real
    field_real =  E_real
    field_imag =  E_imag
    wave_coef_real = wave_equation_coefficient_real
    wave_coef_imag = wave_equation_coefficient_imaginary
    component = real
  []
  [body_force_real]
    type = VectorBodyForce
    variable = E_real
    function = source_real
  []
  [curl_curl_imag]
    type = CurlCurlField
    variable = E_imag
  []
  [coeff_imag]
    type = ADMatWaveReaction
    variable = E_imag
    field_real =  E_real
    field_imag =  E_imag
    wave_coef_real = wave_equation_coefficient_real
    wave_coef_imag = wave_equation_coefficient_imaginary
    component = imaginary
  []
  [body_force_imag]
    type = VectorBodyForce
    variable = E_imag
    function = source_imag
  []
[]
[BCs]
  [sides_real]
    type = VectorCurlPenaltyDirichletBC
    variable = E_real
    function_x = 'y*y'
    function_y = '-x*x'
    penalty = 1e8
    boundary = 'left right top bottom'
  []
  [sides_imag]
    type = VectorCurlPenaltyDirichletBC
    variable = E_imag
    function_x = 'y*y'
    function_y = '-x*x'
    penalty = 1e8
    boundary = 'left right top bottom'
  []
[]
[Postprocessors]
  [error_real]
    type = ElementVectorL2Error
    variable = E_real
    function = exact
  []
  [error_imag]
    type = ElementVectorL2Error
    variable = E_imag
    function = exact
  []
  [h]
    type = AverageElementSize
  []
  [h_squared]
    type = ParsedPostprocessor
    pp_names = 'h'
    expression = 'h * h'
  []
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
[]
[Outputs]
  exodus = true
  csv = true
[]
(modules/combined/examples/optimization/thermomechanical/thermal_sub.i)
vol_frac = 0.4
power = 2.0
E0 = 1.0e-6
E1 = 1.0
rho0 = 0.0
rho1 = 1.0
C0 = 1.0e-6
C1 = 1.0
TC0 = 1.0e-16
TC1 = 1.0
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Mesh]
  [MeshGenerator]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 40
    ny = 40
    xmin = 0
    xmax = 40
    ymin = 0
    ymax = 40
  []
  [node]
    type = ExtraNodesetGenerator
    input = MeshGenerator
    new_boundary = hold
    nodes = 0
  []
  [push_left]
    type = ExtraNodesetGenerator
    input = node
    new_boundary = push_left
    coord = '16 0 0'
  []
  [push_center]
    type = ExtraNodesetGenerator
    input = push_left
    new_boundary = push_center
    coord = '24 0 0'
  []
  [extra]
    type = SideSetsFromBoundingBoxGenerator
    input = push_center
    bottom_left = '-0.01 17.999  0'
    top_right = '5 22.001  0'
    boundary_new = n1
    included_boundaries = left
  []
  [dirichlet_bc]
    type = SideSetsFromNodeSetsGenerator
    input = extra
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [temp]
    initial_condition = 100.0
  []
[]
[AuxVariables]
  [Dc]
    family = MONOMIAL
    order = FIRST
    initial_condition = -1.0
  []
  [Cc]
    family = MONOMIAL
    order = FIRST
    initial_condition = -1.0
  []
  [Tc]
    family = MONOMIAL
    order = FIRST
    initial_condition = -1.0
  []
  [Cost]
    family = MONOMIAL
    order = FIRST
    initial_condition = -1.0
  []
  [mat_den]
    family = MONOMIAL
    order = FIRST
    initial_condition = ${vol_frac}
  []
[]
[AuxKernels]
  [Cost]
    type = MaterialRealAux
    variable = Cost
    property = Cost_mat
  []
[]
[Kernels]
  [heat_conduction]
    type = HeatConduction
    variable = temp
    diffusion_coefficient = thermal_cond
  []
  [heat_source]
    type = HeatSource
    value = 1e-2 # W/m^3
    variable = temp
  []
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    strain = SMALL
    add_variables = true
    incremental = false
  []
[]
[BCs]
  [no_y]
    type = DirichletBC
    variable = disp_y
    boundary = hold
    value = 0.0
  []
  [no_x_symm]
    type = DirichletBC
    variable = disp_x
    boundary = right
    value = 0.0
  []
  [left_n1]
    type = DirichletBC
    variable = temp
    boundary = n1
    value = 0.0
  []
  [top]
    type = NeumannBC
    variable = temp
    boundary = top
    value = 0
  []
  [bottom]
    type = NeumannBC
    variable = temp
    boundary = bottom
    value = 0
  []
  [right]
    type = NeumannBC
    variable = temp
    boundary = right
    value = 0
  []
  [left]
    type = NeumannBC
    variable = temp
    boundary = left
    value = 0
  []
[]
[NodalKernels]
  [push_left]
    type = NodalGravity
    variable = disp_y
    boundary = push_left
    gravity_value = 0.0 # -1e-8
    mass = 1
  []
  [push_center]
    type = NodalGravity
    variable = disp_y
    boundary = push_center
    gravity_value = 0.0 # -1e-8
    mass = 1
  []
[]
[Materials]
  [thermal_cond]
    type = DerivativeParsedMaterial
    # ordered multimaterial simp
    expression = "A1:=(${TC0}-${TC1})/(${rho0}^${power}-${rho1}^${power}); "
                 "B1:=${TC0}-A1*${rho0}^${power}; TC1:=A1*mat_den^${power}+B1; TC1"
    coupled_variables = 'mat_den'
    property_name = thermal_cond
    outputs = 'exodus'
  []
  [thermal_compliance]
    type = ThermalCompliance
    temperature = temp
    thermal_conductivity = thermal_cond
    outputs = 'exodus'
  []
  [elasticity_tensor]
    type = ComputeVariableIsotropicElasticityTensor
    youngs_modulus = E_phys
    poissons_ratio = poissons_ratio
    args = 'mat_den'
  []
  [E_phys]
    type = DerivativeParsedMaterial
    # ordered multimaterial simp
    expression = "A1:=(${E0}-${E1})/(${rho0}^${power}-${rho1}^${power}); "
                 "B1:=${E0}-A1*${rho0}^${power}; E1:=A1*mat_den^${power}+B1; E1"
    coupled_variables = 'mat_den'
    property_name = E_phys
  []
  [Cost_mat]
    type = DerivativeParsedMaterial
    # ordered multimaterial simp
    expression = "A1:=(${C0}-${C1})/(${rho0}^(1/${power})-${rho1}^(1/${power})); "
                 "B1:=${C0}-A1*${rho0}^(1/${power}); C1:=A1*mat_den^(1/${power})+B1; C1"
    coupled_variables = 'mat_den'
    property_name = Cost_mat
  []
  [CostDensity]
    type = ParsedMaterial
    property_name = CostDensity
    coupled_variables = 'mat_den Cost'
    expression = 'mat_den*Cost'
  []
  [poissons_ratio]
    type = GenericConstantMaterial
    prop_names = poissons_ratio
    prop_values = 0.3
  []
  [stress]
    type = ComputeLinearElasticStress
  []
  [dc]
    type = ComplianceSensitivity
    design_density = mat_den
    youngs_modulus = E_phys
  []
  [cc]
    type = CostSensitivity
    design_density = mat_den
    cost = Cost_mat
    outputs = 'exodus'
  []
  [tc]
    type = ThermalSensitivity
    design_density = mat_den
    thermal_conductivity = thermal_cond
    temperature = temp
    outputs = 'exodus'
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[UserObjects]
  [rad_avg]
    type = RadialAverage
    radius = 0.1
    weights = linear
    prop_name = sensitivity
    execute_on = TIMESTEP_END
    force_preaux = true
  []
  [rad_avg_cost]
    type = RadialAverage
    radius = 0.1
    weights = linear
    prop_name = cost_sensitivity
    execute_on = TIMESTEP_END
    force_preaux = true
  []
  [rad_avg_thermal]
    type = RadialAverage
    radius = 0.1
    weights = linear
    prop_name = thermal_sensitivity
    execute_on = TIMESTEP_END
    force_preaux = true
  []
  # Provides Dc
  [calc_sense]
    type = SensitivityFilter
    density_sensitivity = Dc
    design_density = mat_den
    filter_UO = rad_avg
    execute_on = TIMESTEP_END
    force_postaux = true
  []
  # Provides Cc
  [calc_sense_cost]
    type = SensitivityFilter
    density_sensitivity = Cc
    design_density = mat_den
    filter_UO = rad_avg_cost
    execute_on = TIMESTEP_END
    force_postaux = true
  []
  # Provides Tc
  [calc_sense_thermal]
    type = SensitivityFilter
    density_sensitivity = Tc
    design_density = mat_den
    filter_UO = rad_avg_thermal
    execute_on = TIMESTEP_END
    force_postaux = true
  []
[]
[Executioner]
  type = Transient
  solve_type = PJFNK
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu superlu_dist'
  nl_abs_tol = 1e-12
  dt = 1.0
  num_steps = 500
[]
[Outputs]
  exodus = true
  [out]
    type = CSV
    execute_on = 'TIMESTEP_END'
  []
  print_linear_residuals = false
[]
[Postprocessors]
  [right_flux]
    type = SideDiffusiveFluxAverage
    variable = temp
    boundary = right
    diffusivity = 10
  []
  [mesh_volume]
    type = VolumePostprocessor
    execute_on = 'initial timestep_end'
  []
  [total_vol]
    type = ElementIntegralVariablePostprocessor
    variable = mat_den
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [vol_frac]
    type = ParsedPostprocessor
    expression = 'total_vol / mesh_volume'
    pp_names = 'total_vol mesh_volume'
  []
  [sensitivity]
    type = ElementIntegralMaterialProperty
    mat_prop = sensitivity
  []
  [cost_sensitivity]
    type = ElementIntegralMaterialProperty
    mat_prop = cost_sensitivity
  []
  [cost]
    type = ElementIntegralMaterialProperty
    mat_prop = CostDensity
  []
  [cost_frac]
    type = ParsedPostprocessor
    expression = 'cost / mesh_volume'
    pp_names = 'cost mesh_volume'
  []
  [objective]
    type = ElementIntegralMaterialProperty
    mat_prop = strain_energy_density
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [objective_thermal]
    type = ElementIntegralMaterialProperty
    mat_prop = thermal_compliance
    execute_on = 'INITIAL TIMESTEP_END'
  []
[]
(modules/heat_transfer/test/tests/gap_heat_transfer_radiation/sphere.i)
#
# This problem is one of radiation boundary conditions between two
# spherical surfaces.
#
#            S(T1^4 - T2^4)                         R1^2
# flux1 = - ----------------   and flux2 = -flux1 * ----
#           1    1 - e2   R1^2                      R2^2
#           -- + ------ * ----
#           e1     e2     R2^2
#
# where S is the Stefan Boltzmann constant         5.67e-8 W/m^2/K^4
#       T1 is the temperature on the left surface  278 K
#       T2 is the temperature on the right surface 333 K
#       e1 is the emissivity for the left surface  0.8
#       e2 is the emissivity for the left surface  0.9
#       R1 is the radius of the inner surface      0.1 m
#       R2 is the radius of the outer surface      0.11 m
#
# Flux1:
# Exact           Code
# -------------   -------------
# -267.21 W/m^2   -267.02 W/m^2
#
# Flux2:
# Exact           Code
# -------------   -------------
#  220.83 W/m^2    220.70 W/m^2
#
thick = 0.01
R1 = 0.1
R2 = 0.11
[GlobalParams]
  order = second
  family = lagrange
[]
[Mesh]
  coord_type = RSPHERICAL
  [mesh1]
    type = GeneratedMeshGenerator
    dim = 1
    elem_type = edge3
    nx = 4
    xmin = '${fparse R1 - thick}'
    xmax = '${R1}'
    boundary_name_prefix = left
  []
  [mesh2]
    type = GeneratedMeshGenerator
    dim = 1
    elem_type = edge3
    nx = 4
    ny = 1
    xmin = '${R2}'
    xmax = '${fparse R2 + thick}'
    boundary_id_offset = 4
    boundary_name_prefix = right
  []
  [final]
    type = CombinerGenerator
    inputs = 'mesh1 mesh2'
  []
[]
[Variables]
  [temperature]
  []
[]
[Kernels]
  [heat_conduction]
    type = HeatConduction
    variable = temperature
  []
[]
[BCs]
  [left]
    type = DirichletBC
    variable = temperature
    boundary = left_left
    value = 278
  []
  [right]
    type = DirichletBC
    variable = temperature
    boundary = right_right
    value = 333
  []
[]
[Materials]
  [heat]
    type = HeatConductionMaterial
    thermal_conductivity = 200 # W/m/K
    specific_heat = 4.2e5
  []
[]
[ThermalContact]
  [thermal_contact]
    type = GapHeatTransfer
    variable = temperature
    primary = left_right
    secondary = right_left
    emissivity_primary = 0.8
    emissivity_secondary = 0.9
    quadrature = true
    gap_conductivity = 1e-40 # requires a positive value
    gap_geometry_type = sphere
  []
[]
[Functions]
  [analytic_flux_1]
    type = ParsedFunction
    symbol_names = 'S        T1  T2  e1  e2  R1    R2'
    symbol_values = '5.67e-8 278 333 0.8 0.9 ${R1} ${R2}'
    expression = 'T14 := T1*T1*T1*T1;
                  T24 := T2*T2*T2*T2;
                  S*(T14-T24)/(1/e1+(1-e2)/e2*R1*R1/R2/R2)'
  []
  [analytic_flux_2]
    type = ParsedFunction
    symbol_names = 'S        T1  T2  e1  e2  R1    R2'
    symbol_values = '5.67e-8 278 333 0.8 0.9 ${R1} ${R2}'
    expression = 'T14 := T1*T1*T1*T1;
                  T24 := T2*T2*T2*T2;
                  -S*(T14-T24)/(1/e1+(1-e2)/e2*R1*R1/R2/R2)*R1*R1/R2/R2'
  []
[]
[Postprocessors]
  [code_flux_1]
    type = SideDiffusiveFluxAverage
    variable = temperature
    boundary = left_right
    diffusivity = thermal_conductivity
    execute_on = 'initial timestep_end'
  []
  [analytic_flux_1]
    type = FunctionValuePostprocessor
    function = analytic_flux_1
    execute_on = 'initial timestep_end'
  []
  [error_1]
    type = ParsedPostprocessor
    pp_names = 'code_flux_1 analytic_flux_1'
    expression = '(analytic_flux_1 - code_flux_1)/analytic_flux_1*100'
    execute_on = 'initial timestep_end'
  []
  [code_flux_2]
    type = SideDiffusiveFluxAverage
    variable = temperature
    boundary = right_left
    diffusivity = thermal_conductivity
    execute_on = 'initial timestep_end'
  []
  [analytic_flux_2]
    type = FunctionValuePostprocessor
    function = analytic_flux_2
    execute_on = 'initial timestep_end'
  []
  [error_2]
    type = ParsedPostprocessor
    pp_names = 'code_flux_2 analytic_flux_2'
    expression = '(analytic_flux_2 - code_flux_2)/analytic_flux_2*100'
    execute_on = 'initial timestep_end'
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = newton
  num_steps = 1
  dt = 1
  end_time = 1
  nl_abs_tol = 1e-12
  nl_rel_tol = 1e-10
[]
[Outputs]
  csv = true
[]
(modules/heat_transfer/test/tests/gap_heat_transfer_mortar/large_gap_heat_transfer_test_sphere.i)
sphere_outer_htc = 10 # W/m^2/K
sphere_outer_Tinf = 300 # K
[GlobalParams]
  order = SECOND
  family = LAGRANGE
[]
[Mesh]
  [file]
    type = FileMeshGenerator
    file = cyl2D.e
  []
  allow_renumbering = false
  coord_type = RZ
[]
[Functions]
  [temp]
    type = PiecewiseLinear
    x = '0   1'
    y = '100 200'
  []
[]
[Variables]
  [temp]
    initial_condition = 500
  []
[]
[AuxVariables]
  [gap_conductance]
    order = CONSTANT
    family = MONOMIAL
  []
  [power_density]
    block = 'fuel'
    initial_condition = 50e3
  []
[]
[Kernels]
  [heat_conduction]
    type = HeatConduction
    variable = temp
  []
  [heat_source]
    type = CoupledForce
    variable = temp
    block = 'fuel'
    v = power_density
  []
[]
[AuxKernels]
  [gap_cond]
    type = MaterialRealAux
    property = gap_conductance
    variable = gap_conductance
    boundary = 2
  []
[]
[Materials]
  [heat1]
    type = HeatConductionMaterial
    block = '1 2'
    specific_heat = 1.0
    thermal_conductivity = 34.6
  []
[]
[ThermalContact]
  [thermal_contact]
    type = GapHeatTransfer
    variable = temp
    primary = 3
    secondary = 2
    emissivity_primary = 0.0
    emissivity_secondary = 0.0
    gap_conductivity = 5
  #  quadrature = true
    gap_geometry_type = SPHERE
    sphere_origin = '0 0 0'
  []
[]
[BCs]
  [RPV_out_BC] # k \nabla T = h (T- T_inf) at RPV outer boundary
    type = ConvectiveFluxFunction # (Robin BC)
    variable = temp
    boundary = '4' # outer RPV
    coefficient = ${sphere_outer_htc}
    T_infinity = ${sphere_outer_Tinf}
  []
[]
[VectorPostprocessors]
  [NodalTemperature]
    type = NodalValueSampler
    sort_by = id
    boundary = '2 3'
    variable = temp
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu       superlu_dist'
  dt = 1
  dtmin = 0.01
  end_time = 1
  nl_rel_tol = 1e-12
  nl_abs_tol = 1e-7
  [Quadrature]
    order = fifth
    side_order = seventh
  []
[]
[Outputs]
  exodus = true
  csv = true
  [Console]
    type = Console
  []
[]
[Postprocessors]
  [temp_left]
    type = SideAverageValue
    boundary = 2
    variable = temp
  []
  [temp_right]
    type = SideAverageValue
    boundary = 3
    variable = temp
  []
  [flux_left]
    type = SideDiffusiveFluxIntegral
    variable = temp
    boundary = 2
    diffusivity = thermal_conductivity
  []
  [flux_right]
    type = SideDiffusiveFluxIntegral
    variable = temp
    boundary = 3
    diffusivity = thermal_conductivity
  []
  [ptot]
    type = ElementIntegralVariablePostprocessor
    variable = power_density
    block = 'fuel'
  []
  [sphere_convective_out]
    type = ConvectiveHeatTransferSideIntegral
    T_solid = temp
    boundary = '4' # outer RVP
    T_fluid = ${sphere_outer_Tinf}
    htc = ${sphere_outer_htc}
  []
  [heat_balance] # should be equal to 0 upon convergence
    type = ParsedPostprocessor
    expression = '(sphere_convective_out - ptot) / ptot'
    pp_names = 'sphere_convective_out ptot'
  []
[]
(modules/subchannel/validation/ORNL_19_pin/ORNL_19.i)
# M. Fontana, et All,
# "Temperature distribution in the duct wall and at the exit of a 19-pin simulated lmfbr fuel assembly (ffm bundle 2a),
# "Nuclear Technology, vol. 24, no. 2, pp. 176-200, 1974.
T_in = 588.5
flow_area = 0.0004980799633447909 #m2
mass_flux_in = '${fparse 55*3.78541/10/60/flow_area}'
P_out = 2.0e5 # Pa
[TriSubChannelMesh]
  [subchannel]
    type = SCMTriSubChannelMeshGenerator
    nrings = 3
    n_cells = 40
    flat_to_flat = 3.41e-2
    heated_length = 0.5334
    unheated_length_entry = 0.4064
    unheated_length_exit = 0.0762
    pin_diameter = 5.84e-3
    pitch = 7.26e-3
    dwire = 1.42e-3
    hwire = 0.3048
  []
[]
[AuxVariables]
  [mdot]
  []
  [SumWij]
  []
  [P]
  []
  [DP]
  []
  [h]
  []
  [T]
  []
  [rho]
  []
  [S]
  []
  [w_perim]
  []
  [q_prime]
  []
  [mu]
  []
  [displacement]
  []
[]
[FluidProperties]
  [sodium]
    type = PBSodiumFluidProperties
  []
[]
[Problem]
  type = TriSubChannel1PhaseProblem
  fp = sodium
  n_blocks = 1
  P_out = 2.0e5
  CT = 2.6
  compute_density = true
  compute_viscosity = true
  compute_power = true
  implicit = true
  segregated = false
  staggered_pressure = false
  monolithic_thermal = true
  verbose_multiapps = true
  verbose_subchannel = true
  interpolation_scheme = upwind
[]
[ICs]
  [S_IC]
    type = SCMTriFlowAreaIC
    variable = S
  []
  [w_perim_IC]
    type = SCMTriWettedPerimIC
    variable = w_perim
  []
  [q_prime_IC]
    type = SCMTriPowerIC
    variable = q_prime
    power = 16975 # W/m
    filename = "pin_power_profile19.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
  []
[]
[AuxKernels]
  [T_in_bc]
    type = ConstantAux
    variable = T
    boundary = inlet
    value = ${T_in}
    execute_on = 'timestep_begin'
  []
  [mdot_in_bc]
    type = SCMMassFlowRateAux
    variable = mdot
    boundary = inlet
    area = S
    mass_flux = ${mass_flux_in}
    execute_on = 'timestep_begin'
  []
[]
[Outputs]
  exodus = true
  csv = true
[]
[Executioner]
  type = Steady
[]
[Postprocessors]
  [T]
    type = SubChannelPointValue
    variable = T
    index = 36
    execute_on = "timestep_end"
    height = 0.7
  []
  [Pin_Planar_Mean]
    type = SCMPlanarMean
    variable = P
    execute_on = 'TIMESTEP_END'
    height = 0.0
  []
  [Pout_Planar_Mean]
    type = SCMPlanarMean
    variable = P
    execute_on = 'TIMESTEP_END'
    height = 1.2
  []
  [Pout_user_provided]
    type = Receiver
    default = ${P_out}
    execute_on = 'TIMESTEP_END'
  []
  ####### Assembly pressure drop
  [DP_Planar_mean]
    type = ParsedPostprocessor
    pp_names = 'Pin_Planar_Mean Pout_Planar_Mean'
    expression = 'Pin_Planar_Mean - Pout_Planar_Mean'
  []
  [DP_SubchannelDelta]
    type = SubChannelDelta
    variable = P
    execute_on = 'TIMESTEP_END'
  []
[]
################################################################################
# A multiapp that projects data to a detailed mesh
################################################################################
[MultiApps]
  [viz]
    type = FullSolveMultiApp
    input_files = "3d_ORNL_19.i"
    execute_on = "timestep_end"
  []
[]
[Transfers]
  [xfer]
    type = SCMSolutionTransfer
    to_multi_app = viz
    variable = 'mdot SumWij P DP h T rho mu q_prime S'
  []
[]
(modules/combined/test/tests/subchannel_thm_coupling/THM_SCM_coupling.i)
# THM file based on https://mooseframework.inl.gov/modules/thermal_hydraulics/tutorials/single_phase_flow/step05.html
# Used to loosely couple THM with SCM
# This is a simple open loop with fixed massflow at the inlet and pressure at the outlet.
# THM sends massflux and temperature at the inlet of the core, and pressure at the outlet of the core
# to subchannel. Subchannel returns total pressure drop of the assembly and total power to THM and THM calculates an
# average friction factor for the core region.
T_in = 583.0 # K
m_dot_in = 1 # kg/s
press = 2e5 # Pa
SC_core = 0.0004980799633447909 #m2
# core parameters
core_length = 1. # m
core_n_elems = 1
A_core = 0.005 #dummy
# pipe parameters
pipe_dia = '${units 10. cm -> m}'
A_pipe = '${fparse 0.25 * pi * pipe_dia^2}'
# heat exchanger parameters
hx_dia_inner = '${units 12. cm -> m}'
hx_wall_thickness = '${units 5. mm -> m}'
hx_dia_outer = '${units 50. cm -> m}'
hx_radius_wall = '${fparse hx_dia_inner / 2. + hx_wall_thickness}'
hx_length = 1.5 # m
hx_n_elems = 25
m_dot_sec_in = 1. # kg/s
[GlobalParams]
  initial_p = ${press}
  initial_vel = 0.0001
  initial_T = ${T_in}
  initial_vel_x = 0
  initial_vel_y = 0
  initial_vel_z = 0
  gravity_vector = '0 0 0'
  rdg_slope_reconstruction = minmod
  scaling_factor_1phase = '1 1e-2 1e-4'
  scaling_factor_rhoV = 1
  scaling_factor_rhouV = 1e-2
  scaling_factor_rhovV = 1e-2
  scaling_factor_rhowV = 1e-2
  scaling_factor_rhoEV = 1e-4
  closures = thm_closures
  fp = sodium_eos
[]
[Functions]
  [q_wall_fn]
    type = ParsedFunction
    symbol_names = 'core_power length'
    symbol_values = 'core_power  ${core_length}'
    expression = 'core_power/length'
  []
[]
[FluidProperties]
  [water]
    type = StiffenedGasFluidProperties
    gamma = 2.35
    cv = 1816.0
    q = -1.167e6
    p_inf = 1.0e9
    q_prime = 0
  []
  [sodium_eos]
    type = StiffenedGasFluidProperties
    gamma = 1.24
    cv = 1052.8
    q = -2.6292e+05
    p_inf = 1.1564e+08
    q_prime = 0
    mu = 3.222e-04
    k = 73.82
  []
[]
[Closures]
  [thm_closures]
    type = Closures1PhaseTHM
  []
  [none_closures]
    type = Closures1PhaseNone
  []
[]
[Materials]
  [f_mat]
    type = ADParsedMaterial
    property_name = f_D
    postprocessor_names = 'core_f'
    expression = 'core_f'
    block = 'core_chan'
  []
[]
[HeatStructureMaterials]
  [steel]
    type = SolidMaterialProperties
    rho = 8050
    k = 45
    cp = 466
  []
[]
[Components]
  [inlet]
    type = InletMassFlowRateTemperature1Phase
    input = 'bottom_2:in'
    m_dot = ${m_dot_in}
    T = ${T_in}
  []
  [outlet]
    type = Outlet1Phase
    input = 'bottom_1:out'
    p = ${press}
  []
  [up_pipe_1]
    type = FlowChannel1Phase
    position = '0 0 -0.5'
    orientation = '0 0 1'
    length = 0.5
    n_elems = 15
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct1]
    type = JunctionParallelChannels1Phase
    position = '0 0 0'
    connections = 'up_pipe_1:out core_chan:in'
    volume = 1e-5
  []
  [core_chan]
    type = FlowChannel1Phase
    position = '0 0 0'
    orientation = '0 0 1'
    length = ${core_length}
    n_elems = ${core_n_elems}
    A = ${A_core}
    closures = none_closures
  []
  [core_ht]
    type = HeatTransferFromHeatFlux1Phase
    flow_channel = core_chan
    q_wall = q_wall_fn
    P_hf = 1
  []
  [jct2]
    type = JunctionParallelChannels1Phase
    position = '0 0 1'
    connections = 'core_chan:out up_pipe_2:in'
    volume = 1e-5
  []
  [up_pipe_2]
    type = FlowChannel1Phase
    position = '0 0 1'
    orientation = '0 0 1'
    length = 0.5
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct3]
    type = JunctionOneToOne1Phase
    connections = 'up_pipe_2:out top_pipe_1:in'
  []
  [top_pipe_1]
    type = FlowChannel1Phase
    position = '0 0 1.5'
    orientation = '1 0 0'
    length = 0.5
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [top_pipe_2]
    type = FlowChannel1Phase
    position = '0.5 0 1.5'
    orientation = '1 0 0'
    length = 0.5
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct4]
    type = VolumeJunction1Phase
    position = '0.5 0 1.5'
    volume = 1e-5
    connections = 'top_pipe_1:out top_pipe_2:in'
  []
  [jct5]
    type = JunctionOneToOne1Phase
    connections = 'top_pipe_2:out down_pipe_1:in'
  []
  [down_pipe_1]
    type = FlowChannel1Phase
    position = '1 0 1.5'
    orientation = '0 0 -1'
    length = 0.25
    A = ${A_pipe}
    n_elems = 5
  []
  [jct6]
    type = JunctionParallelChannels1Phase
    position = '1 0 1.25'
    connections = 'down_pipe_1:out hx/pri:in'
    volume = 1e-5
  []
  [hx]
    [pri]
      type = FlowChannel1Phase
      position = '1 0 1.25'
      orientation = '0 0 -1'
      length = ${hx_length}
      n_elems = ${hx_n_elems}
      roughness = 1e-5
      A = '${fparse pi * hx_dia_inner * hx_dia_inner / 4.}'
      D_h = ${hx_dia_inner}
    []
    [ht_pri]
      type = HeatTransferFromHeatStructure1Phase
      hs = hx/wall
      hs_side = inner
      flow_channel = hx/pri
      P_hf = '${fparse pi * hx_dia_inner}'
    []
    [wall]
      type = HeatStructureCylindrical
      position = '1 0 1.25'
      orientation = '0 0 -1'
      length = ${hx_length}
      n_elems = ${hx_n_elems}
      widths = '${hx_wall_thickness}'
      n_part_elems = '3'
      materials = 'steel'
      names = '0'
      inner_radius = '${fparse hx_dia_inner / 2.}'
    []
    [ht_sec]
      type = HeatTransferFromHeatStructure1Phase
      hs = hx/wall
      hs_side = outer
      flow_channel = hx/sec
      P_hf = '${fparse 2 * pi * hx_radius_wall}'
    []
    [sec]
      type = FlowChannel1Phase
      position = '${fparse 1 + hx_wall_thickness} 0 -0.25'
      orientation = '0 0 1'
      length = ${hx_length}
      n_elems = ${hx_n_elems}
      A = '${fparse pi * (hx_dia_outer * hx_dia_outer / 4. - hx_radius_wall * hx_radius_wall)}'
      D_h = '${fparse hx_dia_outer - (2 * hx_radius_wall)}'
      fp = water
      initial_T = 300
    []
  []
  [jct7]
    type = JunctionParallelChannels1Phase
    position = '1 0 -0.25'
    connections = 'hx/pri:out down_pipe_2:in'
    volume = 1e-5
  []
  [down_pipe_2]
    type = FlowChannel1Phase
    position = '1 0 -0.25'
    orientation = '0 0 -1'
    length = 0.25
    n_elems = 10
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct8]
    type = JunctionOneToOne1Phase
    connections = 'down_pipe_2:out bottom_1:in'
  []
  [bottom_1]
    type = FlowChannel1Phase
    position = '1 0 -0.5'
    orientation = '-1 0 0'
    length = 0.5
    n_elems = 5
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [bottom_2]
    type = FlowChannel1Phase
    position = '0.5 0 -0.5'
    orientation = '-1 0 0'
    length = 0.5
    n_elems = 5
    A = ${A_pipe}
    D_h = ${pipe_dia}
  []
  [jct9]
    type = JunctionOneToOne1Phase
    connections = 'bottom_2:out up_pipe_1:in'
  []
  [inlet_sec]
    type = InletMassFlowRateTemperature1Phase
    input = 'hx/sec:in'
    m_dot = ${m_dot_sec_in}
    T = 300
  []
  [outlet_sec]
    type = Outlet1Phase
    input = 'hx/sec:out'
    p = 1e5
  []
[]
[Postprocessors]
  [power_to_coolant]
    type = ADHeatRateDirectFlowChannel
    q_wall_prop = q_wall
    block = core_chan
    P_hf = 1
  []
  [core_T_out]
    type = SideAverageValue
    boundary = core_chan:out
    variable = T
  []
  [T_out]
    type = SideAverageValue
    boundary = bottom_1:out
    variable = T
  []
  [core_p_in]
    type = SideAverageValue
    boundary = up_pipe_1:out
    variable = p
  []
  [core_p_out]
    type = SideAverageValue
    boundary = up_pipe_2:in
    variable = p
  []
  [core_delta_p]
    type = ParsedPostprocessor
    pp_names = 'core_p_in core_p_out'
    expression = 'core_p_in - core_p_out'
  []
  [hx_pri_T_out]
    type = SideAverageValue
    boundary = hx/pri:out
    variable = T
  []
  [hx_sec_T_in]
    type = SideAverageValue
    boundary = inlet_sec
    variable = T
  []
  [hx_sec_T_out]
    type = SideAverageValue
    boundary = outlet_sec
    variable = T
  []
  [m_dot_sec]
    type = ADFlowBoundaryFlux1Phase
    boundary = inlet_sec
    equation = mass
  []
  ############## Friction Factor Calculation #############
  [av_rhouA]
    type = ElementAverageValue
    variable = 'rhouA'
    block = 'core_chan'
  []
  [av_rho]
    type = ElementAverageValue
    variable = 'rho'
    block = 'core_chan'
  []
  [Kloss]
    type = ParsedPostprocessor
    pp_names = 'core_delta_p_tgt av_rhouA av_rho'
    expression = '2.0 * core_delta_p_tgt * av_rho * ${A_core} * ${A_core} / (av_rhouA * av_rhouA)'
  []
  [Dh]
    type = ADElementAverageMaterialProperty
    mat_prop = D_h
    block = core_chan
  []
  [core_f]
    type = ParsedPostprocessor
    pp_names = 'Kloss Dh'
    expression = 'Kloss * Dh / ${core_length}'
  []
  ### INFO to send to SC
  [outlet_pressure]
    type = SideAverageValue
    boundary = up_pipe_2:in
    variable = p
  []
  [inlet_mass_flow_rate]
    type = ADFlowJunctionFlux1Phase
    boundary = up_pipe_1:out
    connection_index = 0
    equation = mass
    junction = jct1
  []
  [inlet_temperature]
    type = SideAverageValue
    boundary = up_pipe_1:out
    variable = T
  []
  [inlet_mass_flux]
    type = ParsedPostprocessor
    pp_names = 'inlet_mass_flow_rate'
    expression = 'abs(inlet_mass_flow_rate/${SC_core})'
  []
  #####
  ##### Info received from subchannel
  [core_delta_p_tgt]
    type = Receiver
    default = 100
  []
  [core_power]
    type = Receiver
    default = 100
  []
[]
[Preconditioning]
  [pc]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  start_time = 0
  [TimeStepper]
    type = IterationAdaptiveDT
    dt = 0.01
  []
  # dtmax = 5
  end_time = 5
  line_search = basic
  solve_type = NEWTON
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-8
  nl_max_its = 25
[]
[Outputs]
  csv = true
  [console]
    type = Console
    max_rows = 1
    outlier_variable_norms = false
  []
  print_linear_residuals = false
[]
################################################################################
# A multiapp that couples THM to subchannel
################################################################################
[MultiApps]
  [subchannel]
    type = FullSolveMultiApp
    input_files = 'subchannel.i'
    execute_on = 'timestep_end'
    positions = '0 0 0'
    max_procs_per_app = 1
    output_in_position = true
    bounding_box_padding = '0 0 0.1'
  []
[]
[Transfers]
  [pressure_drop_transfer] # Get pressure drop to THM from subchannel
    type = MultiAppPostprocessorTransfer
    from_multi_app = subchannel
    from_postprocessor = total_pressure_drop_SC
    to_postprocessor = core_delta_p_tgt
    reduction_type = average
    execute_on = 'timestep_end'
  []
  [power_transfer] # Get Total power to THM from subchannel
    type = MultiAppPostprocessorTransfer
    from_multi_app = subchannel
    from_postprocessor = Total_power
    to_postprocessor = core_power
    reduction_type = average
    execute_on = 'timestep_end'
  []
  [mass_flux_tranfer] # Send mass_flux at the inlet of THM core to subchannel
    type = MultiAppPostprocessorTransfer
    to_multi_app = subchannel
    from_postprocessor = inlet_mass_flux
    to_postprocessor = report_mass_flux_inlet
    execute_on = 'timestep_end'
  []
  [outlet_pressure_tranfer] # Send pressure at the outlet of THM core to subchannel
    type = MultiAppPostprocessorTransfer
    to_multi_app = subchannel
    from_postprocessor = outlet_pressure
    to_postprocessor = report_pressure_outlet
    execute_on = 'timestep_end'
  []
  [inlet_temperature_transfer]
    type = MultiAppPostprocessorTransfer
    to_multi_app = subchannel
    from_postprocessor = inlet_temperature
    to_postprocessor = report_temperature_inlet
    execute_on = 'timestep_end'
  []
[]
(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/electromagnetic_joule_heating/aux_microwave_heating.i)
# Test for JouleHeatingHeatGeneratedAux
# Manufactured solution: E_real = cos(pi*y) * x_hat - cos(pi*x) * y_hat
#                        E_imag = sin(pi*y) * x_hat - sin(pi*x) * y_hat
#                        n = x^2*y^2
#                        heating = '0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
[Mesh]
  [gmg]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 5
    ny = 5
    xmin = -1
    ymin = -1
    elem_type = QUAD9
  []
[]
[Functions]
  #The exact solution for the heated species and electric field real and imag. component
  [exact_real]
    type = ParsedVectorFunction
    expression_x = 'cos(pi*y)'
    expression_y = '-cos(pi*x)'
  []
  [exact_imag]
    type = ParsedVectorFunction
    expression_x = 'sin(pi*y)'
    expression_y = '-sin(pi*x)'
  []
  [exact_n]
    type = ParsedFunction
    expression = 'x^2*y^2'
  []
  #The forcing terms for the heated species and electric field real and imag. component
  [source_real]
    type = ParsedVectorFunction
    symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
    symbol_values = 'omega   mu   epsilon   sigma   omega   mu   epsilon   sigma'
    expression_x = '-epsilon_i*mu_i*omega_i^2*cos(pi*y) - 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*y) + epsilon_i*mu_i*omega_r^2*cos(pi*y) - epsilon_i*mu_r*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_r*omega_r^2*sin(pi*y) - epsilon_r*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_r*mu_i*omega_r^2*sin(pi*y) + epsilon_r*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_r*omega_r^2*cos(pi*y) + mu_i*omega_i*sigma_i*cos(pi*y) + mu_i*omega_i*sigma_r*sin(pi*y) + mu_i*omega_r*sigma_i*sin(pi*y) - mu_i*omega_r*sigma_r*cos(pi*y) + mu_r*omega_i*sigma_i*sin(pi*y) - mu_r*omega_i*sigma_r*cos(pi*y) - mu_r*omega_r*sigma_i*cos(pi*y) - mu_r*omega_r*sigma_r*sin(pi*y) + pi^2*cos(pi*y)'
    expression_y = 'epsilon_i*mu_i*omega_i^2*cos(pi*x) + 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*x) - epsilon_i*mu_i*omega_r^2*cos(pi*x) + epsilon_i*mu_r*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_r*omega_r^2*sin(pi*x) + epsilon_r*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_r*mu_i*omega_r^2*sin(pi*x) - epsilon_r*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_r*omega_r^2*cos(pi*x) - mu_i*omega_i*sigma_i*cos(pi*x) - mu_i*omega_i*sigma_r*sin(pi*x) - mu_i*omega_r*sigma_i*sin(pi*x) + mu_i*omega_r*sigma_r*cos(pi*x) - mu_r*omega_i*sigma_i*sin(pi*x) + mu_r*omega_i*sigma_r*cos(pi*x) + mu_r*omega_r*sigma_i*cos(pi*x) + mu_r*omega_r*sigma_r*sin(pi*x) - pi^2*cos(pi*x)'
  []
  [source_imag]
    type = ParsedVectorFunction
    symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
    symbol_values = 'omega   mu   epsilon   sigma   omega   mu   epsilon   sigma'
    expression_x = '-epsilon_i*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_i*omega_r^2*sin(pi*y) + epsilon_i*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_i*mu_r*omega_r^2*cos(pi*y) + epsilon_r*mu_i*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_i*omega_r^2*cos(pi*y) + epsilon_r*mu_r*omega_i^2*sin(pi*y) - 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*y) - epsilon_r*mu_r*omega_r^2*sin(pi*y) + mu_i*omega_i*sigma_i*sin(pi*y) - mu_i*omega_i*sigma_r*cos(pi*y) - mu_i*omega_r*sigma_i*cos(pi*y) - mu_i*omega_r*sigma_r*sin(pi*y) - mu_r*omega_i*sigma_i*cos(pi*y) - mu_r*omega_i*sigma_r*sin(pi*y) - mu_r*omega_r*sigma_i*sin(pi*y) + mu_r*omega_r*sigma_r*cos(pi*y) + pi^2*sin(pi*y)'
    expression_y = 'epsilon_i*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_i*omega_r^2*sin(pi*x) - epsilon_i*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_i*mu_r*omega_r^2*cos(pi*x) - epsilon_r*mu_i*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_i*omega_r^2*cos(pi*x) - epsilon_r*mu_r*omega_i^2*sin(pi*x) + 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*x) + epsilon_r*mu_r*omega_r^2*sin(pi*x) - mu_i*omega_i*sigma_i*sin(pi*x) + mu_i*omega_i*sigma_r*cos(pi*x) + mu_i*omega_r*sigma_i*cos(pi*x) + mu_i*omega_r*sigma_r*sin(pi*x) + mu_r*omega_i*sigma_i*cos(pi*x) + mu_r*omega_i*sigma_r*sin(pi*x) + mu_r*omega_r*sigma_i*sin(pi*x) - mu_r*omega_r*sigma_r*cos(pi*x) - pi^2*sin(pi*x)'
  []
  [source_n]
    type = ParsedFunction
    symbol_names = 'sigma_r'
    symbol_values = 'sigma'
    expression = '-2*x^2 - 2*y^2 - 0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
  []
  [heating_func]
    type = ParsedFunction
    symbol_names = 'sigma_r'
    symbol_values = 'sigma'
    expression = '0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
  []
  #Material Coefficients
  [omega]
    type = ParsedFunction
    expression = '2.0'
  []
  [mu]
    type = ParsedFunction
    expression = '1.0'
  []
  [epsilon]
    type = ParsedFunction
    expression = '3.0'
  []
  [sigma]
    type = ParsedFunction
    expression = '4.0'
    #expression = 'x^2*y^2'
  []
[]
[Materials]
  [WaveCoeff]
    type = WaveEquationCoefficient
    eps_rel_imag = eps_imag
    eps_rel_real = eps_real
    k_real = k_real
    k_imag = k_imag
    mu_rel_imag = mu_imag
    mu_rel_real = mu_real
  []
  [eps_real]
    type = ADGenericFunctionMaterial
    prop_names = eps_real
    prop_values = epsilon
  []
  [eps_imag]
    type = ADGenericFunctionMaterial
    prop_names = eps_imag
    prop_values = epsilon
  []
  [mu_real]
    type = ADGenericFunctionMaterial
    prop_names = mu_real
    prop_values = mu
  []
  [mu_imag]
    type = ADGenericFunctionMaterial
    prop_names = mu_imag
    prop_values = mu
  []
  [k_real]
    type = ADGenericFunctionMaterial
    prop_names = k_real
    prop_values = omega
  []
  [k_imag]
    type = ADGenericFunctionMaterial
    prop_names = k_imag
    prop_values = omega
  []
  [cond_real]
    type = ADGenericFunctionMaterial
    prop_names = cond_real
    prop_values = sigma
  []
  [cond_imag]
    type = ADGenericFunctionMaterial
    prop_names = cond_imag
    prop_values = sigma
  []
  [ElectromagneticMaterial]
    type = ElectromagneticHeatingMaterial
    electric_field = E_real
    complex_electric_field = E_imag
    electric_field_heating_name = electric_field_heating
    electrical_conductivity = cond_real
    formulation = FREQUENCY
    solver = ELECTROMAGNETIC
  []
[]
[Variables]
  [n]
    family = LAGRANGE
    order = FIRST
  []
  [E_real]
    family = NEDELEC_ONE
    order = FIRST
  []
  [E_imag]
    family = NEDELEC_ONE
    order = FIRST
  []
[]
[Kernels]
  [curl_curl_real]
    type = CurlCurlField
    variable = E_real
  []
  [coeff_real]
    type = ADMatWaveReaction
    variable = E_real
    field_real =  E_real
    field_imag =  E_imag
    wave_coef_real = wave_equation_coefficient_real
    wave_coef_imag = wave_equation_coefficient_imaginary
    component = real
  []
  [conduction_real]
    type = ADConductionCurrent
    variable = E_real
    field_imag =  E_imag
    field_real =  E_real
    conductivity_real = cond_real
    conductivity_imag = cond_imag
    ang_freq_real = k_real
    ang_freq_imag = k_imag
    permeability_real = mu_real
    permeability_imag = mu_imag
    component = real
  []
  [body_force_real]
    type = VectorBodyForce
    variable = E_real
    function = source_real
  []
  [curl_curl_imag]
    type = CurlCurlField
    variable = E_imag
  []
  [coeff_imag]
    type = ADMatWaveReaction
    variable = E_imag
    field_real =  E_real
    field_imag =  E_imag
    wave_coef_real = wave_equation_coefficient_real
    wave_coef_imag = wave_equation_coefficient_imaginary
    component = imaginary
  []
  [conduction_imag]
    type = ADConductionCurrent
    variable = E_imag
    field_imag =  E_imag
    field_real =  E_real
    conductivity_real = cond_real
    conductivity_imag = cond_imag
    ang_freq_real = k_real
    ang_freq_imag = k_imag
    permeability_real = mu_real
    permeability_imag = mu_imag
    component = imaginary
  []
  [body_force_imag]
    type = VectorBodyForce
    variable = E_imag
    function = source_imag
  []
  [n_diffusion]
    type = Diffusion
    variable = n
  []
  [microwave_heating]
    type = ADJouleHeatingSource
    variable = n
    heating_term = 'electric_field_heating'
  []
  [body_force_n]
    type = BodyForce
    variable = n
    function = source_n
  []
[]
[AuxVariables]
  [heating_term]
    family = MONOMIAL
    order = FIRST
  []
[]
[AuxKernels]
  [aux_microwave_heating]
    type = JouleHeatingHeatGeneratedAux
    variable = heating_term
    heating_term = 'electric_field_heating'
  []
[]
[BCs]
  [sides_real]
    type = VectorCurlPenaltyDirichletBC
    variable = E_real
    function = exact_real
    penalty = 1e8
    boundary = 'left right top bottom'
  []
  [sides_imag]
    type = VectorCurlPenaltyDirichletBC
    variable = E_imag
    function = exact_imag
    penalty = 1e8
    boundary = 'left right top bottom'
  []
  [sides_n]
    type = FunctorDirichletBC
    variable = n
    boundary = 'left right top bottom'
    functor = exact_n
    preset = false
  []
[]
[Postprocessors]
  [error_real]
    type = ElementVectorL2Error
    variable = E_real
    function = exact_real
  []
  [error_imag]
    type = ElementVectorL2Error
    variable = E_imag
    function = exact_imag
  []
  [error_n]
    type = ElementL2Error
    variable = n
    function = exact_n
  []
  [error_aux_heating]
    type = ElementL2Error
    variable = heating_term
    function = heating_func
  []
  [h]
    type = AverageElementSize
  []
  [h_squared]
    type = ParsedPostprocessor
    pp_names = 'h'
    expression = 'h * h'
  []
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-12
[]
[Outputs]
  exodus = true
  csv = true
[]
(test/tests/postprocessors/parsed_postprocessor/parsed_pp.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
  [../]
[]
[Postprocessors]
  [./L2_norm]
    type = ElementL2Norm
    variable = u
  [../]
  [./L2:norm]
    type = ElementL2Norm
    variable = u
  [../]
  [L1_norm]
    type = ElementL1Error
    function = 0
    variable = u
  []
  [parsed]
    type = ParsedPostprocessor
    expression = 'L2_norm / L1_norm'
    pp_names = 'L2_norm L1_norm'
  []
  [parsed_with_t]
    type = ParsedPostprocessor
    expression = 'L2_norm + L1_norm + t'
    pp_names = 'L2_norm L1_norm'
    use_t = true
  []
  [parsed_with_constants]
    type = ParsedPostprocessor
    expression = 'L2_norm + 3*L1_norm + mu'
    pp_names = 'L2_norm L1_norm'
    constant_names = 'mu'
    constant_expressions = '4'
  []
[]
[Executioner]
  type = Transient
  num_steps = 4
  nl_abs_tol = 1e-8
  solve_type = PJFNK
  petsc_options_iname = '-pc_type -pc_hypre_type'
  petsc_options_value = 'hypre boomeramg'
  line_search = 'none'
[]
[Outputs]
  csv = true
[]
(test/tests/convergence/reference_residual_convergence/ad_abs_ref.i)
[Mesh]
  type = GeneratedMesh
  dim = 1
  nx = 10
[]
[GlobalParams]
  absolute_value_vector_tags = 'absref'
[]
[Problem]
  extra_tag_vectors = 'absref'
[]
[Variables]
  [u][]
  [v]
    scaling = 1e-6
  []
[]
[Functions]
  [ramp]
    type = ParsedFunction
    expression = 'if(t < 5, t - 5, 0) * x'
  []
[]
[Kernels]
  [u_dt]
    type = ADTimeDerivative
    variable = u
  []
  [u_coupled_rx]
    type = ADCoupledForce
    variable = u
    v = v
    coef = 1
  []
  [v_dt]
    type = ADTimeDerivative
    variable = v
  []
  [v_neg_force]
    type = ADBodyForce
    variable = v
    value = ${fparse -1 / 2}
    function = ramp
  []
  [v_force]
    type = ADBodyForce
    variable = v
    value = 1
    function = ramp
  []
[]
[Postprocessors]
  [u_avg]
    type = ElementAverageValue
    variable = u
    execute_on = 'TIMESTEP_END INITIAL'
  []
  [v_avg]
    type = ElementAverageValue
    variable = v
    execute_on = 'TIMESTEP_END INITIAL'
  []
  [timestep]
    type = TimePostprocessor
    outputs = 'none'
  []
  [v_old]
    type = ElementAverageValue
    variable = v
    execute_on = TIMESTEP_BEGIN
    outputs = none
  []
  [u_old]
    type = ElementAverageValue
    variable = u
    execute_on = TIMESTEP_BEGIN
    outputs = none
  []
  [v_exact]
    type = ParsedPostprocessor
    pp_names = 'timestep v_old'
    expression = 't := if(timestep > 5, 5, timestep); (t^2 - 9 * t) / 8'
  []
  [u_exact]
    type = ParsedPostprocessor
    pp_names = 'u_old v_exact'
    expression = 'u_old + v_exact'
  []
[]
[Convergence]
  [conv]
    type = ReferenceResidualConvergence
    reference_vector = 'absref'
  []
[]
[Executioner]
  type = Transient
  petsc_options = '-snes_converged_reason'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  line_search = none
  num_steps = 10
  nl_rel_tol = 1e-06
  nonlinear_convergence = conv
  verbose = true
[]
[Outputs]
  csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/channel-drift-flux.i)
mu = 1.0
rho = 10.0
mu_d = 0.1
rho_d = 1.0
l = 2
U = 1
dp = 0.01
inlet_phase_2 = 0.1
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[GlobalParams]
  rhie_chow_user_object = 'rc'
  density_interp_method = 'average'
  mu_interp_method = 'average'
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = vel_x
    v = vel_y
    pressure = pressure
  []
[]
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = '${fparse l * 5}'
    ymin = '${fparse -l / 2}'
    ymax = '${fparse l / 2}'
    nx = 10
    ny = 4
  []
  uniform_refine = 0
[]
[Variables]
  [vel_x]
    type = INSFVVelocityVariable
    initial_condition = 0
  []
  [vel_y]
    type = INSFVVelocityVariable
    initial_condition = 0
  []
  [pressure]
    type = INSFVPressureVariable
  []
  [phase_2]
    type = INSFVScalarFieldVariable
  []
[]
[FVKernels]
  [mass]
    type = INSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = 'rho_mixture'
  []
  [u_advection]
    type = INSFVMomentumAdvection
    variable = vel_x
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = 'rho_mixture'
    momentum_component = 'x'
  []
  [u_drift]
    type = WCNSFV2PMomentumDriftFlux
    variable = vel_x
    rho_d = ${rho_d}
    fd = 'phase_2'
    u_slip = 'vel_slip_x'
    v_slip = 'vel_slip_y'
    momentum_component = 'x'
  []
  [u_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_x
    mu = 'mu_mixture'
    limit_interpolation = true
    momentum_component = 'x'
  []
  [u_pressure]
    type = INSFVMomentumPressure
    variable = vel_x
    momentum_component = 'x'
    pressure = pressure
  []
  [u_friction]
    type = PINSFVMomentumFriction
    Darcy_name = Darcy_coefficient_vec
    is_porous_medium = false
    momentum_component = x
    mu = mu_mixture
    rho = rho_mixture
    variable = vel_x
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = vel_y
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = 'rho_mixture'
    momentum_component = 'y'
  []
  [v_drift]
    type = WCNSFV2PMomentumDriftFlux
    variable = vel_y
    rho_d = ${rho_d}
    fd = 'phase_2'
    u_slip = 'vel_slip_x'
    v_slip = 'vel_slip_y'
    momentum_component = 'x'
  []
  [v_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_y
    mu = 'mu_mixture'
    limit_interpolation = true
    momentum_component = 'y'
  []
  [v_pressure]
    type = INSFVMomentumPressure
    variable = vel_y
    momentum_component = 'y'
    pressure = pressure
  []
  [v_friction]
    type = PINSFVMomentumFriction
    Darcy_name = Darcy_coefficient_vec
    is_porous_medium = false
    momentum_component = y
    mu = mu_mixture
    rho = rho_mixture
    variable = vel_y
  []
  [phase_2_advection]
    type = INSFVScalarFieldAdvection
    variable = phase_2
    u_slip = 'vel_slip_x'
    v_slip = 'vel_slip_y'
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = 'upwind'
  []
  [phase_2_src]
    type = NSFVMixturePhaseInterface
    variable = phase_2
    phase_coupled = phase_1
    alpha = 0.1
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_x
    functor = '${U}'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_y
    functor = '0'
  []
  [walls-u]
    type = INSFVNoSlipWallBC
    boundary = 'top bottom'
    variable = vel_x
    function = 0
  []
  [walls-v]
    type = INSFVNoSlipWallBC
    boundary = 'top bottom'
    variable = vel_y
    function = 0
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = '0'
  []
  [inlet_phase_2]
    type = FVDirichletBC
    boundary = 'left'
    variable = phase_2
    value = ${inlet_phase_2}
  []
[]
[AuxVariables]
  [drag_coefficient]
    type = MooseVariableFVReal
  []
  [rho_mixture_var]
    type = MooseVariableFVReal
  []
  [mu_mixture_var]
    type = MooseVariableFVReal
  []
[]
[AuxKernels]
  [populate_cd]
    type = FunctorAux
    variable = drag_coefficient
    functor = 'Darcy_coefficient'
  []
  [populate_rho_mixture_var]
    type = FunctorAux
    variable = rho_mixture_var
    functor = 'rho_mixture'
  []
  [populate_mu_mixture_var]
    type = FunctorAux
    variable = mu_mixture_var
    functor = 'mu_mixture'
  []
[]
[FunctorMaterials]
  [populate_u_slip]
    type = WCNSFV2PSlipVelocityFunctorMaterial
    slip_velocity_name = 'vel_slip_x'
    momentum_component = 'x'
    u = 'vel_x'
    v = 'vel_y'
    rho = ${rho}
    mu = 'mu_mixture'
    rho_d = ${rho_d}
    particle_diameter = ${dp}
    linear_coef_name = 'Darcy_coefficient'
    outputs = 'out'
    output_properties = 'vel_slip_x'
    ghost_layers = 5
  []
  [populate_v_slip]
    type = WCNSFV2PSlipVelocityFunctorMaterial
    slip_velocity_name = 'vel_slip_y'
    momentum_component = 'y'
    u = 'vel_x'
    v = 'vel_y'
    rho = ${rho}
    mu = 'mu_mixture'
    rho_d = ${rho_d}
    particle_diameter = ${dp}
    linear_coef_name = 'Darcy_coefficient'
    outputs = 'out'
    output_properties = 'vel_slip_y'
    ghost_layers = 5
  []
  [compute_phase_1]
    type = ADParsedFunctorMaterial
    property_name = phase_1
    functor_names = 'phase_2'
    expression = '1 - phase_2'
    outputs = 'out'
    output_properties = 'phase_1'
  []
  [CD]
    type = NSFVDispersePhaseDragFunctorMaterial
    rho = 'rho_mixture'
    mu = mu_mixture
    u = 'vel_x'
    v = 'vel_y'
    particle_diameter = ${dp}
  []
  [mixing_material]
    type = NSFVMixtureFunctorMaterial
    phase_2_names = '${rho} ${mu}'
    phase_1_names = '${rho_d} ${mu_d}'
    prop_names = 'rho_mixture mu_mixture'
    phase_1_fraction = 'phase_2'
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  nl_rel_tol = 1e-10
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
    petsc_options_iname = '-pc_type -pc_factor_shift_type'
    petsc_options_value = 'lu       NONZERO'
  []
[]
[Outputs]
  print_linear_residuals = true
  print_nonlinear_residuals = true
  [out]
    type = Exodus
    hide = 'Re lin cum_lin'
  []
  [perf]
    type = PerfGraphOutput
  []
[]
[Postprocessors]
  [Re]
    type = ParsedPostprocessor
    expression = '${rho} * ${l} * ${U}'
  []
  [lin]
    type = NumLinearIterations
  []
  [cum_lin]
    type = CumulativeValuePostprocessor
    postprocessor = lin
  []
[]
(modules/heat_transfer/test/tests/gap_heat_transfer_mortar/large_gap_heat_transfer_test_rz_cylinder.i)
rpv_core_gap_size = 0.2
core_outer_radius = 2
rpv_inner_radius = '${fparse 2 + rpv_core_gap_size}'
rpv_outer_radius = '${fparse 2.5 + rpv_core_gap_size}'
rpv_width = '${fparse rpv_outer_radius - rpv_inner_radius}'
rpv_outer_htc = 10 # W/m^2/K
rpv_outer_Tinf = 300 # K
core_blocks = '1'
rpv_blocks = '3'
[Mesh]
  [gmg]
    type = CartesianMeshGenerator
    dim = 2
    dx = '${core_outer_radius} ${rpv_core_gap_size} ${rpv_width}'
    ix = '400 1 100'
    dy = 1
    iy = '5'
  []
  [set_block_id1]
    type = SubdomainBoundingBoxGenerator
    input = gmg
    bottom_left = '0 0 0'
    top_right = '${core_outer_radius} 1 0'
    block_id = 1
    location = INSIDE
  []
  [rename_core_bdy]
    type = SideSetsBetweenSubdomainsGenerator
    input = set_block_id1
    primary_block = 1
    paired_block = 0
    new_boundary = 'core_outer'
  []
  [set_block_id3]
    type = SubdomainBoundingBoxGenerator
    input = rename_core_bdy
    bottom_left = '${rpv_inner_radius} 0 0'
    top_right = '${rpv_outer_radius} 1 0'
    block_id = 3
    location = INSIDE
  []
  [rename_inner_rpv_bdy]
    type = SideSetsBetweenSubdomainsGenerator
    input = set_block_id3
    primary_block = 3
    paired_block = 0
    new_boundary = 'rpv_inner'
  []
  # comment out for test without gap
  [2d_mesh]
    type = BlockDeletionGenerator
    input = rename_inner_rpv_bdy
    block = 0
  []
  allow_renumbering = false
  coord_type = RZ
[]
[Variables]
  [Tsolid]
    initial_condition = 500
  []
[]
[Kernels]
  [heat_source]
    type = CoupledForce
    variable = Tsolid
    block = '${core_blocks}'
    v = power_density
  []
  [heat_conduction]
    type = HeatConduction
    variable = Tsolid
  []
[]
[BCs]
  [RPV_out_BC] # k \nabla T = h (T- T_inf) at RPV outer boundary
    type = ConvectiveFluxFunction # (Robin BC)
    variable = Tsolid
    boundary = 'right' # outer RPV
    coefficient = ${rpv_outer_htc}
    T_infinity = ${rpv_outer_Tinf}
  []
[]
[ThermalContact]
  [RPV_gap]
    type = GapHeatTransfer
    gap_geometry_type = 'CYLINDER'
    emissivity_primary = 0.8
    emissivity_secondary = 0.8
    variable = Tsolid
    primary = 'core_outer'
    secondary = 'rpv_inner'
    gap_conductivity = 0.1
    quadrature = true
  []
[]
[AuxVariables]
  [power_density]
    block = '${core_blocks}'
    initial_condition = 50e3
  []
[]
[Materials]
  [simple_mat]
    type = HeatConductionMaterial
    thermal_conductivity = 34.6 # W/m/K
  []
[]
[Postprocessors]
  [Tcore_avg]
    type = ElementAverageValue
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Tcore_max]
    type = ElementExtremeValue
    value_type = max
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Tcore_min]
    type = ElementExtremeValue
    value_type = min
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Trpv_avg]
    type = ElementAverageValue
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [Trpv_max]
    type = ElementExtremeValue
    value_type = max
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [Trpv_min]
    type = ElementExtremeValue
    value_type = min
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [ptot]
    type = ElementIntegralVariablePostprocessor
    variable = power_density
    block = '${core_blocks}'
  []
  [rpv_convective_out]
    type = ConvectiveHeatTransferSideIntegral
    T_solid = Tsolid
    boundary = 'right' # outer RVP
    T_fluid = ${rpv_outer_Tinf}
    htc = ${rpv_outer_htc}
  []
  [heat_balance] # should be equal to 0 upon convergence
    type = ParsedPostprocessor
    expression = '(rpv_convective_out - ptot) / ptot'
    pp_names = 'rpv_convective_out ptot'
  []
  [flux_from_core] # converges to ptot as the mesh is refined
    type = SideDiffusiveFluxIntegral
    variable = Tsolid
    boundary = core_outer
    diffusivity = thermal_conductivity
  []
  [flux_into_rpv] # converges to rpv_convective_out as the mesh is refined
    type = SideDiffusiveFluxIntegral
    variable = Tsolid
    boundary = rpv_inner
    diffusivity = thermal_conductivity
  []
[]
[VectorPostprocessors]
  [NodalTemperature]
    type = NodalValueSampler
    sort_by = id
    boundary = 'rpv_inner core_outer'
    variable = Tsolid
  []
[]
[Executioner]
  type = Steady
  automatic_scaling = true
  compute_scaling_once = false
  petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart '
  petsc_options_value = 'hypre boomeramg 100'
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-10
  l_max_its = 100
  [Quadrature]
    # order = fifth
    side_order = seventh
  []
  line_search = none
[]
[Outputs]
  exodus = false
  csv = true
[]
(test/tests/auxkernels/divergence_aux/test_fe.i)
[Mesh]
  [cmg]
    type = CartesianMeshGenerator
    dim = 2
    dx = '1.5 1 0.1'
    dy = '1.3 1 0.9'
    ix = '2 4 1'
    iy = '2 3 3'
    subdomain_id = '1 1 1
                    1 2 1
                    1 1 1'
  []
  [add_inner_boundaries_top]
    type = SideSetsAroundSubdomainGenerator
    input = cmg
    new_boundary = 'block_2_top'
    block = 2
    normal = '0 1 0'
  []
  [add_inner_boundaries_bot]
    type = SideSetsAroundSubdomainGenerator
    input = add_inner_boundaries_top
    new_boundary = 'block_2_bot'
    block = 2
    normal = '0 -1 0'
  []
  [add_inner_boundaries_right]
    type = SideSetsAroundSubdomainGenerator
    input = add_inner_boundaries_bot
    new_boundary = 'block_2_right'
    block = 2
    normal = '1 0 0'
  []
  [add_inner_boundaries_left]
    type = SideSetsAroundSubdomainGenerator
    input = add_inner_boundaries_right
    new_boundary = 'block_2_left'
    block = 2
    normal = '-1 0 0'
  []
[]
[Variables]
  [u]
  []
  [v]
  []
[]
[Kernels]
  [diff_u]
    type = Diffusion
    variable = u
  []
  [reaction_u]
    type = Reaction
    variable = u
  []
  [diff_v]
    type = Diffusion
    variable = v
  []
  [reaction_v]
    type = Reaction
    variable = v
  []
[]
[AuxVariables]
  [div]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [divergence]
    type = ADDivergenceAux
    variable = div
    u = u
    v = v
  []
[]
[BCs]
  [left]
    type = DirichletBC
    variable = u
    boundary = left
    value = 1
  []
  [right]
    type = DirichletBC
    variable = u
    boundary = right
    value = 1
  []
  [top]
    type = DirichletBC
    variable = v
    boundary = top
    value = 1
  []
  [bottom]
    type = DirichletBC
    variable = v
    boundary = bottom
    value = 1
  []
[]
[Executioner]
  type = Steady
  solve_type = PJFNK
  petsc_options_iname = '-pc_type -pc_hypre_type'
  petsc_options_value = 'hypre boomeramg'
[]
[Postprocessors]
  [int_divergence]
    type = ElementL1Error
    block = 2
    variable = div
    function = 0
  []
  [sum_surface_current]
    type = ParsedPostprocessor
    expression = 's1 - s2 + s3 - s4'
    pp_names = 's1 s2 s3 s4'
  []
  [s1]
    type = SideIntegralVariablePostprocessor
    boundary = 'block_2_right'
    variable = 'u'
  []
  [s2]
    type = SideIntegralVariablePostprocessor
    boundary = 'block_2_left'
    variable = 'u'
  []
  [s3]
    type = SideIntegralVariablePostprocessor
    boundary = 'block_2_top'
    variable = 'v'
  []
  [s4]
    type = SideIntegralVariablePostprocessor
    boundary = 'block_2_bot'
    variable = 'v'
  []
[]
[Outputs]
  csv = true
  hide = 's1 s2 s3 s4'
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/channel-advection-slip.i)
mu = 1.0
rho = 10.0
mu_d = 0.1
rho_d = 1.0
l = 2
U = 1
dp = 0.01
inlet_phase_2 = 0.1
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[GlobalParams]
  rhie_chow_user_object = 'rc'
  mu_interp_method = 'average'
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = vel_x
    v = vel_y
    pressure = pressure
  []
[]
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = '${fparse l * 5}'
    ymin = '${fparse -l / 2}'
    ymax = '${fparse l / 2}'
    nx = 10
    ny = 6
  []
  uniform_refine = 0
[]
[Variables]
  [vel_x]
    type = INSFVVelocityVariable
    initial_condition = 0
  []
  [vel_y]
    type = INSFVVelocityVariable
    initial_condition = 0
  []
  [pressure]
    type = INSFVPressureVariable
  []
  [phase_2]
    type = INSFVScalarFieldVariable
  []
[]
[FVKernels]
  [mass]
    type = INSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = 'rho_mixture'
  []
  [u_advection]
    type = INSFVMomentumAdvection
    variable = vel_x
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = 'rho_mixture'
    momentum_component = 'x'
  []
  [u_advection_slip]
    type = WCNSFV2PMomentumAdvectionSlip
    variable = vel_x
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    rho_d = ${rho_d}
    fd = phase_2
    u_slip = 'vel_slip_x'
    v_slip = 'vel_slip_y'
    momentum_component = 'x'
  []
  [u_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_x
    mu = 'mu_mixture'
    limit_interpolation = true
    momentum_component = 'x'
  []
  [u_pressure]
    type = INSFVMomentumPressure
    variable = vel_x
    momentum_component = 'x'
    pressure = pressure
  []
  [u_friction]
    type = PINSFVMomentumFriction
    Darcy_name = Darcy_coefficient_vec
    is_porous_medium = false
    momentum_component = x
    mu = mu_mixture
    rho = rho_mixture
    variable = vel_x
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = vel_y
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = 'rho_mixture'
    momentum_component = 'y'
  []
  [v_advection_slip]
    type = WCNSFV2PMomentumAdvectionSlip
    variable = vel_y
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    rho_d = ${rho_d}
    fd = phase_2
    u_slip = 'vel_slip_x'
    v_slip = 'vel_slip_y'
    momentum_component = 'y'
  []
  [v_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_y
    mu = 'mu_mixture'
    limit_interpolation = true
    momentum_component = 'y'
  []
  [v_pressure]
    type = INSFVMomentumPressure
    variable = vel_y
    momentum_component = 'y'
    pressure = pressure
  []
  [v_friction]
    type = PINSFVMomentumFriction
    Darcy_name = Darcy_coefficient_vec
    is_porous_medium = false
    momentum_component = y
    mu = mu_mixture
    rho = rho_mixture
    variable = vel_y
  []
  [phase_2_advection]
    type = INSFVScalarFieldAdvection
    variable = phase_2
    u_slip = 'vel_slip_x'
    v_slip = 'vel_slip_y'
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = 'upwind'
  []
  [phase_2_src]
    type = NSFVMixturePhaseInterface
    variable = phase_2
    phase_coupled = phase_1
    alpha = 0.1
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_x
    functor = '${U}'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_y
    functor = '0'
  []
  [walls-u]
    type = INSFVNoSlipWallBC
    boundary = 'top bottom'
    variable = vel_x
    function = 0
  []
  [walls-v]
    type = INSFVNoSlipWallBC
    boundary = 'top bottom'
    variable = vel_y
    function = 0
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = '0'
  []
  [inlet_phase_2]
    type = FVDirichletBC
    boundary = 'left'
    variable = phase_2
    value = ${inlet_phase_2}
  []
[]
[AuxVariables]
  [drag_coefficient]
    type = MooseVariableFVReal
  []
  [rho_mixture_var]
    type = MooseVariableFVReal
  []
  [mu_mixture_var]
    type = MooseVariableFVReal
  []
[]
[AuxKernels]
  [populate_cd]
    type = FunctorAux
    variable = drag_coefficient
    functor = 'Darcy_coefficient'
  []
  [populate_rho_mixture_var]
    type = FunctorAux
    variable = rho_mixture_var
    functor = 'rho_mixture'
  []
  [populate_mu_mixture_var]
    type = FunctorAux
    variable = mu_mixture_var
    functor = 'mu_mixture'
  []
[]
[FunctorMaterials]
  [phase_1]
    property_name = 'phase_1'
    type = ADParsedFunctorMaterial
    functor_names = 'phase_2'
    expression = '1 - phase_2'
    outputs = 'out'
    output_properties = 'phase_1'
  []
  [populate_u_slip]
    type = WCNSFV2PSlipVelocityFunctorMaterial
    slip_velocity_name = 'vel_slip_x'
    momentum_component = 'x'
    u = 'vel_x'
    v = 'vel_y'
    rho = ${rho}
    mu = 'mu_mixture'
    rho_d = ${rho_d}
    particle_diameter = ${dp}
    linear_coef_name = 'Darcy_coefficient'
    outputs = 'out'
    output_properties = 'vel_slip_x'
  []
  [populate_v_slip]
    type = WCNSFV2PSlipVelocityFunctorMaterial
    slip_velocity_name = 'vel_slip_y'
    momentum_component = 'y'
    u = 'vel_x'
    v = 'vel_y'
    rho = ${rho}
    mu = 'mu_mixture'
    rho_d = ${rho_d}
    particle_diameter = ${dp}
    linear_coef_name = 'Darcy_coefficient'
    outputs = 'out'
    output_properties = 'vel_slip_y'
  []
  [CD]
    type = NSFVDispersePhaseDragFunctorMaterial
    rho = 'rho_mixture'
    mu = mu_mixture
    u = 'vel_x'
    v = 'vel_y'
    particle_diameter = ${dp}
  []
  [mixing_material]
    type = NSFVMixtureFunctorMaterial
    phase_2_names = '${rho} ${mu}'
    phase_1_names = '${rho_d} ${mu_d}'
    prop_names = 'rho_mixture mu_mixture'
    phase_1_fraction = 'phase_2'
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  nl_rel_tol = 1e-10
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
    petsc_options_iname = '-pc_type -pc_factor_shift_type'
    petsc_options_value = 'lu       NONZERO'
  []
[]
[Outputs]
  [out]
    type = Exodus
    hide = 'Re lin cum_lin'
  []
[]
[Postprocessors]
  [Re]
    type = ParsedPostprocessor
    expression = '${rho} * ${l} * ${U}'
  []
  [lin]
    type = NumLinearIterations
  []
  [cum_lin]
    type = CumulativeValuePostprocessor
    postprocessor = lin
  []
[]
(modules/optimization/test/tests/executioners/constrained/shape_optimization/forward.i)
# This test is documented as an example for ConstrainedShapeOptimization. This
# test should not be changed without updating the documentation.
inner_radius = 6
outer_radius = 10
volume_constraint = 200
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Mesh]
  [mesh]
    type = ConcentricCircleMeshGenerator
    has_outer_square = no
    num_sectors = 16
    radii = '${inner_radius} ${outer_radius}'
    rings = '16 16'
    preserve_volumes = false
  []
  [inner_radius]
    type = SideSetsBetweenSubdomainsGenerator
    input = mesh
    new_boundary = inner
    primary_block = 2
    paired_block = 1
  []
  [delete]
    type = BlockDeletionGenerator
    input = inner_radius
    block = 1
  []
  [gather_all]
    type = BoundingBoxNodeSetGenerator
    input = delete
    bottom_left = '-100 -100 -100'
    top_right = '100 100 100'
    new_boundary = total
  []
  [combine]
    type = SideSetsFromBoundingBoxGenerator
    input = gather_all
    bottom_left = '-100 -100 -100'
    top_right = '100 100 100'
    included_boundaries = 'inner outer'
    boundary_new = moving
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [T]
  []
[]
[AuxVariables]
  [dist_between]
    [AuxKernel]
      type = NearestNodeDistanceAux
      variable = dist_between
      paired_boundary = moving
      boundary = total
      block = 2
      use_displaced_mesh = false
      execute_on = "INITIAL"
    []
  []
[]
[Kernels]
  [disp_x]
    type = MatDiffusion
    variable = disp_x
    use_displaced_mesh = false
    diffusivity = diff_coef
  []
  [disp_y]
    type = MatDiffusion
    variable = disp_y
    use_displaced_mesh = false
    diffusivity = diff_coef
  []
  # run physics of interest on deformed mesh
  [Diffusion]
    type = FunctionDiffusion
    variable = T
    use_displaced_mesh = true
  []
  [Source]
    type = BodyForce
    variable = T
    value = 1
    use_displaced_mesh = true
  []
[]
[Materials]
  # perserve elements near the boundary
  [diff_coef]
    type = ParsedMaterial
    coupled_variables = 'dist_between'
    expression = '1/(dist_between+0.5)'
    property_name = 'diff_coef'
  []
  [h]
    type = ADGenericFunctionMaterial
    prop_names = h
    prop_values = h
  []
  # convection type boundary condition
  [convection_bc]
    type = ADParsedMaterial
    coupled_variables = "T"
    expression = "h*(100-T)"
    material_property_names = "h"
    property_name = convection
  []
[]
[Functions]
  [r1_x]
    type = ParsedOptimizationFunction
    expression = 'r1 * cos((atan(y/x)))'
    param_symbol_names = 'r0 r1'
    param_vector_name = 'params/radii'
  []
  [r1_y]
    type = ParsedOptimizationFunction
    expression = 'r1 * sin((atan(y/x)))'
    param_symbol_names = 'r0 r1'
    param_vector_name = 'params/radii'
  []
  [r0_x]
    type = ParsedOptimizationFunction
    expression = 'r0 * cos((atan(y/x)))'
    param_symbol_names = 'r0 r1'
    param_vector_name = 'params/radii'
  []
  [r0_y]
    type = ParsedOptimizationFunction
    expression = 'r0 * sin((atan(y/x)))'
    param_symbol_names = 'r0 r1'
    param_vector_name = 'params/radii'
  []
  [h]
    type = ParsedOptimizationFunction
    # r0+${inner_radius} is the true current inner radius
    expression = '10 /(pi * (r0+${inner_radius})^3)'
    param_symbol_names = 'r0 r1'
    param_vector_name = 'params/radii'
  []
  [eq_grad_r0]
    type = ParsedOptimizationFunction
    expression = '-2 * pi * (r0 + ${inner_radius})'
    param_symbol_names = 'r0 r1'
    param_vector_name = 'params/radii'
  []
  [eq_grad_r1]
    type = ParsedOptimizationFunction
    # r1+${outer_radius} is the true current outer radius
    expression = '2 * pi * (r1+${outer_radius})'
    param_symbol_names = 'r0 r1'
    param_vector_name = 'params/radii'
  []
[]
[BCs]
  [diffuse_r1_x]
    type = ADFunctionDirichletBC
    variable = disp_x
    boundary = 'outer'
    function = r1_x
    preset = false
  []
  [diffuse_r1_y]
    type = ADFunctionDirichletBC
    variable = disp_y
    boundary = 'outer'
    function = r1_y
    preset = false
  []
  [diffuse_r0_x]
    type = ADFunctionDirichletBC
    variable = disp_x
    boundary = 'inner'
    function = r0_x
    preset = false
  []
  [diffuse_r0_y]
    type = ADFunctionDirichletBC
    variable = disp_y
    boundary = 'inner'
    function = r0_y
    preset = false
  []
  # run physics on deformed mesh
  [convection]
    type = ADMatNeumannBC
    variable = T
    boundary = inner
    boundary_material = convection
    use_displaced_mesh = true
    value = 1
  []
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
  []
[]
[Reporters]
  [params]
    type = ConstantReporter
    real_vector_names = 'radii'
    real_vector_values = '0 0'
    dof_id_type_vector_names = 'num_params'
    dof_id_type_vector_values = '2'
  []
[]
[Postprocessors]
  [current_volume]
    type = VolumePostprocessor
    use_displaced_mesh = true
  []
  # objective function
  [objective]
    type = NodalExtremeValue
    variable = T
  []
  [eq_constraint]
    type = ParsedPostprocessor
    pp_names = current_volume
    expression = 'current_volume - ${volume_constraint}'
  []
  [func_r0]
    type = FunctionValuePostprocessor
    function = eq_grad_r0
  []
  [func_r1]
    type = FunctionValuePostprocessor
    function = eq_grad_r1
  []
[]
[VectorPostprocessors]
  # convert "Real" postprocessors to vectors
  [vol_constraint]
    type = VectorOfPostprocessors
    postprocessors = 'eq_constraint'
    force_postaux = true
  []
  [eq_grad]
    type = VectorOfPostprocessors
    postprocessors = 'func_r0 func_r1'
    force_postaux = true
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -pc_factor_shift_type'
  petsc_options_value = 'lu       NONZERO'
  line_search = none
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-8
[]
[Outputs]
  console = false
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/hydraulic-separators/separator-jump.i)
# This test describes a test where three parallel channels are
# separated using flow separators that act as slip boundary conditions.
# The different channels have different pressure discontinuities
# due to Bernoulli pressure jump combined with irreversible form losses.
# Channel 1 expected drop (analytic, Bernoulli plus contraction form loss): 2.079E-01 Pa
# Channel 2 expected drop (analytic, Bernoulli plus contraction form loss): 8.360E-02 Pa
# Channel 3 expected drop (analytic, Bernoulli plus contraction form loss): 1.870E-02 Pa
rho=1.1
advected_interp_method='upwind'
velocity_interp_method='rc'
[Mesh]
  [mesh]
    type = CartesianMeshGenerator
    dim = 2
    dx = '0.2 0.2 0.2 0.2'
    dy = '0.25 0.25 0.25'
    ix = '2 2 2 2'
    iy = '2 2 2'
    subdomain_id = '1 2 2 2 3 3 4 4 5 5 5 6'
  []
  [separator-1]
    type = SideSetsBetweenSubdomainsGenerator
    input = mesh
    primary_block = '1 2'
    paired_block = '3 4'
    new_boundary = 'separator-1'
  []
  [separator-2]
    type = SideSetsBetweenSubdomainsGenerator
    input = separator-1
    primary_block = '3 4'
    paired_block = '5 6'
    new_boundary = 'separator-2'
  []
  [jump-1]
    type = SideSetsBetweenSubdomainsGenerator
    input = separator-2
    primary_block = '1'
    paired_block = '2'
    new_boundary = 'jump-1'
  []
  [jump-2]
    type = SideSetsBetweenSubdomainsGenerator
    input = jump-1
    primary_block = '3'
    paired_block = '4'
    new_boundary = 'jump-2'
  []
  [jump-3]
    type = SideSetsBetweenSubdomainsGenerator
    input = jump-2
    primary_block = '5'
    paired_block = '6'
    new_boundary = 'jump-3'
  []
  [inlet-1]
    type = ParsedGenerateSideset
    input = jump-3
    combinatorial_geometry = 'y < 0.25 & x < 0.00001'
    replace = true
    new_sideset_name = inlet-1
  []
  [inlet-2]
    type = ParsedGenerateSideset
    input = inlet-1
    combinatorial_geometry = 'y > 0.25 & y < 0.5 & x < 0.00001'
    replace = true
    new_sideset_name = inlet-2
  []
  [inlet-3]
    type = ParsedGenerateSideset
    input = inlet-2
    combinatorial_geometry = 'y > 0.5 & x < 0.00001'
    replace = true
    new_sideset_name = inlet-3
  []
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
  porosity = porosity
[]
[UserObjects]
  [rc]
    type = PINSFVRhieChowInterpolator
    u = superficial_vel_x
    v = superficial_vel_y
    pressure = pressure
  []
[]
[Variables]
  [superficial_vel_x]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = 0.1
  []
  [superficial_vel_y]
    type = PINSFVSuperficialVelocityVariable
  []
  [pressure]
    type = BernoulliPressureVariable
    u = superficial_vel_x
    v = superficial_vel_y
    rho = ${rho}
    pressure_drop_sidesets = 'jump-1 jump-2 jump-3'
    pressure_drop_form_factors = '0.1 0.2 0.3 '
  []
[]
[FVKernels]
  [mass]
    type = PINSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
  []
  [u_advection]
    type = PINSFVMomentumAdvection
    variable = superficial_vel_x
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'x'
  []
  [u_pressure]
    type = PINSFVMomentumPressure
    variable = superficial_vel_x
    pressure = pressure
    momentum_component = 'x'
  []
  [v_advection]
    type = PINSFVMomentumAdvection
    variable = superficial_vel_y
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'y'
  []
  [v_pressure]
    type = PINSFVMomentumPressure
    variable = superficial_vel_y
    pressure = pressure
    momentum_component = 'y'
  []
[]
[FVBCs]
  [inlet-u-1]
    type = INSFVInletVelocityBC
    boundary = 'inlet-1'
    variable = superficial_vel_x
    functor = '0.1'
  []
  [inlet-u-2]
    type = INSFVInletVelocityBC
    boundary = 'inlet-2'
    variable = superficial_vel_x
    functor = '0.2'
  []
  [inlet-u-3]
    type = INSFVInletVelocityBC
    boundary = 'inlet-3'
    variable = superficial_vel_x
    functor = '0.3'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'inlet-1 inlet-2 inlet-3'
    variable = superficial_vel_y
    functor = 0
  []
  [walls-u]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top bottom'
    variable = superficial_vel_x
    momentum_component = 'x'
  []
  [walls-v]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top bottom'
    variable = superficial_vel_y
    momentum_component = 'y'
  []
  [separator-u]
    type = INSFVVelocityHydraulicSeparatorBC
    boundary = 'separator-1 separator-2'
    variable = superficial_vel_x
    momentum_component = 'x'
  []
  [separator-v]
    type = INSFVVelocityHydraulicSeparatorBC
    boundary = 'separator-1 separator-2'
    variable = superficial_vel_y
    momentum_component = 'y'
  []
  [separator-p]
    type = INSFVScalarFieldSeparatorBC
    boundary = 'separator-1 separator-2'
    variable = pressure
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = 0.4
  []
[]
[FunctorMaterials]
  [porosity-1]
    type = ADGenericFunctorMaterial
    prop_names = 'porosity'
    prop_values = '1.0'
    block = '1 3 5'
  []
  [porosity-2]
    type = ADGenericFunctorMaterial
    prop_names = 'porosity'
    prop_values = '0.5'
    block = '2 4 6'
  []
  [speed]
    type = PINSFVSpeedFunctorMaterial
    superficial_vel_x = superficial_vel_x
    superficial_vel_y = superficial_vel_y
    porosity = porosity
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
  petsc_options_value = ' lu       NONZERO               1e-10'
  line_search = 'none'
  nl_rel_tol = 1e-10
[]
[Postprocessors]
  [inlet_p1]
    type = SideAverageValue
    variable = 'pressure'
    boundary = 'inlet-1'
  []
  [inlet_p2]
    type = SideAverageValue
    variable = 'pressure'
    boundary = 'inlet-2'
  []
  [inlet_p3]
    type = SideAverageValue
    variable = 'pressure'
    boundary = 'inlet-3'
  []
  [drop-1]
    type = ParsedPostprocessor
    expression = 'inlet_p1 - outlet'
    pp_names = 'inlet_p1'
    constant_names = 'outlet'
    constant_expressions = '0.4'
  []
  [drop-2]
    type = ParsedPostprocessor
    expression = 'inlet_p2 - outlet'
    pp_names = 'inlet_p2'
    constant_names = 'outlet'
    constant_expressions = '0.4'
  []
  [drop-3]
    type = ParsedPostprocessor
    expression = 'inlet_p3 - outlet'
    pp_names = 'inlet_p3'
    constant_names = 'outlet'
    constant_expressions = '0.4'
  []
[]
[Outputs]
  csv = true
  execute_on = final
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_interface_area_model/turbulent_driven_growth.i)
###############################################################################
# Validation test based on Hibiki and Ishii experiment [1] reported in Figure 5
# [1] Hibiki, T., & Ishii, M. (2000). One-group interfacial area transport of
# bubbly flows in vertical round tubes.
# International Journal of Heat and Mass Transfer, 43(15), 2711-2726.
###############################################################################
mu = 1.0
rho = 1000.0
mu_d = 1.0
rho_d = 1.0
l = ${fparse 50.8/1000.0}
U = 5.031429
dp = 0.005
inlet_phase_2 = 0.442
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
mass_exchange_coeff = 0.0
inlet_interface_area = ${fparse 6.0*inlet_phase_2/dp}
outlet_pressure = 1e5
[GlobalParams]
  rhie_chow_user_object = 'rc'
  density_interp_method = 'average'
  mu_interp_method = 'average'
[]
[Problem]
  identify_variable_groups_in_nl = false
  previous_nl_solution_required = true
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = vel_x
    v = vel_y
    pressure = pressure
  []
[]
[Mesh]
  coord_type = 'RZ'
  rz_coord_axis = 'X'
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = '${fparse l * 60}'
    ymin = 0
    ymax = '${fparse l / 2}'
    nx = 20
    ny = 5
  []
  uniform_refine = 0
[]
[Variables]
  [vel_x]
    type = INSFVVelocityVariable
    initial_condition = 0
  []
  [vel_y]
    type = INSFVVelocityVariable
    initial_condition = 0
  []
  [pressure]
    type = INSFVPressureVariable
  []
  [phase_2]
    type = INSFVScalarFieldVariable
    initial_condition = ${inlet_phase_2}
  []
  [interface_area]
    type = INSFVScalarFieldVariable
    initial_condition = ${inlet_interface_area}
  []
[]
[FVKernels]
  [mass]
    type = INSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
  []
  [u_advection]
    type = INSFVMomentumAdvection
    variable = vel_x
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = 'rho_mixture'
    momentum_component = 'x'
  []
  [u_drift]
    type = WCNSFV2PMomentumDriftFlux
    variable = vel_x
    rho_d = ${rho_d}
    fd = 'rho_mixture_var'
    u_slip = 'vel_slip_x'
    v_slip = 'vel_slip_y'
    momentum_component = 'x'
  []
  [u_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_x
    mu = 'mu_mixture'
    limit_interpolation = true
    momentum_component = 'x'
  []
  [u_pressure]
    type = INSFVMomentumPressure
    variable = vel_x
    momentum_component = 'x'
    pressure = pressure
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = vel_y
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = 'rho_mixture'
    momentum_component = 'y'
  []
  [v_drift]
    type = WCNSFV2PMomentumDriftFlux
    variable = vel_y
    rho_d = ${rho_d}
    fd = 'rho_mixture_var'
    u_slip = 'vel_slip_x'
    v_slip = 'vel_slip_y'
    momentum_component = 'y'
  []
  [v_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_y
    mu = 'mu_mixture'
    limit_interpolation = true
    momentum_component = 'y'
  []
  [v_pressure]
    type = INSFVMomentumPressure
    variable = vel_y
    momentum_component = 'y'
    pressure = pressure
  []
  [phase_2_advection]
    type = INSFVScalarFieldAdvection
    variable = phase_2
    u_slip = 'vel_x'
    v_slip = 'vel_y'
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = 'upwind'
  []
  [phase_2_diffusion]
    type = FVDiffusion
    variable = phase_2
    coeff = 1.0
  []
  [phase_2_src]
    type = NSFVMixturePhaseInterface
    variable = phase_2
    phase_coupled = phase_1
    alpha = ${mass_exchange_coeff}
  []
  [interface_area_advection]
    type = INSFVScalarFieldAdvection
    variable = interface_area
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = 'upwind'
  []
  [interface_area_diffusion]
    type = FVDiffusion
    variable = interface_area
    coeff = 0.1
  []
  [interface_area_source_sink]
    type = WCNSFV2PInterfaceAreaSourceSink
    variable = interface_area
    u = 'vel_x'
    v = 'vel_y'
    L = ${fparse l/2}
    rho = 'rho_mixture'
    rho_d = 'rho'
    pressure = 'pressure'
    k_c = '${fparse mass_exchange_coeff}'
    fd = 'phase_2'
    sigma = 1e-3
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_x
    functor = '${U}'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_y
    functor = '0'
  []
  [walls-u]
    type = INSFVNoSlipWallBC
    boundary = 'top'
    variable = vel_x
    function = 0
  []
  [walls-v]
    type = INSFVNoSlipWallBC
    boundary = 'top'
    variable = vel_y
    function = 0
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = '${outlet_pressure}'
  []
  [inlet_phase_2]
    type = FVDirichletBC
    boundary = 'left'
    variable = phase_2
    value = ${inlet_phase_2}
  []
  [inlet_interface_area]
    type = FVDirichletBC
    boundary = 'left'
    variable = interface_area
    value = ${inlet_interface_area}
  []
  [symmetry-u]
    type = PINSFVSymmetryVelocityBC
    boundary = 'bottom'
    variable = vel_x
    u = vel_x
    v = vel_y
    mu = 'mu_mixture'
    momentum_component = 'x'
  []
  [symmetry-v]
    type = PINSFVSymmetryVelocityBC
    boundary = 'bottom'
    variable = vel_y
    u = vel_x
    v = vel_y
    mu = 'mu_mixture'
    momentum_component = 'y'
  []
  [symmetry-p]
    type = INSFVSymmetryPressureBC
    boundary = 'bottom'
    variable = pressure
  []
  [symmetry-phase-2]
    type = INSFVSymmetryScalarBC
    boundary = 'bottom'
    variable = phase_2
  []
  [symmetry-interface-area]
    type = INSFVSymmetryScalarBC
    boundary = 'bottom'
    variable = interface_area
  []
[]
[AuxVariables]
  [drag_coefficient]
    type = MooseVariableFVReal
  []
  [rho_mixture_var]
    type = MooseVariableFVReal
  []
  [mu_mixture_var]
    type = MooseVariableFVReal
  []
[]
[AuxKernels]
  [populate_cd]
    type = FunctorAux
    variable = drag_coefficient
    functor = 'Darcy_coefficient'
  []
  [populate_rho_mixture_var]
    type = FunctorAux
    variable = rho_mixture_var
    functor = 'rho_mixture'
  []
  [populate_mu_mixture_var]
    type = FunctorAux
    variable = mu_mixture_var
    functor = 'mu_mixture'
  []
[]
[FluidProperties]
  [fp]
    type = IdealGasFluidProperties
  []
[]
[FunctorMaterials]
  [bubble_properties]
    type = GeneralFunctorFluidProps
    fp = 'fp'
    pressure = 'pressure'
    T_fluid = 300.0
    speed = 1.0
    characteristic_length = 1.0
    porosity = 1.0
    output_properties = 'rho'
    outputs = 'out'
  []
  [populate_u_slip]
    type = WCNSFV2PSlipVelocityFunctorMaterial
    slip_velocity_name = 'vel_slip_x'
    momentum_component = 'x'
    u = 'vel_x'
    v = 'vel_y'
    rho = ${rho}
    mu = 'mu_mixture'
    rho_d = ${rho_d}
    particle_diameter = ${dp}
    linear_coef_name = 'Darcy_coefficient'
  []
  [populate_v_slip]
    type = WCNSFV2PSlipVelocityFunctorMaterial
    slip_velocity_name = 'vel_slip_y'
    momentum_component = 'y'
    u = 'vel_x'
    v = 'vel_y'
    rho = ${rho}
    mu = 'mu_mixture'
    rho_d = ${rho_d}
    particle_diameter = ${dp}
    linear_coef_name = 'Darcy_coefficient'
  []
  [compute_phase_1]
    type = ADParsedFunctorMaterial
    property_name = phase_1
    functor_names = 'phase_2'
    expression = '1 - phase_2'
  []
  [CD]
    type = NSFVDispersePhaseDragFunctorMaterial
    rho = 'rho_mixture'
    mu = mu_mixture
    u = 'vel_x'
    v = 'vel_y'
    particle_diameter = ${dp}
  []
  [mixing_material]
    type = NSFVMixtureFunctorMaterial
    phase_2_names = '${rho} ${mu}'
    phase_1_names = 'rho ${mu_d}'
    prop_names = 'rho_mixture mu_mixture'
    phase_1_fraction = 'phase_2'
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  nl_rel_tol = 1e-10
  line_search = 'none'
[]
[Debug]
  show_var_residual_norms = true
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
    petsc_options_iname = '-pc_type -pc_factor_shift_type'
    petsc_options_value = 'lu       NONZERO'
  []
[]
[Outputs]
  [out]
    type = Exodus
  []
[]
[Postprocessors]
  [Re]
    type = ParsedPostprocessor
    expression = '${rho} * ${l} * ${U}'
    pp_names = ''
  []
  [rho_outlet]
    type = SideAverageValue
    boundary = 'right'
    variable = 'rho_mixture_var'
  []
[]
(modules/electromagnetics/test/tests/auxkernels/heating/aux_microwave_heating.i)
# Test for EMJouleHeatingHeatGeneratedAux
# Manufactured solution: E_real = cos(pi*y) * x_hat - cos(pi*x) * y_hat
#                        E_imag = sin(pi*y) * x_hat - sin(pi*x) * y_hat
#                        n = x^2*y^2
#                        heating = '0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
[Mesh]
  [gmg]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 5
    ny = 5
    xmin = -1
    ymin = -1
    elem_type = QUAD9
  []
[]
[Functions]
  #The exact solution for the heated species and electric field real and imag. component
  [exact_real]
    type = ParsedVectorFunction
    expression_x = 'cos(pi*y)'
    expression_y = '-cos(pi*x)'
  []
  [exact_imag]
    type = ParsedVectorFunction
    expression_x = 'sin(pi*y)'
    expression_y = '-sin(pi*x)'
  []
  [exact_n]
    type = ParsedFunction
    expression = 'x^2*y^2'
  []
  #The forcing terms for the heated species and electric field real and imag. component
  [source_real]
    type = ParsedVectorFunction
    symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
    symbol_values = 'omega   mu   epsilon   sigma   omega   mu   epsilon   sigma'
    expression_x = '-epsilon_i*mu_i*omega_i^2*cos(pi*y) - 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*y) + epsilon_i*mu_i*omega_r^2*cos(pi*y) - epsilon_i*mu_r*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_r*omega_r^2*sin(pi*y) - epsilon_r*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_r*mu_i*omega_r^2*sin(pi*y) + epsilon_r*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_r*omega_r^2*cos(pi*y) + mu_i*omega_i*sigma_i*cos(pi*y) + mu_i*omega_i*sigma_r*sin(pi*y) + mu_i*omega_r*sigma_i*sin(pi*y) - mu_i*omega_r*sigma_r*cos(pi*y) + mu_r*omega_i*sigma_i*sin(pi*y) - mu_r*omega_i*sigma_r*cos(pi*y) - mu_r*omega_r*sigma_i*cos(pi*y) - mu_r*omega_r*sigma_r*sin(pi*y) + pi^2*cos(pi*y)'
    expression_y = 'epsilon_i*mu_i*omega_i^2*cos(pi*x) + 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*x) - epsilon_i*mu_i*omega_r^2*cos(pi*x) + epsilon_i*mu_r*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_r*omega_r^2*sin(pi*x) + epsilon_r*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_r*mu_i*omega_r^2*sin(pi*x) - epsilon_r*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_r*omega_r^2*cos(pi*x) - mu_i*omega_i*sigma_i*cos(pi*x) - mu_i*omega_i*sigma_r*sin(pi*x) - mu_i*omega_r*sigma_i*sin(pi*x) + mu_i*omega_r*sigma_r*cos(pi*x) - mu_r*omega_i*sigma_i*sin(pi*x) + mu_r*omega_i*sigma_r*cos(pi*x) + mu_r*omega_r*sigma_i*cos(pi*x) + mu_r*omega_r*sigma_r*sin(pi*x) - pi^2*cos(pi*x)'
  []
  [source_imag]
    type = ParsedVectorFunction
    symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
    symbol_values = 'omega   mu   epsilon   sigma   omega   mu   epsilon   sigma'
    expression_x = '-epsilon_i*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_i*omega_r^2*sin(pi*y) + epsilon_i*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_i*mu_r*omega_r^2*cos(pi*y) + epsilon_r*mu_i*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_i*omega_r^2*cos(pi*y) + epsilon_r*mu_r*omega_i^2*sin(pi*y) - 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*y) - epsilon_r*mu_r*omega_r^2*sin(pi*y) + mu_i*omega_i*sigma_i*sin(pi*y) - mu_i*omega_i*sigma_r*cos(pi*y) - mu_i*omega_r*sigma_i*cos(pi*y) - mu_i*omega_r*sigma_r*sin(pi*y) - mu_r*omega_i*sigma_i*cos(pi*y) - mu_r*omega_i*sigma_r*sin(pi*y) - mu_r*omega_r*sigma_i*sin(pi*y) + mu_r*omega_r*sigma_r*cos(pi*y) + pi^2*sin(pi*y)'
    expression_y = 'epsilon_i*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_i*omega_r^2*sin(pi*x) - epsilon_i*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_i*mu_r*omega_r^2*cos(pi*x) - epsilon_r*mu_i*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_i*omega_r^2*cos(pi*x) - epsilon_r*mu_r*omega_i^2*sin(pi*x) + 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*x) + epsilon_r*mu_r*omega_r^2*sin(pi*x) - mu_i*omega_i*sigma_i*sin(pi*x) + mu_i*omega_i*sigma_r*cos(pi*x) + mu_i*omega_r*sigma_i*cos(pi*x) + mu_i*omega_r*sigma_r*sin(pi*x) + mu_r*omega_i*sigma_i*cos(pi*x) + mu_r*omega_i*sigma_r*sin(pi*x) + mu_r*omega_r*sigma_i*sin(pi*x) - mu_r*omega_r*sigma_r*cos(pi*x) - pi^2*sin(pi*x)'
  []
  [source_n]
    type = ParsedFunction
    symbol_names = 'sigma_r'
    symbol_values = 'sigma'
    expression = '-2*x^2 - 2*y^2 - 0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
  []
  [heating_func]
    type = ParsedFunction
    symbol_names = 'sigma_r'
    symbol_values = 'sigma'
    expression = '0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
  []
  #Material Coefficients
  [omega]
    type = ParsedFunction
    expression = '2.0'
  []
  [mu]
    type = ParsedFunction
    expression = '1.0'
  []
  [epsilon]
    type = ParsedFunction
    expression = '3.0'
  []
  [sigma]
    type = ParsedFunction
    expression = '4.0'
    #expression = 'x^2*y^2'
  []
[]
[Materials]
  [WaveCoeff]
    type = WaveEquationCoefficient
    eps_rel_imag = eps_imag
    eps_rel_real = eps_real
    k_real = k_real
    k_imag = k_imag
    mu_rel_imag = mu_imag
    mu_rel_real = mu_real
  []
  [eps_real]
    type = ADGenericFunctionMaterial
    prop_names = eps_real
    prop_values = epsilon
  []
  [eps_imag]
    type = ADGenericFunctionMaterial
    prop_names = eps_imag
    prop_values = epsilon
  []
  [mu_real]
    type = ADGenericFunctionMaterial
    prop_names = mu_real
    prop_values = mu
  []
  [mu_imag]
    type = ADGenericFunctionMaterial
    prop_names = mu_imag
    prop_values = mu
  []
  [k_real]
    type = ADGenericFunctionMaterial
    prop_names = k_real
    prop_values = omega
  []
  [k_imag]
    type = ADGenericFunctionMaterial
    prop_names = k_imag
    prop_values = omega
  []
  [cond_real]
    type = ADGenericFunctionMaterial
    prop_names = cond_real
    prop_values = sigma
  []
  [cond_imag]
    type = ADGenericFunctionMaterial
    prop_names = cond_imag
    prop_values = sigma
  []
[]
[Variables]
  [n]
    family = LAGRANGE
    order = FIRST
  []
  [E_real]
    family = NEDELEC_ONE
    order = FIRST
  []
  [E_imag]
    family = NEDELEC_ONE
    order = FIRST
  []
[]
[Kernels]
  [curl_curl_real]
    type = CurlCurlField
    variable = E_real
  []
  [coeff_real]
    type = ADMatWaveReaction
    variable = E_real
    field_real =  E_real
    field_imag =  E_imag
    wave_coef_real = wave_equation_coefficient_real
    wave_coef_imag = wave_equation_coefficient_imaginary
    component = real
  []
  [conduction_real]
    type = ADConductionCurrent
    variable = E_real
    field_imag =  E_imag
    field_real =  E_real
    conductivity_real = cond_real
    conductivity_imag = cond_imag
    ang_freq_real = k_real
    ang_freq_imag = k_imag
    permeability_real = mu_real
    permeability_imag = mu_imag
    component = real
  []
  [body_force_real]
    type = VectorBodyForce
    variable = E_real
    function = source_real
  []
  [curl_curl_imag]
    type = CurlCurlField
    variable = E_imag
  []
  [coeff_imag]
    type = ADMatWaveReaction
    variable = E_imag
    field_real =  E_real
    field_imag =  E_imag
    wave_coef_real = wave_equation_coefficient_real
    wave_coef_imag = wave_equation_coefficient_imaginary
    component = imaginary
  []
  [conduction_imag]
    type = ADConductionCurrent
    variable = E_imag
    field_imag =  E_imag
    field_real =  E_real
    conductivity_real = cond_real
    conductivity_imag = cond_imag
    ang_freq_real = k_real
    ang_freq_imag = k_imag
    permeability_real = mu_real
    permeability_imag = mu_imag
    component = imaginary
  []
  [body_force_imag]
    type = VectorBodyForce
    variable = E_imag
    function = source_imag
  []
  [n_diffusion]
    type = Diffusion
    variable = n
  []
  [microwave_heating]
    type = EMJouleHeatingSource
    variable = n
    E_imag = E_imag
    E_real = E_real
    conductivity = cond_real
  []
  [body_force_n]
    type = BodyForce
    variable = n
    function = source_n
  []
[]
[AuxVariables]
  [heating_term]
    family = MONOMIAL
    order = FIRST
  []
[]
[AuxKernels]
  [aux_microwave_heating]
    type = EMJouleHeatingHeatGeneratedAux
    variable = heating_term
    E_imag = E_imag
    E_real = E_real
    conductivity = cond_real
  []
[]
[BCs]
  [sides_real]
    type = VectorCurlPenaltyDirichletBC
    variable = E_real
    function = exact_real
    penalty = 1e8
    boundary = 'left right top bottom'
  []
  [sides_imag]
    type = VectorCurlPenaltyDirichletBC
    variable = E_imag
    function = exact_imag
    penalty = 1e8
    boundary = 'left right top bottom'
  []
  [sides_n]
    type = FunctorDirichletBC
    variable = n
    boundary = 'left right top bottom'
    functor = exact_n
    preset = false
  []
[]
[Postprocessors]
  [error_real]
    type = ElementVectorL2Error
    variable = E_real
    function = exact_real
  []
  [error_imag]
    type = ElementVectorL2Error
    variable = E_imag
    function = exact_imag
  []
  [error_n]
    type = ElementL2Error
    variable = n
    function = exact_n
  []
  [error_aux_heating]
    type = ElementL2Error
    variable = heating_term
    function = heating_func
  []
  [h]
    type = AverageElementSize
  []
  [h_squared]
    type = ParsedPostprocessor
    pp_names = 'h'
    expression = 'h * h'
  []
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-12
[]
[Outputs]
  exodus = true
  csv = true
[]
(modules/combined/examples/optimization/three_materials.i)
vol_frac = 0.4
cost_frac = 0.3
power = 4
E0 = 1.0e-6
E1 = 0.2
E2 = 0.6
E3 = 1.0
rho0 = 1.0e-6
rho1 = 0.4
rho2 = 0.7
rho3 = 1.0
C0 = 1.0e-6
C1 = 0.5
C2 = 0.8
C3 = 1.0
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Mesh]
  [MeshGenerator]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 50
    ny = 50
    xmin = 0
    xmax = 50
    ymin = 0
    ymax = 50
  []
  [node]
    type = ExtraNodesetGenerator
    input = MeshGenerator
    new_boundary = hold
    nodes = 0
  []
  [push_left]
    type = ExtraNodesetGenerator
    input = node
    new_boundary = push_left
    coord = '25 0 0'
  []
  [push_center]
    type = ExtraNodesetGenerator
    input = push_left
    new_boundary = push_center
    coord = '50 0 0'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
[]
[AuxVariables]
  [Dc]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = -1.0
  []
  [Cc]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = -1.0
  []
  [Cost]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = -1.0
  []
  [mat_den]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = ${vol_frac}
  []
[]
[AuxKernels]
  [Cost]
    type = MaterialRealAux
    variable = Cost
    property = Cost_mat
  []
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    strain = SMALL
    add_variables = true
    incremental = false
  []
[]
[BCs]
  [no_y]
    type = DirichletBC
    variable = disp_y
    boundary = hold
    value = 0.0
  []
  [no_x_symm]
    type = DirichletBC
    variable = disp_x
    boundary = right
    value = 0.0
  []
[]
[NodalKernels]
  [push_left]
    type = NodalGravity
    variable = disp_y
    boundary = push_left
    gravity_value = -1e-3
    mass = 1
  []
  [push_center]
    type = NodalGravity
    variable = disp_y
    boundary = push_center
    gravity_value = -1e-3
    mass = 1
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeVariableIsotropicElasticityTensor
    youngs_modulus = E_phys
    poissons_ratio = poissons_ratio
    args = 'mat_den'
  []
  [E_phys]
    type = DerivativeParsedMaterial
    # ordered multimaterial simp
    expression = "A1:=(${E0}-${E1})/(${rho0}^${power}-${rho1}^${power}); "
                 "B1:=${E0}-A1*${rho0}^${power}; E1:=A1*mat_den^${power}+B1; "
                 "A2:=(${E1}-${E2})/(${rho1}^${power}-${rho2}^${power}); "
                 "B2:=${E1}-A2*${rho1}^${power}; E2:=A2*mat_den^${power}+B2; "
                 "A3:=(${E2}-${E3})/(${rho2}^${power}-${rho3}^${power}); "
                 "B3:=${E2}-A3*${rho2}^${power}; E3:=A3*mat_den^${power}+B3; "
                 "if(mat_den<${rho1},E1,if(mat_den<${rho2},E2,E3))"
    coupled_variables = 'mat_den'
    property_name = E_phys
  []
  [Cost_mat]
    type = DerivativeParsedMaterial
    # ordered multimaterial simp
    expression = "A1:=(${C0}-${C1})/(${rho0}^(1/${power})-${rho1}^(1/${power})); "
                 "B1:=${C0}-A1*${rho0}^(1/${power}); C1:=A1*mat_den^(1/${power})+B1; "
                 "A2:=(${C1}-${C2})/(${rho1}^(1/${power})-${rho2}^(1/${power})); "
                 "B2:=${C1}-A2*${rho1}^(1/${power}); C2:=A2*mat_den^(1/${power})+B2; "
                 "A3:=(${C2}-${C3})/(${rho2}^(1/${power})-${rho3}^(1/${power})); "
                 "B3:=${C2}-A3*${rho2}^(1/${power}); C3:=A3*mat_den^(1/${power})+B3; "
                 "if(mat_den<${rho1},C1,if(mat_den<${rho2},C2,C3))"
    coupled_variables = 'mat_den'
    property_name = Cost_mat
  []
  [CostDensity]
    type = ParsedMaterial
    property_name = CostDensity
    coupled_variables = 'mat_den Cost'
    expression = 'mat_den*Cost'
  []
  [poissons_ratio]
    type = GenericConstantMaterial
    prop_names = poissons_ratio
    prop_values = 0.3
  []
  [stress]
    type = ComputeLinearElasticStress
  []
  [dc]
    type = ComplianceSensitivity
    design_density = mat_den
    youngs_modulus = E_phys
  []
  [cc]
    type = CostSensitivity
    design_density = mat_den
    cost = Cost_mat
    outputs = 'exodus'
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[UserObjects]
  [rad_avg]
    type = RadialAverage
    radius = 3
    weights = linear
    prop_name = sensitivity
    execute_on = TIMESTEP_END
    force_preaux = true
  []
  [rad_avg_cost]
    type = RadialAverage
    radius = 3
    weights = linear
    prop_name = cost_sensitivity
    execute_on = TIMESTEP_END
    force_preaux = true
  []
  [update]
    type = DensityUpdateTwoConstraints
    # This is
    density_sensitivity = Dc
    cost_density_sensitivity = Cc
    cost = Cost
    cost_fraction = ${cost_frac}
    design_density = mat_den
    volume_fraction = ${vol_frac}
    bisection_lower_bound = 0
    bisection_upper_bound = 1.0e16 # 100
    bisection_move = 0.05
    adaptive_move = true
    relative_tolerance = 1.0e-3
    execute_on = TIMESTEP_BEGIN
  []
  # Provides Dc
  [calc_sense]
    type = SensitivityFilter
    density_sensitivity = Dc
    design_density = mat_den
    filter_UO = rad_avg
    execute_on = TIMESTEP_END
    force_postaux = true
  []
  # Provides Cc
  [calc_sense_cost]
    type = SensitivityFilter
    density_sensitivity = Cc
    design_density = mat_den
    filter_UO = rad_avg_cost
    execute_on = TIMESTEP_END
    force_postaux = true
  []
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu superlu_dist'
  nl_abs_tol = 1e-10
  dt = 1.0
  num_steps = 40
[]
[Outputs]
  exodus = true
  [out]
    type = CSV
    execute_on = 'TIMESTEP_END'
  []
  print_linear_residuals = false
[]
[Postprocessors]
  [total_vol]
    type = ElementIntegralVariablePostprocessor
    variable = mat_den
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [mesh_volume]
    type = VolumePostprocessor
    execute_on = 'initial timestep_end'
  []
  [vol_frac]
    type = ParsedPostprocessor
    expression = 'total_vol / mesh_volume'
    pp_names = 'total_vol mesh_volume'
  []
  [sensitivity]
    type = ElementIntegralMaterialProperty
    mat_prop = sensitivity
  []
  [cost_sensitivity]
    type = ElementIntegralMaterialProperty
    mat_prop = cost_sensitivity
  []
  [cost]
    type = ElementIntegralMaterialProperty
    mat_prop = CostDensity
  []
  [cost_frac]
    type = ParsedPostprocessor
    expression = 'cost / mesh_volume'
    pp_names = 'cost mesh_volume'
  []
[]
(modules/heat_transfer/test/tests/gap_heat_transfer_balance/large_gap_heat_transfer_test_rz_cylinder.i)
rpv_core_gap_size = 0.2
core_outer_radius = 2
rpv_inner_radius = '${fparse 2 + rpv_core_gap_size}'
rpv_outer_radius = '${fparse 2.5 + rpv_core_gap_size}'
rpv_width = '${fparse rpv_outer_radius - rpv_inner_radius}'
rpv_outer_htc = 10 # W/m^2/K
rpv_outer_Tinf = 300 # K
core_blocks = '1'
rpv_blocks = '3'
[Mesh]
  [gmg]
    type = CartesianMeshGenerator
    dim = 2
    dx = '${core_outer_radius} ${rpv_core_gap_size} ${rpv_width}'
    ix = '400 1 100'
    dy = 1
    iy = '5'
  []
  [set_block_id1]
    type = SubdomainBoundingBoxGenerator
    input = gmg
    bottom_left = '0 0 0'
    top_right = '${core_outer_radius} 1 0'
    block_id = 1
    location = INSIDE
  []
  [rename_core_bdy]
    type = SideSetsBetweenSubdomainsGenerator
    input = set_block_id1
    primary_block = 1
    paired_block = 0
    new_boundary = 'core_outer'
  []
  [set_block_id3]
    type = SubdomainBoundingBoxGenerator
    input = rename_core_bdy
    bottom_left = '${rpv_inner_radius} 0 0'
    top_right = '${rpv_outer_radius} 1 0'
    block_id = 3
    location = INSIDE
  []
  [rename_inner_rpv_bdy]
    type = SideSetsBetweenSubdomainsGenerator
    input = set_block_id3
    primary_block = 3
    paired_block = 0
    new_boundary = 'rpv_inner'
  []
  # comment out for test without gap
  [2d_mesh]
    type = BlockDeletionGenerator
    input = rename_inner_rpv_bdy
    block = 0
  []
  coord_type = RZ
[]
[Variables]
  [Tsolid]
    initial_condition = 500
  []
[]
[Kernels]
  [heat_source]
    type = CoupledForce
    variable = Tsolid
    block = '${core_blocks}'
    v = power_density
  []
  [heat_conduction]
    type = HeatConduction
    variable = Tsolid
  []
[]
[BCs]
  [RPV_out_BC] # k \nabla T = h (T- T_inf) at RPV outer boundary
    type = ConvectiveFluxFunction # (Robin BC)
    variable = Tsolid
    boundary = 'right' # outer RPV
    coefficient = ${rpv_outer_htc}
    T_infinity = ${rpv_outer_Tinf}
  []
[]
[ThermalContact]
  [RPV_gap]
    type = GapHeatTransfer
    gap_geometry_type = 'CYLINDER'
    emissivity_primary = 0.8
    emissivity_secondary = 0.8
    variable = Tsolid
    primary = 'core_outer'
    secondary = 'rpv_inner'
    gap_conductivity = 0.1
    quadrature = true
  []
[]
[AuxVariables]
  [power_density]
    block = '${core_blocks}'
    initial_condition = 50e3
  []
[]
[Materials]
  [simple_mat]
    type = HeatConductionMaterial
    thermal_conductivity = 34.6 # W/m/K
  []
[]
[Postprocessors]
  [Tcore_avg]
    type = ElementAverageValue
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Tcore_max]
    type = ElementExtremeValue
    value_type = max
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Tcore_min]
    type = ElementExtremeValue
    value_type = min
    variable = Tsolid
    block = '${core_blocks}'
  []
  [Trpv_avg]
    type = ElementAverageValue
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [Trpv_max]
    type = ElementExtremeValue
    value_type = max
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [Trpv_min]
    type = ElementExtremeValue
    value_type = min
    variable = Tsolid
    block = '${rpv_blocks}'
  []
  [ptot]
    type = ElementIntegralVariablePostprocessor
    variable = power_density
    block = '${core_blocks}'
  []
  [rpv_convective_out]
    type = ConvectiveHeatTransferSideIntegral
    T_solid = Tsolid
    boundary = 'right' # outer RVP
    T_fluid = ${rpv_outer_Tinf}
    htc = ${rpv_outer_htc}
  []
  [heat_balance] # should be equal to 0 upon convergence
    type = ParsedPostprocessor
    expression = '(rpv_convective_out - ptot) / ptot'
    pp_names = 'rpv_convective_out ptot'
  []
  [flux_from_core] # converges to ptot as the mesh is refined
    type = SideDiffusiveFluxIntegral
    variable = Tsolid
    boundary = core_outer
    diffusivity = thermal_conductivity
  []
  [flux_into_rpv] # converges to rpv_convective_out as the mesh is refined
    type = SideDiffusiveFluxIntegral
    variable = Tsolid
    boundary = rpv_inner
    diffusivity = thermal_conductivity
  []
[]
[Executioner]
  type = Steady
  automatic_scaling = true
  compute_scaling_once = false
  petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart '
  petsc_options_value = 'hypre boomeramg 100'
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-10
  l_max_its = 100
  [Quadrature]
    # order = fifth
    side_order = seventh
  []
  line_search = none
[]
[Outputs]
  exodus = false
  csv = true
[]