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

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

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 12, 2015, 11:29
Default 3-D parabolic velocity Inlet - Steady state - UDF Turbulent Flow
  #1
Member
 
Mochibaru
Join Date: Jan 2015
Location: Japan
Posts: 41
Rep Power: 11
mohibanwar is on a distinguished road
Hello Members,Senior Members,And all others who can help me out,

I am currently seeking help for the 3-D parabolic velocity Inlet UDF for turbulent flow as i have already seen the Fluent User UDF Manual for my case but there i only found a 2d Case and that was not for turbulent inlet velocity profile?
Can any body help me how to fix my problem as i am new User of Fluent and do not know much about UDF and velocity Inlet profiles?

Your Helping Hand will be highly appreciated.

I only found this code but i am not sure whether this will work for my case or not?My case is the velocity Inlet in Negative direction while pipe inlet is 20 mm above XY plane.
Need your Help plzzz.Thanks.

#include "udf.h"

#define PIPE_DIAMETER 10.e-3 // Set here the diameter of your pipe in meters

#define AVG_Z_VELOCITY 1. // Set here the average z velocity at inlet in m/s

DEFINE_PROFILE(paraboloid_velocity, thread, position) { real x[ND_ND];

real coeff,r,v_max;

face_t f;

r = PIPE_DIAMETER/2.; //Calculating radius

v_max = 2.*AVG_Z_VELOCITY; //Calculating paraboloid vertex z (max velocity)

coeff = -v_max/pow(r,2.);

begin_f_loop(f, thread)

{

F_CENTROID(x,f,thread);

F_PROFILE(f, thread, position) = coeff*(pow(x[0],2.) + pow(x[1],2)) + v_max;

} end_f_loop(f, thread) }
mohibanwar is offline   Reply With Quote

Old   May 18, 2015, 06:17
Default Help Required for 3D parabolic Velocity Inlet UDF
  #2
Member
 
Mochibaru
Join Date: Jan 2015
Location: Japan
Posts: 41
Rep Power: 11
mohibanwar is on a distinguished road
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.
mohibanwar is offline   Reply With Quote

Old   May 18, 2015, 06:31
Default
  #3
Member
 
Join Date: Jul 2013
Posts: 80
Rep Power: 13
upeksa is on a distinguished road
#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)
}
upeksa is offline   Reply With Quote

Old   May 18, 2015, 06:32
Default
  #4
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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.
`e` is offline   Reply With Quote

Old   May 18, 2015, 06:45
Default
  #5
Member
 
Mochibaru
Join Date: Jan 2015
Location: Japan
Posts: 41
Rep Power: 11
mohibanwar is on a distinguished road
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)
}
mohibanwar is offline   Reply With Quote

Old   May 18, 2015, 06:55
Default "e"
  #6
Member
 
Mochibaru
Join Date: Jan 2015
Location: Japan
Posts: 41
Rep Power: 11
mohibanwar is on a distinguished road
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?
mohibanwar is offline   Reply With Quote

Old   May 18, 2015, 07:56
Default
  #7
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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?
`e` is offline   Reply With Quote

Old   May 18, 2015, 08:14
Default
  #8
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
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?
pakk is offline   Reply With Quote

Old   May 18, 2015, 11:08
Default
  #9
Member
 
Mochibaru
Join Date: Jan 2015
Location: Japan
Posts: 41
Rep Power: 11
mohibanwar is on a distinguished road
Quote:
Originally Posted by `e` View Post
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
mohibanwar is offline   Reply With Quote

Old   May 18, 2015, 11:15
Default
  #10
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
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.
pakk is offline   Reply With Quote

Old   May 18, 2015, 11:34
Default
  #11
Member
 
Mochibaru
Join Date: Jan 2015
Location: Japan
Posts: 41
Rep Power: 11
mohibanwar is on a distinguished road
Quote:
Originally Posted by pakk View Post
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
mohibanwar 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
Issues on the simulation of high-speed compressible flow within turbomachinery dowlee OpenFOAM Running, Solving & CFD 11 August 6, 2021 07:40
UDF for 3d inlet parabolic velocity profile ? shahzeb irfan Fluent UDF and Scheme Programming 10 March 28, 2016 16:00
error message cuteapathy CFX 14 March 20, 2012 07:45
UDF problem : inlet velocity in cyl. coord. system Jongdae Kim FLUENT 0 June 15, 2004 12:21
About the difference between steady and unsteady problems Lisa Main CFD Forum 11 July 5, 2000 15:37


All times are GMT -4. The time now is 05:56.