9.1
general documentation
cs_wall_functions.cpp File Reference
#include "base/cs_defs.h"
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <float.h>
#include "bft/bft_error.h"
#include "bft/bft_printf.h"
#include "base/cs_log.h"
#include "base/cs_mem.h"
#include "mesh/cs_mesh.h"
#include "mesh/cs_mesh_quantities.h"
#include "turb/cs_turbulence_model.h"
#include "cdo/cs_domain.h"
#include "base/cs_field.h"
#include "base/cs_field_operator.h"
#include "base/cs_field_pointer.h"
#include "base/cs_field_default.h"
#include "pprt/cs_physical_model.h"
#include "atmo/cs_atmo.h"
#include "base/cs_wall_functions.h"
+ Include dependency graph for cs_wall_functions.cpp:

Functions

cs_wall_functions_tcs_get_glob_wall_functions (void)
 
static void _atmo_louis (const cs_real_t utau, const cs_real_t rough_d, const cs_real_t distbf, const cs_real_t duplus, const cs_real_t dtplus, const cs_real_t prt, const cs_real_t yplus_t, const cs_real_t buoyant_param, const cs_real_t delta_t, cs_real_t *uet, cs_real_t *cfnns, cs_real_t *cfnnk, cs_real_t *cfnne, cs_real_t *dlmo)
 Compute friction velocity u* and surface sensible heat flux q0 for a non neutral atmospheric surface layer using the explicit formula developed for the ECMWF by Louis (1982) More...
 
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, cs_real_t rough_t, cs_real_t buoyant_param, cs_real_t delta_t, cs_real_t turb_prandtl, int icodcl_th_fid, cs_real_t flux, cs_field_t *f_th, 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, cs_real_t *cfnns, cs_real_t *cfnnk, cs_real_t *cfnne, cs_real_t *dlmo)
 Compute the friction velocity and $y^+$ / $u^+$. More...
 
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...
 

Detailed Description

Wall functions descriptor and computation.

Function Documentation

◆ _atmo_louis()

static void _atmo_louis ( const cs_real_t  utau,
const cs_real_t  rough_d,
const cs_real_t  distbf,
const cs_real_t  duplus,
const cs_real_t  dtplus,
const cs_real_t  prt,
const cs_real_t  yplus_t,
const cs_real_t  buoyant_param,
const cs_real_t  delta_t,
cs_real_t uet,
cs_real_t cfnns,
cs_real_t cfnnk,
cs_real_t cfnne,
cs_real_t dlmo 
)
static

Compute friction velocity u* and surface sensible heat flux q0 for a non neutral atmospheric surface layer using the explicit formula developed for the ECMWF by Louis (1982)

Parameters
[in]utautangential mean velocity
[in]rough_droughness z0
[in]distbfdistance between the cell center and the center of gravity of the border face
[in]duplus1 over dimensionless velocity in neutral conditions
[in]dtplus1 over dimensionless temperature in neutral conditions
[in]prtturbulent Prandtl number
[in]yplus_tthermal dimensionless wall distance
[in]buoyant_paramg beta delta Theta
[in]delta_tdelta Theta
[out]uetfriction velocity
[out]cfnnsnon neutral correction coefficients for profiles of scalar
[out]cfnnknon neutral correction coefficients for profiles of k
[out]cfnnenon neutral correction coefficients for profiles of eps
[out]dlmoinverse Monin Obukhov length (for log only)
[in]temppotential temperature in boundary cell
[in]totwttotal water content in boundary cell
[in]liqwtliquid water content in boundary cell

◆ cs_get_glob_wall_functions()

cs_wall_functions_t * cs_get_glob_wall_functions ( void  )

◆ cs_wall_functions_scalar()

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 $ y^+ = \dfrac{\centip \centf u_\star}{\nu}$.

Then the return coefficient reads:

\[
 h_{tur} = Pr \dfrac{y^+}{T^+}
 \]

Parameters
[in]iwalfstype of wall functions for scalar
[in]l_visckinematic viscosity
[in]prllaminar Prandtl number
[in]prtturbulent Prandtl number
[in]rough_tscalar roughness lenghth scale
[in]ukvelocity scale based on TKE
[in]yplusdimensionless distance to the wall
[in]dplusdimensionless distance for scalable wall functions
[out]hturcorrected exchange coefficient
[out]yplimvalue of the limit for $ y^+ $

◆ cs_wall_functions_velocity()

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,
cs_real_t  rough_t,
cs_real_t  buoyant_param,
cs_real_t  delta_t,
cs_real_t  turb_prandtl,
int  icodcl_th_fid,
cs_real_t  flux,
cs_field_t f_th,
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,
cs_real_t cfnns,
cs_real_t cfnnk,
cs_real_t cfnne,
cs_real_t dlmo 
)

Compute the friction velocity and $y^+$ / $u^+$.

Parameters
[in]iwallfwall function type
[in]l_visckinematic viscosity
[in]t_viscturbulent kinematic viscosity
[in]velwall projected cell center velocity
[in]ywall distance
[in]rough_droughness length scale (not sand grain roughness)
[in]rnnb$\vec{n}.(\tens{R}\vec{n})$
[in]kinetic_enturbulent kinetic energy (cell center)
[in]rough_tboundary_thermal_roughness
[in]buoyant_paramBuoyant parameter: g beta delta Theta v
[in]delta_ttemperature delta
[in]turb_prandtlturbulent Prandtl
[in]icodcl_th_fidicodcl_th_f[f_id]]
[in]flux
[in,out]iunturindicator: 0 in the viscous sublayer
[in,out]nsublacounter of cell in the viscous sublayer
[in,out]nloglacounter of cell in the log-layer
[out]cfbnnscorrectif factors
[out]cfnnk
[out]cfnne
[out]dlmoinverse of Obukhov length
[out]ustarfriction velocity
[out]ukfriction velocity
[out]yplusdimensionless distance to the wall
[out]ypupyplus projected vel ratio
[out]cofimp$\frac{|U_F|}{|U_I^p|}$ to ensure a good turbulence production
[out]dplusdimensionless shift to the wall for scalable wall functions