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

3D UDF Paraboilc Velocity Profile with max velocity

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 4, 2011, 15:35
Default 3D UDF Paraboilc Velocity Profile with max velocity
  #1
New Member
 
John Gosselin
Join Date: Jan 2011
Location: quebec
Posts: 3
Rep Power: 15
johnGo is on a distinguished road
Hello,

I am simulating the air flow over a 3D building in a wind domain using a paraboilc velocity inlet profile.

I have this UDF but i would like have a max velocity in my UDF, exemple 5 m/s

// UDF code for 3D parabolic Velocity Profile //

#include "udf.h"

DEFINE_PROFILE(inlet_x_velocity, thread, position)

{

real x[ND_ND];

real z; // Vertical Distance

face_t f;

begin_f_loop(f, thread)

{

F_CENTROID(x,f,thread);

z = x[2];

F_PROFILE(f, thread, position) = 24.9 *pow(z,0.27);

}

end_f_loop(f, thread)

}

Thank you
johnGo is offline   Reply With Quote

Old   January 4, 2011, 22:45
Default
  #2
Senior Member
 
Real Name :)
Join Date: Jan 2010
Location: United States
Posts: 192
Rep Power: 16
ComputerGuy is on a distinguished road
If you just want to limit the velocity, you could look at the lesser of two values: your function, and 5.0. Like this:
Code:
#include "udf.h"

DEFINE_PROFILE(inlet_x_velocity, thread, position)
{
	real x[ND_ND];
	real z; // Vertical Distance
	face_t f;
	begin_f_loop(f, thread)
	{
		F_CENTROID(x,f,thread);
		z = x[2];
		F_PROFILE(f, thread, position) = MIN(24.9 *pow(z,0.27),5.0);
	}
	end_f_loop(f, thread)
}
If the MIN function is giving you trouble (can't remember if Fluent's interpreter has it built-in), you can get the same functionality with:
Code:
#include "udf.h"

DEFINE_PROFILE(inlet_x_velocity, thread, position)
{
	real x[ND_ND];
	real z; // Vertical Distance
	face_t f;
	begin_f_loop(f, thread)
	{
		F_CENTROID(x,f,thread);
		z = x[2];
		F_PROFILE(f, thread, position) = 24.9 *pow(z,0.27);
		if ((24.9 *pow(z,0.27))>5.)
		{
			F_PROFILE(f, thread, position) = 5.0;
		}
	}
	end_f_loop(f, thread)
}
ComputerGuy 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
UDF problems - velocity profile Oli Fluent UDF and Scheme Programming 6 October 24, 2016 11:38
[boundary condition] logarithmic velocity profile cfdworker FLUENT 2 April 18, 2009 00:36
Multi step transient UDF velocity profile problem William177 FLUENT 1 February 3, 2008 07:47
UDF problem : inlet velocity in cyl. coord. system Jongdae Kim FLUENT 0 June 15, 2004 12:21
particle velocity and velocity profile HGG FLUENT 2 June 10, 2001 17:32


All times are GMT -4. The time now is 23:29.