8.3
general documentation
cs_boundary_conditions_set_coeffs_turb.cpp File Reference
#include "cs_defs.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include <mpi.h>
#include "bft_mem.h"
#include "bft_printf.h"
#include "cs_air_props.h"
#include "cs_ale.h"
#include "cs_atmo.h"
#include "cs_boundary_conditions_set_coeffs.h"
#include "cs_field_default.h"
#include "cs_field_pointer.h"
#include "cs_internal_coupling.h"
#include "cs_mesh.h"
#include "cs_parall.h"
#include "cs_parameters.h"
#include "cs_physical_constants.h"
#include "cs_physical_model.h"
#include "cs_rad_transfer.h"
#include "cs_thermal_model.h"
#include "cs_turbomachinery.h"
#include "cs_turbulence_bc.h"
#include "cs_turbulence_model.h"
#include "cs_wall_functions.h"
#include "cs_boundary_conditions_set_coeffs_turb.h"
+ Include dependency graph for cs_boundary_conditions_set_coeffs_turb.cpp:

Functions

static void _cs_boundary_conditions_set_coeffs_turb_scalar (cs_field_t *f_sc, int isvhb, cs_real_t byplus[], cs_real_t bdplus[], cs_real_t buk[], cs_real_t buet[], cs_real_t bcfnns[], cs_real_t bdlmo[], cs_real_t hbord[], cs_real_t theipb[], cs_real_t *tetmax, cs_real_t *tetmin, cs_real_t *tplumx, cs_real_t *tplumn)
 Compute boundary coefficients for smooth/rough walls for scalar. More...
 
static void _cs_boundary_conditions_set_coeffs_turb_vector (cs_field_t *f_v, cs_real_t byplus[], cs_real_t bdplus[], cs_real_t buk[])
 Compute boundary coefficients for smooth walls for vector. More...
 
static void _update_physical_quantities_smooth_wall (const cs_lnum_t c_id, const cs_real_t visclc, const cs_real_t visctc, const cs_real_t romc, const cs_real_t distbf, const cs_real_t utau, const cs_real_t uet, const cs_real_t uk, const cs_real_t yplus, const cs_real_t ypup, const cs_real_t dplus, cs_real_t *cofimp, cs_real_t *rcprod, cs_real_t *hflui, cs_real_t *uiptn)
 Compute hflui and uiptn for smooth wall. More...
 
static void _update_physical_quantities_rough_wall (const cs_real_t visclc, const cs_real_t visctc, const cs_real_t romc, const cs_real_t distbf, const cs_real_t utau, const cs_real_t uet, const cs_real_t uk, const cs_real_t uplus, const cs_real_t rough_d, const cs_real_t dlmo, int *iuntur, cs_gnum_t *nlogla, cs_gnum_t *nsubla, cs_real_t *cofimp, cs_real_t *rcprod, cs_real_t *hflui, cs_real_t *uiptn)
 Update physical quantities for rough wall. More...
 
static void _atmo_cls (const cs_lnum_t f_id, const cs_real_t utau, const cs_real_t rough_d, const cs_real_t duplus, const cs_real_t dtplus, const cs_real_t yplus_t, cs_real_t *uet, const cs_real_t gredu, cs_real_t *cfnns, cs_real_t *cfnnk, cs_real_t *cfnne, cs_real_t *dlmo, const cs_real_t temp, const cs_real_t totwt, const cs_real_t liqwt)
 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_boundary_conditions_set_coeffs_turb (int isvhb, cs_real_t velipb[][3], cs_real_t rijipb[][6], cs_real_t visvdr[], cs_real_t hbord[], cs_real_t theipb[])
 Boundary conditions for smooth walls (icodcl = 5). More...
 

Variables

static cs_lnum_t _ntlast = -1
 
static cs_lnum_t _iaff = 0
 
static int _kbfid = -1
 
static const cs_lnum_t _iv2t [6] = {0, 1, 2, 0, 1, 0}
 
static const cs_lnum_t _jv2t [6] = {0, 1, 2, 1, 2, 2}
 

