|
[Sponsors] |
October 30, 2018, 22:45 |
Cylinder UDF, oscillate about an origin
|
#1 |
New Member
Kimster
Join Date: Oct 2018
Posts: 9
Rep Power: 8 |
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; } |
|
October 31, 2018, 02:47 |
|
#2 |
Senior Member
|
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(). |
|
October 31, 2018, 07:00 |
|
#3 |
Member
mohamed
Join Date: Apr 2016
Posts: 34
Rep Power: 10 |
vel is for linear motion and you need omeg
|
|
November 1, 2018, 10:02 |
|
#4 |
New Member
Kimster
Join Date: Oct 2018
Posts: 9
Rep Power: 8 |
Working perfectly now.
Thanks! |
|
November 2, 2018, 13:30 |
|
#5 |
New Member
Kimster
Join Date: Oct 2018
Posts: 9
Rep Power: 8 |
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 |
|
November 2, 2018, 14:05 |
|
#6 |
Member
mohamed
Join Date: Apr 2016
Posts: 34
Rep Power: 10 |
yes you right in the equation and t from time-step also right
|
|
|
|
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 |