Amrita Pati
Ansys Employee

Hi Zbynka,

Thank you for sharing your code. The base angle should be assigned in degrees. Something else that I saw in your code is that you have used ht=base_width/(2*tan(alpha)); I believe it should be ht = base_width*tan(alpha)/2; I made these two changes in the code and I can see the triangular cross-section as shown below:

The modified code is:

clear;

deleteall;

 

lambda=1.23e-9;

 

addwaveguide;

set("name","wg_top_left");

addwaveguide;

set("name","bend_top_left");

addwaveguide;

set("name","couple_top");

addwaveguide;

set("name","bend_top_right");

addwaveguide;

set("name","wg_top_right");

addwaveguide;

set("name","wg_bottom_left");

addwaveguide;

set("name","bend_bottom_left");

addwaveguide;

set("name","couple_bottom");

addwaveguide;

set("name","bend_bottom_right");

addwaveguide;

set("name","wg_bottom_right");

 

base_width = 800e-9; #width of the waveguide

alpha_deg = 60;

alpha=(alpha_deg*pi)/180;

ht=base_width*tan(alpha)/2;

 

y_span = 10e-6; #distance between u shape, output ports

 

Lw = 20e-6; #fixed

Ls = 20e-6; #fixed

Lc = 20e-6; #change/vary this parameter

gap = 100e-9; #nm

 

selectall;

set ("detail",0.5);

set ("index", 2.6);

set("base width",base_width);

set("base height",ht);

#set("base angle",2*alpha);

set("base angle",alpha_deg);

 

setnamed("wg_top_left","poles",[0,y_span/2; Lw, y_span/2]);

setnamed("bend_top_left","poles",[Lw,y_span/2; Lw+Ls/2, y_span/2; Lw+Ls/2, (gap+base_width)/2; Lw+Ls, (gap+base_width)/2]);

setnamed("couple_top","poles",[Lw+Ls, (gap+base_width)/2; Lw+Ls+Lc, (gap+base_width)/2]);

setnamed("bend_top_right","poles",[Lw+Ls+Lc,(gap+base_width)/2;Lw+3*Ls/2+Lc, (gap+base_width)/2;Lw+3*Ls/2+Lc,y_span/2;Lw+2*Ls+Lc,y_span/2]);

setnamed("wg_top_right", "poles",[Lw+2*Ls+Lc, y_span/2; 2*Lw+2*Ls+Lc, y_span/2]);

 

setnamed("wg_bottom_left","poles",[0,-y_span/2; Lw,-y_span/2]);

setnamed("bend_bottom_left", "poles",[Lw, -y_span/2; Lw+Ls/2,-y_span/2;Lw+Ls/2,- (gap+base_width)/2; Lw+Ls, - (gap+base_width)/2]);

setnamed("couple_bottom","poles", [Lw+Ls, -(gap+base_width)/2; Lw+Ls+Lc,-(gap+base_width)/2]);

setnamed("bend_bottom_right","poles",[Lw+Ls+Lc, - (gap+base_width)/2;Lw+3*Ls/2+Lc,- (gap+base_width)/2;Lw+3*Ls/2+Lc,-y_span/2;Lw+2*Ls+Lc,-y_span/2]);

setnamed("wg_bottom_right", "poles",[Lw+2*Ls+Lc,-y_span/2; 2*Lw+2*Ls+Lc, -y_span/2]);

Please let me know if you have any further questions. Thank you.

Regards,
Amrita