[help!] Empirical Reaction Rate UDF
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:
/*********************************************************** 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! |
Because the indice 'i' is not updated with each iteration.
|
Also, you must compile the UDF and not interpret. Once you compile the 'net_rxn' should be available for selection in UDF hook.
|
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! |
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 . |
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. |
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! |
I think its in the phases/interaction/reaction
|
Quote:
Have you got the answer? I am also stuck in that.Please revert:confused: |
All times are GMT -4. The time now is 06:38. |