May 6, 2022 at 7:17 pmhachaSubscriber
I would like to define some of my variables in the Model scope, but if I create a construction script there it prevents me from manually adding things like monitors (sometimes it's nice to put an arbitrary monitor in after designing a simulation).
The workaround is to create a structure group and use a separate analysis group, but sometimes I would like a monitor to rely on some variable that I specified for the construction group. Is there a way for me to access a variable stored in another group? Or can I define variables in the Model group and access them from the group's Structure or Analysis group children?
Example: I want a monitor at the end of a waveguide while I run a parameter sweep on waveguide length, 'WG_length' . I can script this all in the model group, but then it will override any attempts to add more monitors via the GUI. I could script the waveguide in a structure group, and the monitor in the analysis group, but then the monitor will no longer have access to the 'WG_length' variable and will not move with the waveguide during the parameter sweep.May 9, 2022 at 2:50 pmGuilin SunAnsys EmployeeStructure groups can only be used to set up geometry, and analysis groups can be used to set up all objects, including geometry, source, monitors and simulation solvers (similar to MODEL). However, the scripts in those groups can only access the variables inside the groups and get them from MODEL (cannot be from group to MODEL). They cannot directly access other groups.
In your case, you can include the structure group inside the analysis group, or simply setup the structure and the monitors in analysis group. You can refer some online examples, such as
May 9, 2022 at 5:46 pmhachaSubscriberThank you, that is super helpful! Could you share an example of a group script getting a variable from MODEL? Do you have to pass the variables to the group from the MODEL script, or can the groups pull the variables from MODEL? Hope this makes sense!
May 9, 2022 at 6:54 pmGuilin SunAnsys Employeeany group cannot pull variables in MODEL. It is the MODEL that passes the variables/parameters to the groups. The same parameters can be passed from MODEL to different groups, if they are the same. IN band structure simulations the periodicity is passed to the analysis, structure and dipole groups: Photonic crystals - list of examples
May 9, 2022 at 7:01 pmhachaSubscriberAh, now I understand. Thanks again!
Viewing 4 reply threads
Ansys Innovation Space
- You must be logged in to reply to this topic.
Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.
Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.Trending discussions
- “Import optical generation” or “delta generation rate”?
- Why am I getting “process exited without calling finalize”, and how do I fix it?
- Using a license file on a new license server
- Ansys Insight: Diverging Simulations
- Error: addfdtd is not a valid function or a variable name
- Questions about the calculation of the cross-polarization conversion efficiency of metasurface
- Finding your Ansys (or Lumerical) account number
- Error on Lumerical device
- Ansys Insight: About override mesh in FDTD: its use and settings
- Lumerical – error message when trying to open from Linux terminal
Top Rated Tags
© 2023 Copyright ANSYS, Inc. All rights reserved.Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.