-
-
September 2, 2023 at 4:58 pm
xuanlunhuang20
SubscriberHi, recently I met a problem with using a script file to change the geometry and run the RCWA simulation. The problem is that the sizes of the objects in a new simulation cannot change and keep the same values as the previous simulation. Here is the description:
I have the following simulation model. There are “bar”, “substrate” and RCWA in the model.
Inside the model, I have four variables:
In the Script of Setup, I have the following codes to set the geometry of the three objects:
Lmax = 1e-6;
n1 = 1;
n2 = 1;
#set structure properties
select("bar");
set("x",0);set("y",0);
set("x span",wx);
set("y span",wy);
set("z max",height);
set("z min",0);
select("substrate");
set("x",0);set("y",0);
set("x span",period*3);
set("y span",period*3);
set("z max",0);
set("z min",-3*Lmax/n1);
# Set up RCWA simulation objects
select("RCWA");
set("x",0);set("y",0);
set("x span",period);
set("y span",period);
set("z max",0.5*Lmax/n2+height); # match FDTD region
set("z min",-0.5*Lmax/n1); # match FDTD region
Then, I try to run this script to change the geometry of the objects and run the RCWA simulation. At first, I tried only to change the geometry, which means I commented out line 14 “run;” and ran the script.
As seen from the two pictures, the geometry of the objects can be changed accordingly if I choose line 1 or line 2 to run.
But something wrong happened when I uncommented line 14. As seen from the following two pictures, even though I choose line 1 or line 2 to run, the geometry of the objects remains unchanged in the two simulations. I find that the variables in the model are changed, while the geometry of the three objects remains as the previous.
Could anyone help with this? Thanks in advance.
-
September 3, 2023 at 4:40 am
xuanlunhuang20
SubscriberIf I use FDTD to simulate, this problem won't happen. And I found an alternative method for this. That is you can copy all the codes in the model to the script file that you want to run, which can change the geometry and run the correct simulation. I am wondering if there is something special that needs to be set for the RCWA simulation as compared with the FDTD simulation.
-
- 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.

Ansys Blog
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.
- “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
- Error on Lumerical device
- Questions about the calculation of the cross-polarization conversion efficiency of metasurface
- Ansys Insight: About override mesh in FDTD: its use and settings
- Finding your Ansys (or Lumerical) account number
- Lumerical – error message when trying to open from Linux terminal
-
7626
-
4456
-
2955
-
1427
-
1322
© 2023 Copyright ANSYS, Inc. All rights reserved.