|
[Sponsors] |
January 10, 2013, 19:47 |
UDF For Constant Pressure term
|
#1 |
Member
Mike
Join Date: Jun 2012
Posts: 58
Rep Power: 14 |
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) } |
|
January 10, 2013, 20:39 |
|
#2 |
Member
Join Date: Dec 2012
Posts: 92
Rep Power: 14 |
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 |
|
January 15, 2013, 21:47 |
|
#3 |
Member
Mike
Join Date: Jun 2012
Posts: 58
Rep Power: 14 |
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 |
|
January 16, 2013, 13:57 |
|
#4 |
Member
Join Date: Dec 2012
Posts: 92
Rep Power: 14 |
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)
|
|
|
|
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 |