Go to the source code of this file.
Data Structures | |
struct | cs_wall_functions_t |
wall functions descriptor. More... | |
Enumerations | |
enum | cs_wall_f_type_t { CS_WALL_F_UNSET = -999 , CS_WALL_F_DISABLED = 0 , CS_WALL_F_1SCALE_POWER = 1 , CS_WALL_F_1SCALE_LOG = 2 , CS_WALL_F_2SCALES_LOG = 3 , CS_WALL_F_SCALABLE_2SCALES_LOG = 4 , CS_WALL_F_2SCALES_VDRIEST = 5 , CS_WALL_F_2SCALES_SMOOTH_ROUGH = 6 , CS_WALL_F_2SCALES_CONTINUOUS = 7 } |
enum | cs_wall_f_s_type_t { CS_WALL_F_S_UNSET = -999 , CS_WALL_F_S_ARPACI_LARSEN = 0 , CS_WALL_F_S_VDRIEST = 1 , CS_WALL_F_S_LOUIS = 2 , CS_WALL_F_S_MONIN_OBUKHOV = 3 , CS_WALL_F_S_SMOOTH_ROUGH = 4 } |
Functions | |
static void | cs_wall_functions_1scale_power (cs_real_t l_visc, cs_real_t vel, cs_real_t y, int *iuntur, cs_gnum_t *nsubla, cs_gnum_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. More... | |
static void | cs_wall_functions_1scale_log (cs_real_t l_visc, cs_real_t vel, cs_real_t y, int *iuntur, cs_gnum_t *nsubla, cs_gnum_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. More... | |
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) |
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) |
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_gnum_t *nsubla, cs_gnum_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 friction and the turbulent kinetic energy. Can be used with RANS model either in high Reynolds or in low Reynolds (if the underlying RANS model is compatible). More... | |
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_gnum_t *nsubla, cs_gnum_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 kinetic energy. More... | |
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_gnum_t *nsubla, cs_gnum_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 ![]() | |
static cs_real_t | _vdriest_dupdyp_integral (cs_real_t yplus) |
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_gnum_t *nsubla, cs_gnum_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. More... | |
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 rough_d, cs_real_t kinetic_en, int *iuntur, cs_gnum_t *nsubla, cs_gnum_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. More... | |
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_gnum_t *nsubla, cs_gnum_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. More... | |
static void | cs_wall_functions_s_arpaci_larsen (cs_real_t l_visc, cs_real_t prl, cs_real_t prt, cs_real_t rough_t, cs_real_t uk, 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 viscous sub-layer and themal sub-layer. More... | |
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 ![]() | |
static void | cs_wall_functions_s_smooth_rough (cs_real_t l_visc, cs_real_t prl, cs_real_t prt, cs_real_t rough_t, cs_real_t uk, cs_real_t yplus, cs_real_t dplus, cs_real_t *htur) |
Rough Smooth Thermal Wall Function - Prototype. More... | |
void | wallfunctions (const int *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 rough_d, const cs_real_t *const rnnb, const cs_real_t *const 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) |
void | hturbp (const int *const iwalfs, const cs_real_t *const l_visc, const cs_real_t *const prl, const cs_real_t *const prt, const cs_real_t *const rough_t, const cs_real_t *const uk, const cs_real_t *const yplus, const cs_real_t *const dplus, cs_real_t *htur, cs_real_t *yplim) |
cs_wall_functions_t * | cs_get_glob_wall_functions (void) |
void | cs_wall_functions_velocity (cs_wall_f_type_t iwallf, cs_real_t l_visc, cs_real_t t_visc, cs_real_t vel, cs_real_t y, cs_real_t rough_d, cs_real_t rnnb, cs_real_t kinetic_en, int *iuntur, cs_gnum_t *nsubla, cs_gnum_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 ![]() ![]() | |
void | cs_wall_functions_scalar (cs_wall_f_s_type_t iwalfs, cs_real_t l_visc, cs_real_t prl, cs_real_t prt, cs_real_t rough_t, cs_real_t uk, 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 flow. More... | |
void | cs_immersed_boundary_wall_functions (int f_id, cs_real_t *st_exp, cs_real_t *st_imp) |
Compute boundary contributions for all immersed boundaries. More... | |
Variables | |
const cs_wall_functions_t * | cs_glob_wall_functions |
enum cs_wall_f_s_type_t |
enum cs_wall_f_type_t |
|
inlinestatic |
|
inlinestatic |
cs_wall_functions_t* cs_get_glob_wall_functions | ( | void | ) |
Compute boundary contributions for all immersed boundaries.
[in] | f_id | field id of the variable |
[out] | st_exp | explicit source term |
[out] | st_imp | implicit part of the source term |
This is similar to clptur.
[in] | f_id | field id of the variable |
[out] | st_exp | explicit source term |
[out] | st_imp | implicit part of the source term |
|
inlinestatic |
Log law: piecewise linear and log, with one velocity scale based on the friction.
[in] | ifac | face number |
[in] | l_visc | kinematic viscosity |
[in] | vel | wall projected cell center velocity |
[in] | y | wall distance |
[out] | iuntur | indicator: 0 in the viscous sublayer |
[out] | nsubla | counter of cell in the viscous sublayer |
[out] | nlogla | counter of cell in the log-layer |
[out] | ustar | friction velocity |
[out] | uk | friction velocity |
[out] | yplus | dimensionless distance to the wall |
[out] | ypup | yplus projected vel ratio |
[out] | cofimp | ![]() |
|
inlinestatic |
Power law: Werner & Wengle.
[in] | l_visc | kinematic viscosity |
[in] | vel | wall projected cell center velocity |
[in] | y | wall distance |
[out] | iuntur | indicator: 0 in the viscous sublayer |
[out] | nsubla | counter of cell in the viscous sublayer |
[out] | nlogla | counter of cell in the log-layer |
[out] | ustar | friction velocity |
[out] | uk | friction velocity |
[out] | yplus | dimensionless distance to the wall |
[out] | ypup | yplus projected vel ratio |
[out] | cofimp | ![]() |
|
inlinestatic |
Continuous law of the wall between the linear and log law, with two velocity scales based on the friction and the turbulent kinetic energy. Can be used with RANS model either in high Reynolds or in low Reynolds (if the underlying RANS model is compatible).
[in] | rnnb | ![]() |
[in] | l_visc | kinematic viscosity |
[in] | t_visc | turbulent kinematic viscosity |
[in] | vel | wall projected cell center velocity |
[in] | y | wall distance |
[in] | kinetic_en | turbulent kinetic energy |
[out] | iuntur | indicator: 0 in the viscous sublayer |
[out] | nsubla | counter of cell in the viscous sublayer |
[out] | nlogla | counter of cell in the log-layer |
[out] | ustar | friction velocity |
[out] | uk | friction velocity |
[out] | yplus | dimensionless distance to the wall |
[out] | ypup | yplus projected vel ratio |
[out] | cofimp | ![]() |
|
inlinestatic |
Log law: piecewise linear and log, with two velocity scales based on the friction and the turbulent kinetic energy.
[in] | l_visc | kinematic viscosity |
[in] | t_visc | turbulent kinematic viscosity |
[in] | vel | wall projected cell center velocity |
[in] | y | wall distance |
[in] | kinetic_en | turbulent kinetic energy |
[out] | iuntur | indicator: 0 in the viscous sublayer |
[out] | nsubla | counter of cell in the viscous sublayer |
[out] | nlogla | counter of cell in the log-layer |
[out] | ustar | friction velocity |
[out] | uk | friction velocity |
[out] | yplus | dimensionless distance to the wall |
[out] | ypup | yplus projected vel ratio |
[out] | cofimp | ![]() |
|
inlinestatic |
Scalable wall function: shift the wall if .
[in] | l_visc | kinematic viscosity |
[in] | t_visc | turbulent kinematic viscosity |
[in] | vel | wall projected cell center velocity |
[in] | y | wall distance |
[in] | kinetic_en | turbulent kinetic energy |
[out] | iuntur | indicator: 0 in the viscous sublayer |
[out] | nsubla | counter of cell in the viscous sublayer |
[out] | nlogla | counter of cell in the log-layer |
[out] | ustar | friction velocity |
[out] | uk | friction velocity |
[out] | yplus | dimensionless distance to the wall |
[out] | dplus | dimensionless shift to the wall for scalable wall functions |
[out] | ypup | yplus projected vel ratio |
[out] | cofimp | ![]() |
|
inlinestatic |
Two velocity scales wall function with automatic switch from rough to smooth.
is computed as follows:
with and
.
[in] | l_visc | kinematic viscosity |
[in] | t_visc | turbulent kinematic viscosity |
[in] | vel | wall projected cell center velocity |
[in] | y | wall distance |
[in] | rough_d | roughness length scale (not sand grain) |
[in] | kinetic_en | turbulent kinetic energy |
[out] | iuntur | indicator: 0 in the viscous sublayer |
[out] | nsubla | counter of cell in the viscous sublayer |
[out] | nlogla | counter of cell in the log-layer |
[out] | ustar | friction velocity |
[out] | uk | friction velocity |
[out] | yplus | dimensionless distance to the wall |
[out] | dplus | dimensionless shift to the wall for scalable wall functions |
[out] | ypup | yplus projected vel ratio |
[out] | cofimp | ![]() |
|
inlinestatic |
Two velocity scales wall function using Van Driest mixing length.
is computed as follows:
with standing for Van Driest mixing length:
.
A polynome fitting the integral is used for , and a log law is used for
.
A wall roughness can be taken into account in the mixing length as proposed by Rotta (1962) with Cebeci & Chang (1978) correlation.
[in] | rnnb | ![]() |
[in] | l_visc | kinematic viscosity |
[in] | vel | wall projected cell center velocity |
[in] | y | wall distance |
[in] | kinetic_en | turbulent kinetic energy |
[out] | iuntur | indicator: 0 in the viscous sublayer |
[out] | nsubla | counter of cell in the viscous sublayer |
[out] | nlogla | counter of cell in the log-layer |
[out] | ustar | friction velocity |
[out] | uk | friction velocity |
[out] | yplus | dimensionless distance to the wall |
[out] | ypup | yplus projected vel ratio |
[out] | cofimp | ![]() |
[in] | lmk | dimensionless mixing length |
[in] | kr | wall roughness |
[in] | wf | enable full wall function computation, if false, uk is not recomputed and uplus is the only output |
|
inlinestatic |
No wall function.
[in] | l_visc | kinematic viscosity |
[in] | t_visc | turbulent kinematic viscosity |
[in] | vel | wall projected cell center velocity |
[in] | y | wall distance |
[out] | iuntur | indicator: 0 in the viscous sublayer |
[out] | nsubla | counter of cell in the viscous sublayer |
[out] | nlogla | counter of cell in the log-layer |
[out] | ustar | friction velocity |
[out] | uk | friction velocity |
[out] | yplus | dimensionless distance to the wall |
[out] | dplus | dimensionless shift to the wall for scalable wall functions |
[out] | ypup | yplus projected vel ratio |
[out] | cofimp | ![]() |
|
inlinestatic |
The correction of the exchange coefficient is computed thanks to a similarity model between dynamic viscous sub-layer and themal sub-layer.
is computed as follows:
The final exchange coefficient is:
[in] | l_visc | kinetic viscosity |
[in] | prl | laminar Prandtl number |
[in] | prt | turbulent Prandtl number |
[in] | rough_t | scalar roughness length scale |
[in] | uk | velocity scale based on TKE |
[in] | yplus | dimensionless distance to the wall |
[out] | dplus | dimensionless shift to the wall for scalable wall functions |
[out] | htur | correction for the exchange coefficient ( ![]() |
[out] | yplim | value of the limit for ![]() |
|
inlinestatic |
Rough Smooth Thermal Wall Function - Prototype.
[in] | l_visc | kinetic viscosity |
[in] | prl | molecular Prandtl number ( ![]() |
[in] | prt | turbulent Prandtl number ( ![]() |
[in] | rough_t | scalar roughness length scale |
[in] | uk | velocity scale based on TKE |
[in] | yplus | dimensionless distance to the wall |
[in] | dplus | dimensionless shift to the wall for scalable wall function |
[out] | htur | correction for the exchange coefficient ( ![]() |
|
inlinestatic |
The correction of the exchange coefficient is computed thanks to a numerical integration of:
with as assumed in the derivation of the two scales wall function using Van Driest mixing length. Therefore
is taken.
Notice that we integrate up to (YP100), beyond that value the profile is prolonged by a logarithm relying on the fact that
beyond
.
[in] | prl | molecular Prandtl number ( ![]() |
[in] | prt | turbulent Prandtl number ( ![]() |
[in] | yplus | dimensionless distance to the wall |
[out] | htur | correction for the exchange coefficient ( ![]() |
void cs_wall_functions_scalar | ( | cs_wall_f_s_type_t | iwalfs, |
cs_real_t | l_visc, | ||
cs_real_t | prl, | ||
cs_real_t | prt, | ||
cs_real_t | rough_t, | ||
cs_real_t | uk, | ||
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 flow.
This is function of the dimensionless distance to the wall .
Then the return coefficient reads:
[in] | iwalfs | type of wall functions for scalar |
[in] | l_visc | kinematic viscosity |
[in] | prl | laminar Prandtl number |
[in] | prt | turbulent Prandtl number |
[in] | rough_t | scalar roughness lenghth scale |
[in] | uk | velocity scale based on TKE |
[in] | yplus | dimensionless distance to the wall |
[in] | dplus | dimensionless distance for scalable wall functions |
[out] | htur | corrected exchange coefficient |
[out] | yplim | value of the limit for ![]() |
void cs_wall_functions_velocity | ( | cs_wall_f_type_t | iwallf, |
cs_real_t | l_visc, | ||
cs_real_t | t_visc, | ||
cs_real_t | vel, | ||
cs_real_t | y, | ||
cs_real_t | rough_d, | ||
cs_real_t | rnnb, | ||
cs_real_t | kinetic_en, | ||
int * | iuntur, | ||
cs_gnum_t * | nsubla, | ||
cs_gnum_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 /
.
[in] | iwallf | wall function type |
[in] | l_visc | kinematic viscosity |
[in] | t_visc | turbulent kinematic viscosity |
[in] | vel | wall projected cell center velocity |
[in] | y | wall distance |
[in] | rough_d | roughness lenghth scale |
[in] | rnnb | ![]() |
[in] | kinetic_en | turbulent kinetic energy |
[in] | iuntur | indicator: 0 in the viscous sublayer |
[in] | nsubla | counter of cell in the viscous sublayer |
[in] | nlogla | counter of cell in the log-layer |
[out] | ustar | friction velocity |
[out] | uk | friction velocity |
[out] | yplus | non-dimension wall distance |
[out] | ypup | yplus projected vel ratio |
[out] | cofimp | ![]() |
[out] | dplus | dimensionless shift to the wall for scalable wall functions |
[in] | iwallf | wall function type |
[in] | l_visc | kinematic viscosity |
[in] | t_visc | turbulent kinematic viscosity |
[in] | vel | wall projected cell center velocity |
[in] | y | wall distance |
[in] | rough_d | roughness length scale (not sand grain roughness) |
[in] | rnnb | ![]() |
[in] | kinetic_en | turbulent kinetic energy (cell center) |
[in,out] | iuntur | indicator: 0 in the viscous sublayer |
[in,out] | nsubla | counter of cell in the viscous sublayer |
[in,out] | nlogla | counter of cell in the log-layer |
[out] | ustar | friction velocity |
[out] | uk | friction velocity |
[out] | yplus | dimensionless distance to the wall |
[out] | ypup | yplus projected vel ratio |
[out] | cofimp | ![]() |
[out] | dplus | dimensionless shift to the wall for scalable wall functions |
void hturbp | ( | const int *const | iwalfs, |
const cs_real_t *const | l_visc, | ||
const cs_real_t *const | prl, | ||
const cs_real_t *const | prt, | ||
const cs_real_t *const | rough_t, | ||
const cs_real_t *const | uk, | ||
const cs_real_t *const | yplus, | ||
const cs_real_t *const | dplus, | ||
cs_real_t * | htur, | ||
cs_real_t * | yplim | ||
) |
void wallfunctions | ( | const int *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 | rough_d, | ||
const cs_real_t *const | rnnb, | ||
const cs_real_t *const | 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 | ||
) |
|
extern |