As usual, one can access any field using the field_get_val_s_by_name function. cvar_*
(iel) is the value of this variable in cell number iel
. ONLY done if there is no restart computation
pulverized_coal example
Local variables to be added
The following local variables need to be defined for the examples in this section:
Initialization
The following initialization block allows setting some variable values (variables not set here keep their GUI-defined or default values):
return;
bft_printf(
"%s: settings for pulverized coal\n", __func__);
const int ico2 = cm->
ico2 - 1;
const int ih2o = cm->
ih2o - 1;
const int in2 = cm->
in2 - 1;
const int io2 = cm->
io2 - 1;
coefe[ige] = 0.;
const int ioxy = 0;
coefe[io2] = cm->
wmole[io2] * cm->
oxyo2[ioxy ]/dmas;
coefe[in2] = cm->
wmole[in2] * cm->
oxyn2[ioxy ]/dmas;
for (
cs_lnum_t cell_id = 0; cell_id < n_cells; cell_id++)
cvar_h[cell_id] = h1init;
for (
cs_lnum_t cell_id = 0; cell_id < n_cells; cell_id++)
cvar_yco2[cell_id] = xco2;
}
for (
cs_lnum_t cell_id = 0; cell_id < n_cells; cell_id++)
cvar_nox[cell_id] = h1init;
}