CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF programming for pressure 3D..HELP (https://www.cfd-online.com/Forums/fluent-udf/62703-udf-programming-pressure-3d-help.html)

coolyihao March 17, 2009 10:21

UDF programming for pressure 3D..HELP
 
#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

panda March 18, 2009 03:29

It's similar to define the pressure (difference) if you want to apply a pressure boundary conditon.

Chipsgrottel June 28, 2010 19:28

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.

Geisel June 29, 2010 10:14

Quote:

Originally Posted by Chipsgrottel (Post 264885)
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?

Chipsgrottel July 15, 2010 15:28

Thank you
 
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.


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