CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   error: line 1 parse error (https://www.cfd-online.com/Forums/fluent/33597-error-line-1-parse-error.html)

Arky April 28, 2004 02:49

error: line 1 parse error
 
I'm trying to pass the Interpreted UDF to Fluent 6.1. But the progrma generates the following messgae: line 1 parse error. Even when I'm trying to interpret HelloWorld UDF. Can anybody help me?

thomas April 28, 2004 03:42

Re: error: line 1 parse error
 
post your UDF !

Arky April 28, 2004 06:02

Re: error: line 1 parse error
 
I was trying to interpret the following example code (which is in documentation). Still no result...

#include "udf.h" /* must be at the beginning of every UDF you write */

DEFINE_PROFILE(inlet_x_velocity, thread, index) { real x[ND_ND]; /* this will hold the position vector */ real y; face_t f;

begin_f_loop(f, thread) /* loops over all faces in the thread passed

in the DEFINE macro argument */

{

F_CENTROID(x,f,thread);

y = x[1];

F_PROFILE(f, thread, index) = 20. - y*y/(.0745*.0745)*20.;

} end_f_loop(f, thread) }

thomas April 28, 2004 08:18

Re: error: line 1 parse error
 
For me it compiled and interpret well. Check your compiler.

Karthick April 28, 2004 09:10

Re: error: line 1 parse error
 
Dear Arky

U check whether the udf file is in same folder as the case file u are running. What I have done is, first I've kept the same udf which u posted in my desktop and interpreted. It showed parse error.

Then I transferred to the case file folder and run the same udf. It interpreted well.

If u have still problems, write to me.

Regards Karthick

Arky April 29, 2004 03:57

Re: error: line 1 parse error
 
The UDF is in the folder that contains .cas and .dat files. I even tried to place the UDF source file, .cas and .dat files into ..\ntbin\ntx86, and still the same error. I suppose that something wrong with paths to some files, but I dont know exactly to which ones.

Karthick April 29, 2004 04:39

Re: error: line 1 parse error
 
Dear Arky

Don't worry, it will not be a problem with ur udf. May be there may be a problem with ur path. I'll send u file helps to u set the path correctly to ur personal id.

Check it and then tell

Regards Karthick

Arky April 30, 2004 05:34

Re: error: line 1 parse error
 
Thanx a lot! i've installed MS VC and everything is working properly! Thanks again. :)

Barry May 6, 2004 05:44

Re: error: line 1 parse error
 
In windows you can fix the problem by simply launching fluent from the directory where your UDF and case files are, by typing fluent xxx (e.d 2dddp etc) on the dos prompt

Shivani November 7, 2022 22:29

UDF error
 
Hi
I am trying to studying the hydrodynamics and heat transfer in gas solid fluidised beds.
I am trying to use the modified drag law as a UDF.
************************************************** ***************
UDF for customizing the default Syamlal drag law in ANSYS FLUENT
************************************************** *****************/

#include "udf.h"
#define pi 4.*atan(1.)
#define diam2 3.e-4

DEFINE_EXCHANGE_PROPERTY(custom_drag,cell,mix_thre ad,s_col,f_col)
{
Thread *thread_g, *thread_s;
real x_vel_g, x_vel_s, y_vel_g, y_vel_s, abs_v, slip_x, slip_y,
rho_g, rho_s, mu_g, reyp, afac,
bfac, void_g, vfac, fdrgs, taup, k_g_s;

/* find the threads for the gas (primary) */
/* and solids (secondary phases) */

thread_g = THREAD_SUB_THREAD(mix_thread, s_col);/* gas phase */
thread_s = THREAD_SUB_THREAD(mix_thread, f_col);/* solid phase*/

/* find phase velocities and properties*/

x_vel_g = C_U(cell, thread_g);
y_vel_g = C_V(cell, thread_g);

x_vel_s = C_U(cell, thread_s);
y_vel_s = C_V(cell, thread_s);

slip_x = x_vel_g - x_vel_s;
slip_y = y_vel_g - y_vel_s;

rho_g = C_R(cell, thread_g);
rho_s = C_R(cell, thread_s);

mu_g = C_MU_L(cell, thread_g);

/*compute slip*/
abs_v = sqrt(slip_x*slip_x + slip_y*slip_y);

/*compute Reynold's number*/

reyp = rho_g*abs_v*diam2/mu_g;

/* compute particle relaxation time */

taup = rho_s*diam2*diam2/18./mu_g;

void_g = C_VOF(cell, thread_g);/* gas vol frac*/

/*compute drag and return drag coeff, k_g_s*/

afac = pow(void_g,4.14);

if(void_g<=0.85)
bfac = 0.8*pow(void_g, 1.28);
else
bfac = pow(void_g, 2.65);

vfac = 0.5*(afac-0.06*reyp+sqrt(0.0036*reyp*reyp+0.12*reyp*(2.*bfac-
afac)+afac*afac));
fdrgs = void_g*(pow((0.63*sqrt(reyp)/
vfac+4.8*sqrt(vfac)/vfac),2))/24.0;

k_g_s = (1.-void_g)*rho_s*fdrgs/taup;

return k_g_s;
}
This is the code I am using in the simulation.
Can someone help me in fixing this?



"C:/Users/s3798474/AppData/Local/Temp/UDF5.h.27452.0.c"
Error: C:/Users/s3798474/AppData/Local/Temp/UDF5.h.27452.0.c: line 1: parse error.

AlexanderZ November 8, 2022 01:48

put
Code:

/*
on the first line

Shivani November 8, 2022 18:54

Hi Alexandarz
Thanks.. It is working.


All times are GMT -4. The time now is 16:26.