programmer's documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups 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-2014 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 
39 /*----------------------------------------------------------------------------*/
40 
42 
43 /*============================================================================
44  * Macro definitions
45  *============================================================================*/
46 
47 /*============================================================================
48  * Type definitions
49  *============================================================================*/
50 
51 /*----------------------------------------------------------------------------
52  * Type of synthetic turbulence generation
53  *----------------------------------------------------------------------------*/
54 
55 typedef enum {
56 
57  CS_INFLOW_LAMINAR, /* Laminar fluctuations (i.e no fluctuation) */
58  CS_INFLOW_RANDOM, /* Gaussian random fluctuation */
59  CS_INFLOW_BATTEN, /* Fluctuations generated by the Batten method */
60  CS_INFLOW_SEM /* Fluctuations generated by the Synthetic Eddy Method */
61 
63 
64 /*=============================================================================
65  * Local Structure Definitions
66  *============================================================================*/
67 
68 /* Inlet definition */
69 /*------------------*/
70 
71 typedef struct _cs_inlet_t cs_inlet_t;
72 
73 /*=============================================================================
74  * Public function prototypes for Fortran API
75  *============================================================================*/
76 
77 /*----------------------------------------------------------------------------
78  * Creation of a structure for the inlets
79  *----------------------------------------------------------------------------*/
80 
81 void CS_PROCF(defsyn, DEFSYN)
82 (
83  cs_int_t *n_inlets /* <-- number of inlets */
85 );
86 
87 /*----------------------------------------------------------------------------
88  * General synthetic turbulence generation
89  *----------------------------------------------------------------------------*/
90 
91 void CS_PROCF(synthe, SYNTHE)(
92  const cs_int_t *const nvar, /* --> number of variables */
93  const cs_int_t *const nscal, /* --> number of scalars */
94  const cs_int_t *const iu, /* --> index of velocity component */
95  const cs_int_t *const iv, /* --> index of velocity component */
96  const cs_int_t *const iw, /* --> index of velocity component */
97  const cs_real_t *const ttcabs, /* --> current physical time */
98  const cs_real_t dt[], /* --> time step */
99  const cs_real_t rtpa[], /* --> variables at cellules (previous) */
100  const cs_real_t rtp[], /* --> variables at cellules */
101  const cs_real_t propce[], /* --> physical properties at cells */
102  cs_real_t rcodcl[] /* <-> boundary conditions array */
104 );
105 
106 void CS_PROCF(cs_user_les_inflow_init, CS_USER_LES_INFLOW_INIT)(
107  cs_int_t *nent /* <-- number of LES inlets */
108 );
109 
110 void CS_PROCF(cs_user_les_inflow_define, CS_USER_LES_INFLOW_DEFINE)(
111  const cs_int_t *const nument, /* --> id of the inlet */
112  int *typent, /* <-- type of inflow method at the inlet */
113  int *nelent, /* <-- numb. of entities of the inflow meth*/
114  int *iverbo, /* <-- verbosity level */
115  cs_int_t *nfbent, /* <-- numb. of bound. faces of the inlet */
116  cs_int_t lfbent[], /* <-- list of bound. faces of the inlet */
117  cs_real_t vitent[], /* <-- ref. mean velocity at the inlet */
118  cs_real_t *enrent, /* <-- ref. turb. kin. ener. at the inlet */
119  cs_real_t *dspent /* <-- ref. turb. dissipation at the inlet */
120 );
121 
122 void CS_PROCF(cs_user_les_inflow_advanced, CS_USER_LES_INFLOW_ADVANCED)(
123  const cs_int_t *const nument, /* --> id of the inlet */
124  const cs_int_t *const nfbent, /* --> numb. of bound. faces of the inlet */
125  const cs_int_t *const nvar, /* --> number of variables */
126  const cs_int_t *const nscal, /* --> number of scalars */
127  const cs_int_t lfbent[], /* --> list of bound. faces of the inlet */
128  const cs_real_t dt[], /* --> time step */
129  cs_real_t uent[], /* <-- mean velocity at the inlet faces */
130  cs_real_t rijent[], /* <-- turb. kin. ener. at the inlet faces */
131  cs_real_t epsent[] /* <-- turb. dissipation at the inlet faces*/
132 );
133 
134 /*----------------------------------------------------------------------------
135  * Read the restart file of the LES inflow module
136  *----------------------------------------------------------------------------*/
137 
138 void CS_PROCF(lecsyn, LECSYN)
139 (
140  const char *const filnam, /* <- Name of the sequel file */
141  const cs_int_t *const lngnam /* <- Length of the name */
143 );
144 
145 /*----------------------------------------------------------------------------
146  * Write the restart file of the LES inflow module
147  *----------------------------------------------------------------------------*/
148 
149 void CS_PROCF(ecrsyn, ECRSYN)
150 (
151  const char *const filnam, /* <- Name of the sequel file */
152  const cs_int_t *const lngnam /* <- Length of the name */
154 );
155 
156 /*=============================================================================
157  * Public function prototypes
158  *============================================================================*/
159 
160 /*----------------------------------------------------------------------------
161  * Finalize turbulent inflow generation API.
162  *----------------------------------------------------------------------------*/
163 
164 void
165 cs_inflow_finalize(void);
166 
167 /*----------------------------------------------------------------------------*/
168 
170 
171 #endif /* __CS_LES_INFLOW_H__ */
Definition: cs_les_inflow.h:59
cs_inflow_type_t
Definition: cs_les_inflow.h:55
void cs_inflow_finalize(void)
Definition: cs_les_inflow.c:2255
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:1549
#define BEGIN_C_DECLS
Definition: cs_defs.h:405
int cs_int_t
Fortran-compatible integer.
Definition: cs_defs.h:295
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)
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[], cs_real_t uent[], cs_real_t rijent[], cs_real_t epsent[])
#define CS_ARGF_SUPP_CHAINE
Definition: cs_defs.h:434
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[], cs_real_t rcodcl[]CS_ARGF_SUPP_CHAINE)
Definition: cs_les_inflow.c:1346
Definition: cs_les_inflow.h:57
void defsyn(cs_int_t *n_inletsCS_ARGF_SUPP_CHAINE)
Definition: cs_les_inflow.c:1240
#define END_C_DECLS
Definition: cs_defs.h:406
double cs_real_t
Definition: cs_defs.h:296
#define CS_PROCF(x, y)
Definition: cs_defs.h:419
Definition: cs_les_inflow.h:60
void ecrsyn(const char *const filnam, const cs_int_t *const lngnamCS_ARGF_SUPP_CHAINE)
Definition: cs_les_inflow.c:1972
Definition: cs_les_inflow.h:58