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 ##################### # 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 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)