~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to include/base/cs_gui_boundary_conditions.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-24 00:00:08 UTC
  • mfrom: (6.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20111124000008-2vo99e38267942q5
Tags: 2.1.0-3
Install a missing file

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*============================================================================
2
 
 *
3
 
 *     This file is part of the Code_Saturne Kernel, element of the
4
 
 *     Code_Saturne CFD tool.
5
 
 *
6
 
 *     Copyright (C) 1998-2009 EDF S.A., France
7
 
 *
8
 
 *     contact: saturne-support@edf.fr
9
 
 *
10
 
 *     The Code_Saturne Kernel is free software; you can redistribute it
11
 
 *     and/or modify it under the terms of the GNU General Public License
12
 
 *     as published by the Free Software Foundation; either version 2 of
13
 
 *     the License, or (at your option) any later version.
14
 
 *
15
 
 *     The Code_Saturne Kernel is distributed in the hope that it will be
16
 
 *     useful, but WITHOUT ANY WARRANTY; without even the implied warranty
17
 
 *     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 
 *     GNU General Public License for more details.
19
 
 *
20
 
 *     You should have received a copy of the GNU General Public License
21
 
 *     along with the Code_Saturne Kernel; if not, write to the
22
 
 *     Free Software Foundation, Inc.,
23
 
 *     51 Franklin St, Fifth Floor,
24
 
 *     Boston, MA  02110-1301  USA
25
 
 *
26
 
 *============================================================================*/
27
 
 
28
 
#ifndef __CS_GUI_BOUNDARY_CONDITION_H__
29
 
#define __CS_GUI_BOUNDARY_CONDITION_H__
30
 
 
31
 
/*============================================================================
32
 
 * Management of the GUI parameters file: boundary conditions
33
 
 *============================================================================*/
34
 
 
35
 
/*----------------------------------------------------------------------------
36
 
 * MEI library headers
37
 
 *----------------------------------------------------------------------------*/
38
 
 
39
 
#ifdef HAVE_MEI
40
 
#include "mei_evaluate.h"
41
 
#endif
42
 
 
43
 
/*----------------------------------------------------------------------------
44
 
 * Local headers
45
 
 *----------------------------------------------------------------------------*/
46
 
 
47
 
#include "cs_base.h"
48
 
 
49
 
/*----------------------------------------------------------------------------*/
50
 
 
51
 
BEGIN_C_DECLS
52
 
 
53
 
/*============================================================================
54
 
 * Type definitions
55
 
 *============================================================================*/
56
 
 
57
 
/*----------------------------------------------------------------------------
58
 
 * Structures associated to boundary conditions definition
59
 
 *----------------------------------------------------------------------------*/
60
 
 
61
 
typedef struct {
62
 
  double val1;             /* fortran array RCODCL(.,.,1) mapping             */
63
 
  double val2;             /* fortran array RCODCL(.,.,2) mapping             */
64
 
  double val3;             /* fortran array RCODCL(.,.,3) mapping             */
65
 
} cs_val_t;
66
 
 
67
 
typedef struct {
68
 
  int        read_data;    /* 1 if profile is calculated from data            */
69
 
  int        automatic;    /* 1 if nature of the boundary is automatic        */
70
 
} cs_meteo_t;
71
 
 
72
 
typedef struct {
73
 
  char      **label;       /* label for each boundary zone                    */
74
 
  char      **nature;      /* nature for each boundary zone                   */
75
 
  int        *iqimp;       /* 1 if a flow rate is applied                     */
76
 
  int        *ientat;      /* 1 if inlet for oxydant (coal combustion)        */
77
 
  int        *ientcp;      /* 1 if inlet for oxydant+coal (coal combustion)   */
78
 
  int        *icalke;      /* automatic boundaries for turbulent variables    */
79
 
  double     *qimp;        /* oxydant flow rate (coal combustion)             */
80
 
  double     *inmoxy;      /* oxydant number (coal combustion)                */
81
 
  double     *timpat;      /* inlet temperature of oxydant (coal combustion)  */
82
 
  double    **qimpcp;      /* inlet coal flow rate (coal combustion)          */
83
 
  double    **timpcp;      /* inlet coal temperature (coal combustion)        */
84
 
  double     *dh;          /* inlet hydraulic diameter                        */
85
 
  double     *xintur;      /* inlet turbulent intensity                       */
86
 
  int       **type_code;   /* type of boundary for each variables             */
87
 
  cs_val_t  **values;      /* fortran array RCODCL mapping                    */
88
 
  double   ***distch;      /* ratio for each coal                             */
89
 
  double     *rough;       /* roughness size                                  */
90
 
  double     *norm;        /* norm of velocity vector                         */
91
 
  double     *dirx;        /* directions x inlet velocity                     */
92
 
  double     *diry;        /* directions y inlet velocity                     */
93
 
  double     *dirz;        /* directions z inlet velocity                     */
94
 
#if defined(HAVE_MEI)
95
 
  mei_tree_t **velocity;   /* formula for norm or mass flow rate of velocity  */
96
 
  mei_tree_t **direction;  /* formula for direction of velocity               */
97
 
#endif
98
 
  cs_meteo_t  *meteo;      /* inlet or outlet info for atmospheric flow       */
99
 
} cs_boundary_t;
100
 
 
101
 
 
102
 
/*----------------------------------------------------------------------------
103
 
 * Enum for boundary conditions
104
 
 *----------------------------------------------------------------------------*/
105
 
 
106
 
typedef enum {
107
 
  DIRICHLET,
108
 
  FLOW1,
109
 
  HYDRAULIC_DIAMETER,
110
 
  TURBULENT_INTENSITY,
111
 
  NEUMANN,
112
 
  COEF_ECHANGE,
113
 
  COALFLOW,
114
 
  WALL_FUNCTION
115
 
} cs_boundary_value_t;
116
 
 
117
 
/*============================================================================
118
 
 * Static global variables
119
 
 *============================================================================*/
120
 
 
121
 
/* Pointer on the main boundaries structure */
122
 
 
123
 
extern cs_boundary_t *boundaries;
124
 
 
125
 
/*============================================================================
126
 
 * Public function prototypes for Fortran API
127
 
 *============================================================================*/
128
 
 
129
 
/*----------------------------------------------------------------------------
130
 
 * Boundary conditions treatment
131
 
 *
132
 
 * Fortran Interface:
133
 
 *
134
 
 * SUBROUTINE UICLIM
135
 
 * *****************
136
 
 *
137
 
 * INTEGER          NTCABS  --> current iteration number
138
 
 * INTEGER          NFABOR  --> number of boundary faces
139
 
 * INTEGER          NOZPPM  --> max number of boundary conditions zone
140
 
 * INTEGER          NCHARM  --> maximal number of coals
141
 
 * INTEGER          NCHARB  --> number of simulated coals
142
 
 * INTEGER          NCLPCH  --> number of simulated class per coals
143
 
 * INTEGER          IINDEF  --> type of boundary: not defined
144
 
 * INTEGER          IENTRE  --> type of boundary: inlet
145
 
 * INTEGER          IPAROI  --> type of boundary: smooth wall
146
 
 * INTEGER          IPARUG  --> type of boundary: rough wall
147
 
 * INTEGER          ISYMET  --> type of boundary: symetry
148
 
 * INTEGER          ISOLIB  --> type of boundary: outlet
149
 
 * INTEGER          IQIMP   --> 1 if flow rate is applied
150
 
 * INTEGER          ICALKE  --> 1 for automatic turbulent boundary conditions
151
 
 * INTEGER          IENTAT  --> 1 for air temperature boundary conditions (coal)
152
 
 * INTEGER          IENTCP  --> 1 for coal temperature boundary conditions (coal)
153
 
 * INTEGER          inmoxy  --> oxydant number (coal)
154
 
 * integer          iprofm  --> atmospheric flows: on/off for profile from data
155
 
 * INTEGER          ITYPFB  --> type of boundary for each face
156
 
 * INTEGER          IZFPPP  --> zone number for each boundary face
157
 
 * INTEGER          ICODCL  --> boundary conditions array type
158
 
 * DOUBLE PRECISION DTREF   --> time step
159
 
 * DOUBLE PRECISION TTCABS  --> current time
160
 
 * DOUBLE PRECISION SURFBO  --> boundary faces surface
161
 
 * DOUBLE PRECISION CGDFBO  --> boundary faces center of gravity
162
 
 * DOUBLE PRECISION QIMP    --> inlet flow rate
163
 
 * DOUBLE PRECISION QIMPAT  --> inlet air flow rate (coal)
164
 
 * DOUBLE PRECISION QIMPCP  --> inlet coal flow rate (coal)
165
 
 * DOUBLE PRECISION DH      --> hydraulic diameter
166
 
 * DOUBLE PRECISION XINTUR  --> turbulent intensity
167
 
 * DOUBLE PRECISION TIMPAT  --> air temperature boundary conditions (coal)
168
 
 * DOUBLE PRECISION TIMPCP  --> inlet coal temperature (coal)
169
 
 * DOUBLE PRECISION DISTCH  --> ratio for each coal
170
 
 * DOUBLE PRECISION RCODCL  --> boundary conditions array value
171
 
 *----------------------------------------------------------------------------*/
172
 
 
173
 
void CS_PROCF (uiclim, UICLIM)(const    int *const ntcabs,
174
 
                               const    int *const nfabor,
175
 
                               const    int *const nozppm,
176
 
                               const    int *const ncharm,
177
 
                               const    int *const ncharb,
178
 
                               const    int *const nclpch,
179
 
                               const    int *const iindef,
180
 
                               const    int *const ientre,
181
 
                               const    int *const iparoi,
182
 
                               const    int *const iparug,
183
 
                               const    int *const isymet,
184
 
                               const    int *const isolib,
185
 
                                        int *const iqimp,
186
 
                                        int *const icalke,
187
 
                                        int *const ientat,
188
 
                                        int *const ientcp,
189
 
                                        int *const inmoxy,
190
 
                                        int *const iprofm,
191
 
                                        int *const itypfb,
192
 
                                        int *const izfppp,
193
 
                                        int *const icodcl,
194
 
                                     double *const dtref,
195
 
                                     double *const ttcabs,
196
 
                                     double *const surfbo,
197
 
                                     double *const cdgfbo,
198
 
                                     double *const qimp,
199
 
                                     double *const qimpat,
200
 
                                     double *const qimpcp,
201
 
                                     double *const dh,
202
 
                                     double *const xintur,
203
 
                                     double *const timpat,
204
 
                                     double *const timpcp,
205
 
                                     double *const distch,
206
 
                                     double *const rcodcl);
207
 
 
208
 
/*----------------------------------------------------------------------------
209
 
 * Boundary conditions input verification
210
 
 *
211
 
 * Fortran Interface:
212
 
 *
213
 
 * SUBROUTINE UICLVE
214
 
 * *****************
215
 
 *
216
 
 * INTEGER          NFABOR  --> number of boundary faces
217
 
 * INTEGER          NOZPPM  --> max number of boundary conditions zone
218
 
 * INTEGER          IINDEF  --> type of boundary: not defined
219
 
 * INTEGER          IENTRE  --> type of boundary: inlet
220
 
 * INTEGER          IPAROI  --> type of boundary: wall
221
 
 * INTEGER          IPARUG  --> type of boundary: wall with rugosity
222
 
 * INTEGER          ISYMET  --> type of boundary: symmetry
223
 
 * INTEGER          ISOLIB  --> type of boundary: outlet
224
 
 * INTEGER          ITYPFB  --> type of boundary for each face
225
 
 * INTEGER          IZFPPP  --> zone number
226
 
 *----------------------------------------------------------------------------*/
227
 
 
228
 
void CS_PROCF (uiclve, UICLVE) (const int *const nfabor,
229
 
                                const int *const nozppm,
230
 
                                const int *const iindef,
231
 
                                const int *const ientre,
232
 
                                const int *const iparoi,
233
 
                                const int *const iparug,
234
 
                                const int *const isymet,
235
 
                                const int *const isolib,
236
 
                                      int *const itypfb,
237
 
                                      int *const izfppp);
238
 
 
239
 
/*=============================================================================
240
 
 * Public function prototypes
241
 
 *============================================================================*/
242
 
 
243
 
/*-----------------------------------------------------------------------------
244
 
 * Return number of boundary regions definition
245
 
 *----------------------------------------------------------------------------*/
246
 
 
247
 
int
248
 
cs_gui_boundary_zones_number(void);
249
 
 
250
 
/*-----------------------------------------------------------------------------
251
 
 * Return the nature of boundary condition for the given zone
252
 
 *----------------------------------------------------------------------------*/
253
 
 
254
 
char *
255
 
cs_gui_boundary_zone_nature(const int ith_zone);
256
 
 
257
 
/*-----------------------------------------------------------------------------
258
 
 * Return the label of boundary condition for the given zone
259
 
 *----------------------------------------------------------------------------*/
260
 
 
261
 
char *
262
 
cs_gui_boundary_zone_label(const int ith_zone);
263
 
 
264
 
/*-----------------------------------------------------------------------------
265
 
 * Return the zone number of boundary condition for the given zone
266
 
 *----------------------------------------------------------------------------*/
267
 
 
268
 
int
269
 
cs_gui_boundary_zone_number(const int ith_zone);
270
 
 
271
 
/*-----------------------------------------------------------------------------
272
 
 * Return the description of a boundary zone
273
 
 *
274
 
 * parameters:
275
 
 *   label                 -->  label of boundary zone
276
 
 *----------------------------------------------------------------------------*/
277
 
 
278
 
char *
279
 
cs_gui_boundary_zone_localization(const char *const label);
280
 
 
281
 
/*-----------------------------------------------------------------------------
282
 
 * Helper to get the face list for the izone
283
 
 *
284
 
 * parameters:
285
 
 *   izone     -->  zone index
286
 
 *   label     -->  boundary label
287
 
 *   nfabor    -->  number of boundary faces
288
 
 *   nozppm    -->  max number of boundary zone for preefined physics
289
 
 *   faces     <--  number of face
290
 
 *----------------------------------------------------------------------------*/
291
 
 
292
 
int*
293
 
cs_gui_get_faces_list(const int   izone,
294
 
                      const char *label,
295
 
                      const int   nfabor,
296
 
                      const int   nozppm,
297
 
                            int  *faces );
298
 
 
299
 
/*----------------------------------------------------------------------------
300
 
 * Free memory
301
 
 *
302
 
 * INTEGER          NCHARB  --> number of coal
303
 
 *----------------------------------------------------------------------------*/
304
 
 
305
 
void
306
 
cs_gui_boundary_conditions_free_memory(const int *const ncharb);
307
 
 
308
 
/*----------------------------------------------------------------------------*/
309
 
 
310
 
END_C_DECLS
311
 
 
312
 
#endif /* __CS_GUI_BOUNDARY_CONDITION_H__ */