-
-
February 26, 2019 at 4:34 pm
BeginerModel
SubscriberHi All.
I have created a UDF which varies the inlet velocity with time, however I need the inlet to have fully developed flow as well. So currently the model develops the flow across the "pipe" and the boundary layer etc inside my model which is costing my a large amount of computing power and other problems. I have seen the UDF's for creating a laminar parabolic profile, but am unsure how to combine the two together. Here is my current UDF:
/**********************************************************************
  CoronaryVelocity.c                            Â
  UDF for specifying a fourier fitted velocity boundary conditionÂ
***********************************************************************/
Â
#include "udf.h"
Â
  float a0 =   0.1564; Â
  float a1 =   -0.03045; Â
  float b1 =   0.007764; Â
  float a2 =   0.0242; Â
  float b2 =   0.03948; Â
  float a3 =   -0.01151; Â
  float b3 =   -0.008163; Â
  float a4 =  0.009875; Â
  float b4 =  0.003343; Â
  float a5 =  -0.01003; Â
  float b5 =   0.002862; Â
  float a6 =  0.006133; Â
  float b6 =  -0.0007519; Â
  float a7 =  0.001413; Â
  float b7 =   0.001232; Â
  float a8 =   -0.003654; Â
  float b8 =  -0.000137; Â
  float w =    7.858;Â
Â
DEFINE_PROFILE(CoronaryVelocity, thread, position)Â
{
 face_t f;
 real t = CURRENT_TIME;
 begin_f_loop(f, thread)
  { Â
   F_PROFILE(f, thread, position) = a0 + a1*cos(t*w) + b1*sin(t*w) +Â
        a2*cos(2*t*w) + b2*sin(2*t*w) + a3*cos(3*t*w) + b3*sin(3*t*w) +Â
        a4*cos(4*t*w) + b4*sin(4*t*w) + a5*cos(5*t*w) + b5*sin(5*t*w) +Â
        a6*cos(6*t*w) + b6*sin(6*t*w) + a7*cos(7*t*w) + b7*sin(7*t*w) +Â
        a8*cos(8*t*w) + b8*sin(8*t*w);
  }
 end_f_loop(f, thread)
}
Â
I want a simple parabolic profile using that function. Where do I start?
Â
Thanks
Â
-
February 26, 2019 at 4:55 pm
DrAmine
Ansys EmployeeWhy not applying the parabolic profile by knowing the inlet geometry. Does the magnitude varies over time but the profiles remain laminar? -
February 26, 2019 at 5:09 pm
BeginerModel
SubscriberThe inlet is essentially a circle, and whilst the magnitude varies, the flow is always laminar.
-
February 26, 2019 at 5:57 pm
DrAmine
Ansys EmployeeOkay then provide a power law profile based on the center-line position and the radius. Let the magniute be function of time.
Â
Here an example:
Â
/***********************************************************************
  vprofile.c                             Â
  UDF for specifying steady-state velocity profile boundary conditionÂ
************************************************************************/
#include "udf.h"
Â
DEFINE_PROFILE(inlet_x_velocity, thread, position)Â
{
 real x[ND_ND]; /* this will hold the position vector */
 real y;
 face_t f;
Â
 begin_f_loop(f, thread)
  {
   F_CENTROID(x,f,thread);
   y = x[1];
   F_PROFILE(f, thread, position) = 20. - y*y/(.0745*.0745)*20.;
  }
 end_f_loop(f, thread)
}
-
February 27, 2019 at 1:37 pm
BeginerModel
SubscriberFor anyone looking at this later, I have figured it out.
DEFINE_PROFILE(LaminarCoronaryVelocity, thread, position)
{
real x[ND_ND];
real y;
real z;
real t = CURRENT_TIME;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
y = x[1];
z = x[2];
F_PROFILE(f, thread, position) = (YOUR TRANSIENT FUNCTION)*(1-(y*y+z*z)/(YOUR RADIUS SQUARED));
}
end_f_loop(f, thread)
}
-
February 27, 2019 at 2:26 pm
DrAmine
Ansys EmployeeMark thìs as solved.
-
- The topic ‘UDF for transient fully developed laminar profile at inlet?’ is closed to new replies.
-
3597
-
1283
-
1107
-
1068
-
983
© 2025 Copyright ANSYS, Inc. All rights reserved.