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

adjusting gravity using UDFs

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 5, 2002, 22:08
Default adjusting gravity using UDFs
  #1
chriss
Guest
 
Posts: n/a
I need to adjust gravity every time step. Using Scheme this is straight forward but I can find how to do it using UDFs.

Any ideas.

  Reply With Quote

Old   May 6, 2002, 03:31
Default Re: adjusting gravity using UDFs
  #2
Henrik Widell
Guest
 
Posts: n/a
The M_gravity[ND_ND] array in models.h holds the gravity vector, so you can change gravity by changing the values in this array. I need no "include models.h" statement, I think, since this header file seems to be included through udf.h - but I might be mistaken on this.

ND_ND is 2 for a 2D case and 3 for a 3D case...

Regards,

Henrik
  Reply With Quote

Old   May 7, 2002, 00:07
Default Re: adjusting gravity using UDFs
  #3
chriss
Guest
 
Posts: n/a
Great.

Will that work with interpreted UDF's? I tried referencing M_gravity[0] with and without #include "models.h" and the preprocessor complained.

Thanks.
  Reply With Quote

Old   May 7, 2002, 03:01
Default Re: adjusting gravity using UDFs
  #4
Henrik Widell
Guest
 
Posts: n/a
What version are you using? In FLUENT 6 M_gravity is in models.h, but in FLUENT 5 it is in flow.h - both should be included if you have included udf.h though.

Will it work in interpreted UDFs? To be honest, I don't know - I gave up using the interpreted UDFs long ago, because of all the limitations and bugs. A C compiler isn't that expensive...and it saves me a lot of grief.

Henrik
  Reply With Quote

Old   May 8, 2002, 09:09
Default Re: adjusting gravity using UDFs
  #5
Greg Perkins
Guest
 
Posts: n/a
If that doesn't work, you can always add the gravity as a source term = pg to the momentum equations using your own udf. I haven't done this but I can't see why it wouldn't work.

Of course, modifying the internal gravity vector is a bit better if its possible for your interpreted udfs.

I too think compiled udfs are the way to go - interpreted stuff is generally more of a hassle. Also, I've found a unix/linux platform better than a Windows platform.

Greg
  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
Unsteady and Flux UDFs for UDSs tom FLUENT 0 February 13, 2009 11:27
how to consider gravity in CFX shrimp CFX 4 September 8, 2008 21:41
Use UDFs to change gravity vector in part ofdomain Nico FLUENT 0 August 29, 2006 07:15
Help: gravity in CFX Dejun Jing CFX 2 July 22, 2002 09:58
On gravity modelling... Drona CFX 7 November 22, 2001 11:28


All times are GMT -4. The time now is 12:28.