# STOP Analysis of high-power laser systems - part 4

High power lasers are widely used in a variety of applications, such as laser cutting, wielding, and drilling etc. The effect caused by absorption laser light in the optical system is noticeable. The performance of such optical systems will be degraded by heating from the high power laser, either due to bulk absorption of the lens materials or surface absorption via coatings. Modeling of such effects is necessary to ensure the focal length stability and the laser beam size and quality. In this series of 5 articles we are going to simulate laser heating effects, including the change of refractive index due to the increased temperature in the lens materials, as well as the structural deformation caused by mechanical stress and thermal elastic effect.

Authored by: Julia Zhang, Hui Chen, Steven La Cava & Chris Normanshire

Article attachments

## Preparation for FEA analysis

We will now open the full optomechanical system in OpticStudio and prepare to record the amount of laser power that is absorbed as the beam passes through the lenses and mirror. We’ll then export this data in a format that can be imported to our FEA software. Open the attached file ‘system_NSC_2022.zar’

### The Detector Volume object

Unlike 2D detector objects (e.g. Detector Rectangle, Detector Surface, Detector Color) the Detector Volume is a 3D object divided into voxels (volume pixels) to record the absorbed flux, incident flux, or absorbed flux per volume. To obtain the absorbed flux data in our lenses we will a Detector Volume lens element in the system.

When using Detector Volumes we can take advantage of the nesting rule in Non-Sequential Mode to compute the absorbed flux inside objects such as lenses. If two non-sequential objects overlap in space then the behavior of rays in the overlapping regions is determined by the nesting rule. The nesting rule states: if a ray strikes more than one object at the exact same point in space, the last object listed in the NSC Editor determines the properties of the surface or volume at that point.

## Add Detector Volume objects

To get the absorbed flux for the lenses, a Detector Volume object is added for each element. According to the nesting rule, the Detector Volume is inserted before the target lens in the NSCE. The center of the Detector Volume is co-located with the target element enclosed. Parameters: X Half Width, Y Half Width and Z Half Width are chosen such that the Detector Volume object is just slightly larger than the corresponding lens element. Parameters # X Pixels, # Y Pixels, and # Z Pixels specify the total number of voxels in each Detector Volume object. Communication with the FEA engineer at this point is useful to ensure a high enough resolution for good FEA analysis while not having so many voxels that a prohibitively large number of rays is required. We have decided in this example to use a moderate pixel sampling of 100 x 100 x 100.

Add a Detector Volume object for each lens in the NSCE as shown below.

## Apply coatings to mechanical components

We will now apply reflection, absorption and scattering properties to all mechanical components. Highlight CAD objects 14-26 in the NSCE and open Object Properties…Coat/Scatter. Apply the coating AL_LASER to Face 0, and apply a Lambertian scattering model with a Scatter Fraction of 1. These changes will be applied to all the objects you have currently highlighted in the NSCE.

### Object property settings

With all the imported CAD parts still selected, Object Properties…Type and tick the option ‘Object is A Detector’. This will set these objects as detectors (the mesh triangles used to render the CAD object are treated as pixels) so the absorbed fluence on the object faces can be recorded.

For the CAD parts used as detectors, the default number of facets that are used as pixels will probably not provide enough resolution to record the data accurately. We can make the facets/pixels smaller (and increase to number of pixels) by changing the Object Properties…CAD...Maximum edge length parameter from the default value of 0.

Set Maximum edge values to 0.8 mm for each of the CAD parts.

### System Explorer: Non-Sequential settings

With the default Minimum Relative Ray Intensity setting, a ray reflected from the coated surface of the CAD parts is terminated when it falls below 0.1% (1e-3) of the ray’s initial power. In our analysis or this high power laser, even rays with a relatively low fraction of their initial power will still cause heating of the system and must be accounted for. To avoid losing energy due to the threshold, set the Minimum Relative Ray Intensity to 1.0000E-007.

