9.0
general documentation
Loading...
Searching...
No Matches
cs_combustion_gas.h
Go to the documentation of this file.
1#ifndef __CS_COMBUSTION_GAS_H__
2#define __CS_COMBUSTION_GAS_H__
3
4/*============================================================================
5 * Gas combustion model.
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 * Standard C library headers
32 *----------------------------------------------------------------------------*/
33
34/*----------------------------------------------------------------------------
35 * Local headers
36 *----------------------------------------------------------------------------*/
37
38#include "base/cs_defs.h"
39#include "base/cs_field.h"
41
42/*----------------------------------------------------------------------------*/
43
45
46/*============================================================================
47 * Macro definitions
48 *============================================================================*/
49
51#define CS_COMBUSTION_GAS_MAX_GLOBAL_SPECIES 25
52
54#define CS_COMBUSTION_GAS_MAX_ATOMIC_SPECIES 5
55
57#define CS_COMBUSTION_GAS_MAX_OXYDANTS 3
58
60#define CS_COMBUSTION_GAS_MAX_ELEMENTARY_COMPONENTS 20
61
63#define CS_COMBUSTION_GAS_MAX_GLOBAL_REACTIONS 1
64
66#define CS_COMBUSTION_GAS_MAX_TABULATION_POINTS 50
67
69#define CS_COMBUSTION_GAS_MAX_DIRAC 5
70
71/*============================================================================
72 * Type definitions
73 *============================================================================*/
74
76/*-----------------------*/
77
147
149
177
179/*--------------------------------------------*/
180
181typedef struct {
182
183 /* Generic members
184 ---------------
185 (keep aligned with coal combustion, so that we can
186 move to an object inheritance model in the future) */
187
191
194
196
197 double pcigas;
199 double xco2;
200 double xh2o;
201
204
207
210
213
216
219
220 /* Members specific to the gas combustion model
221 -------------------------------------------- */
222
224
225 char *data_file_name; /* Name of thermochemistry data file */
226
229
230 int iic;
231 int iico2;
232 int iio2;
233 int isoot;
234 int ientgf;
235 int ientgb;
236
237 double hinfue;
238 double tinfue;
239 double tinoxy;
240 double hinoxy;
241
242 double xsoot;
243 double rosoot;
244 double lsp_fuel;
245
246 double frmel;
247 double tgf;
248 double cebu;
249
252
257
262
265
270
274
277
278 /* Pointers to gas combustion fields
279 ---------------------------------- */
280
281 cs_field_t *fm; /*< mixing rate */
282 cs_field_t *fp2m; /*< mixing rate variance */
283 cs_field_t *fsqm; /*< second moment of the mixing rate */
284 cs_field_t *pvm; /*< transported progress variable (some SFLM variants) */
285 cs_field_t *ygfm; /*< fresh gas mass fraction */
286 cs_field_t *yfm; /*< mass fraction */
287 cs_field_t *yfp2m; /*< mass fraction variance */
288 cs_field_t *coyfp; /*< mass fraction covariance */
289
290 cs_field_t *npm; /*< soot precursor number */
291 cs_field_t *fsm; /*< soot mass fraction */
292
293 cs_field_t *xr; /*< heat loss */
294 cs_field_t *hrr; /*< heat release rate */
295 cs_field_t *omgc; /*< Omega C */
296 cs_field_t *totki; /*< total dissipation */
297 cs_field_t *recvr; /*< reconstructed fp2m */
298
299 /* fuel, oxydizer, and product mass fractions */
301
302 /* fuel, oxydizer, and product mass fractions at boundary*/
304
305 cs_field_t *t2m; /*< state variable: \f$T^2\f$ term */
306 cs_field_t *t3m; /*< state variable: \f$T^3\f$ term (radiation model) */
307 cs_field_t *t4m; /*< state variable: \f$T^4\f$ term (radiation model) */
308 cs_field_t *ckabs; /*< state variable: radiation absorption coefficient */
309
310 /* Numerical parameters
311 -------------------- */
312
313 double srrom;
316
318
319 double coeff_therm[7][2][5];
320
322
324
326
329 int nki;
330 int nxr;
331 int nzm;
332 int nzvar;
334 int ikimid;
335
340
343
345
347
348/*============================================================================
349 * Global variables
350 *============================================================================*/
351
353
355
356/*=============================================================================
357 * Public function prototypes
358 *============================================================================*/
359
360/*----------------------------------------------------------------------------*/
361/*
362 * \brief Activate gas combustion model.
363 *
364 * \return pointer to gas combustion model structure.
365 *
366 * \param[in] type gas combustion model type
367 */
368/*----------------------------------------------------------------------------*/
369
372
373/*----------------------------------------------------------------------------*/
374/*
375 * \brief Set the thermochemical data file name.
376 *
377 * \param[in] file_name name of the file.
378 */
379/*----------------------------------------------------------------------------*/
380
381void
383
384/*----------------------------------------------------------------------------*/
388/*----------------------------------------------------------------------------*/
389
390void
392
393/*----------------------------------------------------------------------------*/
394/*
395 * \brief Print the gas combustion module options to setup.log.
396 */
397/*----------------------------------------------------------------------------*/
398
399void
401
402/*----------------------------------------------------------------------------*/
406/*----------------------------------------------------------------------------*/
407
408void
410
411/*----------------------------------------------------------------------------*/
415/*----------------------------------------------------------------------------*/
416
417void
419
420/*----------------------------------------------------------------------------*/
421/*
422 * \brief Compute molar and mass fractions of
423 * elementary species Ye, Xe (fuel, O2, CO2, H2O, N2) from
424 * global species Yg (fuel, oxidant, products).
425 *
426 * \param[in] yg global mass fraction
427 * \param[out] ye elementary mass fraction
428 * \param[out] xe elementary molar fraction
429 */
430/*----------------------------------------------------------------------------*/
431
432void
434 cs_real_t ye[],
435 cs_real_t xe[]);
436
437/*----------------------------------------------------------------------------*/
438
440
441#endif /* __CS_COMBUSTION_GAS_H__ */
cs_combustion_gas_model_t * cs_glob_combustion_gas_model
Definition cs_combustion_gas.cpp:178
#define CS_COMBUSTION_GAS_MAX_OXYDANTS
Definition cs_combustion_gas.h:57
cs_combustion_gas_model_t * cs_combustion_gas_set_model(cs_combustion_gas_model_type_t type)
Activate gas combustion model.
Definition cs_combustion_gas.cpp:383
void cs_combustion_gas_add_variable_fields(void)
Add variable fields for gas combustion models.
Definition cs_combustion_gas.cpp:815
void cs_combustion_gas_setup(void)
Specific setup operations for gas combustion models.
Definition cs_combustion_gas.cpp:600
void cs_combustion_gas_log_setup(void)
Print the gas combustion module options to setup.log.
Definition cs_combustion_gas.cpp:701
#define CS_COMBUSTION_GAS_MAX_ATOMIC_SPECIES
Definition cs_combustion_gas.h:54
#define CS_COMBUSTION_GAS_MAX_DIRAC
Definition cs_combustion_gas.h:69
void cs_combustion_gas_yg2xye(const cs_real_t yg[], cs_real_t ye[], cs_real_t xe[])
Compute molar and mass fractions of elementary species Ye, Xe (fuel, O2, CO2, H2O,...
Definition cs_combustion_gas.cpp:1212
void cs_combustion_gas_add_property_fields(void)
Add property fields for gas combustion models.
Definition cs_combustion_gas.cpp:1056
void cs_combustion_gas_set_thermochemical_data_file(const char *file_name)
Set the thermochemical data file name.
Definition cs_combustion_gas.cpp:577
cs_combustion_gas_model_type_t
Definition cs_combustion_gas.h:78
@ CS_COMBUSTION_BSH_PERMEATIC
Definition cs_combustion_gas.h:92
@ CS_COMBUSTION_3PT_ADIABATIC
Definition cs_combustion_gas.h:83
@ CS_COMBUSTION_EBU_CONSTANT_PERMEATIC
Definition cs_combustion_gas.h:112
@ CS_COMBUSTION_EBU_CONSTANT_ADIABATIC
Definition cs_combustion_gas.h:108
@ CS_COMBUSTION_SLFM_STEADY_PERMEATIC
Definition cs_combustion_gas.h:98
@ CS_COMBUSTION_LW_2PEAK_PERMEATIC
Definition cs_combustion_gas.h:128
@ CS_COMBUSTION_SLFM_PROGRESS_PERMEATIC
Definition cs_combustion_gas.h:104
@ CS_COMBUSTION_LW_4PEAK_PERMEATIC
Definition cs_combustion_gas.h:144
@ CS_COMBUSTION_LW_3PEAK_PERMEATIC
Definition cs_combustion_gas.h:136
@ CS_COMBUSTION_EBU_VARIABLE_PERMEATIC
Definition cs_combustion_gas.h:120
@ CS_COMBUSTION_LW_2PEAK_ADIABATIC
Definition cs_combustion_gas.h:124
@ CS_COMBUSTION_LW_4PEAK_ADIABATIC
Definition cs_combustion_gas.h:140
@ CS_COMBUSTION_BSH_ADIABATIC
Definition cs_combustion_gas.h:89
@ CS_COMBUSTION_3PT_PERMEATIC
Definition cs_combustion_gas.h:86
@ CS_COMBUSTION_SLFM_STEADY_ADIABATIC
Definition cs_combustion_gas.h:95
@ CS_COMBUSTION_LW_3PEAK_ADIABATIC
Definition cs_combustion_gas.h:132
@ CS_COMBUSTION_GAS_NONE
Definition cs_combustion_gas.h:80
@ CS_COMBUSTION_SLFM_PROGRESS_ADIABATIC
Definition cs_combustion_gas.h:101
@ CS_COMBUSTION_EBU_VARIABLE_ADIABATIC
Definition cs_combustion_gas.h:116
#define CS_COMBUSTION_GAS_MAX_TABULATION_POINTS
Definition cs_combustion_gas.h:66
#define CS_COMBUSTION_GAS_MAX_ELEMENTARY_COMPONENTS
Definition cs_combustion_gas.h:60
#define CS_COMBUSTION_GAS_MAX_GLOBAL_SPECIES
Definition cs_combustion_gas.h:51
#define CS_COMBUSTION_GAS_MAX_GLOBAL_REACTIONS
Definition cs_combustion_gas.h:63
#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
@ CS_COMBUSTION_LW
Definition cs_physical_model.h:61
@ CS_COMBUSTION_3PT
Definition cs_physical_model.h:58
@ CS_COMBUSTION_EBU
Definition cs_physical_model.h:60
@ CS_COMBUSTION_SLFM
Definition cs_physical_model.h:59
Definition cs_combustion_gas.h:181
double wmolg[CS_COMBUSTION_GAS_MAX_GLOBAL_SPECIES]
Definition cs_combustion_gas.h:251
double oxyco2[CS_COMBUSTION_GAS_MAX_OXYDANTS]
Definition cs_combustion_gas.h:215
double hinfue
Definition cs_combustion_gas.h:237
int iio2
Definition cs_combustion_gas.h:232
cs_combustion_gas_model_type_t type
Definition cs_combustion_gas.h:223
int n_gas_el_comp
Definition cs_combustion_gas.h:188
bool use_janaf
Definition cs_combustion_gas.h:227
double oxyh2o[CS_COMBUSTION_GAS_MAX_OXYDANTS]
Definition cs_combustion_gas.h:212
cs_field_t * t2m
Definition cs_combustion_gas.h:305
cs_field_t * yfm
Definition cs_combustion_gas.h:286
cs_field_t * t3m
Definition cs_combustion_gas.h:306
double wmole[CS_COMBUSTION_GAS_MAX_ELEMENTARY_COMPONENTS]
Definition cs_combustion_gas.h:203
int iic
Definition cs_combustion_gas.h:230
double tinfue
Definition cs_combustion_gas.h:238
cs_field_t * recvr
Definition cs_combustion_gas.h:297
double rosoot
Definition cs_combustion_gas.h:243
int nki
Definition cs_combustion_gas.h:329
double eh_gas_g[CS_COMBUSTION_GAS_MAX_TABULATION_POINTS][CS_COMBUSTION_GAS_MAX_GLOBAL_SPECIES]
Definition cs_combustion_gas.h:273
int nxr
Definition cs_combustion_gas.h:330
cs_field_t * fm
Definition cs_combustion_gas.h:281
double th[CS_COMBUSTION_GAS_MAX_TABULATION_POINTS]
Definition cs_combustion_gas.h:218
cs_field_t * npm
Definition cs_combustion_gas.h:290
double coefeg[CS_COMBUSTION_GAS_MAX_GLOBAL_SPECIES][CS_COMBUSTION_GAS_MAX_ELEMENTARY_COMPONENTS]
Definition cs_combustion_gas.h:256
int nzm
Definition cs_combustion_gas.h:331
double coeff_therm[7][2][5]
Definition cs_combustion_gas.h:319
double pcigas
Definition cs_combustion_gas.h:197
int n_reactions
Definition cs_combustion_gas.h:192
int nlibvar
Definition cs_combustion_gas.h:333
char * data_file_name
Definition cs_combustion_gas.h:225
double cp_gas_g[CS_COMBUSTION_GAS_MAX_TABULATION_POINTS][CS_COMBUSTION_GAS_MAX_GLOBAL_SPECIES]
Definition cs_combustion_gas.h:269
cs_field_t * bym[CS_COMBUSTION_GAS_MAX_GLOBAL_SPECIES]
Definition cs_combustion_gas.h:303
cs_field_t * t4m
Definition cs_combustion_gas.h:307
int ikimid
Definition cs_combustion_gas.h:334
int n_tab_points
Definition cs_combustion_gas.h:195
double frmel
Definition cs_combustion_gas.h:246
double cebu
Definition cs_combustion_gas.h:248
cs_field_t * coyfp
Definition cs_combustion_gas.h:288
cs_field_t * ckabs
Definition cs_combustion_gas.h:308
cs_field_t * ygfm
Definition cs_combustion_gas.h:285
int nzvar
Definition cs_combustion_gas.h:332
cs_field_t * hrr
Definition cs_combustion_gas.h:294
cs_field_t * omgc
Definition cs_combustion_gas.h:295
cs_field_t * fsqm
Definition cs_combustion_gas.h:283
cs_field_t * yfp2m
Definition cs_combustion_gas.h:287
cs_field_t * pvm
Definition cs_combustion_gas.h:284
cs_real_t * flamelet_library_p
Definition cs_combustion_gas.h:344
int isoot
Definition cs_combustion_gas.h:233
double wmolat[CS_COMBUSTION_GAS_MAX_ATOMIC_SPECIES]
Definition cs_combustion_gas.h:206
int n_atomic_species
Definition cs_combustion_gas.h:190
cs_field_t * totki
Definition cs_combustion_gas.h:296
cs_field_t * xr
Definition cs_combustion_gas.h:293
double compog[CS_COMBUSTION_GAS_MAX_GLOBAL_SPECIES][CS_COMBUSTION_GAS_MAX_ELEMENTARY_COMPONENTS]
Definition cs_combustion_gas.h:261
int n_gas_species
Definition cs_combustion_gas.h:189
int iico2
Definition cs_combustion_gas.h:231
double tgf
Definition cs_combustion_gas.h:247
double hinoxy
Definition cs_combustion_gas.h:240
double lsp_fuel
Definition cs_combustion_gas.h:244
int mode_fp2m
Definition cs_combustion_gas.h:339
double fs[CS_COMBUSTION_GAS_MAX_GLOBAL_REACTIONS]
Definition cs_combustion_gas.h:264
cs_field_t * fp2m
Definition cs_combustion_gas.h:282
double oxyn2[CS_COMBUSTION_GAS_MAX_OXYDANTS]
Definition cs_combustion_gas.h:209
cs_libby_williams_params_t lw
Definition cs_combustion_gas.h:323
double xco2
Definition cs_combustion_gas.h:199
char flamelet_species_name[CS_COMBUSTION_GAS_MAX_GLOBAL_SPECIES][13]
Definition cs_combustion_gas.h:342
double srrom
Definition cs_combustion_gas.h:313
double xh2o
Definition cs_combustion_gas.h:200
int ientgf
Definition cs_combustion_gas.h:234
double tinoxy
Definition cs_combustion_gas.h:239
cs_field_t * ym[CS_COMBUSTION_GAS_MAX_GLOBAL_SPECIES]
Definition cs_combustion_gas.h:300
double xsoot
Definition cs_combustion_gas.h:242
int ientgb
Definition cs_combustion_gas.h:235
int n_gas_fl
Definition cs_combustion_gas.h:327
double ckabsg[CS_COMBUSTION_GAS_MAX_GLOBAL_SPECIES]
Definition cs_combustion_gas.h:276
cs_field_t * fsm
Definition cs_combustion_gas.h:291
Field descriptor.
Definition cs_field.h:158
Definition cs_combustion_gas.h:150
double lref
Definition cs_combustion_gas.h:154
double coeff1
Definition cs_combustion_gas.h:161
double vref
Definition cs_combustion_gas.h:153
cs_field_t * tscl[CS_COMBUSTION_GAS_MAX_DIRAC]
Definition cs_combustion_gas.h:173
cs_field_t * rhol[CS_COMBUSTION_GAS_MAX_DIRAC]
Definition cs_combustion_gas.h:168
cs_field_t * mam
Definition cs_combustion_gas.h:166
double coeff2
Definition cs_combustion_gas.h:162
double fmax
Definition cs_combustion_gas.h:158
cs_field_t * tsc
Definition cs_combustion_gas.h:165
cs_field_t * fmal[CS_COMBUSTION_GAS_MAX_DIRAC]
Definition cs_combustion_gas.h:171
cs_field_t * ampl[CS_COMBUSTION_GAS_MAX_DIRAC]
Definition cs_combustion_gas.h:172
cs_field_t * fmel[CS_COMBUSTION_GAS_MAX_DIRAC]
Definition cs_combustion_gas.h:170
double coeff3
Definition cs_combustion_gas.h:163
double tstar
Definition cs_combustion_gas.h:156
double hmin
Definition cs_combustion_gas.h:159
double ta
Definition cs_combustion_gas.h:155
double hmax
Definition cs_combustion_gas.h:160
cs_field_t * maml[CS_COMBUSTION_GAS_MAX_DIRAC]
Definition cs_combustion_gas.h:174
cs_field_t * teml[CS_COMBUSTION_GAS_MAX_DIRAC]
Definition cs_combustion_gas.h:169
int n_dirac
Definition cs_combustion_gas.h:152
double fmin
Definition cs_combustion_gas.h:157