- boundaryThe list of boundary IDs from the mesh where this object appliesC++ Type:std::vector<BoundaryName> Controllable:No Description:The list of boundary IDs from the mesh where this object applies 
- momentum_componentThe component of the momentum equation that this kernel applies to.C++ Type:MooseEnum Controllable:No Description:The component of the momentum equation that this kernel applies to. 
- rhie_chow_user_objectThe rhie-chow user-objectC++ Type:UserObjectName Controllable:No Description:The rhie-chow user-object 
- variableThe name of the variable that this boundary condition applies toC++ Type:NonlinearVariableName Unit:(no unit assumed) Controllable:No Description:The name of the variable that this boundary condition applies to 
INSFVNaturalFreeSlipBC
This object implements a free slip boundary condition. It should be applied to each velocity component. This BC operates very simply by setting the total momentum boundary flux, e.g. the sum of advective and viscous fluxes, to zero.
Input Parameters
- displacementsThe displacementsC++ 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) 
Optional Parameters
- absolute_value_vector_tagsThe tags for the vectors this residual object should fill with the absolute value of the residual contributionC++ 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 fillC++ 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 fillC++ Type:std::vector<TagName> Controllable:No Description:The extra tags for the vectors this Kernel should fill 
- matrix_tagssystemThe tag for the matrices this Kernel should fillDefault:system C++ Type:MultiMooseEnum Options:nontime, system Controllable:No Description:The tag for the matrices this Kernel should fill 
- vector_tagsnontimeThe tag for the vectors this Kernel should fillDefault:nontime C++ Type:MultiMooseEnum Options:nontime, time Controllable:No Description:The tag 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 formDefault: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). 
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.Default:False C++ Type:bool Controllable:No Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used. 
Advanced Parameters
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.C++ Type:MaterialPropertyName Unit:(no unit assumed) Controllable:No Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character. 
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.Default:False C++ Type:bool Controllable:No Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction. 
Material Property Retrieval Parameters
Input Files
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/2d-rc.i)
- (modules/navier_stokes/test/tests/finite_volume/controls/switch-pressure-bc/test.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/2d-rc-rz-by-parts.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/hydraulic-separators/separator-scalar.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/lid-driven/rz-gravity-quiescent-fluid.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/2d-rc-epsjump.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/cylindrical/diverging.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/2d-rc-friction.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/segregated/2d-momentum.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/one-elem-wide-channel.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/2d-rc.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/cylindrical/no-slip-tris.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_reversal.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/variables/caching/3d-rc.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/cylindrical/2d-rc-slip.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/hydraulic-separators/separator-energy-nonorthogonal.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/bernoulli-2d.i)
- (modules/navier_stokes/test/tests/finite_volume/materials/ergun/ergun.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/hydraulic-separators/separator-no-jump.i)
- (modules/navier_stokes/test/tests/postprocessors/flow_rates/conservation_PINSFV.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/segregated/2d/2d-segregated-velocity-rz-slip.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/hydraulic-separators/separator-jump.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/3d-rc.i)
- (modules/navier_stokes/test/tests/postprocessors/flow_rates/conservation_INSFV.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/hydraulic-separators/separator-mixing.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/hydraulic-separators/separator-energy.i)
Child Objects
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/2d-rc.i)
mu = 1.1
rho = 1.1
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 5
    ymin = 0
    ymax = 1
    nx = 20
    ny = 10
  []
[]
[GlobalParams]
  advected_interp_method = 'average'
  velocity_interp_method = 'rc'
  rhie_chow_user_object = 'rc'
[]
[UserObjects]
  [rc]
    type = PINSFVRhieChowInterpolator
    u = superficial_vel_x
    v = superficial_vel_y
    pressure = pressure
    porosity = porosity
  []
[]
[Variables]
  inactive = 'lambda'
  [superficial_vel_x]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = 1
  []
  [superficial_vel_y]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = 1e-6
  []
  [pressure]
    type = INSFVPressureVariable
  []
  [lambda]
    family = SCALAR
    order = FIRST
  []
[]
[AuxVariables]
  [porosity]
    family = MONOMIAL
    order = CONSTANT
    fv = true
    initial_condition = 0.5
  []
[]
[FVKernels]
  inactive = 'mean-pressure'
  [mass]
    type = PINSFVMassAdvection
    variable = pressure
    rho = ${rho}
  []
  [u_advection]
    type = PINSFVMomentumAdvection
    variable = superficial_vel_x
    rho = ${rho}
    porosity = porosity
    momentum_component = 'x'
  []
  [u_viscosity]
    type = PINSFVMomentumDiffusion
    variable = superficial_vel_x
    mu = ${mu}
    porosity = porosity
    momentum_component = 'x'
  []
  [u_pressure]
    type = PINSFVMomentumPressure
    variable = superficial_vel_x
    momentum_component = 'x'
    pressure = pressure
    porosity = porosity
  []
  [v_advection]
    type = PINSFVMomentumAdvection
    variable = superficial_vel_y
    rho = ${rho}
    porosity = porosity
    momentum_component = 'y'
  []
  [v_viscosity]
    type = PINSFVMomentumDiffusion
    variable = superficial_vel_y
    mu = ${mu}
    porosity = porosity
    momentum_component = 'y'
  []
  [v_pressure]
    type = PINSFVMomentumPressure
    variable = superficial_vel_y
    momentum_component = 'y'
    pressure = pressure
    porosity = porosity
  []
  [mean-pressure]
    type = FVIntegralValueConstraint
    variable = pressure
    lambda = lambda
    phi0 = 0.01
  []
