8.2
general documentation
cs_les_inflow.h
Go to the documentation of this file.
1 
2 #ifndef __CS_LES_INFLOW_H__
3 #define __CS_LES_INFLOW_H__
4 
5 /*============================================================================
6  * Turbulent inflow generation
7  *============================================================================*/
8 
9 /*
10  This file is part of code_saturne, a general-purpose CFD tool.
11 
12  Copyright (C) 1998-2024 EDF S.A.
13 
14  This program is free software; you can redistribute it and/or modify it under
15  the terms of the GNU General Public License as published by the Free Software
16  Foundation; either version 2 of the License, or (at your option) any later
17  version.
18 
19  This program is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
22  details.
23 
24  You should have received a copy of the GNU General Public License along with
25  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
26  Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 */
28 
29 /*----------------------------------------------------------------------------*/
30 
31 #include "cs_defs.h"
32 
33 /*----------------------------------------------------------------------------
34  * Local headers
35  *----------------------------------------------------------------------------*/
36 
37 #include "cs_base.h"
38 #include "cs_zone.h"
39 
40 /*----------------------------------------------------------------------------*/
41 
43 
44 /*============================================================================
45  * Macro definitions
46  *============================================================================*/
47 
48 /*============================================================================
49  * Type definitions
50  *============================================================================*/
51 
52 /*----------------------------------------------------------------------------
53  * Type of synthetic turbulence generation
54  *----------------------------------------------------------------------------*/
55 
56 typedef enum {
57 
65 
66 /*=============================================================================
67  * Local Structure Definitions
68  *============================================================================*/
69 
70 /* Inlet definition */
71 /*------------------*/
72 
73 typedef struct _cs_inlet_t cs_inlet_t;
74 
75 typedef struct {
76 
84 
85 /*=============================================================================
86  * Public function prototypes
87  *============================================================================*/
88 
89 /*----------------------------------------------------------------------------*/
93 /*----------------------------------------------------------------------------*/
94 
95 void
97 
98 /*----------------------------------------------------------------------------*/
102 /*----------------------------------------------------------------------------*/
103 
104 void
106 
107 /*----------------------------------------------------------------------------*/
127 /*----------------------------------------------------------------------------*/
128 
129 void
131  bool volume_mode,
132  const cs_zone_t *zone,
133  int n_entities,
134  int verbosity,
135  const cs_real_t *vel_r,
136  cs_real_t k_r,
137  cs_real_t eps_r);
138 
139 /*----------------------------------------------------------------------------*/
143 /*----------------------------------------------------------------------------*/
144 
145 void
147 
148 /*----------------------------------------------------------------------------
149  * Read the restart file of les inflow module.
150  *----------------------------------------------------------------------------*/
151 
152 void
154 
155 /*----------------------------------------------------------------------------
156  * Write the restart file of les inflow module.
157  *----------------------------------------------------------------------------*/
158 
159 void
161 
162 /*----------------------------------------------------------------------------*/
180 /*----------------------------------------------------------------------------*/
181 
182 void
184  const cs_lnum_t elt_ids[],
185  const cs_real_3_t point_coordinates[],
186  const cs_real_t *point_weight,
187  int initialize,
188  int verbosity,
189  cs_inflow_sem_t *inflow,
190  cs_real_t t_cur,
191  const cs_real_3_t vel_m_l[],
192  const cs_real_6_t rij_l[],
193  const cs_real_t eps_l[],
194  cs_real_3_t fluctuations[]);
195 
196 /*----------------------------------------------------------------------------*/
209 void
211  const cs_real_6_t statistics[],
212  cs_real_3_t fluctuations[]);
213 
214 /*----------------------------------------------------------------------------*/
224 /*----------------------------------------------------------------------------*/
225 
226 void
228 
229 /*----------------------------------------------------------------------------*/
236 /*----------------------------------------------------------------------------*/
237 
238 int
240 
241 /*----------------------------------------------------------------------------*/
250 /*----------------------------------------------------------------------------*/
251 
252 void
253 cs_les_inflow_get_restart(bool *allow_read,
254  bool *allow_write);
255 
256 /*----------------------------------------------------------------------------*/
266 /*----------------------------------------------------------------------------*/
267 
268 void
269 cs_les_inflow_set_restart(bool allow_read,
270  bool allow_write);
271 
272 /*----------------------------------------------------------------------------*/
276 /*----------------------------------------------------------------------------*/
277 
278 void
280 
281 /*----------------------------------------------------------------------------*/
290 /*----------------------------------------------------------------------------*/
291 
292 void
294  cs_real_t vel_r[3],
295  cs_real_t *k_r,
296  cs_real_t *eps_r);
297 
298 /*----------------------------------------------------------------------------
299  * Definition of mean velocity, Reynolds stresses and dissipation rate
300  * for each boundary face of the given synthetic turbulence inlet.
301  *----------------------------------------------------------------------------*/
302 
303 void
305  cs_real_3_t vel_l[],
306  cs_real_6_t rij_l[],
307  cs_real_t eps_l[]);
308 
309 /*----------------------------------------------------------------------------*/
310 
312 
313 #endif /* __CS_LES_INFLOW_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:528
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:347
cs_real_t cs_real_6_t[6]
vector of 6 floating-point values
Definition: cs_defs.h:349
#define END_C_DECLS
Definition: cs_defs.h:529
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
cs_les_inflow_type_t
Definition: cs_les_inflow.h:56
@ CS_INFLOW_BATTEN
Definition: cs_les_inflow.h:60
@ CS_INFLOW_LAMINAR
Definition: cs_les_inflow.h:58
@ CS_INFLOW_SEM
Definition: cs_les_inflow.h:61
@ CS_INFLOW_RANDOM
Definition: cs_les_inflow.h:59
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
void cs_les_synthetic_eddy_restart_read(void)
Definition: cs_les_inflow.c:1056
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.
Definition: cs_user_les_inflow.c:97
void cs_les_synthetic_eddy_restart_write(void)
Definition: cs_les_inflow.c:1405
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
int cs_les_synthetic_eddy_get_n_restart_structures(void)
Return number of structures used for volume SEM when restarting from another turbulence model.
Definition: cs_les_inflow.c:2152
struct _cs_inlet_t cs_inlet_t
Definition: cs_les_inflow.h:73
void cs_les_inflow_get_restart(bool *allow_read, bool *allow_write)
Query behavior of the LES inflow module in case of restart.
Definition: cs_les_inflow.c:2169
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.
Definition: cs_les_inflow.c:2084
void cs_les_inflow_initialize(void)
Creation of structures for the LES inflows.
Definition: cs_les_inflow.c:484
void cs_les_inflow_finalize(void)
Finalize turbulent inflow generation API.
Definition: cs_les_inflow.c:500
void cs_user_les_inflow_define(void)
Define parameters of synthetic turbulence at LES inflow.
Definition: cs_user_les_inflow.c:79
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).
Definition: cs_les_inflow.c:1618
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.
Definition: cs_les_inflow.c:2137
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 giv...
Definition: cs_user_les_inflow.c:138
void cs_les_inflow_compute(void)
General synthetic turbulence generation.
Definition: cs_les_inflow.c:811
Definition: cs_les_inflow.h:75
int volume_mode
Definition: cs_les_inflow.h:78
int n_structures
Definition: cs_les_inflow.h:77
cs_real_3_t * energy
Definition: cs_les_inflow.h:81
cs_real_3_t * position
Definition: cs_les_inflow.h:80
Definition: cs_zone.h:55