CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   reaction in UDF(DEFINE_VR_RATE) (

louiza September 2, 2009 05:53

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"

/*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 */
/* Message("Unknown Reaction\n"); */
/* Message("Actual Reaction: %s\n",r->name); */


Thank you.

elmcmaster October 12, 2010 06:36

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

Allan Walsh October 12, 2010 12:38

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.

coalgas October 13, 2010 23:59

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 01:52.