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:
                            false);  
void cs_les_inflow_set_restart(bool allow_read, bool allow_write)
Define behavior of the LES inflow module in case of restart.
Definition: cs_les_inflow.c:2193
  
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:
  {
    
    int n_entities = 50;
 
    
 
                            false,
                            n_entities,
                            0,  
                            vel_r,
                            k_r,
                            eps_r);
  }
const cs_zone_t * cs_boundary_zone_by_name(const char *name)
Return a pointer to a boundary zone based on its name if present.
Definition: cs_boundary_zone.c:711
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
void cs_les_inflow_add_inlet(cs_les_inflow_type_t type, bool volume_mode, const cs_zone_t *zone, int n_entities, int verbosity, const cs_real_t *vel_r, cs_real_t k_r, cs_real_t eps_r)
Add an inlet definition for synthetic turbulence inflow generation.
Definition: cs_les_inflow.c:650
@ CS_INFLOW_BATTEN
Definition: cs_les_inflow.h:60
 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) {
    
    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_real_t yy = 1.0 - b_face_cog[f_id][1];
 
 
      
                             + 7.8*(1. - exp(-
yplus/11.0)
                              + (1.0 - exp(-
yplus/20.0)) *4.5
                              / (1. + 4.0*
yplus/r_fro);
 
      
      vel_l[i][0] = uplus * utau;
      vel_l[i][1] = 0.0;
      vel_l[i][2] = 0.0;
 
      rij_l[i][3] = 0;
      rij_l[i][4] = 0;
      rij_l[i][5] = 0;
 
    }
  }
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:347
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
@ mu
Definition: cs_field_pointer.h:103
@ yplus
Definition: cs_field_pointer.h:240
#define CS_F_(e)
Macro used to return a field pointer by its enumerated value.
Definition: cs_field_pointer.h:51
static CS_F_HOST_DEVICE cs_real_t cs_math_pow2(cs_real_t x)
Compute the square of a real value.
Definition: cs_math.h:258
static CS_F_HOST_DEVICE cs_real_t cs_math_pow4(cs_real_t x)
Compute the 4-th power of a real value.
Definition: cs_math.h:290
cs_mesh_quantities_t * cs_glob_mesh_quantities
double cs_turb_xkappa
Definition: cs_turbulence_model.c:446
const cs_turb_ref_values_t * cs_glob_turb_ref_values
real(c_double), pointer, save uref
the characteristic flow velocity, used for the initialization of the turbulence. Negative value: not ...
Definition: cstphy.f90:353
cs_real_t * b_face_cog
Definition: cs_mesh_quantities.h:111
cs_lnum_t * b_face_cells
Definition: cs_mesh.h:112
double uref
Definition: cs_turbulence_model.h:169
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) {
 
 
 
 
      vel_l[i][0] = 1.1;
      vel_l[i][1] = 1.1;
      vel_l[i][2] = 1.1;
 
 
      
 
      
 
 
                                         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;
    }
  }
static CS_F_HOST_DEVICE cs_real_t cs_math_3_square_norm(const cs_real_t v[3])
Compute the square norm of a vector of 3 real values.
Definition: cs_math.h:476
static CS_F_HOST_DEVICE cs_real_t cs_math_fmax(cs_real_t x, cs_real_t y)
Compute the max value of two real values.
Definition: cs_math.h:200
void cs_turbulence_bc_ke_turb_intensity(double uref2, double t_intensity, double dh, double *k, double *eps)
Calculation of  and  from a diameter , a turbulent intensity  and the reference velocity  for a circu...
Definition: cs_turbulence_bc.c:827