- prop_nameThe name of the property to declare. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The name of the property to declare. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- subdomain_to_prop_valueMap from subdomain to property value. The value may be a constant or any kind of functor (functions, variables, functor material properties)
C++ Type:std::map<std::string, std::string>
Controllable:No
Description:Map from subdomain to property value. The value may be a constant or any kind of functor (functions, variables, functor material properties)
PiecewiseByBlockFunctorMaterial ADPiecewiseByBlockFunctorMaterial
Computes a property value on a per-subdomain basis
Overview
This object is useful for providing a material property value that is discontinuous from subdomain to subdomain. "prop_name" is required to specify the name of the material property. The map parameter "subdomain_to_prop_value" is used for specifying the property value on a subdomain name basis; the first member of each pair should be a subdomain name while the second member should be a functor.
This material is a shorthand for specifying GenericFunctorMaterial restricted to each block.
ADPiecewiseByBlockFunctorMaterial is the version of this object with automatic differentiation AD functors must be specified as the values on each block.
Input Parameters
- blockThe list of blocks (ids or names) that this object will be applied
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:The list of blocks (ids or names) that this object will be applied
- declare_suffixAn optional suffix parameter that can be appended to any declared 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 declared properties. The suffix will be prepended with a '_' character.
- execute_onALWAYSThe list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
Default:ALWAYS
C++ Type:ExecFlagEnum
Options:XFEM_MARK, FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, LINEAR_CONVERGENCE, NONLINEAR, NONLINEAR_CONVERGENCE, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, MULTIAPP_FIXED_POINT_CONVERGENCE, MULTISYSTEM_FIXED_POINT_ITERATION_END, FINAL, CUSTOM, ALWAYS
Controllable:No
Description:The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
Optional Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Controllable:No
Description:Determines whether this object is calculated using an implicit or explicit form
- search_methodnearest_node_connected_sidesChoice of search algorithm. All options begin by finding the nearest node in the primary boundary to a query point in the secondary boundary. In the default nearest_node_connected_sides algorithm, primary boundary elements are searched iff that nearest node is one of their nodes. This is fast to determine via a pregenerated node-to-elem map and is robust on conforming meshes. In the optional all_proximate_sides algorithm, primary boundary elements are searched iff they touch that nearest node, even if they are not topologically connected to it. This is more CPU-intensive but is necessary for robustness on any boundary surfaces which has disconnections (such as Flex IGA meshes) or non-conformity (such as hanging nodes in adaptively h-refined meshes).
Default:nearest_node_connected_sides
C++ Type:MooseEnum
Options:nearest_node_connected_sides, all_proximate_sides
Controllable:No
Description:Choice of search algorithm. All options begin by finding the nearest node in the primary boundary to a query point in the secondary boundary. In the default nearest_node_connected_sides algorithm, primary boundary elements are searched iff that nearest node is one of their nodes. This is fast to determine via a pregenerated node-to-elem map and is robust on conforming meshes. In the optional all_proximate_sides algorithm, primary boundary elements are searched iff they touch that nearest node, even if they are not topologically connected to it. This is more CPU-intensive but is necessary for robustness on any boundary surfaces which has disconnections (such as Flex IGA meshes) or non-conformity (such as hanging nodes in adaptively h-refined meshes).
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
Advanced Parameters
- output_propertiesList of material properties, from this material, to output (outputs must also be defined to an output type)
C++ Type:std::vector<std::string>
Controllable:No
Description:List of material properties, from this material, to output (outputs must also be defined to an output type)
- outputsnone Vector of output names where you would like to restrict the output of variables(s) associated with this object
Default:none
C++ Type:std::vector<OutputName>
Controllable:No
Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object
Outputs Parameters
Input Files
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/2d-simple-channel-enthalpy/porous-baffle-2d-enthalpy.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/bernoulli-1d-functor-material.i)
- (test/tests/materials/piecewise_by_block_material/named_subdomain_error.i)
- (test/tests/postprocessors/side_integral/side_integral_functor.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/pump/pump_as_volume_force_loop_pressure_corrected.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/2d-rc-epsjump.i)
- (test/tests/postprocessors/element_integral/functors/element_integral_test.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/rz-pipe-channel/porous-baffle-rz.i)
- (test/tests/meshdivisions/block_division.i)
- (test/tests/materials/piecewise_by_block_material/discontinuous_functor.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/radial-baffle-rz/radial-baffle-rz.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/2d-simple-channel-enthalpy/porous-baffle-2d-enthalpy-fluid-only.i)
- (test/tests/fvkernels/mms/harmonic_interpolation/diffusion.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/errors/pressure-jump-errors.i)
- (test/tests/postprocessors/side_average_value/side_average_functor_test.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/2d-variable-density/porous-baffle-2d-variable-density-bernoulli.i)
- (test/tests/linearfvbcs/internal-boundary-functor-side/internal-boundary.i)
- (modules/heat_transfer/test/tests/fviks/fv_sideset_heat_transfer/fv_sideset_heat_transfer_one_variable.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/hydraulic-separators/separator-mixing-physics.i)
- (test/tests/interfacekernels/1d_interface/ad-coupled-value-coupled-flux.i)
- (test/tests/actioncomponents/interfaces/component_with_ics.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/formloss/formloss_multiple.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/1d-simple-channel/porous-baffle-1d.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/formloss/formloss_single.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/pump/pump_as_volume_force_loop_force_corrected.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/hydraulic-separators/separator-mixing.i)
- (test/tests/fvkernels/mms/broken-domain/diffusion.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/scalar_advection/2d-rc-physics.i)
prop_name
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The name of the property to declare. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
subdomain_to_prop_value
C++ Type:std::map<std::string, std::string>
Controllable:No
Description:Map from subdomain to property value. The value may be a constant or any kind of functor (functions, variables, functor material properties)
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/2d-simple-channel-enthalpy/porous-baffle-2d-enthalpy.i)
# Steady conjugate heat transfer from a heated solid to fluid in a 0.5-m porous block.
# The solid fraction scales the 20 MW/m^3 source to 10 MW/m^3. Conservation therefore gives
# u_block_2 = 2, T_fluid_out = 300.59523809524, and h_fluid_out = 1262500.
# For 10 upwind cells, T_fluid_block_2 = 300.32738095238. The local balance gives
# T_solid_block_2 - T_fluid_block_2 = 10e6 / 30000 = 333.33333333333,
# hence T_solid_block_2 = 633.66071428571.
mu = 2e-3
rho = 1000
advected_interp_method = 'upwind'
u_in = 2
forchheimer = 0
bf = '0 0'
cp_fluid = 4200
cp_solid = 500
k_fluid = 0.4
k_solid = 0.2
h_vol = 30000
q_solid = 20000000
T_inlet = 300
T_initial = 300
[FVGradientMethods]
[jump_aware]
type = FVPressureJumpGreenGaussGradient
[]
[velocity_jump_aware]
type = FVVelocityJumpGreenGaussGradient
[]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = jump_aware
gradient_relaxation = 1.0
[]
[]
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '0.5 0.5 0.5'
dy = '0.5'
ix = '10 10 10'
iy = '3'
subdomain_id = '1 2 3'
[]
[baffle]
type = SideSetsBetweenSubdomainsGenerator
input = mesh
primary_block = '1'
paired_block = '2'
new_boundary = 'baffle'
[]
[baffle2]
type = SideSetsBetweenSubdomainsGenerator
input = baffle
primary_block = '2'
paired_block = '3'
new_boundary = 'baffle2'
[]
[split_top_bottom]
type = BreakBoundaryOnSubdomainGenerator
input = baffle2
boundaries = 'top bottom'
[]
[delete]
type = BoundaryDeletionGenerator
boundary_names = 'top bottom'
input = split_top_bottom
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system energy_system solid_energy_system'
previous_nl_solution_required = true
[]
[UserObjects]
[pressure_jump]
type = BernoulliFormLossPressureJump
boundary = 'baffle baffle2'
porosity = porosity
density = ${rho}
form_loss = ${bf}
reference_velocity_side = 'lower_porosity higher_porosity'
[]
[rc]
type = PorousRhieChowMassFlux
u = superficial_u
v = superficial_v
pressure = pressure
rho = ${rho}
porosity = porosity
p_diffusion_kernel = p_diffusion
pressure_jump_models = pressure_jump
pressure_jump_relaxation = 0.1
[]
[]
[Variables]
[superficial_u]
type = MooseLinearVariableFVReal
solver_sys = u_system
initial_condition = ${u_in}
gradient_method = velocity_jump_aware
[]
[superficial_v]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.0
gradient_method = velocity_jump_aware
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0.0
gradient_method = jump_aware
[]
[h_fluid]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = '${fparse cp_fluid * T_initial}'
[]
[T_solid]
type = MooseLinearVariableFVReal
solver_sys = solid_energy_system
initial_condition = ${T_initial}
block = 2
[]
[]
[LinearFVKernels]
[u_advection]
type = LinearPWCNSFVMomentumFlux
variable = superficial_u
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
u = superficial_u
v = superficial_v
momentum_component = 'x'
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[v_advection]
type = LinearPWCNSFVMomentumFlux
variable = superficial_v
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
u = superficial_u
v = superficial_v
momentum_component = 'y'
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_u
momentum_component = 'x'
porosity = porosity
pressure = pressure
gradient_method = reconstructed
[]
[v_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_v
momentum_component = 'y'
porosity = porosity
pressure = pressure
gradient_method = reconstructed
[]
[u_friction]
type = LinearFVMomentumFriction
variable = superficial_u
Forchheimer_name = forch
porosity = porosity
rho = ${rho}
u = superficial_u
v = superficial_v
momentum_component = 'x'
block = 2
[]
[v_friction]
type = LinearFVMomentumFriction
variable = superficial_v
Forchheimer_name = forch
porosity = porosity
rho = ${rho}
u = superficial_u
v = superficial_v
momentum_component = 'y'
block = 2
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusionJump
variable = pressure
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[fluid_advection]
type = LinearFVEnergyAdvection
variable = h_fluid
advected_quantity = enthalpy
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = rc
[]
[fluid_diffusion]
type = LinearFVDiffusion
variable = h_fluid
diffusion_coeff = kappa_fluid
use_nonorthogonal_correction = false
[]
[fluid_exchange]
type = LinearFVEnthalpyVolumetricHeatTransfer
variable = h_fluid
h_solid_fluid = h_vol
cp = cp_fluid
T_fluid = T_fluid
T_solid = T_solid
is_solid = false
block = 2
[]
[fluid_source]
type = LinearFVSource
variable = h_fluid
source_density = q_fluid_scaled
[]
[solid_diffusion]
type = LinearFVDiffusion
variable = T_solid
diffusion_coeff = ${k_solid}
use_nonorthogonal_correction = false
block = 2
[]
[solid_exchange]
type = LinearFVEnthalpyVolumetricHeatTransfer
variable = T_solid
h_solid_fluid = h_vol
cp = 1.0
T_fluid = T_fluid
T_solid = T_solid
is_solid = true
block = 2
[]
[solid_source]
type = LinearFVSource
variable = T_solid
source_density = q_solid_scaled
block = 2
[]
[]
[LinearFVBCs]
[left_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = superficial_u
functor = ${u_in}
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
variable = superficial_u
use_two_term_expansion = false
[]
[left_v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = superficial_v
functor = 0.0
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
variable = superficial_v
use_two_term_expansion = false
[]
[symmetry-u]
type = LinearFVVelocitySymmetryBC
boundary = 'top_to_1 top_to_3 bottom_to_1 bottom_to_3 top_to_2 bottom_to_2'
variable = superficial_u
u = superficial_u
v = superficial_v
momentum_component = x
[]
[symmetry-v]
type = LinearFVVelocitySymmetryBC
boundary = 'top_to_1 top_to_3 bottom_to_1 bottom_to_3 top_to_2 bottom_to_2'
variable = superficial_v
u = superficial_u
v = superficial_v
momentum_component = y
[]
[pressure-extrapolation]
type = LinearFVPressureFluxBC
boundary = 'bottom_to_1 bottom_to_2 bottom_to_3 top_to_1 top_to_2 top_to_3'
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
rho = ${rho}
u = superficial_u
v = superficial_v
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = right
variable = pressure
functor = 0.0
[]
[left_T_fluid]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = T_fluid
functor = ${T_inlet}
[]
[left_h_fluid]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = h_fluid
functor = h_from_p_T
[]
[walls_h_fluid]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
boundary = 'top_to_1 top_to_2 top_to_3 bottom_to_1 bottom_to_2 bottom_to_3'
variable = h_fluid
functor = 0.0
diffusion_coeff = kappa_fluid
[]
[outlet_h_fluid]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
variable = h_fluid
use_two_term_expansion = false
[]
[solid_zero_flux]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
boundary = 'baffle baffle2 top_to_2 bottom_to_2'
variable = T_solid
functor = 0.0
diffusion_coeff = kappa_solid
[]
[]
[FunctorMaterials]
[forch]
type = GenericVectorFunctorMaterial
prop_names = forch
prop_values = '${forchheimer} ${forchheimer} ${forchheimer}'
[]
[porosity]
type = PiecewiseByBlockFunctorMaterial
prop_name = porosity
subdomain_to_prop_value = '1 1.0 2 0.5 3 1.0'
[]
[fluid_constants]
type = GenericFunctorMaterial
prop_names = 'cp_fluid kappa_fluid h_vol q_fluid_scaled'
prop_values = '${cp_fluid} ${fparse k_fluid/cp_fluid} ${h_vol} 0'
[]
[solid_constants]
type = GenericFunctorMaterial
prop_names = 'cp_solid kappa_solid'
prop_values = '${cp_solid} ${fparse k_solid/cp_solid}'
[]
[q_solid]
type = GenericFunctorMaterial
prop_names = 'q_solid'
prop_values = ${q_solid}
block = 2
[]
[q_solid_scaled]
type = ParsedFunctorMaterial
property_name = q_solid_scaled
functor_names = 'porosity q_solid'
expression = '(1 - porosity) * q_solid'
block = 2
[]
[fluid_enthalpy_material]
type = LinearFVEnthalpyFunctorMaterial
pressure = pressure
T_fluid = T_fluid
h = h_fluid
h_from_p_T_functor = h_from_p_T_functor
T_from_p_h_functor = T_from_p_h_functor
[]
[h_from_p_T_functor]
type = ParsedFunctorMaterial
property_name = h_from_p_T_functor
functor_names = 'T_fluid'
expression = '${cp_fluid} * T_fluid'
[]
[T_from_p_h_functor]
type = ParsedFunctorMaterial
property_name = T_from_p_h_functor
functor_names = 'h_fluid'
expression = 'h_fluid / ${cp_fluid}'
[]
[]
[Postprocessors]
[u_block_2]
type = ElementAverageValue
variable = superficial_u
block = 2
[]
[T_fluid_out]
type = SideAverageValue
variable = T_fluid
boundary = right
[]
[T_fluid_block_2]
type = ElementAverageValue
variable = T_fluid
block = 2
[]
[T_solid_block_2]
type = ElementAverageValue
variable = T_solid
block = 2
[]
[h_fluid_out]
type = SideAverageValue
variable = h_fluid
boundary = right
[]
[]
[AuxVariables]
[porosity_aux]
type = MooseLinearVariableFVReal
[]
[T_fluid]
type = MooseLinearVariableFVReal
initial_condition = ${T_initial}
[]
[]
[AuxKernels]
[por]
type = FunctorAux
variable = porosity_aux
functor = porosity
execute_on = 'NONLINEAR'
[]
[fluid_temperature]
type = FunctorAux
variable = T_fluid
functor = T_from_p_h
execute_on = 'NONLINEAR'
[]
[]
[VectorPostprocessors]
# Sample each x-cell once at its center.
[centerline]
type = LineValueSampler
variable = 'superficial_u T_fluid T_solid'
start_point = '0.0119047619047619 0.25 0'
end_point = '1.4880952380952381 0.25 0'
num_points = 30
sort_by = x
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
energy_l_abs_tol = 1e-14
solid_energy_l_abs_tol = 1e-14
momentum_l_tol = 0
pressure_l_tol = 0
energy_l_tol = 0
solid_energy_l_tol = 0
rhie_chow_user_object = rc
momentum_systems = 'u_system v_system'
pressure_system = pressure_system
energy_system = energy_system
solid_energy_system = solid_energy_system
momentum_equation_relaxation = 0.2
pressure_variable_relaxation = 0.1
energy_equation_relaxation = 0.8
num_iterations = 1000
# These outer tolerances stop once the velocity and zero-pressure fields have stabilized to
# substantially below the accuracy exercised by the temperature and velocity profile checks.
pressure_absolute_tolerance = 1e-6
momentum_absolute_tolerance = 1e-2
energy_absolute_tolerance = 1e-8
solid_energy_absolute_tolerance = 1e-8
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
energy_petsc_options_iname = '-pc_type -pc_hypre_type'
energy_petsc_options_value = 'hypre boomeramg'
solid_energy_petsc_options_iname = '-pc_type -pc_hypre_type'
solid_energy_petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
csv = true
execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/bernoulli-1d-functor-material.i)
rho = 1.1
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 1
dx = '1 1'
ix = '3 3'
subdomain_id = '1 2'
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolator
u = u
pressure = pressure
porosity = porosity
[]
[]
[Variables]
[u]
type = PINSFVSuperficialVelocityVariable
initial_condition = 1
[]
[pressure]
type = BernoulliPressureVariable
u = u
porosity = porosity
rho = ${rho}
[]
[]
[AuxVariables]
[has_porosity_jump_face]
type = MooseVariableFVReal
[]
[porosity_out]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[has_porosity_jump_face]
type = HasPorosityJumpFace
porosity = porosity
execute_on = 'initial timestep_end'
variable = has_porosity_jump_face
[]
[porosity_out]
type = FunctorAux
variable = porosity_out
functor = porosity
execute_on = 'initial timestep_end'
[]
[]
[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}
porosity = porosity
momentum_component = 'x'
[]
[u_pressure]
type = PINSFVMomentumPressure
variable = u
pressure = pressure
porosity = porosity
momentum_component = 'x'
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = u
functor = '1'
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = 1
[]
[]
[FunctorMaterials]
[porosity]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'porosity'
subdomain_to_prop_value = '1 1 2 0.5'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
[]
[Postprocessors]
[inlet_p]
type = SideAverageValue
variable = 'pressure'
boundary = 'left'
[]
[outlet-u]
type = SideIntegralVariablePostprocessor
variable = u
boundary = 'right'
[]
[]
[Outputs]
exodus = true
csv = true
[]
(test/tests/materials/piecewise_by_block_material/named_subdomain_error.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 2
subdomain_name = left
[]
[right_block]
type = ParsedSubdomainMeshGenerator
input = gen
combinatorial_geometry = 'x > 0.5'
block_id = 1
block_name = right
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Materials]
[coeff_mat]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = coeff
subdomain_to_prop_value = 'left 1'
[]
[]
[Postprocessors]
[integral]
type = ADElementIntegralFunctorPostprocessor
block = right
functor = coeff
execute_on = INITIAL
[]
[]
(test/tests/postprocessors/side_integral/side_integral_functor.i)
[Mesh]
inactive = 'refine'
# U-shaped domains to have internal boundaries in
# a variety of directions
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '1 1 1'
dy = '3 1'
ix = '4 5 3'
iy = '12 4'
subdomain_id = '1 2 1
1 1 1'
[]
[internal_boundary_dir1]
type = SideSetsBetweenSubdomainsGenerator
input = cmg
primary_block = 1
paired_block = 2
new_boundary = 'inside_1'
[]
[internal_boundary_dir2]
type = SideSetsBetweenSubdomainsGenerator
input = internal_boundary_dir1
primary_block = 2
paired_block = 1
new_boundary = 'inside_2'
[]
[refine]
type = RefineBlockGenerator
input = internal_boundary_dir2
block = '1 2'
refinement = '2 1'
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
block = 1
[]
[]
[AuxVariables]
[v1]
type = MooseVariableFVReal
block = 1
[FVInitialCondition]
type = FVFunctionIC
function = 'x + y'
[]
[]
[v2]
type = MooseVariableFVReal
block = 2
[FVInitialCondition]
type = FVFunctionIC
function = '2*x*x - y'
[]
[]
[]
[Functions]
[f1]
type = ParsedFunction
expression = 'exp(x - y)'
[]
[]
[Materials]
[m1]
type = ADGenericFunctorMaterial
prop_names = 'm1'
prop_values = 'f1'
[]
[m2]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'm2'
subdomain_to_prop_value = '1 12
2 4'
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = u
coeff = '1'
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = u
boundary = 3
value = 0
[]
[right]
type = FVDirichletBC
variable = u
boundary = 1
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Postprocessors]
# Mesh external boundaries integration
[ext_u]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left top right'
functor = u
restrict_to_functors_domain = true
[]
[ext_v1]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left right'
functor = v1
[]
[ext_v2]
type = ADSideIntegralFunctorPostprocessor
boundary = 'top'
functor = v2
restrict_to_functors_domain = true
[]
[ext_f1]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left top right'
functor = f1
prefactor = f1
[]
[ext_m1]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left top right'
functor = m1
restrict_to_functors_domain = true
[]
[ext_m2]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left top right'
functor = m2
restrict_to_functors_domain = true
[]
# Internal to the mesh, but a side to the variables
# With orientation of normal 1->2
[int_s1_u]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_1
functor = u
[]
[int_s1_v1]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_1
functor = v1
[]
[int_s1_f1]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_1
functor = f1
[]
[int_s1_m1]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_1
functor = m1
[]
[int_s1_m2]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_1
functor = m2
[]
# With orientation of normal 2->1
[int_s2_v2]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_2
functor = v2
[]
[int_s2_f1]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_2
functor = f1
[]
[int_s2_m1]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_2
functor = m1
[]
[int_s2_m2]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_2
functor = m2
[]
[]
[Outputs]
csv = true
exodus = true
[]
[Problem]
kernel_coverage_check = false
[]
(modules/navier_stokes/test/tests/finite_volume/ins/pump/pump_as_volume_force_loop_pressure_corrected.i)
mu = 1.0
rho = 1.0
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.1 0.8 0.1'
dy = '0.1 0.8 0.1'
ix = '5 20 5'
iy = '5 20 5'
subdomain_id = '1 1 1
1 2 1
1 1 1'
[]
[delete_internal_part]
type = BlockDeletionGenerator
input = gen
block = '2'
new_boundary = 'wall-internal'
[]
[lump_bdries_to_wall]
type = RenameBoundaryGenerator
input = delete_internal_part
old_boundary = 'bottom right top left'
new_boundary = 'wall-external wall-external wall-external wall-external'
[]
[pump_domain]
type = ParsedSubdomainMeshGenerator
input = lump_bdries_to_wall
combinatorial_geometry = 'x > 0.3 & x < 0.7 & y > 0.5'
block_id = '3'
[]
[rename_blocks]
type = RenameBlockGenerator
input = pump_domain
old_block = '1 3'
new_block = 'pipe pump'
[]
[side_pump]
type = ParsedGenerateSideset
input = rename_blocks
included_subdomains = 'pump'
included_neighbors = 'pipe'
new_sideset_name = 'pump_side'
normal = '1 0 0'
combinatorial_geometry = 'x > 0.35'
[]
[]
[GlobalParams]
velocity_interp_method = 'rc'
advected_interp_method = 'upwind'
rhie_chow_user_object = 'rc'
[]
[Problem]
material_coverage_check = False
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
correct_volumetric_force = true
volumetric_force_functors = 'pump_force'
volume_force_correction_method = 'pressure-consistent'
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 1
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1
[]
[pressure]
type = INSFVPressureVariable
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = vel_x
y = vel_y
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[mean_zero_pressure]
type = FVIntegralValueConstraint
variable = pressure
lambda = lambda
phi0 = 0.0
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_pump]
type = INSFVBodyForce
variable = vel_x
momentum_component = 'x'
functor = 'pump_force'
block = 'pump'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[]
[FVBCs]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'wall-internal wall-external'
variable = vel_x
function = '0'
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'wall-internal wall-external'
variable = vel_y
function = '0'
[]
[]
[FunctorMaterials]
[pump_force]
type = PiecewiseByBlockFunctorMaterial
prop_name = 'pump_force'
subdomain_to_prop_value = 'pump 1000.0
pipe 0.0'
[]
[]
[Postprocessors]
[flow_rate]
type = Receiver
default = 1.0
[]
[flow_rate_to_pipe]
type = VolumetricFlowRate
advected_quantity = ${rho}
boundary = 'pump_side'
vel_x = 'vel_x'
vel_y = 'vel_y'
[]
[maximum_speed]
type = ADElementExtremeFunctorValue
functor = vel_x
value_type = max
[]
[]
[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 = false
[out]
type = CSV
execute_on = FINAL
show = 'flow_rate_to_pipe maximum_speed'
[]
[]
(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
[]
(test/tests/postprocessors/element_integral/functors/element_integral_test.i)
[Mesh]
second_order = true
[square]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[]
[block]
type = ParsedSubdomainMeshGenerator
input = square
block_id = 1
combinatorial_geometry = 'x > 0.5'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[AuxVariables]
[nodal]
[InitialCondition]
type = FunctionIC
function = '1 + x*x + y*y*y'
[]
[]
[fe_higher_order]
order = SECOND
[InitialCondition]
type = FunctionIC
function = '1 + x*x + y*y*y'
[]
[]
[fe_elemental]
family = MONOMIAL
order = SECOND
[InitialCondition]
type = FunctionIC
function = '1 + x*x + y*y*y'
[]
[]
[fv_var]
type = MooseVariableFVReal
[FVInitialCondition]
type = FVFunctionIC
function = '1 + x*x + y*y*y'
[]
[]
[]
[Functions]
[f]
type = ParsedFunction
expression = '1 + x*x + y*y*y'
[]
[]
[Materials]
[two_piece]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'mat'
subdomain_to_prop_value = '0 nodal 1 fv_var'
[]
[]
[Postprocessors]
[fe]
type = ADElementIntegralFunctorPostprocessor
functor = nodal
[]
[fe_higher_order]
type = ADElementIntegralFunctorPostprocessor
functor = fe_higher_order
[]
[fe_elemental]
type = ADElementIntegralFunctorPostprocessor
functor = fe_elemental
[]
[fv]
type = ADElementIntegralFunctorPostprocessor
functor = fv_var
[]
[function]
type = ElementIntegralFunctorPostprocessor
functor = f
prefactor = f
[]
[functor_matprop]
type = ADElementIntegralFunctorPostprocessor
functor = mat
[]
[]
[Outputs]
file_base = out
exodus = false
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/rz-pipe-channel/porous-baffle-rz.i)
# Axisymmetric pipe version of ../1d-simple-channel/porous-baffle-1d.i: the same axial flow in an
# RZ pipe of radius 0.5 with symmetry conditions on the axis and on the wall (slip), so the
# solution is independent of r and must reproduce the one-dimensional results. The comments below
# are those of the one-dimensional input.
# One-dimensional verification of Bernoulli jumps, porous drag, and form loss.
# Mass conservation gives u_block_1 = u_block_2 = 0.1 and u_block_jump = 0.
# Without drag or form loss, the two pressure jumps (right minus left) are 0.03 and -0.03,
# so p_left = p_right = p_jump = 0. With mu = 1 and Forchheimer = 50, the porous block
# adds a pressure drop of 0.25. A form-loss coefficient of 10 adds 0.4 at each baffle,
# giving p_jump = p_left - p_right = 1.05 and baffle jumps of -0.37 and -0.43.
mu = 0.0 # 1e-2
rho = 2.0
advected_interp_method = 'average'
forchheimer_value = 50
inlet_u = 0.1
[FVGradientMethods]
[jump_aware]
type = FVPressureJumpGreenGaussGradient
[]
[velocity_jump_aware]
type = FVVelocityJumpGreenGaussGradient
[]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = jump_aware
gradient_relaxation = 1.0
[]
[]
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '0.5 0.5 0.5'
ix = '200 200 200'
dy = '0.5'
iy = '2'
subdomain_id = '1 2 3'
[]
[baffle]
type = SideSetsBetweenSubdomainsGenerator
input = mesh
primary_block = '1'
paired_block = '2'
new_boundary = 'baffle'
[]
[baffle2]
type = SideSetsBetweenSubdomainsGenerator
input = baffle
primary_block = '2'
paired_block = '3'
new_boundary = 'baffle2'
[]
coord_type = RZ
rz_coord_axis = X
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[UserObjects]
[pressure_jump]
type = BernoulliFormLossPressureJump
boundary = 'baffle baffle2'
porosity = porosity
density = ${rho}
[]
[rc]
type = PorousRhieChowMassFlux
u = superficial_u
v = superficial_v
pressure = pressure
rho = ${rho}
porosity = porosity
p_diffusion_kernel = p_diffusion
pressure_jump_models = pressure_jump
pressure_jump_relaxation = 0.1
[]
[]
[Variables]
[superficial_u]
type = MooseLinearVariableFVReal
solver_sys = u_system
initial_condition = ${inlet_u}
gradient_method = velocity_jump_aware
[]
[superficial_v]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0
gradient_method = velocity_jump_aware
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0.0
gradient_method = jump_aware
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[LinearFVKernels]
[u_advection]
type = LinearPWCNSFVMomentumFlux
variable = superficial_u
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
u = superficial_u
v = superficial_v
momentum_component = 'x'
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[v_advection]
type = LinearPWCNSFVMomentumFlux
variable = superficial_v
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
u = superficial_u
v = superficial_v
momentum_component = 'y'
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_u
momentum_component = 'x'
porosity = porosity
pressure = pressure
gradient_method = reconstructed
[]
[v_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_v
momentum_component = 'y'
porosity = porosity
pressure = pressure
gradient_method = reconstructed
[]
[u_friction]
type = LinearFVMomentumFriction
variable = superficial_u
Forchheimer_name = forch
porosity = porosity
rho = ${rho}
u = superficial_u
v = superficial_v
momentum_component = 'x'
block = 2
[]
[v_friction]
type = LinearFVMomentumFriction
variable = superficial_v
Forchheimer_name = forch
porosity = porosity
rho = ${rho}
u = superficial_u
v = superficial_v
momentum_component = 'y'
block = 2
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusionJump
variable = pressure
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[inlet_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = superficial_u
functor = ${inlet_u}
[]
[inlet_v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = superficial_v
functor = 0
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
variable = superficial_u
use_two_term_expansion = false
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
variable = superficial_v
use_two_term_expansion = false
[]
# The axis (bottom) and the slip wall (top) are both symmetry planes for this flow.
[symmetry_u]
type = LinearFVVelocitySymmetryBC
boundary = 'bottom top'
variable = superficial_u
u = superficial_u
v = superficial_v
momentum_component = 'x'
[]
[symmetry_v]
type = LinearFVVelocitySymmetryBC
boundary = 'bottom top'
variable = superficial_v
u = superficial_u
v = superficial_v
momentum_component = 'y'
[]
[symmetry_p]
type = LinearFVPressureSymmetryBC
boundary = 'bottom top'
variable = pressure
HbyA_flux = HbyA
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = right
variable = pressure
functor = 0.0
[]
[]
[FunctorMaterials]
[forch]
type = GenericVectorFunctorMaterial
prop_names = forch
prop_values = '${forchheimer_value} ${forchheimer_value} ${forchheimer_value}'
[]
[porosity]
type = PiecewiseByBlockFunctorMaterial
prop_name = porosity
subdomain_to_prop_value = '1 0.5 2 1.0 3 0.5'
[]
[]
[Postprocessors]
[p_left]
type = SideAverageValue
variable = pressure
boundary = left
[]
[p_right]
type = SideAverageValue
variable = pressure
boundary = right
[]
[p_jump]
type = ParsedPostprocessor
expression = 'p_left - p_right'
pp_names = 'p_left p_right'
[]
# These points are the centers of the cells adjacent to x = 0.5 and x = 1.0. The mesh spacing
# is 0.5 / 200 = 0.0025, so the adjacent centers are offset by half that distance. The radial
# coordinate 0.375 is the center of the outer row of cells.
[p_baffle_1_left]
type = PointValue
variable = pressure
point = '0.49875 0.375 0'
[]
[p_baffle_1_right]
type = PointValue
variable = pressure
point = '0.50125 0.375 0'
[]
[p_baffle_2_left]
type = PointValue
variable = pressure
point = '0.99875 0.375 0'
[]
[p_baffle_2_right]
type = PointValue
variable = pressure
point = '1.00125 0.375 0'
[]
[p_baffle_1_jump]
type = ParsedPostprocessor
expression = 'p_baffle_1_right - p_baffle_1_left'
pp_names = 'p_baffle_1_right p_baffle_1_left'
[]
[p_baffle_2_jump]
type = ParsedPostprocessor
expression = 'p_baffle_2_right - p_baffle_2_left'
pp_names = 'p_baffle_2_right p_baffle_2_left'
[]
[u_block_1]
type = ElementAverageValue
variable = superficial_u
block = 1
[]
[u_block_2]
type = ElementAverageValue
variable = superficial_u
block = 2
[]
[u_block_jump]
type = ParsedPostprocessor
expression = 'u_block_1 - u_block_2'
pp_names = 'u_block_1 u_block_2'
[]
[]
[AuxVariables]
[porosity_aux]
type = MooseLinearVariableFVReal
[]
[]
[AuxKernels]
[por]
type = FunctorAux
variable = porosity_aux
functor = porosity
execute_on = 'timestep_end'
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-12
pressure_l_abs_tol = 1e-12
momentum_l_tol = 0
pressure_l_tol = 0
rhie_chow_user_object = rc
momentum_systems = 'u_system v_system'
pressure_system = pressure_system
momentum_equation_relaxation = 0.3
pressure_variable_relaxation = 0.1
num_iterations = 1000
pressure_absolute_tolerance = 1e-8
# The Forchheimer case plateaus near 1e-2 after pressure and velocity stabilize; 2e-2 stops
# with the total pressure drop within 2e-6 relative to the value after 1000 iterations.
momentum_absolute_tolerance = 2e-2
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
csv = true
execute_on = 'timestep_end'
[]
(test/tests/meshdivisions/block_division.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 3
dx = '1.5 2.4 0.1'
dy = '1.3 0.9'
dz = '0.4 0.5 0.6 0.7'
ix = '2 1 1'
iy = '2 3'
iz = '1 1 1 1'
subdomain_id = '0 1 1
2 2 2
3 4 4
5 5 5
0 1 1
2 2 2
3 4 4
5 5 5
'
[]
[]
[MeshDivisions]
[block_div]
type = SubdomainsDivision
[]
[]
[AuxVariables]
[blocks]
family = MONOMIAL
order = CONSTANT
[]
[div]
family = MONOMIAL
order = CONSTANT
[]
[diff]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'block_div'
[]
[subdomains]
type = FunctorAux
functor = 'blocks_fmat'
variable = 'blocks'
[]
[difference]
type = ParsedAux
variable = diff
expression = 'blocks - div'
coupled_variables = 'blocks div'
[]
[]
[FunctorMaterials]
[fmat]
type = PiecewiseByBlockFunctorMaterial
prop_name = 'blocks_fmat'
subdomain_to_prop_value = '0 0 1 1 2 2 3 3 4 4 5 5'
[]
[]
[Postprocessors]
[min_diff]
type = ElementExtremeValue
variable = diff
value_type = 'min'
[]
[max_diff]
type = ElementExtremeValue
variable = diff
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(test/tests/materials/piecewise_by_block_material/discontinuous_functor.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 10
xmax = 2
[]
[subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '1.0 0 0'
block_id = 1
top_right = '2.0 1.0 0'
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = u
coeff = 'coeff'
coeff_interp_method = average
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = u
boundary = 'left'
value = 1
[]
[right]
type = FVDirichletBC
variable = u
boundary = 'right'
value = 0
[]
[]
[Materials]
[coeff_mat]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'coeff'
subdomain_to_prop_value = '0 4
1 2'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/radial-baffle-rz/radial-baffle-rz.i)
# Steady inviscid radial outflow through a porous annulus (r < r0) into a region of unit porosity
# (r > r0), separated by a pressure baffle on the cylinder r = r0, in RZ coordinates with x as the
# radial direction. With mass flow per radian m and the friction
# f = mu D U + 0.5 rho F |U| / eps U of LinearFVMomentumFriction, the exact solution is
# U_r = m / (rho r), U_z = 0,
# p = -m^2 / (2 rho eps^2 r^2) - mu D m / (rho eps) ln(r) + F m^2 / (2 rho eps^2 r) + c
# in each region. At the baffle the pressure jumps by the Bernoulli and form-loss terms of
# BernoulliFormLossPressureJump, with the porous side as the lower-porosity reference. The flow is
# inviscid because baffle faces carry no normal viscous stress, which a viscous solution of this
# form would need.
rho = 1
m = 1
eps_bed = 0.4
# Darcy coefficients mu D of each region. Central advection of a divergence-free flow adds almost
# nothing to the momentum diagonal, so without viscosity the friction keeps the momentum systems
# nonsingular, and the plenum needs it too.
darcy_bed = 1
darcy_plenum = 0.5
forchheimer = 2
form_loss = 0.5
r_inner = 1
r_baffle = 1.5
r_outer = 2
height = 0.25
nx = 8
ny = 2
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[Mesh]
[generated]
type = GeneratedMeshGenerator
dim = 2
xmin = ${r_inner}
xmax = ${r_outer}
ymax = ${height}
nx = ${nx}
ny = ${ny}
[]
[bed]
type = ParsedSubdomainMeshGenerator
input = generated
combinatorial_geometry = 'x < ${r_baffle}'
block_id = 1
block_name = bed
[]
[plenum]
type = ParsedSubdomainMeshGenerator
input = bed
combinatorial_geometry = 'x > ${r_baffle}'
block_id = 2
block_name = plenum
[]
[baffle]
type = SideSetsBetweenSubdomainsGenerator
input = plenum
primary_block = bed
paired_block = plenum
new_boundary = baffle
[]
coord_type = RZ
rz_coord_axis = Y
[]
[FVGradientMethods]
[jump_aware]
type = FVPressureJumpGreenGaussGradient
[]
[velocity_jump_aware]
type = FVVelocityJumpGreenGaussGradient
[]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = jump_aware
gradient_relaxation = 1
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[UserObjects]
[pressure_jump]
type = BernoulliFormLossPressureJump
boundary = baffle
porosity = porosity
density = ${rho}
form_loss = ${form_loss}
[]
[rc]
type = PorousRhieChowMassFlux
u = superficial_u
v = superficial_v
pressure = pressure
rho = ${rho}
porosity = porosity
p_diffusion_kernel = p_diffusion
pressure_projection_method = consistent
pressure_jump_models = pressure_jump
[]
[]
[Variables]
[superficial_u]
type = MooseLinearVariableFVReal
solver_sys = u_system
initial_condition = 0
gradient_method = velocity_jump_aware
[]
[superficial_v]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0
gradient_method = velocity_jump_aware
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0
gradient_method = jump_aware
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearPWCNSFVMomentumFlux
variable = superficial_u
advected_interp_method_name = average
mu = 0
u = superficial_u
v = superficial_v
momentum_component = x
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[v_advection_stress]
type = LinearPWCNSFVMomentumFlux
variable = superficial_v
advected_interp_method_name = average
mu = 0
u = superficial_u
v = superficial_v
momentum_component = y
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_u
pressure = pressure
porosity = porosity
momentum_component = x
gradient_method = reconstructed
[]
[v_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_v
pressure = pressure
porosity = porosity
momentum_component = y
gradient_method = reconstructed
[]
[u_friction]
type = LinearFVMomentumFriction
variable = superficial_u
Darcy_name = darcy
Forchheimer_name = forchheimer
mu = 1
rho = ${rho}
porosity = porosity
u = superficial_u
v = superficial_v
momentum_component = x
[]
[v_friction]
type = LinearFVMomentumFriction
variable = superficial_v
Darcy_name = darcy
Forchheimer_name = forchheimer
mu = 1
rho = ${rho}
porosity = porosity
u = superficial_u
v = superficial_v
momentum_component = y
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusionJump
variable = pressure
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[velocity_x]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = superficial_u
functor = exact_u
[]
[velocity_y]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = superficial_v
functor = 0
[]
[pressure_flux]
type = LinearFVPressureFluxBC
boundary = 'left right top bottom'
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
rho = ${rho}
u = superficial_u
v = superficial_v
[]
[]
[FunctorMaterials]
[porosity]
type = PiecewiseByBlockFunctorMaterial
prop_name = porosity
subdomain_to_prop_value = 'bed ${eps_bed} plenum 1'
[]
[friction_bed]
type = GenericVectorFunctorMaterial
prop_names = 'darcy forchheimer'
prop_values = '${darcy_bed} ${darcy_bed} ${darcy_bed} ${forchheimer} ${forchheimer} ${forchheimer}'
block = bed
[]
[friction_plenum]
type = GenericVectorFunctorMaterial
prop_names = 'darcy forchheimer'
prop_values = '${darcy_plenum} ${darcy_plenum} ${darcy_plenum} 0 0 0'
block = plenum
[]
[pressure_difference]
type = ParsedFunctorMaterial
property_name = pressure_difference
functor_names = 'pressure exact_pressure'
expression = 'pressure-exact_pressure'
[]
# The pin fixes the pressure of the cell containing the pin point, so the computed pressure is
# compared after removing the mean difference to the exact pressure.
[shifted_pressure]
type = ParsedFunctorMaterial
property_name = shifted_pressure
functor_names = 'pressure mean_pressure_difference'
expression = 'pressure-mean_pressure_difference'
[]
[pressure_error]
type = ParsedFunctorMaterial
property_name = pressure_error
functor_names = 'shifted_pressure exact_pressure'
expression = 'shifted_pressure-exact_pressure'
[]
[u_error]
type = ParsedFunctorMaterial
property_name = u_error
functor_names = 'superficial_u exact_u'
expression = 'superficial_u-exact_u'
[]
[]
[Functions]
[exact_u]
type = ParsedFunction
expression = '${m}/(${rho}*x)'
[]
[bed_pressure]
type = ParsedFunction
expression = '-${m}^2/(2*${rho}*${eps_bed}^2*x^2) - ${darcy_bed}*${m}/(${rho}*${eps_bed})*log(x) '
'+ ${forchheimer}*${m}^2/(2*${rho}*${eps_bed}^2*x)'
[]
[plenum_pressure]
type = ParsedFunction
expression = '-${m}^2/(2*${rho}*x^2) - ${darcy_plenum}*${m}/${rho}*log(x)'
[]
# p_plenum(r0) - p_bed(r0) = 0.5 rho u0^2 (1/eps_bed^2 - 1) - 0.5 K rho (u0/eps_bed)^2 with
# u0 = m / (rho r0).
[exact_pressure]
type = ParsedFunction
symbol_names = 'pb pp u0'
symbol_values = 'bed_pressure plenum_pressure ${fparse m / (rho * r_baffle)}'
expression = 'if(x < ${r_baffle}, pb, pp + '
'(-${m}^2/(2*${rho}*${eps_bed}^2*${r_baffle}^2) - ${darcy_bed}*${m}/(${rho}*${eps_bed})*log(${r_baffle}) '
'+ ${forchheimer}*${m}^2/(2*${rho}*${eps_bed}^2*${r_baffle}) + ${m}^2/(2*${rho}*${r_baffle}^2) '
'+ ${darcy_plenum}*${m}/${rho}*log(${r_baffle})) '
'+ 0.5*${rho}*u0^2*(1/${eps_bed}^2 - 1) - 0.5*${form_loss}*${rho}*(u0/${eps_bed})^2)'
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-12
pressure_l_abs_tol = 1e-12
momentum_l_tol = 0
pressure_l_tol = 0
momentum_l_max_its = 100
pressure_l_max_its = 100
rhie_chow_user_object = rc
momentum_systems = 'u_system v_system'
pressure_system = pressure_system
# Without viscosity nothing damps round-off in the axial velocity, and at a momentum relaxation
# of 0.5 the iteration amplifies it by about 1% per iteration on the twice-refined mesh.
momentum_equation_relaxation = 0.3
pressure_variable_relaxation = 0.2
num_iterations = 3000
pressure_absolute_tolerance = 1e-9
# The exact axial velocity is zero, so the axial momentum system has a vanishing normalization
# factor and its normalized residual stays O(1e-2) at round-off. Its tolerance is therefore not
# used as a convergence criterion; L2v checks the axial velocity instead.
momentum_absolute_tolerance = '1e-9 1'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
print_fields = false
pin_pressure = true
pressure_pin_value = 0
pressure_pin_point = '${fparse 0.5 * (r_baffle + r_outer)} ${fparse 0.5 * height} 0'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
[Postprocessors]
[mean_pressure_difference]
type = ElementAverageFunctorPostprocessor
functor = pressure_difference
execute_on = FINAL
# Must run before the pressure errors that subtract it.
execution_order_group = -1
outputs = none
[]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[L2u]
type = ElementL2FunctorError
approximate = superficial_u
exact = exact_u
execute_on = FINAL
[]
[L2v]
type = ElementL2FunctorError
approximate = superficial_v
exact = 0
execute_on = FINAL
[]
[L2p]
type = ElementL2FunctorError
approximate = shifted_pressure
exact = exact_pressure
execute_on = FINAL
[]
# The maximum pointwise errors detect cell-to-cell oscillations that the L2 norms average out.
[max_u_error]
type = ElementExtremeFunctorValue
functor = u_error
value_type = max_abs
execute_on = FINAL
[]
[max_v_error]
type = ElementExtremeFunctorValue
functor = superficial_v
value_type = max_abs
execute_on = FINAL
[]
[max_p_error]
type = ElementExtremeFunctorValue
functor = pressure_error
value_type = max_abs
execute_on = FINAL
[]
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/2d-simple-channel-enthalpy/porous-baffle-2d-enthalpy-fluid-only.i)
# Steady fluid-only enthalpy transport through a 0.5-m heated porous block.
# With rho = 1000, u = 2, cp = 4200, and q = 20 MW/m^3, conservation gives
# u_block_2 = 2, T_fluid_out = 301.19047619048, and h_fluid_out = 1265000.
# For 10 upwind cells in the heated block, T_fluid_block_2 = 300.65476190476.
mu = 2e-3
rho = 1000
advected_interp_method = 'upwind'
u_in = 2
forchheimer = 0
bf = '0 0'
cp_fluid = 4200
k_fluid = 0.4
h_vol = 300
T_inlet = 300
T_initial = 300
q = 20000000
[FVGradientMethods]
[jump_aware]
type = FVPressureJumpGreenGaussGradient
[]
[velocity_jump_aware]
type = FVVelocityJumpGreenGaussGradient
[]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = jump_aware
gradient_relaxation = 1.0
[]
[]
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '0.5 0.5 0.5'
dy = '0.5'
ix = '10 10 10'
iy = '3'
subdomain_id = '1 2 3'
[]
[baffle]
type = SideSetsBetweenSubdomainsGenerator
input = mesh
primary_block = '1'
paired_block = '2'
new_boundary = 'baffle'
[]
[baffle2]
type = SideSetsBetweenSubdomainsGenerator
input = baffle
primary_block = '2'
paired_block = '3'
new_boundary = 'baffle2'
[]
[split_top_bottom]
type = BreakBoundaryOnSubdomainGenerator
input = baffle2
boundaries = 'top bottom'
[]
[delete]
type = BoundaryDeletionGenerator
boundary_names = 'top bottom'
input = split_top_bottom
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system energy_system'
previous_nl_solution_required = true
[]
[UserObjects]
[pressure_jump]
type = BernoulliFormLossPressureJump
boundary = 'baffle baffle2'
porosity = porosity
density = ${rho}
form_loss = ${bf}
reference_velocity_side = 'lower_porosity higher_porosity'
[]
[rc]
type = PorousRhieChowMassFlux
u = superficial_u
v = superficial_v
pressure = pressure
rho = ${rho}
porosity = porosity
p_diffusion_kernel = p_diffusion
pressure_jump_models = pressure_jump
pressure_jump_relaxation = 0.1
[]
[]
[Variables]
[superficial_u]
type = MooseLinearVariableFVReal
solver_sys = u_system
initial_condition = ${u_in}
gradient_method = velocity_jump_aware
[]
[superficial_v]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.0
gradient_method = velocity_jump_aware
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0.0
gradient_method = jump_aware
[]
[h_fluid]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = '${fparse cp_fluid * T_initial}'
[]
[]
[LinearFVKernels]
[u_advection]
type = LinearPWCNSFVMomentumFlux
variable = superficial_u
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
u = superficial_u
v = superficial_v
momentum_component = 'x'
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[v_advection]
type = LinearPWCNSFVMomentumFlux
variable = superficial_v
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
u = superficial_u
v = superficial_v
momentum_component = 'y'
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_u
momentum_component = 'x'
porosity = porosity
pressure = pressure
gradient_method = reconstructed
[]
[v_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_v
momentum_component = 'y'
porosity = porosity
pressure = pressure
gradient_method = reconstructed
[]
[u_friction]
type = LinearFVMomentumFriction
variable = superficial_u
Forchheimer_name = forch
porosity = porosity
rho = ${rho}
u = superficial_u
v = superficial_v
momentum_component = 'x'
block = 2
[]
[v_friction]
type = LinearFVMomentumFriction
variable = superficial_v
Forchheimer_name = forch
porosity = porosity
rho = ${rho}
u = superficial_u
v = superficial_v
momentum_component = 'y'
block = 2
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusionJump
variable = pressure
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[fluid_advection]
type = LinearFVEnergyAdvection
variable = h_fluid
advected_quantity = enthalpy
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = rc
[]
[fluid_diffusion]
type = LinearFVDiffusion
variable = h_fluid
diffusion_coeff = kappa_fluid
use_nonorthogonal_correction = false
[]
[fluid_source]
type = LinearFVSource
variable = h_fluid
source_density = q_fluid_scaled
block = 2
[]
[]
[LinearFVBCs]
[left_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = superficial_u
functor = ${u_in}
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
variable = superficial_u
use_two_term_expansion = false
[]
[left_v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = superficial_v
functor = 0.0
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
variable = superficial_v
use_two_term_expansion = false
[]
[symmetry-u]
type = LinearFVVelocitySymmetryBC
boundary = 'top_to_2 bottom_to_2 top_to_1 top_to_3 bottom_to_1 bottom_to_3'
variable = superficial_u
u = superficial_u
v = superficial_v
momentum_component = x
[]
[symmetry-v]
type = LinearFVVelocitySymmetryBC
boundary = 'top_to_2 bottom_to_2 top_to_1 top_to_3 bottom_to_1 bottom_to_3'
variable = superficial_v
u = superficial_u
v = superficial_v
momentum_component = y
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = right
variable = pressure
functor = 0.0
[]
[pressure-extrapolation]
type = LinearFVPressureFluxBC
boundary = 'bottom_to_1 bottom_to_2 bottom_to_3 top_to_1 top_to_2 top_to_3'
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
rho = ${rho}
u = superficial_u
v = superficial_v
[]
[left_T_fluid]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = T_fluid
functor = ${T_inlet}
[]
[left_h_fluid]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = h_fluid
functor = h_from_p_T
[]
[walls_h_fluid]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
boundary = 'top_to_1 top_to_2 top_to_3 bottom_to_1 bottom_to_2 bottom_to_3'
variable = h_fluid
functor = 0.0
diffusion_coeff = kappa_fluid
[]
[outlet_h_fluid]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
variable = h_fluid
use_two_term_expansion = false
[]
[]
[FunctorMaterials]
[forch]
type = GenericVectorFunctorMaterial
prop_names = forch
prop_values = '${forchheimer} ${forchheimer} ${forchheimer}'
[]
[porosity]
type = PiecewiseByBlockFunctorMaterial
prop_name = porosity
subdomain_to_prop_value = '1 1.0 2 0.5 3 1.0'
[]
[fluid_constants]
type = GenericFunctorMaterial
prop_names = 'cp_fluid kappa_fluid h_vol q_fluid_scaled'
prop_values = '${cp_fluid} ${fparse k_fluid/cp_fluid} ${h_vol} ${q}'
[]
[fluid_enthalpy_material]
type = LinearFVEnthalpyFunctorMaterial
pressure = pressure
T_fluid = T_fluid
h = h_fluid
h_from_p_T_functor = h_from_p_T_functor
T_from_p_h_functor = T_from_p_h_functor
[]
[h_from_p_T_functor]
type = ParsedFunctorMaterial
property_name = h_from_p_T_functor
functor_names = 'T_fluid'
expression = '${cp_fluid} * T_fluid'
[]
[T_from_p_h_functor]
type = ParsedFunctorMaterial
property_name = T_from_p_h_functor
functor_names = 'h_fluid'
expression = 'h_fluid / ${cp_fluid}'
[]
[]
[Postprocessors]
[u_block_2]
type = ElementAverageValue
variable = superficial_u
block = 2
[]
[T_fluid_out]
type = SideAverageValue
variable = T_fluid
boundary = right
[]
[T_fluid_block_2]
type = ElementAverageValue
variable = T_fluid
block = 2
[]
[h_fluid_out]
type = SideAverageValue
variable = h_fluid
boundary = right
[]
[]
[AuxVariables]
[porosity_aux]
type = MooseLinearVariableFVReal
[]
[T_fluid]
type = MooseLinearVariableFVReal
initial_condition = ${T_initial}
[]
[]
[AuxKernels]
[por]
type = FunctorAux
variable = porosity_aux
functor = porosity
execute_on = 'NONLINEAR'
[]
[fluid_temperature]
type = FunctorAux
variable = T_fluid
functor = T_from_p_h
execute_on = 'NONLINEAR'
[]
[]
[VectorPostprocessors]
# Sample each x-cell once at its center.
[centerline]
type = LineValueSampler
variable = 'superficial_u T_fluid'
start_point = '0.0119047619047619 0.25 0'
end_point = '1.4880952380952381 0.25 0'
num_points = 30
sort_by = x
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
energy_l_abs_tol = 1e-14
momentum_l_tol = 0
pressure_l_tol = 0
energy_l_tol = 0
rhie_chow_user_object = rc
momentum_systems = 'u_system v_system'
pressure_system = pressure_system
energy_system = energy_system
momentum_equation_relaxation = 0.2
pressure_variable_relaxation = 0.2
energy_equation_relaxation = 0.7
num_iterations = 1000
# These outer tolerances stop once the velocity and zero-pressure fields have stabilized to
# substantially below the accuracy exercised by the temperature and velocity profile checks.
pressure_absolute_tolerance = 1e-6
momentum_absolute_tolerance = 1e-2
energy_absolute_tolerance = 1e-8
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
energy_petsc_options_iname = '-pc_type -pc_hypre_type'
energy_petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
csv = true
execute_on = FINAL
[]
(test/tests/fvkernels/mms/harmonic_interpolation/diffusion.i)
d1 = 1
d2 = 10
[Mesh]
[gen_mesh]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
elem_type = TRI3
[]
[subdomain]
type = ParsedSubdomainMeshGenerator
input = gen_mesh
combinatorial_geometry = 'y > 0.5'
block_id = 1
[]
[]
[Variables]
[v]
type = MooseVariableFVReal
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = v
coeff = 'diff_coeff'
coeff_interp_method = average
[]
[body_v]
type = FVBodyForce
variable = v
function = 'forcing'
[]
[]
[FVBCs]
[exact]
type = FVFunctionDirichletBC
boundary = 'left right top bottom'
function = 'exact'
variable = v
[]
[]
[Functions]
[exact]
type = ParsedFunction
expression = 'if (y < 0.5, 1 + x + 3*y*y*y, (11*d2-3*d1)/ (8*d2) + x + 3*d1/d2*y*y*y)'
symbol_names = 'd1 d2'
symbol_values = '${d1} ${d2}'
[]
[forcing]
type = ParsedFunction
expression = '-d1*18*y'
symbol_names = 'd1'
symbol_values = '${d1}'
[]
[]
[Materials]
[diff_coeff]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'diff_coeff'
subdomain_to_prop_value = '0 ${d1}
1 ${d2}'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
csv = true
exodus = true
[]
[Postprocessors]
[error]
type = ElementL2Error
variable = v
function = exact
outputs = 'console csv'
[]
[h]
type = AverageElementSize
outputs = 'console csv'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/errors/pressure-jump-errors.i)
# Compact fixture for constructor and setup errors on pressure-jump objects.
mu = 0.0
rho = 2.0
advected_interp_method = 'average'
inlet_u = 0.1
[FVGradientMethods]
[jump_aware]
type = FVPressureJumpGreenGaussGradient
[]
[velocity_jump_aware]
type = FVVelocityJumpGreenGaussGradient
[]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = jump_aware
gradient_relaxation = 1.0
[]
[]
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 1
dx = '0.5 0.5 0.5'
ix = '2 2 2'
subdomain_id = '1 2 3'
[]
[baffle]
type = SideSetsBetweenSubdomainsGenerator
input = mesh
primary_block = '1'
paired_block = '2'
new_boundary = 'baffle'
[]
[baffle2]
type = SideSetsBetweenSubdomainsGenerator
input = baffle
primary_block = '2'
paired_block = '3'
new_boundary = 'baffle2'
[]
[]
[Problem]
linear_sys_names = 'u_system pressure_system'
previous_nl_solution_required = true
[]
[UserObjects]
active = 'pressure_jump rc'
[pressure_jump]
type = BernoulliFormLossPressureJump
boundary = 'baffle baffle2'
porosity = porosity
density = ${rho}
[]
[duplicate_jump]
type = BernoulliFormLossPressureJump
boundary = 'baffle'
porosity = porosity
density = ${rho}
[]
[rc]
type = PorousRhieChowMassFlux
u = superficial_u
pressure = pressure
rho = ${rho}
porosity = porosity
p_diffusion_kernel = p_diffusion
pressure_jump_models = pressure_jump
pressure_jump_relaxation = 0.1
[]
[]
[Variables]
[superficial_u]
type = MooseLinearVariableFVReal
solver_sys = u_system
initial_condition = ${inlet_u}
gradient_method = velocity_jump_aware
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0.0
gradient_method = jump_aware
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[LinearFVKernels]
active = 'u_advection u_pressure p_diffusion HbyA_divergence'
[u_advection]
type = LinearPWCNSFVMomentumFlux
variable = superficial_u
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
u = superficial_u
momentum_component = 'x'
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_u
momentum_component = 'x'
porosity = porosity
pressure = pressure
gradient_method = reconstructed
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusionJump
variable = pressure
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[ordinary_p_diffusion]
type = LinearFVPressureCorrectionDiffusion
variable = pressure
diffusion_tensor = Ainv
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[inlet_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = superficial_u
functor = ${inlet_u}
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
variable = superficial_u
use_two_term_expansion = false
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = right
variable = pressure
functor = 0.0
[]
[]
[FunctorMaterials]
[porosity]
type = PiecewiseByBlockFunctorMaterial
prop_name = porosity
subdomain_to_prop_value = '1 0.5 2 1.0 3 0.5'
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = rc
momentum_systems = 'u_system'
pressure_system = pressure_system
num_iterations = 1
continue_on_max_its = true
[]
[Outputs]
csv = false
exodus = false
[]
(test/tests/postprocessors/side_average_value/side_average_functor_test.i)
[Mesh]
inactive = 'refine'
# U-shaped domains to have internal boundaries in
# a variety of directions
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '1 1 1'
dy = '3 1'
ix = '4 5 3'
iy = '12 4'
subdomain_id = '1 2 1
1 1 1'
[]
[internal_boundary_dir1]
type = SideSetsBetweenSubdomainsGenerator
input = cmg
primary_block = 1
paired_block = 2
new_boundary = 'inside_1'
[]
[internal_boundary_dir2]
type = SideSetsBetweenSubdomainsGenerator
input = internal_boundary_dir1
primary_block = 2
paired_block = 1
new_boundary = 'inside_2'
[]
[refine]
type = RefineBlockGenerator
input = internal_boundary_dir2
block = '1 2'
refinement = '2 1'
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
block = 1
[]
[]
[AuxVariables]
[v1]
type = MooseVariableFVReal
block = 1
[FVInitialCondition]
type = FVFunctionIC
function = 'x + y'
[]
[]
[v2]
type = MooseVariableFVReal
block = 2
[FVInitialCondition]
type = FVFunctionIC
function = '2*x*x - y'
[]
[]
[]
[Functions]
[f1]
type = ParsedFunction
expression = 'exp(x - y)'
[]
[]
[FunctorMaterials]
[m1]
type = ADGenericFunctorMaterial
prop_names = 'm1'
prop_values = 'f1'
[]
[m2]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'm2'
subdomain_to_prop_value = '1 12
2 4'
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = u
coeff = '1'
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = u
boundary = 3
value = 0
[]
[right]
type = FVDirichletBC
variable = u
boundary = 1
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Postprocessors]
# Mesh external boundaries integration
[ext_u]
type = SideAverageFunctorPostprocessor
boundary = 'left top right'
functor = u
restrict_to_functors_domain = true
[]
[ext_u_int]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left top right'
functor = u
restrict_to_functors_domain = true
[]
[ext_u_area]
type = AreaPostprocessor
boundary = 'left top right'
[]
[ext_u_diff]
type = ParsedPostprocessor
pp_names = 'ext_u ext_u_int ext_u_area'
expression = 'ext_u - ext_u_int/ext_u_area'
[]
[ext_v1]
type = SideAverageFunctorPostprocessor
boundary = 'left right'
functor = v1
[]
[ext_v2]
type = SideAverageFunctorPostprocessor
boundary = 'top'
functor = v2
restrict_to_functors_domain = true
[]
[ext_f1]
type = SideAverageFunctorPostprocessor
boundary = 'left top right'
functor = f1
prefactor = f1
[]
[ext_m1]
type = SideAverageFunctorPostprocessor
boundary = 'left top right'
functor = m1
restrict_to_functors_domain = true
[]
[ext_m2]
type = SideAverageFunctorPostprocessor
boundary = 'left top right'
functor = m2
restrict_to_functors_domain = true
[]
# Internal to the mesh, but a side to the variables
# With orientation of normal 1->2
[int_s1_u]
type = SideAverageFunctorPostprocessor
boundary = inside_1
functor = u
[]
[int_s1_v1]
type = SideAverageFunctorPostprocessor
boundary = inside_1
functor = v1
[]
[int_s1_f1]
type = SideAverageFunctorPostprocessor
boundary = inside_1
functor = f1
[]
[int_s1_m1]
type = SideAverageFunctorPostprocessor
boundary = inside_1
functor = m1
[]
[int_s1_m2]
type = SideAverageFunctorPostprocessor
boundary = inside_1
functor = m2
[]
# With orientation of normal 2->1
[int_s2_v2]
type = SideAverageFunctorPostprocessor
boundary = inside_2
functor = v2
[]
[int_s2_f1]
type = SideAverageFunctorPostprocessor
boundary = inside_2
functor = f1
[]
[int_s2_m1]
type = SideAverageFunctorPostprocessor
boundary = inside_2
functor = m1
[]
[int_s2_m2]
type = SideAverageFunctorPostprocessor
boundary = inside_2
functor = m2
[]
[]
[Outputs]
csv = true
exodus = true
[]
[Problem]
kernel_coverage_check = false
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/2d-variable-density/porous-baffle-2d-variable-density-bernoulli.i)
# Manufactured variable-density porous-baffle solution. The exact fields are
# rho = 1 - 0.05 x, rho * superficial_u = 1, porosity = 1 for x < 5 and 0.5
# otherwise, and p_right = 0. The exact pressure solution gives p_left = delta_p =
# 4.99973888889. Its block averages are p_block_1 = 4.84902726575 and
# p_block_2 = 1.51242493694, so p_block_jump = 3.33660232881. The exact velocity
# averages are u_block_1 = 1.15072828981 and u_block_2 = 1.62186043243.
# L2_rho and L2_porosity should be zero; the velocity and pressure errors measure
# discretization of their nonconstant exact profiles.
length_left = 5.0
length_right = 5.0
height = 1.0
nx_left = 30
nx_right = 30
ny = 5
epsilon_left = 1.0
epsilon_right = 0.5
u_in = 1.0
p_out = 0.0
mu = 1e-3
density_factor = 1e-3
density_slope_exact = '${fparse -0.05e3 * density_factor}'
rho_in_exact = '${fparse 1e3 * density_factor}'
mass_flux_exact = '${fparse rho_in_exact * u_in}'
rho_baffle_exact = '${fparse (1e3 - 0.05e3 * length_left) * density_factor}'
rho_out_exact = '${fparse (1e3 - 0.05e3 * (length_left + length_right)) * density_factor}'
u_prime_baffle_exact = '${fparse -mass_flux_exact * density_slope_exact / (rho_baffle_exact * rho_baffle_exact)}'
u_prime_out_exact = '${fparse -mass_flux_exact * density_slope_exact / (rho_out_exact * rho_out_exact)}'
transport_baffle_left_exact = '${fparse mass_flux_exact * mass_flux_exact / (rho_baffle_exact * epsilon_left * epsilon_left) - mu * u_prime_baffle_exact / epsilon_left}'
transport_baffle_right_exact = '${fparse mass_flux_exact * mass_flux_exact / (rho_baffle_exact * epsilon_right * epsilon_right) - mu * u_prime_baffle_exact / epsilon_right}'
transport_out_right_exact = '${fparse mass_flux_exact * mass_flux_exact / (rho_out_exact * epsilon_right * epsilon_right) - mu * u_prime_out_exact / epsilon_right}'
bernoulli_jump_exact = '${fparse 0.5 * mass_flux_exact * mass_flux_exact * (1 / (rho_baffle_exact * epsilon_right * epsilon_right) - 1 / (rho_baffle_exact * epsilon_left * epsilon_left))}'
pressure_right_constant_exact = '${fparse p_out + transport_out_right_exact}'
pressure_left_constant_exact = '${fparse pressure_right_constant_exact - transport_baffle_right_exact + bernoulli_jump_exact + transport_baffle_left_exact}'
advected_interp_method = 'average'
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[FVGradientMethods]
[jump_aware]
type = FVPressureJumpGreenGaussGradient
[]
[velocity_jump_aware]
type = FVVelocityJumpGreenGaussGradient
[]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = jump_aware
gradient_relaxation = 1.0
[]
[]
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
# Two blocks are enough for this verification problem: one block on each side of the
# internal porous-baffle interface.
dx = '${length_left} ${length_right}'
dy = '${height}'
ix = '${nx_left} ${nx_right}'
iy = '${ny}'
subdomain_id = '1 2'
[]
[baffle]
type = SideSetsBetweenSubdomainsGenerator
input = mesh
primary_block = '1'
paired_block = '2'
new_boundary = 'baffle'
[]
[split_top_bottom]
type = BreakBoundaryOnSubdomainGenerator
input = baffle
boundaries = 'top bottom'
[]
[delete]
type = BoundaryDeletionGenerator
boundary_names = 'top bottom'
input = split_top_bottom
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[UserObjects]
[pressure_jump]
type = BernoulliFormLossPressureJump
boundary = baffle
porosity = porosity
density = rho_aux
[]
[rc]
type = PorousRhieChowMassFlux
u = superficial_u
v = superficial_v
pressure = pressure
rho = 'rho_aux'
porosity = 'porosity'
p_diffusion_kernel = p_diffusion
pressure_jump_models = pressure_jump
pressure_jump_relaxation = 0.1
[]
[]
[Variables]
[superficial_u]
type = MooseLinearVariableFVReal
solver_sys = u_system
initial_condition = ${u_in}
gradient_method = velocity_jump_aware
[]
[superficial_v]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.0
gradient_method = velocity_jump_aware
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = ${p_out}
gradient_method = jump_aware
[]
[]
[LinearFVKernels]
[u_advection]
type = LinearPWCNSFVMomentumFlux
variable = superficial_u
advected_interp_method_name = ${advected_interp_method}
mu = 'mu'
u = superficial_u
v = superficial_v
momentum_component = 'x'
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[v_advection]
type = LinearPWCNSFVMomentumFlux
variable = superficial_v
advected_interp_method_name = ${advected_interp_method}
mu = 'mu'
u = superficial_u
v = superficial_v
momentum_component = 'y'
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_u
momentum_component = 'x'
porosity = 'porosity'
pressure = pressure
gradient_method = reconstructed
[]
[v_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_v
momentum_component = 'y'
porosity = 'porosity'
pressure = pressure
gradient_method = reconstructed
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusionJump
variable = pressure
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[left_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = superficial_u
functor = ${u_in}
[]
[left_v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = superficial_v
functor = 0.0
[]
[pressure-extrapolation]
type = LinearFVExtrapolatedPressureBC
boundary = 'left'
variable = pressure
use_two_term_expansion = true
[]
# Fix the outlet pressure and leave the outlet velocity free.
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
variable = superficial_u
use_two_term_expansion = true
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
variable = superficial_v
use_two_term_expansion = true
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = right
variable = pressure
functor = ${p_out}
[]
# Symmetry removes any wall losses and keeps the exact solution one-dimensional.
[symmetry_u]
type = LinearFVVelocitySymmetryBC
boundary = 'top_to_1 top_to_2 bottom_to_1 bottom_to_2'
variable = superficial_u
u = superficial_u
v = superficial_v
momentum_component = x
[]
[symmetry_v]
type = LinearFVVelocitySymmetryBC
boundary = 'top_to_1 top_to_2 bottom_to_1 bottom_to_2'
variable = superficial_v
u = superficial_u
v = superficial_v
momentum_component = y
[]
[pressure_symmetric]
type = LinearFVPressureSymmetryBC
boundary = 'top_to_1 top_to_2 bottom_to_1 bottom_to_2'
variable = pressure
HbyA_flux = 'HbyA'
[]
[]
[Functions]
[rho]
type = ParsedFunction
expression = '(1e3 - 0.05e3 * x)*${density_factor}'
[]
[]
[FunctorMaterials]
[rho_exact]
type = ParsedFunctorMaterial
property_name = rho_exact
expression = '(1e3 - 0.05e3 * x)*${density_factor}'
[]
[porosity_exact]
type = PiecewiseByBlockFunctorMaterial
prop_name = porosity_exact
subdomain_to_prop_value = '1 ${epsilon_left} 2 ${epsilon_right}'
[]
[porosity]
type = PiecewiseByBlockFunctorMaterial
prop_name = porosity
subdomain_to_prop_value = '1 ${epsilon_left} 2 ${epsilon_right}'
[]
[mu]
type = ParsedFunctorMaterial
property_name = mu
expression = '${mu}'
[]
[u_superficial_exact]
type = ParsedFunctorMaterial
property_name = u_superficial_exact
functor_names = 'rho_exact'
expression = '${mass_flux_exact} / rho_exact'
[]
[u_superficial_prime_exact]
type = ParsedFunctorMaterial
property_name = u_superficial_prime_exact
functor_names = 'rho_exact'
expression = '-${mass_flux_exact} * ${density_slope_exact} / (rho_exact * rho_exact)'
[]
[p_exact]
type = ParsedFunctorMaterial
property_name = p_exact
functor_names = 'rho_exact u_superficial_prime_exact'
expression = 'if(x < ${length_left}, ${pressure_left_constant_exact} - ${mass_flux_exact} * ${mass_flux_exact} / (rho_exact * ${epsilon_left} * ${epsilon_left}) + ${mu} * u_superficial_prime_exact / ${epsilon_left}, ${pressure_right_constant_exact} - ${mass_flux_exact} * ${mass_flux_exact} / (rho_exact * ${epsilon_right} * ${epsilon_right}) + ${mu} * u_superficial_prime_exact / ${epsilon_right})'
[]
[]
[AuxVariables]
[rho_aux]
type = MooseLinearVariableFVReal
[]
[porosity_aux]
type = MooseLinearVariableFVReal
[]
[]
[AuxKernels]
[assign_rho_aux]
type = FunctorAux
variable = rho_aux
functor = 'rho'
execute_on = 'initial timestep_end'
[]
[assign_porosity_aux]
type = FunctorAux
variable = porosity_aux
functor = 'porosity'
execute_on = 'initial timestep_end'
[]
[]
[Postprocessors]
[L2_rho]
type = ElementL2FunctorError
approximate = rho_aux
exact = rho_exact
[]
[L2_porosity]
type = ElementL2FunctorError
approximate = porosity_aux
exact = porosity_exact
[]
[L2_superficial_u]
type = ElementL2FunctorError
approximate = superficial_u
exact = u_superficial_exact
[]
[L2_pressure]
type = ElementL2FunctorError
approximate = pressure
exact = p_exact
[]
# Overall pressure drop from the solved field.
[p_left]
type = SideAverageValue
variable = pressure
boundary = left
[]
[p_right]
type = SideAverageValue
variable = pressure
boundary = right
[]
[delta_p]
type = ParsedPostprocessor
expression = 'p_left - p_right'
pp_names = 'p_left p_right'
[]
# The block averages give a more direct measure of the interface jump because the exact
# solution is piecewise constant in each block.
[p_block_1]
type = ElementAverageValue
variable = pressure
block = 1
[]
[p_block_2]
type = ElementAverageValue
variable = pressure
block = 2
[]
[p_block_jump]
type = ParsedPostprocessor
expression = 'p_block_1 - p_block_2'
pp_names = 'p_block_1 p_block_2'
[]
# Check the superficial velocities on both sides of the jump.
[u_block_1]
type = ElementAverageValue
variable = superficial_u
block = 1
[]
[u_block_2]
type = ElementAverageValue
variable = superficial_u
block = 2
[]
[]
[VectorPostprocessors]
[centerline_solution]
type = LineValueSampler
variable = 'rho_aux porosity_aux superficial_u pressure'
start_point = '0.0 0.5 0'
end_point = '${fparse length_left + length_right} 0.5 0'
num_points = 50
sort_by = x
execute_on = timestep_end
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-16
momentum_l_tol = 0
pressure_l_tol = 0
rhie_chow_user_object = rc
momentum_systems = 'u_system v_system'
pressure_system = pressure_system
momentum_equation_relaxation = 0.4
pressure_variable_relaxation = 0.2
num_iterations = 500
pressure_absolute_tolerance = 1e-10
# The exact transverse velocity is zero, so the y-momentum system has a vanishing normalization
# factor and its normalized residual converges slowly without changing the solution. Its
# tolerance is therefore not used as a convergence criterion.
momentum_absolute_tolerance = '1e-10 1'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
csv = true
execute_on = timestep_end
[]
(test/tests/linearfvbcs/internal-boundary-functor-side/internal-boundary.i)
# The variable lives on block 1 only and is bounded by an internal sideset shared with block 2.
# The boundary functors are functor materials defined block by block, so the boundary condition
# must evaluate them on the variable side of the internal sideset.
#
# Dirichlet case: the boundary value is 1 on block 1 and 5 on block 2. With u(0) = 0, the exact
# solution on block 1 is u = x, which a two-point flux reproduces exactly; interpolating the two
# sides' values would raise the boundary value above 1.
#
# Anisotropic Neumann case: the flux is defined on block 2 only, which the boundary condition
# must find on the other side of the internal sideset. With the unit diffusivity, the exact
# solution is u = flux * x.
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 1
dx = '1 1'
ix = '4 4'
subdomain_id = '1 2'
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = cmg
new_boundary = interface
primary_block = 1
paired_block = 2
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = u_sys
initial_condition = 0
block = 1
[]
[]
[LinearFVKernels]
active = 'diffusion'
[diffusion]
type = LinearFVDiffusion
variable = u
[]
[anisotropic_diffusion]
type = LinearFVAnisotropicDiffusion
variable = u
diffusion_tensor = unit_tensor
[]
[]
[LinearFVBCs]
active = 'left dirichlet'
[left]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = left
functor = 0
[]
[dirichlet]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = interface
functor = boundary_value
[]
[anisotropic_neumann]
type = LinearFVAnisotropicDiffusionFunctorNeumannBC
variable = u
boundary = interface
functor = boundary_flux
diffusion_tensor = unit_tensor
[]
[]
[FunctorMaterials]
[boundary_value]
type = PiecewiseByBlockFunctorMaterial
prop_name = boundary_value
subdomain_to_prop_value = '1 1 2 5'
[]
[unit_tensor]
type = GenericVectorFunctorMaterial
prop_names = unit_tensor
prop_values = '1 1 1'
[]
[boundary_flux]
type = GenericFunctorMaterial
prop_names = boundary_flux
prop_values = 2
block = 2
[]
[]
[Functions]
[exact]
type = ParsedFunction
expression = 'x'
[]
[]
[Postprocessors]
[error]
type = ElementL2FunctorError
approximate = u
exact = exact
block = 1
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-12
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
csv = true
[]
(modules/heat_transfer/test/tests/fviks/fv_sideset_heat_transfer/fv_sideset_heat_transfer_one_variable.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 6
ny = 5
xmax = 2
subdomain_ids = '0 0 0 1 1 1
0 0 0 1 1 1
0 0 0 1 1 1
0 0 0 1 1 1
0 0 0 1 1 1'
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = gen
primary_block = 0
paired_block = 1
new_boundary = interface
[]
[]
[Problem]
kernel_coverage_check = false
[]
[Variables]
[T]
type = MooseVariableFVReal
initial_condition = 0.5
[]
[]
[FVKernels]
[diff_left]
type = FVDiffusion
variable = T
block = 0
coeff = 2
[]
[diff_right]
type = FVDiffusion
variable = T
block = 1
coeff = 4
[]
[]
[FVInterfaceKernels]
[interface_heat_transfer]
type = FVSideSetHeatTransferKernel
boundary = interface
subdomain1 = 0
subdomain2 = 1
variable1 = T
conductance = constant_conductance
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
boundary = left
variable = T
value = 1
[]
[right]
type = FVDirichletBC
boundary = right
variable = T
value = 0
[]
[]
[FunctorMaterials]
[constant_conductance]
type = ADGenericFunctorMaterial
prop_names = 'constant_conductance'
prop_values = '1'
[]
[piecewise_conductance]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'piecewise_conductance'
subdomain_to_prop_value = '0 1
1 100'
[]
[]
[VectorPostprocessors]
[temperature]
type = LineValueSampler
variable = T
start_point = '0 0.5 0'
end_point = '2 0.5 0'
num_points = 7
sort_by = x
warn_discontinuous_face_values = false
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
csv = true
execute_on = timestep_end
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/hydraulic-separators/separator-mixing-physics.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
[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
[]
[]
[Physics]
[NavierStokes]
[Flow]
[flow]
compressibility = 'incompressible'
porous_medium_treatment = true
# Material property parameters
density = ${rho}
dynamic_viscosity = ${mu}
# Porous medium parameters
porosity = porosity
porosity_interface_pressure_treatment = 'bernoulli'
pressure_drop_sidesets = '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'
friction_types = 'forchheimer'
friction_coeffs = 'Forchheimer_coefficient'
# Initial conditions
initial_velocity = '0.1 0 0'
initial_pressure = 0.0
# Boundary conditions
inlet_boundaries = 'left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_functors = '0.1 0'
wall_boundaries = 'top bottom'
momentum_wall_types = 'slip slip'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_functors = '0.4'
hydraulic_separator_sidesets = 'separator-1 separator-2'
[]
[]
[FluidHeatTransfer]
[heat]
# Material properties
thermal_conductivity = ${k}
specific_heat = ${cp}
# Initial conditions
initial_temperature = 300.0
# Boundary conditions
energy_inlet_types = 'fixed-temperature'
energy_inlet_functors = 300.0
energy_wall_types = 'heatflux heatflux'
energy_wall_functors = '0 0'
# Heat source
external_heat_source = heating
[]
[]
[]
[]
[Functions]
[heating]
type = ParsedFunction
expression = 'if(x>0.25 & x<1.25, if(y<0.25, 10, if(y<0.5, 20, 30)), 0)'
[]
[]
[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'
[]
[fc-1]
type = ADGenericVectorFunctorMaterial
prop_names = 'Forchheimer_coefficient'
prop_values = '1.0 1.0 1.0'
block = '1 5'
[]
[fc-2]
type = ADGenericVectorFunctorMaterial
prop_names = 'Forchheimer_coefficient'
prop_values = '3.0 3.0 3.0'
block = 2
[]
[fc-3]
type = ADGenericVectorFunctorMaterial
prop_names = 'Forchheimer_coefficient'
prop_values = '1.5 1.5 1.5'
block = 3
[]
[fc-4]
type = ADGenericVectorFunctorMaterial
prop_names = 'Forchheimer_coefficient'
prop_values = '0.75 0.75 0.75'
block = 4
[]
[]
[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
[]
(test/tests/interfacekernels/1d_interface/ad-coupled-value-coupled-flux.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 10
xmax = 2
[]
[subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '1.0 0 0'
block_id = 1
top_right = '2.0 1.0 0'
[]
[interface]
input = subdomain1
type = SideSetsBetweenSubdomainsGenerator
primary_block = '0'
paired_block = '1'
new_boundary = 'primary0_interface'
[]
[]
[Variables]
[u]
block = '0'
[]
[v]
block = '1'
[]
[]
[Kernels]
[diff_u]
type = ADMatDiffusion
variable = u
diffusivity = 4
block = 0
[]
[diff_v]
type = ADMatDiffusion
variable = v
diffusivity = 2
block = 1
[]
[]
[InterfaceKernels]
[penalty_interface]
type = ADPenaltyInterfaceDiffusion
variable = u
neighbor_var = v
boundary = primary0_interface
penalty = 1e6
jump_prop_name = "jump"
[]
[]
[Materials]
[bulk]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'functor_var_mat_prop'
subdomain_to_prop_value = '0 u 1 v'
[]
[bulk_traditional]
type = ScalarPropFromFunctorProp
functor = 'functor_var_mat_prop'
prop = 'var_mat_prop'
[]
[jump]
type = PropertyJumpInterfaceMaterial
property = var_mat_prop
boundary = primary0_interface
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = u
boundary = 'left'
value = 1
[]
[right]
type = ADDirichletBC
variable = v
boundary = 'right'
value = 0
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
(test/tests/actioncomponents/interfaces/component_with_ics.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
ix = 2
iy = 2
dx = 1
dy = 1
subdomain_id = 2
[]
final_generator = 'cmg'
[]
[Physics]
[Diffusion]
[FiniteVolume]
[phy1]
diffusivity_functor = 'diff'
# we make this physics defined everywhere to have a vector input of initial conditions
block = '2'
dirichlet_boundaries = 'left cylinder_1_left cylinder_2_right'
boundary_values = '1 3 2'
source_functor = '1'
source_coef = '1'
[]
[phy2]
variable_name = v
diffusivity_functor = 'diff'
source_functor = '2'
source_coef = '1'
dirichlet_boundaries = 'cylinder_2_right'
boundary_values = '2'
[]
[]
[]
[]
[ActionComponents]
[cylinder_1]
type = CylinderComponent
dimension = 2
radius = 2
length = 10
n_axial = 1
n_radial = 1
position = '1 0 0'
direction = '0 1 0'
physics = 'phy1'
block = 'cyl1'
initial_condition_variables = 'u'
initial_condition_values = '1.1'
[]
[cylinder_2]
type = CylinderComponent
dimension = 2
radius = 4
length = 1
n_axial = 1
n_radial = 1
position = '2 0 0'
direction = '0 0 1'
physics = 'phy1 phy2'
block = 'cyl2'
initial_condition_variables = 'u v'
initial_condition_values = '1.2 1.3'
[]
[]
[FunctorMaterials]
[diff]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'diff'
subdomain_to_prop_value = 'cyl1 1
2 1
cyl2 2'
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[min_u_c1]
type = ElementExtremeValue
value_type = min
variable = u
block = 'cyl1'
execute_on = 'INITIAL TIMESTEP_END'
[]
[min_u_c2]
type = ElementExtremeValue
value_type = min
variable = u
block = 'cyl2'
execute_on = 'INITIAL TIMESTEP_END'
[]
[min_v]
type = ElementExtremeValue
value_type = min
variable = v
block = 'cyl2'
execute_on = 'INITIAL TIMESTEP_END'
[]
[max_u_c1]
type = ElementExtremeValue
variable = u
block = 'cyl1'
execute_on = 'INITIAL TIMESTEP_END'
[]
[max_u_c2]
type = ElementExtremeValue
variable = u
block = 'cyl2'
execute_on = 'INITIAL TIMESTEP_END'
[]
[max_v]
type = ElementExtremeValue
variable = v
block = 'cyl2'
execute_on = 'INITIAL TIMESTEP_END'
[]
[ave_u_c1]
type = ElementAverageValue
variable = u
block = 'cyl1'
execute_on = 'INITIAL TIMESTEP_END'
[]
[ave_u_c2]
type = ElementAverageValue
variable = u
block = 'cyl2'
execute_on = 'INITIAL TIMESTEP_END'
[]
[ave_v]
type = ElementAverageValue
variable = v
block = 'cyl2'
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/formloss/formloss_multiple.i)
# The expected pressure drop from textbook correlations for this example is: 1081.468315
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '1.0 1.0 1.0 1.0 1.0 1.0'
dy = '1.0'
subdomain_id = '1 2 3 3 4 5'
[]
[area_change_1]
type = SideSetsAroundSubdomainGenerator
input = gen
block = 1
normal = '1 0 0'
new_boundary = 'area_change_1'
[]
[area_change_2]
type = SideSetsAroundSubdomainGenerator
input = area_change_1
block = 4
normal = '1 0 0'
new_boundary = 'area_change_2'
[]
[]
[Variables]
[pressure]
type = BernoulliPressureVariable
pressure_drop_sidesets = 'area_change_1 area_change_2'
pressure_drop_form_factors = '0.2973 0.25'
porosity = porosity
u = superficial_vel_x
v = superficial_vel_y
rho = 988.0
initial_condition = 1.01e5
block = '1 2 3 4 5'
[]
[]
[Materials]
[all_constant_props]
type = ADGenericConstantFunctorMaterial
prop_names = 'u rho mu '
prop_values = '0.50 988 1e-3 '
[]
[porosityMat]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = porosity
subdomain_to_prop_value = '1 1.00
2 0.50
3 0.50
4 0.50
5 1.00'
[]
[]
[Modules]
[NavierStokesFV]
block = '1 2 3 4 5'
compressibility = 'weakly-compressible'
porous_medium_treatment = true
# Material property parameters
density = rho
dynamic_viscosity = mu
pressure_variable = pressure
# Porous medium parameters
porosity = porosity
porosity_interface_pressure_treatment = 'bernoulli'
# Boundary conditions
inlet_boundaries = 'left'
outlet_boundaries = 'right'
momentum_inlet_types = fixed-velocity
momentum_inlet_functors = '1.0 0.0'
momentum_outlet_types = fixed-pressure
pressure_functors = '1.01e5'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-6
l_max_its = 100
nl_max_its = 100
automatic_scaling = true
off_diagonals_in_auto_scaling = true
line_search = none
[]
[Postprocessors]
[inlet_pressure]
type = ElementAverageValue
variable = pressure
block = 1
[]
[middle_pressure]
type = ElementAverageValue
variable = pressure
block = 2
[]
[outlet_pressure]
type = ElementAverageValue
variable = pressure
block = 5
[]
[pressure_drop]
type = ParsedPostprocessor
pp_names = 'inlet_pressure outlet_pressure'
expression = 'inlet_pressure - outlet_pressure'
[]
[]
[Outputs]
csv = true
execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/1d-simple-channel/porous-baffle-1d.i)
# One-dimensional verification of Bernoulli jumps, porous drag, and form loss.
# Mass conservation gives u_block_1 = u_block_2 = 0.1 and u_block_jump = 0.
# Without drag or form loss, the two pressure jumps (right minus left) are 0.03 and -0.03,
# so p_left = p_right = p_jump = 0. With mu = 1 and Forchheimer = 50, the porous block
# adds a pressure drop of 0.25. A form-loss coefficient of 10 adds 0.4 at each baffle,
# giving p_jump = p_left - p_right = 1.05 and baffle jumps of -0.37 and -0.43.
# Referencing the higher-porosity velocity 0.1 instead of the lower-porosity velocity 0.2 makes the
# form loss 0.1 at that baffle. With reference_velocity_side = 'lower_porosity higher_porosity',
# the baffle jumps are -0.37 and -0.13; with 'higher_porosity lower_porosity', they are -0.07 and
# -0.43. Both give p_jump = 0.75.
mu = 0.0 # 1e-2
rho = 2.0
advected_interp_method = 'average'
forchheimer_value = 50
inlet_u = 0.1
[FVGradientMethods]
[jump_aware]
type = FVPressureJumpGreenGaussGradient
[]
[velocity_jump_aware]
type = FVVelocityJumpGreenGaussGradient
[]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = jump_aware
gradient_relaxation = 1.0
[]
[]
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 1
dx = '0.5 0.5 0.5'
ix = '200 200 200'
subdomain_id = '1 2 3'
[]
[baffle]
type = SideSetsBetweenSubdomainsGenerator
input = mesh
primary_block = '1'
paired_block = '2'
new_boundary = 'baffle'
[]
[baffle2]
type = SideSetsBetweenSubdomainsGenerator
input = baffle
primary_block = '2'
paired_block = '3'
new_boundary = 'baffle2'
[]
[]
[Problem]
linear_sys_names = 'u_system pressure_system'
previous_nl_solution_required = true
[]
[UserObjects]
[pressure_jump]
type = BernoulliFormLossPressureJump
boundary = 'baffle baffle2'
porosity = porosity
density = ${rho}
[]
[rc]
type = PorousRhieChowMassFlux
u = superficial_u
pressure = pressure
rho = ${rho}
porosity = porosity
p_diffusion_kernel = p_diffusion
pressure_jump_models = pressure_jump
pressure_jump_relaxation = 0.1
[]
[]
[Variables]
[superficial_u]
type = MooseLinearVariableFVReal
solver_sys = u_system
initial_condition = ${inlet_u}
gradient_method = velocity_jump_aware
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0.0
gradient_method = jump_aware
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[LinearFVKernels]
[u_advection]
type = LinearPWCNSFVMomentumFlux
variable = superficial_u
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
u = superficial_u
momentum_component = 'x'
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_u
momentum_component = 'x'
porosity = porosity
pressure = pressure
gradient_method = reconstructed
[]
[u_friction]
type = LinearFVMomentumFriction
variable = superficial_u
Forchheimer_name = forch
porosity = porosity
rho = ${rho}
u = superficial_u
momentum_component = 'x'
block = 2
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusionJump
variable = pressure
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[inlet_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = superficial_u
functor = ${inlet_u}
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
variable = superficial_u
use_two_term_expansion = false
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = right
variable = pressure
functor = 0.0
[]
[]
[FunctorMaterials]
[forch]
type = GenericVectorFunctorMaterial
prop_names = forch
prop_values = '${forchheimer_value} ${forchheimer_value} ${forchheimer_value}'
[]
[porosity]
type = PiecewiseByBlockFunctorMaterial
prop_name = porosity
subdomain_to_prop_value = '1 0.5 2 1.0 3 0.5'
[]
[]
[Postprocessors]
[p_left]
type = SideAverageValue
variable = pressure
boundary = left
[]
[p_right]
type = SideAverageValue
variable = pressure
boundary = right
[]
[p_jump]
type = ParsedPostprocessor
expression = 'p_left - p_right'
pp_names = 'p_left p_right'
[]
# These points are the centers of the cells adjacent to x = 0.5 and x = 1.0. The mesh spacing
# is 0.5 / 200 = 0.0025, so the adjacent centers are offset by half that distance.
[p_baffle_1_left]
type = PointValue
variable = pressure
point = '0.49875 0 0'
[]
[p_baffle_1_right]
type = PointValue
variable = pressure
point = '0.50125 0 0'
[]
[p_baffle_2_left]
type = PointValue
variable = pressure
point = '0.99875 0 0'
[]
[p_baffle_2_right]
type = PointValue
variable = pressure
point = '1.00125 0 0'
[]
[p_baffle_1_jump]
type = ParsedPostprocessor
expression = 'p_baffle_1_right - p_baffle_1_left'
pp_names = 'p_baffle_1_right p_baffle_1_left'
[]
[p_baffle_2_jump]
type = ParsedPostprocessor
expression = 'p_baffle_2_right - p_baffle_2_left'
pp_names = 'p_baffle_2_right p_baffle_2_left'
[]
[u_block_1]
type = ElementAverageValue
variable = superficial_u
block = 1
[]
[u_block_2]
type = ElementAverageValue
variable = superficial_u
block = 2
[]
[u_block_jump]
type = ParsedPostprocessor
expression = 'u_block_1 - u_block_2'
pp_names = 'u_block_1 u_block_2'
[]
[]
[AuxVariables]
[porosity_aux]
type = MooseLinearVariableFVReal
[]
[]
[AuxKernels]
[por]
type = FunctorAux
variable = porosity_aux
functor = porosity
execute_on = 'timestep_end'
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-12
pressure_l_abs_tol = 1e-12
momentum_l_tol = 0
pressure_l_tol = 0
rhie_chow_user_object = rc
momentum_systems = 'u_system'
pressure_system = pressure_system
momentum_equation_relaxation = 0.3
pressure_variable_relaxation = 0.1
num_iterations = 1000
pressure_absolute_tolerance = 1e-8
# The exact superficial velocity is uniform, so the momentum normalization factor
# sum(|Ax - Ax_avg| + |b - Ax_avg|) nearly vanishes and the normalized momentum residual measures
# round-off. It levels off at a value that depends on the partitioning (near 1e-2 on one process,
# near 1e-1 on three), so only the pressure residual is used as a convergence criterion.
momentum_absolute_tolerance = 1
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
csv = true
execute_on = 'timestep_end'
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/porosity_jump/formloss/formloss_single.i)
# The expected pressure increase from textbook correlations for an expansion is: -355.68 Pa
# The form loss coefficient is computed with the following expression:
#
# K = (1-\beta)^2 = 0.25,
#
# where $\beta$ is the area ratio (0.5 in our case). With this, the total pressure drop
# can be computed using:
#
# \Delta p = 0.5 * K * \rho * v_upstream^2 + 0.5 * \rho * (v_downstream^2 - v_upstream^2)
#
# The expected pressure drop from textbook correlations for a contraction is: 2980.03437 Pa
# The form loss coefficient is computed with the following expression:
#
# K = 0.5*(1-/beta)^0.75 = 0.29730,
#
# where $\beta$ is the area ratio (0.5 in our case). With this, the total pressure drop
# can be computed using:
#
# \Delta p = 0.5 * K * rho * v_downstream^2 + 0.5 * \rho * (v_downstream^2 - v_upstream^2)
#
# Every velocity in these expressions is interstitial normal velocity to the surface.
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '1.0 1.0'
dy = '1.0'
subdomain_id = '1 2'
[]
[area_change]
type = SideSetsAroundSubdomainGenerator
input = gen
block = 1
normal = '1 0 0'
new_boundary = 'area_change'
[]
[]
[Materials]
[all_constant_props]
type = ADGenericConstantFunctorMaterial
prop_names = 'rho mu '
prop_values = '988 1e-3 '
[]
[porosity]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = porosity
subdomain_to_prop_value = '1 0.50
2 1.00'
[]
[]
[Physics]
[NavierStokes]
[Flow]
[flow]
block = '1 2'
compressibility = 'weakly-compressible'
porous_medium_treatment = true
# Material property parameters
density = rho
dynamic_viscosity = mu
# Porous medium parameters
porosity = porosity
porosity_interface_pressure_treatment = 'bernoulli'
pressure_drop_sidesets = 'area_change'
pressure_drop_form_factors = '0.25'
# Boundary conditions
inlet_boundaries = 'left'
outlet_boundaries = 'right'
momentum_inlet_types = fixed-velocity
momentum_inlet_functors = '0.6 0.0'
momentum_outlet_types = fixed-pressure
pressure_functors = '1.01e5'
[]
[]
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
[]
[Postprocessors]
[inlet_pressure]
type = ElementAverageValue
variable = pressure
block = 1
outputs = none
[]
[outlet_pressure]
type = ElementAverageValue
variable = pressure
block = 2
outputs = none
[]
[pressure_drop]
type = ParsedPostprocessor
pp_names = 'inlet_pressure outlet_pressure'
expression = 'inlet_pressure - outlet_pressure'
[]
[]
[Outputs]
csv = true
execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/ins/pump/pump_as_volume_force_loop_force_corrected.i)
mu = 1.0
rho = 1.0
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.1 0.8 0.1'
dy = '0.1 0.8 0.1'
ix = '5 20 5'
iy = '5 20 5'
subdomain_id = '1 1 1
1 2 1
1 1 1'
[]
[delete_internal_part]
type = BlockDeletionGenerator
input = gen
block = '2'
new_boundary = 'wall-internal'
[]
[lump_bdries_to_wall]
type = RenameBoundaryGenerator
input = delete_internal_part
old_boundary = 'bottom right top left'
new_boundary = 'wall-external wall-external wall-external wall-external'
[]
[pump_domain]
type = ParsedSubdomainMeshGenerator
input = lump_bdries_to_wall
combinatorial_geometry = 'x > 0.3 & x < 0.7 & y > 0.5'
block_id = '3'
[]
[rename_blocks]
type = RenameBlockGenerator
input = pump_domain
old_block = '1 3'
new_block = 'pipe pump'
[]
[side_pump]
type = ParsedGenerateSideset
input = rename_blocks
included_subdomains = 'pump'
included_neighbors = 'pipe'
new_sideset_name = 'pump_side'
normal = '1 0 0'
combinatorial_geometry = 'x > 0.35'
[]
[]
[GlobalParams]
velocity_interp_method = 'rc'
advected_interp_method = 'upwind'
rhie_chow_user_object = 'rc'
[]
[Problem]
material_coverage_check = False
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
correct_volumetric_force = true
volumetric_force_functors = 'pump_force'
volume_force_correction_method = 'force-consistent'
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 1
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1
[]
[pressure]
type = INSFVPressureVariable
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = vel_x
y = vel_y
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[mean_zero_pressure]
type = FVIntegralValueConstraint
variable = pressure
lambda = lambda
phi0 = 0.0
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_pump]
type = INSFVBodyForce
variable = vel_x
momentum_component = 'x'
functor = 'pump_force'
block = 'pump'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[]
[FVBCs]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'wall-internal wall-external'
variable = vel_x
function = '0'
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'wall-internal wall-external'
variable = vel_y
function = '0'
[]
[]
[FunctorMaterials]
[pump_force]
type = PiecewiseByBlockFunctorMaterial
prop_name = 'pump_force'
subdomain_to_prop_value = 'pump 1000.0
pipe 0.0'
[]
[]
[Postprocessors]
[flow_rate]
type = Receiver
default = 1.0
[]
[flow_rate_to_pipe]
type = VolumetricFlowRate
advected_quantity = ${rho}
boundary = 'pump_side'
vel_x = 'vel_x'
vel_y = 'vel_y'
[]
[maximum_speed]
type = ADElementExtremeFunctorValue
functor = vel_x
value_type = max
[]
[]
[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 = false
[out]
type = CSV
execute_on = FINAL
show = 'flow_rate_to_pipe maximum_speed'
[]
[]
(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
[]
(test/tests/fvkernels/mms/broken-domain/diffusion.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 2
xmax = 2
[]
[subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '1.0 0 0'
block_id = 1
top_right = '2.0 1.0 0'
[]
[interface_primary_side]
input = subdomain1
type = SideSetsBetweenSubdomainsGenerator
primary_block = '0'
paired_block = '1'
new_boundary = 'primary_interface'
[]
[interface_secondary_side]
input = interface_primary_side
type = SideSetsBetweenSubdomainsGenerator
primary_block = '1'
paired_block = '0'
new_boundary = 'secondary_interface'
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
block = 0
initial_condition = 0.5
[]
[v]
type = MooseVariableFVReal
block = 1
initial_condition = 0.5
[]
[]
[FVKernels]
[diff_left]
type = FVDiffusion
variable = u
coeff = 'left'
block = 0
[]
[diff_right]
type = FVDiffusion
variable = v
coeff = 'right'
block = 1
[]
[body_left]
type = FVBodyForce
variable = u
function = 'forcing'
block = 0
[]
[body_right]
type = FVBodyForce
variable = v
function = 'forcing'
block = 1
[]
[]
[FVInterfaceKernels]
# This will add a flux term for variable1, e.g. u
[interface]
type = FVOnlyAddDiffusionToOneSideOfInterface
variable1 = u
variable2 = v
boundary = 'primary_interface'
subdomain1 = '0'
subdomain2 = '1'
coeff2 = 'right'
[]
[]
[FVBCs]
[left]
type = FVFunctionDirichletBC
variable = u
boundary = 'left'
function = 'exact'
[]
[right]
type = FVFunctionDirichletBC
variable = v
boundary = 'right'
function = 'exact'
[]
[middle]
# The BC producer variable v is defined on block 1 while the functor u is defined on block 0.
# This exercises evaluating a functor on the opposite side of the face from the producer while
# also ensuring that flux kernels run for variable v.
type = FVADUseFunctorSideForSsfDirichletBC
variable = v
functor = u
boundary = 'secondary_interface'
[]
[]
[FunctorMaterials]
[block0]
type = ADGenericFunctorMaterial
block = '0'
prop_names = 'left'
prop_values = '1'
[]
[block1]
type = ADGenericFunctorMaterial
block = '1'
prop_names = 'right'
prop_values = '1'
[]
[composite]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'composite'
subdomain_to_prop_value = '0 u 1 v'
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm lu NONZERO'
[]
[Outputs]
exodus = true
csv = true
[]
[Functions]
[exact]
type = ParsedFunction
expression = '3*x^2 + 2*x + 1'
[]
[forcing]
type = ParsedFunction
expression = '-6'
[]
[]
[Postprocessors]
[error]
type = ElementL2FunctorError
approximate = composite
exact = exact
outputs = 'console csv'
[]
[h]
type = AverageElementSize
outputs = 'console csv'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/scalar_advection/2d-rc-physics.i)
mu = 1.1
rho = 1.1
# No scalar diffusion, as we are looking at advective flow rate for conservation
diff = 0
advected_interp_method = 'upwind'
[Problem]
error_on_jacobian_nonzero_reallocation = true
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 5
ymin = 0
ymax = 1
nx = 20
ny = 10
[]
[second_block]
type = ParsedSubdomainMeshGenerator
input = 'gen'
combinatorial_geometry = 'x > 2.5001'
block_id = '1'
[]
[middle]
type = SideSetsBetweenSubdomainsGenerator
input = 'second_block'
primary_block = '0'
paired_block = '1'
new_boundary = 'mid'
[]
[]
[Physics]
[NavierStokes]
[Flow]
[flow]
compressibility = 'incompressible'
porous_medium_treatment = true
density = 'rho'
dynamic_viscosity = 'mu'
# Porosity settings
porosity = 'porosity'
porosity_interface_pressure_treatment = 'bernoulli'
initial_velocity = '1 1e-6 0'
initial_pressure = 0.0
inlet_boundaries = 'left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_functors = '1 0'
wall_boundaries = 'top bottom'
momentum_wall_types = 'slip slip'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_functors = '0'
mass_advection_interpolation = '${advected_interp_method}'
momentum_advection_interpolation = '${advected_interp_method}'
[]
[]
[ScalarTransport]
[flow]
passive_scalar_names = 'scalar'
passive_scalar_diffusivity = '${diff}'
# Should add +1.25 to scalar concentration on left domain
# Then multiply by 2: 3.25 -> 6.5
# then +2.5 on the right domain -> outlet flow at 9
passive_scalar_coupled_source = Q
passive_scalar_coupled_source_coeff = 0.1
# See flow for inlet boundary
passive_scalar_inlet_types = 'fixed-value'
passive_scalar_inlet_functors = '2'
# No need to specify wall or outlet boundaries here
passive_scalar_advection_interpolation = '${advected_interp_method}'
[]
[]
[]
[]
[FunctorMaterials]
[const]
type = ADGenericFunctorMaterial
prop_names = 'rho mu Q'
prop_values = '${rho} ${mu} 10'
[]
[eps_step]
type = PiecewiseByBlockFunctorMaterial
prop_name = 'porosity'
subdomain_to_prop_value = '0 0.5
1 1'
[]
[]
[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-u]
type = VolumetricFlowRate
vel_x = 'superficial_vel_x'
vel_y = 'superficial_vel_y'
advected_quantity = '1'
rhie_chow_user_object = 'pins_rhie_chow_interpolator'
advected_interp_method = '${advected_interp_method}'
subtract_mesh_velocity = 'false'
boundary = 'left'
[]
[outlet-u]
type = VolumetricFlowRate
vel_x = 'superficial_vel_x'
vel_y = 'superficial_vel_y'
advected_quantity = '1'
rhie_chow_user_object = 'pins_rhie_chow_interpolator'
advected_interp_method = '${advected_interp_method}'
subtract_mesh_velocity = 'false'
boundary = 'right'
[]
[inlet-momx]
type = VolumetricFlowRate
vel_x = 'superficial_vel_x'
vel_y = 'superficial_vel_y'
advected_quantity = 'superficial_vel_x'
rhie_chow_user_object = 'pins_rhie_chow_interpolator'
advected_interp_method = '${advected_interp_method}'
subtract_mesh_velocity = 'false'
boundary = 'left'
[]
[outlet-momx]
type = VolumetricFlowRate
vel_x = 'superficial_vel_x'
vel_y = 'superficial_vel_y'
advected_quantity = 'superficial_vel_x'
rhie_chow_user_object = 'pins_rhie_chow_interpolator'
advected_interp_method = '${advected_interp_method}'
subtract_mesh_velocity = 'false'
boundary = 'right'
[]
[inlet-scalar]
type = VolumetricFlowRate
vel_x = 'superficial_vel_x'
vel_y = 'superficial_vel_y'
advected_quantity = 'scalar'
rhie_chow_user_object = 'pins_rhie_chow_interpolator'
advected_interp_method = '${advected_interp_method}'
subtract_mesh_velocity = 'false'
boundary = 'left'
[]
[mid-scalar]
type = VolumetricFlowRate
vel_x = 'superficial_vel_x'
vel_y = 'superficial_vel_y'
advected_quantity = 'scalar'
rhie_chow_user_object = 'pins_rhie_chow_interpolator'
advected_interp_method = '${advected_interp_method}'
subtract_mesh_velocity = 'false'
boundary = 'mid'
[]
[outlet-scalar]
type = VolumetricFlowRate
vel_x = 'superficial_vel_x'
vel_y = 'superficial_vel_y'
advected_quantity = 'scalar'
rhie_chow_user_object = 'pins_rhie_chow_interpolator'
advected_interp_method = '${advected_interp_method}'
subtract_mesh_velocity = 'false'
boundary = 'right'
[]
[]
[Outputs]
exodus = true
csv = true
[]