- variableThe name of the variable that this object applies to
C++ Type:AuxVariableName
Unit:(no unit assumed)
Controllable:No
Description:The name of the variable that this object applies to
WallDistanceMixingLengthAux
This auxkernel computes the turbulent mixing length by assuming that it is proportional to the distance from the nearest wall. If a δ parameter is set by the user, the mixing length takes on Escudier's modification to cap the mixing length at a distance from the wall proportional to δ. For more details please refer to https://mooseframework.inl.gov/modules/navier_stokes/rans_theory.html.
Input Parameters
- blockThe list of blocks (ids or names) that this object will be applied
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:The list of blocks (ids or names) that this object will be applied
- boundaryThe list of boundaries (ids or names) from the mesh where this object applies
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:The list of boundaries (ids or names) from the mesh where this object applies
- check_boundary_restrictedTrueWhether to check for multiple element sides on the boundary in the case of a boundary restricted, element aux variable. Setting this to false will allow contribution to a single element's elemental value(s) from multiple boundary sides on the same element (example: when the restricted boundary exists on two or more sides of an element, such as at a corner of a mesh
Default:True
C++ Type:bool
Controllable:No
Description:Whether to check for multiple element sides on the boundary in the case of a boundary restricted, element aux variable. Setting this to false will allow contribution to a single element's elemental value(s) from multiple boundary sides on the same element (example: when the restricted boundary exists on two or more sides of an element, such as at a corner of a mesh
- delta1e+09. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.
Default:1e+09
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.
- execute_onLINEAR TIMESTEP_ENDThe list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
Default:LINEAR TIMESTEP_END
C++ Type:ExecFlagEnum
Options:XFEM_MARK, FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR_CONVERGENCE, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, PRE_DISPLACE
Controllable:No
Description:The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
- von_karman_const0.41. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.
Default:0.41
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.
- von_karman_const_00.09. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.
Default:0.09
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.
- wallsBoundaries that correspond to solid walls.
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:Boundaries that correspond to solid walls.
Optional Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Material Property Retrieval Parameters
Input Files
- (modules/navier_stokes/test/tests/finite_volume/wcns/channel-flow/2d-transient.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/wall_distance_capped_mixing_length_aux/capped_mixing_length.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mixing_length_eddy_viscosity_aux/steady.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mixing_length_total_viscosity_material/steady.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/2d-mixing-length.i)
- (modules/navier_stokes/examples/pipe_mixing_length/pipe_mixing_length.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mixing_length_total_viscosity_material/mixing_length_total_viscosity.i)
- (modules/navier_stokes/test/tests/finite_volume/fvbcs/wall_function/Re_t395.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mixing_length_eddy_viscosity_aux/mixing_length_eddy_viscosity.i)
(modules/navier_stokes/test/tests/finite_volume/wcns/channel-flow/2d-transient.i)
rho = 'rho'
l = 10
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_v = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 20
ny = 10
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = ${inlet_v}
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[]
[AuxVariables]
[mixing_length]
type = MooseVariableFVReal
[]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
inactive = 'u_turb v_turb temp_turb'
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_x
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_turb]
type = INSFVMixingLengthReynoldsStress
variable = vel_x
rho = ${rho}
mixing_length = 'mixing_length'
momentum_component = 'x'
u = vel_x
v = vel_y
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_y
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
momentum_component = 'y'
mu = ${mu}
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[v_turb]
type = INSFVMixingLengthReynoldsStress
variable = vel_y
rho = ${rho}
mixing_length = 'mixing_length'
momentum_component = 'y'
u = vel_x
v = vel_y
[]
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T_fluid
rho = rho
drho_dt = drho_dt
h = h
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T_fluid
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T_fluid
v = power_density
[]
[temp_turb]
type = WCNSFVMixingLengthEnergyDiffusion
variable = T_fluid
rho = rho
cp = cp
mixing_length = 'mixing_length'
schmidt_number = 1
u = vel_x
v = vel_y
[]
[]
[FVBCs]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'top bottom'
function = 0
[]
# Inlet
[inlet_u]
type = INSFVInletVelocityBC
variable = vel_x
boundary = 'left'
function = ${inlet_v}
[]
[inlet_v]
type = INSFVInletVelocityBC
variable = vel_y
boundary = 'left'
function = 0
[]
[inlet_T]
type = FVDirichletBC
variable = T_fluid
boundary = 'left'
value = ${inlet_temp}
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T_fluid
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho}
[]
[]
[AuxKernels]
inactive = 'mixing_len'
[mixing_len]
type = WallDistanceMixingLengthAux
walls = 'top'
variable = mixing_length
execute_on = 'initial'
delta = 0.5
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-3
optimal_iterations = 6
[]
end_time = 15
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
off_diagonals_in_auto_scaling = true
compute_scaling_once = false
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/wall_distance_capped_mixing_length_aux/capped_mixing_length.i)
von_karman_const = 0.41
H = 1 #halfwidth of the channel
L = 150
Re = 13700
rho = 1
bulk_u = 1
mu = ${fparse rho * bulk_u * 2 * H / Re}
advected_interp_method='upwind'
velocity_interp_method='rc'
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '${L}'
dy = '0.667 0.333'
ix = '100'
iy = '10 1'
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = 1e-6
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-6
[]
[pressure]
type = INSFVPressureVariable
[]
[]
[AuxVariables]
[mixing_len]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[wall_shear_stress]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[wall_yplus]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = u
rho = ${rho}
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = u
rho = ${rho}
mixing_length = mixing_len
momentum_component = 'x'
u = u
v = v
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = INSFVMomentumTimeDerivative
variable = v
rho = ${rho}
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = v
rho = ${rho}
mixing_length = mixing_len
momentum_component = 'y'
u = u
v = v
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[]
[AuxKernels]
[mixing_len]
type = WallDistanceMixingLengthAux
walls = 'top'
variable = mixing_len
execute_on = 'initial'
von_karman_const = ${von_karman_const}
delta = 0.5
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = u
function = '1'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = v
function = '0'
[]
[wall-u]
type = INSFVWallFunctionBC
variable = u
boundary = 'top'
u = u
v = v
mu = ${mu}
rho = ${rho}
momentum_component = x
[]
[wall-v]
type = INSFVWallFunctionBC
variable = v
boundary = 'top'
u = u
v = v
mu = ${mu}
rho = ${rho}
momentum_component = y
[]
[sym-u]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = u
u = u
v = v
mu = ${mu}
momentum_component = x
[]
[sym-v]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = v
u = u
v = v
mu = ${mu}
momentum_component = y
[]
[symmetry_pressure]
type = INSFVSymmetryPressureBC
boundary = 'bottom'
variable = pressure
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = '0'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 6
dt = 1e-3
[]
nl_abs_tol = 1e-8
end_time = 1e9
[]
[Outputs]
[out]
type = Exodus
execute_on = 'final'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/mixing_length_eddy_viscosity_aux/steady.i)
von_karman_const = 0.41
H = 1 #halfwidth of the channel
L = 150
Re = 100
rho = 1
bulk_u = 1
mu = '${fparse rho * bulk_u * 2 * H / Re}'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '${L}'
dy = '0.667 0.333'
ix = '200'
iy = '10 1'
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = 1e-6
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-6
[]
[pressure]
type = INSFVPressureVariable
[]
[]
[AuxVariables]
[mixing_len]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[wall_shear_stress]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[wall_yplus]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[eddy_viscosity]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = u
rho = ${rho}
mixing_length = mixing_len
momentum_component = 'x'
u = u
v = v
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = v
rho = ${rho}
mixing_length = mixing_len
momentum_component = 'y'
u = u
v = v
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[]
[AuxKernels]
[mixing_len]
type = WallDistanceMixingLengthAux
walls = 'top'
variable = mixing_len
execute_on = 'initial'
von_karman_const = ${von_karman_const}
delta = 0.5
[]
[turbulent_viscosity]
type = INSFVMixingLengthTurbulentViscosityAux
variable = eddy_viscosity
mixing_length = mixing_len
u = u
v = v
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = u
function = '1'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = v
function = '0'
[]
[wall-u]
type = INSFVWallFunctionBC
variable = u
boundary = 'top'
u = u
v = v
mu = ${mu}
rho = ${rho}
momentum_component = x
[]
[wall-v]
type = INSFVWallFunctionBC
variable = v
boundary = 'top'
u = u
v = v
mu = ${mu}
rho = ${rho}
momentum_component = y
[]
[sym-u]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = u
u = u
v = v
mu = ${mu}
momentum_component = x
[]
[sym-v]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = v
u = u
v = v
mu = ${mu}
momentum_component = y
[]
[symmetry_pressure]
type = INSFVSymmetryPressureBC
boundary = 'bottom'
variable = pressure
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = '0'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/mixing_length_total_viscosity_material/steady.i)
von_karman_const = 0.41
H = 1 #halfwidth of the channel
L = 150
Re = 100
rho = 1
bulk_u = 1
mu = '${fparse rho * bulk_u * 2 * H / Re}'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '${L}'
dy = '0.667 0.333'
ix = '200'
iy = '10 1'
[]
[]
[Functions]
[delta_func]
type = ParsedFunction
expression = '1.0-x/150'
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 1e-6
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1e-6
[]
[pressure]
type = INSFVPressureVariable
[]
[]
[AuxVariables]
[mixing_length]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = vel_x
rho = ${rho}
mixing_length = mixing_length
momentum_component = 'x'
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = vel_y
rho = ${rho}
mixing_length = mixing_length
momentum_component = 'y'
u = vel_x
v = vel_y
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[]
[AuxKernels]
[mixing_length]
type = WallDistanceMixingLengthAux
walls = 'top'
variable = mixing_length
execute_on = 'initial'
von_karman_const = ${von_karman_const}
delta = 0.5
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_x
function = '1'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_y
function = '0'
[]
[wall-u]
type = INSFVWallFunctionBC
variable = vel_x
boundary = 'top'
u = vel_x
v = vel_y
mu = ${mu}
rho = ${rho}
momentum_component = x
[]
[wall-v]
type = INSFVWallFunctionBC
variable = vel_y
boundary = 'top'
u = vel_x
v = vel_y
mu = ${mu}
rho = ${rho}
momentum_component = y
[]
[sym-u]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = vel_x
u = vel_x
v = vel_y
mu = total_viscosity
momentum_component = x
[]
[sym-v]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = vel_y
u = vel_x
v = vel_y
mu = total_viscosity
momentum_component = y
[]
[symmetry_pressure]
type = INSFVSymmetryPressureBC
boundary = 'bottom'
variable = pressure
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = '0'
[]
[]
[FunctorMaterials]
[total_viscosity]
type = MixingLengthTurbulentViscosityFunctorMaterial
u = 'vel_x' #computes total viscosity = mu_t + mu
v = 'vel_y' #property is called total_viscosity
mixing_length = mixing_length
mu = ${mu}
rho = ${rho}
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/2d-mixing-length.i)
Re = 1e4
von_karman_const = 0.2
D = 1
rho = 1
bulk_u = 1
mu = '${fparse rho * bulk_u * D / Re}'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 5
ymin = 0
ymax = '${fparse 0.5 * D}'
nx = 20
ny = 10
bias_y = '${fparse 1 / 1.2}'
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 1
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1
[]
[pressure]
type = INSFVPressureVariable
[]
[scalar]
type = INSFVScalarFieldVariable
[]
[]
[AuxVariables]
[mixing_length]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = vel_x
rho = ${rho}
mixing_length = 'mixing_length'
momentum_component = 'x'
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = vel_y
rho = ${rho}
mixing_length = 'mixing_length'
momentum_component = 'y'
u = vel_x
v = vel_y
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_diffusion_rans]
type = INSFVMixingLengthScalarDiffusion
variable = scalar
mixing_length = 'mixing_length'
u = vel_x
v = vel_y
schmidt_number = 1.0
[]
[scalar_src]
type = FVBodyForce
variable = scalar
value = 0.1
[]
[]
[AuxKernels]
[mixing_len]
type = WallDistanceMixingLengthAux
walls = 'top bottom'
variable = 'mixing_length'
execute_on = 'initial'
von_karman_const = ${von_karman_const}
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_x
function = '1'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_y
function = '0'
[]
[inlet_scalar]
type = FVDirichletBC
boundary = 'left'
variable = scalar
value = 1
[]
[wall-u]
type = INSFVNoSlipWallBC
boundary = 'top'
variable = vel_x
function = 0
[]
[wall-v]
type = INSFVNoSlipWallBC
boundary = 'top'
variable = vel_y
function = 0
[]
[sym-u]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = vel_x
u = vel_x
v = vel_y
mu = 'total_viscosity'
momentum_component = x
[]
[sym-v]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = vel_y
u = vel_x
v = vel_y
mu = 'total_viscosity'
momentum_component = y
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = '0'
[]
[]
[FunctorMaterials]
[total_viscosity]
type = MixingLengthTurbulentViscosityFunctorMaterial
u = 'vel_x' #computes total viscosity = mu_t + mu
v = 'vel_y' #property is called total_viscosity
mixing_length = 'mixing_length'
mu = ${mu}
rho = ${rho}
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/examples/pipe_mixing_length/pipe_mixing_length.i)
# This example demonstrates how the mixing length model can be tuned to match an
# established correlation for pressure drop in a smooth circular pipe.
# The primary input parameters for this example are the system Reynolds number
# and the von Karman constant for the mixing length model. These two parameters
# can be changed here:
Re = 1e5
von_karman_const = 0.22
# Note that for this model (using the wall-distance mixing length for the entire
# pipe) different von Karman constants are optimal for different Reynolds
# numbers.
# This model has been non-dimensionalized. The diameter (D), density (rho), and
# bulk velocity (bulk_u) are all considered unity.
D = 1
total_len = ${fparse 40 * D}
rho = 1
bulk_u = 1
# With those parameters set, the viscosity is then computed in order to reach
# the desired Reynolds number.
mu = ${fparse rho * bulk_u * D / Re}
# Here the DeltaP will be evaluated by using a postprocessor to find the pressure
# at a point that is 10 diameters away from the outlet. (The outlet pressure is
# set to zero.)
L = ${fparse 10 * D}
# We will use the McAdams correlation to find the Darcy friction factor. Note
# that this correlation is valid for fully developed flow in smooth circular
# tubes at 3e4 < Re < 1e6.
f = ${fparse 0.316 * Re^(-0.25)}
# The DeltaP can then be computed using this friction factor as,
ref_delta_P = ${fparse f * L / D * rho * bulk_u^2 / 2}
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${total_len}
ymin = 0
ymax = ${fparse 0.5 * D}
nx = 200
ny = 40
bias_y = ${fparse 1 / 1.2}
[]
[rename1]
type = RenameBoundaryGenerator
input = gen
old_boundary = 'left'
new_boundary = 'inlet'
[]
[rename2]
type = RenameBoundaryGenerator
input = rename1
old_boundary = 'right'
new_boundary = 'outlet'
[]
[rename3]
type = RenameBoundaryGenerator
input = rename2
old_boundary = 'bottom'
new_boundary = 'symmetry'
[]
[rename4]
type = RenameBoundaryGenerator
input = rename3
old_boundary = 'top'
new_boundary = 'wall'
[]
[]
[Outputs]
exodus = true
[]
[Problem]
kernel_coverage_check = false
fv_bcs_integrity_check = true
coord_type = 'RZ'
rz_coord_axis = 'X'
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
# The upwind and Rhie-Chow interpolation schemes are used here.
advected_interp_method='upwind'
velocity_interp_method='rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = 1e-6
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-6
[]
[pressure]
type = INSFVPressureVariable
[]
[]
[AuxVariables]
[mixing_len]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[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}
momentum_component = 'x'
[]
[u_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = u
rho = ${rho}
mixing_length = mixing_len
momentum_component = 'x'
u = u
v = v
[]
[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_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = v
rho = ${rho}
mixing_length = mixing_len
momentum_component = 'y'
u = u
v = v
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[]
[AuxKernels]
[mixing_len]
type = WallDistanceMixingLengthAux
walls = 'wall'
variable = mixing_len
execute_on = 'initial'
von_karman_const = ${von_karman_const}
[]
[]
[FVBCs]
[inlet_u]
type = INSFVInletVelocityBC
boundary = 'inlet'
variable = u
function = ${bulk_u}
[]
[inlet_v]
type = INSFVInletVelocityBC
boundary = 'inlet'
variable = v
function = '0'
[]
[walls_u]
type = INSFVNoSlipWallBC
boundary = 'wall'
variable = u
function = 0
[]
[walls_v]
type = INSFVNoSlipWallBC
boundary = 'wall'
variable = v
function = 0
[]
[sym_u]
type = INSFVSymmetryVelocityBC
boundary = 'symmetry'
variable = u
u = u
v = v
mu = ${mu}
momentum_component = x
[]
[sym_v]
type = INSFVSymmetryVelocityBC
boundary = 'symmetry'
variable = v
u = u
v = v
mu = ${mu}
momentum_component = y
[]
[sym_p]
type = INSFVSymmetryPressureBC
boundary = 'symmetry'
variable = pressure
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'outlet'
variable = pressure
function = '0'
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
line_search = 'none'
nl_rel_tol = 1e-12
nl_abs_tol = 1e-12
[]
[Postprocessors]
[delta_P]
type = PointValue
variable = 'pressure'
point = '${fparse total_len - L} 0 0'
[]
[reference_delta_P]
type = Receiver
default = ${ref_delta_P}
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/mixing_length_total_viscosity_material/mixing_length_total_viscosity.i)
von_karman_const = 0.41
H = 1 #halfwidth of the channel
L = 150
Re = 13700
rho = 1
bulk_u = 1
mu = ${fparse rho * bulk_u * 2 * H / Re}
advected_interp_method='upwind'
velocity_interp_method='rc'
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '${L}'
dy = '0.667 0.333'
ix = '200'
iy = '10 1'
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 1e-6
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1e-6
[]
[pressure]
type = INSFVPressureVariable
[]
[]
[AuxVariables]
[mixing_length]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[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_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = vel_x
rho = ${rho}
mixing_length = mixing_length
momentum_component = 'x'
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = INSFVMomentumTimeDerivative
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[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_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = vel_y
rho = ${rho}
mixing_length = mixing_length
momentum_component = 'y'
u = vel_x
v = vel_y
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[]
[AuxKernels]
[mixing_len]
type = WallDistanceMixingLengthAux
walls = 'top'
variable = mixing_length
execute_on = 'initial'
von_karman_const = ${von_karman_const}
delta = 0.5
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_x
function = '1'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_y
function = '0'
[]
[wall-u]
type = INSFVWallFunctionBC
variable = vel_x
boundary = 'top'
u = vel_x
v = vel_y
mu = ${mu}
rho = ${rho}
momentum_component = x
[]
[wall-v]
type = INSFVWallFunctionBC
variable = vel_y
boundary = 'top'
u = vel_x
v = vel_y
mu = ${mu}
rho = ${rho}
momentum_component = y
[]
[sym-u]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = vel_x
u = vel_x
v = vel_y
mu = total_viscosity
momentum_component = x
[]
[sym-v]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = vel_y
u = vel_x
v = vel_y
mu = total_viscosity
momentum_component = y
[]
[symmetry_pressure]
type = INSFVSymmetryPressureBC
boundary = 'bottom'
variable = pressure
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = '0'
[]
[]
[FunctorMaterials]
[total_viscosity]
type = MixingLengthTurbulentViscosityFunctorMaterial
u = 'vel_x' #computes total viscosity = mu_t + mu
v = 'vel_y' #property is called total_viscosity
mixing_length = mixing_length
mu = ${mu}
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 6
dt = 1e-3
[]
nl_abs_tol = 1e-8
end_time = 1e9
[]
[Outputs]
[out]
type = Exodus
execute_on = 'final'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/fvbcs/wall_function/Re_t395.i)
von_karman_const = 0.41
H = 1 #halfwidth of the channel
L = 150
Re = 13700
rho = 1
bulk_u = 1
mu = ${fparse rho * bulk_u * 2 * H / Re}
advected_interp_method='upwind'
velocity_interp_method='rc'
[GlobalParams]
two_term_boundary_expansion = true
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '${L}'
dy = '0.667 0.333'
ix = '200'
iy = '10 1'
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = 1e-6
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-6
[]
[pressure]
type = INSFVPressureVariable
[]
[]
[AuxVariables]
[mixing_len]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[wall_shear_stress]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[wall_yplus]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = u
rho = ${rho}
mixing_length = mixing_len
momentum_component = 'x'
u = u
v = v
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = v
rho = ${rho}
mixing_length = mixing_len
momentum_component = 'y'
u = u
v = v
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[]
[AuxKernels]
[mixing_len]
type = WallDistanceMixingLengthAux
walls = 'top'
variable = mixing_len
execute_on = 'initial'
von_karman_const = ${von_karman_const}
[]
[wall_shear_stress]
type = WallFunctionWallShearStressAux
variable = wall_shear_stress
walls = 'top'
u = u
v = v
mu = ${mu}
rho = ${rho}
[]
[wall_yplus]
type = WallFunctionYPlusAux
variable = wall_yplus
walls = 'top'
u = u
v = v
mu = ${mu}
rho = ${rho}
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = u
function = '1'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = v
function = '0'
[]
[wall-u]
type = INSFVWallFunctionBC
variable = u
boundary = 'top'
u = u
v = v
mu = ${mu}
rho = ${rho}
momentum_component = x
[]
[wall-v]
type = INSFVWallFunctionBC
variable = v
boundary = 'top'
u = u
v = v
mu = ${mu}
rho = ${rho}
momentum_component = y
[]
[sym-u]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = u
u = u
v = v
mu = total_viscosity
momentum_component = x
[]
[sym-v]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = v
u = u
v = v
mu = total_viscosity
momentum_component = y
[]
[symmetry_pressure]
type = INSFVSymmetryPressureBC
boundary = 'bottom'
variable = pressure
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = '0'
[]
[]
[FunctorMaterials]
[total_viscosity]
type = MixingLengthTurbulentViscosityFunctorMaterial
u = 'u' #computes total viscosity = mu_t + mu
v = 'v' #property is called total_viscosity
mixing_length = mixing_len
mu = ${mu}
rho = ${rho}
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm 200 lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/mixing_length_eddy_viscosity_aux/mixing_length_eddy_viscosity.i)
von_karman_const = 0.41
H = 1 #halfwidth of the channel
L = 150
Re = 13700
rho = 1
bulk_u = 1
mu = ${fparse rho * bulk_u * 2 * H / Re}
advected_interp_method='upwind'
velocity_interp_method='rc'
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '${L}'
dy = '0.667 0.333'
ix = '100'
iy = '10 1'
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = 1e-6
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-6
[]
[pressure]
type = INSFVPressureVariable
[]
[]
[AuxVariables]
[mixing_len]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[wall_shear_stress]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[wall_yplus]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[eddy_viscosity]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = u
rho = ${rho}
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = u
rho = ${rho}
mixing_length = mixing_len
momentum_component = 'x'
u = u
v = v
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = INSFVMomentumTimeDerivative
variable = v
rho = ${rho}
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = v
rho = ${rho}
mixing_length = mixing_len
momentum_component = 'y'
u = u
v = v
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[]
[AuxKernels]
[mixing_len]
type = WallDistanceMixingLengthAux
walls = 'top'
variable = mixing_len
execute_on = 'initial'
von_karman_const = ${von_karman_const}
delta = 0.5
[]
[turbulent_viscosity]
type = INSFVMixingLengthTurbulentViscosityAux
variable = eddy_viscosity
mixing_length = mixing_len
u = u
v = v
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = u
function = '1'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = v
function = '0'
[]
[wall-u]
type = INSFVWallFunctionBC
variable = u
boundary = 'top'
u = u
v = v
mu = ${mu}
rho = ${rho}
momentum_component = x
[]
[wall-v]
type = INSFVWallFunctionBC
variable = v
boundary = 'top'
u = u
v = v
mu = ${mu}
rho = ${rho}
momentum_component = y
[]
[sym-u]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = u
u = u
v = v
mu = ${mu}
momentum_component = x
[]
[sym-v]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = v
u = u
v = v
mu = ${mu}
momentum_component = y
[]
[symmetry_pressure]
type = INSFVSymmetryPressureBC
boundary = 'bottom'
variable = pressure
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = '0'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 6
dt = 1e-3
[]
nl_abs_tol = 1e-8
end_time = 1e9
[]
[Outputs]
[out]
type = Exodus
execute_on = 'final'
[]
[]