7.1
general documentation
cs_les_inflow.c File Reference
#include "cs_defs.h"
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "bft_mem.h"
#include "bft_error.h"
#include "bft_printf.h"
#include "cs_array.h"
#include "cs_base.h"
#include "cs_field.h"
#include "cs_field_pointer.h"
#include "cs_log.h"
#include "cs_math.h"
#include "cs_mesh.h"
#include "cs_mesh_quantities.h"
#include "cs_parall.h"
#include "cs_random.h"
#include "cs_timer.h"
#include "cs_mesh_location.h"
#include "cs_restart.h"
#include "cs_restart_default.h"
#include "cs_les_inflow.h"
+ Include dependency graph for cs_les_inflow.c:

Functions

void synthe (const cs_real_t *const ttcabs, const cs_real_t dt[], cs_real_t rcodcl[])
 
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_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...
 

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_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

◆ 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 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)

◆ 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 boundary faces
[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

◆ 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

◆ synthe()

void synthe ( const cs_real_t *const  ttcabs,
const cs_real_t  dt[],
cs_real_t  rcodcl[] 
)