7.1
general documentation
cs_gui.h
Go to the documentation of this file.
1 #ifndef __CS_GUI_H__
2 #define __CS_GUI_H__
3 
4 /*============================================================================
5  * Management of the GUI parameters file: main parameters
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2021 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  * Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "cs_base.h"
35 #include "cs_volume_zone.h"
36 
37 /*----------------------------------------------------------------------------*/
38 
40 
41 /*============================================================================
42  * Type definitions
43  *============================================================================*/
44 
45 /*============================================================================
46  * Public function prototypes for Fortran API
47  *============================================================================*/
48 
49 /*----------------------------------------------------------------------------
50  * Thermal model.
51  *
52  * Fortran Interface:
53  *
54  * SUBROUTINE CSTHER ()
55  * *****************
56  *
57  *----------------------------------------------------------------------------*/
58 
59 void CS_PROCF (csther, CSTHER) (void);
60 
61 /*----------------------------------------------------------------------------
62  * Turbulence model
63  *----------------------------------------------------------------------------*/
64 
65 void cs_gui_turb_model(void);
66 
67 /*----------------------------------------------------------------------------
68  * Define reference length and reference velocity for the initialization of
69  * the turbulence variables
70  *----------------------------------------------------------------------------*/
71 
72 void cs_gui_turb_ref_values(void);
73 
74 /*----------------------------------------------------------------------------
75  * Specific heat variable or constant indicator.
76  *
77  * Fortran Interface:
78  *
79  * SUBROUTINE CSCPVA
80  * *****************
81  *
82  *----------------------------------------------------------------------------*/
83 
84 void CS_PROCF (cscpva, CSCPVA) (void);
85 
86 /*----------------------------------------------------------------------------
87  * Volumic viscosity variable or constant indicator.
88  *
89  * Fortran Interface:
90  *
91  * SUBROUTINE CSCVVVA (ICP)
92  * *****************
93  *
94  * INTEGER IVISCV --> specific heat variable or constant indicator
95  *----------------------------------------------------------------------------*/
96 
97 void CS_PROCF (csvvva, CSVVVA) (int *iviscv);
98 
99 /*----------------------------------------------------------------------------
100  * Constant or variable indicator for the user scalar laminar viscosity.
101  *
102  * Fortran Interface:
103  *
104  * subroutine csivis
105  * *****************
106  *----------------------------------------------------------------------------*/
107 
108 void CS_PROCF (csivis, CSIVIS) (void);
109 
110 /*----------------------------------------------------------------------------
111  * Time passing parameter.
112  *
113  * Fortran Interface:
114  *
115  * SUBROUTINE CSIDTV ()
116  * *****************
117  *
118  *----------------------------------------------------------------------------*/
119 
120 void CS_PROCF(csidtv, CSIDTV) (void);
121 
122 /*----------------------------------------------------------------------------
123  * Hydrostatic pressure parameter.
124  *
125  * Fortran Interface:
126  *
127  * SUBROUTINE CSIPHY ()
128  * *****************
129  *
130  *----------------------------------------------------------------------------*/
131 
132 void CS_PROCF (csiphy, CSIPHY) (void);
133 
134 /*----------------------------------------------------------------------------
135  * Hydrostatic equilibrium parameter.
136  *
137  * Fortran Interface:
138  *
139  * SUBROUTINE CSCFGP (ICFGRP)
140  * *****************
141  *
142  * INTEGER ICFGRP --> hydrostatic equilibrium
143  *----------------------------------------------------------------------------*/
144 
145 void CS_PROCF (cscfgp, CSCFGP) (int *icfgrp);
146 
147 /*----------------------------------------------------------------------------
148  * Restart parameters.
149  *
150  * Fortran Interface:
151  *
152  * SUBROUTINE CSISUI
153  * *****************
154  *
155  * INTEGER NTSUIT --> checkpoint frequency
156  * INTEGER ICCFVG --> restart with frozen field
157  *----------------------------------------------------------------------------*/
158 
159 
160 void CS_PROCF (csisui, CSISUI) (int *ntsuit,
161  int *iccvfg);
162 
163 /*----------------------------------------------------------------------------
164  * Time passing parameters.
165  *
166  * Fortran Interface:
167  *
168  * SUBROUTINE CSTIME
169  * *****************
170  *
171  *----------------------------------------------------------------------------*/
172 
173 void CS_PROCF (cstime, CSTIME) (void);
174 
175 /*----------------------------------------------------------------------------
176  *
177  * Fortran Interface:
178  *
179  * SUBROUTINE UINUM1
180  * *****************
181  *
182  *----------------------------------------------------------------------------*/
183 
184 void CS_PROCF (uinum1, UINUM1) (double *cdtvar);
185 
186 /*----------------------------------------------------------------------------
187  * Global numerical parameters.
188  *
189  * Fortran Interface:
190  *
191  * SUBROUTINE CSNUM2
192  * *****************
193  *
194  * INTEGER RELAXP --> pressure relaxation
195  * INTEGER IMRGRA --> gradient reconstruction
196  *----------------------------------------------------------------------------*/
197 
198 void CS_PROCF (csnum2, CSNUM2) (double *relaxp,
199  int *imrgra);
200 
201 /*----------------------------------------------------------------------------
202  * User scalar min and max values for clipping.
203  *
204  * Fortran Interface:
205  *
206  * subroutine cssca2
207  * *****************
208  *
209  *----------------------------------------------------------------------------*/
210 
211 void CS_PROCF (cssca2, CSSCA2) (void);
212 
213 /*----------------------------------------------------------------------------
214  * Read reference dynamic and user scalar viscosity
215  *----------------------------------------------------------------------------*/
216 
217 void CS_PROCF (cssca3, CSSCA3) (void);
218 
219 /*----------------------------------------------------------------------------
220  * Turbulence initialization parameters.
221  *
222  * Fortran Interface:
223  *
224  * SUBROUTINE CSTINI
225  * *****************
226  *
227  *----------------------------------------------------------------------------*/
228 
229 void CS_PROCF (cstini, CSTINI) (void);
230 
231 /*----------------------------------------------------------------------------
232  * Define porosity.
233  *
234  * Fortran Interface:
235  *
236  * SUBROUTINE UIPORO
237  *----------------------------------------------------------------------------*/
238 
239 void CS_PROCF (uiporo, UIPORO) (void);
240 
241 /*----------------------------------------------------------------------------
242  * User momentum source terms.
243  *
244  * Fortran Interface:
245  *
246  * subroutine uitsnv (ncelet, vel, tsexp, tsimp)
247  * *****************
248  *
249  * integer ncelet <-- number of cells with halo
250  * double precision vel <-- fluid velocity
251  * double precision tsexp --> explicit source terms
252  * double precision tsimp --> implicit source terms
253  *----------------------------------------------------------------------------*/
254 
255 void CS_PROCF(uitsnv, UITSNV)(const cs_real_3_t *restrict vel,
256  cs_real_3_t *restrict tsexp,
257  cs_real_33_t *restrict tsimp);
258 
259 /*----------------------------------------------------------------------------
260  * User scalar source terms.
261  *
262  * Fortran Interface:
263  *
264  * subroutine uitssc (f_id, pvar, tsexp, tsimp)
265  * *****************
266  *
267  * integer idarcy <-- groundwater module activation
268  * integer f_id <-- field id
269  * double precision pvar <-- scalar
270  * double precision tsexp --> explicit source terms
271  * double precision tsimp --> implicit source terms
272  *----------------------------------------------------------------------------*/
273 
274 void CS_PROCF(uitssc, UITSSC)(const int *idarcy,
275  const int *f_id,
276  const cs_real_t *restrict pvar,
277  cs_real_t *restrict tsexp,
278  cs_real_t *restrict tsimp);
279 
280 /*----------------------------------------------------------------------------
281  * Thermal scalar source terms.
282  *
283  * Fortran Interface:
284  *
285  * subroutine uitsth (f_id, pvar, tsexp, tsimp)
286  * *****************
287  *
288  * integer f_id <-- field id
289  * double precision pvar <-- scalar
290  * double precision tsexp --> explicit source terms
291  * double precision tsimp --> implicit source terms
292  *----------------------------------------------------------------------------*/
293 
294 void CS_PROCF(uitsth, UITSTH)(const int *f_id,
295  const cs_real_t *restrict pvar,
296  cs_real_t *restrict tsexp,
297  cs_real_t *restrict tsimp);
298 
299 /*----------------------------------------------------------------------------
300  * Variables and user scalars initialization.
301  *
302  * Fortran Interface:
303  *
304  * subroutine uiiniv
305  * *****************
306  *
307  * integer isuite <-- restart indicator
308  * integer idarcy <-- groundwater module activation
309  * integer iccfth <-- type of initialization (compressible model)
310  *----------------------------------------------------------------------------*/
311 
312 void CS_PROCF(uiiniv, UIINIV)(const int *isuite,
313  const int *idarcy,
314  int *iccfth);
315 
316 /*----------------------------------------------------------------------------
317  * User law for material Properties
318  *
319  * Fortran Interface:
320  *
321  * subroutine uiphyv
322  * *****************
323  *
324  * integer iviscv <-- pointer for volumic viscosity viscv
325  *----------------------------------------------------------------------------*/
326 
327 void CS_PROCF(uiphyv, UIPHYV)(const int *iviscv);
328 
329 /*----------------------------------------------------------------------------
330  * extra operations
331  *
332  * Fortran Interface:
333  *
334  * SUBROUTINE UIEXOP
335  * *****************
336  *
337  *----------------------------------------------------------------------------*/
338 
339 void CS_PROCF (uiexop, UIEXOP)(void);
340 
341 /*----------------------------------------------------------------------------
342  * groundwater model : read laws for capacity, saturation and permeability
343  *
344  * Fortran Interface:
345  *
346  * subroutine uidapp
347  * *****************
348  * integer permeability <-- permeability type
349  * integer diffusion <-- diffusion type
350  * integer gravity <-- check if gravity is taken into account
351  * double gravity_x <-- gravity direction
352  * double gravity_y <-- gravity direction
353  * double gravity_z <-- gravity direction
354  * integer unsaturated <-- unsaturated zone taken into account
355  *----------------------------------------------------------------------------*/
356 
357 void CS_PROCF (uidapp, UIDAPP) (const int *permeability,
358  const int *diffusion,
359  const int *gravity,
360  const cs_real_t *gravity_x,
361  const cs_real_t *gravity_y,
362  const cs_real_t *gravity_z,
363  const int *unsaturated);
364 
365 /*----------------------------------------------------------------------------
366  * Define fans with GUI
367  *
368  * Fortran Interface:
369  *
370  * SUBROUTINE UIFANS
371  * *****************
372  *
373  *----------------------------------------------------------------------------*/
374 
375 void CS_PROCF (uifans, UIFANS) (void);
376 
377 /*----------------------------------------------------------------------------
378  * Define error estimators
379  *
380  * Fortran Interface:
381  *
382  * SUBROUTINE UIERES
383  * *****************
384  *
385  *----------------------------------------------------------------------------*/
386 
387 void CS_PROCF (uieres, UIERES) (int *iescal,
388  int *iespre,
389  int *iesder,
390  int *iescor,
391  int *iestot);
392 
393 /*=============================================================================
394  * Public function prototypes
395  *============================================================================*/
396 
397 /*-----------------------------------------------------------------------------
398  * Free memory: clean global private variables.
399  *----------------------------------------------------------------------------*/
400 
401 void
402 cs_gui_finalize(void);
403 
404 /*----------------------------------------------------------------------------*/
415 /*----------------------------------------------------------------------------*/
416 
417 void
418 cs_gui_head_losses(const cs_zone_t *zone,
419  const cs_real_3_t *cvara_vel,
420  cs_real_t cku[][6]);
421 
422 /*-----------------------------------------------------------------------------
423  * Selection of linear solvers.
424  *----------------------------------------------------------------------------*/
425 
426 void
428 
429 /*-----------------------------------------------------------------------------
430  * Define parallel IO settings.
431  *----------------------------------------------------------------------------*/
432 
433 void
434 cs_gui_parallel_io(void);
435 
436 /*-----------------------------------------------------------------------------
437  * Set partitioning options.
438  *----------------------------------------------------------------------------*/
439 
440 void
441 cs_gui_partition(void);
442 
443 /*-----------------------------------------------------------------------------
444  * Set MPI related algorithm options
445  *----------------------------------------------------------------------------*/
446 
447 void
449 
450 /*----------------------------------------------------------------------------
451  * Treatment of gravity and fluid physical properties
452  * Initialize reference pressure and temperature if present
453  *----------------------------------------------------------------------------*/
454 
455 void
457 
458 /*----------------------------------------------------------------------------
459  * Determine porosity model type
460  *----------------------------------------------------------------------------*/
461 
462 void
463 cs_gui_porous_model(void);
464 
465 /*-----------------------------------------------------------------------------
466  * Get initial value from property markup.
467  *
468  * parameters:
469  * property_name <-- name of the property
470  * value --> new initial value of the property
471  *----------------------------------------------------------------------------*/
472 
473 void
474 cs_gui_properties_value(const char *property_name,
475  double *value);
476 
477 /*-----------------------------------------------------------------------------
478  * Get value of property markup for fluid of given id
479  *
480  * parameters:
481  * fluid_id <-- fluid index
482  * property_name <-- name of the property
483  * value --> new initial value of the property
484  *----------------------------------------------------------------------------*/
485 
486 void
487 cs_gui_properties_value_by_fluid_id(const int fluid_id,
488  const char *property_name,
489  double *value);
490 
491 /*-----------------------------------------------------------------------------
492  * Get value of reference fluid properties parameter.
493  *
494  * parameters:
495  * name <-- parameter name
496  * value --> parameter value
497  *----------------------------------------------------------------------------*/
498 
499 void
500 cs_gui_fluid_properties_value(const char *param,
501  double *value);
502 
503 /*----------------------------------------------------------------------------
504  * Get thermal scalar model.
505  *
506  * return:
507  * value of itherm*10 + (temperature variant flag), or -1 if not defined
508  *----------------------------------------------------------------------------*/
509 
510 int
512 
513 /*----------------------------------------------------------------------------
514  * Time moments definition
515  *----------------------------------------------------------------------------*/
516 
517 void
518 cs_gui_time_moments(void);
519 
520 /*-----------------------------------------------------------------------------
521  * Set turbomachinery model
522  *----------------------------------------------------------------------------*/
523 
524 void
526 
527 /*-----------------------------------------------------------------------------
528  * Set turbomachinery options.
529  *----------------------------------------------------------------------------*/
530 
531 void
533 
534 /*----------------------------------------------------------------------------
535  * Logging output for MEI usage.
536  *----------------------------------------------------------------------------*/
537 
538 void
539 cs_gui_usage_log(void);
540 
541 /*----------------------------------------------------------------------------
542  * Define user variables through the GUI.
543  *----------------------------------------------------------------------------*/
544 
545 void
547 
548 /*----------------------------------------------------------------------------
549  * Define user arrays through the GUI.
550  *----------------------------------------------------------------------------*/
551 
552 void
553 cs_gui_user_arrays(void);
554 
555 /*----------------------------------------------------------------------------
556  * Define balance by zone through the GUI.
557  *----------------------------------------------------------------------------*/
558 
559 void
561 
562 /*----------------------------------------------------------------------------
563  * Define pressure drop through the GUI.
564  *----------------------------------------------------------------------------*/
565 
566 void
568 
569 /*----------------------------------------------------------------------------
570  * Define fans through the GUI.
571  *----------------------------------------------------------------------------*/
572 
573 void
574 cs_gui_define_fans(void);
575 
576 /*----------------------------------------------------------------------------
577  * Define error estimator through the GUI.
578  *----------------------------------------------------------------------------*/
579 
580 void
582  int *iespre,
583  int *iesder,
584  int *iescor,
585  int *iestot);
586 
587 /*----------------------------------------------------------------------------
588  * Define volume and boundary zones through the GUI.
589  *----------------------------------------------------------------------------*/
590 
591 void
592 cs_gui_zones(void);
593 
594 /*----------------------------------------------------------------------------
595  * Define internal coupling through the GUI.
596  *----------------------------------------------------------------------------*/
597 
598 void
600 
601 /*----------------------------------------------------------------------------*/
602 
604 
605 #endif /* __CS_GUI_H__ */
void uiphyv(const int *iviscv)
Definition: cs_gui.c:3218
void csidtv(void)
Definition: cs_gui.c:1762
#define restrict
Definition: cs_defs.h:142
void csnum2(double *relaxp, int *imrgra)
Definition: cs_gui.c:2036
void cs_gui_user_variables(void)
Definition: cs_gui.c:4616
void cs_gui_head_losses(const cs_zone_t *zone, const cs_real_3_t *cvara_vel, cs_real_t cku[][6])
Compute GUI-defined head losses for a given volume zone.
Definition: cs_gui.c:3825
void cs_gui_fluid_properties_value(const char *param, double *value)
Definition: cs_gui.c:4327
void cssca3(void)
Definition: cs_gui.c:2351
void cscfgp(int *icfgrp)
Definition: cs_gui.c:1814
integer iesder
Error estimator for Navier-Stokes. iest = iesder: drift (default name: EsDer). The estimator is base...
Definition: paramx.f90:258
integer, save ntsuit
saving period of the restart files
Definition: entsor.f90:52
#define BEGIN_C_DECLS
Definition: cs_defs.h:510
void cs_gui_physical_properties(void)
Definition: cs_gui.c:2127
void cs_gui_turbomachinery(void)
Definition: cs_gui.c:4482
void cs_gui_define_fans(void)
Definition: cs_gui.c:4922
void cs_gui_parallel_io(void)
Definition: cs_gui.c:4041
void cs_gui_user_arrays(void)
Definition: cs_gui.c:4676
integer idarcy
pointer to specify richards model
Definition: ppincl.f90:239
void cs_gui_turb_ref_values(void)
Definition: cs_gui.c:1597
int cs_gui_thermal_model(void)
Definition: cs_gui.c:4345
void cssca2(void)
Definition: cs_gui.c:2295
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
Definition: cs_field_pointer.h:68
integer, save isuite
Indicator of a calculation restart (=1) or not (=0). This value is set automatically by the code; dep...
Definition: optcal.f90:281
void cs_gui_usage_log(void)
Definition: cs_gui.c:4588
void cs_gui_partition(void)
Definition: cs_gui.c:4108
void uiporo(void)
Definition: cs_gui.c:2435
void cs_gui_internal_coupling(void)
Definition: cs_gui.c:5047
void cs_gui_turbomachinery_rotor(void)
Definition: cs_gui.c:4497
void cscpva(void)
Definition: cs_gui.c:1642
integer(c_int), pointer, save iccvfg
Definition: optcal.f90:795
void csther(void)
Definition: cs_gui.c:1448
void uiexop(void)
Definition: cs_gui.c:3373
void csivis(void)
Definition: cs_gui.c:1689
void cs_gui_properties_value_by_fluid_id(const int fluid_id, const char *property_name, double *value)
Definition: cs_gui.c:4291
void cs_gui_zones(void)
Definition: cs_gui.c:4719
void uitssc(const int *idarcy, const int *f_id, const cs_real_t *restrict pvar, cs_real_t *restrict tsexp, cs_real_t *restrict tsimp)
Definition: cs_gui.c:2615
integer, save icfgrp
indicates if the boundary conditions should take into account (=1) or not (=0) the hydrostatic balanc...
Definition: ppincl.f90:658
void cs_gui_mpi_algorithms(void)
Definition: cs_gui.c:4204
integer, dimension(nestmx), save iescal
iescal indicates the calculation mode for the error estimator iespre, iesder, iescor or iestot for th...
Definition: optcal.f90:939
void cs_gui_pressure_drop_by_zone(void)
Definition: cs_gui.c:4900
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:335
void cs_gui_error_estimator(int *iescal, int *iespre, int *iesder, int *iescor, int *iestot)
Definition: cs_gui.c:4988
double precision, dimension(nvarmx), save cdtvar
multiplicator coefficient for the time step of each variable
Definition: optcal.f90:433
void cs_gui_properties_value(const char *property_name, double *value)
Definition: cs_gui.c:4265
void uidapp(const int *permeability, const int *diffusion, const int *gravity, const cs_real_t *gravity_x, const cs_real_t *gravity_y, const cs_real_t *gravity_z, const int *unsaturated)
Definition: cs_gui.c:3395
void uitsth(const int *f_id, const cs_real_t *restrict pvar, cs_real_t *restrict tsexp, cs_real_t *restrict tsimp)
Definition: cs_gui.c:2700
void uieres(int *iescal, int *iespre, int *iesder, int *iescor, int *iestot)
Definition: cs_gui.c:3784
void uifans(void)
Definition: cs_gui.c:3769
#define END_C_DECLS
Definition: cs_defs.h:511
void cs_gui_finalize(void)
Definition: cs_gui.c:3806
void csisui(int *ntsuit, int *iccvfg)
Definition: cs_gui.c:1841
#define CS_PROCF(x, y)
Definition: cs_defs.h:524
void uitsnv(const cs_real_3_t *restrict vel, cs_real_3_t *restrict tsexp, cs_real_33_t *restrict tsimp)
Definition: cs_gui.c:2503
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition: cs_defs.h:342
void csvvva(int *iviscv)
Definition: cs_gui.c:1667
void csiphy(void)
Definition: cs_gui.c:1786
void cstime(void)
Definition: cs_gui.c:1872
void cs_gui_turb_model(void)
Definition: cs_gui.c:1488
void cs_gui_time_moments(void)
Definition: cs_gui.c:4382
void cstini(void)
void cs_gui_porous_model(void)
Definition: cs_gui.c:4229
integer, save iviscv
additional property:
Definition: ppincl.f90:598
void uiiniv(const int *isuite, const int *idarcy, int *iccfth)
Definition: cs_gui.c:2778
integer iestot
Error estimator for Navier-Stokes. iest = iestot: total, (default name: EsTot). The estimator ...
Definition: paramx.f90:308
integer iescor
Error estimator for Navier-Stokes. iest = iescor: correction, (default name: EsCor). The estimator comes directly from the mass flow calculated with the updated velocity field: .
Definition: paramx.f90:278
integer(c_int), pointer, save imrgra
type of gradient reconstruction
Definition: optcal.f90:260
void cs_gui_linear_solvers(void)
Definition: cs_gui.c:3895
void cs_gui_balance_by_zone(void)
Definition: cs_gui.c:4871
void uinum1(double *cdtvar)
Definition: cs_gui.c:1948
integer iespre
Error estimator for Navier-Stokes. iest = iespre: prediction, (default name: EsPre). After the velocity prediction step (yielding ), the estimator , local variable calculated at every cell , is created from , which represents the residual of the equation solved during this step: and : .
Definition: paramx.f90:242
Definition: cs_zone.h:55