Photonics

Photonics

Topics related to Lumerical and more

Problem of using a script file to change geometry and run RCWA simulation.

TAGGED: ,

    • xuanlunhuang20
      Subscriber

      Hi, 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.

    • xuanlunhuang20
      Subscriber

      If 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.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.