def setup_module(module): ################ Light parameters ##################### # Set up light objects wl_super = 500.0 wavelengths = np.array([wl_super]) light_list = [ objects.Light(wl, theta=20, phi=40, max_order_PWs=1) for wl in wavelengths ] light = light_list[0] ################ Scattering matrices (for distinct layers) ############## """ Calculate scattering matrices for each distinct layer. Calculated in the order listed below, however this does not influence final structure which is defined later """ # period must be consistent throughout simulation!!! period = 600 NW_diameter = 120 num_BM = 20 NW_array = objects.NanoStruct('2D_array', period, NW_diameter, height_nm=2330, inclusion_a=materials.Si_c, background=materials.Air, loss=True, make_mesh_now=False, mesh_file='600_120.mail') sim_NW_array = NW_array.calc_modes(light, num_BM=num_BM) superstrate = objects.ThinFilm(period=period, height_nm='semi_inf', material=materials.Air, loss=False) sim_superstrate = superstrate.calc_modes(light) substrate = objects.ThinFilm(period=period, height_nm='semi_inf', material=materials.SiO2_a, loss=False) sim_substrate = substrate.calc_modes(light) ################ Construct & solve for full solar cell structure ############## """ Now when defining full structure order is critical and solar_cell list MUST be ordered from bottom to top! """ stack = Stack((sim_substrate, sim_NW_array, sim_superstrate)) stack.calc_scat() module.stack_list = [stack] last_light_object = light_list.pop() param_layer = NW_array # Specify the layer for which the parameters should be printed on figures. params_string = plotting.gen_params_string(param_layer, last_light_object, max_num_BMs=num_BM) active_layer_nu = 1 plotting.t_r_a_write_files(stack_list, wavelengths)
def setup_module(module): ################ Light parameters ##################### # Set up light objects wavelengths = np.array([700]) light_list = [ objects.Light(wl, max_order_PWs=2, theta=0.0, phi=0.0) for wl in wavelengths ] light = light_list[0] #period must be consistent throughout simulation!!! period = 500 NW_diameter = 120 num_BMs = 40 NW_array = objects.NanoStruct('2D_array', period, NW_diameter, height_nm=2330, inclusion_a=materials.InP, background=materials.Air, loss=True, make_mesh_now=True, force_mesh=True, lc_bkg=0.07, lc2=1.5, lc3=2.0) superstrate = objects.ThinFilm(period=period, height_nm='semi_inf', material=materials.Air, loss=False) substrate = objects.ThinFilm(period=period, height_nm='semi_inf', material=materials.SiO2, loss=False) ################ Evaluate each layer individually ############## sim_superstrate = superstrate.calc_modes(light) sim_NW_array = NW_array.calc_modes(light, num_BMs=num_BMs) sim_substrate = substrate.calc_modes(light) stack = Stack((sim_substrate, sim_NW_array, sim_superstrate)) stack.calc_scat(pol='TE') module.stack_list = [stack] plotting.t_r_a_write_files(stack_list, wavelengths)
def setup_module(module): ################ Light parameters ##################### wl_1 = 1.11 * 940 wl_2 = 1.15 * 940 no_wl_1 = 1 # Set up light objects wavelengths = np.linspace(wl_1, wl_2, no_wl_1) light_list = [ objects.Light(wl, max_order_PWs=4, theta=5.0, phi=0.0) for wl in wavelengths ] light = light_list[0] #period must be consistent throughout simulation!!! period = 940 diameter = 266 NHs = objects.NanoStruct('2D_array', period, diameter, height_nm=200, inclusion_a=materials.Air, background=materials.Au, loss=True, square=True, make_mesh_now=False, mesh_file='940_266_sq.mail') superstrate = objects.ThinFilm(period=period, height_nm='semi_inf', material=materials.Air, loss=False) substrate = objects.ThinFilm(period=period, height_nm='semi_inf', material=materials.Air, loss=False) num_BM = 100 ################ Evaluate each layer individually ############## sim_NHs = NHs.calc_modes(light, num_BM=num_BM) sim_superstrate = superstrate.calc_modes(light) sim_substrate = substrate.calc_modes(light) stack = Stack((sim_substrate, sim_NHs, sim_superstrate)) stack.calc_scat(pol='TM') module.stack_list = [stack]
height_nm='semi_inf', world_1d=True, material=materials.Air, loss=False) spacer = objects.ThinFilm(period, height_nm=200, world_1d=True, material=materials.SiO2_a, loss=True) grating = objects.NanoStruct('1D_array', period, int(round(0.7 * period)), height_nm=400, background=materials.Material(1.45 + 0.0j), inclusion_a=materials.Material(3.77 + 0.01j), loss=True, lc_bkg=0.005, plotting_fields=True) def simulate_stack(light): ################ Evaluate each layer individually ############## sim_superstrate = superstrate.calc_modes(light) sim_substrate = substrate.calc_modes(light) sim_grating = grating.calc_modes(light) sim_spacer = spacer.calc_modes(light) ###################### Evaluate structure ######################
height_nm=5, material=materials.Material(3.6 + 0.27j), loss=True) substrate = objects.ThinFilm(period, height_nm='semi_inf', material=materials.Air, loss=False) grating_diameter = 100 grating = objects.NanoStruct('1D_array', period, grating_diameter, height_nm=25, inclusion_a=materials.Ag, background=materials.Material(1.5 + 0.0j), loss=True, make_mesh_now=True, force_mesh=True, lc_bkg=0.05, lc2=4.0) mirror = objects.ThinFilm(period, height_nm=100, material=materials.Ag, loss=True) def simulate_stack(light): ################ Evaluate each layer individually ############## sim_superstrate = superstrate.calc_modes(light)
# Period must be consistent throughout simulation!!! period = 165 diam1 = 140 diam2 = 60 ellipticity = (float(diam1 - diam2)) / float(diam1) # Replicating the geometry of the paper we set up a gold layer with elliptical air # holes. To get good agreement with the published work we use the Drude model for Au. # Note that better physical results are obtained using the tabulated data for Au! Au_NHs = objects.NanoStruct('2D_array', period, diam1, inc_shape='ellipse', ellipticity=ellipticity, height_nm=60, inclusion_a=materials.Air, background=materials.Au_drude, loss=True, make_mesh_now=True, force_mesh=True, lc_bkg=0.2, lc2=5.0) superstrate = objects.ThinFilm(period=period, height_nm='semi_inf', material=materials.Air, loss=True) substrate = objects.ThinFilm(period=period, height_nm='semi_inf', material=materials.Air, loss=False)
height_nm='semi_inf', material=materials.Air, loss=False) spacer = objects.ThinFilm(period, height_nm=200, material=materials.SiO2_a, loss=True) NW_diameter = 120 NW_array = objects.NanoStruct('2D_array', period, NW_diameter, height_nm=2330, inclusion_a=materials.Si_c, background=materials.Air, loss=True, make_mesh_now=True, force_mesh=True, lc_bkg=0.1, lc2=2.0, plotting_fields=True) def simulate_stack(light): ################ Evaluate each layer individually ############## sim_superstrate = superstrate.calc_modes(light) sim_substrate = substrate.calc_modes(light) sim_NWs = NW_array.calc_modes(light) sim_spacer = spacer.calc_modes(light)
L = 0.4e9 strate = objects.ThinFilm(period, height_nm='semi_inf', material=materials.Air, loss=False) NW_rads = 0.0015e9 dummy_diameter = 1 NW_diameter = NW_rads * 2 NW_array = objects.NanoStruct('2D_array', period, NW_diameter, height_nm=wl_0 / (2 * n), inclusion_a=materials.Material(0.0 + 1e6j), background=materials.Material(n), loss=True, hyperbolic=True, make_mesh_now=True, force_mesh=True, lc_bkg=0.05, lc2=4.0) def simulate_stack(lyte): wl = lyte[0] kx = lyte[1] light = objects.Light(wl, max_order_PWs=2, k_parallel=[kx, 0.000000000001]) ################ Evaluate each layer individually ############## sim_NWs = NW_array.calc_modes(light) sim_strate = strate.calc_modes(light) stack = Stack((sim_strate, sim_NWs, sim_strate))
# Period must be consistent throughout simulation!!! period = 600 # In this example we set the number of Bloch modes to use in the simulation # Be default it is set to be slightly greater than the number of PWs. num_BMs = 200 superstrate = objects.ThinFilm(period, height_nm = 'semi_inf', material = materials.Air, loss = False) substrate = objects.ThinFilm(period, height_nm = 'semi_inf', material = materials.SiO2_a, loss = False) NW_diameter = 120 NW_array = objects.NanoStruct('2D_array', period, NW_diameter, height_nm = 2330, inclusion_a = materials.Si_c, background = materials.Air, loss = True, make_mesh_now = True, force_mesh = True, lc_bkg = 0.1, lc2= 2.0) # We now create a 1D grating that is periodic in x only, but whose scattering # matrices are constructed with of the 2D plane wave basis. This allows this layer # to be combined with 2D_arrays. grating = objects.NanoStruct('1D_array', period, int(round(0.75*period)), height_nm = 2900, background = materials.Material(1.46 + 0.0j), inclusion_a = materials.Material(5.0 + 0.0j), loss = True, lc_bkg = 0.01, world_1d = False) def simulate_stack(light): ################ Evaluate each layer individually ############## sim_superstrate = superstrate.calc_modes(light) sim_substrate = substrate.calc_modes(light)
# wavelengths = np.array([785,788,790,792,795]) light_list = [ objects.Light(wl, max_order_PWs=5, theta=0.0, phi=0.0) for wl in wavelengths ] #period must be consistent throughout simulation!!! period = 940 diam1 = 266 NHs = objects.NanoStruct('2D_array', period, diam1, height_nm=200, inclusion_a=materials.Air, background=materials.Au, loss=True, inc_shape='square', make_mesh_now=True, force_mesh=True, lc_bkg=0.12, lc2=5.0, lc3=3.0) #lc_bkg = 0.08, lc2= 5.0) strate = objects.ThinFilm(period=period, height_nm='semi_inf', material=materials.Air, loss=False) NH_heights = [200] # num_h = 21 # NH_heights = np.linspace(50,3000,num_h)
substrate = objects.ThinFilm(period, height_nm='semi_inf', material=materials.Air, loss=False, world_1d=True) absorber = objects.ThinFilm(period, height_nm=10, material=materials.Material(1.0 + 0.05j), loss=True, world_1d=True) grating_1 = objects.NanoStruct('1D_array', period, int(round(0.75 * period)), height_nm=2900, background=materials.Material(1.46 + 0.0j), inclusion_a=materials.Material(3.61 + 0.0j), loss=True, lc_bkg=0.005) def simulate_stack(light): ################ Evaluate each layer individually ############## sim_superstrate = superstrate.calc_modes(light) sim_substrate = substrate.calc_modes(light) sim_absorber = absorber.calc_modes(light) sim_grating_1 = grating_1.calc_modes(light) ###################### Evaluate structure ###################### """ Now define full structure. Here order is critical and
period = 550 cover = objects.ThinFilm(period=period, height_nm='semi_inf', material=materials.Air, loss=True) sub_ns = np.linspace(1.0, 4.0, 100) NW_diameter = 480 NWs = objects.NanoStruct('1D_array', period, NW_diameter, height_nm=2330, inclusion_a=materials.Si_c, background=materials.Air, loss=True, make_mesh_now=True, force_mesh=True, lc_bkg=0.17, lc2=2.5) def simulate_stack(light): ################ Evaluate each layer individually ############## sim_cover = cover.calc_modes(light) sim_NWs = NWs.calc_modes(light) # Loop over substrates stack_list = [] for s in sub_ns:
# Define each layer of the structure # We need to inform EMUstack at this point that all layers in the stack will # be at most be periodic in one dimension (i.e. there are no '2D_arrays's). superstrate = objects.ThinFilm(period, height_nm = 'semi_inf', world_1d=True, material = materials.Air) substrate = objects.ThinFilm(period, height_nm = 'semi_inf', world_1d=True, material = materials.Air) # Define 1D grating that is periodic in x and contains 2 interleaved inclusions. # Inclusion_a is in the center of the unit cell. Inclusion_b has diameter # diameter2 and can be of a different refractive index and by default the # centers of the inclusions are seperated by period/2. # See Fortran Backends section of tutorial for more details. grating = objects.NanoStruct('1D_array', period, int(round(0.15*period)), diameter2 = int(round(0.27*period)), height_nm = 2900, background = materials.Material(1.46 + 0.0j), inclusion_a = materials.Material(5.0 + 0.0j), inclusion_b = materials.Material(3.0 + 0.0j), loss = True, lc_bkg = 0.0051) # To dictate the seperation of the inclusions set the Keyword Arg small_space to the # distance (in nm) between between the inclusions edges. grating_2 = objects.NanoStruct('1D_array', period, int(round(0.15*period)), diameter2 = int(round(0.27*period)), small_space = 50, height_nm = 2900, background = materials.Material(1.46 + 0.0j), inclusion_a = materials.Material(5.0 + 0.0j), inclusion_b = materials.Material(3.0 + 0.0j), loss = True, lc_bkg = 0.0051) def simulate_stack(light): ################ Evaluate each layer individually ############## sim_superstrate = superstrate.calc_modes(light) sim_grating = grating.calc_modes(light) sim_substrate = substrate.calc_modes(light)
substrate = objects.ThinFilm(period, height_nm='semi_inf', world_1d=True, material=materials.Air) # Define 1D grating that is periodic in x and contains 3 interleaved inclusions. # Inclusion_a is in the center of the unit cell. Inclusions 2 and 3 have # diameters diameter2, diameter3, and are of material inclusion_b. # Inclusion 1 is still centered in the center and by default all inclusions are # seperated by period/(# inclusions) so in this case perid/3. # See Fortran Backends section of tutorial for more details. grating = objects.NanoStruct('1D_array', period, int(round(0.05 * period)), diameter2=int(round(0.17 * period)), diameter3=int(round(0.03 * period)), diameter4=int(round(0.07 * period)), height_nm=2900, background=materials.Material(1.46 + 0.0j), inclusion_a=materials.Material(5.0 + 0.0j), inclusion_b=materials.Material(3.0 + 0.0j), loss=True, lc_bkg=0.0071) # To instead seperate the inclusions with an equal distance between their edges use # the Keyword Arg edge_spacing = True. grating = objects.NanoStruct('1D_array', period, int(round(0.15 * period)), diameter2=int(round(0.27 * period)), diameter3=int(round(0.03 * period)), edge_spacing=True, height_nm=2900, background=materials.Material(1.46 + 0.0j),
def setup_module(module): # Remove results of previous simulations plotting.clear_previous('.log') plotting.clear_previous('.pdf') plotting.clear_previous('.txt') ################ Light parameters ##################### wavelengths = np.linspace(800, 1600, 1) light_list = [ objects.Light(wl, max_order_PWs=6, theta=0.0, phi=0.0) for wl in wavelengths ] light = light_list[0] period = 760 superstrate = objects.ThinFilm(period, height_nm='semi_inf', world_1d=True, material=materials.Air, loss=False) substrate = objects.ThinFilm(period, height_nm='semi_inf', world_1d=True, material=materials.Air, loss=False) grating_1 = objects.NanoStruct('1D_array', period, diameter1=int(round(0.25 * period)), diameter2=int(round(0.25 * period)), height_nm=150, inclusion_a=materials.Material(1.46 + 0.0j), inclusion_b=materials.Material(1.46 + 0.0j), background=materials.Material(3.61 + 0.0j), loss=True, lc_bkg=0.005) grating_2 = objects.NanoStruct('1D_array', period, int(round(0.25 * period)), height_nm=900, background=materials.Material(3.61 + 0.0j), inclusion_a=materials.Material(1.46 + 0.0j), loss=True, lc_bkg=0.005) ################ Evaluate each layer individually ############## sim_superstrate = superstrate.calc_modes(light) sim_substrate = substrate.calc_modes(light) sim_grating_1 = grating_1.calc_modes(light) sim_grating_2 = grating_2.calc_modes(light) ################ Evaluate full solar cell structure ############## """ Now when defining full structure order is critical and stack list MUST be ordered from bottom to top! """ stack = Stack( (sim_substrate, sim_grating_1, sim_grating_2, sim_superstrate)) stack.calc_scat(pol='TE') module.stack_list = [stack] plotting.t_r_a_plots(stack_list, save_txt=True)
################ Scattering matrices (for distinct layers) ############## """ Calculate scattering matrices for each distinct layer. Calculated in the order listed below, however this does not influence final structure which is defined later """ # period must be consistent throughout simulation!!! period = 600 NW_diameter = 120 num_BM = 40 NW_array = objects.NanoStruct('2D_array', period, NW_diameter, height_nm=2330, inclusion_a=materials.Si_c, background=materials.Air, loss=True, make_mesh_now=False, mesh_file='600_120.mail') superstrate = objects.ThinFilm(period=period, height_nm='semi_inf', material=materials.Air, loss=False) substrate = objects.ThinFilm(period=period, height_nm='semi_inf', material=materials.SiO2_a, loss=False)
wl = 1600 light_list = [objects.Light(wl, max_order_PWs = 2, theta = p, phi = 0.0) \ for p in azi_angles] ################ Grating parameters ##################### period = 760 superstrate = objects.ThinFilm(period, height_nm = 'semi_inf', material = materials.Air, loss = False) substrate = objects.ThinFilm(period, height_nm = 'semi_inf', material = materials.Air, loss = False) grating_1 = objects.NanoStruct('1D_array', period, small_d=period/2, diameter1=int(round(0.25*period)), diameter2=int(round(0.25*period)), height_nm = 150, inclusion_a = materials.Material(3.61 + 0.0j), inclusion_b = materials.Material(3.61 + 0.0j), background = materials.Material(1.46 + 0.0j), loss = True, make_mesh_now = True, force_mesh = False, lc_bkg = 0.1, lc2= 3.0) grating_2 = objects.NanoStruct('1D_array', period, int(round(0.75*period)), height_nm = 2900, background = materials.Material(1.46 + 0.0j), inclusion_a = materials.Material(3.61 + 0.0j), loss = True, make_mesh_now = True, force_mesh = False, lc_bkg = 0.1, lc2= 3.0) num_BMs = 60 def simulate_stack(light): ################ Evaluate each layer individually ############## sim_superstrate = superstrate.calc_modes(light) sim_substrate = substrate.calc_modes(light)
height_nm='semi_inf', material=materials.Air, loss=False) substrate = objects.ThinFilm(period, height_nm='semi_inf', material=materials.SiO2, loss=False) NW_diameter = 120 NW_array = objects.NanoStruct('2D_array', period, NW_diameter, height_nm=2330, inclusion_a=materials.Si_c, background=materials.Air, loss=True, make_mesh_now=True, force_mesh=True, lc_bkg=0.1, lc2=2.0) # Here we get EMUstack to make the FEM mesh automagically using our input parameters. # the lc_bkg parameter sets the baseline distance between points on the FEM mesh, # lc_bkg/lc2 is the distance between mesh points that lie on the inclusion boundary. # There are higher lc parameters which are used when including multiple inclusions. # Alternatively we can specify a pre-made mesh as follows. NW_array2 = objects.NanoStruct('2D_array', period, NW_diameter, height_nm=2330,