programmer's documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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-2013 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 *preout; /* outlet pressure for subsonic(compressible model)*/
89  double *dh; /* inlet hydraulic diameter */
90  double *xintur; /* inlet turbulent intensity */
91  int **type_code; /* type of boundary for each variables */
92  cs_val_t **values; /* fortran array RCODCL mapping */
93  double ***distch; /* ratio for each coal */
94  double *rough; /* roughness size */
95  double *norm; /* norm of velocity vector */
96  double *dirx; /* directions x inlet velocity */
97  double *diry; /* directions y inlet velocity */
98  double *dirz; /* directions z inlet velocity */
99  mei_tree_t **velocity; /* formula for norm or mass flow rate of velocity */
100  mei_tree_t **direction; /* formula for direction of velocity */
101  cs_meteo_t *meteo; /* inlet or outlet info for atmospheric flow */
102  mei_tree_t ***scalar; /* formula for scalar (neumann, dirichlet or
103  exchange coefficient)*/
104 } cs_boundary_t;
105 
106 /*============================================================================
107  * Static global variables
108  *============================================================================*/
109 
110 /* Pointer on the main boundaries structure */
111 
112 extern cs_boundary_t *boundaries;
113 
114 /*============================================================================
115  * Public function prototypes for Fortran API
116  *============================================================================*/
117 /*----------------------------------------------------------------------------
118  * Boundary conditions treatment
119  *
120  * Remember: rdoccl[k][j][i] = rcodcl[ k * dim1 *dim2 + j *dim1 + i]
121  *
122  * Fortran Interface:
123  *
124  * subroutine uiclim
125  * *****************
126  *----------------------------------------------------------------------------*/
127 
128 void CS_PROCF (uiclim, UICLIM)(const int *ntcabs,
129  const int *nfabor,
130  const int *nozppm,
131  const int *ncharm,
132  const int *ncharb,
133  const int *nclpch,
134  const int *iindef,
135  const int *ientre,
136  const int *iesicf,
137  const int *isspcf,
138  const int *iephcf,
139  const int *isopcf,
140  const int *iparoi,
141  const int *iparug,
142  const int *isymet,
143  const int *isolib,
144  const int *isca,
145  const int *ipr,
146  const int *iscalt,
147  const int *itempk,
148  const int *ienerg,
149  int *iqimp,
150  int *icalke,
151  int *ientat,
152  int *ientcp,
153  int *inmoxy,
154  int *ientox,
155  int *ientfu,
156  int *ientgf,
157  int *ientgb,
158  int *iprofm,
159  double *coejou,
160  double *dpot,
161  cs_real_t rtpa[],
162  int *ielcor,
163  int *ipotr,
164  int *ipoti,
165  int ipotva[],
166  int *ncelet,
167  int *itypfb,
168  int *izfppp,
169  int *icodcl,
170  double *dtref,
171  double *ttcabs,
172  double *surfbo,
173  double *cdgfbo,
174  double *qimp,
175  double *qimpat,
176  double *qimpcp,
177  double *dh,
178  double *xintur,
179  double *timpat,
180  double *timpcp,
181  double *tkent,
182  double *fment,
183  double *distch,
184  double *rcodcl);
185 
186 /*----------------------------------------------------------------------------
187  * Boundary conditions input verification
188  *
189  * Fortran Interface:
190  *
191  * SUBROUTINE UICLVE
192  * *****************
193  *
194  * INTEGER NFABOR --> number of boundary faces
195  * INTEGER NOZPPM --> max number of boundary conditions zone
196  * INTEGER IINDEF --> type of boundary: not defined
197  * INTEGER IENTRE --> type of boundary: inlet
198  * INTEGER IESICF --> type of boundary: imposed inlet (compressible)
199  * INTEGER ISSPCF --> type of boundary: supersonic outlet (compressible)
200  * INTEGER IEPHCF --> type of boundary: subsonic inlet imposed total pressure and total enthalpy (compressible)
201  * INTEGER ISOPCF --> type of boundary: subsonic outlet (compressible)
202  * INTEGER IPAROI --> type of boundary: wall
203  * INTEGER IPARUG --> type of boundary: wall with rugosity
204  * INTEGER ISYMET --> type of boundary: symmetry
205  * INTEGER ISOLIB --> type of boundary: outlet
206  * INTEGER ITYPFB --> type of boundary for each face
207  * INTEGER IZFPPP --> zone number
208  *----------------------------------------------------------------------------*/
209 
210 void CS_PROCF (uiclve, UICLVE) (const int *nfabor,
211  const int *nozppm,
212  const int *iindef,
213  const int *ientre,
214  const int *iesicf,
215  const int *iephcf,
216  const int *isspcf,
217  const int *isopcf,
218  const int *iparoi,
219  const int *iparug,
220  const int *isymet,
221  const int *isolib,
222  int *itypfb,
223  int *izfppp);
224 
225 /*=============================================================================
226  * Public function prototypes
227  *============================================================================*/
228 
229 /*-----------------------------------------------------------------------------
230  * Return number of boundary regions definition
231  *----------------------------------------------------------------------------*/
232 
233 int
235 
236 /*-----------------------------------------------------------------------------
237  * Return the nature of boundary condition for the given zone
238  *----------------------------------------------------------------------------*/
239 
240 char *
241 cs_gui_boundary_zone_nature(int ith_zone);
242 
243 /*-----------------------------------------------------------------------------
244  * Return the label of boundary condition for the given zone
245  *----------------------------------------------------------------------------*/
246 
247 char *
248 cs_gui_boundary_zone_label(int ith_zone);
249 
250 /*-----------------------------------------------------------------------------
251  * Return the zone number of boundary condition for the given zone
252  *----------------------------------------------------------------------------*/
253 
254 int
255 cs_gui_boundary_zone_number(int ith_zone);
256 
257 /*-----------------------------------------------------------------------------
258  * Return the description of a boundary zone
259  *
260  * parameters:
261  * label <-- label of boundary zone
262  *----------------------------------------------------------------------------*/
263 
264 char *
265 cs_gui_boundary_zone_localization(const char *label);
266 
267 /*-----------------------------------------------------------------------------
268  * Helper to get the face list for the izone
269  *
270  * parameters:
271  * izone <-- zone index
272  * label <-- boundary label
273  * nfabor <-- number of boundary faces
274  * nozppm <-- max number of boundary zone for preefined physics
275  * faces --> number of faces
276  *----------------------------------------------------------------------------*/
277 
278 int*
279 cs_gui_get_faces_list(int izone,
280  const char *label,
281  int nfabor,
282  int nozppm,
283  int *faces );
284 
285 /*----------------------------------------------------------------------------
286  * Free boundary conditions structures
287  *
288  * parameters:
289  * ncharb <-- number of coals
290  *----------------------------------------------------------------------------*/
291 
292 void
293 cs_gui_boundary_conditions_free_memory(const int *ncharb);
294 
295 /*----------------------------------------------------------------------------*/
296 
298 
299 #endif /* __CS_GUI_BOUNDARY_CONDITION_H__ */
int read_data
Definition: cs_gui_boundary_conditions.h:61
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:98
char ** label
Definition: cs_gui_boundary_conditions.h:66
mei_tree_t *** scalar
Definition: cs_gui_boundary_conditions.h:102
int * itype
Definition: cs_gui_boundary_conditions.h:83
int automatic
Definition: cs_gui_boundary_conditions.h:62
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
#define BEGIN_C_DECLS
Definition: cs_defs.h:403
int cs_gui_boundary_zone_number(int ith_zone)
Definition: cs_gui_boundary_conditions.c:1493
char ** nature
Definition: cs_gui_boundary_conditions.h:67
double * tempin
Definition: cs_gui_boundary_conditions.h:86
int * iqimp
Definition: cs_gui_boundary_conditions.h:68
double * dirx
Definition: cs_gui_boundary_conditions.h:96
char * cs_gui_boundary_zone_nature(int ith_zone)
Definition: cs_gui_boundary_conditions.c:1449
Definition: cs_gui_boundary_conditions.h:65
char * cs_gui_boundary_zone_localization(const char *label)
Definition: cs_gui_boundary_conditions.c:1520
int * ientcp
Definition: cs_gui_boundary_conditions.h:74
void cs_gui_boundary_conditions_free_memory(const int *ncharb)
Definition: cs_gui_boundary_conditions.c:2889
double * rhoin
Definition: cs_gui_boundary_conditions.h:85
double * prein
Definition: cs_gui_boundary_conditions.h:84
void uiclim(const int *ntcabs, const int *nfabor, const int *nozppm, const int *ncharm, const int *ncharb, const int *nclpch, const int *iindef, const int *ientre, const int *iesicf, const int *isspcf, const int *iephcf, const int *isopcf, const int *iparoi, const int *iparug, const int *isymet, const int *isolib, const int *isca, const int *ipr, const int *iscalt, const int *itempk, const int *ienerg, int *iqimp, int *icalke, int *ientat, int *ientcp, int *inmoxy, int *ientox, int *ientfu, int *ientgf, int *ientgb, int *iprofm, double *coejou, double *dpot, cs_real_t rtpa[], int *ielcor, int *ipotr, int *ipoti, int ipotva[], int *ncelet, int *itypfb, int *izfppp, int *icodcl, double *dtref, double *ttcabs, double *surfbo, double *cdgfbo, double *qimp, double *qimpat, double *qimpcp, double *dh, double *xintur, double *timpat, double *timpcp, double *tkent, double *fment, double *distch, double *rcodcl)
Definition: cs_gui_boundary_conditions.c:1658
mei_tree_t ** direction
Definition: cs_gui_boundary_conditions.h:100
double * tkent
Definition: cs_gui_boundary_conditions.h:79
cs_meteo_t * meteo
Definition: cs_gui_boundary_conditions.h:101
cs_boundary_t * boundaries
Definition: cs_gui_boundary_conditions.c:108
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:1471
double *** distch
Definition: cs_gui_boundary_conditions.h:93
double * fment
Definition: cs_gui_boundary_conditions.h:82
double * rough
Definition: cs_gui_boundary_conditions.h:94
double * entin
Definition: cs_gui_boundary_conditions.h:87
int * cs_gui_get_faces_list(int izone, const char *label, int nfabor, int nozppm, int *faces)
Definition: cs_gui_boundary_conditions.c:1549
double * norm
Definition: cs_gui_boundary_conditions.h:95
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
Build an interpreter for a mathematical expression.
int ** type_code
Definition: cs_gui_boundary_conditions.h:91
#define END_C_DECLS
Definition: cs_defs.h:404
int * ientgb
Definition: cs_gui_boundary_conditions.h:71
double cs_real_t
Definition: cs_defs.h:296
void uiclve(const int *nfabor, const int *nozppm, const int *iindef, const int *ientre, const int *iesicf, const int *iephcf, const int *isspcf, const int *isopcf, const int *iparoi, const int *iparug, const int *isymet, const int *isolib, int *itypfb, int *izfppp)
Definition: cs_gui_boundary_conditions.c:2747
cs_val_t ** values
Definition: cs_gui_boundary_conditions.h:92
double ** timpcp
Definition: cs_gui_boundary_conditions.h:81
#define CS_PROCF(x, y)
Definition: cs_defs.h:417
Definition: cs_gui_boundary_conditions.h:54
double * xintur
Definition: cs_gui_boundary_conditions.h:90
double ** qimpcp
Definition: cs_gui_boundary_conditions.h:80
double * diry
Definition: cs_gui_boundary_conditions.h:97
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:99
double * dh
Definition: cs_gui_boundary_conditions.h:89
double * preout
Definition: cs_gui_boundary_conditions.h:88
int cs_gui_boundary_zones_number(void)
Definition: cs_gui_boundary_conditions.c:1429