7.3
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_equation_param.h"
36 #include "cs_field.h"
37 #include "cs_zone.h"
38 
39 /*----------------------------------------------------------------------------*/
40 
42 
43 /*============================================================================
44  * Type definitions
45  *============================================================================*/
46 
49 typedef struct {
50 
51  const cs_zone_t *zone; /*<! Pointer to zone */
52  const cs_field_t **fields; /*<! Array of field pointers (NULL-terminated) */
53 
55 
56 /*============================================================================
57  * Public function prototypes for Fortran API
58  *============================================================================*/
59 
60 /*----------------------------------------------------------------------------
61  * Specific heat variable or constant indicator.
62  *
63  * Fortran Interface:
64  *
65  * SUBROUTINE CSCPVA
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  * Global numerical parameters.
162  *
163  * Fortran Interface:
164  *
165  * SUBROUTINE CSNUM2
166  * *****************
167  *
168  * INTEGER RELAXP --> pressure relaxation
169  * INTEGER IMRGRA --> gradient reconstruction
170  *----------------------------------------------------------------------------*/
171 
172 void CS_PROCF (csnum2, CSNUM2) (double *relaxp,
173  int *imrgra);
174 
175 /*----------------------------------------------------------------------------
176  * Turbulence initialization parameters.
177  *
178  * Fortran Interface:
179  *
180  * SUBROUTINE CSTINI
181  * *****************
182  *
183  *----------------------------------------------------------------------------*/
184 
185 void CS_PROCF (cstini, CSTINI) (void);
186 
187 /*----------------------------------------------------------------------------
188  * Define porosity.
189  *
190  * Fortran Interface:
191  *
192  * SUBROUTINE UIPORO
193  *----------------------------------------------------------------------------*/
194 
195 void CS_PROCF (uiporo, UIPORO) (void);
196 
197 /*----------------------------------------------------------------------------
198  * User momentum source terms.
199  *
200  * Fortran Interface:
201  *
202  * subroutine uitsnv (ncelet, vel, tsexp, tsimp)
203  * *****************
204  *
205  * integer ncelet <-- number of cells with halo
206  * double precision vel <-- fluid velocity
207  * double precision tsexp --> explicit source terms
208  * double precision tsimp --> implicit source terms
209  *----------------------------------------------------------------------------*/
210 
211 void CS_PROCF(uitsnv, UITSNV)(const cs_real_3_t *restrict vel,
212  cs_real_3_t *restrict tsexp,
213  cs_real_33_t *restrict tsimp);
214 
215 /*----------------------------------------------------------------------------
216  * User scalar source terms.
217  *
218  * Fortran Interface:
219  *
220  * subroutine uitssc (f_id, pvar, tsexp, tsimp)
221  * *****************
222  *
223  * integer idarcy <-- groundwater module activation
224  * integer f_id <-- field id
225  * double precision pvar <-- scalar
226  * double precision tsexp --> explicit source terms
227  * double precision tsimp --> implicit source terms
228  *----------------------------------------------------------------------------*/
229 
230 void CS_PROCF(uitssc, UITSSC)(const int *idarcy,
231  const int *f_id,
232  const cs_real_t *restrict pvar,
233  cs_real_t *restrict tsexp,
234  cs_real_t *restrict tsimp);
235 
236 /*----------------------------------------------------------------------------
237  * Thermal scalar source terms.
238  *
239  * Fortran Interface:
240  *
241  * subroutine uitsth (f_id, pvar, tsexp, tsimp)
242  * *****************
243  *
244  * integer f_id <-- field id
245  * double precision pvar <-- scalar
246  * double precision tsexp --> explicit source terms
247  * double precision tsimp --> implicit source terms
248  *----------------------------------------------------------------------------*/
249 
250 void CS_PROCF(uitsth, UITSTH)(const int *f_id,
251  const cs_real_t *restrict pvar,
252  cs_real_t *restrict tsexp,
253  cs_real_t *restrict tsimp);
254 
255 /*----------------------------------------------------------------------------
256  * User law for material Properties
257  *
258  * Fortran Interface:
259  *
260  * subroutine uiphyv
261  * *****************
262  *
263  * integer iviscv <-- pointer for volumic viscosity viscv
264  *----------------------------------------------------------------------------*/
265 
266 void CS_PROCF(uiphyv, UIPHYV)(const int *iviscv);
267 
268 /*----------------------------------------------------------------------------
269  * extra operations
270  *
271  * Fortran Interface:
272  *
273  * SUBROUTINE UIEXOP
274  * *****************
275  *
276  *----------------------------------------------------------------------------*/
277 
278 void CS_PROCF (uiexop, UIEXOP)(void);
279 
280 /*----------------------------------------------------------------------------
281  * groundwater model : read laws for capacity, saturation and permeability
282  *
283  * Fortran Interface:
284  *
285  * subroutine uidapp
286  * *****************
287  * integer permeability <-- permeability type
288  * integer diffusion <-- diffusion type
289  * integer unsaturated <-- unsaturated zone taken into account
290  *----------------------------------------------------------------------------*/
291 
292 void CS_PROCF (uidapp, UIDAPP) (const int *permeability,
293  const int *diffusion,
294  const int *unsaturated);
295 
296 /*----------------------------------------------------------------------------
297  * Define error estimators
298  *
299  * Fortran Interface:
300  *
301  * SUBROUTINE UIERES
302  * *****************
303  *
304  *----------------------------------------------------------------------------*/
305 
306 void CS_PROCF (uieres, UIERES) (int *iescal,
307  int *iespre,
308  int *iesder,
309  int *iescor,
310  int *iestot);
311 
312 /*=============================================================================
313  * Public function prototypes
314  *============================================================================*/
315 
316 /*----------------------------------------------------------------------------
317  * Space scheme options, linear solver precision and time step factor
318  *----------------------------------------------------------------------------*/
319 
320 void
322 
323 /*-----------------------------------------------------------------------------
324  * Free memory: clean global private variables.
325  *----------------------------------------------------------------------------*/
326 
327 void
328 cs_gui_finalize(void);
329 
330 /*----------------------------------------------------------------------------
331  * Return a pointer to equation parameters based on a field or equation name.
332  *
333  * parameters:
334  * name <-- field or equation name
335  *
336  * return:
337  * pointer to matching child string
338  *----------------------------------------------------------------------------*/
339 
341 cs_gui_get_equation_param(const char *name);
342 
343 /*-----------------------------------------------------------------------------
344  * Get value of reference fluid properties parameter.
345  *
346  * parameters:
347  * name <-- parameter name
348  * value --> parameter value
349  *----------------------------------------------------------------------------*/
350 
351 void
352 cs_gui_fluid_properties_value(const char *param,
353  double *value);
354 
355 /*----------------------------------------------------------------------------*/
366 /*----------------------------------------------------------------------------*/
367 
368 void
369 cs_gui_head_losses(const cs_zone_t *zone,
370  const cs_real_3_t *cvara_vel,
371  cs_real_t cku[][6]);
372 
373 /*----------------------------------------------------------------------------*/
377 /*----------------------------------------------------------------------------*/
378 
379 void
381 
382 /*-----------------------------------------------------------------------------
383  * Selection of linear solvers.
384  *----------------------------------------------------------------------------*/
385 
386 void
388 
389 /*-----------------------------------------------------------------------------
390  * Define global numerical options.
391  *----------------------------------------------------------------------------*/
392 
393 void
395 
396 /*-----------------------------------------------------------------------------
397  * Define parallel IO settings.
398  *----------------------------------------------------------------------------*/
399 
400 void
401 cs_gui_parallel_io(void);
402 
403 /*-----------------------------------------------------------------------------
404  * Set partitioning options.
405  *----------------------------------------------------------------------------*/
406 
407 void
408 cs_gui_partition(void);
409 
410 /*-----------------------------------------------------------------------------
411  * Set MPI related algorithm options
412  *----------------------------------------------------------------------------*/
413 
414 void
416 
417 /*----------------------------------------------------------------------------
418  * Treatment of physical constants (gravity and Coriolis).
419  *----------------------------------------------------------------------------*/
420 
421 void
423 
424 /*----------------------------------------------------------------------------
425  * Treatment of gravity and fluid physical properties
426  * Initialize reference pressure and temperature if present
427  *----------------------------------------------------------------------------*/
428 
429 void
431 
432 /*----------------------------------------------------------------------------
433  * Determine porosity model type
434  *----------------------------------------------------------------------------*/
435 
436 void
437 cs_gui_porous_model(void);
438 
439 /*-----------------------------------------------------------------------------
440  * Get initial value from property markup.
441  *
442  * parameters:
443  * property_name <-- name of the property
444  * value --> new initial value of the property
445  *----------------------------------------------------------------------------*/
446 
447 void
448 cs_gui_properties_value(const char *property_name,
449  double *value);
450 
451 /*-----------------------------------------------------------------------------
452  * Get value of property markup for fluid of given id
453  *
454  * parameters:
455  * fluid_id <-- fluid index
456  * property_name <-- name of the property
457  * value --> new initial value of the property
458  *----------------------------------------------------------------------------*/
459 
460 void
461 cs_gui_properties_value_by_fluid_id(const int fluid_id,
462  const char *property_name,
463  double *value);
464 
465 /*----------------------------------------------------------------------------
466  * Read minimum / maximum values (used in clipping) and turbulent flux model
467  * for additional user or model variables.
468  *
469  * Also read reference dynamic and user scalar viscosity
470  *----------------------------------------------------------------------------*/
471 
472 void
474 
475 /*----------------------------------------------------------------------------
476  * Thermal model.
477  *----------------------------------------------------------------------------*/
478 
479 void
481 
482 /*----------------------------------------------------------------------------
483  * Get thermal scalar model.
484  *
485  * return:
486  * value of itherm*10 + (temperature variant flag), or -1 if not defined
487  *----------------------------------------------------------------------------*/
488 
489 int
491 
492 /*----------------------------------------------------------------------------
493  * Time moments definition
494  *----------------------------------------------------------------------------*/
495 
496 void
497 cs_gui_time_moments(void);
498 
499 /*-----------------------------------------------------------------------------
500  * Set turbomachinery model
501  *----------------------------------------------------------------------------*/
502 
503 void
505 
506 /*-----------------------------------------------------------------------------
507  * Set turbomachinery options.
508  *----------------------------------------------------------------------------*/
509 
510 void
512 
513 /*----------------------------------------------------------------------------
514  * Turbulence model
515  *----------------------------------------------------------------------------*/
516 
517 void
518 cs_gui_turb_model(void);
519 
520 /*----------------------------------------------------------------------------
521  * Define reference length and reference velocity for the initialization of
522  * the turbulence variables
523  *----------------------------------------------------------------------------*/
524 
525 void
527 
528 /*----------------------------------------------------------------------------
529  * Logging output for MEI usage.
530  *----------------------------------------------------------------------------*/
531 
532 void
533 cs_gui_usage_log(void);
534 
535 /*----------------------------------------------------------------------------
536  * Define user variables through the GUI.
537  *----------------------------------------------------------------------------*/
538 
539 void
541 
542 /*----------------------------------------------------------------------------
543  * Define user arrays through the GUI.
544  *----------------------------------------------------------------------------*/
545 
546 void
547 cs_gui_user_arrays(void);
548 
549 /*----------------------------------------------------------------------------
550  * Define balance by zone through the GUI.
551  *----------------------------------------------------------------------------*/
552 
553 void
555 
556 /*----------------------------------------------------------------------------
557  * Define pressure drop through the GUI.
558  *----------------------------------------------------------------------------*/
559 
560 void
562 
563 /*----------------------------------------------------------------------------
564  * Define fans through the GUI.
565  *----------------------------------------------------------------------------*/
566 
567 void
568 cs_gui_define_fans(void);
569 
570 /*----------------------------------------------------------------------------
571  * Define error estimator through the GUI.
572  *----------------------------------------------------------------------------*/
573 
574 void
576  int *iespre,
577  int *iesder,
578  int *iescor,
579  int *iestot);
580 
581 /*----------------------------------------------------------------------------
582  * Define volume and boundary zones through the GUI.
583  *----------------------------------------------------------------------------*/
584 
585 void
586 cs_gui_zones(void);
587 
588 /*----------------------------------------------------------------------------
589  * Define internal coupling through the GUI.
590  *----------------------------------------------------------------------------*/
591 
592 void
594 
595 /*----------------------------------------------------------------------------*/
605 /*----------------------------------------------------------------------------*/
606 
609  const cs_field_t *fields[],
610  const int n_fields);
611 
612 /*----------------------------------------------------------------------------*/
613 
615 
616 #endif /* __CS_GUI_H__ */
void uiphyv(const int *iviscv)
Definition: cs_gui.c:2191
void csidtv(void)
Definition: cs_gui.c:1660
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:5196
#define restrict
Definition: cs_defs.h:142
void csnum2(double *relaxp, int *imrgra)
void cs_gui_user_variables(void)
Definition: cs_gui.c:4686
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:2914
void cs_gui_fluid_properties_value(const char *param, double *value)
Definition: cs_gui.c:2890
void cs_gui_thermal_model(void)
Definition: cs_gui.c:4222
Field descriptor.
Definition: cs_field.h:130
void cscfgp(int *icfgrp)
Definition: cs_gui.c:1712
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources...
Definition: cs_equation_param.h:186
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:512
void cs_gui_physical_properties(void)
Definition: cs_gui.c:3916
void cs_gui_turbomachinery(void)
Definition: cs_gui.c:4403
void cs_gui_define_fans(void)
Definition: cs_gui.c:4992
void cs_gui_parallel_io(void)
Definition: cs_gui.c:3689
void cs_gui_user_arrays(void)
Definition: cs_gui.c:4746
integer idarcy
pointer to specify richards model
Definition: ppincl.f90:264
void cs_gui_turb_ref_values(void)
Definition: cs_gui.c:4619
void uidapp(const int *permeability, const int *diffusion, const int *unsaturated)
Definition: cs_gui.c:2364
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
Definition: cs_field_pointer.h:68
Definition: cs_gui.h:49
void cs_gui_usage_log(void)
Definition: cs_gui.c:4658
void cs_gui_partition(void)
Definition: cs_gui.c:3756
void uiporo(void)
Definition: cs_gui.c:1850
void cs_gui_internal_coupling(void)
Definition: cs_gui.c:5117
void cs_gui_turbomachinery_rotor(void)
Definition: cs_gui.c:4418
cs_equation_param_t * cs_gui_get_equation_param(const char *name)
Definition: cs_gui.c:2867
void cscpva(void)
Definition: cs_gui.c:1540
void cs_gui_physical_constants(void)
Definition: cs_gui.c:3877
integer(c_int), pointer, save iccvfg
Definition: optcal.f90:748
void uiexop(void)
Definition: cs_gui.c:2346
void csivis(void)
Definition: cs_gui.c:1587
void cs_gui_properties_value_by_fluid_id(const int fluid_id, const char *property_name, double *value)
Definition: cs_gui.c:4126
void cs_gui_zones(void)
Definition: cs_gui.c:4789
void cs_gui_numerical_options(void)
Definition: cs_gui.c:3566
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:2030
void cs_gui_scalar_model_settings(void)
Definition: cs_gui.c:4161
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:4266
void cs_gui_mpi_algorithms(void)
Definition: cs_gui.c:3852
integer, dimension(nestmx), save iescal
iescal indicates the calculation mode for the error estimator iespre, iesder, iescor or iestot for th...
Definition: optcal.f90:870
void cs_gui_initial_conditions(void)
Apply initial conditions based on GUI-defined settings.
Definition: cs_gui.c:2985
void cs_gui_pressure_drop_by_zone(void)
Definition: cs_gui.c:4970
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:5058
void cs_gui_properties_value(const char *property_name, double *value)
Definition: cs_gui.c:4100
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:2115
void uieres(int *iescal, int *iespre, int *iesder, int *iescor, int *iestot)
Definition: cs_gui.c:2740
#define END_C_DECLS
Definition: cs_defs.h:513
void cs_gui_finalize(void)
Definition: cs_gui.c:2844
void csisui(int *ntsuit, int *iccvfg)
Definition: cs_gui.c:1739
#define CS_PROCF(x, y)
Definition: cs_defs.h:526
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:1918
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition: cs_defs.h:344
void csvvva(int *iviscv)
Definition: cs_gui.c:1565
void cs_gui_equation_parameters(void)
Definition: cs_gui.c:2758
const cs_zone_t * zone
Definition: cs_gui.h:51
void csiphy(void)
Definition: cs_gui.c:1684
void cstime(void)
Definition: cs_gui.c:1770
void cs_gui_turb_model(void)
Definition: cs_gui.c:4509
void cs_gui_time_moments(void)
Definition: cs_gui.c:4303
void cstini(void)
void cs_gui_porous_model(void)
Definition: cs_gui.c:4064
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:208
const cs_field_t ** fields
Definition: cs_gui.h:52
void cs_gui_linear_solvers(void)
Definition: cs_gui.c:3418
void cs_gui_balance_by_zone(void)
Definition: cs_gui.c:4941
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