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

UDF inlet velocity profile mismatch with Fluent

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

Like Tree3Likes
  • 1 Post By Goldsstean
  • 2 Post By maryamgh

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 16, 2010, 15:11
Default UDF inlet velocity profile mismatch with Fluent
  #1
New Member
 
Join Date: Feb 2010
Posts: 1
Rep Power: 0
ChristineL is on a distinguished road
I am prescribing a velocity profile at the inlet of my mesh. Fluent compiles the c file fine and the solution does converge. However, the velocity profile that I am inputting is a parabola and Fluent does not plot the correct shape of my profile at the inlet. My UDF code is show below. My y coordinates start at zero and goes to 0.0093 m.
Any ideas on why Fluent is not interpreting the correct velocity profile would be appreciated.

#include "udf.h"
#include "mem.h"

/** Parameter Constants **/

#define wallspeed 7.0711

#define finalheight 0.0093

#define height 0.001

/***************** Inlet Velocity Profile in Slot *****************/
DEFINE_PROFILE(inlet_velocity_profile,thread,posit ion)
{
real x[ND_ND];
real y;
face_t f;

begin_f_loop(f,thread)
{
F_CENTROID(x,f,thread);
y = fabs(x[1]);
F_PROFILE(f,thread,position) = wallspeed*(((6/(finalheight*finalheight))*((1/2)-(height/finalheight))*((y*y)-(finalheight*y)))-(y/finalheight)+1);
}
end_f_loop(f,thread)
}
ChristineL is offline   Reply With Quote

Old   February 22, 2010, 15:17
Default profile in the velocity inlet
  #2
New Member
 
Elahe
Join Date: Oct 2009
Posts: 21
Rep Power: 16
ekakavand is on a distinguished road
hi...

did you solve your problem,
i have this problem,too.

thanks,
elahe
ekakavand is offline   Reply With Quote

Old   February 23, 2010, 02:01
Default
  #3
Member
 
Amol Ramteke
Join Date: May 2009
Location: Kolkata
Posts: 30
Rep Power: 17
Goldsstean is on a distinguished road
Ohhhh,

There is problem in your geometry creation.

Remember the velocity profile given for pipe, y= something something...

for e.g the pipe is of diameter 1m on y axis. you should construct it as (y=+0.5 and y=-0.5 and centre of pipe should be at "zero")

either you can make changes in udf but i feel that is tidious(not that much).

Amol
shiva102 likes this.
Goldsstean is offline   Reply With Quote

Old   February 24, 2010, 04:43
Default
  #4
New Member
 
Elahe
Join Date: Oct 2009
Posts: 21
Rep Power: 16
ekakavand is on a distinguished road
hi Goldsstean

thanks for your attention
it's a bit odd, my case is a canal and i want to make wave in that. 'y' in my case is calculate from the bottom of canal , is different with pipe,ya?
do you try yoursef?
i try your idea....

best
elahe
ekakavand is offline   Reply With Quote

Old   February 24, 2010, 04:48
Default
  #5
Member
 
Amol Ramteke
Join Date: May 2009
Location: Kolkata
Posts: 30
Rep Power: 17
Goldsstean is on a distinguished road
Could you please explain your problem in detail.
Goldsstean is offline   Reply With Quote

Old   February 24, 2010, 07:23
Default
  #6
New Member
 
Elahe
Join Date: Oct 2009
Posts: 21
Rep Power: 16
ekakavand is on a distinguished road
i model a canal with 20 m lenght and 15 m height in 2d fluent.
i wanna generate wave in canal and i hook a udf file that velocity time varing was defined in it for x and y direction. wave is generated correctly but velocity profile plot is not correct and do not match with velocity countor. it seems velocity countor is right and match with theory but profile is wrong.

i set velocity inlet in the left border of canal. and in plot menu >xy plot> i write a file of velocity in this boundary. is my way right or not?

thanks in advance
elahe
ekakavand is offline   Reply With Quote

Old   February 10, 2012, 05:06
Default how do give parabolic inlet velocity
  #7
New Member
 
saravanan
Join Date: Oct 2011
Posts: 2
Rep Power: 0
saran15 is on a distinguished road
how do give parabolic inlet velocity profile for supersonic nozzle
saran15 is offline   Reply With Quote

Old   February 13, 2012, 04:22
Default udf for velocity profile
  #8
New Member
 
maryam ghadiri
Join Date: Feb 2012
Posts: 1
Rep Power: 0
maryamgh is on a distinguished road
dear all, i am new in fluent simulation. I write a udf file to define a terrain for my case. I use log law for velocity but I face to this massage: " number error floatingpoint error" .
would you please help me.

this is my udf file:
#include "udf.h"
DEFINE_PROFILE(log_velocity,thread,position)
{
real x[ND_ND];
real y;
face_t f;
begin_f_loop(f,thread)
{
F_CENTROID(x,f,thread);
y = x[1];
F_PROFILE(f,thread,position) = 5*log(y/0.4)/log(10/0.4);
}
end_f_loop(f,thread)
}
denoma and shiva102 like this.

Last edited by maryamgh; February 13, 2012 at 21:01.
maryamgh is offline   Reply With Quote

Old   February 14, 2012, 01:50
Default UDF for density variation
  #9
New Member
 
deepak
Join Date: Feb 2011
Posts: 8
Rep Power: 15
student00 is on a distinguished road
Please help me in making a UDF for following condition=

Variable density was defined in the liquid state as
q = ql/[b(T - Tl) + 1] for 30C < T < 100 C, where q =
760 kg/m3, Tl = 30 C, and b = 0.0005 , with linearly
varying density in the ‘‘mushy” state, from 870 kg/m3
at 28 C to 760 kg/m3 at 30 C.
student00 is offline   Reply With Quote

Old   June 21, 2013, 14:42
Default
  #10
New Member
 
Mahboobe Mahdavi
Join Date: Mar 2013
Posts: 22
Rep Power: 13
Mahboobe365 is on a distinguished road
Hi ekakavand,

In fluent if you use Grid or MEsh/ reorder domain/zones, it may help.
Mahboobe365 is offline   Reply With Quote

Old   June 24, 2013, 06:10
Default
  #11
New Member
 
Ravindra
Join Date: May 2013
Posts: 5
Rep Power: 13
Ravindra123 is on a distinguished road
Do u get the solution to your problem? I am also getting the same problem but in giving the transient temperature profile.
Any help would be appreciated.
Ravindra123 is offline   Reply With Quote

Old   October 5, 2016, 04:24
Default open channel problem
  #12
Member
 
muhamed
Join Date: Jun 2013
Posts: 66
Rep Power: 13
Mohammad80 is on a distinguished road
Hi everybody,
I have a problem with the wind pressure distribution on a building. As you can see from the attached picture (Picture 1), which I downloaded it from the internet, the pressure at the lower part of the building is much less than that at the upper part and this is expected to be happened because the wind velocity near the ground is much less than that at the top.
The problem I faced is that the wind pressure be the same along the height of the building (Picture 2). Does anyone can help me?
Attached Images
File Type: jpg Picture 1.jpg (50.6 KB, 23 views)
File Type: jpg Picture 2.jpg (57.0 KB, 16 views)
Mohammad80 is offline   Reply With Quote

Old   November 23, 2016, 22:01
Default
  #13
New Member
 
Yousef
Join Date: Dec 2015
Posts: 14
Rep Power: 10
yousefaz is on a distinguished road
Hi Muhamed,

You need to define a velocity profile the varies with height at the inlet using a UDF. I would also suggest that you refine the mesh near the building.

By the way, do you happen to know the source for Picture 1?

Thanks
Y.A.Z
yousefaz is offline   Reply With Quote

Old   November 24, 2016, 04:37
Default
  #14
Member
 
muhamed
Join Date: Jun 2013
Posts: 66
Rep Power: 13
Mohammad80 is on a distinguished road
Quote:
Originally Posted by yousefaz View Post
Hi Muhamed,

You need to define a velocity profile the varies with height at the inlet using a UDF. I would also suggest that you refine the mesh near the building.

By the way, do you happen to know the source for Picture 1?

Thanks
Y.A.Z
Thanks a lot for your reply.
Do you have a UDF for inlet velocity profile in an open channel? I couldn't find it in the INTERNET and I don't know how to write the UDF that I need.

Regarding Picture 1, as I remember, I took it from an article about air velocity distribution on a building.
Mohammad80 is offline   Reply With Quote

Old   November 25, 2016, 03:32
Default
  #15
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Here is a UDF for defining a velocity profile along a boundary for wind modelling around buildings: http://www.cfd-online.com/Forums/flu...nd-height.html

Edit the following equation to your inlet velocity profile (z is the z-direction height in their UDF):

Code:
F_PROFILE(f, thread, position) = 24.9 *pow(z,0.27);
`e` is offline   Reply With Quote

Old   November 25, 2016, 06:45
Default
  #16
Member
 
muhamed
Join Date: Jun 2013
Posts: 66
Rep Power: 13
Mohammad80 is on a distinguished road
Quote:
Originally Posted by `e` View Post
Here is a UDF for defining a velocity profile along a boundary for wind modelling around buildings: http://www.cfd-online.com/Forums/flu...nd-height.html

Edit the following equation to your inlet velocity profile (z is the z-direction height in their UDF):

Code:
F_PROFILE(f, thread, position) = 24.9 *pow(z,0.27);
Thank you very much for your help. I will try and see how it goes.
Mohammad80 is offline   Reply With Quote

Reply

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
UDF problems - velocity profile Oli Fluent UDF and Scheme Programming 6 October 24, 2016 10:38
Inlet Velocity in CFX aeroman CFX 12 August 6, 2009 18:42
Logarithmic velocity profile cfdworker Fluent UDF and Scheme Programming 0 April 23, 2009 19:09
Urgent! Help on UDF to set inlet velocity Ray Hong FLUENT 4 December 30, 2005 12:32
inlet velocity profile in Polyflow srinu Main CFD Forum 0 January 16, 2003 20:27


All times are GMT -4. The time now is 01:14.