Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions gplugins/tidy3d/get_simulation_grating_coupler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from gdsfactory.technology import DerivedLayer, LayerStack, LogicalLayer
from gdsfactory.typings import CrossSectionSpec, LayerSpecs

from gplugins.common.base_models.component import move_polar_rad_copy
from gplugins.tidy3d.materials import get_medium


Expand Down Expand Up @@ -427,11 +426,7 @@ def get_simulation_grating_coupler(
+ box_thickness
)
waveguide_port_size = [size_x, size_y, size_z]

xy_shifted = move_polar_rad_copy(
np.array(port.dcenter), angle=np.deg2rad(angle), length=port_waveguide_offset
)
waveguide_port_center = [xy_shifted[0], xy_shifted[1], (size_z) / 2]
waveguide_port_center = [-sim_size[0] / 2 + port_waveguide_offset, 0, 0]

waveguide_monitor = td.ModeMonitor(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main issue I found while testing this was that the mode monitor z span was too large. The mode monitor was extending into the si substrate, which caused the monitor to overlap for slab modes instead of waveguide modes. I would recommend setting the default values (eg zmargin=0) so that the monitor doesn't extend into the substrate.

center=waveguide_port_center,
Expand Down Expand Up @@ -466,7 +461,7 @@ def get_simulation_grating_coupler(

# Define Gaussian beam source
gaussian_beam = td.GaussianBeam(
size=(td.inf, td.inf, 0),
size=(fiber_mfd, td.inf, 0),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The source size is a bit small, I would recommend using at least 2x fiber_mfd, 3x would be even better.

center=[fiber_port_x, 0, fiber_z],
source_time=td.GaussianPulse(freq0=freq0, fwidth=fwidth),
angle_theta=np.deg2rad(-fiber_angle_deg),
Expand Down
Loading