programmer's documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules 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-2018 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 <ple_locator.h>
41 
42 #include "cs_base.h"
43 
44 /*----------------------------------------------------------------------------*/
45 
47 
48 /*============================================================================
49  * Type definitions
50  *============================================================================*/
51 
52 /*----------------------------------------------------------------------------
53  * Structures associated to boundary conditions definition
54  *----------------------------------------------------------------------------*/
55 
56 typedef struct {
57  double val1; /* fortran array RCODCL(.,.,1) mapping */
58  double val2; /* fortran array RCODCL(.,.,2) mapping */
59  double val3; /* fortran array RCODCL(.,.,3) mapping */
60 } cs_val_t;
61 
62 typedef struct {
63  int read_data; /* 1 if profile is calculated from data */
64  int automatic; /* 1 if nature of the boundary is automatic */
65 } cs_meteo_t;
66 
67 typedef struct {
68  char **label; /* label for each boundary zone */
69  char **nature; /* nature for each boundary zone */
70  int *iqimp; /* 1 if a flow rate is applied */
71  int *ientfu; /* 1 for a fuel flow inlet (gas combustion - D3P) */
72  int *ientox; /* 1 for an air flow inlet (gas combustion - D3P) */
73  int *ientgb; /* 1 for burned gas inlet (gas combustion) */
74  int *ientgf; /* 1 for unburned gas inlet (gas combustion) */
75  int *ientat; /* 1 if inlet for oxydant (coal combustion) */
76  int *ientcp; /* 1 if inlet for oxydant+coal (coal combustion) */
77  int *icalke; /* automatic boundaries for turbulent variables */
78  double *qimp; /* oxydant flow rate (coal combustion) */
79  int *inmoxy; /* oxydant number (coal combustion) */
80  double *timpat; /* inlet temperature of oxydant (coal combustion) */
81  double *tkent; /* inlet temperature (gas combustion) */
82  double **qimpcp; /* inlet coal flow rate (coal combustion) */
83  double **timpcp; /* inlet coal temperature (coal combustion) */
84  double *fment; /* Mean Mixture Fraction at Inlet (gas combustion) */
85  int *itype; /* type of inlet/outlet (compressible model) */
86  double *prein; /* inlet pressure (compressible model) */
87  double *rhoin; /* inlet density (compressible model) */
88  double *tempin; /* inlet temperature (compressible model) */
89  double *entin; /* inlet total energy (compressible model) */
90  double *preout; /* outlet pressure for subsonic(compressible model)*/
91  double *dh; /* inlet hydraulic diameter */
92  double *xintur; /* inlet turbulent intensity */
93  int **type_code; /* type of boundary for each variables */
94  cs_val_t **values; /* fortran array RCODCL mapping */
95  double ***distch; /* ratio for each coal */
96  double *rough; /* roughness size */
97  double *norm; /* norm of velocity vector */
98  double *dirx; /* directions x inlet velocity */
99  double *diry; /* directions y inlet velocity */
100  double *dirz; /* directions z inlet velocity */
101  mei_tree_t **velocity; /* formula for norm or mass flow rate of velocity */
102  mei_tree_t **direction; /* formula for direction of velocity */
103  cs_meteo_t *meteo; /* inlet or outlet info for atmospheric flow */
104  mei_tree_t ***scalar; /* formula for scalar (neumann, dirichlet or
105  exchange coefficient)*/
106  mei_tree_t **headLoss; /* formula for head loss (free inlet/outlet) */
107  mei_tree_t **groundwat; /* formula for hydraulic head (groundwater) */
108  ple_locator_t **locator; /* locator for inlet mapped */
109 } cs_boundary_t;
110 
111 /*============================================================================
112  * Static global variables
113  *============================================================================*/
114 
115 /* Pointer on the main boundaries structure */
116 
117 extern cs_boundary_t *boundaries;
118 
119 /*============================================================================
120  * Public function prototypes for Fortran API
121  *============================================================================*/
122 /*----------------------------------------------------------------------------
123  * Boundary conditions treatment
124  *
125  * Remember: rdoccl[k][j][i] = rcodcl[ k * dim1 *dim2 + j *dim1 + i]
126  *
127  * Fortran Interface:
128  *
129  * subroutine uiclim
130  * *****************
131  *----------------------------------------------------------------------------*/
132 
133 void CS_PROCF (uiclim, UICLIM)(const int *idarcy,
134  const int *nozppm,
135  const int *ncharm,
136  const int *ncharb,
137  const int *nclpch,
138  int *iqimp,
139  int *icalke,
140  int *ientat,
141  int *ientcp,
142  int *inmoxy,
143  int *ientox,
144  int *ientfu,
145  int *ientgf,
146  int *ientgb,
147  int *iprofm,
148  int *iautom,
149  int *itypfb,
150  int *izfppp,
151  int *icodcl,
152  double *surfbo,
153  double *cdgfbo,
154  double *qimp,
155  double *qimpat,
156  double *qimpcp,
157  double *dh,
158  double *xintur,
159  double *timpat,
160  double *timpcp,
161  double *tkent,
162  double *fment,
163  double *distch,
164  int *nvar,
165  double *rcodcl);
166 
167 /*----------------------------------------------------------------------------
168  * Boundary conditions input verification
169  *
170  * Fortran Interface:
171  *
172  * SUBROUTINE UICLVE
173  * *****************
174  *
175  * integer nozppm <-- max number of boundary conditions zone
176  * integer iale <-- ale module activated
177  * integer itypfb <-- type of boundary for each face
178  * integer izfppp <-- zone number
179  *----------------------------------------------------------------------------*/
180 
181 void CS_PROCF (uiclve, UICLVE)(const int *nozppm,
182  const int *iale,
183  int *itypfb,
184  int *izfppp);
185 
186 /*=============================================================================
187  * Public function prototypes
188  *============================================================================*/
189 
190 /*-----------------------------------------------------------------------------
191  * Return number of boundary regions definition
192  *----------------------------------------------------------------------------*/
193 
194 int
196 
197 /*-----------------------------------------------------------------------------
198  * Return the nature of boundary condition for the given zone
199  *----------------------------------------------------------------------------*/
200 
201 char *
202 cs_gui_boundary_zone_nature(int ith_zone);
203 
204 /*-----------------------------------------------------------------------------
205  * Return the label of boundary condition for the given zone
206  *----------------------------------------------------------------------------*/
207 
208 char *
209 cs_gui_boundary_zone_label(int ith_zone);
210 
211 /*-----------------------------------------------------------------------------
212  * Return the zone number of boundary condition for the given zone
213  *----------------------------------------------------------------------------*/
214 
215 int
216 cs_gui_boundary_zone_number(int ith_zone);
217 
218 /*-----------------------------------------------------------------------------
219  * Return the description of a boundary zone
220  *
221  * parameters:
222  * label <-- label of boundary zone
223  *----------------------------------------------------------------------------*/
224 
225 char *
226 cs_gui_boundary_zone_localization(const char *label);
227 
228 /*-----------------------------------------------------------------------------
229  * Helper to get the face list for the izone
230  *
231  * parameters:
232  * label <-- boundary label
233  * n_faces --> number of faces
234  *
235  * returns:
236  * pointer to face list
237  *----------------------------------------------------------------------------*/
238 
239 const cs_lnum_t *
240 cs_gui_get_boundary_faces(const char *label,
241  cs_lnum_t *n_faces);
242 
243 /*----------------------------------------------------------------------------
244  * Free boundary conditions structures
245  *
246  * parameters:
247  * ncharb <-- number of coals
248  *----------------------------------------------------------------------------*/
249 
250 void
251 cs_gui_boundary_conditions_free_memory(const int *ncharb);
252 
253 /*----------------------------------------------------------------------------*/
254 
256 
257 #endif /* __CS_GUI_BOUNDARY_CONDITION_H__ */
int read_data
Definition: cs_gui_boundary_conditions.h:63
int * ientfu
Definition: cs_gui_boundary_conditions.h:71
double val1
Definition: cs_gui_boundary_conditions.h:57
double * dirz
Definition: cs_gui_boundary_conditions.h:100
char ** label
Definition: cs_gui_boundary_conditions.h:68
mei_tree_t *** scalar
Definition: cs_gui_boundary_conditions.h:104
int * itype
Definition: cs_gui_boundary_conditions.h:85
int automatic
Definition: cs_gui_boundary_conditions.h:64
const cs_lnum_t * cs_gui_get_boundary_faces(const char *label, cs_lnum_t *n_faces)
Definition: cs_gui_boundary_conditions.c:3467
double * timpat
Definition: cs_gui_boundary_conditions.h:80
Definition: cs_gui_boundary_conditions.h:62
int * ientox
Definition: cs_gui_boundary_conditions.h:72
#define BEGIN_C_DECLS
Definition: cs_defs.h:453
int cs_gui_boundary_zone_number(int ith_zone)
Definition: cs_gui_boundary_conditions.c:3410
char ** nature
Definition: cs_gui_boundary_conditions.h:69
double * tempin
Definition: cs_gui_boundary_conditions.h:88
int * iqimp
Definition: cs_gui_boundary_conditions.h:70
double * dirx
Definition: cs_gui_boundary_conditions.h:98
char * cs_gui_boundary_zone_nature(int ith_zone)
Definition: cs_gui_boundary_conditions.c:3366
Definition: cs_gui_boundary_conditions.h:67
void uiclim(const int *idarcy, const int *nozppm, const int *ncharm, const int *ncharb, const int *nclpch, int *iqimp, int *icalke, int *ientat, int *ientcp, int *inmoxy, int *ientox, int *ientfu, int *ientgf, int *ientgb, int *iprofm, int *iautom, int *itypfb, int *izfppp, int *icodcl, 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 *nvar, double *rcodcl)
Definition: cs_gui_boundary_conditions.c:1773
char * cs_gui_boundary_zone_localization(const char *label)
Definition: cs_gui_boundary_conditions.c:3438
int * ientcp
Definition: cs_gui_boundary_conditions.h:76
void cs_gui_boundary_conditions_free_memory(const int *ncharb)
Definition: cs_gui_boundary_conditions.c:3488
double * rhoin
Definition: cs_gui_boundary_conditions.h:87
double * prein
Definition: cs_gui_boundary_conditions.h:86
mei_tree_t ** direction
Definition: cs_gui_boundary_conditions.h:102
int * inmoxy
Definition: cs_gui_boundary_conditions.h:79
double * tkent
Definition: cs_gui_boundary_conditions.h:81
cs_meteo_t * meteo
Definition: cs_gui_boundary_conditions.h:103
cs_boundary_t * boundaries
double val2
Definition: cs_gui_boundary_conditions.h:58
char * cs_gui_boundary_zone_label(int ith_zone)
Definition: cs_gui_boundary_conditions.c:3387
ple_locator_t ** locator
Definition: cs_gui_boundary_conditions.h:108
double *** distch
Definition: cs_gui_boundary_conditions.h:95
void uiclve(const int *nozppm, const int *iale, int *itypfb, int *izfppp)
Definition: cs_gui_boundary_conditions.c:3181
double * fment
Definition: cs_gui_boundary_conditions.h:84
double * rough
Definition: cs_gui_boundary_conditions.h:96
double * entin
Definition: cs_gui_boundary_conditions.h:89
mei_tree_t ** groundwat
Definition: cs_gui_boundary_conditions.h:107
double * norm
Definition: cs_gui_boundary_conditions.h:97
double * qimp
Definition: cs_gui_boundary_conditions.h:78
double val3
Definition: cs_gui_boundary_conditions.h:59
int * ientgf
Definition: cs_gui_boundary_conditions.h:74
Build an interpreter for a mathematical expression.
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:293
int ** type_code
Definition: cs_gui_boundary_conditions.h:93
#define END_C_DECLS
Definition: cs_defs.h:454
int * ientgb
Definition: cs_gui_boundary_conditions.h:73
cs_val_t ** values
Definition: cs_gui_boundary_conditions.h:94
double ** timpcp
Definition: cs_gui_boundary_conditions.h:83
#define CS_PROCF(x, y)
Definition: cs_defs.h:467
mei_tree_t ** headLoss
Definition: cs_gui_boundary_conditions.h:106
Definition: cs_gui_boundary_conditions.h:56
double * xintur
Definition: cs_gui_boundary_conditions.h:92
double ** qimpcp
Definition: cs_gui_boundary_conditions.h:82
double * diry
Definition: cs_gui_boundary_conditions.h:99
int * icalke
Definition: cs_gui_boundary_conditions.h:77
int * ientat
Definition: cs_gui_boundary_conditions.h:75
mei_tree_t ** velocity
Definition: cs_gui_boundary_conditions.h:101
double * dh
Definition: cs_gui_boundary_conditions.h:91
double * preout
Definition: cs_gui_boundary_conditions.h:90
int cs_gui_boundary_zones_number(void)
Definition: cs_gui_boundary_conditions.c:3345