|
[Sponsors] |
March 17, 2009, 11:21 |
UDF programming for pressure 3D..HELP
|
#1 |
New Member
oscar
Join Date: Mar 2009
Posts: 7
Rep Power: 17 |
#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 |
|
March 18, 2009, 04:29 |
|
#2 |
Member
Join Date: Mar 2009
Posts: 35
Rep Power: 17 |
It's similar to define the pressure (difference) if you want to apply a pressure boundary conditon.
|
|
June 28, 2010, 20:28 |
|
#3 |
New Member
Charles de Luzan
Join Date: Jun 2010
Location: Cincinnati, OH
Posts: 12
Rep Power: 16 |
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. |
|
June 29, 2010, 11:14 |
|
#4 | |
New Member
Luk
Join Date: Jun 2009
Posts: 24
Rep Power: 17 |
Quote:
x[1] = y x[2] = z Maybe that?
__________________
******************************* |
||
July 15, 2010, 16:28 |
Thank you
|
#5 |
New Member
Charles de Luzan
Join Date: Jun 2010
Location: Cincinnati, OH
Posts: 12
Rep Power: 16 |
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. |
|
|
|
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 |