CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   changing reaction rate (http://www.cfd-online.com/Forums/fluent/27395-changing-reaction-rate.html)

Arthur Valais December 1, 1999 21:52

changing reaction rate
 
Hello All,

Does anyone have any source code snippet on how to alter the volume reaction rate on a per cell basis after each time step or iteration? My guess is to use DEFINE_ADJUST and DEFINE_VR_RATE together but I'm lost after that. Any clues will be appreciated.

Arthur Valais

Joe Maruszewski December 10, 1999 11:53

Re: changing reaction rate
 
Hi,

Here's a rather silly example of how you could modify the reaction rate as a function of time. In the example, when a new time step is done the reaction rate is cut in half.

#include "udf.h"

DEFINE_VR_RATE(my_rate, c, t, r, mw, yi, rr, rr_t) { static real old_flow_time = 0.; static real specified_rr = 1.; if (RP_Get_Real("flow-time") > old_flow_time)

specified_rr /= 2.; old_flow_time = RP_Get_Real("flow-time"); *rr = specified_rr; }

If you could be more specific about what you are trying to do I may be able to provide more suggestions.

Joe


All times are GMT -4. The time now is 00:31.