8.3
general documentation
cs_les_inflow.h File Reference
#include "cs_defs.h"
#include "cs_base.h"
#include "cs_zone.h"
+ Include dependency graph for cs_les_inflow.h:

Go to the source code of this file.

Data Structures

struct  cs_inflow_sem_t
 

Typedefs

typedef struct _cs_inlet_t cs_inlet_t
 

Enumerations

enum  cs_les_inflow_type_t { CS_INFLOW_LAMINAR , CS_INFLOW_RANDOM , CS_INFLOW_BATTEN , CS_INFLOW_SEM }
 

Functions

void cs_les_inflow_initialize (void)
 Creation of structures for the LES inflows. More...
 
void cs_les_inflow_finalize (void)
 Finalize turbulent inflow generation API. More...
 
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. More...
 
void cs_les_inflow_compute (void)
 General synthetic turbulence generation. More...
 
void cs_les_synthetic_eddy_restart_read (void)
 
void cs_les_synthetic_eddy_restart_write (void)
 
void cs_les_synthetic_eddy_method (cs_lnum_t n_points, const cs_lnum_t elt_ids[], const cs_real_3_t point_coordinates[], const cs_real_t *point_weight, int initialize, int verbosity, cs_inflow_sem_t *inflow, cs_real_t t_cur, const cs_real_3_t vel_m_l[], const cs_real_6_t rij_l[], const cs_real_t eps_l[], cs_real_3_t fluctuations[])
 Generation of synthetic turbulence via the Synthetic Eddy Method (SEM). More...
 
void cs_les_rescale_fluctuations (cs_lnum_t n_points, const cs_real_6_t statistics[], cs_real_3_t fluctuations[])
 Rescale fluctuations by statistics following the Lund method. More...
 
void cs_les_synthetic_eddy_set_n_restart_structures (int n_structures)
 Set number of structures used for volume SEM when restarting from another turbulence model. More...
 
int cs_les_synthetic_eddy_get_n_restart_structures (void)
 Return number of structures used for volume SEM when restarting from another turbulence model. More...
 
void cs_les_inflow_get_restart (bool *allow_read, bool *allow_write)
 Query behavior of the LES inflow module in case of restart. More...
 
void cs_les_inflow_set_restart (bool allow_read, bool allow_write)
 Define behavior of the LES inflow module in case of restart. More...
 
void cs_user_les_inflow_define (void)
 Define parameters of synthetic turbulence at LES inflow. More...
 
void cs_user_les_inflow_update (const cs_zone_t *zone, cs_real_t vel_r[3], cs_real_t *k_r, cs_real_t *eps_r)
 Update of the characteristics of a given synthetic turbulence inlet. More...
 
void cs_user_les_inflow_advanced (const cs_zone_t *zone, cs_real_3_t vel_l[], cs_real_6_t rij_l[], cs_real_t eps_l[])
 Definition of mean velocity, Reynolds stresses and dissipation rate for each boundary face of the given synthetic turbulence inlet. More...
 

Typedef Documentation

◆ cs_inlet_t

typedef struct _cs_inlet_t cs_inlet_t

Enumeration Type Documentation

◆ cs_les_inflow_type_t

Enumerator
CS_INFLOW_LAMINAR 

Laminar fluctuations (i.e no fluctuation)

CS_INFLOW_RANDOM 

Gaussian random fluctuation

CS_INFLOW_BATTEN 

Fluctuations generated by the Batten method

CS_INFLOW_SEM 

Fluctuations generated by the Synthetic Eddy Method

Function Documentation

◆ cs_les_inflow_add_inlet()

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.

Remarks
:
  • eps_r is used only for CS_INFLOW_BATTEN and CS_INFLOW_SEM types.
  • Strictly positive values are required for k_r and eps_r.
  • Finer definition of the statistics of the flow at the inlet can be done later using cs_user_les_inflow_advanced.
Parameters
[out]typetype of inflow method at the inlet
[out]volume_modeif true, generate turbulence over the whole domain (only if type is CS_INFLOW_SEM)
[in]zonepointer to associated boundary zone
[out]n_entitiesnumber of structures or modes
[out]verbosityverbosity level
[out]vel_rreference mean velocity
[out]k_rreference turbulent kinetic energy
[out]eps_rreference turbulent dissipation

◆ cs_les_inflow_compute()

void cs_les_inflow_compute ( void  )

General synthetic turbulence generation.

◆ cs_les_inflow_finalize()

void cs_les_inflow_finalize ( void  )

Finalize turbulent inflow generation API.

◆ cs_les_inflow_get_restart()

void cs_les_inflow_get_restart ( bool *  allow_read,
bool *  allow_write 
)

Query behavior of the LES inflow module in case of restart.

See cs_les_synthetic_eddy_set_restart for details.

Parameters
[out]allow_readpointer to read flag, or NULL
[out]allow_writepointer to write flag, or NULL

See cs_les_synthetic_eddy_set_restart for details.

Parameters
[out]allow_readpointer to read flag, or nullptr
[out]allow_writepointer to write flag, or nullptr

◆ cs_les_inflow_initialize()

void cs_les_inflow_initialize ( void  )

Creation of structures for the LES inflows.

◆ cs_les_inflow_set_restart()

void cs_les_inflow_set_restart ( bool  allow_read,
bool  allow_write 
)

Define behavior of the LES inflow module in case of restart.

By default, a restart file is read if present, and a checkpoint written. If not read, synthetic fluctuations are re-initialized.

Parameters
[in]allow_readallow reading a relevant checkpoint if present
[in]allow_writeallow writing a relevant checkpoint if present

