Ansys Learning Forum › Forums › Discuss Simulation › Photonics › EME Mode Sweep Not Converging › Reply To: EME Mode Sweep Not Converging
September 11, 2024 at 6:57 pm
Sept
Subscriber
Hi Amrita,
Â
this is the code with the waveguide added at the end:
Â
selectall; deleteall; clear;
Â
selectall; deleteall; clear;
Â
if(materialexists("TFLN"))
Â
{
Â
deletematerial("TFLN");
Â
}
Â
Â
####################Defining TFLN###########################
Â
#Indices of refraction for substrate & waveguide layers
delta_n = 0;
n_TFLN = [2.21; 2.14; 2.21];
temp = addmaterial("Dielectric");
setmaterial(temp,"name","TFLN");
setmaterial("TFLN", "Anisotropy", 1); # enable diagonal anisotropy
setmaterial("TFLN","Refractive Index", n_TFLN);
Â
Â
########## SETTING UP VARIABLES THAT CAN BE PARAMETRIZED ##################
wg_taper_length=20e-6;
wg_height=0.3e-6;
slab_height=0.3e-6;
s_angle=pi/3;
add_length=wg_height/tan(s_angle);
wg_width=2.5e-6;
l=10.25e-6;
etch=550e-9;
Â
##Setting Wg1
addrect;
set("x min",-3e-6);
set("x max",0);
set("y",0);
set("y span",wg_width);
set("z min",0);
set("z max",wg_height+slab_height);
set("name","Waveguide1");
set("material","TFLN");
Â
##Setting Up Waveguide Middle
vtx=[0,0;0,wg_height+slab_height;wg_taper_length,wg_height+slab_height-etch;wg_taper_length,0];
addpoly;
set("vertices",vtx);
set("z",0);
set("z span",wg_width);
set("x",0);
set("y",0);
 set("first axis","x");
 set("rotation 1",90);
 set("name","Taper");
 set("material","TFLN");
Â
##Setting Wg2
addrect;
set("x min",wg_taper_length);
set("x max",wg_taper_length+3e-6);
set("y",0);
set("y span",wg_width);
set("z min",0);
set("z max",wg_height+slab_height-etch);
set("name","Waveguide2");
set("material","TFLN");
Â
Â
Â
addmesh;
set("based on a structure",1);
set("structure","Taper");
set("buffer",0.1e-6);
set("dy",100e-9);
set("dz",1e-9);
Â
addmesh;
set("based on a structure",1);
set("structure","Waveguide2");
set("buffer",0.1e-6);
set("dy",100e-9);
set("dz",1e-9);
Â
addmesh;
set("based on a structure",1);
set("structure","Waveguide1");
set("buffer",0.1e-6);
set("dy",100e-9);
set("dz",1e-9);
Â
Â
Â
yspan=6e-6;
zspan=6e-6;
Â
addeme;
set("index",1.4440);
set("x min",-1e-6);
set("y min",-yspan);
set("y max",yspan);
set("z max",zspan);
set("z min",-zspan);
set("y min bc","metal");
set("y max bc","metal");
set("z min bc","metal");
set("z max bc","metal");
set("number of cell groups",3);
set("group spans",[1e-6;wg_taper_length;1e-6]);
set("cells",[1;50;1]);
set("subcell method",[0; 1; 0]);
set("energy conservation",1);
set("number of modes for all cell groups",60);
#set("allow custom eigensolver settings",1);
#set("modes",[20;60]);
set("wavelength",1.55e-6);
set("display cells",1);
#set("mesh cells y",60);
#set("mesh cells z",60);
#set("min mesh step",0.5e-9);
Â
Â
### Setting up Port 1 ###
select("EME::Ports::port_1");
set("use full simulation span",1);
set("mode selection","fundamental TE mode");
Â
Â
#### Setting up Port 2 ###
select("EME::Ports::port_2");
set("use full simulation span",1);
set("mode selection","fundamental TE mode");