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

UDF Fluent binary diffusivity (stefan Maxwell)

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   September 19, 2011, 11:42
Default UDF Fluent binary diffusivity (stefan Maxwell)
  #1
Member
 
Nathan
Join Date: Aug 2010
Posts: 64
Rep Power: 6
natantyt is on a distinguished road
Hi

Below is my code for a binary diffusivity for a gas mixture, modified from a code that exist on Ansys costumer portal. It seems that fluent does not recognize my code at all. The code compiled and loaded perfectly. But whatever I put as a value for the binary diffusivity whether a typical chapman formula or a number, the result is shown as 1#QNBe+00!


#include"udf.h"
#define NUM_SPECIES 6
#define catalyst 2
VkH2 = 7.07;
VkCO = 18.9;
VkCO2 = 26.9;
VkC3H8 = 64;
VkH2O = 12.7;
VkN2 = 17.9;

real Vk[6]={7.07,18.9,26.9,64,12.7,17.9};
real MW[6]={2,28,44,44,18,28};
real d_m[7][7];
real diff;
real divide;
Material *m;
int a,b,alpha;
alpha=0;
int j1, j2, k, n, flag,i;




DEFINE_DIFFUSIVITY(binary_diff,c,t,i)
{


real Temp = C_T(c,t);
real Pressure = 10e5+C_P(c,t);


/* Dij matrix*/

for (a=0;a<NUM_SPECIES; ++a)
{
for (b=0;b<NUM_SPECIES;++b)
{

d_m[a][b]=pow(10,-5);
}
}
/* n = # of species, n-1 # of equations */
m=THREAD_MATERIAL(t);
flag = 0;
k = NUM_SPECIES-1;
while(flag==0)
{
divide = (i+1-k)%(n-1);
if(divide==0.0)
{
j2=k;
flag=1;
}
else
k=k-1;
}

j1=((i+1-j2)/(n-1));
diff=d_m[j1][j2];
return diff;

}

Anybody has any idea? Thank You Very Much!
natantyt is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help,I have some questions about UDF of mass diffusivity in fluent apolloking Fluent UDF and Scheme Programming 0 March 20, 2011 12:40
Fluent 6.3 pemfc module, UDS diffusivity yerem3 FLUENT 0 January 19, 2010 04:10
UDF in Fluent subha_meter Main CFD Forum 0 October 17, 2009 23:54
Compiling UDF in Fluent 12 jsm FLUENT 1 July 22, 2009 07:40
UDF of Zimont model in fluent Z Main CFD Forum 0 February 17, 2005 04:07


All times are GMT -4. The time now is 08:21.