|
[Sponsors] |
January 20, 2012, 15:21 |
UDF to modify gravity vector ?
|
#1 |
Member
Join Date: Apr 2009
Posts: 94
Rep Power: 17 |
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 |
|
January 20, 2012, 15:41 |
|
#2 |
Senior Member
Real Name :)
Join Date: Jan 2010
Location: United States
Posts: 192
Rep Power: 16 |
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; } |
|
January 20, 2012, 16:15 |
|
#3 |
Member
Join Date: Apr 2009
Posts: 94
Rep Power: 17 |
Thank you ComputerGuy, I appreciate your answer
|
|
January 24, 2012, 10:10 |
|
#4 |
Member
Join Date: Apr 2009
Posts: 94
Rep Power: 17 |
One clarification -
when you say "real mygrav=9.81;" along what axis is this applied? Thanks |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |