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

Modify gravity via UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 22, 2015, 10:37
Default Modify gravity via UDF
  #1
New Member
 
witali
Join Date: Jun 2015
Posts: 4
Rep Power: 10
bluebelly is on a distinguished road
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!
bluebelly is offline   Reply With Quote

Old   June 23, 2015, 00:09
Default
  #2
Senior Member
 
Vaze
Join Date: Jun 2009
Posts: 172
Rep Power: 16
mvee is on a distinguished road
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
mvee is offline   Reply With Quote

Old   June 23, 2015, 01:53
Default
  #3
New Member
 
witali
Join Date: Jun 2015
Posts: 4
Rep Power: 10
bluebelly is on a distinguished road
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)?
bluebelly is offline   Reply With Quote

Old   June 23, 2015, 04:23
Default
  #4
Senior Member
 
Vaze
Join Date: Jun 2009
Posts: 172
Rep Power: 16
mvee is on a distinguished road
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
mvee is offline   Reply With Quote

Reply


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
Modify gravity through UDF flotus1 Fluent UDF and Scheme Programming 2 April 12, 2015 05:55
modify a intern variable of Fluent with scheme and UDF fanch33 Fluent UDF and Scheme Programming 3 March 2, 2015 11:01
How can I modify surface reaction using UDF Juun Fluent UDF and Scheme Programming 0 July 28, 2014 09:13
parse error while interpreting udf Kristin Fluent UDF and Scheme Programming 3 March 15, 2012 06:43
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14


All times are GMT -4. The time now is 09:54.