8.0
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-2023 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  * Time passing parameters.
134  *
135  * Fortran Interface:
136  *
137  * SUBROUTINE CSTIME
138  * *****************
139  *
140  *----------------------------------------------------------------------------*/
141 
142 void CS_PROCF (cstime, CSTIME) (void);
143 
144 /*----------------------------------------------------------------------------
145  * Global numerical parameters.
146  *
147  * Fortran Interface:
148  *
149  * SUBROUTINE CSNUM2
150  * *****************
151  *
152  * INTEGER RELAXP --> pressure relaxation
153  * INTEGER IMRGRA --> gradient reconstruction
154  *----------------------------------------------------------------------------*/
155 
156 void CS_PROCF (csnum2, CSNUM2) (double *relaxp,
157  int *imrgra);
158 
159 /*----------------------------------------------------------------------------
160  * Turbulence initialization parameters.
161  *
162  * Fortran Interface:
163  *
164  * SUBROUTINE CSTINI
165  * *****************
166  *
167  *----------------------------------------------------------------------------*/
168 
169 void CS_PROCF (cstini, CSTINI) (void);
170 
171 /*----------------------------------------------------------------------------
172  * Define porosity.
173  *
174  * Fortran Interface:
175  *
176  * SUBROUTINE UIPORO
177  *----------------------------------------------------------------------------*/
178 
179 void CS_PROCF (uiporo, UIPORO) (void);
180 
181 /*----------------------------------------------------------------------------
182  * User momentum source terms.
183  *
184  * Fortran Interface:
185  *
186  * subroutine uitsnv (ncelet, vel, tsexp, tsimp)
187  * *****************
188  *
189  * integer ncelet <-- number of cells with halo
190  * double precision vel <-- fluid velocity
191  * double precision tsexp --> explicit source terms
192  * double precision tsimp --> implicit source terms
193  *----------------------------------------------------------------------------*/
194 
195 void CS_PROCF(uitsnv, UITSNV)(const cs_real_3_t *restrict vel,
196  cs_real_3_t *restrict tsexp,
197  cs_real_33_t *restrict tsimp);
198 
199 /*----------------------------------------------------------------------------
200  * User scalar source terms.
201  *
202  * Fortran Interface:
203  *
204  * subroutine uitssc (f_id, pvar, tsexp, tsimp)
205  * *****************
206  *
207  * integer idarcy <-- groundwater module activation
208  * integer f_id <-- field id
209  * double precision pvar <-- scalar
210  * double precision tsexp --> explicit source terms
211  * double precision tsimp --> implicit source terms
212  *----------------------------------------------------------------------------*/
213 
214 void CS_PROCF(uitssc, UITSSC)(const int *idarcy,
215  const int *f_id,
216  const cs_real_t *restrict pvar,
217  cs_real_t *restrict tsexp,
218  cs_real_t *restrict tsimp);
219 
220 /*----------------------------------------------------------------------------
221  * Thermal scalar source terms.
222  *
223  * Fortran Interface:
224  *
225  * subroutine uitsth (f_id, pvar, tsexp, tsimp)
226  * *****************
227  *
228  * integer f_id <-- field id
229  * double precision pvar <-- scalar
230  * double precision tsexp --> explicit source terms
231  * double precision tsimp --> implicit source terms
232  *----------------------------------------------------------------------------*/
233 
234 void CS_PROCF(uitsth, UITSTH)(const int *f_id,
235  const cs_real_t *restrict pvar,
236  cs_real_t *restrict tsexp,
237  cs_real_t *restrict tsimp);
238 
239 /*----------------------------------------------------------------------------
240  * User law for material Properties
241  *
242  * Fortran Interface:
243  *
244  * subroutine uiphyv
245  * *****************
246  *
247  * integer iviscv <-- pointer for volumic viscosity viscv
248  *----------------------------------------------------------------------------*/
249 
250 void CS_PROCF(uiphyv, UIPHYV)(const int *iviscv);
251 
252 /*----------------------------------------------------------------------------
253  * extra operations
254  *
255  * Fortran Interface:
256  *
257  * SUBROUTINE UIEXOP
258  * *****************
259  *
260  *----------------------------------------------------------------------------*/
261 
262 void CS_PROCF (uiexop, UIEXOP)(void);
263 
264 /*----------------------------------------------------------------------------
265  * groundwater model : read laws for capacity, saturation and permeability
266  *
267  * Fortran Interface:
268  *
269  * subroutine uidapp
270  * *****************
271  * integer permeability <-- permeability type
272  * integer diffusion <-- diffusion type
273  * integer unsaturated <-- unsaturated zone taken into account
274  *----------------------------------------------------------------------------*/
275 
276 void CS_PROCF (uidapp, UIDAPP) (const int *permeability,
277  const int *diffusion,
278  const int *unsaturated);
279 
280 /*----------------------------------------------------------------------------
281  * Define error estimators
282  *
283  * Fortran Interface:
284  *
285  * SUBROUTINE UIERES
286  * *****************
287  *
288  *----------------------------------------------------------------------------*/
289 
290 void CS_PROCF (uieres, UIERES) (int *iescal,
291  int *iespre,
292  int *iesder,
293  int *iescor,
294  int *iestot);
295 
296 /*=============================================================================
297  * Public function prototypes
298  *============================================================================*/
299 
300 /*----------------------------------------------------------------------------*/
304 /*----------------------------------------------------------------------------*/
305 
306 void
308 
309 /*----------------------------------------------------------------------------
310  * Space scheme options, linear solver precision and time step factor
311  *----------------------------------------------------------------------------*/
312 
313 void
315 
316 /*-----------------------------------------------------------------------------
317  * Free memory: clean global private variables.
318  *----------------------------------------------------------------------------*/
319 
320 void
321 cs_gui_finalize(void);
322 
323 /*----------------------------------------------------------------------------
324  * Return a pointer to equation parameters based on a field or equation name.
325  *
326  * parameters:
327  * name <-- field or equation name
328  *
329  * return:
330  * pointer to matching child string
331  *----------------------------------------------------------------------------*/
332 
334 cs_gui_get_equation_param(const char *name);
335 
336 /*-----------------------------------------------------------------------------
337  * Get value of reference fluid properties parameter.
338  *
339  * parameters:
340  * name <-- parameter name
341  * value --> parameter value
342  *----------------------------------------------------------------------------*/
343 
344 void
345 cs_gui_fluid_properties_value(const char *param,
346  double *value);
347 
348 /*----------------------------------------------------------------------------*/
359 /*----------------------------------------------------------------------------*/
360 
361 void
362 cs_gui_head_losses(const cs_zone_t *zone,
363  const cs_real_3_t *cvara_vel,
364  cs_real_t cku[][6]);
365 
366 /*----------------------------------------------------------------------------*/
370 /*----------------------------------------------------------------------------*/
371 
372 void
374 
375 /*-----------------------------------------------------------------------------
376  * Selection of linear solvers.
377  *----------------------------------------------------------------------------*/
378 
379 void
381 
382 /*-----------------------------------------------------------------------------
383  * Define global numerical options.
384  *----------------------------------------------------------------------------*/
385 
386 void
388 
389 /*-----------------------------------------------------------------------------
390  * Define parallel IO settings.
391  *----------------------------------------------------------------------------*/
392 
393 void
394 cs_gui_parallel_io(void);
395 
396 /*-----------------------------------------------------------------------------
397  * Set partitioning options.
398  *----------------------------------------------------------------------------*/
399 
400 void
401 cs_gui_partition(void);
402 
403 /*-----------------------------------------------------------------------------
404  * Set MPI related algorithm options
405  *----------------------------------------------------------------------------*/
406 
407 void
409 
410 /*----------------------------------------------------------------------------
411  * Treatment of physical constants (gravity and Coriolis).
412  *----------------------------------------------------------------------------*/
413 
414 void
416 
417 /*----------------------------------------------------------------------------
418  * Treatment of gravity and fluid physical properties
419  * Initialize reference pressure and temperature if present
420  *----------------------------------------------------------------------------*/
421 
422 void
424 
425 /*----------------------------------------------------------------------------
426  * Determine porosity model type
427  *----------------------------------------------------------------------------*/
428 
429 void
430 cs_gui_porous_model(void);
431 
432 /*-----------------------------------------------------------------------------
433  * Get initial value from property markup.
434  *
435  * parameters:
436  * property_name <-- name of the property
437  * value --> new initial value of the property
438  *----------------------------------------------------------------------------*/
439 
440 void
441 cs_gui_properties_value(const char *property_name,
442  double *value);
443 
444 /*-----------------------------------------------------------------------------
445  * Get value of property markup for fluid of given id
446  *
447  * parameters:
448  * fluid_id <-- fluid index
449  * property_name <-- name of the property
450  * value --> new initial value of the property
451  *----------------------------------------------------------------------------*/
452 
453 void
454 cs_gui_properties_value_by_fluid_id(const int fluid_id,
455  const char *property_name,
456  double *value);
457 
458 /*----------------------------------------------------------------------------
459  * Read minimum / maximum values (used in clipping) and turbulent flux model
460  * for additional user or model variables.
461  *
462  * Also read reference dynamic and user scalar viscosity
463  *----------------------------------------------------------------------------*/
464 
465 void
467 
468 /*----------------------------------------------------------------------------
469  * Thermal model.
470  *----------------------------------------------------------------------------*/
471 
472 void
474 
475 /*----------------------------------------------------------------------------
476  * Get thermal scalar model.
477  *
478  * return:
479  * value of itherm*10 + (temperature variant flag), or -1 if not defined
480  *----------------------------------------------------------------------------*/
481 
482 int
484 
485 /*----------------------------------------------------------------------------
486  * Time moments definition
487  *----------------------------------------------------------------------------*/
488 
489 void
490 cs_gui_time_moments(void);
491 
492 /*-----------------------------------------------------------------------------
493  * Set turbomachinery model
494  *----------------------------------------------------------------------------*/
495 
496 void
498 
499 /*-----------------------------------------------------------------------------
500  * Set turbomachinery options.
501  *----------------------------------------------------------------------------*/
502 
503 void
505 
506 /*----------------------------------------------------------------------------
507  * Turbulence model
508  *----------------------------------------------------------------------------*/
509 
510 void
511 cs_gui_turb_model(void);
512 
513 /*----------------------------------------------------------------------------
514  * Define reference length and reference velocity for the initialization of
515  * the turbulence variables
516  *----------------------------------------------------------------------------*/
517 
518 void
520 
521 /*----------------------------------------------------------------------------
522  * Logging output for MEI usage.
523  *----------------------------------------------------------------------------*/
524 
525 void
526 cs_gui_usage_log(void);
527 
528 /*----------------------------------------------------------------------------
529  * Define user variables through the GUI.
530  *----------------------------------------------------------------------------*/
531 
532 void
534 
535 /*----------------------------------------------------------------------------
536  * Define user arrays through the GUI.
537  *----------------------------------------------------------------------------*/
538 
539 void
540 cs_gui_user_arrays(void);
541 
542 /*----------------------------------------------------------------------------
543  * Define balance by zone through the GUI.
544  *----------------------------------------------------------------------------*/
545 
546 void
548 
549 /*----------------------------------------------------------------------------
550  * Define pressure drop through the GUI.
551  *----------------------------------------------------------------------------*/
552 
553 void
555 
556 /*----------------------------------------------------------------------------
557  * Define fans through the GUI.
558  *----------------------------------------------------------------------------*/
559 
560 void
561 cs_gui_define_fans(void);
562 
563 /*----------------------------------------------------------------------------
564  * Define error estimator through the GUI.
565  *----------------------------------------------------------------------------*/
566 
567 void
569  int *iespre,
570  int *iesder,
571  int *iescor,
572  int *iestot);
573 
574 /*----------------------------------------------------------------------------
575  * Define volume and boundary zones through the GUI.
576  *----------------------------------------------------------------------------*/
577 
578 void
579 cs_gui_zones(void);
580 
581 /*----------------------------------------------------------------------------
582  * Define internal coupling through the GUI.
583  *----------------------------------------------------------------------------*/
584 
585 void
587 
588 /*----------------------------------------------------------------------------*/
598 /*----------------------------------------------------------------------------*/
599 
602  const cs_field_t *fields[],
603  const int n_fields);
604 
605 /*----------------------------------------------------------------------------*/
609 /*----------------------------------------------------------------------------*/
610 
611 void
612 cs_gui_time_tables(void);
613 
614 /*----------------------------------------------------------------------------*/
615 
617 
618 #endif /* __CS_GUI_H__ */
#define restrict
Definition: cs_defs.h:139
#define BEGIN_C_DECLS
Definition: cs_defs.h:509
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
#define CS_PROCF(x, y)
Definition: cs_defs.h:523
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:332
#define END_C_DECLS
Definition: cs_defs.h:510
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition: cs_defs.h:341
@ vel
Definition: cs_field_pointer.h:68
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:2082
void cs_gui_porous_model(void)
Definition: cs_gui.c:4216
cs_equation_param_t * cs_gui_get_equation_param(const char *name)
Definition: cs_gui.c:2962
void cs_gui_error_estimator(int *iescal, int *iespre, int *iesder, int *iescor, int *iestot)
Definition: cs_gui.c:5212
void cs_gui_initial_conditions(void)
Apply initial conditions based on GUI-defined settings.
Definition: cs_gui.c:3080
void uiporo(void)
Definition: cs_gui.c:1886
void cs_gui_equation_parameters(void)
Definition: cs_gui.c:2862
void cs_gui_time_tables(void)
Read GUI defined time tables.
Definition: cs_gui.c:5402
void cs_gui_pressure_drop_by_zone(void)
Definition: cs_gui.c:5124
void cs_gui_checkpoint_parameters(void)
Read GUi-defined Checkpoint parameters.
Definition: cs_gui.c:2826
void cs_gui_parallel_io(void)
Definition: cs_gui.c:3831
void cs_gui_finalize(void)
Definition: cs_gui.c:2939
void uiexop(void)
Definition: cs_gui.c:2408
void cs_gui_internal_coupling(void)
Definition: cs_gui.c:5271
void cs_gui_properties_value(const char *property_name, double *value)
Definition: cs_gui.c:4252
void cscpva(void)
Definition: cs_gui.c:1610
void uieres(int *iescal, int *iespre, int *iesder, int *iescor, int *iestot)
Definition: cs_gui.c:2806
void cs_gui_turb_model(void)
Definition: cs_gui.c:4661
void csiphy(void)
Definition: cs_gui.c:1754
void cstime(void)
Definition: cs_gui.c:1806
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:1965
void cs_gui_time_moments(void)
Definition: cs_gui.c:4455
void csnum2(double *relaxp, int *imrgra)
void cs_gui_properties_value_by_fluid_id(const int fluid_id, const char *property_name, double *value)
Definition: cs_gui.c:4278
void uiphyv(const int *iviscv)
Definition: cs_gui.c:2253
void cs_gui_physical_properties(void)
Definition: cs_gui.c:4058
void cs_gui_user_variables(void)
Definition: cs_gui.c:4840
void cscfgp(int *icfgrp)
Definition: cs_gui.c:1782
void cs_gui_linear_solvers(void)
Definition: cs_gui.c:3541
void cs_gui_scalar_model_settings(void)
Definition: cs_gui.c:4313
void cs_gui_fluid_properties_value(const char *param, double *value)
Definition: cs_gui.c:2985
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:2172
void csidtv(void)
Definition: cs_gui.c:1730
void cs_gui_turbomachinery(void)
Definition: cs_gui.c:4555
void cs_gui_numerical_options(void)
Definition: cs_gui.c:3708
void cs_gui_user_arrays(void)
Definition: cs_gui.c:4900
int cs_gui_thermal_model_code(void)
Definition: cs_gui.c:4418
void uidapp(const int *permeability, const int *diffusion, const int *unsaturated)
Definition: cs_gui.c:2426
void cs_gui_zones(void)
Definition: cs_gui.c:4943
void cs_gui_define_fans(void)
Definition: cs_gui.c:5146
void csvvva(int *iviscv)
Definition: cs_gui.c:1635
void cs_gui_balance_by_zone(void)
Definition: cs_gui.c:5095
void cs_gui_usage_log(void)
Definition: cs_gui.c:4812
void csivis(void)
Definition: cs_gui.c:1657
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:5355
void cs_gui_turb_ref_values(void)
Definition: cs_gui.c:4773
void cs_gui_turbomachinery_rotor(void)
Definition: cs_gui.c:4570
void cs_gui_partition(void)
Definition: cs_gui.c:3898
void cstini(void)
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:3009
void cs_gui_mpi_algorithms(void)
Definition: cs_gui.c:3994
void cs_gui_physical_constants(void)
Definition: cs_gui.c:4019
void cs_gui_thermal_model(void)
Definition: cs_gui.c:4374
integer idarcy
pointer to specify richards model
Definition: ppincl.f90:264
integer, save icfgrp
indicates if the boundary conditions should take into account (=1) or not (=0) the hydrostatic balanc...
Definition: ppincl.f90:713
integer, save iviscv
additional property:
Definition: ppincl.f90:653
integer(c_int), pointer, save imrgra
type of gradient reconstruction
Definition: optcal.f90:137
integer iespre
Error estimator for Navier-Stokes. iest = iespre: prediction, (default name: EsPre)....
Definition: paramx.f90:242
integer iescor
Error estimator for Navier-Stokes. iest = iescor: correction, (default name: EsCor)....
Definition: paramx.f90:278
integer iestot
Error estimator for Navier-Stokes. iest = iestot: total, (default name: EsTot). The estimator ,...
Definition: paramx.f90:308
integer iesder
Error estimator for Navier-Stokes. iest = iesder: drift (default name: EsDer). The estimator is base...
Definition: paramx.f90:258
integer, dimension(nestmx), save iescal
iescal indicates the calculation mode for the error estimator iespre, iesder, iescor or iestot for th...
Definition: optcal.f90:779
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:192
Field descriptor.
Definition: cs_field.h:130
Definition: cs_gui.h:49
const cs_zone_t * zone
Definition: cs_gui.h:51
const cs_field_t ** fields
Definition: cs_gui.h:52
Definition: cs_zone.h:55