7.0
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  * Routines 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-2021 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_field.h"
35 #include "cs_mesh.h"
36 #include "cs_property.h"
37 #include "cs_time_step.h"
38 #include "cs_turbulence_model.h"
39 
40 /*----------------------------------------------------------------------------*/
41 
43 
44 /*============================================================================
45  * Macro definitions
46  *============================================================================*/
47 
48 #define CS_NAVSTO_TOTAL_VISCOSITY "total_viscosity"
49 #define CS_NAVSTO_LAM_VISCOSITY "laminar_viscosity"
50 #define CS_NAVSTO_TURB_VISCOSITY "turbulent_viscosity"
51 
52 /*============================================================================
53  * Type definitions
54  *============================================================================*/
55 
63 typedef struct {
64 
71 
79 
87 
93 
95 
96 /*============================================================================
97  * Function pointer definition
98  *============================================================================*/
99 
100 /*----------------------------------------------------------------------------*/
109 /*----------------------------------------------------------------------------*/
110 
111 typedef void *
113 
114 /*----------------------------------------------------------------------------*/
122 /*----------------------------------------------------------------------------*/
123 
124 typedef void *
125 (cs_turb_free_context_t)(void *turb_context);
126 
127 /*----------------------------------------------------------------------------*/
137 /*----------------------------------------------------------------------------*/
138 
139 typedef void
141  const cs_turbulence_param_t *tbp,
142  void *tbc);
143 
144 /*----------------------------------------------------------------------------*/
155 /*----------------------------------------------------------------------------*/
156 
157 typedef void
159  const cs_time_step_t *time_step,
160  const cs_cdo_connect_t *connect,
161  const cs_cdo_quantities_t *cdoq,
162  const cs_turbulence_param_t *tbp,
163  void *tbc);
164 
171 typedef struct {
172 
184 
195 
201 
207 
212 
219  /* \var mu_t_field
220  * Field related to the turbulent viscosity
221  */
222 
224 
230 
247  void *context;
248 
254 
260 
266 
273 
275 
276 /*============================================================================
277  * Public function prototypes
278  *============================================================================*/
279 
280 /*----------------------------------------------------------------------------*/
287 /*----------------------------------------------------------------------------*/
288 
291 
292 /*----------------------------------------------------------------------------*/
300 /*----------------------------------------------------------------------------*/
301 
304 
305 /*----------------------------------------------------------------------------*/
311 /*----------------------------------------------------------------------------*/
312 
313 void
314 cs_turbulence_free(cs_turbulence_t **p_turb_struct);
315 
316 /*----------------------------------------------------------------------------*/
322 /*----------------------------------------------------------------------------*/
323 
324 void
326 
327 /*----------------------------------------------------------------------------*/
338 /*----------------------------------------------------------------------------*/
339 
340 void
342  const cs_cdo_connect_t *connect,
343  const cs_cdo_quantities_t *quant,
344  const cs_time_step_t *time_step,
345  cs_turbulence_t *tbs);
346 
347 /*----------------------------------------------------------------------------*/
357 /*----------------------------------------------------------------------------*/
358 
359 void
361  const cs_cdo_connect_t *connect,
362  const cs_cdo_quantities_t *quant,
363  const cs_time_step_t *time_step,
364  cs_turbulence_t *tbs);
365 
366 /*----------------------------------------------------------------------------*/
375 /*----------------------------------------------------------------------------*/
376 
377 void *
379 
380 /*----------------------------------------------------------------------------*/
388 /*----------------------------------------------------------------------------*/
389 
390 void *
391 cs_turb_free_k_eps_context(void *tbc);
392 
393 /*----------------------------------------------------------------------------*/
403 /*----------------------------------------------------------------------------*/
404 
405 void
406 cs_turb_compute_k_eps(const cs_mesh_t *mesh,
407  const cs_turbulence_param_t *tpb,
408  void *tbc);
409 
410 /*----------------------------------------------------------------------------*/
411 
413 
414 #endif /* __CS_CDO_TURBULENCE_H__ */
cs_turb_compute_t * compute
Definition: cs_cdo_turbulence.h:265
void * context
Definition: cs_cdo_turbulence.h:247
cs_property_t * mu_l
Definition: cs_cdo_turbulence.h:200
time step descriptor
Definition: cs_time_step.h:64
void cs_turb_compute_k_eps(const cs_mesh_t *mesh, const cs_turbulence_param_t *tpb, void *tbc)
Compute for the current time step the new state for the turbulence model. This means that all related...
Definition: cs_cdo_turbulence.c:636
void *() cs_turb_free_context_t(void *turb_context)
Free the context structure related to a given turbulence modelling.
Definition: cs_cdo_turbulence.h:125
cs_turbulence_t * cs_turbulence_create(cs_turbulence_param_t *tbp)
Allocate the structure managing the turbulence modelling.
Definition: cs_cdo_turbulence.c:216
Structure storing the parameters related to the resolution of the tubulence modelling. Several members are structures defined in cs_turbulence_model.h.
Definition: cs_cdo_turbulence.h:171
Field descriptor.
Definition: cs_field.h:125
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:112
void cs_turbulence_free(cs_turbulence_t **p_turb_struct)
Free the structure managing the turbulence modelling.
Definition: cs_cdo_turbulence.c:259
#define BEGIN_C_DECLS
Definition: cs_defs.h:495
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.c:366
Turbulence model general options descriptor.
Definition: cs_turbulence_model.h:114
cs_turbulence_param_t * param
Definition: cs_cdo_turbulence.h:183
void cs_turbulence_initialize(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 quantities related to a turbulence model.
Definition: cs_cdo_turbulence.c:451
Definition: cs_cdo_connect.h:76
cs_field_t * rij
Definition: cs_cdo_turbulence.h:229
cs_field_t * mu_t_field
Definition: cs_cdo_turbulence.h:223
cs_turb_ref_values_t * reference_values
Definition: cs_cdo_turbulence.h:92
cs_turb_init_context_t * init_context
Definition: cs_cdo_turbulence.h:253
double cs_real_t
Floating-point value.
Definition: cs_defs.h:307
Definition: cs_turbulence_model.h:162
Definition: cs_cdo_quantities.h:124
Definition: cs_mesh.h:84
cs_property_t * mu_tot
Definition: cs_cdo_turbulence.h:194
void * cs_turb_free_k_eps_context(void *tbc)
Free the context structure related to the k-epsilon turbulence model.
Definition: cs_cdo_turbulence.c:611
void() cs_turb_update_t(const cs_mesh_t *mesh, const cs_time_step_t *time_step, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq, const cs_turbulence_param_t *tbp, void *tbc)
Update properties, arrays related to the turbulent variables.
Definition: cs_cdo_turbulence.h:158
cs_turb_model_t * model
Definition: cs_cdo_turbulence.h:70
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.c:189
RANS turbulence model descriptor.
Definition: cs_turbulence_model.h:173
Structure storing the parameters related to the resolution of the tubulence modelling. Several members are structures defined in cs_turbulence_model.h as a global variable. The prupose of this structure is to store all parameters in one place.
Definition: cs_cdo_turbulence.h:63
cs_real_t * mu_tot_array
Definition: cs_cdo_turbulence.h:211
void() cs_turb_compute_t(const cs_mesh_t *mesh, const cs_turbulence_param_t *tbp, void *tbc)
Compute for the current time step the new state for the turbulence model. This means that all related...
Definition: cs_cdo_turbulence.h:140
cs_property_t * mu_t
Definition: cs_cdo_turbulence.h:206
LES turbulence model descriptor.
Definition: cs_turbulence_model.h:242
#define END_C_DECLS
Definition: cs_defs.h:496
void cs_turbulence_init_setup(cs_turbulence_t *turb)
Initialize the structure managing the turbulence modelling.
Definition: cs_cdo_turbulence.c:286
cs_turb_les_model_t * les_param
Definition: cs_cdo_turbulence.h:86
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.c:508
cs_turb_rans_model_t * rans_param
Definition: cs_cdo_turbulence.h:78
Structure associated to the definition of a property relying on the cs_xdef_t structure.
cs_turb_update_t * update
Definition: cs_cdo_turbulence.h:272
cs_turb_free_context_t * free_context
Definition: cs_cdo_turbulence.h:259
Definition: mesh.f90:26