My Project
programmer's 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-2019 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 */
84 );
85 
86 /*----------------------------------------------------------------------------
87  * General synthetic turbulence generation
88  *----------------------------------------------------------------------------*/
89 
90 void CS_PROCF(synthe, SYNTHE)(
91  const cs_int_t *const nvar, /* --> number of variables */
92  const cs_int_t *const nscal, /* --> number of scalars */
93  const cs_int_t *const iu, /* --> index of velocity component */
94  const cs_int_t *const iv, /* --> index of velocity component */
95  const cs_int_t *const iw, /* --> index of velocity component */
96  const cs_real_t *const ttcabs, /* --> current physical time */
97  const cs_real_t dt[], /* --> time step */
98  cs_real_t rcodcl[] /* <-> boundary conditions array */
99 );
100 
101 void CS_PROCF(cs_user_les_inflow_init, CS_USER_LES_INFLOW_INIT)(
102  cs_int_t *nent /* <-- number of LES inlets */
103 );
104 
105 void CS_PROCF(cs_user_les_inflow_define, CS_USER_LES_INFLOW_DEFINE)(
106  const cs_int_t *const nument, /* --> id of the inlet */
107  int *typent, /* <-- type of inflow method at the inlet */
108  int *nelent, /* <-- numb. of entities of the inflow meth*/
109  int *iverbo, /* <-- verbosity level */
110  cs_int_t *nfbent, /* <-- numb. of bound. faces of the inlet */
111  cs_int_t lfbent[], /* <-- list of bound. faces of the inlet */
112  cs_real_t vitent[], /* <-- ref. mean velocity at the inlet */
113  cs_real_t *enrent, /* <-- ref. turb. kin. ener. at the inlet */
114  cs_real_t *dspent /* <-- ref. turb. dissipation at the inlet */
115 );
116 
117 void CS_PROCF(cs_user_les_inflow_advanced, CS_USER_LES_INFLOW_ADVANCED)(
118  const cs_int_t *const nument, /* --> id of the inlet */
119  const cs_int_t *const nfbent, /* --> numb. of bound. faces of the inlet */
120  const cs_int_t *const nvar, /* --> number of variables */
121  const cs_int_t *const nscal, /* --> number of scalars */
122  const cs_int_t lfbent[], /* --> list of bound. faces of the inlet */
123  const cs_real_t dt[], /* --> time step */
124  cs_real_t uent[], /* <-- mean velocity at the inlet faces */
125  cs_real_t rijent[], /* <-- turb. kin. ener. at the inlet faces */
126  cs_real_t epsent[] /* <-- turb. dissipation at the inlet faces*/
127 );
128 
129 /*----------------------------------------------------------------------------
130  * Read the restart file of the LES inflow module
131  *----------------------------------------------------------------------------*/
132 
133 void CS_PROCF(lecsyn, LECSYN)
134 (
135  const char *filename
136 );
137 
138 /*----------------------------------------------------------------------------
139  * Write the restart file of the LES inflow module
140  *----------------------------------------------------------------------------*/
141 
142 void CS_PROCF(ecrsyn, ECRSYN)
143 (
144  const char *filename
145 );
146 
147 /*=============================================================================
148  * Public function prototypes
149  *============================================================================*/
150 
151 /*----------------------------------------------------------------------------
152  * Finalize turbulent inflow generation API.
153  *----------------------------------------------------------------------------*/
154 
155 void
156 cs_inflow_finalize(void);
157 
158 /*----------------------------------------------------------------------------*/
159 
161 
162 #endif /* __CS_LES_INFLOW_H__ */
cs_user_les_inflow_init
subroutine cs_user_les_inflow_init(nent)
Definition: cs_user_les_inflow.f90:60
cs_inflow_type_t
cs_inflow_type_t
Definition: cs_les_inflow.h:55
CS_INFLOW_BATTEN
Definition: cs_les_inflow.h:59
cs_defs.h
CS_PROCF
void CS_PROCF(defsyn, DEFSYN)(cs_int_t *n_inlets)
Definition: cs_les_inflow.c:1213
cs_inflow_finalize
void cs_inflow_finalize(void)
Definition: cs_les_inflow.c:2213
cs_user_les_inflow_advanced
subroutine cs_user_les_inflow_advanced(nument, nfbent, nvar, nscal, lfbent, dt, uvwent, rijent, epsent)
Generation of synthetic turbulence at LES inlets advanced mode.
Definition: cs_user_les_inflow.f90:264
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
nelent
void int int * nelent
Definition: cs_les_inflow.h:107
dspent
void int int int cs_int_t cs_int_t cs_real_t cs_real_t cs_real_t * dspent
Definition: cs_les_inflow.h:107
cs_real_t
double cs_real_t
Floating-point value.
Definition: cs_defs.h:302
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
nvar
void const cs_int_t *const const cs_int_t *const nvar
Definition: cs_les_inflow.h:119
typent
void int * typent
Definition: cs_les_inflow.h:107
rijent
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t const cs_real_t cs_real_t cs_real_t rijent[]
Definition: cs_les_inflow.h:119
uent
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t const cs_real_t cs_real_t uent[]
Definition: cs_les_inflow.h:119
iverbo
void int int int * iverbo
Definition: cs_les_inflow.h:107
rcodcl
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_real_t *const const cs_real_t cs_real_t rcodcl[]
Definition: cs_les_inflow.h:92
iw
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const iw
Definition: cs_les_inflow.h:92
cs_user_les_inflow_define
subroutine cs_user_les_inflow_define(nument, typent, nelent, iverbo, nfbent, lfbent, vitent, enrent, dspent)
Definition of the characteristics of the synthetic turbulence inlet nument.
Definition: cs_user_les_inflow.f90:164
cs_inlet_t
struct _cs_inlet_t cs_inlet_t
Definition: cs_les_inflow.h:71
CS_INFLOW_LAMINAR
Definition: cs_les_inflow.h:57
vitent
void int int int cs_int_t cs_int_t cs_real_t vitent[]
Definition: cs_les_inflow.h:107
epsent
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t const cs_real_t cs_real_t cs_real_t cs_real_t epsent[]
Definition: cs_les_inflow.h:119
dt
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_real_t *const const cs_real_t dt[]
Definition: cs_les_inflow.h:92
enrent
void int int int cs_int_t cs_int_t cs_real_t cs_real_t * enrent
Definition: cs_les_inflow.h:107
nfbent
void int int int cs_int_t * nfbent
Definition: cs_les_inflow.h:107
nscal
void const cs_int_t *const nscal
Definition: cs_les_inflow.h:92
ttcabs
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_real_t *const ttcabs
Definition: cs_les_inflow.h:92
cs_int_t
int cs_int_t
Fortran-compatible integer.
Definition: cs_defs.h:301
CS_INFLOW_SEM
Definition: cs_les_inflow.h:60
iu
void const cs_int_t *const const cs_int_t *const iu
Definition: cs_les_inflow.h:92
iv
void const cs_int_t *const const cs_int_t *const const cs_int_t *const iv
Definition: cs_les_inflow.h:92
CS_INFLOW_RANDOM
Definition: cs_les_inflow.h:58
cs_base.h
lfbent
void int int int cs_int_t cs_int_t lfbent[]
Definition: cs_les_inflow.h:107