My Project
programmer's documentation
Loading...
Searching...
No Matches
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
55typedef 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
71typedef 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
81void CS_PROCF(defsyn, DEFSYN)
82(
83 cs_int_t *n_inlets /* <-- number of inlets */
84);
85
86/*----------------------------------------------------------------------------
87 * General synthetic turbulence generation
88 *----------------------------------------------------------------------------*/
89
90void 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
101void CS_PROCF(cs_user_les_inflow_init, CS_USER_LES_INFLOW_INIT)(
102 cs_int_t *nent /* <-- number of LES inlets */
103);
104
105void 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
117void 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
133void CS_PROCF(lecsyn, LECSYN)
134(
135 const char *filename
136);
137
138/*----------------------------------------------------------------------------
139 * Write the restart file of the LES inflow module
140 *----------------------------------------------------------------------------*/
141
142void 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
155void
157
158/*----------------------------------------------------------------------------*/
159
161
162#endif /* __CS_LES_INFLOW_H__ */
#define BEGIN_C_DECLS
Definition cs_defs.h:467
double cs_real_t
Floating-point value.
Definition cs_defs.h:302
int cs_int_t
Fortran-compatible integer.
Definition cs_defs.h:301
#define CS_PROCF(x, y)
Definition cs_defs.h:481
#define END_C_DECLS
Definition cs_defs.h:468
@ dt
Definition cs_field_pointer.h:65
void cs_user_les_inflow_init(cs_int_t *nent)
void lecsyn(const char *filename)
Definition cs_les_inflow.c:1517
cs_inflow_type_t
Definition cs_les_inflow.h:55
@ CS_INFLOW_BATTEN
Definition cs_les_inflow.h:59
@ CS_INFLOW_LAMINAR
Definition cs_les_inflow.h:57
@ CS_INFLOW_SEM
Definition cs_les_inflow.h:60
@ CS_INFLOW_RANDOM
Definition cs_les_inflow.h:58
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[], cs_real_t rcodcl[])
Definition cs_les_inflow.c:1319
struct _cs_inlet_t cs_inlet_t
Definition cs_les_inflow.h:71
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[])
void cs_inflow_finalize(void)
Definition cs_les_inflow.c:2213
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 defsyn(cs_int_t *n_inlets)
Definition cs_les_inflow.c:1214
void ecrsyn(const char *filename)
Definition cs_les_inflow.c:1934