8.3
general documentation
cs_cdo_turbulence.h
Go to the documentation of this file.
1#ifndef __CS_CDO_TURBULENCE_H__
2#define __CS_CDO_TURBULENCE_H__
3
4/*============================================================================
5 * Functions to handle the resolution of the turbulence modelling
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 * Local headers
30 *----------------------------------------------------------------------------*/
31
32#include "cs_cdo_connect.h"
33#include "cs_cdo_quantities.h"
34#include "cs_equation.h"
35#include "cs_field.h"
36#include "cs_mesh.h"
37#include "cs_property.h"
38#include "cs_time_step.h"
39#include "cs_turbulence_model.h"
40
41/*----------------------------------------------------------------------------*/
42
44
45/*============================================================================
46 * Macro definitions
47 *============================================================================*/
48
49#define CS_NAVSTO_TOTAL_VISCOSITY "total_viscosity"
50#define CS_NAVSTO_LAM_VISCOSITY "laminar_viscosity"
51#define CS_NAVSTO_TURB_VISCOSITY "turbulent_viscosity"
52
53/*============================================================================
54 * Type definitions
55 *============================================================================*/
56
64typedef struct {
65
72
80
88
94
96
103typedef struct _cs_turbulence_t cs_turbulence_t;
104
105/*============================================================================
106 * Function pointer definition
107 *============================================================================*/
108
109/*----------------------------------------------------------------------------*/
118/*----------------------------------------------------------------------------*/
119
120typedef void *
122
123/*----------------------------------------------------------------------------*/
131/*----------------------------------------------------------------------------*/
132
133typedef void *
134(cs_turb_free_context_t)(void *turb_context);
135
136/*----------------------------------------------------------------------------*/
148/*----------------------------------------------------------------------------*/
149
150typedef void
152 const cs_cdo_connect_t *connect,
153 const cs_cdo_quantities_t *quant,
154 const cs_time_step_t *time_step,
155 cs_turbulence_t *tbs);
156
157/*----------------------------------------------------------------------------*/
167/*----------------------------------------------------------------------------*/
168
169typedef void
171 const cs_cdo_connect_t *connect,
172 const cs_cdo_quantities_t *quant,
173 const cs_time_step_t *time_step,
174 const cs_turbulence_t *tbs);
175
183
195
200
211
217
223
229
234
241 /* \var mu_t_field
242 * Field related to the turbulent viscosity
243 */
244
246
252
269 void *context;
270
276
282
288
295
302
303};
304
305/*============================================================================
306 * Public function prototypes
307 *============================================================================*/
308
309/*----------------------------------------------------------------------------*/
316/*----------------------------------------------------------------------------*/
317
320
321/*----------------------------------------------------------------------------*/
329/*----------------------------------------------------------------------------*/
330
333
334/*----------------------------------------------------------------------------*/
340/*----------------------------------------------------------------------------*/
341
342void
343cs_turbulence_free(cs_turbulence_t **p_turb_struct);
344
345/*----------------------------------------------------------------------------*/
352/*----------------------------------------------------------------------------*/
353
354void
356 cs_equation_t *mom_eq);
357
358/*----------------------------------------------------------------------------*/
369/*----------------------------------------------------------------------------*/
370
371void
373 const cs_cdo_connect_t *connect,
374 const cs_cdo_quantities_t *quant,
375 const cs_time_step_t *time_step,
376 cs_turbulence_t *tbs);
377
378/*----------------------------------------------------------------------------*/
388/*----------------------------------------------------------------------------*/
389
390void
392 const cs_cdo_connect_t *connect,
393 const cs_cdo_quantities_t *quant,
394 const cs_time_step_t *time_step,
395 cs_turbulence_t *tbs);
396
397/*----------------------------------------------------------------------------*/
406/*----------------------------------------------------------------------------*/
407
408void *
410
411/*----------------------------------------------------------------------------*/
419/*----------------------------------------------------------------------------*/
420
421void *
423
424/*----------------------------------------------------------------------------*/
436/*----------------------------------------------------------------------------*/
437
438void
440 const cs_cdo_connect_t *connect,
441 const cs_cdo_quantities_t *quant,
442 const cs_time_step_t *time_step,
443 cs_turbulence_t *tbs);
444
445
446/*----------------------------------------------------------------------------*/
457/*----------------------------------------------------------------------------*/
458
459void
461 const cs_cdo_connect_t *connect,
462 const cs_cdo_quantities_t *quant,
463 const cs_time_step_t *time_step,
464 const cs_turbulence_t *tbs);
465
466/*----------------------------------------------------------------------------*/
467
469
470#endif /* __CS_CDO_TURBULENCE_H__ */
void cs_turbulence_finalize_setup(const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step, cs_turbulence_t *tbs)
Finalize the setup of the turbulence modelling and especially the equations/properties and other rela...
Definition: cs_cdo_turbulence.cpp:478
void cs_turbulence_init_setup(cs_turbulence_t *tbs, cs_equation_t *mom_eq)
Initialize the structure managing the turbulence modelling.
Definition: cs_cdo_turbulence.cpp:390
void * cs_turb_free_k_eps_context(void *tbc)
Free the context structure related to the k-epsilon turbulence model.
Definition: cs_cdo_turbulence.cpp:726
void *() cs_turb_free_context_t(void *turb_context)
Free the context structure related to a given turbulence modelling.
Definition: cs_cdo_turbulence.h:134
void * cs_turb_init_k_eps_context(const cs_turb_model_t *tbm)
Allocate and initialize the context structure related to the k-epsilon turbulence model.
Definition: cs_cdo_turbulence.cpp:628
void cs_turbulence_free(cs_turbulence_t **p_turb_struct)
Free the structure managing the turbulence modelling.
Definition: cs_cdo_turbulence.cpp:362
void() cs_turb_compute_t(const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step, cs_turbulence_t *tbs)
Compute for the current time step the new state for the turbulence model. This means that all related...
Definition: cs_cdo_turbulence.h:151
cs_turbulence_t * cs_turbulence_create(cs_turbulence_param_t *tbp)
Allocate the structure managing the turbulence modelling.
Definition: cs_cdo_turbulence.cpp:311
void *() cs_turb_init_context_t(const cs_turb_model_t *tbm)
Allocate and initialize the context structure related to a given turbulence modelling.
Definition: cs_cdo_turbulence.h:121
void cs_turbulence_init_values(const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step, cs_turbulence_t *tbs)
Initialize the values of quantities related to a turbulence model.
Definition: cs_cdo_turbulence.cpp:595
void() cs_turb_update_t(const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step, const cs_turbulence_t *tbs)
Update properties, arrays related to the turbulent variables.
Definition: cs_cdo_turbulence.h:170
cs_turbulence_param_t * cs_turbulence_param_create(void)
Allocate the structure storing the set of parameters for the turbulence modelling.
Definition: cs_cdo_turbulence.cpp:284
void cs_turb_compute_k_eps(const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step, cs_turbulence_t *tbs)
Compute for the current time step the new state for the turbulence model. This means that all related...
Definition: cs_cdo_turbulence.cpp:827
void cs_turb_update_k_eps(const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step, const cs_turbulence_t *tbs)
Update for the current time step the new state for the turbulence model. This is used to update the t...
Definition: cs_cdo_turbulence.cpp:752
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
#define END_C_DECLS
Definition: cs_defs.h:543
Definition: mesh.f90:26
Definition: cs_cdo_turbulence.h:182
cs_property_t * mu_l
Definition: cs_cdo_turbulence.h:222
cs_turb_update_t * update
Definition: cs_cdo_turbulence.h:301
void * context
Definition: cs_cdo_turbulence.h:269
cs_turb_compute_t * compute_steady
Definition: cs_cdo_turbulence.h:294
cs_turbulence_param_t * param
Definition: cs_cdo_turbulence.h:194
cs_turb_free_context_t * free_context
Definition: cs_cdo_turbulence.h:281
cs_equation_t * mom_eq
Definition: cs_cdo_turbulence.h:199
cs_property_t * mu_t
Definition: cs_cdo_turbulence.h:228
cs_turb_init_context_t * init_context
Definition: cs_cdo_turbulence.h:275
cs_turb_compute_t * compute
Definition: cs_cdo_turbulence.h:287
cs_field_t * mu_t_field
Definition: cs_cdo_turbulence.h:245
cs_property_t * rho
Definition: cs_cdo_turbulence.h:210
cs_field_t * rij
Definition: cs_cdo_turbulence.h:251
cs_real_t * mu_tot_array
Definition: cs_cdo_turbulence.h:233
cs_property_t * mu_tot
Definition: cs_cdo_turbulence.h:216
Definition: cs_cdo_connect.h:61
Definition: cs_cdo_quantities.h:139
Main structure to handle the discretization and the resolution of an equation.
Field descriptor.
Definition: cs_field.h:131
Definition: cs_mesh.h:85
Structure associated to the definition of a property relying on the cs_xdef_t structure.
time step descriptor
Definition: cs_time_step.h:64
LES turbulence model descriptor.
Definition: cs_turbulence_model.h:276
Turbulence model general options descriptor.
Definition: cs_turbulence_model.h:127
RANS turbulence model descriptor.
Definition: cs_turbulence_model.h:195
Definition: cs_turbulence_model.h:184
Structure storing the parameters related to the resolution of the turbulence modelling....
Definition: cs_cdo_turbulence.h:64
cs_turb_les_model_t * les_param
Definition: cs_cdo_turbulence.h:87
cs_turb_ref_values_t * reference_values
Definition: cs_cdo_turbulence.h:93
cs_turb_model_t * model
Definition: cs_cdo_turbulence.h:71
cs_turb_rans_model_t * rans_param
Definition: cs_cdo_turbulence.h:79
Structure storing the parameters related to the resolution of the turbulence modelling....