CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > 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 Search this Thread Display Modes
Old   January 20, 2012, 15:21
Default UDF to modify gravity vector ?
  #1
jpo
Member
 
Join Date: Apr 2009
Posts: 94
Rep Power: 17
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: 192
Rep Power: 16
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: 94
Rep Power: 17
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: 94
Rep Power: 17
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 Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modify the htc using UDF on NT frederic FLUENT 1 February 24, 2020 00:26
UDF to modify the value of a user defined scalar Raja Banerjee Fluent UDF and Scheme Programming 5 March 5, 2019 15:19
On demand UDF error RS FLUENT 0 May 10, 2007 13: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


All times are GMT -4. The time now is 06:35.