reaction in UDF(DEFINE_VR_RATE)
Hello everybody,
How do I write the reaction in the UDF,for example reaction: Ar + e -> Ar + + 2e (1),(k1 = 2 * 10-7 = reaction rate) /************************************************** ******************* Multiple reaction UDF that specifies different reaction rates for different volumetric chemical reactions ************************************************** ********************/ #include "udf.h" DEFINE_VR_RATE(myrate,c,t,r,mw,yi,rr,rr_t) { /*If more than one reaction is defined, it is necessary to distinguish between these using the names of the reactions. */ if (!strcmp(r->name, "reaction-1")) { /* Reaction 1 */ } else if (!strcmp(r->name, "reaction-2")) { /* Reaction 2 */ } else { /* Message("Unknown Reaction\n"); */ } /* Message("Actual Reaction: %s\n",r->name); */ } Thank you. |
Hi louiza, im doing something similar, just fill in the rate expressions for each part , though mine is working its not working correctly yet, ill get back to you if i find out
|
I'm not clear why you are using a UDF to describe this reaction and not just the built-in Fluent reacting model. You would use an Arrhenius type expression where the Energy of Activation is zero and the pre-exponenential factor is your rate constant (assuming you want the rate as shown). The stoichiometric exponent could also be zero. Make sure that you convert the units for your expression to match those used in Fluent and then check that the calculated rate matches a simple hand-calculation.
If your reaction is different than shown, you could invest a week or so of time and write the UDF. |
Completely agree with you Allan, UDF can be useful only when you have customerised reaction rate equation.
|
All times are GMT -4. The time now is 21:05. |