# Sway Motion UDF?

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

 October 14, 2005, 12:51 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

 October 17, 2005, 01:39 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

 October 17, 2005, 01:51 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)

 October 17, 2005, 04:31 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

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

 October 18, 2005, 16:27 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?

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

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post fivos Fluent UDF and Scheme Programming 3 December 24, 2016 11:50 Fil FLUENT 4 January 3, 2015 14:14 Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20 lequi7 Fluent UDF and Scheme Programming 2 November 4, 2011 00:18 Alex FLUENT 0 March 22, 2006 18:40

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