CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   error in mass diffusivity UDF (https://www.cfd-online.com/Forums/fluent-udf/83319-error-mass-diffusivity-udf.html)

vaibhav_v December 23, 2010 05:27

error in mass diffusivity UDF
 
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

ComputerGuy December 31, 2010 13:13

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


All times are GMT -4. The time now is 06:38.