Ansys Learning Forum Forums Discuss Simulation Photonics EME Mode Sweep Not Converging Reply To: EME Mode Sweep Not Converging

Sept
Subscriber

Hi Amrita,

that is correct, in the simulation the waveguides are lossless. If it helps at all I will attach my code along with a screenshot of my sweep (also for debuggin purposes I have seen that turning off csvs and energy conservation helped some of my paramaters conerge.

 

Code: 

 

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",50e-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",2);
set("group spans",[1e-6;wg_taper_length]);
set("cells",[1;50]);
set("subcell method",[0; 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");

 

Â