Photonics

Photonics

Topics related to Lumerical and more

Solar monitor position not getting updated while using script in model setup

    • 1706170
      Bbp_participant

      Hello. I have been trying to set up a Lumerical FDTD simulation for running structure optimization and sweep of a solar cell. For this, I have declared a structure group of solar cell layers with the layer thickness value as input user-defined parameters. I have also tried to set the FDTD and monitor dimension based on the user-defined solar cell structure group properties. For the later part, I have added the following code in the model setup script.

      select("PSC_pin");
      set("h_HTL_1", HTL_zspan); #sweep variable 
      set("h_ABS", PSC_zspan); #sweep variable 
      runsetup;


      select("PSC_pin::BC");
      PSC_zbottom = get("z min");
      select("PSC_pin::TCO");
      PSC_ztop = get("z max");

      offset_src = 200e-9;
      src_z = PSC_ztop+offset_src;
      select("source");
      set("z", src_z);


      FDTD_offset = 100e-9;
      FDTD_zmax = src_z+FDTD_offset;
      FDTD_zmin = PSC_zbottom-FDTD_offset;
      select("FDTD");
      set("z min", FDTD_zmin);
      set("z max", FDTD_zmax);
      select("PSC_pin::HTL_1");
      solar_ztop = get("z max");

      select("PSC_pin::ETL_1");
      solar_zbottom = get("z min");
      solar_z = (solar_ztop + solar_zbottom)/2;
      solar_zspan = solar_ztop - solar_zbottom;

      select("solar_generation");
      set("z", solar_z);
      set("z span", solar_zspan);
      runsetup;

       

      When I ran the sweep, the structure, FDTD domain, and source position were updated in the newly created .fsp files but the monitor dimension remained the same. Outside of sweep, I tried changing the thickness parameters from the model's setup variable section. But for the monitor to be updated properly, I had to click the 'test' twice.

      After clicking "test" first time, I had the message that the structure group script had run. After clicking "test" second time, I had the message that the solar generation analysis group script had run. 

      What should I do to run the sweep using this setup properly?

    • Guilin Sun
      Ansys Employee

       

      I believe you need script to control the monitor in the analysis group. When you change the z-span of “solar_generation”, does it apply to the monitor location? if not,  please try to set the monitor position with a variable related to z-span or a new parameter.

       

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