# 3-D parabolic velocity Inlet - Steady state - UDF Turbulent Flow

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

 May 18, 2015, 05:17 Help Required for 3D parabolic Velocity Inlet UDF #2 New Member   Mohib Khan Join Date: Jan 2015 Posts: 24 Rep Power: 2 Hello, I want to apply a turbulent parabolic velocity inlet for a pipe outlet in 3D which is located 20m above the xy plane along z direction and velocity is in Z-negative direction.I am using power Law for turbulent. I have manged a code but it has lots of problem? Can any body can help me to make my code correct i will be really thank ful you guys.I need your helps guys. CODE is: #include "udf.h" #include "math.h" DEFINE_PROFILE(inlet_z_velocity, thread, index) { real xcoord; real ycoord; real zcoord; real a; real n; real Umax; real Umean; face_t f; begin_f_loop(f, thread) /*loops over all faces in the thread passed in the DEFINE macro argument*/ { F_CENTROID(x,f,thread); xcoord=x[0]; ycoord=x[1]; zcoord=x[2];; n = 7; d = 0.001; /* m */ Umean = 15; /* m/s */ Umax = Umean*(((n+1)*(2*n+1))/(2*pow(n,2))); a = pow((pow(y,2)+pow(z,2)),0.5); F_PROFILE(f, thread, index) = Umax*pow(1-sqrt(pow(xcoord,2)+pow(ycoord,2))/(d/2),(1/n)); } end_f_loop(f, thread) } Waiting for kind response.

 May 18, 2015, 05:31 #3 Member   Join Date: Jul 2013 Posts: 74 Rep Power: 4 #include "udf.h" #include "math.h" DEFINE_PROFILE(inlet_z_velocity, thread, index) { real xcoord; real ycoord; real zcoord; real a; real n; real Umax; real Umean; real d; face_t f; real x[ND_ND]; real y, z; begin_f_loop(f, thread) /*loops over all faces in the thread passed in the DEFINE macro argument*/ { F_CENTROID(x,f,thread); xcoord=x[0]; ycoord=x[1]; zcoord=x[2];; n = 7; d = 0.001; /* m */ Umean = 15; /* m/s */ y= ycoord;//¿? I don't know what you mean, could be this? z=zcoord;//¿? Umax = Umean*(((n+1)*(2*n+1))/(2*pow(n,2))); a = pow((pow(y,2)+pow(z,2)),0.5); F_PROFILE(f, thread, index) = Umax*pow((1-sqrt(pow(xcoord,2)+pow(ycoord,2))/(d/2)),(1/n));//some extra brackets are ok } end_f_loop(f, thread) }

 May 18, 2015, 05:32 #4 Senior Member   Join Date: Mar 2015 Posts: 468 Rep Power: 5 What velocity profile are you expecting from your velocity inlet and what velocity profile are you actually applying with this UDF? upeksa is correct in that you need to declare the variable "x" if you're using this variable with the F_CENTROID macro.

 May 18, 2015, 05:45 #5 New Member   Mohib Khan Join Date: Jan 2015 Posts: 24 Rep Power: 2 Hello upeksa and "e", Thanks a lot for your quick reply and i am really thankful to you.As i am new and i do not know much about UDF what i want is a parabolic velocity profile for a pipe outlet.That round section of that pipe outlet is 20m above the XY plane and my velocity is in negative z direction.So i need to make changes in this code.I have also find another code which is similar to that but i need to make it according to my case?Can you guys can help me? kindly check this code too: Thank you so much #include "udf.h" #include "math.h" DEFINE_PROFILE(inlet_x_velocity, thread, index) { real x[ND_ND]; /* this will hold the position vector */ real y; real z; real a n; real Umax Umean; face_t f; begin_f_loop(f, thread) /*loops over all faces in the thread passed in the DEFINE macro argument*/ { F_CENTROID(x,f,thread); y =x[1]; z =x[1]; n = 7; d = 10; /* cm */ Umean = 3.1; /* m/s */ Umax = Umean*(((n+1)*(2*n+1))/(2*pow(n,2))); a = pow((pow(y,2)+pow(z,2)),0.5); F_PROFILE(f, thread, index) = Umax*pow(1-sqrt(pow(x,2)+pow(z,2))/(d/2),(1/n)); } end_f_loop(f, thread) }

 May 18, 2015, 05:55 "e" #6 New Member   Mohib Khan Join Date: Jan 2015 Posts: 24 Rep Power: 2 I need a parabolic velocity Inlet at pipe in Negative Z direction.My case is in 3d the main problem is that so i am not getting help from any where although my problem is not that much complex one?

 May 18, 2015, 06:56 #7 Senior Member   Join Date: Mar 2015 Posts: 468 Rep Power: 5 Are you confusing the inlet and outlet boundary conditions, or are you intending to set a velocity outlet condition? Have you tried compiling your UDF and what are the results?

 May 18, 2015, 07:14 #8 Senior Member   Join Date: Nov 2013 Posts: 739 Rep Power: 10 You already have a code. You don't tell us what is wrong with it, so it is very difficult to help you. Does your code compile? If not, what are the error messages? If it compiles, did it do what you want it to do? If it did not, what did it do wrong?

May 18, 2015, 10:08
#9
New Member

Mohib Khan
Join Date: Jan 2015
Posts: 24
Rep Power: 2
Quote:
 Originally Posted by `e` Are you confusing the inlet and outlet boundary conditions, or are you intending to set a velocity outlet condition? Have you tried compiling your UDF and what are the results?
Hello e actually i do not have VS studio installed in my computer Also some other software.I have put them in torrents for downloading.But to save time i start understanding this code and i want to make changes in the code.
I want velocity Inlet profile in z direction that it.

Thanks a lot for co-ordinating

 May 18, 2015, 10:15 #10 Senior Member   Join Date: Nov 2013 Posts: 739 Rep Power: 10 There is no need to go to torrents to download software to compile UDFs... You can install the Microsoft Software Development Kit for free, without any legal difficulties.

May 18, 2015, 10:34
#11
New Member

Mohib Khan
Join Date: Jan 2015
Posts: 24
Rep Power: 2
Quote:
 Originally Posted by pakk There is no need to go to torrents to download software to compile UDFs... You can install the Microsoft Software Development Kit for free, without any legal difficulties.
Thanks a lot pakk for being nice.Your Kit help me a lot mine downloads were of 2.8 GBs
Thanks once again

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post dowlee OpenFOAM Running, Solving & CFD 6 August 27, 2015 05:26 cuteapathy CFX 14 March 20, 2012 07:45 shahzeb irfan Fluent UDF and Scheme Programming 6 June 23, 2011 16:40 Jongdae Kim FLUENT 0 June 15, 2004 11:21 Lisa Main CFD Forum 11 July 5, 2000 14:37

All times are GMT -4. The time now is 09:14.