Skip to content

Wave port#53

Merged
vvahidd merged 22 commits intogdsfactory:mainfrom
EpsilonForge:wave_port
Apr 16, 2026
Merged

Wave port#53
vvahidd merged 22 commits intogdsfactory:mainfrom
EpsilonForge:wave_port

Conversation

@dot-cross
Copy link
Copy Markdown
Contributor

Added support for waveports. Modified palace_demo_cpw notebook to simulate and plot both lumped and waveports.

@dot-cross
Copy link
Copy Markdown
Contributor Author

output

@vvahidd
Copy link
Copy Markdown
Contributor

vvahidd commented Mar 18, 2026

@dot-cross why do you think S21 for waveport is 4dB more lossy? this simple cpw line should be very close to no loss. can you look at what mode is being excite in the waveport? maybe it's the wrong mode

@dot-cross
Copy link
Copy Markdown
Contributor Author

@dot-cross why do you think S21 for waveport is 4dB more lossy? this simple cpw line should be very close to no loss. can you look at what mode is being excite in the waveport? maybe it's the wrong mode

Not sure why is 4dB more lossy. The mode is set to one, which by Palace documentation correspond to the biggest wave number.

@dot-cross
Copy link
Copy Markdown
Contributor Author

mode2 This is for mode 2 @vvahidd

@mdmaas
Copy link
Copy Markdown
Contributor

mdmaas commented Mar 18, 2026

Maybe the waveport region should be made larger? I mean, perhaps the 2D eigenvalue solver is converging to the correct numerical solution, but the domain where the problem is defined (which is a truncation of the real unbounded domain) is too small. Maybe even the airbox is not large enough. For example, I know that in antenna problems we need an air region that is at least $\lambda/2$ large.

@mdmaas
Copy link
Copy Markdown
Contributor

mdmaas commented Mar 18, 2026

We could also add the visualization of the mode for verification purposes.

For an example reference, here I have a CPW simulation where the airbox seems to be too small, as the eigenmode is non-zero at the top:

Screenshot from 2026-03-18 15-35-33

I think that for this PR just making the domain (and the waveport) large enough should be sufficient, but eventually we need to bring the viz server back to life :-D

@dot-cross dot-cross force-pushed the wave_port branch 2 times, most recently from 4c8f3bd to 5eb90f6 Compare March 23, 2026 23:40
@dot-cross
Copy link
Copy Markdown
Contributor Author

sparams Lumped port displaced inside the board. Margin set to zero for meshing in both cases.

@mdmaas
Copy link
Copy Markdown
Contributor

mdmaas commented Mar 31, 2026

I've been making minor changes in the waveport geometry. I added a flag to give it a "maximum size", and re run the simulations with the following settings:

  • lumped ports have an airbuffer margin of 50
  • waveports have margin=0

The results are still unsatisfactory, with the waveport S-parameters ranging from -2 to -6.

However, looking more closely at the waveport mesh I think the problem is that we do need an airbuffer zone at the sides

Screenshot from 2026-03-31 14-05-34

@mdmaas
Copy link
Copy Markdown
Contributor

mdmaas commented Mar 31, 2026

In the last commit I added the option to have an airbuffer zone only to one side of the simulation domain.

The mesh now looks like this:

Screenshot from 2026-03-31 15-22-18

and the S-parameters are a lot closer to convergence:

output

@mdmaas
Copy link
Copy Markdown
Contributor

mdmaas commented Mar 31, 2026

I refactored some visualization functions from the viz notebook to be able to use them here, in order to compare the fields we're getting from lumped vs waveports.

lumped waveport

Both plots look like there is room for improvement ;-)

I think we could check the boundary conditions on the floor, as the fields are clearly non-zero there, so maybe we are getting some sort of spurious reflections.

@mdmaas
Copy link
Copy Markdown
Contributor

mdmaas commented Apr 15, 2026

Ok, it seems this was a meshing issue.

Using graded meshes with very fine refined_mesh_size, and max_mesh_size reduces the losses to virtually zero even for the lumped port case in high frequencies.

Screenshot from 2026-04-15 08-15-15

I'll run some more tests to find a good compromise and come up with numbers.

@mdmaas
Copy link
Copy Markdown
Contributor

mdmaas commented Apr 16, 2026

I ran some more tests, and the full effect is obtained by the combination of adding air below the substrate and using a finer mesh, which is specially important in the waveport example (it requires a finer mesh). The air below the substrate also helps reduce the lumped port simulation losses.

@mdmaas
Copy link
Copy Markdown
Contributor

mdmaas commented Apr 16, 2026

I made some further improvement to graded meshing. Both simulation types now run in about ~3 minutes (local run) and show no loss throughout the frequency range.

Screenshot from 2026-04-16 01-58-48 Screenshot from 2026-04-16 01-59-02

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

❌ Patch coverage is 10.66514% with 779 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@c09f7d8). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/gsim/viz.py 1.54% 637 Missing ⚠️
src/gsim/palace/mesh/geometry.py 25.00% 39 Missing and 3 partials ⚠️
src/gsim/palace/results.py 5.00% 38 Missing ⚠️
src/gsim/palace/base.py 30.30% 18 Missing and 5 partials ⚠️
src/gsim/palace/ports/config.py 30.00% 14 Missing ⚠️
src/gsim/palace/mesh/config_generator.py 38.46% 4 Missing and 4 partials ⚠️
src/gsim/palace/mesh/generator.py 40.00% 4 Missing and 2 partials ⚠️
src/gsim/palace/models/mesh.py 76.19% 4 Missing and 1 partial ⚠️
src/gsim/palace/driven.py 33.33% 3 Missing and 1 partial ⚠️
src/gsim/common/stack/extractor.py 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #53   +/-   ##
=======================================
  Coverage        ?   46.74%           
=======================================
  Files           ?       57           
  Lines           ?     6197           
  Branches        ?     1079           
=======================================
  Hits            ?     2897           
  Misses          ?     3003           
  Partials        ?      297           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread nbs/palace_cpw_fields.ipynb
- substrate_thickness: Thickness below z=0 in um (default: 2.0)
- air_above: Air box height above top metal in um (default: 200)
- air_below: Air box height below substrate/oxide in um
(default: 0)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
(default: 0)
- air_below: Air box height below substrate/oxide in um (default: 0)

@vvahidd vvahidd merged commit 8000ebd into gdsfactory:main Apr 16, 2026
8 checks passed
@dot-cross dot-cross deleted the wave_port branch April 22, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants