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

UDF programming for pressure 3D..HELP

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 17, 2009, 11:21
Default UDF programming for pressure 3D..HELP
  #1
New Member
 
oscar
Join Date: Mar 2009
Posts: 7
Rep Power: 17
coolyihao is on a distinguished road
#include "udf.h"
DEFINE_PROFILE(x_velocity,thread,index)
{
real x[ND_ND];
real y,z;
face_t f;
begin_f_loop(f,thread)
{
F_CENTROID(x,f,thread);
y = x[1];
z = x[1];
F_PROFILE(f,thread,index) = 20. - y*y/(.0745*.0745)*20.;
}
end_f_loop(f,thread)
}

This is the UDF programming for x velocity inlet (3D)..
If i want to write for pressure difference (3D)...what is the programming for that..thanks
coolyihao is offline   Reply With Quote

Old   March 18, 2009, 04:29
Default
  #2
Member
 
Join Date: Mar 2009
Posts: 35
Rep Power: 17
panda is on a distinguished road
It's similar to define the pressure (difference) if you want to apply a pressure boundary conditon.
panda is offline   Reply With Quote

Old   June 28, 2010, 20:28
Default
  #3
New Member
 
Charles de Luzan
Join Date: Jun 2010
Location: Cincinnati, OH
Posts: 12
Rep Power: 16
Chipsgrottel is on a distinguished road
Hello,

I have a problem using an UDF to define my parabolic inlet velocity profile.
I would like to make it this shape:
Vx= -0.00094*y*y+-0.00094*z*z+0.67743

I wrote this helped by your program:

#include "udf.h"
DEFINE_PROFILE(x_velocity,thread,index)
{
real x[ND_ND];
real y,z;
face_t f;
begin_f_loop(f,thread)
{
F_CENTROID(x,f,thread);
y = x[1];
z = x[1];
F_PROFILE(f,thread,index) = -0.00094*y*y+-0.00094*z*z+0.67743;
}
end_f_loop(f,thread)
}

But what I got is a constant profile.
Do you see any mistake?

Thank you for your attention.
Chipsgrottel is offline   Reply With Quote

Old   June 29, 2010, 11:14
Default
  #4
New Member
 
Luk
Join Date: Jun 2009
Posts: 24
Rep Power: 17
Geisel is on a distinguished road
Quote:
Originally Posted by Chipsgrottel View Post
Hello,

I have a problem using an UDF to define my parabolic inlet velocity profile.
I would like to make it this shape:
Vx= -0.00094*y*y+-0.00094*z*z+0.67743

I wrote this helped by your program:

#include "udf.h"
DEFINE_PROFILE(x_velocity,thread,index)
{
real x[ND_ND];
real y,z;
face_t f;
begin_f_loop(f,thread)
{
F_CENTROID(x,f,thread);
y = x[1];
z = x[1];
F_PROFILE(f,thread,index) = -0.00094*y*y+-0.00094*z*z+0.67743;
}
end_f_loop(f,thread)
}

But what I got is a constant profile.
Do you see any mistake?

Thank you for your attention.
x[0] = x
x[1] = y
x[2] = z

Maybe that?
__________________
*******************************
Geisel is offline   Reply With Quote

Old   July 15, 2010, 16:28
Default Thank you
  #5
New Member
 
Charles de Luzan
Join Date: Jun 2010
Location: Cincinnati, OH
Posts: 12
Rep Power: 16
Chipsgrottel is on a distinguished road
Actually I couldn't do it even with your idea so I did something different:

I designed a long duct with the same conditions as my inlet duct and long enough to let the fluid reach a fully developed profile of velocity. Then I saved it by define -> profile -> write and set it up at the inlet.
Finally it worked.

Thank you for your help anyway

C.
Chipsgrottel 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 programming fullmonty FLUENT 5 June 30, 2011 03:40
Scheme programming Gene FLUENT 0 August 10, 2005 14:08
Programming in CFD Lam Main CFD Forum 7 May 27, 2004 06:12
Programming in C Tony Main CFD Forum 5 March 7, 2002 13:40


All times are GMT -4. The time now is 15:02.