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

UDF For Constant Pressure term

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 10, 2013, 19:47
Default UDF For Constant Pressure term
  #1
Member
 
Mike
Join Date: Jun 2012
Posts: 58
Rep Power: 14
dreamchaser is on a distinguished road
Hey everyone,

I have a square tank and I want to apply a constant pressure of 400kPa for just 1s at the bottom. i want to see how the fluid velocity vectors react to this pressure force. However, I am having troulble with the UDF For this. My UDF is below. For some reason the pressure is only applied in the first time interval and shuts off after. I would really appreciate it if you can please help me.


#include "udf.h"
DEFINE_PROFILE (unsteady_pressure, thread, position)
{

face_t f;
real t= CURRENT_TIME;
printf("current time is %f\n",t);

if (t<1)
{
begin_f_loop (f,thread)
{
F_PROFILE (f, thread, position )= 400,000;
}
end_f_loop (f,thread)
//----------------------------------------------------
}
else
{
begin_f_loop (f,thread)
F_PROFILE (f, thread, position )= 0;
}
end_f_loop (f,thread)
}
dreamchaser is offline   Reply With Quote

Old   January 10, 2013, 20:39
Default
  #2
Member
 
Join Date: Dec 2012
Posts: 92
Rep Power: 13
beer is on a distinguished road
Hi
First: Did you chose the transient solver? I think CURRENT_TIME is only available for transient solutions.
Second: Is "400,000" just a typing error? Usually C can't read a commas.
For C Codes you should write "400000." or "4e5".
Everything else seems ok to me, but it's late, so no guarantee

Greetings
beer is offline   Reply With Quote

Old   January 15, 2013, 21:47
Default
  #3
Member
 
Mike
Join Date: Jun 2012
Posts: 58
Rep Power: 14
dreamchaser is on a distinguished road
Hello thanks alot for the help. Your right. I needed to get rid of the comma.

However, my pressure boundary condition is not holding. The pressure is only 400000 for the first time step and then starts decreasing.
Do you know why this is happening?
For some reason, its not holding the pressure boundary condition.
I apprecite your help
thanks
dreamchaser is offline   Reply With Quote

Old   January 16, 2013, 13:57
Default
  #4
Member
 
Join Date: Dec 2012
Posts: 92
Rep Power: 13
beer is on a distinguished road
I donīt know your case, so I just can guess what it is. The pressure on the boundary is by default the gauge pressure, maybe you look at the wrong pressure (pabs)
beer 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
UDF for pressure at outlet mireis FLUENT 1 October 1, 2018 13:55
Accelerating pre and checking the mfr at exit how to hook udf to Pressure inlet(BC) kokoory Fluent UDF and Scheme Programming 0 August 17, 2011 09:20
UDF for transient pressure inlet, mass flow check at nozzle exit and volumetric heat kokoory FLUENT 0 August 17, 2011 03:07
correct UDF code for unsteady pressure boundary James W FLUENT 0 November 2, 2005 12:38
Gas pressure question Dan Moskal Main CFD Forum 0 October 24, 2002 23:02


All times are GMT -4. The time now is 14:00.