- boundaryThe list of boundary IDs from the mesh where this object applies
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:The list of boundary IDs from the mesh where this object applies
 - vThe variable whose value we are to match.
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:The variable whose value we are to match.
 - variableThe name of the variable that this residual object operates on
C++ Type:NonlinearVariableName
Unit:(no unit assumed)
Controllable:No
Description:The name of the variable that this residual object operates on
 
MatchedValueBC
Implements a NodalBC which equates two different Variables' values on a specified boundary.
Description
MatchedValueBC is a NodalBC which applies to systems of two or more variables, and can be used to impose equality of two solutions along a given boundary. This class is appropriate for systems of partial differential equations (PDEs) of the form  where  is the domain, and  is its boundary, ,  are the unknowns, ,  are forcing functions (which may depend on both  and ), and  and  are given fluxes. The v parameter is used to specify the variable whose value is tied to . In the example below, the other variable's name happens to be v as well.
Example Input Syntax
  [./left_u]
    type = MatchedValueBC
    variable = u
    boundary = 3
    v = v
  [../](test/tests/bcs/matched_value_bc/matched_value_bc_test.i)Input Parameters
- diag_save_inThe name of auxiliary variables to save this BC's diagonal jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
C++ Type:std::vector<AuxVariableName>
Unit:(no unit assumed)
Controllable:No
Description:The name of auxiliary variables to save this BC's diagonal jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
 - displacementsThe displacements
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:The displacements
 - matrix_onlyFalseWhether this object is only doing assembly to matrices (no vectors)
Default:False
C++ Type:bool
Controllable:No
Description:Whether this object is only doing assembly to matrices (no vectors)
 - save_inThe name of auxiliary variables to save this BC's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
C++ Type:std::vector<AuxVariableName>
Unit:(no unit assumed)
Controllable:No
Description:The name of auxiliary variables to save this BC's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
 - u_coeff1 A coefficient for primary variable u
Default:1
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description: A coefficient for primary variable u
 - v_coeff1 A coefficient for coupled variable v
Default:1
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description: A coefficient for coupled variable v
 
Optional Parameters
- absolute_value_vector_tagsThe tags for the vectors this residual object should fill with the absolute value of the residual contribution
C++ Type:std::vector<TagName>
Controllable:No
Description:The tags for the vectors this residual object should fill with the absolute value of the residual contribution
 - extra_matrix_tagsThe extra tags for the matrices this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the matrices this Kernel should fill
 - extra_vector_tagsThe extra tags for the vectors this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the vectors this Kernel should fill
 
Contribution To Tagged Field Data 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.
 - implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Controllable:No
Description:Determines whether this object is calculated using an implicit or explicit form
 - search_methodnearest_node_connected_sidesChoice of search algorithm. All options begin by finding the nearest node in the primary boundary to a query point in the secondary boundary. In the default nearest_node_connected_sides algorithm, primary boundary elements are searched iff that nearest node is one of their nodes. This is fast to determine via a pregenerated node-to-elem map and is robust on conforming meshes. In the optional all_proximate_sides algorithm, primary boundary elements are searched iff they touch that nearest node, even if they are not topologically connected to it. This is more CPU-intensive but is necessary for robustness on any boundary surfaces which has disconnections (such as Flex IGA meshes) or non-conformity (such as hanging nodes in adaptively h-refined meshes).
Default:nearest_node_connected_sides
C++ Type:MooseEnum
Options:nearest_node_connected_sides, all_proximate_sides
Controllable:No
Description:Choice of search algorithm. All options begin by finding the nearest node in the primary boundary to a query point in the secondary boundary. In the default nearest_node_connected_sides algorithm, primary boundary elements are searched iff that nearest node is one of their nodes. This is fast to determine via a pregenerated node-to-elem map and is robust on conforming meshes. In the optional all_proximate_sides algorithm, primary boundary elements are searched iff they touch that nearest node, even if they are not topologically connected to it. This is more CPU-intensive but is necessary for robustness on any boundary surfaces which has disconnections (such as Flex IGA meshes) or non-conformity (such as hanging nodes in adaptively h-refined meshes).
 - seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
 - 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
- matrix_tagssystem timeThe tag for the matrices this Kernel should fill
Default:system time
C++ Type:MultiMooseEnum
Options:nontime, system, time
Controllable:No
Description:The tag for the matrices this Kernel should fill
 - vector_tagsresidualThe tag for the vectors this Kernel should fill
Default:residual
C++ Type:MultiMooseEnum
Options:nontime, time, residual
Controllable:No
Description:The tag for the vectors this Kernel should fill
 
Tagging Parameters
Input Files
- (test/tests/interfacekernels/1d_interface/ik_save_in_test.i)
 - (test/tests/interfacekernels/ad_coupled_gradient/coupled.i)
 - (test/tests/misc/boundary_variable_check/three-domains/test.i)
 - (test/tests/interfacekernels/ad_coupled_value/coupled.i)
 - (modules/subchannel/examples/coupling/thermo_mech/quad/one_pin_problem_sub.i)
 - (modules/combined/examples/geochem-porous_flow/geotes_weber_tensleep/porous_flow.i)
 - (test/tests/misc/boundary_variable_check/test.i)
 - (modules/subchannel/examples/duct/wrapper.i)
 - (test/tests/bcs/matched_value_bc/matched_value_bc_test.i)
 - (modules/combined/examples/geochem-porous_flow/geotes_2D/porous_flow.i)
 - (test/tests/interfacekernels/hybrid/interface.i)
 - (modules/subchannel/test/tests/problems/coupling/sub.i)
 - (test/tests/bcs/ad_matched_value_bc/test.i)
 - (test/tests/interfacekernels/1d_interface/coupled_value_coupled_flux.i)
 
(test/tests/bcs/matched_value_bc/matched_value_bc_test.i)
[Mesh]
  [./square]
    type = GeneratedMeshGenerator
    nx = 2
    ny = 2
    dim = 2
  [../]
[]
# Solves a pair of coupled diffusion equations where u=v on the boundary
[Variables]
  active = 'u v'
  [./u]
    order = FIRST
    family = LAGRANGE
    initial_condition = 3
  [../]
  [./v]
    order = FIRST
    family = LAGRANGE
    initial_condition = 2
  [../]
[]
[Kernels]
  active = 'diff_u diff_v'
  [./diff_u]
    type = Diffusion
    variable = u
  [../]
  [./diff_v]
    type = Diffusion
    variable = v
  [../]
[]
[BCs]
  active = 'right_v left_u'
  [./right_v]
    type = DirichletBC
    variable = v
    boundary = 1
    value = 3
  [../]
  [./left_u]
    type = MatchedValueBC
    variable = u
    boundary = 3
    v = v
  [../]
[]
[Preconditioning]
  [./precond]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -pc_hypre_type'
  petsc_options_value = 'hypre boomeramg'
  nl_rel_tol = 1e-10
  l_tol = 1e-12
[]
[Outputs]
  file_base = out
  exodus = true
[]
(test/tests/interfacekernels/1d_interface/ik_save_in_test.i)
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 1
    nx = 2
    xmax = 2
  []
  [./subdomain1]
    input = gen
    type = SubdomainBoundingBoxGenerator
    bottom_left = '1.0 0 0'
    block_id = 1
    top_right = '2.0 1.0 0'
  [../]
  [./interface]
    type = SideSetsBetweenSubdomainsGenerator
    input = subdomain1
    primary_block = '0'
    paired_block = '1'
    new_boundary = 'primary0_interface'
  [../]
  [./interface_again]
    type = SideSetsBetweenSubdomainsGenerator
    input = interface
    primary_block = '1'
    paired_block = '0'
    new_boundary = 'primary1_interface'
  [../]
[]
[Variables]
  [./u]
    order = FIRST
    family = LAGRANGE
    block = '0'
  [../]
  [./v]
    order = FIRST
    family = LAGRANGE
    block = '1'
  [../]
[]
[AuxVariables]
  [./primary_resid]
  [../]
  [./secondary_resid]
  [../]
  [./primary_jac]
  [../]
  [./secondary_jac]
  [../]
[]
[Kernels]
  [./diff_u]
    type = CoeffParamDiffusion
    variable = u
    D = 4
    block = 0
    save_in = 'primary_resid'
  [../]
  [./diff_v]
    type = CoeffParamDiffusion
    variable = v
    D = 2
    block = 1
    save_in = 'secondary_resid'
  [../]
[]
[InterfaceKernels]
  [./interface]
    type = InterfaceDiffusion
    variable = u
    neighbor_var = v
    boundary = primary0_interface
    D = 4
    D_neighbor = 2
    save_in_var_side = 'm s'
    save_in = 'primary_resid secondary_resid'
    diag_save_in_var_side = 'm s'
    diag_save_in = 'primary_jac secondary_jac'
  [../]
[]
[BCs]
  [./left]
    type = DirichletBC
    variable = u
    boundary = 'left'
    value = 0
    save_in = 'primary_resid'
  [../]
  [./right]
    type = DirichletBC
    variable = v
    boundary = 'right'
    value = 1
    save_in = 'secondary_resid'
  [../]
  [./middle]
    type = MatchedValueBC
    variable = v
    boundary = 'primary0_interface'
    v = u
    save_in = 'secondary_resid'
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Steady
  solve_type = NEWTON
[]
[Outputs]
  exodus = true
  print_linear_residuals = true
[]
[Debug]
  show_var_residual_norms = true
