- drho_dp1.7324e-07derivative of density with respect to pressure (at constant temperature)Default:1.7324e-07 C++ Type:double Unit:(no unit assumed) Controllable:No Description:derivative of density with respect to pressure (at constant temperature) 
FlibeFluidProperties
Fluid properties for flibe
Description
The FlibeFluidProperties class provides fluid properties for a peritectic molar composition of 67% LiF and 33% BeF, commonly referred to as 'flibe'.
Density is calculated from Richard et al. (2014), but with a pressure dependence added to ensure finite derivatives with respect to pressure needed by some applications. The partial derivative of density with respect to pressure is assumed to be 1.7324e-7 kg/m/Pa Richard et al. (2014), but this may be set to a user-defined value. Slightly increasing the partial derivative of density with respect to pressure may improve convergence of compressible flow equations without significantly affecting the physical accuracy of the density estimation Scarlat (2012). In the absence of the pressure dependence, the uncertainty on density is 0.05% Richard et al. (2014).
Viscosity, isobaric specific heat, and thermal conductivity are calculated with uncertainties of 20%, 2%, and 15%, respectively Richard et al. (2014). The viscosity of LiF and BeF vary by eight orders of magnitude, so caution should be used if applying these fluid properties to LiF-BeF mixtures with slightly different ratios Romatoski and Hu (2017).
Isochoric specific heat is calculated according to its definition as
which becomes, after substituting the definition for ,
Molar mass is calculated assuming 99.995% enrichment of lithium in the Li-7 isotope.
Range of Validity
These fluid properties are only applicable to liquid flibe. At atmospheric pressure, the melting and boiling points of flibe are approximately 458C and 1400C, respectively Richard et al. (2014). These fluid properties should not be used outside this range.
Input Parameters
- T_initial_guess400Temperature initial guess for Newton Method variable set conversionDefault:400 C++ Type:double Unit:(no unit assumed) Controllable:No Description:Temperature initial guess for Newton Method variable set conversion 
- max_newton_its100Maximum number of Newton iterations for variable set conversionsDefault:100 C++ Type:unsigned int Controllable:No Description:Maximum number of Newton iterations for variable set conversions 
- p_initial_guess200000Pressure initial guess for Newton Method variable set conversionDefault:200000 C++ Type:double Unit:(no unit assumed) Controllable:No Description:Pressure initial guess for Newton Method variable set conversion 
- tolerance1e-08Tolerance for 2D Newton variable set conversionDefault:1e-08 C++ Type:double Unit:(no unit assumed) Controllable:No Description:Tolerance for 2D Newton variable set conversion 
Variable Set Conversions Newton Solve Parameters
- allow_imperfect_jacobiansFalsetrue to allow unimplemented property derivative terms to be set to zero for the AD APIDefault:False C++ Type:bool Controllable:No Description:true to allow unimplemented property derivative terms to be set to zero for the AD API 
- 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. 
- fp_typesingle-phase-fpType of the fluid property objectDefault:single-phase-fp C++ Type:FPType Controllable:No Description:Type of the fluid property object 
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/wcns/boundary_conditions/flux_bcs_mdot-action.i)
- (modules/navier_stokes/test/tests/finite_volume/pwcns/boundary_conditions/flux_bcs_mdot-action.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_mdot.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/channel-flow/2d-transient-physics.i)
- (modules/navier_stokes/test/tests/finite_volume/pwcns/channel-flow/2d-transient-action.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/materials/2d-transient-physics.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_velocity.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/channel-flow/2d-transient-action.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/materials/functorfluidprops.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/materials/2d-transient.i)
- (modules/navier_stokes/test/tests/finite_volume/pwcns/channel-flow/2d-transient-physics.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/dirichlet_bcs_mdot.i)
- (modules/navier_stokes/test/tests/finite_volume/controls/switch-pressure-bc/switch_vel_pres_bc.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_velocity-action.i)
- (modules/navier_stokes/test/tests/finite_volume/pwcns/channel-flow/2d-transient.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/dirichlet_bcs_velocity.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/channel-flow/2d-transient.i)
References
- J. Richard, D. Wang, G. Yoder, J. Carbajo, D. Williams, B. Forget, and C. Forsberg.
Implementation of Liquid Salt Working Fluids Into TRACE.
In Proceedings of ICAPP 2014. 2014.[BibTeX]@InProceedings{richard, author = "Richard, J. and Wang, D. and Yoder, G. and Carbajo, J. and Williams, D. and Forget, B. and Forsberg, C.", title = "{Implementation of Liquid Salt Working Fluids Into TRACE}", booktitle = "{Proceedings of ICAPP 2014}", year = "2014" }
- R.R. Romatoski and L.W. Hu.
Fluoride Salt Coolant Properties for Nuclear Reactor Applications: A Review.
Annals of Nuclear Energy, 109:635–647, 2017.[BibTeX]@Article{romatoski, author = "Romatoski, R.R. and Hu, L.W.", title = "{Fluoride Salt Coolant Properties for Nuclear Reactor Applications: A Review}", journal = "Annals of Nuclear Energy", year = "2017", volume = "109", pages = "635--647" }
- R.O. Scarlat.
Design of Complex Systems to Achieve Passive Safety: Natural Circulation Cooling of Liquid Salt Pebble Bed Reactors.
PhD thesis, University of California, Berkeley, 2012.[BibTeX]@phdThesis{scarlat, author = "Scarlat, R.O.", title = "Design of Complex Systems to Achieve Passive Safety: Natural Circulation Cooling of Liquid Salt Pebble Bed Reactors", year = "2012", school = "University of California, Berkeley" }
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_mdot-action.i)
l = 10
inlet_area = 1
# 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.001
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = ${l}
    ymin = 0
    ymax = 1
    nx = 10
    ny = 5
  []
[]
[FluidProperties]
  [fp]
    type = FlibeFluidProperties
  []
[]
[Modules]
  [NavierStokesFV]
    compressibility = 'weakly-compressible'
    add_energy_equation = true
    add_scalar_equation = true
    passive_scalar_names = 'scalar'
    density = 'rho'
    dynamic_viscosity = 'mu'
    thermal_conductivity = 'k'
    specific_heat = 'cp'
    passive_scalar_diffusivity = 1.1
    initial_velocity = '${inlet_velocity} 1e-15 0'
    initial_temperature = '${inlet_temp}'
    initial_pressure = '${outlet_pressure}'
    initial_scalar_variables = 0.1
    inlet_boundaries = 'left'
    momentum_inlet_types = 'flux-mass'
    flux_inlet_pps = 'inlet_mdot'
    energy_inlet_types = 'flux-mass'
    energy_inlet_functors = 'inlet_T'
    passive_scalar_inlet_types = 'flux-mass'
    passive_scalar_inlet_functors = 'inlet_scalar_value'
    wall_boundaries = 'top bottom'
    momentum_wall_types = 'noslip noslip'
    energy_wall_types = 'heatflux heatflux'
    energy_wall_functors = '0 0'
    outlet_boundaries = 'right'
    momentum_outlet_types = 'fixed-pressure'
    pressure_functors = '${outlet_pressure}'
    external_heat_source = 'power_density'
    passive_scalar_source = 2.1
    mass_advection_interpolation = 'average'
    momentum_advection_interpolation = 'average'
    energy_advection_interpolation = 'average'
  []
[]
[Postprocessors]
  [inlet_mdot]
    type = Receiver
    default = ${fparse 1980 * inlet_velocity * inlet_area}
  []
  [inlet_T]
    type = Receiver
    default = ${inlet_temp}
  []
  [inlet_scalar_value]
    type = Receiver
    default = 0.2
  []
[]
[AuxVariables]
  [power_density]
    type = MooseVariableFVReal
    initial_condition = 1e4
  []
[]
[FunctorMaterials]
  [const_functor]
    type = ADGenericFunctorMaterial
    prop_names = 'cp k mu'
    prop_values = '${cp} ${k} ${mu}'
  []
  [rho]
    type = RhoFromPTFunctorMaterial
    fp = fp
    temperature = T_fluid
    pressure = pressure
  []
[]
[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-2
    optimal_iterations = 6
  []
  end_time = 1
  nl_abs_tol = 1e-9
  nl_max_its = 50
  line_search = 'none'
  automatic_scaling = true
[]
[Outputs]
  exodus = true
  execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/pwcns/boundary_conditions/flux_bcs_mdot-action.i)
l = 10
inlet_area = 2
# 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.001
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = ${l}
    ymin = 0
    ymax = ${inlet_area}
    nx = 10
    ny = 5
  []
[]
[FluidProperties]
  [fp]
    type = FlibeFluidProperties
  []
