Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

UDF for transient fully developed laminar profile at inlet?

    • BeginerModel
      Subscriber

      Hi 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


       

    • DrAmine
      Ansys Employee
      Why not applying the parabolic profile by knowing the inlet geometry. Does the magnitude varies over time but the profiles remain laminar?
    • BeginerModel
      Subscriber

      The inlet is essentially a circle, and whilst the magnitude varies, the flow is always laminar.

    • DrAmine
      Ansys Employee

      Okay 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)


      }

    • BeginerModel
      Subscriber

      For 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)


      }

    • DrAmine
      Ansys Employee
      Mark thìs as solved.
Viewing 5 reply threads
  • The topic ‘UDF for transient fully developed laminar profile at inlet?’ is closed to new replies.