Code_Saturne
CFD tool
cs_gui_boundary_conditions.h
Go to the documentation of this file.
1 #ifndef __CS_GUI_BOUNDARY_CONDITION_H__
2 #define __CS_GUI_BOUNDARY_CONDITION_H__
3 
4 /*============================================================================
5  * Management of the GUI parameters file: boundary conditions
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2012 EDF S.A.
12 
13  This program is free software; you can redistribute it and/or modify it under
14  the terms of the GNU General Public License as published by the Free Software
15  Foundation; either version 2 of the License, or (at your option) any later
16  version.
17 
18  This program is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21  details.
22 
23  You should have received a copy of the GNU General Public License along with
24  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25  Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 */
27 
28 /*----------------------------------------------------------------------------*/
29 
30 /*----------------------------------------------------------------------------
31  * MEI library headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "mei_evaluate.h"
35 
36 /*----------------------------------------------------------------------------
37  * Local headers
38  *----------------------------------------------------------------------------*/
39 
40 #include "cs_base.h"
41 
42 /*----------------------------------------------------------------------------*/
43 
45 
46 /*============================================================================
47  * Type definitions
48  *============================================================================*/
49 
50 /*----------------------------------------------------------------------------
51  * Structures associated to boundary conditions definition
52  *----------------------------------------------------------------------------*/
53 
54 typedef struct {
55  double val1; /* fortran array RCODCL(.,.,1) mapping */
56  double val2; /* fortran array RCODCL(.,.,2) mapping */
57  double val3; /* fortran array RCODCL(.,.,3) mapping */
58 } cs_val_t;
59 
60 typedef struct {
61  int read_data; /* 1 if profile is calculated from data */
62  int automatic; /* 1 if nature of the boundary is automatic */
63 } cs_meteo_t;
64 
65 typedef struct {
66  char **label; /* label for each boundary zone */
67  char **nature; /* nature for each boundary zone */
68  int *iqimp; /* 1 if a flow rate is applied */
69  int *ientfu; /* 1 for a fuel flow inlet (gas combustion - D3P) */
70  int *ientox; /* 1 for an air flow inlet (gas combustion - D3P) */
71  int *ientgb; /* 1 for burned gas inlet (gas combustion) */
72  int *ientgf; /* 1 for unburned gas inlet (gas combustion) */
73  int *ientat; /* 1 if inlet for oxydant (coal combustion) */
74  int *ientcp; /* 1 if inlet for oxydant+coal (coal combustion) */
75  int *icalke; /* automatic boundaries for turbulent variables */
76  double *qimp; /* oxydant flow rate (coal combustion) */
77  double *inmoxy; /* oxydant number (coal combustion) */
78  double *timpat; /* inlet temperature of oxydant (coal combustion) */
79  double *tkent; /* inlet temperature (gas combustion) */
80  double **qimpcp; /* inlet coal flow rate (coal combustion) */
81  double **timpcp; /* inlet coal temperature (coal combustion) */
82  double *fment; /* Mean Mixture Fraction at Inlet (gas combustion) */
83  int *itype; /* type of inlet/outlet (compressible model) */
84  double *prein; /* inlet pressure (compressible model) */
85  double *rhoin; /* inlet density (compressible model) */
86  double *tempin; /* inlet temperature (compressible model) */
87  double *entin; /* inlet total energy (compressible model) */
88  double *denin; /* inlet density for subsonic (compressible model) */
89  double *preout; /* outlet pressure for subsonic(compressible model)*/
90  double *dh; /* inlet hydraulic diameter */
91  double *xintur; /* inlet turbulent intensity */
92  int **type_code; /* type of boundary for each variables */
93  cs_val_t **values; /* fortran array RCODCL mapping */
94  double ***distch; /* ratio for each coal */
95  double *rough; /* roughness size */
96  double *norm; /* norm of velocity vector */
97  double *dirx; /* directions x inlet velocity */
98  double *diry; /* directions y inlet velocity */
99  double *dirz; /* directions z inlet velocity */
100  mei_tree_t **velocity; /* formula for norm or mass flow rate of velocity */
101  mei_tree_t **direction; /* formula for direction of velocity */
102  cs_meteo_t *meteo; /* inlet or outlet info for atmospheric flow */
103  mei_tree_t ***scalar; /* formula for scalar (neumann, dirichlet or
104  exchange coefficient)*/
105 } cs_boundary_t;
106 
107 
108 /*----------------------------------------------------------------------------
109  * Enum for boundary conditions
110  *----------------------------------------------------------------------------*/
111 
112 typedef enum {
125 
126 /*============================================================================
127  * Static global variables
128  *============================================================================*/
129 
130 /* Pointer on the main boundaries structure */
131 
132 extern cs_boundary_t *boundaries;
133 
134 /*============================================================================
135  * Public function prototypes for Fortran API
136  *============================================================================*/
137 
138 /*----------------------------------------------------------------------------
139  * Boundary conditions treatment
140  *
141  * Fortran Interface:
142  *
143  * SUBROUTINE UICLIM
144  * *****************
145  *
146  * INTEGER NTCABS --> current iteration number
147  * INTEGER NFABOR --> number of boundary faces
148  * INTEGER NOZPPM --> max number of boundary conditions zone
149  * INTEGER NCHARM --> maximal number of coals
150  * INTEGER NCHARB --> number of simulated coals
151  * INTEGER NCLPCH --> number of simulated class per coals
152  * INTEGER IINDEF --> type of boundary: not defined
153  * INTEGER IENTRE --> type of boundary: inlet
154  * INTEGER IESICF --> type of boundary: imposed inlet (compressible)
155  * INTEGER ISSPCF --> type of boundary: supersonic outlet (compressible)
156  * INTEGER IERUCF --> type of boundary: subsonic inlet (compressible)
157  * INTEGER ISOPCF --> type of boundary: subsonic outlet (compressible)
158  * INTEGER IPAROI --> type of boundary: smooth wall
159  * INTEGER IPARUG --> type of boundary: rough wall
160  * INTEGER ISYMET --> type of boundary: symetry
161  * INTEGER ISOLIB --> type of boundary: outlet
162  * INTEGER ISCA <-- indirection array for scalar number
163  * INTEGER IPR <-- rtp index for pressure
164  * INTEGER IRHO <-- rtp index for density
165  * INTEGER ITEMPK <-- rtp index for temperature (in K)
166  * INTEGER IENERG <-- rtp index for energy total
167  * INTEGER IQIMP --> 1 if flow rate is applied
168  * INTEGER ICALKE --> 1 for automatic turbulent boundary conditions
169  * INTEGER IENTAT --> 1 for air temperature boundary conditions (coal)
170  * INTEGER IENTCP --> 1 for coal temperature boundary conditions (coal)
171  * INTEGER inmoxy --> oxydant number (coal)
172  * INTEGER IENTOX --> 1 for an air fow inlet (gas combustion)
173  * INTEGER IENTFU --> 1 for fuel flow inlet (gas combustion)
174  * INTEGER IENTGB --> 1 for burned gas inlet (gas combustion)
175  * INTEGER IENTGF --> 1 for unburned gas inlet (gas combustion)
176  * integer iprofm --> atmospheric flows: on/off for profile from data
177  * INTEGER ITYPFB --> type of boundary for each face
178  * INTEGER IZFPPP --> zone number for each boundary face
179  * INTEGER ICODCL --> boundary conditions array type
180  * DOUBLE PRECISION DTREF --> time step
181  * DOUBLE PRECISION TTCABS --> current time
182  * DOUBLE PRECISION SURFBO --> boundary faces surface
183  * DOUBLE PRECISION CGDFBO --> boundary faces center of gravity
184  * DOUBLE PRECISION QIMP --> inlet flow rate
185  * DOUBLE PRECISION QIMPAT --> inlet air flow rate (coal)
186  * DOUBLE PRECISION QIMPCP --> inlet coal flow rate (coal)
187  * DOUBLE PRECISION DH --> hydraulic diameter
188  * DOUBLE PRECISION XINTUR --> turbulent intensity
189  * DOUBLE PRECISION TIMPAT --> air temperature boundary conditions (coal)
190  * DOUBLE PRECISION TIMPCP --> inlet coal temperature (coal)
191  * DOUBLE PRECISION TKENT --> inlet temperature (gas combustion)
192  * DOUBLE PRECISION FMENT --> Mean Mixture Fraction at Inlet (gas combustion)
193  * DOUBLE PRECISION DISTCH --> ratio for each coal
194  * DOUBLE PRECISION RCODCL --> boundary conditions array value
195  *----------------------------------------------------------------------------*/
196 
197 void CS_PROCF (uiclim, UICLIM)(const int *const ntcabs,
198  const int *const nfabor,
199  const int *const nozppm,
200  const int *const ncharm,
201  const int *const ncharb,
202  const int *const nclpch,
203  const int *const iindef,
204  const int *const ientre,
205  const int *const iesicf,
206  const int *const isspcf,
207  const int *const ierucf,
208  const int *const isopcf,
209  const int *const iparoi,
210  const int *const iparug,
211  const int *const isymet,
212  const int *const isolib,
213  const int *isca,
214  const int *const ipr,
215  const int *const irho,
216  const int *const itempk,
217  const int *const ienerg,
218  int *const iqimp,
219  int *const icalke,
220  int *const ientat,
221  int *const ientcp,
222  int *const inmoxy,
223  int *const ientox,
224  int *const ientfu,
225  int *const ientgf,
226  int *const ientgb,
227  int *const iprofm,
228  int *const itypfb,
229  int *const izfppp,
230  int *const icodcl,
231  double *const dtref,
232  double *const ttcabs,
233  double *const surfbo,
234  double *const cdgfbo,
235  double *const qimp,
236  double *const qimpat,
237  double *const qimpcp,
238  double *const dh,
239  double *const xintur,
240  double *const timpat,
241  double *const timpcp,
242  double *const tkent,
243  double *const fment,
244  double *const distch,
245  double *const rcodcl);
246 
247 /*----------------------------------------------------------------------------
248  * Boundary conditions input verification
249  *
250  * Fortran Interface:
251  *
252  * SUBROUTINE UICLVE
253  * *****************
254  *
255  * INTEGER NFABOR --> number of boundary faces
256  * INTEGER NOZPPM --> max number of boundary conditions zone
257  * INTEGER IINDEF --> type of boundary: not defined
258  * INTEGER IENTRE --> type of boundary: inlet
259  * INTEGER IESICF --> type of boundary: imposed inlet (compressible)
260  * INTEGER ISSPCF --> type of boundary: supersonic outlet (compressible)
261  * INTEGER IERUCF --> type of boundary: subsonic inlet (compressible)
262  * INTEGER ISOPCF --> type of boundary: subsonic outlet (compressible)
263  * INTEGER IPAROI --> type of boundary: wall
264  * INTEGER IPARUG --> type of boundary: wall with rugosity
265  * INTEGER ISYMET --> type of boundary: symmetry
266  * INTEGER ISOLIB --> type of boundary: outlet
267  * INTEGER ITYPFB --> type of boundary for each face
268  * INTEGER IZFPPP --> zone number
269  *----------------------------------------------------------------------------*/
270 
271 void CS_PROCF (uiclve, UICLVE) (const int *const nfabor,
272  const int *const nozppm,
273  const int *const iindef,
274  const int *const ientre,
275  const int *const iesicf,
276  const int *const ierucf,
277  const int *const isspcf,
278  const int *const isopcf,
279  const int *const iparoi,
280  const int *const iparug,
281  const int *const isymet,
282  const int *const isolib,
283  int *const itypfb,
284  int *const izfppp);
285 
286 /*=============================================================================
287  * Public function prototypes
288  *============================================================================*/
289 
290 /*-----------------------------------------------------------------------------
291  * Return number of boundary regions definition
292  *----------------------------------------------------------------------------*/
293 
294 int
296 
297 /*-----------------------------------------------------------------------------
298  * Return the nature of boundary condition for the given zone
299  *----------------------------------------------------------------------------*/
300 
301 char *
302 cs_gui_boundary_zone_nature(int ith_zone);
303 
304 /*-----------------------------------------------------------------------------
305  * Return the label of boundary condition for the given zone
306  *----------------------------------------------------------------------------*/
307 
308 char *
309 cs_gui_boundary_zone_label(int ith_zone);
310 
311 /*-----------------------------------------------------------------------------
312  * Return the zone number of boundary condition for the given zone
313  *----------------------------------------------------------------------------*/
314 
315 int
316 cs_gui_boundary_zone_number(int ith_zone);
317 
318 /*-----------------------------------------------------------------------------
319  * Return the description of a boundary zone
320  *
321  * parameters:
322  * label <-- label of boundary zone
323  *----------------------------------------------------------------------------*/
324 
325 char *
326 cs_gui_boundary_zone_localization(const char *label);
327 
328 /*-----------------------------------------------------------------------------
329  * Helper to get the face list for the izone
330  *
331  * parameters:
332  * izone <-- zone index
333  * label <-- boundary label
334  * nfabor <-- number of boundary faces
335  * nozppm <-- max number of boundary zone for preefined physics
336  * faces --> number of faces
337  *----------------------------------------------------------------------------*/
338 
339 int*
340 cs_gui_get_faces_list(int izone,
341  const char *label,
342  int nfabor,
343  int nozppm,
344  int *faces );
345 
346 /*----------------------------------------------------------------------------
347  * Free boundary conditions structures
348  *
349  * parameters:
350  * ncharb <-- number of coals
351  *----------------------------------------------------------------------------*/
352 
353 void
355 
356 /*----------------------------------------------------------------------------*/
357 
359 
360 #endif /* __CS_GUI_BOUNDARY_CONDITION_H__ */
int read_data
Definition: cs_gui_boundary_conditions.h:61
double * denin
Definition: cs_gui_boundary_conditions.h:88
integer iindef
Definition: paramx.f90:65
Definition: cs_gui_boundary_conditions.h:117
int * ientfu
Definition: cs_gui_boundary_conditions.h:69
double val1
Definition: cs_gui_boundary_conditions.h:55
double * dirz
Definition: cs_gui_boundary_conditions.h:99
integer, dimension(ncharm), save nclpch
Definition: cpincl.f90:61
integer, dimension(nozppm), save iqimp
Definition: ppincl.f90:247
integer, save ienerg
Definition: ppincl.f90:185
integer, dimension(nozppm), save ientfu
Definition: coincl.f90:58
char ** label
Definition: cs_gui_boundary_conditions.h:66
integer, save ipr
Definition: numvar.f90:52
mei_tree_t *** scalar
Definition: cs_gui_boundary_conditions.h:103
Definition: cs_gui_boundary_conditions.h:113
int * itype
Definition: cs_gui_boundary_conditions.h:83
integer isspcf
Definition: paramx.f90:65
Definition: cs_gui_boundary_conditions.h:119
integer isolib
Definition: paramx.f90:65
integer ientre
Definition: paramx.f90:65
int automatic
Definition: cs_gui_boundary_conditions.h:62
integer, dimension(nozppm), save ientox
Definition: coincl.f90:58
double precision, dimension(nozppm), save xintur
Definition: ppincl.f90:248
double * timpat
Definition: cs_gui_boundary_conditions.h:78
Definition: cs_gui_boundary_conditions.h:60
int * ientox
Definition: cs_gui_boundary_conditions.h:70
double precision, dimension(nozppm, ncharm), save qimpcp
Definition: cpincl.f90:280
#define BEGIN_C_DECLS
Definition: cs_defs.h:365
double precision, dimension(nozppm), save fment
Definition: coincl.f90:84
int cs_gui_boundary_zone_number(int ith_zone)
Definition: cs_gui_boundary_conditions.c:1348
char ** nature
Definition: cs_gui_boundary_conditions.h:67
Definition: cs_gui_boundary_conditions.h:118
double * tempin
Definition: cs_gui_boundary_conditions.h:86
int * iqimp
Definition: cs_gui_boundary_conditions.h:68
integer, dimension(nozppm), save ientat
Definition: cpincl.f90:256
integer, save itempk
Definition: ppincl.f90:185
integer, dimension(nozppm), save ientgb
Definition: coincl.f90:83
double precision, dimension(nozppm), save timpat
Definition: cpincl.f90:257
double * dirx
Definition: cs_gui_boundary_conditions.h:97
integer iparug
Definition: paramx.f90:65
char * cs_gui_boundary_zone_nature(int ith_zone)
Definition: cs_gui_boundary_conditions.c:1304
Definition: cs_gui_boundary_conditions.h:65
integer isopcf
Definition: paramx.f90:65
char * cs_gui_boundary_zone_localization(const char *label)
Definition: cs_gui_boundary_conditions.c:1375
void uiclim(const int *const ntcabs, const int *const nfabor, const int *const nozppm, const int *const ncharm, const int *const ncharb, const int *const nclpch, const int *const iindef, const int *const ientre, const int *const iesicf, const int *const isspcf, const int *const ierucf, const int *const isopcf, const int *const iparoi, const int *const iparug, const int *const isymet, const int *const isolib, const int *isca, const int *const ipr, const int *const irho, const int *const itempk, const int *const ienerg, int *const iqimp, int *const icalke, int *const ientat, int *const ientcp, int *const inmoxy, int *const ientox, int *const ientfu, int *const ientgf, int *const ientgb, int *const iprofm, int *const itypfb, int *const izfppp, int *const icodcl, double *const dtref, double *const ttcabs, double *const surfbo, double *const cdgfbo, double *const qimp, double *const qimpat, double *const qimpcp, double *const dh, double *const xintur, double *const timpat, double *const timpcp, double *const tkent, double *const fment, double *const distch, double *const rcodcl)
Definition: cs_gui_boundary_conditions.c:1509
int * ientcp
Definition: cs_gui_boundary_conditions.h:74
integer, dimension(:), allocatable itypfb
Definition: pointe.f90:88
Definition: cs_gui_boundary_conditions.h:122
integer, save ntcabs
Definition: optcal.f90:277
void cs_gui_boundary_conditions_free_memory(const int *ncharb)
Definition: cs_gui_boundary_conditions.c:2614
Definition: cs_gui_boundary_conditions.h:116
double * rhoin
Definition: cs_gui_boundary_conditions.h:85
double * prein
Definition: cs_gui_boundary_conditions.h:84
integer, dimension(nozppm), save ientgf
Definition: coincl.f90:83
integer, save nfabor
Definition: mesh.f90:42
integer, save ncharb
Definition: cpincl.f90:54
mei_tree_t ** direction
Definition: cs_gui_boundary_conditions.h:101
double precision, dimension(:,:), pointer surfbo
Definition: mesh.f90:104
Definition: cs_gui_boundary_conditions.h:115
Definition: cs_gui_boundary_conditions.h:123
void uiclve(const int *const nfabor, const int *const nozppm, const int *const iindef, const int *const ientre, const int *const iesicf, const int *const ierucf, const int *const isspcf, const int *const isopcf, const int *const iparoi, const int *const iparug, const int *const isymet, const int *const isolib, int *const itypfb, int *const izfppp)
Definition: cs_gui_boundary_conditions.c:2464
double precision, dimension(:,:), pointer cdgfbo
Definition: mesh.f90:106
integer iesicf
Definition: paramx.f90:65
double precision, dimension(nozppm, ncharm), save timpcp
Definition: cpincl.f90:280
double * tkent
Definition: cs_gui_boundary_conditions.h:79
integer isymet
Definition: paramx.f90:65
cs_meteo_t * meteo
Definition: cs_gui_boundary_conditions.h:102
cs_boundary_t * boundaries
Definition: cs_gui_boundary_conditions.c:96
double * inmoxy
Definition: cs_gui_boundary_conditions.h:77
double val2
Definition: cs_gui_boundary_conditions.h:56
char * cs_gui_boundary_zone_label(int ith_zone)
Definition: cs_gui_boundary_conditions.c:1326
integer, dimension(:), allocatable izfppp
Definition: pointe.f90:88
Structure defining an interpreter for a mathematical expression.
Definition: mei_evaluate.h:53
integer, save irho
Definition: ppincl.f90:185
double *** distch
Definition: cs_gui_boundary_conditions.h:94
double precision, dimension(nozppm), save tkent
Definition: coincl.f90:84
integer, dimension(nozppm), save ientcp
Definition: cpincl.f90:256
double precision, dimension(nozppm), save qimpat
Definition: cpincl.f90:279
double * fment
Definition: cs_gui_boundary_conditions.h:82
double * rough
Definition: cs_gui_boundary_conditions.h:95
integer ncharm
Definition: ppppar.f90:43
double * entin
Definition: cs_gui_boundary_conditions.h:87
integer nozppm
Definition: ppppar.f90:34
int * cs_gui_get_faces_list(int izone, const char *label, int nfabor, int nozppm, int *faces)
Definition: cs_gui_boundary_conditions.c:1404
double precision, dimension(nozppm), save dh
Definition: ppincl.f90:248
double * norm
Definition: cs_gui_boundary_conditions.h:96
double * qimp
Definition: cs_gui_boundary_conditions.h:76
double val3
Definition: cs_gui_boundary_conditions.h:57
int * ientgf
Definition: cs_gui_boundary_conditions.h:72
Definition: cs_gui_boundary_conditions.h:120
Build an interpreter for a mathematical expression.
double precision, dimension(nozppm, ncharm, ncpcmx), save distch
Definition: cpincl.f90:281
int ** type_code
Definition: cs_gui_boundary_conditions.h:92
Definition: cs_gui_boundary_conditions.h:121
cs_boundary_value_t
Definition: cs_gui_boundary_conditions.h:112
#define END_C_DECLS
Definition: cs_defs.h:366
int * ientgb
Definition: cs_gui_boundary_conditions.h:71
double precision, save ttcabs
Definition: optcal.f90:278
double precision, dimension(nozppm), save qimp
Definition: coincl.f90:84
cs_val_t ** values
Definition: cs_gui_boundary_conditions.h:93
integer, dimension(nozppm), save inmoxy
Definition: ppcpfu.f90:102
double ** timpcp
Definition: cs_gui_boundary_conditions.h:81
#define CS_PROCF(x, y)
Definition: cs_defs.h:379
Definition: cs_gui_boundary_conditions.h:54
integer, dimension(nscamx), save isca
Definition: numvar.f90:52
Definition: cs_gui_boundary_conditions.h:114
double * xintur
Definition: cs_gui_boundary_conditions.h:91
integer, dimension(nozppm), save iprofm
Definition: atincl.f90:110
integer, dimension(nozppm), save icalke
Definition: ppincl.f90:247
double precision, save dtref
Definition: optcal.f90:302
double ** qimpcp
Definition: cs_gui_boundary_conditions.h:80
integer iparoi
Definition: paramx.f90:65
double * diry
Definition: cs_gui_boundary_conditions.h:98
int * icalke
Definition: cs_gui_boundary_conditions.h:75
int * ientat
Definition: cs_gui_boundary_conditions.h:73
mei_tree_t ** velocity
Definition: cs_gui_boundary_conditions.h:100
double * dh
Definition: cs_gui_boundary_conditions.h:90
double * preout
Definition: cs_gui_boundary_conditions.h:89
integer ierucf
Definition: paramx.f90:65
int cs_gui_boundary_zones_number(void)
Definition: cs_gui_boundary_conditions.c:1284