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

Wave Generation via Flapping Wall UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 28, 2012, 15:31
Default Wave Generation via Flapping Wall UDF
  #1
New Member
 
Join Date: Mar 2011
Posts: 4
Rep Power: 15
LenDawg0220 is on a distinguished road
Hello All,

Long story short... I'm working on developing a 2D cfd model via fluent 13, that models surface waves interacting with various geometries lying on the free surface. The model consists of a tank, with wall boundary's at the front and end walls, the bottom, and a pressure outlet for the top. The trick is I need the model to be robust enough that the waves being developed reflect off the end wall, and combine with oncoming waves, and I need to run this until a standing wave develops in the tank.

I would like to accomplish this by generating the waves via a udf, which causes the front wall to oscillate like a hinged flap. Reading the udf manual, the DEFINE_CG_MOTION macro, appears to allow this to occur, however something I can't explain is occuring. When I preview the motion, the wall begins to move as intended, but when it attempts to pass back through the vertical plane, it changes direction and heads back in the direction in which it came. It's as if the sign on the angular velocity has suddenly changed, however I can confirm that hasn't. Before people ask, I've played with the phase angle to no avail, and it doesn't matter which direction the motion starts (ie. into the tank or out of the tank), it always changes direction unexpectedly.

I've included the UDF below. If anyone has any thoughts on this, or suggestions on other ways to accomplish my goal please comment. I welcome all suggestions.

#include"udf.h"
real pi, freq, phase, Ampdeg, Amprad, w, AVel;
DEFINE_CG_MOTION(wallmotion, dt, vel, omega, time, dtime)
{
NV_S(vel, =, 0.0);
NV_S(omega, =, 0.0);
/* Defined Constants*/

pi = 3.141592654;
freq = .97;
Ampdeg = 11.195;
phase = 0;
/*Define Wall Motion via. Angular Velocity */
Amprad = Ampdeg*pi/180; /*Convert amplitude to radians */
w=2.0*pi*freq; /*angular freq in radians*/
AVel = Amprad*w*cos(w*time + phase);
omega[2] = AVel;
/*Assign AVel to omegaz */
Message("time:%f omegaz:%f \n", time, omega[2]);
}

Thanks for your time.

Len
LenDawg0220 is offline   Reply With Quote

Old   April 29, 2012, 15:30
Default
  #2
New Member
 
Join Date: Mar 2011
Posts: 4
Rep Power: 15
LenDawg0220 is on a distinguished road
Well I solved my problem rather unexpectedly. There appears to be a bug with in Fluent 13, because I have no other way to explain it. When I previewed the wall motion using the display zone motion option, it gave me the problem I listed above. When I used the preview mesh motion option though, the motion ran as expected.

Len
LenDawg0220 is offline   Reply With Quote

Old   May 11, 2012, 08:13
Default
  #3
New Member
 
Patrick
Join Date: Apr 2012
Posts: 28
Rep Power: 14
Patrick1 is on a distinguished road
Quote:
Originally Posted by LenDawg0220 View Post
Well I solved my problem rather unexpectedly. There appears to be a bug with in Fluent 13, because I have no other way to explain it. When I previewed the wall motion using the display zone motion option, it gave me the problem I listed above. When I used the preview mesh motion option though, the motion ran as expected.

Len
Glad you fixed your problem. Was just wondering if you need a special mesh to use this CG_MOTION macro? How does it actually model the movement? Have no real questions just sounds like an interesting sim you're running there. Do the waves reflect properly?
Patrick1 is offline   Reply With Quote

Old   June 11, 2012, 11:08
Default
  #4
New Member
 
Join Date: Mar 2011
Posts: 4
Rep Power: 15
LenDawg0220 is on a distinguished road
Quote:
Originally Posted by Patrick1 View Post
Glad you fixed your problem. Was just wondering if you need a special mesh to use this CG_MOTION macro? How does it actually model the movement? Have no real questions just sounds like an interesting sim you're running there. Do the waves reflect properly?
Sorry for the delay in replying Patrick, I intended to respond right away but got sidetracked.

To answer your question, the only trick to using a moving mesh, that they don't jump right out and tell you is that the mesh has to be a tri grid, not an H-Grid for the smoothing function to work. If you don't use a tri grid, when you run the motion or the simulation the mesh will not deform and the simulation will fail as soon as the moving object crosses over into the next element (creates a negative volume).

Other than that my mesh is setup very much like the falling box example. I used ICEM to make a separate region around my moving flap, which has an H-grid that moves with the flap, and then created a region around that which is all a tri grid that I've allowed to deform. I subject both the flap and the H-grid region to the macro I wrote (I've since modified it slightly to account for the flap having a thickness and being hinged at the back instead of the middle, but its general function is the same).

As for the waves, I've successfully run several models up to the 1 min mark, and they are reflecting and creating a standing wave. However I've yet to compare the results to wave theory yet or results from a wave tank, so I don't really know how good my results are, but it's a start.

Len
LenDawg0220 is offline   Reply With Quote

Old   April 11, 2017, 17:21
Default
  #5
New Member
 
Siddani Bhargav Sriram
Join Date: Feb 2017
Posts: 2
Rep Power: 0
siddanibhargav is on a distinguished road
Hello LenDawg0220,
Can you please let me know how you had created the prism layer using ICEM in detail? I'm working on a similar project, but I'm carrying out 2D analysis. As I couldn't generate a prism layer, I had generated an inflation but had faced a problem in FLUENT solver (Negative Cell Volume).

I would be glad if anyone can give me some inputs.
Thanks in advance.
siddanibhargav is offline   Reply With Quote

Old   June 26, 2017, 17:05
Default
  #6
New Member
 
Usama.JM's Avatar
 
Usama
Join Date: Jun 2017
Posts: 6
Rep Power: 9
Usama.JM is on a distinguished road
Help me please
How writing UDF for: w=A(t)*sin(n*pi*x/L)


Sent from my iPhone using CFD Online Forum mobile app
Usama.JM 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
Accessing wall shear stress using UDF Robert Fluent UDF and Scheme Programming 2 July 31, 2013 09:34
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
Wall motion as a UDF, is it possible? linch FLUENT 1 August 31, 2009 10:18
How to write udf of slip wall condition cxzhao FLUENT 0 April 27, 2005 22:20
Vibrating / Deforming Wall UDF Qureshi FLUENT 2 January 16, 2004 05:48


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