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

Sway Motion UDF?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread 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


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 problem: incorrect grid motion Fil FLUENT 5 December 19, 2020 09:16
Grid motion with UDF fivos Fluent UDF and Scheme Programming 5 June 30, 2018 08:50
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 3, 2011 23:18
UDF error CG Motion Alex FLUENT 0 March 22, 2006 17:40


All times are GMT -4. The time now is 04:51.