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

Mode solver improvement for simulations at low-frequency containing metals #2023

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

weiliangjin2021
Copy link
Collaborator

@weiliangjin2021 weiliangjin2021 commented Oct 18, 2024

Two main improvements:

  • For the eigenvalue problem with the matrix PQ where P = p_mu + p_partial and Q = q_ep + q_partial, where p_mu denotes the matrix containing mu_parallel, and q_ep for epsilon_parallel, and the partial term for the remaining matrix components that contains Grad*ep(mu)^-1*Grad. One observation is that if you write out the block form, one can find that p_partial @ q_partial=0. Since Grad scales 1/(k0* dl), in low-frequency/high-resolution regime, Grad can be huge, not mention that p(q)_partial scales as Grad**2. So even though p_partial @ q_partial is strictly 0, machine error can generate nonzero terms that completely ruin the eigenvalues of matrix PQ. This is responsible for the oscillating phenomenon of effective n as a function of frequency in the low-frequency regime.

    In this PR, we don't compute PQ with the fully assembled matrix P and Q, but PQ = p_mu @ Q + p_partial @ q_ep so that p_partial @ q_partial is for sure dropped.

  • Let's take matrix P as an illustration (the same applies to Q), p_partial scales as 1/(k0* dl)**2. So in low-frequency/high-resolution regime, p_partial term might grow so huge that p_mu term becomes negligible. But for PEC, its permittivity value should still be significant. So our default permittivity value for PEC should be scaled by the factor 1/(k0* dl)**2.

(Tests to be added in the solver part in a separate PR.)

@tylerflex tylerflex removed their request for review October 18, 2024 18:23
@weiliangjin2021
Copy link
Collaborator Author

weiliangjin2021 commented Oct 18, 2024

Here is a benchmark example from @dmarek-flex regarding a micostrip made of PEC. Its effective k should be 0, and effective n approaches a constant around 1.82 as frequency goes to 0. double precision is used.

  • Before this PR: significant oscillation in low-frequency region and effective k is huge.
    image

  • Just scaling pec_val, equally bad.
    image

  • Just dropping p_partial @ q_partial, the curve becomes smooth, but incorrect
    image

  • With both:
    image

@weiliangjin2021
Copy link
Collaborator Author

@prashkh welcome to test if you have other tests in mind

Copy link
Contributor

@dmarek-flex dmarek-flex left a comment

Choose a reason for hiding this comment

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

Results speak for themselves. Thanks @weiliangjin2021, I tried it out on my own example as well and it worked well down to 1 MHz, which is plenty low enough.

First time I get to remind someone to update the Changelog though!

@weiliangjin2021
Copy link
Collaborator Author

Results speak for themselves. Thanks @weiliangjin2021, I tried it out on my own example as well and it worked well down to 1 MHz, which is plenty low enough.

Well, soon enough we might need to handle <1MHz. But that will probably need a very different formulation.

First time I get to remind someone to update the Changelog though!

Thanks for the reminder. I plan to add it after 1st round of review so that I'm confident enough to say that it works well in low-frequency.

@weiliangjin2021
Copy link
Collaborator Author

@dmarek-flex CHANGELOG added.

@weiliangjin2021 weiliangjin2021 merged commit 4407df4 into pre/2.8 Oct 23, 2024
15 checks passed
@weiliangjin2021 weiliangjin2021 deleted the weiliang/low_freq branch October 23, 2024 17:04
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.

3 participants