Boundary Conditions#

Overview#

Boundary conditions specify the constraints on the field solution along the external boundaries of the simulation domain. In order to achieve good agreement with the physical problem, it is important that the user specifies the appropriate boundary type for their application.

The Boundary Specification section discusses how to set up simulation boundaries in a Tidy3D simulation.

The sections below discuss the respective types of supported boundary conditions:

  • PEC/PMC: Simulates a perfect electric or magnetic conductor

  • Periodic: Simulates periodic boundary conditions in 1, 2, or 3-dimensions

  • Absorbing: Simulates an open boundary for outgoing radiation


Boundary Specification#

tidy3d.BoundarySpec

Specifies boundary conditions on each side of the domain and along each dimension.

tidy3d.Boundary

Boundary conditions at the minus and plus extents along a dimension.

The BoundarySpec object contains information on the boundary conditions on all six sides of the simulation domain. The Boundary object specifies the boundary conditions along a single axis, i.e. x, y, or z. Typically, the Simulation object contains a BoundarySpec instance, which in turn contains three Boundary instances.

There are several ways to specify boundaries with BoundarySpec. To quickly specify a single boundary type for all six sides, use the BoundarySpec.all_sides() method.

my_boundary_spec = BoundarySpec.all_sides(boundary=PML())

To specify boundaries along each of the three axes:

my_boundary_spec = BoundarySpec(
    x = Boundary.periodic(),
    y = Boundary.pec(),
    z = Boundary.pml(),
)

In the above example, built-in convenience methods such as pec(), pml(), and periodic() in the Boundary object were used to specify boundaries for both sides of each axis.

Finally, for full control of each of the six sides:

my_boundary_spec = BoundarySpec(
    x = Boundary(plus=PECBoundary(), minus=PMCBoundary()),
    y = Boundary(plus=Periodic(), minus=Periodic()),
    z = Boundary(plus=PML(), minus=PECBoundary()),
)

In the above example, individual boundary instances were created and passed into the plus and minus attributes of each Boundary instance.

See also

For more details and examples, please see the following article:


PEC/PMC#

tidy3d.PECBoundary

Perfect electric conductor boundary condition class.

tidy3d.PMCBoundary

Perfect magnetic conductor boundary condition class.

tidy3d.Boundary.pec()

PEC boundary specification on both sides along a dimension.

tidy3d.Boundary.pmc()

PMC boundary specification on both sides along a dimension.

These boundary conditions simulate a perfect electric or magnetic conductor by placing constraints on the normal and tangential components of the electric/magnetic fields.

\[\begin{split}\mathbf{E} \times \mathbf{n} &= 0 \quad \text{(PEC)},\\ \mathbf{H} \times \mathbf{n} &= 0 \quad \text{(PMC)}.\end{split}\]

where \(\mathbf{n}\) is the boundary normal vector.

Note

To simulate a PEC structure, use the PECMedium class instead. Please refer to the EM Mediums page for details.


Periodic#

tidy3d.Periodic

Periodic boundary condition class.

tidy3d.BlochBoundary

Specifies a Bloch boundary condition along a single dimension.

tidy3d.Boundary.periodic()

Periodic boundary specification on both sides along a dimension.

tidy3d.Boundary.bloch(bloch_vec)

Bloch boundary specification on both sides along a dimension.

tidy3d.Boundary.bloch_from_source(source, ...)

Bloch boundary specification on both sides along a dimension based on a given source.

Periodic boundary conditions are commonly used in unit cell simulations. The Periodic boundary type enforces field continuity, i.e.

\[\mathbf{E}(\mathbf{r}_a) = \mathbf{E}(\mathbf{r}_b)\]

where \(\mathbf{r}_a\) and \(\mathbf{r}_b\) are matching positions on the respective pair of periodic boundaries. This is commonly used in conjunction with a normal incidence plane wave excitation.

The BlochBoundary boundary type implements Bloch periodicity, i.e.

\[\mathbf{E}(\mathbf{r}_a) = e^{i \mathbf{k}_b \cdot (\mathbf{r}_a - \mathbf{r}_b)} \mathbf{E}(\mathbf{r}_b)\]

where \(\mathbf{k}_b\) is the Bloch periodicity vector. This is typically used together with an off-normal incidence plane wave excitation, where the Bloch vector corresponds to the lateral phase difference due to the off-normal plane wave. For user convenience, the Boundary.bloch_from_source() method automatically creates a BlochBoundary object from a given excitation.

See also

For more details and examples, please see the following notebooks:


Absorbing#

tidy3d.PML

Specifies a standard PML along a single dimension.

tidy3d.PMLParams

Specifies full set of parameters needed for complex, frequency-shifted PML.

tidy3d.Boundary.pml([num_layers, parameters])

PML boundary specification on both sides along a dimension.

tidy3d.StablePML

Specifies a 'stable' PML along a single dimension.

tidy3d.Boundary.stable_pml([num_layers, ...])

Stable PML boundary specification on both sides along a dimension.

tidy3d.Absorber

Specifies an adiabatic absorber along a single dimension.

tidy3d.AbsorberParams

Specifies parameters common to Absorbers and PMLs.

tidy3d.Boundary.absorber([num_layers, ...])

Adiabatic absorber boundary specification on both sides along a dimension.

tidy3d.InternalAbsorber

Internally placed plane with one-way wave equation boundary conditions for absorption of electromagnetic waves.

tidy3d.ABCBoundary

One-way wave equation absorbing boundary conditions.

tidy3d.ModeABCBoundary

One-way wave equation absorbing boundary conditions for absorbing a waveguide mode.

tidy3d.BroadbandModeABCSpec

Specifies the broadband mode absorption boundary conditions.

tidy3d.BroadbandModeABCFitterParam

Parameters for fitting the mode propagation index over the frequency range using pole-residue pair model.

For simulations with radiative modes, it is recommended to surround the simulation domain with absorbing boundary conditions, i.e. either the Perfectly Matched Layer PML type, or the Absorber type.

The PML boundary type uses coordinate stretching to rapidly attenuate any outgoing radiation, and is the default boundary condition for all simulations in Tidy3D.

The Absorber boundary type uses a fictitious lossy medium with ramped conductivity to attenuate outgoing waves. In comparison to the PML, there can be greater reflection at the boundary. The Absorber boundary is more numerically stable when structures with dispersive mediums extend into the boundary.

See also

For more details and examples, please see the following article:

For a general introduction to PMLs, please see the following FDTD101 resource: