7.0
general documentation
Generation of synthetic turbulence at LES inlets

Introduction

Generation of synthetic turbulence at LES inlets can be defined using the cs_user_les_inflow_define user function, and possibly updated using cs_user_les_inflow_update, with cs_user_les_inflow_advanced allowing for finer definition of target statistics the inlet if needed.

Global caracteristics of synthetic turbulence inlets

General settings

The cs_user_les_inflow_define function is the main entry point for LES inflow definitions.

It can be used to set general options, such as the specific checkpoint/restart behavior, as in the following example:

cs_les_inflow_set_restart(false, /* allow_read */
false); /* allow_write */

Defining inlet properties

For each LES inlet, the cs_les_inflow_add_inlet must be used.

For example, to use the Batten Method for boundary faces of a zone named INLET_1:

{
/* Number of turbulence structures */
int n_entities = 50;
/* Velocity, turbulent kinetic energy and dissipation rate */
cs_real_t vel_r[3] = {18.0, 0, 0};
cs_real_t k_r = 4.0;
cs_real_t eps_r = 4.0;
false,
n_entities,
0, /* verbosity */
vel_r,
k_r,
eps_r);
}

And to use the Synthetic Eddy Method for boundary faces of a zone named INLET_2:

Modifying synthetic turbulence inlets

Updating base characteristics

To update reference velocity, turbulent kinetic energy, or dissipation rate for a given turbulence inlet, the cs_user_les_inflow_update function may be used. It is called automatically for each LES inlet defined previously.

The following example illustrates modifying values for the example zone named INLET_1:

if (strcmp(zone->name, "INLET_1") == 0) {
/* Velocity, turbulent kinetic energy and dissipation rate */
vel_r[0] = 19.0;
vel_r[1] = 0.0;
vel_r[2] = 0.0;
*k_r = 5.0;
*eps_r = 5.0;
}

Advanced LES inlet Example 1

Mean velocity, Reynolds stresses an dissipation are deduced from a wall law for the zone named INLET_1 (no modification of the statistics of the flow is provided for the other synthetic turbulence inlets).

if (strcmp(zone->name, "INLET_1") == 0) {
const cs_lnum_t n_faces = zone->n_elts;
const cs_lnum_t *face_ids = zone->elt_ids;
const cs_real_t d2_s3 = 2.0/3.0;
const cs_mesh_t *m = cs_glob_mesh;
const cs_real_3_t *b_face_cog
const cs_real_t *cpro_mu = CS_F_(mu)->val;
/* Approximation of the friction velocity */
const cs_real_t utau = uref/20.0;
/* Reference length scale */
const cs_real_t h_ref = 1.0;
for (cs_lnum_t i = 0; i < n_faces; i++) {
const cs_lnum_t f_id = face_ids[i];
const cs_lnum_t c_id = m->b_face_cells[f_id];
const cs_real_t x_mu = cpro_mu[c_id];
const cs_real_t r_fro = utau * h_ref / x_mu;
/* Dimensionless wall distance */
const cs_real_t yy = 1.0 - b_face_cog[f_id][1];
const cs_real_t yplus = yy / h_ref * r_fro;
/* Reichart laws (dimensionless) */
const cs_real_t uplus = log(1. + 0.4*yplus)/kappa
+ 7.8*(1. - exp(-yplus/11.0)
- yplus/11.0*exp(-0.33*yplus));
const cs_real_t kplus = 0.07*yplus*yplus*exp(-yplus/8.0)
+ (1.0 - exp(-yplus/20.0)) *4.5
/ (1. + 4.0*yplus/r_fro);
const cs_real_t eplus = (1.0/kappa)
/ pow(( cs_math_pow4(yplus)
+ cs_math_pow4(15.)), 0.25);
/* Arrays are filled with dimensionnal stats */
vel_l[i][0] = uplus * utau;
vel_l[i][1] = 0.0;
vel_l[i][2] = 0.0;
rij_l[i][0] = d2_s3 * kplus * cs_math_pow2(utau);
rij_l[i][1] = d2_s3 * kplus * cs_math_pow2(utau);
rij_l[i][2] = d2_s3 * kplus * cs_math_pow2(utau);
rij_l[i][3] = 0;
rij_l[i][4] = 0;
rij_l[i][5] = 0;
eps_l[i] = eplus * cs_math_pow4(utau) / x_mu;
}
}

Advanced LES Example 2

Reynolds stresses and dissipation at the inlet are computed using the turbulence intensity and standard laws for a circular pipe for for the zone named INLET_1 (no modification of the statistics of the flow is provided for the other synthetic turbulence inlets).

if (strcmp(zone->name, "INLET_1") == 0) {
const cs_lnum_t n_faces = zone->n_elts;
const cs_real_t d2_s3 = 2.0/3.0;
for (cs_lnum_t i = 0; i < n_faces; i++) {
vel_l[i][0] = 1.1;
vel_l[i][1] = 1.1;
vel_l[i][2] = 1.1;
cs_real_t uref2 = cs_math_3_square_norm(vel_l[i]);
uref2 = cs_math_fmax(uref2, 1e-12);
/* Hydraulic diameter */
const cs_real_t x_hd = 0.075;
/* Turbulence intensity */
const cs_real_t x_ti = 0.02;
cs_real_t x_k = 1e-12;
cs_real_t x_eps = 1e-12;
x_ti,
x_hd,
&x_k,
&x_eps);
rij_l[i][0] = d2_s3 * x_k;
rij_l[i][1] = d2_s3 * x_k;
rij_l[i][2] = d2_s3 * x_k;
rij_l[i][3] = 0;
rij_l[i][4] = 0;
rij_l[i][5] = 0;
eps_l[i] = x_eps;
}
}