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

interpreted UDF

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 8, 2002, 04:10
Default interpreted UDF
  #1
James
Guest
 
Posts: n/a
I compiled the UG example on DEFINE_CG_MOTION

/************************************************** ********** * * 1-degree of freedom equation of motion (x-direction) * ************************************************** **********/

#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 euler formula */

dv = dtime * force / 50.0;

v_prev += dv;

Message ("time = %f, x_vel = %f, force = %f\n", time, v_prev, force);

/* set x-component of velocity */

vel[0] = v_prev;

}

I interpreted it in order to have it in my dynamic mesh udf panel but the interpretation failed and the message is :

/usr/local/Fluent.Inc/contrib/lnx86/cpp -I/usr/local/Fluent.Inc/fluent6.0/src -I/usr/local/Fluent.Inc/fluent6.0/cortex/src -I/usr/local/Fluent.Inc/fluent6.0/client/src -I/usr/local/Fluent.Inc/fluent6.0/multiport/src -I. -DUDFCONFIG_H="<udfconfig.h>" /home/memoire/jaj/tenplus/libudf/lnx86/2d/piston.c Error: /home/memoire/jaj/tenplus/libudf/lnx86/2d/piston.c: line 10: parse error.

Can anyone tell me what is the problem ??

thanks

james
  Reply With Quote

Old   October 8, 2002, 09:56
Default Re: interpreted UDF
  #2
Alexandre
Guest
 
Posts: n/a
you must compile it since static values cannot be used with interpreted udfs
  Reply With Quote

Old   October 8, 2002, 10:32
Default Re: interpreted UDF
  #3
James
Guest
 
Posts: n/a
I rewrote the udf file and it worked thanks
  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
Interpreted UDF Bikash FLUENT 10 December 3, 2019 01:52
A Problem of Fluent Interpreted UDF: parse error knight Fluent UDF and Scheme Programming 25 August 16, 2018 11:26
Interpreted UDF in parallel David Chabot Fluent UDF and Scheme Programming 8 May 30, 2012 04:18
compiled or interpreted udf Aireen FLUENT 11 August 25, 2005 01:54
error of Interpreted udf Zhang Junmei FLUENT 6 December 12, 2001 09:03


All times are GMT -4. The time now is 11:56.