Photonics

Photonics

Topics related to Lumerical and more

Simulation error in port source

    • kai.w.ab
      Subscriber

      I ran the simulation with FDTD and nothing remained in the results. I placed a port on a photonic crystal made of silicon from which I excited the basic mode.
      I used Python script when setting up the objects.The simulation log contained the following error statement. 
       
       
      Error: the source field data for '::port 1 Mode Source' is not valid for the source orientation and dimension.
       
      What are the possible causes?

    • Guilin Sun
      Ansys Employee

      It is hard to diagnoise here without details of your settings. I would suggest that you manually setup a similar simple device and add the port exactly the same as you are currently using and check if it works. In principle FDTD can have mode source in xy,xz and yz plane without any issue for 3D simulation. Please check your simulation "dimension" to see if it is 2D and you add the mode source in xy plane. Before using advanced method please use simple way to verify the settings. If problem still exists, please post some screen copies here.

      • kai.w.ab
        Subscriber

         

         

         

        Thank you for your response.
        Sorry for asking abstract questions without sending details.
        The python script we used for the setup is as follows (I inserted 2d photonic crystals structure as holes in the part that imports the gds files)
         
        import numpy as np
        import lumapi
        fdtd = lumapi.FDTD()
         
        #—————set constant——————————————-
        a=0.46e-6
        b=a*1e6
        nx=14
        ny=100
        G=11
         
        #—————-set FDTD————————————————-
         
        fdtd.addfdtd(dimension=”3D”, x = 0,x_span=4*b*nx*1e-6, y = 0, y_min=-20*b/0.5*1e-6, y_max=ny*b*1e-6 , z = 0.0, z_span=220e-9)
        fdtdObj= fdtd.getObjectById(“::model::FDTD”)
        fdtdObj.simulation_time=3000e-15
        fdtdObj.simulation_temperature=300
        fdtdObj.background_material=”
        fdtdObj.index=1.0
        fdtdObj.x_max_bc=”PML”
        fdtdObj.x_min_bc=”PML”
        fdtdObj.y_max_bc=”PML”
        fdtdObj.y_min_bc=”PML”
        fdtdObj.z_max_bc=”PML”
        fdtdObj.z_min_bc=”Symmetric”
        fdtdObj.same_settings_on_all_boundaries=False
         
        #——————set mesh, movie monitor, Frequency-domain field and power monitor, SiSlab(rectangle)—————————
         
        fdtd.addmesh(x = 0,x_span=4*b*nx*1e-6,  y_min=-20*b/0.5*1e-6, y_max=ny*b*1e-6 , z = 0.0, z_span=220e-9),
        fdtd.addmovie(name=”movie_z0″,monitor_type=3,x = 0,x_span=4*b*nx*1e-6,y_min=-20*b/0.5*1e-6, y_max=ny*b*1e-6 , z = 0.0, lock_aspect_ratio=1, horizontal_resolution=240 ),
        fdtd.addpower(name=”monitor_z2″,monitor_type=7,x=0,x_span=2*b*(G-1)*1e-6,
                        y=b*(ny-18)*1e-6, y_span=24*b*1e-6, z=1450e-9)
        r= fdtd.addrect(name=”SiSlab”, x = 0,x_span=4*b*nx*1e-6, y_min=-20*b/0.5*1e-6, y_max=ny*b*1e-6 , z = 0.0, z_span=220e-9)
        r.material = “Si (Silicon) – Palik”
         
        #——————–set port——————————————–
         
        fdtd.addport(),
        port1=fdtd.getObjectById(“::model::FDTD::ports::port 1”)
        port1.x=0
        port1.x_span=5*a/0.5
        port1.y=-8*a/0.5
        port1.z=0
        port1.z_span=5*a/0.5
        port1.direction=”Forward”
        port1.amplitude=100
        port1.phase=0
        port1.mode_selection=”fundamental mode”
        port1.number_of_field_profile_samples=1
        port1.injection_axis=”y-axis”
         
        # ————set global monitor————————
         
        fdtd.setglobalmonitor(“use source limits”, False)
        fdtd.setglobalmonitor(“minimum wavelength”, 1.25e-6)
        fdtd.setglobalmonitor(“maximum wavelength”, 1.45e-6)
        fdtd.setglobalmonitor(“frequency points”,41)
        fdtd.setglobalmonitor(“use wavelength spacing”,True)
         
        # ————–set global source————————-
         
        fdtd.setglobalsource(“set wavelength”, True)
        fdtd.setglobalsource(“wavelength start”, 1.25e-6)
        fdtd.setglobalsource(“wavelength stop”, 1.45e-6)
        fdtd.setglobalsource(“eliminate discontinuities”, True)
        fdtd.setglobalsource(“optimize for short pulse”, True)
        fdtd.setglobalsource(“eliminate dc” , False)
         
         
        #——-import layer from gds files———————————–
         
        layerlist_1=[0,10,20,30,35]
        for layer in layerlist_1:
            fdtd.gdsimport(“gds file 1”, “cell name 1”, layer, “etch”, -110e-9, 110e-9) 
        layerlist_p2=[41,42]
        for layer in layerlist_2:
            fdtd.gdsimport(“gds file 2”, “cell name 2”, layer, “etch”, -110e-9, 110e-9)
         
         
         
        fdtd.run()
         
         
         
         
         
         
        The setup works fine, but when I run the simulation, nothing is recorded on the monitor.
        Note that when I set up and ran the simulation manually, it worked fine. (a=0.5)  I tried to automate it with a python script to change the variable “a” ,but I am facing this problem.

         



         

         

    • Guilin Sun
      Ansys Employee

       

      Unfortunately we are not allowed to test script in this forum. Before running the FDTD, please check if the FDTD file is correct and proper. Once it is ok, you can use another python file to run it, in order to isolate the cause. Please try simple structure first.

       

Viewing 2 reply threads
  • You must be logged in to reply to this topic.