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 and functions both are not showing Parabolic profile (https://www.cfd-online.com/Forums/fluent-udf/234203-udf-functions-both-not-showing-parabolic-profile.html)

aerosuraj1 February 26, 2021 06:47

UDF and functions both are not showing Parabolic profile
 
2 Attachment(s)
hello all,
i am working on the the bifurcation geometry where, 1 inlet and 2 outlet.
at the inlet first i have provided UDF (fully developed parabolic profile)
please find the attachment for UDF code.
but in the result, it shows constant profile instead of parabolic.
after this
i have used the ''function'' in fluent for parabolic velocity profile as follow

v_mean*(1-(r/r_max)**2)
where, v_mean and r_max are constant defined
and r=sqrt(x**2+y**2).

but no expected result.
it shows constant profile instead of parabolic.

please help

pakk February 26, 2021 12:36

Could you put the code here, not in an attachment? It's very hard/annoying to open attachments from a phone, and I guess that the code is not so big.

ebrahem February 27, 2021 06:21

This is the working UDF for 2D profile

#include "C:\Program Files\ANSYS Inc\v162\fluent\fluent16.2.0\src\udf\udf.h"

DEFINE_PROFILE(inlet_x_velocity, thread, position)
{
real x[ND_ND]; /* this will hold the position vector */
real y;
real h=0.003;
real u=0.06392694064; /* for Re = 100 based on Diameter of cylinder */
face_t f;

begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
y = x[1];
F_PROFILE(f, thread, position) = u*1.5*(1-(4*(y*y/(h*h))));
}
end_f_loop(f, thread)
}

pakk February 28, 2021 05:33

Your function is wrong because it assumes you work in the xy-plane, but your picture shows it's yz.

Your UDF is 2D, but should still work a bit. It's your channel centered around y=0?

aerosuraj1 February 28, 2021 23:35

Quote:

Originally Posted by pakk (Post 797445)
Your function is wrong because it assumes you work in the xy-plane, but your picture shows it's yz.

Your UDF is 2D, but should still work a bit. It's your channel centered around y=0?

thank you very much sir @pakk
your right sir my function was wrong, and now i got it. your comment helps me.

yes, my channel centered around y=o.

aerosuraj1 February 28, 2021 23:37

Quote:

Originally Posted by ebrahem (Post 797393)
This is the working UDF for 2D profile

#include "C:\Program Files\ANSYS Inc\v162\fluent\fluent16.2.0\src\udf\udf.h"

DEFINE_PROFILE(inlet_x_velocity, thread, position)
{
real x[ND_ND]; /* this will hold the position vector */
real y;
real h=0.003;
real u=0.06392694064; /* for Re = 100 based on Diameter of cylinder */
face_t f;

begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
y = x[1];
F_PROFILE(f, thread, position) = u*1.5*(1-(4*(y*y/(h*h))));
}
end_f_loop(f, thread)
}

thank you @ebrahem,
i will try this UDF


All times are GMT -4. The time now is 06:57.