Optical

Optical

How to test different SOP/VOP with automation?

    • Xime54
      Subscriber

      Hi every body, 

      For lighting luminaire simulation, I want to test the effect of color of the body of the luminaire on the results. I want to try several colors. My first idea was to prepare as much simulation as colors I want to test, and launch all the simulation at the same time, but it appeats it's not possible. 

       

      Somebody has a good trick for this? 

      Thank you. 

       

    • Mathieu Reigneau
      Subscriber

      Hello,

      There are several solutions, the most efficient depends on the number of materials to test. You can either export a simulation for each material and run these from Speos Core. Or you can record a script that automates the material change and run the simulation for each.

      Cheers.

    • Xime54
      Subscriber

      Thanks Mathieu for your answer, 

      For now, scripting is a little bit too complicate for me, and I'm not very used with the "SPEOS Core" tool, I discover it with your answer. Is it possible to put several speos file in it, in order to chain the calculations?

      Thank you!

       

      Maxime

    • Thomas Martineau
      Ansys Employee

       

      Hello,

      There is also a possibility using Workbench.

      First in Speos, go in Workbench tab and click Publish Parameters. Then select the material and tick in the row Publish corresponding to the material file (the value is a path to the file)

      Then launch Workbench. Darg and drop a Speos toolbox in the project schematic like this 

      Right click on Geomety then Import Geometry and select your Speos project.

      Right Click on Simulation Task and click Generate Parameters.

      The project is automatically open and Workbench retrieve the parameters. A link parameter set is added under the Speos node

      Double click on parameter set

      On the right part, there is the ‘Table of Design points’. Here you can  right click on DP 0 and duplicate it as many time as you need (number of configutations) and on each new design point (DP) you can change the file name

      Save the project. 

      Back to the project tab, you can Update all design points (will work only if you have an output paramete) or  when parameter set is selected, chande in the propertie Retaiend Design point to Update full project like this :

      Then you can update all design points.

      Workbench will create one folder for each confuguration with the project corresponding to this configuration and launch the simulation. 

      In each subfolder you can find the result for each configuration. 

       

      When selecting simulation task, in the propertie you can also choose the GPU solver

       

      Best regards

      Thomas 

       

    • Xime54
      Subscriber

      Thank you Thomas for this very complete and detail answer, I will try it as soon as possible, like the scripting method. 


      I found an alternative before the weekend (a good time to launch several calculations): I create as many copies of mechanical parts as necessary, and I apply to each one a material to test; ditto for the sources if I want to calculate with several sources. 
      "I only have" (the most difficult and long part) to create as many simulations as necessary, selecting the right geometries and the right sources. 

      Effectively, the best would be that I master the scripts.

       

      Regards, 

      Maxime

       

       

       

       

    • Gwenaël Moysan
      Ansys Employee

      You can start scripting with something simple like this:

      And then elaboorate with an Excel File:

      Speos API: ANSYS SPEOS Automation 2023 R1

      The script example provided here are under MIT Licence:

      # Copyright 2022 Ansys Inc.

      # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

      # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

      # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Viewing 5 reply threads
  • You must be logged in to reply to this topic.