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

UDF For Constant Pressure term

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 10, 2013, 19:47
Default UDF For Constant Pressure term
  #1
Member
 
Mike
Join Date: Jun 2012
Posts: 55
Rep Power: 5
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: 78
Rep Power: 4
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: 55
Rep Power: 5
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: 78
Rep Power: 4
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

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
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 08:20
UDF for transient pressure inlet, mass flow check at nozzle exit and volumetric heat kokoory FLUENT 0 August 17, 2011 02:07
UDF for pressure at outlet mireis FLUENT 0 August 12, 2010 06:19
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 22:02


All times are GMT -4. The time now is 11:38.