halbux / sparselizard

C++ FEM library | user-friendly | multi-physics | hp-adaptive | HPC
http://www.sparselizard.org
Other
343 stars 65 forks source link

Implementing microwave ports #77

Open Gerharddc opened 1 week ago

Gerharddc commented 1 week ago

Hi, I am struggling to figure out how I can implement ports within Sparselizard that would allow for microwave simulations such as measuring S-parameters. Here I am talking about ports such as the ones described in https://innovationspace.ansys.com/courses/wp-content/uploads/sites/5/2021/07/HFSS_GS_2020R2_EN_LE6_Port_Basics.pdf and https://www.comsol.com/blogs/ports-and-lumped-ports-for-wave-electromagnetics-problems.

I think the "lumped port" should be easiest to start with as it just requires forcing a uniform electric field on a face. The halfwave-dipole-antenna-2d shows how a uniform electric field boundary condition can be applied to a face. This should be sufficient to create an incident wave, but I don't think such a simple condition would allow for a reflected wave to also exist at the face. That really is what I'm struggling with, how to create an fixed incident wave while also allowing an unknown reflected wave.

Another relevant example appears to be waveguide-3d which would allow for something similar to a "wave port" to be implemented. However, I believe it still has the same problem with disallowing reflected waves.

Any ideas or suggestions would be greatly appreciated, thanks!

P.S. any explanation as to why the halfwave-dipole-antenna-2d example uses the "harmonics" feature at a single single harmonic frequency while the waveguide-3d instead just uses the frequency domain wave formulation. I would have assumed these are equivalent?

halbux commented 6 days ago

Hi Gerhard,

You are absolutely right, nothing reflected is absorbed or can be measured.

We have strongly extended sparselizard as a commercial product (Quanscient Allsolve) where we have added lumped ports (including RLC component connections) as well as waveports. Waveports and their S-parameters can be readily implemented in sparselizard as is (no source code change needed), but you'll need to go (alone) through the math. In certain cases lumped ports can also be readily implemented but in the generic case there is a feature missing in sparselizard as is.

Quanscient (and me) maintain sparselizard (bug fixes for example) but I have very little time unfortunately to develop new features open source right now.

We do however have the browser GUI product based on extended sparselizard for sale, and there is a python interface there which is pretty much 100% sparselizard-python compatible.

Are you doing these simulations more on the as-hobby side or as part of your work? If it is in the latter case we do provide very discounted academic deals or regular commercial deals.

Sorry for that. I wish I would have time to dedicate to help you out in this nice RF sims (I personally love those very much!) but there is only 24 hours a day unfortunately!

halbux commented 6 days ago

To answer your last question: there is no particular reason for the difference, but over time I started writing things more and more in their time-dependent form, as this is more readily copy-pastable for both frequency as well as transient and eigenmode analysis. So the time form with dt() etc is more generic, without any performance downside.