7.3
general documentation
Electric arcs initialization example

Electric arcs example

Local variables to be added

The following local variables need to be defined for the examples in this section:

const cs_lnum_t n_cells = domain->mesh-> n_cells;
const cs_real_3_t *cell_cen
= (const cs_real_3_t *)domain->mesh_quantities->cell_cen;
const cs_real_t hhot = 0.4075;

Allocation

Before user initialization, work arrays lstelt must be allocated, like in basic example.

Initialization

Classical initialization:

/* Apply only at the true computation start, not on restarts */
if (domain->time_step->nt_prev > 0)
return;
/* Mass fraction = 1 for first gas, 0 for others */
int n_gasses = cs_glob_elec_properties->ngaz;
if (n_gasses > 1) {
cs_array_real_set_scalar(n_cells, 1.0, CS_FI_(ycoel, 0)->val);
for (int sp_id = 1; sp_id < n_gasses-1; sp_id++)
cs_array_real_fill_zero(n_cells, CS_FI_(ycoel, sp_id)->val);
}
/* Enthalpy = H(T0) or 0
For electric arc,
for the whole compution domain enthalpy is set to H(T) using
the model conversion function.
For Joule jeating by direct conduction,
enthalpy is set to zero, and the user will enter his H(T) function
tabulation.
*/
/* Enthaly reinitialization */
cs_real_t *cpro_t = CS_F_(t)->val;
cs_real_t *cvar_h = CS_F_(h)->val;
}
else {
false,
cpro_t,
cvar_h);
}
/* Enthalpy modification in given area */
for (cs_lnum_t i = 0; i < n_cells; i++) {
cs_real_t rayo = sqrt( cell_cen[i][0]*cell_cen[i][0]
+ cell_cen[i][1]*cell_cen[i][1]);
if (rayo <= 0.8e-3)
cvar_h[i] = hhot;
}
/* Set electric potential to 0 (real component and imaginary component -- for
Joule heating by direct conduction) */
if (CS_F_(poti) != NULL)
/* Vector potential (electric arcs, 3d) */
if (CS_F_(potva) != NULL)
cs_array_real_fill_zero(3*n_cells, CS_F_(potva)->val);