8.3
general documentation
Pulverized coal

The examples provided here are only concern inlet boundary conditions. Other boundary condition types are not specific to the pulverized coal model, so generic examples apply (and as usual, the GUI is recommended).

Note that turbulence variables BC's are usually computed automatically, based on definitions using cs_boundary_conditions_inlet_set_turbulence_hyd_diam or cs_boundary_conditions_inlet_set_turbulence_internsity.

This following examples show how user code con be defined in cs_user_boundary_conditions_setup, so as to define inlet properties using the high-level for non-coal-specific variables, and access the coal inlet structure definition to set the required properties.

Example 1

Secondary or tertiary air inlet, for zone 'inlet', using either the base pulverized coal model or the pulverized coal with moisture model (with Lagrangian particle tracking).

{
const cs_zone_t *z = cs_boundary_zone_by_name("inlet");
/* Inlet velocity direction based on constant vector;
value based on oxidizer mass flow rate (in kg/s);*/
cs_real_t u[] = {0, 0, 0.5};
ci->ientat = 1;
/* Oxidizer's number (1 to 3) */
ci->inmoxy = 1;
/* Oxidizer Temperature in K */
/* Turbulence variables BC's calculated based on hydraulic diameter */
/* Automatic treatment of non-user scalars */
/* Treatment of user-defined scalars */
const char *names[] = {"scalar1", "scalar2"};
for (int i = 0; i < 2; i++) {
if (eqp == nullptr)
continue;
cs_real_t val[1] = {1.0};
z->name,
val);
}
}
void cs_boundary_conditions_open_set_mass_flow_rate_by_value(const cs_zone_t *z, cs_real_t q)
Assign a constant mass flow rate to an inlet or outlet.
Definition: cs_boundary_conditions.cpp:3226
void cs_boundary_conditions_inlet_set_turbulence_hyd_diam(const cs_zone_t *zone, cs_real_t hd)
Base the inlet turbulence values on a a circular duct with smooth wall (see ref cs_turbulence_bc_ke_h...
Definition: cs_boundary_conditions.cpp:3568
void cs_boundary_conditions_open_set_velocity_by_value(const cs_zone_t *z, const cs_real_t u[3])
Assign a constant velocity to an open (inlet/outlet) boundary.
Definition: cs_boundary_conditions.cpp:3039
const cs_zone_t * cs_boundary_zone_by_name(const char *name)
Return a pointer to a boundary zone based on its name if present.
Definition: cs_boundary_zone.cpp:711
cs_coal_bc_inlet_t * cs_coal_boundary_conditions_get_inlet(const cs_zone_t *zone)
Return pointer to coal boundary conditions inlet structure.
Definition: cs_coal_boundary_conditions.cpp:265
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
cs_equation_param_t * cs_equation_param_by_name(const char *eqname)
Return the cs_equation_param_t structure associated to a cs_equation_t structure based on the equatio...
Definition: cs_equation.cpp:600
cs_xdef_t * cs_equation_add_bc_by_value(cs_equation_param_t *eqp, const cs_param_bc_type_t bc_type, const char *z_name, cs_real_t *values)
Define and initialize a new structure to set a boundary condition related to the given equation struc...
Definition: cs_equation_param.cpp:2337
@ CS_BC_DIRICHLET
Definition: cs_param_types.h:484
const double cs_physical_constants_celsius_to_kelvin
Definition: cs_physical_constants.cpp:449
double precision, dimension(:,:,:), allocatable u
Definition: atimbr.f90:112
Inlet definition for pulverized coal combustion.
Definition: cs_coal_boundary_conditions.h:60
cs_real_t t_air
Definition: cs_coal_boundary_conditions.h:77
int ientat
Definition: cs_coal_boundary_conditions.h:64
int inmoxy
Definition: cs_coal_boundary_conditions.h:66
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:192
Definition: cs_zone.h:55
const char * name
Definition: cs_zone.h:57

Example 2

Primary air and coal inlet, for zone 'primary_inlet'.

{
const cs_zone_t *z = cs_boundary_zone_by_name("primary_inlet");
/* Inlet velocity direction based on constant vector;
value based on oxidizer mass flow rate (in kg/s);*/
cs_real_t u[] = {0, 0, 0.5};
(z, 1.46e-03);
/* Turbulence variables BC's calculated based on hydraulic diameter */
/* Air inlet with pulverized coal */
ci->ientcp = 1;
/* Oxidizer's number (1 to 3) */
ci->inmoxy = 1;
/* Oxidizer Temperature in K */
/* code_saturne deals with ncha different coals (component of blend)
every coal is described by n_classes_per_coal[icha] class of particles
(each of them described by an inlet diameter) */
/* Treatment for the first coal */
int icha = 0;
/* Coal mass flow rate in kg/s */
ci->qimpcp[icha] = 1.46e-4;
/* Percentage mass fraction of each granulometric class */
for (int iclapc = 0; iclapc < coal->n_classes_per_coal[icha]; iclapc++) {
ci->distch[icha][iclapc] = 100.0/(double)coal->n_classes_per_coal[icha];
}
/* Inlet temperature for coal & primary air */
/* Automatic treatment of non-user scalars */
}
cs_coal_model_t * cs_glob_coal_model
Definition: cs_coal.cpp:96
void cs_coal_boundary_conditions_inlet_set_air_mass_flow_rate_by_value(const cs_zone_t *z, cs_real_t q)
Assign a constant air mass flow rate to an inlet.
Definition: cs_coal_boundary_conditions.cpp:336
int ientcp
Definition: cs_coal_boundary_conditions.h:65
cs_real_t qimpcp[CS_COMBUSTION_MAX_COALS]
Definition: cs_coal_boundary_conditions.h:68
cs_real_t timpcp[CS_COMBUSTION_MAX_COALS]
Definition: cs_coal_boundary_conditions.h:69
cs_real_t distch[CS_COMBUSTION_MAX_COALS][CS_COMBUSTION_MAX_CLASSES_PER_COAL]
Definition: cs_coal_boundary_conditions.h:75
Definition: cs_coal.h:96
int n_classes_per_coal[CS_COMBUSTION_MAX_COALS]
Definition: cs_coal.h:192