CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

CG_motion problem

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

LinkBack Thread Tools Display Modes
Old   March 6, 2011, 14:22
Default CG_motion problem
Join Date: Apr 2010
Location: Pisa / Italy
Posts: 62
Rep Power: 9
Atze is on a distinguished road

I have to simulate a cylinder contrained with a spring and loaded only with its weight. I've written this UDF but monitoring the X-position of the center of the body it tends to 1mm and Cd tends to 0 .... where are the mistakes?

Thanks a lot for your help

#include "udf.h"

DEFINE_CG_MOTION(oscillazione,dt,vel,omega,time,dt ime)

real x[ND_ND];
Thread *t;
face_t f;
real A[ND_ND];
real Ft,F_el,F_pressure, dv, v_prev;
real Keq= 50.0;
real m = 0.25;

NV_S(vel, =, 0.0);

t = DT_THREAD(dt);

F_pressure = 0.0;

F_el += -Keq*x[0]; /* is this wrong? */
F_pressure += F_P(f,t) * A[0]; /* or F_P*NV_MAG(A) ? */

dv = dtime * (Ft / m);

v_prev += dv;

vel[0] = v_prev;
Atze is offline   Reply With Quote


Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
Incoherent problem table in hollow-fiber spinning Gianni FLUENT 0 April 5, 2008 10:33
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13
Is this problem well posed? Thomas P. Abraham Main CFD Forum 5 September 8, 1999 14:52

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