# gravity direction

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 March 30, 2011, 11:48 gravity direction #1 New Member   Pietro Romanazzi Join Date: Mar 2011 Posts: 5 Rep Power: 8 Hello, does anybody know if it's possible to change the direction of the gravity acceleration with a time dependent UDF? Thanks!!

 March 30, 2011, 16:10 #2 Senior Member     Amir Join Date: May 2009 Location: Montreal, QC Posts: 739 Blog Entries: 1 Rep Power: 16 Hi, I've done it before with a proper journal file. I don't think that it can be done with UDF!

 March 30, 2011, 16:24 #3 New Member   Pietro Romanazzi Join Date: Mar 2011 Posts: 5 Rep Power: 8 Thanky you for the reply, I was thinking to use a journal file as well, but I tried write this UDF. Unfortunately it's wrong because "gravity" isn't the variable right name. Do you know which could be the proper one? #include "udf.h" #define PI 3.14159 DEFINE_ADJUST(gravity_change,d) { cell_t c; Thread *t; real gr[ND_ND]; real time=RP_Get_Real("flow-time"); if (time<0.25) gr[0]=9.81*sin(PItime*4/0.25); gr[1]=9.81*cos(PI/180*time*4/0.25); gravity[0]=RP_Set_Real(gr[0]); gravity[1]=RP_Set_Real(gr[1]); } Last edited by metello; March 31, 2011 at 07:57.

 March 31, 2011, 03:18 #4 Senior Member     Amir Join Date: May 2009 Location: Montreal, QC Posts: 739 Blog Entries: 1 Rep Power: 16 if you want to write a UDF, I have a suggestion. you can implicitly involve a gravitational effect by importing a source term in momentum equations, here it doesn't need to activate gravity effect in fluent instead write 2 UDFs for x and y momentum equations via DEFINE_SOURCE macro.

 March 31, 2011, 07:56 #5 New Member   Pietro Romanazzi Join Date: Mar 2011 Posts: 5 Rep Power: 8 Great idea! Could you be so kind to give me an example?

March 31, 2011, 09:12
#6
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 739
Blog Entries: 1
Rep Power: 16
Quote:
 Originally Posted by metello Great idea! Could you be so kind to give me an example?
of course,
your x and y momentum sources change with time. e.g. for rotating gravity it would be:
s_x=rho*g*cos(wt)
s_y=rho*g*sin(wt)

to implement a DEFINE_SOURCE UDF you can refer to UDF manual. I think it's clear.

 March 31, 2011, 11:02 #7 New Member   Pietro Romanazzi Join Date: Mar 2011 Posts: 5 Rep Power: 8 I really don't know how to thank you! But I have another question, I hope it will be the last! Since my problem is multiphase, is it possible to read Rho or is it suppose to be a constant?

 March 31, 2011, 11:09 #8 Senior Member     Amir Join Date: May 2009 Location: Montreal, QC Posts: 739 Blog Entries: 1 Rep Power: 16 I think, if you use C_R(c,t) as rho, FLUENT automatically account for that.

 April 1, 2011, 10:10 #9 New Member   Pietro Romanazzi Join Date: Mar 2011 Posts: 5 Rep Power: 8 It works! Thank you for all these aids Amir!

 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 bengt OpenFOAM Running, Solving & CFD 2 May 28, 2010 14:45 shrimp CFX 4 September 8, 2008 20:41 Nico FLUENT 0 September 7, 2006 12:00 Vidya FLUENT 8 July 31, 2006 08:28 Dejun Jing CFX 2 July 22, 2002 08:58

All times are GMT -4. The time now is 22:32.

 Contact Us - CFD Online - Privacy Statement - Top