Wave Port#
Class representing a single wave port |
The WavePort represents a modal source port for RF and microwave simulations. The port mode is first calculated in the 2D mode solver with automatic characteristic impedance calculation, then injected into the 3D simulation. The WavePort is also automatically terminated with a modal absorbing boundary ModeABCBoundary that perfectly absorbs the outgoing mode. Any non-matching modes are subject to PEC reflection.
Basic Usage
my_wave_port_1 = WavePort(
center=(0,0,0),
size=(port_width, port_height, 0),
name='My Wave Port 1',
direction='+', # direction of signal
mode_spec=MicrowaveModeSpec(
num_modes=1,
target_neff=1.5,
impedance_specs=AutoImpedanceSpec() # automatic impedance calculation
),
)
Key parameters:
mode_specusesMicrowaveModeSpecto specify mode solver settings and impedance calculationimpedance_specswithinMicrowaveModeSpecdefines how voltage, current, and characteristic impedance are computed. UseAutoImpedanceSpecfor automatic calculation (recommended) orCustomImpedanceSpecfor manual control.
Multimode WavePort Support
WavePorts can support multiple modes simultaneously. This is useful for multimode waveguides and transmission lines.
# Create a WavePort that solves for 3 modes
multimode_port = WavePort(
center=(0, 0, 0),
size=(4, 4, 0),
direction='+',
mode_spec=MicrowaveModeSpec(
num_modes=3, # solve for 3 modes
impedance_specs=AutoImpedanceSpec() # applied to all modes
),
name='multimode_port'
)
When creating sources from a multimode port, specify which mode to excite:
source_time = GaussianPulse(freq0=10e9, fwidth=1e9)
# Create sources for different modes
source_mode0 = multimode_port.to_source(source_time, mode_index=0)
source_mode1 = multimode_port.to_source(source_time, mode_index=1)
source_mode2 = multimode_port.to_source(source_time, mode_index=2)
You can also specify different impedance calculations for each mode:
mode_spec = MicrowaveModeSpec(
num_modes=2,
impedance_specs=(
CustomImpedanceSpec(...), # custom for mode 0
AutoImpedanceSpec(), # auto for mode 1
)
)
Mode Solver
If you need to solve for the 2D port mode without running a full 3D simulation, use the to_mode_solver() convenience method:
import tidy3d.web as web
# Define a mode solver from the wave port
my_mode_solver = my_wave_port_1.to_mode_solver(
simulation=base_sim, # base Simulation object
freqs=my_frequencies, # frequencies for 2D mode solver
)
# Execute mode solver
my_mode_data = web.run(my_mode_solver, task_name='mode solver')
The resulting my_mode_data will be MicrowaveModeSolverData containing mode fields and transmission line parameters (characteristic impedance, voltage/current coefficients).
Accessing Transmission Line Data
After running a simulation with WavePort, you can access the transmission line characteristics from the mode data:
# Get mode data from TerminalComponentModeler results
mode_data = tcm_data.data['port1']['mode_monitor']
# Access characteristic impedance for each mode
Z0_mode0 = mode_data.transmission_line_data.Z0.sel(mode_index=0)
# Get voltage and current coefficients
voltage_coeff = mode_data.transmission_line_data.voltage_coeffs.sel(mode_index=0)
current_coeff = mode_data.transmission_line_data.current_coeffs.sel(mode_index=0)
Alternatively, use the portβs get_port_impedance() method:
# Get impedance directly from port
Z0 = my_wave_port_1.get_port_impedance(mode_data, mode_index=0)
See also
Related Documentation:
RF Mode Analysis - MicrowaveModeSpec and transmission line mode analysis
v2.10 RF Refactor Migration Guide - Migration guide for API changes
Tutorials and Examples: