7.1
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-2021 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 for Fortran API
87  *============================================================================*/
88 
89 /*----------------------------------------------------------------------------
90  * General synthetic turbulence generation
91  *----------------------------------------------------------------------------*/
92 
93 void CS_PROCF(synthe, SYNTHE)
94 (
95  const cs_real_t *const ttcabs, /* --> current physical time */
96  const cs_real_t dt[], /* --> time step */
97  cs_real_t rcodcl[] /* <-> boundary conditions array */
98 );
99 
100 /*=============================================================================
101  * Public function prototypes
102  *============================================================================*/
103 
104 /*----------------------------------------------------------------------------*/
108 /*----------------------------------------------------------------------------*/
109 
110 void
112 
113 /*----------------------------------------------------------------------------*/
117 /*----------------------------------------------------------------------------*/
118 
119 void
121 
122 /*----------------------------------------------------------------------------*/
142 /*----------------------------------------------------------------------------*/
143 
144 void
146  bool volume_mode,
147  const cs_zone_t *zone,
148  int n_entities,
149  int verbosity,
150  const cs_real_t *vel_r,
151  cs_real_t k_r,
152  cs_real_t eps_r);
153 
154 /*----------------------------------------------------------------------------
155  * Read the restart file of les inflow module.
156  *----------------------------------------------------------------------------*/
157 
158 void
160 
161 /*----------------------------------------------------------------------------
162  * Write the restart file of les inflow module.
163  *----------------------------------------------------------------------------*/
164 
165 void
167 
168 /*----------------------------------------------------------------------------*/
186 /*----------------------------------------------------------------------------*/
187 
188 void
190  const cs_lnum_t elt_ids[],
191  const cs_real_3_t point_coordinates[],
192  const cs_real_t *point_weight,
193  int initialize,
194  int verbosity,
195  cs_inflow_sem_t *inflow,
196  cs_real_t t_cur,
197  const cs_real_3_t vel_m_l[],
198  const cs_real_6_t rij_l[],
199  const cs_real_t eps_l[],
200  cs_real_3_t fluctuations[]);
201 
202 /*----------------------------------------------------------------------------*/
215 void
217  const cs_real_6_t statistics[],
218  cs_real_3_t fluctuations[]);
219 
220 /*----------------------------------------------------------------------------*/
230 /*----------------------------------------------------------------------------*/
231 
232 void
234 
235 /*----------------------------------------------------------------------------*/
242 /*----------------------------------------------------------------------------*/
243 
244 int
246 
247 /*----------------------------------------------------------------------------*/
256 /*----------------------------------------------------------------------------*/
257 
258 void
259 cs_les_inflow_get_restart(bool *allow_read,
260  bool *allow_write);
261 
262 /*----------------------------------------------------------------------------*/
272 /*----------------------------------------------------------------------------*/
273 
274 void
275 cs_les_inflow_set_restart(bool allow_read,
276  bool allow_write);
277 
278 /*----------------------------------------------------------------------------*/
282 /*----------------------------------------------------------------------------*/
283 
284 void
286 
287 /*----------------------------------------------------------------------------*/
296 /*----------------------------------------------------------------------------*/
297 
298 void
300  cs_real_t vel_r[3],
301  cs_real_t *k_r,
302  cs_real_t *eps_r);
303 
304 /*----------------------------------------------------------------------------
305  * Definition of mean velocity, Reynolds stresses and dissipation rate
306  * for each boundary face of the given synthetic turbulence inlet.
307  *----------------------------------------------------------------------------*/
308 
309 void
311  cs_real_3_t vel_l[],
312  cs_real_6_t rij_l[],
313  cs_real_t eps_l[]);
314 
315 /*----------------------------------------------------------------------------*/
316 
318 
319 #endif /* __CS_LES_INFLOW_H__ */
cs_real_3_t * energy
Definition: cs_les_inflow.h:81
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:2157
cs_real_t cs_real_6_t[6]
vector of 6 floating-point values
Definition: cs_defs.h:337
int volume_mode
Definition: cs_les_inflow.h:78
cs_les_inflow_type_t
Definition: cs_les_inflow.h:56
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:2089
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:902
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:2198
#define BEGIN_C_DECLS
Definition: cs_defs.h:510
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:103
void cs_user_les_inflow_define(void)
Define parameters of synthetic turbulence at LES inflow.
Definition: cs_user_les_inflow.c:85
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
real(c_double), pointer, save ttcabs
Current absolute time.
Definition: optcal.f90:353
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:144
void cs_les_inflow_initialize(void)
Creation of structures for the LES inflows.
Definition: cs_les_inflow.c:736
Definition: cs_les_inflow.h:59
Definition: cs_field_pointer.h:65
Definition: cs_les_inflow.h:58
int n_structures
Definition: cs_les_inflow.h:77
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:335
Definition: cs_les_inflow.h:75
void cs_les_synthetic_eddy_restart_write(void)
Definition: cs_les_inflow.c:1410
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:316
cs_real_3_t * position
Definition: cs_les_inflow.h:80
void cs_les_synthetic_eddy_restart_read(void)
Definition: cs_les_inflow.c:1061
struct _cs_inlet_t cs_inlet_t
Definition: cs_les_inflow.h:73
Definition: cs_les_inflow.h:61
#define END_C_DECLS
Definition: cs_defs.h:511
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:2174
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:1623
#define CS_PROCF(x, y)
Definition: cs_defs.h:524
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:2142
void cs_les_inflow_finalize(void)
Finalize turbulent inflow generation API.
Definition: cs_les_inflow.c:752
void synthe(const cs_real_t *const ttcabs, const cs_real_t dt[], cs_real_t rcodcl[])
Definition: cs_les_inflow.c:482
Definition: cs_les_inflow.h:60
Definition: cs_zone.h:55