1 #ifndef __CS_WALL_FUNCTIONS_H__ 2 #define __CS_WALL_FUNCTIONS_H__ 142 const double ydvisc = y / l_visc;
148 *yplus = *ustar * ydvisc;
151 if (*yplus <= ypluli) {
153 *ustar = sqrt(vel / ydvisc);
154 *yplus = *ustar * ydvisc;
214 double ustarwer, ustarmin, ustaro, ydvisc;
223 reynolds = vel * ydvisc;
230 if (reynolds <= ypluli * ypluli) {
232 *ustar = sqrt(vel / ydvisc);
233 *yplus = *ustar * ydvisc;
249 ustaro =
CS_MAX(ustarwer, ustarmin);
250 *ustar = (cs_turb_xkappa * vel + ustaro)
254 for (iter = 0; iter < niter_max
255 && fabs(*ustar - ustaro) >= eps * ustaro; iter++) {
257 *ustar = (cs_turb_xkappa * vel + ustaro)
261 if (iter >= niter_max) {
262 bft_printf(
_(
"WARNING: non-convergence in the computation\n" 263 "******** of the friction velocity\n\n" 265 "friction vel: %f \n" ), ifac, *ustar);
269 *yplus = *ustar * ydvisc;
271 *cofimp = 1. - *ypup / cs_turb_xkappa * 1.5 / *yplus;
319 double rcprod, ml_visc, Re, g;
324 Re = sqrt(kinetic_en) * y / l_visc;
328 + g * l_visc * vel / y);
330 *yplus = *uk * y / l_visc;
333 if (*yplus > ypluli) {
340 *cofimp = 1. - *ypup /
cs_turb_xkappa * ( 2. * rcprod - 1. / (2. * *yplus));
347 if (*yplus > 1.e-12) {
348 *ustar = fabs(vel / *yplus);
405 double rcprod, ml_visc, Re, g;
409 Re = sqrt(kinetic_en) * y / l_visc;
413 + g * l_visc * vel / y);
415 *yplus = *uk * y / l_visc;
419 *yplus = *uk * y / l_visc;
422 if (*yplus > ypluli) {
431 *dplus = ypluli - *yplus;
465 static double aa[11] = {-0.0091921, 3.9577, 0.031578,
466 -0.51013, -2.3254, -0.72665,
467 2.969, 0.48506, -1.5944,
470 cs_real_t y1,y2,y3,y4,y5,y6,y7,y8,y9,y10, uplus;
472 y1 = 0.25 * log(yplus);
553 double urplus, d_up, lmk15;
559 *yplus =
CS_MAX(*uk * y / l_visc, 1.e-4);
566 cs_real_t dyrp = 0.9 * (sqrt(krp) - krp * exp(-krp / 6.));
571 else if (dyrp <= 200.)
576 if (yrplus <= 1.e-1) {
591 }
else if (yrplus <= 200.) {
598 *ypup = *yplus / (urplus-d_up);
607 *cofimp = 1. - (2. / (1. + *lmk) - 1. / (1. + lmk15)) * *ypup;
617 *ypup = *yplus / (urplus-d_up);
626 *cofimp = 1. - (2. / *lmk - 1. / lmk15) * *ypup;
631 *ustar = vel / (urplus-d_up);
686 double rcprod, ml_visc, Re, g;
700 Re = sqrt(kinetic_en) * (y + y0) / l_visc;
704 + g * l_visc * vel / (y + y0));
708 *yplus = *uk * (y + y0) / effective_visc;
711 double yk = *uk * y / l_visc;
714 *dplus = *uk * y0 / effective_visc;
724 *dplus = ypluli - *yplus;
732 *ustar = vel / uplus;
738 *cofimp = 1. - (*yplus - *dplus) / uplus
788 *ustar = sqrt(vel * l_visc / y);
789 *yplus = *ustar * y / l_visc;
795 if (*yplus <= ypluli) {
850 const double epzero = 1.e-12;
860 (*htur) =
CS_MAX(yplus-dplus,epzero)/
CS_MAX(yplus,epzero);
870 if (yplus > (*yplim)) {
872 (*htur) = prl*(yplus-dplus)/tplus;
882 (*yplim) = pow(1000./prl,1./3.);
884 a2 = 15.*pow(prl,2./3.);
885 beta2 = a2 - 500./ pow(yp2,2);
887 if (yplus >= (*yplim) && yplus < yp2) {
888 tplus = a2 - 500./(yplus*yplus);
889 (*htur) = prl*(yplus-dplus)/tplus;
894 (*htur) = prl*(yplus-dplus)/tplus;
934 const int ninter_max = 100;
946 int npeff =
CS_MAX((
int)(ypint / ypmax * (
double)(ninter_max)), 1);
948 double dy = ypint / (double)(npeff);
953 for (
int ip = 1; ip <= npeff; ip++) {
954 double yp = ypint * (double)(ip) / (double)(npeff);
956 stplus += dy / (1. + prlrat * 0.5 * (nut1 + nut2));
962 stplus += log( (1. + r*yplus) / (1. + r*ypint)) / r;
966 *htur = yplus / stplus;
const double cs_turb_cstlog_rough
Definition: cs_turbulence_model.c:326
const double cs_turb_xkappa
Definition: cs_turbulence_model.c:295
double precision epzero
epsilon
Definition: cstnum.f90:40
cs_wall_f_type_t iwallf
Definition: cs_wall_functions.h:82
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 roughness, 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
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:386
#define BEGIN_C_DECLS
Definition: cs_defs.h:448
integer(c_int), pointer, save iwalfs
Wall functions for scalar.
Definition: optcal.f90:556
int cs_int_t
Fortran-compatible integer.
Definition: cs_defs.h:295
#define CS_UNUSED(x)
Definition: cs_defs.h:435
double cs_turb_cmu025
Definition: cs_turbulence_model.c:356
static cs_real_t _vdriest_dupdyp_integral(cs_real_t yplus)
Definition: cs_wall_functions.h:462
cs_wall_functions_t * cs_get_glob_wall_functions(void)
Definition: cs_wall_functions.c:263
Definition: cs_wall_functions.h:72
Definition: cs_wall_functions.h:61
double precision, dimension(ncharm), save a2
Definition: cpincl.f90:233
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:233
Definition: cs_wall_functions.h:60
double cs_turb_dpow
Definition: cs_turbulence_model.c:345
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 roughness, 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:303
double cs_real_t
Floating-point value.
Definition: cs_defs.h:296
const double cs_turb_bpow
Definition: cs_turbulence_model.c:342
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:837
cs_wall_f_s_type_t
Definition: cs_wall_functions.h:70
Definition: cs_wall_functions.h:64
const double cs_turb_vdriest
Definition: cs_turbulence_model.c:304
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:926
double cs_turb_cstlog_alpha
Definition: cs_turbulence_model.c:336
#define CS_MIN(a, b)
Definition: cs_defs.h:412
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:284
integer(c_int), pointer, save iwallf
Wall functions.
Definition: optcal.f90:551
static void cs_wall_functions_2scales_smooth_rough(cs_real_t l_visc, cs_real_t t_visc, cs_real_t vel, cs_real_t y, cs_real_t roughness, 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)
Two velocity scales wall function with automatic switch from rough to smooth.
Definition: cs_wall_functions.h:666
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:128
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:536
#define END_C_DECLS
Definition: cs_defs.h:449
wall functions descriptor.
Definition: cs_wall_functions.h:80
#define _(String)
Definition: cs_defs.h:52
Definition: cs_wall_functions.h:66
const double cs_turb_cstlog
Definition: cs_turbulence_model.c:315
#define CS_PROCF(x, y)
Definition: cs_defs.h:472
#define CS_MAX(a, b)
Definition: cs_defs.h:413
int iwallt
Definition: cs_wall_functions.h:86
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:303
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:766
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:84
Definition: cs_field_pointer.h:70
double ypluli
Definition: cs_wall_functions.h:91
cs_wall_f_type_t
Definition: cs_wall_functions.h:58
Definition: cs_wall_functions.h:73
const double cs_turb_crij1
Definition: cs_turbulence_model.c:400
const double cs_turb_crij2
Definition: cs_turbulence_model.c:406
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:199
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:478
Definition: cs_wall_functions.h:65
const double cs_turb_apow
Definition: cs_turbulence_model.c:339