Function Documentation

◆ _atmo_cls()

static void _atmo_cls ( const cs_lnum_t  f_id,
const cs_real_t  utau,
const cs_real_t  rough_d,
const cs_real_t  duplus,
const cs_real_t  dtplus,
const cs_real_t  yplus_t,
cs_real_t uet,
const cs_real_t  gredu,
cs_real_t cfnns,
cs_real_t cfnnk,
cs_real_t cfnne,
cs_real_t dlmo,
const cs_real_t  temp,
const cs_real_t  totwt,
const cs_real_t  liqwt 
)
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]ifactreated boundary face
[in]utautangential mean velocity
[in]rough_droughness z0
[in]duplus1 over dimensionless velocity in neutral conditions
[in]dtplus1 over dimensionless temperature in neutral conditions
[in]yplus_tthermal dimensionless wall distance
[out]uetfriction velocity
[out]gredureduced gravity for non horizontal wall
[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_boundary_conditions_set_coeffs_turb_scalar()

static void _cs_boundary_conditions_set_coeffs_turb_scalar ( cs_field_t f_sc,
int  isvhb,
cs_real_t  byplus[],
cs_real_t  bdplus[],
cs_real_t  buk[],
cs_real_t  buet[],
cs_real_t  bcfnns[],
cs_real_t  bdlmo[],
cs_real_t  hbord[],
cs_real_t  theipb[],
cs_real_t tetmax,
cs_real_t tetmin,
cs_real_t tplumx,
cs_real_t tplumn 
)
static

Compute boundary coefficients for smooth/rough walls for scalar.

Parameters
[in]f_scscalar field
[in]isvhbid of field whose exchange coeffient should be saved at the walls, or -1.
[in]byplusdimensionless distance to the wall
[in]bdplusdimensionless shift to the wall for scalable wall functions
[in]bukdimensionless velocity
[in]buetboundary ustar value
[in]bcfnnsboundary correction factor
[in]bdlmoboundary Monin Obukhov length inverse, or nullptr
[in,out]hbordexchange coefficient at boundary
[in]theipbvalue of thermal scalar at $ \centip $ of boundary cells
[out]tetmaxmaximum local ustar value
[out]tetminminimum local ustar value
[out]tplumxmaximum local tplus value
[out]tplumnminimum local tplus value

◆ _cs_boundary_conditions_set_coeffs_turb_vector()

static void _cs_boundary_conditions_set_coeffs_turb_vector ( cs_field_t f_v,
cs_real_t  byplus[],
cs_real_t  bdplus[],
cs_real_t  buk[] 
)
static

Compute boundary coefficients for smooth walls for vector.

Parameters
[in]f_vvector field
[in]byplusdimensionless distance to the wall
[in]bdplusdimensionless shift to the wall for scalable wall functions
[in]bukdimensionless velocity

◆ _update_physical_quantities_rough_wall()

static void _update_physical_quantities_rough_wall ( const cs_real_t  visclc,
const cs_real_t  visctc,
const cs_real_t  romc,
const cs_real_t  distbf,
const cs_real_t  utau,
const cs_real_t  uet,
const cs_real_t  uk,
const cs_real_t  uplus,
const cs_real_t  rough_d,
const cs_real_t  dlmo,
int *  iuntur,
cs_gnum_t nlogla,
cs_gnum_t nsubla,
cs_real_t cofimp,
cs_real_t rcprod,
cs_real_t hflui,
cs_real_t uiptn 
)
static

Update physical quantities for rough wall.

Parameters
[in]visclckinematic viscosity
[in]visctcturbulent kinematic viscosity
[in]romcdensity
[in]distbfdistance between the cell center and the center of gravity of the border face
[in]utautangential mean velocity
[in]uetfriction velocity
[in]ukfriction velocity
[in]uplusdimensionless velocity
[in]dplusdimensionless shift to the wall for scalable wall functions
[in]rough_droughness length scale (not sand grain)
[in]dlmoinverse Monin Obukhov length (for log only)
[in,out]iunturindicator: 0 in the viscous sublayer
[in,out]nloglacounter of cell in the log-layer
[in,out]nsublacounter of cell in the viscous sublayer
[in,out]cofimp$\frac{|U_F|}{|U_I^p|}$ to ensure a good turbulence production
[in,out]rcprod?
[in,out]hfluiinternal exchange coefficient
[in,out]uiptncounter of reversal layer

◆ _update_physical_quantities_smooth_wall()

static void _update_physical_quantities_smooth_wall ( const cs_lnum_t  c_id,
const cs_real_t  visclc,
const cs_real_t  visctc,
const cs_real_t  romc,
const cs_real_t  distbf,
const cs_real_t  utau,
const cs_real_t  uet,
const cs_real_t  uk,
const cs_real_t  yplus,
const cs_real_t  ypup,
const cs_real_t  dplus,
cs_real_t cofimp,
cs_real_t rcprod,
cs_real_t hflui,
cs_real_t uiptn 
)
static

Compute hflui and uiptn for smooth wall.

Parameters
[in]c_idcell id
[in]visclckinematic viscosity
[in]visctcturbulent kinematic viscosity
[in]romcdensity evaluated at cell_id
[in]distbfdistance between the cell center and the center of gravity of the border face
[in]utautangential mean velocity
[in]uetboundary ustar value
[in]ukdimensionless velocity
[in]yplusdimensionless distance to the wall
[in]ypupyplus projected vel ratio
[in]dplusdimensionless shift to the wall for scalable wall functions
[in,out]cofimp$\frac{|U_F|}{|U_I^p|}$ to ensure a good turbulence production
[in,out]rcprod?
[in,out]hfluiinternal exchange coefficient
[in,out]uiptncounter of reversal layer

◆ cs_boundary_conditions_set_coeffs_turb()

void cs_boundary_conditions_set_coeffs_turb ( int  isvhb,
cs_real_t  velipb[][3],
cs_real_t  rijipb[][6],
cs_real_t  visvdr[],
cs_real_t  hbord[],
cs_real_t  theipb[] 
)

Boundary conditions for smooth walls (icodcl = 5).

The wall functions may change the value of the diffusive flux.

The values at a boundary face $ \fib $ stored in the face center $ \centf $ of the variable $ P $ and its diffusive flux $ Q $ are written as:

\[
P_{\face} = A_P^g + B_P^g P_{\centi}
\]

and

\[
Q_{\face} = A_P^f + B_P^f P_{\centi}
\]

where $ P_\centi $ is the value of the variable $ P $ at the neighboring cell.

Warning:

  • For a vector field such as the velocity $ \vect{u} $ the boundary conditions may read:

    \[
  \vect{u}_{\face} = \vect{A}_u^g + \tens{B}_u^g \vect{u}_{\centi}
  \]

    and

    \[
  \vect{Q}_{\face} = \vect{A}_u^f + \tens{B}_u^f \vect{u}_{\centi}
  \]

    where $ \tens{B}_u^g $ and $ \tens{B}_u^f $ are 3x3 tensor matrix which coupled velocity components next to a boundary.

Please refer to the wall boundary conditions section of the theory guide for more informations, as well as the clptur section.

Parameters
[in]isvhbid of field whose exchange coeffient should be saved at the walls, or -1.
[in]velipbvalue of the velocity at $ \centip $ of boundary cells
[in]rijipbvalue of $ R_{ij} $ at $ \centip $ of boundary cells
[out]visvdrdynamic viscosity after V. Driest damping in boundary cells
[out]hbordexchange coefficient at boundary
[in]theipbvalue of thermal scalar at $ \centip $ of boundary cells

Variable Documentation

◆ _iaff

cs_lnum_t _iaff = 0
static

◆ _iv2t

const cs_lnum_t _iv2t[6] = {0, 1, 2, 0, 1, 0}
static

◆ _jv2t

const cs_lnum_t _jv2t[6] = {0, 1, 2, 1, 2, 2}
static

◆ _kbfid

int _kbfid = -1
static

◆ _ntlast

cs_lnum_t _ntlast = -1
static