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"
{
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;

{
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]);
}
}