Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support coaxial lumped ports #1669

Merged
merged 1 commit into from May 24, 2024
Merged

Conversation

dmarek-flex
Copy link
Contributor

@dmarek-flex dmarek-flex commented May 2, 2024

Related to issue 523.

Adding support for coaxial ports. This requires adding support for lumped elements with coaxial geometry as well. The basic idea is the same as for the original rectangular lumped port except now:

  • Current source is radially symmetric and implemented as a CustomCurrentSource
  • Path integral for current computation has to use the core conductor of the port, rather than the lumped resistor itself. This means the port definition requires a direction parameter, which tells the port on which side of the port plane to compute the path integral for current.
  • The geometry related to the port is an annulus instead of a rectangle

@dmarek-flex dmarek-flex changed the title coaxial lumped ports support coaxial lumped ports May 2, 2024
@dmarek-flex dmarek-flex self-assigned this May 2, 2024
@dmarek-flex dmarek-flex force-pushed the dmarek/coaxial_lumped_ports branch 6 times, most recently from 15499d6 to c9fb8b0 Compare May 7, 2024 20:01
@dmarek-flex
Copy link
Contributor Author

Ok this PR is ready for review now! A couple of things that I was not confident about:

  • I had to use this "noqa" commands to get rid of ruff errors in test_medium.py
  • Also in docstrings I had to use the format ":class:.Simulation" to get the proper linking in the docs, but I think it is usually suggested to use double back ticks. I don't know if this matters at all.

Copy link
Collaborator

@tylerflex tylerflex left a comment

Choose a reason for hiding this comment

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

Thanks for this massive contribution @dmarek-flex

I had a lot of small comments, but I wasn't able to fully go through everything in total detail.

As you can probably gather, I'm a fan of trying to use the more declarative helpers (eg pop_axis) whenever possible. There's a lot of necessary lower-level data manipulation in these new features. Whenever possible, I think it helps a lot to try to separate this from the higher level, more declarative stuff. For example, try to hide the procedural code into methods (like pop axis) so it can be reused as much as possible.

I gave some suggestions where I saw things, but there were many places where the same operations pop up.

As the RF /microwave codebase grows in complexity, eventually you'll probably hit a point where you'll want as much of this abstracted away as possible, so I'd just consider that moving forward.

Anyway, thanks a lot for the great work! I'm going to add @QimingFlex as a reviewer too to get another pair of eyes on it, specifically the physics part. and so he gets some review experience

tidy3d/components/geometry/base.py Outdated Show resolved Hide resolved
tidy3d/components/geometry/utils_2d.py Outdated Show resolved Hide resolved
tests/test_components/test_medium.py Outdated Show resolved Hide resolved
tidy3d/components/lumped_element.py Outdated Show resolved Hide resolved
tidy3d/components/lumped_element.py Show resolved Hide resolved
tidy3d/plugins/smatrix/ports/coaxial_lumped.py Outdated Show resolved Hide resolved
tidy3d/plugins/smatrix/ports/coaxial_lumped.py Outdated Show resolved Hide resolved
tidy3d/plugins/smatrix/ports/coaxial_lumped.py Outdated Show resolved Hide resolved
tidy3d/plugins/smatrix/ports/rectangular_lumped.py Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@dmarek-flex dmarek-flex force-pushed the dmarek/coaxial_lumped_ports branch 2 times, most recently from a51275b to a385e15 Compare May 9, 2024 20:24
Copy link
Collaborator

@weiliangjin2021 weiliangjin2021 left a comment

Choose a reason for hiding this comment

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

This is tons of work! First pass except for custom path integral part. All look solid and easy to follow. One question when you compute the current by using a loop in the middle of the two conductors: I assume the current computation will depend on the loop size if the dielectric material between the two conductors is lossy. How is lossy dielectric usually handled in lumped port?

tidy3d/plugins/smatrix/ports/coaxial_lumped.py Outdated Show resolved Hide resolved
tidy3d/plugins/smatrix/ports/coaxial_lumped.py Outdated Show resolved Hide resolved
tidy3d/plugins/smatrix/ports/coaxial_lumped.py Outdated Show resolved Hide resolved
@dmarek-flex
Copy link
Contributor Author

This is tons of work! First pass except for custom path integral part. All look solid and easy to follow. One question when you compute the current by using a loop in the middle of the two conductors: I assume the current computation will depend on the loop size if the dielectric material between the two conductors is lossy. How is lossy dielectric usually handled in lumped port?

At the end of the day the computation for current is an approximation. It should be more accurate at low frequencies, when fields are closer to TEM, when path is close to the surfaces of conductors. As long as the lossy material does not impact the field distribution a lot, the computation should still be accurate.

We could allow for an optional parameter for the user to place the contour where ever they want. The reason I chose the midpoint is that usually there are only a handful of grid cells in the port and I want to make sure that the path is far enough away from the conductors, so that staircasing and conformal mesh affects to the fields are avoided.

Copy link
Collaborator

@weiliangjin2021 weiliangjin2021 left a comment

Choose a reason for hiding this comment

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

A few minor comments. Otherwise looks good.

tidy3d/plugins/microwave/custom_path_integrals.py Outdated Show resolved Hide resolved
tidy3d/plugins/microwave/custom_path_integrals.py Outdated Show resolved Hide resolved
@tylerflex tylerflex self-requested a review May 24, 2024 16:29
Copy link
Collaborator

@tylerflex tylerflex left a comment

Choose a reason for hiding this comment

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

@dmarek-flex looks good to me, barring a few changes to get the tests working, I think this should be basically good to go?

@dmarek-flex
Copy link
Contributor Author

@dmarek-flex looks good to me, barring a few changes to get the tests working, I think this should be basically good to go?

Yep, think I just need to rebase and the tests will pass again.

@tylerflex
Copy link
Collaborator

looks like it just needs submodule update?

@dmarek-flex
Copy link
Contributor Author

dmarek-flex commented May 24, 2024

looks like it just needs submodule update?

Yea, but I am also trying to diagnose a regression on the backend tests that I just noticed before merging.

Ok fixed, it was something that I was testing that somehow snuck into the commits

extending impedance calculator for custom paths and fixing one bug

modified convention for vertices in custom path integral
@dmarek-flex dmarek-flex merged commit b54df57 into pre/2.7 May 24, 2024
16 checks passed
@dmarek-flex dmarek-flex deleted the dmarek/coaxial_lumped_ports branch May 24, 2024 19:08
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.

None yet

4 participants