CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF for 3D parabolic Inlet Profile (https://www.cfd-online.com/Forums/fluent/174790-udf-3d-parabolic-inlet-profile.html)

Sicario July 18, 2016 21:27

UDF for 3D parabolic Inlet Profile
 
Hi Everyone,

I'm trying to create a fully developed inlet parabolic velocity profile, using Poiseuille flow equation v=vmax(1-(r/r)^2).

I have created the following UDF, but I'm not quite sure whether it is 100% as I'm quite new to this area. Especially, defining the time. Can someone please correct me if it is wrong or something is missing? It will be a massive help.

#include "udf.h"//file that contains definitions for define functions and fluent operations

DEFINE_PROFILE(inlet_para_velocity,th,i)
{
float x[ND_ND]; /* an array for the coordinates */
float xx, y, r;
face_t f; /* f is a face thread index */
r = 0.00314; /* inlet radius in m */
begin_f_loop(f,th)
{

double t = (CURRENT_TIME*2-floor(CURRENT_TIME*2))/2; //t is the local time within each period

F_CENTROID(x,f,th);
xx = x[0]; /* x coordinate */
y = x[1]; /* y coordinate */



F_PROFILE(f,th,i) = 0.254*(1.-(xx*xx+y*y)/(r*r));




}
end_f_loop(f,th)
}

Regards

Sicario July 18, 2016 21:36

1 Attachment(s)
Actually, I have attached the inlet contour after running the simulation for 0.5s and it is clearly not what I need, I need the maximum velocity at the centre. Hope someone can help.

mikethe October 2, 2018 08:57

F_PROFILE(f,th,i) = 0.254*(1.-(sqrt(xx*xx+y*y))/(r*r));

I think 'sqrt' should be added due to obtain parabolic or pauiseille flow velocity inlet condition.


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