# Simulation of sloshing by time varying gravity

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

 August 19, 2005, 03:25 Simulation of sloshing by time varying gravity #1 Manoj Kumar Guest   Posts: n/a Hi I am trying to simulate sloshing in a tank. I tried solving the problem by adding a source term in the momentum equation using following code.. #include "udf.h" #define pie 3.141592654 DEFINE_SOURCE(cell_x_source, cell, thread, dS, eqn) { real source; /* source term */ source=(-0.15)*pow((2*pie/1.70),2)*C_R(cell,thread)*sin((2*pie/1.70)*CURRENT_TIME); dS[eqn] = 0.; return source; } I compared my results with published experimental and CFD results, and found that the change in freesurface with time is not matching. Now I want to solve the problem by using a time varying gravity. Is follwing code sufficient ? #include "udf.h" #DEFINE g 9.81 #DEFINE pie 3.14 #DEFINE timeperiod 1.70 DEFINE_ADJUST(my_adjust,d) { M_gravity[ND_ND]=g*sin((2*pie/timeperiod)*CURRENT_TIME); } Thanks Manoj

 August 19, 2005, 03:29 Re: Simulation of sloshing by time varying gravity #2 Manoj Kumar Guest   Posts: n/a The codes are .. #include "udf.h" #define pie 3.141592654 DEFINE_SOURCE(cell_x_source, cell, thread, dS, eqn) { real source; /* source term */ source=(-0.15)*pow((2*pie/1.70),2)*C_R(cell,thread)*sin((2*pie/1.70)*CURRENT_TIME); dS[eqn] = 0.; return source; } and #include "udf.h" #DEFINE g 9.81 #DEFINE pie 3.14 #DEFINE timeperiod 1.70 DEFINE_ADJUST(my_adjust,d) { M_gravity[ND_ND]=g*sin((2*pie/timeperiod)*CURRENT_TIME); }

 November 30, 2009, 21:01 #3 New Member   Saeed Abbasi Join Date: Sep 2009 Location: Iran Posts: 20 Rep Power: 15 Dear friend, I utilized your posts very much. I appreciate your activities. Thanks a lot. Saeed

 June 13, 2011, 04:34 gravity variation in Fluent? #4 New Member   Joyi Wang Join Date: Apr 2010 Posts: 8 Rep Power: 14 Hi, for the second method, I've tried to implement your code in Fluent 6.3 but it can not recognize the item "M-gravity". Does anyone know the definition of gravity in Fluent code,? I can't find it in the udf manual.