[]
[FVBCs]
  # Select desired boundary conditions
  active = 'inlet-u inlet-v outlet-p free-slip-u free-slip-v'
  # Possible inlet boundary conditions
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = superficial_vel_x
    functor = '1'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = superficial_vel_y
    functor = 0
  []
  [inlet-p]
    type = INSFVOutletPressureBC
    boundary = 'left'
    variable = pressure
    function = 1
  []
  # Possible wall boundary conditions
  [free-slip-u]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top bottom'
    variable = superficial_vel_x
    momentum_component = 'x'
  []
  [free-slip-v]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top bottom'
    variable = superficial_vel_y
    momentum_component = 'y'
  []
  [no-slip-u]
    type = INSFVNoSlipWallBC
    boundary = 'top bottom'
    variable = superficial_vel_x
    function = 0
  []
  [no-slip-v]
    type = INSFVNoSlipWallBC
    boundary = 'top bottom'
    variable = superficial_vel_y
    function = 0
  []
  [symmetry-u]
    type = PINSFVSymmetryVelocityBC
    boundary = 'bottom'
    variable = superficial_vel_x
    u = superficial_vel_x
    v = superficial_vel_y
    mu = ${mu}
    momentum_component = 'x'
  []
  [symmetry-v]
    type = PINSFVSymmetryVelocityBC
    boundary = 'bottom'
    variable = superficial_vel_y
    u = superficial_vel_x
    v = superficial_vel_y
    mu = ${mu}
    momentum_component = 'y'
  []
  [symmetry-p]
    type = INSFVSymmetryPressureBC
    boundary = 'bottom'
    variable = pressure
  []
  # Possible outlet boundary conditions
  [outlet-p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = 0
  []
  [outlet-p-novalue]
    type = INSFVMassAdvectionOutflowBC
    boundary = 'right'
    variable = pressure
    u = superficial_vel_x
    v = superficial_vel_y
    rho = ${rho}
  []
  [outlet-u]
    type = PINSFVMomentumAdvectionOutflowBC
    boundary = 'right'
    variable = superficial_vel_x
    u = superficial_vel_x
    v = superficial_vel_y
    porosity = porosity
    momentum_component = 'x'
    rho = ${rho}
  []
  [outlet-v]
    type = PINSFVMomentumAdvectionOutflowBC
    boundary = 'right'
    variable = superficial_vel_y
    u = superficial_vel_x
    v = superficial_vel_y
    porosity = porosity
    momentum_component = 'y'
    rho = ${rho}
  []
[]
[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      300                lu           NONZERO'
  line_search = 'none'
  nl_rel_tol = 1e-11
  nl_abs_tol = 1e-14
[]
# Some basic Postprocessors to visually examine the solution
[Postprocessors]
  [inlet-p]
    type = SideIntegralVariablePostprocessor
    variable = pressure
    boundary = 'left'
  []
  [outlet-u]
    type = SideIntegralVariablePostprocessor
    variable = superficial_vel_x
    boundary = 'right'
  []
[]
[Outputs]
  exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/controls/switch-pressure-bc/test.i)
rho = 1
mu = 1
l = 1
velocity_interp_method = 'rc'
advected_interp_method = 'upwind'
outlet_pressure = 1e5
inlet_v = 1
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = ${l}
    ymin = 0
    ymax = 1
    nx = 4
    ny = 2
  []
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = vel_x
    v = vel_y
    pressure = pressure
  []
[]
[Variables]
  [vel_x]
    type = INSFVVelocityVariable
    initial_condition = ${inlet_v}
  []
  [vel_y]
    type = INSFVVelocityVariable
  []
  [pressure]
    type = INSFVPressureVariable
    initial_condition = ${outlet_pressure}
  []
[]
[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
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = ${advected_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
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = ${advected_interp_method}
    rho = ${rho}
    momentum_component = 'y'
  []
  [v_viscosity]
    type = INSFVMomentumDiffusion
    variable = vel_y
    momentum_component = 'y'
    mu = ${mu}
  []
  [v_pressure]
    type = INSFVMomentumPressure
    variable = vel_y
    momentum_component = 'y'
    pressure = pressure
  []
[]
[FVBCs]
  [free_slip_x]
    type = INSFVNaturalFreeSlipBC
    variable = vel_x
    boundary = 'top bottom'
    momentum_component = 'x'
  []
  [free_slip_y]
    type = INSFVNaturalFreeSlipBC
    variable = vel_y
    boundary = 'top bottom'
    momentum_component = 'y'
  []
  # Inlet
  [inlet_u]
    type = INSFVInletVelocityBC
    variable = vel_x
    boundary = 'left'
    functor = ${inlet_v}
  []
  [inlet_u_later]
    type = INSFVInletVelocityBC
    variable = vel_x
    boundary = 'right'
    functor = ${fparse -1 * inlet_v}
    enable = false
  []
  [inlet_v]
    type = INSFVInletVelocityBC
    variable = vel_y
    boundary = 'left'
    functor = 0
  []
  [inlet_v_later]
    type = INSFVInletVelocityBC
    variable = vel_y
    boundary = 'right'
    functor = 0
    enable = false
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    variable = pressure
    boundary = 'right'
    function = ${outlet_pressure}
  []
  [outlet_p_later]
    type = INSFVOutletPressureBC
    variable = pressure
    boundary = 'left'
    function = ${fparse 2 * outlet_pressure}
    enable = false
  []
[]
[Functions]
  [conditional_function]
    type = ParsedFunction
    expression = 't > 1.5'
  []
[]
[Controls]
  [p_threshold]
    type = ConditionalFunctionEnableControl
    conditional_function = conditional_function
    disable_objects = 'FVBCs::outlet_p FVBCs::inlet_u FVBCs::inlet_v'
    enable_objects = 'FVBCs::outlet_p_later FVBCs::inlet_u_later FVBCs::inlet_v_later'
    execute_on = 'INITIAL TIMESTEP_BEGIN'
  []
[]
[FunctorMaterials]
  [const_functor]
    type = ADGenericFunctorMaterial
    prop_names = 'rho mu'
    prop_values = '${rho} ${mu}'
  []
[]
[Postprocessors]
  [pressure_right]
    type = SideAverageValue
    variable = pressure
    boundary = right
  []
  [pressure_left]
    type = SideAverageValue
    variable = pressure
    boundary = right
  []
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -pc_factor_shift_type'
  petsc_options_value = 'lu       NONZERO'
  end_time = 3
  line_search = 'bt'
  nl_abs_tol = 1e-8
  abort_on_solve_fail = true
[]
[Outputs]
  csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/2d-rc-rz-by-parts.i)
mu = 1.1
rho = 1
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 5
    ymin = 0
    ymax = 1
    nx = 40
    ny = 10
  []
  coord_type = 'RZ'
  rz_coord_axis = 'X'
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
[]
[UserObjects]
  [rc]
    type = PINSFVRhieChowInterpolator
    u = u
    v = v
    pressure = pressure
    porosity = porosity
  []
[]
[Variables]
  [u]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = 1
  []
  [v]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = 1e-6
  []
  [pressure]
    type = INSFVPressureVariable
  []
[]
[AuxVariables]
  [porosity]
    family = MONOMIAL
    order = CONSTANT
    fv = true
    initial_condition = 0.5
  []
[]
[FVKernels]
  inactive = 'v_pressure_volumetric'
  [mass]
    type = PINSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
  []
  [u_advection]
    type = PINSFVMomentumAdvection
    variable = u
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    porosity = porosity
    momentum_component = 'x'
  []
  [u_viscosity]
    type = PINSFVMomentumDiffusion
    variable = u
    mu = ${mu}
    porosity = porosity
    momentum_component = 'x'
  []
  [u_pressure]
    type = PINSFVMomentumPressureFlux
    variable = u
    momentum_component = 'x'
    pressure = pressure
    porosity = porosity
  []
  [u_friction]
    type = PINSFVMomentumFriction
    variable = u
    momentum_component = 'x'
    Darcy_name = 'Darcy_coefficient'
    Forchheimer_name = 'Forchheimer_coefficient'
    rho = ${rho}
    speed = speed
    mu = ${mu}
  []
  [v_advection]
    type = PINSFVMomentumAdvection
    variable = v
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    porosity = porosity
    momentum_component = 'y'
  []
  [v_viscosity]
    type = PINSFVMomentumDiffusion
    variable = v
    mu = ${mu}
    porosity = porosity
    momentum_component = 'y'
  []
  [v_pressure_volumetric]
    type = PINSFVMomentumPressure
    variable = v
    momentum_component = 'y'
    pressure = pressure
    porosity = porosity
  []
  [v_pressure_by_parts_flux]
    type = PINSFVMomentumPressureFlux
    variable = v
    momentum_component = 'y'
    pressure = pressure
    porosity = porosity
  []
  [v_pressure_by_parts_volume_term]
    type = PNSFVMomentumPressureFluxRZ
    variable = v
    pressure = pressure
    porosity = porosity
    momentum_component = 'y'
  []
  [v_friction]
    type = PINSFVMomentumFriction
    variable = v
    momentum_component = 'y'
    Darcy_name = 'Darcy_coefficient'
    Forchheimer_name = 'Forchheimer_coefficient'
    rho = ${rho}
    speed = speed
    mu = ${mu}
  []
[]
[FVBCs]
  inactive = 'free-slip-u free-slip-v'
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = u
    functor = '1'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = v
    functor = 0
  []
  [no-slip-u]
    type = INSFVNoSlipWallBC
    boundary = 'top'
    variable = u
    function = 0
  []
  [no-slip-v]
    type = INSFVNoSlipWallBC
    boundary = 'top'
    variable = v
    function = 0
  []
  [free-slip-u]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top'
    variable = u
    momentum_component = 'x'
  []
  [free-slip-v]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top'
    variable = v
    momentum_component = 'y'
  []
  [symmetry-u]
    type = PINSFVSymmetryVelocityBC
    boundary = 'bottom'
    variable = u
    u = u
    v = v
    mu = ${mu}
    momentum_component = 'x'
  []
  [symmetry-v]
    type = PINSFVSymmetryVelocityBC
    boundary = 'bottom'
    variable = v
    u = u
    v = v
    mu = ${mu}
    momentum_component = 'y'
  []
  [symmetry-p]
    type = INSFVSymmetryPressureBC
    boundary = 'bottom'
    variable = pressure
  []
  [outlet-p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = 0
  []
[]
[FunctorMaterials]
  [darcy]
    type = ADGenericVectorFunctorMaterial
    prop_names = 'Darcy_coefficient Forchheimer_coefficient'
    prop_values = '0.1 0.1 0.1 0.1 0.1 0.1'
  []
  [speed]
    type = PINSFVSpeedFunctorMaterial
    superficial_vel_x = u
    superficial_vel_y = v
    porosity = porosity
  []
[]
[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-11
  nl_abs_tol = 1e-14
[]
# Some basic Postprocessors to visually examine the solution
[Postprocessors]
  [inlet-p]
    type = SideAverageValue
    variable = pressure
    boundary = 'left'
  []
  [outlet-u]
    type = SideIntegralVariablePostprocessor
    variable = u
    boundary = 'right'
  []
[]
[Outputs]
  exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/hydraulic-separators/separator-scalar.i)
# This test is designed to check for energy conservation
# in separated channels. The three inlet temperatures should be
# preserved at the outlets.
rho=1.1
mu=0.6
alpha=0.1
advected_interp_method='upwind'
velocity_interp_method='rc'
[Mesh]
  [mesh]
    type = CartesianMeshGenerator
    dim = 2
    dx = '1.0'
    dy = '0.25 0.25 0.25'
    ix = '5'
    iy = '2 2 2'
    subdomain_id = '1 2 3'
  []
  [separator-1]
    type = SideSetsBetweenSubdomainsGenerator
    input = mesh
    primary_block = '1'
    paired_block = '2'
    new_boundary = 'separator-1'
  []
  [separator-2]
    type = SideSetsBetweenSubdomainsGenerator
    input = separator-1
    primary_block = '2'
    paired_block = '3'
    new_boundary = 'separator-2'
  []
  [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
  []
  [outlet-1]
    type = ParsedGenerateSideset
    input = inlet-3
    combinatorial_geometry = 'y < 0.25 & x > 0.999999'
    replace = false
    new_sideset_name = outlet-1
  []
  [outlet-2]
    type = ParsedGenerateSideset
    input = outlet-1
    combinatorial_geometry = 'y > 0.25 & y < 0.5 & x > 0.999999'
    replace = false
    new_sideset_name = outlet-2
  []
  [outlet-3]
    type = ParsedGenerateSideset
    input = outlet-2
    combinatorial_geometry = 'y > 0.5 & x > 0.999999'
    replace = false
    new_sideset_name = outlet-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}
  []
  [scalar]
    type = INSFVEnergyVariable
    initial_condition = 50
  []
[]
[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'
  []
  [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'
  []
  [scalar_conduction]
    type = FVDiffusion
    coeff = ${alpha}
    variable = scalar
  []
  [scalar_advection]
    type = INSFVScalarFieldAdvection
    variable = scalar
  []
[]
[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
  []
  [inlet-scalar-1]
    type = FVDirichletBC
    variable = scalar
    boundary = 'inlet-1'
    value = 10
  []
  [inlet-scalar-2]
    type = FVDirichletBC
    variable = scalar
    boundary = 'inlet-2'
    value = 20
  []
  [inlet-scalar-3]
    type = FVDirichletBC
    variable = scalar
    boundary = 'inlet-3'
    value = 30
  []
  [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
  []
  [separator-scalar]
    type = INSFVScalarFieldSeparatorBC
    boundary = 'separator-1 separator-2'
    variable = scalar
  []
  [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'
  []
  [porosity-2]
    type = ADGenericFunctorMaterial
    prop_names = 'porosity'
    prop_values = '0.5'
    block = '2'
  []
  [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]
  [outlet_scalar1]
    type = SideAverageValue
    variable = 'scalar'
    boundary = 'outlet-1'
  []
  [outlet_scalar2]
    type = SideAverageValue
    variable = 'scalar'
    boundary = 'outlet-2'
  []
  [outlet_scalar3]
    type = SideAverageValue
    variable = 'scalar'
    boundary = 'outlet-3'
  []
[]
[Outputs]
  csv = true
  execute_on = final
[]
(modules/navier_stokes/test/tests/finite_volume/ins/lid-driven/rz-gravity-quiescent-fluid.i)
mu = .01
rho = 1
[GlobalParams]
  velocity_interp_method = 'rc'
  advected_interp_method = 'average'
  two_term_boundary_expansion = true
  rhie_chow_user_object = 'rc'
[]
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 1
    xmax = 2
    ymin = 0
    ymax = 1
    nx = 10
    ny = 10
  []
  coord_type = 'RZ'
[]
[Variables]
  [u]
    type = INSFVVelocityVariable
  []
  [v]
    type = INSFVVelocityVariable
  []
  [pressure]
    type = INSFVPressureVariable
  []
  [lambda]
    family = SCALAR
    order = FIRST
  []
[]
[AuxVariables]
  [U]
    order = CONSTANT
    family = MONOMIAL
    fv = true
  []
[]
[AuxKernels]
  [mag]
    type = VectorMagnitudeAux
    variable = U
    x = u
    y = v
  []
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = u
    v = v
    pressure = pressure
  []
[]
[FVKernels]
  [mass]
    type = INSFVMassAdvection
    variable = pressure
    rho = ${rho}
  []
  [mean_zero_pressure]
    type = FVIntegralValueConstraint
    variable = pressure
    lambda = lambda
  []
  [u_advection]
    type = INSFVMomentumAdvection
    variable = u
    rho = ${rho}
    momentum_component = 'x'
  []
  [u_viscosity]
    type = INSFVMomentumDiffusion
    variable = u
    mu = 'mu'
    momentum_component = 'x'
  []
  [u_pressure]
    type = INSFVMomentumPressure
    variable = u
    momentum_component = 'x'
    pressure = pressure
  []
  [u_gravity]
    type = INSFVMomentumGravity
    variable = u
    momentum_component = 'x'
    rho = ${rho}
    gravity = '0 -1 0'
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = v
    rho = ${rho}
    momentum_component = 'y'
  []
  [v_viscosity]
    type = INSFVMomentumDiffusion
    variable = v
    mu = 'mu'
    momentum_component = 'y'
  []
  [v_pressure]
    type = INSFVMomentumPressure
    variable = v
    momentum_component = 'y'
    pressure = pressure
  []
  [v_gravity]
    type = INSFVMomentumGravity
    variable = v
    momentum_component = 'y'
    rho = ${rho}
    gravity = '0 -1 0'
  []
[]
[FVBCs]
  [free_slip_x]
    type = INSFVNaturalFreeSlipBC
    variable = u
    boundary = 'left right top bottom'
    momentum_component = 'x'
  []
  [free_slip_y]
    type = INSFVNaturalFreeSlipBC
    variable = v
    boundary = 'left right top bottom'
    momentum_component = 'y'
  []
[]
[FunctorMaterials]
  [mu]
    type = ADGenericFunctorMaterial
    prop_names = 'mu'
    prop_values = '${mu}'
  []
[]
[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
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/2d-rc-epsjump.i)
mu=1.1
rho=1.1
advected_interp_method='upwind'
velocity_interp_method='rc'
[Mesh]
  [mesh]
    type = CartesianMeshGenerator
    dim = 2
    dx = '1 1'
    dy = '0.5'
    ix = '30 30'
    iy = '20'
    subdomain_id = '1 2'
  []
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
  porosity = porosity
[]
[UserObjects]
  [rc]
    type = PINSFVRhieChowInterpolator
    u = u
    v = v
    porosity = porosity
    pressure = pressure
  []
[]
[Variables]
  [u]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = 1
  []
  [v]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = 1e-6
  []
  [pressure]
    type = INSFVPressureVariable
  []
[]
[AuxVariables]
  [porosity]
    type = MooseVariableFVReal
  []
[]
[ICs]
  inactive = 'porosity_continuous'
  [porosity_1]
    type = ConstantIC
    variable = porosity
    block = 1
    value = 1
  []
  [porosity_2]
    type = ConstantIC
    variable = porosity
    block = 2
    value = 0.5
  []
  [porosity_continuous]
    type = FunctionIC
    variable = porosity
    block = '1 2'
    function = smooth_jump
  []
[]
[Functions]
  [smooth_jump]
    type = ParsedFunction
    expression = '1 - 0.5 * 1 / (1 + exp(-30*(x-1)))'
  []
[]
[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 = u
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'x'
  []
  [u_viscosity]
    type = PINSFVMomentumDiffusion
    variable = u
    mu = ${mu}
    momentum_component = 'x'
  []
  [u_pressure]
    type = PINSFVMomentumPressure
    variable = u
    pressure = pressure
    momentum_component = 'x'
  []
  [v_advection]
    type = PINSFVMomentumAdvection
    variable = v
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'y'
  []
  [v_viscosity]
    type = PINSFVMomentumDiffusion
    variable = v
    mu = ${mu}
    momentum_component = 'y'
  []
  [v_pressure]
    type = PINSFVMomentumPressure
    variable = v
    pressure = pressure
    momentum_component = 'y'
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = u
    functor = '1'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = v
    functor = 0
  []
  [walls-u]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top bottom'
    variable = u
    momentum_component = 'x'
  []
  [walls-v]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top bottom'
    variable = v
    momentum_component = 'y'
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = 0.4
  []
[]
[FunctorMaterials]
  inactive = 'smooth'
  [jump]
    type = ADPiecewiseByBlockFunctorMaterial
    prop_name = 'porosity'
    subdomain_to_prop_value = '1 1
                               2 0.5'
  []
  [smooth]
    type = ADGenericFunctionFunctorMaterial
    prop_names = 'porosity'
    prop_values = 'smooth_jump'
  []
[]
[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-10
[]
[Postprocessors]
  [inlet_p]
    type = SideAverageValue
    variable = 'pressure'
    boundary = 'left'
  []
  [outlet-u]
    type = SideIntegralVariablePostprocessor
    variable = u
    boundary = 'right'
  []
[]
[Outputs]
  exodus = true
  csv = false
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/cylindrical/diverging.i)
mu = 1
rho = 1
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[GlobalParams]
  rhie_chow_user_object = 'rc'
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = u
    v = v
    pressure = pressure
  []
[]
[Mesh]
  file = diverging.msh
  uniform_refine = 2
  coord_type = 'RZ'
[]
[Variables]
  [u]
    type = INSFVVelocityVariable
    initial_condition = 1e-15
  []
  [v]
    type = INSFVVelocityVariable
    initial_condition = 1e-15
  []
  [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 = u
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'x'
  []
  [u_viscosity]
    type = INSFVMomentumDiffusion
    variable = u
    mu = ${mu}
    momentum_component = 'x'
  []
  [u_pressure]
    type = INSFVMomentumPressure
    variable = u
    momentum_component = 'x'
    pressure = pressure
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = v
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'y'
    # we can think of the axis as a slip wall boundary, no normal velocity and no viscous shear
  []
  [v_viscosity]
    type = INSFVMomentumDiffusion
    variable = v
    mu = ${mu}
    momentum_component = 'y'
  []
  [v_pressure]
    type = INSFVMomentumPressure
    variable = v
    momentum_component = 'y'
    pressure = pressure
  []
[]
[FVBCs]
  active = 'inlet-u inlet-v free-slip-wall-u free-slip-wall-v outlet-p axis-u axis-v'
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'bottom'
    variable = u
    functor = 0
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'bottom'
    variable = v
    functor = 1
  []
  [free-slip-wall-u]
    type = INSFVNaturalFreeSlipBC
    boundary = 'right'
    variable = u
    momentum_component = 'x'
  []
  [free-slip-wall-v]
    type = INSFVNaturalFreeSlipBC
    boundary = 'right'
    variable = v
    momentum_component = 'y'
  []
  [no-slip-wall-u]
    type = INSFVNoSlipWallBC
    boundary = 'right'
    variable = u
    function = 0
  []
  [no-slip-wall-v]
    type = INSFVNoSlipWallBC
    boundary = 'right'
    variable = v
    function = 0
  []
  [outlet-p]
    type = INSFVOutletPressureBC
    boundary = 'top'
    variable = pressure
    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
  []
[]
[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
[]
[Debug]
  show_var_residual_norms = true
[]
[Postprocessors]
  [in]
    type = SideIntegralVariablePostprocessor
    variable = v
    boundary = 'bottom'
  []
  [out]
    type = SideIntegralVariablePostprocessor
    variable = v
    boundary = 'top'
  []
  [num_lin]
    type = NumLinearIterations
    outputs = 'console'
  []
  [num_nl]
    type = NumNonlinearIterations
    outputs = 'console'
  []
  [cum_lin]
    type = CumulativeValuePostprocessor
    outputs = 'console'
    postprocessor = 'num_lin'
  []
  [cum_nl]
    type = CumulativeValuePostprocessor
    outputs = 'console'
    postprocessor = 'num_nl'
  []
[]
[Outputs]
  exodus = true
  csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/2d-rc-friction.i)
mu = 1.1
rho = 1
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[Mesh]
  [mesh]
    type = CartesianMeshGenerator
    dim = 2
    dx = '2.5 2.5'
    dy = '1.0'
    ix = '20 20'
    iy = '20'
    subdomain_id = '1 2'
  []
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
[]
[UserObjects]
  [rc]
    type = PINSFVRhieChowInterpolator
    u = superficial_vel_x
    v = superficial_vel_y
    pressure = pressure
    porosity = porosity
  []
[]
[Variables]
  inactive = 'lambda'
  [superficial_vel_x]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = 1
  []
  [superficial_vel_y]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = 1e-6
  []
  [pressure]
    type = INSFVPressureVariable
  []
  [lambda]
    family = SCALAR
    order = FIRST
  []
[]
[AuxVariables]
  [porosity]
    family = MONOMIAL
    order = CONSTANT
    fv = true
    initial_condition = 0.5
  []
[]
[FVKernels]
  inactive = 'mean-pressure'
  [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}
    porosity = porosity
    momentum_component = 'x'
  []
  [u_viscosity]
    type = PINSFVMomentumDiffusion
    variable = superficial_vel_x
    mu = ${mu}
    porosity = porosity
    momentum_component = 'x'
  []
  [u_pressure]
    type = PINSFVMomentumPressure
    variable = superficial_vel_x
    momentum_component = 'x'
    pressure = pressure
    porosity = porosity
  []
  [u_friction]
    type = PINSFVMomentumFriction
    variable = superficial_vel_x
    momentum_component = 'x'
    Darcy_name = 'Darcy_coefficient'
    Forchheimer_name = 'Forchheimer_coefficient'
    mu = ${mu}
    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}
    porosity = porosity
    momentum_component = 'y'
  []
  [v_viscosity]
    type = PINSFVMomentumDiffusion
    variable = superficial_vel_y
    mu = ${mu}
    porosity = porosity
    momentum_component = 'y'
  []
  [v_pressure]
    type = PINSFVMomentumPressure
    variable = superficial_vel_y
    momentum_component = 'y'
    pressure = pressure
    porosity = porosity
  []
  [v_friction]
    type = PINSFVMomentumFriction
    variable = superficial_vel_y
    momentum_component = 'y'
    Darcy_name = 'Darcy_coefficient'
    Forchheimer_name = 'Forchheimer_coefficient'
    rho = ${rho}
    speed = speed
    mu = ${mu}
  []
  [mean-pressure]
    type = FVIntegralValueConstraint
    variable = pressure
    lambda = lambda
    phi0 = 0.01
  []
[]
[FVBCs]
  inactive = 'free-slip-u free-slip-v'
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = superficial_vel_x
    functor = '1'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = superficial_vel_y
    functor = 0
  []
  [no-slip-u]
    type = INSFVNoSlipWallBC
    boundary = 'top'
    variable = superficial_vel_x
    function = 0
  []
  [no-slip-v]
    type = INSFVNoSlipWallBC
    boundary = 'top'
    variable = superficial_vel_y
    function = 0
  []
  [free-slip-u]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top'
    variable = superficial_vel_x
    momentum_component = 'x'
  []
  [free-slip-v]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top'
    variable = superficial_vel_y
    momentum_component = 'y'
  []
  [symmetry-u]
    type = PINSFVSymmetryVelocityBC
    boundary = 'bottom'
    variable = superficial_vel_x
    u = superficial_vel_x
    v = superficial_vel_y
    mu = ${mu}
    momentum_component = 'x'
  []
  [symmetry-v]
    type = PINSFVSymmetryVelocityBC
    boundary = 'bottom'
    variable = superficial_vel_y
    u = superficial_vel_x
    v = superficial_vel_y
    mu = ${mu}
    momentum_component = 'y'
  []
  [symmetry-p]
    type = INSFVSymmetryPressureBC
    boundary = 'bottom'
    variable = pressure
  []
  [outlet-p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = 0
  []
[]
[FunctorMaterials]
  [darcy]
    type = ADGenericVectorFunctorMaterial
    prop_names = 'Darcy_coefficient Forchheimer_coefficient'
    prop_values = '0.1 0.1 0.1 0.1 0.1 0.1'
  []
  [speec]
    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'
  petsc_options_value = 'lu NONZERO'
  nl_rel_tol = 1e-11
  nl_abs_tol = 1e-14
[]
# Some basic Postprocessors to visually examine the solution
[Postprocessors]
  [inlet-p]
    type = SideAverageValue
    variable = pressure
    boundary = 'left'
  []
  [outlet-u]
    type = SideIntegralVariablePostprocessor
    variable = superficial_vel_x
    boundary = 'right'
  []
[]
[Outputs]
  exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/segregated/2d-momentum.i)
mu = 1.1
rho = 1.1
pressure_tag = "pressure_grad"
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 5
    ymin = 0
    ymax = 1
    nx = 40
    ny = 6
  []
[]
[GlobalParams]
  advected_interp_method = 'average'
  velocity_interp_method = 'rc'
  rhie_chow_user_object = 'rc'
[]
[UserObjects]
  [rc]
    type = PINSFVRhieChowInterpolatorSegregated
    u = superficial_vel_x
    v = superficial_vel_y
    pressure = pressure
    porosity = porosity
  []
[]
[Problem]
  nl_sys_names = 'u_system v_system pressure_system'
  previous_nl_solution_required = true
[]
[Variables]
  [superficial_vel_x]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = 1
    solver_sys = u_system
    two_term_boundary_expansion = false
  []
  [superficial_vel_y]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = 1e-6
    solver_sys = v_system
    two_term_boundary_expansion = false
  []
  [pressure]
    type = INSFVPressureVariable
    two_term_boundary_expansion = false
    solver_sys = pressure_system
  []
[]
[AuxVariables]
  [porosity]
    type = MooseVariableFVReal
    initial_condition = 0.5
  []
[]
[FVKernels]
  inactive = "u_friction v_friction"
  [u_advection]
    type = PINSFVMomentumAdvection
    variable = superficial_vel_x
    rho = ${rho}
    porosity = porosity
    momentum_component = 'x'
  []
  [u_viscosity]
    type = PINSFVMomentumDiffusion
    variable = superficial_vel_x
    mu = ${mu}
    porosity = porosity
    momentum_component = 'x'
  []
  [u_pressure]
    type = PINSFVMomentumPressure
    variable = superficial_vel_x
    momentum_component = 'x'
    pressure = pressure
    porosity = porosity
    extra_vector_tags = ${pressure_tag}
  []
  [u_friction]
    type = PINSFVMomentumFriction
    variable = superficial_vel_x
    momentum_component = 'y'
    Darcy_name = 'Darcy_coefficient'
    Forchheimer_name = 'Forchheimer_coefficient'
    rho = ${rho}
    speed = speed
    mu = ${mu}
  []
  [v_advection]
    type = PINSFVMomentumAdvection
    variable = superficial_vel_y
    rho = ${rho}
    porosity = porosity
    momentum_component = 'y'
  []
  [v_viscosity]
    type = PINSFVMomentumDiffusion
    variable = superficial_vel_y
    mu = ${mu}
    porosity = porosity
    momentum_component = 'y'
  []
  [v_pressure]
    type = PINSFVMomentumPressure
    variable = superficial_vel_y
    momentum_component = 'y'
    pressure = pressure
    porosity = porosity
    extra_vector_tags = ${pressure_tag}
  []
  [v_friction]
    type = PINSFVMomentumFriction
    variable = superficial_vel_y
    momentum_component = 'y'
    Darcy_name = 'Darcy_coefficient'
    Forchheimer_name = 'Forchheimer_coefficient'
    rho = ${rho}
    speed = speed
    mu = ${mu}
  []
  [p_diffusion]
    type = FVAnisotropicDiffusion
    variable = pressure
    coeff = "Ainv"
    coeff_interp_method = 'average'
  []
  [p_source]
    type = FVDivergence
    variable = pressure
    vector_field = "HbyA"
    force_boundary_execution = true
  []
[]
[FVBCs]
  inactive = 'slip-u slip-v'
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = superficial_vel_x
    functor = '1'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = superficial_vel_y
    functor = 0
  []
  [no-slip-u]
    type = INSFVNoSlipWallBC
    boundary = 'top'
    variable = superficial_vel_x
    function = 0
  []
  [no-slip-v]
    type = INSFVNoSlipWallBC
    boundary = 'top'
    variable = superficial_vel_y
    function = 0
  []
  [symmetry-u]
    type = INSFVSymmetryVelocityBC
    boundary = 'bottom'
    variable = superficial_vel_x
    u = superficial_vel_x
    v = superficial_vel_y
    mu = ${mu}
    momentum_component = 'x'
  []
  [symmetry-v]
    type = PINSFVSymmetryVelocityBC
    boundary = 'bottom'
    variable = superficial_vel_y
    u = superficial_vel_x
    v = superficial_vel_y
    mu = ${mu}
    momentum_component = 'y'
  []
  [symmetry-p]
    type = INSFVSymmetryPressureBC
    boundary = 'bottom'
    variable = pressure
  []
  [outlet-p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = 0.4
  []
  ### Are disabled by default but we switch it on for certain tests ###
  [slip-u]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top'
    variable = superficial_vel_x
    momentum_component = 'x'
  []
  [slip-v]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top'
    variable = superficial_vel_y
    momentum_component = 'y'
  []
  #####################################################################
[]
[FunctorMaterials]
  [darcy]
    type = ADGenericVectorFunctorMaterial
    prop_names = 'Darcy_coefficient Forchheimer_coefficient'
    prop_values = '0.01 0.02 0.03 0.01 0.02 0.03'
  []
  [speed]
    type = PINSFVSpeedFunctorMaterial
    superficial_vel_x = superficial_vel_x
    superficial_vel_y = superficial_vel_y
    porosity = porosity
  []
[]
[Executioner]
  type = SIMPLENonlinearAssembly
  momentum_l_abs_tol = 1e-14
  pressure_l_abs_tol = 1e-14
  momentum_l_tol = 0
  pressure_l_tol = 0
  rhie_chow_user_object = 'rc'
  momentum_systems = 'u_system v_system'
  pressure_system = 'pressure_system'
  pressure_gradient_tag = ${pressure_tag}
  momentum_equation_relaxation = 0.85
  pressure_variable_relaxation = 0.45
  num_iterations = 150
  pressure_absolute_tolerance = 1e-13
  momentum_absolute_tolerance = 1e-13
  print_fields = false
  continue_on_max_its = true
[]
[Outputs]
  exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/one-elem-wide-channel.i)
mu = 1.1
rho = 1.1
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[GlobalParams]
  rhie_chow_user_object = 'rc'
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = u
    v = v
    pressure = pressure
  []
[]
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 10
    ymin = -1
    ymax = 1
    nx = 5
    ny = 1
  []
[]
[Variables]
  [u]
    type = INSFVVelocityVariable
    initial_condition = 1
  []
  [v]
    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 = u
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'x'
  []
  [u_viscosity]
    type = INSFVMomentumDiffusion
    variable = u
    mu = ${mu}
    momentum_component = 'x'
  []
  [u_pressure]
    type = INSFVMomentumPressure
    variable = u
    momentum_component = 'x'
    pressure = pressure
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = v
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'y'
  []
  [v_viscosity]
    type = INSFVMomentumDiffusion
    variable = v
    mu = ${mu}
    momentum_component = 'y'
  []
  [v_pressure]
    type = INSFVMomentumPressure
    variable = v
    momentum_component = 'y'
    pressure = pressure
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = u
    functor = '1'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = v
    functor = '0'
  []
  [walls-u]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top bottom'
    variable = u
    momentum_component = 'x'
  []
  [walls-v]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top bottom'
    variable = v
    momentum_component = 'y'
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = '0'
  []
[]
[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
  csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/2d-rc.i)
mu = 1.1
rho = 1.1
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 10
    ymin = -1
    ymax = 1
    nx = 100
    ny = 20
  []
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = vel_x
    v = vel_y
    pressure = pressure
  []
[]
[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 = '1'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_y
    functor = 0
  []
  [walls-u]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top bottom'
    variable = vel_x
    momentum_component = 'x'
  []
  [walls-v]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top bottom'
    variable = vel_y
    momentum_component = 'y'
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = 0
  []
[]
[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
  csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/cylindrical/no-slip-tris.i)
mu = 1
rho = 1
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[GlobalParams]
  two_term_boundary_expansion = true
  rhie_chow_user_object = 'rc'
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = vel_x
    v = vel_y
    pressure = pressure
  []
[]
[Mesh]
  type = GeneratedMesh
  nx = 4
  ny = 4
  xmax = 3.9
  ymax = 4.1
  elem_type = TRI3
  dim = 2
  coord_type = 'RZ'
[]
[Variables]
  [vel_x]
    type = INSFVVelocityVariable
    initial_condition = 1e-15
  []
  [vel_y]
    type = INSFVVelocityVariable
    initial_condition = 1e-15
  []
  [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'
    # we can think of the axis as a slip wall boundary, no normal velocity and no viscous shear
  []
  [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]
  active = 'inlet-u inlet-v free-slip-wall-u free-slip-wall-v outlet-p axis-u axis-v'
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'bottom'
    variable = vel_x
    functor = 0
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'bottom'
    variable = vel_y
    functor = 1
  []
  [free-slip-wall-u]
    type = INSFVNaturalFreeSlipBC
    boundary = 'right'
    variable = vel_x
    momentum_component = 'x'
  []
  [free-slip-wall-v]
    type = INSFVNaturalFreeSlipBC
    boundary = 'right'
    variable = vel_y
    momentum_component = 'y'
  []
  [no-slip-wall-u]
    type = INSFVNoSlipWallBC
    boundary = 'right'
    variable = vel_x
    function = 0
  []
  [no-slip-wall-v]
    type = INSFVNoSlipWallBC
    boundary = 'right'
    variable = vel_y
    function = 0
  []
  [outlet-p]
    type = INSFVOutletPressureBC
    boundary = 'top'
    variable = pressure
    function = 0
  []
  [axis-u]
    type = INSFVSymmetryVelocityBC
    boundary = 'left'
    variable = vel_x
    u = vel_x
    v = vel_y
    mu = ${mu}
    momentum_component = x
  []
  [axis-v]
    type = INSFVSymmetryVelocityBC
    boundary = 'left'
    variable = vel_y
    u = vel_x
    v = vel_y
    mu = ${mu}
    momentum_component = y
  []
  [axis-p]
    type = INSFVSymmetryPressureBC
    boundary = 'left'
    variable = 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
[]
[Debug]
  show_var_residual_norms = true
[]
[Postprocessors]
  [in]
    type = SideIntegralVariablePostprocessor
    variable = vel_y
    boundary = 'bottom'
  []
  [out]
    type = SideIntegralVariablePostprocessor
    variable = vel_y
    boundary = 'top'
  []
  [num_lin]
    type = NumLinearIterations
    outputs = 'console'
  []
  [num_nl]
    type = NumNonlinearIterations
    outputs = 'console'
  []
  [cum_lin]
    type = CumulativeValuePostprocessor
    outputs = 'console'
    postprocessor = 'num_lin'
  []
  [cum_nl]
    type = CumulativeValuePostprocessor
    outputs = 'console'
    postprocessor = 'num_nl'
  []
[]
[Outputs]
  exodus = true
  csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_reversal.i)
rho = 'rho'
l = 10
inlet_area = 1
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.1
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = ${l}
    ymin = 0
    ymax = 1
    nx = 6
    ny = 3
  []
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = vel_x
    v = vel_y
    pressure = pressure
  []
[]
[Variables]
  [vel_x]
    type = INSFVVelocityVariable
    initial_condition = ${inlet_velocity}
  []
  [vel_y]
    type = INSFVVelocityVariable
    initial_condition = 1e-15
  []
  [pressure]
    type = INSFVPressureVariable
    initial_condition = ${outlet_pressure}
  []
  [T_fluid]
    type = INSFVEnergyVariable
    initial_condition = ${inlet_temp}
  []
  [scalar]
    type = MooseVariableFVReal
    initial_condition = 0.1
  []
  [lambda]
    family = SCALAR
    order = FIRST
  []
[]
[AuxVariables]
  [power_density]
    type = MooseVariableFVReal
    initial_condition = 1e6
  []
[]
[FVKernels]
  # Mass equation
  [mass]
    type = INSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
  []
  [mean_zero_pressure]
    type = FVIntegralValueConstraint
    variable = pressure
    lambda = lambda
    phi0 = 0.0
  []
  # X component momentum equation
  [u_time]
    type = WCNSFVMomentumTimeDerivative
    variable = vel_x
    drho_dt = drho_dt
    rho = rho
    momentum_component = 'x'
  []
  [u_advection]
    type = INSFVMomentumAdvection
    variable = vel_x
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = ${advected_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
  []
  # Y component momentum equation
  [v_time]
    type = WCNSFVMomentumTimeDerivative
    variable = vel_y
    drho_dt = drho_dt
    rho = rho
    momentum_component = 'y'
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = vel_y
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = ${advected_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
  []
  # Energy equation
  [temp_time]
    type = WCNSFVEnergyTimeDerivative
    variable = T_fluid
    rho = rho
    drho_dt = drho_dt
    dh_dt = dh_dt
    h = h
  []
  [temp_conduction]
    type = FVDiffusion
    coeff = 'k'
    variable = T_fluid
  []
  [temp_advection]
    type = INSFVEnergyAdvection
    variable = T_fluid
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = ${advected_interp_method}
  []
  [heat_source]
    type = FVCoupledForce
    variable = T_fluid
    v = power_density
  []
  # Scalar concentration equation
  [scalar_time]
    type = FVFunctorTimeKernel
    variable = scalar
  []
  [scalar_advection]
    type = INSFVScalarFieldAdvection
    variable = scalar
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = ${advected_interp_method}
  []
  [scalar_diffusion]
    type = FVDiffusion
    variable = scalar
    coeff = 1.1
  []
  [scalar_source]
    type = FVBodyForce
    variable = scalar
    function = 2.1
  []
[]
[FVBCs]
  # Inlet
  [inlet_mass]
    type = WCNSFVMassFluxBC
    variable = pressure
    boundary = 'left'
    mdot_pp = 'inlet_mdot'
    area_pp = 'area_pp_left'
    rho = 'rho'
    vel_x = vel_x
    vel_y = vel_y
  []
  [inlet_u]
    type = WCNSFVMomentumFluxBC
    variable = vel_x
    boundary = 'left'
    mdot_pp = 'inlet_mdot'
    area_pp = 'area_pp_left'
    rho = 'rho'
    momentum_component = 'x'
    vel_x = vel_x
    vel_y = vel_y
  []
  [inlet_v]
    type = WCNSFVMomentumFluxBC
    variable = vel_y
    boundary = 'left'
    mdot_pp = 0
    area_pp = 'area_pp_left'
    rho = 'rho'
    momentum_component = 'y'
    vel_x = vel_x
    vel_y = vel_y
  []
  [inlet_T]
    type = WCNSFVEnergyFluxBC
    variable = T_fluid
    T_fluid = T_fluid
    boundary = 'left'
    temperature_pp = 'inlet_T'
    mdot_pp = 'inlet_mdot'
    area_pp = 'area_pp_left'
    rho = 'rho'
    cp = 'cp'
    vel_x = vel_x
    vel_y = vel_y
  []
  [inlet_scalar]
    type = WCNSFVScalarFluxBC
    variable = scalar
    boundary = 'left'
    scalar_value_pp = 'inlet_scalar_value'
    mdot_pp = 'inlet_mdot'
    area_pp = 'area_pp_left'
    rho = 'rho'
    vel_x = vel_x
    vel_y = vel_y
    passive_scalar = scalar
  []
  [outlet_mass]
    type = WCNSFVMassFluxBC
    variable = pressure
    boundary = 'right'
    mdot_pp = 'outlet_mdot'
    area_pp = 'area_pp_left'
    rho = 'rho'
    vel_x = vel_x
    vel_y = vel_y
  []
  [outlet_u]
    type = WCNSFVMomentumFluxBC
    variable = vel_x
    boundary = 'right'
    mdot_pp = 'outlet_mdot'
    area_pp = 'area_pp_left'
    rho = 'rho'
    momentum_component = 'x'
    vel_x = vel_x
    vel_y = vel_y
  []
  [outlet_v]
    type = WCNSFVMomentumFluxBC
    variable = vel_y
    boundary = 'right'
    mdot_pp = 0
    area_pp = 'area_pp_left'
    rho = 'rho'
    momentum_component = 'y'
    vel_x = vel_x
    vel_y = vel_y
  []
  [outlet_T]
    type = WCNSFVEnergyFluxBC
    variable = T_fluid
    T_fluid = T_fluid
    boundary = 'right'
    temperature_pp = 'inlet_T'
    mdot_pp = 'outlet_mdot'
    area_pp = 'area_pp_left'
    rho = 'rho'
    cp = 'cp'
    vel_x = vel_x
    vel_y = vel_y
  []
  [outlet_scalar]
    type = WCNSFVScalarFluxBC
    variable = scalar
    boundary = 'right'
    scalar_value_pp = 'inlet_scalar_value'
    mdot_pp = 'outlet_mdot'
    area_pp = 'area_pp_left'
    rho = 'rho'
    vel_x = vel_x
    vel_y = vel_y
    passive_scalar = scalar
  []
  # Walls
  [no_slip_x]
    type = INSFVNaturalFreeSlipBC
    variable = vel_x
    momentum_component = x
    boundary = 'top bottom'
  []
  [no_slip_y]
    type = INSFVNaturalFreeSlipBC
    variable = vel_y
    momentum_component = y
    boundary = 'top bottom'
  []
[]
# used for the boundary conditions in this example
[Postprocessors]
  [inlet_mdot]
    type = Receiver
    default = ${fparse 1980 * inlet_velocity * inlet_area}
    #outputs = none
  []
  [outlet_mdot]
    type = Receiver
    default = ${fparse -1980 * inlet_velocity * inlet_area}
    outputs = none
  []
  [area_pp_left]
    type = AreaPostprocessor
    boundary = 'left'
    execute_on = 'INITIAL'
    outputs = none
  []
  [inlet_T]
    type = Receiver
    default = ${inlet_temp}
    outputs = none
  []
  [inlet_scalar_value]
    type = Receiver
    default = 0.2
    outputs = none
  []
  [left_mdot]
    type = VolumetricFlowRate
    vel_x = vel_x
    vel_y = vel_y
    advected_quantity = rho
    boundary = left
    advected_interp_method = ${advected_interp_method}
  []
  [right_mdot]
    type = VolumetricFlowRate
    vel_x = vel_x
    vel_y = vel_y
    advected_quantity = rho
    boundary = right
    advected_interp_method = ${advected_interp_method}
  []
[]
[FunctorMaterials]
  [const_functor]
    type = ADGenericFunctorMaterial
    prop_names = 'cp k rho'
    prop_values = '${cp} ${k} 1980'
  []
  [ins_fv]
    type = INSFVEnthalpyFunctorMaterial
    temperature = 'T_fluid'
    rho = ${rho}
  []
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -pc_factor_shift_type'
  petsc_options_value = 'lu       NONZERO'
  [TimeStepper]
    type = IterationAdaptiveDT
    dt = 1e-1
    optimal_iterations = 6
    growth_factor = 4
  []
  end_time = 500000
  nl_abs_tol = 1e-7
  nl_max_its = 50
  line_search = 'none'
  automatic_scaling = true
[]
[Outputs]
  exodus = true
  execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/ins/variables/caching/3d-rc.i)
mu=1.1
rho=1.1
advected_interp_method='average'
velocity_interp_method='rc'
pressure_cell_gradient_caching = true
velocity_cell_gradient_caching = true
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 3
    xmin = 0
    xmax = 10
    ymin = -1
    ymax = 1
    zmin = -1
    zmax = 1
    nx = 15
    ny = 5
    nz = 5
  []
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = u
    v = v
    w = w
    pressure = pressure
  []
[]
[Variables]
  [u]
    type = INSFVVelocityVariable
    initial_condition = 1
    cache_cell_gradients = ${velocity_cell_gradient_caching}
  []
  [v]
    type = INSFVVelocityVariable
    initial_condition = 1e-6
    cache_cell_gradients = ${velocity_cell_gradient_caching}
  []
  [w]
    type = INSFVVelocityVariable
    initial_condition = 1e-6
    cache_cell_gradients = ${velocity_cell_gradient_caching}
  []
  [pressure]
    type = INSFVPressureVariable
    cache_cell_gradients = ${pressure_cell_gradient_caching}
  []
[]
[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 = u
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'x'
  []
  [u_viscosity]
    type = INSFVMomentumDiffusion
    variable = u
    mu = ${mu}
    momentum_component = 'x'
  []
  [u_pressure]
    type = INSFVMomentumPressure
    variable = u
    momentum_component = 'x'
    pressure = pressure
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = v
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'y'
  []
  [v_viscosity]
    type = INSFVMomentumDiffusion
    variable = v
    mu = ${mu}
    momentum_component = 'y'
  []
  [v_pressure]
    type = INSFVMomentumPressure
    variable = v
    momentum_component = 'y'
    pressure = pressure
  []
  [w_advection]
    type = INSFVMomentumAdvection
    variable = w
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'z'
  []
  [w_viscosity]
    type = INSFVMomentumDiffusion
    variable = w
    mu = ${mu}
    momentum_component = 'z'
  []
  [w_pressure]
    type = INSFVMomentumPressure
    variable = w
    momentum_component = 'z'
    pressure = pressure
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = u
    functor = '1'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = v
    functor = 0
  []
  [inlet-w]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = w
    functor = 0
  []
  [walls-u]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top bottom front back'
    variable = u
    momentum_component = 'x'
  []
  [walls-v]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top bottom front back'
    variable = v
    momentum_component = 'y'
  []
  [walls-w]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top bottom front back'
    variable = w
    momentum_component = 'z'
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = 0
  []
[]
[Postprocessors]
  [physical]
    type = MemoryUsage
    mem_type = physical_memory
    value_type = total
    # by default MemoryUsage reports the peak value for the current timestep
    # out of all samples that have been taken (at linear and non-linear iterations)
    execute_on = 'INITIAL TIMESTEP_END NONLINEAR LINEAR'
  []
[]
[Executioner]
  type = Steady
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -ksp_gmres_restart'
  petsc_options_value = 'asm      100               '
  line_search = 'none'
  nl_abs_tol = 1e-8
[]
[Outputs]
  hide = 'physical'
  perf_graph = true
  exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/cylindrical/2d-rc-slip.i)
mu = 1.1
rho = 1.1
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 2
    ymin = 0
    ymax = 10
    nx = 10
    ny = 50
  []
  coord_type = 'RZ'
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = u
    v = v
    pressure = pressure
  []
[]
[Variables]
  [u]
    type = INSFVVelocityVariable
    initial_condition = 1
  []
  [v]
    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 = u
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'x'
  []
  [u_viscosity]
    type = INSFVMomentumDiffusion
    variable = u
    mu = ${mu}
    momentum_component = 'x'
  []
  [u_pressure]
    type = INSFVMomentumPressure
    variable = u
    momentum_component = 'x'
    pressure = pressure
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = v
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'y'
  []
  [v_viscosity]
    type = INSFVMomentumDiffusion
    variable = v
    mu = ${mu}
    momentum_component = 'y'
  []
  [v_pressure]
    type = INSFVMomentumPressure
    variable = v
    momentum_component = 'y'
    pressure = pressure
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'bottom'
    variable = u
    functor = 0
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'bottom'
    variable = v
    functor = 1
  []
  [free-slip-wall-u]
    type = INSFVNaturalFreeSlipBC
    boundary = 'right'
    variable = u
    momentum_component = 'x'
  []
  [free-slip-wall-v]
    type = INSFVNaturalFreeSlipBC
    boundary = 'right'
    variable = v
    momentum_component = 'y'
  []
  [outlet-p]
    type = INSFVOutletPressureBC
    boundary = 'top'
    variable = pressure
    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
  []
[]
[Postprocessors]
  [in]
    type = SideIntegralVariablePostprocessor
    variable = v
    boundary = 'bottom'
    outputs = 'csv'
  []
  [out]
    type = SideIntegralVariablePostprocessor
    variable = v
    boundary = 'top'
    outputs = 'csv'
  []
[]
[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
  csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/hydraulic-separators/separator-energy-nonorthogonal.i)
# This test is designed to check for energy conservation
# in separated channels which are described using a nonorthogonal mesh.
# The two inlet temperatures should be preserved at the outlets.
rho=1.1
mu=0.6
k=2.1
cp=5.5
advected_interp_method='upwind'
velocity_interp_method='rc'
[Mesh]
  [file]
    type = FileMeshGenerator
    file = diverging.msh
  []
  [mirror]
    type = SymmetryTransformGenerator
    input = file
    mirror_point = "0 0 0"
    mirror_normal_vector = "1 0 0"
  []
  [stitch]
    type = StitchedMeshGenerator
    inputs = 'file mirror'
    stitch_boundaries_pairs = 'left left'
  []
  [subdomain1]
    type = ParsedSubdomainMeshGenerator
    input = stitch
    combinatorial_geometry = 'x > 0'
    block_id = 1
  []
  [subdomain2]
    type = ParsedSubdomainMeshGenerator
    input = subdomain1
    combinatorial_geometry = 'x < 0'
    block_id = 2
  []
  [separator]
    type = ParsedGenerateSideset
    input = subdomain2
    combinatorial_geometry = 'x > -0.00001 & x < 0.00001'
    replace = true
    new_sideset_name = separator
  []
  [inlet-1]
    type = ParsedGenerateSideset
    input = separator
    combinatorial_geometry = 'y < 0.00001 & x < 0'
    replace = true
    new_sideset_name = inlet-1
  []
  [inlet-2]
    type = ParsedGenerateSideset
    input = inlet-1
    combinatorial_geometry = 'y < 0.00001 & x > 0'
    replace = true
    new_sideset_name = inlet-2
  []
  [outlet-1]
    type = ParsedGenerateSideset
    input = inlet-2
    combinatorial_geometry = 'y > 20.999999 & x < 0'
    replace = true
    new_sideset_name = outlet-1
  []
  [outlet-2]
    type = ParsedGenerateSideset
    input = outlet-1
    combinatorial_geometry = 'y > 20.999999 & x > 0'
    replace = true
    new_sideset_name = outlet-2
  []
  uniform_refine = 1
[]
[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
  []
  [superficial_vel_y]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = 0.1
  []
  [pressure]
    type = BernoulliPressureVariable
    u = superficial_vel_x
    v = superficial_vel_y
    rho = ${rho}
  []
  [T_fluid]
    type = INSFVEnergyVariable
    initial_condition = 300
  []
[]
[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'
  []
  [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'
  []
  [temp_conduction]
    type = FVDiffusion
    coeff = ${k}
    variable = T_fluid
  []
  [temp_advection]
    type = INSFVEnergyAdvection
    variable = T_fluid
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'inlet-1 inlet-2'
    variable = superficial_vel_x
    functor = '0.0'
  []
  [inlet-v-1]
    type = INSFVInletVelocityBC
    boundary = 'inlet-1'
    variable = superficial_vel_y
    functor = 0.1
  []
  [inlet-v-2]
    type = INSFVInletVelocityBC
    boundary = 'inlet-2'
    variable = superficial_vel_y
    functor = 0.2
  []
  [inlet-T-1]
    type = FVDirichletBC
    variable = T_fluid
    boundary = 'inlet-1'
    value = 310
  []
  [inlet-T-2]
    type = FVDirichletBC
    variable = T_fluid
    boundary = 'inlet-2'
    value = 350
  []
  [walls-u]
    type = INSFVNaturalFreeSlipBC
    boundary = 'right'
    variable = superficial_vel_x
    momentum_component = 'x'
  []
  [walls-v]
    type = INSFVNaturalFreeSlipBC
    boundary = 'right'
    variable = superficial_vel_y
    momentum_component = 'y'
  []
  [separator-u]
    type = INSFVVelocityHydraulicSeparatorBC
    boundary = 'separator'
    variable = superficial_vel_x
    momentum_component = 'x'
  []
  [separator-v]
    type = INSFVVelocityHydraulicSeparatorBC
    boundary = 'separator'
    variable = superficial_vel_y
    momentum_component = 'y'
  []
  [separator-p]
    type = INSFVScalarFieldSeparatorBC
    boundary = 'separator'
    variable = pressure
  []
  [separator-T]
    type = INSFVScalarFieldSeparatorBC
    boundary = 'separator'
    variable = T_fluid
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'outlet-2 outlet-1'
    variable = pressure
    function = 0.4
  []
[]
[FunctorMaterials]
  [porosity-1]
    type = ADGenericFunctorMaterial
    prop_names = 'porosity'
    prop_values = '1.0'
    block = '1'
  []
  [porosity-2]
    type = ADGenericFunctorMaterial
    prop_names = 'porosity'
    prop_values = '0.5'
    block = '2'
  []
  [speed]
    type = PINSFVSpeedFunctorMaterial
    superficial_vel_x = superficial_vel_x
    superficial_vel_y = superficial_vel_y
    porosity = porosity
  []
  [ins_fv]
    type = INSFVEnthalpyFunctorMaterial
    temperature = 'T_fluid'
    rho = ${rho}
    cp = ${cp}
  []
[]
[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]
  [outlet_T1]
    type = SideAverageValue
    variable = 'T_fluid'
    boundary = 'outlet-1'
  []
  [outlet_T2]
    type = SideAverageValue
    variable = 'T_fluid'
    boundary = 'outlet-2'
  []
[]
[Outputs]
  csv = true
  execute_on = final
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/bernoulli-2d.i)
rho=1.1
advected_interp_method='upwind'
velocity_interp_method='rc'
[Mesh]
  [mesh]
    type = CartesianMeshGenerator
    dim = 2
    dx = '1 1'
    dy = '0.5'
    ix = '3 3'
    iy = '2'
    subdomain_id = '1 2'
  []
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
  porosity = porosity
[]
[UserObjects]
  [rc]
    type = PINSFVRhieChowInterpolator
    u = u
    v = v
    porosity = porosity
    pressure = pressure
  []
[]
[Variables]
  [u]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = 1
  []
  [v]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = 1e-6
  []
  [pressure]
    type = BernoulliPressureVariable
    u = u
    v = v
    porosity = porosity
    rho = ${rho}
  []
[]
[AuxVariables]
  [porosity]
    type = PiecewiseConstantVariable
  []
[]
[ICs]
  [porosity_1]
    type = ConstantIC
    variable = porosity
    block = 1
    value = 1
  []
  [porosity_2]
    type = ConstantIC
    variable = porosity
    block = 2
    value = 0.5
  []
[]
[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 = u
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'x'
  []
  [u_pressure]
    type = PINSFVMomentumPressure
    variable = u
    pressure = pressure
    momentum_component = 'x'
  []
  [v_advection]
    type = PINSFVMomentumAdvection
    variable = v
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'y'
  []
  [v_pressure]
    type = PINSFVMomentumPressure
    variable = v
    pressure = pressure
    momentum_component = 'y'
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = u
    functor = '1'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = v
    functor = 0
  []
  [walls-u]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top bottom'
    variable = u
    momentum_component = 'x'
  []
  [walls-v]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top bottom'
    variable = v
    momentum_component = 'y'
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = 0.4
  []
[]
[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-10
[]
[Postprocessors]
  [inlet_p]
    type = SideAverageValue
    variable = 'pressure'
    boundary = 'left'
  []
  [outlet-u]
    type = SideIntegralVariablePostprocessor
    variable = u
    boundary = 'right'
  []
[]
[Outputs]
  exodus = true
  csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/materials/ergun/ergun.i)
# This file simulates flow of fluid in a porous elbow for the purpose of verifying
# correct implementation of the various different solution variable sets. This input
# tests correct implementation of the primitive superficial variable set. Flow enters on the top
# and exits on the right. Because the purpose is only to test the equivalence of
# different equation sets, no solid energy equation is included.
porosity_left = 0.4
porosity_right = 0.6
pebble_diameter = 0.06
mu = 1.81e-5 # This has been increased to avoid refining the mesh
M = 28.97e-3
R = 8.3144598
# inlet mass flowrate, kg/s
mdot = -10.0
# inlet mass flux (superficial)
mflux_in_superficial = ${fparse mdot / (pi * 0.5 * 0.5)}
# inlet mass flux (interstitial)
mflux_in_interstitial = ${fparse mflux_in_superficial / porosity_left}
p_initial = 201325.0
T_initial = 300.0
rho_initial = ${fparse p_initial / T_initial * M / R}
vel_y_initial = ${fparse mflux_in_interstitial / rho_initial}
vel_x_initial = 0.0
superficial_vel_y_initial = ${fparse mflux_in_superficial / rho_initial}
superficial_vel_x_initial = 1e-12
# Computation parameters
velocity_interp_method = 'rc'
advected_interp_method = 'upwind'
# ==============================================================================
# GEOMETRY AND MESH
# ==============================================================================
[Mesh]
  [fmg]
    type = FileMeshGenerator
    file = 'ergun_in.e'
  []
  coord_type = RZ
[]
[UserObjects]
  [rc]
    type = PINSFVRhieChowInterpolator
    u = superficial_vel_x
    v = superficial_vel_y
    pressure = pressure
    porosity = porosity
  []
[]
[GlobalParams]
  porosity = porosity
  pebble_diameter = ${pebble_diameter}
  fp = fp
  # rho for the kernels. Must match fluid property!
  rho = ${rho_initial}
  fv = true
  velocity_interp_method = ${velocity_interp_method}
  advected_interp_method = ${advected_interp_method}
  # behavior at time of test creation
  two_term_boundary_expansion = false
  rhie_chow_user_object = 'rc'
[]
# ==============================================================================
# VARIABLES AND KERNELS
# ==============================================================================
[Variables]
  [pressure]
    type = INSFVPressureVariable
    initial_condition = ${p_initial}
  []
  [superficial_vel_x]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = ${superficial_vel_x_initial}
  []
  [superficial_vel_y]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = ${superficial_vel_y_initial}
  []
[]
[FVKernels]
  # Mass Equation.
  [mass]
    type = PINSFVMassAdvection
    variable = 'pressure'
  []
  # Momentum x component equation.
  [vel_x_time]
    type = PINSFVMomentumTimeDerivative
    variable = 'superficial_vel_x'
    momentum_component = 'x'
  []
  [vel_x_advection]
    type = PINSFVMomentumAdvection
    variable = 'superficial_vel_x'
    momentum_component = 'x'
  []
  [vel_x_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'
    Darcy_name = 'Darcy_coefficient'
    Forchheimer_name = 'Forchheimer_coefficient'
    momentum_component = 'x'
    speed = speed
    mu = 'mu'
  []
  # Momentum y component equation.
  [vel_y_time]
    type = PINSFVMomentumTimeDerivative
    variable = 'superficial_vel_y'
    momentum_component = 'y'
  []
  [vel_y_advection]
    type = PINSFVMomentumAdvection
    variable = 'superficial_vel_y'
    momentum_component = 'y'
  []
  [vel_y_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'
    Darcy_name = 'Darcy_coefficient'
    Forchheimer_name = 'Forchheimer_coefficient'
    momentum_component = 'y'
    mu = 'mu'
    speed = speed
  []
  [gravity]
    type = PINSFVMomentumGravity
    variable = 'superficial_vel_y'
    gravity = '0 -9.81 0'
    momentum_component = 'y'
  []
[]
# ==============================================================================
# AUXVARIABLES AND AUXKERNELS
# ==============================================================================
[AuxVariables]
  [T_fluid]
    initial_condition = ${T_initial}
    order = CONSTANT
    family = MONOMIAL
  []
  [vel_x]
    initial_condition = ${fparse vel_x_initial}
    order = CONSTANT
    family = MONOMIAL
  []
  [vel_y]
    initial_condition = ${fparse vel_y_initial}
    order = CONSTANT
    family = MONOMIAL
  []
  [porosity_out]
    type = MooseVariableFVReal
  []
[]
[AuxKernels]
  [vel_x]
    type = FunctorAux
    variable = vel_x
    functor = vel_x_mat
  []
  [vel_y]
    type = FunctorAux
    variable = vel_y
    functor = vel_y_mat
  []
  [porosity_out]
    type = FunctorAux
    variable = porosity_out
    functor = porosity
  []
[]
# ==============================================================================
# FLUID PROPERTIES, MATERIALS AND USER OBJECTS
# ==============================================================================
[FluidProperties]
  [fp]
    type = IdealGasFluidProperties
    k = 0.0
    mu = ${mu}
    gamma = 1.4
    molar_mass = ${M}
  []
[]
[FunctorMaterials]
  [enthalpy]
    type = INSFVEnthalpyMaterial
    temperature = 'T_fluid'
  []
  [speed]
    type = PINSFVSpeedFunctorMaterial
    superficial_vel_x = 'superficial_vel_x'
    superficial_vel_y = 'superficial_vel_y'
    porosity = porosity
    vel_x = vel_x_mat
    vel_y = vel_y_mat
  []
  [kappa]
    type = FunctorKappaFluid
  []
  [const_Fdrags_mat]
    type = FunctorErgunDragCoefficients
    porosity = porosity
  []
  [fluidprops]
    type = GeneralFunctorFluidProps
    mu_rampdown = mu_func
    porosity = porosity
    characteristic_length = ${pebble_diameter}
    T_fluid = 'T_fluid'
    pressure = 'pressure'
    speed = 'speed'
  []
[]
d = 0.05
[Functions]
  [mu_func]
    type = PiecewiseLinear
    x = '1 3 5 10 15 20'
    y = '1e5 1e4 1e3 1e2 1e1 1'
  []
  [real_porosity_function]
    type = ParsedFunction
    expression = 'if (x < 0.6 - ${d}, ${porosity_left}, if (x > 0.6 + ${d}, ${porosity_right},
        (x-(0.6-${d}))/(2*${d})*(${porosity_right}-${porosity_left}) + ${porosity_left}))'
  []
  [porosity]
    type = ParsedFunction
    expression = 'if (x < 0.6 - ${d}, ${porosity_left}, if (x > 0.6 + ${d}, ${porosity_right},
        (x-(0.6-${d}))/(2*${d})*(${porosity_right}-${porosity_left}) + ${porosity_left}))'
  []
[]
# ==============================================================================
# BOUNDARY CONDITIONS
# ==============================================================================
[FVBCs]
  [outlet_p]
    type = INSFVOutletPressureBC
    variable = 'pressure'
    function = ${p_initial}
    boundary = 'right'
  []
  ## No or Free slip BC
  [free-slip-wall-x]
    type = INSFVNaturalFreeSlipBC
    boundary = 'bottom wall_1 wall_2 left'
    variable = superficial_vel_x
    momentum_component = 'x'
  []
  [free-slip-wall-y]
    type = INSFVNaturalFreeSlipBC
    boundary = 'bottom wall_1 wall_2 left'
    variable = superficial_vel_y
    momentum_component = 'y'
  []
  ## Symmetry
  [symmetry-x]
    type = PINSFVSymmetryVelocityBC
    boundary = 'left'
    variable = superficial_vel_x
    u = superficial_vel_x
    v = superficial_vel_y
    mu = 'mu'
    momentum_component = 'x'
  []
  [symmetry-y]
    type = PINSFVSymmetryVelocityBC
    boundary = 'left'
    variable = superficial_vel_y
    u = superficial_vel_x
    v = superficial_vel_y
    mu = 'mu'
    momentum_component = 'y'
  []
  [symmetry-p]
    type = INSFVSymmetryPressureBC
    boundary = 'left'
    variable = 'pressure'
  []
  ## inlet
  [inlet_vel_x]
    type = INSFVInletVelocityBC
    variable = 'superficial_vel_x'
    functor = ${superficial_vel_x_initial}
    boundary = 'top'
  []
  [inlet_vel_y]
    type = INSFVInletVelocityBC
    variable = 'superficial_vel_y'
    functor = ${superficial_vel_y_initial}
    boundary = 'top'
  []
[]
# ==============================================================================
# EXECUTION PARAMETERS
# ==============================================================================
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -ksp_gmres_restart'
  petsc_options_value = 'asm      lu           NONZERO                   200'
  line_search = 'none'
  # Problem time parameters
  dtmin = 0.01
  dtmax = 2000
  end_time = 3000
  # must be the same as the fluid
  # Iterations parameters
  l_max_its = 50
  l_tol     = 1e-8
  nl_max_its = 25
  # nl_rel_tol = 5e-7
  nl_abs_tol = 2e-7
  # Automatic scaling
  automatic_scaling = true
  verbose = true
  [TimeStepper]
    type = IterationAdaptiveDT
    dt                 = 0.025
    cutback_factor     = 0.5
    growth_factor      = 2.0
  []
  # Steady state detection.
  steady_state_detection = true
  steady_state_tolerance = 1e-7
  steady_state_start_time = 400
[]
# ==============================================================================
# POSTPROCESSORS DEBUG AND OUTPUTS
# ==============================================================================
[Postprocessors]
  [mass_flow_in]
    type = VolumetricFlowRate
    boundary = 'top'
    vel_x = 'superficial_vel_x'
    vel_y = 'superficial_vel_y'
    advected_quantity = ${rho_initial}
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [mass_flow_out]
    type = VolumetricFlowRate
    boundary = 'right'
    vel_x = 'superficial_vel_x'
    vel_y = 'superficial_vel_y'
    advected_quantity = ${rho_initial}
    execute_on = 'INITIAL TIMESTEP_END'
  []
  [p_in]
    type = SideAverageValue
    variable = pressure
    boundary = 'top'
  []
  [dP]
    type = LinearCombinationPostprocessor
    pp_names = 'p_in'
    pp_coefs = '1.0'
    b = ${fparse -p_initial}
  []
[]
[Outputs]
  exodus = true
  print_linear_residuals = false
[]
(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
[]
(modules/navier_stokes/test/tests/postprocessors/flow_rates/conservation_PINSFV.i)
mu=1
rho=1
advected_interp_method='average'
velocity_interp_method='rc'
[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'
  []
[]
[Problem]
  fv_bcs_integrity_check = true
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
  advected_interp_method = ${advected_interp_method}
  velocity_interp_method = ${velocity_interp_method}
[]
[UserObjects]
  [rc]
    type = PINSFVRhieChowInterpolator
    u = u
    v = v
    pressure = pressure
    porosity = porosity
  []
[]
[Variables]
  [u]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = 0
  []
  [v]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = 1
  []
  [pressure]
    type = INSFVPressureVariable
  []
  [temperature]
    type = INSFVEnergyVariable
  []
[]
[AuxVariables]
  [advected_density]
    order = CONSTANT
    family = MONOMIAL
    fv = true
    initial_condition = ${rho}
  []
  [porosity]
    order = CONSTANT
    family = MONOMIAL
    fv = true
    initial_condition = 0.5
  []
[]
[FVKernels]
  [mass]
    type = PINSFVMassAdvection
    variable = pressure
    rho = ${rho}
  []
  [u_advection]
    type = PINSFVMomentumAdvection
    variable = u
    rho = ${rho}
    porosity = porosity
    momentum_component = 'x'
  []
  [u_viscosity]
    type = PINSFVMomentumDiffusion
    variable = u
    force_boundary_execution = true
    porosity = porosity
    mu = ${mu}
    momentum_component = 'x'
  []
  [u_pressure]
    type = PINSFVMomentumPressure
    variable = u
    momentum_component = 'x'
    pressure = pressure
    porosity = porosity
  []
  [v_advection]
    type = PINSFVMomentumAdvection
    variable = v
    rho = ${rho}
    porosity = porosity
    momentum_component = 'y'
  []
  [v_viscosity]
    type = PINSFVMomentumDiffusion
    variable = v
    force_boundary_execution = true
    porosity = porosity
    mu = ${mu}
    momentum_component = 'y'
  []
  [v_pressure]
    type = PINSFVMomentumPressure
    variable = v
    momentum_component = 'y'
    pressure = pressure
    porosity = porosity
  []
  [temp_advection]
    type = PINSFVEnergyAdvection
    variable = temperature
    advected_interp_method = 'upwind'
  []
  [temp_source]
    type = FVBodyForce
    variable = temperature
    function = 10
    block = 1
  []
[]
[FVBCs]
  inactive = 'noslip-u noslip-v'
  [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
  []
  [free-slip-u]
    type = INSFVNaturalFreeSlipBC
    boundary = 'right'
    variable = u
    momentum_component = 'x'
  []
  [free-slip-v]
    type = INSFVNaturalFreeSlipBC
    boundary = 'right'
    variable = v
    momentum_component = 'y'
  []
  [axis-u]
    type = PINSFVSymmetryVelocityBC
    boundary = 'left'
    variable = u
    u = u
    v = v
    mu = ${mu}
    momentum_component = x
  []
  [axis-v]
    type = PINSFVSymmetryVelocityBC
    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'
  []
[]
[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]
  [inlet_mass_variable]
    type = VolumetricFlowRate
    boundary = bottom
    vel_x = u
    vel_y = v
    advected_quantity = advected_density
  []
  [inlet_mass_constant]
    type = VolumetricFlowRate
    boundary = bottom
    vel_x = u
    vel_y = v
    advected_quantity = ${rho}
  []
  [inlet_mass_matprop]
    type = VolumetricFlowRate
    boundary = bottom
    vel_x = u
    vel_y = v
    advected_quantity = 'advected_rho'
  []
  [mid1_mass]
    type = VolumetricFlowRate
    boundary = internal_bot
    vel_x = u
    vel_y = v
    advected_quantity = ${rho}
  []
  [mid2_mass]
    type = VolumetricFlowRate
    boundary = internal_top
    vel_x = u
    vel_y = v
    advected_quantity = ${rho}
  []
  [outlet_mass]
    type = VolumetricFlowRate
    boundary = top
    vel_x = u
    vel_y = v
    advected_quantity = ${rho}
  []
  [inlet_momentum_x]
    type = VolumetricFlowRate
    boundary = bottom
    vel_x = u
    vel_y = v
    advected_quantity = u
  []
  [inlet_momentum_y]
    type = VolumetricFlowRate
    boundary = bottom
    vel_x = u
    vel_y = v
    advected_quantity = v
  []
  [mid1_advected_energy]
    type = VolumetricFlowRate
    boundary = internal_bot
    vel_x = u
    vel_y = v
    advected_quantity = 'rho_cp_temp'
    advected_interp_method = 'upwind'
  []
  [mid2_advected_energy]
    type = VolumetricFlowRate
    boundary = internal_top
    vel_x = u
    vel_y = v
    advected_quantity = 'rho_cp_temp'
    advected_interp_method = 'upwind'
  []
  [outlet_advected_energy]
    type = VolumetricFlowRate
    boundary = top
    vel_x = u
    vel_y = v
    advected_quantity = 'rho_cp_temp'
    advected_interp_method = 'upwind'
  []
[]
[Outputs]
  csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/segregated/2d/2d-segregated-velocity-rz-slip.i)
mu = 2.6
rho = 1.0
advected_interp_method = 'average'
velocity_interp_method = 'rc'
pressure_tag = "pressure_grad"
[Mesh]
  coord_type = 'RZ'
  rz_coord_axis = X
  [mesh]
    type = CartesianMeshGenerator
    dim = 2
    dx = '1.25'
    dy = '0.2'
    ix = '30'
    iy = '7'
  []
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
[]
[Problem]
  nl_sys_names = 'u_system v_system pressure_system'
  previous_nl_solution_required = true
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolatorSegregated
    u = vel_x
    v = vel_y
    pressure = pressure
  []
[]
[Variables]
  [vel_x]
    type = INSFVVelocityVariable
    initial_condition = 0.5
    solver_sys = u_system
    two_term_boundary_expansion = false
  []
  [vel_y]
    type = INSFVVelocityVariable
    initial_condition = 0.0
    solver_sys = v_system
    two_term_boundary_expansion = false
  []
  [pressure]
    type = INSFVPressureVariable
    solver_sys = pressure_system
    initial_condition = 0.2
    two_term_boundary_expansion = false
  []
[]
[FVKernels]
  inactive = 'u_friction v_friction'
  [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
    extra_vector_tags = ${pressure_tag}
  []
  [u_friction]
    type = PINSFVMomentumFriction
    variable = vel_x
    u = vel_x
    v = vel_y
    momentum_component = 'x'
    Darcy_name = 'Darcy_coefficient'
    Forchheimer_name = 'Forchheimer_coefficient'
    standard_friction_formulation = false
    rho = ${rho}
  []
  [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
    extra_vector_tags = ${pressure_tag}
  []
  [v_friction]
    type = PINSFVMomentumFriction
    variable = vel_y
    u = vel_x
    v = vel_y
    momentum_component = 'y'
    Darcy_name = 'Darcy_coefficient'
    Forchheimer_name = 'Forchheimer_coefficient'
    standard_friction_formulation = false
    rho = ${rho}
  []
  [p_diffusion]
    type = FVAnisotropicDiffusion
    variable = pressure
    coeff = "Ainv"
    coeff_interp_method = 'average'
  []
  [p_source]
    type = FVDivergence
    variable = pressure
    vector_field = "HbyA"
    force_boundary_execution = true
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_x
    functor = '1.1'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = vel_y
    functor = '0.0'
  []
  [walls-u]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top'
    variable = vel_x
    momentum_component = 'x'
  []
  [walls-v]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top'
    variable = vel_y
    momentum_component = 'y'
  []
  [symmetry_u]
    type = INSFVSymmetryVelocityBC
    variable = vel_x
    boundary = 'bottom'
    momentum_component = 'x'
    mu = ${mu}
    u = vel_x
    v = vel_y
  []
  [symmetry_v]
    type = INSFVSymmetryVelocityBC
    variable = vel_y
    boundary = 'bottom'
    momentum_component = 'y'
    mu = ${mu}
    u = vel_x
    v = vel_y
  []
  [symmetry_pressure]
    type = INSFVSymmetryPressureBC
    boundary = 'bottom'
    variable = pressure
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = 1.4
  []
[]
[FunctorMaterials]
  [darcy]
    type = ADGenericVectorFunctorMaterial
    prop_names = 'Darcy_coefficient Forchheimer_coefficient'
    prop_values = '0.1 0.1 0.1 0.1 0.1 0.1'
  []
[]
[Executioner]
  type = SIMPLENonlinearAssembly
  momentum_l_abs_tol = 1e-14
  pressure_l_abs_tol = 1e-14
  momentum_l_tol = 0
  pressure_l_tol = 0
  rhie_chow_user_object = 'rc'
  momentum_systems = 'u_system v_system'
  pressure_system = 'pressure_system'
  pressure_gradient_tag = ${pressure_tag}
  momentum_equation_relaxation = 0.5
  pressure_variable_relaxation = 0.3
  num_iterations = 150
  pressure_absolute_tolerance = 1e-13
  momentum_absolute_tolerance = 1e-13
  print_fields = false
  continue_on_max_its = true
[]
[Outputs]
  exodus = true
  csv = false
  perf_graph = false
  print_nonlinear_residuals = false
  print_linear_residuals = true
[]
(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/ins/channel-flow/3d-rc.i)
mu = 1.1
rho = 1.1
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 3
    xmin = 0
    xmax = 10
    ymin = -1
    ymax = 1
    zmin = -1
    zmax = 1
    nx = 21
    ny = 7
    nz = 7
  []
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = u
    v = v
    w = w
    pressure = pressure
  []
[]
[Variables]
  [u]
    type = INSFVVelocityVariable
    initial_condition = 1
  []
  [v]
    type = INSFVVelocityVariable
    initial_condition = 1e-6
  []
  [w]
    type = INSFVVelocityVariable
    initial_condition = 1e-6
  []
  [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 = u
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'x'
  []
  [u_viscosity]
    type = INSFVMomentumDiffusion
    variable = u
    mu = ${mu}
    momentum_component = 'x'
  []
  [u_pressure]
    type = INSFVMomentumPressure
    variable = u
    momentum_component = 'x'
    pressure = pressure
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = v
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'y'
  []
  [v_viscosity]
    type = INSFVMomentumDiffusion
    variable = v
    mu = ${mu}
    momentum_component = 'y'
  []
  [v_pressure]
    type = INSFVMomentumPressure
    variable = v
    momentum_component = 'y'
    pressure = pressure
  []
  [w_advection]
    type = INSFVMomentumAdvection
    variable = w
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
    momentum_component = 'z'
  []
  [w_viscosity]
    type = INSFVMomentumDiffusion
    variable = w
    mu = ${mu}
    momentum_component = 'z'
  []
  [w_pressure]
    type = INSFVMomentumPressure
    variable = w
    momentum_component = 'z'
    pressure = pressure
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = u
    functor = '1'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = v
    functor = 0
  []
  [inlet-w]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = w
    functor = 0
  []
  [walls-u]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top bottom front back'
    variable = u
    momentum_component = 'x'
  []
  [walls-v]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top bottom front back'
    variable = v
    momentum_component = 'y'
  []
  [walls-w]
    type = INSFVNaturalFreeSlipBC
    boundary = 'top bottom front back'
    variable = w
    momentum_component = 'z'
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = 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      100                lu           NONZERO'
  line_search = 'none'
  nl_abs_tol = 1e-13
[]
[Outputs]
  exodus = true
  csv = true
[]
(modules/navier_stokes/test/tests/postprocessors/flow_rates/conservation_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]
  inactive = 'noslip-u noslip-v'
  [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
  []
  [free-slip-u]
    type = INSFVNaturalFreeSlipBC
    boundary = 'right'
    variable = u
    momentum_component = 'x'
  []
  [free-slip-v]
    type = INSFVNaturalFreeSlipBC
    boundary = 'right'
    variable = v
    momentum_component = 'y'
  []
  [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'
  []
[]
[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]
  [inlet_mass_variable]
    type = VolumetricFlowRate
    boundary = bottom
    vel_x = u
    vel_y = v
    advected_quantity = advected_density
  []
  [inlet_mass_constant]
    type = VolumetricFlowRate
    boundary = bottom
    vel_x = u
    vel_y = v
    advected_quantity = ${rho}
  []
  [inlet_mass_matprop]
    type = VolumetricFlowRate
    boundary = bottom
    vel_x = u
    vel_y = v
    advected_quantity = 'advected_rho'
  []
  [mid1_mass]
    type = VolumetricFlowRate
    boundary = internal_bot
    vel_x = u
    vel_y = v
    advected_quantity = ${rho}
  []
  [mid2_mass]
    type = VolumetricFlowRate
    boundary = internal_top
    vel_x = u
    vel_y = v
    advected_quantity = ${rho}
  []
  [outlet_mass]
    type = VolumetricFlowRate
    boundary = top
    vel_x = u
    vel_y = v
    advected_quantity = ${rho}
  []
  [inlet_momentum_x]
    type = VolumetricFlowRate
    boundary = bottom
    vel_x = u
    vel_y = v
    advected_quantity = u
  []
  [inlet_momentum_y]
    type = VolumetricFlowRate
    boundary = bottom
    vel_x = u
    vel_y = v
    advected_quantity = v
  []
  [mid1_advected_energy]
    type = VolumetricFlowRate
    boundary = internal_bot
    vel_x = u
    vel_y = v
    advected_quantity = 'rho_cp_temp'
    advected_interp_method = 'upwind'
  []
  [mid2_advected_energy]
    type = VolumetricFlowRate
    boundary = internal_top
    vel_x = u
    vel_y = v
    advected_quantity = 'rho_cp_temp'
    advected_interp_method = 'upwind'
  []
  [outlet_advected_energy]
    type = VolumetricFlowRate
    boundary = top
    vel_x = u
    vel_y = v
    advected_quantity = 'rho_cp_temp'
    advected_interp_method = 'upwind'
  []
[]
[Outputs]
  csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/hydraulic-separators/separator-mixing.i)
# This test is designed to check for energy conservation
# in separated channels. The three inlet temperatures should be
# preserved at the outlets.
rho=1.1
mu=1e-4
k=2.1
cp=5.5
advected_interp_method='upwind'
velocity_interp_method='rc'
[Mesh]
  [mesh]
    type = CartesianMeshGenerator
    dim = 2
    dx = '0.25 1.0 0.25'
    dy = '0.25 0.25 0.25'
    ix = '4 20 4'
    iy = '5 5 5'
    subdomain_id = '1 2 5 1 3 5 1 4 5'
  []
  [separator-1]
    type = SideSetsBetweenSubdomainsGenerator
    input = mesh
    primary_block = '2'
    paired_block = '3'
    new_boundary = 'separator-1'
  []
  [separator-2]
    type = SideSetsBetweenSubdomainsGenerator
    input = separator-1
    primary_block = '3'
    paired_block = '4'
    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 = '1'
    paired_block = '3'
    new_boundary = jump-2
  []
  [jump-3]
    type = SideSetsBetweenSubdomainsGenerator
    input = jump-2
    primary_block = '1'
    paired_block = '4'
    new_boundary = jump-3
  []
  [outlet-1]
    type = SideSetsBetweenSubdomainsGenerator
    input = jump-3
    primary_block = '2'
    paired_block = '5'
    new_boundary = outlet-1
  []
  [outlet-2]
    type = SideSetsBetweenSubdomainsGenerator
    input = outlet-1
    primary_block = '3'
    paired_block = '5'
    new_boundary = outlet-2
  []
  [outlet-3]
    type = SideSetsBetweenSubdomainsGenerator
    input = outlet-2
    primary_block = '4'
    paired_block = '5'
    new_boundary = outlet-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 outlet-1 outlet-2 outlet-3'
    pressure_drop_form_factors = '0.1 0.2 0.3 0.1 0.2 0.3'
  []
  [T_fluid]
    type = INSFVEnergyVariable
    initial_condition = 300
  []
[]
[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
  []
  [temp_conduction]
    type = FVDiffusion
    coeff = ${k}
    variable = T_fluid
  []
  [temp_advection]
    type = INSFVEnergyAdvection
    variable = T_fluid
  []
  [temp_source]
    type = FVBodyForce
    variable = T_fluid
    function = heating
    block = '2 3 4'
  []
[]
[Functions]
  [heating]
    type = ParsedFunction
    expression = 'if(y<0.25, 10, if(y<0.5, 20, 30))'
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = superficial_vel_x
    functor = '0.1'
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = superficial_vel_y
    functor = 0
  []
  [inlet-T]
    type = FVDirichletBC
    variable = T_fluid
    boundary = 'left'
    value = 300
  []
  [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
  []
  [separator-T]
    type = INSFVScalarFieldSeparatorBC
    boundary = 'separator-1 separator-2'
    variable = T_fluid
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    boundary = 'right'
    variable = pressure
    function = 0.4
  []
[]
[FunctorMaterials]
  [porosity]
    type = ADPiecewiseByBlockFunctorMaterial
    prop_name = porosity
    subdomain_to_prop_value = '1 0.8
                               2 0.7
                               3 0.6
                               4 0.5
                               5 0.8'
  []
  [darcy-1]
    type = ADGenericVectorFunctorMaterial
    prop_names = 'Forchheimer_coefficient'
    prop_values = '1.0 1.0 1.0'
    block = '1 5'
  []
  [darcy-2]
    type = ADGenericVectorFunctorMaterial
    prop_names = 'Forchheimer_coefficient'
    prop_values = '3.0 3.0 3.0'
    block = 2
  []
  [darcy-3]
    type = ADGenericVectorFunctorMaterial
    prop_names = 'Forchheimer_coefficient'
    prop_values = '1.5 1.5 1.5'
    block = 3
  []
  [darcy-4]
    type = ADGenericVectorFunctorMaterial
    prop_names = 'Forchheimer_coefficient'
    prop_values = '0.75 0.75 0.75'
    block = 4
  []
  [speed]
    type = PINSFVSpeedFunctorMaterial
    superficial_vel_x = superficial_vel_x
    superficial_vel_y = superficial_vel_y
    porosity = porosity
  []
  [ins_fv]
    type = INSFVEnthalpyFunctorMaterial
    temperature = 'T_fluid'
    rho = ${rho}
    cp = ${cp}
  []
[]
[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]
  [outlet_T1]
    type = SideAverageValue
    variable = 'T_fluid'
    boundary = 'right'
  []
[]
[Outputs]
  csv = true
  execute_on = final
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/hydraulic-separators/separator-energy.i)
# This test is designed to check for energy conservation
# in separated channels. The three inlet temperatures should be
# preserved at the outlets.
rho=1.1
mu=0.6
k=2.1
cp=5.5
advected_interp_method='upwind'
velocity_interp_method='rc'
[Mesh]
  [mesh]
    type = CartesianMeshGenerator
    dim = 2
    dx = '1.0'
    dy = '0.25 0.25 0.25'
    ix = '5'
    iy = '2 2 2'
    subdomain_id = '1 2 3'
  []
  [separator-1]
    type = SideSetsBetweenSubdomainsGenerator
    input = mesh
    primary_block = '1'
    paired_block = '2'
    new_boundary = 'separator-1'
  []
  [separator-2]
    type = SideSetsBetweenSubdomainsGenerator
    input = separator-1
    primary_block = '2'
    paired_block = '3'
    new_boundary = 'separator-2'
  []
  [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
  []
  [outlet-1]
    type = ParsedGenerateSideset
    input = inlet-3
    combinatorial_geometry = 'y < 0.25 & x > 0.999999'
    replace = false
    new_sideset_name = outlet-1
  []
  [outlet-2]
    type = ParsedGenerateSideset
    input = outlet-1
    combinatorial_geometry = 'y > 0.25 & y < 0.5 & x > 0.999999'
    replace = false
    new_sideset_name = outlet-2
  []
  [outlet-3]
    type = ParsedGenerateSideset
    input = outlet-2
    combinatorial_geometry = 'y > 0.5 & x > 0.999999'
    replace = false
    new_sideset_name = outlet-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}
  []
  [T_fluid]
    type = INSFVEnergyVariable
    initial_condition = 300
  []
[]
[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'
  []
  [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'
  []
  [temp_conduction]
    type = FVDiffusion
    coeff = ${k}
    variable = T_fluid
  []
  [temp_advection]
    type = INSFVEnergyAdvection
    variable = T_fluid
  []
[]
[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
  []
  [inlet-T-1]
    type = FVDirichletBC
    variable = T_fluid
    boundary = 'inlet-1'
    value = 310
  []
  [inlet-T-2]
    type = FVDirichletBC
    variable = T_fluid
    boundary = 'inlet-2'
    value = 320
  []
  [inlet-T-3]
    type = FVDirichletBC
    variable = T_fluid
    boundary = 'inlet-3'
    value = 330
  []
  [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
  []
  [separator-T]
    type = INSFVScalarFieldSeparatorBC
    boundary = 'separator-1 separator-2'
    variable = T_fluid
  []
  [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'
  []
  [porosity-2]
    type = ADGenericFunctorMaterial
    prop_names = 'porosity'
    prop_values = '0.5'
    block = '2'
  []
  [speed]
    type = PINSFVSpeedFunctorMaterial
    superficial_vel_x = superficial_vel_x
    superficial_vel_y = superficial_vel_y
    porosity = porosity
  []
  [ins_fv]
    type = INSFVEnthalpyFunctorMaterial
    temperature = 'T_fluid'
    rho = ${rho}
    cp = ${cp}
  []
[]
[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]
  [outlet_T1]
    type = SideAverageValue
    variable = 'T_fluid'
    boundary = 'outlet-1'
  []
  [outlet_T2]
    type = SideAverageValue
    variable = 'T_fluid'
    boundary = 'outlet-2'
  []
  [outlet_T3]
    type = SideAverageValue
    variable = 'T_fluid'
    boundary = 'outlet-3'
  []
[]
[Outputs]
  csv = true
  execute_on = final
[]
(modules/navier_stokes/include/fvbcs/INSFVWallFunctionBC.h)
// This file is part of the MOOSE framework
// https://mooseframework.inl.gov
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "INSFVNaturalFreeSlipBC.h"
#include "INSFVVelocityVariable.h"
/**
 * A class for setting the wall shear stress at the walls, based on
 * the standard wall function formulation.
 */
class INSFVWallFunctionBC : public INSFVNaturalFreeSlipBC
{
public:
  static InputParameters validParams();
  INSFVWallFunctionBC(const InputParameters & params);
  using INSFVNaturalFreeSlipBC::gatherRCData;
  void gatherRCData(const FaceInfo &) override final;
protected:
  ADReal computeStrongResidual();
  ADReal computeSegregatedContribution() override;
  /// the dimension of the simulation
  const unsigned int _dim;
  /// x-velocity
  const Moose::Functor<ADReal> & _u;
  /// y-velocity
  const Moose::Functor<ADReal> * const _v;
  /// z-velocity
  const Moose::Functor<ADReal> * const _w;
  /// density
  const Moose::Functor<ADReal> & _rho;
  /// dynamic viscosity
  const Moose::Functor<ADReal> & _mu;
  /// Rhie-Chow coefficient
  ADReal _a = 0;
};