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

Cylinder UDF, oscillate about an origin

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 30, 2018, 22:45
Default Cylinder UDF, oscillate about an origin
  #1
New Member
 
Kimster
Join Date: Oct 2018
Posts: 9
Rep Power: 8
iceman53y is on a distinguished road
Hi,

I have this UDF where I am trying to move a cylinder at a certain frequency.
But the cylinder moves to the right and comes back to its original position. I want it to oscillate about its origin. I want it to move right and left from its origin position.

What do I change in this UDF. Please help.

/* Moving Grid problem - CG movement of a cylinder */
#include "udf.h"
static real velx = 0.0;
DEFINE_CG_MOTION(cylinder, dt, vel, omega, time, dtime)
{
NV_S(vel, =, 0.0);
NV_S(omega, =, 0.0);

velx = 0.005 * sin(3.1415927 * time / 5.);
vel[0] = velx;
}
iceman53y is offline   Reply With Quote

Old   October 31, 2018, 02:47
Default
  #2
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 22
blackmask will become famous soon enough
Note that what you want is

x = A*sin(b*t);
where A, b denote the amplitude and frequency of the motion, respectively. Therefore, the velocity should be

u = dx/dt = b*A*cos(b*t);


i.e., change the sin() in your code to cos().
blackmask is offline   Reply With Quote

Old   October 31, 2018, 07:00
Default
  #3
Member
 
mohamed
Join Date: Apr 2016
Posts: 34
Rep Power: 10
moh_zain is on a distinguished road
vel is for linear motion and you need omeg
moh_zain is offline   Reply With Quote

Old   November 1, 2018, 10:02
Default
  #4
New Member
 
Kimster
Join Date: Oct 2018
Posts: 9
Rep Power: 8
iceman53y is on a distinguished road
Working perfectly now.

Thanks!
iceman53y is offline   Reply With Quote

Old   November 2, 2018, 13:30
Default
  #5
New Member
 
Kimster
Join Date: Oct 2018
Posts: 9
Rep Power: 8
iceman53y is on a distinguished road
Hello again,

My intention is to move this cylinder at a certain frequency, i.e. 8Hz

When I consider the equation in the form of

u = dx/dt = b*A*cos(b*t);

Is this representing:

x = A sin (wt)
v = Aw cos (wt)

And w would be 2*pi*f
And A would be the amplitude.

Please let me know if i'm doing this right.

Also where does fluent get the t from? is is from the timestamp value that I put in?

Thanks
iceman53y is offline   Reply With Quote

Old   November 2, 2018, 14:05
Default
  #6
Member
 
mohamed
Join Date: Apr 2016
Posts: 34
Rep Power: 10
moh_zain is on a distinguished road
yes you right in the equation and t from time-step also right
moh_zain is offline   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
UDF of natural convection in 3D cylinder a_Sarlak Fluent UDF and Scheme Programming 0 November 7, 2015 09:19
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF acasas CFD Freelancers 1 January 23, 2015 08:26
Accelarating of a cylinder UDF Ashutosh FLUENT 4 August 3, 2010 07:52
[blockMesh] Specifying boundary faces failes in blockMesh blaise OpenFOAM Meshing & Mesh Conversion 0 May 10, 2010 04:56
moving cylinder and UDF Achilleas FLUENT 1 June 1, 2005 15:44


All times are GMT -4. The time now is 13:46.