Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

UDF for dynamic contact velocity

    • ahmetgultekin
      Subscriber

      Hi,


      I have been working to set dynamic contact angle at a boundary condition using UDF for a droplet impingement problem. It is a 2D axi-symmetric and Volume of Fluid model with air and water.


      In my case, the dynamic contact angle will change like the below;
      θ_d (t)=θ_e+(θ_a-θ_r)*tanh((U_c (t)/U_t )


      U_c(t) is the component of the interface velocity parallel to the substrate at the contact point. The other parameters are constant. I couldn’t figure out to get the dynamic contact velocity.


      I hope someone could help me on this issue. Thanks for your valuable time and help. The UDF code is as follows;



       


       

    • Rob
      Forum Moderator

      The contact velocity will be the particle velocity? Or do you mean when the particle hits the free surface?  Have you gone through the accretion UDF example in the manual?

    • ahmetgultekin
      Subscriber

      After hitting surface droplet is spreading, and the contact velocity is the interface velocity parallel to the surface. I'm using VOF method for single droplet

    • DrAmine
      Ansys Employee

      You want to provide advancing and receding angle for your interface: correct? Then you need to use DEFINE_PROFILE to change the contact angle. Offcourse you can calculate everything in a ADJUST assign the results in UDMI then use that UDMI value in the profile.


       

    • ahmetgultekin
      Subscriber

      Yes I want to change the contact angle with constant advancing, receding angle and time-dependent interface velocity. My main problem, I couldn't get the interface velocity  


       


      #include "udf.h"


      int T_e = 90;                                         //Equilibrium contact angle


      int T_a = 60;                                          //Advancing contact angle


      int T_r = 110;                                        //Receding contact angle


      double U_t = 0.6;                                  //Characteristic velocity


      double contact_velocity=0.0;              //Contact velocity


      double dynamic_contact_angle=90.0;    //Dynamic contact angle


      double contact_line_position=0.0;


      double time=0.0;


      FILE *file;


      double sum=0.0 ;


       


      DEFINE_ADJUST(Contact_Angle_Update, domain)


      {


                  Thread *thread = Lookup_Thread(domain, 5);


                  Thread **pt = THREAD_SUB_THREADS(thread); 


                  cell_t cell;


                  face_t f;


                  real x[ND_ND];  


                  double max_y=0, volume;


                  int n;


                  sum=0.0;


                  begin_c_loop_all (cell,pt[1])


                  {


                              if(C_VOF(cell,pt[1])!=0)


                              {


                                         C_CENTROID(x,cell,pt[1]);


                                         printf("## x=%f y=%f z=%f vof=%fn",x[0],x[1],x[2],C_VOF(cell,pt[1]));


                                         if(x[1]>max_y)


                                         max_y=x[1];


                              }


                              sum+=C_VOF(cell,pt[1]);


                  }


                  end_c_loop_all (cell,pt[1])


       


      contact_velocity= (max_y-contact_line_position)/(RP_Get_Real("physical-time-step"));


      contact_line_position = max_y;


      time+= RP_Get_Real("physical-time-step");


      printf("max_y=%f contact_velocity=%f time=%f dynamic_contact_angle=%f sum=%fn  contact_line_position=%f",max_y,contact_velocity,time,dynamic_contact_angle,sum,contact_line_position);


      dynamic_contact_angle=T_e+(T_a-T_r)*tanh(contact_velocity/U_t);


      }


      DEFINE_PROFILE(Contact_Angle_Set_Profile,t,i)


      {


                  face_t f;


                  begin_f_loop(f,t)


                  {


                              F_PROFILE(f,t,i) = dynamic_contact_angle;


          }


                  end_f_loop(f,t)


      }

    • Rob
      Forum Moderator

      Ah, so you need the velocity at which the droplet strikes the free surface. Given the VOF formulation tells us where the interface is and not it's angle (or exact position) I think you can use the droplet velocity & cell (fluid) velocity where the volume fraction is 0.5  However, unless you have a lot of droplets tracking the film will be difficult: working it out will also be beyond the level at which ANSYS staff can help on a public forum! 

    • ahmetgultekin
      Subscriber

      Thanks rwoolhou for your comment


      I am going to explain my problem more clearly.I have a single droplet and I have an expression for dynamic contact angle which is a function of contact line velocity. Also, I attached a basic geometry to show the contact line.


      Can anyone help me to uderstand that how the velocity of contact point (at three phase contact line) can be evaluated and used as a variable in Ansys ? By the way, the contact point moves when there will be change in the contact angle.


    • DrAmine
      Ansys Employee

      You might have a look into: VOF simulations of the contact angle dynamics during the drop spreading: standard models and a new wetting force model

Viewing 7 reply threads
  • The topic ‘UDF for dynamic contact velocity’ is closed to new replies.