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-2015 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  mei_tree_t **headLoss; /* formula for head loss (free inlet/outlet) */
105 } cs_boundary_t;
106 
107 /*============================================================================
108  * Static global variables
109  *============================================================================*/
110 
111 /* Pointer on the main boundaries structure */
112 
113 extern cs_boundary_t *boundaries;
114 
115 /*============================================================================
116  * Public function prototypes for Fortran API
117  *============================================================================*/
118 /*----------------------------------------------------------------------------
119  * Boundary conditions treatment
120  *
121  * Remember: rdoccl[k][j][i] = rcodcl[ k * dim1 *dim2 + j *dim1 + i]
122  *
123  * Fortran Interface:
124  *
125  * subroutine uiclim
126  * *****************
127  *----------------------------------------------------------------------------*/
128 
129 void CS_PROCF (uiclim, UICLIM)(const int *ntcabs,
130  const int *nfabor,
131  const int *idarcy,
132  const int *darcy_gravity,
133  double *darcy_gravity_x,
134  double *darcy_gravity_y,
135  double *darcy_gravity_z,
136  const int *nozppm,
137  const int *ncharm,
138  const int *ncharb,
139  const int *nclpch,
140  const int *iindef,
141  const int *ientre,
142  const int *iesicf,
143  const int *isspcf,
144  const int *iephcf,
145  const int *isopcf,
146  const int *iparoi,
147  const int *iparug,
148  const int *isymet,
149  const int *isolib,
150  const int *ifrent,
151  const int *ifresf,
152  int *iqimp,
153  int *icalke,
154  int *ientat,
155  int *ientcp,
156  int *inmoxy,
157  int *ientox,
158  int *ientfu,
159  int *ientgf,
160  int *ientgb,
161  int *iprofm,
162  double *coejou,
163  double *dpot,
164  int *ielcor,
165  int *ipoti,
166  int *itypfb,
167  int *izfppp,
168  int *icodcl,
169  double *dtref,
170  double *ttcabs,
171  double *surfbo,
172  double *cdgfbo,
173  double *qimp,
174  double *qimpat,
175  double *qimpcp,
176  double *dh,
177  double *xintur,
178  double *timpat,
179  double *timpcp,
180  double *tkent,
181  double *fment,
182  double *distch,
183  int *nvarcl,
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 IFRESF <-- type of boundary: free surface
207  * INTEGER IALE <-- ALE module activated
208  * INTEGER ITYPFB --> type of boundary for each face
209  * INTEGER IZFPPP --> zone number
210  *----------------------------------------------------------------------------*/
211 
212 void CS_PROCF (uiclve, UICLVE)(const int *nfabor,
213  const int *nozppm,
214  const int *iindef,
215  const int *ientre,
216  const int *iesicf,
217  const int *iephcf,
218  const int *isspcf,
219  const int *isopcf,
220  const int *iparoi,
221  const int *iparug,
222  const int *isymet,
223  const int *isolib,
224  const int *ifresf,
225  const int *iale,
226  int *itypfb,
227  int *izfppp);
228 
229 /*=============================================================================
230  * Public function prototypes
231  *============================================================================*/
232 
233 /*-----------------------------------------------------------------------------
234  * Return number of boundary regions definition
235  *----------------------------------------------------------------------------*/
236 
237 int
239 
240 /*-----------------------------------------------------------------------------
241  * Return the nature of boundary condition for the given zone
242  *----------------------------------------------------------------------------*/
243 
244 char *
245 cs_gui_boundary_zone_nature(int ith_zone);
246 
247 /*-----------------------------------------------------------------------------
248  * Return the label of boundary condition for the given zone
249  *----------------------------------------------------------------------------*/
250 
251 char *
252 cs_gui_boundary_zone_label(int ith_zone);
253 
254 /*-----------------------------------------------------------------------------
255  * Return the zone number of boundary condition for the given zone
256  *----------------------------------------------------------------------------*/
257 
258 int
259 cs_gui_boundary_zone_number(int ith_zone);
260 
261 /*-----------------------------------------------------------------------------
262  * Return the description of a boundary zone
263  *
264  * parameters:
265  * label <-- label of boundary zone
266  *----------------------------------------------------------------------------*/
267 
268 char *
269 cs_gui_boundary_zone_localization(const char *label);
270 
271 /*-----------------------------------------------------------------------------
272  * Helper to get the face list for the izone
273  *
274  * parameters:
275  * izone <-- zone index
276  * label <-- boundary label
277  * nfabor <-- number of boundary faces
278  * nozppm <-- max number of boundary zone for preefined physics
279  * faces --> number of faces
280  *----------------------------------------------------------------------------*/
281 
282 cs_lnum_t*
283 cs_gui_get_faces_list(int izone,
284  const char *label,
285  cs_lnum_t nfabor,
286  int nozppm,
287  cs_lnum_t *faces);
288 
289 /*----------------------------------------------------------------------------
290  * Free boundary conditions structures
291  *
292  * parameters:
293  * ncharb <-- number of coals
294  *----------------------------------------------------------------------------*/
295 
296 void
297 cs_gui_boundary_conditions_free_memory(const int *ncharb);
298 
299 /*----------------------------------------------------------------------------*/
300 
302 
303 #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:419
int cs_gui_boundary_zone_number(int ith_zone)
Definition: cs_gui_boundary_conditions.c:2974
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:2930
Definition: cs_gui_boundary_conditions.h:65
char * cs_gui_boundary_zone_localization(const char *label)
Definition: cs_gui_boundary_conditions.c:3002
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:3080
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
double * tkent
Definition: cs_gui_boundary_conditions.h:79
cs_meteo_t * meteo
Definition: cs_gui_boundary_conditions.h:101
cs_boundary_t * boundaries
double val2
Definition: cs_gui_boundary_conditions.h:56
char * cs_gui_boundary_zone_label(int ith_zone)
Definition: cs_gui_boundary_conditions.c:2951
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, const int *ifresf, const int *iale, int *itypfb, int *izfppp)
Definition: cs_gui_boundary_conditions.c:2765
double *** distch
Definition: cs_gui_boundary_conditions.h:93
cs_lnum_t * cs_gui_get_faces_list(int izone, const char *label, cs_lnum_t nfabor, int nozppm, cs_lnum_t *faces)
Definition: cs_gui_boundary_conditions.c:3031
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
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 cs_lnum_t
local mesh entity id
Definition: cs_defs.h:292
int ** type_code
Definition: cs_gui_boundary_conditions.h:91
void uiclim(const int *ntcabs, const int *nfabor, const int *idarcy, const int *darcy_gravity, double *darcy_gravity_x, double *darcy_gravity_y, double *darcy_gravity_z, 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 *ifrent, const int *ifresf, 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:1582
#define END_C_DECLS
Definition: cs_defs.h:420
int * ientgb
Definition: cs_gui_boundary_conditions.h:71
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:433
mei_tree_t ** headLoss
Definition: cs_gui_boundary_conditions.h:104
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:2909