# stack based on doi:10.1038/s41563-018-0115-4 front_materials = [Layer(100e-9, MgF2), Layer(110e-9, IZO), SnO2, Layer(15e-9, C60), Layer(1e-9, LiF), Layer(440e-9, Perovskite), Spiro, Layer(6.5e-9, aSi_n), Layer(6.5e-9, aSi_i)] back_materials = [Layer(6.5e-9, aSi_i), Layer(6.5e-9, aSi_p), Layer(240e-9, ITO_back)] # whether pyramids are upright or inverted is relative to front incidence. # so if the same etch is applied to both sides of a slab of silicon, one surface # will have 'upright' pyramids and the other side will have 'not upright' (inverted) # pyramids in the model surf = regular_pyramids(elevation_angle=55, upright=True) surf_back = regular_pyramids(elevation_angle=55, upright=False) front_surf = Interface('RT_TMM', texture = surf, layers=front_materials, name = 'Perovskite_aSi', coherent=True) back_surf = Interface('RT_TMM', texture = surf_back, layers=back_materials, name = 'aSi_ITO_2', coherent=True) bulk_Si = BulkLayer(260e-6, Si, name = 'Si_bulk') # bulk thickness in m SC = Structure([front_surf, bulk_Si, back_surf], incidence=Air, transmission=Ag) process_structure(SC, options)
#n_rays = [2500, 5000, 10000, 50000] nxy = np.ceil(np.linspace(1, 50, 15)).astype(int)[:] n_rays = np.ceil(np.linspace(2500, 50000, 15)).astype(int) if calc: for n in nxy: for nr in n_rays: print('\n \n nxy/reps', n, nr) options['nx'] = n options['ny'] = n options['n_rays'] = nr flat_surf = planar_surface(size=size) triangle_surf = regular_pyramids(55, upright=False, size=size) rtstr = rt_structure(textures=[triangle_surf, flat_surf], materials=[Si], widths=[si('200um')], incidence=Air, transmission=Air) start = time() result_new = rtstr.calculate(options) print(str(size), time() - start) result = result_new to_save = np.vstack( (options['wavelengths'] * 1e9, result['R'], result['R0'], result['T'], result['A_per_layer'][:, 0])).T np.savetxt(
# materials with constant n, zero k x = 1000 d_vectors = ((x, 0), (0, x)) area_fill_factor = 0.36 hw = np.sqrt(area_fill_factor) * 500 front_materials = [] back_materials = [] # whether pyramids are upright or inverted is relative to front incidence. # so if the same etch is applied to both sides of a slab of silicon, one surface # will have 'upright' pyramids and the other side will have 'not upright' (inverted) # pyramids in the model surf = regular_pyramids(elevation_angle=55, size=5, upright=True) front_surf = Interface('RT_TMM', texture=surf, layers=[Layer(si('0.1nm'), Air)], name='pyramids' + str(options['n_rays'])) back_surf = Interface('Mirror', layers=[], name='mirror') bulk_Si = BulkLayer(201.8e-6, Si, name='Si_bulk') # bulk thickness in m SC = Structure([front_surf, bulk_Si, back_surf], incidence=Air, transmission=Air) process_structure(SC, options) results = calculate_RAT(SC, options)
} Si = material('Si_OPTOS')() Air = material('Air')() # materials with constant n, zero k x = 1000 front_materials = [] back_materials = [] # whether pyramids are upright or inverted is relative to front incidence. # so if the same etch is applied to both sides of a slab of silicon, one surface # will have 'upright' pyramids and the other side will have 'not upright' (inverted) # pyramids in the model surf = regular_pyramids(elevation_angle=55, upright=False) front_surf = Interface('RT_TMM', texture=surf, layers=[Layer(si('0.01nm'), Air)], name='inv_pyramids' + str(options['n_rays'])) back_surf = Interface('TMM', layers=[], name='planar_back' + str(options['n_rays'])) bulk_Si = BulkLayer(201.8e-6, Si, name='Si_bulk') # bulk thickness in m SC = Structure([front_surf, bulk_Si, back_surf], incidence=Air, transmission=Air)
'ny': nxy, 'parallel': True, 'pol': 'u', 'n_rays': 1 * nxy**2, 'depth_spacing': si('1um'), 'random_ray_position': False } thickness = np.arange(190, 210, 0.1) res_reg = [] res_rand = [] for th in thickness: flat_surf = planar_surface(size=size) triangle_surf = regular_pyramids(55, upright=True, size=size) options['avoid_edges'] = False options['randomize'] = False rtstr1 = rt_structure(textures=[triangle_surf, flat_surf], materials=[Si], widths=[si(th, 'um')], incidence=Air, transmission=Air) start = time() result_new1 = rtstr1.calculate(options) print(str(size), time() - start) res_reg.append(result_new1['A_per_layer'][:, 0][0]) for th in thickness: flat_surf = planar_surface(size=size)
'ny': nxy, 'parallel': True, 'pol': 'u', 'n_rays': 2 * nxy**2, 'depth_spacing': si('1um'), 'random_ray_position': False } sizes = np.linspace(2, 5, 30) res_rand = [] for sz in sizes: print('SIZE', sz) flat_surf = planar_surface(size=sz) triangle_surf = regular_pyramids(55, upright=True, size=sz) options['avoid_edges'] = False options['randomize'] = True rtstr1 = rt_structure(textures=[triangle_surf, flat_surf], materials=[Si], widths=[si(200, 'um')], incidence=Air, transmission=Air) start = time() result_new1 = rtstr1.calculate(options) print(str(sz), time() - start) res_rand.append(result_new1) A_rand = [ np.asscalar(res_rand[i1]['A_per_layer'][0]) for i1 in range(len(sizes))
result_new = rtstr.calculate(options) print(time() - start) result_opposite = result_new n_passes_Vopp = np.mean(result_opposite['n_passes'], 1) n_interactions_Vopp = np.mean(result_opposite['n_interactions'], 1) to_save_opp = np.vstack( (options['wavelengths'] * 1e9, result_opposite['R'], result_opposite['R0'], result_opposite['T'], result_opposite['A_per_layer'][:, 0], n_passes_Vopp, n_interactions_Vopp)).T np.savetxt('rayflare_fullrt_100um_Vgrooves_oppositedir', to_save_opp) options['randomize'] = False pyramids = regular_pyramids(size=5, upright=True) planar = planar_surface(size=5) rtstr = rt_structure(textures=[pyramids, planar], materials=[Si], widths=[si('200um')], incidence=Air, transmission=Air) start = time() result_new = rtstr.calculate(options) print(time() - start) result_pyrfront = result_new n_passes_pyrreg = np.mean(result_pyrfront['n_passes'], 1) n_interactions_pyrreg = np.mean(result_pyrfront['n_interactions'], 1) to_save_pyrfront = np.vstack(
from cycler import cycler pal = sns.cubehelix_palette(7, start=.5, rot=-.9) cols = cycler('color', pal) plt.rcParams['axes.prop_cycle'] = cols Air = material('Air')() Si = material('Si')() GaAs = material('GaAs')() Ge = material('Ge')() flat_surf = planar_surface() triangle_surf = regular_pyramids(10) #options = {'wavelengths': np.linspace(700, 1700, 100)*1e-9, 'theta': 45*np.pi/180, 'phi': 0, # 'I_thresh': 1e-4, 'nx': 5, 'ny': 5, # 'parallel': True, 'pol': 'p', 'n_rays': 2000, 'depth_spacing': 1, 'n_jobs': -1} options = {'wavelengths': np.linspace(700, 1700, 7)*1e-9, 'theta': 45*np.pi/180, 'phi': 0, 'I_thresh': 1e-4, 'nx': 5, 'ny': 5, 'parallel': True, 'pol': 'p', 'n_rays': 2000, 'depth_spacing': si('1um'), 'n_jobs': -1} #structure = RTgroup(textures=[flat_surf, flat_surf, flat_surf, flat_surf], materials = [GaAs, Si, Ge], # widths=[si('100um'), si('70um'), si('50um')], depth_spacing=1) rtstr = rt_structure(textures=[flat_surf, flat_surf, flat_surf, flat_surf], materials = [GaAs, Si, Ge], widths=[si('100um'), si('70um'), si('50um')], incidence=Air, transmission=Air) start = time() result_new = rtstr.calculate(options)
ax1.plot(options['wavelengths'] * 1e9, results_per_layer_front[:, 4], label='SiGeSn') ax1.plot(options['wavelengths'] * 1e9, results_TMM_Matrix[0].A_bulk[0], label='Ge') ax1.plot(options['wavelengths'] * 1e9, results_TMM_Matrix[0].T[0], label='T') ax1.set_xlabel('Wavelength (nm)') ax1.set_ylabel('Reflection / Absorption') #ax1.legend(loc='upper right') ax1.set_title('a)', loc='left') #plt.show() ## RT TMM surf = regular_pyramids(elevation_angle=0, upright=True) # [texture, reverse] front_surf = Interface('RT_TMM', layers=front_materials, texture=surf, name='GaInP_GaAs_SiGeSn_RT' + options.pol, coherent=True) back_surf = Interface('RT_TMM', layers=back_materials, texture=surf, name='SiN_Ag_RT' + options.pol, coherent=True) SC = Structure([front_surf, bulk_Si, back_surf], incidence=Air, transmission=Ag)