|
[Sponsors] |
July 17, 2014, 05:17 |
3D Velocity profile for turbulent flow
|
#1 |
New Member
Kirill
Join Date: Jul 2014
Posts: 7
Rep Power: 12 |
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, 08:14 |
|
#2 |
New Member
Kirill
Join Date: Jul 2014
Posts: 7
Rep Power: 12 |
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, 09:17 |
|
#3 |
New Member
Kirill
Join Date: Jul 2014
Posts: 7
Rep Power: 12 |
I apply the my UDFFile in Fluent and the error is occured:
Please, can somebody help me? |
|
July 17, 2014, 09:42 |
|
#4 |
New Member
Kirill
Join Date: Jul 2014
Posts: 7
Rep Power: 12 |
changed the variable in 12-th line on z.
And Now error is in 30 and 32-th lines? |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to calculate mean velocity profile for channel flow | michel1988 | OpenFOAM Post-Processing | 3 | November 20, 2019 10:09 |
3D parabolic velocity profile for channel flow | seetaratnam | FLUENT | 1 | August 10, 2016 04:08 |
Problem with assigned inlet velocity profile as a boundary condition | Ozgur_ | FLUENT | 5 | August 25, 2015 05:58 |
How to apply an outlet velocity profile to another inlet? | siw | FLUENT | 4 | April 10, 2013 12:19 |
Variables Definition in CFX Solver 5.6 | R P | CFX | 2 | October 26, 2004 03:13 |