9.2
general documentation
cs_gas_mix.h
Go to the documentation of this file.
1#ifndef CS_GAS_MIX_H
2#define CS_GAS_MIX_H
3
4/*============================================================================
5 * Base gas mix data.
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2026 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_defs.h"
35
36/*----------------------------------------------------------------------------*/
37
39
40/*=============================================================================
41 * Macro definitions
42 *============================================================================*/
43
44/*============================================================================
45 * Type definitions
46 *============================================================================*/
47
48/* Gas mix types
49 ------------- */
50
51typedef enum {
52
65
66/* Gas mix descriptor
67 ------------------ */
68
69typedef struct {
70
78
79/*
80 * Gas mix modelling physical properties
81 * ------------------------------------- */
82
83typedef struct {
84
85 double mol_mas; /* molar mass */
86 double cp; /* specific heat at constant pressure */
87 double vol_dif; /* volume diffusion */
88 double mu_a; /* dynamic viscosity a */
89 double mu_b; /* dynamic viscosity a */
90 double lambda_a; /* thermal conductivity a */
91 double lambda_b; /* thermal conductivity b */
92 double muref; /* ref. viscosity for Sutherland law */
93 double lamref; /* ref. thermal conductivity for Sutherland law */
94 double trefmu; /* ref. temperature for viscosity in Sutherland law */
95 double treflam; /* ref. temperature for conductivity Sutherland law */
96 double smu; /* Sutherland temperature for viscosity */
97 double slam; /* Sutherland temperature for conductivity */
98
100
101/*============================================================================
102 * Static global variables
103 *============================================================================*/
104
105/* Pointer to main physical constants structure */
106
107extern const cs_gas_mix_t *cs_glob_gas_mix;
108
109/*=============================================================================
110 * Public function prototypes
111 *============================================================================*/
112
113/*----------------------------------------------------------------------------*/
114/*
115 * \brief Get the field key for gas mix properties.
116 *
117 * \return field key id for gas mix properties
118 */
119/*----------------------------------------------------------------------------*/
120
121int
123
124/*----------------------------------------------------------------------------*/
125/*
126 * \brief Add a species field to the gas mix (set of fields).
127 *
128 * \param[in] f_id field id of an already created scalar model field
129 */
130/*----------------------------------------------------------------------------*/
131
132void
133cs_gas_mix_add_species(int f_id);
134
135/*----------------------------------------------------------------------------*/
136/*
137 * \brief Add a species field to the gas mix (set of fields).
138 *
139 * \param[in] f_id id of field representing species mixture fraction.
140 * \param[in] mol_mass molar mass
141 * \param[in] cp specific heat
142 * \param[in] col_diff volume diffusion
143 * \param[in] mu_a dynamic viscosity a
144 * \param[in] mu_b dynamic viscosity b
145 * \param[in] lambda_a thermal conductivity a
146 * \param[in] lambda_b thermal conductivity b
147 * \param[in] mu_ref reference viscosity (Sutherland)
148 * \param[in] lambda_ref reference conductivity (Sutherland)
149 * \param[in] tref_mu reference temperature for viscosity
150 * \param[in] tref_lambda reference temperature for conductivity
151 * \param[in] s_mu Sutherland temperature for viscosity
152 * \param[in] s_lambda Sutherland temperature for conductivity
153 */
154/*----------------------------------------------------------------------------*/
155
156void
160 cs_real_t vol_diff,
161 cs_real_t mu_a,
162 cs_real_t mu_b,
163 cs_real_t lambda_a,
164 cs_real_t lambda_b,
165 cs_real_t mu_ref,
166 cs_real_t lambda_ref,
167 cs_real_t tref_mu,
168 cs_real_t tref_lambda,
169 cs_real_t s_mu,
170 cs_real_t s_lambda);
171
172/*----------------------------------------------------------------------------*/
173/*
174 * \brief Add variable fields specific to a gas mix.
175 */
176/*----------------------------------------------------------------------------*/
177
178void
180
181/*----------------------------------------------------------------------------*/
182/*
183 * \brief Add property fields specific to a gas mix.
184 */
185/*----------------------------------------------------------------------------*/
186
187void
189
190/*----------------------------------------------------------------------------*/
191/*
192 * \brief Free array mapping gas mix species ids to field ids.
193 */
194/*----------------------------------------------------------------------------*/
195
196void
198
199/*----------------------------------------------------------------------------*/
200/*
201 * \brief Initialization of calculation variables for gas mixture modelling
202 * in presence of the steam gas or another gas used as variable deduced
203 * and not solved.
204 */
205/*----------------------------------------------------------------------------*/
206
207void
209
210/*----------------------------------------------------------------------------*/
211/*
212 * \brief Fills physical properties which are variable in time
213 * for the gas mixtures modelling with or without steam
214 * inside the fluid domain. In presence of steam, this one
215 * is deduced from the noncondensable gases transported
216 * as scalars (by means of the mass fraction of each species).
217 */
218/*----------------------------------------------------------------------------*/
219
220void
222
223/*----------------------------------------------------------------------------*/
224
226
227#endif /* CS_GAS_MIX_H */
#define BEGIN_C_DECLS
Definition: cs_defs.h:528
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
#define END_C_DECLS
Definition: cs_defs.h:529
@ mol_mass
Definition: cs_field_pointer.h:170
@ cp
Definition: cs_field_pointer.h:99
void cs_gas_mix_initialization(void)
Initialization of calculation variables for gas mixture modelling in presence of the steam gas or ano...
Definition: cs_gas_mix.cpp:1356
cs_gas_mix_type_t
Definition: cs_gas_mix.h:51
@ CS_GAS_MIX_HELIUM_AIR
Definition: cs_gas_mix.h:59
@ CS_GAS_MIX_NO2_AIR
Definition: cs_gas_mix.h:61
@ CS_GAS_MIX_AIR_HELIUM
Definition: cs_gas_mix.h:54
@ CS_GAS_MIX_CO2_AIR
Definition: cs_gas_mix.h:60
@ CS_GAS_MIX_AIR_STEAM
Definition: cs_gas_mix.h:56
@ CS_GAS_MIX_AIR_HELIUM_STEAM
Definition: cs_gas_mix.h:57
@ CS_GAS_MIX_AIR_HYDROGEN
Definition: cs_gas_mix.h:55
@ CS_GAS_MIX_OFF
Definition: cs_gas_mix.h:53
@ CS_GAS_MIX_USER
Definition: cs_gas_mix.h:62
@ CS_GAS_MIX_AIR_HYDROGEN_STEAM
Definition: cs_gas_mix.h:58
void cs_gas_mix_add_property_fields(void)
Add property fields specific to a gas mix.
Definition: cs_gas_mix.cpp:802
void cs_gas_mix_finalize(void)
Free array mapping gas mix species ids to field ids.
Definition: cs_gas_mix.cpp:1341
void cs_gas_mix_physical_properties(void)
Fills physical properties which are variable in time for the gas mixtures modelling with or without s...
Definition: cs_gas_mix.cpp:937
int cs_gas_mix_get_field_key(void)
Get the field key for gas mix properties.
Definition: cs_gas_mix.cpp:577
const cs_gas_mix_t * cs_glob_gas_mix
Definition: cs_gas_mix.cpp:146
void cs_gas_mix_add_species(int f_id)
Add a species field to the gas mix (set of fields).
Definition: cs_gas_mix.cpp:612
void cs_gas_mix_add_variable_fields(void)
Add variable fields specific to a gas mix.
Definition: cs_gas_mix.cpp:712
void cs_gas_mix_add_species_with_properties(int f_id, cs_real_t mol_mass, cs_real_t cp, cs_real_t vol_diff, cs_real_t mu_a, cs_real_t mu_b, cs_real_t lambda_a, cs_real_t lambda_b, cs_real_t mu_ref, cs_real_t lambda_ref, cs_real_t tref_mu, cs_real_t tref_lambda, cs_real_t s_mu, cs_real_t s_lambda)
Add a species field to the gas mix (set of fields).
Definition: cs_gas_mix.cpp:659
Definition: cs_gas_mix.h:83
double muref
Definition: cs_gas_mix.h:92
double vol_dif
Definition: cs_gas_mix.h:87
double lambda_a
Definition: cs_gas_mix.h:90
double smu
Definition: cs_gas_mix.h:96
double lamref
Definition: cs_gas_mix.h:93
double trefmu
Definition: cs_gas_mix.h:94
double mol_mas
Definition: cs_gas_mix.h:85
double mu_b
Definition: cs_gas_mix.h:89
double cp
Definition: cs_gas_mix.h:86
double treflam
Definition: cs_gas_mix.h:95
double lambda_b
Definition: cs_gas_mix.h:91
double mu_a
Definition: cs_gas_mix.h:88
double slam
Definition: cs_gas_mix.h:97
Gas mix descriptor.
Definition: cs_gas_mix.h:69
int n_species
Definition: cs_gas_mix.h:71
int * species_to_field_id
Definition: cs_gas_mix.h:74
int n_species_solved
Definition: cs_gas_mix.h:72