By default, a specific file is read if present in the restart folder, and files written in the checkpoint folder at global checkpoint intervals.

If not read, synthetic fluctuations are re-initialized.

Parameters
[in]allow_readallow reading a relevant checkpoint if present
[in]allow_writeallow writing a relevant checkpoint if present

◆ cs_les_rescale_fluctuations()

void cs_les_rescale_fluctuations ( cs_lnum_t  n_points,
const cs_real_6_t  statistics[],
cs_real_3_t  fluctuations[] 
)

Rescale fluctuations by statistics following the Lund method.

One assumes that the statistics are interlaced and ordered as follows: <u'u'> <v'v'> <w'w'> <u'v'> <v'w'> <u'w'>

Parameters
[in]n_pointslocal number of points where turbulence is generated
[in]statisticsstatistics (i.e. Reynolds stresses)

\param[in, out] fluctuations velocity fluctuations generated

One assumes that the statistics are interlaced and ordered as follows: <u'u'> <v'v'> <w'w'> <u'v'> <v'w'> <u'w'>

Parameters
[in]n_pointslocal number of points where turbulence is generated
[in]statisticsstatistics (i.e. Reynolds stresses)

\param[in, out] fluctuations velocity fluctuations generated

◆ cs_les_synthetic_eddy_get_n_restart_structures()

int cs_les_synthetic_eddy_get_n_restart_structures ( void  )

Return number of structures used for volume SEM when restarting from another turbulence model.

Returns
number of structures for initialization

◆ cs_les_synthetic_eddy_method()

void cs_les_synthetic_eddy_method ( cs_lnum_t  n_points,
const cs_lnum_t  elt_ids[],
const cs_real_3_t  point_coordinates[],
const cs_real_t point_weight,
int  initialize,
int  verbosity,
cs_inflow_sem_t inflow,
cs_real_t  t_cur,
const cs_real_3_t  vel_m_l[],
const cs_real_6_t  rij_l[],
const cs_real_t  eps_l[],
cs_real_3_t  fluctuations[] 
)

Generation of synthetic turbulence via the Synthetic Eddy Method (SEM).

Parameters
[in]n_pointslocal number of points where turbulence is generated
[in]elt_idslocal id of inlet elements
[in]point_coordinatespoint coordinates
[in]point_weightpoint weights (surface, volume or NULL)
[in]initializeinitialization indicator
[in]verbosityverbosity level
[in]inflowpointer to structure for Batten method
[in]t_curcurrent time
[in]vel_m_lmean velocity at each point
[in]rij_lreynolds stresses at each point
[in]eps_ldissipation rate at each point
[out]fluctuationsvelocity fluctuations at each point
[in]n_pointslocal number of points where turbulence is generated
[in]elt_idslocal id of inlet boundary faces
[in]point_coordinatespoint coordinates
[in]point_weightpoint weights (surface, volume or nullptr)
[in]initializeinitialization indicator
[in]verbosityverbosity level
[in]inflowpointer to structure for Batten method
[in]t_curcurrent time
[in]vel_m_lmean velocity at each point
[in]rij_lReynolds stresses at each point
[in]eps_ldissipation rate at each point
[out]fluctuationsvelocity fluctuations at each point

◆ cs_les_synthetic_eddy_restart_read()

void cs_les_synthetic_eddy_restart_read ( void  )

◆ cs_les_synthetic_eddy_restart_write()

void cs_les_synthetic_eddy_restart_write ( void  )

◆ cs_les_synthetic_eddy_set_n_restart_structures()

void cs_les_synthetic_eddy_set_n_restart_structures ( int  n_structures)

Set number of structures used for volume SEM when restarting from another turbulence model.

By default, a restart file is read if present, and a checkpoint written. If not read, synthetic fluctuations are re-initialized.

Parameters
[in]n_structuresnumber of structures for initialization

◆ cs_user_les_inflow_advanced()

void cs_user_les_inflow_advanced ( const cs_zone_t zone,
cs_real_3_t  vel_l[],
cs_real_6_t  rij_l[],
cs_real_t  eps_l[] 
)

Definition of mean velocity, Reynolds stresses and dissipation rate for each boundary face of the given synthetic turbulence inlet.

Accurate definition of mean velocity, Reynolds stresses and dissipation rate for each boundary face of the given synthetic turbulence inlet

Rij components are ordered as usual: XX, YY, ZZ, XY, YZ, XZ

Arrays are pre-initialized before this function is called (see cs_user_les_inflow_define).

vel_l[face_id][coo_id] = vel_r[coo_id]

rij_l[face_id][0] = 2./3. * k_l rij_l[face_id][1] = 2./3. * k_l rij_l[face_id][2] = 2./3. * k_l rij_l[face_id][3] = 0 rij_l[face_id][4] = 0 rij_l[face_id][5] = 0

eps_l[face_id] = eps_r

Parameters
[in]zonepointer to associated boundary zone
[in,out]vel_lvelocity a zone faces
[in,out]rij_lreynods stresses at zone faces
[in,out]eps_lreference turbulent dissipation

◆ cs_user_les_inflow_define()

void cs_user_les_inflow_define ( void  )

Define parameters of synthetic turbulence at LES inflow.

◆ cs_user_les_inflow_update()

void cs_user_les_inflow_update ( const cs_zone_t zone,
cs_real_t  vel_r[3],
cs_real_t k_r,
cs_real_t eps_r 
)

Update of the characteristics of a given synthetic turbulence inlet.

Parameters
[in]zonepointer to associated boundary zone
[out]vel_rreference mean velocity
[out]k_rreference turbulent kinetic energy
[out]eps_rreference turbulent dissipation