9.0
general documentation
Loading...
Searching...
No Matches
cs_les_inflow.cpp File Reference
#include "base/cs_defs.h"
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "bft/bft_error.h"
#include "bft/bft_printf.h"
#include "base/cs_array.h"
#include "base/cs_base.h"
#include "base/cs_field.h"
#include "base/cs_field_pointer.h"
#include "base/cs_log.h"
#include "base/cs_math.h"
#include "base/cs_mem.h"
#include "mesh/cs_mesh.h"
#include "mesh/cs_mesh_quantities.h"
#include "base/cs_parall.h"
#include "base/cs_random.h"
#include "base/cs_timer.h"
#include "mesh/cs_mesh_location.h"
#include "base/cs_restart.h"
#include "base/cs_restart_default.h"
#include "turb/cs_les_inflow.h"
Include dependency graph for cs_les_inflow.cpp:

Functions

void cs_les_inflow_initialize (void)
 Creation of structures for the LES inflows.
void cs_les_inflow_finalize (void)
 Finalize turbulent inflow generation API.
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.
void cs_les_inflow_compute (void)
 General synthetic turbulence generation.
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).
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.
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.
int cs_les_synthetic_eddy_get_n_restart_structures (void)
 Return number of structures used for volume SEM when restarting from another turbulence model.
void cs_les_inflow_get_restart (bool *allow_read, bool *allow_write)
 Query behavior of the LES inflow module in case of restart.
void cs_les_inflow_set_restart (bool allow_read, bool allow_write)
 Define behavior of the LES inflow module in case of restart.

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

autotoc_md56

Parameters
[in,out]fluctuationsvelocity 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 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