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

(??) sinusoidal motion for DEFINE_CG_MOTION

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

LinkBack Thread Tools Display Modes
Old   November 8, 2010, 03:34
Question (??) sinusoidal motion for DEFINE_CG_MOTION
New Member
Join Date: Mar 2010
Posts: 3
Rep Power: 6
salzini is on a distinguished road
I'm testing with a simple UDF for sinusoidal angular velocity motion but it has a problem.

macro [DEFINE_CG_MOTION] presents [omega] for angular velocity variable and [time] to passes time variable, so try this to describe a pseudo-vibrating cantilever.

omega is time dependant variable and displacement(angle) is intergation of the omega over the time passed. so I assumed if I put some intergand of the time into UDF, Fluent will reflect its integration to the moving boundary.

Few graphs were ploted for investigation


and equations are...

F_1 = INTEGRAL(w_1, t)

w_2=sin(2*pi*t + pi/2)
F_2 = INTEGRAL(w_2, t)

w_3=sin(2*pi*t - pi/2)
F_3 = INTEGRAL(w_3, t)

I choosed blue one(w_2) and its UDF code were...

DEFINE_CG_MOTION(move, dt, vel, omega, time, dtime)
NV_S(vel, =, 0.0);
NV_S(omega, =, 0.0);
omega[2]=sin(2*M_PI*time + M_PI/2);

my desired output was correct y position of lever though, it only moves over y=0 but y>0 and vise versa (no alternation of -+. just up and down under y=0 or over y=0).

I have no idea for [dtime] and [accumulater+= valiable] form to the that situation. So I put integrand in the UDF and hope the Fluent updates position of that intergrand for the time, but it seemed not that explictly

SO... It seems obiously there are stupid assumption or mis-understanding of UDF. Can I recieve a wise solution?

Last edited by salzini; November 8, 2010 at 03:48. Reason: refine
salzini is offline   Reply With Quote

Old   December 10, 2010, 05:47
Senior Member
dmoroian's Avatar
Join Date: Mar 2009
Posts: 646
Rep Power: 10
dmoroian is on a distinguished road
First of all, I don't see why F_1 is always positive in your picture (
If angular velocity is:
1. \omega = sin(2{\pi}t)
then the integral of it should be:
\theta = -\frac{1}{2\pi}cos(2{\pi}t)
which alternates between \left[-\frac{1}{2\pi};+\frac{1}{2\pi}\right]
2. \omega = sin(2{\pi}t+\frac{\pi}{2})
then the integral of it should be:
\theta = -\frac{1}{2\pi}cos(2{\pi}t+\frac{\pi}{2})
which again alternates between \left[-\frac{1}{2\pi};+\frac{1}{2\pi}\right]

My suggestion is to check around which origing you define this omega!
dmoroian is offline   Reply With Quote


define_cg_motion, sinusoidal, udf

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 for non sinusoidal or varying amplitude motion with respect to time lalit kumar FLUENT 1 November 13, 2010 17:58
Sinusoidal motion udf urmazda Fluent UDF and Scheme Programming 6 July 30, 2010 12:44
Convergence moving mesh lr103476 OpenFOAM Running, Solving & CFD 30 November 19, 2007 15:09
tank motion on boat Tim FLUENT 0 May 23, 2007 12:50
Airfoil Sinusoidal Motion - How? Andrew FLUENT 1 April 8, 2005 20:42

All times are GMT -4. The time now is 05:47.