6.3
general documentation
cs_les_balance.h
Go to the documentation of this file.
1 #ifndef __CS_LES_BALANCE_H__
2 #define __CS_LES_BALANCE_H__
3 
4 /*============================================================================
5  * Filters for dynamic models.
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2020 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_defs.h"
36 
37 /*----------------------------------------------------------------------------*/
38 
40 
41 /*============================================================================
42  * Macro definitions
43  *============================================================================*/
44 
45 /* LES balance type masks */
46 
48 #define CS_LES_BALANCE_RIJ (1 << 0)
49 
51 #define CS_LES_BALANCE_RIJ_BASE (1 << 1)
52 
54 #define CS_LES_BALANCE_RIJ_FULL (1 << 2)
55 
57 #define CS_LES_BALANCE_TUI (1 << 3)
58 
60 #define CS_LES_BALANCE_TUI_BASE (1 << 4)
61 
63 #define CS_LES_BALANCE_TUI_FULL (1 << 5)
64 
65 /*============================================================================
66  * Type definition
67  *============================================================================*/
68 
69 /* Rij LES balance structure */
70 /*---------------------------*/
71 
72 typedef struct {
73 
74  /* Working arrays */
87 
89 
90 /* Tui LES balance structure */
91 /*---------------------------*/
92 
93 typedef struct {
94 
95  /* Field id */
96  int f_id;
97 
98  /* Working arrays */
120 
122 
123 /* LES balance structure */
124 /*-----------------------*/
125 
126 typedef struct {
127 
129 
131 
133 
134  int type;
135 
137 
139 
140 /* Pointer to main LES balance structure */
142 
143 /*=============================================================================
144  * Public function prototypes
145  *============================================================================*/
146 
147 /*----------------------------------------------------------------------------
148  * Create fields used in LES balance computation
149  *----------------------------------------------------------------------------*/
150 
151 void
153 
154 /*----------------------------------------------------------------------------
155  * Provide access to cs_glob_les_balance.
156  *
157  * returns:
158  * pointer to LES balance global structure
159  *----------------------------------------------------------------------------*/
160 
163 
164 /*----------------------------------------------------------------------------
165  * Create a LES balance descriptor.
166  *----------------------------------------------------------------------------*/
167 
168 void
170 
171 /*----------------------------------------------------------------------------
172  * Update gradients needed in LES balance
173  *----------------------------------------------------------------------------*/
174 
175 void
177 
178 /*----------------------------------------------------------------------------
179  * Compute Rij LES balance.
180  *----------------------------------------------------------------------------*/
181 
182 void
184 
185 /*----------------------------------------------------------------------------
186  * Compute Tui LES balance.
187  *----------------------------------------------------------------------------*/
188 
189 void
191 
192 /*----------------------------------------------------------------------------
193  * Write the LES balance structure in the auxiliary restart file.
194  *----------------------------------------------------------------------------*/
195 
196 void
198 
199 /*----------------------------------------------------------------------------
200  * Destroy the LES balance structure.
201  *----------------------------------------------------------------------------*/
202 
203 void
205 
206 /*----------------------------------------------------------------------------
207  * Active the LES balance module.
208  *
209  * parameters:
210  * type_flag --> mask of LES balance type
211  * frequency_n --> balance computing frequency in time-steps
212  *----------------------------------------------------------------------------*/
213 
214 void
215 cs_les_balance_activate(int type_flag,
216  int frequency_n);
217 
218 /*----------------------------------------------------------------------------
219  * Compute the LES balance
220  *----------------------------------------------------------------------------*/
221 
222 void
224 
225 /*----------------------------------------------------------------------------*/
226 
228 
229 #endif /* __CS_LES_BALANCE_H__ */
cs_les_balance_tui_t::diffttpi
cs_real_3_t * diffttpi
Definition: cs_les_balance.h:114
cs_les_balance_tui_t::f_id
int f_id
Definition: cs_les_balance.h:96
cs_les_balance_tui_t::budsgstuifull
cs_real_3_t ** budsgstuifull
Definition: cs_les_balance.h:119
cs_les_balance_create_fields
void cs_les_balance_create_fields(void)
Definition: cs_les_balance.c:2651
cs_defs.h
cs_les_balance_tui_t::convvar
cs_real_t * convvar
Definition: cs_les_balance.h:104
cs_les_balance_t::frequency_n
int frequency_n
Definition: cs_les_balance.h:136
cs_les_balance_rij_t::unstij
cs_real_6_t * unstij
Definition: cs_les_balance.h:82
cs_real_69_t
cs_real_t cs_real_69_t[6][9]
Definition: cs_defs.h:334
cs_les_balance_tui_t::epsvar
cs_real_t * epsvar
Definition: cs_les_balance.h:102
cs_les_balance_t::brij
cs_les_balance_rij_t * brij
Definition: cs_les_balance.h:128
cs_real_3_t
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:317
cs_les_balance_update_gradients
void cs_les_balance_update_gradients(void)
Update gradients needed in LES balance.
Definition: cs_les_balance.c:2817
cs_les_balance_compute_tui
void cs_les_balance_compute_tui(void)
Compute Tui LES balance.
Definition: cs_les_balance.c:3261
cs_les_balance_t::i_les_balance
int i_les_balance
Definition: cs_les_balance.h:132
cs_les_balance_tui_t::difflamti
cs_real_3_t * difflamti
Definition: cs_les_balance.h:116
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:493
cs_les_balance_tui_t
Turbulent thermal flux vector (Tui) LES balance descriptor.
Definition: cs_les_balance.h:93
cs_les_balance_tui_t::difftvar
cs_real_t * difftvar
Definition: cs_les_balance.h:103
cs_les_balance_create
void cs_les_balance_create(void)
Create a LES balance descriptor.
Definition: cs_les_balance.c:2733
cs_real_t
double cs_real_t
Floating-point value.
Definition: cs_defs.h:304
cs_les_balance_rij_t::epsij
cs_real_6_t * epsij
Definition: cs_les_balance.h:79
cs_les_balance_rij_t::convij
cs_real_6_t * convij
Definition: cs_les_balance.h:83
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:492
cs_les_balance_activate
void cs_les_balance_activate(int type_flag, int frequency_n)
Active the LES balance module.
Definition: cs_les_balance.c:3836
cs_les_balance_rij_t
Reynolds tensor (Rij) LES balance descriptor.
Definition: cs_les_balance.h:72
cs_les_balance_tui_t::prodtTi
cs_real_3_t * prodtTi
Definition: cs_les_balance.h:110
cs_les_balance_tui_t::budsgsvarfull
cs_real_6_t * budsgsvarfull
Definition: cs_les_balance.h:118
cs_get_glob_les_balance
cs_les_balance_t * cs_get_glob_les_balance(void)
Provide access to cs_glob_les_balance.
Definition: cs_les_balance.c:2721
cs_les_balance_tui_t::budsgstui
cs_real_3_t * budsgstui
Definition: cs_les_balance.h:117
cs_les_balance_t
LES balance general options descriptor.
Definition: cs_les_balance.h:126
cs_les_balance_rij_t::pp2
cs_real_t * pp2
Definition: cs_les_balance.h:75
cs_les_balance_tui_t::convti
cs_real_3_t * convti
Definition: cs_les_balance.h:115
cs_les_balance_rij_t::difftpij
cs_real_6_t * difftpij
Definition: cs_les_balance.h:81
cs_les_balance_tui_t::difftti
cs_real_3_t * difftti
Definition: cs_les_balance.h:113
cs_les_balance_tui_t::tpuip
cs_real_3_t * tpuip
Definition: cs_les_balance.h:107
cs_les_balance_tui_t::difflamvar
cs_real_t * difflamvar
Definition: cs_les_balance.h:105
cs_les_balance_tui_t::phiti
cs_real_3_t * phiti
Definition: cs_les_balance.h:111
cs_les_balance_rij_t::budsgsfullij
cs_real_69_t * budsgsfullij
Definition: cs_les_balance.h:86
cs_real_6_t
cs_real_t cs_real_6_t[6]
vector of 6 floating-point values
Definition: cs_defs.h:319
cs_les_balance_rij_t::phiij
cs_real_6_t * phiij
Definition: cs_les_balance.h:78
cs_les_balance_rij_t::smagp2
cs_real_t * smagp2
Definition: cs_les_balance.h:76
cs_les_balance_tui_t::unstti
cs_real_3_t * unstti
Definition: cs_les_balance.h:108
cs_les_balance_compute
void cs_les_balance_compute(void)
Compute the LES balance for Tui or Rij.
Definition: cs_les_balance.c:3853
cs_les_balance_tui_t::unstvar
cs_real_t * unstvar
Definition: cs_les_balance.h:99
cs_les_balance_tui_t::tptp
cs_real_t * tptp
Definition: cs_les_balance.h:100
cs_glob_les_balance
cs_les_balance_t * cs_glob_les_balance
Definition: cs_les_balance.c:229
cs_les_balance_write_restart
void cs_les_balance_write_restart(void)
Write the LES balance structure in the LES balance restart file.
Definition: cs_les_balance.c:3784
cs_les_balance_tui_t::epsti
cs_real_3_t * epsti
Definition: cs_les_balance.h:112
cs_les_balance_rij_t::budsgsij
cs_real_6_t * budsgsij
Definition: cs_les_balance.h:85
cs_les_balance_rij_t::difflamij
cs_real_6_t * difflamij
Definition: cs_les_balance.h:84
cs_les_balance_tui_t::budsgsvar
cs_real_t * budsgsvar
Definition: cs_les_balance.h:106
cs_les_balance_t::type
int type
Definition: cs_les_balance.h:134
cs_les_balance_compute_rij
void cs_les_balance_compute_rij(void)
Compute Rij LES balance.
Definition: cs_les_balance.c:2829
cs_les_balance_tui_t::prodvar
cs_real_t * prodvar
Definition: cs_les_balance.h:101
cs_les_balance_t::btui
cs_les_balance_tui_t ** btui
Definition: cs_les_balance.h:130
cs_les_balance_rij_t::difftij
cs_real_6_t * difftij
Definition: cs_les_balance.h:80
cs_les_balance_finalize
void cs_les_balance_finalize(void)
Destroy the LES balance structure.
Definition: cs_les_balance.c:3816
cs_les_balance_rij_t::prodij
cs_real_6_t * prodij
Definition: cs_les_balance.h:77
cs_base.h
cs_les_balance_tui_t::prodtUi
cs_real_3_t * prodtUi
Definition: cs_les_balance.h:109