The file at this stage 'system_NSC_2022_Final.zar’ is available in the article attachments.

## Ray trace and retrieve absorption data

Run raytracing with the settings shown below. The flux data will be stored in detectors and ready for use and retrieval through ZOS-API.

The irradiance on the face of any ‘Object is Detector’ can be visualized in the Shaded model.

And the absorbed flux inside the Detector Volumes can be viewed in the Detector Viewer.

ZOS-API is a powerful tool that can help automate the data export process. In the following section we show how to use ZOS-API script to retrieve the flux data stored on the detectors and configure the output to meet the input requirements of your FEA package. If you are new to ZOS-API please see Getting Started with ZOS-API – Zemax for full guidance and inspiration on how to make the most of its capabilities.

#### Data type of detectors

In OpticStudio the different detector types are capable of storing different types of data.

 Detector Type Data Type Radiometric Unit Energy Unit Detector Rectangle Irradiance watt/meter^2 watt/centimeter^2 watt/millimeter^2 watt/foot^2 watt/inch^2 joule/meter^2 joule/centimeter^2 joule/millimeter^2 joule/foot^2 joule/inch^2 Intensity watt/steradian joule/steradian Radiance watt/steradian-meter^2 joule/steradian-meter^2 Detector Volume Incident Flux watt Absorbed Flux/Volume Absorbed Flux watt joule Absorbed Flux/Volume watt/meter^3 watt/centimeter^3 watt/millimeter^3 watt/foot^3 watt/inch^3 joule/meter^3 joule/centimeter^3 joule/millimeter^3 joule/foot^3 joule/inch^3 Object is A Detector Incident Fluence watt/meter^2 watt/centimeter^2 watt/millimeter^2 watt/foot^2 watt/inch^2 joule/meter^2 joule/centimeter^2 joule/millimeter^2 joule/foot^2 joule/inch^2 Absorbed Fluence

#### Data format required in the example

The following table summarizes the types of data extracted from each kind of detectors to be used for FEA analysis.

Detector Type

Pixel Shape

Data Type

ZOS-API syntax

Detector Rectangle

Rectangle

watt/centimeter^2

 bool GetDetectorData (int ObjectNumber, int pixel, int Data(=2), out double Value)

Detector Volume

Rectangular Volume

Absorbed Flux/Volume

watt/centimeter^3

 bool GetDetectorData (int ObjectNumber, int pixel, int Data(=2), out double Value)

Object is a Detector

Triangle

Absorbed Fluence

watt/centimeter^2

The FEA software used for this example is Ansys Mechanical, which can import our absorbed flux at data as an external heat source for use in thermal simulations. The required format for the imported data is as follows:

X  Y  Z  AbsorbedData

X, Y, Z are the global coordinates for the center of each pixel, and the AbsorbedData is the value of the data type listed above.

Note that when checking the absorbed flux data from a Detector Viewer window, the data is only available in Text tab for Object is A Detector. The Text tab displays a text listing of the Flux and Irradiance values for each triangular pixels. The X, Y, and Z values are the local coordinates of the center of each pixel. It is good practice to use a single consistent global coordinate system throughout the STOP analysis. If data is to be exported in Global coordinates, the appropriate coordinates transformation is needed.

## Using ZOS-API to export absorption data

We have created Python script to retrieve, format and export the data. This script, ‘ExportAbsorbedFlux.py’ is available in the article attachments. The following sections will explain the main sections of this code.

#### Calculation of Rotation Matrix

First we need to determine the rotation matrix of each object in our system. If the option Object Properties…Type…Use Global XYZ Rotation Order is unticked, the rotation matrix for the object is computed using the following equation, in which A, B, and C are the Tilt X, Y, Z angles listed in the NSCE.

On the contrary, if the ‘ Use Global XYZ Rotation Order’ option is ticked, then the rotation matrix for the object is decided by:

The above calculation is defined within the function rotation_matrix

#### Conversion from local coordinates into global coordinates

