This article describes how to export multiphysics results from Ansys Mechanical using a custom extension from Zemax. The extension (available for download below this article) helps streamline the export process with each FEA data properly named and formatted for immediate import into OpticStudio via the STAR Multiphysics Data Loader. The extension makes it easy to keep track of the FEA datasets and which surface they should be assigned to in your optical design. The extension will work with multiphysics datasets including surface deformation, thermal profiles, and stress files.
Authored By Esteban Carbajal and Matthias Schlich
Downloads
Article attachment and version history
Introduction
The STAR tools in OpticStudio streamlines the STOP analysis workflow by enabling users to load multiphysics data into OpticStudio and assess the impact on the optical performance of their designs. Keeping track of which multiphysics datasets are assigned to which optical surfaces is essential to correctly model the optical performance. With multiple optical elements and surfaces, naming the individual datasets appropriately can quickly become a tedious and time consuming task.
Ansys ACT API makes it easy for users to create extensions and automate their workflow. Saving multiphysics datasets with a consistent naming scheme is an ideal example of where scripting can help improve the processing speed and reduce human error.
During the development of the STAR Module, our team quickly realized this opportunity and began working on an extension for the Ansys Mechanical platform that we were using. We built an Ansys Mechanical user-extension which helped us to keep track of the surface name, the data type, and the reference coordinate system. Using the extension culminated in a workflow that reduced the number of mistakes made during the testing process. To help our users streamline their STOP analysis workflow further, we now provide this extension as a courtesy to our customers so they can use it in Ansys Mechanical to export multiphysics data to OpticStudio via STAR.
NOTE: While the extension provided here only works for Ansys module, STAR will accept data from any FEA package.
NOTE: This extension was developed and tested using English as the language setting in Ansys Workbench. Problems may occur when using other language settings in Ansys Workbench. (Also, the Ansys analysis name and folder name for the exported files must be in alphanumeric characters).
Overview
This extension reads surface deformations as well as volume temperature and stress profiles. It creates output datasets as .txt files in a separate folder inside the user_files folder of the Ansys workbench project directory. The columns are tab-delimited and describe the node position followed by the deformation, stress or temperature. The results are exported along with any solve/result evaluation.
OpticStudio STAR tools expect results to have certain units during the loading process. To enable customers to work in the units that they are most comfortable with, the Export to STAR extension will automatically convert the units of the results upon export for thermal and stress datatypes. This streamlines the data import process and is summarized below:
Expected Unit in AZOS STAR | Action Taken | |
Structural | Lens Unit of .ZMX file | None |
Thermal | °C | Convert to °C |
Stress | MPa | Convert to MPa |
The extension is intended to be used in a structural analysis where a temperature profile has been imported. With this type of analysis, the extension can export deformations, stress and temperatures from the same analysis. If no temperature profile has been assigned, a uniform body temperature will be exported. They now contain a uniform temperature based on the environment setting. It is possible to use the extension within a thermal analysis, but this will only provide temperature files.
To allow the accurate alignment of temperature and stress data with both the deformed as well as the un-deformed optic, two different data sets are written for each volume.
- The txt file with the name Surface_XX_Temperature.txt / Surface_XX_Stress.txt contains the original node positions and is intended to be used only if deformations are not applied.
- The txt file with the name Surface_XX_Temperature_deformed.txt / Surface_XX_Stress_deformed.txt should be used in cases where both deformations and volumetric datasets are taken into account in STAR. The node positions in this temperature or stress file reflect the deformation that is contained in the deformation files. Note that in this case both front and back surface deformation files as well as the Surface_XX_Temperature_deformed.txt / Surface_XX_Stress_deformed.txt temperature file have to be applied for the result to be accurate.
Analysis Type |
Mirror Export |
Lens Export |
Static Structural |
Only Deformation Export |
Deformation, Stress & Temperature Export |
Transient Structural |
Only Deformation Export |
Deformation, Stress & Temperature Export |
Steady-State Thermal |
Not Available |
Only Temperature Export |
Transient Thermal |
Not Available |
Only Temperature Export |
Installing the Export to STAR Extension in Ansys Mechanical
In the Ansys Workbench environment, click Extensions and then Install Extension… in the menu.
In the Explorer window, locate the Export to STAR.wbex file and click Open.
If you see this error message:
try switching your windows regional format to “English (United States)”, restart Workbench, and start again.
Now navigate to the ACT Home and from there to the Extension Manager by clicking on ACT Start Page and then on Manage Extensions
After the extension has been installed, click the extension in the Extension Manager to load the extension. The extension should become highlighted in green.
Close the ACT Start Page to return to your Workbench Project.
The Export to STAR extension has now been installed and loaded for your active Ansys Workbench project.
Using the Export to STAR Extension for Ansys Mechanical
If the installation of the extension was successful, you should now see an Export to STAR tab in the ribbon at the top of your Ansys Mechanical window:
There are two different export buttons:
- Export Mirror Data gets the deformation data for a single surface and is inactive in a thermal analysis.
- Export Lens Data has two different functionalities depending on the analysis type:
- In structural analyses it inserts an Export Lens to STAR object into the result, which gets the deformation data of two surfaces as well as the thermal and stress data of the selected volume.
- In thermal analyses it inserts an Export Temperature to STAR object into the result, which only gets the thermal data of the selected volume.
In the following section only the Export Lens to STAR functionality is described, as it covers all the options for Export Mirror to STAR and Export Temperature to STAR as well.
In the Graphics Toolbar, enable Body mode.
In the graphics area, select the body of the optical component you want to export the data from. This step is important. Skipping it will otherwise lead to exporting the temperature data for the entire assembly.
On the Export to STAR tab of the ribbon, click Export Lens Data.
Once the Export Lens to STAR entry is inserted in the solution tab, select the front surface of the component, and apply to Front-Surface../Geometry.
To do so, first enable the Face mode in the Graphics Toolbar (if you are in a 2D analysis, enable Edge mode), then click the yellow box next to Geometry.
Next, click the front surface of the lens in the graphics area, and then click Apply.
Repeat the previous steps for the back surface of the lens.
Define the Front Surface Zemax ID using the row number of the surface in the Lens Data Editor in OpticStudio.
Define the Front Coordinate System (select the same one for all if you want to use global coordinates).
Repeat the process and define back surface information.
Define the Length Unit that is being used in OpticStudio:
- mm (default)
- cm
- in
- m
Select if you want to export the deformation along with a 7th column containing weight values for each node. The weights will be used in the computation of Rigid Body Motions in OpticStudio STAR module.
Define the timesteps that are desired:
- All Timesteps – several folders will be created
- Define Timestep – select timestep range
If Defined Timestep is selected, choose the appropriate timestep definition.
Enter the timestep you want to export the data from.
When all entries have been added to the solution tab, click Evaluate All Results to start the export.
This will create .txt files in the user_files folder of your workbench project directory for each surface and volume selected . Your multiphysics data is now ready to be loaded into OpticStudio via STAR!
Conclusion
By streamlining the process to export data, the optical and mechanical design teams can collaborate to accomplish STOP analysis inside of OpticStudio via STAR. This extension makes it easy to keep track of the different datasets and which optical surfaces they are assigned to. It not only helps reduce the effort on Ansys Mechanical data exporting and STAR multiphysics data loading, but also helps eliminate human error in the process and improves the overall efficiency of the STAR workflow.
Version History
Extension Version | Notes (each version added functionality on top of the previous one) |
v1.0 |
(no binary extension available) exports temperature and deformation only from structural analyses for lenses only.
|
v1.1 |
exports temperature and deformation only from structural analyses for mirrors and lenses (this was never attached to the KBA).
|
v1.2 |
exports temperature from both thermal and structural analyses (except for Ansys 2021R2, where temperature can only be exported from thermal analyses).
|
v1.3 |
exports data in batch mode as well (updating your Workbench project works additionally to evaluating results in mechanical).
|
v2.0 | Supports 2D Analyses, user can choose unit system, weights can be exported for deformations. |
v2.1 | Bugfix for user defined coordinate system in combination with unit conversion. |
v2.2 | Same as v2.1 but compatible with Ansys Workbench version 2020 R1 and newer (except for 2021 R2, see v1.2) |
v2.3 | Bugfix for length unit conversion not working correctly for some unit systems. |
v3.2 | Added stress export to enable stress birefringence STOP analysis |
Comments
Article is closed for comments.