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

UDF to modify gravity vector ?

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

Like Tree1Likes
  • 1 Post By ComputerGuy

Reply
 
LinkBack Thread Tools Display Modes
Old   January 20, 2012, 15:21
Default UDF to modify gravity vector ?
  #1
jpo
Member
 
Join Date: Apr 2009
Posts: 93
Rep Power: 8
jpo is on a distinguished road
Hello,

would anyone know how to write a UDF that modifies the definition of the gravity vector? Specifically, the magnitude of the gravity with altitude

Thank you
jpo is offline   Reply With Quote

Old   January 20, 2012, 15:41
Default
  #2
Senior Member
 
Real Name :)
Join Date: Jan 2010
Location: United States
Posts: 180
Rep Power: 7
ComputerGuy is on a distinguished road
Interesting problem. You might use a DEFINE_SOURCE macro for the x, y, or z momentum equations and specify whatever functional form of gravity you wanted. You can modify gravity (global) with the M_gravity[ND_ND] function, but it sounds like you want (effectively) cell-by-cell control.

Unchecked!
Code:
#include "udf.h"

DEFINE_SOURCE(grav_source,c,t,dS,eqn)
{
real mygrav=9.81; /*constant here, but could be some function of height.*/
real source;
source = mygrav*C_R(c,t); /*rho g */
return source;
}
ComputerGuy


Quote:
Originally Posted by jpo View Post
Hello,

would anyone know how to write a UDF that modifies the definition of the gravity vector? Specifically, the magnitude of the gravity with altitude

Thank you
jpo likes this.
ComputerGuy is offline   Reply With Quote

Old   January 20, 2012, 16:15
Default
  #3
jpo
Member
 
Join Date: Apr 2009
Posts: 93
Rep Power: 8
jpo is on a distinguished road
Thank you ComputerGuy, I appreciate your answer
jpo is offline   Reply With Quote

Old   January 24, 2012, 10:10
Default
  #4
jpo
Member
 
Join Date: Apr 2009
Posts: 93
Rep Power: 8
jpo is on a distinguished road
One clarification -

when you say "real mygrav=9.81;"
along what axis is this applied?

Thanks
jpo is offline   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
On demand UDF error RS FLUENT 0 May 10, 2007 12:54
Gravity, UDF Source & Operating Density. HELP ME! Brian FLUENT 0 November 1, 2005 16:17
variation of gravity with time rajani FLUENT 0 February 16, 2005 03:45
UDF to modify the value of a user defined scalar Raja Banerjee FLUENT 4 December 12, 2000 11:42
Modify the htc using UDF on NT frederic FLUENT 0 February 7, 2000 08:51


All times are GMT -4. The time now is 23:17.