9.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-2026 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 "base/cs_base.h"
36#include "base/cs_field.h"
37#include "base/cs_zone.h"
38
39/*----------------------------------------------------------------------------*/
40
41#define GUI_STR(str) #str
42
43/*============================================================================
44 * Type definitions
45 *============================================================================*/
46
49typedef 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
58 *============================================================================*/
59
60/*----------------------------------------------------------------------------
61 * Specific heat variable or constant indicator.
62 *----------------------------------------------------------------------------*/
63
64void
65cs_gui_cp_params (void);
66
67/*----------------------------------------------------------------------------
68 * Constant or variable indicator for the user scalar laminar viscosity.
69 *----------------------------------------------------------------------------*/
70
71void
73
74/*----------------------------------------------------------------------------
75 * Time passing parameter.
76 *----------------------------------------------------------------------------*/
77
78void
79cs_gui_dt(void);
80
81/*----------------------------------------------------------------------------
82 * Hydrostatic pressure parameter.
83 *----------------------------------------------------------------------------*/
84
85void
87
88/*----------------------------------------------------------------------------
89 * Hydrostatic equilibrium parameter.
90 *----------------------------------------------------------------------------*/
91
92void
94
95/*----------------------------------------------------------------------------
96 * Time passing parameters.
97 *----------------------------------------------------------------------------*/
98
99void
100cs_gui_dt_param(void);
101
102/*----------------------------------------------------------------------------
103 * Define porosity.
104 *----------------------------------------------------------------------------*/
105
106void
107cs_gui_porosity(void);
108
109/*----------------------------------------------------------------------------*/
113/*----------------------------------------------------------------------------*/
114
115void
117
118/*----------------------------------------------------------------------------
119 * Space scheme options, linear solver precision and time step factor
120 *----------------------------------------------------------------------------*/
121
122void
124
125/*-----------------------------------------------------------------------------
126 * Free memory: clean global private variables.
127 *----------------------------------------------------------------------------*/
128
129void
130cs_gui_finalize(void);
131
132/*----------------------------------------------------------------------------
133 * Return a pointer to equation parameters based on a field or equation name.
134 *
135 * parameters:
136 * name <-- field or equation name
137 *
138 * return:
139 * pointer to matching child string
140 *----------------------------------------------------------------------------*/
141
143cs_gui_get_equation_param(const char *name);
144
145/*-----------------------------------------------------------------------------
146 * Get value of reference fluid properties parameter.
147 *
148 * parameters:
149 * name <-- parameter name
150 * value --> parameter value
151 *----------------------------------------------------------------------------*/
152
153void
154cs_gui_fluid_properties_value(const char *param,
155 double *value);
156
157/*----------------------------------------------------------------------------
158 * Groundwater model : read laws for capacity, saturation and permeability
159 *
160 * parameters:
161 * permeability <-- permeability type
162 * diffusion <-- diffusion type
163 * unsaturated <-- unsaturated zone taken into account
164 *----------------------------------------------------------------------------*/
165
166void
167cs_gui_groundwater_property_laws(int permeability,
168 int diffusion,
169 int unsaturated);
170
171/*----------------------------------------------------------------------------*/
182/*----------------------------------------------------------------------------*/
183
184void
185cs_gui_head_losses(const cs_zone_t *zone,
186 const cs_real_3_t *cvara_vel,
187 cs_real_t cku[][6]);
188
189/*----------------------------------------------------------------------------*/
193/*----------------------------------------------------------------------------*/
194
195void
197
198/*-----------------------------------------------------------------------------
199 * Selection of linear solvers.
200 *----------------------------------------------------------------------------*/
201
202void
204
205/*----------------------------------------------------------------------------
206 * User momentum source terms.
207 *
208 * parameters:
209 * vel <-- fluid velocity
210 * tsexp --> explicit source terms
211 * tsimp --> implicit source terms
212 *----------------------------------------------------------------------------*/
213
214void
216 cs_real_3_t *tsexp,
217 cs_real_33_t *tsimp);
218
219/*-----------------------------------------------------------------------------
220 * Define global numerical options.
221 *----------------------------------------------------------------------------*/
222
223void
225
226/*-----------------------------------------------------------------------------
227 * Define parallel IO settings.
228 *----------------------------------------------------------------------------*/
229
230void
232
233/*-----------------------------------------------------------------------------
234 * Set partitioning options.
235 *----------------------------------------------------------------------------*/
236
237void
238cs_gui_partition(void);
239
240/*-----------------------------------------------------------------------------
241 * Set MPI related algorithm options
242 *----------------------------------------------------------------------------*/
243
244void
246
247/*----------------------------------------------------------------------------
248 * Treatment of physical constants (gravity and Coriolis).
249 *----------------------------------------------------------------------------*/
250
251void
253
254/*----------------------------------------------------------------------------
255 * Treatment of gravity and fluid physical properties
256 * Initialize reference pressure and temperature if present
257 *----------------------------------------------------------------------------*/
258
259void
261
262/*----------------------------------------------------------------------------
263 * User law for material properties
264 *----------------------------------------------------------------------------*/
265
266void
268
269/*----------------------------------------------------------------------------
270 * Determine porosity model type
271 *----------------------------------------------------------------------------*/
272
273void
275
276/*-----------------------------------------------------------------------------
277 * Get initial value from property markup.
278 *
279 * parameters:
280 * property_name <-- name of the property
281 * value --> new initial value of the property
282 *----------------------------------------------------------------------------*/
283
284void
285cs_gui_properties_value(const char *property_name,
286 double *value);
287
288/*-----------------------------------------------------------------------------
289 * Get value of property markup for fluid of given id
290 *
291 * parameters:
292 * fluid_id <-- fluid index
293 * property_name <-- name of the property
294 * value --> new initial value of the property
295 *----------------------------------------------------------------------------*/
296
297void
298cs_gui_properties_value_by_fluid_id(const int fluid_id,
299 const char *property_name,
300 double *value);
301
302/*----------------------------------------------------------------------------
303 * Read minimum / maximum values (used in clipping) and turbulent flux model
304 * for additional user or model variables.
305 *
306 * Also read reference dynamic and user scalar viscosity
307 *----------------------------------------------------------------------------*/
308
309void
311
312/*----------------------------------------------------------------------------
313 * Thermal model.
314 *----------------------------------------------------------------------------*/
315
316void
318
319/*----------------------------------------------------------------------------
320 * Get thermal scalar model.
321 *
322 * return:
323 * value of itherm*10 + (temperature variant flag), or -1 if not defined
324 *----------------------------------------------------------------------------*/
325
326int
328
329/*----------------------------------------------------------------------------
330 * Time moments definition
331 *----------------------------------------------------------------------------*/
332
333void
335
336/*-----------------------------------------------------------------------------
337 * Set turbomachinery model
338 *----------------------------------------------------------------------------*/
339
340void
342
343/*-----------------------------------------------------------------------------
344 * Set turbomachinery options.
345 *----------------------------------------------------------------------------*/
346
347void
349
350/*----------------------------------------------------------------------------
351 * Turbulence model
352 *----------------------------------------------------------------------------*/
353
354void
356
357/*----------------------------------------------------------------------------
358 * Define reference length and reference velocity for the initialization of
359 * the turbulence variables
360 *----------------------------------------------------------------------------*/
361
362void
364
365/*----------------------------------------------------------------------------
366 * Logging output for MEI usage.
367 *----------------------------------------------------------------------------*/
368
369[[deprecated("Remove this call to now empty function")]]
370void
371cs_gui_usage_log(void);
372
373/*----------------------------------------------------------------------------
374 * Define user variables through the GUI.
375 *----------------------------------------------------------------------------*/
376
377void
379
380/*----------------------------------------------------------------------------
381 * Define user arrays through the GUI.
382 *----------------------------------------------------------------------------*/
383
384void
386
387/*----------------------------------------------------------------------------
388 * Define user calculator functions through the GUI
389 *----------------------------------------------------------------------------*/
390
391void
393
394/*----------------------------------------------------------------------------
395 * Define balance by zone through the GUI.
396 *----------------------------------------------------------------------------*/
397
398void
400
401/*----------------------------------------------------------------------------
402 * Define pressure drop through the GUI.
403 *----------------------------------------------------------------------------*/
404
405void
407
408/*----------------------------------------------------------------------------
409 * Define fans through the GUI.
410 *----------------------------------------------------------------------------*/
411
412void
414
415/*----------------------------------------------------------------------------
416 * Define error estimator through the GUI.
417 *----------------------------------------------------------------------------*/
418
419void
421
422/*----------------------------------------------------------------------------
423 * Define volume and boundary zones through the GUI.
424 *----------------------------------------------------------------------------*/
425
426void
427cs_gui_zones(void);
428
429/*----------------------------------------------------------------------------
430 * Define internal coupling through the GUI.
431 *----------------------------------------------------------------------------*/
432
433void
435
436/*----------------------------------------------------------------------------*/
446/*----------------------------------------------------------------------------*/
447
450 const cs_field_t *fields[],
451 const int n_fields);
452
453/*----------------------------------------------------------------------------
454 * Define user scalar source terms.
455 *----------------------------------------------------------------------------*/
456
457void
459 const cs_real_t *pvar,
460 cs_real_t *tsexp,
461 cs_real_t *tsimp);
462
463/*----------------------------------------------------------------------------
464 * Compute user defined thermal scalar source terms (GUI)
465 *----------------------------------------------------------------------------*/
466
467void
469 const cs_real_t *pvar,
470 cs_real_t *tsexp,
471 cs_real_t *tsimp);
472
473/*----------------------------------------------------------------------------*/
474/*
475 * Define thermal scalar source terms as xdef
476 */
477/*----------------------------------------------------------------------------*/
478
479void
481
482/*----------------------------------------------------------------------------*/
486/*----------------------------------------------------------------------------*/
487
488void
490
491/*----------------------------------------------------------------------------
492 * For heat transfer model, check if lambda is anisotropic.
493 *
494 * return: 1 if anisotropic, 0 otherwise.
495 *----------------------------------------------------------------------------*/
496
497int
499
500/*----------------------------------------------------------------------------*/
501
502#endif /* CS_GUI_H */
Field descriptor.
Definition: cs_field.h:275
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:349
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition: cs_defs.h:358
@ vel
Definition: cs_field_pointer.h:66
void cs_gui_porous_model(void)
Definition: cs_gui.cpp:4331
void cs_gui_initial_conditions(void)
Apply initial conditions based on GUI-defined settings.
Definition: cs_gui.cpp:2800
void cs_gui_equation_parameters(void)
Definition: cs_gui.cpp:2166
void cs_gui_time_tables(void)
Read GUI defined time tables.
Definition: cs_gui.cpp:5768
void cs_gui_scalar_source_terms(cs_field_t *f, const cs_real_t *pvar, cs_real_t *tsexp, cs_real_t *tsimp)
void cs_gui_pressure_drop_by_zone(void)
Definition: cs_gui.cpp:5272
void cs_gui_checkpoint_parameters(void)
Read GUi-defined Checkpoint parameters.
Definition: cs_gui.cpp:2125
void cs_gui_parallel_io(void)
Definition: cs_gui.cpp:3829
void cs_gui_momentum_source_terms(const cs_real_3_t *vel, cs_real_3_t *tsexp, cs_real_33_t *tsimp)
void cs_gui_finalize(void)
Definition: cs_gui.cpp:2280
void cs_gui_dt(void)
Definition: cs_gui.cpp:1895
cs_equation_param_t * cs_gui_get_equation_param(const char *name)
Definition: cs_gui.cpp:2303
void cs_gui_thermal_source_terms(cs_field_t *f, const cs_real_t *pvar, cs_real_t *tsexp, cs_real_t *tsimp)
void cs_gui_internal_coupling(void)
Definition: cs_gui.cpp:5412
void cs_gui_properties_value(const char *property_name, double *value)
Definition: cs_gui.cpp:4367
void cs_gui_physical_variable(void)
Definition: cs_gui.cpp:5884
void cs_gui_turb_model(void)
Definition: cs_gui.cpp:4785
void cs_gui_time_moments(void)
Definition: cs_gui.cpp:4580
void cs_gui_porosity(void)
Definition: cs_gui.cpp:2048
void cs_gui_properties_value_by_fluid_id(const int fluid_id, const char *property_name, double *value)
Definition: cs_gui.cpp:4393
void cs_gui_physical_properties(void)
Definition: cs_gui.cpp:4056
void cs_gui_hydrostatic_equ_param(void)
Definition: cs_gui.cpp:1938
void cs_gui_user_variables(void)
Definition: cs_gui.cpp:4959
void cs_gui_linear_solvers(void)
Definition: cs_gui.cpp:3410
void cs_gui_scalar_model_settings(void)
Definition: cs_gui.cpp:4428
void cs_gui_fluid_properties_value(const char *param, double *value)
Definition: cs_gui.cpp:2326
void cs_gui_hydrostatic_pressure(void)
Definition: cs_gui.cpp:1916
void cs_gui_calculator_functions(void)
Definition: cs_gui.cpp:5048
void cs_gui_turbomachinery(void)
Definition: cs_gui.cpp:4679
void cs_gui_numerical_options(void)
Definition: cs_gui.cpp:3704
void cs_gui_user_arrays(void)
Definition: cs_gui.cpp:5020
int cs_gui_thermal_model_code(void)
Definition: cs_gui.cpp:4543
void cs_gui_dt_param(void)
Definition: cs_gui.cpp:1961
void cs_gui_zones(void)
Definition: cs_gui.cpp:5098
void cs_gui_define_fans(void)
Definition: cs_gui.cpp:5294
void cs_gui_balance_by_zone(void)
Definition: cs_gui.cpp:5243
void cs_gui_error_estimator(void)
Definition: cs_gui.cpp:5360
void cs_gui_usage_log(void)
Definition: cs_gui.cpp:4950
void cs_gui_cp_params(void)
Definition: cs_gui.cpp:1803
void cs_gui_thermal_source_terms_setup(void)
Define thermal scalar source terms as xdef.
Definition: cs_gui.cpp:5703
void cs_gui_turb_ref_values(void)
Definition: cs_gui.cpp:4911
void cs_gui_turbomachinery_rotor(void)
Definition: cs_gui.cpp:4694
void cs_gui_laminar_viscosity(void)
Definition: cs_gui.cpp:1826
void cs_gui_partition(void)
Definition: cs_gui.cpp:3896
int cs_gui_physical_properties_ht_lambda_is_anisotropic(void)
Definition: cs_gui.cpp:6032
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.cpp:2729
void cs_gui_mpi_algorithms(void)
Definition: cs_gui.cpp:3992
void cs_gui_physical_constants(void)
Definition: cs_gui.cpp:4017
void cs_gui_thermal_model(void)
Definition: cs_gui.cpp:4498
void cs_gui_groundwater_property_laws(int permeability, int diffusion, int unsaturated)
Definition: cs_gui.cpp:2346
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.cpp:5497
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:190
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:51