#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"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. | |
| 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.
| [out] | type | type of inflow method at the inlet |
| [out] | volume_mode | if true, generate turbulence over the whole domain (only if type is CS_INFLOW_SEM) |
| [in] | zone | pointer to associated boundary zone |
| [out] | n_entities | number of structures or modes |
| [out] | verbosity | verbosity level |
| [out] | vel_r | reference mean velocity |
| [out] | k_r | reference turbulent kinetic energy |
| [out] | eps_r | reference turbulent dissipation |
| void cs_les_inflow_compute | ( | void | ) |
General synthetic turbulence generation.
| void cs_les_inflow_finalize | ( | void | ) |
Finalize turbulent inflow generation API.
Query behavior of the LES inflow module in case of restart.
See cs_les_synthetic_eddy_set_restart for details.
| [out] | allow_read | pointer to read flag, or NULL |
| [out] | allow_write | pointer to write flag, or NULL |
| void cs_les_inflow_initialize | ( | void | ) |
Creation of structures for the LES inflows.
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.
| [in] | allow_read | allow reading a relevant checkpoint if present |
| [in] | allow_write | allow writing a relevant checkpoint if present |
| 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'>
| [in] | n_points | local number of points where turbulence is generated |
| [in] | statistics | statistics (i.e. Reynolds stresses) |
| [in,out] | fluctuations | velocity fluctuations generated |
| 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_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).
| [in] | n_points | local number of points where turbulence is generated |
| [in] | elt_ids | local id of inlet boundary faces |
| [in] | point_coordinates | point coordinates |
| [in] | point_weight | point weights (surface, volume or NULL) |
| [in] | initialize | initialization indicator |
| [in] | verbosity | verbosity level |
| [in] | inflow | pointer to structure for Batten method |
| [in] | t_cur | current time |
| [in] | vel_m_l | mean velocity at each point |
| [in] | rij_l | Reynolds stresses at each point |
| [in] | eps_l | dissipation rate at each point |
| [out] | fluctuations | velocity fluctuations at each point |
| void cs_les_synthetic_eddy_restart_read | ( | void | ) |
| void cs_les_synthetic_eddy_restart_write | ( | void | ) |
| 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.
| [in] | n_structures | number of structures for initialization |