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 pressure profile at outlet: (http://www.cfd-online.com/Forums/fluent-udf/86741-udf-pressure-profile-outlet.html)

 sandeep_tu March 31, 2011 16:49

UDF for pressure profile at outlet:

Hello everyone,

Could any one please help me in writing an UDF for pressure profile at outlet which is varying with respect to Z direction in 3-D case i.e,

p = -1.2*9.81*101325*(z-1)*((1/293)-(1/290))

thanks
Sandeep

 sandeep_tu April 1, 2011 11:13

I tried to write an udf (pressure profile) for my case, could any one please help if I am in the right path.
As the outlet in my case is in XZ plane perpendicular to Y direction.

#include "udf.h"
{
real y[ND_ND];
real z;
face_t f;
{
z=y[2];
}
}

can anyone please explain these two commands real y[ND_ND]; and z=y[2];

thank you
Sandeep

 coglione April 4, 2011 05:54

With y[ND_ND] you define a vector of length ND_ND, which will be set automatically to 2 for 2-D and 3 for 3-D problems. Thus in 3-D y will have 3 components (y[0],y[1],y[2]) and as you fill it with the coordinates (x,y,z) of a face f, y[2] returns the z-component.

cheers

 sandeep_tu April 4, 2011 09:40

thank you for the reply, udf is working :)

 Yapoo December 23, 2011 05:27

Quote:
 Originally Posted by sandeep_tu (Post 301859) I tried to write an udf (pressure profile) for my case, could any one please help if I am in the right path. As the outlet in my case is in XZ plane perpendicular to Y direction. #include "udf.h" DEFINE_PROFILE(pressure_profile,thread,index) { real y[ND_ND]; real z; face_t f; begin_f_loop(f,thread) { F_CENTROID(y,f,thread); z=y[2]; F_PROFILE(f,thread,index) = -1.2*9.81*101325*(z-1)*((1/293)-(1/290)); } end_f_loop(f,thread) } can anyone please explain these two commands real y[ND_ND]; and z=y[2]; thank you Sandeep
Dear freind
i have a questions why are you using ((1/293)-(1/290)) in your profile equation?

 ComputerGuy December 29, 2011 19:33

One can impose any "physics" one wants in fluent. The two fractions likely have something to do with the setup of the problem.

 flashkicker November 14, 2014 15:10

Hi, I am looking for the UDF to close and open the pressure outlet wrt time. I am really new to UDF. Any help would be appreciated.

 sandeep_tu November 27, 2014 08:17

1 Attachment(s)
For your problem, you can also try with defining events. All you need is dynamic mesh model. In the dynamic mesh model, events can be defined.

I've attached a picture, where you can see how to enable the events. Just enable the dynamic mesh model. Then you are able to access the panel to define time-dependent events.

 flashkicker December 3, 2014 14:17

Thank you...it was really helpful. Sorry for late reply...

 All times are GMT -4. The time now is 16:13.