


{"id":366655,"date":"2024-05-13T20:06:07","date_gmt":"2024-05-13T20:06:07","guid":{"rendered":"\/forum\/forums\/topic\/solar-monitor-position-not-getting-updated-while-using-script-in-model-setup\/"},"modified":"2024-05-13T20:06:07","modified_gmt":"2024-05-13T20:06:07","slug":"solar-monitor-position-not-getting-updated-while-using-script-in-model-setup","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/solar-monitor-position-not-getting-updated-while-using-script-in-model-setup\/","title":{"rendered":"Solar monitor position not getting updated while using script in model setup"},"content":{"rendered":"<p>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.<\/p>\n<p><span style=\"font-size: 12pt\"><em>select(&#8220;PSC_pin&#8221;);<\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>set(&#8220;h_HTL_1&#8221;, HTL_zspan);&nbsp;<span>#sweep variable&nbsp;<\/span><\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>set(&#8220;h_ABS&#8221;, PSC_zspan); <span>#sweep variable&nbsp;<\/span><\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>runsetup;<\/em><\/span><\/p>\n<p><span style=\"font-size: 12pt\"><em>select(&#8220;PSC_pin::BC&#8221;);<\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>PSC_zbottom = get(&#8220;z min&#8221;);<\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>select(&#8220;PSC_pin::TCO&#8221;);<\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>PSC_ztop = get(&#8220;z max&#8221;);<\/em><\/span><\/p>\n<p><span style=\"font-size: 12pt\"><em>offset_src = 200e-9;<\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>src_z = PSC_ztop+offset_src;<\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>select(&#8220;source&#8221;);<\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>set(&#8220;z&#8221;, src_z);<\/em><\/span><\/p>\n<p><span style=\"font-size: 12pt\"><em>FDTD_offset = 100e-9;<\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>FDTD_zmax = src_z+FDTD_offset;<\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>FDTD_zmin = PSC_zbottom-FDTD_offset;<\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>select(&#8220;FDTD&#8221;);<\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>set(&#8220;z min&#8221;, FDTD_zmin);<\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>set(&#8220;z max&#8221;, FDTD_zmax);<\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>select(&#8220;PSC_pin::HTL_1&#8221;);<\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>solar_ztop = get(&#8220;z max&#8221;);<\/em><\/span><\/p>\n<p><span style=\"font-size: 12pt\"><em>select(&#8220;PSC_pin::ETL_1&#8221;);<\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>solar_zbottom = get(&#8220;z min&#8221;);<\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>solar_z = (solar_ztop + solar_zbottom)\/2;<\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>solar_zspan = solar_ztop &#8211; solar_zbottom;<\/em><\/span><\/p>\n<p><span style=\"font-size: 12pt\"><em>select(&#8220;solar_generation&#8221;);<\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>set(&#8220;z&#8221;, solar_z);<\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>set(&#8220;z span&#8221;, solar_zspan);<\/em><\/span><br \/><span style=\"font-size: 12pt\"><em>runsetup;<\/em><\/span><\/p>\n<p>&nbsp;<\/p>\n<p>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&#8217;s setup variable section. But for the monitor to be updated properly, I had to click the &#8216;test&#8217; twice.<\/p>\n<p>After clicking &#8220;test&#8221; first time, I had the message that the structure group script had run. After clicking &#8220;test&#8221; second time, I had the message that the solar generation analysis group script had run.&nbsp;<\/p>\n<p>What should I do to run the sweep using this setup properly?<br \/><img decoding=\"async\" src=\"\/forum\/wp-content\/uploads\/sites\/2\/2024\/05\/13-05-2024-1715630446-mceclip0.png\"><\/p>\n","protected":false},"template":"","class_list":["post-366655","topic","type-topic","status-closed","hentry","topic-tag-LumericalFDTD-1","topic-tag-lumericalscript-1","topic-tag-parametric-sweep"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["101114","2592"],"_bbp_author_ip":["184.24.96.177"]," _bbp_last_reply_id":["0"]," _bbp_likes_count":["0"],"_btv_view_count":["327"],"_bbp_topic_status":["unanswered"],"_bbp_topic_id":["366655"],"_bbp_forum_id":["27833"],"_bbp_engagement":["2592","101114"],"_bbp_voice_count":["2"],"_bbp_reply_count":["1"],"_bbp_last_reply_id":["366791"],"_bbp_last_active_id":["366791"],"_bbp_last_active_time":["2024-05-14 15:34:09"]},"test":"9f34c5df3cb644447b3cefd5e1c2456962b73779"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/366655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/366655\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=366655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}