Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Laser Surface melting in fluent using udf

    • Avinash Kumar
      Subscriber

      I am trying to simulate the problem of laser surface melting in fluent . I have created a domain of 11*5*2 mm cuboid shape with 4,44,000 elements and mesh is fined along on of the faces along the length direction through the centroid of the cuboid along the length and laser source is applied as heat flux with gaussian distribution and it is applied as heat flux on the face and as user defined function and in model and boundary conditons are top face and all side face is convected and bottom face is adiabatic .i am sharing the details of the problem in for of photos and i am trying to run calcultions its not converging #questions #disscussion
      I would greatly appreciate it if you could kindly assist me in resolving this issue as soon as possible.

    • Rob
      Forum Moderator

      What is the flow field doing? If it's a transient calculation why are you updating the animation every iteration? 

    • Avinash Kumar
      Subscriber

      I am using Energy equations on with solidification and melting on . with boundary conditions as all the surface of cuboid is convected to atmosphere with top is applied as udf as heat flux which will be moving to centroid of rectangle from one breadth  to another breadth of cuboid.

    • Rob
      Forum Moderator

      OK, and what is happening with the flow? 

    • Avinash Kumar
      Subscriber

      There is no inlet and outlet only heat source is moving and natural convection is applied to all faces of cuboid

    • Rob
      Forum Moderator

      OK, but if there's no inlet or outlet where does the extra volume go that's generated to give natural convection? Without any images of flow I can't do much to help. 

    • Avinash Kumar
      Subscriber

       

      This is mail id email – Edited - Rob 

      Just send me Hi I will send the images of flow and in details about the problem . It will very helpful as I am new to  this software .

       

    • Rob
      Forum Moderator

      I'm only permitted to comment on "public domain" questions and information, so please post on here. I'll remove your email address from the thread. 

    • Avinash Kumar
      Subscriber

      I have written a udf for 2D gaussian heat source moving in x direction on the face to the centroid of the largest face of rectangle .

      #include "udf.h"
      DEFINE_PROFILE(gauss2D_heat_flux, thread, position)
      {
        real x[ND_ND];
        face_t f;
        real current_time;
        real Q = 250;
        real PI = acos(-1);
        real vel = 1e-2;
        real r = 0.00125;
        real B = -3;
        real A;
        real d;
        real dt;
        real x_pos;
        current_time = CURRENT_TIME;
        dt = CURRENT_TIMESTEP;
        A = (2 * Q) / (PI * pow(r, 2.));
        begin_f_loop(f, thread)
        {
           F_CENTROID(x, f, thread);
           x_pos = vel * current_time;
           F_PROFILE(f, thread, position) = A * exp(B * (pow((x[0] - x_pos), 2.) + pow(x[1], 2.)) / pow(r, 2.));
        }
        end_f_loop(f, thread)
      }
      I think there is probelm in udf Can you check it.



    • Avinash Kumar
      Subscriber

      I am trying to do  same problem as done in this youtube tutorial

      link -

      Please take a look on this

    • Rob
      Forum Moderator

      Which surface are you adding heat to? Ie are the x[0] and x[1] coordinates on that surface?

    • Avinash Kumar
      Subscriber

      Actually I have copied  the code from YouTube . And I am adding the heat source on the top surface of the cuboid in the boundary condition as heat flux.

    • Rob
      Forum Moderator

      And how does that relate to x[0] and x[1] positions and your equation? 

    • Avinash Kumar
      Subscriber
      • x[0] is the x-coordinate of the face centroid.
      • x[1] is the y-coordinate of the face centroid.
      • x_pos is a variable representing the current position of the heat source along the x-direction, which is updated based on the velocity and current simulation time (vel * current_time).
      • A, B, and r are constants in your equation.
      • F_PROFILE(f, thread, position) sets the temperature profile on the face.

      Breaking down the equation:

      • (x[0] - x_pos) represents the distance of the face centroid from the current x-position of the heat source.
      • (pow((x[0] - x_pos), 2.) + pow(x[1], 2.)) is the square of the Euclidean distance of the face centroid from the current position of the heat source in both x and y directions.
      • pow(r, 2.) is the square of the radius r.
      • B * (pow((x[0] - x_pos), 2.) + pow(x[1], 2.)) / pow(r, 2.) is the argument inside the exponential term.
      • exp(...) calculates the exponential function.
    • Rob
      Forum Moderator

      Yes, and what is the value of (x[0]-xpos)  ? 

    • Avinash Kumar
      Subscriber
      • (x[0] - x_pos) represents the distance of the face centroid from the current x-position of the heat source.
    • Rob
      Forum Moderator

      Yes, and if you look at the actual value is it on the surface you think it is? 

    • Avinash Kumar
      Subscriber

      Yes I asked the person who have written the udf it's on surface.

    • Rob
      Forum Moderator

      And how have you hooked the UDF? 

    • Avinash Kumar
      Subscriber

      I want the heat source to move from one side of rectangle ( top face of cuboid ) to the other side through centroid along the length of rectangle

Viewing 19 reply threads
  • The topic ‘Laser Surface melting in fluent using udf’ is closed to new replies.