|
My Project
programmer's documentation
|
Go to the documentation of this file. 1 #ifndef __CS_WALL_FUNCTIONS_H__
2 #define __CS_WALL_FUNCTIONS_H__
143 const double ydvisc =
y / l_visc;
215 double ustarwer, ustarmin, ustaro, ydvisc;
224 reynolds =
vel * ydvisc;
250 ustaro =
CS_MAX(ustarwer, ustarmin);
255 for (iter = 0; iter < niter_max
256 && fabs(*
ustar - ustaro) >=
eps * ustaro; iter++) {
262 if (iter >= niter_max) {
263 bft_printf(
_(
"WARNING: non-convergence in the computation\n"
264 "******** of the friction velocity\n\n"
299 f_blend = exp(-0.25*cuv*pow(yp,3)) ;
300 uplus = f_blend*yp + (log(yp)/
ka +B)*(1.-exp(-pow(yp/y0,n)))*(1-f_blend);
323 dupdyp = exp(-0.25*cuv*pow(yp,3))
324 - 0.75*cuv*pow(yp,3.)*exp(-0.25*cuv*pow(yp,3.))
325 + n*(1.-exp(-0.25*cuv*pow(yp,3.)))*(pow(yp,n-1.)/pow(y0,n))*exp(-pow(yp/y0,n))*((1./
ka)*log(yp)+B)
326 + 0.75*cuv*pow(yp,2.)*exp(-0.25*cuv*pow(yp,3.))*(1.-exp(-pow(yp/y0,n)))*((1./
ka)*log(yp)+B)
327 + (1./
ka/yp)*(1.-exp(-pow(yp/y0,n)))*(1-exp(-0.25*cuv*pow(yp,3.))) ;
374 double Re, g, t_visc_durb;
389 + g * l_visc *
vel /
y);
397 if( *
yplus < 1.e-1 ) {
431 *
cofimp = 1. - *
ypup * (2.0 * sqrt( l_visc / t_visc_durb * dup1 * (1.0 - dup1) ) - dup2) ;
483 double rcprod, ml_visc, Re, g;
492 + g * l_visc *
vel /
y);
511 if (*
yplus > 1.e-12) {
569 double rcprod, ml_visc, Re, g;
577 + g * l_visc *
vel /
y);
629 static double aa[11] = {-0.0091921, 3.9577, 0.031578,
630 -0.51013, -2.3254, -0.72665,
631 2.969, 0.48506, -1.5944,
634 cs_real_t y1,y2,y3,y4,y5,y6,y7,y8,y9,y10, uplus;
636 y1 = 0.25 * log(
yplus);
717 double urplus, d_up, lmk15;
730 cs_real_t dyrp = 0.9 * (sqrt(krp) - krp * exp(-krp / 6.));
735 else if (dyrp <= 200.)
740 if (yrplus <= 1.e-1) {
755 }
else if (yrplus <= 200.) {
771 *
cofimp = 1. - (2. / (1. + *lmk) - 1. / (1. + lmk15)) * *
ypup;
790 *
cofimp = 1. - (2. / *lmk - 1. / lmk15) * *
ypup;
850 double rcprod, ml_visc, Re, g;
868 + g * l_visc *
vel / (
y + y0));
873 *
yplus = *
uk * (
y + y0) / effective_visc;
875 double yk = *
uk *
y / l_visc;
878 *
dplus = *
uk * y0 / effective_visc;
1014 const double epzero = 1.e-12;
1046 (*yplim) = pow(1000./
prl,1./3.);
1048 a2 = 15.*pow(
prl,2./3.);
1049 beta2 =
a2 - 500./ pow(yp2,2);
1098 const int ninter_max = 100;
1110 int npeff =
CS_MAX((
int)(ypint / ypmax * (
double)(ninter_max)), 1);
1112 double dy = ypint / (double)(npeff);
1117 for (
int ip = 1; ip <= npeff; ip++) {
1118 double yp = ypint * (double)(ip) / (double)(npeff);
1120 stplus += dy / (1. + prlrat * 0.5 * (nut1 + nut2));
1124 if (
yplus > ypint) {
1126 stplus += log( (1. + r*
yplus) / (1. + r*ypint)) / r;
1129 if (stplus >= 1.e-6)
1144 void CS_PROCF (wallfunctions, WALLFUNCTIONS)
double cs_turb_cmu025
Definition: cs_turbulence_model.c:434
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:200
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:511
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:293
Definition: cs_wall_functions.h:74
void const cs_real_t *const const cs_real_t *const prt
Definition: cs_wall_functions.h:1173
void const cs_lnum_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const cs_int_t cs_lnum_t cs_lnum_t cs_real_t cs_real_t cs_real_t * yplus
Definition: cs_wall_functions.h:1147
static void cs_wall_functions_2scales_continuous(cs_real_t rnnb, 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)
Continuous law of the wall between the linear and log law, with two velocity scales based on the fric...
Definition: cs_wall_functions.h:358
wall functions descriptor.
Definition: cs_wall_functions.h:81
const double cs_turb_cstlog_rough
Definition: cs_turbulence_model.c:404
double precision epzero
epsilon
Definition: cstnum.f90:40
const cs_turb_model_t * cs_glob_turb_model
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:550
static cs_real_t _vdriest_dupdyp_integral(cs_real_t yplus)
Definition: cs_wall_functions.h:626
Definition: cs_wall_functions.h:61
double precision, dimension(ncharm), save a2
Definition: cpincl.f90:233
#define END_C_DECLS
Definition: cs_defs.h:468
int itytur
Definition: cs_turbulence_model.h:99
#define _(String)
Definition: cs_defs.h:52
void const cs_lnum_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const cs_int_t cs_lnum_t cs_lnum_t cs_real_t cs_real_t cs_real_t cs_real_t cs_real_t * cofimp
Definition: cs_wall_functions.h:1147
double cs_real_t
Floating-point value.
Definition: cs_defs.h:302
const double cs_turb_bpow
Definition: cs_turbulence_model.c:420
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:320
cs_wall_functions_t * cs_get_glob_wall_functions(void)
Definition: cs_wall_functions.c:280
void const cs_lnum_t *const ifac
Definition: cs_wall_functions.h:1147
static cs_real_t _uplus(cs_real_t yp, cs_real_t ka, cs_real_t B, cs_real_t cuv, cs_real_t y0, cs_real_t n)
Definition: cs_wall_functions.h:290
Definition: cs_wall_functions.h:60
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
Definition: cs_wall_functions.h:73
void const cs_lnum_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const vel
Definition: cs_wall_functions.h:1147
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:1001
integer(c_int), pointer, save iwallf
Wall functions Indicates the type of wall function used for the velocity boundary conditions on a fri...
Definition: optcal.f90:614
Definition: cs_wall_functions.h:62
const double cs_turb_vdriest
Definition: cs_turbulence_model.c:382
cs_wall_f_s_type_t
Definition: cs_wall_functions.h:71
void const cs_lnum_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const cs_int_t cs_lnum_t * nsubla
Definition: cs_wall_functions.h:1147
void const cs_lnum_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const roughness
Definition: cs_wall_functions.h:1147
double ypluli
Definition: cs_wall_functions.h:92
int iwallt
Definition: cs_wall_functions.h:87
Definition: cs_field_pointer.h:71
#define CS_MIN(a, b)
Definition: cs_defs.h:430
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:
Definition: cs_wall_functions.h:1090
double cs_turb_crij1
Definition: cs_turbulence_model.c:478
Definition: cs_wall_functions.h:64
void const cs_lnum_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const y
Definition: cs_wall_functions.h:1147
double cs_turb_crij2
Definition: cs_turbulence_model.c:484
double cs_turb_dpow
Definition: cs_turbulence_model.c:423
Definition: cs_wall_functions.h:67
void const cs_lnum_t *const const cs_real_t *const viscosity
Definition: cs_wall_functions.h:1147
void const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const cs_real_t * htur
Definition: cs_wall_functions.h:1173
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
void const cs_lnum_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const cs_int_t cs_lnum_t cs_lnum_t cs_real_t cs_real_t cs_real_t cs_real_t cs_real_t cs_real_t * dplus
Definition: cs_wall_functions.h:1147
void CS_PROCF(wallfunctions, WALLFUNCTIONS)(const cs_int_t *const iwallf
const double cs_turb_cstlog
Definition: cs_turbulence_model.c:393
void const cs_lnum_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const cs_int_t * iuntur
Definition: cs_wall_functions.h:1147
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:830
void const cs_lnum_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const cs_int_t cs_lnum_t cs_lnum_t * nlogla
Definition: cs_wall_functions.h:1147
#define CS_UNUSED(x)
Definition: cs_defs.h:453
double cs_turb_cstlog_alpha
Definition: cs_turbulence_model.c:414
Definition: cs_wall_functions.h:66
void const cs_lnum_t *const const cs_real_t *const const cs_real_t *const t_visc
Definition: cs_wall_functions.h:1147
cs_wall_f_type_t iwallf
Definition: cs_wall_functions.h:83
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:700
void const cs_lnum_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const cs_int_t cs_lnum_t cs_lnum_t cs_real_t * ustar
Definition: cs_wall_functions.h:1147
Definition: cs_wall_functions.h:63
int cs_int_t
Fortran-compatible integer.
Definition: cs_defs.h:301
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:129
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:467
void const cs_real_t *const prl
Definition: cs_wall_functions.h:1173
void const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const cs_real_t cs_real_t * yplim
Definition: cs_wall_functions.h:1173
const double cs_turb_apow
Definition: cs_turbulence_model.c:417
Definition: cs_wall_functions.h:65
#define CS_MAX(a, b)
Definition: cs_defs.h:431
void const cs_lnum_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const cs_int_t cs_lnum_t cs_lnum_t cs_real_t cs_real_t * uk
Definition: cs_wall_functions.h:1147
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:930
integer(c_int), pointer, save iwalfs
Wall functions for scalar.
Definition: optcal.f90:619
double precision, dimension(4, npot), save ka
Definition: ppcpfu.f90:159
const double cs_turb_xkappa
Definition: cs_turbulence_model.c:373
cs_wall_f_s_type_t iwalfs
Definition: cs_wall_functions.h:85
const cs_wall_functions_t * cs_glob_wall_functions
void const cs_lnum_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const rnnb
Definition: cs_wall_functions.h:1147
void const cs_lnum_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const kinetic_en
Definition: cs_wall_functions.h:1147
void const cs_lnum_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const cs_int_t cs_lnum_t cs_lnum_t cs_real_t cs_real_t cs_real_t cs_real_t * ypup
Definition: cs_wall_functions.h:1147
static cs_real_t _dupdyp(cs_real_t yp, cs_real_t ka, cs_real_t B, cs_real_t cuv, cs_real_t y0, cs_real_t n)
Definition: cs_wall_functions.h:314
cs_wall_f_type_t
Definition: cs_wall_functions.h:58
int bft_printf(const char *const format,...)
Replacement for printf() with modifiable behavior.
Definition: bft_printf.c:140
double cs_turb_cmu
Definition: cs_turbulence_model.c:431