8.1
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;
cs_real_t *cvar_fm = CS_F_(fm)->val;
const cs_real_t fs = cm->gas->fs[0];
/* Mean Mixture Fraction */
cs_array_real_set_scalar(n_cells, fs, cvar_fm);
/* Enthalpy */
const cs_real_t hinoxy = cm->hinoxy;
const cs_real_t hinfue = cm->gas->hinfue;
cs_real_t h_ini = hinfue*fs + hinoxy*(1.0-fs);
cs_array_real_set_scalar(n_cells, h_ini, cvar_scalt);
}
void cs_array_real_set_scalar(cs_lnum_t n_elts, cs_real_t ref_val, cs_real_t a[restrict])
Assign a constant scalar value to an array.
Definition: cs_array.c:581
cs_combustion_model_t * cs_glob_combustion_model
Definition: cs_combustion_model.c:120
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:313
@ fm
Definition: cs_field_pointer.h:127
#define CS_F_(e)
Macro used to return a field pointer by its enumerated value.
Definition: cs_field_pointer.h:51
int cs_glob_physical_model_flag[CS_N_PHYSICAL_MODEL_TYPES]
Definition: cs_physical_model.c:108
@ CS_COMBUSTION_3PT
Definition: cs_physical_model.h:58
cs_field_t * cs_thermal_model_field(void)
Definition: cs_thermal_model.c:216
real(c_double), dimension(:), pointer, save fs
Mixing rate at the stoichiometry.
Definition: ppthch.f90:147
real(c_double), pointer, save hinoxy
Definition: coincl.f90:88
real(c_double), pointer, save hinfue
Definition: coincl.f90:88
double hinfue
Definition: cs_combustion_model.h:78
double fs[CS_COMBUSTION_GAS_MAX_GLOBAL_REACTIONS]
Definition: cs_combustion_model.h:97
Definition: cs_combustion_model.h:104
cs_combustion_gas_model_t * gas
Definition: cs_combustion_model.h:106
double hinoxy
Definition: cs_combustion_model.h:140
cs_real_t * val
Definition: cs_field.h:152