CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   3d velocity inlet-help needed! (https://www.cfd-online.com/Forums/fluent/36958-3d-velocity-inlet-help-needed.html)

david June 14, 2005 15:18

3d velocity inlet-help needed!
 
Hello CFD community,

The subject of how to define a 3d parabolic velocity profile as been explained at numerous occasions on this site.

My problem is the following: I cannot use a single one of these UDF succesfully although Fluent has no problem interpreting them succesfully. In other words, I can interpret a UDF but Fluent does not assign the proper veolcity values to the inlet face. In fact Fluent does not loop through each face of a surface as should be the case.

This appears very odd to since I have no trouble using the UDF for 2d cases. But as soon as I try using 3d, I get no response and the case will case converge within 1 iteration since no change occur in the domain.

As anyone experienced this problem before? I can email a small 3d mesh file to anyone curious about this. Below is a typical UDF tried.

Best Regards, David

----------------------------------------------------- #include "udf.h"

#define xc 0./*inlet face center cordinates are x=0 and y=0 since pipe is along z-axis*/

#define yc 0.

#define radius 0.0065

#define umean 0.232

DEFINE_PROFILE(z_velocity, thread, position)

{

float r, x[2];

face_t f;

begin_f_loop(f, thread)

{ F_CENTROID(x,f,thread);

r = sqrt(pow(x[0]-xc,2)+pow(x[1]-yc,2));

printf("r=%.6f\n",r); /* for control purposes*/

F_PROFILE(f,thread,position) = 2*umean*(1-pow(r/radius,2));

printf("x=%.6f\t r=%.6f\t u=%.5f\n",x[0],r,2*umean*(1-pow(r/radius,2))); /* for control purposes*/

}

end_f_loop(f, thread)

}

peter June 15, 2005 07:34

Re: 3d velocity inlet-help needed!
 
David..try using the following declaration for x: real x[ND_ND]; "The constant ND_ND is defined as 2 for RP_2D ( FLUENT 2D) and RP_3D ( FLUENT 3D). It can be used when you want to build a matrix in 2D and a matrix in 3D. When you use ND_ND, your UDF will work for both 2D and 3D cases, without requiring any modifications." - Fluent UDF Manual, Ch. 6.6 Vector Macros


david June 15, 2005 10:06

Re: 3d velocity inlet-help needed!
 
Hello Peter, thank you for responding. I tried declaring this variable as you had suggested without any success. I don't understand why Fluent does not seem to loop on a planar surface such as the one used in my 3d case. Any other comments would be greatly appreciated!

Regards, David

david June 17, 2005 11:33

Re: 3d velocity inlet-help needed!
 
Just for the record:

I compiled the same UDF and it worked.


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