[]
(test/tests/interfacekernels/ad_coupled_gradient/coupled.i)
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 1
    nx = 20
    xmax = 2
  []
  [subdomain1]
    input = gen
    type = SubdomainBoundingBoxGenerator
    bottom_left = '1.0 0 0'
    block_id = 1
    top_right = '2.0 1.0 0'
  []
  [interface]
    input = subdomain1
    type = SideSetsBetweenSubdomainsGenerator
    primary_block = '0'
    paired_block = '1'
    new_boundary = 'primary0_interface'
  []
[]
[Variables]
  [u]
    block = '0'
  []
  [v]
    block = '1'
  []
  [w]
  []
[]
[Kernels]
  [diff_u]
    type = Diffusion
    variable = u
    block = 0
  []
  [diff_v]
    type = Diffusion
    variable = v
    block = 1
  []
  [diff_w]
    type = Diffusion
    variable = w
  []
  [react_w]
    type = Reaction
    variable = w
  []
[]
[InterfaceKernels]
  [interface]
    type = ADCoupledInterfacialSourceGradient
    variable = u
    neighbor_var = v
    var_source = w
    boundary = primary0_interface
    D = 1
    D_neighbor = 1
  []
[]
[BCs]
  [left]
    type = DirichletBC
    variable = u
    boundary = 'left'
    value = 0
  []
  [right]
    type = DirichletBC
    variable = v
    boundary = 'right'
    value = 10
  []
  [middle]
    type = MatchedValueBC
    variable = v
    boundary = 'primary0_interface'
    v = u
  []
  [w_left]
    type = DirichletBC
    variable = w
    boundary = 'left'
    value = 0
  []
  [w_right]
    type = DirichletBC
    variable = w
    boundary = 'right'
    value = 4
  []
[]
[Executioner]
  type = Steady
  solve_type = NEWTON
[]
[Outputs]
  exodus = true
[]
(test/tests/misc/boundary_variable_check/three-domains/test.i)
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 1
    nx = 15
    xmax = 3
  []
  [subdomain1]
    input = gen
    type = SubdomainBoundingBoxGenerator
    bottom_left = '1.0 0 0'
    block_id = 1
    top_right = '2.0 1.0 0'
  []
  [subdomain2]
    input = subdomain1
    type = SubdomainBoundingBoxGenerator
    bottom_left = '2.0 0 0'
    block_id = 2
    top_right = '3.0 1.0 0'
  []
  [interface]
    input = subdomain2
    type = SideSetsBetweenSubdomainsGenerator
    primary_block = '0'
    paired_block = '1'
    new_boundary = 'primary0_interface'
  []
[]
[Variables]
  [u]
    block = '0 1'
  []
  [v]
    block = '2'
  []
[]
[Kernels]
  [diff_u]
    type = CoeffParamDiffusion
    variable = u
    D = 4
    block = '0 1'
  []
  [diff_v]
    type = CoeffParamDiffusion
    variable = v
    D = 2
    block = '2'
  []
[]
[BCs]
  [bad]
    type = MatchedValueBC
    variable = u
    boundary = 'primary0_interface'
    v = v
  []
[]
[Executioner]
  type = Steady
  solve_type = NEWTON
[]
[Outputs]
  exodus = true
[]
(test/tests/interfacekernels/ad_coupled_value/coupled.i)
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 1
    nx = 20
    xmax = 2
  []
  [./subdomain1]
    input = gen
    type = SubdomainBoundingBoxGenerator
    bottom_left = '1.0 0 0'
    block_id = 1
    top_right = '2.0 1.0 0'
  [../]
  [./interface]
    input = subdomain1
    type = SideSetsBetweenSubdomainsGenerator
    primary_block = '0'
    paired_block = '1'
    new_boundary = 'primary0_interface'
  [../]
[]
[Variables]
  [./u]
    block = '0'
  [../]
  [./v]
    block = '1'
  [../]
  [w][]
[]
[Kernels]
  [./diff_u]
    type = Diffusion
    variable = u
    block = 0
  [../]
  [./diff_v]
    type = Diffusion
    variable = v
    block = 1
  [../]
  [diff_w]
    type = Diffusion
    variable = w
  []
[]
[InterfaceKernels]
  [./interface]
    type = ADCoupledInterfacialSource
    variable = u
    neighbor_var = v
    var_source = w
    boundary = primary0_interface
    D = 1
    D_neighbor = 1
  [../]
[]
[BCs]
  [./left]
    type = DirichletBC
    variable = u
    boundary = 'left'
    value = 0
  [../]
  [./right]
    type = DirichletBC
    variable = v
    boundary = 'right'
    value = 10
  [../]
  [./middle]
    type = MatchedValueBC
    variable = v
    boundary = 'primary0_interface'
    v = u
  [../]
  [w_left]
    type = DirichletBC
    variable = w
    boundary = 'left'
    value = 0
  []
  [w_right]
    type = DirichletBC
    variable = w
    boundary = 'right'
    value = 4
  []
[]
[Executioner]
  type = Steady
  solve_type = NEWTON
[]
[Outputs]
  exodus = true
[]
(modules/subchannel/examples/coupling/thermo_mech/quad/one_pin_problem_sub.i)
pin_diameter = 0.00950
heated_length = 1.0
T_in = 359.15
[GlobalParams]
    displacements = 'disp_x disp_y'
[]
[Mesh]
    second_order = true
    [PinMesh]
        type = GeneratedMeshGenerator
        dim = 2
        xmax = '${fparse pin_diameter / 2.0}'
        bias_x = 1.0
        nx = 20
        ymax = ${heated_length}
        ny = 100 # number of axial cells
    []
    coord_type = RZ
    rz_coord_axis = Y
    beta_rotation = 90
[]
[Functions]
    [volumetric_heat_rate] # Defined such as to be consistent with the IC in SCM
        type = ParsedFunction
        expression = '(4.0 * 100000.0 / (pi * D * D * L)) * (pi/2)*sin(pi*y/L)'
        symbol_names = 'L D'
        symbol_values = '${heated_length} ${pin_diameter}'
    []
[]
[Variables]
    [temperature]
        order = SECOND
        family = LAGRANGE
    []
[]
[AuxVariables]
    [Pin_surface_temperature]
    []
    [pin_diameter_deformed]
        # order = CONSTANT
        # family = MONOMIAL
    []
    [q_prime]
        order = CONSTANT
        family = MONOMIAL
    []
[]
[Physics]
    [SolidMechanics]
        [QuasiStatic]
            add_variables = true
            strain = SMALL
            incremental = true
            generate_output = 'stress_xx stress_yy stress_xy'
            temperature = temperature
            [block0]
                eigenstrain_names = eigenstrain
                block = 0
            []
        []
    []
[]
[AuxKernels]
    [QPrime]
        type = SCMRZPinQPrimeAux # This kernel calculates linear heat rate for the 2D-RZ pin model
        diffusivity = 'thermal_conductivity'
        variable = q_prime
        diffusion_variable = temperature
        component = normal
        boundary = 'right'
        execute_on = 'TIMESTEP_END'
        use_displaced_mesh = true
    []
    [Deformation]
        type = ParsedAux
        variable = pin_diameter_deformed
        coupled_variables = 'disp_x'
        expression = '2.0 * disp_x + ${pin_diameter}'
        execute_on = 'timestep_end'
    []
[]
[Kernels]
    [heat_conduction]
        type = HeatConduction
        variable = temperature
        use_displaced_mesh = true
    []
    [heat_source]
        type = HeatSource
        variable = temperature
        function = volumetric_heat_rate
        use_displaced_mesh = false
    []
[]
[Materials]
    [elasticity_tensor]
        type = ComputeIsotropicElasticityTensor
        block = 0
        bulk_modulus = 0.333333333333e6
        poissons_ratio = 0.0
    []
    [thermal_strain]
        type = ComputeThermalExpansionEigenstrain
        block = 0
        temperature = temperature
        stress_free_temperature = 117.56
        thermal_expansion_coeff = 1e-5
        eigenstrain_name = eigenstrain
    []
    [stress]
        type = ComputeStrainIncrementBasedStress
        block = 0
    []
    [heat_conductor]
        type = HeatConductionMaterial
        thermal_conductivity = 1.0
        block = 0
    []
    [density]
        type = Density
        block = 0
        density = 1.0
    []
[]
[BCs]
    [left]
        type = NeumannBC
        variable = temperature
        boundary = 'left'
    []
    [right]
        type = MatchedValueBC
        variable = temperature
        boundary = 'right'
        v = Pin_surface_temperature
    []
    [no_x]
        type = DirichletBC
        variable = disp_x
        boundary = 'left'
        value = 0.0
    []
    [no_y]
        type = DirichletBC
        variable = disp_y
        boundary = 'bottom top'
        value = 0.0
    []
[]
[ICs]
    [temperature_ic]
        type = ConstantIC
        variable = temperature
        value = ${T_in}
    []
    [q_prime_ic]
        type = ConstantIC
        variable = q_prime
        value = 0.0
    []
    [RD_IC]
        type = ConstantIC
        variable = pin_diameter_deformed
        value = ${pin_diameter}
    []
[]
[Preconditioning]
    [smp]
        type = SMP
        full = true
    []
[]
[Executioner]
    type = Transient
    solve_type = 'PJFNK'
    nl_abs_tol = 1e-7
    l_max_its = 20
    start_time = 0.0
    dt = 0.5
    num_steps = 2
    end_time = 1.0
    petsc_options_iname = '-pc_type -mat_fd_coloring_err -mat_fd_type'
    petsc_options_value = 'lu       1e-6                 ds'
    [Quadrature]
        order = FIFTH
        side_order = SEVENTH
    []
[]
[Postprocessors]
    [total_power]
        type = ElementIntegralFunctorPostprocessor
        functor = volumetric_heat_rate
        use_displaced_mesh = false
    []
    [total_power_disp]
        type = ElementIntegralFunctorPostprocessor
        functor = volumetric_heat_rate
        use_displaced_mesh = true
    []
    [volume]
        type = VolumePostprocessor
    []
    [volume_disp]
        type = VolumePostprocessor
        use_displaced_mesh = true
    []
[]
[Outputs]
    exodus = true
[]
(modules/combined/examples/geochem-porous_flow/geotes_weber_tensleep/porous_flow.i)
#########################################
#                                       #
# File written by create_input_files.py #
#                                       #
#########################################
# PorousFlow simulation of injection and production in a simplified GeoTES aquifer
# Much of this file is standard porous-flow stuff.  The unusual aspects are:
# - transfer of the rates of changes of each species (kg.s) to the aquifer_geochemistry.i simulation.  This is achieved by saving these changes from the PorousFlowMassTimeDerivative residuals
# - transfer of the temperature field to the aquifer_geochemistry.i simulation
# Interesting behaviour can be simulated by this file without its 'parent' simulation, exchanger.i.  exchanger.i provides mass-fractions injected via the injection_rate_massfrac_* variables, but since these are more-or-less constant throughout the duration of the exchanger.i simulation, the initial_conditions specified below may be used.  Similar, exchanger.i provides injection_temperature, but that is also constant.
injection_rate = -0.02 # kg/s/m, negative because injection as a source
production_rate = 0.02 # kg/s/m, this is about the maximum that can be sustained by the aquifer, with its fairly low permeability, without porepressure becoming negative
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 3
    xmin = -75
    xmax = 75
    ymin = 0
    ymax = 40
    zmin = -25
    zmax = 25
    nx = 15
    ny = 4
    nz = 5
  []
  [aquifer]
    type = ParsedSubdomainMeshGenerator
    input = gen
    block_id = 1
    block_name = aquifer
    combinatorial_geometry = 'z >= -5 & z <= 5'
  []
  [injection_nodes]
    input = aquifer
    type = ExtraNodesetGenerator
    new_boundary = injection_nodes
    coord = '-25 0 -5; -25 0 5'
  []
  [production_nodes]
    input = injection_nodes
    type = ExtraNodesetGenerator
    new_boundary = production_nodes
    coord = '25 0 -5; 25 0 5'
  []
[]
[GlobalParams]
  PorousFlowDictator = dictator
  gravity = '0 0 -10'
[]
[BCs]
  [injection_temperature]
    type = MatchedValueBC
    variable = temperature
    v = injection_temperature
    boundary = injection_nodes
  []
[]
[FluidProperties]
  [the_simple_fluid]
    type = SimpleFluidProperties
    thermal_expansion = 0
    bulk_modulus = 2E9
    viscosity = 1E-3
    density0 = 1000
    cv = 4000.0
    cp = 4000.0
  []
[]
[PorousFlowFullySaturated]
  coupling_type = ThermoHydro
  porepressure = porepressure
  temperature = temperature
  mass_fraction_vars = 'f_H f_Cl f_SO4 f_HCO3 f_SiO2aq f_Al f_Ca f_Mg f_Fe f_K f_Na f_Sr f_F f_BOH f_Br f_Ba f_Li f_NO3 f_O2aq '
  save_component_rate_in = 'rate_H rate_Cl rate_SO4 rate_HCO3 rate_SiO2aq rate_Al rate_Ca rate_Mg rate_Fe rate_K rate_Na rate_Sr rate_F rate_BOH rate_Br rate_Ba rate_Li rate_NO3 rate_O2aq rate_H2O' # change in kg at every node / dt
  fp = the_simple_fluid
  temperature_unit = Celsius
[]
[Materials]
  [porosity_caps]
    type = PorousFlowPorosityConst # this simulation has no porosity changes from dissolution
    block = 0
    porosity = 0.01
  []
  [porosity_aquifer]
    type = PorousFlowPorosityConst # this simulation has no porosity changes from dissolution
    block = aquifer
    porosity = 0.063
  []
  [permeability_caps]
    type = PorousFlowPermeabilityConst
    block = 0
    permeability = '1E-18 0 0   0 1E-18 0   0 0 1E-18'
  []
  [permeability_aquifer]
    type = PorousFlowPermeabilityConst
    block = aquifer
    permeability = '1.7E-15 0 0   0 1.7E-15 0   0 0 4.1E-16'
  []
  [thermal_conductivity]
    type = PorousFlowThermalConductivityIdeal
    dry_thermal_conductivity = '0 0 0  0 0 0  0 0 0'
  []
  [rock_heat]
    type = PorousFlowMatrixInternalEnergy
    density = 2500.0
    specific_heat_capacity = 1200.0
  []
[]
[Preconditioning]
  active = typically_efficient
  [typically_efficient]
    type = SMP
    full = true
    petsc_options_iname = '-pc_type -pc_hypre_type'
    petsc_options_value = ' hypre    boomeramg'
  []
  [strong]
    type = SMP
    full = true
    petsc_options = '-ksp_diagonal_scale -ksp_diagonal_scale_fix'
    petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
    petsc_options_value = ' asm      ilu           NONZERO                   2'
  []
  [probably_too_strong]
    type = SMP
    full = true
    petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
    petsc_options_value = ' lu       mumps'
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  end_time = 7.76E6 # 90 days
  [TimeStepper]
    type = FunctionDT
    function = 'min(3E4, max(1E4, 0.2 * t))'
  []
[]
[Outputs]
  exodus = true
[]
[Variables]
  [f_H]
    initial_condition = -2.952985071156e-06
  []
  [f_Cl]
    initial_condition = 0.04870664551708
  []
  [f_SO4]
    initial_condition = 0.0060359986852517
  []
  [f_HCO3]
    initial_condition = 5.0897287594019e-05
  []
  [f_SiO2aq]
    initial_condition = 3.0246609868421e-05
  []
  [f_Al]
    initial_condition = 3.268028901929e-08
  []
  [f_Ca]
    initial_condition = 0.00082159428184586
  []
  [f_Mg]
    initial_condition = 1.8546347062146e-05
  []
  [f_Fe]
    initial_condition = 4.3291908204093e-05
  []
  [f_K]
    initial_condition = 6.8434768308898e-05
  []
  [f_Na]
    initial_condition = 0.033298053919671
  []
  [f_Sr]
    initial_condition = 1.2771866652177e-05
  []
  [f_F]
    initial_condition = 5.5648860174073e-06
  []
  [f_BOH]
    initial_condition = 0.0003758574621917
  []
  [f_Br]
    initial_condition = 9.0315286107068e-05
  []
  [f_Ba]
    initial_condition = 1.5637460875161e-07
  []
  [f_Li]
    initial_condition = 8.3017067912701e-05
  []
  [f_NO3]
    initial_condition = 0.00010958455036169
  []
  [f_O2aq]
    initial_condition = -7.0806852373351e-05
  []
  [porepressure]
    initial_condition = 30E6
  []
  [temperature]
    initial_condition = 92
    scaling = 1E-6 # fluid enthalpy is roughly 1E6
  []
