8.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-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_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
72typedef struct {
73
74 /* Working arrays */
87
89
90/* Tui LES balance structure */
91/*---------------------------*/
92
93typedef struct {
94
95 /* Field id */
96 int f_id;
97
98 /* Working arrays */
120
122
123/* LES balance structure */
124/*-----------------------*/
125
126typedef 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
151void
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
168void
170
171/*----------------------------------------------------------------------------
172 * Update gradients needed in LES balance
173 *----------------------------------------------------------------------------*/
174
175void
177
178/*----------------------------------------------------------------------------
179 * Compute Rij LES balance.
180 *----------------------------------------------------------------------------*/
181
182void
184
185/*----------------------------------------------------------------------------
186 * Compute Tui LES balance.
187 *----------------------------------------------------------------------------*/
188
189void
191
192/*----------------------------------------------------------------------------
193 * Write the LES balance structure in the auxiliary restart file.
194 *----------------------------------------------------------------------------*/
195
196void
198
199/*----------------------------------------------------------------------------
200 * Destroy the LES balance structure.
201 *----------------------------------------------------------------------------*/
202
203void
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
214void
215cs_les_balance_activate(int type_flag,
216 int frequency_n);
217
218/*----------------------------------------------------------------------------
219 * Compute the LES balance
220 *----------------------------------------------------------------------------*/
221
222void
224
225/*----------------------------------------------------------------------------*/
226
228
229#endif /* __CS_LES_BALANCE_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
cs_real_t cs_real_69_t[6][9]
Definition: cs_defs.h:378
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:359
cs_real_t cs_real_6_t[6]
vector of 6 floating-point values
Definition: cs_defs.h:361
#define END_C_DECLS
Definition: cs_defs.h:543
void cs_les_balance_create_fields(void)
Definition: cs_les_balance.cpp:2670
void cs_les_balance_compute_rij(void)
Compute Rij LES balance.
Definition: cs_les_balance.cpp:2848
cs_les_balance_t * cs_glob_les_balance
Definition: cs_les_balance.cpp:231
void cs_les_balance_create(void)
Create a LES balance descriptor.
Definition: cs_les_balance.cpp:2752
void cs_les_balance_activate(int type_flag, int frequency_n)
Active the LES balance module.
Definition: cs_les_balance.cpp:3858
void cs_les_balance_write_restart(void)
Write the LES balance structure in the LES balance restart file.
Definition: cs_les_balance.cpp:3806
void cs_les_balance_update_gradients(void)
Update gradients needed in LES balance.
Definition: cs_les_balance.cpp:2836
void cs_les_balance_compute(void)
Compute the LES balance for Tui or Rij.
Definition: cs_les_balance.cpp:3875
void cs_les_balance_finalize(void)
Destroy the LES balance structure.
Definition: cs_les_balance.cpp:3838
cs_les_balance_t * cs_get_glob_les_balance(void)
Provide access to cs_glob_les_balance.
Definition: cs_les_balance.cpp:2740
void cs_les_balance_compute_tui(void)
Compute Tui LES balance.
Definition: cs_les_balance.cpp:3282
Reynolds tensor (Rij) LES balance descriptor.
Definition: cs_les_balance.h:72
cs_real_6_t * convij
Definition: cs_les_balance.h:83
cs_real_6_t * prodij
Definition: cs_les_balance.h:77
cs_real_6_t * difftij
Definition: cs_les_balance.h:80
cs_real_6_t * difflamij
Definition: cs_les_balance.h:84
cs_real_t * smagp2
Definition: cs_les_balance.h:76
cs_real_69_t * budsgsfullij
Definition: cs_les_balance.h:86
cs_real_6_t * unstij
Definition: cs_les_balance.h:82
cs_real_6_t * budsgsij
Definition: cs_les_balance.h:85
cs_real_6_t * phiij
Definition: cs_les_balance.h:78
cs_real_6_t * difftpij
Definition: cs_les_balance.h:81
cs_real_t * pp2
Definition: cs_les_balance.h:75
cs_real_6_t * epsij
Definition: cs_les_balance.h:79
LES balance general options descriptor.
Definition: cs_les_balance.h:126
int frequency_n
Definition: cs_les_balance.h:136
cs_les_balance_tui_t ** btui
Definition: cs_les_balance.h:130
int type
Definition: cs_les_balance.h:134
cs_les_balance_rij_t * brij
Definition: cs_les_balance.h:128
int i_les_balance
Definition: cs_les_balance.h:132
Turbulent thermal flux vector (Tui) LES balance descriptor.
Definition: cs_les_balance.h:93
cs_real_3_t * epsti
Definition: cs_les_balance.h:112
cs_real_t * unstvar
Definition: cs_les_balance.h:99
cs_real_3_t * difftti
Definition: cs_les_balance.h:113
cs_real_t * epsvar
Definition: cs_les_balance.h:102
int f_id
Definition: cs_les_balance.h:96
cs_real_3_t * convti
Definition: cs_les_balance.h:115
cs_real_t * difflamvar
Definition: cs_les_balance.h:105
cs_real_t * prodvar
Definition: cs_les_balance.h:101
cs_real_t * convvar
Definition: cs_les_balance.h:104
cs_real_3_t * difflamti
Definition: cs_les_balance.h:116
cs_real_3_t * unstti
Definition: cs_les_balance.h:108
cs_real_3_t * tpuip
Definition: cs_les_balance.h:107
cs_real_3_t * diffttpi
Definition: cs_les_balance.h:114
cs_real_3_t ** budsgstuifull
Definition: cs_les_balance.h:119
cs_real_t * tptp
Definition: cs_les_balance.h:100
cs_real_3_t * prodtTi
Definition: cs_les_balance.h:110
cs_real_t * difftvar
Definition: cs_les_balance.h:103
cs_real_3_t * prodtUi
Definition: cs_les_balance.h:109
cs_real_3_t * budsgstui
Definition: cs_les_balance.h:117
cs_real_6_t * budsgsvarfull
Definition: cs_les_balance.h:118
cs_real_3_t * phiti
Definition: cs_les_balance.h:111
cs_real_t * budsgsvar
Definition: cs_les_balance.h:106