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-2014 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  int *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  int *iqimp,
145  int *icalke,
146  int *ientat,
147  int *ientcp,
148  int *inmoxy,
149  int *ientox,
150  int *ientfu,
151  int *ientgf,
152  int *ientgb,
153  int *iprofm,
154  double *coejou,
155  double *dpot,
156  int *ielcor,
157  int *ipoti,
158  int *itypfb,
159  int *izfppp,
160  int *icodcl,
161  double *dtref,
162  double *ttcabs,
163  double *surfbo,
164  double *cdgfbo,
165  double *qimp,
166  double *qimpat,
167  double *qimpcp,
168  double *dh,
169  double *xintur,
170  double *timpat,
171  double *timpcp,
172  double *tkent,
173  double *fment,
174  double *distch,
175  int *nvarcl,
176  double *rcodcl);
177 
178 /*----------------------------------------------------------------------------
179  * Boundary conditions input verification
180  *
181  * Fortran Interface:
182  *
183  * SUBROUTINE UICLVE
184  * *****************
185  *
186  * INTEGER NFABOR --> number of boundary faces
187  * INTEGER NOZPPM --> max number of boundary conditions zone
188  * INTEGER IINDEF --> type of boundary: not defined
189  * INTEGER IENTRE --> type of boundary: inlet
190  * INTEGER IESICF --> type of boundary: imposed inlet (compressible)
191  * INTEGER ISSPCF --> type of boundary: supersonic outlet (compressible)
192  * INTEGER IEPHCF --> type of boundary: subsonic inlet imposed total pressure and total enthalpy (compressible)
193  * INTEGER ISOPCF --> type of boundary: subsonic outlet (compressible)
194  * INTEGER IPAROI --> type of boundary: wall
195  * INTEGER IPARUG --> type of boundary: wall with rugosity
196  * INTEGER ISYMET --> type of boundary: symmetry
197  * INTEGER ISOLIB --> type of boundary: outlet
198  * INTEGER ITYPFB --> type of boundary for each face
199  * INTEGER IZFPPP --> zone number
200  *----------------------------------------------------------------------------*/
201 
202 void CS_PROCF (uiclve, UICLVE) (const int *nfabor,
203  const int *nozppm,
204  const int *iindef,
205  const int *ientre,
206  const int *iesicf,
207  const int *iephcf,
208  const int *isspcf,
209  const int *isopcf,
210  const int *iparoi,
211  const int *iparug,
212  const int *isymet,
213  const int *isolib,
214  int *itypfb,
215  int *izfppp);
216 
217 /*=============================================================================
218  * Public function prototypes
219  *============================================================================*/
220 
221 /*-----------------------------------------------------------------------------
222  * Return number of boundary regions definition
223  *----------------------------------------------------------------------------*/
224 
225 int
227 
228 /*-----------------------------------------------------------------------------
229  * Return the nature of boundary condition for the given zone
230  *----------------------------------------------------------------------------*/
231 
232 char *
233 cs_gui_boundary_zone_nature(int ith_zone);
234 
235 /*-----------------------------------------------------------------------------
236  * Return the label of boundary condition for the given zone
237  *----------------------------------------------------------------------------*/
238 
239 char *
240 cs_gui_boundary_zone_label(int ith_zone);
241 
242 /*-----------------------------------------------------------------------------
243  * Return the zone number of boundary condition for the given zone
244  *----------------------------------------------------------------------------*/
245 
246 int
247 cs_gui_boundary_zone_number(int ith_zone);
248 
249 /*-----------------------------------------------------------------------------
250  * Return the description of a boundary zone
251  *
252  * parameters:
253  * label <-- label of boundary zone
254  *----------------------------------------------------------------------------*/
255 
256 char *
257 cs_gui_boundary_zone_localization(const char *label);
258 
259 /*-----------------------------------------------------------------------------
260  * Helper to get the face list for the izone
261  *
262  * parameters:
263  * izone <-- zone index
264  * label <-- boundary label
265  * nfabor <-- number of boundary faces
266  * nozppm <-- max number of boundary zone for preefined physics
267  * faces --> number of faces
268  *----------------------------------------------------------------------------*/
269 
270 int*
271 cs_gui_get_faces_list(int izone,
272  const char *label,
273  int nfabor,
274  int nozppm,
275  int *faces );
276 
277 /*----------------------------------------------------------------------------
278  * Free boundary conditions structures
279  *
280  * parameters:
281  * ncharb <-- number of coals
282  *----------------------------------------------------------------------------*/
283 
284 void
285 cs_gui_boundary_conditions_free_memory(const int *ncharb);
286 
287 /*----------------------------------------------------------------------------*/
288 
290 
291 #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:405
int cs_gui_boundary_zone_number(int ith_zone)
Definition: cs_gui_boundary_conditions.c:1439
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:1395
Definition: cs_gui_boundary_conditions.h:65
char * cs_gui_boundary_zone_localization(const char *label)
Definition: cs_gui_boundary_conditions.c:1466
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:2831
double * rhoin
Definition: cs_gui_boundary_conditions.h:85
double * prein
Definition: cs_gui_boundary_conditions.h:84
mei_tree_t ** direction
Definition: cs_gui_boundary_conditions.h:100
int * inmoxy
Definition: cs_gui_boundary_conditions.h:77
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, int *iqimp, int *icalke, int *ientat, int *ientcp, int *inmoxy, int *ientox, int *ientfu, int *ientgf, int *ientgb, int *iprofm, double *coejou, double *dpot, int *ielcor, int *ipoti, 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, int *nvarcl, double *rcodcl)
Definition: cs_gui_boundary_conditions.c:1599
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:109
double val2
Definition: cs_gui_boundary_conditions.h:56
char * cs_gui_boundary_zone_label(int ith_zone)
Definition: cs_gui_boundary_conditions.c:1417
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:1495
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:406
int * ientgb
Definition: cs_gui_boundary_conditions.h:71
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:2689
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:419
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:1375