CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF For Constant Pressure term (http://www.cfd-online.com/Forums/fluent-udf/111612-udf-constant-pressure-term.html)

 dreamchaser January 10, 2013 19:47

UDF For Constant Pressure term

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"
{

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

if (t<1)
{
{
F_PROFILE (f, thread, position )= 400,000;
}
//----------------------------------------------------
}
else
{
F_PROFILE (f, thread, position )= 0;
}
}

 beer January 10, 2013 20:39

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 :D

Greetings

 dreamchaser January 15, 2013 21:47

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.