# 3D Velocity profile for turbulent flow

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 July 17, 2014, 04:17 3D Velocity profile for turbulent flow #1 New Member   Kirill Join Date: Jul 2014 Posts: 7 Rep Power: 11 To all good day! I have small experience with programming and working with Fluen. I need to create the velocity profile on inlet! How I had read posts, I will need to make the UDF file for profile. I have the turbulent flow. Location axis is the next: Z - along the pipe, X, Y - perpendicular to the axis Z. The equation of velocity is the next: U=u'*(((n+1)*(2n+1))/((2n)^2))*(1-r/R)^(1/n) where u' - the average velocity, u'=Q/A, Q -flow rate, A - area of inlet n=1,66*log(Re), in my model the n I take 9. R - dia/2 of inlet (radius) How I seen, I have two variant of creating of UDF file. 1) to make the two UDF files for z-x plane of velocity profile and UDF file for z-y plane of velocity profile. 2) to make one UDF file for common velocity profile. If I use the first variant of decision. The text of UDF file will be the next: #include "udf.h" #define Q 4.444e-3 //unit m3/sec #define Diameter 0.158 //unit m #define n 9 DEFINE_PROFILE(inlet_zx_velocity,t,i) { real x[ND_ND]; real y; real U,A,Um,K,Kn,Ko,R; A=(M_PI/4.0)*pow(Diameter,2); Um=Q/A; Kn=((n+1)*(2*n+1))/(2*pow(n,2)); Ko=1/n; K=Um*Kn; R=Diameter/2; face_t f; begin_f_loop(f,t) { F_CENTROID(x,f,t); y = x[1]; U = pow(1-y/R,Ko); F_PROFILE(f,t,i) = K*U; } end_f_loop(f,t) } How to modify this UDF file to realize the second variant: The one UDF file? And how to write down the equation of y=log(X), for example? Many thanks!

 July 17, 2014, 07:14 #2 New Member   Kirill Join Date: Jul 2014 Posts: 7 Rep Power: 11 If I think right, that the UDF File for 3D turbulent velocity profile will be: #include "udf.h" #define Q 4.444e-3 //unit m3/sec #define Diameter 0.158 //unit m #define n 9 DEFINE_PROFILE(inlet_z_velocity,t,i) { real x[ND_ND]; real x; real y; real U,A,Um,K,Kn,Ko,R,rad; A=(M_PI/4.0)*pow(Diameter,2); Um=Q/A; Kn=((n+1)*(2*n+1))/(2*pow(n,2)); Ko=1/n; K=Um*Kn; R=Diameter/2; face_t f; begin_f_loop(f,t) { F_CENTROID(x,f,t); x = x[0]; y = x[1]; rad = pow(x*x+y*y,0.5); U = pow(1-rad/R,Ko); F_PROFILE(f,t,i) = K*U; } end_f_loop(f,t) }

July 17, 2014, 08:17
#3
New Member

Kirill
Join Date: Jul 2014
Posts: 7
Rep Power: 11
I apply the my UDFFile in Fluent and the error is occured:

Please, can somebody help me?
Attached Images
 Error.jpg (78.1 KB, 41 views)

July 17, 2014, 08:42
#4
New Member

Kirill
Join Date: Jul 2014
Posts: 7
Rep Power: 11
changed the variable in 12-th line on z.
And Now error is in 30 and 32-th lines?
Attached Images
 error_02.jpg (59.5 KB, 27 views)

 Thread Tools Search this Thread Search this Thread: Advanced Search 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 Off Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post michel1988 OpenFOAM Post-Processing 3 November 20, 2019 09:09 seetaratnam FLUENT 1 August 10, 2016 03:08 Ozgur_ FLUENT 5 August 25, 2015 04:58 siw FLUENT 4 April 10, 2013 11:19 R P CFX 2 October 26, 2004 02:13

All times are GMT -4. The time now is 15:30.

 Contact Us - CFD Online - Privacy Statement - Top