[]
[Modules]
  [NavierStokesFV]
    compressibility = 'weakly-compressible'
    add_energy_equation = true
    porous_medium_treatment = true
    porosity = 'porosity'
    density = 'rho'
    dynamic_viscosity = 'mu'
    thermal_conductivity = 'k'
    specific_heat = 'cp'
    initial_velocity = '${inlet_velocity} 1e-15 0'
    initial_temperature = '${inlet_temp}'
    initial_pressure = '${outlet_pressure}'
    inlet_boundaries = 'left'
    momentum_inlet_types = 'flux-mass'
    flux_inlet_pps = 'inlet_mdot'
    energy_inlet_types = 'flux-mass'
    energy_inlet_functors = 'inlet_T'
    wall_boundaries = 'top bottom'
    momentum_wall_types = 'noslip noslip'
    energy_wall_types = 'heatflux heatflux'
    energy_wall_functors = '0 0'
    outlet_boundaries = 'right'
    momentum_outlet_types = 'fixed-pressure'
    pressure_functors = '${outlet_pressure}'
    external_heat_source = 'power_density'
    mass_advection_interpolation = 'average'
    momentum_advection_interpolation = 'average'
    energy_advection_interpolation = 'average'
  []
[]
[Postprocessors]
  [inlet_mdot]
    type = Receiver
    default = ${fparse 1980 * inlet_velocity * inlet_area}
  []
  [inlet_T]
    type = Receiver
    default = ${inlet_temp}
  []
[]
[AuxVariables]
  [power_density]
    type = MooseVariableFVReal
    initial_condition = 1e4
  []
[]
[FunctorMaterials]
  [const_functor]
    type = ADGenericFunctorMaterial
    prop_names = 'cp k mu porosity'
    prop_values = '${cp} ${k} ${mu} 0.5'
  []
  [rho]
    type = RhoFromPTFunctorMaterial
    fp = fp
    temperature = T_fluid
    pressure = pressure
  []
