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

gravity direction

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 30, 2011, 11:48
Default gravity direction
  #1
New Member
 
Pietro Romanazzi
Join Date: Mar 2011
Posts: 5
Rep Power: 15
metello is on a distinguished road
Hello,

does anybody know if it's possible to change the direction of the gravity acceleration with a time dependent UDF?

Thanks!!
metello is offline   Reply With Quote

Old   March 30, 2011, 16:10
Default
  #2
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Hi,
I've done it before with a proper journal file. I don't think that it can be done with UDF!
Amir is offline   Reply With Quote

Old   March 30, 2011, 16:24
Default
  #3
New Member
 
Pietro Romanazzi
Join Date: Mar 2011
Posts: 5
Rep Power: 15
metello is on a distinguished road
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.
metello is offline   Reply With Quote

Old   March 31, 2011, 03:18
Default
  #4
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
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.
Amir is offline   Reply With Quote

Old   March 31, 2011, 07:56
Default
  #5
New Member
 
Pietro Romanazzi
Join Date: Mar 2011
Posts: 5
Rep Power: 15
metello is on a distinguished road
Great idea!
Could you be so kind to give me an example?
metello is offline   Reply With Quote

Old   March 31, 2011, 09:12
Default
  #6
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Quote:
Originally Posted by metello View Post
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.
Amir is offline   Reply With Quote

Old   March 31, 2011, 11:02
Default
  #7
New Member
 
Pietro Romanazzi
Join Date: Mar 2011
Posts: 5
Rep Power: 15
metello is on a distinguished road
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?
metello is offline   Reply With Quote

Old   March 31, 2011, 11:09
Default
  #8
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
I think, if you use C_R(c,t) as rho, FLUENT automatically account for that.
Amir is offline   Reply With Quote

Old   April 1, 2011, 10:10
Default
  #9
New Member
 
Pietro Romanazzi
Join Date: Mar 2011
Posts: 5
Rep Power: 15
metello is on a distinguished road
It works!

Thank you for all these aids Amir!
metello 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
MRFInterFoam: Trouble with direction of gravity / Continuity error cannot be removed bengt OpenFOAM Running, Solving & CFD 2 May 28, 2010 14:45
how to consider gravity in CFX shrimp CFX 4 September 8, 2008 20:41
changing gravity vector direction using UDF Nico FLUENT 0 September 7, 2006 12:00
Gravity component and inlet velocity Vidya FLUENT 8 July 31, 2006 08:28
Help: gravity in CFX Dejun Jing CFX 2 July 22, 2002 08:58


All times are GMT -4. The time now is 03:33.