This article describes how to export FEA 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 Module. 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 both structural and thermal datasets.
Authored By Esteban Carbajal and Matthias Schlich
The OpticStudio STAR Module streamlines the STOP analysis workflow by enabling users to load FEA data into OpticStudio and assess the impact on the optical performance of their designs. Keeping track of which FEA datasets are assigned to which optical surfaces is essential to correctly model the optical performance. With multiple optical elements and surfaces, naming the individual FEA 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 FEA 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 FEA platform that we were using. We built an Ansys user-extension which helped us to keep track of the surface name, the FEA 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 to export FEA data to the OpticStudio STAR Module.
NOTE: While the extension provided here only works for Ansys, the STAR module will accept FEA 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).
This extension reads surface deformations as well as volume temperature 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 or temperature. The results are exported along with any solve/result evaluation.
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 both deformations 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 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 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 should be used in cases where both deformations and temperatures are taken into account in the STAR module. The node positions in this temperature file do 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 temperature file have to be applied for the result to be accurate.
Only Deformation Export
Deformation & Temperature Export
Only Deformation Export
Deformation & Temperature Export
|Only Temperature Export|
Only Temperature Export
Installing the Export to STAR Extension in Ansys
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 there 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
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 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)
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 FEA data is now ready to be loaded into the STAR Module in OpticStudio!
By streamlining the process to export FEA data, the optical and mechanical design teams can collaborate to accomplish STOP analysis inside of OpticStudio via the STAR Module. 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 FEA data exporting and STAR FEA data loading, but also helps eliminate human error in the process and improves the overall efficiency of the STAR workflow.
|Extension Version||Notes (each version added functionality on top of the previous one)|
(no binary extension available) exports temperature and deformation only from structural analyses for lenses only.
exports temperature and deformation only from structural analyses for mirrors and lenses (this was never attached to the KBA).
exports temperature from both thermal and structural analyses (except for Ansys 2021R2, where temperature can only be exported from thermal analyses).
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)|