7.2
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-2022 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_field.h"
36 #include "cs_zone.h"
37 
38 /*----------------------------------------------------------------------------*/
39 
41 
42 /*============================================================================
43  * Type definitions
44  *============================================================================*/
45 
48 typedef struct {
49 
50  const cs_zone_t *zone; /*<! Pointer to zone */
51  const cs_field_t **fields; /*<! Array of field pointers (NULL-terminated) */
52 
54 
55 /*============================================================================
56  * Public function prototypes for Fortran API
57  *============================================================================*/
58 
59 /*----------------------------------------------------------------------------
60  * Specific heat variable or constant indicator.
61  *
62  * Fortran Interface:
63  *
64  * SUBROUTINE CSCPVA
65  * *****************
66  *
67  *----------------------------------------------------------------------------*/
68 
69 void CS_PROCF (cscpva, CSCPVA) (void);
70 
71 /*----------------------------------------------------------------------------
72  * Volumic viscosity variable or constant indicator.
73  *
74  * Fortran Interface:
75  *
76  * SUBROUTINE CSCVVVA (ICP)
77  * *****************
78  *
79  * INTEGER IVISCV --> specific heat variable or constant indicator
80  *----------------------------------------------------------------------------*/
81 
82 void CS_PROCF (csvvva, CSVVVA) (int *iviscv);
83 
84 /*----------------------------------------------------------------------------
85  * Constant or variable indicator for the user scalar laminar viscosity.
86  *
87  * Fortran Interface:
88  *
89  * subroutine csivis
90  * *****************
91  *----------------------------------------------------------------------------*/
92 
93 void CS_PROCF (csivis, CSIVIS) (void);
94 
95 /*----------------------------------------------------------------------------
96  * Time passing parameter.
97  *
98  * Fortran Interface:
99  *
100  * SUBROUTINE CSIDTV ()
101  * *****************
102  *
103  *----------------------------------------------------------------------------*/
104 
105 void CS_PROCF(csidtv, CSIDTV) (void);
106 
107 /*----------------------------------------------------------------------------
108  * Hydrostatic pressure parameter.
109  *
110  * Fortran Interface:
111  *
112  * SUBROUTINE CSIPHY ()
113  * *****************
114  *
115  *----------------------------------------------------------------------------*/
116 
117 void CS_PROCF (csiphy, CSIPHY) (void);
118 
119 /*----------------------------------------------------------------------------
120  * Hydrostatic equilibrium parameter.
121  *
122  * Fortran Interface:
123  *
124  * SUBROUTINE CSCFGP (ICFGRP)
125  * *****************
126  *
127  * INTEGER ICFGRP --> hydrostatic equilibrium
128  *----------------------------------------------------------------------------*/
129 
130 void CS_PROCF (cscfgp, CSCFGP) (int *icfgrp);
131 
132 /*----------------------------------------------------------------------------
133  * Restart parameters.
134  *
135  * Fortran Interface:
136  *
137  * SUBROUTINE CSISUI
138  * *****************
139  *
140  * INTEGER NTSUIT --> checkpoint frequency
141  * INTEGER ICCFVG --> restart with frozen field
142  *----------------------------------------------------------------------------*/
143 
144 
145 void CS_PROCF (csisui, CSISUI) (int *ntsuit,
146  int *iccvfg);
147 
148 /*----------------------------------------------------------------------------
149  * Time passing parameters.
150  *
151  * Fortran Interface:
152  *
153  * SUBROUTINE CSTIME
154  * *****************
155  *
156  *----------------------------------------------------------------------------*/
157 
158 void CS_PROCF (cstime, CSTIME) (void);
159 
160 /*----------------------------------------------------------------------------
161  *
162  * Fortran Interface:
163  *
164  * SUBROUTINE UINUM1
165  * *****************
166  *
167  *----------------------------------------------------------------------------*/
168 
169 void CS_PROCF (uinum1, UINUM1) (double *cdtvar);
170 
171 /*----------------------------------------------------------------------------
172  * Global numerical parameters.
173  *
174  * Fortran Interface:
175  *
176  * SUBROUTINE CSNUM2
177  * *****************
178  *
179  * INTEGER RELAXP --> pressure relaxation
180  * INTEGER IMRGRA --> gradient reconstruction
181  *----------------------------------------------------------------------------*/
182 
183 void CS_PROCF (csnum2, CSNUM2) (double *relaxp,
184  int *imrgra);
185 
186 /*----------------------------------------------------------------------------
187  * Turbulence initialization parameters.
188  *
189  * Fortran Interface:
190  *
191  * SUBROUTINE CSTINI
192  * *****************
193  *
194  *----------------------------------------------------------------------------*/
195 
196 void CS_PROCF (cstini, CSTINI) (void);
197 
198 /*----------------------------------------------------------------------------
199  * Define porosity.
200  *
201  * Fortran Interface:
202  *
203  * SUBROUTINE UIPORO
204  *----------------------------------------------------------------------------*/
205 
206 void CS_PROCF (uiporo, UIPORO) (void);
207 
208 /*----------------------------------------------------------------------------
209  * User momentum source terms.
210  *
211  * Fortran Interface:
212  *
213  * subroutine uitsnv (ncelet, vel, tsexp, tsimp)
214  * *****************
215  *
216  * integer ncelet <-- number of cells with halo
217  * double precision vel <-- fluid velocity
218  * double precision tsexp --> explicit source terms
219  * double precision tsimp --> implicit source terms
220  *----------------------------------------------------------------------------*/
221 
222 void CS_PROCF(uitsnv, UITSNV)(const cs_real_3_t *restrict vel,
223  cs_real_3_t *restrict tsexp,
224  cs_real_33_t *restrict tsimp);
225 
226 /*----------------------------------------------------------------------------
227  * User scalar source terms.
228  *
229  * Fortran Interface:
230  *
231  * subroutine uitssc (f_id, pvar, tsexp, tsimp)
232  * *****************
233  *
234  * integer idarcy <-- groundwater module activation
235  * integer f_id <-- field id
236  * double precision pvar <-- scalar
237  * double precision tsexp --> explicit source terms
238  * double precision tsimp --> implicit source terms
239  *----------------------------------------------------------------------------*/
240 
241 void CS_PROCF(uitssc, UITSSC)(const int *idarcy,
242  const int *f_id,
243  const cs_real_t *restrict pvar,
244  cs_real_t *restrict tsexp,
245  cs_real_t *restrict tsimp);
246 
247 /*----------------------------------------------------------------------------
248  * Thermal scalar source terms.
249  *
250  * Fortran Interface:
251  *
252  * subroutine uitsth (f_id, pvar, tsexp, tsimp)
253  * *****************
254  *
255  * integer f_id <-- field id
256  * double precision pvar <-- scalar
257  * double precision tsexp --> explicit source terms
258  * double precision tsimp --> implicit source terms
259  *----------------------------------------------------------------------------*/
260 
261 void CS_PROCF(uitsth, UITSTH)(const int *f_id,
262  const cs_real_t *restrict pvar,
263  cs_real_t *restrict tsexp,
264  cs_real_t *restrict tsimp);
265 
266 /*----------------------------------------------------------------------------
267  * User law for material Properties
268  *
269  * Fortran Interface:
270  *
271  * subroutine uiphyv
272  * *****************
273  *
274  * integer iviscv <-- pointer for volumic viscosity viscv
275  *----------------------------------------------------------------------------*/
276 
277 void CS_PROCF(uiphyv, UIPHYV)(const int *iviscv);
278 
279 /*----------------------------------------------------------------------------
280  * extra operations
281  *
282  * Fortran Interface:
283  *
284  * SUBROUTINE UIEXOP
285  * *****************
286  *
287  *----------------------------------------------------------------------------*/
288 
289 void CS_PROCF (uiexop, UIEXOP)(void);
290 
291 /*----------------------------------------------------------------------------
292  * groundwater model : read laws for capacity, saturation and permeability
293  *
294  * Fortran Interface:
295  *
296  * subroutine uidapp
297  * *****************
298  * integer permeability <-- permeability type
299  * integer diffusion <-- diffusion type
300  * integer gravity <-- check if gravity is taken into account
301  * double gravity_x <-- gravity direction
302  * double gravity_y <-- gravity direction
303  * double gravity_z <-- gravity direction
304  * integer unsaturated <-- unsaturated zone taken into account
305  *----------------------------------------------------------------------------*/
306 
307 void CS_PROCF (uidapp, UIDAPP) (const int *permeability,
308  const int *diffusion,
309  const int *gravity,
310  const cs_real_t *gravity_x,
311  const cs_real_t *gravity_y,
312  const cs_real_t *gravity_z,
313  const int *unsaturated);
314 
315 /*----------------------------------------------------------------------------
316  * Define error estimators
317  *
318  * Fortran Interface:
319  *
320  * SUBROUTINE UIERES
321  * *****************
322  *
323  *----------------------------------------------------------------------------*/
324 
325 void CS_PROCF (uieres, UIERES) (int *iescal,
326  int *iespre,
327  int *iesder,
328  int *iescor,
329  int *iestot);
330 
331 /*=============================================================================
332  * Public function prototypes
333  *============================================================================*/
334 
335 /*-----------------------------------------------------------------------------
336  * Free memory: clean global private variables.
337  *----------------------------------------------------------------------------*/
338 
339 void
340 cs_gui_finalize(void);
341 
342 /*-----------------------------------------------------------------------------
343  * Get value of reference fluid properties parameter.
344  *
345  * parameters:
346  * name <-- parameter name
347  * value --> parameter value
348  *----------------------------------------------------------------------------*/
349 
350 void
351 cs_gui_fluid_properties_value(const char *param,
352  double *value);
353 
354 /*----------------------------------------------------------------------------*/
365 /*----------------------------------------------------------------------------*/
366 
367 void
368 cs_gui_head_losses(const cs_zone_t *zone,
369  const cs_real_3_t *cvara_vel,
370  cs_real_t cku[][6]);
371 
372 /*----------------------------------------------------------------------------*/
376 /*----------------------------------------------------------------------------*/
377 
378 void
380 
381 /*-----------------------------------------------------------------------------
382  * Selection of linear solvers.
383  *----------------------------------------------------------------------------*/
384 
385 void
387 
388 /*-----------------------------------------------------------------------------
389  * Define parallel IO settings.
390  *----------------------------------------------------------------------------*/
391 
392 void
393 cs_gui_parallel_io(void);
394 
395 /*-----------------------------------------------------------------------------
396  * Set partitioning options.
397  *----------------------------------------------------------------------------*/
398 
399 void
400 cs_gui_partition(void);
401 
402 /*-----------------------------------------------------------------------------
403  * Set MPI related algorithm options
404  *----------------------------------------------------------------------------*/
405 
406 void
408 
409 /*----------------------------------------------------------------------------
410  * Treatment of gravity and fluid physical properties
411  * Initialize reference pressure and temperature if present
412  *----------------------------------------------------------------------------*/
413 
414 void
416 
417 /*----------------------------------------------------------------------------
418  * Determine porosity model type
419  *----------------------------------------------------------------------------*/
420 
421 void
422 cs_gui_porous_model(void);
423 
424 /*-----------------------------------------------------------------------------
425  * Get initial value from property markup.
426  *
427  * parameters:
428  * property_name <-- name of the property
429  * value --> new initial value of the property
430  *----------------------------------------------------------------------------*/
431 
432 void
433 cs_gui_properties_value(const char *property_name,
434  double *value);
435 
436 /*-----------------------------------------------------------------------------
437  * Get value of property markup for fluid of given id
438  *
439  * parameters:
440  * fluid_id <-- fluid index
441  * property_name <-- name of the property
442  * value --> new initial value of the property
443  *----------------------------------------------------------------------------*/
444 
445 void
446 cs_gui_properties_value_by_fluid_id(const int fluid_id,
447  const char *property_name,
448  double *value);
449 
450 /*----------------------------------------------------------------------------
451  * Read minimum / maximum values (used in clipping) and turbulent flux model
452  * for additional user or model variables.
453  *
454  * Also read reference dynamic and user scalar viscosity
455  *----------------------------------------------------------------------------*/
456 
457 void
459 
460 /*----------------------------------------------------------------------------
461  * Thermal model.
462  *----------------------------------------------------------------------------*/
463 
464 void
466 
467 /*----------------------------------------------------------------------------
468  * Get thermal scalar model.
469  *
470  * return:
471  * value of itherm*10 + (temperature variant flag), or -1 if not defined
472  *----------------------------------------------------------------------------*/
473 
474 int
476 
477 /*----------------------------------------------------------------------------
478  * Time moments definition
479  *----------------------------------------------------------------------------*/
480 
481 void
482 cs_gui_time_moments(void);
483 
484 /*-----------------------------------------------------------------------------
485  * Set turbomachinery model
486  *----------------------------------------------------------------------------*/
487 
488 void
490 
491 /*-----------------------------------------------------------------------------
492  * Set turbomachinery options.
493  *----------------------------------------------------------------------------*/
494 
495 void
497 
498 /*----------------------------------------------------------------------------
499  * Turbulence model
500  *----------------------------------------------------------------------------*/
501 
502 void
503 cs_gui_turb_model(void);
504 
505 /*----------------------------------------------------------------------------
506  * Define reference length and reference velocity for the initialization of
507  * the turbulence variables
508  *----------------------------------------------------------------------------*/
509 
510 void
512 
513 /*----------------------------------------------------------------------------
514  * Logging output for MEI usage.
515  *----------------------------------------------------------------------------*/
516 
517 void
518 cs_gui_usage_log(void);
519 
520 /*----------------------------------------------------------------------------
521  * Define user variables through the GUI.
522  *----------------------------------------------------------------------------*/
523 
524 void
526 
527 /*----------------------------------------------------------------------------
528  * Define user arrays through the GUI.
529  *----------------------------------------------------------------------------*/
530 
531 void
532 cs_gui_user_arrays(void);
533 
534 /*----------------------------------------------------------------------------
535  * Define balance by zone through the GUI.
536  *----------------------------------------------------------------------------*/
537 
538 void
540 
541 /*----------------------------------------------------------------------------
542  * Define pressure drop through the GUI.
543  *----------------------------------------------------------------------------*/
544 
545 void
547 
548 /*----------------------------------------------------------------------------
549  * Define fans through the GUI.
550  *----------------------------------------------------------------------------*/
551 
552 void
553 cs_gui_define_fans(void);
554 
555 /*----------------------------------------------------------------------------
556  * Define error estimator through the GUI.
557  *----------------------------------------------------------------------------*/
558 
559 void
561  int *iespre,
562  int *iesder,
563  int *iescor,
564  int *iestot);
565 
566 /*----------------------------------------------------------------------------
567  * Define volume and boundary zones through the GUI.
568  *----------------------------------------------------------------------------*/
569 
570 void
571 cs_gui_zones(void);
572 
573 /*----------------------------------------------------------------------------
574  * Define internal coupling through the GUI.
575  *----------------------------------------------------------------------------*/
576 
577 void
579 
580 /*----------------------------------------------------------------------------*/
590 /*----------------------------------------------------------------------------*/
591 
594  const cs_field_t *fields[],
595  const int n_fields);
596 
597 /*----------------------------------------------------------------------------*/
598 
600 
601 #endif /* __CS_GUI_H__ */
void uiphyv(const int *iviscv)
Definition: cs_gui.c:2369
void csidtv(void)
Definition: cs_gui.c:1661
const cs_gui_volume_meg_context_t * cs_gui_add_volume_meg_context(const cs_zone_t *zone, const cs_field_t *fields[], const int n_fields)
Add new volume MEG function context info.
Definition: cs_gui.c:5133
#define restrict
Definition: cs_defs.h:142
void csnum2(double *relaxp, int *imrgra)
Definition: cs_gui.c:1935
void cs_gui_user_variables(void)
Definition: cs_gui.c:4623
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:2987
void cs_gui_fluid_properties_value(const char *param, double *value)
Definition: cs_gui.c:2963
void cs_gui_thermal_model(void)
Definition: cs_gui.c:4159
Field descriptor.
Definition: cs_field.h:125
void cscfgp(int *icfgrp)
Definition: cs_gui.c:1713
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:3828
void cs_gui_turbomachinery(void)
Definition: cs_gui.c:4340
void cs_gui_define_fans(void)
Definition: cs_gui.c:4929
void cs_gui_parallel_io(void)
Definition: cs_gui.c:3639
void cs_gui_user_arrays(void)
Definition: cs_gui.c:4683
integer idarcy
pointer to specify richards model
Definition: ppincl.f90:264
void cs_gui_turb_ref_values(void)
Definition: cs_gui.c:4556
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
Definition: cs_field_pointer.h:68
Definition: cs_gui.h:48
void cs_gui_usage_log(void)
Definition: cs_gui.c:4595
void cs_gui_partition(void)
Definition: cs_gui.c:3706
void uiporo(void)
Definition: cs_gui.c:2028
void cs_gui_internal_coupling(void)
Definition: cs_gui.c:5054
void cs_gui_turbomachinery_rotor(void)
Definition: cs_gui.c:4355
void cscpva(void)
Definition: cs_gui.c:1541
integer(c_int), pointer, save iccvfg
Definition: optcal.f90:795
void uiexop(void)
Definition: cs_gui.c:2524
void csivis(void)
Definition: cs_gui.c:1588
void cs_gui_properties_value_by_fluid_id(const int fluid_id, const char *property_name, double *value)
Definition: cs_gui.c:4063
void cs_gui_zones(void)
Definition: cs_gui.c:4726
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:2208
void cs_gui_scalar_model_settings(void)
Definition: cs_gui.c:4098
integer, save icfgrp
indicates if the boundary conditions should take into account (=1) or not (=0) the hydrostatic balanc...
Definition: ppincl.f90:713
int cs_gui_thermal_model_code(void)
Definition: cs_gui.c:4203
void cs_gui_mpi_algorithms(void)
Definition: cs_gui.c:3802
integer, dimension(nestmx), save iescal
iescal indicates the calculation mode for the error estimator iespre, iesder, iescor or iestot for th...
Definition: optcal.f90:917
void cs_gui_initial_conditions(void)
Apply initial conditions based on GUI-defined settings.
Definition: cs_gui.c:3058
void cs_gui_pressure_drop_by_zone(void)
Definition: cs_gui.c:4907
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:4995
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:4037
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:2546
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:2293
void uieres(int *iescal, int *iespre, int *iesder, int *iescor, int *iestot)
Definition: cs_gui.c:2920
#define END_C_DECLS
Definition: cs_defs.h:511
void cs_gui_finalize(void)
Definition: cs_gui.c:2942
void csisui(int *ntsuit, int *iccvfg)
Definition: cs_gui.c:1740
#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:2096
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:1566
const cs_zone_t * zone
Definition: cs_gui.h:50
void csiphy(void)
Definition: cs_gui.c:1685
void cstime(void)
Definition: cs_gui.c:1771
void cs_gui_turb_model(void)
Definition: cs_gui.c:4446
void cs_gui_time_moments(void)
Definition: cs_gui.c:4240
void cstini(void)
void cs_gui_porous_model(void)
Definition: cs_gui.c:4001
integer, save iviscv
additional property:
Definition: ppincl.f90:653
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
const cs_field_t ** fields
Definition: cs_gui.h:51
void cs_gui_linear_solvers(void)
Definition: cs_gui.c:3491
void cs_gui_balance_by_zone(void)
Definition: cs_gui.c:4878
void uinum1(double *cdtvar)
Definition: cs_gui.c:1847
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