CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

the udf has been hooked to the fluent successfully,but it does not work!

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

LinkBack Thread Tools Search this Thread Display Modes
Old   June 3, 2011, 03:57
Question the udf has been hooked to the fluent successfully,but it does not work!
New Member
Join Date: Jun 2011
Posts: 1
Rep Power: 0
hugeforest is on a distinguished road
I want to use udf (DEFINE_CG_MOTION) to determine the motion of a rectangular body (2D) according to the pressure on the top and bottom faces. The udf has been successfully hooked to the FLUENT, and the zone has also been successfully defined. But the rectangular body's motion was not affected by the udf and it did not move at all. I'm sure that there is a big difference of the pressure on both faces. There were no error information at all. Additionally, I try to use the command "message" to output the value of some parameters, but no information was shown up in the TUI windows.
I really appreciate your help. Thank you.
Here is my udf:

#include "udf.h"
#include "dynamesh_tools.h"

/* velocities */
static real v_invalve1 = 0.0;
static real v_exvalve1 = 0.0;

/* displacement */
static real s_invalve1 = 0.0;
static real s_exvalve1 = 0.0;

static real lift = -0.0015;

Thread *t1, *t2;
face_t f;
real NV_VEC(A);
real force, dv, a, ds;
Domain * domain;

int zone_id1=81;
int zone_id2=91;

/* reset velocities */
NV_S(vel, =, 0.0);
NV_S(omega, =, 0.0);

if (!Data_Valid_P())

/* get the thread pointer for which this motion is defined */

/* compute pressure force on body by looping through all faces */
force = 0.0;
force += F_P(f,t1) * A[1];

force += F_P(f,t2) * A[1];

/* compute change in velocity, i.e., dv = F * dt / mass
velocity update using explicit Euler formula */
else if(s_invalve1+ds>=0)
dv = dtime * a;
v_invalve1 += dv;
s_invalve1 += ds;
Message ("time = %f, y_vel = %f, force = %f\n", time, v_invalve1, force);

/* set y-component of velocity */
vel[1] = v_invalve1;
hugeforest is offline   Reply With Quote

Old   July 8, 2011, 04:31
New Member
Join Date: Mar 2009
Posts: 19
Rep Power: 17
sri31049 is on a distinguished road

First calculate the pressure force and velocity using DEFINE_EXECUTE_AT_END .

Second use that velocity in DEFINE_CG_MOTION

I hope it will work
sri31049 is offline   Reply With Quote


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
Trouble: Sandia UV UDF on FLUENT 12.0.16 RPJones Fluent UDF and Scheme Programming 31 May 25, 2011 11:15
HELP! Fluent UDF Iterate error Sam FLUENT 2 July 10, 2008 21:29
compiling my UDF Seyed Farid Hosseinizadeh FLUENT 22 February 14, 2006 10:19
UDF problem caused by various version of Fluent Yurong FLUENT 3 January 15, 2006 10:57
UDF of Zimont model in fluent Z Main CFD Forum 0 February 17, 2005 03:07

All times are GMT -4. The time now is 21:48.