PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
 
Loading...
Searching...
No Matches
wallfunction.c
Go to the documentation of this file.
1/**
2 * @file wallfunction.c
3 * @brief Wall function implementations for near-wall turbulence modeling
4 *
5 * This file contains various wall function models that bridge the gap between
6 * the wall and the first computational grid point. Wall functions allow simulations
7 * to avoid resolving the viscous sublayer, reducing computational cost while
8 * maintaining reasonable accuracy for turbulent wall-bounded flows.
9 *
10 * PHYSICAL BACKGROUND:
11 * The near-wall region in turbulent flows is characterized by three layers:
12 * 1. Viscous sublayer (y+ < 5): Dominated by viscous effects, u+ = y+
13 * 2. Buffer layer (5 < y+ < 30): Transition region
14 * 3. Log-law region (y+ > 30): Inertial layer, u+ = (1/κ) ln(y+) + B
15 * where:
16 * u+ = u / u_τ (normalized velocity)
17 * y+ = y * u_τ / ν (normalized wall distance)
18 * u_τ = sqrt(τ_w / ρ) (friction velocity)
19 * κ ≈ 0.41 (von Karman constant)
20 * B ≈ 5.5 (log-law intercept for smooth walls)
21 *
22 * IMPLEMENTED MODELS (each a profile and the friction velocity that inverts it, which
23 * ApplyWallFunction() turns into the wall shear stress):
24 * - Werner-Wengle: Algebraic wall function
25 * - Log-law: Standard equilibrium wall function with roughness
26 * - Cabot: Non-equilibrium wall function with pressure gradient effects
27 *
28 * @author Original implementation adapted from legacy code
29 * @date Enhanced with comprehensive documentation
30 */
31
32#include "wallfunction.h"
33#include <math.h>
34#include <stdlib.h>
35#include <stdio.h>
36
37// ============================================================================
38// PHYSICAL CONSTANTS
39// ============================================================================
40
41/** @brief von Karman constant (universal turbulence constant) */
42#define KAPPA 0.41
43
44/** @brief Log-law intercept constant B for smooth walls */
45#define LOGLAW_B 5.5
46
47/** @brief Werner-Wengle power-law coefficient A and exponent B in u+ = A (y+)^B. */
48#define WERNER_A 8.3
49#define WERNER_B (1.0 / 7.0)
50
51/** @brief Werner-Wengle sublayer edge: where u+ = y+ meets u+ = A (y+)^B, at A^(1/(1-B)).
52 * The commonly quoted 11.81 is this value rounded, and rounding it leaves the two branches
53 * apart by about 2e-5 of u+, so the profile and its inverse jump there. */
54#define WERNER_SUBLAYER_YPLUS (pow(WERNER_A, 1.0 / (1.0 - WERNER_B)))
55
56/** @brief Smooth-to-rough transition y+ threshold */
57#define ROUGHNESS_TRANSITION_YPLUS 2.25
58
59/** @brief Fully rough regime y+ threshold */
60#define FULLY_ROUGH_YPLUS 90.0
61
62/** @brief Eddy viscosity damping coefficient (van Driest damping) */
63#define DAMPING_COEFFICIENT 19.0
64
65// ============================================================================
66// BASIC BOUNDARY CONDITION FUNCTIONS
67// ============================================================================
68
69// ============================================================================
70// ROUGHNESS-CORRECTED LOG-LAW FUNCTIONS
71// ============================================================================
72
73/**
74 * @brief Implementation of \ref E_coeff().
75 * @see E_coeff()
76 */
77double E_coeff(double friction_velocity, double roughness_height, double kinematic_viscosity)
78{
79 // Compute roughness Reynolds number
80 double roughness_reynolds = friction_velocity * roughness_height / kinematic_viscosity;
81
82 double roughness_correction;
83
84 if (roughness_reynolds <= ROUGHNESS_TRANSITION_YPLUS) {
85 // Hydraulically smooth regime: no correction needed
86 roughness_correction = 0.0;
87 }
88 else if (roughness_reynolds < FULLY_ROUGH_YPLUS) {
89 // Transitional regime: smooth interpolation using sine function
90 // This provides a gradual transition between smooth and rough wall behavior
91 double max_correction = LOGLAW_B - 8.5 + (1.0 / KAPPA) * log(roughness_reynolds);
92
93 roughness_correction = max_correction *
94 sin(0.4258 * (log(roughness_reynolds) - 0.811));
95 }
96 else {
97 // Fully rough regime: maximum correction
98 roughness_correction = LOGLAW_B - 8.5 + (1.0 / KAPPA) * log(roughness_reynolds);
99 }
100
101 // Return E = exp[κ(B - ΔB)]
102 return exp(KAPPA * (LOGLAW_B - roughness_correction));
103}
104
105/**
106 * @brief The log law's sublayer edge for a given E: the y+ where u+ = y+ meets
107 * u+ = ln(E y+)/kappa.
108 *
109 * Switching at a fixed 11.81 instead left the two branches apart by about 2.4% of u+ for a
110 * smooth wall (E = exp(kappa B)), so the profile jumped and the friction velocity it implies
111 * had two roots in a band of U y/nu. Switching where they meet keeps the profile continuous
112 * and increasing, so each reference speed has one friction velocity. Newton from 11.81
113 * converges in a few steps for every E the roughness function produces.
114 */
115static inline double LogLawSublayerEdge(double E)
116{
117 double y = 11.81;
118
119 for (int iteration = 0; iteration < 50; iteration++) {
120 const double g = y - log(E * y) / KAPPA;
121 const double dg = 1.0 - 1.0 / (KAPPA * y);
122 const double step = g / dg;
123
124 y -= step;
125 if (fabs(step) < 1.e-12 * y) break;
126 }
127 return y;
128}
129
130/**
131 * @brief Implementation of \ref u_hydset_roughness().
132 * @see u_hydset_roughness()
133 */
134double u_hydset_roughness(double kinematic_viscosity, double wall_distance,
135 double friction_velocity, double roughness_height)
136{
137 // Normalized wall distance
138 double yplus = friction_velocity * wall_distance / kinematic_viscosity;
139 const double E = E_coeff(friction_velocity, roughness_height, kinematic_viscosity);
140
141 double tangential_velocity;
142
143 /* The forward form of exactly the relation find_utau_hydset() inverts, at every y+:
144 the logarithmic branch continues above y+ = 300 as it does in the inverse. Whether
145 the first cell lies where the law describes the flow is the range check in
146 LogWallModelDiagnostics(), not a property of the profile. */
147 if (yplus <= LogLawSublayerEdge(E)) {
148 // Viscous sublayer: linear velocity profile
149 tangential_velocity = friction_velocity * yplus;
150 }
151 else {
152 // Log-layer: logarithmic velocity profile with roughness correction
153 tangential_velocity = (friction_velocity / KAPPA) * log(E * yplus);
154 }
155
156 return tangential_velocity;
157}
158
159// ============================================================================
160// NEWTON-RAPHSON SOLVER FOR FRICTION VELOCITY (LOG-LAW)
161// ============================================================================
162
163/**
164 * @brief Implementation of \ref f_hydset().
165 * @see f_hydset()
166 */
167double f_hydset(double kinematic_viscosity, double known_velocity,
168 double wall_distance, double friction_velocity_guess,
169 double roughness_height)
170{
171 double yplus = friction_velocity_guess * wall_distance / kinematic_viscosity;
172 double E = E_coeff(friction_velocity_guess, roughness_height, kinematic_viscosity);
173 double residual;
174
175 if (yplus <= LogLawSublayerEdge(E)) {
176 // Viscous sublayer: u = u_τ * y+
177 residual = friction_velocity_guess * yplus - known_velocity;
178 }
179 else {
180 // Log-layer: u = (u_τ / κ) * ln(E * y+)
181 residual = friction_velocity_guess * (1.0 / KAPPA * log(E * yplus)) - known_velocity;
182 }
183
184 return residual;
185}
186
187/**
188 * @brief Implementation of \ref df_hydset().
189 * @details Full API contract (arguments, ownership, side effects) is documented with
190 * the header declaration in `include/wallfunction.h`.
191 * @see df_hydset()
192 */
193double df_hydset(double kinematic_viscosity, double known_velocity,
194 double wall_distance, double friction_velocity_guess,
195 double roughness_height)
196{
197 const double perturbation = 1.e-7;
198
199 double f_plus = f_hydset(kinematic_viscosity, known_velocity, wall_distance,
200 friction_velocity_guess + perturbation, roughness_height);
201
202 double f_minus = f_hydset(kinematic_viscosity, known_velocity, wall_distance,
203 friction_velocity_guess - perturbation, roughness_height);
204
205 return (f_plus - f_minus) / (2.0 * perturbation);
206}
207
208/**
209 * @brief Implementation of \ref find_utau_hydset().
210 * @details Full API contract (arguments, ownership, side effects) is documented with
211 * the header declaration in `include/wallfunction.h`.
212 * @see find_utau_hydset()
213 */
214double find_utau_hydset(double kinematic_viscosity, double known_velocity,
215 double wall_distance, double initial_guess,
216 double roughness_height)
217{
218 double friction_velocity = initial_guess;
219 double friction_velocity_old = initial_guess;
220
221 const int max_iterations = 30;
222 const double convergence_tolerance = 1.e-7;
223
224 int iteration;
225 for (iteration = 0; iteration < max_iterations; iteration++) {
226 // Newton-Raphson update
227 double residual = f_hydset(kinematic_viscosity, known_velocity, wall_distance,
228 friction_velocity_old, roughness_height);
229 double derivative = df_hydset(kinematic_viscosity, known_velocity, wall_distance,
230 friction_velocity_old, roughness_height);
231 if (derivative == 0.0 || !isfinite(derivative)) break;
232
233 friction_velocity = friction_velocity_old - residual / derivative;
234 /* The friction velocity is positive. The linear branch's residual u_tau^2 y/nu - U
235 has a mirror root at -u_tau, which an undamped step from a small guess can reach
236 (a rough wall made it common); halving toward the last positive iterate keeps the
237 iteration on the physical root. */
238 if (!(friction_velocity > 0.0)) friction_velocity = 0.5 * friction_velocity_old;
239
240 // Check convergence
241 if (fabs(friction_velocity - friction_velocity_old) < convergence_tolerance) {
242 break;
243 }
244
245 friction_velocity_old = friction_velocity;
246 }
247
248 // Warn if convergence not achieved
249 if (iteration == max_iterations) {
251 "WARNING: u_tau iteration did not converge after %d iterations. "
252 "Final difference: %le\n",
253 iteration, fabs(friction_velocity - friction_velocity_old));
254 }
255
256 return friction_velocity;
257}
258
259// ============================================================================
260// TURBULENT EDDY VISCOSITY MODELS
261// ============================================================================
262
263/**
264 * @brief Implementation of \ref nu_t().
265 * @see nu_t()
266 */
267double nu_t(double yplus)
268{
269 // van Driest damping function: [1 - exp(-y+ / A+)]²
270 double damping_function = 1.0 - exp(-yplus / DAMPING_COEFFICIENT);
271
272 // Mixing length model: ν_t / ν = κ * y+ * D²
273 return KAPPA * yplus * damping_function * damping_function;
274}
275
276/**
277 * @brief Implementation of \ref integrate_1().
278 * @details Full API contract (arguments, ownership, side effects) is documented with
279 * the header declaration in `include/wallfunction.h`.
280 * @see integrate_1()
281 */
282double integrate_1(double kinematic_viscosity, double wall_distance,
283 double friction_velocity, int integration_mode)
284{
285 /* Composite Simpson in s, with y = wall_distance * s^2. The integrand falls off like
286 1/y+ across the log layer, so uniform points in y left the near-wall rise under-sampled:
287 30 of them were about 33% off at y+ = 1000. Clustering them toward the wall as s^2 does
288 makes the mapped integrand smooth at every y+ the model is allowed to reach. */
289 const int intervals = 128; /* even */
290 const double ds = 1.0 / intervals;
291 double integral_sum = 0.0;
292
293 for (int i = 0; i <= intervals; i++) {
294 const double s_value = i * ds;
295 const double current_distance = wall_distance * s_value * s_value;
296 const double jacobian = 2.0 * wall_distance * s_value; /* dy/ds */
297 const double yplus = current_distance * friction_velocity / kinematic_viscosity;
298 const double denominator = (1.0 + nu_t(fabs(yplus))) * kinematic_viscosity;
299 const double integrand = ((integration_mode == 0) ? 1.0 : current_distance) / denominator * jacobian;
300 const double weight = (i == 0 || i == intervals) ? 1.0 : ((i % 2) ? 4.0 : 2.0);
301
302 integral_sum += weight * integrand;
303 }
304 return integral_sum * ds / 3.0;
305}
306
307// ============================================================================
308// CABOT NON-EQUILIBRIUM WALL FUNCTION
309// ============================================================================
310
311/**
312 * @brief Implementation of \ref taw().
313 * @details Full API contract (arguments, ownership, side effects) is documented with
314 * the header declaration in `include/wallfunction.h`.
315 * @see taw()
316 */
317double taw(double kinematic_viscosity, double friction_velocity,
318 double wall_distance, double velocity, double pressure_gradient_tangent)
319{
320 // Compute integrated viscosity profiles
321 double F1 = integrate_1(kinematic_viscosity, wall_distance, friction_velocity, 0);
322 double Fy = integrate_1(kinematic_viscosity, wall_distance, friction_velocity, 1);
323
324 // Apply momentum balance: τ_w * F1 = u - (dp/dx) * Fy
325 return (1.0 / F1) * (velocity - pressure_gradient_tangent * Fy);
326}
327
328/**
329 * @brief Implementation of \ref u_Cabot().
330 * @details Full API contract (arguments, ownership, side effects) is documented with
331 * the header declaration in `include/wallfunction.h`.
332 * @see u_Cabot()
333 */
334double u_Cabot(double kinematic_viscosity, double wall_distance,
335 double friction_velocity, double pressure_gradient_tangent,
336 double wall_shear_stress)
337{
338 double F1 = integrate_1(kinematic_viscosity, wall_distance, friction_velocity, 0);
339 double Fy = integrate_1(kinematic_viscosity, wall_distance, friction_velocity, 1);
340
341 return wall_shear_stress * F1 + pressure_gradient_tangent * Fy;
342}
343
344/**
345 * @brief Implementation of \ref f_Cabot().
346 * @see f_Cabot()
347 */
348double f_Cabot(double kinematic_viscosity, double velocity, double wall_distance,
349 double friction_velocity_guess, double pressure_gradient_tangent,
350 double pressure_gradient_normal)
351{
352 (void)pressure_gradient_normal;
353 double wall_shear = taw(kinematic_viscosity, friction_velocity_guess,
354 wall_distance, velocity, pressure_gradient_tangent);
355
356 return friction_velocity_guess - sqrt(fabs(wall_shear));
357}
358
359/**
360 * @brief Implementation of \ref df_Cabot().
361 * @details Full API contract (arguments, ownership, side effects) is documented with
362 * the header declaration in `include/wallfunction.h`.
363 * @see df_Cabot()
364 */
365double df_Cabot(double kinematic_viscosity, double velocity, double wall_distance,
366 double friction_velocity_guess, double pressure_gradient_tangent,
367 double pressure_gradient_normal)
368{
369 const double perturbation = 1.e-7;
370
371 double f_plus = f_Cabot(kinematic_viscosity, velocity, wall_distance,
372 friction_velocity_guess + perturbation,
373 pressure_gradient_tangent, pressure_gradient_normal);
374
375 double f_minus = f_Cabot(kinematic_viscosity, velocity, wall_distance,
376 friction_velocity_guess - perturbation,
377 pressure_gradient_tangent, pressure_gradient_normal);
378
379 return (f_plus - f_minus) / (2.0 * perturbation);
380}
381
382/**
383 * @brief Implementation of \ref find_utau_Cabot().
384 * @details Full API contract (arguments, ownership, side effects) is documented with
385 * the header declaration in `include/wallfunction.h`.
386 * @see find_utau_Cabot()
387 */
388void find_utau_Cabot(double kinematic_viscosity, double velocity, double wall_distance,
389 double initial_guess, double pressure_gradient_tangent,
390 double pressure_gradient_normal, double *friction_velocity,
391 double *wall_shear_velocity, double *wall_shear_normal)
392{
393 double current_guess = initial_guess;
394 double new_guess;
395
396 const int max_iterations = 30;
397 const double convergence_tolerance = 1.e-10;
398
399 int iteration;
400 for (iteration = 0; iteration < max_iterations; iteration++) {
401 double residual = f_Cabot(kinematic_viscosity, velocity, wall_distance,
402 current_guess, pressure_gradient_tangent,
403 pressure_gradient_normal);
404
405 double derivative = df_Cabot(kinematic_viscosity, velocity, wall_distance,
406 current_guess, pressure_gradient_tangent,
407 pressure_gradient_normal);
408
409 new_guess = fabs(current_guess - residual / derivative);
410
411 if (fabs(current_guess - new_guess) < convergence_tolerance) {
412 break;
413 }
414
415 current_guess = new_guess;
416 }
417
418 if (fabs(current_guess - new_guess) > 1.e-5 && iteration >= 29) {
419 /* Per wall cell and step, so reported only the first time on each rank. */
420 static PetscBool reported = PETSC_FALSE;
421 if (!reported) {
422 reported = PETSC_TRUE;
424 "Cabot wall-function iteration reached its limit without the requested tolerance "
425 "(reported once per rank; later occurrences are not).\n");
426 }
427 }
428
429 *friction_velocity = new_guess;
430 *wall_shear_velocity = taw(kinematic_viscosity, new_guess, wall_distance,
431 velocity, pressure_gradient_tangent);
432 *wall_shear_normal = taw(kinematic_viscosity, new_guess, wall_distance,
433 0.0, pressure_gradient_normal);
434}
435
436// ============================================================================
437// WERNER-WENGLE ALGEBRAIC WALL FUNCTION
438// ============================================================================
439
440/**
441 * @brief Implementation of \ref u_Werner().
442 * @see u_Werner()
443 */
444double u_Werner(double kinematic_viscosity, double wall_distance,
445 double friction_velocity)
446{
447 /* The pointwise profile. ApplyWallFunction() takes the friction velocity from its exact
448 inverse, find_utau_Werner(), at the reference cell. */
449 double yplus = friction_velocity * wall_distance / kinematic_viscosity;
450
451 // Werner-Wengle constants
452 const double power_law_coefficient = WERNER_A;
453 const double power_law_exponent = WERNER_B;
454
455 double velocity;
456
457 if (yplus <= WERNER_SUBLAYER_YPLUS) {
458 // Viscous sublayer: u+ = y+
459 velocity = yplus * friction_velocity;
460 }
461 else {
462 // Power-law region: u+ = A * (y+)^B
463 velocity = power_law_coefficient * pow(yplus, power_law_exponent) * friction_velocity;
464 }
465
466 return velocity;
467}
468
469#undef __FUNCT__
470#define __FUNCT__ "taw_Werner"
471/**
472 * @brief Implementation of \ref taw_Werner().
473 * @details Full API contract is documented with the header declaration in
474 * `include/wallfunction.h`.
475 */
476double taw_Werner(double kinematic_viscosity, double velocity, double wall_distance)
477{
479 const double A = WERNER_A;
480 const double B = WERNER_B;
481 const double speed = fabs(velocity);
482 const double nu_over_y = kinematic_viscosity / wall_distance;
483
484 /* The switch is written in terms of the geometry alone. Expressing it through the
485 friction velocity, as the iterative residual does, makes the branch depend on the
486 answer and forces a Newton solve the closed form does not need. */
487 const double transition_speed = 0.5 * nu_over_y * pow(A, 2.0 / (1.0 - B));
488
489 if (speed <= transition_speed) {
490 /* Integrating u+ = y+ across the cell leaves the factor of two that separates
491 this from the pointwise relation tau_w = nu u / y. */
493 return 2.0 * kinematic_viscosity * speed / wall_distance;
494 }
495
496 {
497 const double term1 = 0.5 * (1.0 - B) * pow(A, (1.0 + B) / (1.0 - B)) *
498 pow(nu_over_y, 1.0 + B);
499 const double term2 = (1.0 + B) / A * pow(nu_over_y, B) * speed;
500
502 return pow(term1 + term2, 2.0 / (1.0 + B));
503 }
505}
506
507#undef __FUNCT__
508#define __FUNCT__ "u_Werner_explicit"
509/**
510 * @brief Implementation of \ref u_Werner_explicit().
511 * @details Full API contract is documented with the header declaration in
512 * `include/wallfunction.h`.
513 */
514double u_Werner_explicit(double kinematic_viscosity, double wall_distance,
515 double wall_shear_stress)
516{
518 const double A = WERNER_A;
519 const double B = WERNER_B;
520 const double stress = fabs(wall_shear_stress);
521 const double nu_over_y = kinematic_viscosity / wall_distance;
522
523 /* The same threshold as taw_Werner(), carried over to the stress side. The two
524 branches meet here exactly, so selecting on the stress cannot land on the wrong
525 side of the velocity switch. */
526 const double transition_stress = nu_over_y * nu_over_y * pow(A, 2.0 / (1.0 - B));
527
528 if (stress <= transition_stress) {
530 return stress * wall_distance / (2.0 * kinematic_viscosity);
531 }
532
533 {
534 const double offset = 0.5 * (1.0 - B) * pow(A, (1.0 + B) / (1.0 - B)) *
535 pow(nu_over_y, 1.0 + B);
536 /* Non-negative by construction above the threshold - it is zero only in the
537 limit of the switch - so the max guards roundoff, not a modelling case. */
538 const double bracket = PetscMax(pow(stress, 0.5 * (1.0 + B)) - offset, 0.0);
539
541 return A / (1.0 + B) * pow(1.0 / nu_over_y, B) * bracket;
542 }
544}
545
546/**
547 * @brief Implementation of \ref find_utau_Werner().
548 * @details Full API contract (arguments, ownership, side effects) is documented with
549 * the header declaration in `include/wallfunction.h`.
550 * @see find_utau_Werner()
551 */
552double find_utau_Werner(double kinematic_viscosity, double velocity,
553 double wall_distance, double initial_guess)
554{
555 const double A = WERNER_A;
556 const double B = WERNER_B;
557 const double speed = fabs(velocity);
558 const double y_over_nu = wall_distance / kinematic_viscosity;
559 (void)initial_guess;
560
561 /* The exact inverse of `u_Werner()`, branch for branch. Along that profile
562 U y / nu = (y+)^2 in the sublayer, so the branch it was evaluated on is decided by
563 the data alone: the sublayer holds while U y / nu <= WERNER_SUBLAYER_YPLUS^2, the
564 same switch `u_Werner()` applies to y+. Both branches then invert explicitly. */
565 if (speed * y_over_nu <= WERNER_SUBLAYER_YPLUS * WERNER_SUBLAYER_YPLUS) {
566 return sqrt(speed / y_over_nu); /* U = u_tau^2 y / nu */
567 }
568 return pow(speed / (A * pow(y_over_nu, B)), 1.0 / (1.0 + B)); /* U = A u_tau^(1+B) (y/nu)^B */
569}
570
571// ============================================================================
572// UTILITY FUNCTIONS
573// ============================================================================
574
575// ============================================================================
576// HIGH-LEVEL WALL FUNCTION INTERFACE FUNCTIONS
577// ============================================================================
578
#define LOCAL
Logging scope definitions for controlling message output.
Definition logging.h:45
#define LOG_ALLOW(scope, level, fmt,...)
Logging macro that checks both the log level and whether the calling function is in the allowed-funct...
Definition logging.h:214
#define PROFILE_HELPER_BEGIN
Marks the beginning of a profiled helper: timed only when enabled by name.
Definition logging.h:1014
#define PROFILE_HELPER_END
Alias of PROFILE_FUNCTION_END for a function that began with PROFILE_HELPER_BEGIN.
Definition logging.h:1033
@ LOG_WARNING
Non-critical issues that warrant attention.
Definition logging.h:30
@ LOG_DEBUG
Detailed debugging information.
Definition logging.h:32
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().
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 u_Werner(double kinematic_viscosity, double wall_distance, double friction_velocity)
Implementation of u_Werner().
double u_hydset_roughness(double kinematic_viscosity, double wall_distance, double friction_velocity, double roughness_height)
Implementation of u_hydset_roughness().
double u_Werner_explicit(double kinematic_viscosity, double wall_distance, double wall_shear_stress)
Implementation of u_Werner_explicit().
#define DAMPING_COEFFICIENT
Eddy viscosity damping coefficient (van Driest damping)
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 taw(double kinematic_viscosity, double friction_velocity, double wall_distance, double velocity, double pressure_gradient_tangent)
Implementation of taw().
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 u_Cabot(double kinematic_viscosity, double wall_distance, double friction_velocity, double pressure_gradient_tangent, double wall_shear_stress)
Implementation of u_Cabot().
#define ROUGHNESS_TRANSITION_YPLUS
Smooth-to-rough transition y+ threshold.
#define LOGLAW_B
Log-law intercept constant B for smooth walls.
#define WERNER_SUBLAYER_YPLUS
Werner-Wengle sublayer edge: where u+ = y+ meets u+ = A (y+)^B, at A^(1/(1-B)).
#define WERNER_A
Werner-Wengle power-law coefficient A and exponent B in u+ = A (y+)^B.
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 integrate_1(double kinematic_viscosity, double wall_distance, double friction_velocity, int integration_mode)
Implementation of integrate_1().
#define FULLY_ROUGH_YPLUS
Fully rough regime y+ threshold.
double f_hydset(double kinematic_viscosity, double known_velocity, double wall_distance, double friction_velocity_guess, double roughness_height)
Implementation of f_hydset().
double E_coeff(double friction_velocity, double roughness_height, double kinematic_viscosity)
Implementation of E_coeff().
#define WERNER_B
#define KAPPA
von Karman constant (universal turbulence constant)
double taw_Werner(double kinematic_viscosity, double velocity, double wall_distance)
Implementation of taw_Werner().
double nu_t(double yplus)
Implementation of nu_t().
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_Werner(double kinematic_viscosity, double velocity, double wall_distance, double initial_guess)
Implementation of find_utau_Werner().