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

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

 May 18, 2015, 06:17 Help Required for 3D parabolic Velocity Inlet UDF #2 Member   Mochibaru Join Date: Jan 2015 Location: Japan Posts: 41 Rep Power: 10 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, 06:31 #3 Member   Join Date: Jul 2013 Posts: 80 Rep Power: 11 #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, 06:32 #4 Senior Member   Join Date: Mar 2015 Posts: 892 Rep Power: 17 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, 06:45 #5 Member   Mochibaru Join Date: Jan 2015 Location: Japan Posts: 41 Rep Power: 10 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, 06:55 "e" #6 Member   Mochibaru Join Date: Jan 2015 Location: Japan Posts: 41 Rep Power: 10 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, 07:56 #7 Senior Member   Join Date: Mar 2015 Posts: 892 Rep Power: 17 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, 08:14 #8 Senior Member   Join Date: Nov 2013 Posts: 1,965 Rep Power: 25 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, 11:08
#9
Member

Mochibaru
Join Date: Jan 2015
Location: Japan
Posts: 41
Rep Power: 10
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, 11:15 #10 Senior Member   Join Date: Nov 2013 Posts: 1,965 Rep Power: 25 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, 11:34
#11
Member

Mochibaru
Join Date: Jan 2015
Location: Japan
Posts: 41
Rep Power: 10
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