CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Boundary Temperature Profile UDF error (http://www.cfd-online.com/Forums/fluent-udf/101962-boundary-temperature-profile-udf-error.html)

shikamaru May 18, 2012 05:07

Boundary Temperature Profile UDF error
 
Hi,

I have just started using udf. I am trying to prescribe a variable wall temperature in the boundary. But I am getting parse error in line 2 (DEFINE..)


Can anyone help me with this? and tell me what is wrong here? [downsized the arrays of the code]

#include "udf.h"
DEFINE_PROFILE(tmold_profile, thread, index)
{
real x[ND_ND];
real z;
real tmold[163]={228.9,277.5,301.6,.....};
real zm[163]={0.0,5.1,10.1,......};
int n=0;
real tmp=0.0;
face_t f;

begin_f_loop(f,thread)
{
F_CENTROID(x,f,thread);
z = x[1];
for (n;n<163;n++)
{
if (z < zm[0])
tmp=tmold[0];
if (z > zm[162])
tmp=tmold[162];

if (z == zm[n])
tmp = tmold[n];
else
{
if (z>zm[n] && z<zm[n+1])
tmp = tmold[n]+(z-zm[n])*(tmold[n+1]-tmold[n])/(zm[n+1]-zm[n]);
}
}

F_PROFILE(f,thread,index) = tmp+273;
}
end_f_loop(f,thread)
}

shikamaru May 18, 2012 21:19

I found out that some how in the c file the the first line was like this
#include?"udf.h"
while I was coding in notepad++ it did not show that!!
fixed with notepad.


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