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" 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) } |
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 |
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 |
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)
|
All times are GMT -4. The time now is 12:11. |