9.1
general documentation
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
78typedef enum {
79
81
84
87
90
93
96
99
102
105
109
113
117
121
125
129
133
137
141
145
147
150typedef struct {
151
153 double vref;
154 double lref;
155 double ta;
156 double tstar;
157 double fmin;
158 double fmax;
159 double hmin;
160 double hmax;
161 double coeff1;
162 double coeff2;
163 double coeff3;
164
165 cs_field_t *tsc; /*< source term */
166 cs_field_t *mam; /*< molar mass */
167
175
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
197 double pcigas;
199 double xco2;
200 double xh2o;
204
207
210
213
216
219
220 /* Members specific to the gas combustion model
221 -------------------------------------------- */
222
232 int iic;
233 int iico2;
234 int iio2;
235 int isoot;
236 int ientgf;
237 int ientgb;
239 double hinfue;
240 double tinfue;
241 double tinoxy;
242 double hinoxy;
244 double xsoot;
245 double rosoot;
246 double lsp_fuel;
248 double frmel;
249 double tgf;
250 double cebu;
254
259
264
267
272
276
279
280 /* Pointers to gas combustion fields
281 ---------------------------------- */
282
283 cs_field_t *fm; /*< mixing fraction */
284 cs_field_t *fp2m; /*< mixing fraction variance */
285 cs_field_t *fsqm; /*< second moment of the mixing fraction */
286 cs_field_t *pvm; /*< transported progress variable (some SLFM variants) */
287 cs_field_t *ygfm; /*< fresh gas mass fraction */
288 cs_field_t *yfm; /*< mass fraction */
289 cs_field_t *yfp2m; /*< mass fraction variance */
290 cs_field_t *coyfp; /*< mass fraction covariance */
291
292 cs_field_t *npm; /*< soot precursor number */
293 cs_field_t *fsm; /*< soot mass fraction */
294
295 cs_field_t *xr; /*< heat loss */
296 cs_field_t *hrr; /*< heat release rate */
297 cs_field_t *omgc; /*< Omega C */
298 cs_field_t *totki; /*< total dissipation */
299 cs_field_t *recvr; /*< reconstructed fp2m */
300
301 /* fuel, oxydizer, and product mass fractions */
303
304 /* fuel, oxydizer, and product mass fractions at boundary*/
306
307 cs_field_t *t2m; /*< state variable: \f$T^2\f$ term */
308 cs_field_t *t3m; /*< state variable: \f$T^3\f$ term (radiation model) */
309 cs_field_t *t4m; /*< state variable: \f$T^4\f$ term (radiation model) */
310 cs_field_t *ckabs; /*< state variable: radiation absorption coefficient */
311
312 /* Numerical parameters
313 -------------------- */
314
315 double srrom;
321 double hstoea; /*< temperature at adiabatic stoichiometry */
322 double hh[9]; /*< tabulated stoichiometric enthalpy (size nmaxh) */
323 double ff[9]; /*< tabulated richness (size nmaxf) */
324 double tfh[9][9]; /*< tabulated richness - stoichiometric enthalpy */
325
328 double coeff_therm[7][2][5];
329
333
338 int nki;
339 int nxr;
340 int nzm;
341 int nzvar;
343 int ikimid;
349
351 char flamelet_species_name[CS_COMBUSTION_GAS_MAX_GLOBAL_SPECIES][13];
352
371
373
374/*============================================================================
375 * Global variables
376 *============================================================================*/
377
381
382/*=============================================================================
383 * Public function prototypes
384 *============================================================================*/
385
386/*----------------------------------------------------------------------------*/
387/*
388 * \brief Activate gas combustion model.
389 *
390 * \return pointer to gas combustion model structure.
391 *
392 * \param[in] type gas combustion model type
393 */
394/*----------------------------------------------------------------------------*/
395
398
399/*----------------------------------------------------------------------------*/
405/*----------------------------------------------------------------------------*/
406
407void
409
410/*----------------------------------------------------------------------------*/
416/*----------------------------------------------------------------------------*/
417
418void
419cs_combustion_gas_set_radiation_data_file(const char *file_name);
420
421/*----------------------------------------------------------------------------*/
425/*----------------------------------------------------------------------------*/
426
427void
429
430/*----------------------------------------------------------------------------*/
434/*----------------------------------------------------------------------------*/
435
436void
438
439/*----------------------------------------------------------------------------*/
440/*
441 * \brief Print the gas combustion module options to setup.log.
442 */
443/*----------------------------------------------------------------------------*/
444
445void
447
448/*----------------------------------------------------------------------------*/
452/*----------------------------------------------------------------------------*/
453
454void
456
457/*----------------------------------------------------------------------------*/
461/*----------------------------------------------------------------------------*/
462
463void
465
466/*----------------------------------------------------------------------------*/
467/*
468 * \brief Compute molar and mass fractions of
469 * elementary species Ye, Xe (fuel, O2, CO2, H2O, N2) from
470 * global species Yg (fuel, oxidant, products).
471 *
472 * \param[in] yg global mass fraction
473 * \param[out] ye elementary mass fraction
474 * \param[out] xe elementary molar fraction
475 */
476/*----------------------------------------------------------------------------*/
477
478void
480 cs_real_t ye[],
481 cs_real_t xe[]);
482
483/*----------------------------------------------------------------------------*/
484
486
487#endif /* __CS_COMBUSTION_GAS_H__ */
#define CS_COMBUSTION_GAS_MAX_OXYDANTS
Definition: cs_combustion_gas.h:57
void cs_combustion_gas_set_radiation_data_file(const char *file_name)
Set the radiation data file name.
Definition: cs_combustion_gas.cpp:546
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:287
void cs_combustion_gas_add_variable_fields(void)
Add variable fields for gas combustion models.
Definition: cs_combustion_gas.cpp:924
void cs_combustion_gas_setup(void)
Specific setup operations for gas combustion models.
Definition: cs_combustion_gas.cpp:607
cs_combustion_gas_model_t * cs_glob_combustion_gas_model
Definition: cs_combustion_gas.cpp:173
void cs_combustion_gas_log_setup(void)
Print the gas combustion module options to setup.log.
Definition: cs_combustion_gas.cpp:810
#define CS_COMBUSTION_GAS_MAX_ATOMIC_SPECIES
Definition: cs_combustion_gas.h:54
void cs_combustion_slfm_init_library(void)
Initialize steady flamelet library.
Definition: cs_combustion_gas.cpp:570
#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:1310
void cs_combustion_gas_add_property_fields(void)
Add property fields for gas combustion models.
Definition: cs_combustion_gas.cpp:1162
void cs_combustion_gas_set_thermochemical_data_file(const char *file_name)
Set the thermochemical data file name.
Definition: cs_combustion_gas.cpp:520
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:554
double cs_real_t
Floating-point value.
Definition: cs_defs.h:357
#define END_C_DECLS
Definition: cs_defs.h:555
@ 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
int flamelet_temp2
Definition: cs_combustion_gas.h:366
double hinfue
Definition: cs_combustion_gas.h:239
int iio2
Definition: cs_combustion_gas.h:234
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:229
int flamelet_vis
Definition: cs_combustion_gas.h:364
cs_field_t * t2m
Definition: cs_combustion_gas.h:307
int flamelet_omg_c
Definition: cs_combustion_gas.h:369
double hstoea
Definition: cs_combustion_gas.h:321
cs_field_t * yfm
Definition: cs_combustion_gas.h:288
cs_field_t * t3m
Definition: cs_combustion_gas.h:308
cs_real_t * radiation_library
Definition: cs_combustion_gas.h:356
int iic
Definition: cs_combustion_gas.h:232
double tinfue
Definition: cs_combustion_gas.h:240
cs_field_t * recvr
Definition: cs_combustion_gas.h:299
double rosoot
Definition: cs_combustion_gas.h:245
cs_real_t * flamelet_library
Definition: cs_combustion_gas.h:353
int nki
Definition: cs_combustion_gas.h:338
int flamelet_xr
Definition: cs_combustion_gas.h:360
int nxr
Definition: cs_combustion_gas.h:339
cs_field_t * fm
Definition: cs_combustion_gas.h:283
cs_field_t * npm
Definition: cs_combustion_gas.h:292
int nzm
Definition: cs_combustion_gas.h:340
double pcigas
Definition: cs_combustion_gas.h:197
int n_reactions
Definition: cs_combustion_gas.h:192
int nlibvar
Definition: cs_combustion_gas.h:342
char * data_file_name
Definition: cs_combustion_gas.h:225
cs_field_t * t4m
Definition: cs_combustion_gas.h:309
int ikimid
Definition: cs_combustion_gas.h:343
int n_tab_points
Definition: cs_combustion_gas.h:195
int flamelet_temp
Definition: cs_combustion_gas.h:362
double frmel
Definition: cs_combustion_gas.h:248
double cebu
Definition: cs_combustion_gas.h:250
cs_field_t * coyfp
Definition: cs_combustion_gas.h:290
cs_field_t * ckabs
Definition: cs_combustion_gas.h:310
cs_field_t * ygfm
Definition: cs_combustion_gas.h:287
int nzvar
Definition: cs_combustion_gas.h:341
cs_real_t * rho_library
Definition: cs_combustion_gas.h:355
cs_field_t * hrr
Definition: cs_combustion_gas.h:296
cs_field_t * omgc
Definition: cs_combustion_gas.h:297
int flamelet_dt
Definition: cs_combustion_gas.h:365
char * radiation_data_file_name
Definition: cs_combustion_gas.h:226
cs_field_t * fsqm
Definition: cs_combustion_gas.h:285
cs_field_t * yfp2m
Definition: cs_combustion_gas.h:289
int flamelet_c
Definition: cs_combustion_gas.h:368
cs_field_t * pvm
Definition: cs_combustion_gas.h:286
int isoot
Definition: cs_combustion_gas.h:235
int n_atomic_species
Definition: cs_combustion_gas.h:190
cs_field_t * totki
Definition: cs_combustion_gas.h:298
cs_field_t * xr
Definition: cs_combustion_gas.h:295
int flamelet_rho
Definition: cs_combustion_gas.h:363
int flamelet_zvar
Definition: cs_combustion_gas.h:359
int n_gas_species
Definition: cs_combustion_gas.h:189
int iico2
Definition: cs_combustion_gas.h:233
double tgf
Definition: cs_combustion_gas.h:249
double hinoxy
Definition: cs_combustion_gas.h:242
double lsp_fuel
Definition: cs_combustion_gas.h:246
int mode_fp2m
Definition: cs_combustion_gas.h:348
int flamelet_zm
Definition: cs_combustion_gas.h:358
cs_field_t * fp2m
Definition: cs_combustion_gas.h:284
cs_libby_williams_params_t lw
Definition: cs_combustion_gas.h:332
double xco2
Definition: cs_combustion_gas.h:199
int flamelet_ki
Definition: cs_combustion_gas.h:361
double srrom
Definition: cs_combustion_gas.h:315
int flamelet_hrr
Definition: cs_combustion_gas.h:367
double xh2o
Definition: cs_combustion_gas.h:200
int ientgf
Definition: cs_combustion_gas.h:236
double tinoxy
Definition: cs_combustion_gas.h:241
double xsoot
Definition: cs_combustion_gas.h:244
int ientgb
Definition: cs_combustion_gas.h:237
int n_gas_fl
Definition: cs_combustion_gas.h:336
cs_field_t * fsm
Definition: cs_combustion_gas.h:293
Field descriptor.
Definition: cs_field.h:156
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 * 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
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
int n_dirac
Definition: cs_combustion_gas.h:152
double fmin
Definition: cs_combustion_gas.h:157