- mixing_lengthTurbulent eddy mixing length. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:Turbulent eddy mixing length. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- muThe viscosity. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The viscosity. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- rhoThe value for the density. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The value for the density. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- uThe x-velocity. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The x-velocity. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
MixingLengthTurbulentViscosityFunctorMaterial
This material calculates the 'total_viscosity' which is essentially the sum of the material kinematic viscosity and the turbulent kinematic viscosity computed using the mixing length model.
Computes the material property corresponding to the total viscositycomprising the mixing length model turbulent total_viscosityand the molecular viscosity.
Input Parameters
- blockThe list of blocks (ids or names) that this object will be applied
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:The list of blocks (ids or names) that this object will be applied
- declare_suffixAn optional suffix parameter that can be appended to any declared properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:An optional suffix parameter that can be appended to any declared properties. The suffix will be prepended with a '_' character.
- execute_onALWAYSThe list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
Default:ALWAYS
C++ Type:ExecFlagEnum
Options:XFEM_MARK, FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, LINEAR_CONVERGENCE, NONLINEAR, NONLINEAR_CONVERGENCE, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, MULTIAPP_FIXED_POINT_CONVERGENCE, FINAL, CUSTOM, ALWAYS
Controllable:No
Description:The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
- v0y-velocity. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
Default:0
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:y-velocity. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- w0z-velocity. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
Default:0
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:z-velocity. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
Optional Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Controllable:No
Description:Determines whether this object is calculated using an implicit or explicit form
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
Advanced Parameters
- output_propertiesList of material properties, from this material, to output (outputs must also be defined to an output type)
C++ Type:std::vector<std::string>
Controllable:No
Description:List of material properties, from this material, to output (outputs must also be defined to an output type)
- outputsnone Vector of output names where you would like to restrict the output of variables(s) associated with this object
Default:none
C++ Type:std::vector<OutputName>
Controllable:No
Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object
Outputs Parameters
Input Files
- (tutorials/shield_multiphysics/inputs/step11_multiapps/step11_2d_fluid.i)
- (modules/navier_stokes/test/tests/finite_volume/fvbcs/wall_function/Re_t395.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mixing_length_total_viscosity_material/mixing_length_total_viscosity.i)
- (tutorials/shield_multiphysics/inputs/step10_finite_volume/step10.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)
(tutorials/shield_multiphysics/inputs/step11_multiapps/step11_2d_fluid.i)
cp_water_multiplier = 5e-2
mu_multiplier = 1
# Real facility uses forced convection to cool the water tank at full power
# Need to lower power for natural convection so concrete doesn't get too hot.
power = '${fparse 5e4 / 144 * 0.5}'
[Mesh]
[fmg]
type = FileMeshGenerator
file = 'mesh2d_coarse_in.e'
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
block = 'water'
initial_condition = 1e-4
[]
[vel_y]
type = INSFVVelocityVariable
block = 'water'
initial_condition = 1e-4
[]
[pressure]
type = INSFVPressureVariable
block = 'water'
initial_condition = 1e5
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = 300
block = 'water'
scaling = 1e-05
[]
[lambda]
type = MooseVariableScalar
family = SCALAR
order = FIRST
# Cleans up console output
outputs = none
[]
[]
[GlobalParams]
velocity_interp_method = rc
rhie_chow_user_object = ins_rhie_chow_interpolator
rho = rho
[]
[FVKernels]
[water_ins_mass_advection]
type = INSFVMassAdvection
advected_interp_method = upwind
block = water
variable = pressure
[]
[water_ins_mass_pressure_pin]
type = FVPointValueConstraint
lambda = lambda
phi0 = 1e5
point = '1 3 0'
variable = pressure
[]
[water_ins_momentum_time_vel_x]
type = INSFVMomentumTimeDerivative
block = water
momentum_component = x
variable = vel_x
[]
[water_ins_momentum_time_vel_y]
type = INSFVMomentumTimeDerivative
block = water
momentum_component = y
variable = vel_y
[]
[water_ins_momentum_advection_x]
type = INSFVMomentumAdvection
advected_interp_method = upwind
block = water
momentum_component = x
variable = vel_x
characteristic_speed = 0.01
[]
[water_ins_momentum_advection_y]
type = INSFVMomentumAdvection
advected_interp_method = upwind
block = water
momentum_component = y
variable = vel_y
characteristic_speed = 0.1
[]
[water_ins_momentum_diffusion_x]
type = INSFVMomentumDiffusion
block = water
momentum_component = x
mu = mu
variable = vel_x
[]
[water_ins_momentum_diffusion_y]
type = INSFVMomentumDiffusion
block = water
momentum_component = y
mu = mu
variable = vel_y
[]
[water_ins_momentum_pressure_x]
type = INSFVMomentumPressure
block = water
momentum_component = x
pressure = pressure
variable = vel_x
[]
[water_ins_momentum_pressure_y]
type = INSFVMomentumPressure
block = water
momentum_component = y
pressure = pressure
variable = vel_y
[]
[water_ins_momentum_gravity_z]
type = INSFVMomentumGravity
block = water
gravity = '0 -9.81 0'
momentum_component = y
variable = vel_y
[]
[water_ins_momentum_boussinesq_z]
type = INSFVMomentumBoussinesq
T_fluid = T_fluid
alpha_name = alpha
block = water
gravity = '0 -9.81 0'
momentum_component = y
ref_temperature = 300
rho = 955.7
variable = vel_y
[]
# Energy conservation equation
[water_ins_energy_time]
type = INSFVEnergyTimeDerivative
block = water
dh_dt = dh_dt
rho = rho
variable = T_fluid
[]
[water_ins_energy_advection]
type = INSFVEnergyAdvection
advected_interp_method = upwind
block = water
variable = T_fluid
[]
[water_ins_energy_diffusion_all]
type = FVDiffusion
block = water
coeff = k
variable = T_fluid
[]
# Turbulence
[water_ins_viscosity_rans_x]
type = INSFVMixingLengthReynoldsStress
variable = vel_x
mixing_length = mixing_length
momentum_component = 'x'
u = vel_x
v = vel_y
[]
[water_ins_viscosity_rans_y]
type = INSFVMixingLengthReynoldsStress
variable = vel_y
mixing_length = mixing_length
momentum_component = 'y'
u = vel_x
v = vel_y
[]
[water_ins_energy_rans]
type = WCNSFVMixingLengthEnergyDiffusion
variable = T_fluid
cp = cp
mixing_length = mixing_length
schmidt_number = 1
u = vel_x
v = vel_y
[]
[]
[AuxKernels]
[mixing_length]
type = WallDistanceMixingLengthAux
variable = mixing_length
walls = 'water_boundary inner_cavity_water'
execute_on = 'initial'
[]
[]
[FunctorMaterials]
[water]
type = ADGenericFunctorMaterial
block = 'water'
prop_names = 'rho k cp mu alpha_wall'
prop_values = '955.7 0.6 ${fparse cp_water_multiplier * 4181} ${fparse 7.98e-4 * mu_multiplier} 30'
[]
[boussinesq_params]
type = ADGenericFunctorMaterial
prop_names = 'alpha '
prop_values = '2.9e-3'
[]
[water_ins_enthalpy_material]
type = INSFVEnthalpyFunctorMaterial
block = water
cp = cp
execute_on = ALWAYS
outputs = none
temperature = T_fluid
[]
[total_viscosity]
type = MixingLengthTurbulentViscosityFunctorMaterial
u = 'vel_x'
v = 'vel_y'
mixing_length = mixing_length
mu = mu
[]
[]
[FVBCs]
[vel_x_water_boundary]
type = INSFVNoSlipWallBC
boundary = 'water_boundary inner_cavity_water'
function = 0
variable = vel_x
[]
[vel_y_water_boundary]
type = INSFVNoSlipWallBC
boundary = 'water_boundary inner_cavity_water'
function = 0
variable = vel_y
[]
[T_fluid_inner_cavity]
type = FVFunctorNeumannBC
boundary = inner_cavity_water
functor = ${power}
variable = T_fluid
[]
[T_fluid_water_boundary]
type = FVFunctorConvectiveHeatFluxBC
boundary = water_boundary
variable = T_fluid
T_bulk = T_fluid
T_solid = T_solid
heat_transfer_coefficient = 600
is_solid = false
[]
[]
[UserObjects]
[ins_rhie_chow_interpolator]
type = INSFVRhieChowInterpolator
pressure = 'pressure'
u = 'vel_x'
v = 'vel_y'
block = 'water'
[]
[]
[AuxVariables]
# This isn't used in simulation, but useful for visualization
[vel_z]
type = INSFVVelocityVariable
block = 'water'
initial_condition = 0
[]
[mixing_length]
block = 'water'
order = CONSTANT
family = MONOMIAL
fv = true
[]
# This is the variable that is transferred from the main app
[T_solid]
block = 'concrete_hd concrete Al'
initial_condition = 300
[]
[]
[Problem]
kernel_coverage_check = false
[]
[Executioner]
type = Transient
solve_type = NEWTON
automatic_scaling = true
off_diagonals_in_auto_scaling = true
line_search = none
# Direct solve works for everything small enough
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu NONZERO superlu_dist'
nl_abs_tol = 3e-7
nl_max_its = 10
l_max_its = 3
start_time = -1
dtmax = 100
[TimeStepper]
type = FunctionDT
function = 'if(t < 0.1, 0.1, t)'
[]
[]
[Outputs]
exodus = true
[]
(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_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'
[]
[]
(tutorials/shield_multiphysics/inputs/step10_finite_volume/step10.i)
cp_water_multiplier = 5e-2
mu_multiplier = 1
power = '${fparse 5e4 / 144}'
[Mesh]
[fmg]
type = FileMeshGenerator
file = 'mesh2d_in.e'
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
block = 'water'
initial_condition = 1e-4
[]
[vel_y]
type = INSFVVelocityVariable
block = 'water'
initial_condition = 1e-4
[]
[pressure]
type = INSFVPressureVariable
block = 'water'
initial_condition = 1e5
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = 300
block = 'water'
scaling = 1e-05
[]
[lambda]
type = MooseVariableScalar
family = SCALAR
order = FIRST
[]
[]
[AuxVariables]
# This isn't used in simulation, but useful for visualization
[vel_z]
type = INSFVVelocityVariable
block = 'water'
initial_condition = 0
[]
[mixing_length]
block = 'water'
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[GlobalParams]
velocity_interp_method = rc
rhie_chow_user_object = ins_rhie_chow_interpolator
rho = rho
[]
[FVKernels]
[water_ins_mass_advection]
type = INSFVMassAdvection
advected_interp_method = upwind
block = water
variable = pressure
[]
[water_ins_mass_pressure_pin]
type = FVPointValueConstraint
lambda = lambda
phi0 = 1e5
point = '1 3 0'
variable = pressure
[]
[water_ins_momentum_time_vel_x]
type = INSFVMomentumTimeDerivative
block = water
momentum_component = x
variable = vel_x
[]
[water_ins_momentum_time_vel_y]
type = INSFVMomentumTimeDerivative
block = water
momentum_component = y
variable = vel_y
[]
[water_ins_momentum_advection_x]
type = INSFVMomentumAdvection
advected_interp_method = upwind
block = water
momentum_component = x
variable = vel_x
characteristic_speed = 0.01
[]
[water_ins_momentum_advection_y]
type = INSFVMomentumAdvection
advected_interp_method = upwind
block = water
momentum_component = y
variable = vel_y
characteristic_speed = 0.1
[]
[water_ins_momentum_diffusion_x]
type = INSFVMomentumDiffusion
block = water
momentum_component = x
mu = mu
variable = vel_x
[]
[water_ins_momentum_diffusion_y]
type = INSFVMomentumDiffusion
block = water
momentum_component = y
mu = mu
variable = vel_y
[]
[water_ins_momentum_pressure_x]
type = INSFVMomentumPressure
block = water
momentum_component = x
pressure = pressure
variable = vel_x
[]
[water_ins_momentum_pressure_y]
type = INSFVMomentumPressure
block = water
momentum_component = y
pressure = pressure
variable = vel_y
[]
[water_ins_momentum_gravity_z]
type = INSFVMomentumGravity
block = water
gravity = '0 -9.81 0'
momentum_component = y
variable = vel_y
[]
[water_ins_momentum_boussinesq_z]
type = INSFVMomentumBoussinesq
T_fluid = T_fluid
alpha_name = alpha
block = water
gravity = '0 -9.81 0'
momentum_component = y
ref_temperature = 300
rho = 955.7
variable = vel_y
[]
# Energy conservation equation
[water_ins_energy_time]
type = INSFVEnergyTimeDerivative
block = water
dh_dt = dh_dt
rho = rho
variable = T_fluid
[]
[water_ins_energy_advection]
type = INSFVEnergyAdvection
advected_interp_method = upwind
block = water
variable = T_fluid
[]
[water_ins_energy_diffusion_all]
type = FVDiffusion
block = water
coeff = k
variable = T_fluid
[]
# Turbulence
[water_ins_viscosity_rans_x]
type = INSFVMixingLengthReynoldsStress
variable = vel_x
mixing_length = mixing_length
momentum_component = 'x'
u = vel_x
v = vel_y
[]
[water_ins_viscosity_rans_y]
type = INSFVMixingLengthReynoldsStress
variable = vel_y
mixing_length = mixing_length
momentum_component = 'y'
u = vel_x
v = vel_y
[]
[water_ins_energy_rans]
type = WCNSFVMixingLengthEnergyDiffusion
variable = T_fluid
cp = cp
mixing_length = mixing_length
schmidt_number = 1
u = vel_x
v = vel_y
[]
[]
[AuxKernels]
[mixing_length]
type = WallDistanceMixingLengthAux
variable = mixing_length
walls = 'water_boundary inner_cavity_water'
execute_on = 'initial'
[]
[]
[FunctorMaterials]
[water]
type = ADGenericFunctorMaterial
block = 'water'
prop_names = 'rho k cp mu alpha_wall'
prop_values = '955.7 0.6 ${fparse cp_water_multiplier * 4181} ${fparse 7.98e-4 * mu_multiplier} 30'
[]
[boussinesq_params]
type = ADGenericFunctorMaterial
prop_names = 'alpha '
prop_values = '2.9e-3'
[]
[water_ins_enthalpy_material]
type = INSFVEnthalpyFunctorMaterial
block = water
cp = cp
execute_on = ALWAYS
outputs = none
temperature = T_fluid
[]
[total_viscosity]
type = MixingLengthTurbulentViscosityFunctorMaterial
u = 'vel_x'
v = 'vel_y'
mixing_length = mixing_length
mu = mu
[]
[]
[FVBCs]
[vel_x_water_boundary]
type = INSFVNoSlipWallBC
boundary = 'water_boundary inner_cavity_water'
function = 0
variable = vel_x
[]
[vel_y_water_boundary]
type = INSFVNoSlipWallBC
boundary = 'water_boundary inner_cavity_water'
function = 0
variable = vel_y
[]
[T_fluid_inner_cavity]
type = FVFunctorNeumannBC
boundary = inner_cavity_water
functor = ${power}
variable = T_fluid
[]
[T_fluid_water_boundary]
type = FVFunctorConvectiveHeatFluxBC
boundary = water_boundary
variable = T_fluid
T_bulk = T_fluid
T_solid = 300
heat_transfer_coefficient = 600
is_solid = false
[]
[]
[UserObjects]
[ins_rhie_chow_interpolator]
type = INSFVRhieChowInterpolator
pressure = 'pressure'
u = 'vel_x'
v = 'vel_y'
block = 'water'
[]
[]
[Problem]
kernel_coverage_check = false
[]
[Executioner]
type = Transient
solve_type = NEWTON
automatic_scaling = true
off_diagonals_in_auto_scaling = true
line_search = none
# Direct solve works for everything small enough
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu NONZERO superlu_dist'
nl_abs_tol = 1e-8
nl_max_its = 10
l_max_its = 3
steady_state_tolerance = 1e-12
steady_state_detection = true
normalize_solution_diff_norm_by_dt = false
start_time = -1
dtmax = 100
[TimeStepper]
type = FunctionDT
function = 'if(t < 1, 0.1, t / 10)'
[]
[]
[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
[]