CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Error message udf-library

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 30, 2011, 05:30
Default Error message udf-library
  #1
Member
 
daalou
Join Date: Feb 2011
Posts: 31
Rep Power: 15
alilouu is on a distinguished road
hi; I work on the hydrodynamic transient problem using an udf .
when I use an ordinary PC, the udf is compiled, but when i use a work station, or an other pc work with 64 bits, and after :
adding the udf
building the library udf
loadin this librudf, i ve got alwas this message

error opening library udf: the path is not found

what have i to do to compile this udf???
alilouu is offline   Reply With Quote

Old   July 6, 2011, 03:50
Default
  #2
Member
 
Nikolopoulos Aristeidis
Join Date: Jan 2011
Location: Athens, Greece
Posts: 62
Rep Power: 15
Nikolopoulos is on a distinguished road
You should recomplile your udf every time you change OS and every time you change from 32 to 64.
Nikolopoulos is offline   Reply With Quote

Old   July 6, 2011, 10:31
Default UDF error
  #3
New Member
 
mecamor
Join Date: Jul 2011
Posts: 23
Rep Power: 14
mecamor is on a distinguished road
hello
I wrote the UDF of the piston, but when compiling with C 13 or it Fluent There's an error in line 3. How I should do. thank you
Error: C:\Program Files\ANSYS Inc\v130\fluent\ntbin\win64\PISTON2.c: line 3: parse error.

How I should do. thank you
#include "udf.h"
#include "dynamesh_tools.h"
static real v_prev= 0.0;
DEFINE_CG_MOTION(piston, dt, vel, omega, time, dtime)
{
Thread *t;
face_t f;
real NV_VEC (A);
real force, dv;
/* reset velocities */
NV_S (vel, =, 0.0);
NV_S (omega, =, 0.0);
if (!Data_Valid_P ())
return;
/* get the thread pointer for which this motion is defined */
t = DT_THREAD ((Dynamic_Thread *)dt);
/* compute pressure force on body by looping through all faces */
force = 0.0;
begin_f_loop (f, t)
{
F_AREA (A, f, t);
force += F_P (f, t) * NV_MAG (A);
}
end_f_loop (f, t)
/* compute change in velocity, i.e., dv= F * dt/ mass;
velocity update using explicit eulerformula */
dv= dtime* force / 50.0;
v_prev+= dv;
CX_Message ("time = %f, x_vel= %f, force = %f\n", time, v_prev, force);
/* set x-component of velocity */
vel[0] = v_prev;
}
mecamor is offline   Reply With Quote

Old   July 7, 2011, 05:54
Default piston UDF
  #4
Member
 
Nikolopoulos Aristeidis
Join Date: Jan 2011
Location: Athens, Greece
Posts: 62
Rep Power: 15
Nikolopoulos is on a distinguished road
Your UDF has no problem. I can compile it with no error!

What OS are you using?

If you wrote your .c file in Windows and you compile it in Unix use the
dos2unix command
Nikolopoulos is offline   Reply With Quote

Old   July 8, 2011, 13:28
Default laoding udf
  #5
Member
 
daalou
Join Date: Feb 2011
Posts: 31
Rep Power: 15
alilouu is on a distinguished road
hi Nikolopoulos Aristeidis

thanks for your help,
I didn't understand your idea about compiling every time I change OS, or from 32 to 64 bits. do I compile the udf when I load It by fluent (whitch failed every time) or using the compiling programm in c++ langage
thnks a lot.
alilouu is offline   Reply With Quote

Old   July 11, 2011, 03:07
Default
  #6
Member
 
Nikolopoulos Aristeidis
Join Date: Jan 2011
Location: Athens, Greece
Posts: 62
Rep Power: 15
Nikolopoulos is on a distinguished road
If you built your libudf in windows 32 and then move your case file and libudf in Linux or in windows 64 your libudf will not load. You should rebuilt it.

If you did that the problem is something else. Your code is compiling in my PC.

Your workstation is working with Linux?
If yes try the dos2unix command for your .c file before building your libudf
Nikolopoulos is offline   Reply With Quote

