|
[Sponsors] |
April 28, 2004, 02:49 |
error: line 1 parse error
|
#1 |
Guest
Posts: n/a
|
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?
|
|
April 28, 2004, 03:42 |
Re: error: line 1 parse error
|
#2 |
Guest
Posts: n/a
|
post your UDF !
|
|
April 28, 2004, 06:02 |
Re: error: line 1 parse error
|
#3 |
Guest
Posts: n/a
|
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) } |
|
April 28, 2004, 08:18 |
Re: error: line 1 parse error
|
#4 |
Guest
Posts: n/a
|
For me it compiled and interpret well. Check your compiler.
|
|
April 28, 2004, 09:10 |
Re: error: line 1 parse error
|
#5 |
Guest
Posts: n/a
|
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 |
|
April 29, 2004, 03:57 |
Re: error: line 1 parse error
|
#6 |
Guest
Posts: n/a
|
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.
|
|
April 29, 2004, 04:39 |
Re: error: line 1 parse error
|
#7 |
Guest
Posts: n/a
|
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 |
|
April 30, 2004, 05:34 |
Re: error: line 1 parse error
|
#8 |
Guest
Posts: n/a
|
Thanx a lot! i've installed MS VC and everything is working properly! Thanks again.
|
|
May 6, 2004, 05:44 |
Re: error: line 1 parse error
|
#9 |
Guest
Posts: n/a
|
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
|
|
November 7, 2022, 22:29 |
UDF error
|
#10 |
New Member
Victoria
Join Date: Sep 2022
Posts: 4
Rep Power: 3 |
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. |
|
November 8, 2022, 01:48 |
|
#11 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
put
Code:
/*
__________________
best regards ****************************** press LIKE if this message was helpful |
|
November 8, 2022, 18:54 |
|
#12 |
New Member
Victoria
Join Date: Sep 2022
Posts: 4
Rep Power: 3 |
Hi Alexandarz
Thanks.. It is working. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM] Native ParaView Reader Bugs | tj22 | ParaView | 270 | January 4, 2016 11:39 |
nonNewtonian viscosity model | mhassani | OpenFOAM Programming & Development | 5 | January 7, 2013 09:27 |
Accessing phi from a fvPatchField at same patch | johndeas | OpenFOAM | 1 | September 13, 2010 20:23 |
compile errors of boundary condition "expDirectionMixed" | liying02ts | OpenFOAM Bugs | 2 | February 1, 2010 20:11 |
user defined function | cfduser | CFX | 0 | April 29, 2006 10:58 |