|
[Sponsors] |
September 2, 2009, 06:53 |
reaction in UDF(DEFINE_VR_RATE)
|
#1 |
New Member
hameurlaine
Join Date: Jul 2009
Posts: 27
Rep Power: 17 |
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. |
|
October 12, 2010, 07:36 |
|
#2 |
New Member
Michael McMaster
Join Date: May 2009
Posts: 29
Rep Power: 17 |
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
|
|
October 12, 2010, 13:38 |
|
#3 |
Member
Allan Walsh
Join Date: Mar 2009
Posts: 56
Rep Power: 17 |
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. |
|
October 14, 2010, 00:59 |
|
#4 |
Member
chétan
Join Date: May 2009
Location: Australia
Posts: 55
Rep Power: 17 |
Completely agree with you Allan, UDF can be useful only when you have customerised reaction rate equation.
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CFX5.7 - chemical reaction problem... | H.L. | CFX | 4 | March 25, 2009 11:33 |
combustion - reaction rates - urgent help needed | siri | Main CFD Forum | 2 | March 3, 2007 13:25 |
chemical reaction - decompostition | La S. Hyuck | CFX | 1 | May 23, 2001 01:07 |
chemical reaction - howto | Dan Sorensen | Siemens | 1 | February 21, 2000 10:20 |
turbulent mixing controlled reaction vs. chemical kinetics controlled reaction | Hyeryung NA | Main CFD Forum | 10 | November 11, 1999 04:00 |