Old   July 11, 2011, 03:14
Default
  #7
Member
 
Nikolopoulos Aristeidis
Join Date: Jan 2011
Location: Athens, Greece
Posts: 62
Rep Power: 15
Nikolopoulos is on a distinguished road
Post here what fluent writes when you build your UDF
Nikolopoulos is offline   Reply With Quote

Old   July 11, 2011, 04:04
Default hi ...
  #8
Member
 
daalou
Join Date: Feb 2011
Posts: 31
Rep Power: 15
alilouu is on a distinguished road
hi my freind; here is the message after LOADING the udf:

"The UDF library you are trying to load (libudf) is not compiled for 3d on the curent platform (win64).
The system cannot find the file specified.

c:\users\administrator\desktop\udf ali\libudf\win64\3d\libudf.dll "



and my udf :I use win 64 bits.

#include <stdio.h>
#include "udf.h"

/* Definition du nom du fichier où sont stockées les données */
# define UDF_FILENAME "udf_donnees.dat"

/* Début de la soubroutine de déformation de paroi */
DEFINE_GRID_MOTION(cylindre, domain, dt, time, dtime)
{
/* définition des variables : x_coor (coordonnée suivant l'axe x)
x_centre (coordonnée selon x du centre du cylindre)
y_coor (coordonnée suivant l'axe y)
y_centre (coordonnée selon y du centre du cylindre)
rayon (rayon actuel du cylindre)
freq (fréquence de déformation)
alpha (Amplitude de déformation)
temps */
Thread *tf = DT_THREAD (dt);
face_t f;
Node *v;
real x_coor;
real x_centre;
real y_coor;
real y_centre;
real rayon;
real freq;
real alpha;
real temps;
real tempss;
real corec;
int i;
int j;

int n;
FILE *fp = fopen(UDF_FILENAME, "r");

/* set deforming flag on adjacent cell zone */
SET_DEFORMING_THREAD_FLAG (THREAD_T0 (tf));


fscanf(fp,"%e %e %e %e %e", &x_centre, &y_centre, &rayon, &freq, &alpha);

fclose (fp);
corec=1;

temps = RP_Get_Real("flow-time");

if(temps>0){corec=corec*(1+ABS((alpha)*sin(2*M_PI* freq*(temps-0.0002))));}



begin_f_loop (f, tf)
{


f_node_loop (f, tf, n)
{
v = F_NODE (f, tf, n);
if (NODE_POS_NEED_UPDATE (v))
{
NODE_POS_UPDATED (v);


//rayon = sqrt(NODE_X (v)*NODE_X (v)+NODE_Y (v)*NODE_Y (v));
x_coor = (NODE_X (v)-x_centre)/rayon;
y_coor = (NODE_Y (v)-y_centre)/rayon;
NODE_X (v) = (rayon*(1+ABS(((alpha)*sin(2*M_PI*freq*temps))))*x _coor)/corec;
NODE_Y (v) = (rayon*(1+ABS(((alpha)*sin(2*M_PI*freq*temps))))*y _coor)/corec;

}
}

}
end_f_loop (f, tf);
}
alilouu is offline   Reply With Quote

Old   July 11, 2011, 04:25
Default
  #9
Member
 
Nikolopoulos Aristeidis
Join Date: Jan 2011
Location: Athens, Greece
Posts: 62
Rep Power: 15
Nikolopoulos is on a distinguished road
"The UDF library you are trying to load (libudf) is not compiled for 3d on the curent platform (win64).
The system cannot find the file specified.

c:\users\administrator\desktop\udf ali\libudf\win64\3d\libudf.dll "


After getting this message , unload any UDF in your CASE file and built again your libudf. When you press the button for Building fluent writes down how the building (compilation) went. Post this message here.
Nikolopoulos is offline   Reply With Quote

Old   July 11, 2011, 04:51
Default
  #10
Member
 
daalou
Join Date: Feb 2011
Posts: 31
Rep Power: 15
alilouu is on a distinguished road
after re-building without reloading the udf, this is the message