[]
[DiracKernels]
  [inject_H]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    multiplying_var = injection_rate_massfrac_H
    point_file = injection.bh
    variable = f_H
  []
  [inject_Cl]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    multiplying_var = injection_rate_massfrac_Cl
    point_file = injection.bh
    variable = f_Cl
  []
  [inject_SO4]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    multiplying_var = injection_rate_massfrac_SO4
    point_file = injection.bh
    variable = f_SO4
  []
  [inject_HCO3]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    multiplying_var = injection_rate_massfrac_HCO3
    point_file = injection.bh
    variable = f_HCO3
  []
  [inject_SiO2aq]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    multiplying_var = injection_rate_massfrac_SiO2aq
    point_file = injection.bh
    variable = f_SiO2aq
  []
  [inject_Al]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    multiplying_var = injection_rate_massfrac_Al
    point_file = injection.bh
    variable = f_Al
  []
  [inject_Ca]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    multiplying_var = injection_rate_massfrac_Ca
    point_file = injection.bh
    variable = f_Ca
  []
  [inject_Mg]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    multiplying_var = injection_rate_massfrac_Mg
    point_file = injection.bh
    variable = f_Mg
  []
  [inject_Fe]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    multiplying_var = injection_rate_massfrac_Fe
    point_file = injection.bh
    variable = f_Fe
  []
  [inject_K]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    multiplying_var = injection_rate_massfrac_K
    point_file = injection.bh
    variable = f_K
  []
  [inject_Na]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    multiplying_var = injection_rate_massfrac_Na
    point_file = injection.bh
    variable = f_Na
  []
  [inject_Sr]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    multiplying_var = injection_rate_massfrac_Sr
    point_file = injection.bh
    variable = f_Sr
  []
  [inject_F]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    multiplying_var = injection_rate_massfrac_F
    point_file = injection.bh
    variable = f_F
  []
  [inject_BOH]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    multiplying_var = injection_rate_massfrac_BOH
    point_file = injection.bh
    variable = f_BOH
  []
  [inject_Br]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    multiplying_var = injection_rate_massfrac_Br
    point_file = injection.bh
    variable = f_Br
  []
  [inject_Ba]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    multiplying_var = injection_rate_massfrac_Ba
    point_file = injection.bh
    variable = f_Ba
  []
  [inject_Li]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    multiplying_var = injection_rate_massfrac_Li
    point_file = injection.bh
    variable = f_Li
  []
  [inject_NO3]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    multiplying_var = injection_rate_massfrac_NO3
    point_file = injection.bh
    variable = f_NO3
  []
  [inject_O2aq]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    multiplying_var = injection_rate_massfrac_O2aq
    point_file = injection.bh
    variable = f_O2aq
  []
  [inject_H2O]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    multiplying_var = injection_rate_massfrac_H2O
    point_file = injection.bh
    variable = porepressure
  []
  [produce_H]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_H
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    mass_fraction_component = 0
    point_file = production.bh
    variable = f_H
  []
  [produce_Cl]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_Cl
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    mass_fraction_component = 1
    point_file = production.bh
    variable = f_Cl
  []
  [produce_SO4]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_SO4
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    mass_fraction_component = 2
    point_file = production.bh
    variable = f_SO4
  []
  [produce_HCO3]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_HCO3
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    mass_fraction_component = 3
    point_file = production.bh
    variable = f_HCO3
  []
  [produce_SiO2aq]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_SiO2aq
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    mass_fraction_component = 4
    point_file = production.bh
    variable = f_SiO2aq
  []
  [produce_Al]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_Al
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    mass_fraction_component = 5
    point_file = production.bh
    variable = f_Al
  []
  [produce_Ca]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_Ca
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    mass_fraction_component = 6
    point_file = production.bh
    variable = f_Ca
  []
  [produce_Mg]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_Mg
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    mass_fraction_component = 7
    point_file = production.bh
    variable = f_Mg
  []
  [produce_Fe]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_Fe
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    mass_fraction_component = 8
    point_file = production.bh
    variable = f_Fe
  []
  [produce_K]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_K
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    mass_fraction_component = 9
    point_file = production.bh
    variable = f_K
  []
  [produce_Na]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_Na
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    mass_fraction_component = 10
    point_file = production.bh
    variable = f_Na
  []
  [produce_Sr]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_Sr
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    mass_fraction_component = 11
    point_file = production.bh
    variable = f_Sr
  []
  [produce_F]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_F
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    mass_fraction_component = 12
    point_file = production.bh
    variable = f_F
  []
  [produce_BOH]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_BOH
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    mass_fraction_component = 13
    point_file = production.bh
    variable = f_BOH
  []
  [produce_Br]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_Br
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    mass_fraction_component = 14
    point_file = production.bh
    variable = f_Br
  []
  [produce_Ba]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_Ba
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    mass_fraction_component = 15
    point_file = production.bh
    variable = f_Ba
  []
  [produce_Li]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_Li
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    mass_fraction_component = 16
    point_file = production.bh
    variable = f_Li
  []
  [produce_NO3]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_NO3
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    mass_fraction_component = 17
    point_file = production.bh
    variable = f_NO3
  []
  [produce_O2aq]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_O2aq
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    mass_fraction_component = 18
    point_file = production.bh
    variable = f_O2aq
  []
  [produce_H2O]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_H2O
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    mass_fraction_component = 19
    point_file = production.bh
    variable = porepressure
  []
  [produce_heat]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_heat
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    use_enthalpy = true
    point_file = production.bh
    variable = temperature
  []
[]
[UserObjects]
  [injected_mass]
    type = PorousFlowSumQuantity
  []
  [produced_mass_H]
    type = PorousFlowSumQuantity
  []
  [produced_mass_Cl]
    type = PorousFlowSumQuantity
  []
  [produced_mass_SO4]
    type = PorousFlowSumQuantity
  []
  [produced_mass_HCO3]
    type = PorousFlowSumQuantity
  []
  [produced_mass_SiO2aq]
    type = PorousFlowSumQuantity
  []
  [produced_mass_Al]
    type = PorousFlowSumQuantity
  []
  [produced_mass_Ca]
    type = PorousFlowSumQuantity
  []
  [produced_mass_Mg]
    type = PorousFlowSumQuantity
  []
  [produced_mass_Fe]
    type = PorousFlowSumQuantity
  []
  [produced_mass_K]
    type = PorousFlowSumQuantity
  []
  [produced_mass_Na]
    type = PorousFlowSumQuantity
  []
  [produced_mass_Sr]
    type = PorousFlowSumQuantity
  []
  [produced_mass_F]
    type = PorousFlowSumQuantity
  []
  [produced_mass_BOH]
    type = PorousFlowSumQuantity
  []
  [produced_mass_Br]
    type = PorousFlowSumQuantity
  []
  [produced_mass_Ba]
    type = PorousFlowSumQuantity
  []
  [produced_mass_Li]
    type = PorousFlowSumQuantity
  []
  [produced_mass_NO3]
    type = PorousFlowSumQuantity
  []
  [produced_mass_O2aq]
    type = PorousFlowSumQuantity
  []
  [produced_mass_H2O]
    type = PorousFlowSumQuantity
  []
  [produced_heat]
    type = PorousFlowSumQuantity
  []
