CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF code help solve reaction rate equation palm oil (https://www.cfd-online.com/Forums/fluent-udf/183769-udf-code-help-solve-reaction-rate-equation-palm-oil.html)

 zirkov February 13, 2017 10:34

UDF code help solve reaction rate equation palm oil

1 Attachment(s)
Hello everyone,

I am trying to write a UDF code to import it into Ansys Fluent.

Actually, the reason of writing a UDF code is that there is not in fluent data base palm oil namely Triglycerides for reactants and Alkanes for products.

So I have to write a UDF code.

Firstly, I have already a udf code (DEFINE_PROPERTY) for chemical properties for each triglycerides, each alkanes and some fatty acids like density, conductivity, specific heat capacity, viscosity ect..

I am here to help me how to write the reaction kinetic rate for each equation. I need to find the rate k1 to k8 reactions. For each reactant and each product, I don't have the concentration.

I have found a UDF example but I'd like to know if it's a good example to take for writing a UDF code with my case (palm oil)

#include "udf.h"

#define K1 2.0e-2
#define K2 5.

DEFINE_VR_RATE(vol_reac_rate, c, t, r, mole_weight, species_mf, rate, rr_t)
{
real s1 = species_mf[0];
real mw1 = mole_weight[0];

*rate = K1*s1/pow((1.+K2*s1),2.0)/mw1;
else
*rate = 0.;

*rr_t = *rate;
}

I have sent in attachment a file with my kinetic equation reaction.

Is it possible to use the previous code UDF for my case, otherwise do you have any idea ?

Thank you for your help.

 All times are GMT -4. The time now is 09:55.