8.2
general documentation
Loading...
Searching...
No Matches
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-2024 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
48
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 for Fortran API
58 *============================================================================*/
59
60/*----------------------------------------------------------------------------
61 * Specific heat variable or constant indicator.
62 *
63 * Fortran Interface:
64 *
65 * SUBROUTINE CSFPVA
66 * *****************
67 *----------------------------------------------------------------------------*/
68
69void CS_PROCF (csfpva, CSFPVA) (void);
70
71/*----------------------------------------------------------------------------
72 * Constant or variable indicator for the user scalar laminar viscosity.
73 *
74 * Fortran Interface:
75 *
76 * subroutine csivis
77 * *****************
78 *----------------------------------------------------------------------------*/
79
80void CS_PROCF (csivis, CSIVIS) (void);
81
82/*----------------------------------------------------------------------------
83 * Time passing parameter.
84 *
85 * Fortran Interface:
86 *
87 * SUBROUTINE CSIDTV ()
88 * *****************
89 *
90 *----------------------------------------------------------------------------*/
91
92void CS_PROCF(csidtv, CSIDTV) (void);
93
94/*----------------------------------------------------------------------------
95 * Hydrostatic pressure parameter.
96 *
97 * Fortran Interface:
98 *
99 * SUBROUTINE CSIPHY ()
100 * *****************
101 *
102 *----------------------------------------------------------------------------*/
103
104void CS_PROCF (csiphy, CSIPHY) (void);
105
106/*----------------------------------------------------------------------------
107 * Hydrostatic equilibrium parameter.
108 *
109 * Fortran Interface:
110 *
111 * subroutine cscfgp (icfgrp)
112 * *****************
113 *----------------------------------------------------------------------------*/
114
115void CS_PROCF (cscfgp, CSCFGP) (void);
116
117/*----------------------------------------------------------------------------
118 * Time passing parameters.
119 *
120 * Fortran Interface:
121 *
122 * SUBROUTINE CSTIME
123 * *****************
124 *
125 *----------------------------------------------------------------------------*/
126
127void CS_PROCF (cstime, CSTIME) (void);
128
129/*----------------------------------------------------------------------------
130 * Global numerical parameters.
131 *
132 * Fortran Interface:
133 *
134 * SUBROUTINE CSNUM2
135 * *****************
136 *
137 * INTEGER RELAXP --> pressure relaxation
138 * INTEGER IMRGRA --> gradient reconstruction
139 *----------------------------------------------------------------------------*/
140
141void CS_PROCF (csnum2, CSNUM2) (double *relaxp,
142 int *imrgra);
143
144/*----------------------------------------------------------------------------
145 * Turbulence initialization parameters.
146 *
147 * Fortran Interface:
148 *
149 * SUBROUTINE CSTINI
150 * *****************
151 *
152 *----------------------------------------------------------------------------*/
153
154void CS_PROCF (cstini, CSTINI) (void);
155
156/*----------------------------------------------------------------------------
157 * Define porosity.
158 *
159 * Fortran Interface:
160 *
161 * SUBROUTINE UIPORO
162 *----------------------------------------------------------------------------*/
163
164void CS_PROCF (uiporo, UIPORO) (void);
165
166/*----------------------------------------------------------------------------
167 * User law for material Properties
168 *
169 * Fortran Interface:
170 *
171 * subroutine uiphyv
172 * *****************
173 *----------------------------------------------------------------------------*/
174
175void CS_PROCF(uiphyv, UIPHYV)(void);
176
177/*----------------------------------------------------------------------------
178 * extra operations
179 *
180 * Fortran Interface:
181 *
182 * subroutine uiexop
183 * *****************
184 *----------------------------------------------------------------------------*/
185
186void CS_PROCF (uiexop, UIEXOP)(void);
187
188/*=============================================================================
189 * Public function prototypes
190 *============================================================================*/
191
192/*----------------------------------------------------------------------------*/
196/*----------------------------------------------------------------------------*/
197
198void
200
201/*----------------------------------------------------------------------------
202 * Space scheme options, linear solver precision and time step factor
203 *----------------------------------------------------------------------------*/
204
205void
207
208/*-----------------------------------------------------------------------------
209 * Free memory: clean global private variables.
210 *----------------------------------------------------------------------------*/
211
212void
213cs_gui_finalize(void);
214
215/*----------------------------------------------------------------------------
216 * Return a pointer to equation parameters based on a field or equation name.
217 *
218 * parameters:
219 * name <-- field or equation name
220 *
221 * return:
222 * pointer to matching child string
223 *----------------------------------------------------------------------------*/
224
226cs_gui_get_equation_param(const char *name);
227
228/*-----------------------------------------------------------------------------
229 * Get value of reference fluid properties parameter.
230 *
231 * parameters:
232 * name <-- parameter name
233 * value --> parameter value
234 *----------------------------------------------------------------------------*/
235
236void
237cs_gui_fluid_properties_value(const char *param,
238 double *value);
239
240/*----------------------------------------------------------------------------
241 * Groundwater model : read laws for capacity, saturation and permeability
242 *
243 * parameters:
244 * permeability <-- permeability type
245 * diffusion <-- diffusion type
246 * unsaturated <-- unsaturated zone taken into account
247 *----------------------------------------------------------------------------*/
248
249void
250cs_gui_groundwater_property_laws(int permeability,
251 int diffusion,
252 int unsaturated);
253
254/*----------------------------------------------------------------------------*/
265/*----------------------------------------------------------------------------*/
266
267void
268cs_gui_head_losses(const cs_zone_t *zone,
269 const cs_real_3_t *cvara_vel,
270 cs_real_t cku[][6]);
271
272/*----------------------------------------------------------------------------*/
276/*----------------------------------------------------------------------------*/
277
278void
280
281/*-----------------------------------------------------------------------------
282 * Selection of linear solvers.
283 *----------------------------------------------------------------------------*/
284
285void
287
288/*----------------------------------------------------------------------------
289 * User momentum source terms.
290 *
291 * parameters:
292 * vel <-- fluid velocity
293 * tsexp --> explicit source terms
294 * tsimp --> implicit source terms
295 *----------------------------------------------------------------------------*/
296
297void
299 cs_real_3_t *restrict tsexp,
300 cs_real_33_t *restrict tsimp);
301
302/*-----------------------------------------------------------------------------
303 * Define global numerical options.
304 *----------------------------------------------------------------------------*/
305
306void
308
309/*-----------------------------------------------------------------------------
310 * Define parallel IO settings.
311 *----------------------------------------------------------------------------*/
312
313void
315
316/*-----------------------------------------------------------------------------
317 * Set partitioning options.
318 *----------------------------------------------------------------------------*/
319
320void
321cs_gui_partition(void);
322
323/*-----------------------------------------------------------------------------
324 * Set MPI related algorithm options
325 *----------------------------------------------------------------------------*/
326
327void
329
330/*----------------------------------------------------------------------------
331 * Treatment of physical constants (gravity and Coriolis).
332 *----------------------------------------------------------------------------*/
333
334void
336
337/*----------------------------------------------------------------------------
338 * Treatment of gravity and fluid physical properties
339 * Initialize reference pressure and temperature if present
340 *----------------------------------------------------------------------------*/
341
342void
344
345/*----------------------------------------------------------------------------
346 * Determine porosity model type
347 *----------------------------------------------------------------------------*/
348
349void
351
352/*-----------------------------------------------------------------------------
353 * Get initial value from property markup.
354 *
355 * parameters:
356 * property_name <-- name of the property
357 * value --> new initial value of the property
358 *----------------------------------------------------------------------------*/
359
360void
361cs_gui_properties_value(const char *property_name,
362 double *value);
363
364/*-----------------------------------------------------------------------------
365 * Get value of property markup for fluid of given id
366 *
367 * parameters:
368 * fluid_id <-- fluid index
369 * property_name <-- name of the property
370 * value --> new initial value of the property
371 *----------------------------------------------------------------------------*/
372
373void
374cs_gui_properties_value_by_fluid_id(const int fluid_id,
375 const char *property_name,
376 double *value);
377
378/*----------------------------------------------------------------------------
379 * Read minimum / maximum values (used in clipping) and turbulent flux model
380 * for additional user or model variables.
381 *
382 * Also read reference dynamic and user scalar viscosity
383 *----------------------------------------------------------------------------*/
384
385void
387
388/*----------------------------------------------------------------------------
389 * Thermal model.
390 *----------------------------------------------------------------------------*/
391
392void
394
395/*----------------------------------------------------------------------------
396 * Get thermal scalar model.
397 *
398 * return:
399 * value of itherm*10 + (temperature variant flag), or -1 if not defined
400 *----------------------------------------------------------------------------*/
401
402int
404
405/*----------------------------------------------------------------------------
406 * Time moments definition
407 *----------------------------------------------------------------------------*/
408
409void
411
412/*-----------------------------------------------------------------------------
413 * Set turbomachinery model
414 *----------------------------------------------------------------------------*/
415
416void
418
419/*-----------------------------------------------------------------------------
420 * Set turbomachinery options.
421 *----------------------------------------------------------------------------*/
422
423void
425
426/*----------------------------------------------------------------------------
427 * Turbulence model
428 *----------------------------------------------------------------------------*/
429
430void
432
433/*----------------------------------------------------------------------------
434 * Define reference length and reference velocity for the initialization of
435 * the turbulence variables
436 *----------------------------------------------------------------------------*/
437
438void
440
441/*----------------------------------------------------------------------------
442 * Logging output for MEI usage.
443 *----------------------------------------------------------------------------*/
444
445void
446cs_gui_usage_log(void);
447
448/*----------------------------------------------------------------------------
449 * Define user variables through the GUI.
450 *----------------------------------------------------------------------------*/
451
452void
454
455/*----------------------------------------------------------------------------
456 * Define user arrays through the GUI.
457 *----------------------------------------------------------------------------*/
458
459void
461
462/*----------------------------------------------------------------------------
463 * Define user calculator functions through the GUI
464 *----------------------------------------------------------------------------*/
465
466void
468
469/*----------------------------------------------------------------------------
470 * Define balance by zone through the GUI.
471 *----------------------------------------------------------------------------*/
472
473void
475
476/*----------------------------------------------------------------------------
477 * Define pressure drop through the GUI.
478 *----------------------------------------------------------------------------*/
479
480void
482
483/*----------------------------------------------------------------------------
484 * Define fans through the GUI.
485 *----------------------------------------------------------------------------*/
486
487void
489
490/*----------------------------------------------------------------------------
491 * Define error estimator through the GUI.
492 *----------------------------------------------------------------------------*/
493
494void
496
497/*----------------------------------------------------------------------------
498 * Define volume and boundary zones through the GUI.
499 *----------------------------------------------------------------------------*/
500
501void
502cs_gui_zones(void);
503
504/*----------------------------------------------------------------------------
505 * Define internal coupling through the GUI.
506 *----------------------------------------------------------------------------*/
507
508void
510
511/*----------------------------------------------------------------------------*/
521/*----------------------------------------------------------------------------*/
522
525 const cs_field_t *fields[],
526 const int n_fields);
527
528/*----------------------------------------------------------------------------
529 * Define user scalar source terms.
530 *----------------------------------------------------------------------------*/
531
532void
534 const cs_real_t *restrict pvar,
535 cs_real_t *restrict tsexp,
536 cs_real_t *restrict tsimp);
537
538/*----------------------------------------------------------------------------
539 * Define user thermal scalar source terms
540 *----------------------------------------------------------------------------*/
541
542void
544 const cs_real_t *restrict pvar,
545 cs_real_t *restrict tsexp,
546 cs_real_t *restrict tsimp);
547
548/*----------------------------------------------------------------------------*/
552/*----------------------------------------------------------------------------*/
553
554void
556
557/*----------------------------------------------------------------------------*/
558
560
561#endif /* __CS_GUI_H__ */
#define restrict
Definition cs_defs.h:141
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition cs_defs.h:356
#define BEGIN_C_DECLS
Definition cs_defs.h:528
double cs_real_t
Floating-point value.
Definition cs_defs.h:332
#define CS_PROCF(x, y)
Definition cs_defs.h:560
#define END_C_DECLS
Definition cs_defs.h:529
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition cs_defs.h:347
@ vel
Definition cs_field_pointer.h:68
void uiporo(void)
Definition cs_gui.c:2028
void uiexop(void)
Definition cs_gui.c:2260
void csiphy(void)
Definition cs_gui.c:1895
void cstime(void)
Definition cs_gui.c:1948
void csidtv(void)
Definition cs_gui.c:1871
void uiphyv(void)
Definition cs_gui.c:2108
void csfpva(void)
Definition cs_gui.c:1771
void cscfgp(void)
Definition cs_gui.c:1921
void csivis(void)
Definition cs_gui.c:1798
void cs_gui_porous_model(void)
Definition cs_gui.c:4290
void cs_gui_initial_conditions(void)
Apply initial conditions based on GUI-defined settings.
Definition cs_gui.c:2933
void cs_gui_equation_parameters(void)
Definition cs_gui.c:2313
void cs_gui_time_tables(void)
Read GUI defined time tables.
Definition cs_gui.c:5666
void cs_gui_pressure_drop_by_zone(void)
Definition cs_gui.c:5232
void cs_gui_checkpoint_parameters(void)
Read GUi-defined Checkpoint parameters.
Definition cs_gui.c:2277
void cs_gui_parallel_io(void)
Definition cs_gui.c:3905
void cs_gui_finalize(void)
Definition cs_gui.c:2412
cs_equation_param_t * cs_gui_get_equation_param(const char *name)
Definition cs_gui.c:2435
void cs_gui_internal_coupling(void)
Definition cs_gui.c:5372
void cs_gui_properties_value(const char *property_name, double *value)
Definition cs_gui.c:4326
void cs_gui_turb_model(void)
Definition cs_gui.c:4744
void cs_gui_time_moments(void)
Definition cs_gui.c:4538
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:4352
void cs_gui_physical_properties(void)
Definition cs_gui.c:4132
void cs_gui_user_variables(void)
Definition cs_gui.c:4923
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:5502
void cs_gui_linear_solvers(void)
Definition cs_gui.c:3498
void cs_gui_scalar_model_settings(void)
Definition cs_gui.c:4387
void cs_gui_fluid_properties_value(const char *param, double *value)
Definition cs_gui.c:2458
void cs_gui_calculator_functions(void)
Definition cs_gui.c:5011
void cs_gui_turbomachinery(void)
Definition cs_gui.c:4638
void cs_gui_numerical_options(void)
Definition cs_gui.c:3780
void cs_gui_user_arrays(void)
Definition cs_gui.c:4983
int cs_gui_thermal_model_code(void)
Definition cs_gui.c:4501
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:5586
void cs_gui_zones(void)
Definition cs_gui.c:5058
void cs_gui_define_fans(void)
Definition cs_gui.c:5254
void cs_gui_balance_by_zone(void)
Definition cs_gui.c:5203
void cs_gui_error_estimator(void)
Definition cs_gui.c:5320
void cs_gui_usage_log(void)
Definition cs_gui.c:4895
void cs_gui_turb_ref_values(void)
Definition cs_gui.c:4856
void cs_gui_turbomachinery_rotor(void)
Definition cs_gui.c:4653
void cs_gui_partition(void)
Definition cs_gui.c:3972
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:3669
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:2862
void cs_gui_mpi_algorithms(void)
Definition cs_gui.c:4068
void cs_gui_physical_constants(void)
Definition cs_gui.c:4093
void cs_gui_thermal_model(void)
Definition cs_gui.c:4457
void cs_gui_groundwater_property_laws(int permeability, int diffusion, int unsaturated)
Definition cs_gui.c:2478
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:5457
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition cs_equation_param.h:193
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