Fluent-UDF_Coal-Combustion-Multipha-Flow-Process
---Codes for various kinds of heterogeneous reactions
【第二部分-Part2】
DEFINE_HET_RXN_RATE(SteamGasif_Rev_MGAS,c,t,hr,mw,yi,rr,rr_t)
laborious
{
Thread **pt = THREAD_SUB_THREADS(t);
Thread *tp = pt[0]; /* gas pha */
int index_pha = Get_Pha_Index(hr);
Thread *ts = pt[index_pha]; /* solid pha */
*rr = 0;
double direction = 0.0, mol_weight, y_carbon, rr_turb = 1e+20;
/*
CO + H2 ---> H2O + 1/25 Soot
厦门培训中心
The rever steam gasification reaction, which is CO + H2 ---> 1/25 Soot + H2O is written as the reaction
shown above. So a negative rate means CO and H2 is consumed and H2O and Soot are generated. Note that no
C(s) is generated, the stoich coeff for C(s) in the above reation is zero.
Set the pha and species indices. Ash species index is initialized to zero, with all other indices.
Ash species index is ud as a flag to execute SetSpeciesIndex only once. This is done by the first
reaction, defined in the heterogeneous reaction panel in FLUENT GUI.
concretely */
if(IS_ASH == 0)
SetSpeciesIndex();
if(MGAS_Gasif)
{
double RoRT = C_R(c,tp) * UNIVERSAL_GAS_CONSTANT * C_T(c,tp);
double p_h2o = RoRT * yi[IP_H2O][IS_H2O]/mw[IP_H2O][IS_H2O]/ 101325.;
double p_co = RoRT * yi[IP_CO][IS_CO]/mw[IP_CO][IS_CO] / 101325.;
double p_h2 = RoRT * yi[IP_H2][IS_H2]/mw[IP_H2][IS_H2] / 101325.;
y_carbon = yi[IP_SOOT][IS_SOOT];
mol_weight = mw[IP_SOOT][IS_SOOT];
if (rp_ke)
rr_turb = Turbulent_rr(c, t, hr, yi);
万圣节英文 if(C_VOF(c, ts) >= eps_s_small)
{
*rr = rr_steam_gasif(c, t, ts, tp, p_h2o, p_co, p_h2, y_carbon, mol_weight, &direction); /* mol/(cm^3 .s) */
if( direction > 0.0) /* positive value implies C(s) + H2O ---> CO + H2 */
*rr = 0.0;
john sculley
el /* negative value implies CO + H2 ---> H2O + 1/25 Soot */
{
*rr = abs(*rr);
*rr = MIN(*rr, rr_turb);
}
}
}
}
double rr_steam_gasif(cell_t c, Thread *t, Thread *ts, Thread *tp, double p_h2o, double p_co, double p_h2, double y_carbon, double mol_weight, double* direction)
{
double rate, prod, T_g = MIN((MAX(TMIN,C_T(c,tp))),TMAX);
double p_h2o_star = p_h2 * p_co / ( exp(17.29 - 16326/T_g) );
if(MGAS_Gasif) *direction = p_h2o - p_h2o_star;
if(PCCL_Gasif) *direction = pow(p_h2o, N_steam_gasification)/(1.+K_steam_gasification*p_h2);
prod = y_carbon*(C_R(c,ts)*1e-03)/mol_weight*C_VOF(c,ts); /*1e-3 is to convert density from kg/m^3 to g/cm^3 */
if(MGAS_Gasif && *direction < 0.0) /* this implies rever H2O gasification */
marangoni
prod = y_carbon*(C_R(c,tp)*1e-03)/mol_weight*C_VOF(c,tp); /*1e-3 is to convert density from kg/m^3 to g/cm^3 */
really really want
rate = A_steam_gasification*exp(-E_steam_gasification/Rgas/T_g)* Annealing_steam_gasification * prod * *direction; /* mol/cm^3.s */
rate *= 1000.; /* kmol/(m^3 .s) */
return rate;
}
DEFINE_HET_RXN_RATE(Co2Gasif,c,t,hr,mw,yi,rr,rr_t)
{
Thread **pt = THREAD_SUB_THREADS(t);
Thread *tp = pt[0]; /* gas pha */
int index_pha = Get_Pha_Index(hr);
Thread *ts = pt[index_pha]; /* solid pha */
*rr = 0;
double direction = 0.0, mol_weight, y_carbon;
/*
C(s) + CO2 ---> 2CO
time for miracles
Set the pha and species indices. Ash species index is initialized to zero, with all other indices.
Ash species index is ud as a flag to execute SetSpeciesIndex only once. This is done by the first
reaction, defined in the heterogeneous reaction panel in FLUENT GUI.
branching
*/
if(IS_ASH == 0)
SetSpeciesIndex();
double RoRT = C_R(c,tp) * UNIVERSAL_GAS_CONSTANT * C_T(c,tp);
double p_co = RoRT * yi[IP_CO][IS_CO]/mw[IP_CO][IS_CO] / 101325.;
double p_co2 = RoRT * yi[IP_CO2][IS_CO2]/mw[IP_CO2][IS_CO2] / 101325.;
SolidFuel_Reactant(c, t, hr, &y_carbon, &mol_weight);
if(C_VOF(c, ts) >= eps_s_small)
教育部雅思报名
{
*rr = rr_co2_gasif(c, t, ts, tp, p_co, p_co2, y_carbon, mol_weight, &direction); /* mol/(cm^3 .s) */
if( direction < 0.0) /* negative implies rever steam gasification */
*rr = 0.0;
}
}
DEFINE_HET_RXN_RATE(Soot_CO2_Gasif,c,t,r,mw,yi,rr,rr_t)