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/)
-   -   Pulsatile profile at inlet (https://www.cfd-online.com/Forums/fluent-udf/98454-pulsatile-profile-inlet.html)

Josyula March 12, 2012 00:37

Pulsatile profile at inlet
 
Hi,
I am trying to superimpose a pulsatile (sinusoidal) profile on an existing parabolic profile, at the inlet of a rectangular microchannel, whose hydraulic diameter is 77.1 micron.

I have written a UDF for the same and which is shown below:

#include "udf.h"
#include "math.h"
DEFINE_PROFILE (unsteady_velocity,thread,position)
{
real x[ND_ND];
real y;
real Par;
face_t f;
real t = CURRENT_TIME;
begin_f_loop (f,thread)
{
y = x[1];
Par = 0.0122*(1-((y*y)/(38.55e-06*38.55e-06))); /* Parabolic profile where r = 38.55e-06*/
F_PROFILE (f,thread,position) = Par+(0.5*sin(2*3.141592654*1.333*t)); /*Parabolic + Pulsatile profile (Asin(2*pi*freq*t))*/
}
end_f_loop (f,thread)
}

After interpreting and hooking the profile to the inlet, I am getting a uniform profile at the inlet instead of a pulsatile profile, even after a very long timestep.

Can anyone tell me what could be the problem with the UDF?

Thanks.

ComputerGuy March 17, 2012 11:16

Quote:

Originally Posted by Josyula (Post 348850)
Hi,
I am trying to superimpose a pulsatile (sinusoidal) profile on an existing parabolic profile, at the inlet of a rectangular microchannel, whose hydraulic diameter is 77.1 micron.

I have written a UDF for the same and which is shown below:

#include "udf.h"
#include "math.h"
DEFINE_PROFILE (unsteady_velocity,thread,position)
{
real x[ND_ND];
real y;
real Par;
face_t f;
real t = CURRENT_TIME;
begin_f_loop (f,thread)
{
y = x[1];
Par = 0.0122*(1-((y*y)/(38.55e-06*38.55e-06))); /* Parabolic profile where r = 38.55e-06*/
F_PROFILE (f,thread,position) = Par+(0.5*sin(2*3.141592654*1.333*t)); /*Parabolic + Pulsatile profile (Asin(2*pi*freq*t))*/
}
end_f_loop (f,thread)
}

After interpreting and hooking the profile to the inlet, I am getting a uniform profile at the inlet instead of a pulsatile profile, even after a very long timestep.

Can anyone tell me what could be the problem with the UDF?

Thanks.


Sure -- you're not ever assigning a value to the x-array (you should use C_CENTROID), and thus it is always returning its default value.

ComputerGuy

Josyula April 30, 2012 08:47

Quote:

Originally Posted by ComputerGuy (Post 349988)
Sure -- you're not ever assigning a value to the x-array (you should use C_CENTROID), and thus it is always returning its default value.

ComputerGuy

Hi,

Sorry for the late reply.

How and where do I incorporate the C_CENTROID macro?

Daniel Tanner May 1, 2012 03:54

Try putting it in here, otherwise the you have not set x so y=x[1] will not give the required answer.

begin_f_loop (f,thread)
{
F_CENTROID(x,f,thread);
y=x[1];
.....

Josyula May 6, 2012 10:09

Quote:

Originally Posted by Daniel Tanner (Post 358588)
Try putting it in here, otherwise the you have not set x so y=x[1] will not give the required answer.

begin_f_loop (f,thread)
{
F_CENTROID(x,f,thread);
y=x[1];
.....

Thank you Daniel! :)


All times are GMT -4. The time now is 21:39.