|
[Sponsors] |
![]() |
![]() |
#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?
|
|
![]() |
![]() |
![]() |
#2 |
Guest
Posts: n/a
|
post your UDF !
|
|
![]() |
![]() |
![]() |
#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) } |
|
![]() |
![]() |
![]() |
#4 |
Guest
Posts: n/a
|
For me it compiled and interpret well. Check your compiler.
|
|
![]() |
![]() |
![]() |
#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 |
|
![]() |
![]() |
![]() |
#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.
|
|
![]() |
![]() |
![]() |
#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 |
|
![]() |
![]() |
![]() |
#8 |
Guest
Posts: n/a
|
Thanx a lot! i've installed MS VC and everything is working properly! Thanks again.
![]() |
|
![]() |
![]() |
![]() |
#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
|
|
![]() |
![]() |
![]() |
#10 |
New Member
Victoria
Join Date: Sep 2022
Posts: 5
Rep Power: 4 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#11 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 35 ![]() ![]() |
put
Code:
/*
__________________
best regards ****************************** press LIKE if this message was helpful |
|
![]() |
![]() |
![]() |
![]() |
#12 |
New Member
Victoria
Join Date: Sep 2022
Posts: 5
Rep Power: 4 ![]() |
Hi Alexandarz
Thanks.. It is working. |
|
![]() |
![]() |
![]() |
![]() |
#13 |
New Member
Syed Aatif Moin
Join Date: Feb 2025
Location: NITK Surathkal
Posts: 6
Rep Power: 2 ![]() |
Hii, i have the same error on Ansys 2023 R1. I've already installed MS VS 2019 on the pc but it neither compiles nor interprets.
Im trying to simulate a 2d water tank under an earthquake. Just to try it out, this is the file im using for the compiler............ #include"udf.h" DEFINE_ADJUST(ac,domain) { real gravity[3]; real time=0.0; time=RP_Get_Real("flow-time"); gravity[0]=0.0; gravity[1]=0.0; gravity[2]=-9.81; RP_Set_Real("gravity/x",gravity[0]); RP_Set_Real("gravity/y",gravity[1]); RP_Set_Real("gravity/z",gravity[2]); } |
|
![]() |
![]() |
![]() |
![]() |
#14 |
New Member
Syed Aatif Moin
Join Date: Feb 2025
Location: NITK Surathkal
Posts: 6
Rep Power: 2 ![]() |
im also getting this error-
LINK : fatal error LNK1104: cannot open file 'kernel32.lib' This is what i have installed from visual studio https://drive.google.com/file/d/1j7K...usp=drive_link Thanks in advance Last edited by aatifmoin; February 6, 2025 at 08:51. |
|
![]() |
![]() |
![]() |
![]() |
#15 |
New Member
Victoria
Join Date: Sep 2022
Posts: 5
Rep Power: 4 ![]() |
Hi
Can you try opening fluent using command line for visual studios. I am posting link of you tube video for that https://youtu.be/xt2hnE9_LdM?si=YzEDxttxUeEOPN4U |
|
![]() |
![]() |
![]() |
![]() |
#16 |
New Member
Syed Aatif Moin
Join Date: Feb 2025
Location: NITK Surathkal
Posts: 6
Rep Power: 2 ![]() |
Hii, thank you for the reply. I'm running Ansys 2023R1 this is older version that is shown here, the interface is quite different.
|
|
![]() |
![]() |
![]() |
![]() |
#17 |
New Member
Syed Aatif Moin
Join Date: Feb 2025
Location: NITK Surathkal
Posts: 6
Rep Power: 2 ![]() |
I just made a .ttb file of the the expression i wanted to work with in Fluent, it was much easier.
Used this video for reference if anyone else needs help, https://youtu.be/OiFSZgBOSGU?si=uQr8dBVrV11rm6Yz |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 |