- 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.
- mu_tTurbulent 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:Turbulent viscosity. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- rhoFluid density. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:Fluid density. 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 whose linear system this object contributes to
C++ Type:LinearVariableName
Unit:(no unit assumed)
Controllable:No
Description:The name of the variable whose linear system this object contributes to
kEpsilonTKESourceSink
kEpsilonTKESourceSink is a finite volume elemental kernel that computes the turbulent source and sink term for the turbulent kinetic energy equation in the k– family of models.
The explanations in this kernel documentation are a summary. The reader is referred to the theory for more details if needed.
The turbulent kinetic energy (TKE) equation is written in conservative form as
where:
is the turbulent kinetic energy,
is the mean velocity,
is the shear production,
is the buoyancy production,
is the production due to nonlinear Reynolds stresses,
is a compressibility correction, and
is the dissipation rate supplied by the -equation.
kEpsilonTKESourceSink forms the right-hand side source term for the k-equation by computing the combination
with expressions that depend on the chosen k– variant and options.
The kernel is designed to be used together with:
kEpsilonTKEDSourceSink for the -equation, and
kEpsilonViscosity for the turbulent viscosity .
Model variants
The kernel supports several members of the k– family via the "k_epsilon_variant" parameter:
Standard— classical high-Reynolds-number k– model.StandardLowRe— low-Reynolds-number k– model with damping functions.StandardTwoLayer— two-layer k– formulation using a blending between outer k– and near-wall length scales.Realizable— realizable k– model with variable depending on strain/rotation invariants.RealizableTwoLayer— realizable model with a two-layer near-wall treatment.
The choice of variant affects:
how the shear production is formed,
whether a curvature correction factor is applied,
how near-wall behavior is modeled (two-layer vs. high-Re),
whether low-Re damping functions and extra terms are used (via -equation).
Bulk formulation
In bulk cells (not explicitly treated as near-wall by this kernel), the source term is computed as
The individual contributions are detailed below.
Strain-rate tensor and invariants
The mean velocity gradient is used to form the symmetric strain-rate tensor and the antisymmetric rotation tensor :
The invariants are defined as:
,
,
.
These invariants are shared by the turbulence viscosity, nonlinear models, and curvature correction.
Shear production
The base formulation of the shear production is
where
is the turbulent viscosity provided as a functor, and
.
For compressible flows, the implementation allows inclusion of the extra trace terms
consistent with the constitutive relation for the Reynolds stress tensor in compressible flow.
The shear production is then modified depending on the k– variant and curvature correction model (see below).
Curvature / rotation correction
For realizable variants, an optional curvature correction factor may be applied via "curvature_model". The current implementation supports:
curvature_model = none— no curvature correction, ;curvature_model = standard— Spalart–Shur–type rotation/curvature correction based on and .
The curvature correction builds a correction that enhances production in stabilizing curvature and reduces it in destabilizing regions. The corrected shear production is
Standard, StandardLowRe, StandardTwoLayer:
Realizable, RealizableTwoLayer:
Buoyancy production
If "use_buoyancy" is true, buoyancy production is added via
where
is the thermal expansion coefficient,
is the turbulent Prandtl number,
is the temperature,
is the gravitational acceleration.
The gradient and gravity vector are supplied as functors / parameters. Buoyancy can either augment or reduce total production depending on the sign of the dot product .
nonlinear production
kEpsilonTKESourceSink supports optional nonlinear constitutive relations for the Reynolds stress tensor. The choice is controlled by "nonlinear_model":
nonlinear_model = none— no nonlinear production, ;nonlinear_model = quadratic— quadratic constitutive relation;nonlinear_model = cubic— quadratic + cubic terms.
The nonlinear Reynolds stress contribution is computed in TurbulenceMethods as
where depends on:
the velocity gradient (through and ),
the invariants , ,
, , ,
fixed model coefficients and a variable .
In all k– variants, kEpsilonTKESourceSink adds to the k-equation’s production:
Compressibility correction
If "use_compressibility" is true, a compressibility correction is added to the sink term:
where is a model coefficient and is the speed of sound. This term is computed by NS::computeGammaM and is subtracted from total production, representing the transfer of TKE into acoustic modes in compressible flow.
Production limiter
To avoid excessive TKE generation in stagnation regions, a production limiter is applied:
The limiter coefficient is available as "C_pl". This limiter follows the standard approach from Menter (1994) and is applied in the bulk region.
Summary of bulk source
In non-wall-bounded cells, the kernel assembles the following source term for the residual:
Wall formulation
Cells adjacent to boundaries listed in "walls" are treated as next-to-wall cells with a different expression for production and destruction, similar in spirit to LinearFVTKESourceSink. Wall distances are typically computed using WallDistanceAux, which returns the distance from each cell centroid to the nearest wall.
The near-wall treatment is implemented in the matrix contribution for this kernel, where a distinction is made between the viscous sublayer and the logarithmic region based on the non-dimensional wall distance
with
the distance from the cell center to the wall,
the friction velocity obtained from a wall-function model,
the molecular viscosity.
The same wall-function options as used for the turbulent viscosity are available via "wall_treatment" (e.g. eq_newton, eq_incremental, eq_linearized, neq).
Viscous sublayer ()
For cells in the viscous sublayer (sub-laminar region), turbulent production is negligible and the model sets
Destruction is modeled using a near-wall expression of the form
which enforces rapid dissipation very close to the wall.
Logarithmic region ()
For cells in the log layer, production and destruction take the classical wall-function forms:
Production:
where
is the wall shear stress,
is the effective wall viscosity (including turbulent contributions),
is the wall-normal velocity gradient norm,
is the k– closure coefficient,
is the von Kármán constant.
Destruction:
In the logarithmic region, production and destruction are balanced in such a way that the near-wall TKE profile is consistent with the log-law of the wall.
When the near-wall treatment is handled by this kernel, the wall boundary condition for is effectively provided by the model and explicit Dirichlet boundary conditions for on those walls are typically unnecessary.
Interaction with -equation and viscosity
kEpsilonTKESourceSink only forms the k-equation source terms. For a complete k– model, this kernel must be used together with:
kEpsilonTKEDSourceSink, which provides the -equation sources,
including:
realizable production terms,
nonlinear contributions,
ow-Re extra production ,
Yap correction,
buoyancy source for ;
kEpsilonViscosity, which computes the turbulent viscosity from the current and , including:
low-Re damping for SKE-LRe,
two-layer viscosity blending,
realizable variable ,
bulk wall treatment for (if requested).
The three objects together implement the full k– turbulence model family.
Input Parameters
- C_M1Coefficient used in the compressibility correction gamma_M.
Default:1
C++ Type:Real
Unit:(no unit assumed)
Controllable:No
Description:Coefficient used in the compressibility correction gamma_M.
- C_mu0.09Turbulent kinetic energy closure constant C_mu.
Default:0.09
C++ Type:Real
Unit:(no unit assumed)
Controllable:No
Description:Turbulent kinetic energy closure constant C_mu.
- C_pl10Production limiter multiplier C_pl.
Default:10
C++ Type:Real
Unit:(no unit assumed)
Controllable:No
Description:Production limiter multiplier C_pl.
- Pr_t0.9Turbulent Prandtl number used in the buoyancy production term.
Default:0.9
C++ Type:Real
Unit:(no unit assumed)
Controllable:No
Description:Turbulent Prandtl number used in the buoyancy production term.
- betaThermal expansion coefficient functor used for buoyancy production (beta(T)). 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:Thermal expansion coefficient functor used for buoyancy production (beta(T)). A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- 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
- curvature_modelnoneCurvature / rotation correction model: 'none' (default) or 'standard' (Spalart–Shur style).
Default:none
C++ Type:MooseEnum
Options:none, standard
Controllable:No
Description:Curvature / rotation correction model: 'none' (default) or 'standard' (Spalart–Shur style).
- gravity0 0 0Gravity vector used for buoyancy production.
Default:0 0 0
C++ Type:libMesh::VectorValue<Real>
Unit:(no unit assumed)
Controllable:No
Description:Gravity vector used for buoyancy production.
- k_epsilon_variantStandardk-epsilon model variant used for the bulk production term.
Default:Standard
C++ Type:MooseEnum
Options:Standard, StandardLowRe, StandardTwoLayer, Realizable, RealizableTwoLayer
Controllable:No
Description:k-epsilon model variant used for the bulk production term.
- nonlinear_modelnoneNon-linear constitutive relation for standard k-epsilon.
Default:none
C++ Type:MooseEnum
Options:none, quadratic, cubic
Controllable:No
Description:Non-linear constitutive relation for standard k-epsilon.
- speed_of_soundSpeed of sound functor used for compressibility correction gamma_M. 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:Speed of sound functor used for compressibility correction gamma_M. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- temperatureTemperature functor used for buoyancy production. 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:Temperature functor used for buoyancy production. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- use_buoyancyFalseInclude buoyancy production Gb in the bulk k-equation.
Default:False
C++ Type:bool
Controllable:No
Description:Include buoyancy production Gb in the bulk k-equation.
- use_compressibilityFalseInclude compressibility correction gamma_M in the bulk k-equation.
Default:False
C++ Type:bool
Controllable:No
Description:Include compressibility correction gamma_M in the bulk k-equation.
- use_curvature_correctionFalseApply a curvature correction factor f_c to the shear production.
Default:False
C++ Type:bool
Controllable:No
Description:Apply a curvature correction factor f_c to the shear production.
- 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_treatmentneqMethod used for wall functions.
Default:neq
C++ Type:MooseEnum
Options:eq_newton, eq_incremental, eq_linearized, neq
Controllable:No
Description:Method used for wall functions.
- wallsBoundaries that correspond to solid walls.
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:Boundaries that correspond to solid walls.
Optional Parameters
- absolute_value_vector_tagsThe tags for the vectors this residual object should fill with the absolute value of the residual contribution
C++ Type:std::vector<TagName>
Controllable:No
Description:The tags for the vectors this residual object should fill with the absolute value of the residual contribution
- extra_matrix_tagsThe extra tags for the matrices this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the matrices this Kernel should fill
- extra_vector_tagsThe extra tags for the vectors this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the vectors this Kernel should fill
- matrix_onlyFalseWhether this object is only doing assembly to matrices (no vectors)
Default:False
C++ Type:bool
Controllable:No
Description:Whether this object is only doing assembly to matrices (no vectors)
- matrix_tagssystemThe tag for the matrices this Kernel should fill
Default:system
C++ Type:MultiMooseEnum
Options:nontime, system
Controllable:No
Description:The tag for the matrices this Kernel should fill
- vector_tagsrhsThe tag for the vectors this Kernel should fill
Default:rhs
C++ Type:MultiMooseEnum
Options:rhs, time
Controllable:No
Description:The tag for the vectors this Kernel should fill
Contribution To Tagged Field Data Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Controllable:No
Description:Determines whether this object is calculated using an implicit or explicit form
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
- 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
- ghost_layers1The number of layers of elements to ghost.
Default:1
C++ Type:unsigned short
Controllable:No
Description:The number of layers of elements to ghost.
- use_point_neighborsFalseWhether to use point neighbors, which introduces additional ghosting to that used for simple face neighbors.
Default:False
C++ Type:bool
Controllable:No
Description:Whether to use point neighbors, which introduces additional ghosting to that used for simple face neighbors.
Parallel Ghosting Parameters
Input Files
- (test/tests/kEpsilon/special-cases/channel_ERCOFTAC_buoyant.i)
- (test/tests/kEpsilon/lid-driven-cavity/lid-driven.i)
- (test/tests/kEpsilon/special-cases/lid-driven-curvature-corrected.i)
- (validation/free_flow/isothermal/single-stream-jet/RTL10000/jet_RTL10000.i)
- (test/tests/kEpsilon/special-cases/channel_ERCOFTAC_low_Re.i)
- (test/tests/kEpsilon/special-cases/channel_ERCOFTAC.i)
- (test/tests/kEpsilon/special-cases/channel_ERCOFTAC_bulk_treatment.i)
- (validation/free_flow/isothermal/ercoftac_030_bfs/bfs_input.i)
- (test/tests/kEpsilon/channel/channel_ERCOFTAC.i)
References
- Florian R Menter.
Two-equation eddy-viscosity turbulence models for engineering applications.
AIAA journal, 32(8):1598–1605, 1994.[Export]
BibTeX
@article{menter1994two, author = "Menter, Florian R", title = "Two-equation eddy-viscosity turbulence models for engineering applications", journal = "AIAA journal", volume = "32", number = "8", pages = "1598--1605", year = "1994" }RIS
TY - JOUR AU - Menter, Florian R TI - Two-equation eddy-viscosity turbulence models for engineering applications JO - AIAA journal PY - 1994 VL - 32 IS - 8 SP - 1598 EP - 1605 ER -Plain Text
Florian R Menter. Two-equation eddy-viscosity turbulence models for engineering applications. AIAA journal, 32(8):1598–1605, 1994.
k_epsilon_variant
Default:Standard
C++ Type:MooseEnum
Options:Standard, StandardLowRe, StandardTwoLayer, Realizable, RealizableTwoLayer
Controllable:No
Description:k-epsilon model variant used for the bulk production term.
curvature_model
Default:none
C++ Type:MooseEnum
Options:none, standard
Controllable:No
Description:Curvature / rotation correction model: 'none' (default) or 'standard' (Spalart–Shur style).
use_buoyancy
Default:False
C++ Type:bool
Controllable:No
Description:Include buoyancy production Gb in the bulk k-equation.
nonlinear_model
Default:none
C++ Type:MooseEnum
Options:none, quadratic, cubic
Controllable:No
Description:Non-linear constitutive relation for standard k-epsilon.
use_compressibility
Default:False
C++ Type:bool
Controllable:No
Description:Include compressibility correction gamma_M in the bulk k-equation.
C_pl
Default:10
C++ Type:Real
Unit:(no unit assumed)
Controllable:No
Description:Production limiter multiplier C_pl.
walls
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:Boundaries that correspond to solid walls.
wall_treatment
Default:neq
C++ Type:MooseEnum
Options:eq_newton, eq_incremental, eq_linearized, neq
Controllable:No
Description:Method used for wall functions.
(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'
[]
[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
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = ${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_name = ${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 = LinearFVPressureCorrectionDiffusion
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
advected_interp_method_name = ${advected_interp_method}
[]
[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
advected_interp_method_name = ${advected_interp_method}
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/lid-driven-cavity/lid-driven.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'
[]
[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}
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = upwind
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_name = upwind
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 = LinearFVPressureCorrectionDiffusion
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
advected_interp_method_name = upwind
[]
[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
# if/when you have these fields:
# temperature = T
# beta = beta
# speed_of_sound = c
# nonlinear_production = Gnl
# curvature_factor = fc
[]
[TKED_advection]
type = LinearFVTurbulentAdvection
variable = TKED
advected_interp_method_name = upwind
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
# same functors as for TKE if you use them:
# temperature = T
# beta = beta
# speed_of_sound = c
# nonlinear_production = Gnl
# curvature_factor = fc
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'
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-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 = 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/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'
[]
[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}
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = upwind
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_name = upwind
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 = LinearFVPressureCorrectionDiffusion
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
advected_interp_method_name = upwind
[]
[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
advected_interp_method_name = upwind
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'
[]
[]
(validation/free_flow/isothermal/single-stream-jet/RTL10000/jet_RTL10000.i)
# ================================================================================================================
# Model description
# ================================================================================================================
# Open-Pronghorn simulation of a steady state incompressible turbulent flow of a jet into a big space/tank.
# Reference: https://pubs.aip.org/aip/pof/article/36/11/115133/3319195/Calibration-of-the-Reynolds-stress-model-for
# Author: Dr. Kyriakopoulos Vasileios, Dr. Mauricio Tano
# Idaho Falls, INL, April 10, 2026
# ================================================================================================================
# MODEL PARAMETERS
# ================================================================================================================
# Geometry
# ================================================================================================================
H = 0.2 # Height/width of the tank (m).
L = 0.3 # Total tank length (m)
Dh = 0.01 # Inlet Pipe diameter (m)
nz = 150 # number of cells in the axial direction
n1 = 8 # number of radial cells per ring in the cross-section
n2 = 8 # number of radial cells per ring in the cross-section
n3 = 8 # number of radial cells per ring in the cross-section
n4 = 8 # number of radial cells per ring in the cross-section
n5 = 8 # number of radial cells per ring in the cross-section
ny = ${fparse n1 + n2 + n3 + n4 + n5}
# A = '${fparse pi*Dh*Dh/4}' # Cross-section area of the inlet (m2)
# ================================================================================================================
# Air properties
# ================================================================================================================
rho = 1.184 # Density (kg/m3)
# ================================================================================================================
# Flow and Boundary conditions
# ================================================================================================================
Re = 10000.0 # Reynolds number
mu = 1.844e-5 # Pa*s
Vin = '${fparse Re * mu / (rho * Dh)}' # Inlet velocity (m/s) # Uniform velocity profile Faghani et al. 2011
intensity = 0.05 # Turutoglu et al 2024
k_init = '${fparse 1.5*(intensity * Vin)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / (2*0.07*Dh)}'
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
# The front boundary is the solid inlet-plane area outside the jet opening;
# the remaining outer tank boundaries are pressure outlets.
walls = 'front'
wall_treatment = 'neq' # Options: eq_newton, eq_incremental, eq_linearized, neq
eps = 1e-4
# ================================================================================================================
# Modeling parameters: 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
use_low_re_Gprime = false
bulk_wall_treatment = false
outlet = 'back bottom top left right'
[Mesh]
[front_face]
type = ConcentricCircleMeshGenerator
num_sectors = 8
radii = '${fparse Dh/2.0} ${Dh} ${fparse Dh*2.0} ${fparse Dh*4.0}'
rings = '${n1} ${n2} ${n3} ${n4} ${n5}'
has_outer_square = on
pitch = ${H}
preserve_volumes = on
smoothing_max_it = 3
[]
[extrude]
type = AdvancedExtruderGenerator
direction = '0 0 1'
input = front_face
heights = '${L}'
num_layers = ${nz}
[]
[inlet]
type = ParsedGenerateSideset
input = extrude
combinatorial_geometry = 'abs(z) < 1e-6'
included_subdomains = '1'
normal = '0 0 -1'
new_sideset_name = inlet
[]
[front]
type = ParsedGenerateSideset
input = inlet
combinatorial_geometry = 'abs(z) < 1e-6'
included_subdomains = '2 3 4 5'
normal = '0 0 -1'
new_sideset_name = front
[]
[back]
type = ParsedGenerateSideset
input = front
combinatorial_geometry = 'abs(z) > ${fparse L - 1e-6}'
included_subdomains = '1 2 3 4 5'
normal = '0 0 1'
new_sideset_name = back
[]
[delete_surfaces]
type = BoundaryDeletionGenerator
input = back
operation = remove
boundary_names = '5 6'
[]
[rename]
type = RenameBlockGenerator
input = delete_surfaces
old_block = '1 2 3 4 5'
new_block = 'air air air air air'
[]
[]
[Problem]
linear_sys_names = 'u_system v_system w_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
w = vel_z
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
pressure_projection_method = 'consistent'
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 0
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
initial_condition = 0
solver_sys = v_system
[]
[vel_z]
type = MooseLinearVariableFVReal
initial_condition = 0
solver_sys = w_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}
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = ${advected_interp_method}
mu = 'mu_eff'
u = vel_x
v = vel_y
w = vel_z
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = true
use_deviatoric_terms = yes
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method_name = ${advected_interp_method}
mu = 'mu_eff'
u = vel_x
v = vel_y
w = vel_z
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = true
use_deviatoric_terms = yes
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[w_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_z
advected_interp_method_name = ${advected_interp_method}
mu = 'mu_eff'
u = vel_x
v = vel_y
w = vel_z
momentum_component = 'z'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = true
use_deviatoric_terms = yes
[]
[w_pressure]
type = LinearFVMomentumPressure
variable = vel_z
pressure = pressure
momentum_component = 'z'
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusion
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
advected_interp_method_name = ${advected_interp_method}
[]
[TKE_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKE
diffusion_coeff = 'mu_eff_k'
use_nonorthogonal_correction = true
[]
[TKE_source_sink]
type = kEpsilonTKESourceSink
variable = TKE
u = vel_x
v = vel_y
w = vel_z
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
# 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
advected_interp_method_name = ${advected_interp_method}
walls = ${walls}
[]
[TKED_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKED
diffusion_coeff = 'mu_eff_eps'
use_nonorthogonal_correction = true
walls = ${walls}
[]
[TKED_source_sink]
type = kEpsilonTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
w = vel_z
tke = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment}
# 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 = 'inlet'
variable = vel_x
functor = '0.0'
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'inlet'
variable = vel_y
functor = '0.0'
[]
[inlet-w]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'inlet'
variable = vel_z
functor = ${Vin}
[]
[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-w]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = ${walls}
variable = vel_z
functor = 0.0
[]
[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_w]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = ${outlet}
variable = vel_z
use_two_term_expansion = false
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = ${outlet}
variable = pressure
functor = 0.0
[]
[inlet_TKE]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'inlet'
variable = TKE
functor = '${k_init}'
[]
[outlet_TKE]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = ${outlet}
variable = TKE
use_two_term_expansion = false
[]
[inlet_TKED]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'inlet'
variable = TKED
functor = '${eps_init}'
[]
[outlet_TKED]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = ${outlet}
variable = TKED
use_two_term_expansion = false
[]
[walls_mu_t]
type = LinearFVTurbulentViscosityWallFunctionBC
boundary = ${walls}
variable = 'mu_t'
u = vel_x
v = vel_y
w = vel_z
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'
[]
[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
w = vel_z
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 = 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
w = vel_z
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[]
[FunctorMaterials]
[compute_mu_eff]
type = FunctorEffectiveDynamicViscosity
property_name = mu_eff
mu = ${mu}
mu_t = mu_t
mu_t_inverse_factor = 1
execute_on = 'ALWAYS'
[]
[compute_mu_eff_k]
type = FunctorEffectiveDynamicViscosity
property_name = mu_eff_k
mu = ${mu}
mu_t = mu_t
mu_t_inverse_factor = ${sigma_k}
execute_on = 'ALWAYS'
[]
[compute_mu_eff_eps]
type = FunctorEffectiveDynamicViscosity
property_name = mu_eff_eps
mu = ${mu}
mu_t = mu_t
mu_t_inverse_factor = ${sigma_eps}
execute_on = 'ALWAYS'
[]
[]
[VectorPostprocessors]
[centerline]
type = LineValueSampler
start_point = '${eps} ${eps} ${fparse 0.5 * L / nz}'
end_point = '${eps} ${eps} ${fparse L - 0.5 * L / nz}'
num_points = ${nz}
variable = vel_z
sort_by = 'z'
execute_on = 'FINAL'
[]
!include radial.i
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system w_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKE_system TKED_system'
momentum_l_abs_tol = 1e-6
pressure_l_abs_tol = 1e-6
turbulence_l_abs_tol = 1e-6
momentum_l_tol = 1e-6
pressure_l_tol = 1e-6
turbulence_l_tol = 1e-6
momentum_equation_relaxation = 0.6
pressure_variable_relaxation = 0.25
turbulence_equation_relaxation = '0.4 0.4'
turbulence_field_relaxation = '0.4 0.4'
num_iterations = 1500
pressure_absolute_tolerance = 1e-7
momentum_absolute_tolerance = 1e-7
turbulence_absolute_tolerance = '1e-7 1e-7'
momentum_petsc_options_iname = '-u_system_pc_type -u_system_pc_hypre_type -v_system_pc_type -v_system_pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
turbulence_petsc_options_iname = '-TKE_system_pc_type -TKE_system_pc_hypre_type -TKED_system_pc_type -TKED_system_pc_hypre_type'
turbulence_petsc_options_value = 'hypre boomeramg hypre boomeramg'
momentum_l_max_its = 300
pressure_l_max_its = 300
turbulence_l_max_its = 300
print_fields = false
continue_on_max_its = true
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = FINAL
[]
[]
(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'
[]
[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}
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = ${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_name = ${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 = LinearFVPressureCorrectionDiffusion
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
advected_interp_method_name = ${advected_interp_method}
[]
[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
advected_interp_method_name = ${advected_interp_method}
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'
[]
[]
(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'
[]
[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}
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = ${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_name = ${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 = LinearFVPressureCorrectionDiffusion
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
advected_interp_method_name = ${advected_interp_method}
[]
[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
advected_interp_method_name = ${advected_interp_method}
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'
[]
[]
(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'
[]
[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}
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = ${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_name = ${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 = LinearFVPressureCorrectionDiffusion
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
advected_interp_method_name = ${advected_interp_method}
[]
[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
advected_interp_method_name = ${advected_interp_method}
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'
[]
[]
(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'
[]
[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
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = ${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_name = ${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 = LinearFVPressureCorrectionDiffusion
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
advected_interp_method_name = ${advected_interp_method}
[]
[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
advected_interp_method_name = ${advected_interp_method}
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'
[]
[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}
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = ${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_name = ${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 = LinearFVPressureCorrectionDiffusion
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
advected_interp_method_name = ${advected_interp_method}
[]
[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
advected_interp_method_name = ${advected_interp_method}
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'
[]
[]
- Model variants
- Bulk formulation
- Wall formulation
- Interaction with - equation and viscosity var element = document.getElementById("moose-equation-bad9f494-357c-4fb9-8809-1abbaf21c272");katex.render("\\epsilon", element, {displayMode:false,throwOnError:false,macros:{"\\eqc":"\\,,","\\eqp":"\\,.","\\pd":"\\frac{\\partial #1}{\\partial #2}","\\pr":"\\left(#1\\right)","\\ddt":"\\frac{d #1}{d t}"}});
- Input Parameters
- Input Files
- References