7.3
general documentation
Gas 3 PTCHEM example
Gas 3 PTCHEM example
Initialization
The following initialization block needs to be added for the following examples:
/* If this is restarted computation, do not reinitialize values */
if
(domain->time_step->nt_prev > 0)
return
;
const
cs_lnum_t
n_cells = domain->mesh->n_cells;
const
cs_combustion_model_t
*cm =
cs_glob_combustion_model
;
cs_real_t
*cvar_fm =
CS_F_
(
fm
)->val;
cs_real_t
*cvar_scalt =
cs_thermal_model_field
()->
val
;
const
cs_real_t
fs
= cm->
gas
.
fs
[0];
/* Mean Mixture Fraction */
cs_array_real_set_scalar
(n_cells, fs, cvar_fm);
/* Enthalpy */
if
(
cs_glob_physical_model_flag
[
CS_COMBUSTION_3PT
] == 1) {
const
cs_real_t
hinoxy
= cm->
hinoxy
;
const
cs_real_t
hinfue
= cm->
fuel
.
hinfue
;
cs_real_t
h_ini = hinfue*fs + hinoxy*(1.0-
fs
);
cs_array_real_set_scalar
(n_cells, h_ini, cvar_scalt);
}
Generated on Tue Dec 20 2022 17:59:05 for code_saturne by
1.8.13