CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

3D Velocity profile for turbulent flow

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 17, 2014, 05:17
Default 3D Velocity profile for turbulent flow
  #1
New Member
 
Kirill
Join Date: Jul 2014
Posts: 7
Rep Power: 12
Kirill is on a distinguished road
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!
Kirill is offline   Reply With Quote

Old   July 17, 2014, 08:14
Default
  #2
New Member
 
Kirill
Join Date: Jul 2014
Posts: 7
Rep Power: 12
Kirill is on a distinguished road
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)

}
Kirill is offline   Reply With Quote

Old   July 17, 2014, 09:17
Default
  #3
New Member
 
Kirill
Join Date: Jul 2014
Posts: 7
Rep Power: 12
Kirill is on a distinguished road
I apply the my UDFFile in Fluent and the error is occured:


Please, can somebody help me?
Attached Images
File Type: jpg Error.jpg (78.1 KB, 41 views)
Kirill is offline   Reply With Quote

Old   July 17, 2014, 09:42
Default
  #4
New Member
 
Kirill
Join Date: Jul 2014
Posts: 7
Rep Power: 12
Kirill is on a distinguished road
changed the variable in 12-th line on z.
And Now error is in 30 and 32-th lines?
Attached Images
File Type: jpg error_02.jpg (59.5 KB, 28 views)
Kirill is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 16:03.