" Deleted old libudf\win64\3d\libudf.dll
1 file(s) copied.
(system "copy "\SERVER\C$\PROGRA~1\ANSYSI~1\v130\fluent"\fluent1 3.0.0\src\makefile_nt.udf "libudf\win64\3d\makefile" ")
1 file(s) copied.
(chdir "libudf")()
(chdir "win64\3d")()
'nmake' is not recognized as an internal or external command,
operable program or batch file.
'nmake' is not recognized as an internal or external command,
operable program or batch file.

Done.
alilouu is offline   Reply With Quote

Old   July 11, 2011, 05:03
Default
  #11
Member
 
Nikolopoulos Aristeidis
Join Date: Jan 2011
Location: Athens, Greece
Posts: 62
Rep Power: 15
Nikolopoulos is on a distinguished road
Ok! Now i know what the problem is.

You don't have a compiler or the environmental variables are not properly set in order to fluent use this compiler.

You have win 64?
Do you have visual studio installed?
If yes check the environmental variables (if you have a fluent launcher just check the envirnmental variables from there).

Alternatively open a visual studio 64 bit command prompt and launch fluent from there with a text command
Nikolopoulos is offline   Reply With Quote

Old   July 11, 2011, 06:20
Default
  #12
Member
 
daalou
Join Date: Feb 2011
Posts: 31
Rep Power: 15
alilouu is on a distinguished road
Thank you my friend, by using the fluent launcher, I think I solved the problem, bravo.


there is an other question if you don't minde;
I want to track some particules to fellow their path, pressure, velocity...
i've been told to use DPM, but I failed.
how to use dpm, and how to get the results.?

P.s: sorry for my boring questions, realy I need to learn.
alilouu is offline   Reply With Quote

Old   July 11, 2011, 07:36
Default
  #13
Member
 
Nikolopoulos Aristeidis
Join Date: Jan 2011
Location: Athens, Greece
Posts: 62
Rep Power: 15
Nikolopoulos is on a distinguished road
For dpm use the -> Model -> Discrete model and set up your injection.

It is not dfficult just find a fluent tutorial.
Nikolopoulos is offline   Reply With Quote

Old   July 11, 2011, 08:14
Default
  #14
New Member
 
mecamor
Join Date: Jul 2011
Posts: 23
Rep Power: 14
mecamor is on a distinguished road
hello
I work with windows 7. how to build the library udf. and when I compile my udf fluent that he lacks nmake.
mecamor is offline   Reply With Quote

Old   July 11, 2011, 08:43
Default
  #15
Member
 
Nikolopoulos Aristeidis
Join Date: Jan 2011
Location: Athens, Greece
Posts: 62
Rep Power: 15
Nikolopoulos is on a distinguished road
mecamor you have the same problem as ali.

Do you have Visual studio installed?
Nikolopoulos is offline   Reply With Quote

Old   July 11, 2011, 08:57
Default
  #16
New Member
 
mecamor
Join Date: Jul 2011
Posts: 23
Rep Power: 14
mecamor is on a distinguished road
Quote:
Originally Posted by Nikolopoulos View Post
mecamor you have the same problem as ali.

Do you have Visual studio installed?
dear friend
I installed Microsoft Visual C + + 2010 Express.
mecamor is offline   Reply With Quote

Old   July 11, 2011, 11:09
Default
  #17
Member
 
daalou
Join Date: Feb 2011
Posts: 31
Rep Power: 15
alilouu is on a distinguished road
Thank you very much my friend Nikolopoulos Aristeidis, I found what I need.

Ali.
alilouu is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem loading UDF library in parallel cluster Veera Gutti FLUENT 8 July 26, 2016 07:24
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
Error in opening UDF library anon_d Fluent UDF and Scheme Programming 4 May 21, 2011 02:10
fluent UDF external library lapack problem Rick FLUENT 0 May 7, 2008 10:16
Error in opening the UDF library Sri FLUENT 3 December 11, 2006 16:19


All times are GMT -4. The time now is 20:55.