|
[Sponsors] |
How to get the current cell and thread inform when using DEFINE_NET_REACTION_RATE |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 12, 2015, 11:19 |
How to get the current cell and thread inform when using DEFINE_NET_REACTION_RATE
|
#1 |
New Member
Join Date: Dec 2012
Posts: 4
Rep Power: 14 |
Hello everybody!
Recently I am trying to modified the reaction rates when using the EDC model in fluent. The UDF manual of fluent shows that I can implement that by using DEFINE_NET_REACTION_RATE. And here is the example provided in the UDF manual : #include "udf.h" DEFINE_NET_REACTION_RATE(user_net_reaction_rate, p, temp, yi, rr, jac) { int i; for(i=0;i<n_spe;i++) rr[i] = 1./(real)n_spe - yi[i]; } However, in my own scheme I need to call the viscosity of the current cell and I will use the macro C_MU_L(c, t), which means I need to know the information of the current cell and thread. But this reaction rate function does not providing the information. How can I solve this problem? or how can I acquire the cell and thread information when I use DEFINE_NET_REACTION_RATE? Any suggestions will be appreciated. Thank you. |
|
March 12, 2015, 11:27 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
In my version of Fluent (v15), the macro is different:
Code:
DEFINE_NET_REACTION_RATE(net_rxn,c,t,particle,pressure,temp,yi,rr,jac) |
|
March 12, 2015, 12:01 |
|
#3 |
New Member
Join Date: Dec 2012
Posts: 4
Rep Power: 14 |
Thank you for your reply. I am using Fluent 6.3 and I have tried the new function format with cell and thread information.
Actually I am trying to implement the default EDC model using my own UDF and here is the code: #include "udf.h" DEFINE_NET_REACTION_RATE(default_edc, c, t, particle, pressure, temp, yi, rr, jac) { int i = 0; double ctau, cxi, tau, xi; //DEFINE ctau and cxi ctau = 0.4082; cxi = 2.1377; xi = cxi*pow(C_MU_L(c,t)*C_D(c,t)/(C_R(c,t)*C_K(c,t)*C_K(c,t)),0.25); tau = ctau*sqrt(C_MU_L(c,t)/(C_D(c,t)*C_R(c,t))); for(i=0;i<n_spe;i++) { rr[i] = C_R(c,t)*xi*xi/(ctau*(1. - xi*xi*xi))*(C_YI_EDC(c,t,i) - yi[i]); } } Unfortunately the code did not work. When I hook it and run the simulation primitive error occurred. Then I realize that the c and t this function passes may be different from what I need in the macros such as C_D(c, t). The c and t this function passes is for the particles, right? |
|
August 13, 2015, 09:13 |
|
#4 |
New Member
Join Date: Aug 2015
Posts: 1
Rep Power: 0 |
Hello malcolmcheong,
Did you manage to solve the problem with using the DEFINE_NET_REACTION_RATE. I am trying to use it as well and am facing similar problems. Would appreciate any suggestions... |
|
December 5, 2016, 05:24 |
|
#5 |
New Member
aslan nazari
Join Date: May 2016
Posts: 8
Rep Power: 10 |
Hello everybody
Did anyone succeed in rewriting the EDC default model by udf?!! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
udf problem | jane | Fluent UDF and Scheme Programming | 37 | February 20, 2018 05:17 |
Possible to loop a face thread inside a cell thread loop? | MarcusW | FLUENT | 3 | March 7, 2012 07:32 |
Accessing cell thread from a boundary face thread? | Vishal | FLUENT | 2 | March 21, 2006 08:29 |
thread facet cell in flunt | peter | FLUENT | 2 | September 27, 2005 23:16 |
how to connect faces(only one adjacent cell thread | BC | FLUENT | 8 | July 13, 2005 17:07 |