CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

How to get the current cell and thread inform when using DEFINE_NET_REACTION_RATE

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By malcolmcheong

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 12, 2015, 11:19
Question 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
malcolmcheong is on a distinguished road
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.
Ety likes this.
malcolmcheong is offline   Reply With Quote

Old   March 12, 2015, 11:27
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
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)
So the reaction rate function does give the information. Which version are you using?
pakk is offline   Reply With Quote

Old   March 12, 2015, 12:01
Default
  #3
New Member
 
Join Date: Dec 2012
Posts: 4
Rep Power: 14
malcolmcheong is on a distinguished road
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?
malcolmcheong is offline   Reply With Quote

Old   August 13, 2015, 09:13
Default
  #4
New Member
 
Join Date: Aug 2015
Posts: 1
Rep Power: 0
loop is on a distinguished road
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...
loop is offline   Reply With Quote

Old   December 5, 2016, 05:24
Default
  #5
New Member
 
aslan nazari
Join Date: May 2016
Posts: 8
Rep Power: 10
Aslan_nzr is on a distinguished road
Hello everybody

Did anyone succeed in rewriting the EDC default model by udf?!!
Aslan_nzr is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 18:39.