Code_Saturne
CFD tool
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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-2012 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 /*----------------------------------------------------------------------------
32  * Local headers
33  *----------------------------------------------------------------------------*/
34 
35 #include "cs_base.h"
36 
37 /*----------------------------------------------------------------------------*/
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #if 0
42 } /* Fake brace to force Emacs auto-indentation back to column 0 */
43 #endif
44 #endif /* __cplusplus */
45 
46 /*============================================================================
47  * Macro definitions
48  *============================================================================*/
49 
50 /*============================================================================
51  * Type definitions
52  *============================================================================*/
53 
54 /*----------------------------------------------------------------------------
55  * Type of synthetic turbulence generation
56  *----------------------------------------------------------------------------*/
57 
58 typedef enum {
59 
60  CS_INFLOW_LAMINAR, /* Laminar fluctuations (i.e no fluctuation) */
61  CS_INFLOW_RANDOM, /* Gaussian random fluctuation */
62  CS_INFLOW_BATTEN, /* Fluctuations generated by the Batten method */
63  CS_INFLOW_SEM /* Fluctuations generated by the Synthetic Eddy Method */
64 
66 
67 /*=============================================================================
68  * Local Structure Definitions
69  *============================================================================*/
70 
71 /* Inlet definition */
72 /*------------------*/
73 
74 typedef struct _cs_inlet_t cs_inlet_t;
75 
76 /*=============================================================================
77  * Public function prototypes for Fortran API
78  *============================================================================*/
79 
80 /*----------------------------------------------------------------------------
81  * Creation of a structure for the inlets
82  *----------------------------------------------------------------------------*/
83 
84 void CS_PROCF(defsyn, DEFSYN)
85 (
86  cs_int_t *n_inlets /* <-- number of inlets */
88 );
89 
90 /*----------------------------------------------------------------------------
91  * General synthetic turbulence generation
92  *----------------------------------------------------------------------------*/
93 
94 void CS_PROCF(synthe, SYNTHE)(
95  const cs_int_t *const nvar, /* --> number of variables */
96  const cs_int_t *const nscal, /* --> number of scalars */
97  const cs_int_t *const iu, /* --> index of velocity component */
98  const cs_int_t *const iv, /* --> index of velocity component */
99  const cs_int_t *const iw, /* --> index of velocity component */
100  const cs_real_t *const ttcabs, /* --> current physical time */
101  const cs_real_t dt[], /* --> time step */
102  const cs_real_t rtpa[], /* --> variables at cellules (previous) */
103  const cs_real_t rtp[], /* --> variables at cellules */
104  const cs_real_t propce[], /* --> physical properties at cells */
105  const cs_real_t propfa[], /* --> physical properties at faces */
106  const cs_real_t propfb[], /* --> physical properties at bound. faces */
107  const cs_real_t coefa[], /* --> boundary conditions array */
108  const cs_real_t coefb[], /* --> boundary conditions array */
109  cs_real_t rcodcl[] /* <-> boundary conditions array */
111 );
112 
113 void CS_PROCF(cs_user_les_inflow_init, CS_USER_LES_INFLOW_INIT)(
114  cs_int_t *nent /* <-- number of LES inlets */
115 );
116 
117 void CS_PROCF(cs_user_les_inflow_define, CS_USER_LES_INFLOW_DEFINE)(
118  const cs_int_t *const nument, /* --> id of the inlet */
119  int *typent, /* <-- type of inflow method at the inlet */
120  int *nelent, /* <-- numb. of entities of the inflow meth*/
121  int *iverbo, /* <-- verbosity level */
122  cs_int_t *nfbent, /* <-- numb. of bound. faces of the inlet */
123  cs_int_t lfbent[], /* <-- list of bound. faces of the inlet */
124  cs_real_t vitent[], /* <-- ref. mean velocity at the inlet */
125  cs_real_t *enrent, /* <-- ref. turb. kin. ener. at the inlet */
126  cs_real_t *dspent /* <-- ref. turb. dissipation at the inlet */
127 );
128 
129 void CS_PROCF(cs_user_les_inflow_advanced, CS_USER_LES_INFLOW_ADVANCED)(
130  const cs_int_t *const nument, /* --> id of the inlet */
131  const cs_int_t *const nfbent, /* --> numb. of bound. faces of the inlet */
132  const cs_int_t *const nvar, /* --> number of variables */
133  const cs_int_t *const nscal, /* --> number of scalars */
134  const cs_int_t lfbent[], /* --> list of bound. faces of the inlet */
135  const cs_real_t dt[], /* --> time step */
136  const cs_real_t rtpa[], /* --> variables at cells (previous) */
137  const cs_real_t rtp[], /* --> variables at cells */
138  const cs_real_t propce[], /* --> physical properties at cells */
139  const cs_real_t propfa[], /* --> physical properties at faces */
140  const cs_real_t propfb[], /* --> physical properties at bound. faces */
141  const cs_real_t coefa[], /* --> boundary conditions array */
142  const cs_real_t coefb[], /* --> boundary conditions array */
143  cs_real_t uent[], /* <-- mean velocity at the inlet faces */
144  cs_real_t rijent[], /* <-- turb. kin. ener. at the inlet faces */
145  cs_real_t epsent[] /* <-- turb. dissipation at the inlet faces*/
146 );
147 
148 /*----------------------------------------------------------------------------
149  * Read the restart file of the LES inflow module
150  *----------------------------------------------------------------------------*/
151 
152 void CS_PROCF(lecsyn, LECSYN)
153 (
154  const char *const filnam, /* <- Name of the sequel file */
155  const cs_int_t *const lngnam /* <- Length of the name */
157 );
158 
159 /*----------------------------------------------------------------------------
160  * Write the restart file of the LES inflow module
161  *----------------------------------------------------------------------------*/
162 
163 void CS_PROCF(ecrsyn, ECRSYN)
164 (
165  const char *const filnam, /* <- Name of the sequel file */
166  const cs_int_t *const lngnam /* <- Length of the name */
168 );
169 
170 /*=============================================================================
171  * Public function prototypes
172  *============================================================================*/
173 
174 /*----------------------------------------------------------------------------
175  * Finalize turbulent inflow generation API.
176  *----------------------------------------------------------------------------*/
177 
178 void
179 cs_inflow_finalize(void);
180 
181 #ifdef __cplusplus
182 }
183 #endif /* __cplusplus */
184 
185 #endif /* __CS_LES_INFLOW_H__ */
void synthe(const cs_int_t *const nvar, const cs_int_t *const nscal, const cs_int_t *const iu, const cs_int_t *const iv, const cs_int_t *const iw, const cs_real_t *const ttcabs, const cs_real_t dt[], const cs_real_t rtpa[], const cs_real_t rtp[], const cs_real_t propce[], const cs_real_t propfa[], const cs_real_t propfb[], const cs_real_t coefa[], const cs_real_t coefb[], cs_real_t rcodcl[]CS_ARGF_SUPP_CHAINE)
Definition: cs_les_inflow.c:1285
Definition: cs_les_inflow.h:62
cs_inflow_type_t
Definition: cs_les_inflow.h:58
void cs_inflow_finalize(void)
Definition: cs_les_inflow.c:2192
void cs_user_les_inflow_init(cs_int_t *nent)
void lecsyn(const char *const filnam, const cs_int_t *const lngnamCS_ARGF_SUPP_CHAINE)
Definition: cs_les_inflow.c:1484
void cs_user_les_inflow_define(const cs_int_t *const nument, int *typent, int *nelent, int *iverbo, cs_int_t *nfbent, cs_int_t lfbent[], cs_real_t vitent[], cs_real_t *enrent, cs_real_t *dspent)
#define CS_ARGF_SUPP_CHAINE
Definition: cs_defs.h:394
Definition: cs_les_inflow.h:60
int cs_int_t
Definition: cs_defs.h:263
void cs_user_les_inflow_advanced(const cs_int_t *const nument, const cs_int_t *const nfbent, const cs_int_t *const nvar, const cs_int_t *const nscal, const cs_int_t lfbent[], const cs_real_t dt[], const cs_real_t rtpa[], const cs_real_t rtp[], const cs_real_t propce[], const cs_real_t propfa[], const cs_real_t propfb[], const cs_real_t coefa[], const cs_real_t coefb[], cs_real_t uent[], cs_real_t rijent[], cs_real_t epsent[])
Definition: cs_les_inflow.c:136
void defsyn(cs_int_t *n_inletsCS_ARGF_SUPP_CHAINE)
Definition: cs_les_inflow.c:1179
double cs_real_t
Definition: cs_defs.h:264
#define CS_PROCF(x, y)
Definition: cs_defs.h:379
Definition: cs_les_inflow.h:63
void ecrsyn(const char *const filnam, const cs_int_t *const lngnamCS_ARGF_SUPP_CHAINE)
Definition: cs_les_inflow.c:1909
Definition: cs_les_inflow.h:61