[]
[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-2
    optimal_iterations = 6
  []
  end_time = 1
  nl_abs_tol = 1e-9
  nl_max_its = 50
  line_search = 'none'
  automatic_scaling = true
[]
[Outputs]
  exodus = true
  execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_mdot.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.001
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = ${l}
    ymin = 0
    ymax = 1
    nx = 10
    ny = 5
  []
[]
[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
  []
[]
[AuxVariables]
  [power_density]
    type = MooseVariableFVReal
    initial_condition = 1e4
  []
[]
[FVKernels]
  # Mass equation
  [mass_time]
    type = WCNSFVMassTimeDerivative
    variable = pressure
    drho_dt = drho_dt
  []
  [mass]
    type = WCNSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
  []
  # 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
    h = h
    dh_dt = dh_dt
  []
  [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_p]
    type = INSFVOutletPressureBC
    variable = pressure
    boundary = 'right'
    function = ${outlet_pressure}
  []
  # Walls
  [no_slip_x]
    type = INSFVNoSlipWallBC
    variable = vel_x
    boundary = 'top bottom'
    function = 0
  []
  [no_slip_y]
    type = INSFVNoSlipWallBC
    variable = vel_y
    boundary = 'top bottom'
    function = 0
  []
[]
# used for the boundary conditions in this example
[Postprocessors]
  [inlet_mdot]
    type = Receiver
    default = ${fparse 1980 * inlet_velocity * inlet_area}
  []
  [area_pp_left]
    type = AreaPostprocessor
    boundary = 'left'
    execute_on = 'INITIAL'
  []
  [inlet_T]
    type = Receiver
    default = ${inlet_temp}
  []
  [inlet_scalar_value]
    type = Receiver
    default = 0.2
  []
[]
[FluidProperties]
  [fp]
    type = FlibeFluidProperties
  []
[]
[FunctorMaterials]
  [const_functor]
    type = ADGenericFunctorMaterial
    prop_names = 'cp k'
    prop_values = '${cp} ${k}'
  []
  [rho]
    type = RhoFromPTFunctorMaterial
    fp = fp
    temperature = T_fluid
    pressure = pressure
  []
  [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-2
    optimal_iterations = 6
  []
  end_time = 1
  nl_abs_tol = 1e-9
  nl_max_its = 50
  line_search = 'none'
  automatic_scaling = true
[]
[Outputs]
  exodus = true
  execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/channel-flow/2d-transient-physics.i)
l = 10
# 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_v = 0.001
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = ${l}
    ymin = 0
    ymax = 1
    nx = 20
    ny = 10
  []
[]
[Physics]
  [NavierStokes]
    [Flow]
      [flow]
        compressibility = 'weakly-compressible'
        velocity_variable = 'vel_x vel_y'
        density = 'rho'
        dynamic_viscosity = 'mu'
        initial_velocity = '${inlet_v} 1e-15 0'
        initial_pressure = '${outlet_pressure}'
        inlet_boundaries = 'left'
        momentum_inlet_types = 'fixed-velocity'
        momentum_inlet_functors = '${inlet_v} 0'
        wall_boundaries = 'top bottom'
        momentum_wall_types = 'noslip noslip'
        outlet_boundaries = 'right'
        momentum_outlet_types = 'fixed-pressure'
        pressure_functors = '${outlet_pressure}'
        mass_advection_interpolation = 'average'
        momentum_advection_interpolation = 'average'
      []
    []
    [FluidHeatTransfer]
      [energy]
        coupled_flow_physics = flow
        thermal_conductivity = 'k'
        specific_heat = 'cp'
        initial_temperature = '${inlet_temp}'
        energy_inlet_types = 'fixed-temperature'
        energy_inlet_functors = '${inlet_temp}'
        energy_wall_types = 'heatflux heatflux'
        energy_wall_functors = '0 0'
        external_heat_source = 'power_density'
        energy_advection_interpolation = 'average'
      []
    []
    [Turbulence]
      [turbulence]
        coupled_flow_physics = flow
        fluid_heat_transfer_physics = energy
      []
    []
  []
[]
[AuxVariables]
  [power_density]
    type = MooseVariableFVReal
    initial_condition = 1e4
  []
[]
[FluidProperties]
  [fp]
    type = FlibeFluidProperties
  []
[]
[FunctorMaterials]
  [const_functor]
    type = ADGenericFunctorMaterial
    prop_names = 'cp k mu'
    prop_values = '${cp} ${k} ${mu}'
  []
  [rho]
    type = RhoFromPTFunctorMaterial
    fp = fp
    temperature = T_fluid
    pressure = pressure
  []
[]
[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-3
    optimal_iterations = 6
  []
  end_time = 15
  nl_abs_tol = 1e-9
  nl_max_its = 50
  line_search = 'none'
  automatic_scaling = true
  off_diagonals_in_auto_scaling = true
  compute_scaling_once = false
[]
[Outputs]
  exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/pwcns/channel-flow/2d-transient-action.i)
# Solid properties
cp_s = 2
rho_s = 4
k_s = 1e-2
h_fs = 10
# Operating conditions
u_inlet = 1
T_inlet = 200
p_outlet = 10
top_side_temperature = 150
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 10
    ymin = 0
    ymax = 1
    nx = 20
    ny = 5
  []
[]
[Variables]
  [T_solid]
    type = INSFVEnergyVariable
    initial_condition = 100
  []
[]
[AuxVariables]
  [porosity]
    type = MooseVariableFVReal
    initial_condition = 0.5
  []
  [velocity_norm]
    type = MooseVariableFVReal
  []
[]
[FluidProperties]
  [fp]
    type = FlibeFluidProperties
  []
[]
[Modules]
  [NavierStokesFV]
    compressibility = 'weakly-compressible'
    add_energy_equation = true
    porous_medium_treatment = true
    density = 'rho'
    dynamic_viscosity = 'mu'
    thermal_conductivity = 'k'
    specific_heat = 'cp'
    initial_velocity = '${u_inlet} 1e-6 0'
    initial_pressure = '${p_outlet}'
    initial_temperature = '${T_inlet}'
    inlet_boundaries = 'left'
    momentum_inlet_types = 'fixed-velocity'
    momentum_inlet_functors = '${u_inlet} 0'
    energy_inlet_types = 'fixed-temperature'
    energy_inlet_functors = '${T_inlet}'
    wall_boundaries = 'top bottom'
    momentum_wall_types = 'noslip symmetry'
    energy_wall_types = 'heatflux heatflux'
    energy_wall_functors = '0 0'
    outlet_boundaries = 'right'
    momentum_outlet_types = 'fixed-pressure'
    pressure_functors = '${p_outlet}'
    ambient_convection_alpha = 'h_cv'
    ambient_temperature = 'T_solid'
    mass_advection_interpolation = 'average'
    momentum_advection_interpolation = 'average'
    energy_advection_interpolation = 'average'
  []
[]
[FVKernels]
  [solid_energy_time]
    type = PINSFVEnergyTimeDerivative
    variable = T_solid
    cp = ${cp_s}
    rho = ${rho_s}
    is_solid = true
    porosity = 'porosity'
  []
  [solid_energy_diffusion]
    type = FVDiffusion
    variable = T_solid
    # this should use eps * k instead of k
    coeff = ${k_s}
  []
  [solid_energy_convection]
    type = PINSFVEnergyAmbientConvection
    variable = T_solid
    is_solid = true
    T_fluid = 'T_fluid'
    T_solid = 'T_solid'
    h_solid_fluid = 'h_cv'
  []
[]
[FVBCs]
  [heated-side]
    type = FVDirichletBC
    boundary = 'top'
    variable = 'T_solid'
    value = ${top_side_temperature}
  []
[]
[FunctorMaterials]
  [const_functor]
    type = ADGenericFunctorMaterial
    prop_names = 'h_cv'
    prop_values = '${h_fs}'
  []
  [fluid_props_to_mat_props]
    type = GeneralFunctorFluidProps
    fp = fp
    pressure = 'pressure'
    T_fluid = 'T_fluid'
    speed = 'velocity_norm'
    # To initialize with a high viscosity
    mu_rampdown = 'mu_rampdown'
    # For porous flow
    characteristic_length = 1
    porosity = 'porosity'
  []
[]
[Functions]
  [mu_rampdown]
    type = PiecewiseLinear
    x = '1 2 3 4'
    y = '1e3 1e2 1e1 1'
  []
[]
[AuxKernels]
  [speed]
    type = ParsedAux
    variable = 'velocity_norm'
    coupled_variables = 'superficial_vel_x superficial_vel_y porosity'
    expression = 'sqrt(superficial_vel_x*superficial_vel_x + superficial_vel_y*superficial_vel_y) / porosity'
  []
[]
[Executioner]
  type = Transient
  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_rel_tol = 1e-12
  end_time = 3.0
[]
# Some basic Postprocessors to examine the solution
[Postprocessors]
  [inlet-p]
    type = SideAverageValue
    variable = pressure
    boundary = 'left'
  []
  [outlet-u]
    type = SideAverageValue
    variable = superficial_vel_x
    boundary = 'right'
  []
  [outlet-temp]
    type = SideAverageValue
    variable = T_fluid
    boundary = 'right'
  []
  [solid-temp]
    type = ElementAverageValue
    variable = T_solid
  []
[]
[Outputs]
  exodus = true
  csv = false
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/materials/2d-transient-physics.i)
l = 10
advected_interp_method = 'average'
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_v = 0.001
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = ${l}
    ymin = 0
    ymax = 1
    nx = 20
    ny = 10
  []
[]
[Physics]
  [NavierStokes]
    [Flow]
      [flow]
        compressibility = 'weakly-compressible'
        fp = 'fp'
        velocity_variable = 'u v'
        fluid_temperature_variable = 'T'
        density = 'rho'
        dynamic_viscosity = 'mu'
        mu_rampdown = 'mu_rampdown'
        initial_velocity = '${inlet_v} 0 0'
        initial_pressure = '${outlet_pressure}'
        inlet_boundaries = 'left'
        momentum_inlet_types = 'fixed-velocity'
        momentum_inlet_functors = '${inlet_v} 0'
        wall_boundaries = 'top bottom'
        momentum_wall_types = 'noslip noslip'
        outlet_boundaries = 'right'
        momentum_outlet_types = 'fixed-pressure'
        pressure_functors = '${outlet_pressure}'
        mass_advection_interpolation = ${advected_interp_method}
        momentum_advection_interpolation = ${advected_interp_method}
      []
    []
    [FluidHeatTransfer]
      [energy]
        coupled_flow_physics = flow
        fluid_temperature_variable = 'T'
        fp = 'fp'
        thermal_conductivity = 'k'
        specific_heat = 'cp'
        initial_temperature = '${inlet_temp}'
        energy_inlet_types = 'fixed-temperature'
        energy_inlet_functors = '${inlet_temp}'
        energy_wall_types = 'heatflux heatflux'
        energy_wall_functors = '0 0'
        external_heat_source = 'power_density'
        energy_advection_interpolation = 'average'
      []
    []
    [Turbulence]
      [turbulence]
        coupled_flow_physics = flow
        fluid_heat_transfer_physics = energy
      []
    []
  []
[]
[AuxVariables]
  [velocity_norm]
    type = MooseVariableFVReal
  []
  [power_density]
    type = MooseVariableFVReal
    initial_condition = 1e4
  []
[]
[FluidProperties]
  [fp]
    type = FlibeFluidProperties
    # AD-version of h_from_p_T(p, T, h, dh_dp, dh_dT) not implemented
    allow_imperfect_jacobians = true
  []
[]
[AuxKernels]
  [speed]
    type = VectorMagnitudeAux
    variable = 'velocity_norm'
    x = u
    y = v
  []
[]
[Functions]
  [mu_rampdown]
    type = PiecewiseLinear
    x = '1 2 3 4'
    y = '1e3 1e2 1e1 1'
  []
[]
[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-3
    optimal_iterations = 6
  []
  end_time = 15
  nl_abs_tol = 1e-12
  nl_max_its = 50
  line_search = 'none'
  automatic_scaling = true
  off_diagonals_in_auto_scaling = true
  compute_scaling_once = false
[]
[Outputs]
  exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_velocity.i)
rho = 'rho'
l = 10
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.001
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = ${l}
    ymin = 0
    ymax = 1
    nx = 10
    ny = 5
  []
[]
[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
  []
[]
[AuxVariables]
  [power_density]
    type = MooseVariableFVReal
    initial_condition = 1e4
  []
[]
[FVKernels]
  [mass_time]
    type = WCNSFVMassTimeDerivative
    variable = pressure
    drho_dt = drho_dt
  []
  [mass]
    type = WCNSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
  []
  [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
  []
  [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
  []
  [temp_time]
    type = WCNSFVEnergyTimeDerivative
    variable = T_fluid
    rho = rho
    drho_dt = drho_dt
    h = h
    dh_dt = dh_dt
  []
  [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'
    velocity_pp = 'inlet_u'
    rho = 'rho'
    vel_x = vel_x
    vel_y = vel_y
  []
  [inlet_u]
    type = WCNSFVMomentumFluxBC
    variable = vel_x
    boundary = 'left'
    velocity_pp = 'inlet_u'
    rho = 'rho'
    momentum_component = 'x'
    vel_x = vel_x
    vel_y = vel_y
  []
  [inlet_v]
    type = WCNSFVMomentumFluxBC
    variable = vel_y
    boundary = 'left'
    velocity_pp = 0
    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'
    velocity_pp = 'inlet_u'
    temperature_pp = 'inlet_T'
    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'
    velocity_pp = 'inlet_u'
    vel_x = vel_x
    vel_y = vel_y
    rho = rho
    passive_scalar = scalar
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    variable = pressure
    boundary = 'right'
    function = ${outlet_pressure}
  []
  # Walls
  [no_slip_x]
    type = INSFVNoSlipWallBC
    variable = vel_x
    boundary = 'top bottom'
    function = 0
  []
  [no_slip_y]
    type = INSFVNoSlipWallBC
    variable = vel_y
    boundary = 'top bottom'
    function = 0
  []
[]
# used for the boundary conditions in this example
[Postprocessors]
  [inlet_u]
    type = Receiver
    default = ${inlet_velocity}
  []
  [area_pp_left]
    type = AreaPostprocessor
    boundary = 'left'
    execute_on = 'INITIAL'
  []
  [inlet_T]
    type = Receiver
    default = ${inlet_temp}
  []
  [inlet_scalar_value]
    type = Receiver
    default = 0.2
  []
[]
[FluidProperties]
  [fp]
    type = FlibeFluidProperties
  []
[]
[FunctorMaterials]
  [const_functor]
    type = ADGenericFunctorMaterial
    prop_names = 'cp k'
    prop_values = '${cp} ${k}'
  []
  [rho]
    type = RhoFromPTFunctorMaterial
    fp = fp
    temperature = T_fluid
    pressure = pressure
  []
  [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-2
    optimal_iterations = 6
  []
  end_time = 1
  nl_abs_tol = 1e-9
  nl_max_its = 50
  line_search = 'none'
  automatic_scaling = true
[]
[Outputs]
  exodus = true
  execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/channel-flow/2d-transient-action.i)
l = 10
# 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_v = 0.001
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = ${l}
    ymin = 0
    ymax = 1
    nx = 20
    ny = 10
  []
[]
[Modules]
  [NavierStokesFV]
    compressibility = 'weakly-compressible'
    add_energy_equation = true
    density = 'rho'
    dynamic_viscosity = 'mu'
    thermal_conductivity = 'k'
    specific_heat = 'cp'
    initial_velocity = '${inlet_v} 1e-15 0'
    initial_temperature = '${inlet_temp}'
    initial_pressure = '${outlet_pressure}'
    inlet_boundaries = 'left'
    momentum_inlet_types = 'fixed-velocity'
    momentum_inlet_functors = '${inlet_v} 0'
    energy_inlet_types = 'fixed-temperature'
    energy_inlet_functors = '${inlet_temp}'
    wall_boundaries = 'top bottom'
    momentum_wall_types = 'noslip noslip'
    energy_wall_types = 'heatflux heatflux'
    energy_wall_functors = '0 0'
    outlet_boundaries = 'right'
    momentum_outlet_types = 'fixed-pressure'
    pressure_functors = '${outlet_pressure}'
    external_heat_source = 'power_density'
    mass_advection_interpolation = 'average'
    momentum_advection_interpolation = 'average'
    energy_advection_interpolation = 'average'
  []
[]
[AuxVariables]
  [power_density]
    type = MooseVariableFVReal
    initial_condition = 1e4
  []
[]
[FluidProperties]
  [fp]
    type = FlibeFluidProperties
  []
[]
[FunctorMaterials]
  [const_functor]
    type = ADGenericFunctorMaterial
    prop_names = 'cp k mu'
    prop_values = '${cp} ${k} ${mu}'
  []
  [rho]
    type = RhoFromPTFunctorMaterial
    fp = fp
    temperature = T_fluid
    pressure = pressure
  []
[]
[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-3
    optimal_iterations = 6
  []
  end_time = 15
  nl_abs_tol = 1e-9
  nl_max_its = 50
  line_search = 'none'
  automatic_scaling = true
  off_diagonals_in_auto_scaling = true
  compute_scaling_once = false
[]
[Outputs]
  exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/materials/functorfluidprops.i)
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_v = 4
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 2
    ymin = 0
    ymax = 1
    nx = 5
    ny = 5
  []
[]
[Variables]
  [u]
    type = INSFVVelocityVariable
    initial_condition = ${inlet_v}
  []
  [v]
    type = INSFVVelocityVariable
    initial_condition = 2
  []
  [pressure]
    type = INSFVPressureVariable
    initial_condition = ${outlet_pressure}
  []
  [T]
    type = INSFVEnergyVariable
    initial_condition = ${inlet_temp}
  []
[]
[FVKernels]
  [u_time]
    type = FVFunctorTimeKernel
    variable = u
  []
  [v_time]
    type = FVFunctorTimeKernel
    variable = v
  []
  [p_time]
    type = FVFunctorTimeKernel
    variable = pressure
  []
  [T_time]
    type = FVFunctorTimeKernel
    variable = T
  []
[]
[FluidProperties]
  [fp]
    type = FlibeFluidProperties
  []
[]
[FunctorMaterials]
  [fluid_props_to_mat_props]
    type = GeneralFunctorFluidProps
    fp = fp
    pressure = 'pressure'
    T_fluid = 'T'
    speed = 'velocity_norm'
    # For porous flow
    characteristic_length = 2
    porosity = 'porosity'
  []
[]
[AuxVariables]
  [velocity_norm]
    type = MooseVariableFVReal
  []
  [porosity]
    type = MooseVariableFVReal
    initial_condition = 0.4
  []
  [rho_var]
    type = MooseVariableFVReal
  []
  [drho_dp_var]
    type = MooseVariableFVReal
  []
  [drho_dT_var]
    type = MooseVariableFVReal
  []
  [rho_dot_var]
    type = MooseVariableFVReal
  []
  [cp_var]
    type = MooseVariableFVReal
  []
  [dcp_dp_var]
    type = MooseVariableFVReal
  []
  [dcp_dT_var]
    type = MooseVariableFVReal
  []
  [cp_dot_var]
    type = MooseVariableFVReal
  []
  [cv_var]
    type = MooseVariableFVReal
  []
  [mu_var]
    type = MooseVariableFVReal
  []
  [dmu_dp_var]
    type = MooseVariableFVReal
  []
  [dmu_dT_var]
    type = MooseVariableFVReal
  []
  [k_var]
    type = MooseVariableFVReal
  []
  [dk_dp_var]
    type = MooseVariableFVReal
  []
  [dk_dT_var]
    type = MooseVariableFVReal
  []
  [Pr_var]
    type = MooseVariableFVReal
  []
  [dPr_dp_var]
    type = MooseVariableFVReal
  []
  [dPr_dT_var]
    type = MooseVariableFVReal
  []
  [Re_var]
    type = MooseVariableFVReal
  []
  [dRe_dp_var]
    type = MooseVariableFVReal
  []
  [dRe_dT_var]
    type = MooseVariableFVReal
  []
  [Re_h_var]
    type = MooseVariableFVReal
  []
  [Re_i_var]
    type = MooseVariableFVReal
  []
[]
[AuxKernels]
  [speed]
    type = VectorMagnitudeAux
    variable = 'velocity_norm'
    x = u
    y = v
  []
  # To output the functor material properties
  [rho_out]
    type = FunctorAux
    functor = 'rho'
    variable = 'rho_var'
    execute_on = 'timestep_begin'
  []
  [drho_dp_out]
    type = FunctorAux
    functor = 'drho/dpressure'
    variable = 'drho_dp_var'
    execute_on = 'timestep_begin'
  []
  [drho_dT_out]
    type = FunctorAux
    functor = 'drho/dT_fluid'
    variable = 'drho_dT_var'
    execute_on = 'timestep_begin'
  []
  [drho_dt_out]
    type = FunctorAux
    functor = 'drho_dt'
    variable = 'rho_dot_var'
    execute_on = 'timestep_begin'
  []
  [cp_out]
    type = FunctorAux
    functor = 'cp'
    variable = 'cp_var'
    execute_on = 'timestep_begin'
  []
  [dcp_dp_out]
    type = FunctorAux
    functor = 'dcp/dpressure'
    variable = 'dcp_dp_var'
    execute_on = 'timestep_begin'
  []
  [dcp_dT_out]
    type = FunctorAux
    functor = 'dcp/dT_fluid'
    variable = 'dcp_dT_var'
    execute_on = 'timestep_begin'
  []
  [dcp_dt_out]
    type = FunctorAux
    functor = 'dcp_dt'
    variable = 'cp_dot_var'
    execute_on = 'timestep_begin'
  []
  [cv_out]
    type = FunctorAux
    functor = 'cv'
    variable = 'cv_var'
    execute_on = 'timestep_begin'
  []
  [mu_out]
    type = FunctorAux
    functor = 'mu'
    variable = 'mu_var'
    execute_on = 'timestep_begin'
  []
  [dmu_dp_out]
    type = FunctorAux
    functor = 'dmu/dpressure'
    variable = 'dmu_dp_var'
    execute_on = 'timestep_begin'
  []
  [dmu_dT_out]
    type = FunctorAux
    functor = 'dmu/dT_fluid'
    variable = 'dmu_dT_var'
    execute_on = 'timestep_begin'
  []
  [k_out]
    type = FunctorAux
    functor = 'k'
    variable = 'k_var'
    execute_on = 'timestep_begin'
  []
  [dk_dp_out]
    type = FunctorAux
    functor = 'dk/dpressure'
    variable = 'dk_dp_var'
    execute_on = 'timestep_begin'
  []
  [dk_dT_out]
    type = FunctorAux
    functor = 'dk/dT_fluid'
    variable = 'dk_dT_var'
    execute_on = 'timestep_begin'
  []
  [Pr_out]
    type = FunctorAux
    functor = 'Pr'
    variable = 'Pr_var'
    execute_on = 'timestep_begin'
  []
  [dPr_dp_out]
    type = FunctorAux
    functor = 'dPr/dpressure'
    variable = 'dPr_dp_var'
    execute_on = 'timestep_begin'
  []
  [dPr_dT_out]
    type = FunctorAux
    functor = 'dPr/dT_fluid'
    variable = 'dPr_dT_var'
    execute_on = 'timestep_begin'
  []
  [Re_out]
    type = FunctorAux
    functor = 'Re'
    variable = 'Re_var'
    execute_on = 'timestep_begin'
  []
  [dRe_dp_out]
    type = FunctorAux
    functor = 'dRe/dpressure'
    variable = 'dRe_dp_var'
    execute_on = 'timestep_begin'
  []
  [dRe_dT_out]
    type = FunctorAux
    functor = 'dRe/dT_fluid'
    variable = 'dRe_dT_var'
    execute_on = 'timestep_begin'
  []
  [Re_h_out]
    type = FunctorAux
    functor = 'Re_h'
    variable = 'Re_h_var'
    execute_on = 'timestep_begin'
  []
  [Re_i_out]
    type = FunctorAux
    functor = 'Re_i'
    variable = 'Re_i_var'
    execute_on = 'timestep_begin'
  []
[]
[Executioner]
  type = Transient
  end_time = 0.1
  dt = 0.1
[]
[Outputs]
  exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/materials/2d-transient.i)
l = 10
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_v = 0.001
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = ${l}
    ymin = 0
    ymax = 1
    nx = 20
    ny = 10
  []
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
  rho = 'rho'
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = u
    v = v
    pressure = pressure
  []
[]
[Variables]
  [u]
    type = INSFVVelocityVariable
    initial_condition = ${inlet_v}
  []
  [v]
    type = INSFVVelocityVariable
    initial_condition = 1e-15
  []
  [pressure]
    type = INSFVPressureVariable
    initial_condition = ${outlet_pressure}
  []
  [T]
    type = INSFVEnergyVariable
    initial_condition = ${inlet_temp}
  []
[]
[AuxVariables]
  [velocity_norm]
    type = MooseVariableFVReal
  []
  [power_density]
    type = MooseVariableFVReal
    initial_condition = 1e4
  []
[]
[FVKernels]
  [mass_time]
    type = WCNSFVMassTimeDerivative
    variable = pressure
    drho_dt = drho_dt
  []
  [mass]
    type = WCNSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = 'rho'
  []
  [u_time]
    type = WCNSFVMomentumTimeDerivative
    variable = u
    drho_dt = drho_dt
    rho = rho
    momentum_component = 'x'
  []
  [u_advection]
    type = INSFVMomentumAdvection
    variable = u
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = ${advected_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_time]
    type = WCNSFVMomentumTimeDerivative
    variable = v
    drho_dt = drho_dt
    rho = rho
    momentum_component = 'y'
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = v
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = ${advected_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
  []
  [temp_time]
    type = WCNSFVEnergyTimeDerivative
    variable = T
    rho = rho
    drho_dt = drho_dt
    h = h
    dh_dt = dh_dt
  []
  [temp_conduction]
    type = FVDiffusion
    coeff = 'k'
    variable = T
  []
  [temp_advection]
    type = INSFVEnergyAdvection
    variable = T
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = ${advected_interp_method}
  []
  [heat_source]
    type = FVCoupledForce
    variable = T
    v = power_density
  []
[]
[FVBCs]
  [no_slip_x]
    type = INSFVNoSlipWallBC
    variable = u
    boundary = 'top bottom'
    function = 0
  []
  [no_slip_y]
    type = INSFVNoSlipWallBC
    variable = v
    boundary = 'top bottom'
    function = 0
  []
  # Inlet
  [inlet_u]
    type = INSFVInletVelocityBC
    variable = u
    boundary = 'left'
    functor = ${inlet_v}
  []
  [inlet_v]
    type = INSFVInletVelocityBC
    variable = v
    boundary = 'left'
    functor = 0
  []
  [inlet_T]
    type = FVDirichletBC
    variable = T
    boundary = 'left'
    value = ${inlet_temp}
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    variable = pressure
    boundary = 'right'
    function = ${outlet_pressure}
  []
[]
[FluidProperties]
  [fp]
    type = FlibeFluidProperties
    # AD-version of h_from_p_T(p, T, h, dh_dp, dh_dT) not implemented
    allow_imperfect_jacobians = true
  []
[]
[FunctorMaterials]
  [ins_fv]
    type = INSFVEnthalpyFunctorMaterial
    temperature = 'T'
    rho = 'rho'
  []
  [fluid_props_to_mat_props]
    type = GeneralFunctorFluidProps
    fp = fp
    pressure = 'pressure'
    T_fluid = 'T'
    speed = 'velocity_norm'
    # even though we provide rho from the parameters, we
    # want to get rho from the fluid properties
    force_define_density = true
    # To initialize with a high viscosity
    mu_rampdown = 'mu_rampdown'
    # For porous flow
    characteristic_length = 1
    porosity = 1
  []
[]
[AuxKernels]
  [speed]
    type = VectorMagnitudeAux
    variable = 'velocity_norm'
    x = u
    y = v
  []
[]
[Functions]
  [mu_rampdown]
    type = PiecewiseLinear
    x = '1 2 3 4'
    y = '1e3 1e2 1e1 1'
  []
[]
[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-3
    optimal_iterations = 6
  []
  end_time = 15
  nl_abs_tol = 1e-12
  nl_max_its = 50
  line_search = 'none'
  automatic_scaling = true
  off_diagonals_in_auto_scaling = true
  compute_scaling_once = false
[]
[Outputs]
  exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/pwcns/channel-flow/2d-transient-physics.i)
# Solid properties
cp_s = 2
rho_s = 4
k_s = '${fparse 1e-2 / 0.5}'
h_fs = 10
# thermal diffusivity is divided by 0.5 to match the reference using the action
# Operating conditions
u_inlet = 1
T_inlet = 200
p_outlet = 10
top_side_temperature = 150
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 10
    ymin = 0
    ymax = 1
    nx = 20
    ny = 5
  []
[]
[AuxVariables]
  [porosity]
    type = MooseVariableFVReal
    initial_condition = 0.5
  []
  [velocity_norm]
    type = MooseVariableFVReal
  []
[]
[FluidProperties]
  [fp]
    type = FlibeFluidProperties
  []
[]
[Physics]
  [NavierStokes]
    [Flow]
      [flow]
        compressibility = 'weakly-compressible'
        porous_medium_treatment = true
        define_variables = true
        pressure_variable = 'pressure'
        density = 'rho'
        dynamic_viscosity = 'mu'
        initial_velocity = '${u_inlet} 1e-6 0'
        initial_pressure = '${p_outlet}'
        inlet_boundaries = 'left'
        momentum_inlet_types = 'fixed-velocity'
        momentum_inlet_functors = '${u_inlet} 0'
        wall_boundaries = 'top bottom'
        momentum_wall_types = 'noslip symmetry'
        outlet_boundaries = 'right'
        momentum_outlet_types = 'fixed-pressure'
        pressure_functors = '${p_outlet}'
        mass_advection_interpolation = 'average'
        momentum_advection_interpolation = 'average'
      []
    []
    [FluidHeatTransfer]
      [fluid]
        thermal_conductivity = 'k'
        effective_conductivity = true
        specific_heat = 'cp'
        initial_temperature = '${T_inlet}'
        # See 'flow' for inlet boundaries
        energy_inlet_types = 'fixed-temperature'
        energy_inlet_functors = '${T_inlet}'
        # See 'flow' for wall boundaries
        energy_wall_types = 'heatflux heatflux'
        energy_wall_functors = '0 0'
        ambient_convection_alpha = 'h_cv'
        ambient_temperature = 'T_solid'
        energy_advection_interpolation = 'average'
      []
    []
    [SolidHeatTransfer]
      [solid]
        block = 0
        initial_temperature = 100
        transient = true
        # To match the previous test results
        solid_temperature_two_term_bc_expansion = true
        thermal_conductivity_solid = '${k_s}'
        cp_solid = ${cp_s}
        rho_solid = ${rho_s}
        fixed_temperature_boundaries = 'top'
        boundary_temperatures = '${top_side_temperature}'
        ambient_convection_alpha = 'h_cv'
        ambient_convection_temperature = 'T_fluid'
        verbose = true
      []
    []
  []
[]
[FunctorMaterials]
  [const_functor]
    type = ADGenericFunctorMaterial
    prop_names = 'h_cv'
    prop_values = '${h_fs}'
  []
  [fluid_props_to_mat_props]
    type = GeneralFunctorFluidProps
    fp = fp
    pressure = 'pressure'
    T_fluid = 'T_fluid'
    speed = 'velocity_norm'
    # To initialize with a high viscosity
    mu_rampdown = 'mu_rampdown'
    # For porous flow
    characteristic_length = 1
    porosity = 'porosity'
  []
[]
[Functions]
  [mu_rampdown]
    type = PiecewiseLinear
    x = '1 2 3 4'
    y = '1e3 1e2 1e1 1'
  []
[]
[AuxKernels]
  [speed]
    type = ParsedAux
    variable = 'velocity_norm'
    coupled_variables = 'superficial_vel_x superficial_vel_y porosity'
    expression = 'sqrt(superficial_vel_x*superficial_vel_x + superficial_vel_y*superficial_vel_y) / porosity'
  []
[]
[Executioner]
  type = Transient
  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_rel_tol = 1e-12
  end_time = 3.0
[]
# Some basic Postprocessors to examine the solution
[Postprocessors]
  [inlet-p]
    type = SideAverageValue
    variable = pressure
    boundary = 'left'
  []
  [outlet-u]
    type = SideAverageValue
    variable = superficial_vel_x
    boundary = 'right'
  []
  [outlet-temp]
    type = SideAverageValue
    variable = T_fluid
    boundary = 'right'
  []
  [solid-temp]
    type = ElementAverageValue
    variable = T_solid
  []
[]
[Outputs]
  exodus = true
  csv = false
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/dirichlet_bcs_mdot.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.001
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = ${l}
    ymin = 0
    ymax = 1
    nx = 10
    ny = 5
  []
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = u
    v = v
    pressure = pressure
  []
[]
[Variables]
  [u]
    type = INSFVVelocityVariable
    initial_condition = ${inlet_velocity}
  []
  [v]
    type = INSFVVelocityVariable
    initial_condition = 1e-15
  []
  [pressure]
    type = INSFVPressureVariable
    initial_condition = ${outlet_pressure}
  []
  [T]
    type = INSFVEnergyVariable
    initial_condition = ${inlet_temp}
  []
[]
[AuxVariables]
  [power_density]
    type = MooseVariableFVReal
    initial_condition = 1e4
  []
[]
[FVKernels]
  [mass_time]
    type = WCNSFVMassTimeDerivative
    variable = pressure
    drho_dt = drho_dt
  []
  [mass]
    type = WCNSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
  []
  [u_time]
    type = WCNSFVMomentumTimeDerivative
    variable = u
    drho_dt = drho_dt
    rho = rho
    momentum_component = 'x'
  []
  [u_advection]
    type = INSFVMomentumAdvection
    variable = u
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = ${advected_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_time]
    type = WCNSFVMomentumTimeDerivative
    variable = v
    drho_dt = drho_dt
    rho = rho
    momentum_component = 'y'
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = v
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = ${advected_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
  []
  [temp_time]
    type = WCNSFVEnergyTimeDerivative
    variable = T
    rho = rho
    drho_dt = drho_dt
    h = h
    dh_dt = dh_dt
  []
  [temp_conduction]
    type = FVDiffusion
    coeff = 'k'
    variable = T
  []
  [temp_advection]
    type = INSFVEnergyAdvection
    variable = T
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = ${advected_interp_method}
  []
  [heat_source]
    type = FVCoupledForce
    variable = T
    v = power_density
  []
[]
[FVBCs]
  # Inlet
  [inlet_u]
    type = WCNSFVInletVelocityBC
    variable = u
    boundary = 'left'
    mdot_pp = 'inlet_mdot'
    area_pp = 'surface_inlet'
    rho = 'rho'
  []
  [inlet_v]
    type = WCNSFVInletVelocityBC
    variable = v
    boundary = 'left'
    mdot_pp = 0
    area_pp = 'surface_inlet'
    rho = 'rho'
  []
  [inlet_T]
    type = WCNSFVInletTemperatureBC
    variable = T
    boundary = 'left'
    temperature_pp = 'inlet_T'
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    variable = pressure
    boundary = 'right'
    function = ${outlet_pressure}
  []
  # Walls
  [no_slip_x]
    type = INSFVNoSlipWallBC
    variable = u
    boundary = 'top bottom'
    function = 0
  []
  [no_slip_y]
    type = INSFVNoSlipWallBC
    variable = v
    boundary = 'top bottom'
    function = 0
  []
[]
# used for the boundary conditions in this example
[Postprocessors]
  [inlet_mdot]
    type = Receiver
    default = ${fparse 1980 * inlet_velocity * inlet_area}
  []
  [surface_inlet]
    type = AreaPostprocessor
    boundary = 'left'
    execute_on = 'INITIAL'
  []
  [inlet_T]
    type = Receiver
    default = ${inlet_temp}
  []
[]
[FluidProperties]
  [fp]
    type = FlibeFluidProperties
  []
[]
[FunctorMaterials]
  [const_functor]
    type = ADGenericFunctorMaterial
    prop_names = 'cp k'
    prop_values = '${cp} ${k}'
  []
  [rho]
    type = RhoFromPTFunctorMaterial
    fp = fp
    temperature = T
    pressure = pressure
  []
  [ins_fv]
    type = INSFVEnthalpyFunctorMaterial
    temperature = 'T'
    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-2
    optimal_iterations = 6
  []
  end_time = 1
  nl_abs_tol = 1e-9
  nl_max_its = 50
  line_search = 'none'
  automatic_scaling = true
[]
[Outputs]
  exodus = true
  execute_on = 'FINAL'
[]
(modules/navier_stokes/test/tests/finite_volume/controls/switch-pressure-bc/switch_vel_pres_bc.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.001
end_time = 3.0
switch_time = 1.0
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = ${l}
    ymin = 0
    ymax = 1
    nx = 10
    ny = 5
  []
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = u
    v = v
    pressure = pressure
  []
[]
[Variables]
  [u]
    type = INSFVVelocityVariable
    initial_condition = ${inlet_velocity}
  []
  [v]
    type = INSFVVelocityVariable
  []
  [pressure]
    type = INSFVPressureVariable
    initial_condition = ${outlet_pressure}
  []
  [T]
    type = INSFVEnergyVariable
    initial_condition = ${inlet_temp}
  []
[]
[AuxVariables]
  [power_density]
    type = MooseVariableFVReal
    initial_condition = 1e4
  []
[]
[FVKernels]
  [mass_time]
    type = WCNSFVMassTimeDerivative
    variable = pressure
    drho_dt = drho_dt
  []
  [mass]
    type = INSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
  []
  [u_time]
    type = WCNSFVMomentumTimeDerivative
    variable = u
    drho_dt = drho_dt
    rho = rho
    momentum_component = 'x'
  []
  [u_advection]
    type = INSFVMomentumAdvection
    variable = u
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = ${advected_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_time]
    type = WCNSFVMomentumTimeDerivative
    variable = v
    drho_dt = drho_dt
    rho = rho
    momentum_component = 'y'
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = v
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = ${advected_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
  []
  [temp_time]
    type = WCNSFVEnergyTimeDerivative
    variable = T
    rho = rho
    drho_dt = drho_dt
  []
  [temp_conduction]
    type = FVDiffusion
    coeff = 'k'
    variable = T
  []
  [temp_advection]
    type = INSFVEnergyAdvection
    variable = T
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = ${advected_interp_method}
  []
  [heat_source]
    type = FVCoupledForce
    variable = T
    v = power_density
  []
[]
[FVBCs]
  # Inlet
  [inlet_u]
    type = WCNSFVSwitchableInletVelocityBC
    variable = u
    boundary = 'left'
    mdot_pp = 'inlet_mdot'
    area_pp = 'surface_inlet'
    rho = 'rho'
    switch_bc = true
    face_limiter = 1.0
  []
  [outlet_u]
    type = WCNSFVSwitchableInletVelocityBC
    variable = u
    boundary = 'right'
    mdot_pp = 'inlet_mdot'
    area_pp = 'surface_inlet'
    rho = 'rho'
    switch_bc = false
    scaling_factor = -1.0
    face_limiter = 1.0
  []
  [inlet_v]
    type = WCNSFVInletVelocityBC
    variable = v
    boundary = 'left'
    mdot_pp = 0
    area_pp = 'surface_inlet'
    rho = 'rho'
  []
  [inlet_T]
    type = WCNSFVInletTemperatureBC
    variable = T
    boundary = 'left'
    temperature_pp = 'inlet_T'
  []
  [outlet_T]
    type = NSFVOutflowTemperatureBC
    variable = T
    boundary = 'right'
    u = u
    v = v
    rho = 'rho'
    cp = 'cp'
    backflow_T = ${inlet_temp}
  []
  [outlet_p]
    type = INSFVSwitchableOutletPressureBC
    variable = pressure
    boundary = 'right'
    function = ${outlet_pressure}
    switch_bc = true
    face_limiter = 1.0
  []
  [inlet_p]
    type = INSFVSwitchableOutletPressureBC
    variable = pressure
    boundary = 'left'
    function = ${outlet_pressure}
    switch_bc = false
    face_limiter = 1.0
  []
  # Walls
  [no_slip_x]
    type = INSFVNoSlipWallBC
    variable = u
    boundary = 'top bottom'
    function = 0
  []
  [no_slip_y]
    type = INSFVNoSlipWallBC
    variable = v
    boundary = 'top bottom'
    function = 0
  []
[]
[Functions]
  [func_coef]
    type = ParsedFunction
    expression = 'if(t<${switch_time} | t>2.0*${switch_time}, 1, 0)'
  []
  [func_coef_comp]
    type = ParsedFunction
    expression = 'if(t<${switch_time} | t>2.0*${switch_time}, 0, 1)'
  []
  [mass_flux_and_pressure_test_scaling]
    type = ParsedFunction
    expression = 'if(t<${switch_time} | t>2.0*${switch_time}, 0.1, 0.2)'
  []
[]
[Controls]
  [func_control_u_inlet]
    type = BoolFunctionControl
    parameter = 'FVBCs/inlet_u/switch_bc'
    function = 'func_coef'
    execute_on = 'initial timestep_begin'
  []
  [func_control_u_outlet]
    type = BoolFunctionControl
    parameter = 'FVBCs/outlet_u/switch_bc'
    function = 'func_coef_comp'
    execute_on = 'initial timestep_begin'
  []
  [func_control_p_outlet]
    type = BoolFunctionControl
    parameter = 'FVBCs/outlet_p/switch_bc'
    function = 'func_coef'
    execute_on = 'initial timestep_begin'
  []
  [func_control_p_inlet]
    type = BoolFunctionControl
    parameter = 'FVBCs/inlet_p/switch_bc'
    function = 'func_coef_comp'
    execute_on = 'initial timestep_begin'
  []
  [func_control_limiter_u_inlet]
    type = RealFunctionControl
    parameter = 'FVBCs/inlet_u/face_limiter'
    function = 'mass_flux_and_pressure_test_scaling'
    execute_on = 'initial timestep_begin'
  []
  [func_control_limiter_u_outlet]
    type = RealFunctionControl
    parameter = 'FVBCs/outlet_u/face_limiter'
    function = 'mass_flux_and_pressure_test_scaling'
    execute_on = 'initial timestep_begin'
  []
  [func_control_limiter_p_outlet]
    type = RealFunctionControl
    parameter = 'FVBCs/outlet_p/face_limiter'
    function = 'mass_flux_and_pressure_test_scaling'
    execute_on = 'initial timestep_begin'
  []
  [func_control_limiter_p_inlet]
    type = RealFunctionControl
    parameter = 'FVBCs/inlet_p/face_limiter'
    function = 'mass_flux_and_pressure_test_scaling'
    execute_on = 'initial timestep_begin'
  []
[]
# used for the boundary conditions in this example
[Postprocessors]
  [inlet_mdot]
    type = Receiver
    default = '${fparse 1980 * inlet_velocity * inlet_area}'
  []
  [surface_inlet]
    type = AreaPostprocessor
    boundary = 'left'
    execute_on = 'INITIAL'
  []
  [inlet_T]
    type = Receiver
    default = ${inlet_temp}
  []
  [outlet_mfr]
    type = VolumetricFlowRate
    boundary = 'right'
    advected_quantity = 1.0
    vel_x = u
    vel_y = v
  []
[]
[FluidProperties]
  [fp]
    type = FlibeFluidProperties
  []
[]
[FunctorMaterials]
  [const_functor]
    type = ADGenericFunctorMaterial
    prop_names = 'cp k'
    prop_values = '${cp} ${k}'
  []
  [rho]
    type = RhoFromPTFunctorMaterial
    fp = fp
    temperature = T
    pressure = pressure
  []
  [ins_fv]
    type = INSFVEnthalpyFunctorMaterial
    temperature = 'T'
    rho = ${rho}
  []
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -pc_factor_shift_type'
  petsc_options_value = 'lu       NONZERO'
  dt = 0.1
  end_time = ${end_time}
  nl_abs_tol = 1e-12
  nl_max_its = 50
  line_search = 'none'
  automatic_scaling = true
[]
[Outputs]
  csv = true
  execute_on = 'TIMESTEP_END'
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_velocity-action.i)
l = 10
# 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.001
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = ${l}
    ymin = 0
    ymax = 1
    nx = 10
    ny = 5
  []
[]
[FluidProperties]
  [fp]
    type = FlibeFluidProperties
  []
[]
[Modules]
  [NavierStokesFV]
    compressibility = 'weakly-compressible'
    add_energy_equation = true
    add_scalar_equation = true
    passive_scalar_names = 'scalar'
    density = 'rho'
    dynamic_viscosity = 'mu'
    thermal_conductivity = 'k'
    specific_heat = 'cp'
    passive_scalar_diffusivity = 1.1
    initial_velocity = '${inlet_velocity} 1e-15 0'
    initial_temperature = '${inlet_temp}'
    initial_pressure = '${outlet_pressure}'
    initial_scalar_variables = 0.1
    inlet_boundaries = 'left'
    momentum_inlet_types = 'flux-velocity'
    flux_inlet_pps = 'inlet_u'
    energy_inlet_types = 'flux-velocity'
    energy_inlet_functors = 'inlet_T'
    passive_scalar_inlet_types = 'flux-velocity'
    passive_scalar_inlet_functors = 'inlet_scalar_value'
    wall_boundaries = 'top bottom'
    momentum_wall_types = 'noslip noslip'
    energy_wall_types = 'heatflux heatflux'
    energy_wall_functors = '0 0'
    outlet_boundaries = 'right'
    momentum_outlet_types = 'fixed-pressure'
    pressure_functors = '${outlet_pressure}'
    external_heat_source = 'power_density'
    passive_scalar_source = 2.1
    mass_advection_interpolation = 'average'
    momentum_advection_interpolation = 'average'
    energy_advection_interpolation = 'average'
  []
[]
[Postprocessors]
  [inlet_u]
    type = Receiver
    default = ${inlet_velocity}
  []
  [inlet_T]
    type = Receiver
    default = ${inlet_temp}
  []
  [inlet_scalar_value]
    type = Receiver
    default = 0.2
  []
[]
[AuxVariables]
  [power_density]
    type = MooseVariableFVReal
    initial_condition = 1e4
  []
[]
[FunctorMaterials]
  [const_functor]
    type = ADGenericFunctorMaterial
    prop_names = 'cp k mu'
    prop_values = '${cp} ${k} ${mu}'
  []
  [rho]
    type = RhoFromPTFunctorMaterial
    fp = fp
    temperature = T_fluid
    pressure = pressure
  []
[]
[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-2
    optimal_iterations = 6
  []
  end_time = 1
  nl_abs_tol = 1e-9
  nl_max_its = 50
  line_search = 'none'
  automatic_scaling = true
[]
[Outputs]
  exodus = true
  execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/pwcns/channel-flow/2d-transient.i)
# Fluid properties
mu = 'mu'
rho = 'rho'
cp = 'cp'
k = 'k'
# Solid properties
cp_s = 2
rho_s = 4
k_s = 1e-2
h_fs = 10
# Operating conditions
u_inlet = 1
T_inlet = 200
p_outlet = 10
top_side_temperature = 150
# Numerical scheme
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 10
    ymin = 0
    ymax = 1
    nx = 20
    ny = 5
  []
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
[]
[UserObjects]
  [rc]
    type = PINSFVRhieChowInterpolator
    u = superficial_vel_x
    v = superficial_vel_y
    pressure = pressure
    porosity = porosity
  []
[]
[Variables]
  [superficial_vel_x]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = ${u_inlet}
  []
  [superficial_vel_y]
    type = PINSFVSuperficialVelocityVariable
    initial_condition = 1e-6
  []
  [pressure]
    type = INSFVPressureVariable
    initial_condition = ${p_outlet}
  []
  [T_fluid]
    type = INSFVEnergyVariable
    initial_condition = ${T_inlet}
  []
  [T_solid]
    type = MooseVariableFVReal
    initial_condition = 100
  []
[]
[AuxVariables]
  [porosity]
    type = MooseVariableFVReal
    initial_condition = 0.5
  []
  [velocity_norm]
    type = MooseVariableFVReal
  []
[]
[FVKernels]
  [mass_time]
    type = PWCNSFVMassTimeDerivative
    variable = pressure
    porosity = 'porosity'
    drho_dt = 'drho_dt'
  []
  [mass]
    type = PWCNSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
  []
  [u_time]
    type = WCNSFVMomentumTimeDerivative
    variable = superficial_vel_x
    rho = ${rho}
    drho_dt = 'drho_dt'
    momentum_component = 'x'
  []
  [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
  []
  [v_time]
    type = WCNSFVMomentumTimeDerivative
    variable = superficial_vel_y
    rho = ${rho}
    drho_dt = 'drho_dt'
    momentum_component = 'y'
  []
  [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
  []
  [energy_time]
    type = PINSFVEnergyTimeDerivative
    variable = T_fluid
    cp = ${cp}
    rho = ${rho}
    drho_dt = 'drho_dt'
    is_solid = false
    porosity = porosity
  []
  [energy_advection]
    type = PINSFVEnergyAdvection
    variable = T_fluid
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = ${advected_interp_method}
  []
  [energy_diffusion]
    type = PINSFVEnergyDiffusion
    variable = T_fluid
    k = ${k}
    porosity = porosity
  []
  [energy_convection]
    type = PINSFVEnergyAmbientConvection
    variable = T_fluid
    is_solid = false
    T_fluid = T_fluid
    T_solid = T_solid
    h_solid_fluid = 'h_cv'
  []
  [solid_energy_time]
    type = PINSFVEnergyTimeDerivative
    variable = T_solid
    cp = ${cp_s}
    rho = ${rho_s}
    is_solid = true
    porosity = porosity
  []
  [solid_energy_diffusion]
    type = FVDiffusion
    variable = T_solid
    coeff = ${k_s}
  []
  [solid_energy_convection]
    type = PINSFVEnergyAmbientConvection
    variable = T_solid
    is_solid = true
    T_fluid = T_fluid
    T_solid = T_solid
    h_solid_fluid = 'h_cv'
  []
[]
[FVBCs]
  [inlet-u]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = superficial_vel_x
    functor = ${u_inlet}
  []
  [inlet-v]
    type = INSFVInletVelocityBC
    boundary = 'left'
    variable = superficial_vel_y
    functor = 0
  []
  [inlet-T]
    type = FVDirichletBC
    variable = T_fluid
    value = ${T_inlet}
    boundary = 'left'
  []
  [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
  []
  [heated-side]
    type = FVDirichletBC
    boundary = 'top'
    variable = 'T_solid'
    value = ${top_side_temperature}
  []
  [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 = ${p_outlet}
  []
[]
[FluidProperties]
  [fp]
    type = FlibeFluidProperties
  []
[]
[FunctorMaterials]
  [fluid_props_to_mat_props]
    type = GeneralFunctorFluidProps
    fp = fp
    pressure = 'pressure'
    T_fluid = 'T_fluid'
    speed = 'velocity_norm'
    # To initialize with a high viscosity
    mu_rampdown = 'mu_rampdown'
    # For porous flow
    characteristic_length = 1
    porosity = 'porosity'
  []
  [ins_fv]
    type = INSFVEnthalpyFunctorMaterial
    rho = ${rho}
    temperature = 'T_fluid'
  []
  [constants]
    type = ADGenericFunctorMaterial
    prop_names = 'h_cv'
    prop_values = '${h_fs}'
  []
[]
[Functions]
  [mu_rampdown]
    type = PiecewiseLinear
    x = '1 2 3 4'
    y = '1e3 1e2 1e1 1'
  []
[]
[AuxKernels]
  [speed]
    type = ParsedAux
    variable = 'velocity_norm'
    coupled_variables = 'superficial_vel_x superficial_vel_y porosity'
    expression = 'sqrt(superficial_vel_x*superficial_vel_x + superficial_vel_y*superficial_vel_y) / '
               'porosity'
  []
[]
[Executioner]
  type = Transient
  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_rel_tol = 1e-12
  end_time = 3.0
[]
# Some basic Postprocessors to examine the solution
[Postprocessors]
  [inlet-p]
    type = SideAverageValue
    variable = pressure
    boundary = 'left'
  []
  [outlet-u]
    type = SideAverageValue
    variable = superficial_vel_x
    boundary = 'right'
  []
  [outlet-temp]
    type = SideAverageValue
    variable = T_fluid
    boundary = 'right'
  []
  [solid-temp]
    type = ElementAverageValue
    variable = T_solid
  []
[]
[Outputs]
  exodus = true
  csv = false
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/dirichlet_bcs_velocity.i)
rho = 'rho'
l = 10
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.001
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = ${l}
    ymin = 0
    ymax = 1
    nx = 10
    ny = 5
  []
[]
[GlobalParams]
  rhie_chow_user_object = 'rc'
[]
[UserObjects]
  [rc]
    type = INSFVRhieChowInterpolator
    u = u
    v = v
    pressure = pressure
  []
[]
[Variables]
  [u]
    type = INSFVVelocityVariable
    initial_condition = ${inlet_velocity}
  []
  [v]
    type = INSFVVelocityVariable
    initial_condition = 1e-15
  []
  [pressure]
    type = INSFVPressureVariable
    initial_condition = ${outlet_pressure}
  []
  [T]
    type = INSFVEnergyVariable
    initial_condition = ${inlet_temp}
  []
[]
[AuxVariables]
  [power_density]
    type = MooseVariableFVReal
    initial_condition = 1e4
  []
[]
[FVKernels]
  [mass_time]
    type = WCNSFVMassTimeDerivative
    variable = pressure
    drho_dt = drho_dt
  []
  [mass]
    type = WCNSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
  []
  [u_time]
    type = WCNSFVMomentumTimeDerivative
    variable = u
    drho_dt = drho_dt
    rho = rho
    momentum_component = 'x'
  []
  [u_advection]
    type = INSFVMomentumAdvection
    variable = u
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = ${advected_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_time]
    type = WCNSFVMomentumTimeDerivative
    variable = v
    drho_dt = drho_dt
    rho = rho
    momentum_component = 'y'
  []
  [v_advection]
    type = INSFVMomentumAdvection
    variable = v
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = ${advected_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
  []
  [temp_time]
    type = WCNSFVEnergyTimeDerivative
    variable = T
    rho = rho
    drho_dt = drho_dt
    h = h
    dh_dt = dh_dt
  []
  [temp_conduction]
    type = FVDiffusion
    coeff = 'k'
    variable = T
  []
  [temp_advection]
    type = INSFVEnergyAdvection
    variable = T
    velocity_interp_method = ${velocity_interp_method}
    advected_interp_method = ${advected_interp_method}
  []
  [heat_source]
    type = FVCoupledForce
    variable = T
    v = power_density
  []
[]
[FVBCs]
  # Inlet
  [inlet_u]
    type = WCNSFVInletVelocityBC
    variable = u
    boundary = 'left'
    velocity_pp = 'inlet_u'
  []
  [inlet_v]
    type = WCNSFVInletVelocityBC
    variable = v
    boundary = 'left'
    velocity_pp = 0
  []
  [inlet_T]
    type = WCNSFVInletTemperatureBC
    variable = T
    boundary = 'left'
    temperature_pp = 'inlet_T'
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    variable = pressure
    boundary = 'right'
    function = ${outlet_pressure}
  []
  # Walls
  [no_slip_x]
    type = INSFVNoSlipWallBC
    variable = u
    boundary = 'top bottom'
    function = 0
  []
  [no_slip_y]
    type = INSFVNoSlipWallBC
    variable = v
    boundary = 'top bottom'
    function = 0
  []
[]
# used for the boundary conditions in this example
[Postprocessors]
  [inlet_u]
    type = Receiver
    default = ${inlet_velocity}
  []
  [inlet_T]
    type = Receiver
    default = ${inlet_temp}
  []
[]
[FluidProperties]
  [fp]
    type = FlibeFluidProperties
  []
[]
[FunctorMaterials]
  [const_functor]
    type = ADGenericFunctorMaterial
    prop_names = 'cp k'
    prop_values = '${cp} ${k}'
  []
  [rho]
    type = RhoFromPTFunctorMaterial
    fp = fp
    temperature = T
    pressure = pressure
  []
  [ins_fv]
    type = INSFVEnthalpyFunctorMaterial
    temperature = 'T'
    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-2
    optimal_iterations = 6
  []
  end_time = 1
  line_search = 'none'
  automatic_scaling = true
  compute_scaling_once = false
  off_diagonals_in_auto_scaling = true
[]
[Debug]
  show_var_residual_norms = true
[]
[Outputs]
  exodus = true
  execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/channel-flow/2d-transient.i)
rho = 'rho'
l = 10
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_v = 0.001
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = ${l}
    ymin = 0
    ymax = 1
    nx = 20
    ny = 10
  []
[]
[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
    initial_condition = 1e-15
  []
  [pressure]
    type = INSFVPressureVariable
    initial_condition = ${outlet_pressure}
  []
  [T_fluid]
    type = INSFVEnergyVariable
    initial_condition = ${inlet_temp}
  []
[]
[AuxVariables]
  [mixing_length]
    type = MooseVariableFVReal
  []
  [power_density]
    type = MooseVariableFVReal
    initial_condition = 1e4
  []
[]
[FVKernels]
  inactive = 'u_turb v_turb temp_turb'
  [mass_time]
    type = WCNSFVMassTimeDerivative
    variable = pressure
    drho_dt = drho_dt
  []
  [mass]
    type = WCNSFVMassAdvection
    variable = pressure
    advected_interp_method = ${advected_interp_method}
    velocity_interp_method = ${velocity_interp_method}
    rho = ${rho}
  []
  [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
  []
  [u_turb]
    type = INSFVMixingLengthReynoldsStress
    variable = vel_x
    rho = ${rho}
    mixing_length = 'mixing_length'
    momentum_component = 'x'
    u = vel_x
    v = vel_y
  []
  [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
    momentum_component = 'y'
    mu = ${mu}
  []
  [v_pressure]
    type = INSFVMomentumPressure
    variable = vel_y
    momentum_component = 'y'
    pressure = pressure
  []
  [v_turb]
    type = INSFVMixingLengthReynoldsStress
    variable = vel_y
    rho = ${rho}
    mixing_length = 'mixing_length'
    momentum_component = 'y'
    u = vel_x
    v = vel_y
  []
  [temp_time]
    type = WCNSFVEnergyTimeDerivative
    variable = T_fluid
    rho = rho
    drho_dt = drho_dt
    h = h
    dh_dt = dh_dt
  []
  [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
  []
  [temp_turb]
    type = WCNSFVMixingLengthEnergyDiffusion
    variable = T_fluid
    rho = rho
    cp = cp
    mixing_length = 'mixing_length'
    schmidt_number = 1
    u = vel_x
    v = vel_y
  []
[]
[FVBCs]
  [no_slip_x]
    type = INSFVNoSlipWallBC
    variable = vel_x
    boundary = 'top bottom'
    function = 0
  []
  [no_slip_y]
    type = INSFVNoSlipWallBC
    variable = vel_y
    boundary = 'top bottom'
    function = 0
  []
  # Inlet
  [inlet_u]
    type = INSFVInletVelocityBC
    variable = vel_x
    boundary = 'left'
    functor = ${inlet_v}
  []
  [inlet_v]
    type = INSFVInletVelocityBC
    variable = vel_y
    boundary = 'left'
    functor = 0
  []
  [inlet_T]
    type = FVDirichletBC
    variable = T_fluid
    boundary = 'left'
    value = ${inlet_temp}
  []
  [outlet_p]
    type = INSFVOutletPressureBC
    variable = pressure
    boundary = 'right'
    function = ${outlet_pressure}
  []
[]
[FluidProperties]
  [fp]
    type = FlibeFluidProperties
  []
[]
[FunctorMaterials]
  [const_functor]
    type = ADGenericFunctorMaterial
    prop_names = 'cp k'
    prop_values = '${cp} ${k}'
  []
  [rho]
    type = RhoFromPTFunctorMaterial
    fp = fp
    temperature = T_fluid
    pressure = pressure
  []
  [ins_fv]
    type = INSFVEnthalpyFunctorMaterial
    temperature = 'T_fluid'
    rho = ${rho}
  []
[]
[AuxKernels]
  inactive = 'mixing_len'
  [mixing_len]
    type = WallDistanceMixingLengthAux
    walls = 'top'
    variable = mixing_length
    execute_on = 'initial'
    delta = 0.5
  []
[]
[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-3
    optimal_iterations = 6
  []
  end_time = 15
  nl_abs_tol = 1e-9
  nl_max_its = 50
  line_search = 'none'
  automatic_scaling = true
  off_diagonals_in_auto_scaling = true
  compute_scaling_once = false
[]
[Outputs]
  exodus = true
[]