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

Velocity boundary condtion UDF help

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 8, 2012, 17:31
Default Velocity boundary condtion UDF help
  #1
Member
 
Join Date: Sep 2012
Location: FL
Posts: 76
Rep Power: 4
victoryv is on a distinguished road
I have a rectangular inlet (2x1-in X and Z)for a 3 D problem where I want to give a UDF for y velocity (-ve direction). The centre of the of the rectangular inlet is at (-2.5,2,8). The maximum velocity is 10. The profile is parabolic in x and z directon. I have written a UDF. But the velocity comes out to be >100.
I don't know where I'm I doing wrong.

/************************************************** ***********************/
/* udf- velocity profile boundary condition */
/************************************************** ***********************/

#include "udf.h"


DEFINE_PROFILE(inlet_y_velocity, thread, index)
{
real p[ND_ND];
real x,z;
face_t f;

begin_f_loop(f, thread)
{
F_CENTROID(p,f,thread);
x = p[1];
z= p[1];
F_PROFILE(f, thread, index) = (10-10*((x+2.5)*(x+2.5))-10*(((z-2)/0.5)*((z-2)/0.5)));
}
end_f_loop(f, thread)
}
victoryv is offline   Reply With Quote

Old   October 9, 2012, 04:38
Default
  #2
Senior Member
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 1,097
Rep Power: 19
flotus1 will become famous soon enoughflotus1 will become famous soon enough
The x, y and z-values of the face centroids are stored in p[0], p[1] and p[2], respectively.

So first of all you should change the line "x=p[1];" to "x=p[0]"
and the line "z=p[1];" to "x=p[2]"

Didn't check the rest of your formula, so there could still be some more errors.
flotus1 is offline   Reply With Quote

Old   October 9, 2012, 15:27
Default
  #3
Member
 
Join Date: Sep 2012
Location: FL
Posts: 76
Rep Power: 4
victoryv is on a distinguished road
Thanks man.I totally forgot about that. I am getting proper results now. Also, I did miss negative sign in the formula.
victoryv is offline   Reply With Quote

Reply

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 error - parabolic velocity profile - 3D turbine Zaqie Fluent UDF and Scheme Programming 8 May 11, 2014 08:34
CFX13 Post Periodic interface EtaEta CFX 7 December 8, 2011 18:15
Massflow or average velocity boundary condition Sideshore OpenFOAM Pre-Processing 4 November 21, 2011 13:50
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 15:45
UDF problem : inlet velocity in cyl. coord. system Jongdae Kim FLUENT 0 June 15, 2004 11:21


All times are GMT -4. The time now is 18:49.