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

What's wrong with my UDF? It worked in the past.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 26, 2007, 09:40
Default What's wrong with my UDF? It worked in the past.
  #1
CF
Guest
 
Posts: n/a
Hi,

I've got a udf which my friend passed me. It's used to simulate a body moving up/down in a fluid. I've used it before and it worked.

However, now when I tried to use it, I've problems compiling. My sch now uses fluent 6.3 but I wonder if that's the problem. My UDF is

#include "udf.h" /* this function defines velocity of center of gravity for pure plunging motion*/ /* Plunging motion equation is z(t)=h*sin(2*pi*f*t) */ DEFINE_CG_MOTION(plungnew, dt, vel, omega, time, dtime) { thread *t; face_t *f; /*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(dt); */ /* vel[1] is the vertical plunging velocity */ /* These velocity below is for h=0.4c and f=0.993Hz */ vel[1] = 0.1910088333*cos(0.9550441667*time); }

The error message is:

# building library in lnia64/2ddp make[1]: Entering directory `/home/enduser/g0306332/fluent_intro/libudf/lnia64/2ddp' make[1]: *** Warning: File `makefile' has modification time in the future (2007-09-26 20:39:03 > 2007-09-26 20:37:44.628237) # Generating udf_names.c because of makefile plungnew.c make[2]: Entering directory `/home/enduser/g0306332/fluent_intro/libudf/lnia64/2ddp' make[2]: *** Warning: File `makefile' has modification time in the future (2007-09-26 20:39:03 > 2007-09-26 20:37:45.151532) make libudf.so "CFLAGS=-fpic -shared -ansi -Wall -O -DPTR_RESTRICT= " "LDFLAGS=-shared -lm" "LD=cc" make[3]: Entering directory `/home/enduser/g0306332/fluent_intro/libudf/lnia64/2ddp' make[3]: *** Warning: File `makefile' has modification time in the future (2007-09-26 20:39:03 > 2007-09-26 20:37:45.324747) # Compiling udf_names.o because of udf_names.c cc -fpic -shared -ansi -Wall -O -DPTR_RESTRICT= -I/app1/common/Fluent.Inc/fluent6.3.26/`expr \`pwd\` : '.*/\(.*\)/[23].*'`/`basename \`pwd\`` -I/app1/common/Fluent.Inc/fluent6.3.26/src -I/app1/common/Fluent.Inc/fluent6.3.26/cortex/src -I/app1/common/Fluent.Inc/fluent6.3.26/client/src -I/app1/common/Fluent.Inc/fluent6.3.26/tgrid/src -I/app1/common/Fluent.Inc/fluent6.3.26/multiport/src -I. -c udf_names.c # Compiling plungnew.o because of plungnew.c cc -fpic -shared -ansi -Wall -O -DPTR_RESTRICT= -I/app1/common/Fluent.Inc/fluent6.3.26/`expr \`pwd\` : '.*/\(.*\)/[23].*'`/`basename \`pwd\`` -I/app1/common/Fluent.Inc/fluent6.3.26/src -I/app1/common/Fluent.Inc/fluent6.3.26/cortex/src -I/app1/common/Fluent.Inc/fluent6.3.26/client/src -I/app1/common/Fluent.Inc/fluent6.3.26/tgrid/src -I/app1/common/Fluent.Inc/fluent6.3.26/multiport/src -I. -c plungnew.c plungnew.c: In function `plungnew': plungnew.c:6: `thread' undeclared (first use in this function) plungnew.c:6: (Each undeclared identifier is reported only once plungnew.c:6: for each function it appears in.) plungnew.c:6: `t' undeclared (first use in this function) plungnew.c:7: warning: unused variable `f' make[3]: *** [plungnew.o] Error 1 make[3]: Target `libudf.so' not remade because of errors. make[3]: warning: Clock skew detected. Your build may be incomplete.

Can anyone help?

Thanks
  Reply With Quote

Old   September 26, 2007, 10:54
Default Re: What's wrong with my UDF? It worked in the pas
  #2
CF
Guest
 
Posts: n/a
I've rewritten the udf for easy viewing:

#include "udf.h"

/* this function defines velocity of center of gravity for pure plunging motion*/

/* Plunging motion equation is z(t)=h*sin(2*pi*f*t) */

DEFINE_CG_MOTION(plung185, dt, vel, omega, time, dtime)

{

thread *t;

face_t *f;

/*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(dt); */

/* vel[1] is the vertical plunging velocity */

/* These velocity below is for h=0.4c and f=0.993Hz */

vel[1] = 0.1910088333*cos(0.9550441667*time);

}

  Reply With Quote

Old   September 26, 2007, 19:22
Default Re: What's wrong with my UDF? It worked in the pas
  #3
jasond
Guest
 
Posts: n/a
Try "Thread *t" instead of "thread *t". That is certainly a problem.

Jason D.
  Reply With Quote

Old   September 26, 2007, 21:09
Default Re: What's wrong with my UDF? It worked in the pas
  #4
CF
Guest
 
Posts: n/a
Ya it worked! tks.

I wonder why it didn't worked b4...
  Reply With Quote

Reply


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
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 08:37
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 22:38
DEFINE_DPM_OUTPUT macro UDF HELP Puneet FLUENT 3 November 28, 2003 11:55
DEFINE_ON_DEMAND UDF: How to declare A[ND_ND], etc jx FLUENT 1 November 6, 2003 18:23
DEFINE_GEOM UDF Problems Pat FLUENT 0 August 14, 2003 14:16


All times are GMT -4. The time now is 02:24.