- epsilonCoupled turbulent kinetic energy dissipation rate. 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:Coupled turbulent kinetic energy dissipation rate. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- muDynamic 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:Dynamic viscosity. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- rhoDensity. 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:Density. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- tkeCoupled turbulent kinetic energy. 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:Coupled turbulent kinetic energy. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- uThe velocity in the x direction. 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 velocity in the x direction. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- 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
kEpsilonViscosityAux
This is the auxiliary kernel used to compute the dynamic turbulent viscosity
where:
is the density,
is a closure parameter,
is the turbulent kinetic energy,
is the turbulent kinetic energy dissipation rate.
.
By setting parameter "bulk_wall_treatment" to true
, the kernel allows us to set the value of the cells on the boundaries specified in "walls" to the dynamic turbulent viscosity predicted from the law of the wall or non-equilibrium wall functions. See INSFVTurbulentViscosityWallFunction for more details about the near-wall implementation.
If the boundary conditions for the dynamic turbulent viscosity are already set via INSFVTurbulentViscosityWallFunction, there is no need to add bulk wall treatment, i.e., we should set "bulk_wall_treatment" to false
. This type of bulk wall treatment is mainly designed for porous media formulations with large computational cells.
Input Parameters
- C_muCoupled turbulent kinetic energy closure.
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Coupled turbulent kinetic energy closure.
- 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
- bulk_wall_treatmentFalseActivate bulk wall treatment.
Default:False
C++ Type:bool
Controllable:No
Description:Activate bulk wall treatment.
- 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
- 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, LINEAR_CONVERGENCE, NONLINEAR, NONLINEAR_CONVERGENCE, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, MULTIAPP_FIXED_POINT_CONVERGENCE, 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.
- mu_t_ratio_max100000Maximum allowable mu_t_ratio : mu/mu_t.
Default:100000
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Maximum allowable mu_t_ratio : mu/mu_t.
- scale_limiterstandardThe method used to limit the k-epsilon time scale.'none', 'standard'
Default:standard
C++ Type:MooseEnum
Options:none, standard
Controllable:No
Description:The method used to limit the k-epsilon time scale.'none', 'standard'
- vThe velocity in the y direction. 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 velocity in the y direction. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- wThe velocity in the z direction. 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 velocity in the z direction. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- wall_treatmenteq_newtonThe method used for computing the wall functions.'eq_newton', 'eq_incremental', 'eq_linearized', 'neq'
Default:eq_newton
C++ Type:MooseEnum
Options:eq_newton, eq_incremental, eq_linearized, neq
Controllable:No
Description:The method used for computing the wall functions.'eq_newton', 'eq_incremental', 'eq_linearized', 'neq'
- 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.
- newton_solveFalseWhether a Newton nonlinear solve is being used
Default:False
C++ Type:bool
Controllable:No
Description:Whether a Newton nonlinear solve is being used
- 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/ins/turbulence/channel/segregated/channel_ERCOFTAC.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/segregated/lid-driven-turb-energy-wall.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/segregated/lid-driven-turb-non-eq-wall.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/linear-segregated-transient/channel_ERCOFTAC.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/bfs/linear-segregated-transient/BFS_ERCOFTAC.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/segregated/lid-driven-turb-std-wall.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/segregated/lid-driven-turb-capped.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/bfs/linear-segregated/BFS_ERCOFTAC.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/bfs/segregated/BFS_ERCOFTAC.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/segregated/lid-driven-turb-energy.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/segregated/lid-driven-turb-inc-wall.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/segregated/lid-driven-turb-linear-wall.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/linear-segregated/lid-driven-turb-std-wall.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/block-restricted/block-ke.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/segregated/lid-driven-turb-non-eq-bulk.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/segregated/lid-driven-turb-no-wall.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/linear-segregated/lid-driven-turb-non-eq-wall.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/linear-segregated/channel_ERCOFTAC.i)
bulk_wall_treatment
Default:False
C++ Type:bool
Controllable:No
Description:Activate bulk wall treatment.
walls
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:Boundaries that correspond to solid walls.
bulk_wall_treatment
Default:False
C++ Type:bool
Controllable:No
Description:Activate bulk wall treatment.
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/segregated/channel_ERCOFTAC.i)
##########################################################
# ERCOFTAC test case foe turbulent channel flow
# Case Number: 032
# Author: Dr. Mauricio Tano
# Last Update: November, 2023
# Turbulent model using:
# k-epsilon model
# Equilibrium + Newton wall treatement
# SIMPLE solve
##########################################################
H = 1 #halfwidth of the channel
L = 100
Re = 13700
rho = 1
bulk_u = 1
mu = '${fparse rho * bulk_u * 2 * H / Re}'
advected_interp_method = 'upwind'
pressure_tag = "pressure_grad"
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Initial and Boundary Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * bulk_u)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / (2*H)}'
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'top bottom'
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
[Mesh]
[block_1]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = 0
ymax = ${H}
nx = 4
ny = 3
bias_y = 0.7
[]
[block_2]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = ${fparse -H}
ymax = 0
nx = 4
ny = 3
bias_y = ${fparse 1/0.7}
[]
[smg]
type = StitchedMeshGenerator
inputs = 'block_1 block_2'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'bottom top'
merge_boundaries_with_same_name = true
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
velocity_interp_method = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolatorSegregated
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = ${bulk_u}
solver_sys = u_system
two_term_boundary_expansion = false
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 0
solver_sys = v_system
two_term_boundary_expansion = false
[]
[pressure]
type = INSFVPressureVariable
initial_condition = 1e-8
solver_sys = pressure_system
two_term_boundary_expansion = false
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
two_term_boundary_expansion = false
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
two_term_boundary_expansion = false
[]
[]
[FVKernels]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = no
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = no
u = vel_x
v = vel_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
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_x
function = '${bulk_u}'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_y
function = 0
[]
[walls-u]
type = FVDirichletBC
boundary = 'bottom top'
variable = vel_x
value = 0
[]
[walls-v]
type = FVDirichletBC
boundary = 'bottom top'
variable = vel_y
value = 0
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = 0
[]
[inlet_TKE]
type = FVDirichletBC
boundary = 'left'
variable = TKE
value = '${k_init}'
[]
[inlet_TKED]
type = FVDirichletBC
boundary = 'left'
variable = TKED
value = '${eps_init}'
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'bottom top'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[yplus]
type = MooseVariableFVReal
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
mu_t_ratio_max = 1e20
[]
[compute_y_plus]
type = RANSYPlusAux
variable = yplus
k = TKE
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLENonlinearAssembly
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKE_system TKED_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
turbulence_equation_relaxation = '0.2 0.2'
num_iterations = 1000
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
continue_on_max_its = true
[]
[Outputs]
csv = true
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_center_channel]
type = LineValueSampler
start_point = '${fparse 0.125 * L} ${fparse 0.0001} 0'
end_point = '${fparse 0.875 * L} ${fparse 0.0001} 0'
num_points = ${Mesh/block_1/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_quarter_radius_channel]
type = LineValueSampler
start_point = '${fparse 0.125 * L} ${fparse 0.5 * H} 0'
end_point = '${fparse 0.875 * L} ${fparse 0.5 * H} 0'
num_points = ${Mesh/block_1/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/segregated/lid-driven-turb-energy-wall.i)
##########################################################
# Lid-driven cavity test
# Reynolds: 5,000
# Author: Dr. Mauricio Tano
# Last Update: November, 2023
# Turbulent model using:
# k-epsilon model
# Standard wall functions with temperature wall functions
# SIMPLE Solve
##########################################################
### Thermophysical Properties ###
mu = 2e-5
rho = 1.0
k = 0.01
cp = 10.0
Pr_t = 0.9
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'left top right bottom'
wall_treatment_v = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
wall_treatment_T = 'eq_linearized' # Options: eq_newton, eq_incremental, eq_linearized, neq
pressure_tag = "pressure_grad"
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system energy_system TKE_system TKED_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.0
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
[]
[T_fluid]
type = INSFVEnergyVariable
solver_sys = energy_system
initial_condition = 1.0
two_term_boundary_expansion = false
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
two_term_boundary_expansion = false
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
two_term_boundary_expansion = false
[]
[]
[FVKernels]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_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
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T_fluid
[]
[temp_conduction]
type = FVDiffusion
coeff = ${k}
variable = T_fluid
[]
[temp_turb_conduction]
type = FVDiffusion
coeff = 'k_t'
variable = T_fluid
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment_v}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment_v}
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${lid_velocity}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[T_hot]
type = INSFVTurbulentTemperatureWallFunction
variable = T_fluid
boundary = 'top'
T_w = 1
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
cp = ${cp}
kappa = ${k}
k = TKE
wall_treatment = ${wall_treatment_T}
[]
[T_cold]
type = INSFVTurbulentTemperatureWallFunction
variable = T_fluid
boundary = 'bottom'
T_w = 0
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
cp = ${cp}
kappa = ${k}
k = TKE
wall_treatment = ${wall_treatment_T}
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'left right top bottom'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment_v}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[k_t]
type = MooseVariableFVReal
initial_condition = 1.0
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment_v}
execute_on = 'NONLINEAR'
[]
[compute_k_t]
type = TurbulentConductivityAux
variable = k_t
Pr_t = ${Pr_t}
cp = ${cp}
mu_t = 'mu_t'
execute_on = 'NONLINEAR'
[]
[]
[FunctorMaterials]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho}
cp = ${cp}
[]
[]
[Executioner]
type = SIMPLENonlinearAssembly
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
energy_system = 'energy_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.5
energy_equation_relaxation = 0.9
turbulence_equation_relaxation = '0.8 0.8'
num_iterations = 500
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
energy_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
energy_petsc_options_iname = '-pc_type -pc_hypre_type'
energy_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
energy_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
energy_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
continue_on_max_its = true
[]
[Outputs]
csv = true
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_left]
type = SideValueSampler
boundary = 'left'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[side_right]
type = SideValueSampler
boundary = 'right'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[horizontal_center]
type = LineValueSampler
start_point = '${fparse 0.01 * side_length} ${fparse 0.499 * side_length} 0'
end_point = '${fparse 0.99 * side_length} ${fparse 0.499 * side_length} 0'
num_points = ${Mesh/gen/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[vertical_center]
type = LineValueSampler
start_point = '${fparse 0.499 * side_length} ${fparse 0.01 * side_length} 0'
end_point = '${fparse 0.499 * side_length} ${fparse 0.99 * side_length} 0'
num_points = ${Mesh/gen/ny}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/segregated/lid-driven-turb-non-eq-wall.i)
##########################################################
# Lid-driven cavity test
# Reynolds: 5,000
# Author: Dr. Mauricio Tano
# Last Update: November, 2023
# Turbulent model using:
# Standard wall functions with non-equilibrium wall formulation
# No wall functions
# SIMPLE Solve
##########################################################
### Thermophysical Properties ###
mu = 2e-5
rho = 1.0
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'left top right bottom'
wall_treatment = 'neq' # Options: eq_newton, eq_incremental, eq_linearized, neq
pressure_tag = "pressure_grad"
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system TKE_system TKED_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.0
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
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
two_term_boundary_expansion = false
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
two_term_boundary_expansion = false
[]
[]
[FVKernels]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_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
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment}
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${lid_velocity}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'left right top bottom'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLENonlinearAssembly
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.5
turbulence_equation_relaxation = '0.8 0.8'
num_iterations = 500
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
continue_on_max_its = true
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
[]
[Outputs]
csv = true
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_left]
type = SideValueSampler
boundary = 'left'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[side_right]
type = SideValueSampler
boundary = 'right'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[horizontal_center]
type = LineValueSampler
start_point = '${fparse 0.01 * side_length} ${fparse 0.499 * side_length} 0'
end_point = '${fparse 0.99 * side_length} ${fparse 0.499 * side_length} 0'
num_points = ${Mesh/gen/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[vertical_center]
type = LineValueSampler
start_point = '${fparse 0.499 * side_length} ${fparse 0.01 * side_length} 0'
end_point = '${fparse 0.499 * side_length} ${fparse 0.99 * side_length} 0'
num_points = ${Mesh/gen/ny}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/linear-segregated-transient/channel_ERCOFTAC.i)
H = 1 #halfwidth of the channel
L = 100
Re = 13700
rho = 1
bulk_u = 1
mu = '${fparse rho * bulk_u * 2 * H / Re}'
advected_interp_method = 'upwind'
### k-epsilon Closure Parameters ###
sigma_k =1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Initial and Boundary Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * bulk_u)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / (2*H)}'
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'top bottom'
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
[Mesh]
[block_1]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = 0
ymax = ${H}
nx = 4
ny = 3
bias_y = 0.7
[]
[block_2]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = ${fparse -H}
ymax = 0
nx = 4
ny = 3
bias_y = ${fparse 1/0.7}
[]
[smg]
type = StitchedMeshGenerator
inputs = 'block_1 block_2'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'bottom top'
merge_boundaries_with_same_name = true
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = ${bulk_u}
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
initial_condition = 0
solver_sys = v_system
[]
[pressure]
type = MooseLinearVariableFVReal
initial_condition = 1e-8
solver_sys = pressure_system
[]
[TKE]
type = MooseLinearVariableFVReal
solver_sys = TKE_system
initial_condition = ${k_init}
[]
[TKED]
type = MooseLinearVariableFVReal
solver_sys = TKED_system
initial_condition = ${eps_init}
[]
[]
[LinearFVKernels]
[u_time]
type = LinearFVTimeDerivative
variable = vel_x
factor = ${rho}
[]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method = ${advected_interp_method}
mu = 'mu_t'
u = vel_x
v = vel_y
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = yes
[]
[u_diffusion]
type = LinearFVDiffusion
variable = vel_x
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_time]
type = LinearFVTimeDerivative
variable = vel_y
factor = ${rho}
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method = ${advected_interp_method}
mu = 'mu_t'
u = vel_x
v = vel_y
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = yes
[]
[v_diffusion]
type = LinearFVDiffusion
variable = vel_y
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[p_diffusion]
type = LinearFVAnisotropicDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[TKE_time]
type = LinearFVTimeDerivative
variable = TKE
factor = ${rho}
[]
[TKE_advection]
type = LinearFVTurbulentAdvection
variable = TKE
[]
[TKE_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKE
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[TKE_turb_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKE
diffusion_coeff = 'mu_t'
scaling_coeff = ${sigma_k}
use_nonorthogonal_correction = false
[]
[TKE_source_sink]
type = LinearFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
[]
[TKED_time]
type = LinearFVTimeDerivative
variable = TKED
factor = ${rho}
[]
[TKED_advection]
type = LinearFVTurbulentAdvection
variable = TKED
walls = ${walls}
[]
[TKED_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKED
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
walls = ${walls}
[]
[TKED_turb_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKED
diffusion_coeff = 'mu_t'
scaling_coeff = ${sigma_eps}
use_nonorthogonal_correction = false
walls = ${walls}
[]
[TKED_source_sink]
type = LinearFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
tke = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
[]
[]
[LinearFVBCs]
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = '${bulk_u}'
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_y
functor = '0.0'
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom'
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom'
variable = vel_y
functor = 0.0
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = vel_x
use_two_term_expansion = false
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = vel_y
use_two_term_expansion = false
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = 0.0
[]
[inlet_TKE]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKE
functor = '${k_init}'
[]
[outlet_TKE]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKE
use_two_term_expansion = false
[]
[inlet_TKED]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKED
functor = '${eps_init}'
[]
[outlet_TKED]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKED
use_two_term_expansion = false
[]
[walls_mu_t]
type = LinearFVTurbulentViscosityWallFunctionBC
boundary = 'bottom top'
variable = 'mu_t'
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
tke = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
[]
[yplus]
type = MooseLinearVariableFVReal
[]
[mu_eff]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
tke = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
mu_t_ratio_max = 1e20
[]
[compute_y_plus]
type = RANSYPlusAux
variable = yplus
tke = TKE
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[compute_mu_eff]
type = ParsedAux
variable = 'mu_eff'
coupled_variables = 'mu_t'
expression = 'mu_t + ${mu}'
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = PIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKE_system TKED_system'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_tol = 1e-14
pressure_l_tol = 1e-14
turbulence_l_tol = 1e-14
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
turbulence_equation_relaxation = '0.25 0.25'
num_iterations = 1000
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
turbulence_petsc_options_iname = '-pc_type -pc_hypre_type'
turbulence_petsc_options_value = 'hypre boomeramg'
print_fields = false
continue_on_max_its = true
dt = 1.0
num_steps = 2
[]
[Outputs]
csv = true
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_center_channel]
type = LineValueSampler
start_point = '${fparse 0.125 * L} ${fparse 0.0001} 0'
end_point = '${fparse 0.875 * L} ${fparse 0.0001} 0'
num_points = ${Mesh/block_1/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_quarter_radius_channel]
type = LineValueSampler
start_point = '${fparse 0.125 * L} ${fparse 0.5 * H} 0'
end_point = '${fparse 0.875 * L} ${fparse 0.5 * H} 0'
num_points = ${Mesh/block_1/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/bfs/linear-segregated-transient/BFS_ERCOFTAC.i)
Re = 5100
rho = 1.0
bulk_u = 1.0
H = 1.0
mu = '${fparse rho * bulk_u * H / Re}'
advected_interp_method = 'upwind'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Initial and Boundary Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * bulk_u)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / H}'
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'bottom wall-side top'
wall_treatment = 'neq' # Options: eq_newton, eq_incremental, eq_linearized, neq
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '${fparse 10.0*H} ${fparse 20.0*H}'
dy = '${H} ${fparse 5*H}'
ix = '8 16'
iy = '2 8'
subdomain_id = '
2 1
1 1
'
[]
[corner_walls]
type = SideSetsBetweenSubdomainsGenerator
input = gen
primary_block ='1'
paired_block ='2'
new_boundary = 'wall-side'
[]
[delete_bottom]
type = BlockDeletionGenerator
input = corner_walls
block ='2'
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = ${bulk_u}
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
initial_condition = 0
solver_sys = v_system
[]
[pressure]
type = MooseLinearVariableFVReal
initial_condition = 1e-8
solver_sys = pressure_system
[]
[TKE]
type = MooseLinearVariableFVReal
solver_sys = TKE_system
initial_condition = ${k_init}
[]
[TKED]
type = MooseLinearVariableFVReal
solver_sys = TKED_system
initial_condition = ${eps_init}
[]
[]
[LinearFVKernels]
[u_time]
type = LinearFVTimeDerivative
variable = vel_x
factor = ${rho}
[]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method = ${advected_interp_method}
mu = 'mu_t'
u = vel_x
v = vel_y
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = yes
[]
[u_diffusion]
type = LinearFVDiffusion
variable = vel_x
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_time]
type = LinearFVTimeDerivative
variable = vel_y
factor = ${rho}
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method = ${advected_interp_method}
mu = 'mu_t'
u = vel_x
v = vel_y
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = yes
[]
[v_diffusion]
type = LinearFVDiffusion
variable = vel_y
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[p_diffusion]
type = LinearFVAnisotropicDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[TKE_time]
type = LinearFVTimeDerivative
variable = TKE
factor = ${rho}
[]
[TKE_advection]
type = LinearFVTurbulentAdvection
variable = TKE
[]
[TKE_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKE
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[TKE_turb_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKE
diffusion_coeff = 'mu_t'
scaling_coeff = ${sigma_k}
use_nonorthogonal_correction = false
[]
[TKE_source_sink]
type = LinearFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
[]
[TKED_time]
type = LinearFVTimeDerivative
variable = TKED
factor = ${rho}
[]
[TKED_advection]
type = LinearFVTurbulentAdvection
variable = TKED
walls = ${walls}
[]
[TKED_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKED
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
walls = ${walls}
[]
[TKED_turb_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKED
diffusion_coeff = 'mu_t'
scaling_coeff = ${sigma_eps}
use_nonorthogonal_correction = false
walls = ${walls}
[]
[TKED_source_sink]
type = LinearFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
tke = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
[]
[]
[LinearFVBCs]
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = '${bulk_u}'
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_y
functor = '0.0'
[]
[inlet_TKE]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKE
functor = '${k_init}'
[]
[inlet_TKED]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKED
functor = '${eps_init}'
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = 0.0
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = vel_x
use_two_term_expansion = false
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = vel_y
use_two_term_expansion = false
[]
[outlet_TKE]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKE
use_two_term_expansion = false
[]
[outlet_TKED]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKED
use_two_term_expansion = false
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = ${walls}
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = ${walls}
variable = vel_y
functor = 0.0
[]
[walls_mu_t]
type = LinearFVTurbulentViscosityWallFunctionBC
boundary = ${walls}
variable = 'mu_t'
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
tke = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
[]
[yplus]
type = MooseLinearVariableFVReal
[]
[mu_eff]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init + mu}'
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
tke = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
mu_t_ratio_max = 1e20
[]
[compute_y_plus]
type = RANSYPlusAux
variable = yplus
tke = TKE
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[compute_mu_eff]
type = ParsedAux
variable = 'mu_eff'
coupled_variables = 'mu_t'
expression = 'mu_t + ${mu}'
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = PIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKE_system TKED_system'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_tol = 1e-14
pressure_l_tol = 1e-14
turbulence_l_tol = 1e-14
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
turbulence_equation_relaxation = '0.5 0.5'
num_iterations = 20
pressure_absolute_tolerance = 1e-6
momentum_absolute_tolerance = 1e-6
turbulence_absolute_tolerance = '1e-6 1e-6'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
turbulence_petsc_options_iname = '-pc_type -pc_hypre_type'
turbulence_petsc_options_value = 'hypre boomeramg'
print_fields = false
continue_on_max_its = true
dt = 10.0
num_steps = 10
num_piso_iterations = 2
[]
[Outputs]
csv = true
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_entry_channel_wall]
type = LineValueSampler
start_point = '${fparse 0.5 * H} ${fparse 1.00001 * H} 0'
end_point = '${fparse 29.5 * H} ${fparse 1.00001 * H} 0'
num_points = 24
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_quarter_entry_channel]
type = LineValueSampler
start_point = '${fparse 0.5 * H} ${fparse 2.25001 * H} 0'
end_point = '${fparse 29.5 * H} ${fparse 2.25001 * H} 0'
num_points = 24
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/segregated/lid-driven-turb-std-wall.i)
##########################################################
# Lid-driven cavity test
# Reynolds: 5,000
# Author: Dr. Mauricio Tano
# Last Update: November, 2023
# Turbulent model using:
# k-epsilon model
# Standard wall functions
# SIMPLE Solve
##########################################################
### Thermophysical Properties ###
mu = 1e-3
rho = 1.0
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'left top right bottom'
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
pressure_tag = "pressure_grad"
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system TKE_system TKED_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.0
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
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
two_term_boundary_expansion = false
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
two_term_boundary_expansion = false
[]
[]
[FVKernels]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
mu_interp_method = 'average'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_y
mu_interp_method = 'average'
[]
[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
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
coeff_interp_method = 'average'
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
coeff_interp_method = 'average'
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment}
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${lid_velocity}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'left right top bottom'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLENonlinearAssembly
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.5
turbulence_equation_relaxation = '0.8 0.8'
num_iterations = 500
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
continue_on_max_its = true
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
[]
[Outputs]
csv = true
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_left]
type = SideValueSampler
boundary = 'left'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[side_right]
type = SideValueSampler
boundary = 'right'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[horizontal_center]
type = LineValueSampler
start_point = '${fparse 0.01 * side_length} ${fparse 0.499 * side_length} 0'
end_point = '${fparse 0.99 * side_length} ${fparse 0.499 * side_length} 0'
num_points = ${Mesh/gen/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[vertical_center]
type = LineValueSampler
start_point = '${fparse 0.499 * side_length} ${fparse 0.01 * side_length} 0'
end_point = '${fparse 0.499 * side_length} ${fparse 0.99 * side_length} 0'
num_points = ${Mesh/gen/ny}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/segregated/lid-driven-turb-capped.i)
##########################################################
# Lid-driven cavity test
# Reynolds: 5,000
# Author: Dr. Mauricio Tano
# Last Update: November, 2023
# Turbulent model using:
# k-epsilon model with capped mixing length
# Standard wall functions
# SIMPLE Solve
##########################################################
### Thermophysical Properties ###
mu = 2e-5
rho = 1.0
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
C_pl = 0.1
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'left top right bottom'
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
pressure_tag = "pressure_grad"
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
[break_symmetries]
type = ParsedNodeTransformGenerator
input = gen
constant_names = 'side_length'
constant_expressions = '${side_length}'
x_function = 'if(x<side_length*1.001 / 2 & x > side_length * 0.999 / 2, x * 1.05, x)'
y_function = 'if(y<side_length*1.001 / 2 & y > side_length * 0.999 / 2, y * 1.05, y)'
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolatorSegregated
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
solver_sys = u_system
two_term_boundary_expansion = false
[]
[vel_y]
type = INSFVVelocityVariable
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
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
two_term_boundary_expansion = false
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
two_term_boundary_expansion = false
[]
[]
[ICs]
[vx]
type = FunctionIC
variable = vel_x
function = 'if(y>0.09, 0.1, -0.001)'
[]
[vy]
type = FunctionIC
variable = vel_y
function = 'if(x>0.05, -0.001, 0.001)'
[]
[]
[FVKernels]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_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
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C_pl = ${C_pl}
walls = ${walls}
wall_treatment = ${wall_treatment}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
C_pl = ${C_pl}
walls = ${walls}
wall_treatment = ${wall_treatment}
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${lid_velocity}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'left right top bottom'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLENonlinearAssembly
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.5
turbulence_equation_relaxation = '0.8 0.8'
num_iterations = 500
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
continue_on_max_its = true
[]
[Outputs]
csv = true
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_left]
type = SideValueSampler
boundary = 'left'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[side_right]
type = SideValueSampler
boundary = 'right'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[horizontal_center]
type = LineValueSampler
start_point = '${fparse 0.01 * side_length} ${fparse 0.499 * side_length} 0'
end_point = '${fparse 0.99 * side_length} ${fparse 0.499 * side_length} 0'
num_points = ${Mesh/gen/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[vertical_center]
type = LineValueSampler
start_point = '${fparse 0.499 * side_length} ${fparse 0.01 * side_length} 0'
end_point = '${fparse 0.499 * side_length} ${fparse 0.99 * side_length} 0'
num_points = ${Mesh/gen/ny}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/bfs/linear-segregated/BFS_ERCOFTAC.i)
Re = 5100
rho = 1.0
bulk_u = 1.0
H = 1.0
mu = '${fparse rho * bulk_u * H / Re}'
advected_interp_method = 'upwind'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Initial and Boundary Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * bulk_u)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / H}'
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'bottom wall-side top'
wall_treatment = 'eq_incremental' # Options: eq_newton, eq_incremental, eq_linearized, neq
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '${fparse 10.0*H} ${fparse 20.0*H}'
dy = '${H} ${fparse 5*H}'
ix = '8 16'
iy = '2 8'
subdomain_id = '
2 1
1 1
'
[]
[corner_walls]
type = SideSetsBetweenSubdomainsGenerator
input = gen
primary_block = '1'
paired_block = '2'
new_boundary = 'wall-side'
[]
[delete_bottom]
type = BlockDeletionGenerator
input = corner_walls
block = '2'
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = ${bulk_u}
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
initial_condition = 0
solver_sys = v_system
[]
[pressure]
type = MooseLinearVariableFVReal
initial_condition = 1e-8
solver_sys = pressure_system
[]
[TKE]
type = MooseLinearVariableFVReal
solver_sys = TKE_system
initial_condition = ${k_init}
[]
[TKED]
type = MooseLinearVariableFVReal
solver_sys = TKED_system
initial_condition = ${eps_init}
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method = ${advected_interp_method}
mu = 'mu_t'
u = vel_x
v = vel_y
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = yes
[]
[u_diffusion]
type = LinearFVDiffusion
variable = vel_x
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method = ${advected_interp_method}
mu = 'mu_t'
u = vel_x
v = vel_y
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = yes
[]
[v_diffusion]
type = LinearFVDiffusion
variable = vel_y
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[p_diffusion]
type = LinearFVAnisotropicDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[TKE_advection]
type = LinearFVTurbulentAdvection
variable = TKE
[]
[TKE_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKE
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[TKE_turb_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKE
diffusion_coeff = 'mu_t'
scaling_coeff = ${sigma_k}
use_nonorthogonal_correction = false
[]
[TKE_source_sink]
type = LinearFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
[]
[TKED_advection]
type = LinearFVTurbulentAdvection
variable = TKED
walls = ${walls}
[]
[TKED_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKED
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
walls = ${walls}
[]
[TKED_turb_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKED
diffusion_coeff = 'mu_t'
scaling_coeff = ${sigma_eps}
use_nonorthogonal_correction = false
walls = ${walls}
[]
[TKED_source_sink]
type = LinearFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
tke = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
[]
[]
[LinearFVBCs]
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = '${bulk_u}'
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_y
functor = '0.0'
[]
[inlet_TKE]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKE
functor = '${k_init}'
[]
[inlet_TKED]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKED
functor = '${eps_init}'
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = 0.0
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = vel_x
use_two_term_expansion = false
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = vel_y
use_two_term_expansion = false
[]
[outlet_TKE]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKE
use_two_term_expansion = false
[]
[outlet_TKED]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKED
use_two_term_expansion = false
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = ${walls}
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = ${walls}
variable = vel_y
functor = 0.0
[]
[walls_mu_t]
type = LinearFVTurbulentViscosityWallFunctionBC
boundary = ${walls}
variable = 'mu_t'
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
tke = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
[]
[yplus]
type = MooseLinearVariableFVReal
[]
[mu_eff]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init + mu}'
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
tke = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
mu_t_ratio_max = 1e20
[]
[compute_y_plus]
type = RANSYPlusAux
variable = yplus
tke = TKE
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[compute_mu_eff]
type = ParsedAux
variable = 'mu_eff'
coupled_variables = 'mu_t'
expression = 'mu_t + ${mu}'
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKE_system TKED_system'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_tol = 1e-14
pressure_l_tol = 1e-14
turbulence_l_tol = 1e-14
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
turbulence_equation_relaxation = '0.5 0.5'
num_iterations = 1000
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
turbulence_petsc_options_iname = '-pc_type -pc_hypre_type'
turbulence_petsc_options_value = 'hypre boomeramg'
print_fields = false
continue_on_max_its = true
[]
[Outputs]
csv = true
[console]
type = Console
outlier_variable_norms = false
[]
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_entry_channel_wall]
type = LineValueSampler
start_point = '${fparse 0.5 * H} ${fparse 1.00001 * H} 0'
end_point = '${fparse 29.5 * H} ${fparse 1.00001 * H} 0'
num_points = 24
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_quarter_entry_channel]
type = LineValueSampler
start_point = '${fparse 0.5 * H} ${fparse 2.25001 * H} 0'
end_point = '${fparse 29.5 * H} ${fparse 2.25001 * H} 0'
num_points = 24
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/bfs/segregated/BFS_ERCOFTAC.i)
##########################################################
# ERCOFTAC test case foe BFS
# Case Number: 031
# Author: Dr. Mauricio Tano
# Last Update: November, 2023
# Turbulent model using:
# k-epsilon model
# Equilibrium + Newton wall treatement
# SIMPLE solve
##########################################################
Re = 5100
rho = 1.0
bulk_u = 1.0
H = 1.0
mu = '${fparse rho * bulk_u * H/ Re}'
advected_interp_method = 'upwind'
pressure_tag = "pressure_grad"
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Initial and Boundary Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * bulk_u)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / H}'
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'bottom wall-side top'
wall_treatment = 'eq_incremental' # Options: eq_newton, eq_incremental, eq_linearized, neq
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '${fparse 10.0*H} ${fparse 20.0*H}'
dy = '${H} ${fparse 5*H}'
ix = '8 16'
iy = '2 8'
subdomain_id = '
2 1
1 1
'
[]
[corner_walls]
type = SideSetsBetweenSubdomainsGenerator
input = gen
primary_block ='1'
paired_block ='2'
new_boundary = 'wall-side'
[]
[delete_bottom]
type = BlockDeletionGenerator
input = corner_walls
block ='2'
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
velocity_interp_method = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolatorSegregated
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = ${bulk_u}
solver_sys = u_system
two_term_boundary_expansion = false
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 0
solver_sys = v_system
two_term_boundary_expansion = false
[]
[pressure]
type = INSFVPressureVariable
initial_condition = 1e-8
solver_sys = pressure_system
two_term_boundary_expansion = false
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
two_term_boundary_expansion = false
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
two_term_boundary_expansion = false
[]
[]
[FVKernels]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_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
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
tke = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment}
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_x
functor = '${bulk_u}'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_y
functor = 0
[]
[inlet_TKE]
type = INSFVInletIntensityTKEBC
boundary = 'left'
variable = TKE
u = vel_x
v = vel_y
intensity = ${intensity}
[]
[inlet_TKED]
type = INSFVMixingLengthTKEDBC
boundary = 'left'
variable = TKED
tke = TKE
characteristic_length = '${fparse 2*H}'
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
functor = 0
[]
[walls-u]
type = FVDirichletBC
boundary = ${walls}
variable = vel_x
value = 0
[]
[walls-v]
type = FVDirichletBC
boundary = ${walls}
variable = vel_y
value = 0
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = ${walls}
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
tke = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
tke = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLENonlinearAssembly
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
turbulence_equation_relaxation = '0.3 0.3'
num_iterations = 500
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
continue_on_max_its = true
[]
[Outputs]
csv = true
[console]
type = Console
outlier_variable_norms = false
[]
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_entry_channel_wall]
type = LineValueSampler
start_point = '${fparse 0.5 * H} ${fparse 1.00001 * H} 0'
end_point = '${fparse 29.5 * H} ${fparse 1.00001 * H} 0'
num_points = 24
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_quarter_entry_channel]
type = LineValueSampler
start_point = '${fparse 0.5 * H} ${fparse 2.25001 * H} 0'
end_point = '${fparse 29.5 * H} ${fparse 2.25001 * H} 0'
num_points = 24
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/segregated/lid-driven-turb-energy.i)
##########################################################
# Lid-driven cavity test
# Reynolds: 5,000
# Author: Dr. Mauricio Tano
# Last Update: November, 2023
# Turbulent model using:
# k-epsilon model with energy transport
# Standard wall functions without temperature wall functions
# SIMPLE Solve
##########################################################
### Thermophysical Properties ###
mu = 2e-5
rho = 1.0
k = 0.01
cp = 10.0
Pr_t = 0.9
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'left top right bottom'
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
pressure_tag = "pressure_grad"
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system energy_system TKE_system TKED_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.0
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
[]
[T_fluid]
type = INSFVEnergyVariable
solver_sys = energy_system
initial_condition = 1.0
two_term_boundary_expansion = false
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
two_term_boundary_expansion = false
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
two_term_boundary_expansion = false
[]
[]
[FVKernels]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_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
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T_fluid
[]
[temp_conduction]
type = FVDiffusion
coeff = ${k}
variable = T_fluid
[]
[temp_turb_conduction]
type = FVDiffusion
coeff = 'k_t'
variable = T_fluid
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment}
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${lid_velocity}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[T_hot]
type = FVDirichletBC
variable = T_fluid
boundary = 'top'
value = 1
[]
[T_cold]
type = FVDirichletBC
variable = T_fluid
boundary = 'bottom'
value = 0
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'left right top bottom'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[]
[FunctorMaterials]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho}
cp = ${cp}
[]
[k_t]
type = ADParsedFunctorMaterial
expression = 'mu_t * cp / Pr_t'
functor_names = 'mu_t ${cp} ${Pr_t}'
functor_symbols = 'mu_t cp Pr_t'
property_name = 'k_t'
[]
[]
[Executioner]
type = SIMPLENonlinearAssembly
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
energy_system = 'energy_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.5
energy_equation_relaxation = 0.9
turbulence_equation_relaxation = '0.8 0.8'
num_iterations = 500
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
energy_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
energy_petsc_options_iname = '-pc_type -pc_hypre_type'
energy_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
energy_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
energy_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
continue_on_max_its = true
[]
[Outputs]
csv = true
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_left]
type = SideValueSampler
boundary = 'left'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[side_right]
type = SideValueSampler
boundary = 'right'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[horizontal_center]
type = LineValueSampler
start_point = '${fparse 0.01 * side_length} ${fparse 0.499 * side_length} 0'
end_point = '${fparse 0.99 * side_length} ${fparse 0.499 * side_length} 0'
num_points = ${Mesh/gen/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[vertical_center]
type = LineValueSampler
start_point = '${fparse 0.499 * side_length} ${fparse 0.01 * side_length} 0'
end_point = '${fparse 0.499 * side_length} ${fparse 0.99 * side_length} 0'
num_points = ${Mesh/gen/ny}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/segregated/lid-driven-turb-inc-wall.i)
##########################################################
# Lid-driven cavity test
# Reynolds: 5,000
# Author: Dr. Mauricio Tano
# Last Update: November, 2023
# Turbulent model using:
# k-epsilon model
# Incremental wall function formulation (similar to OpenFOAM)
# SIMPLE Solve
##########################################################
### Thermophysical Properties ###
mu = 2e-5
rho = 1.0
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'left top right bottom'
wall_treatment = 'eq_incremental' # Options: eq_newton, eq_incremental, eq_linearized, neq
pressure_tag = "pressure_grad"
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system TKE_system TKED_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.0
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
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
two_term_boundary_expansion = false
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
two_term_boundary_expansion = false
[]
[]
[FVKernels]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_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
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment}
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${lid_velocity}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'left right top bottom'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLENonlinearAssembly
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.5
turbulence_equation_relaxation = '0.8 0.8'
num_iterations = 500
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
continue_on_max_its = true
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
[]
[Outputs]
csv = true
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_left]
type = SideValueSampler
boundary = 'left'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[side_right]
type = SideValueSampler
boundary = 'right'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[horizontal_center]
type = LineValueSampler
start_point = '${fparse 0.01 * side_length} ${fparse 0.499 * side_length} 0'
end_point = '${fparse 0.99 * side_length} ${fparse 0.499 * side_length} 0'
num_points = ${Mesh/gen/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[vertical_center]
type = LineValueSampler
start_point = '${fparse 0.499 * side_length} ${fparse 0.01 * side_length} 0'
end_point = '${fparse 0.499 * side_length} ${fparse 0.99 * side_length} 0'
num_points = ${Mesh/gen/ny}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/segregated/lid-driven-turb-linear-wall.i)
##########################################################
# Lid-driven cavity test
# Reynolds: 5,000
# Author: Dr. Mauricio Tano
# Last Update: November, 2023
# Turbulent model using:
# k-epsilon model
# Linear wall function formulation (faster runs)
# SIMPLE Solve
##########################################################
### Thermophysical Properties ###
mu = 2e-5
rho = 1.0
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'left top right bottom'
wall_treatment = 'eq_linearized' # Options: eq_newton, eq_incremental, eq_linearized, neq
pressure_tag = "pressure_grad"
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system TKE_system TKED_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.0
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
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
two_term_boundary_expansion = false
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
two_term_boundary_expansion = false
[]
[]
[FVKernels]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_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
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment}
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${lid_velocity}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'left right top bottom'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLENonlinearAssembly
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.5
turbulence_equation_relaxation = '0.8 0.8'
num_iterations = 500
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
continue_on_max_its = true
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
[]
[Outputs]
csv = true
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_left]
type = SideValueSampler
boundary = 'left'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[side_right]
type = SideValueSampler
boundary = 'right'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[horizontal_center]
type = LineValueSampler
start_point = '${fparse 0.01 * side_length} ${fparse 0.499 * side_length} 0'
end_point = '${fparse 0.99 * side_length} ${fparse 0.499 * side_length} 0'
num_points = ${Mesh/gen/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[vertical_center]
type = LineValueSampler
start_point = '${fparse 0.499 * side_length} ${fparse 0.01 * side_length} 0'
end_point = '${fparse 0.499 * side_length} ${fparse 0.99 * side_length} 0'
num_points = ${Mesh/gen/ny}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/linear-segregated/lid-driven-turb-std-wall.i)
### Thermophysical Properties ###
mu = 1e-3
rho = 1.0
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'left top right bottom'
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = ${lid_velocity}
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
initial_condition = 0
solver_sys = v_system
[]
[pressure]
type = MooseLinearVariableFVReal
initial_condition = 1e-8
solver_sys = pressure_system
[]
[TKE]
type = MooseLinearVariableFVReal
solver_sys = TKE_system
initial_condition = ${k_init}
[]
[TKED]
type = MooseLinearVariableFVReal
solver_sys = TKED_system
initial_condition = ${eps_init}
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
mu = 'mu_t'
u = vel_x
v = vel_y
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = true
use_deviatoric_terms = yes
[]
[u_diffusion]
type = LinearFVDiffusion
variable = vel_x
diffusion_coeff = ${mu}
use_nonorthogonal_correction = true
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
mu = 'mu_t'
u = vel_x
v = vel_y
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = true
use_deviatoric_terms = yes
[]
[v_diffusion]
type = LinearFVDiffusion
variable = vel_y
diffusion_coeff = ${mu}
use_nonorthogonal_correction = true
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[p_diffusion]
type = LinearFVAnisotropicDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = true
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[TKE_advection]
type = LinearFVTurbulentAdvection
variable = TKE
[]
[TKE_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKE
diffusion_coeff = ${mu}
use_nonorthogonal_correction = true
[]
[TKE_turb_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKE
diffusion_coeff = 'mu_t'
scaling_coeff = ${sigma_k}
use_nonorthogonal_correction = true
[]
[TKE_source_sink]
type = LinearFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
[]
[TKED_advection]
type = LinearFVTurbulentAdvection
variable = TKED
walls = ${walls}
[]
[TKED_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKED
diffusion_coeff = ${mu}
use_nonorthogonal_correction = true
walls = ${walls}
[]
[TKED_turb_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKED
diffusion_coeff = 'mu_t'
scaling_coeff = ${sigma_eps}
use_nonorthogonal_correction = true
walls = ${walls}
[]
[TKED_source_sink]
type = LinearFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
tke = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
[]
[]
[LinearFVBCs]
[top_x]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_x
boundary = 'top'
functor = 1
[]
[no_slip_x]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_x
boundary = 'left right bottom'
functor = 0
[]
[no_slip_y]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_y
boundary = 'left right top bottom'
functor = 0
[]
[pressure-extrapolation]
type = LinearFVExtrapolatedPressureBC
boundary = 'left right top bottom'
variable = pressure
use_two_term_expansion = true
[]
[walls_mu_t]
type = LinearFVTurbulentViscosityWallFunctionBC
boundary = ${walls}
variable = 'mu_t'
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
tke = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
[]
[yplus]
type = MooseLinearVariableFVReal
[]
[mu_eff]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
tke = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
mu_t_ratio_max = 1e20
[]
[compute_y_plus]
type = RANSYPlusAux
variable = yplus
tke = TKE
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[compute_mu_eff]
type = ParsedAux
variable = 'mu_eff'
coupled_variables = 'mu_t'
expression = 'mu_t + ${mu}'
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKE_system TKED_system'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_tol = 1e-14
pressure_l_tol = 1e-14
turbulence_l_tol = 1e-14
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
turbulence_equation_relaxation = '0.5 0.5'
num_iterations = 1000
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
turbulence_petsc_options_iname = '-pc_type -pc_hypre_type'
turbulence_petsc_options_value = 'hypre boomeramg'
print_fields = false
continue_on_max_its = true
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
[]
[Outputs]
csv = true
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_left]
type = SideValueSampler
boundary = 'left'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[side_right]
type = SideValueSampler
boundary = 'right'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[horizontal_center]
type = LineValueSampler
start_point = '${fparse 0.01 * side_length} ${fparse 0.499 * side_length} 0'
end_point = '${fparse 0.99 * side_length} ${fparse 0.499 * side_length} 0'
num_points = ${Mesh/gen/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[vertical_center]
type = LineValueSampler
start_point = '${fparse 0.499 * side_length} ${fparse 0.01 * side_length} 0'
end_point = '${fparse 0.499 * side_length} ${fparse 0.99 * side_length} 0'
num_points = ${Mesh/gen/ny}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/block-restricted/block-ke.i)
H = 1 #halfwidth of the channel
L = 100
Re = 13700
rho = 1
bulk_u = 1
mu = '${fparse rho * bulk_u * 2 * H / Re}'
advected_interp_method = 'upwind'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Initial and Boundary Conditions ###
intensity = '${fparse 0.16*Re^(-1./8.)}'
k_init = '${fparse 1.5*(intensity * bulk_u)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / (2*H)}'
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'walls'
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
[Mesh]
[block_left]
type = GeneratedMeshGenerator
dim = 2
xmin = '${fparse -2*H}'
xmax = '${fparse -H}'
ymin = 0
ymax = ${L}
nx = 3
ny = 4
[]
[block_1]
type = GeneratedMeshGenerator
dim = 2
xmin = '${fparse -H}'
xmax = 0
ymin = 0
ymax = ${L}
nx = 4
ny = 4
bias_x = '${fparse 1/0.7}'
[]
[block_2]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${H}
ymin = 0
ymax = ${L}
nx = 4
ny = 4
bias_x = 0.7
[]
[block_right]
type = GeneratedMeshGenerator
dim = 2
xmin = ${H}
xmax = '${fparse 2*H}'
ymin = 0
ymax = ${L}
nx = 3
ny = 4
[]
[smg]
type = StitchedMeshGenerator
inputs = 'block_left block_1 block_2 block_right'
stitch_boundaries_pairs = 'right left; right left; right left'
[]
[middle]
input = smg
type = SubdomainBoundingBoxGenerator
block_id = 1
bottom_left = '${fparse -H} 0 0'
top_right = '${H} ${L} 50'
[]
[walls]
type = SideSetsBetweenSubdomainsGenerator
primary_block = 1
paired_block = 0
new_boundary = walls
input = middle
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
block = 1
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 0.0
solver_sys = u_system
block = 1
[]
[vel_y]
type = MooseLinearVariableFVReal
initial_condition = ${bulk_u}
solver_sys = v_system
block = 1
[]
[pressure]
type = MooseLinearVariableFVReal
initial_condition = 1e-8
solver_sys = pressure_system
block = 1
[]
[TKE]
type = MooseLinearVariableFVReal
solver_sys = TKE_system
initial_condition = ${k_init}
block = 1
[]
[TKED]
type = MooseLinearVariableFVReal
solver_sys = TKED_system
initial_condition = ${eps_init}
block = 1
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method = ${advected_interp_method}
mu = 'mu_t'
u = vel_x
v = vel_y
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = yes
[]
[u_diffusion]
type = LinearFVDiffusion
variable = vel_x
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method = ${advected_interp_method}
mu = 'mu_t'
u = vel_x
v = vel_y
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = yes
[]
[v_diffusion]
type = LinearFVDiffusion
variable = vel_y
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[p_diffusion]
type = LinearFVAnisotropicDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[TKE_advection]
type = LinearFVTurbulentAdvection
variable = TKE
[]
[TKE_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKE
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[TKE_turb_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKE
diffusion_coeff = 'mu_t'
scaling_coeff = ${sigma_k}
use_nonorthogonal_correction = false
[]
[TKE_source_sink]
type = LinearFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
[]
[TKED_advection]
type = LinearFVTurbulentAdvection
variable = TKED
walls = ${walls}
[]
[TKED_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKED
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
walls = ${walls}
[]
[TKED_turb_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKED
diffusion_coeff = 'mu_t'
scaling_coeff = ${sigma_eps}
use_nonorthogonal_correction = false
walls = ${walls}
[]
[TKED_source_sink]
type = LinearFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
tke = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
[]
[]
[LinearFVBCs]
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'bottom'
variable = vel_x
functor = 0
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'bottom'
variable = vel_y
functor = '${bulk_u}'
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'walls'
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'walls'
variable = vel_y
functor = 0.0
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'top'
variable = vel_x
use_two_term_expansion = false
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'top'
variable = vel_y
use_two_term_expansion = false
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top'
variable = pressure
functor = 0.0
[]
[inlet_TKE]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'bottom'
variable = TKE
functor = '${k_init}'
[]
[outlet_TKE]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'top'
variable = TKE
use_two_term_expansion = false
[]
[inlet_TKED]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'bottom'
variable = TKED
functor = '${eps_init}'
[]
[outlet_TKED]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'top'
variable = TKED
use_two_term_expansion = false
[]
[walls_mu_t]
type = LinearFVTurbulentViscosityWallFunctionBC
boundary = 'walls'
variable = 'mu_t'
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
tke = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
block = 1
[]
[yplus]
type = MooseLinearVariableFVReal
block = 1
[]
[mu_eff]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
block = 1
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
tke = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
mu_t_ratio_max = 1e20
[]
[compute_y_plus]
type = RANSYPlusAux
variable = yplus
tke = TKE
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[compute_mu_eff]
type = ParsedAux
variable = 'mu_eff'
coupled_variables = 'mu_t'
expression = 'mu_t + ${mu}'
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKE_system TKED_system'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_tol = 1e-14
pressure_l_tol = 1e-14
turbulence_l_tol = 1e-14
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
turbulence_equation_relaxation = '0.2 0.2'
turbulence_field_relaxation = '0.2 0.2'
num_iterations = 1000
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
turbulence_petsc_options_iname = '-pc_type -pc_hypre_type'
turbulence_petsc_options_value = 'hypre boomeramg'
print_fields = false
continue_on_max_its = true
[]
[Outputs]
exodus = true
execute_on = timestep_end
csv = true
[]
[VectorPostprocessors]
[line_wall]
type = LineValueSampler
start_point = '${fparse 0.99 * H} ${fparse 0.125 * L} 0'
end_point = '${fparse 0.99 * H} ${fparse 0.875 * L} 0'
num_points = ${Mesh/block_1/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_center_channel]
type = LineValueSampler
start_point = ' ${fparse 0.0001 * H} ${fparse 0.125 * L} 0'
end_point = '${fparse 0.0001 * H} ${fparse 0.875 * L} 0'
num_points = ${Mesh/block_1/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_quarter_radius_channel]
type = LineValueSampler
start_point = '${fparse 0.51 * H} ${fparse 0.125 * L} 0'
end_point = '${fparse 0.51 * H} ${fparse 0.875 * L} 0'
num_points = ${Mesh/block_1/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/segregated/lid-driven-turb-non-eq-bulk.i)
##########################################################
# Lid-driven cavity test
# Reynolds: 5,000
# Author: Dr. Mauricio Tano
# Last Update: November, 2023
# Turbulent model using:
# Standard wall functions with non-equilibrium bulk formaultion
# No wall functions
# SIMPLE Solve
##########################################################
### Thermophysical Properties ###
mu = 2e-5
rho = 1.0
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'left top right bottom'
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
pressure_tag = "pressure_grad"
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system TKE_system TKED_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.0
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
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
two_term_boundary_expansion = false
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
two_term_boundary_expansion = false
[]
[]
[FVKernels]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_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
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment}
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${lid_velocity}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'left right top bottom'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLENonlinearAssembly
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.5
turbulence_equation_relaxation = '0.8 0.8'
num_iterations = 500
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
continue_on_max_its = true
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
[]
[Outputs]
csv = true
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_left]
type = SideValueSampler
boundary = 'left'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[side_right]
type = SideValueSampler
boundary = 'right'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[horizontal_center]
type = LineValueSampler
start_point = '${fparse 0.01 * side_length} ${fparse 0.499 * side_length} 0'
end_point = '${fparse 0.99 * side_length} ${fparse 0.499 * side_length} 0'
num_points = ${Mesh/gen/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[vertical_center]
type = LineValueSampler
start_point = '${fparse 0.499 * side_length} ${fparse 0.01 * side_length} 0'
end_point = '${fparse 0.499 * side_length} ${fparse 0.99 * side_length} 0'
num_points = ${Mesh/gen/ny}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/segregated/lid-driven-turb-no-wall.i)
##########################################################
# Lid-driven cavity test
# Reynolds: 5,000
# Author: Dr. Mauricio Tano
# Last Update: November, 2023
# Turbulent model using:
# k-epsilon model
# No wall functions
# SIMPLE Solve
##########################################################
### Thermophysical Properties ###
mu = 2e-5
rho = 1.0
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
bulk_wall_treatment = false
walls = ''
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
pressure_tag = "pressure_grad"
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system TKE_system TKED_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.0
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
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
two_term_boundary_expansion = false
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
two_term_boundary_expansion = false
[]
[]
[FVKernels]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[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_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_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
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
k = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment}
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${lid_velocity}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'left right top bottom'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
wall_treatment = ${wall_treatment}
[]
[walls_TKED]
type = INSFVTKEDWallFunctionBC
boundary = 'left right top bottom'
variable = TKED
u = vel_x
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
k = TKE
[]
[walls_TKE]
type = FVDirichletBC
boundary = 'left right top bottom'
variable = TKE
value = ${k_init}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
k = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLENonlinearAssembly
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.5
turbulence_equation_relaxation = '0.9 0.9'
num_iterations = 1000
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
continue_on_max_its = true
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
[]
[Outputs]
csv = true
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_left]
type = SideValueSampler
boundary = 'left'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[side_right]
type = SideValueSampler
boundary = 'right'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[horizontal_center]
type = LineValueSampler
start_point = '${fparse 0.01 * side_length} ${fparse 0.499 * side_length} 0'
end_point = '${fparse 0.99 * side_length} ${fparse 0.499 * side_length} 0'
num_points = ${Mesh/gen/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[vertical_center]
type = LineValueSampler
start_point = '${fparse 0.499 * side_length} ${fparse 0.01 * side_length} 0'
end_point = '${fparse 0.499 * side_length} ${fparse 0.99 * side_length} 0'
num_points = ${Mesh/gen/ny}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/linear-segregated/lid-driven-turb-non-eq-wall.i)
### Thermophysical Properties ###
mu = 1e-3
rho = 1.0
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'left top right bottom'
wall_treatment = 'neq' # Options: eq_newton, eq_incremental, eq_linearized, neq
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = ${lid_velocity}
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
initial_condition = 0
solver_sys = v_system
[]
[pressure]
type = MooseLinearVariableFVReal
initial_condition = 1e-8
solver_sys = pressure_system
[]
[TKE]
type = MooseLinearVariableFVReal
solver_sys = TKE_system
initial_condition = ${k_init}
[]
[TKED]
type = MooseLinearVariableFVReal
solver_sys = TKED_system
initial_condition = ${eps_init}
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
mu = 'mu_t'
u = vel_x
v = vel_y
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = yes
[]
[u_diffusion]
type = LinearFVDiffusion
variable = vel_x
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
mu = 'mu_t'
u = vel_x
v = vel_y
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = yes
[]
[v_diffusion]
type = LinearFVDiffusion
variable = vel_y
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[p_diffusion]
type = LinearFVAnisotropicDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[TKE_advection]
type = LinearFVTurbulentAdvection
variable = TKE
[]
[TKE_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKE
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[TKE_turb_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKE
diffusion_coeff = 'mu_t'
scaling_coeff = ${sigma_k}
use_nonorthogonal_correction = false
[]
[TKE_source_sink]
type = LinearFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
[]
[TKED_advection]
type = LinearFVTurbulentAdvection
variable = TKED
walls = ${walls}
[]
[TKED_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKED
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
walls = ${walls}
[]
[TKED_turb_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKED
diffusion_coeff = 'mu_t'
scaling_coeff = ${sigma_eps}
use_nonorthogonal_correction = false
walls = ${walls}
[]
[TKED_source_sink]
type = LinearFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
tke = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
[]
[]
[LinearFVBCs]
[top_x]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_x
boundary = 'top'
functor = 1
[]
[no_slip_x]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_x
boundary = 'left right bottom'
functor = 0
[]
[no_slip_y]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_y
boundary = 'left right top bottom'
functor = 0
[]
[pressure-extrapolation]
type = LinearFVExtrapolatedPressureBC
boundary = 'left right top bottom'
variable = pressure
use_two_term_expansion = true
[]
[walls_mu_t]
type = LinearFVTurbulentViscosityWallFunctionBC
boundary = 'bottom top'
variable = 'mu_t'
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
tke = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
[]
[yplus]
type = MooseLinearVariableFVReal
[]
[mu_eff]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
tke = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
mu_t_ratio_max = 1e20
[]
[compute_y_plus]
type = RANSYPlusAux
variable = yplus
tke = TKE
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[compute_mu_eff]
type = ParsedAux
variable = 'mu_eff'
coupled_variables = 'mu_t'
expression = 'mu_t + ${mu}'
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKE_system TKED_system'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_tol = 1e-14
pressure_l_tol = 1e-14
turbulence_l_tol = 1e-14
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
turbulence_equation_relaxation = '0.5 0.5'
num_iterations = 1000
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
turbulence_petsc_options_iname = '-pc_type -pc_hypre_type'
turbulence_petsc_options_value = 'hypre boomeramg'
print_fields = false
continue_on_max_its = true
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
[]
[Outputs]
csv = true
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_left]
type = SideValueSampler
boundary = 'left'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[side_right]
type = SideValueSampler
boundary = 'right'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[horizontal_center]
type = LineValueSampler
start_point = '${fparse 0.01 * side_length} ${fparse 0.499 * side_length} 0'
end_point = '${fparse 0.99 * side_length} ${fparse 0.499 * side_length} 0'
num_points = ${Mesh/gen/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[vertical_center]
type = LineValueSampler
start_point = '${fparse 0.499 * side_length} ${fparse 0.01 * side_length} 0'
end_point = '${fparse 0.499 * side_length} ${fparse 0.99 * side_length} 0'
num_points = ${Mesh/gen/ny}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/linear-segregated/channel_ERCOFTAC.i)
H = 1 #halfwidth of the channel
L = 100
Re = 13700
rho = 1
bulk_u = 1
mu = '${fparse rho * bulk_u * 2 * H / Re}'
advected_interp_method = 'upwind'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Initial and Boundary Conditions ###
intensity = ${fparse 0.16*Re^(-1./8.)}
k_init = '${fparse 1.5*(intensity * bulk_u)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / (2*H)}'
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'top bottom'
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
[Mesh]
[block_1]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = 0
ymax = ${H}
nx = 4
ny = 4
bias_y = 0.7
[]
[block_2]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = ${fparse -H}
ymax = 0
nx = 4
ny = 4
bias_y = ${fparse 1/0.7}
[]
[smg]
type = StitchedMeshGenerator
inputs = 'block_1 block_2'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'bottom top'
merge_boundaries_with_same_name = true
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = ${bulk_u}
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
initial_condition = 0
solver_sys = v_system
[]
[pressure]
type = MooseLinearVariableFVReal
initial_condition = 1e-8
solver_sys = pressure_system
[]
[TKE]
type = MooseLinearVariableFVReal
solver_sys = TKE_system
initial_condition = ${k_init}
[]
[TKED]
type = MooseLinearVariableFVReal
solver_sys = TKED_system
initial_condition = ${eps_init}
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method = ${advected_interp_method}
mu = 'mu_t'
u = vel_x
v = vel_y
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = yes
[]
[u_diffusion]
type = LinearFVDiffusion
variable = vel_x
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method = ${advected_interp_method}
mu = 'mu_t'
u = vel_x
v = vel_y
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = yes
[]
[v_diffusion]
type = LinearFVDiffusion
variable = vel_y
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[p_diffusion]
type = LinearFVAnisotropicDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[TKE_advection]
type = LinearFVTurbulentAdvection
variable = TKE
[]
[TKE_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKE
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[TKE_turb_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKE
diffusion_coeff = 'mu_t'
scaling_coeff = ${sigma_k}
use_nonorthogonal_correction = false
[]
[TKE_source_sink]
type = LinearFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
[]
[TKED_advection]
type = LinearFVTurbulentAdvection
variable = TKED
walls = ${walls}
[]
[TKED_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKED
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
walls = ${walls}
[]
[TKED_turb_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKED
diffusion_coeff = 'mu_t'
scaling_coeff = ${sigma_eps}
use_nonorthogonal_correction = false
walls = ${walls}
[]
[TKED_source_sink]
type = LinearFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
tke = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
[]
[]
[LinearFVBCs]
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = '${bulk_u}'
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_y
functor = '0.0'
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom'
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom'
variable = vel_y
functor = 0.0
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = vel_x
use_two_term_expansion = false
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = vel_y
use_two_term_expansion = false
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = 0.0
[]
[inlet_TKE]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKE
functor = '${k_init}'
[]
[outlet_TKE]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKE
use_two_term_expansion = false
[]
[inlet_TKED]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKED
functor = '${eps_init}'
[]
[outlet_TKED]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKED
use_two_term_expansion = false
[]
[walls_mu_t]
type = LinearFVTurbulentViscosityWallFunctionBC
boundary = 'bottom top'
variable = 'mu_t'
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
tke = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
[]
[yplus]
type = MooseLinearVariableFVReal
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
tke = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
mu_t_ratio_max = 1e20
[]
[compute_y_plus]
type = RANSYPlusAux
variable = yplus
tke = TKE
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKE_system TKED_system'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_tol = 1e-14
pressure_l_tol = 1e-14
turbulence_l_tol = 1e-14
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
turbulence_equation_relaxation = '0.2 0.2'
turbulence_field_relaxation = '0.2 0.2'
num_iterations = 1000
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
turbulence_petsc_options_iname = '-pc_type -pc_hypre_type'
turbulence_petsc_options_value = 'hypre boomeramg'
print_fields = false
continue_on_max_its = true
[]
[Outputs]
csv = true
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_center_channel]
type = LineValueSampler
start_point = '${fparse 0.125 * L} ${fparse 0.0001} 0'
end_point = '${fparse 0.875 * L} ${fparse 0.0001} 0'
num_points = ${Mesh/block_1/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_quarter_radius_channel]
type = LineValueSampler
start_point = '${fparse 0.125 * L} ${fparse 0.5 * H} 0'
end_point = '${fparse 0.875 * L} ${fparse 0.5 * H} 0'
num_points = ${Mesh/block_1/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[]