CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   Time dependant gravity (

harikrishnan_k December 18, 2012 04:00

Time dependant gravity
Hi all,

I am simulating sloshing in a fuel tank using VOF. I want to provide time dependant gravity to simulate vibration. Could you please help on this?

Thanks and regards,

sicfred December 19, 2012 11:53


1) you have to define an UDF for the time dependant gravity (Source Term). If you know the equation of time, lets say g=sin(pi*t) you can use this UDF:

#include "udf.h"
#define w 3.141592654 /* Frequency of the vibration in rad/s */

#define A 4.0 /* Maximum aceleration */
#define Durac 5.0 /* Duration of the vibrationin seconds */

real time;
real source;






return source;

2) Interpret this UDF.
3)In cell zone conditions enable source terms, then go to source terms and select momentum equation -->UDF---> and select GravDin.
4)You can define more than one source terms in the same UDF, just copying and changing the name of the source, for example GravDinX (for gravity in the x direction)

Hope it hepls you.

harikrishnan_k December 24, 2012 10:09

Hello sicfred,
Thanks for your reply. I do not have a proper function for the vibration profile (Random vibration). I was told that Fluent has an option to provide gravity w.r.t time as a table format and could be downloaded from the users portal. I could not get it from the users portal. Please help me if you have a clue on this.

Thanks and regards,

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