Wall function implementations for near-wall turbulence modeling. More...
Go to the source code of this file.
Macros | |
| #define | KAPPA 0.41 |
| von Karman constant (universal turbulence constant) | |
| #define | LOGLAW_B 5.5 |
| Log-law intercept constant B for smooth walls. | |
| #define | WERNER_A 8.3 |
| Werner-Wengle power-law coefficient A and exponent B in u+ = A (y+)^B. | |
| #define | WERNER_B (1.0 / 7.0) |
| #define | WERNER_SUBLAYER_YPLUS (pow(WERNER_A, 1.0 / (1.0 - WERNER_B))) |
| Werner-Wengle sublayer edge: where u+ = y+ meets u+ = A (y+)^B, at A^(1/(1-B)). | |
| #define | ROUGHNESS_TRANSITION_YPLUS 2.25 |
| Smooth-to-rough transition y+ threshold. | |
| #define | FULLY_ROUGH_YPLUS 90.0 |
| Fully rough regime y+ threshold. | |
| #define | DAMPING_COEFFICIENT 19.0 |
| Eddy viscosity damping coefficient (van Driest damping) | |
| #define | __FUNCT__ "taw_Werner" |
| #define | __FUNCT__ "u_Werner_explicit" |
Functions | |
| double | E_coeff (double friction_velocity, double roughness_height, double kinematic_viscosity) |
| Implementation of E_coeff(). | |
| static double | LogLawSublayerEdge (double E) |
| The log law's sublayer edge for a given E: the y+ where u+ = y+ meets u+ = ln(E y+)/kappa. | |
| double | u_hydset_roughness (double kinematic_viscosity, double wall_distance, double friction_velocity, double roughness_height) |
| Implementation of u_hydset_roughness(). | |
| double | f_hydset (double kinematic_viscosity, double known_velocity, double wall_distance, double friction_velocity_guess, double roughness_height) |
| Implementation of f_hydset(). | |
| double | df_hydset (double kinematic_viscosity, double known_velocity, double wall_distance, double friction_velocity_guess, double roughness_height) |
| Implementation of df_hydset(). | |
| double | find_utau_hydset (double kinematic_viscosity, double known_velocity, double wall_distance, double initial_guess, double roughness_height) |
| Implementation of find_utau_hydset(). | |
| double | nu_t (double yplus) |
| Implementation of nu_t(). | |
| double | integrate_1 (double kinematic_viscosity, double wall_distance, double friction_velocity, int integration_mode) |
| Implementation of integrate_1(). | |
| double | taw (double kinematic_viscosity, double friction_velocity, double wall_distance, double velocity, double pressure_gradient_tangent) |
| Implementation of taw(). | |
| double | u_Cabot (double kinematic_viscosity, double wall_distance, double friction_velocity, double pressure_gradient_tangent, double wall_shear_stress) |
| Implementation of u_Cabot(). | |
| double | f_Cabot (double kinematic_viscosity, double velocity, double wall_distance, double friction_velocity_guess, double pressure_gradient_tangent, double pressure_gradient_normal) |
| Implementation of f_Cabot(). | |
| double | df_Cabot (double kinematic_viscosity, double velocity, double wall_distance, double friction_velocity_guess, double pressure_gradient_tangent, double pressure_gradient_normal) |
| Implementation of df_Cabot(). | |
| void | find_utau_Cabot (double kinematic_viscosity, double velocity, double wall_distance, double initial_guess, double pressure_gradient_tangent, double pressure_gradient_normal, double *friction_velocity, double *wall_shear_velocity, double *wall_shear_normal) |
| Implementation of find_utau_Cabot(). | |
| double | u_Werner (double kinematic_viscosity, double wall_distance, double friction_velocity) |
| Implementation of u_Werner(). | |
| double | taw_Werner (double kinematic_viscosity, double velocity, double wall_distance) |
| Implementation of taw_Werner(). | |
| double | u_Werner_explicit (double kinematic_viscosity, double wall_distance, double wall_shear_stress) |
| Implementation of u_Werner_explicit(). | |
| double | find_utau_Werner (double kinematic_viscosity, double velocity, double wall_distance, double initial_guess) |
| Implementation of find_utau_Werner(). | |
Wall function implementations for near-wall turbulence modeling.
This file contains various wall function models that bridge the gap between the wall and the first computational grid point. Wall functions allow simulations to avoid resolving the viscous sublayer, reducing computational cost while maintaining reasonable accuracy for turbulent wall-bounded flows.
PHYSICAL BACKGROUND: The near-wall region in turbulent flows is characterized by three layers:
IMPLEMENTED MODELS (each a profile and the friction velocity that inverts it, which ApplyWallFunction() turns into the wall shear stress):
Definition in file wallfunction.c.
| #define KAPPA 0.41 |
von Karman constant (universal turbulence constant)
Definition at line 42 of file wallfunction.c.
| #define LOGLAW_B 5.5 |
Log-law intercept constant B for smooth walls.
Definition at line 45 of file wallfunction.c.
| #define WERNER_A 8.3 |
Werner-Wengle power-law coefficient A and exponent B in u+ = A (y+)^B.
Definition at line 48 of file wallfunction.c.
| #define WERNER_B (1.0 / 7.0) |
Definition at line 49 of file wallfunction.c.
Werner-Wengle sublayer edge: where u+ = y+ meets u+ = A (y+)^B, at A^(1/(1-B)).
The commonly quoted 11.81 is this value rounded, and rounding it leaves the two branches apart by about 2e-5 of u+, so the profile and its inverse jump there.
Definition at line 54 of file wallfunction.c.
| #define ROUGHNESS_TRANSITION_YPLUS 2.25 |
Smooth-to-rough transition y+ threshold.
Definition at line 57 of file wallfunction.c.
| #define FULLY_ROUGH_YPLUS 90.0 |
Fully rough regime y+ threshold.
Definition at line 60 of file wallfunction.c.
| #define DAMPING_COEFFICIENT 19.0 |
Eddy viscosity damping coefficient (van Driest damping)
Definition at line 63 of file wallfunction.c.
| #define __FUNCT__ "taw_Werner" |
Definition at line 470 of file wallfunction.c.
| #define __FUNCT__ "u_Werner_explicit" |
Definition at line 470 of file wallfunction.c.
| double E_coeff | ( | double | friction_velocity, |
| double | roughness_height, | ||
| double | kinematic_viscosity | ||
| ) |
Implementation of E_coeff().
Computes roughness-modified log-law coefficient E.
Definition at line 77 of file wallfunction.c.
|
inlinestatic |
The log law's sublayer edge for a given E: the y+ where u+ = y+ meets u+ = ln(E y+)/kappa.
Switching at a fixed 11.81 instead left the two branches apart by about 2.4% of u+ for a smooth wall (E = exp(kappa B)), so the profile jumped and the friction velocity it implies had two roots in a band of U y/nu. Switching where they meet keeps the profile continuous and increasing, so each reference speed has one friction velocity. Newton from 11.81 converges in a few steps for every E the roughness function produces.
Definition at line 115 of file wallfunction.c.
| double u_hydset_roughness | ( | double | kinematic_viscosity, |
| double | wall_distance, | ||
| double | friction_velocity, | ||
| double | roughness_height | ||
| ) |
Implementation of u_hydset_roughness().
Computes velocity from log-law for rough walls.
Definition at line 134 of file wallfunction.c.
| double f_hydset | ( | double | kinematic_viscosity, |
| double | known_velocity, | ||
| double | wall_distance, | ||
| double | friction_velocity_guess, | ||
| double | roughness_height | ||
| ) |
Implementation of f_hydset().
Residual function for friction velocity equation (log-law with roughness)
Definition at line 167 of file wallfunction.c.
| double df_hydset | ( | double | kinematic_viscosity, |
| double | known_velocity, | ||
| double | wall_distance, | ||
| double | friction_velocity_guess, | ||
| double | roughness_height | ||
| ) |
Implementation of df_hydset().
Numerical derivative of residual function.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/wallfunction.h.
Definition at line 193 of file wallfunction.c.
| double find_utau_hydset | ( | double | kinematic_viscosity, |
| double | known_velocity, | ||
| double | wall_distance, | ||
| double | initial_guess, | ||
| double | roughness_height | ||
| ) |
Implementation of find_utau_hydset().
Solves for friction velocity using Newton-Raphson iteration.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/wallfunction.h.
Definition at line 214 of file wallfunction.c.
| double nu_t | ( | double | yplus | ) |
Implementation of nu_t().
Computes turbulent eddy viscosity ratio (ν_t / ν)
Definition at line 267 of file wallfunction.c.
| double integrate_1 | ( | double | kinematic_viscosity, |
| double | wall_distance, | ||
| double | friction_velocity, | ||
| int | integration_mode | ||
| ) |
Implementation of integrate_1().
Integrates eddy viscosity profile from wall to distance y.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/wallfunction.h.
Definition at line 282 of file wallfunction.c.
| double taw | ( | double | kinematic_viscosity, |
| double | friction_velocity, | ||
| double | wall_distance, | ||
| double | velocity, | ||
| double | pressure_gradient_tangent | ||
| ) |
Implementation of taw().
Computes wall shear stress with pressure gradient effects.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/wallfunction.h.
Definition at line 317 of file wallfunction.c.
| double u_Cabot | ( | double | kinematic_viscosity, |
| double | wall_distance, | ||
| double | friction_velocity, | ||
| double | pressure_gradient_tangent, | ||
| double | wall_shear_stress | ||
| ) |
Implementation of u_Cabot().
Computes velocity using Cabot wall function.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/wallfunction.h.
Definition at line 334 of file wallfunction.c.
| double f_Cabot | ( | double | kinematic_viscosity, |
| double | velocity, | ||
| double | wall_distance, | ||
| double | friction_velocity_guess, | ||
| double | pressure_gradient_tangent, | ||
| double | pressure_gradient_normal | ||
| ) |
Implementation of f_Cabot().
Residual function for Cabot wall function.
Definition at line 348 of file wallfunction.c.
| double df_Cabot | ( | double | kinematic_viscosity, |
| double | velocity, | ||
| double | wall_distance, | ||
| double | friction_velocity_guess, | ||
| double | pressure_gradient_tangent, | ||
| double | pressure_gradient_normal | ||
| ) |
Implementation of df_Cabot().
Numerical derivative for Cabot wall function.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/wallfunction.h.
Definition at line 365 of file wallfunction.c.
| void find_utau_Cabot | ( | double | kinematic_viscosity, |
| double | velocity, | ||
| double | wall_distance, | ||
| double | initial_guess, | ||
| double | pressure_gradient_tangent, | ||
| double | pressure_gradient_normal, | ||
| double * | friction_velocity, | ||
| double * | wall_shear_velocity, | ||
| double * | wall_shear_normal | ||
| ) |
Implementation of find_utau_Cabot().
Solves for friction velocity using Cabot wall function.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/wallfunction.h.
Definition at line 388 of file wallfunction.c.
| double u_Werner | ( | double | kinematic_viscosity, |
| double | wall_distance, | ||
| double | friction_velocity | ||
| ) |
Implementation of u_Werner().
Computes velocity using Werner-Wengle wall function.
Definition at line 444 of file wallfunction.c.
| double taw_Werner | ( | double | kinematic_viscosity, |
| double | velocity, | ||
| double | wall_distance | ||
| ) |
Implementation of taw_Werner().
Wall shear stress from the cell-integrated Werner-Wengle relation.
Full API contract is documented with the header declaration in include/wallfunction.h.
Definition at line 476 of file wallfunction.c.
| double u_Werner_explicit | ( | double | kinematic_viscosity, |
| double | wall_distance, | ||
| double | wall_shear_stress | ||
| ) |
Implementation of u_Werner_explicit().
Wall-parallel velocity at a distance, from the Werner-Wengle wall stress.
Full API contract is documented with the header declaration in include/wallfunction.h.
Definition at line 514 of file wallfunction.c.
| double find_utau_Werner | ( | double | kinematic_viscosity, |
| double | velocity, | ||
| double | wall_distance, | ||
| double | initial_guess | ||
| ) |
Implementation of find_utau_Werner().
Friction velocity from a point velocity, inverting u_Werner() exactly.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/wallfunction.h.
Definition at line 552 of file wallfunction.c.