8.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-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 law for material Properties
183  *
184  * Fortran Interface:
185  *
186  * subroutine uiphyv
187  * *****************
188  *
189  * integer iviscv <-- pointer for volumic viscosity viscv
190  *----------------------------------------------------------------------------*/
191 
192 void CS_PROCF(uiphyv, UIPHYV)(const int *iviscv);
193 
194 /*----------------------------------------------------------------------------
195  * extra operations
196  *
197  * Fortran Interface:
198  *
199  * SUBROUTINE UIEXOP
200  * *****************
201  *
202  *----------------------------------------------------------------------------*/
203 
204 void CS_PROCF (uiexop, UIEXOP)(void);
205 
206 /*=============================================================================
207  * Public function prototypes
208  *============================================================================*/
209 
210 /*----------------------------------------------------------------------------*/
214 /*----------------------------------------------------------------------------*/
215 
216 void
218 
219 /*----------------------------------------------------------------------------
220  * Space scheme options, linear solver precision and time step factor
221  *----------------------------------------------------------------------------*/
222 
223 void
225 
226 /*-----------------------------------------------------------------------------
227  * Free memory: clean global private variables.
228  *----------------------------------------------------------------------------*/
229 
230 void
231 cs_gui_finalize(void);
232 
233 /*----------------------------------------------------------------------------
234  * Return a pointer to equation parameters based on a field or equation name.
235  *
236  * parameters:
237  * name <-- field or equation name
238  *
239  * return:
240  * pointer to matching child string
241  *----------------------------------------------------------------------------*/
242 
244 cs_gui_get_equation_param(const char *name);
245 
246 /*-----------------------------------------------------------------------------
247  * Get value of reference fluid properties parameter.
248  *
249  * parameters:
250  * name <-- parameter name
251  * value --> parameter value
252  *----------------------------------------------------------------------------*/
253 
254 void
255 cs_gui_fluid_properties_value(const char *param,
256  double *value);
257 
258 /*----------------------------------------------------------------------------
259  * Groundwater model : read laws for capacity, saturation and permeability
260  *
261  * parameters:
262  * permeability <-- permeability type
263  * diffusion <-- diffusion type
264  * unsaturated <-- unsaturated zone taken into account
265  *----------------------------------------------------------------------------*/
266 
267 void
268 cs_gui_groundwater_property_laws(int permeability,
269  int diffusion,
270  int unsaturated);
271 
272 /*----------------------------------------------------------------------------*/
283 /*----------------------------------------------------------------------------*/
284 
285 void
286 cs_gui_head_losses(const cs_zone_t *zone,
287  const cs_real_3_t *cvara_vel,
288  cs_real_t cku[][6]);
289 
290 /*----------------------------------------------------------------------------*/
294 /*----------------------------------------------------------------------------*/
295 
296 void
298 
299 /*-----------------------------------------------------------------------------
300  * Selection of linear solvers.
301  *----------------------------------------------------------------------------*/
302 
303 void
305 
306 /*----------------------------------------------------------------------------
307  * User momentum source terms.
308  *
309  * parameters:
310  * vel <-- fluid velocity
311  * tsexp --> explicit source terms
312  * tsimp --> implicit source terms
313  *----------------------------------------------------------------------------*/
314 
315 void
317  cs_real_3_t *restrict tsexp,
318  cs_real_33_t *restrict tsimp);
319 
320 /*-----------------------------------------------------------------------------
321  * Define global numerical options.
322  *----------------------------------------------------------------------------*/
323 
324 void
326 
327 /*-----------------------------------------------------------------------------
328  * Define parallel IO settings.
329  *----------------------------------------------------------------------------*/
330 
331 void
332 cs_gui_parallel_io(void);
333 
334 /*-----------------------------------------------------------------------------
335  * Set partitioning options.
336  *----------------------------------------------------------------------------*/
337 
338 void
339 cs_gui_partition(void);
340 
341 /*-----------------------------------------------------------------------------
342  * Set MPI related algorithm options
343  *----------------------------------------------------------------------------*/
344 
345 void
347 
348 /*----------------------------------------------------------------------------
349  * Treatment of physical constants (gravity and Coriolis).
350  *----------------------------------------------------------------------------*/
351 
352 void
354 
355 /*----------------------------------------------------------------------------
356  * Treatment of gravity and fluid physical properties
357  * Initialize reference pressure and temperature if present
358  *----------------------------------------------------------------------------*/
359 
360 void
362 
363 /*----------------------------------------------------------------------------
364  * Determine porosity model type
365  *----------------------------------------------------------------------------*/
366 
367 void
368 cs_gui_porous_model(void);
369 
370 /*-----------------------------------------------------------------------------
371  * Get initial value from property markup.
372  *
373  * parameters:
374  * property_name <-- name of the property
375  * value --> new initial value of the property
376  *----------------------------------------------------------------------------*/
377 
378 void
379 cs_gui_properties_value(const char *property_name,
380  double *value);
381 
382 /*-----------------------------------------------------------------------------
383  * Get value of property markup for fluid of given id
384  *
385  * parameters:
386  * fluid_id <-- fluid index
387  * property_name <-- name of the property
388  * value --> new initial value of the property
389  *----------------------------------------------------------------------------*/
390 
391 void
392 cs_gui_properties_value_by_fluid_id(const int fluid_id,
393  const char *property_name,
394  double *value);
395 
396 /*----------------------------------------------------------------------------
397  * Read minimum / maximum values (used in clipping) and turbulent flux model
398  * for additional user or model variables.
399  *
400  * Also read reference dynamic and user scalar viscosity
401  *----------------------------------------------------------------------------*/
402 
403 void
405 
406 /*----------------------------------------------------------------------------
407  * Thermal model.
408  *----------------------------------------------------------------------------*/
409 
410 void
412 
413 /*----------------------------------------------------------------------------
414  * Get thermal scalar model.
415  *
416  * return:
417  * value of itherm*10 + (temperature variant flag), or -1 if not defined
418  *----------------------------------------------------------------------------*/
419 
420 int
422 
423 /*----------------------------------------------------------------------------
424  * Time moments definition
425  *----------------------------------------------------------------------------*/
426 
427 void
428 cs_gui_time_moments(void);
429 
430 /*-----------------------------------------------------------------------------
431  * Set turbomachinery model
432  *----------------------------------------------------------------------------*/
433 
434 void
436 
437 /*-----------------------------------------------------------------------------
438  * Set turbomachinery options.
439  *----------------------------------------------------------------------------*/
440 
441 void
443 
444 /*----------------------------------------------------------------------------
445  * Turbulence model
446  *----------------------------------------------------------------------------*/
447 
448 void
449 cs_gui_turb_model(void);
450 
451 /*----------------------------------------------------------------------------
452  * Define reference length and reference velocity for the initialization of
453  * the turbulence variables
454  *----------------------------------------------------------------------------*/
455 
456 void
458 
459 /*----------------------------------------------------------------------------
460  * Logging output for MEI usage.
461  *----------------------------------------------------------------------------*/
462 
463 void
464 cs_gui_usage_log(void);
465 
466 /*----------------------------------------------------------------------------
467  * Define user variables through the GUI.
468  *----------------------------------------------------------------------------*/
469 
470 void
472 
473 /*----------------------------------------------------------------------------
474  * Define user arrays through the GUI.
475  *----------------------------------------------------------------------------*/
476 
477 void
478 cs_gui_user_arrays(void);
479 
480 /*----------------------------------------------------------------------------
481  * Define balance by zone through the GUI.
482  *----------------------------------------------------------------------------*/
483 
484 void
486 
487 /*----------------------------------------------------------------------------
488  * Define pressure drop through the GUI.
489  *----------------------------------------------------------------------------*/
490 
491 void
493 
494 /*----------------------------------------------------------------------------
495  * Define fans through the GUI.
496  *----------------------------------------------------------------------------*/
497 
498 void
499 cs_gui_define_fans(void);
500 
501 /*----------------------------------------------------------------------------
502  * Define error estimator through the GUI.
503  *----------------------------------------------------------------------------*/
504 
505 void
507 
508 /*----------------------------------------------------------------------------
509  * Define volume and boundary zones through the GUI.
510  *----------------------------------------------------------------------------*/
511 
512 void
513 cs_gui_zones(void);
514 
515 /*----------------------------------------------------------------------------
516  * Define internal coupling through the GUI.
517  *----------------------------------------------------------------------------*/
518 
519 void
521 
522 /*----------------------------------------------------------------------------*/
532 /*----------------------------------------------------------------------------*/
533 
536  const cs_field_t *fields[],
537  const int n_fields);
538 
539 /*----------------------------------------------------------------------------
540  * Define user scalar source terms.
541  *----------------------------------------------------------------------------*/
542 
543 void
545  const cs_real_t *restrict pvar,
546  cs_real_t *restrict tsexp,
547  cs_real_t *restrict tsimp);
548 
549 /*----------------------------------------------------------------------------
550  * Define user thermal scalar source terms
551  *----------------------------------------------------------------------------*/
552 
553 void
555  const cs_real_t *restrict pvar,
556  cs_real_t *restrict tsexp,
557  cs_real_t *restrict tsimp);
558 
559 /*----------------------------------------------------------------------------*/
563 /*----------------------------------------------------------------------------*/
564 
565 void
566 cs_gui_time_tables(void);
567 
568 /*----------------------------------------------------------------------------*/
569 
571 
572 #endif /* __CS_GUI_H__ */
#define restrict
Definition: cs_defs.h:139
#define BEGIN_C_DECLS
Definition: cs_defs.h:514
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
#define CS_PROCF(x, y)
Definition: cs_defs.h:528
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:334
#define END_C_DECLS
Definition: cs_defs.h:515
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition: cs_defs.h:343
@ vel
Definition: cs_field_pointer.h:68
void cs_gui_porous_model(void)
Definition: cs_gui.c:4259
cs_equation_param_t * cs_gui_get_equation_param(const char *name)
Definition: cs_gui.c:2403
void cs_gui_initial_conditions(void)
Apply initial conditions based on GUI-defined settings.
Definition: cs_gui.c:2901
void uiporo(void)
Definition: cs_gui.c:1993
void cs_gui_equation_parameters(void)
Definition: cs_gui.c:2281
void cs_gui_time_tables(void)
Read GUI defined time tables.
Definition: cs_gui.c:5603
void cs_gui_pressure_drop_by_zone(void)
Definition: cs_gui.c:5169
void cs_gui_checkpoint_parameters(void)
Read GUi-defined Checkpoint parameters.
Definition: cs_gui.c:2245
void cs_gui_parallel_io(void)
Definition: cs_gui.c:3874
void cs_gui_finalize(void)
Definition: cs_gui.c:2380
void uiexop(void)
Definition: cs_gui.c:2228
void cs_gui_internal_coupling(void)
Definition: cs_gui.c:5309
void cs_gui_properties_value(const char *property_name, double *value)
Definition: cs_gui.c:4295
void cscpva(void)
Definition: cs_gui.c:1717
void cs_gui_turb_model(void)
Definition: cs_gui.c:4713
void csiphy(void)
Definition: cs_gui.c:1861
void cstime(void)
Definition: cs_gui.c:1913
void cs_gui_time_moments(void)
Definition: cs_gui.c:4507
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:4321
void uiphyv(const int *iviscv)
Definition: cs_gui.c:2075
void cs_gui_physical_properties(void)
Definition: cs_gui.c:4101
void cs_gui_user_variables(void)
Definition: cs_gui.c:4892
void cs_gui_scalar_source_terms(cs_field_t *f, const cs_real_t *restrict pvar, cs_real_t *restrict tsexp, cs_real_t *restrict tsimp)
Definition: cs_gui.c:5439
void cscfgp(int *icfgrp)
Definition: cs_gui.c:1889
void cs_gui_linear_solvers(void)
Definition: cs_gui.c:3466
void cs_gui_scalar_model_settings(void)
Definition: cs_gui.c:4356
void cs_gui_fluid_properties_value(const char *param, double *value)
Definition: cs_gui.c:2426
void csidtv(void)
Definition: cs_gui.c:1837
void cs_gui_turbomachinery(void)
Definition: cs_gui.c:4607
void cs_gui_numerical_options(void)
Definition: cs_gui.c:3749
void cs_gui_user_arrays(void)
Definition: cs_gui.c:4952
int cs_gui_thermal_model_code(void)
Definition: cs_gui.c:4470
void cs_gui_thermal_source_terms(cs_field_t *f, const cs_real_t *restrict pvar, cs_real_t *restrict tsexp, cs_real_t *restrict tsimp)
Definition: cs_gui.c:5523
void cs_gui_zones(void)
Definition: cs_gui.c:4995
void cs_gui_define_fans(void)
Definition: cs_gui.c:5191
void csvvva(int *iviscv)
Definition: cs_gui.c:1742
void cs_gui_balance_by_zone(void)
Definition: cs_gui.c:5140
void cs_gui_error_estimator(void)
Definition: cs_gui.c:5257
void cs_gui_usage_log(void)
Definition: cs_gui.c:4864
void csivis(void)
Definition: cs_gui.c:1764
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:5394
void cs_gui_turb_ref_values(void)
Definition: cs_gui.c:4825
void cs_gui_turbomachinery_rotor(void)
Definition: cs_gui.c:4622
void cs_gui_partition(void)
Definition: cs_gui.c:3941
void cs_gui_momentum_source_terms(const cs_real_3_t *restrict vel, cs_real_3_t *restrict tsexp, cs_real_33_t *restrict tsimp)
Definition: cs_gui.c:3638
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:2830
void cs_gui_mpi_algorithms(void)
Definition: cs_gui.c:4037
void cs_gui_physical_constants(void)
Definition: cs_gui.c:4062
void cs_gui_thermal_model(void)
Definition: cs_gui.c:4426
void cs_gui_groundwater_property_laws(int permeability, int diffusion, int unsaturated)
Definition: cs_gui.c:2446
integer, save icfgrp
indicates if the boundary conditions should take into account (=1) or not (=0) the hydrostatic balanc...
Definition: ppincl.f90:659
integer, save iviscv
additional property:
Definition: ppincl.f90:599
integer(c_int), pointer, save imrgra
type of gradient reconstruction
Definition: optcal.f90:137
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:131
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