9.0
general documentation
Loading...
Searching...
No Matches
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-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_defs.h"
35
36/*----------------------------------------------------------------------------*/
37
39
40/*=============================================================================
41 * Macro definitions
42 *============================================================================*/
43
44/*============================================================================
45 * Type definitions
46 *============================================================================*/
47
48/* Gas mix types
49 ------------- */
50
63
64/* Gas mix descriptor
65 ------------------ */
66
67typedef struct {
68
74
76
77/*
78 * Gas mix modelling physical properties
79 * ------------------------------------- */
80
81typedef struct {
82
83 double mol_mas; /* molar mass */
84 double cp; /* specific heat at constant pressure */
85 double vol_dif; /* volume diffusion */
86 double mu_a; /* dynamic viscosity a */
87 double mu_b; /* dynamic viscosity a */
88 double lambda_a; /* thermal conductivity a */
89 double lambda_b; /* thermal conductivity b */
90 double muref; /* ref. viscosity for Sutherland law */
91 double lamref; /* ref. thermal conductivity for Sutherland law */
92 double trefmu; /* ref. temperature for viscosity in Sutherland law */
93 double treflam; /* ref. temperature for conductivity Sutherland law */
94 double smu; /* Sutherland temperature for viscosity */
95 double slam; /* Sutherland temperature for conductivity */
96
98
99/*============================================================================
100 * Static global variables
101 *============================================================================*/
102
103/* Pointer to main physical constants structure */
104
105extern const cs_gas_mix_t *cs_glob_gas_mix;
106
107/*=============================================================================
108 * Public function prototypes
109 *============================================================================*/
110
111/*----------------------------------------------------------------------------*/
112/*
113 * \brief Get the field key for gas mix properties.
114 *
115 * \return field key id for gas mix properties
116 */
117/*----------------------------------------------------------------------------*/
118
119int
121
122/*----------------------------------------------------------------------------*/
123/*
124 * \brief Add a species field to the gas mix (set of fields).
125 *
126 * \param[in] f_id field id of an already created scalar model field
127 */
128/*----------------------------------------------------------------------------*/
129
130void
131cs_gas_mix_add_species(int f_id);
132
133/*----------------------------------------------------------------------------*/
134/*
135 * \brief Add a species field to the gas mix (set of fields).
136 *
137 * \param[in] f_id id of field representing species mixture fraction.
138 * \param[in] mol_mass molar mass
139 * \param[in] cp specific heat
140 * \param[in] col_diff volume diffusion
141 * \param[in] mu_a dynamic viscosity a
142 * \param[in] mu_b dynamic viscosity b
143 * \param[in] lambda_a thermal conductivity a
144 * \param[in] lambda_b thermal conductivity b
145 * \param[in] mu_ref reference viscosity (Sutherland)
146 * \param[in] lambda_ref reference conductivity (Sutherland)
147 * \param[in] tref_mu reference temperature for viscosity
148 * \param[in] tref_lambda reference temperature for conductivity
149 * \param[in] s_mu Sutherland temperature for viscosity
150 * \param[in] s_lambda Sutherland temperature for conductivity
151 */
152/*----------------------------------------------------------------------------*/
153
154void
158 cs_real_t vol_diff,
159 cs_real_t mu_a,
160 cs_real_t mu_b,
161 cs_real_t lambda_a,
162 cs_real_t lambda_b,
163 cs_real_t mu_ref,
164 cs_real_t lambda_ref,
165 cs_real_t tref_mu,
166 cs_real_t tref_lambda,
167 cs_real_t s_mu,
168 cs_real_t s_lambda);
169
170/*----------------------------------------------------------------------------*/
171/*
172 * \brief Add variable fields specific to a gas mix.
173 */
174/*----------------------------------------------------------------------------*/
175
176void
178
179/*----------------------------------------------------------------------------*/
180/*
181 * \brief Add property fields specific to a gas mix.
182 */
183/*----------------------------------------------------------------------------*/
184
185void
187
188/*----------------------------------------------------------------------------*/
189/*
190 * \brief Free array mapping gas mix species ids to field ids.
191 */
192/*----------------------------------------------------------------------------*/
193
194void
196
197/*----------------------------------------------------------------------------*/
198/*
199 * \brief Initialization of calculation variables for gas mixture modelling
200 * in presence of the steam gas or another gas used as variable deduced
201 * and not solved.
202 */
203/*----------------------------------------------------------------------------*/
204
205void
207
208/*----------------------------------------------------------------------------*/
209/*
210 * \brief Fills physical properties which are variable in time
211 * for the gas mixtures modelling with or without steam
212 * inside the fluid domain. In presence of steam, this one
213 * is deduced from the noncondensable gases transported
214 * as scalars (by means of the mass fraction of each species).
215 */
216/*----------------------------------------------------------------------------*/
217
218void
220
221/*----------------------------------------------------------------------------*/
222
224
225#endif /* __CS_GAS_MIX_H__ */
#define BEGIN_C_DECLS
Definition cs_defs.h:542
double cs_real_t
Floating-point value.
Definition cs_defs.h:342
#define END_C_DECLS
Definition cs_defs.h:543
@ mol_mass
Definition cs_field_pointer.h:173
@ cp
Definition cs_field_pointer.h:102
const cs_gas_mix_t * cs_glob_gas_mix
Definition cs_gas_mix.cpp:156
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:1225
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_AIR_HELIUM
Definition cs_gas_mix.h:54
@ 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:60
@ 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:746
void cs_gas_mix_finalize(void)
Free array mapping gas mix species ids to field ids.
Definition cs_gas_mix.cpp:1210
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:863
int cs_gas_mix_get_field_key(void)
Get the field key for gas mix properties.
Definition cs_gas_mix.cpp:547
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:582
void cs_gas_mix_add_variable_fields(void)
Add variable fields specific to a gas mix.
Definition cs_gas_mix.cpp:680
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:627
Definition cs_gas_mix.h:81
double muref
Definition cs_gas_mix.h:90
double vol_dif
Definition cs_gas_mix.h:85
double lambda_a
Definition cs_gas_mix.h:88
double smu
Definition cs_gas_mix.h:94
double lamref
Definition cs_gas_mix.h:91
double trefmu
Definition cs_gas_mix.h:92
double mol_mas
Definition cs_gas_mix.h:83
double mu_b
Definition cs_gas_mix.h:87
double cp
Definition cs_gas_mix.h:84
double treflam
Definition cs_gas_mix.h:93
double lambda_b
Definition cs_gas_mix.h:89
double mu_a
Definition cs_gas_mix.h:86
double slam
Definition cs_gas_mix.h:95
Gas mix descriptor.
Definition cs_gas_mix.h:67
int n_species
Definition cs_gas_mix.h:69
int * species_to_field_id
Definition cs_gas_mix.h:72
int n_species_solved
Definition cs_gas_mix.h:70