9.1
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-2025 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 "base/cs_base.h"
35#include "base/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
141
143
144/* Pointer to main LES balance structure */
146
147/*=============================================================================
148 * Public function prototypes
149 *============================================================================*/
150
151/*----------------------------------------------------------------------------
152 * Create fields used in LES balance computation
153 *----------------------------------------------------------------------------*/
154
155void
157
158/*----------------------------------------------------------------------------
159 * Provide access to cs_glob_les_balance.
160 *
161 * returns:
162 * pointer to LES balance global structure
163 *----------------------------------------------------------------------------*/
164
167
168/*----------------------------------------------------------------------------
169 * Create a LES balance descriptor.
170 *----------------------------------------------------------------------------*/
171
172void
174
175/*----------------------------------------------------------------------------
176 * Update gradients needed in LES balance
177 *----------------------------------------------------------------------------*/
178
179void
181
182/*----------------------------------------------------------------------------
183 * Compute Rij LES balance.
184 *----------------------------------------------------------------------------*/
185
186void
188
189/*----------------------------------------------------------------------------
190 * Compute Tui LES balance.
191 *----------------------------------------------------------------------------*/
192
193void
195
196/*----------------------------------------------------------------------------
197 * Write the LES balance structure in the auxiliary restart file.
198 *----------------------------------------------------------------------------*/
199
200void
202
203/*----------------------------------------------------------------------------
204 * Destroy the LES balance structure.
205 *----------------------------------------------------------------------------*/
206
207void
209
210/*----------------------------------------------------------------------------
211 * Active the LES balance module.
212 *
213 * parameters:
214 * type_flag --> mask of LES balance type
215 * frequency_n --> balance computing frequency in time-steps
216 *----------------------------------------------------------------------------*/
217
218void
219cs_les_balance_activate(int type_flag,
220 int frequency_n);
221
222/*----------------------------------------------------------------------------
223 * Compute the LES balance
224 *----------------------------------------------------------------------------*/
225
226void
228
229/*----------------------------------------------------------------------------*/
230
232
233#endif /* __CS_LES_BALANCE_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:554
double cs_real_t
Floating-point value.
Definition: cs_defs.h:357
cs_real_t cs_real_69_t[6][9]
Definition: cs_defs.h:393
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:374
cs_real_t cs_real_6_t[6]
vector of 6 floating-point values
Definition: cs_defs.h:376
#define END_C_DECLS
Definition: cs_defs.h:555
void cs_les_balance_create_fields(void)
Definition: cs_les_balance.cpp:2887
void cs_les_balance_compute_rij(void)
Compute Rij LES balance.
Definition: cs_les_balance.cpp:3067
cs_les_balance_t * cs_glob_les_balance
Definition: cs_les_balance.cpp:264
void cs_les_balance_create(void)
Create a LES balance descriptor.
Definition: cs_les_balance.cpp:2969
void cs_les_balance_activate(int type_flag, int frequency_n)
Active the LES balance module.
Definition: cs_les_balance.cpp:4132
void cs_les_balance_write_restart(void)
Write the LES balance structure in the LES balance restart file.
Definition: cs_les_balance.cpp:4080
void cs_les_balance_update_gradients(void)
Update gradients needed in LES balance.
Definition: cs_les_balance.cpp:3055
void cs_les_balance_compute(void)
Compute the LES balance for Tui or Rij.
Definition: cs_les_balance.cpp:4149
void cs_les_balance_finalize(void)
Destroy the LES balance structure.
Definition: cs_les_balance.cpp:4112
cs_les_balance_t * cs_get_glob_les_balance(void)
Provide access to cs_glob_les_balance.
Definition: cs_les_balance.cpp:2957
void cs_les_balance_compute_tui(void)
Compute Tui LES balance.
Definition: cs_les_balance.cpp:3511
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
cs_real_t t_start
Definition: cs_les_balance.h:138
int nt_start
Definition: cs_les_balance.h:136
int frequency_n
Definition: cs_les_balance.h:140
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