CFD Online URL
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

UDF_parabolic velocity profile

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 22, 2011, 06:28
Smile UDF_parabolic velocity profile
  #1
Member
 
ThanhToan
Join Date: Sep 2010
Posts: 47
Rep Power: 6
trantoan2008 is on a distinguished road
Send a message via Yahoo to trantoan2008 Send a message via Skype™ to trantoan2008
Hi All,

I am studying fully developed flow in tube by using UDFs. The inlet face is on the X-Z plane and the velocity is parabolic profile and normal to the face in the Y direction. After I run some iteration, I checked profile velocity at inlet boundary condition. However, I did not see parabolic profile at inlet condition. Below code as following:


#include "udf.h" /* must be at the beginning of every UDF you write */
#include "math.h"
DEFINE_PROFILE(inlet_y_velocity,thread,index)
{
real y[ND_ND];
real z,x,r;
#define R 1.615 /* Radius of geometry at inlet region */
#define V 36
#define n 1
face_t f;
begin_f_loop(f,thread) /* loops over all faces in the thread passed in the DEFINE macro argument */
{
F_CENTROID(y,f,thread);
x=y[1];
z=y[2];
r=pow((pow(x,2)+pow(z,2)),0.5);
F_PROFILE(f,thread,index) = V*((3*n+1)/(n+1))*(1-pow((r/R),(n+1)/n));
}
end_f_loop(f,thread)
}

There are somethings wrong here? Anybody help me.
trantoan2008 is offline   Reply With Quote

Old   February 22, 2011, 09:26
Default
  #2
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 738
Blog Entries: 1
Rep Power: 13
Amir is on a distinguished road
Hi,
I think here's the problem:
Quote:
Originally Posted by trantoan2008 View Post
F_CENTROID(y,f,thread);
x=y[1];
z=y[2];
try this:
Quote:
F_CENTROID(y,f,thread);
x=y[0];
z=y[2];
Amir is offline   Reply With Quote

Old   February 22, 2011, 09:49
Smile
  #3
Member
 
ThanhToan
Join Date: Sep 2010
Posts: 47
Rep Power: 6
trantoan2008 is on a distinguished road
Send a message via Yahoo to trantoan2008 Send a message via Skype™ to trantoan2008
Hi Amir,

Thanks for your help. According to your instruction, I check accuracy inlet boundary condition. It's obsolutely accuracy.

Best Regard,
Tran Toan
trantoan2008 is offline   Reply With Quote

Reply

Tags
parabolic velocity, udfs

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[UDF] Relative coordinates in logarithmic velocity profile cfdworker Fluent UDF and Scheme Programming 23 November 17, 2014 04:14
Logarithmic velocity profile cfdworker Fluent UDF and Scheme Programming 0 April 23, 2009 20:09
[boundary condition] logarithmic velocity profile cfdworker FLUENT 2 April 18, 2009 00:36
Prescribed inflow velocity profile - how to? Alan Main CFD Forum 10 October 28, 2005 13:14
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 10:11


All times are GMT -4. The time now is 21:54.