################################################################################ # # Lumerical structure-generating script # (c) 2009 Michael Kelzenberg # California Institute of Technology # # This script loads a "template" file and modifies it according to the paramters # set for this node in SWB (i.e., wavelength and polarization). The input/ # output files are defined below. # # Tip: Be carefule using "#" to comment out lines. This can confuse the # sentaurus pre-processor. As a rule, always put a space after "#" if you are # writing comments. # ################################################################################ clear; template_file = "lumcad_template.fsp"; lumstr_file = "n@node@_lumstr.fsp"; Polarization = "@Polarization@"; Lambda = @Wavelen@ * 1e-9; # (m) WireDiameter = 1.61e-6; BoxWidth = 1.8e-6; #This is the width of the monitors surrounding the wire IllumWidth = 4e-6; #This is the width of the illumination source write("Single-wire solar cell FDTD structure generator script for LUMERICAL"); write("Michael Kelzenberg, 2010"); write("Settings: "+Polarization+"-polarization, "+num2str(Lambda*1e+9)+" nm."); write("Loading template file: " + template_file); load(template_file); switchtolayout; setparallel("Shell/batch file type","Linux multi-processors"); setparallel("Create parallel shell/batch file when saving fsp file",1); setparallel("Number of processors per node",2); simulation; select("FDTD"); # Select a reasonable simulation duration (longer than will be required) set("simulation time",1e-12); if( Lambda > 800e-9 ) { set("simulation time",5e-12); } if( Lambda > 950e-9 ) { set("simulation time",10e-12); } if( Lambda > 1070e-9 ) { set("simulation time",20e-12); } # Set correct boundary conditions depending on polarization if( Polarization == "TE" ) { set("x min bc","Anti-Symmetric"); } else { set("x min bc","Symmetric"); } # Set wavelength and polarization of the source sources; select("singleSource"); set("amplitude",86.8); #86.8 V/m is a illum. intensity of 1 mW/cm2 set("polarization",Polarization); set("wavelength start",Lambda); set("wavelength stop",Lambda); # Set the bandwith for partial spectral averaging monitors; freq = 2.998e+8/Lambda; n = real(getindex("SiAspnes",freq)); waveFract = 1; # 2 is for half-wave, 1 for full-wave deltaF = freq / (1 + (waveFract*WireDiameter*n/Lambda) ); write("Partial spectral averaging deltaF = " + num2str( deltaF/1e12 ) + " THz"); select("topMonitor"); set("delta",deltaF); select("bottomMonitor"); set("delta",deltaF); select("leftMonitor"); set("delta",deltaF); select("rightMonitor"); set("delta",deltaF); select("wireMonitor"); set("delta",deltaF); write("Saving modified structure: " + lumstr_file); save(lumstr_file); write("Completed successfully"); exit(2);