- boundaryThe list of boundary IDs from the mesh where this object applies
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:The list of boundary IDs from the mesh where this object applies
- vel_xThe x-axis velocity
C++ Type:std::vector<VariableName>
Controllable:No
Description:The x-axis velocity
VolumetricFlowRate
Computes the volumetric flow rate of an advected quantity through a sideset.
Example input syntax
In this example, we measure:
the mass flow rate
the momentum flow rate
the enthalpy flow rate
with numerous VolumetricFlowRate
postprocessors to prove the conservation of mass, momentum and energy of the finite volume discretization of the incompressible Navier Stokes equations.
[Postprocessors]
[inlet_mass_variable]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = advected_density
[]
[inlet_mass_constant]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[inlet_mass_matprop]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = 'advected_rho'
[]
[mid1_mass]
type = VolumetricFlowRate
boundary = internal_bot
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[mid2_mass]
type = VolumetricFlowRate
boundary = internal_top
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[outlet_mass]
type = VolumetricFlowRate
boundary = top
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[inlet_momentum_x]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = u
[]
[inlet_momentum_y]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = v
[]
[mid1_advected_energy]
type = VolumetricFlowRate
boundary = internal_bot
vel_x = u
vel_y = v
advected_quantity = 'rho_cp_temp'
advected_interp_method = 'upwind'
[]
[mid2_advected_energy]
type = VolumetricFlowRate
boundary = internal_top
vel_x = u
vel_y = v
advected_quantity = 'rho_cp_temp'
advected_interp_method = 'upwind'
[]
[outlet_advected_energy]
type = VolumetricFlowRate
boundary = top
vel_x = u
vel_y = v
advected_quantity = 'rho_cp_temp'
advected_interp_method = 'upwind'
[]
[]
(modules/navier_stokes/test/tests/postprocessors/flow_rates/conservation_INSFV.i)Input Parameters
- advected_interp_methodupwindThe interpolation to use for the advected quantity. Options are 'upwind', 'average', 'sou' (for second-order upwind), 'min_mod', 'vanLeer', 'quick', and 'skewness-corrected' with the default being 'upwind'.
Default:upwind
C++ Type:MooseEnum
Options:average, upwind, sou, min_mod, vanLeer, quick, skewness-corrected
Controllable:No
Description:The interpolation to use for the advected quantity. Options are 'upwind', 'average', 'sou' (for second-order upwind), 'min_mod', 'vanLeer', 'quick', and 'skewness-corrected' with the default being 'upwind'.
- advected_mat_prop0The advected material property of which to study the flow; useful for finite element simulations. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.
Default:0
C++ Type:MooseFunctorName
Controllable:No
Description:The advected material property of which to study the flow; useful for finite element simulations. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.
- advected_quantityThe quantity to advect. This is the canonical parameter to set the advected quantity when finite volume is being used. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.
C++ Type:MooseFunctorName
Controllable:No
Description:The quantity to advect. This is the canonical parameter to set the advected quantity when finite volume is being used. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.
- advected_variableThe advected variable quantity of which to study the flow; useful for finite element simulations
C++ Type:std::vector<VariableName>
Controllable:No
Description:The advected variable quantity of which to study the flow; useful for finite element simulations
- execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.
Default:TIMESTEP_END
C++ Type:ExecFlagEnum
Options:FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, TRANSFER
Controllable:No
Description:The list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- rhie_chow_user_objectThe rhie-chow user-object
C++ Type:UserObjectName
Controllable:No
Description:The rhie-chow user-object
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
- vel_yThe y-axis velocity
C++ Type:std::vector<VariableName>
Controllable:No
Description:The y-axis velocity
- vel_zThe z-axis velocity
C++ Type:std::vector<VariableName>
Controllable:No
Description:The z-axis velocity
- velocity_interp_methodrcThe interpolation to use for the velocity. Options are 'average' and 'rc' which stands for Rhie-Chow. The default is Rhie-Chow.
Default:rc
C++ Type:MooseEnum
Options:average, rc
Controllable:No
Description:The interpolation to use for the velocity. Options are 'average' and 'rc' which stands for Rhie-Chow. The default is Rhie-Chow.
Optional Parameters
- allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
Default:False
C++ Type:bool
Controllable:No
Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
- 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.
- execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
Default:0
C++ Type:int
Controllable:No
Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
- force_postauxFalseForces the UserObject to be executed in POSTAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in POSTAUX
- force_preauxFalseForces the UserObject to be executed in PREAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREAUX
- force_preicFalseForces the UserObject to be executed in PREIC during initial setup
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREIC during initial setup
- outputsVector of output names where you would like to restrict the output of variables(s) associated with this object
C++ Type:std::vector<OutputName>
Controllable:No
Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
Input Files
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_no_parts_steady_stabilized_second_order.i)
- (modules/navier_stokes/test/tests/postprocessors/flow_rates/conservation_PINSFV.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_by_parts_steady_stabilized.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/pump/pump_and_counterpump_loop.i)
- (modules/navier_stokes/test/tests/finite_volume/fviks/convection/convection_channel.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_no_parts_steady.i)
- (modules/navier_stokes/test/tests/postprocessors/flow_rates/mass_flux_weighted_pp.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_no_parts_steady_stabilized.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/segregated/2d/2d-segregated-scalar.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_by_parts_steady.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/RZ_cone_high_reynolds.i)
- (modules/navier_stokes/test/tests/finite_volume/controls/switch-pressure-bc/switch_vel_pres_bc.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/rz_cone_by_parts_steady_stabilized.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/RZ_cone_by_parts.i)
- (modules/navier_stokes/test/tests/finite_volume/pwcns/channel-flow/2d-transient-gas.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/pump/pump_loop.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_by_parts_steady_stabilized_second_order.i)
- (modules/navier_stokes/test/tests/finite_volume/materials/flow_diode/transient_operation.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/with-direction/flux_bcs-direction-action.i)
- (modules/navier_stokes/test/tests/postprocessors/flow_rates/conservation_INSFV.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/rz_cone_by_parts_steady_nobcbc.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/rz_cone_no_parts_steady.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/rz_cone_by_parts_steady_stabilized_second_order.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_no_parts.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_no_parts_steady_nobcbc.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/pump/pump_loop_negative_rotation.i)
- (modules/navier_stokes/test/tests/postprocessors/flow_rates/conservation_INSFE.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_by_parts.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_by_parts_steady_nobcbc.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/ins/pump/pump_as_volume_force_loop_pressure_corrected.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/rz_cone_no_parts_steady_stabilized.i)
- (modules/navier_stokes/test/tests/finite_volume/materials/flow_diode/friction.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/natural_convection/natural_circulation_pipe.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad-rz-displacements.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_by_parts_traction_steady_stabilized.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/rz_cone_by_parts_traction_steady_stabilized.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/rz_cone_no_parts_steady_stabilized_second_order.i)
- (modules/navier_stokes/test/tests/finite_volume/materials/ergun/ergun.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/natural_convection/natural_circulation_dogleg.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_reversal.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/neighbor-connected-boundary/test.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/RZ_cone_no_parts.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/rz_cone_by_parts_steady.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/rz_cone_no_parts_steady_nobcbc.i)
Child Objects
(modules/navier_stokes/test/tests/postprocessors/flow_rates/conservation_INSFV.i)
mu=1
rho=1
advected_interp_method='average'
velocity_interp_method='rc'
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Mesh]
inactive = 'mesh internal_boundary_bot internal_boundary_top'
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '1'
dy = '1 1 1'
ix = '5'
iy = '5 5 5'
subdomain_id = '1
2
3'
[]
[internal_boundary_bot]
type = SideSetsBetweenSubdomainsGenerator
input = mesh
new_boundary = 'internal_bot'
primary_block = 1
paired_block = 2
[]
[internal_boundary_top]
type = SideSetsBetweenSubdomainsGenerator
input = internal_boundary_bot
new_boundary = 'internal_top'
primary_block = 2
paired_block = 3
[]
[diverging_mesh]
type = FileMeshGenerator
file = 'expansion_quad.e'
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = 0
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1
[]
[pressure]
type = INSFVPressureVariable
[]
[temperature]
type = INSFVEnergyVariable
[]
[]
[AuxVariables]
[advected_density]
type = MooseVariableFVReal
initial_condition = ${rho}
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
force_boundary_execution = true
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
force_boundary_execution = true
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = temperature
advected_interp_method = 'upwind'
[]
[temp_source]
type = FVBodyForce
variable = temperature
function = 10
block = 1
[]
[]
[FVBCs]
inactive = 'noslip-u noslip-v'
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'bottom'
variable = u
function = 0
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'bottom'
variable = v
function = 1
[]
[noslip-u]
type = INSFVNoSlipWallBC
boundary = 'right'
variable = u
function = 0
[]
[noslip-v]
type = INSFVNoSlipWallBC
boundary = 'right'
variable = v
function = 0
[]
[free-slip-u]
type = INSFVNaturalFreeSlipBC
boundary = 'right'
variable = u
momentum_component = 'x'
[]
[free-slip-v]
type = INSFVNaturalFreeSlipBC
boundary = 'right'
variable = v
momentum_component = 'y'
[]
[axis-u]
type = INSFVSymmetryVelocityBC
boundary = 'left'
variable = u
u = u
v = v
mu = ${mu}
momentum_component = x
[]
[axis-v]
type = INSFVSymmetryVelocityBC
boundary = 'left'
variable = v
u = u
v = v
mu = ${mu}
momentum_component = y
[]
[axis-p]
type = INSFVSymmetryPressureBC
boundary = 'left'
variable = pressure
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'top'
variable = pressure
function = 0
[]
[inlet_temp]
type = FVNeumannBC
boundary = 'bottom'
variable = temperature
value = 300
[]
[]
[FunctorMaterials]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'temperature'
rho = ${rho}
[]
[advected_material_property]
type = ADGenericFunctorMaterial
prop_names = 'advected_rho cp'
prop_values ='${rho} 1'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm 200 lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
[]
[Postprocessors]
[inlet_mass_variable]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = advected_density
[]
[inlet_mass_constant]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[inlet_mass_matprop]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = 'advected_rho'
[]
[mid1_mass]
type = VolumetricFlowRate
boundary = internal_bot
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[mid2_mass]
type = VolumetricFlowRate
boundary = internal_top
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[outlet_mass]
type = VolumetricFlowRate
boundary = top
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[inlet_momentum_x]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = u
[]
[inlet_momentum_y]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = v
[]
[mid1_advected_energy]
type = VolumetricFlowRate
boundary = internal_bot
vel_x = u
vel_y = v
advected_quantity = 'rho_cp_temp'
advected_interp_method = 'upwind'
[]
[mid2_advected_energy]
type = VolumetricFlowRate
boundary = internal_top
vel_x = u
vel_y = v
advected_quantity = 'rho_cp_temp'
advected_interp_method = 'upwind'
[]
[outlet_advected_energy]
type = VolumetricFlowRate
boundary = top
vel_x = u
vel_y = v
advected_quantity = 'rho_cp_temp'
advected_interp_method = 'upwind'
[]
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_no_parts_steady_stabilized_second_order.i)
[GlobalParams]
order = SECOND
integrate_p_by_parts = false
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[AuxVariables]
[vel_x]
[]
[vel_y]
[]
[]
[AuxKernels]
[vel_x]
type = VectorVariableComponentAux
variable = vel_x
vector_variable = velocity
component = 'x'
[]
[vel_y]
type = VectorVariableComponentAux
variable = vel_y
vector_variable = velocity
component = 'y'
[]
[]
[Variables]
[./velocity]
family = LAGRANGE_VEC
[../]
[./p]
order = FIRST
[../]
[]
# Need to set a non-zero initial condition because we have a velocity norm in
# the denominator for the tau coefficient of the stabilization term
[ICs]
[velocity]
type = VectorConstantIC
x_value = 1e-15
y_value = 1e-15
variable = velocity
[]
[]
[Kernels]
[./mass]
type = INSADMass
variable = p
[../]
[mass_pspg]
type = INSADMassPSPG
variable = p
[]
[momentum_advection]
type = INSADMomentumAdvection
variable = velocity
[]
[./momentum_viscous]
type = INSADMomentumViscous
variable = velocity
[../]
[./momentum_pressure]
type = INSADMomentumPressure
variable = velocity
pressure = p
[../]
[momentum_supg]
type = INSADMomentumSUPG
variable = velocity
velocity = velocity
[]
[]
[BCs]
[p_corner]
type = DirichletBC
boundary = top_right
value = 0
variable = p
[]
[inlet]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'bottom'
function_x = 0
function_y = 'inlet_func'
[../]
[wall]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'right'
function_x = 0
function_y = 0
[]
[axis]
type = ADVectorFunctionDirichletBC
variable = velocity
boundary = 'left'
set_y_comp = false
function_x = 0
[]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Materials]
[./const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[ins_mat]
type = INSADTauMaterial
velocity = velocity
pressure = p
[]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
solve_type = 'NEWTON'
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/postprocessors/flow_rates/conservation_PINSFV.i)
mu=1
rho=1
advected_interp_method='average'
velocity_interp_method='rc'
[Mesh]
inactive = 'mesh internal_boundary_bot internal_boundary_top'
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '1'
dy = '1 1 1'
ix = '5'
iy = '5 5 5'
subdomain_id = '1
2
3'
[]
[internal_boundary_bot]
type = SideSetsBetweenSubdomainsGenerator
input = mesh
new_boundary = 'internal_bot'
primary_block = 1
paired_block = 2
[]
[internal_boundary_top]
type = SideSetsBetweenSubdomainsGenerator
input = internal_boundary_bot
new_boundary = 'internal_top'
primary_block = 2
paired_block = 3
[]
[diverging_mesh]
type = FileMeshGenerator
file = 'expansion_quad.e'
[]
[]
[Problem]
fv_bcs_integrity_check = true
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
porosity = porosity
[]
[]
[Variables]
[u]
type = PINSFVSuperficialVelocityVariable
initial_condition = 0
[]
[v]
type = PINSFVSuperficialVelocityVariable
initial_condition = 1
[]
[pressure]
type = INSFVPressureVariable
[]
[temperature]
type = INSFVEnergyVariable
[]
[]
[AuxVariables]
[advected_density]
order = CONSTANT
family = MONOMIAL
fv = true
initial_condition = ${rho}
[]
[porosity]
order = CONSTANT
family = MONOMIAL
fv = true
initial_condition = 0.5
[]
[]
[FVKernels]
[mass]
type = PINSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[u_advection]
type = PINSFVMomentumAdvection
variable = u
rho = ${rho}
porosity = porosity
momentum_component = 'x'
[]
[u_viscosity]
type = PINSFVMomentumDiffusion
variable = u
force_boundary_execution = true
porosity = porosity
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = PINSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
porosity = porosity
[]
[v_advection]
type = PINSFVMomentumAdvection
variable = v
rho = ${rho}
porosity = porosity
momentum_component = 'y'
[]
[v_viscosity]
type = PINSFVMomentumDiffusion
variable = v
force_boundary_execution = true
porosity = porosity
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = PINSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
porosity = porosity
[]
[temp_advection]
type = PINSFVEnergyAdvection
variable = temperature
advected_interp_method = 'upwind'
[]
[temp_source]
type = FVBodyForce
variable = temperature
function = 10
block = 1
[]
[]
[FVBCs]
inactive = 'noslip-u noslip-v'
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'bottom'
variable = u
function = 0
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'bottom'
variable = v
function = 1
[]
[noslip-u]
type = INSFVNoSlipWallBC
boundary = 'right'
variable = u
function = 0
[]
[noslip-v]
type = INSFVNoSlipWallBC
boundary = 'right'
variable = v
function = 0
[]
[free-slip-u]
type = INSFVNaturalFreeSlipBC
boundary = 'right'
variable = u
momentum_component = 'x'
[]
[free-slip-v]
type = INSFVNaturalFreeSlipBC
boundary = 'right'
variable = v
momentum_component = 'y'
[]
[axis-u]
type = PINSFVSymmetryVelocityBC
boundary = 'left'
variable = u
u = u
v = v
mu = ${mu}
momentum_component = x
[]
[axis-v]
type = PINSFVSymmetryVelocityBC
boundary = 'left'
variable = v
u = u
v = v
mu = ${mu}
momentum_component = y
[]
[axis-p]
type = INSFVSymmetryPressureBC
boundary = 'left'
variable = pressure
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'top'
variable = pressure
function = 0
[]
[inlet_temp]
type = FVNeumannBC
boundary = 'bottom'
variable = temperature
value = 300
[]
[]
[FunctorMaterials]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'temperature'
rho = ${rho}
[]
[advected_material_property]
type = ADGenericFunctorMaterial
prop_names = 'advected_rho cp'
prop_values ='${rho} 1'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm 200 lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
[]
[Postprocessors]
[inlet_mass_variable]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = advected_density
[]
[inlet_mass_constant]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[inlet_mass_matprop]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = 'advected_rho'
[]
[mid1_mass]
type = VolumetricFlowRate
boundary = internal_bot
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[mid2_mass]
type = VolumetricFlowRate
boundary = internal_top
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[outlet_mass]
type = VolumetricFlowRate
boundary = top
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[inlet_momentum_x]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = u
[]
[inlet_momentum_y]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = v
[]
[mid1_advected_energy]
type = VolumetricFlowRate
boundary = internal_bot
vel_x = u
vel_y = v
advected_quantity = 'rho_cp_temp'
advected_interp_method = 'upwind'
[]
[mid2_advected_energy]
type = VolumetricFlowRate
boundary = internal_top
vel_x = u
vel_y = v
advected_quantity = 'rho_cp_temp'
advected_interp_method = 'upwind'
[]
[outlet_advected_energy]
type = VolumetricFlowRate
boundary = top
vel_x = u
vel_y = v
advected_quantity = 'rho_cp_temp'
advected_interp_method = 'upwind'
[]
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_by_parts_steady_stabilized.i)
[GlobalParams]
order = FIRST
integrate_p_by_parts = true
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[AuxVariables]
[vel_x]
[]
[vel_y]
[]
[]
[AuxKernels]
[vel_x]
type = VectorVariableComponentAux
variable = vel_x
vector_variable = velocity
component = 'x'
[]
[vel_y]
type = VectorVariableComponentAux
variable = vel_y
vector_variable = velocity
component = 'y'
[]
[]
[Variables]
[./velocity]
family = LAGRANGE_VEC
[../]
[./p]
[../]
[]
# Need to set a non-zero initial condition because we have a velocity norm in
# the denominator for the tau coefficient of the stabilization term
[ICs]
[velocity]
type = VectorConstantIC
x_value = 1e-15
y_value = 1e-15
variable = velocity
[]
[]
[Kernels]
[./mass]
type = INSADMass
variable = p
[../]
[mass_pspg]
type = INSADMassPSPG
variable = p
[]
[momentum_advection]
type = INSADMomentumAdvection
variable = velocity
[]
[./momentum_viscous]
type = INSADMomentumViscous
variable = velocity
[../]
[./momentum_pressure]
type = INSADMomentumPressure
variable = velocity
pressure = p
[../]
[momentum_supg]
type = INSADMomentumSUPG
variable = velocity
velocity = velocity
[]
[]
[BCs]
[inlet]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'bottom'
function_x = 0
function_y = 'inlet_func'
[../]
[wall]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'right'
function_x = 0
function_y = 0
[]
[axis]
type = ADVectorFunctionDirichletBC
variable = velocity
boundary = 'left'
set_y_comp = false
function_x = 0
[]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Materials]
[./const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[ins_mat]
type = INSADTauMaterial
velocity = velocity
pressure = p
[]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
solve_type = 'NEWTON'
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/pump/pump_and_counterpump_loop.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_1_domain]
type = ParsedSubdomainMeshGenerator
input = lump_bdries_to_wall
combinatorial_geometry = 'x > 0.3 & x < 0.4 & y > 0.5'
block_id = '3'
[]
[pump_2_domain]
type = ParsedSubdomainMeshGenerator
input = pump_1_domain
combinatorial_geometry = 'x > 0.5 & y > 0.3 & y < 0.4'
block_id = '4'
[]
[rename_blocks]
type = RenameBlockGenerator
input = pump_2_domain
old_block = '1 3 4'
new_block = 'pipe pump_1 pump_2'
[]
[side_pump]
type = ParsedGenerateSideset
input = rename_blocks
included_subdomains = 'pump_1'
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_volume_force_1 pump_volume_force_2'
[]
[]
[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_1]
type = INSFVPump
variable = vel_x
momentum_component = 'x'
pump_volume_force = 'pump_volume_force_1'
block = 'pump_1'
[]
[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
[]
[u_pump_2]
type = INSFVPump
variable = vel_y
momentum_component = 'y'
pump_volume_force = 'pump_volume_force_2'
block = 'pump_2'
[]
[]
[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'
[]
[]
[Functions]
[pump_head]
type = PiecewiseLinear
x = '0.0 10.0'
y = '1000.0 0.0'
[]
[]
[FunctorMaterials]
[pump_mat_1]
type = NSFVPumpFunctorMaterial
rho = ${rho}
speed = 'U'
pressure_head_function = 'pump_head'
rotation_speed = 120
rotation_speed_rated = 100
area_rated = 0.1
volume_rated = 0.01
flow_rate_rated = 1.0
flow_rate = 'flow_rate'
block = 'pump_1'
pump_force_name = 'pump_volume_force_1'
[]
[pump_mat_2]
type = NSFVPumpFunctorMaterial
rho = ${rho}
speed = 'U'
pressure_head_function = 'pump_head'
rotation_speed = 50
rotation_speed_rated = 100
area_rated = 0.1
volume_rated = 0.01
flow_rate_rated = 1.0
flow_rate = 'flow_rate'
block = 'pump_2'
pump_force_name = 'pump_volume_force_2'
[]
[]
[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/fviks/convection/convection_channel.i)
mu = 1
rho = 1
k = .01
cp = 1
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '1 0.5'
dy = '1'
ix = '8 5'
iy = '8'
subdomain_id = '0 1'
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = 'cmg'
primary_block = 0
paired_block = 1
new_boundary = 'interface'
[]
[fluid_side]
type = BreakBoundaryOnSubdomainGenerator
input = 'interface'
boundaries = 'top bottom'
[]
[]
[GlobalParams]
# retain behavior at time of test creation
two_term_boundary_expansion = false
rhie_chow_user_object = 'rc'
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
block = 0
pressure = pressure
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
block = 0
initial_condition = 1e-6
[]
[v]
type = INSFVVelocityVariable
block = 0
initial_condition = 1e-6
[]
[pressure]
type = INSFVPressureVariable
block = 0
[]
[T]
type = INSFVEnergyVariable
block = 0
initial_condition = 1
[]
[Ts]
type = INSFVEnergyVariable
block = 1
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[mean_zero_pressure]
type = FVIntegralValueConstraint
variable = pressure
lambda = lambda
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
[]
[solid_temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = Ts
[]
[]
[FVInterfaceKernels]
[convection]
type = FVConvectionCorrelationInterface
variable1 = T
variable2 = Ts
boundary = 'interface'
h = 5
T_solid = Ts
T_fluid = T
subdomain1 = 0
subdomain2 = 1
wall_cell_is_bulk = true
[]
[]
[FVBCs]
[walls_u]
type = INSFVNoSlipWallBC
variable = u
boundary = 'interface left'
function = 0
[]
[walls_v]
type = INSFVNoSlipWallBC
variable = v
boundary = 'interface left'
function = 0
[]
[inlet_u]
type = INSFVInletVelocityBC
variable = u
boundary = 'bottom_to_0'
function = 0
[]
[inlet_v]
type = INSFVInletVelocityBC
variable = v
boundary = 'bottom_to_0'
function = 1
[]
[inlet_T]
type = FVDirichletBC
variable = T
boundary = 'bottom_to_0'
value = 0.5
[]
[outlet]
type = INSFVMassAdvectionOutflowBC
variable = pressure
boundary = 'top_to_0'
u = u
v = v
rho = ${rho}
[]
[outlet_u]
type = INSFVMomentumAdvectionOutflowBC
variable = u
boundary = 'top_to_0'
u = u
v = v
momentum_component = 'x'
rho = ${rho}
[]
[outlet_v]
type = INSFVMomentumAdvectionOutflowBC
variable = v
boundary = 'top_to_0'
u = u
v = v
momentum_component = 'y'
rho = ${rho}
[]
[heater]
type = FVDirichletBC
variable = 'Ts'
boundary = 'right'
value = 10
[]
[]
[FunctorMaterials]
[functor_constants]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
block = 0
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -ksp_gmres_restart'
petsc_options_value = 'asm lu NONZERO 200'
line_search = 'none'
nl_abs_tol = 1e-14
[]
[Postprocessors]
[max_T]
type = ADElementExtremeFunctorValue
functor = T
block = 0
[]
[max_Ts]
type = ADElementExtremeFunctorValue
functor = Ts
block = 1
[]
[mdot_out]
type = VolumetricFlowRate
boundary = 'top_to_0'
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_no_parts_steady.i)
[GlobalParams]
integrate_p_by_parts = false
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[AuxVariables]
[vel_x]
order = SECOND
[]
[vel_y]
order = SECOND
[]
[]
[AuxKernels]
[vel_x]
type = VectorVariableComponentAux
variable = vel_x
vector_variable = velocity
component = 'x'
[]
[vel_y]
type = VectorVariableComponentAux
variable = vel_y
vector_variable = velocity
component = 'y'
[]
[]
[Variables]
[./velocity]
order = SECOND
family = LAGRANGE_VEC
[../]
[./p]
[../]
[]
[Kernels]
[./mass]
type = INSADMass
variable = p
[../]
[momentum_advection]
type = INSADMomentumAdvection
variable = velocity
[]
[./momentum_viscous]
type = INSADMomentumViscous
variable = velocity
[../]
[./momentum_pressure]
type = INSADMomentumPressure
variable = velocity
pressure = p
[../]
[]
[BCs]
[p_corner]
type = DirichletBC
boundary = top_right
value = 0
variable = p
[]
[inlet]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'bottom'
function_x = 0
function_y = 'inlet_func'
[../]
[wall]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'right'
function_x = 0
function_y = 0
[]
[axis]
type = ADVectorFunctionDirichletBC
variable = velocity
boundary = 'left'
set_y_comp = false
function_x = 0
[]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Materials]
[./const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[ins_mat]
type = INSADMaterial
velocity = velocity
pressure = p
[]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
solve_type = 'NEWTON'
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/postprocessors/flow_rates/mass_flux_weighted_pp.i)
# Fluid properties
mu = 1
rho = 1
cp = 1
k = 1e-3
# Operating conditions
u_inlet = 1
T_inlet = 200
p_outlet = 10
# expected temperature at outlet
#
# mdot * cp dT = Qdot
# Qdot = 500
# mdot = 1
# cp = 1
# dT = 500
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '5 0.1 4.9'
ix = '10 3 10'
dy = '0.5 0.5'
iy = '2 2'
subdomain_id = '1 2 3 1 3 3'
[]
[interior]
type = SideSetsBetweenSubdomainsGenerator
primary_block = '1'
paired_block = '2 3'
new_boundary = 'interior'
input = gen
[]
[]
[AuxVariables]
[porosity]
type = MooseVariableFVReal
[]
[hsrc]
type = MooseVariableFVReal
[]
[]
[ICs]
[porosity_1]
type = ConstantIC
variable = porosity
value = 0.5
block = '1 3'
[]
[porosity_2]
type = ConstantIC
variable = porosity
value = 0.1
block = 2
[]
[hsrc]
type = ConstantIC
variable = hsrc
value = 100
block = 1
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'incompressible'
porous_medium_treatment = true
add_energy_equation = true
density = 'rho'
dynamic_viscosity = 'mu'
thermal_conductivity = 'k'
specific_heat = 'cp'
porosity = 'porosity'
initial_velocity = '${u_inlet} 1e-6 0'
initial_pressure = ${p_outlet}
initial_temperature = ${T_inlet}
inlet_boundaries = 'left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '${u_inlet} 0'
energy_inlet_types = 'fixed-temperature'
energy_inlet_function = '${T_inlet}'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip symmetry'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 0'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${p_outlet}'
mass_advection_interpolation = 'upwind'
momentum_advection_interpolation = 'upwind'
energy_advection_interpolation = 'upwind'
external_heat_source = hsrc
[]
[]
[FunctorMaterials]
[constants]
type = ADGenericFunctorMaterial
prop_names = 'cp rho mu k'
prop_values = '${cp} ${rho} ${mu} ${k}'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
nl_abs_tol = 1e-8
end_time = 1000
dt = 10
num_steps = 5
[]
# Some basic Postprocessors to examine the solution
[Postprocessors]
[Qdot]
type = ElementIntegralVariablePostprocessor
variable = hsrc
[]
[mass-flux-weighted-T-out]
type = MassFluxWeightedFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = T_fluid
density = rho
rhie_chow_user_object = 'pins_rhie_chow_interpolator'
boundary = 'right'
[]
[mass-flux-weighted-T-interior]
type = MassFluxWeightedFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = T_fluid
density = rho
rhie_chow_user_object = 'pins_rhie_chow_interpolator'
boundary = 'interior'
[]
[mdot]
type = VolumetricFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = rho
rhie_chow_user_object = 'pins_rhie_chow_interpolator'
boundary = 'right'
[]
[outlet-u]
type = SideAverageValue
variable = superficial_vel_x
boundary = 'right'
[]
[outlet-temp]
type = SideAverageValue
variable = T_fluid
boundary = 'right'
[]
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_no_parts_steady_stabilized.i)
[GlobalParams]
order = FIRST
integrate_p_by_parts = false
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[AuxVariables]
[vel_x]
[]
[vel_y]
[]
[]
[AuxKernels]
[vel_x]
type = VectorVariableComponentAux
variable = vel_x
vector_variable = velocity
component = 'x'
[]
[vel_y]
type = VectorVariableComponentAux
variable = vel_y
vector_variable = velocity
component = 'y'
[]
[]
[Variables]
[./velocity]
family = LAGRANGE_VEC
[../]
[./p]
[../]
[]
# Need to set a non-zero initial condition because we have a velocity norm in
# the denominator for the tau coefficient of the stabilization term
[ICs]
[velocity]
type = VectorConstantIC
x_value = 1e-15
y_value = 1e-15
variable = velocity
[]
[]
[Kernels]
[./mass]
type = INSADMass
variable = p
[../]
[mass_pspg]
type = INSADMassPSPG
variable = p
[]
[momentum_advection]
type = INSADMomentumAdvection
variable = velocity
[]
[./momentum_viscous]
type = INSADMomentumViscous
variable = velocity
[../]
[./momentum_pressure]
type = INSADMomentumPressure
variable = velocity
pressure = p
[../]
[momentum_supg]
type = INSADMomentumSUPG
variable = velocity
velocity = velocity
[]
[]
[BCs]
[p_corner]
type = DirichletBC
boundary = top_right
value = 0
variable = p
[]
[inlet]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'bottom'
function_x = 0
function_y = 'inlet_func'
[../]
[wall]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'right'
function_x = 0
function_y = 0
[]
[axis]
type = ADVectorFunctionDirichletBC
variable = velocity
boundary = 'left'
set_y_comp = false
function_x = 0
[]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Materials]
[./const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[ins_mat]
type = INSADTauMaterial
velocity = velocity
pressure = p
[]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
solve_type = 'NEWTON'
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/segregated/2d/2d-segregated-scalar.i)
mu = 2.6
rho = 1.0
diff = 1.5
advected_interp_method = 'average'
velocity_interp_method = 'rc'
pressure_tag = "pressure_grad"
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '0.3'
dy = '0.3'
ix = '3'
iy = '3'
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system scalar_1_system scalar_2_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolatorSegregated
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 0.5
solver_sys = u_system
two_term_boundary_expansion = false
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 0.0
solver_sys = v_system
two_term_boundary_expansion = false
[]
[pressure]
type = INSFVPressureVariable
solver_sys = pressure_system
initial_condition = 0.2
two_term_boundary_expansion = false
[]
[scalar_1]
type = INSFVScalarFieldVariable
solver_sys = scalar_1_system
initial_condition = 1.2
[]
[scalar_2]
type = INSFVScalarFieldVariable
solver_sys = scalar_2_system
initial_condition = 1.2
[]
[]
[FVKernels]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[p_diffusion]
type = FVAnisotropicDiffusion
variable = pressure
coeff = "Ainv"
coeff_interp_method = 'average'
[]
[p_source]
type = FVDivergence
variable = pressure
vector_field = "HbyA"
force_boundary_execution = true
[]
[scalar_1_advection]
type = INSFVScalarFieldAdvection
variable = scalar_1
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_1_diffusion]
type = FVDiffusion
coeff = ${diff}
variable = scalar_1
[]
[scalar_1_src]
type = FVBodyForce
variable = scalar_1
value = 1.0
[]
[scalar_1_coupled_source]
type = FVCoupledForce
variable = scalar_1
v = scalar_2
coef = 0.1
[]
[scalar_2_advection]
type = INSFVScalarFieldAdvection
variable = scalar_2
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_2_diffusion]
type = FVDiffusion
coeff = '${fparse 2*diff}'
variable = scalar_2
[]
[scalar_2_src]
type = FVBodyForce
variable = scalar_2
value = 5.0
[]
[scalar_2_coupled_source]
type = FVCoupledForce
variable = scalar_2
v = scalar_1
coef = 0.05
[]
[]
[FVBCs]
inactive = "symmetry-u symmetry-v symmetry-p"
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_x
function = '1.1'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_y
function = '0.0'
[]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'top bottom'
variable = vel_x
function = 0.0
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'top bottom'
variable = vel_y
function = 0.0
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = 1.4
[]
[inlet_scalar_1]
type = FVDirichletBC
boundary = 'left'
variable = scalar_1
value = 1
[]
[inlet_scalar_2]
type = FVDirichletBC
boundary = 'left'
variable = scalar_2
value = 2
[]
### Inactive by default, some tests will turn these on ###
[symmetry-u]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = vel_x
u = vel_x
v = vel_y
mu = ${mu}
momentum_component = 'x'
[]
[symmetry-v]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = vel_y
u = vel_x
v = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[symmetry-p]
type = INSFVSymmetryPressureBC
boundary = 'bottom'
variable = pressure
[]
##########################################################
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
passive_scalar_l_abs_tol = 1e-14
momentum_l_tol = 0
pressure_l_tol = 0
passive_scalar_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
passive_scalar_systems = 'scalar_1_system scalar_2_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.3
passive_scalar_equation_relaxation = '0.9 0.9'
num_iterations = 100
pressure_absolute_tolerance = 1e-13
momentum_absolute_tolerance = 1e-13
passive_scalar_absolute_tolerance = '1e-13 1e-13'
print_fields = false
[]
[Outputs]
exodus = true
[csv]
type = CSV
execute_on = FINAL
[]
[]
[Postprocessors]
inactive = "out1 out2 in1 in2"
[out1]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
advected_quantity = 'scalar_1'
boundary = right
execute_on = FINAL
outputs = csv
[]
[in1]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
advected_quantity = 'scalar_1'
boundary = left
execute_on = FINAL
outputs = csv
[]
[out2]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
advected_quantity = 'scalar_2'
boundary = right
execute_on = FINAL
outputs = csv
[]
[in2]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
advected_quantity = 'scalar_2'
boundary = left
execute_on = FINAL
outputs = csv
[]
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_by_parts_steady.i)
[GlobalParams]
integrate_p_by_parts = true
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[AuxVariables]
[vel_x]
order = SECOND
[]
[vel_y]
order = SECOND
[]
[]
[AuxKernels]
[vel_x]
type = VectorVariableComponentAux
variable = vel_x
vector_variable = velocity
component = 'x'
[]
[vel_y]
type = VectorVariableComponentAux
variable = vel_y
vector_variable = velocity
component = 'y'
[]
[]
[Variables]
[./velocity]
order = SECOND
family = LAGRANGE_VEC
[../]
[./p]
[../]
[]
[Kernels]
[./mass]
type = INSADMass
variable = p
[../]
[./momentum_convection]
type = INSADMomentumAdvection
variable = velocity
[../]
[./momentum_viscous]
type = INSADMomentumViscous
variable = velocity
[../]
[./momentum_pressure]
type = INSADMomentumPressure
variable = velocity
pressure = p
[../]
[]
[BCs]
[inlet]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'bottom'
function_x = 0
function_y = 'inlet_func'
[../]
[wall]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'right'
function_x = 0
function_y = 0
[]
[axis]
type = ADVectorFunctionDirichletBC
variable = velocity
boundary = 'left'
set_y_comp = false
function_x = 0
[]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Materials]
[./const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[ins_mat]
type = INSADMaterial
velocity = velocity
pressure = p
[]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
solve_type = 'NEWTON'
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/RZ_cone_high_reynolds.i)
[GlobalParams]
gravity = '0 0 0'
laplace = true
transient_term = false
supg = true
pspg = true
family = LAGRANGE
order = FIRST
[]
[Mesh]
file = 'cone_linear_alltri.e'
[]
[Problem]
coord_type = RZ
[]
[Preconditioning]
[./SMP_PJFNK]
type = SMP
full = true
solve_type = NEWTON
[../]
[]
[Executioner]
# type = Transient
# dt = 0.005
# dtmin = 0.005
# num_steps = 5
# l_max_its = 100
# Block Jacobi works well for this problem, as does "-pc_type asm
# -pc_asm_overlap 2", but an overlap of 1 does not work for some
# reason?
# petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
# petsc_options_value = 'bjacobi ilu 4'
# Note: The Steady executioner can be used for this problem, if you
# drop the INSMomentumTimeDerivative kernels and use the following
# direct solver options.
type = Steady
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
nl_max_its = 20
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Variables]
[./vel_x]
# Velocity in radial (r) direction
[../]
[./vel_y]
# Velocity in axial (z) direction
[../]
[./p]
order = FIRST
[../]
[]
[BCs]
[./u_in]
type = DirichletBC
boundary = bottom
variable = vel_x
value = 0
[../]
[./v_in]
type = FunctionDirichletBC
boundary = bottom
variable = vel_y
function = 'inlet_func'
[../]
[./u_axis_and_walls]
type = DirichletBC
boundary = 'left right'
variable = vel_x
value = 0
[../]
[./v_no_slip]
type = DirichletBC
boundary = 'right'
variable = vel_y
value = 0
[../]
[]
[Kernels]
# [./x_momentum_time]
# type = INSMomentumTimeDerivative
# variable = vel_x
# [../]
# [./y_momentum_time]
# type = INSMomentumTimeDerivative
# variable = vel_y
# [../]
[./mass]
type = INSMassRZ
variable = p
u = vel_x
v = vel_y
pressure = p
[../]
[./x_momentum_space]
type = INSMomentumLaplaceFormRZ
variable = vel_x
u = vel_x
v = vel_y
pressure = p
component = 0
[../]
[./y_momentum_space]
type = INSMomentumLaplaceFormRZ
variable = vel_y
u = vel_x
v = vel_y
pressure = p
component = 1
[../]
[]
[Materials]
[./const]
type = GenericConstantMaterial
block = 1
prop_names = 'rho mu'
prop_values = '1 1e-3'
[../]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
outputs = 'console' execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
outputs = 'console' execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/finite_volume/controls/switch-pressure-bc/switch_vel_pres_bc.i)
rho = 'rho'
l = 10
inlet_area = 1
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
end_time = 3.0
switch_time = 1.0
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[v]
type = INSFVVelocityVariable
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = u
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = v
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T
rho = rho
drho_dt = drho_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T
v = power_density
[]
[]
[FVBCs]
# Inlet
[inlet_u]
type = WCNSFVSwitchableInletVelocityBC
variable = u
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'surface_inlet'
rho = 'rho'
switch_bc = true
face_limiter = 1.0
[]
[outlet_u]
type = WCNSFVSwitchableInletVelocityBC
variable = u
boundary = 'right'
mdot_pp = 'inlet_mdot'
area_pp = 'surface_inlet'
rho = 'rho'
switch_bc = false
scaling_factor = -1.0
face_limiter = 1.0
[]
[inlet_v]
type = WCNSFVInletVelocityBC
variable = v
boundary = 'left'
mdot_pp = 0
area_pp = 'surface_inlet'
rho = 'rho'
[]
[inlet_T]
type = WCNSFVInletTemperatureBC
variable = T
boundary = 'left'
temperature_pp = 'inlet_T'
[]
[outlet_T]
type = NSFVOutflowTemperatureBC
variable = T
boundary = 'right'
u = u
v = v
rho = 'rho'
cp = 'cp'
backflow_T = ${inlet_temp}
[]
[outlet_p]
type = INSFVSwitchableOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
switch_bc = true
face_limiter = 1.0
[]
[inlet_p]
type = INSFVSwitchableOutletPressureBC
variable = pressure
boundary = 'left'
function = ${outlet_pressure}
switch_bc = false
face_limiter = 1.0
[]
# Walls
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'top bottom'
function = 0
[]
[]
[Functions]
[func_coef]
type = ParsedFunction
expression = 'if(t<${switch_time} | t>2.0*${switch_time}, 1, 0)'
[]
[func_coef_comp]
type = ParsedFunction
expression = 'if(t<${switch_time} | t>2.0*${switch_time}, 0, 1)'
[]
[mass_flux_and_pressure_test_scaling]
type = ParsedFunction
expression = 'if(t<${switch_time} | t>2.0*${switch_time}, 0.1, 0.2)'
[]
[]
[Controls]
[func_control_u_inlet]
type = BoolFunctionControl
parameter = 'FVBCs/inlet_u/switch_bc'
function = 'func_coef'
execute_on = 'initial timestep_begin'
[]
[func_control_u_outlet]
type = BoolFunctionControl
parameter = 'FVBCs/outlet_u/switch_bc'
function = 'func_coef_comp'
execute_on = 'initial timestep_begin'
[]
[func_control_p_outlet]
type = BoolFunctionControl
parameter = 'FVBCs/outlet_p/switch_bc'
function = 'func_coef'
execute_on = 'initial timestep_begin'
[]
[func_control_p_inlet]
type = BoolFunctionControl
parameter = 'FVBCs/inlet_p/switch_bc'
function = 'func_coef_comp'
execute_on = 'initial timestep_begin'
[]
[func_control_limiter_u_inlet]
type = RealFunctionControl
parameter = 'FVBCs/inlet_u/face_limiter'
function = 'mass_flux_and_pressure_test_scaling'
execute_on = 'initial timestep_begin'
[]
[func_control_limiter_u_outlet]
type = RealFunctionControl
parameter = 'FVBCs/outlet_u/face_limiter'
function = 'mass_flux_and_pressure_test_scaling'
execute_on = 'initial timestep_begin'
[]
[func_control_limiter_p_outlet]
type = RealFunctionControl
parameter = 'FVBCs/outlet_p/face_limiter'
function = 'mass_flux_and_pressure_test_scaling'
execute_on = 'initial timestep_begin'
[]
[func_control_limiter_p_inlet]
type = RealFunctionControl
parameter = 'FVBCs/inlet_p/face_limiter'
function = 'mass_flux_and_pressure_test_scaling'
execute_on = 'initial timestep_begin'
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_mdot]
type = Receiver
default = '${fparse 1980 * inlet_velocity * inlet_area}'
[]
[surface_inlet]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[outlet_mfr]
type = VolumetricFlowRate
boundary = 'right'
advected_quantity = 1.0
vel_x = u
vel_y = v
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
dt = 0.1
end_time = ${end_time}
nl_abs_tol = 1e-12
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
csv = true
execute_on = 'TIMESTEP_END'
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/rz_cone_by_parts_steady_stabilized.i)
# This input file tests several different things:
# .) The axisymmetric (RZ) form of the governing equations.
# .) An open boundary.
# .) Not integrating the pressure by parts, thereby requiring a pressure pin.
# .) Natural boundary condition at the outlet.
[GlobalParams]
integrate_p_by_parts = true
laplace = true
gravity = '0 0 0'
supg = true
pspg = true
order = FIRST
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[Preconditioning]
[./SMP_PJFNK]
type = SMP
full = true
solve_type = Newton
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Variables]
[./vel_x]
# Velocity in radial (r) direction
[../]
[./vel_y]
# Velocity in axial (z) direction
[../]
[./p]
[../]
[]
[BCs]
[./u_in]
type = DirichletBC
boundary = bottom
variable = vel_x
value = 0
[../]
[./v_in]
type = FunctionDirichletBC
boundary = bottom
variable = vel_y
function = 'inlet_func'
[../]
[./u_axis_and_walls]
type = DirichletBC
boundary = 'left right'
variable = vel_x
value = 0
[../]
[./v_no_slip]
type = DirichletBC
boundary = 'right'
variable = vel_y
value = 0
[../]
[]
[Kernels]
[./mass]
type = INSMassRZ
variable = p
u = vel_x
v = vel_y
pressure = p
[../]
[./x_momentum_space]
type = INSMomentumLaplaceFormRZ
variable = vel_x
u = vel_x
v = vel_y
pressure = p
component = 0
[../]
[./y_momentum_space]
type = INSMomentumLaplaceFormRZ
variable = vel_y
u = vel_x
v = vel_y
pressure = p
component = 1
[../]
[]
[Materials]
[./const]
type = GenericConstantMaterial
block = 'volume'
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/RZ_cone_by_parts.i)
# This input file tests several different things:
# .) The axisymmetric (RZ) form of the governing equations.
# .) An open boundary.
# .) Integrating the pressure by parts.
# .) Natural boundary condition at the outlet.
[GlobalParams]
gravity = '0 0 0'
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[Preconditioning]
[./SMP_PJFNK]
type = SMP
full = true
solve_type = Newton
[../]
[]
[Executioner]
type = Transient
dt = 0.005
dtmin = 0.005
num_steps = 5
l_max_its = 100
# Note: The Steady executioner can be used for this problem, if you
# drop the INSMomentumTimeDerivative kernels and use the following
# direct solver options.
# petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -ksp_type'
# petsc_options_value = 'lu NONZERO 1.e-10 preonly'
# Block Jacobi works well for this problem, as does "-pc_type asm
# -pc_asm_overlap 2", but an overlap of 1 does not work for some
# reason?
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Variables]
[./vel_x]
# Velocity in radial (r) direction
family = LAGRANGE
order = SECOND
[../]
[./vel_y]
# Velocity in axial (z) direction
family = LAGRANGE
order = SECOND
[../]
[./p]
family = LAGRANGE
order = FIRST
[../]
[]
[BCs]
[./u_in]
type = DirichletBC
boundary = bottom
variable = vel_x
value = 0
[../]
[./v_in]
type = FunctionDirichletBC
boundary = bottom
variable = vel_y
function = 'inlet_func'
[../]
[./u_axis_and_walls]
type = DirichletBC
boundary = 'left right'
variable = vel_x
value = 0
[../]
[./v_no_slip]
type = DirichletBC
boundary = 'right'
variable = vel_y
value = 0
[../]
[]
[Kernels]
[./x_momentum_time]
type = INSMomentumTimeDerivative
variable = vel_x
[../]
[./y_momentum_time]
type = INSMomentumTimeDerivative
variable = vel_y
[../]
[./mass]
type = INSMassRZ
variable = p
u = vel_x
v = vel_y
pressure = p
[../]
[./x_momentum_space]
type = INSMomentumLaplaceFormRZ
variable = vel_x
u = vel_x
v = vel_y
pressure = p
component = 0
[../]
[./y_momentum_space]
type = INSMomentumLaplaceFormRZ
variable = vel_y
u = vel_x
v = vel_y
pressure = p
component = 1
[../]
[]
[Materials]
[./const]
type = GenericConstantMaterial
block = 'volume'
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
outputs = 'console' execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
outputs = 'console' execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/finite_volume/pwcns/channel-flow/2d-transient-gas.i)
# Fluid properties
mu = 'mu'
rho = 'rho'
k = 'k'
# Solid properties
cp_s = 2
rho_s = 4
k_s = 1e-2
h_fs = 10
# Operating conditions
u_inlet = 1
T_inlet = 200
p_outlet = 10
top_side_temperature = 150
# Numerical scheme
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = 0
ymax = 1
nx = 20
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolator
u = superficial_vel_x
v = superficial_vel_y
pressure = pressure
porosity = porosity
[]
[]
[Variables]
[superficial_vel_x]
type = PINSFVSuperficialVelocityVariable
initial_condition = ${u_inlet}
[]
[superficial_vel_y]
type = PINSFVSuperficialVelocityVariable
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${p_outlet}
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = ${T_inlet}
[]
[T_solid]
type = MooseVariableFVReal
initial_condition = 100
[]
[]
[AuxVariables]
[porosity]
type = MooseVariableFVReal
initial_condition = 0.5
[]
[]
[FVKernels]
[mass_time]
type = PWCNSFVMassTimeDerivative
variable = pressure
porosity = 'porosity'
drho_dt = 'drho_dt'
[]
[mass]
type = PWCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = superficial_vel_x
rho = ${rho}
drho_dt = 'drho_dt'
momentum_component = 'x'
[]
[u_advection]
type = PINSFVMomentumAdvection
variable = superficial_vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
porosity = porosity
momentum_component = 'x'
[]
[u_viscosity]
type = PINSFVMomentumDiffusion
variable = superficial_vel_x
mu = ${mu}
porosity = porosity
momentum_component = 'x'
[]
[u_pressure]
type = PINSFVMomentumPressure
variable = superficial_vel_x
momentum_component = 'x'
pressure = pressure
porosity = porosity
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = superficial_vel_y
rho = ${rho}
drho_dt = 'drho_dt'
momentum_component = 'y'
[]
[v_advection]
type = PINSFVMomentumAdvection
variable = superficial_vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
porosity = porosity
momentum_component = 'y'
[]
[v_viscosity]
type = PINSFVMomentumDiffusion
variable = superficial_vel_y
mu = ${mu}
porosity = porosity
momentum_component = 'y'
[]
[v_pressure]
type = PINSFVMomentumPressure
variable = superficial_vel_y
momentum_component = 'y'
pressure = pressure
porosity = porosity
[]
[energy_time]
type = PINSFVEnergyTimeDerivative
variable = T_fluid
h = 'h'
dh_dt = 'dh_dt'
rho = ${rho}
drho_dt = 'drho_dt'
is_solid = false
porosity = porosity
[]
[energy_advection]
type = PINSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[energy_diffusion]
type = PINSFVEnergyDiffusion
variable = T_fluid
k = ${k}
porosity = porosity
[]
[energy_convection]
type = PINSFVEnergyAmbientConvection
variable = T_fluid
is_solid = false
T_fluid = T_fluid
T_solid = T_solid
h_solid_fluid = 'h_cv'
[]
[solid_energy_time]
type = PINSFVEnergyTimeDerivative
variable = T_solid
cp = ${cp_s}
rho = ${rho_s}
is_solid = true
porosity = porosity
[]
[solid_energy_diffusion]
type = FVDiffusion
variable = T_solid
coeff = ${k_s}
[]
[solid_energy_convection]
type = PINSFVEnergyAmbientConvection
variable = T_solid
is_solid = true
T_fluid = T_fluid
T_solid = T_solid
h_solid_fluid = 'h_cv'
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = superficial_vel_x
function = ${u_inlet}
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = superficial_vel_y
function = 0
[]
[inlet-T]
type = FVDirichletBC
variable = T_fluid
value = ${T_inlet}
boundary = 'left'
[]
[no-slip-u]
type = INSFVNoSlipWallBC
boundary = 'top'
variable = superficial_vel_x
function = 0
[]
[no-slip-v]
type = INSFVNoSlipWallBC
boundary = 'top'
variable = superficial_vel_y
function = 0
[]
[heated-side]
type = FVDirichletBC
boundary = 'top'
variable = 'T_solid'
value = ${top_side_temperature}
[]
[symmetry-u]
type = PINSFVSymmetryVelocityBC
boundary = 'bottom'
variable = superficial_vel_x
u = superficial_vel_x
v = superficial_vel_y
mu = ${mu}
momentum_component = 'x'
[]
[symmetry-v]
type = PINSFVSymmetryVelocityBC
boundary = 'bottom'
variable = superficial_vel_y
u = superficial_vel_x
v = superficial_vel_y
mu = ${mu}
momentum_component = 'y'
[]
[symmetry-p]
type = INSFVSymmetryPressureBC
boundary = 'bottom'
variable = pressure
[]
[outlet-p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = ${p_outlet}
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
[]
[]
[FunctorMaterials]
[fluid_props_to_mat_props]
type = GeneralFunctorFluidProps
fp = fp
pressure = 'pressure'
T_fluid = 'T_fluid'
speed = 'speed'
# To initialize with a high viscosity
mu_rampdown = 'mu_rampdown'
# For porous flow
characteristic_length = 1
porosity = 'porosity'
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
rho = ${rho}
temperature = 'T_fluid'
[]
[constants]
type = ADGenericFunctorMaterial
prop_names = 'h_cv'
prop_values = '${h_fs}'
[]
[speed]
type = PINSFVSpeedFunctorMaterial
porosity = 'porosity'
superficial_vel_x = 'superficial_vel_x'
superficial_vel_y = 'superficial_vel_y'
[]
[]
[Functions]
[mu_rampdown]
type = PiecewiseLinear
x = '1 2 3 4'
y = '1e3 1e2 1e1 1'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm 100 lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
nl_abs_tol = 1e-10
automatic_scaling = true
end_time = 3.0
[]
# Some basic Postprocessors to examine the solution
[Postprocessors]
[inlet-p]
type = SideAverageValue
variable = pressure
boundary = 'left'
[]
[outlet-u]
type = VolumetricFlowRate
boundary = 'right'
advected_quantity = '1'
advected_interp_method = ${advected_interp_method}
vel_x = 'superficial_vel_x'
vel_y = 'superficial_vel_y'
[]
[outlet-temp]
type = SideAverageValue
variable = T_fluid
boundary = 'right'
[]
[solid-temp]
type = ElementAverageValue
variable = T_solid
[]
[]
[Outputs]
exodus = true
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/pump/pump_loop.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.4 & 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_volume_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 = INSFVPump
variable = vel_x
momentum_component = 'x'
pump_volume_force = 'pump_volume_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'
[]
[]
[Functions]
[pump_head]
type = PiecewiseLinear
x = '0.0 10.0'
y = '1000.0 0.0'
[]
[]
[FunctorMaterials]
[pump_mat]
type = NSFVPumpFunctorMaterial
rho = ${rho}
speed = 'U'
pressure_head_function = 'pump_head'
rotation_speed = 120
rotation_speed_rated = 100
area_rated = 0.1
volume_rated = 0.01
flow_rate_rated = 1.0
flow_rate = 'flow_rate'
block = 'pump'
[]
[]
[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_element/ins/RZ_cone/ad_rz_cone_by_parts_steady_stabilized_second_order.i)
[GlobalParams]
order = SECOND
integrate_p_by_parts = true
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[AuxVariables]
[vel_x]
[]
[vel_y]
[]
[]
[AuxKernels]
[vel_x]
type = VectorVariableComponentAux
variable = vel_x
vector_variable = velocity
component = 'x'
[]
[vel_y]
type = VectorVariableComponentAux
variable = vel_y
vector_variable = velocity
component = 'y'
[]
[]
[Variables]
[./velocity]
family = LAGRANGE_VEC
[../]
[./p]
order = FIRST
[../]
[]
# Need to set a non-zero initial condition because we have a velocity norm in
# the denominator for the tau coefficient of the stabilization term
[ICs]
[velocity]
type = VectorConstantIC
x_value = 1e-15
y_value = 1e-15
variable = velocity
[]
[]
[Kernels]
[./mass]
type = INSADMass
variable = p
[../]
[mass_pspg]
type = INSADMassPSPG
variable = p
[]
[momentum_advection]
type = INSADMomentumAdvection
variable = velocity
[]
[./momentum_viscous]
type = INSADMomentumViscous
variable = velocity
[../]
[./momentum_pressure]
type = INSADMomentumPressure
variable = velocity
pressure = p
[../]
[momentum_supg]
type = INSADMomentumSUPG
variable = velocity
velocity = velocity
[]
[]
[BCs]
[inlet]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'bottom'
function_x = 0
function_y = 'inlet_func'
[../]
[wall]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'right'
function_x = 0
function_y = 0
[]
[axis]
type = ADVectorFunctionDirichletBC
variable = velocity
boundary = 'left'
set_y_comp = false
function_x = 0
[]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Materials]
[./const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[ins_mat]
type = INSADTauMaterial
velocity = velocity
pressure = p
[]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
solve_type = 'NEWTON'
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/finite_volume/materials/flow_diode/transient_operation.i)
# Horizontal H junction with flow in different directions in the two branches
# One of the branches has a diode against the direction of the flow that can
# be triggered using the Controls
# There are 3 different strategies available for the diode blocking the flow
# - based on a time trigger
# - based on a pressure drop (here chosen across the diode)
# - based on a mass flow rate (here chosen through the diode)
mu = 0.1
rho = 10
nx = 10
ny = 5
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '1 0.3 1'
dy = '0.5 0.2 0.5'
ix = '${nx} ${fparse nx/2} ${nx}'
iy = '${ny} ${ny} ${ny}'
subdomain_id = '1 1 1
2 1 2
3 4 1'
[]
[add_walls]
type = SideSetsBetweenSubdomainsGenerator
input = 'cmg'
primary_block = '1 3 4'
paired_block = '2'
new_boundary = 'walls'
[]
[remove_wall_blocks]
type = BlockDeletionGenerator
input = add_walls
block = 2
[]
# Add inlets and outlets
[top_left]
type = ParsedGenerateSideset
input = remove_wall_blocks
combinatorial_geometry = 'x<0.001 & y>0.6'
new_sideset_name = top_left
[]
[bottom_left]
type = ParsedGenerateSideset
input = top_left
combinatorial_geometry = 'x<0.001 & y<0.6'
new_sideset_name = bottom_left
[]
[top_right]
type = ParsedGenerateSideset
input = bottom_left
combinatorial_geometry = 'x>2.299 & y>0.6'
new_sideset_name = top_right
[]
[bottom_right]
type = ParsedGenerateSideset
input = top_right
combinatorial_geometry = 'x>2.299 & y<0.6'
new_sideset_name = bottom_right
[]
# Extra surfaces
[diode_inlet]
type = SideSetsBetweenSubdomainsGenerator
input = bottom_right
primary_block = 4
paired_block = 3
new_boundary = 'diode_inlet'
[]
[mid_section]
type = SideSetsBetweenSubdomainsGenerator
input = diode_inlet
primary_block = 4
paired_block = 1
new_boundary = 'mid_connection'
[]
[reduce_blocks]
type = RenameBlockGenerator
input = 'mid_section'
old_block = '4 3 1'
new_block = '1 diode fluid'
[]
[]
[GlobalParams]
rhie_chow_user_object = 'pins_rhie_chow_interpolator'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Modules]
[NavierStokesFV]
compressibility = 'incompressible'
porous_medium_treatment = true
density = ${rho}
dynamic_viscosity = ${mu}
initial_velocity = '1e-6 1e-6 0'
initial_pressure = 0.0
inlet_boundaries = 'bottom_left top_right'
momentum_inlet_types = 'fixed-velocity fixed-velocity'
momentum_inlet_function = '1 0; -1 0'
wall_boundaries = 'top bottom walls'
momentum_wall_types = 'noslip noslip noslip'
outlet_boundaries = 'bottom_right top_left'
momentum_outlet_types = 'fixed-pressure fixed-pressure'
pressure_function = '1 1'
friction_blocks = 'fluid; diode'
friction_types = 'darcy forchheimer; darcy forchheimer'
# Base friction
# friction_coeffs = 'Darcy Forchheimer; Darcy Forchheimer'
# Combined with diode
friction_coeffs = 'combined_linear combined_quadratic; combined_linear combined_quadratic'
# Porosity jump treatment
# Option 1: diffusion correction
use_friction_correction = true
consistent_scaling = 10
# Option 2: bernouilli jump
# porosity_interface_pressure_treatment = bernoulli
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
[]
[]
[FunctorMaterials]
[porosity]
type = ADGenericFunctorMaterial
prop_names = 'porosity'
prop_values = '0.5'
[]
[base_friction]
type = ADGenericVectorFunctorMaterial
prop_names = 'Darcy Forchheimer'
prop_values = '220 240 260 0 0 0'
[]
# Material definitions needed for the diode
[diode]
type = NSFVFrictionFlowDiodeFunctorMaterial
# Friction only in X direction
direction = '-1 0 0'
additional_linear_resistance = '20000 0 0'
additional_quadratic_resistance = '0 0 0'
base_linear_friction_coefs = 'Darcy'
base_quadratic_friction_coefs = 'Forchheimer'
sum_linear_friction_name = 'diode_linear'
sum_quadratic_friction_name = 'diode_quad'
block = 'diode'
turn_on_diode = false
[]
[combine_linear_friction]
type = ADPiecewiseByBlockVectorFunctorMaterial
prop_name = 'combined_linear'
subdomain_to_prop_value = 'fluid Darcy
diode diode_linear'
[]
[combine_quadratic_friction]
type = ADPiecewiseByBlockVectorFunctorMaterial
prop_name = 'combined_quadratic'
subdomain_to_prop_value = 'fluid Forchheimer
diode diode_quad'
[]
# density is constant
[momentum]
type = ADGenericVectorFunctorMaterial
prop_names = 'momentum'
prop_values = 'superficial_vel_x superficial_vel_y 0'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_shift_type -ksp_gmres_restart'
petsc_options_value = 'lu NONZERO 200'
line_search = 'none'
end_time = 0.2
dt = 0.015
nl_abs_tol = 1e-12
[]
[Controls]
active = 'pdrop_based'
# Case 1: Diode turns on at a certain time and blocks (adds friction) flow at a given time
[time_based]
type = BoolFunctionControl
function = time_function
parameter = 'FunctorMaterials/diode/turn_on_diode'
execute_on = timestep_begin
[]
# Case 2: Diode looks at pressure drop, reduces flow if positive pressure drop
# This will not oscillate as the diode increases the pressure drop
[pdrop_based]
type = BoolFunctionControl
function = pdrop_positive
parameter = 'FunctorMaterials/diode/turn_on_diode'
execute_on = timestep_begin
[]
# Case 3: Diode looks at flow direction & quantity, reduces flow if too much flow
# in a given direction
# This will oscillate (turn on/off on each step) if the action of turning the diode
# makes the amount of flow smaller than the threshold for turning on the diode
[flow_based]
type = BoolFunctionControl
function = velocity_big_enough
parameter = 'FunctorMaterials/diode/turn_on_diode'
execute_on = timestep_begin
[]
[]
[Functions]
# Functions are used to parse postprocessors and provide them to a BoolFunctionControl
[time_function]
type = ParsedFunction
expression = 'if(t<0.1, 0, 1)'
[]
[pdrop_positive]
type = ParsedFunction
expression = 'if(pdrop_diode>100, 1, 0)'
symbol_names = pdrop_diode
symbol_values = pdrop_diode
[]
[velocity_big_enough]
type = ParsedFunction
expression = 'if(flow_diode<-0.4, 1, 0)'
symbol_names = flow_diode
symbol_values = flow_diode
[]
[]
[Postprocessors]
# Analysis of the simulation
[mdot_top]
type = VolumetricFlowRate
boundary = 'top_right'
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = ${rho}
[]
[mdot_bottom]
type = VolumetricFlowRate
boundary = 'bottom_right'
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = ${rho}
[]
[mdot_middle]
type = VolumetricFlowRate
boundary = 'mid_connection'
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = ${rho}
[]
[pdrop_top_channel]
type = PressureDrop
upstream_boundary = 'top_left'
downstream_boundary = 'top_right'
weighting_functor = 'momentum'
boundary = 'top_left top_right'
pressure = pressure
[]
[pdrop_bottom_channel]
type = PressureDrop
upstream_boundary = 'bottom_left'
downstream_boundary = 'bottom_right'
weighting_functor = 'momentum'
boundary = 'bottom_left bottom_right'
pressure = pressure
[]
# Diode operation
[pdrop_diode]
type = PressureDrop
upstream_boundary = 'diode_inlet'
downstream_boundary = 'top_left'
weighting_functor = 'momentum'
boundary = 'diode_inlet top_left'
pressure = pressure
[]
[flow_diode]
type = VolumetricFlowRate
boundary = 'diode_inlet'
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = ${rho}
[]
[]
[Outputs]
exodus = true
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/with-direction/flux_bcs-direction-action.i)
l = 2
inlet_area = 2
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 5e1
rho = 1000
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.2
inlet_scalar = 1.2
# The inlet angle, we will modify this and expect two things:
# 1. If we use a velocity postprocessor for the flux terms, we expect the mass flow
# to be proportional with "direction \cdot surface_normal".
# 2. If a mass flow is specified, it should not change, only the direction and magnitude of the
# inlet vleocity which is inferred based on the supplied massflow.
# direction = "0.86602540378 -0.5 0.0"
# direction = "1.0 0.0 0.0"
# cos_angle = 0.86602540378
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = ${inlet_area}
nx = 10
ny = 10
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'weakly-compressible'
add_energy_equation = true
add_scalar_equation = true
passive_scalar_names = 'scalar'
density = 'rho'
dynamic_viscosity = 'mu'
thermal_conductivity = 'k'
specific_heat = 'cp'
passive_scalar_diffusivity = '10.0'
passive_scalar_schmidt_number = '1.0'
initial_velocity = '${inlet_velocity} 1e-15 0'
initial_temperature = '${inlet_temp}'
initial_pressure = '${outlet_pressure}'
initial_scalar_variables = 1.0
inlet_boundaries = 'left'
momentum_inlet_types = 'flux-mass'
flux_inlet_pps = 'inlet_mdot'
energy_inlet_types = 'flux-mass'
energy_inlet_function = 'inlet_T'
passive_scalar_inlet_types = 'flux-mass'
passive_scalar_inlet_function = 'inlet_scalar'
wall_boundaries = 'top bottom'
momentum_wall_types = 'slip slip'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 0'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${outlet_pressure}'
external_heat_source = 'power_density'
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
[]
[]
[Postprocessors]
[inlet_mdot]
type = Receiver
default = '${fparse rho * inlet_velocity * inlet_area}'
[]
[inlet_velocity]
type = Receiver
default = ${inlet_velocity}
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[inlet_scalar]
type = Receiver
default = ${inlet_scalar}
[]
[outlet_mdot]
type = VolumetricFlowRate
advected_quantity = rho
vel_x = vel_x
vel_y = vel_y
boundary = right
rhie_chow_user_object = ins_rhie_chow_interpolator
[]
[inlet_mdot_check]
type = VolumetricFlowRate
advected_quantity = rho
vel_x = vel_x
vel_y = vel_y
boundary = left
rhie_chow_user_object = ins_rhie_chow_interpolator
[]
[inlet_vel_x_check]
type = SideAverageValue
variable = vel_x
boundary = left
[]
[inlet_vel_y_check]
type = SideAverageValue
variable = vel_y
boundary = left
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'rho cp k mu'
prop_values = '${rho} ${cp} ${k} ${mu}'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/postprocessors/flow_rates/conservation_INSFV.i)
mu=1
rho=1
advected_interp_method='average'
velocity_interp_method='rc'
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Mesh]
inactive = 'mesh internal_boundary_bot internal_boundary_top'
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '1'
dy = '1 1 1'
ix = '5'
iy = '5 5 5'
subdomain_id = '1
2
3'
[]
[internal_boundary_bot]
type = SideSetsBetweenSubdomainsGenerator
input = mesh
new_boundary = 'internal_bot'
primary_block = 1
paired_block = 2
[]
[internal_boundary_top]
type = SideSetsBetweenSubdomainsGenerator
input = internal_boundary_bot
new_boundary = 'internal_top'
primary_block = 2
paired_block = 3
[]
[diverging_mesh]
type = FileMeshGenerator
file = 'expansion_quad.e'
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = 0
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1
[]
[pressure]
type = INSFVPressureVariable
[]
[temperature]
type = INSFVEnergyVariable
[]
[]
[AuxVariables]
[advected_density]
type = MooseVariableFVReal
initial_condition = ${rho}
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
force_boundary_execution = true
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
force_boundary_execution = true
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = temperature
advected_interp_method = 'upwind'
[]
[temp_source]
type = FVBodyForce
variable = temperature
function = 10
block = 1
[]
[]
[FVBCs]
inactive = 'noslip-u noslip-v'
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'bottom'
variable = u
function = 0
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'bottom'
variable = v
function = 1
[]
[noslip-u]
type = INSFVNoSlipWallBC
boundary = 'right'
variable = u
function = 0
[]
[noslip-v]
type = INSFVNoSlipWallBC
boundary = 'right'
variable = v
function = 0
[]
[free-slip-u]
type = INSFVNaturalFreeSlipBC
boundary = 'right'
variable = u
momentum_component = 'x'
[]
[free-slip-v]
type = INSFVNaturalFreeSlipBC
boundary = 'right'
variable = v
momentum_component = 'y'
[]
[axis-u]
type = INSFVSymmetryVelocityBC
boundary = 'left'
variable = u
u = u
v = v
mu = ${mu}
momentum_component = x
[]
[axis-v]
type = INSFVSymmetryVelocityBC
boundary = 'left'
variable = v
u = u
v = v
mu = ${mu}
momentum_component = y
[]
[axis-p]
type = INSFVSymmetryPressureBC
boundary = 'left'
variable = pressure
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'top'
variable = pressure
function = 0
[]
[inlet_temp]
type = FVNeumannBC
boundary = 'bottom'
variable = temperature
value = 300
[]
[]
[FunctorMaterials]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'temperature'
rho = ${rho}
[]
[advected_material_property]
type = ADGenericFunctorMaterial
prop_names = 'advected_rho cp'
prop_values ='${rho} 1'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm 200 lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
[]
[Postprocessors]
[inlet_mass_variable]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = advected_density
[]
[inlet_mass_constant]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[inlet_mass_matprop]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = 'advected_rho'
[]
[mid1_mass]
type = VolumetricFlowRate
boundary = internal_bot
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[mid2_mass]
type = VolumetricFlowRate
boundary = internal_top
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[outlet_mass]
type = VolumetricFlowRate
boundary = top
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[inlet_momentum_x]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = u
[]
[inlet_momentum_y]
type = VolumetricFlowRate
boundary = bottom
vel_x = u
vel_y = v
advected_quantity = v
[]
[mid1_advected_energy]
type = VolumetricFlowRate
boundary = internal_bot
vel_x = u
vel_y = v
advected_quantity = 'rho_cp_temp'
advected_interp_method = 'upwind'
[]
[mid2_advected_energy]
type = VolumetricFlowRate
boundary = internal_top
vel_x = u
vel_y = v
advected_quantity = 'rho_cp_temp'
advected_interp_method = 'upwind'
[]
[outlet_advected_energy]
type = VolumetricFlowRate
boundary = top
vel_x = u
vel_y = v
advected_quantity = 'rho_cp_temp'
advected_interp_method = 'upwind'
[]
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/rz_cone_by_parts_steady_nobcbc.i)
# This input file tests several different things:
# .) The axisymmetric (RZ) form of the governing equations.
# .) An open boundary.
# .) Not integrating the pressure by parts, thereby requiring a pressure pin.
# .) Natural boundary condition at the outlet.
[GlobalParams]
integrate_p_by_parts = true
laplace = true
gravity = '0 0 0'
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[Preconditioning]
[./SMP_PJFNK]
type = SMP
full = true
solve_type = Newton
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Variables]
[./vel_x]
# Velocity in radial (r) direction
family = LAGRANGE
order = SECOND
[../]
[./vel_y]
# Velocity in axial (z) direction
family = LAGRANGE
order = SECOND
[../]
[./p]
family = LAGRANGE
order = FIRST
[../]
[]
[BCs]
[./u_in]
type = DirichletBC
boundary = bottom
variable = vel_x
value = 0
[../]
[./v_in]
type = FunctionDirichletBC
boundary = bottom
variable = vel_y
function = 'inlet_func'
[../]
[./u_axis_and_walls]
type = DirichletBC
boundary = 'left right'
variable = vel_x
value = 0
[../]
[./v_no_slip]
type = DirichletBC
boundary = 'right'
variable = vel_y
value = 0
[../]
[./u_out]
type = INSMomentumNoBCBCLaplaceForm
boundary = top
variable = vel_x
u = vel_x
v = vel_y
pressure = p
component = 0
[../]
[./v_out]
type = INSMomentumNoBCBCLaplaceForm
boundary = top
variable = vel_y
u = vel_x
v = vel_y
pressure = p
component = 1
[../]
# When the NoBCBC is applied on the outlet boundary then there is nothing
# constraining the pressure. Thus we must pin the pressure somewhere to ensure
# that the problem is not singular. If the below BC is not applied then
# -pc_type svd -pc_svd_monitor reveals a singular value
[p_corner]
type = DirichletBC
boundary = top_right
value = 0
variable = p
[]
[]
[Kernels]
[./mass]
type = INSMassRZ
variable = p
u = vel_x
v = vel_y
pressure = p
[../]
[./x_momentum_space]
type = INSMomentumLaplaceFormRZ
variable = vel_x
u = vel_x
v = vel_y
pressure = p
component = 0
[../]
[./y_momentum_space]
type = INSMomentumLaplaceFormRZ
variable = vel_y
u = vel_x
v = vel_y
pressure = p
component = 1
[../]
[]
[Materials]
[./const]
type = GenericConstantMaterial
block = 'volume'
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/rz_cone_no_parts_steady.i)
# This input file tests several different things:
# .) The axisymmetric (RZ) form of the governing equations.
# .) An open boundary.
# .) Not integrating the pressure by parts, thereby requiring a pressure pin.
# .) Natural boundary condition at the outlet.
[GlobalParams]
integrate_p_by_parts = false
laplace = true
gravity = '0 0 0'
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[Preconditioning]
[./SMP_PJFNK]
type = SMP
full = true
solve_type = Newton
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Variables]
[./vel_x]
# Velocity in radial (r) direction
family = LAGRANGE
order = SECOND
[../]
[./vel_y]
# Velocity in axial (z) direction
family = LAGRANGE
order = SECOND
[../]
[./p]
family = LAGRANGE
order = FIRST
[../]
[]
[BCs]
[./p_corner]
# This is required, because pressure term is *not* integrated by parts.
type = DirichletBC
boundary = top_right
value = 0
variable = p
[../]
[./u_in]
type = DirichletBC
boundary = bottom
variable = vel_x
value = 0
[../]
[./v_in]
type = FunctionDirichletBC
boundary = bottom
variable = vel_y
function = 'inlet_func'
[../]
[./u_axis_and_walls]
type = DirichletBC
boundary = 'left right'
variable = vel_x
value = 0
[../]
[./v_no_slip]
type = DirichletBC
boundary = 'right'
variable = vel_y
value = 0
[../]
[]
[Kernels]
[./mass]
type = INSMassRZ
variable = p
u = vel_x
v = vel_y
pressure = p
[../]
[./x_momentum_space]
type = INSMomentumLaplaceFormRZ
variable = vel_x
u = vel_x
v = vel_y
pressure = p
component = 0
[../]
[./y_momentum_space]
type = INSMomentumLaplaceFormRZ
variable = vel_y
u = vel_x
v = vel_y
pressure = p
component = 1
[../]
[]
[Materials]
[./const]
type = GenericConstantMaterial
block = 'volume'
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/rz_cone_by_parts_steady_stabilized_second_order.i)
# This input file tests several different things:
# .) The axisymmetric (RZ) form of the governing equations.
# .) An open boundary.
# .) Not integrating the pressure by parts, thereby requiring a pressure pin.
# .) Natural boundary condition at the outlet.
[GlobalParams]
integrate_p_by_parts = true
laplace = true
gravity = '0 0 0'
supg = true
pspg = true
order = SECOND
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[Preconditioning]
[./SMP_PJFNK]
type = SMP
full = true
solve_type = Newton
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Variables]
[./vel_x]
# Velocity in radial (r) direction
[../]
[./vel_y]
# Velocity in axial (z) direction
[../]
[./p]
order = FIRST
[../]
[]
[BCs]
[./u_in]
type = DirichletBC
boundary = bottom
variable = vel_x
value = 0
[../]
[./v_in]
type = FunctionDirichletBC
boundary = bottom
variable = vel_y
function = 'inlet_func'
[../]
[./u_axis_and_walls]
type = DirichletBC
boundary = 'left right'
variable = vel_x
value = 0
[../]
[./v_no_slip]
type = DirichletBC
boundary = 'right'
variable = vel_y
value = 0
[../]
[]
[Kernels]
[./mass]
type = INSMassRZ
variable = p
u = vel_x
v = vel_y
pressure = p
[../]
[./x_momentum_space]
type = INSMomentumLaplaceFormRZ
variable = vel_x
u = vel_x
v = vel_y
pressure = p
component = 0
[../]
[./y_momentum_space]
type = INSMomentumLaplaceFormRZ
variable = vel_y
u = vel_x
v = vel_y
pressure = p
component = 1
[../]
[]
[Materials]
[./const]
type = GenericConstantMaterial
block = 'volume'
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_no_parts.i)
[GlobalParams]
integrate_p_by_parts = false
viscous_form = 'traction'
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[Preconditioning]
[./SMP_PJFNK]
type = SMP
full = true
solve_type = Newton
[../]
[]
[Executioner]
type = Transient
dt = 0.005
dtmin = 0.005
num_steps = 5
l_max_its = 100
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[AuxVariables]
[./vel_x]
# Velocity in radial (r) direction
family = LAGRANGE
order = SECOND
[../]
[./vel_y]
# Velocity in axial (z) direction
family = LAGRANGE
order = SECOND
[../]
[]
[AuxKernels]
[vel_x]
type = VectorVariableComponentAux
variable = vel_x
vector_variable = velocity
component = 'x'
[]
[vel_y]
type = VectorVariableComponentAux
variable = vel_y
vector_variable = velocity
component = 'y'
[]
[]
[Variables]
[velocity]
family = LAGRANGE_VEC
order = SECOND
[]
[./p]
family = LAGRANGE
order = FIRST
[../]
[]
[BCs]
[./p_corner]
# This is required because of the no bcs
type = DirichletBC
boundary = top_right
value = 0
variable = p
[../]
[./velocity_out]
type = INSADMomentumNoBCBC
boundary = top
variable = velocity
pressure = p
[../]
[./velocity_in]
type = VectorFunctionDirichletBC
boundary = bottom
variable = velocity
function_x = 0
function_y = 'inlet_func'
[../]
[./wall]
type = VectorFunctionDirichletBC
boundary = 'right'
variable = velocity
function_x = 0
function_y = 0
[../]
[./axis]
type = ADVectorFunctionDirichletBC
boundary = 'left'
variable = velocity
set_y_comp = false
function_x = 0
[../]
[]
[Kernels]
[./mass]
type = INSADMass
variable = p
[../]
[./momentum_time]
type = INSADMomentumTimeDerivative
variable = velocity
[../]
[./momentum_convection]
type = INSADMomentumAdvection
variable = velocity
[../]
[./momentum_viscous]
type = INSADMomentumViscous
variable = velocity
[../]
[./momentum_pressure]
type = INSADMomentumPressure
variable = velocity
pressure = p
[../]
[]
[Materials]
[./const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[ins_mat]
type = INSADMaterial
velocity = velocity
pressure = p
[]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
outputs = 'console' execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
outputs = 'console' execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_no_parts_steady_nobcbc.i)
[GlobalParams]
integrate_p_by_parts = false
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[AuxVariables]
[vel_x]
order = SECOND
[]
[vel_y]
order = SECOND
[]
[]
[AuxKernels]
[vel_x]
type = VectorVariableComponentAux
variable = vel_x
vector_variable = velocity
component = 'x'
[]
[vel_y]
type = VectorVariableComponentAux
variable = vel_y
vector_variable = velocity
component = 'y'
[]
[]
[Variables]
[./velocity]
order = SECOND
family = LAGRANGE_VEC
[../]
[./p]
[../]
[]
[Kernels]
[./mass]
type = INSADMass
variable = p
[../]
[momentum_advection]
type = INSADMomentumAdvection
variable = velocity
[]
[./momentum_viscous]
type = INSADMomentumViscous
variable = velocity
[../]
[./momentum_pressure]
type = INSADMomentumPressure
variable = velocity
pressure = p
[../]
[]
[BCs]
[p_corner]
type = DirichletBC
boundary = top_right
value = 0
variable = p
[]
[inlet]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'bottom'
function_x = 0
function_y = 'inlet_func'
[../]
[wall]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'right'
function_x = 0
function_y = 0
[]
[axis]
type = ADVectorFunctionDirichletBC
variable = velocity
boundary = 'left'
set_y_comp = false
function_x = 0
[]
[outlet]
type = INSADMomentumNoBCBC
variable = velocity
pressure = p
boundary = 'top'
[]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Materials]
[./const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[ins_mat]
type = INSADMaterial
velocity = velocity
pressure = p
[]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
solve_type = 'NEWTON'
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/pump/pump_loop_negative_rotation.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.4 & 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_volume_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 = INSFVPump
variable = vel_x
momentum_component = 'x'
pump_volume_force = 'pump_volume_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'
[]
[]
[Functions]
[pump_head_negative]
type = PiecewiseLinear
x = '0.0 10.0'
y = '1000.0 0.0'
[]
[]
[FunctorMaterials]
[pump_mat]
type = NSFVPumpFunctorMaterial
rho = ${rho}
speed = 'U'
rotation_speed = 120
rotation_speed_rated = 100
area_rated = 0.1
volume_rated = 0.01
flow_rate_rated = 1.0
flow_rate = 'flow_rate'
block = 'pump'
enable_negative_rotation = true
symmetric_negative_pressure_head = false
pressure_head_function_negative_rotation = 'pump_head_negative'
[]
[]
[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/postprocessors/flow_rates/conservation_INSFE.i)
[Mesh]
second_order = true
inactive = 'mesh internal_boundary_bot internal_boundary_top'
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '1'
dy = '1 1 1'
ix = '5'
iy = '5 5 5'
subdomain_id = '1
2
3'
[]
[internal_boundary_bot]
type = SideSetsBetweenSubdomainsGenerator
input = mesh
new_boundary = 'internal_bot'
primary_block = 1
paired_block = 2
[]
[internal_boundary_top]
type = SideSetsBetweenSubdomainsGenerator
input = internal_boundary_bot
new_boundary = 'internal_top'
primary_block = 2
paired_block = 3
[]
[diverging_mesh]
type = FileMeshGenerator
file = 'expansion_quad.e'
[]
[]
[Modules]
[IncompressibleNavierStokes]
equation_type = steady-state
# no slip BCs
velocity_boundary = 'bottom right left'
velocity_function = '0 1 0 0 0 0'
pressure_boundary = 'top'
pressure_function = '1'
density_name = rho
dynamic_viscosity_name = mu
integrate_p_by_parts = false
order = SECOND
[]
[]
[Materials]
[const]
type = GenericConstantMaterial
block = '1 2 3'
prop_names = 'rho mu'
prop_values = '1 1'
[]
[]
[FunctorMaterials]
[ADconst]
type = ADGenericFunctorMaterial
block = '1 2 3'
prop_names = 'rho_ad'
prop_values = '1'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
petsc_options_iname = '-ksp_gmres_restart -pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = '300 bjacobi ilu 4'
line_search = none
nl_rel_tol = 1e-12
nl_max_its = 6
l_tol = 1e-6
l_max_its = 300
[]
[Postprocessors]
[inlet_mass_constant]
type = VolumetricFlowRate
boundary = bottom
vel_x = vel_x
vel_y = vel_y
advected_variable = 1
[]
[inlet_mass_matprop]
type = VolumetricFlowRate
boundary = bottom
vel_x = vel_x
vel_y = vel_y
advected_mat_prop = 'rho_ad'
[]
[mid1_mass]
type = VolumetricFlowRate
boundary = internal_bot
vel_x = vel_x
vel_y = vel_y
[]
[other_mid1_mass]
type = VolumetricFlowRate
boundary = internal_bot
vel_x = vel_x
vel_y = vel_y
advected_mat_prop = 'rho_ad'
[]
[mid2_mass]
type = VolumetricFlowRate
boundary = internal_top
vel_x = vel_x
vel_y = vel_y
[]
[outlet_mass]
type = VolumetricFlowRate
boundary = top
vel_x = vel_x
vel_y = vel_y
[]
[inlet_momentum_x]
type = VolumetricFlowRate
boundary = bottom
vel_x = vel_x
vel_y = vel_y
advected_variable = vel_x
[]
[mid1_momentum_x]
type = VolumetricFlowRate
boundary = internal_bot
vel_x = vel_x
vel_y = vel_y
advected_variable = vel_x
[]
[mid2_momentum_x]
type = VolumetricFlowRate
boundary = internal_top
vel_x = vel_x
vel_y = vel_y
advected_variable = vel_x
[]
[outlet_momentum_x]
type = VolumetricFlowRate
boundary = top
vel_x = vel_x
vel_y = vel_y
advected_variable = vel_x
[]
[inlet_momentum_y]
type = VolumetricFlowRate
boundary = bottom
vel_x = vel_x
vel_y = vel_y
advected_variable = vel_y
[]
[mid1_momentum_y]
type = VolumetricFlowRate
boundary = internal_bot
vel_x = vel_x
vel_y = vel_y
advected_variable = vel_y
[]
[mid2_momentum_y]
type = VolumetricFlowRate
boundary = internal_top
vel_x = vel_x
vel_y = vel_y
advected_variable = vel_y
[]
[outlet_momentum_y]
type = VolumetricFlowRate
boundary = top
vel_x = vel_x
vel_y = vel_y
advected_variable = vel_y
[]
[]
[Outputs]
exodus = false
csv = true
inactive = 'console_mass console_momentum_x console_momentum_y'
[console_mass]
type = Console
start_step = 1
show = 'inlet_mass_variable inlet_mass_constant inlet_mass_matprop mid1_mass mid2_mass outlet_mass'
[]
[console_momentum_x]
type = Console
start_step = 1
show = 'inlet_momentum_x mid1_momentum_x mid2_momentum_x outlet_momentum_x'
[]
[console_momentum_y]
type = Console
start_step = 1
show = 'inlet_momentum_y mid1_momentum_y mid2_momentum_y outlet_momentum_y'
[]
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_by_parts.i)
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[AuxVariables]
[vel_x]
order = SECOND
[]
[vel_y]
order = SECOND
[]
[]
[AuxKernels]
[vel_x]
type = VectorVariableComponentAux
variable = vel_x
vector_variable = velocity
component = 'x'
[]
[vel_y]
type = VectorVariableComponentAux
variable = vel_y
vector_variable = velocity
component = 'y'
[]
[]
[Variables]
[./velocity]
order = SECOND
family = LAGRANGE_VEC
[../]
[./p]
[../]
[]
[Kernels]
[./mass]
type = INSADMass
variable = p
[../]
[./momentum_time]
type = INSADMomentumTimeDerivative
variable = velocity
[../]
[./momentum_convection]
type = INSADMomentumAdvection
variable = velocity
[../]
[./momentum_viscous]
type = INSADMomentumViscous
variable = velocity
[../]
[./momentum_pressure]
type = INSADMomentumPressure
variable = velocity
pressure = p
integrate_p_by_parts = true
[../]
[]
[BCs]
[inlet]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'bottom'
function_x = 0
function_y = 'inlet_func'
[../]
[wall]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'right'
function_x = 0
function_y = 0
[]
[axis]
type = ADVectorFunctionDirichletBC
variable = velocity
boundary = 'left'
set_y_comp = false
function_x = 0
[]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Materials]
[./const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[ins_mat]
type = INSADMaterial
velocity = velocity
pressure = p
[]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
solve_type = 'NEWTON'
[../]
[]
[Executioner]
type = Transient
dt = 0.005
dtmin = 0.005
num_steps = 5
l_max_its = 100
# Note: The Steady executioner can be used for this problem, if you
# drop the INSMomentumTimeDerivative kernels and use the following
# direct solver options.
# petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -ksp_type'
# petsc_options_value = 'lu NONZERO 1.e-10 preonly'
# Block Jacobi works well for this problem, as does "-pc_type asm
# -pc_asm_overlap 2", but an overlap of 1 does not work for some
# reason?
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
outputs = 'console' execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
outputs = 'console' execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_by_parts_steady_nobcbc.i)
[GlobalParams]
integrate_p_by_parts = true
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[AuxVariables]
[vel_x]
order = SECOND
[]
[vel_y]
order = SECOND
[]
[]
[AuxKernels]
[vel_x]
type = VectorVariableComponentAux
variable = vel_x
vector_variable = velocity
component = 'x'
[]
[vel_y]
type = VectorVariableComponentAux
variable = vel_y
vector_variable = velocity
component = 'y'
[]
[]
[Variables]
[./velocity]
order = SECOND
family = LAGRANGE_VEC
[../]
[./p]
[../]
[]
[Kernels]
[./mass]
type = INSADMass
variable = p
[../]
[./momentum_convection]
type = INSADMomentumAdvection
variable = velocity
[../]
[./momentum_viscous]
type = INSADMomentumViscous
variable = velocity
[../]
[./momentum_pressure]
type = INSADMomentumPressure
variable = velocity
pressure = p
[../]
[]
[BCs]
[inlet]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'bottom'
function_x = 0
function_y = 'inlet_func'
[../]
[wall]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'right'
function_x = 0
function_y = 0
[]
[axis]
type = ADVectorFunctionDirichletBC
variable = velocity
boundary = 'left'
set_y_comp = false
function_x = 0
[]
[outlet]
type = INSADMomentumNoBCBC
variable = velocity
pressure = p
boundary = 'top'
[]
# When the NoBCBC is applied on the outlet boundary then there is nothing
# constraining the pressure. Thus we must pin the pressure somewhere to ensure
# that the problem is not singular. If the below BC is not applied then
# -pc_type svd -pc_svd_monitor reveals a singular value
[p_corner]
type = DirichletBC
boundary = top_right
value = 0
variable = p
[]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Materials]
[./const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[ins_mat]
type = INSADMaterial
velocity = velocity
pressure = p
[]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
solve_type = 'NEWTON'
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
execute_on = 'timestep_end'
[../]
[]
(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/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_element/ins/RZ_cone/rz_cone_no_parts_steady_stabilized.i)
# This input file tests several different things:
# .) The axisymmetric (RZ) form of the governing equations.
# .) An open boundary.
# .) Not integrating the pressure by parts, thereby requiring a pressure pin.
# .) Natural boundary condition at the outlet.
[GlobalParams]
integrate_p_by_parts = false
laplace = true
gravity = '0 0 0'
supg = true
pspg = true
order = FIRST
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[Preconditioning]
[./SMP_PJFNK]
type = SMP
full = true
solve_type = Newton
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Variables]
[./vel_x]
# Velocity in radial (r) direction
[../]
[./vel_y]
# Velocity in axial (z) direction
[../]
[./p]
[../]
[]
[BCs]
[./p_corner]
# This is required, because pressure term is *not* integrated by parts.
type = DirichletBC
boundary = top_right
value = 0
variable = p
[../]
[./u_in]
type = DirichletBC
boundary = bottom
variable = vel_x
value = 0
[../]
[./v_in]
type = FunctionDirichletBC
boundary = bottom
variable = vel_y
function = 'inlet_func'
[../]
[./u_axis_and_walls]
type = DirichletBC
boundary = 'left right'
variable = vel_x
value = 0
[../]
[./v_no_slip]
type = DirichletBC
boundary = 'right'
variable = vel_y
value = 0
[../]
[]
[Kernels]
[./mass]
type = INSMassRZ
variable = p
u = vel_x
v = vel_y
pressure = p
[../]
[./x_momentum_space]
type = INSMomentumLaplaceFormRZ
variable = vel_x
u = vel_x
v = vel_y
pressure = p
component = 0
[../]
[./y_momentum_space]
type = INSMomentumLaplaceFormRZ
variable = vel_y
u = vel_x
v = vel_y
pressure = p
component = 1
[../]
[]
[Materials]
[./const]
type = GenericConstantMaterial
block = 'volume'
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/finite_volume/materials/flow_diode/friction.i)
mu = 0.1
rho = 10
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '1 0.5 1'
dy = '0.5 0.5'
ix = '3 2 3'
iy = '3 3'
subdomain_id = '1 1 2
2 1 1'
[]
[top_outlet]
type = ParsedGenerateSideset
input = cmg
combinatorial_geometry = 'x>2.499 & y>0.4999'
new_sideset_name = top_right
[]
[bottom_outlet]
type = ParsedGenerateSideset
input = top_outlet
combinatorial_geometry = 'x>2.499 & y<0.50001'
new_sideset_name = bottom_right
[]
[]
[GlobalParams]
rhie_chow_user_object = 'pins_rhie_chow_interpolator'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Modules]
[NavierStokesFV]
compressibility = 'incompressible'
porous_medium_treatment = true
density = ${rho}
dynamic_viscosity = ${mu}
initial_velocity = '1e-6 1e-6 0'
initial_pressure = 0.0
inlet_boundaries = 'left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '1 0'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip noslip'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '1'
use_friction_correction = true
consistent_scaling = 10
friction_blocks = '1; 2'
friction_types = 'darcy forchheimer; darcy forchheimer'
# Base friction
# friction_coeffs = 'Darcy Forchheimer; Darcy Forchheimer'
# Combined with diode
friction_coeffs = 'combined_linear combined_quadratic; combined_linear combined_quadratic'
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
[]
[]
[FunctorMaterials]
[porosity]
type = ADGenericFunctorMaterial
prop_names = 'porosity'
prop_values = '0.5'
[]
[base_friction]
type = ADGenericVectorFunctorMaterial
prop_names = 'Darcy Forchheimer'
prop_values = '220 240 260 0 0 0'
[]
[diode]
type = NSFVFrictionFlowDiodeFunctorMaterial
direction = '1 0 0'
additional_linear_resistance = '4000 0 0'
additional_quadratic_resistance = '0 0 0'
base_linear_friction_coefs = 'Darcy'
base_quadratic_friction_coefs = 'Forchheimer'
sum_linear_friction_name = 'diode_linear'
sum_quadratic_friction_name = 'diode_quad'
block = '2'
turn_on_diode = true
[]
[combine_linear_friction]
type = ADPiecewiseByBlockVectorFunctorMaterial
prop_name = 'combined_linear'
subdomain_to_prop_value = '1 Darcy
2 diode_linear'
[]
[combine_quadratic_friction]
type = ADPiecewiseByBlockVectorFunctorMaterial
prop_name = 'combined_quadratic'
subdomain_to_prop_value = '1 Forchheimer
2 diode_quad'
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_shift_type -ksp_gmres_restart'
petsc_options_value = 'lu NONZERO 200'
line_search = 'none'
nl_abs_tol = 1e-14
[]
[Postprocessors]
[mdot_top]
type = VolumetricFlowRate
boundary = 'top_right'
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = ${rho}
[]
[mdot_bottom]
type = VolumetricFlowRate
boundary = 'bottom_right'
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = ${rho}
[]
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/natural_convection/natural_circulation_pipe.i)
# natural convection through a pipe
# Reference solution in "reference_pipe_natural_convection.py"
# Reference mdot: 0.0792 kg/s
# this input
# iy mdot
# 10 8.302364e-02
# 20 8.111192e-02
# 40 8.007924e-02
# 80 7.954403e-02
# 160 7.927201e-02
# Convergence to the analytical result is observed
height = 10.0
gravity = 9.81
p0 = 1e5
molar_mass = 29.0e-3
T0 = 328
Ru = 8.3145
Ri = '${fparse Ru / molar_mass}'
density = '${fparse p0 / (Ri * T0)}'
head = '${fparse height * density * gravity}'
k = 25.68e-3
gamma = 1.4
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '0.1'
ix = '2'
dy = '${height}'
iy = '5'
[]
[]
[GlobalParams]
rhie_chow_user_object = pins_rhie_chow_interpolator
[]
[FluidProperties]
[air]
type = IdealGasFluidProperties
molar_mass = ${molar_mass}
k = ${k}
gamma = ${gamma}
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'weakly-compressible'
add_energy_equation = true
gravity = '0 -${gravity} 0'
density = rho
dynamic_viscosity = mu
specific_heat = cp
thermal_conductivity = k
initial_velocity = '0 1e-6 0'
initial_pressure = ${p0}
initial_temperature = ${T0}
inlet_boundaries = 'bottom'
momentum_inlet_types = 'fixed-pressure'
momentum_inlet_function = '${fparse p0 + head}'
energy_inlet_types = 'fixed-temperature'
energy_inlet_function = '${T0}'
energy_scaling = 1e-5
wall_boundaries = 'left right'
momentum_wall_types = 'slip slip'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '300 300'
outlet_boundaries = 'top'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${fparse p0}'
momentum_advection_interpolation = 'upwind'
mass_advection_interpolation = 'upwind'
porous_medium_treatment = true
porosity = porosity
energy_advection_interpolation = 'average'
[]
[]
[FVKernels]
[u_friction]
type = INSFVMomentumFriction
variable = superficial_vel_x
linear_coef_name = linear_friction_coeff
momentum_component = 'x'
[]
[v_friction]
type = INSFVMomentumFriction
variable = superficial_vel_y
linear_coef_name = linear_friction_coeff
momentum_component = 'y'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-6
end_time = 1e4
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.1
growth_factor = 2
iteration_window = 2
optimal_iterations = 6
[]
[]
[Functions]
[mu_rampdown_fn]
type = PiecewiseLinear
x = '0 0.5 1 5 10 100 1000 2000'
y = '1000 1000 100 10 1 1 1 0'
[]
[]
[FunctorMaterials]
[fluid_props_to_mat_props]
type = GeneralFunctorFluidProps
fp = air
pressure = pressure
T_fluid = T_fluid
speed = speed
force_define_density = true
mu_rampdown = 'mu_rampdown_fn'
characteristic_length = 1
porosity = porosity
[]
[scalar_props]
type = ADGenericFunctorMaterial
prop_names = 'porosity loss_coeff'
prop_values = '1 1.3'
[]
[linear_friction_coeff]
type = ADParsedFunctorMaterial
property_name = 'linear_friction_coeff'
expression = 'loss_coeff * rho'
functor_names = 'loss_coeff rho'
[]
[]
[AuxVariables]
[rho_var]
type = MooseVariableFVReal
[]
[cp_var]
type = MooseVariableFVReal
[]
[rho_cp_T_fluid_var]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[rho_var_aux]
type = FunctorAux
variable = rho_var
functor = rho
[]
[cp_var_aux]
type = FunctorAux
variable = cp_var
functor = cp
[]
[rho_cp_T_fluid_var_aux]
type = ParsedAux
variable = rho_cp_T_fluid_var
coupled_variables = 'rho_var cp_var T_fluid'
expression = 'rho_var * cp_var * T_fluid'
[]
[]
[Postprocessors]
[inlet_mfr]
type = VolumetricFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = rho
boundary = bottom
advected_interp_method = average
[]
[outlet_mfr]
type = VolumetricFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = rho
boundary = top
advected_interp_method = average
[]
[inlet_energy]
type = VolumetricFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = rho_cp_T_fluid_var
boundary = bottom
advected_interp_method = average
[]
[outlet_energy]
type = VolumetricFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = rho_cp_T_fluid_var
boundary = top
advected_interp_method = average
[]
[]
[Debug]
show_var_residual_norms = true
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad-rz-displacements.i)
[GlobalParams]
order = FIRST
integrate_p_by_parts = true
use_displaced_mesh = true
[]
[Mesh]
file = '2d_cone.msh'
displacements = 'disp_x disp_y'
[]
[Problem]
coord_type = RZ
[]
[AuxVariables]
[vel_x][]
[vel_y][]
[disp_x]
order = SECOND
[]
[disp_y]
order = SECOND
[]
[]
[AuxKernels]
[vel_x]
type = VectorVariableComponentAux
variable = vel_x
vector_variable = velocity
component = 'x'
[]
[vel_y]
type = VectorVariableComponentAux
variable = vel_y
vector_variable = velocity
component = 'y'
[]
[]
[Variables]
[velocity]
family = LAGRANGE_VEC
[]
[p]
[]
[]
# Need to set a non-zero initial condition because we have a velocity norm in
# the denominator for the tau coefficient of the stabilization term
[ICs]
[velocity]
type = VectorConstantIC
x_value = 1e-15
y_value = 1e-15
variable = velocity
[]
[]
[Kernels]
[mass]
type = INSADMass
variable = p
[]
[mass_pspg]
type = INSADMassPSPG
variable = p
[]
[momentum_advection]
type = INSADMomentumAdvection
variable = velocity
[]
[momentum_viscous]
type = INSADMomentumViscous
variable = velocity
[]
[momentum_pressure]
type = INSADMomentumPressure
variable = velocity
pressure = p
[]
[momentum_supg]
type = INSADMomentumSUPG
variable = velocity
velocity = velocity
[]
[]
[BCs]
[inlet]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'bottom'
function_x = 0
function_y = 'inlet_func'
[]
[wall]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'right'
function_x = 0
function_y = 0
[]
[axis]
type = ADVectorFunctionDirichletBC
variable = velocity
boundary = 'left'
set_y_comp = false
function_x = 0
[]
[]
[Functions]
[inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[]
[]
[Materials]
[const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '1 1'
[]
[ins_mat]
type = INSADTauMaterial
velocity = velocity
pressure = p
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
solve_type = 'NEWTON'
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
csv = true
[out]
type = Exodus
hide = 'disp_x disp_y'
[]
[]
[Postprocessors]
[flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
execute_on = 'timestep_end'
[]
[flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/ad_rz_cone_by_parts_traction_steady_stabilized.i)
[GlobalParams]
order = FIRST
integrate_p_by_parts = true
viscous_form = 'traction'
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[AuxVariables]
[vel_x]
[]
[vel_y]
[]
[]
[AuxKernels]
[vel_x]
type = VectorVariableComponentAux
variable = vel_x
vector_variable = velocity
component = 'x'
[]
[vel_y]
type = VectorVariableComponentAux
variable = vel_y
vector_variable = velocity
component = 'y'
[]
[]
[Variables]
[./velocity]
family = LAGRANGE_VEC
[../]
[./p]
[../]
[]
# Need to set a non-zero initial condition because we have a velocity norm in
# the denominator for the tau coefficient of the stabilization term
[ICs]
[velocity]
type = VectorConstantIC
x_value = 1e-15
y_value = 1e-15
variable = velocity
[]
[]
[Kernels]
[./mass]
type = INSADMass
variable = p
[../]
[mass_pspg]
type = INSADMassPSPG
variable = p
[]
[momentum_advection]
type = INSADMomentumAdvection
variable = velocity
[]
[./momentum_viscous]
type = INSADMomentumViscous
variable = velocity
[../]
[./momentum_pressure]
type = INSADMomentumPressure
variable = velocity
pressure = p
[../]
[momentum_supg]
type = INSADMomentumSUPG
variable = velocity
velocity = velocity
[]
[]
[BCs]
[inlet]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'bottom'
function_x = 0
function_y = 'inlet_func'
[../]
[wall]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'right'
function_x = 0
function_y = 0
[]
[axis]
type = ADVectorFunctionDirichletBC
variable = velocity
boundary = 'left'
set_y_comp = false
function_x = 0
[]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Materials]
[./const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[ins_mat]
type = INSADTauMaterial
velocity = velocity
pressure = p
[]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
solve_type = 'NEWTON'
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/rz_cone_by_parts_traction_steady_stabilized.i)
# This input file tests several different things:
# .) The axisymmetric (RZ) form of the governing equations.
# .) An open boundary.
# .) Not integrating the pressure by parts, thereby requiring a pressure pin.
# .) Natural boundary condition at the outlet.
[GlobalParams]
integrate_p_by_parts = true
laplace = false
gravity = '0 0 0'
supg = true
pspg = true
order = FIRST
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[Preconditioning]
[./SMP_PJFNK]
type = SMP
full = true
# Jacobian doesn't appear to be correct for RZ traction form
solve_type = PJFNK
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Variables]
[./vel_x]
# Velocity in radial (r) direction
[../]
[./vel_y]
# Velocity in axial (z) direction
[../]
[./p]
[../]
[]
[BCs]
[./u_in]
type = DirichletBC
boundary = bottom
variable = vel_x
value = 0
[../]
[./v_in]
type = FunctionDirichletBC
boundary = bottom
variable = vel_y
function = 'inlet_func'
[../]
[./u_axis_and_walls]
type = DirichletBC
boundary = 'left right'
variable = vel_x
value = 0
[../]
[./v_no_slip]
type = DirichletBC
boundary = 'right'
variable = vel_y
value = 0
[../]
[]
[Kernels]
[./mass]
type = INSMassRZ
variable = p
u = vel_x
v = vel_y
pressure = p
[../]
[./x_momentum_space]
type = INSMomentumTractionFormRZ
variable = vel_x
u = vel_x
v = vel_y
pressure = p
component = 0
[../]
[./y_momentum_space]
type = INSMomentumTractionFormRZ
variable = vel_y
u = vel_x
v = vel_y
pressure = p
component = 1
[../]
[]
[Materials]
[./const]
type = GenericConstantMaterial
block = 'volume'
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/rz_cone_no_parts_steady_stabilized_second_order.i)
# This input file tests several different things:
# .) The axisymmetric (RZ) form of the governing equations.
# .) An open boundary.
# .) Not integrating the pressure by parts, thereby requiring a pressure pin.
# .) Natural boundary condition at the outlet.
[GlobalParams]
integrate_p_by_parts = false
laplace = true
gravity = '0 0 0'
supg = true
pspg = true
order = SECOND
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[Preconditioning]
[./SMP_PJFNK]
type = SMP
full = true
solve_type = Newton
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Variables]
[./vel_x]
# Velocity in radial (r) direction
[../]
[./vel_y]
# Velocity in axial (z) direction
[../]
[./p]
order = FIRST
[../]
[]
[BCs]
[./p_corner]
# This is required, because pressure term is *not* integrated by parts.
type = DirichletBC
boundary = top_right
value = 0
variable = p
[../]
[./u_in]
type = DirichletBC
boundary = bottom
variable = vel_x
value = 0
[../]
[./v_in]
type = FunctionDirichletBC
boundary = bottom
variable = vel_y
function = 'inlet_func'
[../]
[./u_axis_and_walls]
type = DirichletBC
boundary = 'left right'
variable = vel_x
value = 0
[../]
[./v_no_slip]
type = DirichletBC
boundary = 'right'
variable = vel_y
value = 0
[../]
[]
[Kernels]
[./mass]
type = INSMassRZ
variable = p
u = vel_x
v = vel_y
pressure = p
[../]
[./x_momentum_space]
type = INSMomentumLaplaceFormRZ
variable = vel_x
u = vel_x
v = vel_y
pressure = p
component = 0
[../]
[./y_momentum_space]
type = INSMomentumLaplaceFormRZ
variable = vel_y
u = vel_x
v = vel_y
pressure = p
component = 1
[../]
[]
[Materials]
[./const]
type = GenericConstantMaterial
block = 'volume'
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/finite_volume/materials/ergun/ergun.i)
# This file simulates flow of fluid in a porous elbow for the purpose of verifying
# correct implementation of the various different solution variable sets. This input
# tests correct implementation of the primitive superficial variable set. Flow enters on the top
# and exits on the right. Because the purpose is only to test the equivalence of
# different equation sets, no solid energy equation is included.
porosity_left = 0.4
porosity_right = 0.6
pebble_diameter = 0.06
mu = 1.81e-5 # This has been increased to avoid refining the mesh
M = 28.97e-3
R = 8.3144598
# inlet mass flowrate, kg/s
mdot = -10.0
# inlet mass flux (superficial)
mflux_in_superficial = ${fparse mdot / (pi * 0.5 * 0.5)}
# inlet mass flux (interstitial)
mflux_in_interstitial = ${fparse mflux_in_superficial / porosity_left}
p_initial = 201325.0
T_initial = 300.0
rho_initial = ${fparse p_initial / T_initial * M / R}
vel_y_initial = ${fparse mflux_in_interstitial / rho_initial}
vel_x_initial = 0.0
superficial_vel_y_initial = ${fparse mflux_in_superficial / rho_initial}
superficial_vel_x_initial = 1e-12
# Computation parameters
velocity_interp_method = 'rc'
advected_interp_method = 'upwind'
# ==============================================================================
# GEOMETRY AND MESH
# ==============================================================================
[Mesh]
[fmg]
type = FileMeshGenerator
file = 'ergun_in.e'
[]
coord_type = RZ
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolator
u = superficial_vel_x
v = superficial_vel_y
pressure = pressure
porosity = porosity
[]
[]
[GlobalParams]
porosity = porosity
pebble_diameter = ${pebble_diameter}
fp = fp
# rho for the kernels. Must match fluid property!
rho = ${rho_initial}
fv = true
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
# behavior at time of test creation
two_term_boundary_expansion = false
rhie_chow_user_object = 'rc'
[]
# ==============================================================================
# VARIABLES AND KERNELS
# ==============================================================================
[Variables]
[pressure]
type = INSFVPressureVariable
initial_condition = ${p_initial}
[]
[superficial_vel_x]
type = PINSFVSuperficialVelocityVariable
initial_condition = ${superficial_vel_x_initial}
[]
[superficial_vel_y]
type = PINSFVSuperficialVelocityVariable
initial_condition = ${superficial_vel_y_initial}
[]
[]
[FVKernels]
# Mass Equation.
[mass]
type = PINSFVMassAdvection
variable = 'pressure'
[]
# Momentum x component equation.
[vel_x_time]
type = PINSFVMomentumTimeDerivative
variable = 'superficial_vel_x'
momentum_component = 'x'
[]
[vel_x_advection]
type = PINSFVMomentumAdvection
variable = 'superficial_vel_x'
momentum_component = 'x'
[]
[vel_x_viscosity]
type = PINSFVMomentumDiffusion
variable = 'superficial_vel_x'
momentum_component = 'x'
mu = 'mu'
[]
[u_pressure]
type = PINSFVMomentumPressure
variable = 'superficial_vel_x'
pressure = pressure
momentum_component = 'x'
[]
[u_friction]
type = PINSFVMomentumFriction
variable = 'superficial_vel_x'
Darcy_name = 'Darcy_coefficient'
Forchheimer_name = 'Forchheimer_coefficient'
momentum_component = 'x'
speed = speed
mu = 'mu'
[]
# Momentum y component equation.
[vel_y_time]
type = PINSFVMomentumTimeDerivative
variable = 'superficial_vel_y'
momentum_component = 'y'
[]
[vel_y_advection]
type = PINSFVMomentumAdvection
variable = 'superficial_vel_y'
momentum_component = 'y'
[]
[vel_y_viscosity]
type = PINSFVMomentumDiffusion
variable = 'superficial_vel_y'
momentum_component = 'y'
mu = 'mu'
[]
[v_pressure]
type = PINSFVMomentumPressure
variable = 'superficial_vel_y'
pressure = pressure
momentum_component = 'y'
[]
[v_friction]
type = PINSFVMomentumFriction
variable = 'superficial_vel_y'
Darcy_name = 'Darcy_coefficient'
Forchheimer_name = 'Forchheimer_coefficient'
momentum_component = 'y'
mu = 'mu'
speed = speed
[]
[gravity]
type = PINSFVMomentumGravity
variable = 'superficial_vel_y'
gravity = '0 -9.81 0'
momentum_component = 'y'
[]
[]
# ==============================================================================
# AUXVARIABLES AND AUXKERNELS
# ==============================================================================
[AuxVariables]
[T_fluid]
initial_condition = ${T_initial}
order = CONSTANT
family = MONOMIAL
[]
[vel_x]
initial_condition = ${fparse vel_x_initial}
order = CONSTANT
family = MONOMIAL
[]
[vel_y]
initial_condition = ${fparse vel_y_initial}
order = CONSTANT
family = MONOMIAL
[]
[porosity_out]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[vel_x]
type = FunctorAux
variable = vel_x
functor = vel_x_mat
[]
[vel_y]
type = FunctorAux
variable = vel_y
functor = vel_y_mat
[]
[porosity_out]
type = FunctorAux
variable = porosity_out
functor = porosity
[]
[]
# ==============================================================================
# FLUID PROPERTIES, MATERIALS AND USER OBJECTS
# ==============================================================================
[FluidProperties]
[fp]
type = IdealGasFluidProperties
k = 0.0
mu = ${mu}
gamma = 1.4
molar_mass = ${M}
[]
[]
[FunctorMaterials]
[enthalpy]
type = INSFVEnthalpyMaterial
temperature = 'T_fluid'
[]
[speed]
type = PINSFVSpeedFunctorMaterial
superficial_vel_x = 'superficial_vel_x'
superficial_vel_y = 'superficial_vel_y'
porosity = porosity
vel_x = vel_x_mat
vel_y = vel_y_mat
[]
[kappa]
type = FunctorKappaFluid
[]
[const_Fdrags_mat]
type = FunctorErgunDragCoefficients
porosity = porosity
[]
[fluidprops]
type = GeneralFunctorFluidProps
mu_rampdown = mu_func
porosity = porosity
characteristic_length = ${pebble_diameter}
T_fluid = 'T_fluid'
pressure = 'pressure'
speed = 'speed'
[]
[]
d = 0.05
[Functions]
[mu_func]
type = PiecewiseLinear
x = '1 3 5 10 15 20'
y = '1e5 1e4 1e3 1e2 1e1 1'
[]
[real_porosity_function]
type = ParsedFunction
expression = 'if (x < 0.6 - ${d}, ${porosity_left}, if (x > 0.6 + ${d}, ${porosity_right},
(x-(0.6-${d}))/(2*${d})*(${porosity_right}-${porosity_left}) + ${porosity_left}))'
[]
[porosity]
type = ParsedFunction
expression = 'if (x < 0.6 - ${d}, ${porosity_left}, if (x > 0.6 + ${d}, ${porosity_right},
(x-(0.6-${d}))/(2*${d})*(${porosity_right}-${porosity_left}) + ${porosity_left}))'
[]
[]
# ==============================================================================
# BOUNDARY CONDITIONS
# ==============================================================================
[FVBCs]
[outlet_p]
type = INSFVOutletPressureBC
variable = 'pressure'
function = ${p_initial}
boundary = 'right'
[]
## No or Free slip BC
[free-slip-wall-x]
type = INSFVNaturalFreeSlipBC
boundary = 'bottom wall_1 wall_2 left'
variable = superficial_vel_x
momentum_component = 'x'
[]
[free-slip-wall-y]
type = INSFVNaturalFreeSlipBC
boundary = 'bottom wall_1 wall_2 left'
variable = superficial_vel_y
momentum_component = 'y'
[]
## Symmetry
[symmetry-x]
type = PINSFVSymmetryVelocityBC
boundary = 'left'
variable = superficial_vel_x
u = superficial_vel_x
v = superficial_vel_y
mu = 'mu'
momentum_component = 'x'
[]
[symmetry-y]
type = PINSFVSymmetryVelocityBC
boundary = 'left'
variable = superficial_vel_y
u = superficial_vel_x
v = superficial_vel_y
mu = 'mu'
momentum_component = 'y'
[]
[symmetry-p]
type = INSFVSymmetryPressureBC
boundary = 'left'
variable = 'pressure'
[]
## inlet
[inlet_vel_x]
type = INSFVInletVelocityBC
variable = 'superficial_vel_x'
function = ${superficial_vel_x_initial}
boundary = 'top'
[]
[inlet_vel_y]
type = INSFVInletVelocityBC
variable = 'superficial_vel_y'
function = ${superficial_vel_y_initial}
boundary = 'top'
[]
[]
# ==============================================================================
# EXECUTION PARAMETERS
# ==============================================================================
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -ksp_gmres_restart'
petsc_options_value = 'asm lu NONZERO 200'
line_search = 'none'
# Problem time parameters
dtmin = 0.01
dtmax = 2000
end_time = 3000
# must be the same as the fluid
# Iterations parameters
l_max_its = 50
l_tol = 1e-8
nl_max_its = 25
# nl_rel_tol = 5e-7
nl_abs_tol = 2e-7
# Automatic scaling
automatic_scaling = true
verbose = true
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.025
cutback_factor = 0.5
growth_factor = 2.0
[]
# Steady state detection.
steady_state_detection = true
steady_state_tolerance = 1e-7
steady_state_start_time = 400
[]
# ==============================================================================
# POSTPROCESSORS DEBUG AND OUTPUTS
# ==============================================================================
[Postprocessors]
[mass_flow_in]
type = VolumetricFlowRate
boundary = 'top'
vel_x = 'superficial_vel_x'
vel_y = 'superficial_vel_y'
advected_quantity = ${rho_initial}
execute_on = 'INITIAL TIMESTEP_END'
[]
[mass_flow_out]
type = VolumetricFlowRate
boundary = 'right'
vel_x = 'superficial_vel_x'
vel_y = 'superficial_vel_y'
advected_quantity = ${rho_initial}
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_in]
type = SideAverageValue
variable = pressure
boundary = 'top'
[]
[dP]
type = LinearCombinationPostprocessor
pp_names = 'p_in'
pp_coefs = '1.0'
b = ${fparse -p_initial}
[]
[]
[Outputs]
exodus = true
print_linear_residuals = false
[]
(modules/navier_stokes/test/tests/finite_volume/ins/natural_convection/natural_circulation_dogleg.i)
# natural convection through a dogleg
height = 2.2
density = 1.2
gravity = 10
head = ${fparse height * density * gravity}
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '1 0.2 0.2 0.2 1'
ix = '1 3 3 3 1'
dy = '1 0.2 1'
iy = '12 3 12'
subdomain_id = '2 1 2 2 3
2 1 1 1 3
2 2 2 1 3'
[]
[wall]
type = SideSetsBetweenSubdomainsGenerator
input = mesh
primary_block = '1'
paired_block = '2'
new_boundary = wall
[]
[heated_wall]
type = SideSetsBetweenSubdomainsGenerator
input = wall
primary_block = '1'
paired_block = '3'
new_boundary = heated_wall
[]
[delete]
type = BlockDeletionGenerator
block = '2 3'
input = heated_wall
[]
[]
[GlobalParams]
rhie_chow_user_object = ins_rhie_chow_interpolator
[]
[Modules]
[NavierStokesFV]
compressibility = 'incompressible'
add_energy_equation = true
boussinesq_approximation = true
thermal_expansion = 8e-4
gravity = '0 -${gravity} 0'
density = 1.2
dynamic_viscosity = 1e-3
specific_heat = 300
thermal_conductivity = '10'
initial_velocity = '0 1e-6 0'
initial_pressure = 0
inlet_boundaries = 'bottom'
momentum_inlet_types = 'fixed-pressure'
momentum_inlet_function = '${head}'
energy_inlet_types = 'fixed-temperature'
energy_inlet_function = '300'
wall_boundaries = 'wall heated_wall'
momentum_wall_types = 'slip slip'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 300'
outlet_boundaries = 'top'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '0'
energy_advection_interpolation = 'average'
momentum_advection_interpolation = 'upwind'
mass_advection_interpolation = 'upwind'
friction_blocks = '1'
friction_types = 'Darcy'
friction_coeffs = '2'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-8
[]
[FunctorMaterials]
[props]
type = ADGenericFunctorMaterial
prop_names = 'rho'
prop_values = '${density}'
[]
[]
[Postprocessors]
[inlet_mfr]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
advected_quantity = rho
boundary = bottom
[]
[outlet_mfr]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
advected_quantity = rho
boundary = top
[]
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_reversal.i)
rho = 'rho'
l = 10
inlet_area = 1
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.1
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 6
ny = 3
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[scalar]
type = MooseVariableFVReal
initial_condition = 0.1
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e6
[]
[]
[FVKernels]
# Mass equation
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[mean_zero_pressure]
type = FVIntegralValueConstraint
variable = pressure
lambda = lambda
phi0 = 0.0
[]
# X component momentum equation
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_x
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
# Y component momentum equation
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_y
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
# Energy equation
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T_fluid
rho = rho
drho_dt = drho_dt
dh_dt = dh_dt
h = h
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T_fluid
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T_fluid
v = power_density
[]
# Scalar concentration equation
[scalar_time]
type = FVFunctorTimeKernel
variable = scalar
[]
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_diffusion]
type = FVDiffusion
variable = scalar
coeff = 1.1
[]
[scalar_source]
type = FVBodyForce
variable = scalar
function = 2.1
[]
[]
[FVBCs]
# Inlet
[inlet_mass]
type = WCNSFVMassFluxBC
variable = pressure
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_u]
type = WCNSFVMomentumFluxBC
variable = vel_x
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'x'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_v]
type = WCNSFVMomentumFluxBC
variable = vel_y
boundary = 'left'
mdot_pp = 0
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'y'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_T]
type = WCNSFVEnergyFluxBC
variable = T_fluid
T_fluid = T_fluid
boundary = 'left'
temperature_pp = 'inlet_T'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
cp = 'cp'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_scalar]
type = WCNSFVScalarFluxBC
variable = scalar
boundary = 'left'
scalar_value_pp = 'inlet_scalar_value'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
passive_scalar = scalar
[]
[outlet_mass]
type = WCNSFVMassFluxBC
variable = pressure
boundary = 'right'
mdot_pp = 'outlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
[]
[outlet_u]
type = WCNSFVMomentumFluxBC
variable = vel_x
boundary = 'right'
mdot_pp = 'outlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'x'
vel_x = vel_x
vel_y = vel_y
[]
[outlet_v]
type = WCNSFVMomentumFluxBC
variable = vel_y
boundary = 'right'
mdot_pp = 0
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'y'
vel_x = vel_x
vel_y = vel_y
[]
[outlet_T]
type = WCNSFVEnergyFluxBC
variable = T_fluid
T_fluid = T_fluid
boundary = 'right'
temperature_pp = 'inlet_T'
mdot_pp = 'outlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
cp = 'cp'
vel_x = vel_x
vel_y = vel_y
[]
[outlet_scalar]
type = WCNSFVScalarFluxBC
variable = scalar
boundary = 'right'
scalar_value_pp = 'inlet_scalar_value'
mdot_pp = 'outlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
passive_scalar = scalar
[]
# Walls
[no_slip_x]
type = INSFVNaturalFreeSlipBC
variable = vel_x
momentum_component = x
boundary = 'top bottom'
[]
[no_slip_y]
type = INSFVNaturalFreeSlipBC
variable = vel_y
momentum_component = y
boundary = 'top bottom'
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_mdot]
type = Receiver
default = ${fparse 1980 * inlet_velocity * inlet_area}
#outputs = none
[]
[outlet_mdot]
type = Receiver
default = ${fparse -1980 * inlet_velocity * inlet_area}
outputs = none
[]
[area_pp_left]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
outputs = none
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
outputs = none
[]
[inlet_scalar_value]
type = Receiver
default = 0.2
outputs = none
[]
[left_mdot]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
advected_quantity = rho
boundary = left
#advected_interp_method = ${advected_interp_method}
[]
[right_mdot]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
advected_quantity = rho
boundary = right
advected_interp_method = upwind #${advected_interp_method}
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k rho'
prop_values = '${cp} ${k} 1980'
[]
#[rho]
# type = RhoFromPTFunctorMaterial
# fp = fp
# temperature = T_fluid
# pressure = pressure
#[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-1
optimal_iterations = 6
growth_factor = 4
[]
end_time = 500000
nl_abs_tol = 1e-7
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/ins/neighbor-connected-boundary/test.i)
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '5 5 5 10 5'
ix = '5 5 5 10 5'
dy = '5 10 5 5 5'
iy = '5 10 5 5 5'
subdomain_id = '2 3 2 2 2
2 1 2 2 2
2 1 2 2 2
2 1 1 1 4
2 2 2 2 2'
[]
[attached_to_fluid_block_inlet]
type = SideSetsBetweenSubdomainsGenerator
primary_block = 1
paired_block = 3
input = gen
new_boundary = attached_to_fluid_block_inlet
[]
[attached_to_fluid_block_outlet]
type = SideSetsBetweenSubdomainsGenerator
primary_block = 1
paired_block = 4
input = attached_to_fluid_block_inlet
new_boundary = attached_to_fluid_block_outlet
[]
[attached_to_fluid_block_walls]
type = SideSetsBetweenSubdomainsGenerator
input = attached_to_fluid_block_outlet
primary_block = '1'
paired_block = '2'
new_boundary = attached_to_fluid_block_walls
[]
[attached_to_non_fluid_block_inlet]
type = SideSetsBetweenSubdomainsGenerator
primary_block = 3
paired_block = 1
input = attached_to_fluid_block_walls
new_boundary = attached_to_non_fluid_block_inlet
[]
[attached_to_non_fluid_block_outlet]
type = SideSetsBetweenSubdomainsGenerator
primary_block = 4
paired_block = 1
input = attached_to_non_fluid_block_inlet
new_boundary = attached_to_non_fluid_block_outlet
[]
[attached_to_non_fluid_block_walls]
type = SideSetsBetweenSubdomainsGenerator
input = attached_to_non_fluid_block_outlet
primary_block = '2'
paired_block = '1'
new_boundary = attached_to_non_fluid_block_walls
[]
[]
[Problem]
kernel_coverage_check = false
material_coverage_check = false
[]
[Modules]
[NavierStokesFV]
block = 1
compressibility = 'incompressible'
pressure_face_interpolation = average
momentum_advection_interpolation = upwind
mass_advection_interpolation = upwind
# fluid properties
density = '1'
dynamic_viscosity = '1e-2'
# initial conditions
initial_velocity = '0 0 0'
initial_pressure = 0
# boundary conditions
inlet_boundaries = 'attached_to_non_fluid_block_inlet'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '0 0.1'
outlet_boundaries = 'attached_to_non_fluid_block_outlet'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '0'
wall_boundaries = 'attached_to_non_fluid_block_walls'
momentum_wall_types = 'slip'
[]
[]
[Postprocessors]
[outlet_mfr]
type = VolumetricFlowRate
vel_x = 'vel_x'
vel_y = 'vel_y'
advected_quantity = 1
boundary = attached_to_fluid_block_outlet
rhie_chow_user_object = ins_rhie_chow_interpolator
[]
[inlet_mfr]
type = VolumetricFlowRate
vel_x = 'vel_x'
vel_y = 'vel_y'
advected_quantity = 1
boundary = attached_to_fluid_block_inlet
rhie_chow_user_object = ins_rhie_chow_interpolator
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options = '-pc_svd_monitor'
petsc_options_iname = '-pc_type'
petsc_options_value = 'svd'
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.1
growth_factor = 1.1
cutback_factor = 0.9
optimal_iterations = 6
iteration_window = 2
[]
nl_max_its = 10
nl_abs_tol = 1e-5
# Steady state detection.
steady_state_detection = true
steady_state_tolerance = 1e-10
num_steps = 1
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/RZ_cone_no_parts.i)
# This input file tests several different things:
# .) The axisymmetric (RZ) form of the governing equations.
# .) An open boundary.
# .) Not integrating the pressure by parts, thereby requiring a pressure pin.
# .) Natural boundary condition at the outlet.
[GlobalParams]
integrate_p_by_parts = false
laplace = false
gravity = '0 0 0'
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[Preconditioning]
[./SMP_PJFNK]
type = SMP
full = true
solve_type = Newton
[../]
[]
[Executioner]
type = Transient
dt = 0.005
dtmin = 0.005
num_steps = 5
l_max_its = 100
# Note: The Steady executioner can be used for this problem, if you
# drop the INSMomentumTimeDerivative kernels and use the following
# direct solver options.
# petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -ksp_type'
# petsc_options_value = 'lu NONZERO 1.e-10 preonly'
# Block Jacobi works well for this problem, as does "-pc_type asm
# -pc_asm_overlap 2", but an overlap of 1 does not work for some
# reason?
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Variables]
[./vel_x]
# Velocity in radial (r) direction
family = LAGRANGE
order = SECOND
[../]
[./vel_y]
# Velocity in axial (z) direction
family = LAGRANGE
order = SECOND
[../]
[./p]
family = LAGRANGE
order = FIRST
[../]
[]
[BCs]
[./p_corner]
# This is required, because pressure term is *not* integrated by parts.
type = DirichletBC
boundary = top_right
value = 0
variable = p
[../]
[./u_out]
type = INSMomentumNoBCBCTractionForm
boundary = top
variable = vel_x
u = vel_x
v = vel_y
pressure = p
component = 0
[../]
[./v_out]
type = INSMomentumNoBCBCTractionForm
boundary = top
variable = vel_y
u = vel_x
v = vel_y
pressure = p
component = 1
[../]
[./u_in]
type = DirichletBC
boundary = bottom
variable = vel_x
value = 0
[../]
[./v_in]
type = FunctionDirichletBC
boundary = bottom
variable = vel_y
function = 'inlet_func'
[../]
[./u_axis_and_walls]
type = DirichletBC
boundary = 'left right'
variable = vel_x
value = 0
[../]
[./v_no_slip]
type = DirichletBC
boundary = 'right'
variable = vel_y
value = 0
[../]
[]
[Kernels]
[./x_momentum_time]
type = INSMomentumTimeDerivative
variable = vel_x
[../]
[./y_momentum_time]
type = INSMomentumTimeDerivative
variable = vel_y
[../]
[./mass]
type = INSMassRZ
variable = p
u = vel_x
v = vel_y
pressure = p
[../]
[./x_momentum_space]
type = INSMomentumTractionFormRZ
variable = vel_x
u = vel_x
v = vel_y
pressure = p
component = 0
[../]
[./y_momentum_space]
type = INSMomentumTractionFormRZ
variable = vel_y
u = vel_x
v = vel_y
pressure = p
component = 1
[../]
[]
[Materials]
[./const]
type = GenericConstantMaterial
block = 'volume'
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
outputs = 'console' execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
outputs = 'console' execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/rz_cone_by_parts_steady.i)
# This input file tests several different things:
# .) The axisymmetric (RZ) form of the governing equations.
# .) An open boundary.
# .) Not integrating the pressure by parts, thereby requiring a pressure pin.
# .) Natural boundary condition at the outlet.
[GlobalParams]
integrate_p_by_parts = true
laplace = true
gravity = '0 0 0'
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[Preconditioning]
[./SMP_PJFNK]
type = SMP
full = true
solve_type = Newton
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Variables]
[./vel_x]
# Velocity in radial (r) direction
family = LAGRANGE
order = SECOND
[../]
[./vel_y]
# Velocity in axial (z) direction
family = LAGRANGE
order = SECOND
[../]
[./p]
family = LAGRANGE
order = FIRST
[../]
[]
[BCs]
[./u_in]
type = DirichletBC
boundary = bottom
variable = vel_x
value = 0
[../]
[./v_in]
type = FunctionDirichletBC
boundary = bottom
variable = vel_y
function = 'inlet_func'
[../]
[./u_axis_and_walls]
type = DirichletBC
boundary = 'left right'
variable = vel_x
value = 0
[../]
[./v_no_slip]
type = DirichletBC
boundary = 'right'
variable = vel_y
value = 0
[../]
[]
[Kernels]
[./mass]
type = INSMassRZ
variable = p
u = vel_x
v = vel_y
pressure = p
[../]
[./x_momentum_space]
type = INSMomentumLaplaceFormRZ
variable = vel_x
u = vel_x
v = vel_y
pressure = p
component = 0
[../]
[./y_momentum_space]
type = INSMomentumLaplaceFormRZ
variable = vel_y
u = vel_x
v = vel_y
pressure = p
component = 1
[../]
[]
[Materials]
[./const]
type = GenericConstantMaterial
block = 'volume'
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/rz_cone_no_parts_steady_nobcbc.i)
# This input file tests several different things:
# .) The axisymmetric (RZ) form of the governing equations.
# .) An open boundary.
# .) Not integrating the pressure by parts, thereby requiring a pressure pin.
# .) Natural boundary condition at the outlet.
[GlobalParams]
integrate_p_by_parts = false
laplace = true
gravity = '0 0 0'
[]
[Mesh]
file = '2d_cone.msh'
[]
[Problem]
coord_type = RZ
[]
[Preconditioning]
[./SMP_PJFNK]
type = SMP
full = true
solve_type = Newton
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
console = true
[./out]
type = Exodus
[../]
[]
[Variables]
[./vel_x]
# Velocity in radial (r) direction
family = LAGRANGE
order = SECOND
[../]
[./vel_y]
# Velocity in axial (z) direction
family = LAGRANGE
order = SECOND
[../]
[./p]
family = LAGRANGE
order = FIRST
[../]
[]
[BCs]
[./p_corner]
# This is required, because pressure term is *not* integrated by parts.
type = DirichletBC
boundary = top_right
value = 0
variable = p
[../]
[./u_in]
type = DirichletBC
boundary = bottom
variable = vel_x
value = 0
[../]
[./v_in]
type = FunctionDirichletBC
boundary = bottom
variable = vel_y
function = 'inlet_func'
[../]
[./u_axis_and_walls]
type = DirichletBC
boundary = 'left right'
variable = vel_x
value = 0
[../]
[./v_no_slip]
type = DirichletBC
boundary = 'right'
variable = vel_y
value = 0
[../]
[./u_out]
type = INSMomentumNoBCBCLaplaceForm
boundary = top
variable = vel_x
u = vel_x
v = vel_y
pressure = p
component = 0
[../]
[./v_out]
type = INSMomentumNoBCBCLaplaceForm
boundary = top
variable = vel_y
u = vel_x
v = vel_y
pressure = p
component = 1
[../]
[]
[Kernels]
[./mass]
type = INSMassRZ
variable = p
u = vel_x
v = vel_y
pressure = p
[../]
[./x_momentum_space]
type = INSMomentumLaplaceFormRZ
variable = vel_x
u = vel_x
v = vel_y
pressure = p
component = 0
[../]
[./y_momentum_space]
type = INSMomentumLaplaceFormRZ
variable = vel_y
u = vel_x
v = vel_y
pressure = p
component = 1
[../]
[]
[Materials]
[./const]
type = GenericConstantMaterial
block = 'volume'
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[]
[Functions]
[./inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[../]
[]
[Postprocessors]
[./flow_in]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'bottom'
execute_on = 'timestep_end'
[../]
[./flow_out]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
boundary = 'top'
execute_on = 'timestep_end'
[../]
[]
(modules/navier_stokes/include/postprocessors/MassFluxWeightedFlowRate.h)
// This file is part of the MOOSE framework
// https://www.mooseframework.org
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
// MOOSE includes
#include "VolumetricFlowRate.h"
#include "MathFVUtils.h"
class SinglePhaseFluidProperties;
/**
* This postprocessor computes the mass-flux weighted average of a flow
* quantity over a boundary, internal or external to the flow domain.
*/
class MassFluxWeightedFlowRate : public VolumetricFlowRate
{
public:
static InputParameters validParams();
MassFluxWeightedFlowRate(const InputParameters & parameters);
virtual void initialize() override;
virtual void finalize() override;
virtual void threadJoin(const UserObject & y) override;
virtual Real getValue() const override;
protected:
virtual Real computeFaceInfoIntegral(const FaceInfo * fi) override;
/// density provided as functor
const Moose::Functor<ADReal> & _density;
/// the mass flow rate over the face computed by this object
Real _mdot;
};