programmer's documentation
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-2016 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  mei_tree_t **groundwat; /* formula for hydraulic head (groundwater) */
106 } cs_boundary_t;
107 
108 /*============================================================================
109  * Static global variables
110  *============================================================================*/
111 
112 /* Pointer on the main boundaries structure */
113 
114 extern cs_boundary_t *boundaries;
115 
116 /*============================================================================
117  * Public function prototypes for Fortran API
118  *============================================================================*/
119 /*----------------------------------------------------------------------------
120  * Boundary conditions treatment
121  *
122  * Remember: rdoccl[k][j][i] = rcodcl[ k * dim1 *dim2 + j *dim1 + i]
123  *
124  * Fortran Interface:
125  *
126  * subroutine uiclim
127  * *****************
128  *----------------------------------------------------------------------------*/
129 
130 void CS_PROCF (uiclim, UICLIM)(const int *ntcabs,
131  const int *nfabor,
132  const int *idarcy,
133  const int *nozppm,
134  const int *ncharm,
135  const int *ncharb,
136  const int *nclpch,
137  const int *iindef,
138  const int *ientre,
139  const int *iesicf,
140  const int *isspcf,
141  const int *iephcf,
142  const int *isopcf,
143  const int *iparoi,
144  const int *iparug,
145  const int *isymet,
146  const int *isolib,
147  const int *ifrent,
148  const int *ifresf,
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  int *itypfb,
160  int *izfppp,
161  int *icodcl,
162  double *dtref,
163  double *ttcabs,
164  double *surfbo,
165  double *cdgfbo,
166  double *qimp,
167  double *qimpat,
168  double *qimpcp,
169  double *dh,
170  double *xintur,
171  double *timpat,
172  double *timpcp,
173  double *tkent,
174  double *fment,
175  double *distch,
176  int *nvarcl,
177  double *rcodcl);
178 
179 /*----------------------------------------------------------------------------
180  * Boundary conditions input verification
181  *
182  * Fortran Interface:
183  *
184  * SUBROUTINE UICLVE
185  * *****************
186  *
187  * integer nfabor <-- number of boundary faces
188  * integer nozppm <-- max number of boundary conditions zone
189  * integer iindef <-- type of boundary: not defined
190  * integer ientre <-- type of boundary: inlet
191  * integer iesicf --> type of boundary: imposed inlet (compressible)
192  * integer isspcf --> type of boundary: supersonic outlet (compressible)
193  * integer iephcf --> type of boundary: subsonic inlet at imposed
194  * total pressure and enthalpy (compressible)
195  * integer isopcf --> type of boundary: subsonic outlet (compressible)
196  * integer iparoi <-- type of boundary: smooth wall
197  * integer iparug <-- type of boundary: rough wall
198  * integer isymet <-- type of boundary: symetry
199  * integer isolib <-- type of boundary: outlet
200  * integer ifrent <-- type of boundary: free inlet outlet
201  * integer ifresf <-- type of boundary: free surface
202  * integer iale <-- ale module activated
203  * integer itypfb <-- type of boundary for each face
204  * integer izfppp <-- zone number
205  *----------------------------------------------------------------------------*/
206 
207 void CS_PROCF (uiclve, UICLVE)(const int *nfabor,
208  const int *nozppm,
209  const int *iindef,
210  const int *ientre,
211  const int *iesicf,
212  const int *iephcf,
213  const int *isspcf,
214  const int *isopcf,
215  const int *iparoi,
216  const int *iparug,
217  const int *isymet,
218  const int *isolib,
219  const int *ifrent,
220  const int *ifresf,
221  const int *iale,
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 cs_lnum_t*
279 cs_gui_get_faces_list(int izone,
280  const char *label,
282  int nozppm,
283  cs_lnum_t *faces);
284 
285 /*----------------------------------------------------------------------------
286  * Free boundary conditions structures
287  *
288  * parameters:
289  * ncharb <-- number of coals
290  *----------------------------------------------------------------------------*/
291 
292 void
294 
295 /*----------------------------------------------------------------------------*/
296 
298 
299 #endif /* __CS_GUI_BOUNDARY_CONDITION_H__ */
int read_data
Definition: cs_gui_boundary_conditions.h:61
integer ncharm
maximum number of coals
Definition: ppppar.f90:55
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
double precision, dimension(nozppm), save xintur
turbulent intensity (k=1.5(uref*xintur)**2)
Definition: ppincl.f90:730
integer, dimension(ncharm), save nclpch
Number of classes per coal.
Definition: cpincl.f90:58
integer, dimension(nozppm), save ientfu
Definition: coincl.f90:77
integer isspcf
if itypfb=isspcf: supersonic outlet for compressible flow.
Definition: paramx.f90:163
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
integer, dimension(:), pointer itypfb
Definition: pointe.f90:122
real(c_double), pointer, save dtref
reference time step
Definition: optcal.f90:434
int automatic
Definition: cs_gui_boundary_conditions.h:62
integer, dimension(nozppm), save ientox
Definition: coincl.f90:77
integer iparug
Definition: paramx.f90:133
integer ientre
Definition: paramx.f90:97
double * timpat
Definition: cs_gui_boundary_conditions.h:78
integer, dimension(nozppm), save iprofm
iprofm –> read zone boundary conditions from profile
Definition: atincl.f90:122
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:273
#define BEGIN_C_DECLS
Definition: cs_defs.h:448
double precision, dimension(nozppm), save fment
Definition: coincl.f90:103
int cs_gui_boundary_zone_number(int ith_zone)
Definition: cs_gui_boundary_conditions.c:3178
char ** nature
Definition: cs_gui_boundary_conditions.h:67
double * tempin
Definition: cs_gui_boundary_conditions.h:86
void uiclim(const int *ntcabs, const int *nfabor, const int *idarcy, 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, 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:1660
int * iqimp
Definition: cs_gui_boundary_conditions.h:68
integer, dimension(nozppm), save ientat
Definition: cpincl.f90:249
integer idarcy
pointer to specify richards model
Definition: ppincl.f90:237
integer, dimension(nozppm), save ientgb
Definition: coincl.f90:102
double precision, dimension(nozppm), save timpat
Definition: cpincl.f90:250
double * dirx
Definition: cs_gui_boundary_conditions.h:96
integer, save nfabor
Definition: mesh.f90:58
integer iephcf
if itypfb=iephcf: mixed inlet for compressible flow with given total pressure and total enthalpy (res...
Definition: paramx.f90:195
char * cs_gui_boundary_zone_nature(int ith_zone)
Definition: cs_gui_boundary_conditions.c:3134
Definition: cs_gui_boundary_conditions.h:65
char * cs_gui_boundary_zone_localization(const char *label)
Definition: cs_gui_boundary_conditions.c:3206
int * ientcp
Definition: cs_gui_boundary_conditions.h:74
integer nozppm
maximum index of boundary zones
Definition: ppppar.f90:45
void cs_gui_boundary_conditions_free_memory(const int *ncharb)
Definition: cs_gui_boundary_conditions.c:3284
integer isopcf
if itypfb=isopcf: mixed outlet for compressible flow with a given pressure.
Definition: paramx.f90:179
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:102
integer, save ncharb
Number of coals.
Definition: cpincl.f90:51
mei_tree_t ** direction
Definition: cs_gui_boundary_conditions.h:100
real(c_double), pointer, save ttcabs
Current absolute time. In case of restart, this is equal to ttpabs + additional computed time...
Definition: optcal.f90:405
integer iesicf
if itypfb=iesicf: imposed inlet/outlet for compressible flow (for example, supersonic inlet)...
Definition: paramx.f90:150
integer iindef
Definition: paramx.f90:88
int * inmoxy
Definition: cs_gui_boundary_conditions.h:77
double precision, dimension(nozppm, ncharm), save timpcp
Definition: cpincl.f90:273
double * tkent
Definition: cs_gui_boundary_conditions.h:79
cs_meteo_t * meteo
Definition: cs_gui_boundary_conditions.h:101
double precision, dimension(nozppm), save dh
hydraulic diameter
Definition: ppincl.f90:733
cs_boundary_t * boundaries
integer ifresf
Definition: paramx.f90:220
double val2
Definition: cs_gui_boundary_conditions.h:56
char * cs_gui_boundary_zone_label(int ith_zone)
Definition: cs_gui_boundary_conditions.c:3155
integer, save iale
Activates (=1) or not (=0), activate the ALE module.
Definition: albase.f90:40
integer, dimension(nozppm), save icalke
condition type turbulence indicator
Definition: ppincl.f90:727
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 *ifrent, const int *ifresf, const int *iale, int *itypfb, int *izfppp)
Definition: cs_gui_boundary_conditions.c:2962
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:3235
double precision, dimension(nozppm), save tkent
Definition: coincl.f90:103
integer, dimension(nozppm), save ientcp
Definition: cpincl.f90:249
integer iparoi
Definition: paramx.f90:129
double precision, dimension(nozppm), save qimpat
Definition: cpincl.f90:272
integer isymet
Definition: paramx.f90:125
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
mei_tree_t ** groundwat
Definition: cs_gui_boundary_conditions.h:105
integer, dimension(nozppm), save iqimp
imposed flow zone indicator in a way which is similar to the process described in the framework of th...
Definition: ppincl.f90:721
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
integer, dimension(:), allocatable izfppp
to identify boundary zones associated with boundary faces (particular physics)
Definition: pointe.f90:130
double precision, dimension(nozppm, ncharm, ncpcmx), save distch
Definition: cpincl.f90:274
integer(c_int), pointer, save nvarcl
number of variable plus number of turbulent fluxes (used by the boundary conditions) ...
Definition: optcal.f90:661
int ** type_code
Definition: cs_gui_boundary_conditions.h:91
double precision, dimension(:,:), pointer surfbo
Definition: mesh.f90:124
integer isolib
Definition: paramx.f90:120
#define END_C_DECLS
Definition: cs_defs.h:449
int * ientgb
Definition: cs_gui_boundary_conditions.h:71
integer(c_int), pointer, save ntcabs
Current absolute time step number. In case of restart, this is equal to ntpabs + number of new iterat...
Definition: optcal.f90:392
double precision, dimension(nozppm), save qimp
Definition: coincl.f90:103
cs_val_t ** values
Definition: cs_gui_boundary_conditions.h:92
integer, dimension(nozppm), save inmoxy
Definition: ppcpfu.f90:172
double ** timpcp
Definition: cs_gui_boundary_conditions.h:81
#define CS_PROCF(x, y)
Definition: cs_defs.h:472
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
integer ifrent
Definition: paramx.f90:211
double precision, dimension(:,:), pointer cdgfbo
Definition: mesh.f90:148
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:3113