|
[Sponsors] |
March 19, 2013, 02:49 |
[help!] Empirical Reaction Rate UDF
|
#1 |
Member
Join Date: Feb 2013
Posts: 31
Rep Power: 13 |
Dear all,
I would like to use UDF to define a empirical reaction rate, i.e. it does not have any relationship with the Arrhenius rate equation. I want to use a simplest one as a starter: rate = d[A]/dt = -[A] (a very simple exponential decay) The UDF I used is: Code:
/*********************************************************** Net Reaction Rate Example UDF ************************************************************/ #include "udf.h" DEFINE_NET_REACTION_RATE(net_rxn,c,t,particle,pressure,temp,yi,rr,jac) { int i; rr[i] = - yi[i]; } And, before and after choosing Stiff Chemistry Solver, I hook the function net_rxn. But there is no way for me to indicate it in the species model to tell FLUENT to follow this reaction rate. Any help will be much appreciated. Many thanks! |
|
March 19, 2013, 10:03 |
|
#2 |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23 |
Because the indice 'i' is not updated with each iteration.
|
|
March 19, 2013, 10:09 |
|
#3 |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23 |
Also, you must compile the UDF and not interpret. Once you compile the 'net_rxn' should be available for selection in UDF hook.
|
|
March 19, 2013, 10:23 |
|
#4 |
Member
Join Date: Feb 2013
Posts: 31
Rep Power: 13 |
Hi vasava, thanks!
I am really new to this UDF stuff. What does the "i" means? Is it related to each species or each cells? Can you show me how to loop it? I get myself MSVS express for compilation but failed. I was told that interpretation should work... I can see it in UDF hook, but after that, what should I do (after I get the "i" correct)? I mean, how to include this into in species transport reaction model? I only found those Arrhenuis parameters to be filled but can't find where to insert a UDF. Thanks again! Last edited by cinwendy; March 20, 2013 at 00:01. |
|
March 19, 2013, 10:30 |
|
#5 |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23 |
Here is an example. Its the same one from Fluent manual that you are trying to modify.
/************************************************** ********* Net Reaction Rate Example UDF ************************************************** **********/ #include "udf.h" DEFINE_NET_REACTION_RATE(net_rxn,c,t,particle,pres sure,temp,yi,rr,jac) { int i; for(i=0;i<n_spe;i++) rr[i] = 1./(real)n_spe - yi[i]; } As far as compilation is concerned, you can read this thread http://www.cfd-online.com/Forums/flu...compiling.html . |
|
March 19, 2013, 11:22 |
|
#6 |
Member
Join Date: Feb 2013
Posts: 31
Rep Power: 13 |
Hi vasava,
Now I am a bit confused. Should I use DEFINE_NET_REACTION or DEFINE_VR_REACTION? The reaction term in net_rxn looks more like the form I am interested in, but I don't have those "particle". And my understanding is that the reaction is a "volumetric" one? As for the compilation environment, I still couldn't understand those mentioned in a lot of threads (that's why I start a new one....). I am not from a very programming background. :| i will give another try again. Thanks. |
|
March 20, 2013, 01:11 |
|
#7 |
Member
Join Date: Feb 2013
Posts: 31
Rep Power: 13 |
Now I am using this
#include "udf.h" DEFINE_VR_RATE(vol_reac_rate,c,t,r,mole_weight,spe cies_mf,rate,rr_t) { real s1 = species_mf[0]; real mw1 = mole_weight[0]; *rr_t = -0.1*s1/mw1; } I interpreted it and was able to find it in function hook. But the simulation is showing me that reaction was not included (mass fraction of reactant is the same as the one without reaction). Can anyone tell me how to include this into species reaction model? Many thanks! |
|
January 9, 2015, 04:10 |
|
#8 |
New Member
Join Date: Jan 2015
Posts: 3
Rep Power: 11 |
I think its in the phases/interaction/reaction
|
|
June 14, 2017, 08:16 |
|
#9 | |
Member
Join Date: Dec 2013
Posts: 47
Rep Power: 13 |
Quote:
Have you got the answer? I am also stuck in that.Please revert |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
using rate equation for volumetric reaction | byronsmith | FLUENT | 4 | April 14, 2019 13:28 |
Volumetric Reaction Rate UDF. Inactivation of Clostridium Botulinum | Robbb | Fluent UDF and Scheme Programming | 11 | March 20, 2013 04:54 |
Heterogeneous reaction rate UDF | snh | Fluent UDF and Scheme Programming | 2 | February 23, 2013 03:15 |
reaction rate | Benfa | CFX | 0 | January 22, 2013 14:58 |
surface reaction rate plot at diffusiion limit cas | Jason | FLUENT | 1 | August 22, 2003 05:54 |