[]
[Postprocessors]
  [dt]
    type = TimestepSize
    execute_on = TIMESTEP_BEGIN
  []
  [tot_kg_injected_this_timestep]
    type = PorousFlowPlotQuantity
    uo = injected_mass
  []
  [kg_H_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_H
  []
  [kg_Cl_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_Cl
  []
  [kg_SO4_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_SO4
  []
  [kg_HCO3_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_HCO3
  []
  [kg_SiO2aq_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_SiO2aq
  []
  [kg_Al_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_Al
  []
  [kg_Ca_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_Ca
  []
  [kg_Mg_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_Mg
  []
  [kg_Fe_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_Fe
  []
  [kg_K_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_K
  []
  [kg_Na_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_Na
  []
  [kg_Sr_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_Sr
  []
  [kg_F_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_F
  []
  [kg_BOH_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_BOH
  []
  [kg_Br_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_Br
  []
  [kg_Ba_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_Ba
  []
  [kg_Li_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_Li
  []
  [kg_NO3_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_NO3
  []
  [kg_O2aq_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_O2aq
  []
  [kg_H2O_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_H2O
  []
  [mole_rate_H_produced]
    type = FunctionValuePostprocessor
    function = moles_H
    indirect_dependencies = 'kg_H_produced_this_timestep dt'
  []
  [mole_rate_Cl_produced]
    type = FunctionValuePostprocessor
    function = moles_Cl
    indirect_dependencies = 'kg_Cl_produced_this_timestep dt'
  []
  [mole_rate_SO4_produced]
    type = FunctionValuePostprocessor
    function = moles_SO4
    indirect_dependencies = 'kg_SO4_produced_this_timestep dt'
  []
  [mole_rate_HCO3_produced]
    type = FunctionValuePostprocessor
    function = moles_HCO3
    indirect_dependencies = 'kg_HCO3_produced_this_timestep dt'
  []
  [mole_rate_SiO2aq_produced]
    type = FunctionValuePostprocessor
    function = moles_SiO2aq
    indirect_dependencies = 'kg_SiO2aq_produced_this_timestep dt'
  []
  [mole_rate_Al_produced]
    type = FunctionValuePostprocessor
    function = moles_Al
    indirect_dependencies = 'kg_Al_produced_this_timestep dt'
  []
  [mole_rate_Ca_produced]
    type = FunctionValuePostprocessor
    function = moles_Ca
    indirect_dependencies = 'kg_Ca_produced_this_timestep dt'
  []
  [mole_rate_Mg_produced]
    type = FunctionValuePostprocessor
    function = moles_Mg
    indirect_dependencies = 'kg_Mg_produced_this_timestep dt'
  []
  [mole_rate_Fe_produced]
    type = FunctionValuePostprocessor
    function = moles_Fe
    indirect_dependencies = 'kg_Fe_produced_this_timestep dt'
  []
  [mole_rate_K_produced]
    type = FunctionValuePostprocessor
    function = moles_K
    indirect_dependencies = 'kg_K_produced_this_timestep dt'
  []
  [mole_rate_Na_produced]
    type = FunctionValuePostprocessor
    function = moles_Na
    indirect_dependencies = 'kg_Na_produced_this_timestep dt'
  []
  [mole_rate_Sr_produced]
    type = FunctionValuePostprocessor
    function = moles_Sr
    indirect_dependencies = 'kg_Sr_produced_this_timestep dt'
  []
  [mole_rate_F_produced]
    type = FunctionValuePostprocessor
    function = moles_F
    indirect_dependencies = 'kg_F_produced_this_timestep dt'
  []
  [mole_rate_BOH_produced]
    type = FunctionValuePostprocessor
    function = moles_BOH
    indirect_dependencies = 'kg_BOH_produced_this_timestep dt'
  []
  [mole_rate_Br_produced]
    type = FunctionValuePostprocessor
    function = moles_Br
    indirect_dependencies = 'kg_Br_produced_this_timestep dt'
  []
  [mole_rate_Ba_produced]
    type = FunctionValuePostprocessor
    function = moles_Ba
    indirect_dependencies = 'kg_Ba_produced_this_timestep dt'
  []
  [mole_rate_Li_produced]
    type = FunctionValuePostprocessor
    function = moles_Li
    indirect_dependencies = 'kg_Li_produced_this_timestep dt'
  []
  [mole_rate_NO3_produced]
    type = FunctionValuePostprocessor
    function = moles_NO3
    indirect_dependencies = 'kg_NO3_produced_this_timestep dt'
  []
  [mole_rate_O2aq_produced]
    type = FunctionValuePostprocessor
    function = moles_O2aq
    indirect_dependencies = 'kg_O2aq_produced_this_timestep dt'
  []
  [mole_rate_H2O_produced]
    type = FunctionValuePostprocessor
    function = moles_H2O
    indirect_dependencies = 'kg_H2O_produced_this_timestep dt'
  []
  [heat_joules_extracted_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_heat
  []
  [production_temperature]
    type = AverageNodalVariableValue
    boundary = production_nodes
    variable = temperature
  []
[]
[Functions]
  [moles_H]
    type = ParsedFunction
    symbol_names = 'kg_H dt'
    symbol_values = 'kg_H_produced_this_timestep dt'
    expression = 'kg_H * 1000 / 1.0079 / dt'
  []
  [moles_Cl]
    type = ParsedFunction
    symbol_names = 'kg_Cl dt'
    symbol_values = 'kg_Cl_produced_this_timestep dt'
    expression = 'kg_Cl * 1000 / 35.453 / dt'
  []
  [moles_SO4]
    type = ParsedFunction
    symbol_names = 'kg_SO4 dt'
    symbol_values = 'kg_SO4_produced_this_timestep dt'
    expression = 'kg_SO4 * 1000 / 96.0576 / dt'
  []
  [moles_HCO3]
    type = ParsedFunction
    symbol_names = 'kg_HCO3 dt'
    symbol_values = 'kg_HCO3_produced_this_timestep dt'
    expression = 'kg_HCO3 * 1000 / 61.0171 / dt'
  []
  [moles_SiO2aq]
    type = ParsedFunction
    symbol_names = 'kg_SiO2aq dt'
    symbol_values = 'kg_SiO2aq_produced_this_timestep dt'
    expression = 'kg_SiO2aq * 1000 / 60.0843 / dt'
  []
  [moles_Al]
    type = ParsedFunction
    symbol_names = 'kg_Al dt'
    symbol_values = 'kg_Al_produced_this_timestep dt'
    expression = 'kg_Al * 1000 / 26.9815 / dt'
  []
  [moles_Ca]
    type = ParsedFunction
    symbol_names = 'kg_Ca dt'
    symbol_values = 'kg_Ca_produced_this_timestep dt'
    expression = 'kg_Ca * 1000 / 40.08 / dt'
  []
  [moles_Mg]
    type = ParsedFunction
    symbol_names = 'kg_Mg dt'
    symbol_values = 'kg_Mg_produced_this_timestep dt'
    expression = 'kg_Mg * 1000 / 24.305 / dt'
  []
  [moles_Fe]
    type = ParsedFunction
    symbol_names = 'kg_Fe dt'
    symbol_values = 'kg_Fe_produced_this_timestep dt'
    expression = 'kg_Fe * 1000 / 55.847 / dt'
  []
  [moles_K]
    type = ParsedFunction
    symbol_names = 'kg_K dt'
    symbol_values = 'kg_K_produced_this_timestep dt'
    expression = 'kg_K * 1000 / 39.0983 / dt'
  []
  [moles_Na]
    type = ParsedFunction
    symbol_names = 'kg_Na dt'
    symbol_values = 'kg_Na_produced_this_timestep dt'
    expression = 'kg_Na * 1000 / 22.9898 / dt'
  []
  [moles_Sr]
    type = ParsedFunction
    symbol_names = 'kg_Sr dt'
    symbol_values = 'kg_Sr_produced_this_timestep dt'
    expression = 'kg_Sr * 1000 / 87.62 / dt'
  []
  [moles_F]
    type = ParsedFunction
    symbol_names = 'kg_F dt'
    symbol_values = 'kg_F_produced_this_timestep dt'
    expression = 'kg_F * 1000 / 18.9984 / dt'
  []
  [moles_BOH]
    type = ParsedFunction
    symbol_names = 'kg_BOH dt'
    symbol_values = 'kg_BOH_produced_this_timestep dt'
    expression = 'kg_BOH * 1000 / 61.8329 / dt'
  []
  [moles_Br]
    type = ParsedFunction
    symbol_names = 'kg_Br dt'
    symbol_values = 'kg_Br_produced_this_timestep dt'
    expression = 'kg_Br * 1000 / 79.904 / dt'
  []
  [moles_Ba]
    type = ParsedFunction
    symbol_names = 'kg_Ba dt'
    symbol_values = 'kg_Ba_produced_this_timestep dt'
    expression = 'kg_Ba * 1000 / 137.33 / dt'
  []
  [moles_Li]
    type = ParsedFunction
    symbol_names = 'kg_Li dt'
    symbol_values = 'kg_Li_produced_this_timestep dt'
    expression = 'kg_Li * 1000 / 6.941 / dt'
  []
  [moles_NO3]
    type = ParsedFunction
    symbol_names = 'kg_NO3 dt'
    symbol_values = 'kg_NO3_produced_this_timestep dt'
    expression = 'kg_NO3 * 1000 / 62.0049 / dt'
  []
  [moles_O2aq]
    type = ParsedFunction
    symbol_names = 'kg_O2aq dt'
    symbol_values = 'kg_O2aq_produced_this_timestep dt'
    expression = 'kg_O2aq * 1000 / 31.9988 / dt'
  []
  [moles_H2O]
    type = ParsedFunction
    symbol_names = 'kg_H2O dt'
    symbol_values = 'kg_H2O_produced_this_timestep dt'
    expression = 'kg_H2O * 1000 / 18.01801802 / dt'
  []
[]
[AuxVariables]
  [injection_temperature]
    initial_condition = 92
  []
  [injection_rate_massfrac_H]
    initial_condition = -2.952985071156e-06
  []
  [injection_rate_massfrac_Cl]
    initial_condition = 0.04870664551708
  []
  [injection_rate_massfrac_SO4]
    initial_condition = 0.0060359986852517
  []
  [injection_rate_massfrac_HCO3]
    initial_condition = 5.0897287594019e-05
  []
  [injection_rate_massfrac_SiO2aq]
    initial_condition = 3.0246609868421e-05
  []
  [injection_rate_massfrac_Al]
    initial_condition = 3.268028901929e-08
  []
  [injection_rate_massfrac_Ca]
    initial_condition = 0.00082159428184586
  []
  [injection_rate_massfrac_Mg]
    initial_condition = 1.8546347062146e-05
  []
  [injection_rate_massfrac_Fe]
    initial_condition = 4.3291908204093e-05
  []
  [injection_rate_massfrac_K]
    initial_condition = 6.8434768308898e-05
  []
  [injection_rate_massfrac_Na]
    initial_condition = 0.033298053919671
  []
  [injection_rate_massfrac_Sr]
    initial_condition = 1.2771866652177e-05
  []
  [injection_rate_massfrac_F]
    initial_condition = 5.5648860174073e-06
  []
  [injection_rate_massfrac_BOH]
    initial_condition = 0.0003758574621917
  []
  [injection_rate_massfrac_Br]
    initial_condition = 9.0315286107068e-05
  []
  [injection_rate_massfrac_Ba]
    initial_condition = 1.5637460875161e-07
  []
  [injection_rate_massfrac_Li]
    initial_condition = 8.3017067912701e-05
  []
  [injection_rate_massfrac_NO3]
    initial_condition = 0.00010958455036169
  []
  [injection_rate_massfrac_O2aq]
    initial_condition = -7.0806852373351e-05
  []
  [injection_rate_massfrac_H2O]
    initial_condition = 0.91032275033842
  []
  [rate_H]
  []
  [rate_Cl]
  []
  [rate_SO4]
  []
  [rate_HCO3]
  []
  [rate_SiO2aq]
  []
  [rate_Al]
  []
  [rate_Ca]
  []
  [rate_Mg]
  []
  [rate_Fe]
  []
  [rate_K]
  []
  [rate_Na]
  []
  [rate_Sr]
  []
  [rate_F]
  []
  [rate_BOH]
  []
  [rate_Br]
  []
  [rate_Ba]
  []
  [rate_Li]
  []
  [rate_NO3]
  []
  [rate_O2aq]
  []
  [rate_H2O]
  []
[]
[MultiApps]
  [react]
    type = TransientMultiApp
    input_files = aquifer_geochemistry.i
    clone_master_mesh = true
    execute_on = 'timestep_end'
  []
[]
[Transfers]
  [changes_due_to_flow]
    type = MultiAppCopyTransfer
    source_variable = 'rate_H rate_Cl rate_SO4 rate_HCO3 rate_SiO2aq rate_Al rate_Ca rate_Mg rate_Fe rate_K rate_Na rate_Sr rate_F rate_BOH rate_Br rate_Ba rate_Li rate_NO3 rate_O2aq rate_H2O temperature'
    variable = 'pf_rate_H pf_rate_Cl pf_rate_SO4 pf_rate_HCO3 pf_rate_SiO2aq pf_rate_Al pf_rate_Ca pf_rate_Mg pf_rate_Fe pf_rate_K pf_rate_Na pf_rate_Sr pf_rate_F pf_rate_BOH pf_rate_Br pf_rate_Ba pf_rate_Li pf_rate_NO3 pf_rate_O2aq pf_rate_H2O temperature'
    to_multi_app = react
  []
  [massfrac_from_geochem]
    type = MultiAppCopyTransfer
    source_variable = 'massfrac_H massfrac_Cl massfrac_SO4 massfrac_HCO3 massfrac_SiO2aq massfrac_Al massfrac_Ca massfrac_Mg massfrac_Fe massfrac_K massfrac_Na massfrac_Sr massfrac_F massfrac_BOH massfrac_Br massfrac_Ba massfrac_Li massfrac_NO3 massfrac_O2aq '
    variable = 'f_H f_Cl f_SO4 f_HCO3 f_SiO2aq f_Al f_Ca f_Mg f_Fe f_K f_Na f_Sr f_F f_BOH f_Br f_Ba f_Li f_NO3 f_O2aq '
    from_multi_app = react
  []
[]
(test/tests/misc/boundary_variable_check/test.i)
[Problem]
  boundary_restricted_elem_integrity_check = true
[]
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 1
    nx = 10
    xmax = 2
  []
  [subdomain1]
    input = gen
    type = SubdomainBoundingBoxGenerator
    bottom_left = '1.0 0 0'
    block_id = 1
    top_right = '2.0 1.0 0'
  []
  [interface]
    input = subdomain1
    type = SideSetsBetweenSubdomainsGenerator
    primary_block = '0'
    paired_block = '1'
    new_boundary = 'primary0_interface'
  []
[]
[AuxVariables]
  [dummy][]
  [dummy2]
    family = MONOMIAL
    order = CONSTANT
    block = 1
  []
  [dummy3]
    family = MONOMIAL
    order = CONSTANT
    block = 0
  []
[]
[AuxKernels]
  active = 'bad'
  [bad]
    type = ProjectionAux
    variable = dummy
    v = v
    boundary = 'left'
  []
  [bad_elemental]
    type = ProjectionAux
    variable = dummy3
    v = dummy2
    boundary = 'left'
  []
[]
[Variables]
  [u]
    block = '0'
  []
  [v]
    block = '1'
  []
[]
[Kernels]
  [diff_u]
    type = CoeffParamDiffusion
    variable = u
    D = 4
    block = 0
  []
  [diff_v]
    type = CoeffParamDiffusion
    variable = v
    D = 2
    block = 1
  []
[]
[InterfaceKernels]
  active = 'interface'
  [interface]
    type = InterfaceDiffusion
    variable = u
    neighbor_var = v
    boundary = primary0_interface
    D = 'D'
    D_neighbor = 'D'
  []
  [penalty_interface]
    type = PenaltyInterfaceDiffusion
    variable = u
    neighbor_var = v
    boundary = primary0_interface
    penalty = 1e6
  []
[]
[BCs]
  active = 'left right middle'
  [left]
    type = DirichletBC
    variable = u
    boundary = 'left'
    value = 1
  []
  [bad]
    type = MatchedValueBC
    variable = u
    boundary = 'left'
    v = v
  []
  [bad_integrated]
    type = CoupledVarNeumannBC
    variable = u
    boundary = 'left'
    v = v
  []
  [right]
    type = DirichletBC
    variable = v
    boundary = 'right'
    value = 0
  []
  [middle]
    type = MatchedValueBC
    variable = v
    boundary = 'primary0_interface'
    v = u
  []
[]
[Materials]
  [stateful]
    type = StatefulMaterial
    initial_diffusivity = 1
    boundary = primary0_interface
  []
  [block0]
    type = GenericConstantMaterial
    block = '0'
    prop_names = 'D'
    prop_values = '4'
  []
  [block1]
    type = GenericConstantMaterial
    block = '1'
    prop_names = 'D'
    prop_values = '2'
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Steady
  solve_type = NEWTON
[]
[Outputs]
  exodus = true
[]
[Postprocessors]
  active = ''
  [bad]
    type = NodalExtremeValue
    boundary = 'left'
    variable = v
  []
  [bad_side]
    type = SideDiffusiveFluxIntegral
    variable = v
    diffusivity = 1
    boundary = 'left'
  []
[]
(modules/subchannel/examples/duct/wrapper.i)
# a wrapper mesh for coupling to subchannel
# sqrt(3) / 2 is by how much flat to flat is smaller than corer to corner
f = '${fparse sqrt(3) / 2}'
# units are meters
height = 1.0
duct_inside = 0.085
wrapper_thickness = 0.002
duct_outside = '${fparse duct_inside + 2 * wrapper_thickness}'
# number of radial elements in the wrapper
n_radial = 4
# number of azimuthal elements per side
n_az = 4
# number of axial elements
n_ax = 10
# System variables
T_in = 660
[DefaultElementQuality]
  failure_type = warning
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  [bisonMesh]
    type = PolygonConcentricCircleMeshGenerator
    num_sides = 6
    num_sectors_per_side = '${n_az} ${n_az} ${n_az} ${n_az} ${n_az} ${n_az}'
    background_intervals = 1
    background_block_ids = '1'
    # note that polygon_size is "like radius"
    polygon_size = '${fparse duct_outside / 2}'
    duct_sizes = '${fparse duct_inside / 2 / f}'
    duct_intervals = '${n_radial}'
    duct_block_ids = '2'
    # interface_boundary_names = 'inside'
    external_boundary_name = 'outside'
  []
  [extrude]
    type = AdvancedExtruderGenerator
    # type = FancyExtruderGenerator
    direction = '0 0 1'
    input = bisonMesh
    heights = '${height}'
    num_layers = '${n_ax}'
  []
  [inlet_boundary]
    type = ParsedGenerateSideset
    input = extrude
    combinatorial_geometry = 'z < 1e-6'
    normal = '0 0 -1'
    new_sideset_name = 'inlet'
  []
  [outlet_boundary]
    type = ParsedGenerateSideset
    input = inlet_boundary
    combinatorial_geometry = 'z > ${fparse height - 1e-6}'
    normal = '0 0 1'
    new_sideset_name = 'outlet'
  []
  [inside_boundary]
    type = SideSetsBetweenSubdomainsGenerator
    primary_block = 2
    paired_block = 1
    new_boundary = 'inside'
    input = outlet_boundary
  []
  [remove]
    type = BlockDeletionGenerator
    block = 1
    input = inside_boundary
  []
  [rename]
    type = RenameBlockGenerator
    input = remove
    old_block = '2'
    new_block = 'wrapper'
  []
  [rotate]
    type = TransformGenerator
    input = rename
    transform = ROTATE
    vector_value = '30 0 0'
  []
  coord_type = XYZ
[]
[Functions]
  [volumetric_heat_rate]
    type = ParsedFunction
    expression = '1.0*H'
    symbol_names = 'H'
    symbol_values = '${height}'
  []
[]
[Variables]
  [temperature]
    order = FIRST
    family = LAGRANGE
  []
[]
[Modules]
  [TensorMechanics]
    [Master]
      add_variables = true
      strain = SMALL
      incremental = true
      generate_output = 'stress_xx stress_yy stress_xy'
      temperature = temperature
      [block0]
        eigenstrain_names = eigenstrain
        block = wrapper
      []
    []
  []
[]
[Kernels]
  [heat_conduction]
    type = HeatConduction
    variable = temperature
  []
  [heat_source]
    type = HeatSource
    variable = temperature
    function = volumetric_heat_rate
  []
[]
[AuxVariables]
  [q_prime]
    order = CONSTANT
    family = MONOMIAL
  []
  [duct_surface_temperature]
  []
  [disp_magnitude]
  []
[]
[AuxKernels]
  [QPrime]
    type = SCMTriDuctQPrimeAux
    diffusivity = 'thermal_conductivity'
    flat_to_flat = '${fparse duct_inside}'
    variable = q_prime
    diffusion_variable = temperature
    component = normal
    boundary = 'inside'
    execute_on = 'timestep_end'
  []
  [Deformation]
    type = ParsedAux
    variable = disp_magnitude
    coupled_variables = 'disp_x disp_y disp_z'
    expression = 'sqrt(disp_x^2 + disp_y^2 + disp_z^2)'
    execute_on = 'timestep_end'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    block = wrapper
    bulk_modulus = 0.333333333333e6
    poissons_ratio = 0.0
  []
  [thermal_strain]
    type = ComputeThermalExpansionEigenstrain
    block = wrapper
    temperature = temperature
    stress_free_temperature = ${T_in}
    thermal_expansion_coeff = 1e-5
    eigenstrain_name = eigenstrain
  []
  [stress]
    type = ComputeStrainIncrementBasedStress
    block = wrapper
  []
  [heat_conductor]
    type = HeatConductionMaterial
    thermal_conductivity = 1.0
    block = wrapper
  []
  [density]
    type = Density
    block = wrapper
    density = 1.0
  []
[]
[BCs]
  [isolated_bc]
    type = NeumannBC
    variable = temperature
    boundary = 'inlet outlet'
  []
  [inside_bc]
    type = MatchedValueBC
    variable = temperature
    boundary = 'inside'
    v = duct_surface_temperature
  []
  [outside_bc]
    type = DirichletBC
    variable = temperature
    boundary = 'outside'
    value = '${fparse T_in+10}'
  []
  [no_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'inlet outlet'
    value = 0.0
  []
  [no_y]
    type = DirichletBC
    variable = disp_y
    boundary = 'inlet outlet'
    value = 0.0
  []
  [no_z]
    type = DirichletBC
    variable = disp_z
    boundary = 'inlet'
    value = 0.0
  []
[]
[ICs]
  [temperature_ic]
    type = ConstantIC
    variable = temperature
    value = ${T_in}
  []
  [q_prime_ic]
    type = ConstantIC
    variable = q_prime
    value = 0.0
  []
[]
[UserObjects]
  [q_prime_uo]
    type = LayeredSideAverage
    boundary = 'inside'
    variable = q_prime
    num_layers = 1000
    direction = z
    execute_on = 'TIMESTEP_END'
  []
[]
[Executioner]
  type = Steady
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu superlu_dist'
  [Quadrature]
    order = THIRD
    side_order = FOURTH
  []
[]
[Outputs]
  exodus = true
[]
(test/tests/bcs/matched_value_bc/matched_value_bc_test.i)
[Mesh]
  [./square]
    type = GeneratedMeshGenerator
    nx = 2
    ny = 2
    dim = 2
  [../]
[]
# Solves a pair of coupled diffusion equations where u=v on the boundary
[Variables]
  active = 'u v'
  [./u]
    order = FIRST
    family = LAGRANGE
    initial_condition = 3
  [../]
  [./v]
    order = FIRST
    family = LAGRANGE
    initial_condition = 2
  [../]
[]
[Kernels]
  active = 'diff_u diff_v'
  [./diff_u]
    type = Diffusion
    variable = u
  [../]
  [./diff_v]
    type = Diffusion
    variable = v
  [../]
[]
[BCs]
  active = 'right_v left_u'
  [./right_v]
    type = DirichletBC
    variable = v
    boundary = 1
    value = 3
  [../]
  [./left_u]
    type = MatchedValueBC
    variable = u
    boundary = 3
    v = v
  [../]
[]
[Preconditioning]
  [./precond]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -pc_hypre_type'
  petsc_options_value = 'hypre boomeramg'
  nl_rel_tol = 1e-10
  l_tol = 1e-12
[]
[Outputs]
  file_base = out
  exodus = true
[]
(modules/combined/examples/geochem-porous_flow/geotes_2D/porous_flow.i)
# PorousFlow simulation of injection and production in a 2D aquifer
# Much of this file is standard porous-flow stuff.  The unusual aspects are:
# - transfer of the rates of changes of each species (kg/s) to the aquifer_geochemistry.i simulation.  This is achieved by saving these changes from the PorousFlowMassTimeDerivative residuals
# - transfer of the temperature field to the aquifer_geochemistry.i simulation
# Interesting behaviour can be simulated by this file without its "parent" simulation, exchanger.i.  exchanger.i provides mass-fractions injected via the injection_rate_massfrac_* variables, but since these are more-or-less constant throughout the duration of the exchanger.i simulation, the initial_conditions specified below may be used.  Similar, exchanger.i provides injection_temperature, but that is also constant.
injection_rate = -1.0 # kg/s/m, negative because injection as a source
production_rate = 1.0 # kg/s/m
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 14 # for better resolution, use 56 or 112
    ny = 8  # for better resolution, use 32 or 64
    xmin = -70
    xmax = 70
    ymin = -40
    ymax = 40
  []
  [injection_node]
    input = gen
    type = ExtraNodesetGenerator
    new_boundary = injection_node
    coord = '-30 0 0'
  []
[]
[GlobalParams]
  PorousFlowDictator = dictator
  gravity = '0 0 0'
[]
[Variables]
  [f0]
    initial_condition = 0.002285946
  []
  [f1]
    initial_condition = 0.0035252
  []
  [f2]
    initial_condition = 1.3741E-05
  []
  [porepressure]
    initial_condition = 2E6
  []
  [temperature]
    initial_condition = 50
    scaling = 1E-6 # fluid enthalpy is roughly 1E6
  []
[]
[BCs]
  [injection_temperature]
    type = MatchedValueBC
    variable = temperature
    v = injection_temperature
    boundary = injection_node
  []
[]
[DiracKernels]
  [inject_Na]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    line_length = 1.0
    multiplying_var = injection_rate_massfrac_Na
    point_file = injection.bh
    variable = f0
  []
  [inject_Cl]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    line_length = 1.0
    multiplying_var = injection_rate_massfrac_Cl
    point_file = injection.bh
    variable = f1
  []
  [inject_SiO2]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    line_length = 1.0
    multiplying_var = injection_rate_massfrac_SiO2
    point_file = injection.bh
    variable = f2
  []
  [inject_H2O]
    type = PorousFlowPolyLineSink
    SumQuantityUO = injected_mass
    fluxes = ${injection_rate}
    p_or_t_vals = 0.0
    line_length = 1.0
    multiplying_var = injection_rate_massfrac_H2O
    point_file = injection.bh
    variable = porepressure
  []
  [produce_Na]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_Na
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    line_length = 1.0
    mass_fraction_component = 0
    point_file = production.bh
    variable = f0
  []
  [produce_Cl]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_Cl
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    line_length = 1.0
    mass_fraction_component = 1
    point_file = production.bh
    variable = f1
  []
  [produce_SiO2]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_SiO2
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    line_length = 1.0
    mass_fraction_component = 2
    point_file = production.bh
    variable = f2
  []
  [produce_H2O]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_mass_H2O
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    line_length = 1.0
    mass_fraction_component = 3
    point_file = production.bh
    variable = porepressure
  []
  [produce_heat]
    type = PorousFlowPolyLineSink
    SumQuantityUO = produced_heat
    fluxes = ${production_rate}
    p_or_t_vals = 0.0
    line_length = 1.0
    use_enthalpy = true
    point_file = production.bh
    variable = temperature
  []
[]
[UserObjects]
  [injected_mass]
    type = PorousFlowSumQuantity
  []
  [produced_mass_Na]
    type = PorousFlowSumQuantity
  []
  [produced_mass_Cl]
    type = PorousFlowSumQuantity
  []
  [produced_mass_SiO2]
    type = PorousFlowSumQuantity
  []
  [produced_mass_H2O]
    type = PorousFlowSumQuantity
  []
  [produced_heat]
    type = PorousFlowSumQuantity
  []
[]
[Postprocessors]
  [dt]
    type = TimestepSize
    execute_on = TIMESTEP_BEGIN
  []
  [tot_kg_injected_this_timestep]
    type = PorousFlowPlotQuantity
    uo = injected_mass
  []
  [kg_Na_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_Na
  []
  [kg_Cl_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_Cl
  []
  [kg_SiO2_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_SiO2
  []
  [kg_H2O_produced_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_mass_H2O
  []
  [mole_rate_Na_produced]
    type = FunctionValuePostprocessor
    function = moles_Na
    indirect_dependencies = 'kg_Na_produced_this_timestep dt'
  []
  [mole_rate_Cl_produced]
    type = FunctionValuePostprocessor
    function = moles_Cl
    indirect_dependencies = 'kg_Cl_produced_this_timestep dt'
  []
  [mole_rate_SiO2_produced]
    type = FunctionValuePostprocessor
    function = moles_SiO2
    indirect_dependencies = 'kg_SiO2_produced_this_timestep dt'
  []
  [mole_rate_H2O_produced]
    type = FunctionValuePostprocessor
    function = moles_H2O
    indirect_dependencies = 'kg_H2O_produced_this_timestep dt'
  []
  [heat_joules_extracted_this_timestep]
    type = PorousFlowPlotQuantity
    uo = produced_heat
  []
  [production_temperature]
    type = PointValue
    point = '30 0 0'
    variable = temperature
  []
[]
[Functions]
  [moles_Na]
    type = ParsedFunction
    symbol_names = 'kg_Na dt'
    symbol_values = 'kg_Na_produced_this_timestep dt'
    expression = 'kg_Na * 1000 / 22.9898 / dt'
  []
  [moles_Cl]
    type = ParsedFunction
    symbol_names = 'kg_Cl dt'
    symbol_values = 'kg_Cl_produced_this_timestep dt'
    expression = 'kg_Cl * 1000 / 35.453 / dt'
  []
  [moles_SiO2]
    type = ParsedFunction
    symbol_names = 'kg_SiO2 dt'
    symbol_values = 'kg_SiO2_produced_this_timestep dt'
    expression = 'kg_SiO2 * 1000 / 60.0843 / dt'
  []
  [moles_H2O]
    type = ParsedFunction
    symbol_names = 'kg_H2O dt'
    symbol_values = 'kg_H2O_produced_this_timestep dt'
    expression = 'kg_H2O * 1000 / 18.0152 / dt'
  []
[]
[FluidProperties]
  [the_simple_fluid]
    type = SimpleFluidProperties
    thermal_expansion = 0
    bulk_modulus = 2E9
    viscosity = 1E-3
    density0 = 1000
    cv = 4000.0
    cp = 4000.0
  []
[]
[PorousFlowFullySaturated]
  coupling_type = ThermoHydro
  porepressure = porepressure
  temperature = temperature
  mass_fraction_vars = 'f0 f1 f2'
  save_component_rate_in = 'rate_Na rate_Cl rate_SiO2 rate_H2O' # change in kg at every node / dt
  fp = the_simple_fluid
  temperature_unit = Celsius
[]
[AuxVariables]
  [injection_temperature]
    initial_condition = 200
  []
  [injection_rate_massfrac_Na]
    initial_condition = 0.002285946
  []
  [injection_rate_massfrac_Cl]
    initial_condition = 0.0035252
  []
  [injection_rate_massfrac_SiO2]
    initial_condition = 1.3741E-05
  []
  [injection_rate_massfrac_H2O]
    initial_condition = 0.994175112
  []
  [rate_H2O]
  []
  [rate_Na]
  []
  [rate_Cl]
  []
  [rate_SiO2]
  []
[]
[Materials]
  [porosity]
    type = PorousFlowPorosityConst # this simulation has no porosity changes from dissolution
    porosity = 0.1
  []
  [permeability]
    type = PorousFlowPermeabilityConst
    permeability = '1E-12 0 0   0 1E-12 0   0 0 1E-12'
  []
  [thermal_conductivity]
    type = PorousFlowThermalConductivityIdeal
    dry_thermal_conductivity = '0 0 0  0 0 0  0 0 0'
  []
  [rock_heat]
    type = PorousFlowMatrixInternalEnergy
    density = 2500.0
    specific_heat_capacity = 1200.0
  []
[]
[Preconditioning]
  active = typically_efficient
  [typically_efficient]
    type = SMP
    full = true
    petsc_options_iname = '-pc_type -pc_hypre_type'
    petsc_options_value = ' hypre    boomeramg'
  []
  [strong]
    type = SMP
    full = true
    petsc_options = '-ksp_diagonal_scale -ksp_diagonal_scale_fix'
    petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
    petsc_options_value = ' asm      ilu           NONZERO                   2'
  []
  [probably_too_strong]
    type = SMP
    full = true
    petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
    petsc_options_value = ' lu       mumps'
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  end_time = 7.76E6 # 90 days
  dt = 1E5
[]
[Outputs]
  exodus = true
[]
[MultiApps]
  [react]
    type = TransientMultiApp
    input_files = aquifer_geochemistry.i
    clone_master_mesh = true
    execute_on = 'timestep_end'
  []
[]
[Transfers]
  [changes_due_to_flow]
    type = MultiAppCopyTransfer
    source_variable = 'rate_H2O rate_Na rate_Cl rate_SiO2 temperature'
    variable = 'pf_rate_H2O pf_rate_Na pf_rate_Cl pf_rate_SiO2 temperature'
    to_multi_app = react
  []
  [massfrac_from_geochem]
    type = MultiAppCopyTransfer
    source_variable = 'massfrac_Na massfrac_Cl massfrac_SiO2'
    variable = 'f0 f1 f2'
    from_multi_app = react
  []
[]
(test/tests/interfacekernels/hybrid/interface.i)
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 40
    xmax = 2
    ny = 40
    ymax = 2
  []
  [subdomain1]
    input = gen
    type = SubdomainBoundingBoxGenerator
    bottom_left = '0.5 0.5 0'
    top_right = '1.5 1.5 0'
    block_id = 1
  []
  [interface]
    type = SideSetsBetweenSubdomainsGenerator
    input = subdomain1
    primary_block = '1'
    paired_block = '0'
    new_boundary = 'primary1_interface'
  []
[]
[Variables]
  [u]
    block = 0
  []
  [v]
    block = 1
  []
[]
[Kernels]
  [diff_u]
    type = MatDiffusion
    variable = u
    diffusivity = D
    block = 0
  []
  [diff_v]
    type = MatDiffusion
    variable = v
    diffusivity = D
    block = 1
  []
  [source_u]
    type = BodyForce
    variable = u
    value = 1
    block = 0
  []
  [source_v]
    type = BodyForce
    variable = v
    value = 1
    block = 1
  []
[]
[BCs]
  [u]
    type = VacuumBC
    variable = u
    boundary = 'left bottom right top'
  []
  [interface_bc]
    type = ADMatchedValueBC
    variable = v
    v = u
    boundary = primary1_interface
  []
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Steady
  solve_type = NEWTON
[]
[Outputs]
  exodus = true
  print_linear_residuals = true
[]
[InterfaceKernels]
  active = 'diffusion'
  [./diffusion]
    type = InterfaceDiffusion
    variable = v
    neighbor_var = u
    boundary = primary1_interface
    D = 'D'
    D_neighbor = 'D'
  [../]
  [./penalty]
    type = PenaltyInterfaceDiffusion
    variable = v
    neighbor_var = u
    boundary = primary1_interface
    penalty = 1e3
  [../]
[]
[Materials]
  [mat0]
    type = GenericConstantMaterial
    prop_names = 'D'
    prop_values = '1'
    block = 0
  []
  [mat1]
    type = GenericConstantMaterial
    prop_names = 'D'
    prop_values = '1'
    block = 1
  []
[]
[AuxVariables]
  [c][]
[]
[AuxKernels]
  [u]
    type = ParsedAux
    variable = c
    coupled_variables = 'u'
    expression = 'u'
    block = 0
  []
  [v]
    type = ParsedAux
    variable = c
    coupled_variables = 'v'
    expression = 'v'
    block = 1
  []
[]
(modules/subchannel/test/tests/problems/coupling/sub.i)
pin_diameter = 0.012065
heated_length = 1.0
[Mesh]
  second_order = true
  [myMesh]
    type = GeneratedMeshGenerator
    dim = 2
    xmax = 0.0060325 # pin diameter / 2.0
    bias_x = 1.0
    nx = 20
    ymax = 1.0 # heated length
    ny = 10 # number of axial cells
  []
  coord_type = RZ
  rz_coord_axis = Y
  beta_rotation = 90
[]
[Functions]
  [volumetric_heat_rate] # Defined such as to be consistent with the IC in SCM
      type = ParsedFunction
      expression = '(4.0 * 1000 / (pi * D * D * L)) * (pi/2)*sin(pi*y/L)'
      symbol_names = 'L D'
      symbol_values = '${heated_length} ${pin_diameter}'
  []
[]
[Variables]
  [temperature]
    order = SECOND
    family = LAGRANGE
  []
[]
[AuxVariables]
  [Pin_surface_temperature]
  []
  [q_prime]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [QPrime]
    type = SCMRZPinQPrimeAux
    diffusivity = 'thermal_conductivity'
    variable = q_prime
    diffusion_variable = temperature
    component = normal
    boundary = 'right'
    execute_on = 'timestep_end'
  []
[]
[Kernels]
  [heat_conduction]
    type = HeatConduction
    variable = temperature
  []
  [heat_source]
    type = HeatSource
    variable = temperature
    function = volumetric_heat_rate
  []
[]
[Materials]
  [heat_conductor]
    type = HeatConductionMaterial
    thermal_conductivity = 1.0
    block = 0
  []
[]
[BCs]
  [left]
    type = NeumannBC
    variable = temperature
    boundary = 'left'
  []
  [right]
    type = MatchedValueBC
    variable = temperature
    boundary = 'right'
    v = Pin_surface_temperature
  []
[]
[VectorPostprocessors]
  # These samplers are used for testing purposes.
  [sample_center_line]
    type = LineValueSampler
    variable = 'temperature'
    sort_by = 'y'
    num_points = 11
    start_point = '0 0 0'
    end_point = '0 1.0 0'
  []
[]
[Executioner]
  type = Steady
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu superlu_dist'
[]
[Outputs]
  exodus = true
  csv = true
[]
(test/tests/bcs/ad_matched_value_bc/test.i)
[Problem]
  use_hash_table_matrix_assembly = true
[]
[Mesh]
  [square]
    type = GeneratedMeshGenerator
    nx = 2
    ny = 2
    dim = 2
  []
[]
# Solves a pair of coupled diffusion equations where u=v on the boundary
[Variables]
  [u]
    order = FIRST
    family = LAGRANGE
    initial_condition = 3
  []
  [v]
    order = FIRST
    family = LAGRANGE
    initial_condition = 2
  []
[]
[Kernels]
  [diff_u]
    type = ADDiffusion
    variable = u
  []
  [diff_v]
    type = ADDiffusion
    variable = v
  []
[]
[BCs]
  [right_v]
    type = ADDirichletBC
    variable = v
    boundary = 1
    value = 3
  []
  [left_u]
    type = ADMatchedValueBC
    variable = u
    boundary = 3
    v = v
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  nl_rel_tol = 1e-10
  l_tol = 1e-12
[]
[Outputs]
  file_base = out
  exodus = true
[]
(test/tests/interfacekernels/1d_interface/coupled_value_coupled_flux.i)
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 1
    nx = 10
    xmax = 2
  []
  [./subdomain1]
    input = gen
    type = SubdomainBoundingBoxGenerator
    bottom_left = '1.0 0 0'
    block_id = 1
    top_right = '2.0 1.0 0'
  [../]
  [./interface]
    input = subdomain1
    type = SideSetsBetweenSubdomainsGenerator
    primary_block = '0'
    paired_block = '1'
    new_boundary = 'primary0_interface'
  [../]
[]
[Variables]
  [./u]
    order = FIRST
    family = LAGRANGE
    block = '0'
  [../]
  [./v]
    order = FIRST
    family = LAGRANGE
    block = '1'
  [../]
[]
[Kernels]
  [./diff_u]
    type = CoeffParamDiffusion
    variable = u
    D = 4
    block = 0
  [../]
  [./diff_v]
    type = CoeffParamDiffusion
    variable = v
    D = 2
    block = 1
  [../]
[]
[InterfaceKernels]
  active = 'interface'
  [./interface]
    type = InterfaceDiffusion
    variable = u
    neighbor_var = v
    boundary = primary0_interface
    D = 'D'
    D_neighbor = 'D'
  [../]
  [./penalty_interface]
    type = PenaltyInterfaceDiffusion
    variable = u
    neighbor_var = v
    boundary = primary0_interface
    penalty = 1e6
  [../]
[]
[BCs]
  active = 'left right middle'
  [./left]
    type = DirichletBC
    variable = u
    boundary = 'left'
    value = 1
  [../]
  [./right]
    type = DirichletBC
    variable = v
    boundary = 'right'
    value = 0
  [../]
  [./middle]
    type = MatchedValueBC
    variable = v
    boundary = 'primary0_interface'
    v = u
  [../]
[]
[Materials]
  [./stateful]
    type = StatefulMaterial
    initial_diffusivity = 1
    boundary = primary0_interface
  [../]
  [./block0]
    type = GenericConstantMaterial
    block = '0'
    prop_names = 'D'
    prop_values = '4'
  [../]
  [./block1]
    type = GenericConstantMaterial
    block = '1'
    prop_names = 'D'
    prop_values = '2'
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Steady
  solve_type = NEWTON
[]
[Outputs]
  exodus = true
  print_linear_residuals = true
[]
[Debug]
  show_var_residual_norms = true
[]