CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   Moving Laser Beam (https://www.cfd-online.com/Forums/star-ccm/103351-moving-laser-beam.html)

 fshak92 June 18, 2012 07:32

Moving Laser Beam

I want to simulate the thermal effect of a laser beam(which is moving) on a multiphase surface.
I would appreciate if anyone has ideas about the way(s) i can simulate the moving laser beam.(In Star-CCM+ and/or Ansys and/or OpenFOAM)

 fshak92 June 25, 2012 04:46

I've tried to do a sample Solid case,by defining a table with the moving heat flux according to time.

a) Im not sure it will be the correct way to set a defined heat flux to the fixed coordinates in multiphase case.

b) Making a table to simulate the moving heat flux, somehow is time consuming.Because i should change the heat flux in each coordinates and each time step.(Below is a sample version of table i've used)

x y z t(1s) t(2s) t(3s) ...
1 0 0 500 0 0
2 0 0 0 500 0
3 0 0 0 0 500
.
.
.

Do you have any idea or suggestion about 'a' and 'b' ?

 fshak92 June 29, 2012 05:02

Nobody has any idea?

 flotus1 July 3, 2012 04:07

I am currently busy with quite a similar project. In my case, it is not a multiphase problem.

I am using Ansys fluent for the simulations, since the definition of the transient boundary condition is quite simple there.

If you want to switch to fluent, maybe we could join forces.

 fshak92 July 3, 2012 10:50

Quote:
 Originally Posted by flotus1 (Post 369454) I am currently busy with quite a similar project. In my case, it is not a multiphase problem. I am using Assys fluent for the simulations, since the definition of the transient boundary condition is quite simple there. If you want to switch to fluent, maybe we could join forces.
Yes i can access to Ansys fluent,Would you please tell me how you did it?or please tell me some keywords about the way ,then i can find more explanation in user guide...

 flotus1 July 3, 2012 11:09

If your boundary condition is just a heat flux, then set the BoCo to "wall" and apply a User Defined Function (UDF) as the thermal condition.
A UDF is a text file wit a .c extension which can be interpreted by fluent directly.

For a simplified 2-dimensional case with the laser beam moving in x-direction and having a rectangular intensity distribution, the UDF might look like this:

Code:

```#include "udf.h" DEFINE_PROFILE(laser_beam,t,i)                //Randbedingung für den Energiefluss durch den Laser {     real x[ND_ND];                  //Ortsvektor; ND liest aus ob 2D oder 3D-Fall     real X;                            //Ortskoordinate     real x_0=0.05;                  //starting point     real v=0.05;                    //velocity of the laser beam     real b=0.005;                    //width of the laser beam     real I_0=50000000;            //Intensity     real time=RP_Get_Real("flow-time");        //der Variable time wird die Simulationszeit zugewiesen     face_t f;     begin_f_loop(f,t)     {         F_CENTROID(x,f,t);            //liest Koordinate aus         X=x[0];         if(X>=x_0+time*v-b/2 && X<=x_0+time*v+b/2)    //Laser bewegt sich entlang X             F_PROFILE(f,t,i) = I_0;         else             F_PROFILE(f,t,i) = 0;     }     end_f_loop(f,t); }```
Put the code in a text file, for example beam.c
In Fluent, go to "define" - "user defined" - "functions" - "interpreted" and choose the file. Click on "Interpret".
Now when setting up the heat flux for the boundary condition, the drop down menu which reads "constant" should allow picking the "laser_beam" profile defined in the UDF.

Since I want to simulate melting of the material by the laser, I am no longer using a heat flux as a boundary condition. Instead, I am trying to use the Discrete Ordinates radiation model to simulate the laser beam.
But if you just want to heat up the material, a heat flux BoCo should be sufficient.

 fshak92 July 3, 2012 11:14

Many Many Thanks to you indeed:-)
Wish you the best.

 flotus1 July 3, 2012 12:00

Since I was able to help you I would really appreciate if you could take a few minutes to look at my problem:

cheerio

 fshak92 July 25, 2012 03:16

1 Attachment(s)
Hi

I set the udf to the boundary condition of the line(the line in the picture below) as 'heat flux' and 'temperature' ,but non of them changed any thing in my 'temperature contour' after running for some seconds.
The simulation is 3d but the coordinates of line is changing just in Y ,therefore i replaced all the 'X' , to 'Y'.
Is there any hint that should be considered?
Thank you again.

 flotus1 July 25, 2012 03:35

The names of the Variables have nothing to do with the ordinates.
The array x[ND_ND] holds the position vector, but could easily be called position[ND_ND] or thisisabitconfusing[ND_ND]

x[0] -> x-position
x[1] -> y-position
x[2] -> z-position (if the case is 3D)

 hannarose December 11, 2012 02:52

Quote:
 Originally Posted by flotus1 (Post 369539) If your boundary condition is just a heat flux, then set the BoCo to "wall" and apply a User Defined Function (UDF) as the thermal condition. A UDF is a text file wit a .c extension which can be interpreted by fluent directly. For a simplified 2-dimensional case with the laser beam moving in x-direction and having a rectangular intensity distribution, the UDF might look like this: Code: ```#include "udf.h" DEFINE_PROFILE(laser_beam,t,i)                //Randbedingung für den Energiefluss durch den Laser {     real x[ND_ND];                  //Ortsvektor; ND liest aus ob 2D oder 3D-Fall     real X;                            //Ortskoordinate     real x_0=0.05;                  //starting point     real v=0.05;                    //velocity of the laser beam     real b=0.005;                    //width of the laser beam     real I_0=50000000;            //Intensity     real time=RP_Get_Real("flow-time");        //der Variable time wird die Simulationszeit zugewiesen     face_t f;     begin_f_loop(f,t)     {         F_CENTROID(x,f,t);            //liest Koordinate aus         X=x[0];         if(X>=x_0+time*v-b/2 && X<=x_0+time*v+b/2)    //Laser bewegt sich entlang X             F_PROFILE(f,t,i) = I_0;         else             F_PROFILE(f,t,i) = 0;     }     end_f_loop(f,t); }``` Put the code in a text file, for example beam.c In Fluent, go to "define" - "user defined" - "functions" - "interpreted" and choose the file. Click on "Interpret". Now when setting up the heat flux for the boundary condition, the drop down menu which reads "constant" should allow picking the "laser_beam" profile defined in the UDF. Since I want to simulate melting of the material by the laser, I am no longer using a heat flux as a boundary condition. Instead, I am trying to use the Discrete Ordinates radiation model to simulate the laser beam. But if you just want to heat up the material, a heat flux BoCo should be sufficient.

hye. i will be doing a modeling of laser cutting. the parameters are cutting speed, laser power, focal length. how can i do the modeling using ansys? i want to get the thermal distribution and kerf width.tq

 flotus1 December 11, 2012 05:10

http://www.cfd-online.com/Forums/flu...tes-model.html

 All times are GMT -4. The time now is 11:17.