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

error in mass diffusivity UDF

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By ComputerGuy

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 23, 2010, 05:27
Default error in mass diffusivity UDF
  #1
New Member
 
vaibhav vashistha
Join Date: Dec 2010
Location: New-delhi
Posts: 1
Rep Power: 0
vaibhav_v is on a distinguished road
Hello all,
I wrote my first UDF for giving different mass diffusivity for different zones, but I am getting following error in interpretation:

cpp -I"C:\Fluent.Inc\fluent6.3.26/src" -I"C:\Fluent.Inc\fluent6.3.26/cortex/src" -I"C:\Fluent.Inc\fluent6.3.26/client/src" -I"C:\Fluent.Inc\fluent6.3.26/multiport/src" -I. -DUDFCONFIG_H="<udfconfig.h>" "E:\vaibhav\with_HAMP\DIFF.c"
Error: E:\vaibhav\with_HAMP\DIFF.c: line 1: parse error.

my UDF was following:

#include "udf.h"
DEFINE_DIFFUSIVITY(DIFF,c,t,i)
{
real diff;
int zone_ID = THREAD_ID(t);
if (zone_ID==2)
{
if(i==0)
DIFF= 5.22e-7;
else
DIFF=5.22e-7;
}
else
{
if(i==0)
DIFF=2.6e-5;
else
DIFF=2.6e-5;
}
return DIFF;
}

please help me

Vaibhav

Last edited by vaibhav_v; December 28, 2010 at 09:45.
vaibhav_v is offline   Reply With Quote

Old   December 31, 2010, 13:13
Default
  #2
Senior Member
 
Real Name :)
Join Date: Jan 2010
Location: United States
Posts: 192
Rep Power: 16
ComputerGuy is on a distinguished road
I have no trouble with the following:
Code:
#include "udf.h"
DEFINE_DIFFUSIVITY(DIFFU,c,t,i)
{
real DIFF;
int zone_ID = THREAD_ID(t);
if (zone_ID==2)
{
if(i==0)
DIFF= 5.22e-7;
else
DIFF=5.22e-7;
}
else
{
if(i==0)
DIFF=2.6e-5;
else
DIFF=2.6e-5;
}
return DIFF;
}
ComputerGuy
hda likes this.
ComputerGuy 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
PB: Saving mass fraction of species on two points with an udf biget.a FLUENT 2 July 23, 2009 04:06
UDF mass flow rate Juan FLUENT 2 December 22, 2007 10:29
UDF solution variable for time-averaged mass frac? A. S. FLUENT 0 May 14, 2007 17:44
Heat and Mass Transfer UDF Srinivas Parimi FLUENT 3 August 22, 2005 14:49
UDF for Species mass fraction daniel FLUENT 3 June 22, 2005 09:40


All times are GMT -4. The time now is 14:51.