1 #ifndef __CS_WALL_FUNCTIONS_H__
2 #define __CS_WALL_FUNCTIONS_H__
141 const double ydvisc = y / l_visc;
147 *yplus = *ustar * ydvisc;
150 if (*yplus <= ypluli) {
152 *ustar = sqrt(vel / ydvisc);
153 *yplus = *ustar * ydvisc;
213 double ustarwer, ustarmin, ustaro, ydvisc;
222 reynolds = vel * ydvisc;
229 if (reynolds <= ypluli * ypluli) {
231 *ustar = sqrt(vel / ydvisc);
232 *yplus = *ustar * ydvisc;
248 ustaro =
CS_MAX(ustarwer, ustarmin);
249 *ustar = (cs_turb_xkappa * vel + ustaro)
253 for (iter = 0; iter < niter_max
254 && fabs(*ustar - ustaro) >= eps * ustaro; iter++) {
256 *ustar = (cs_turb_xkappa * vel + ustaro)
260 if (iter >= niter_max) {
261 bft_printf(
_(
"WARNING: non-convergence in the computation\n"
262 "******** of the friction velocity\n\n"
264 "friction vel: %f \n" ), ifac, *ustar);
268 *yplus = *ustar * ydvisc;
270 *cofimp = 1. - *ypup / cs_turb_xkappa * 1.5 / *yplus;
318 double rcprod, ml_visc, Re, g;
323 Re = sqrt(kinetic_en) * y / l_visc;
327 + g * l_visc * vel / y);
329 *yplus = *uk * y / l_visc;
332 if (*yplus > ypluli) {
339 *cofimp = 1. - *ypup /
cs_turb_xkappa * ( 2. * rcprod - 1. / (2. * *yplus));
346 if (*yplus > 1.e-12) {
347 *ustar = fabs(vel / *yplus);
402 double rcprod, ml_visc, Re, g;
406 Re = sqrt(kinetic_en) * y / l_visc;
410 + g * l_visc * vel / y);
412 *yplus = *uk * y / l_visc;
416 *yplus = *uk * y / l_visc;
419 if (*yplus > ypluli) {
428 *dplus = ypluli - *yplus;
462 static double aa[11] = {-0.0091921, 3.9577, 0.031578,
463 -0.51013, -2.3254, -0.72665,
464 2.969, 0.48506, -1.5944,
467 cs_real_t y1,y2,y3,y4,y5,y6,y7,y8,y9,y10, uplus;
469 y1 = 0.25 * log(yplus);
550 double urplus, dup, lmk15;
556 *yplus =
CS_MAX(*uk * y / l_visc, 1.e-4);
563 cs_real_t dyrp = 0.9 * (sqrt(krp) - krp * exp(-krp / 6.));
568 else if (dyrp <= 200.)
573 if (yrplus <= 1.e-1) {
588 }
else if (yrplus <= 200.) {
595 *ypup = *yplus / (urplus-dup);
604 *cofimp = 1. - (2. / (1. + *lmk) - 1. / (1. + lmk15)) * *ypup;
614 *ypup = *yplus / (urplus-dup);
623 *cofimp = 1. - (2. / *lmk - 1. / lmk15) * *ypup;
628 *ustar = vel / (urplus-dup);
672 *ustar = sqrt(vel * l_visc / y);
673 *yplus = *ustar * y / l_visc;
675 *ypup = l_visc / (l_visc + t_visc);
679 if (*yplus <= ypluli) {
734 const double epzero = 1.e-12;
744 (*htur) =
CS_MAX(yplus-dplus,epzero)/
CS_MAX(yplus,epzero);
754 if (yplus > (*yplim)) {
756 (*htur) = prl*(yplus-dplus)/tplus;
766 (*yplim) = pow(1000./prl,1./3.);
768 a2 = 15.*pow(prl,2./3.);
769 beta2 = a2 - 500./ pow(yp2,2);
771 if (yplus >= (*yplim) && yplus < yp2) {
772 tplus = a2 - 500./(yplus*yplus);
773 (*htur) = prl*(yplus-dplus)/tplus;
778 (*htur) = prl*(yplus-dplus)/tplus;
818 const int ninter_max = 100;
830 int npeff =
CS_MAX((
int)(ypint / ypmax * (
double)(ninter_max)), 1);
832 double dy = ypint / (double)(npeff);
837 for (
int ip = 1; ip <= npeff; ip++) {
838 double yp = ypint * (double)(ip) / (double)(npeff);
840 stplus += dy / (1. + prlrat * 0.5 * (nut1 + nut2));
846 stplus += log( (1. + r*yplus) / (1. + r*ypint)) / r;
850 *htur = yplus / stplus;
const double cs_turb_xkappa
Definition: cs_turbulence_model.c:272
double precision epzero
epsilon
Definition: cstnum.f90:40
cs_wall_f_type_t iwallf
Definition: cs_wall_functions.h:81
static void cs_wall_functions_2scales_scalable(cs_real_t l_visc, cs_real_t t_visc, cs_real_t vel, cs_real_t y, cs_real_t kinetic_en, int *iuntur, cs_lnum_t *nsubla, cs_lnum_t *nlogla, cs_real_t *ustar, cs_real_t *uk, cs_real_t *yplus, cs_real_t *dplus, cs_real_t *ypup, cs_real_t *cofimp)
Scalable wall function: shift the wall if .
Definition: cs_wall_functions.h:385
void cs_wall_functions_velocity(cs_wall_f_type_t iwallf, cs_lnum_t ifac, cs_real_t l_visc, cs_real_t t_visc, cs_real_t vel, cs_real_t y, cs_real_t rnnb, cs_real_t kinetic_en, int *iuntur, cs_lnum_t *nsubla, cs_lnum_t *nlogla, cs_real_t *ustar, cs_real_t *uk, cs_real_t *yplus, cs_real_t *ypup, cs_real_t *cofimp, cs_real_t *dplus)
Compute the friction velocity and / .
Definition: cs_wall_functions.c:288
#define BEGIN_C_DECLS
Definition: cs_defs.h:419
integer(c_int), pointer, save iwalfs
Wall functions for scalar.
Definition: optcal.f90:562
int cs_int_t
Fortran-compatible integer.
Definition: cs_defs.h:295
double cs_turb_cmu025
Definition: cs_turbulence_model.c:312
static cs_real_t _vdriest_dupdyp_integral(cs_real_t yplus)
Definition: cs_wall_functions.h:459
Definition: cs_wall_functions.h:71
Definition: cs_wall_functions.h:61
double precision, dimension(ncharm), save a2
Definition: cpincl.f90:226
void hturbp(const cs_int_t *const iwalfs, const cs_real_t *const prl, const cs_real_t *const prt, const cs_real_t *const yplus, const cs_real_t *const dplus, cs_real_t *htur, cs_real_t *yplim)
Definition: cs_wall_functions.c:231
Definition: cs_wall_functions.h:60
double cs_turb_dpow
Definition: cs_turbulence_model.c:301
const double cs_turb_bpow
Definition: cs_turbulence_model.c:298
Definition: cs_wall_functions.h:62
static void cs_wall_functions_s_arpaci_larsen(cs_real_t prl, cs_real_t prt, cs_real_t yplus, cs_real_t dplus, cs_real_t *htur, cs_real_t *yplim)
The correction of the exchange coefficient is computed thanks to a similarity model between dynamic v...
Definition: cs_wall_functions.h:721
cs_wall_f_s_type_t
Definition: cs_wall_functions.h:69
Definition: cs_wall_functions.h:64
const double cs_turb_vdriest
Definition: cs_turbulence_model.c:281
static void cs_wall_functions_s_vdriest(cs_real_t prl, cs_real_t prt, cs_real_t yplus, cs_real_t *htur)
The correction of the exchange coefficient is computed thanks to a numerical integration of: with ...
Definition: cs_wall_functions.h:810
#define CS_MIN(a, b)
Definition: cs_defs.h:392
real(c_double), pointer, save ypluli
limit value of for the viscous sublayer. ypluli depends on the chosen wall function: it is initializ...
Definition: cstphy.f90:249
integer(c_int), pointer, save iwallf
Wall functions.
Definition: optcal.f90:557
void wallfunctions(const cs_int_t *const iwallf, const cs_lnum_t *const ifac, const cs_real_t *const viscosity, const cs_real_t *const t_visc, const cs_real_t *const vel, const cs_real_t *const y, const cs_real_t *const rnnb, const cs_real_t *const kinetic_en, cs_int_t *iuntur, cs_lnum_t *nsubla, cs_lnum_t *nlogla, cs_real_t *ustar, cs_real_t *uk, cs_real_t *yplus, cs_real_t *ypup, cs_real_t *cofimp, cs_real_t *dplus)
Definition: cs_wall_functions.c:185
Definition: cs_wall_functions.h:63
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:292
static void cs_wall_functions_1scale_power(cs_real_t l_visc, cs_real_t vel, cs_real_t y, int *iuntur, cs_lnum_t *nsubla, cs_lnum_t *nlogla, cs_real_t *ustar, cs_real_t *uk, cs_real_t *yplus, cs_real_t *ypup, cs_real_t *cofimp)
Power law: Werner & Wengle.
Definition: cs_wall_functions.h:127
static void cs_wall_functions_2scales_vdriest(cs_real_t rnnb, cs_real_t l_visc, cs_real_t vel, cs_real_t y, cs_real_t kinetic_en, int *iuntur, cs_lnum_t *nsubla, cs_lnum_t *nlogla, cs_real_t *ustar, cs_real_t *uk, cs_real_t *yplus, cs_real_t *ypup, cs_real_t *cofimp, cs_real_t *lmk, cs_real_t kr, bool wf)
Two velocity scales wall function using Van Driest mixing length.
Definition: cs_wall_functions.h:533
#define END_C_DECLS
Definition: cs_defs.h:420
wall functions descriptor.
Definition: cs_wall_functions.h:79
#define _(String)
Definition: cs_defs.h:52
double cs_real_t
Definition: cs_defs.h:296
const double cs_turb_cstlog
Definition: cs_turbulence_model.c:292
#define CS_PROCF(x, y)
Definition: cs_defs.h:443
#define CS_MAX(a, b)
Definition: cs_defs.h:393
int iwallt
Definition: cs_wall_functions.h:85
static void cs_wall_functions_2scales_log(cs_real_t l_visc, cs_real_t t_visc, cs_real_t vel, cs_real_t y, cs_real_t kinetic_en, int *iuntur, cs_lnum_t *nsubla, cs_lnum_t *nlogla, cs_real_t *ustar, cs_real_t *uk, cs_real_t *yplus, cs_real_t *ypup, cs_real_t *cofimp)
Log law: piecewise linear and log, with two velocity scales based on the friction and the turbulent k...
Definition: cs_wall_functions.h:302
static void cs_wall_functions_disabled(cs_real_t l_visc, cs_real_t t_visc, cs_real_t vel, cs_real_t y, int *iuntur, cs_lnum_t *nsubla, cs_lnum_t *nlogla, cs_real_t *ustar, cs_real_t *uk, cs_real_t *yplus, cs_real_t *dplus, cs_real_t *ypup, cs_real_t *cofimp)
No wall function.
Definition: cs_wall_functions.h:654
int bft_printf(const char *const format,...)
Replacement for printf() with modifiable behavior.
Definition: bft_printf.c:140
cs_wall_f_s_type_t iwalfs
Definition: cs_wall_functions.h:83
Definition: cs_field_pointer.h:70
double ypluli
Definition: cs_wall_functions.h:90
cs_wall_f_type_t
Definition: cs_wall_functions.h:58
Definition: cs_wall_functions.h:72
const double cs_turb_crij1
Definition: cs_turbulence_model.c:356
const double cs_turb_crij2
Definition: cs_turbulence_model.c:362
static void cs_wall_functions_1scale_log(cs_lnum_t ifac, cs_real_t l_visc, cs_real_t vel, cs_real_t y, int *iuntur, cs_lnum_t *nsubla, cs_lnum_t *nlogla, cs_real_t *ustar, cs_real_t *uk, cs_real_t *yplus, cs_real_t *ypup, cs_real_t *cofimp)
Log law: piecewise linear and log, with one velocity scale based on the friction. ...
Definition: cs_wall_functions.h:198
const cs_wall_functions_t * cs_glob_wall_functions
void cs_wall_functions_scalar(cs_wall_f_s_type_t iwalfs, cs_real_t prl, cs_real_t prt, cs_real_t yplus, cs_real_t dplus, cs_real_t *htur, cs_real_t *yplim)
Compute the correction of the exchange coefficient between the fluid and the wall for a turbulent flo...
Definition: cs_wall_functions.c:446
Definition: cs_wall_functions.h:65
const double cs_turb_apow
Definition: cs_turbulence_model.c:295