kEpsilonTKEDSourceSink
kEpsilonTKEDSourceSink is a finite volume elemental kernel that computes the turbulent source and sink terms for the -equation in the k– family of models. Together with kEpsilonTKESourceSink and kEpsilonViscosity, it forms the full set of transport and closure relations for the k– turbulence models implemented in OpenPronghorn.
commentnote
The explanations in this kernel documentation are a summary. The reader is referred to the theory for more details if needed.
The -equation is written in conservative form as
where
is the turbulent dissipation rate,
is the mean velocity,
is the assembled production-side term for the -equation (shear, buoyancy, nonlinear production, and any variant-specific corrections such as Yap or the low-Re term),
is the destruction term proportional to .
Some references split the right-hand side as . In OpenPronghorn we fold any additional sources/corrections that would fall under directly into , so the kernel assembles a single production term.
In the implementation, kEpsilonTKEDSourceSink forms the -source term as where and depend on the selected k– variant and damping model.
(test/tests/kEpsilon/special-cases/channel_ERCOFTAC.i)
##########################################################
# ERCOFTAC test case for turbulent channel flow
# Case Number: 032
# Author: Dr. Mauricio Tano & Hailey Tran Kieu
# Last Update: November, 2023 & 2025
# Turbulent model using:
# k-epsilon
# Equilibrium + Newton wall treatment
# SIMPLE solve
##########################################################
### Problem Parameters ###
H = 1 # half-width of the channel
L = 120
Re = 14000
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 = 'bottom top'
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
# NOTE:
# The k-epsilon kernels/aux-kernels now include strict parameter applicability
# checks. To keep this input file usable across all test permutations, we do
# *not* hard-code model-variant-specific options here. Instead, the test harness
# sets per-object options via CLI overrides (see create_tests.py).
[Mesh]
[block_1]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = 0
ymax = ${H}
nx = 10
ny = 5
bias_y = 0.7
[]
[block_2]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = ${fparse -H}
ymax = 0
nx = 10
ny = 5
bias_y = ${fparse 1/0.7}
[]
[smg]
type = StitchMeshGenerator
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
pressure_projection_method = 'consistent'
[]
[]
[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}'
[]
[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}'
[]
[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 = kEpsilonTKESourceSink
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 = kEpsilonTKEDSourceSink
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 = MooseVariableFVReal
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosity
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}
mu_t_ratio_max = 1e20
execute_on = 'NONLINEAR'
[]
[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-7
momentum_absolute_tolerance = 1e-7
turbulence_absolute_tolerance = '1e-7 1e-7'
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'
momentum_l_max_its = 300
pressure_l_max_its = 300
turbulence_l_max_its = 30
print_fields = false
continue_on_max_its = true
[]
[Outputs]
exodus = false
[csv]
type = CSV
execute_on = FINAL
[]
[]
variables_to_sample = 'vel_x vel_y pressure TKE TKED'
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = ${variables_to_sample}
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = ${variables_to_sample}
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 = ${variables_to_sample}
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 = ${variables_to_sample}
sort_by = 'x'
execute_on = 'timestep_end'
[]
[]
(validation/free_flow/isothermal/ercoftac_030_bfs/bfs_input.i)
########################################################################
# BFS simulation
########################################################################
# Modeling Parameters
rho = 1.18415
bulk_u = 44.2
D = 0.1016
mu = 1.8551e-5
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
walls = 'wall'
wall_treatment = 'neq' # Options: eq_newton, eq_incremental, eq_linearized, neq
### 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 / D}'
### Postprocessing
y_first_cell_1 = 5e-4
y_first_cell_2 = ${fparse (0.0127 - 0.0119) / 2}
# Turbulence-model knobs (optional)
k_epsilon_variant = 'Standard' # Standard | StandardLowRe | StandardTwoLayer | Realizable | RealizableTwoLayer
# two_layer_flavor = 'Wolfstein' # Wolfstein | NorrisReynolds | Xu (only used for *TwoLayer variants)
use_buoyancy = false
use_compressibility = false
nonlinear_model = 'none'
curvature_model = 'none'
use_yap = false
use_low_re_Gprime = false
bulk_wall_treatment = false
[Mesh]
[load_mesh]
type = FileMeshGenerator
file = 'BFS_mesh_fine1.e'
[]
[]
[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
pressure_projection_method = 'consistent'
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
[]
[TKE]
type = MooseLinearVariableFVReal
solver_sys = TKE_system
[]
[TKED]
type = MooseLinearVariableFVReal
solver_sys = TKED_system
[]
[]
[FVICs]
[vel_x_ic]
type = FVFunctionIC
variable = 'vel_x'
function = fully_developed_velocity
[]
[vel_y_ic]
type = FVFunctionIC
variable = 'vel_y'
function = 0
[]
[pressure_ic]
type = FVFunctionIC
variable = 'pressure'
function = 0
[]
[TKE_ic]
type = FVFunctionIC
variable = 'TKE'
function = fully_developed_tke
[]
[TKED_ic]
type = FVFunctionIC
variable = 'TKED'
function = fully_developed_tked
[]
[]
[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 = true
[]
[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 = true
[]
[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 = kEpsilonTKESourceSink
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 = 2
# NEW (optional)
k_epsilon_variant = ${k_epsilon_variant} # 'Standard', 'Realizable', etc.
use_buoyancy = ${use_buoyancy}
use_compressibility = ${use_compressibility}
nonlinear_model = ${nonlinear_model}
curvature_model = ${curvature_model}
[]
[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 = kEpsilonTKEDSourceSink
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 = 2
# NEW (optional)
k_epsilon_variant = ${k_epsilon_variant}
use_buoyancy = ${use_buoyancy}
use_compressibility = ${use_compressibility}
nonlinear_model = ${nonlinear_model}
curvature_model = ${curvature_model}
use_yap = ${use_yap}
use_low_re_Gprime = ${use_low_re_Gprime}
wall_distance = distance
[]
[]
[LinearFVBCs]
[inlet_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'inlet'
variable = vel_x
functor = 'fully_developed_velocity'
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'inlet'
variable = vel_y
functor = 0
[]
[inlet_TKE]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'inlet'
variable = TKE
functor = 'fully_developed_tke'
[]
# Alternative constant inlet BC
# [inlet_TKE]
# type = INSFVInletIntensityTKEBC
# boundary = 'inlet'
# variable = TKE
# u = vel_x
# v = vel_y
# w = vel_z
# intensity = ${intensity}
# []
[inlet_TKED]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'inlet'
variable = TKED
functor = 'fully_developed_tked'
[]
# Alternative constant inlet BC
# [inlet_TKED]
# type = INSFVMixingLengthTKEDBC
# boundary = 'inlet'
# variable = TKED
# k = TKE
# characteristic_length = '${D}'
# []
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'outlet'
variable = vel_x
use_two_term_expansion = false
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'outlet'
variable = vel_y
use_two_term_expansion = false
[]
[outlet_tke]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'outlet'
variable = TKE
use_two_term_expansion = false
[]
[outlet_tked]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'outlet'
variable = TKED
use_two_term_expansion = false
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'outlet'
variable = pressure
functor = 0.0
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = ${walls}
variable = vel_x
functor = 0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = ${walls}
variable = vel_y
functor = 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}'
[]
# For computing c_f
[mu_t_wall]
type = MooseLinearVariableFVReal
[]
[yplus]
type = MooseLinearVariableFVReal
[]
[mu_eff]
type = MooseLinearVariableFVReal
initial_condition = '${fparse mu + rho * C_mu * ${k_init}^2 / eps_init}'
[]
[distance]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosity
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}
mu_t_ratio_max = 1e20
execute_on = 'NONLINEAR'
# NEW (optional) – choose model and options
k_epsilon_variant = ${k_epsilon_variant} # e.g. 'Standard' or 'Realizable'
# two_layer_flavor = ${two_layer_flavor} # ignored unless *TwoLayer variants
# Cd0 = 0.091 # defaults, can omit if you keep Standard
# Cd1 = 0.0042
# Cd2 = 0.00011
# Ca0 = 0.667 # Realizable C_mu coefficients
# Ca1 = 1.25
# Ca2 = 1.0
# Ca3 = 0.9
wall_distance = distance # only needed for LowRe/TwoLayer (see below)
[]
[compute_mu_t_wall_neq]
type = ParsedAux
variable = 'mu_t_wall'
expression = '${mu} * (0.4187 * yplus / log(max(9.793 * yplus, 1.0 + 1e-4)) - 1)'
coupled_variables = 'yplus'
execute_on = 'TIMESTEP_END'
[]
# Equivalent way of computing mu_t_wall
# [compute_mu_t_wall]
# type = kEpsilonViscosityAux
# variable = mu_t_wall
# C_mu = ${C_mu}
# tke = TKE
# epsilon = TKED
# mu = ${mu}
# rho = ${rho}
# u = vel_x
# v = vel_y
# bulk_wall_treatment = true
# walls = ${walls}
# wall_treatment = ${wall_treatment}
# execute_on = 'TIMESTEP_END'
# 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'
[]
[distance_aux]
type = WallDistanceMixingLengthAux
walls = 'wall'
variable = 'distance'
execute_on = 'initial'
von_karman_const = 1.0
[]
[]
[UserObjects]
[read_recycling]
type = PropertyReadFile
prop_file_name = 'BFS_FDprofile.csv'
read_type = 'voronoi'
nprop = 7
execute_on = TIMESTEP_BEGIN
nvoronoi = 60
[]
[]
[Functions]
[fully_developed_velocity]
type = PiecewiseConstantFromCSV
read_prop_user_object = 'read_recycling'
read_type = 'voronoi'
column_number = '6'
[]
[fully_developed_tke]
type = PiecewiseConstantFromCSV
read_prop_user_object = 'read_recycling'
read_type = 'voronoi'
column_number = '3'
[]
[fully_developed_tked]
type = PiecewiseConstantFromCSV
read_prop_user_object = 'read_recycling'
read_type = 'voronoi'
column_number = '4'
[]
[]
[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-8
pressure_l_abs_tol = 1e-8
turbulence_l_abs_tol = 1e-8
momentum_l_tol = 1e-10
pressure_l_tol = 1e-10
turbulence_l_tol = 1e-10
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
turbulence_equation_relaxation = '0.4 0.4'
pressure_absolute_tolerance = 1e-8
momentum_absolute_tolerance = 1e-8
turbulence_absolute_tolerance = '1e-8 1e-8'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
turbulence_petsc_options_iname = '-pc_type -pc_hypre_type'
turbulence_petsc_options_value = 'hypre boomeramg'
momentum_l_max_its = 300
pressure_l_max_its = 300
turbulence_l_max_its = 30
print_fields = false
num_iterations = 8000
continue_on_max_its = true
[]
[VectorPostprocessors]
[inlet_channel_wall_sampler]
type = LineValueSampler
variable = 'distance vel_x pressure mu_t_wall'
start_point = '${fparse -0.048} ${y_first_cell_1} 0.0'
end_point = '${fparse -1e-3} ${y_first_cell_1} 0.0'
sort_by = 'x'
num_points = 100
[]
[outlet_channel_wall_sampler]
type = LineValueSampler
variable = 'distance vel_x pressure mu_t_wall'
start_point = '6.1e-4 ${fparse -0.0127 + y_first_cell_2} 0.0'
end_point = '0.2492 ${fparse -0.0127 + y_first_cell_2} 0.0'
sort_by = 'x'
num_points = 100
[]
[vel_x_xoH_1_sampler]
type = LineValueSampler
variable = 'vel_x'
start_point = '${fparse 0.0127*1.0} -0.0127 0.0'
end_point = '${fparse 0.0127*1.0} ${fparse 0.0127*8.2-0.0127} 0.0'
sort_by = 'y'
num_points = 100
[]
[vel_x_xoH_4_sampler]
type = LineValueSampler
variable = 'vel_x'
start_point = '${fparse 0.0127*4.0} -0.0127 0.0'
end_point = '${fparse 0.0127*4.0} ${fparse 0.0127*8.2-0.0127} 0.0'
sort_by = 'y'
num_points = 100
[]
[vel_x_xoH_6_sampler]
type = LineValueSampler
variable = 'vel_x'
start_point = '${fparse 0.0127*6.0} -0.0127 0.0'
end_point = '${fparse 0.0127*6.0} ${fparse 0.0127*8.2-0.0127} 0.0'
sort_by = 'y'
num_points = 100
[]
[vel_x_xoH_10_sampler]
type = LineValueSampler
variable = 'vel_x'
start_point = '${fparse 0.0127*10.0} -0.0127 0.0'
end_point = '${fparse 0.0127*10.0} ${fparse 0.0127*8.2-0.0127} 0.0'
sort_by = 'y'
num_points = 100
[]
[]
[Postprocessors]
[mdot]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
advected_interp_method = ${advected_interp_method}
advected_quantity = ${rho}
boundary = 'inlet'
execute_on = 'TIMESTEP_END'
[]
[bulk_u]
type = SideExtremeValue
boundary = 'inlet'
variable = 'vel_x'
execute_on = 'TIMESTEP_END'
[]
[Reynolds_in]
type = ParsedPostprocessor
expression = 'bulk_u / mu * rho * D'
pp_names = 'bulk_u'
constant_expressions = '${mu} ${rho} ${D}'
constant_names = 'mu rho D'
execute_on = 'TIMESTEP_END'
[]
[]
[Outputs]
[exo]
type = Exodus
[]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/kEpsilon/channel/channel_ERCOFTAC.i)
##########################################################
# ERCOFTAC test case for turbulent channel flow
# Case Number: 032
# Author: Dr. Mauricio Tano & Hailey Tran Kieu
# Last Update: November, 2023 & 2025
# Turbulent model using:
# k-epsilon
# Equilibrium + Newton wall treatment
# SIMPLE solve
##########################################################
### Problem Parameters ###
H = 1 # half-width of the channel
L = 120
Re = 14000
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 = 'bottom top'
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
# NOTE:
# The k-epsilon kernels/aux-kernels now include strict parameter applicability
# checks. To keep this input file usable across all test permutations, we do
# *not* hard-code model-variant-specific options here. Instead, the test harness
# sets per-object options via CLI overrides (see create_tests.py).
[Mesh]
[block_1]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = 0
ymax = ${H}
nx = 10
ny = 5
bias_y = 0.7
[]
[block_2]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = ${fparse -H}
ymax = 0
nx = 10
ny = 5
bias_y = ${fparse 1/0.7}
[]
[smg]
type = StitchMeshGenerator
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
pressure_projection_method = 'consistent'
[]
[]
[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}'
[]
[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}'
[]
[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 = kEpsilonTKESourceSink
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 = kEpsilonTKEDSourceSink
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
wall_distance = wall_distance # for low-Re / two-layer Yap / G' terms
[]
[]
[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]
[wall_distance]
type = MooseVariableFVReal
initial_condition = 1.0
[]
[mu_t]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
[]
[yplus]
type = MooseVariableFVReal
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_wall_distance]
type = WallDistanceAux
variable = wall_distance
walls = ${walls}
execute_on = 'INITIAL NONLINEAR'
[]
[compute_mu_t]
type = kEpsilonViscosity
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}
mu_t_ratio_max = 1e20
execute_on = 'NONLINEAR'
wall_distance = wall_distance # only needed for LowRe/TwoLayer (see below)
[]
[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-7
momentum_absolute_tolerance = 1e-7
turbulence_absolute_tolerance = '1e-7 1e-7'
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'
momentum_l_max_its = 300
pressure_l_max_its = 300
turbulence_l_max_its = 30
print_fields = false
continue_on_max_its = true
[]
[Outputs]
exodus = false
[csv]
type = CSV
execute_on = FINAL
[]
[]
variables_to_sample = 'vel_x vel_y pressure TKE TKED'
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = ${variables_to_sample}
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = ${variables_to_sample}
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 = ${variables_to_sample}
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 = ${variables_to_sample}
sort_by = 'x'
execute_on = 'timestep_end'
[]
[]
(test/tests/kEpsilon/special-cases/channel_ERCOFTAC_buoyant.i)
##########################################################
# ERCOFTAC test case for turbulent channel flow
# Case Number: 032
# Author: Dr. Mauricio Tano & Hailey Tran Kieu
# Last Update: November, 2023 & 2025
# Turbulent model using:
# k-epsilon
# Equilibrium + Newton wall treatment
# SIMPLE solve
##########################################################
### Problem Parameters ###
H = 1 # half-width of the channel
L = 120
Re = 14000
rho_0 = 1
bulk_u = 1
mu = '${fparse rho_0 * bulk_u * 2 * H / Re}'
cp = 4186.0
k = 1.0
alpha_b = 1e-3
T_0 = 300.0
c = 1480.0
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 = 'bottom top'
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
# Turbulence-model knobs (optional)
k_epsilon_variant = 'RealizableTwoLayer' # Standard | StandardLowRe | StandardTwoLayer | Realizable | RealizableTwoLayer
two_layer_flavor = 'Wolfstein' # Wolfstein | NorrisReynolds | Xu (only used for *TwoLayer variants)
use_buoyancy = true
use_compressibility = true
nonlinear_model = 'none'
curvature_model = 'none'
use_yap = false
use_low_re_Gprime = false
[Mesh]
[block_1]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = 0
ymax = ${H}
nx = 10
ny = 5
bias_y = 0.7
[]
[block_2]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = ${fparse -H}
ymax = 0
nx = 10
ny = 5
bias_y = ${fparse 1/0.7}
[]
[smg]
type = StitchMeshGenerator
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 energy_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_functor'
p_diffusion_kernel = p_diffusion
pressure_projection_method = 'consistent'
[]
[]
[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}
[]
[T]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = 300.0
[]
[]
[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}'
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[u_buoyancy]
type = LinearFVMomentumBuoyancy
variable = vel_x
rho = 'rho_functor'
reference_rho = ${rho_0}
gravity = '-9.81 0 0'
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}'
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[v_buoyancy]
type = LinearFVMomentumBuoyancy
variable = vel_y
rho = 'rho_functor'
reference_rho = ${rho_0}
gravity = '-9.81 0 0'
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 = kEpsilonTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = 'rho_functor'
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
# NEW (optional)
k_epsilon_variant = ${k_epsilon_variant} # 'Standard', 'Realizable', etc.
use_buoyancy = ${use_buoyancy}
use_compressibility = ${use_compressibility}
nonlinear_model = ${nonlinear_model}
curvature_model = ${curvature_model}
Pr_t = 0.9
C_M = 1.0
gravity = '-9.81 0 0'
# if/when you have these fields:
temperature = T
beta = ${alpha_b}
speed_of_sound = ${c}
# nonlinear_production = Gnl
# curvature_factor = fc
[]
[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 = kEpsilonTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
tke = TKE
rho = 'rho_functor'
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
# NEW (optional)
k_epsilon_variant = ${k_epsilon_variant}
use_buoyancy = ${use_buoyancy}
use_compressibility = ${use_compressibility}
nonlinear_model = ${nonlinear_model}
curvature_model = ${curvature_model}
use_yap = ${use_yap}
use_low_re_Gprime = ${use_low_re_Gprime}
Pr_t = 0.9
C_M = 1.0
gravity = '-9.81 0 0'
# same functors as for TKE if you use them:
temperature = T
beta = ${alpha_b}
speed_of_sound = ${c}
# nonlinear_production = Gnl
# curvature_factor = fc
wall_distance = wall_distance # for low-Re / two-layer Yap / G' terms
[]
[heat_advection]
type = LinearFVEnergyAdvection
variable = T
advected_quantity = temperature
cp = ${cp}
[]
[conduction]
type = LinearFVDiffusion
variable = T
diffusion_coeff = ${k}
[]
[source]
type = LinearFVSource
variable = T
source_density = 1e3
[]
[]
[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_functor'
mu = ${mu}
tke = TKE
wall_treatment = ${wall_treatment}
[]
[inlet_and_wall_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
functor = 300.0
boundary = 'left top bottom'
[]
[outlet_T]
type = LinearFVAdvectionDiffusionOutflowBC
variable = T
use_two_term_expansion = false
boundary = 'right'
[]
[]
[AuxVariables]
[wall_distance]
type = MooseVariableFVReal
initial_condition = 1.0
[]
[mu_t]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho_0 * C_mu * ${k_init}^2 / eps_init}'
[]
[yplus]
type = MooseVariableFVReal
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_wall_distance]
type = WallDistanceAux
variable = wall_distance
walls = ${walls}
execute_on = 'INITIAL NONLINEAR'
[]
[compute_mu_t]
type = kEpsilonViscosity
variable = mu_t
C_mu = ${C_mu}
tke = TKE
epsilon = TKED
mu = ${mu}
rho = 'rho_functor'
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment}
mu_t_ratio_max = 1e20
execute_on = 'NONLINEAR'
# NEW (optional) – choose model and options
k_epsilon_variant = ${k_epsilon_variant} # e.g. 'Standard' or 'Realizable'
two_layer_flavor = ${two_layer_flavor} # ignored unless *TwoLayer variants
wall_distance = wall_distance # only needed for LowRe/TwoLayer (see below)
[]
[compute_y_plus]
type = RANSYPlusAux
variable = yplus
tke = TKE
mu = ${mu}
rho = 'rho_functor'
u = vel_x
v = vel_y
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[]
[FunctorMaterials]
[rho_function]
type = ParsedFunctorMaterial
property_name = 'rho_functor'
functor_names = 'T'
expression = '${rho_0}*(1-${alpha_b}*(T-${T_0})) '
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKE_system TKED_system'
energy_system = 'energy_system'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
energy_l_abs_tol = 1e-14
momentum_l_tol = 1e-14
pressure_l_tol = 1e-14
turbulence_l_tol = 1e-14
energy_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'
energy_equation_relaxation = 0.9
num_iterations = 1000
pressure_absolute_tolerance = 1e-7
momentum_absolute_tolerance = 1e-7
turbulence_absolute_tolerance = '1e-7 1e-7'
energy_absolute_tolerance = 1e-7
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'
momentum_l_max_its = 300
pressure_l_max_its = 300
turbulence_l_max_its = 30
energy_l_max_its = 300
print_fields = false
continue_on_max_its = true
[]
[Outputs]
exodus = false
[csv]
type = CSV
execute_on = FINAL
[]
[]
variables_to_sample = 'vel_x vel_y pressure T TKE TKED'
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = ${variables_to_sample}
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = ${variables_to_sample}
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 = ${variables_to_sample}
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 = ${variables_to_sample}
sort_by = 'x'
execute_on = 'timestep_end'
[]
[]
(test/tests/kEpsilon/special-cases/lid-driven-curvature-corrected.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
# Turbulence-model knobs (optional)
k_epsilon_variant = 'Realizable' # Standard | StandardLowRe | StandardTwoLayer | Realizable | RealizableTwoLayer
use_buoyancy = false
use_compressibility = false
nonlinear_model = 'none'
curvature_model = 'standard'
use_yap = false
use_low_re_Gprime = false
[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 = 8
ny = 8
[]
# 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 = kEpsilonTKESourceSink
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
# NEW (optional)
k_epsilon_variant = ${k_epsilon_variant} # 'Standard', 'Realizable', etc.
use_buoyancy = ${use_buoyancy}
use_compressibility = ${use_compressibility}
nonlinear_model = ${nonlinear_model}
use_curvature_correction = true
curvature_model = ${curvature_model}
[]
[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 = kEpsilonTKEDSourceSink
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
# NEW (optional)
k_epsilon_variant = ${k_epsilon_variant}
use_buoyancy = ${use_buoyancy}
use_compressibility = ${use_compressibility}
nonlinear_model = ${nonlinear_model}
use_curvature_correction = true
curvature_model = ${curvature_model}
use_yap = ${use_yap}
use_low_re_Gprime = ${use_low_re_Gprime}
wall_distance = wall_distance # for low-Re / two-layer Yap / G' terms
[]
[]
[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]
[wall_distance]
type = MooseVariableFVReal
initial_condition = 1.0
[]
[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_wall_distance]
type = WallDistanceAux
variable = wall_distance
walls = ${walls}
execute_on = 'INITIAL NONLINEAR'
[]
[compute_mu_t]
type = kEpsilonViscosity
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}
mu_t_ratio_max = 1e20
execute_on = 'NONLINEAR'
# NEW (optional) – choose model and options
k_epsilon_variant = ${k_epsilon_variant} # e.g. 'Standard' or 'Realizable'
wall_distance = wall_distance # only needed for LowRe/TwoLayer (see below)
[]
[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-10
pressure_l_abs_tol = 1e-10
turbulence_l_abs_tol = 1e-10
momentum_l_tol = 1e-10
pressure_l_tol = 1e-10
turbulence_l_tol = 1e-10
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
turbulence_equation_relaxation = '0.5 0.5'
num_iterations = 500
pressure_absolute_tolerance = 1e-10
momentum_absolute_tolerance = 1e-10
turbulence_absolute_tolerance = '1e-10 1e-10'
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]
exodus = false
[csv]
type = CSV
execute_on = FINAL
[]
[]
[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'
[]
[]
(test/tests/kEpsilon/special-cases/channel_ERCOFTAC_bulk_treatment.i)
##########################################################
# ERCOFTAC test case for turbulent channel flow
# Case Number: 032
# Author: Dr. Mauricio Tano & Hailey Tran Kieu
# Last Update: November, 2023 & 2025
# Turbulent model using:
# k-epsilon
# Equilibrium + Newton wall treatment
# SIMPLE solve
##########################################################
### Problem Parameters ###
H = 1 # half-width of the channel
L = 120
Re = 14000
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 = true
walls = 'bottom top'
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
# Turbulence-model knobs (optional)
k_epsilon_variant = 'Standard'
use_buoyancy = false
use_compressibility = false
nonlinear_model = 'none'
curvature_model = 'none'
use_yap = false
use_low_re_Gprime = false
[Mesh]
[block_1]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = 0
ymax = ${H}
nx = 10
ny = 3
bias_y = 1.0
[]
[block_2]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = ${fparse -H}
ymax = 0
nx = 10
ny = 3
bias_y = 1.0
[]
[smg]
type = StitchMeshGenerator
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
pressure_projection_method = 'consistent'
[]
[]
[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}'
[]
[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}'
[]
[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 = kEpsilonTKESourceSink
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
# NEW (optional)
k_epsilon_variant = ${k_epsilon_variant} # 'Standard', 'Realizable', etc.
use_buoyancy = ${use_buoyancy}
use_compressibility = ${use_compressibility}
nonlinear_model = ${nonlinear_model}
curvature_model = ${curvature_model}
[]
[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 = kEpsilonTKEDSourceSink
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
# NEW (optional)
k_epsilon_variant = ${k_epsilon_variant}
use_buoyancy = ${use_buoyancy}
use_compressibility = ${use_compressibility}
nonlinear_model = ${nonlinear_model}
curvature_model = ${curvature_model}
use_yap = ${use_yap}
use_low_re_Gprime = ${use_low_re_Gprime}
wall_distance = wall_distance # for low-Re / two-layer Yap / G' terms
[]
[]
[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
[]
[]
[AuxVariables]
[wall_distance]
type = MooseVariableFVReal
initial_condition = 1.0
[]
[mu_t]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
[]
[yplus]
type = MooseVariableFVReal
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_wall_distance]
type = WallDistanceAux
variable = wall_distance
walls = ${walls}
execute_on = 'INITIAL NONLINEAR'
[]
[compute_mu_t]
type = kEpsilonViscosity
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}
mu_t_ratio_max = 1e20
execute_on = 'NONLINEAR'
# NEW (optional) – choose model and options
k_epsilon_variant = ${k_epsilon_variant} # e.g. 'Standard' or 'Realizable'
wall_distance = wall_distance # only needed for LowRe/TwoLayer (see below)
[]
[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-7
momentum_absolute_tolerance = 1e-7
turbulence_absolute_tolerance = '1e-7 1e-7'
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'
momentum_l_max_its = 300
pressure_l_max_its = 300
turbulence_l_max_its = 30
print_fields = false
continue_on_max_its = true
[]
[Outputs]
exodus = false
[csv]
type = CSV
execute_on = FINAL
[]
[]
variables_to_sample = 'vel_x vel_y pressure TKE TKED'
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = ${variables_to_sample}
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = ${variables_to_sample}
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 = ${variables_to_sample}
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 = ${variables_to_sample}
sort_by = 'x'
execute_on = 'timestep_end'
[]
[]
(test/tests/kEpsilon/special-cases/channel_ERCOFTAC_low_Re.i)
##########################################################
# ERCOFTAC test case for turbulent channel flow
# Case Number: 032
# Author: Dr. Mauricio Tano & Hailey Tran Kieu
# Last Update: November, 2023 & 2025
# Turbulent model using:
# k-epsilon
# Equilibrium + Newton wall treatment
# SIMPLE solve
##########################################################
### Problem Parameters ###
H = 1 # half-width of the channel
L = 120
Re = 2000
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 = 'bottom top'
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
# Turbulence-model knobs (optional)
k_epsilon_variant = 'RealizableTwoLayer' # Standard | StandardLowRe | StandardTwoLayer | Realizable | RealizableTwoLayer
two_layer_flavor = 'Wolfstein' # Wolfstein | NorrisReynolds | Xu (only used for *TwoLayer variants)
use_buoyancy = false
use_compressibility = false
nonlinear_model = 'none'
curvature_model = 'none'
use_yap = false
[Mesh]
[block_1]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = 0
ymax = ${H}
nx = 10
ny = 5
bias_y = 0.9
[]
[block_2]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = ${fparse -H}
ymax = 0
nx = 10
ny = 5
bias_y = ${fparse 1/0.9}
[]
[smg]
type = StitchMeshGenerator
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
pressure_projection_method = 'consistent'
[]
[]
[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}'
[]
[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}'
[]
[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 = kEpsilonTKESourceSink
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
# NEW (optional)
k_epsilon_variant = ${k_epsilon_variant} # 'Standard', 'Realizable', etc.
use_buoyancy = ${use_buoyancy}
use_compressibility = ${use_compressibility}
nonlinear_model = ${nonlinear_model}
curvature_model = ${curvature_model}
[]
[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 = kEpsilonTKEDSourceSink
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
# NEW (optional)
k_epsilon_variant = ${k_epsilon_variant}
use_buoyancy = ${use_buoyancy}
use_compressibility = ${use_compressibility}
nonlinear_model = ${nonlinear_model}
curvature_model = ${curvature_model}
use_yap = ${use_yap}
wall_distance = wall_distance # for low-Re / two-layer Yap / G' terms
[]
[]
[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]
[wall_distance]
type = MooseVariableFVReal
initial_condition = 1.0
[]
[mu_t]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
[]
[yplus]
type = MooseVariableFVReal
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_wall_distance]
type = WallDistanceAux
variable = wall_distance
walls = ${walls}
execute_on = 'INITIAL NONLINEAR'
[]
[compute_mu_t]
type = kEpsilonViscosity
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}
mu_t_ratio_max = 1e20
execute_on = 'NONLINEAR'
# NEW (optional) – choose model and options
k_epsilon_variant = ${k_epsilon_variant} # e.g. 'Standard' or 'Realizable'
two_layer_flavor = ${two_layer_flavor} # ignored unless *TwoLayer variants
wall_distance = wall_distance # only needed for LowRe/TwoLayer (see below)
[]
[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-7
momentum_absolute_tolerance = 1e-7
turbulence_absolute_tolerance = '1e-7 1e-7'
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'
momentum_l_max_its = 300
pressure_l_max_its = 300
turbulence_l_max_its = 30
print_fields = false
continue_on_max_its = true
[]
[Outputs]
exodus = false
[csv]
type = CSV
execute_on = FINAL
[]
[]
variables_to_sample = 'vel_x vel_y pressure TKE TKED'
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = ${variables_to_sample}
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = ${variables_to_sample}
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 = ${variables_to_sample}
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 = ${variables_to_sample}
sort_by = 'x'
execute_on = 'timestep_end'
[]
[]