# UDF for pressure profile at outlet:

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

 March 31, 2011, 16:49 UDF for pressure profile at outlet: #1 Member   Sandeep Join Date: Apr 2009 Location: Munich, Germany Posts: 30 Rep Power: 17 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

 April 1, 2011, 11:13 #2 Member   Sandeep Join Date: Apr 2009 Location: Munich, Germany Posts: 30 Rep Power: 17 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

 April 4, 2011, 05:54 #3 Senior Member   Max Join Date: Mar 2009 Posts: 133 Rep Power: 17 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

 April 4, 2011, 09:40 #4 Member   Sandeep Join Date: Apr 2009 Location: Munich, Germany Posts: 30 Rep Power: 17 thank you for the reply, udf is working

December 23, 2011, 04:27
#5
New Member

Pooya
Join Date: May 2010
Posts: 26
Rep Power: 15
Quote:
 Originally Posted by sandeep_tu 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?

 December 29, 2011, 18:33 #6 Senior Member   Real Name :) Join Date: Jan 2010 Location: United States Posts: 192 Rep Power: 16 One can impose any "physics" one wants in fluent. The two fractions likely have something to do with the setup of the problem. Yapoo likes this.

 November 14, 2014, 14:10 #7 New Member   AJK Join Date: Nov 2014 Posts: 6 Rep Power: 11 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.

November 27, 2014, 07:17
#8
Member

Sandeep
Join Date: Apr 2009
Location: Munich, Germany
Posts: 30
Rep Power: 17
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.
Attached Images
 events.jpg (56.0 KB, 49 views)

 December 3, 2014, 13:17 #9 New Member   AJK Join Date: Nov 2014 Posts: 6 Rep Power: 11 Thank you...it was really helpful. Sorry for late reply...