|
[Sponsors] |
June 22, 2015, 11:37 |
Modify gravity via UDF
|
#1 |
New Member
witali
Join Date: Jun 2015
Posts: 4
Rep Power: 11 |
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, 01:09 |
|
#2 |
Senior Member
Vaze
Join Date: Jun 2009
Posts: 172
Rep Power: 17 |
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, 02:53 |
|
#3 |
New Member
witali
Join Date: Jun 2015
Posts: 4
Rep Power: 11 |
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, 05:23 |
|
#4 |
Senior Member
Vaze
Join Date: Jun 2009
Posts: 172
Rep Power: 17 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Modify gravity through UDF | flotus1 | Fluent UDF and Scheme Programming | 2 | April 12, 2015 06:55 |
modify a intern variable of Fluent with scheme and UDF | fanch33 | Fluent UDF and Scheme Programming | 3 | March 2, 2015 12:01 |
How can I modify surface reaction using UDF | Juun | Fluent UDF and Scheme Programming | 0 | July 28, 2014 10:13 |
parse error while interpreting udf | Kristin | Fluent UDF and Scheme Programming | 3 | March 15, 2012 07:43 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 23:14 |