CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

Sway Motion UDF?

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 14, 2005, 12:51
Default Sway Motion UDF?
  #1
Brian
Guest
 
Posts: n/a
I am trying to do a simple sloshing problem but I'm a bit confused how to perform it. I would like to sway (oscillatory x-motion) a 2D box as so: x = Amplitude * sin(omega * time). The box center is at (0,0) for simplicity. I know the amplitude and omega. I just don't know how to perform this task in Fluent. Any suggestions would rock! Thanks all!

-Brian
  Reply With Quote

Old   October 17, 2005, 01:39
Default Re: Sway Motion UDF?
  #2
Manoj Kumar
Guest
 
Posts: n/a
Hi Brian

You can do this by adding time varying momentum source to the momentum equation using following udf ...

#include "udf.h"

#define pie 3.141592654

DEFINE_SOURCE(cell_x_source, cell, thread, dS, eqn) { real source;

/* source term */

source =(-Amplitude)*pow((2*pie/time),2)*C_R(cell,thread)*sin((2*pie/time)*CURRENT_TIME);

/* derivative of source term w.r.t. x-velocity. */

dS[eqn] = 0.;

return source; }

You can also use a time varying gravity or a combination of these to simulate real problems.

Good luck

Manoj
  Reply With Quote

Old   October 17, 2005, 01:51
Default Re: Sway Motion UDF?
  #3
Manoj Kumar
Guest
 
Posts: n/a
Source equation should be

source =(-Amplitude*density)*pow((2*pie/time),2)*C_R(cell,thread)*sin((2*pie/time)*CURRENT_TIME); (N/m3)
  Reply With Quote

Old   October 17, 2005, 04:31
Default Re: Sway Motion UDF?
  #4
RoM
Guest
 
Posts: n/a
I think the first version of your source term was correct. Now you have density squared (from Amplitude*density and C_R(c,t)) which is wrong. Although you dont have to define pie, you can use M_PI instead.

Regards

RoM
  Reply With Quote

Old   October 17, 2005, 05:51
Default Re: Sway Motion UDF?
  #5
Manoj Kumar
Guest
 
Posts: n/a
You are right.

Thanks Rom
  Reply With Quote

Old   October 18, 2005, 16:27
Default Re: Sway Motion UDF?
  #6
Brian
Guest
 
Posts: n/a
Where I do input amplitude and omega ("time" in your example)? Do I define them in the UDF?
  Reply With Quote

Old   October 18, 2005, 16:28
Default Re: Sway Motion UDF?
  #7
Brian
Guest
 
Posts: n/a
NEVERMIND! STUPID QUESTION!!!! HAHAHAHA!!
  Reply With Quote

Reply

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 problem: incorrect grid motion Fil FLUENT 4 January 3, 2015 14:14
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Fluent UDF Discontinuous Motion lequi7 Fluent UDF and Scheme Programming 2 November 4, 2011 00:18
Grid motion with UDF fivos Fluent UDF and Scheme Programming 2 February 27, 2011 05:51
UDF error CG Motion Alex FLUENT 0 March 22, 2006 18:40


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