# Modify gravity via UDF

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

 June 22, 2015, 10:37 Modify gravity via UDF #1 New Member   witali Join Date: Jun 2015 Posts: 2 Rep Power: 0 Hello, i need some help. I am going to simulate a braking process in a tank, filled with water. so, therefore i do like to modify the x-gravity in udf. z-gravity is const = -9.81 m/sē. has anyone an idea how to adress the x-gravity component in the udf? this is my attempt for the udf: DEFINE_SOURCE(gx_source, c, t, dS, eqn) { real gx_source; real time = RP_Get_Real("flow-time"); if (time <= 0.4) { gx_source = 2 * pow(10,-9) * pow(time,4) + 296.74 * pow(time,3) - 178.05 * pow(time,2) + 2.6377 * time - 0.0296; } else if(time <= 3.1) { gx_source = -8.5; } else if(time <= 3.5) { gx_source = -2 * pow(10,-9) * pow(time,4) - 296.74 * pow(time,3) + 2937.8 * pow(time,2) - 9661.7 * pow(time,1) + 10551; } return (gx_source); } many thanks for your help!

 June 23, 2015, 00:09 #2 Senior Member   Vaze Join Date: Jun 2009 Posts: 134 Rep Power: 8 Hi The way you are incorportaing gx is correct. It will be body force/source in x momentum equaion. Please check on units of gx. It should be N/m^3. Best luck Vaze

 June 23, 2015, 01:53 #3 New Member   witali Join Date: Jun 2015 Posts: 2 Rep Power: 0 Hello vaze, first of all: thank you for your reply. I found something like -> C_R(c,t) and C_P(C,t). How do i have to use it now? I mean, do i have to multiplicate or to divide the gx-source with the C_R(C,t)/C_P(C,t)? For a testrun i multiplicated it, the visiualisation looked similar to the case, as if i use constant gravity in x direction. Furthermore, do C_R/C_P depend on the solver i use (pressure-based/density-based)?

 June 23, 2015, 04:23 #4 Senior Member   Vaze Join Date: Jun 2009 Posts: 134 Rep Power: 8 Hi static pressure = rho * gx * z or x distance Check that C_P corresponds to static pressure or not. if not then deduce it. all the best, Vaze

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post flotus1 Fluent UDF and Scheme Programming 2 April 12, 2015 05:55 fanch33 Fluent UDF and Scheme Programming 3 March 2, 2015 12:01 Juun Fluent UDF and Scheme Programming 0 July 28, 2014 09:13 Kristin Fluent UDF and Scheme Programming 3 March 15, 2012 07:43 shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14

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