CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   error when compiled UDF on fluent 15.0 (https://www.cfd-online.com/Forums/fluent/137852-error-when-compiled-udf-fluent-15-0-a.html)

Isitv2A June 24, 2014 04:29

error when compiled UDF on fluent 15.0
 
when try to compile my udf i get this message .


The UDF library you are trying to load (libudf) is not compiled for 3d on the current platform (win64).
Le fichier spécifié est introuvable.


my udf ,

#include "udf.h"
DEFINE_CG_MOTION(pipe,dt,vel,omega,time,dtime) /* macro de fluent pour définir le mouvement du centre de gravité d'une partie (ici le pipe ) */
{
Thread *t; /* pointeur t vers thread */
Domain *d=Get_Domain(1) ; /* pointeur vers le domaine */
real x_cg[3];
real force [3] ;
real moment[3]; /* définit la position la force la vitesse en 3D */
real accl;
real dv ; /* accélération et dv */
real mass= 0.2; /* mass du système */
real wn=12.0; /* pulsation ??????????????? a voir */
real k= mass * wn*wn ; /* raideur du pipe */
real c=2*mass*0.10 ; /* coefficient de trainé eau->solide */
NV_S(vel,=,0.0); /* initialisation de la vitesse linéarire */
NV_S(omega,=,0.0); /* vitesse angulaire */
t=DT_THREAD(dt) ; /* donne au pointeur le thread ou le mouvement se produit */


for (i=0 ; i<3 ,i++)
x_cg[i]=DT_THREAD(dt)[i]; /* initialisation de la position du centre de gravité */


/* pour l'instant le mopuvement est uniquement celon l'axe x */
Compute_Force_And_Moment(d,t,x_cg,force,moment,TRU E); /* calcule les forces de les moments appliqués au centre de gravité */
force[1]+= -k*x_cg[1]-c*vel[1]; : /* force sur l'axe x un terme en k*x_cg qui correpond a un ressort mécanique et un terme de trainé en c*vel */
accl=force[1]/mass ; dv =accl*dtime; /*calcul de accl et dv */
v_prev+=dv; vel[1]=v-prev; /* calcul de vel sur l'axe x */
printf("Computed force : %g\n ",force[1]); /* afiche sur la console la force et la vitesse */
printf("Velocity: %g\n ", vel[1]);
}

pakk June 24, 2014 09:57

To use a compiled UDF in Fluent, you need to do two things:

1. Compile the UDF
2. Load the compiled UDF.

You show the result of step 2, but the problem was in step 1. If you want help, you should show what message you get after step 1.

Isitv2A June 24, 2014 10:36

hi pakk thanks for help i search on this forum and internet because i try to compiled udf.c with a free compiler with Dev-c++ . ( http://fr.wikipedia.org/wiki/Dev-C%2B%2B ) . i try example i found on net , to see if it was mine udf who don't work but i don't suceed either to compiled them .

my compiler said error using one 1srt line .

People speack about using visual studio to compiled their udf . Do we have choice or do we must use this programme ?


Sorry for my english and for my noob question . i still student and try to learn by myself .

pakk June 24, 2014 15:59

Hi Isitv2A, I didn't mean to imply that this was a stupid question,

As far as I know, the visual studio program is the only thing that works. But, I should ust say that I never tried anything else, so I'm only repeating what other people said to me.

Your English is not a problem at all. Et je peux lire Français aussi, et aussi écrire, mais avec plusieurs erreurs. Mais je préfère les questions Anglaises, ils sont plus facile pour moi ;)

Isitv2A June 25, 2014 10:15

hi pakk i have install Visual studio 2010 express . And when i try to compiled using the promt command with cl .

i write cl udf.c , and i get error udf.h no such file or directory .


I also try to lauch fluent from sdk 7.0 or visual studio than try to compiled in fluent using define ->function -> compiled . But always say that libudf.dll missing .


thanks for all help ! have a good day all

Isitv2A June 25, 2014 11:32

Problem solve
 
Thanks to this forum i succeed to compiled my udf thanks all .


All times are GMT -4. The time now is 07:00.