8.0
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-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
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 CSCPVA
66 * *****************
67 *----------------------------------------------------------------------------*/
68
69void 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
82void 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
93void CS_PROCF (csivis, CSIVIS) (void);
94
95/*----------------------------------------------------------------------------
96 * Time passing parameter.
97 *
98 * Fortran Interface:
99 *
100 * SUBROUTINE CSIDTV ()
101 * *****************
102 *
103 *----------------------------------------------------------------------------*/
104
105void CS_PROCF(csidtv, CSIDTV) (void);
106
107/*----------------------------------------------------------------------------
108 * Hydrostatic pressure parameter.
109 *
110 * Fortran Interface:
111 *
112 * SUBROUTINE CSIPHY ()
113 * *****************
114 *
115 *----------------------------------------------------------------------------*/
116
117void 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
130void CS_PROCF (cscfgp, CSCFGP) (int *icfgrp);
131
132/*----------------------------------------------------------------------------
133 * Time passing parameters.
134 *
135 * Fortran Interface:
136 *
137 * SUBROUTINE CSTIME
138 * *****************
139 *
140 *----------------------------------------------------------------------------*/
141
142void 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
156void 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
169void CS_PROCF (cstini, CSTINI) (void);
170
171/*----------------------------------------------------------------------------
172 * Define porosity.
173 *
174 * Fortran Interface:
175 *
176 * SUBROUTINE UIPORO
177 *----------------------------------------------------------------------------*/
178
179void 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
195void 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
214void 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
234void 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
250void CS_PROCF(uiphyv, UIPHYV)(const int *iviscv);
251
252/*----------------------------------------------------------------------------
253 * extra operations
254 *
255 * Fortran Interface:
256 *
257 * SUBROUTINE UIEXOP
258 * *****************
259 *
260 *----------------------------------------------------------------------------*/
261
262void 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
276void 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
290void 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
306void
308
309/*----------------------------------------------------------------------------
310 * Space scheme options, linear solver precision and time step factor
311 *----------------------------------------------------------------------------*/
312
313void
315
316/*-----------------------------------------------------------------------------
317 * Free memory: clean global private variables.
318 *----------------------------------------------------------------------------*/
319
320void
321cs_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
334cs_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
344void
345cs_gui_fluid_properties_value(const char *param,
346 double *value);
347
348/*----------------------------------------------------------------------------*/
359/*----------------------------------------------------------------------------*/
360
361void
362cs_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
372void
374
375/*-----------------------------------------------------------------------------
376 * Selection of linear solvers.
377 *----------------------------------------------------------------------------*/
378
379void
381
382/*-----------------------------------------------------------------------------
383 * Define global numerical options.
384 *----------------------------------------------------------------------------*/
385
386void
388
389/*-----------------------------------------------------------------------------
390 * Define parallel IO settings.
391 *----------------------------------------------------------------------------*/
392
393void
395
396/*-----------------------------------------------------------------------------
397 * Set partitioning options.
398 *----------------------------------------------------------------------------*/
399
400void
401cs_gui_partition(void);
402
403/*-----------------------------------------------------------------------------
404 * Set MPI related algorithm options
405 *----------------------------------------------------------------------------*/
406
407void
409
410/*----------------------------------------------------------------------------
411 * Treatment of physical constants (gravity and Coriolis).
412 *----------------------------------------------------------------------------*/
413
414void
416
417/*----------------------------------------------------------------------------
418 * Treatment of gravity and fluid physical properties
419 * Initialize reference pressure and temperature if present
420 *----------------------------------------------------------------------------*/
421
422void
424
425/*----------------------------------------------------------------------------
426 * Determine porosity model type
427 *----------------------------------------------------------------------------*/
428
429void
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
440void
441cs_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
453void
454cs_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
465void
467
468/*----------------------------------------------------------------------------
469 * Thermal model.
470 *----------------------------------------------------------------------------*/
471
472void
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
482int
484
485/*----------------------------------------------------------------------------
486 * Time moments definition
487 *----------------------------------------------------------------------------*/
488
489void
491
492/*-----------------------------------------------------------------------------
493 * Set turbomachinery model
494 *----------------------------------------------------------------------------*/
495
496void
498
499/*-----------------------------------------------------------------------------
500 * Set turbomachinery options.
501 *----------------------------------------------------------------------------*/
502
503void
505
506/*----------------------------------------------------------------------------
507 * Turbulence model
508 *----------------------------------------------------------------------------*/
509
510void
512
513/*----------------------------------------------------------------------------
514 * Define reference length and reference velocity for the initialization of
515 * the turbulence variables
516 *----------------------------------------------------------------------------*/
517
518void
520
521/*----------------------------------------------------------------------------
522 * Logging output for MEI usage.
523 *----------------------------------------------------------------------------*/
524
525void
526cs_gui_usage_log(void);
527
528/*----------------------------------------------------------------------------
529 * Define user variables through the GUI.
530 *----------------------------------------------------------------------------*/
531
532void
534
535/*----------------------------------------------------------------------------
536 * Define user arrays through the GUI.
537 *----------------------------------------------------------------------------*/
538
539void
541
542/*----------------------------------------------------------------------------
543 * Define balance by zone through the GUI.
544 *----------------------------------------------------------------------------*/
545
546void
548
549/*----------------------------------------------------------------------------
550 * Define pressure drop through the GUI.
551 *----------------------------------------------------------------------------*/
552
553void
555
556/*----------------------------------------------------------------------------
557 * Define fans through the GUI.
558 *----------------------------------------------------------------------------*/
559
560void
562
563/*----------------------------------------------------------------------------
564 * Define error estimator through the GUI.
565 *----------------------------------------------------------------------------*/
566
567void
568cs_gui_error_estimator(int *iescal,
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
578void
579cs_gui_zones(void);
580
581/*----------------------------------------------------------------------------
582 * Define internal coupling through the GUI.
583 *----------------------------------------------------------------------------*/
584
585void
587
588/*----------------------------------------------------------------------------*/
598/*----------------------------------------------------------------------------*/
599
602 const cs_field_t *fields[],
603 const int n_fields);
604
605/*----------------------------------------------------------------------------*/
609/*----------------------------------------------------------------------------*/
610
611void
613
614/*----------------------------------------------------------------------------*/
615
617
618#endif /* __CS_GUI_H__ */
#define restrict
Definition cs_defs.h:139
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition cs_defs.h:341
#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
#define END_C_DECLS
Definition cs_defs.h:510
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition cs_defs.h:332
@ 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:2090
void uiporo(void)
Definition cs_gui.c:1894
void uiexop(void)
Definition cs_gui.c:2416
void cscpva(void)
Definition cs_gui.c:1618
void uieres(int *iescal, int *iespre, int *iesder, int *iescor, int *iestot)
Definition cs_gui.c:2814
void csiphy(void)
Definition cs_gui.c:1762
void cstime(void)
Definition cs_gui.c:1814
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:1973
void uiphyv(const int *iviscv)
Definition cs_gui.c:2261
void cscfgp(int *icfgrp)
Definition cs_gui.c:1790
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:2180
void csidtv(void)
Definition cs_gui.c:1738
void uidapp(const int *permeability, const int *diffusion, const int *unsaturated)
Definition cs_gui.c:2434
void csvvva(int *iviscv)
Definition cs_gui.c:1643
void csivis(void)
Definition cs_gui.c:1665
void cs_gui_porous_model(void)
Definition cs_gui.c:4224
void cs_gui_error_estimator(int *iescal, int *iespre, int *iesder, int *iescor, int *iestot)
Definition cs_gui.c:5220
void cs_gui_initial_conditions(void)
Apply initial conditions based on GUI-defined settings.
Definition cs_gui.c:3088
void cs_gui_equation_parameters(void)
Definition cs_gui.c:2870
void cs_gui_time_tables(void)
Read GUI defined time tables.
Definition cs_gui.c:5410
void cs_gui_pressure_drop_by_zone(void)
Definition cs_gui.c:5132
void cs_gui_checkpoint_parameters(void)
Read GUi-defined Checkpoint parameters.
Definition cs_gui.c:2834
void cs_gui_parallel_io(void)
Definition cs_gui.c:3839
void cs_gui_finalize(void)
Definition cs_gui.c:2947
cs_equation_param_t * cs_gui_get_equation_param(const char *name)
Definition cs_gui.c:2970
void cs_gui_internal_coupling(void)
Definition cs_gui.c:5279
void cs_gui_properties_value(const char *property_name, double *value)
Definition cs_gui.c:4260
void cs_gui_turb_model(void)
Definition cs_gui.c:4669
void cs_gui_time_moments(void)
Definition cs_gui.c:4463
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:4286
void cs_gui_physical_properties(void)
Definition cs_gui.c:4066
void cs_gui_user_variables(void)
Definition cs_gui.c:4848
void cs_gui_linear_solvers(void)
Definition cs_gui.c:3549
void cs_gui_scalar_model_settings(void)
Definition cs_gui.c:4321
void cs_gui_fluid_properties_value(const char *param, double *value)
Definition cs_gui.c:2993
void cs_gui_turbomachinery(void)
Definition cs_gui.c:4563
void cs_gui_numerical_options(void)
Definition cs_gui.c:3716
void cs_gui_user_arrays(void)
Definition cs_gui.c:4908
int cs_gui_thermal_model_code(void)
Definition cs_gui.c:4426
void cs_gui_zones(void)
Definition cs_gui.c:4951
void cs_gui_define_fans(void)
Definition cs_gui.c:5154
void cs_gui_balance_by_zone(void)
Definition cs_gui.c:5103
void cs_gui_usage_log(void)
Definition cs_gui.c:4820
void cs_gui_turb_ref_values(void)
Definition cs_gui.c:4781
void cs_gui_turbomachinery_rotor(void)
Definition cs_gui.c:4578
void cs_gui_partition(void)
Definition cs_gui.c:3906
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:3017
void cs_gui_mpi_algorithms(void)
Definition cs_gui.c:4002
void cs_gui_physical_constants(void)
Definition cs_gui.c:4027
void cs_gui_thermal_model(void)
Definition cs_gui.c:4382
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:5363
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