## Fluids

#### How is the heat of reaction calculated for the multiple surface reactions model?

• Jeroen
Subscriber

I have made a model for a custom particle surface reaction using the multiple surface reactions model with a UDF. Now the heat of reaction for this particle surface reaction is given by:

• Stephen Orlando
Ansys Employee
Hi,nCan you copy and paste your UDF in a reply so that we can have a look? You might want to look at the section 2.2.1. DEFINE_ADJUST in the UDF section of the Fluent Customization Manual which shows how to compute a volume integral in a udf.nThanks,nSteven
• Jeroen
Subscriber
Hi steve, here is the UDF i am currently using. It returns a reaction rate (in kg/s) for a particle. Fluent uses this reaction rate to determine the heat of reaction which should be calculated according to the equation mentioned in my previous post. However, it does not seem to take the integral term into account. This is also something this UDF cannot return (as far as I am aware).n#include udf.hn#include dpm.hn#include stdlib.hnnnDEFINE_PR_RATE(reduction_rate, c, t, r, mw, pp, tp, sf, dif_i, cat_i, rr)n{nntcphase_state_t *c0 = &(tp->cphase[0]); /* cell information of particle location */nntMaterial *mat = THREAD_MATERIAL(t);ntint ind_H2O = mixture_specie_index(mat, h2o); /* get steam index */ntint ind_H2 = mixture_specie_index(mat, h2);  /* get hydrogen index */nntint atm = 101325;        /* atmospheric pressure [Pa] */ntreal T_c = c0->temp;       /* cell temperature [K] */ntreal T_p = TP_T(tp);ttt /* particle temperature [K] */ntreal pp_H2O = pp[ind_H2O] / atm; /* partial pressure steam [atm] */ntreal pp_H2 = pp[ind_H2] / atm;  /* partial pressure hydrogen [atm] */nntreal E_act;ntreal k0;ntint s;ntint n1;ntint n2;nntif (TP_INIT_RHO(tp) == 5150)nt{nttE_act = 214000;nttk0 = 4.41e7;ntts = 0;nttn1 = 2;nttn2 = 3;nt}ntelsent{nttn1 = 3;nttn2 = 4;nttif (T_p >= 1623.15)ntt{ntttE_act = 170000;ntttk0 = 2.5e7;nttts = -1;ntt}nttelsentt{ntttE_act = 193000;ntttk0 = 8.65e6;nttts = 0;ntt}nt}nnt/*************nt Calculationsnt**************/ntreal K = -4.053E-7 * pow((T_p - 273.15), 2) + 0.001404 * (T_p - 273.15) - 0.3145; /* Equilibrium constant */nntfloat molMass1 = 55.845 / 1000;tttttntfloat molMass2 = 15.9994 / 1000;ttttntreal molMass3 = n1 * molMass1 + n2 * molMass2;nntreal mp_t = TP_MASS(tp);ttt /* total particle mass [kg] (at current time) */ntreal mp_i = TP_INIT_MASS(tp);tt /* initial particle mass [kg] (at injection) */nntreal W_oi = (n2 * molMass2) / (molMass3);ttttttttttttttttttt /* initial mass fraction of 2 */ntreal X0 = (mp_i - mp_t) / (mp_i * W_oi);tttttttttttttttttttt /* current conversion degree */ntreal Dp_mu = TP_DIAM(tp)*pow(10, 6);ttttttttttttttttttttt /* particle diameter in mu */ntreal dXdt = k0 * exp(-E_act / (UNIVERSAL_GAS_CONSTANT / 1000 * T_p)) * (pp_H2 - (pp_H2O / K)) * (1 - X0) * pow(Dp_mu, s); /* increase in conversion degree */ntreal dmdt = dXdt * mp_i * W_oi;ttttttttttttttttttttttt /* change in particle mass [kg/s] */nnt*rr = -dmdt / (n2 * molMass2) * molMass3;t/* reaction rate */n}n
• DrAmine
Ansys Employee
Please check if the material used for Multiple Surface Reaction are correct regarding the SSE.n