The conversion from object local coordinates to global coordinates can be written in equation form as:

where the g subscript indicates the global coordinate, o is the offset, and l is the local object coordinate. R11, R12… R33 are the components of the rotation matrix R for the object.

The above calculation is defined within the function convert_to_global

#### Calculation of local coordinates and retrieval of absorbed flux values

For the type of Object is A Detector:

The local coordinates are calculated by the following code within for loop for each facet pixel:

detector.CurrentFace = jposition_1 = detector.GetVertex(0, 0.0, 0.0, 0.0)position_2 = detector.GetVertex(1, 0.0, 0.0, 0.0)position_3 = detector.GetVertex(2, 0.0, 0.0, 0.0)x_position = (position_1[1] + position_2[1] + position_3[1])/3y_position = (position_1[2] + position_2[2] + position_3[2])/3z_position = (position_1[3] + position_2[3] + position_3[3])/3 value = detector.AbsorbedIrradiance

position_1, position_2, position_3 represent the three vertex point for each triangle pixel.

bool GetVertex (int vertexNumber, out double X, out double Y, out double Z)

Method GetVertex is used to retrieve the X, Y, and Z position for the specified vertex. Then, the local coordinates of the center of the triangle can be calculated.

For Detector Rectangle and Detector Volume the local coordinates are calculated by the following code within for loops for each rectangle pixel/rectangular volume pixel.

# Detector Rectanglelocal_x = ((j % pixelsX) - ((pixelsX - 1) / 2)) * (widthX / pixelsX)local_y = (((j // pixelsX) % pixelsX) - ((pixelsY - 1) / 2)) * (widthY / pixelsY)local_z = 0.0value = TheNCE.GetDetectorData(i + 1, j + 1, 2, 0.0)[1]# Detector Volumelocal_x = ((j % voxelsX) - ((voxelsX - 1) / 2)) * (widthX / voxelsX)local_y = (((j // voxelsX) % voxelsY) - ((voxelsY - 1) / 2)) * (widthY / voxelsY)local_z = ((j // (voxelsX * voxelsY)) - ((voxelsZ - 1) / 2)) * (widthZ / voxelsZ)value = TheNCE.GetDetectorData(i + 1, j + 1, 2, 0.0)[1]

Retrieval of the absorbed data is performed pixel by pixel, where i represents the loop over the object, and j represents the loop over the pixels. The referenced local coordinate system is at the center of that object, and the numbering of pixels for the detectors should be noted when deciding how to loop and get the data from pixel to pixel. Comments on pixel numbering for the detectors can be checked in the OpticStudio Help file entry for each detector type.

#### Convert local coordinates into global coordinate and get the result

Empty arrays are created beforehand, ‘detectorData’ is used to store local coordinates, and detector data. ‘global_detectorData’ is used to store the global coordinates and the detector data:

detectorData = []global_detectorData = []

Local data is appended during the loop of pixels for each detector:

detectorData.append([local_x, local_y, local_z, float(value)])

Finally, the array with local coordinates is converted to an array with global coordinates for each detector:

global_detectorData = convert_to_global(i+1, detectorData)

### How to use the Python code

This code is designed to run as an Interactive Extension in OpticStudio.

1. First open the non-sequential lens file, and run a raytrace, with ‘Use Polarization’ checked.
2. Click Programming…Interactive Extension from and then run the ExportAbsorbedFlux.py code in your Python IDE

1. Data will be saved as txt file in the folder specified in the code. The status of the data appending will be printed out during running of the code:

## Conclusion

We have successfully simulated the absorption of our laser beam as it passes through the optical system and generated files of the absorbed flux data. The is data, along with a model of of our complete optomechanical system will provide the inputs for the structural and thermal analysis in our FEA tool. In the next article we will show how to take output of the structural and thermal analysis and import into OpticStudio with the STAR module.

This is the fourth article of the STOP Analysis of high-power laser systems series.

Next article: STOP Analysis of high-power laser systems - part 5