CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Logarithmic velocity profile

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

LinkBack Thread Tools Search this Thread Display Modes
Old   April 23, 2009, 19:09
Default Logarithmic velocity profile
New Member
Join Date: Apr 2009
Posts: 14
Rep Power: 17
cfdworker is on a distinguished road
Hello, I have a problem with the definition of a boundary condition with UDF to simulation of the wind in a terrain. I have to define a velocity inlet in a 3d domain; this condition is a logarithmic velocity profile. I can define the logarithmic velocity profile with UDF, like this:

#include "udf.h"

real x[ND_ND];
real z;
face_t f;

z = x[2];
F_PROFILE(f,thread,index) = 3*log(z/0.01)/log(10/0.01);

My domain is this:

I have to impose the logarithmic profile in the front face that is shown in figure.
My question is how I define in the UDF so that the velocity in bottom of the face is equal 0.
My problem is the coordinates that I use in UDF are absolute and I donít know how to define relative coordinates, in order to the z in the equation that defines the velocity profile, is the height relatively to the bottom of the face and not the absolute height.
I tried to use the C_WALL_DIST(c,thread) macro to resolve this issue (this macro estimate the distance from any cell to the nearest WALL, which is the terrain), like this:

#include "udf.h"

real z;
face_t f;
cell_t c;

z = C_WALL_DIST(c,thread);
F_PROFILE(f,thread,index) =3*log(z/0.01)/log((10)/0.01);

But when i selected the udf in velocity inlet in boundary condition, fluent gave me this message:

FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: ()

I think the problem is that the boundary condition that I set is to a face and I use a macro for cells in the udf.
I donít know how to use this macro for my situation. Can anyone help me with this issue ?

I would appreciate any suggestions.

PS: Sorry for repeat the thread of fluent forum but only now I noticed that there is a sub-forum dedicated to udf

Last edited by cfdworker; April 23, 2009 at 20:38.
cfdworker is offline   Reply With Quote


Thread Tools Search this Thread
Search this Thread:

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
3D UDF Paraboilc Velocity Profile (Can't Maintain) Sing FLUENT 12 August 7, 2017 06:25
[UDF] Relative coordinates in logarithmic velocity profile cfdworker Fluent UDF and Scheme Programming 25 July 13, 2017 03:44
[boundary condition] logarithmic velocity profile cfdworker FLUENT 2 April 17, 2009 23:36
maintaining a logarithmic velocity distribution Morten Andersen CFX 1 January 8, 2007 11:37
Variables Definition in CFX Solver 5.6 R P CFX 2 October 26, 2004 02:13

All times are GMT -4. The time now is 17:32.