-
Notifications
You must be signed in to change notification settings - Fork 3
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
Mesh suitable to model skin depth in metals #91
Comments
Yes a threshold field applied to the surfaces should do. I have done that exact thing before. I don't have access to a computer to make an example right now, can you share your full code? I can maybe take a look EDIT: looking at the picture you attached this could simply be a matter of choosing different dist max, size min, and size max |
Thanks for the quick reply! Here the code: import shapely
import gdsfactory as gf
from meshwell.model import Model
from meshwell.prism import Prism
from meshwell.resolution import ThresholdField, ConstantInField
polygon_hull = shapely.Polygon(
[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]],
)
polygon = polygon_hull
buffers = {0.0: 0.0, 3.0: 0.0}
model = Model()
poly3D = Prism(
polygons=polygon,
buffers=buffers,
model=model,
physical_name="my_prism1",
resolutions=[
ThresholdField(sizemin=0.1, distmax=3, sizemax=2.0, apply_to="surfaces"),
],
)
entities_list = [poly3D]
mesh = model.mesh(
entities_list=entities_list,
filename="prism.msh",
) The prism is supposed to represent a short piece of a metal track (just for experimenting) and I'd like to have fine meshes on all surfaces. |
Ok I was able to take a look. I can get the behaviour you want like so:
You can also achieve similar with the exponential field: Couple things: 1 - Playing with the Prism dimensions and the resolutions can make this more apparent (in your original example, sizemax and distmax were both 2-3 and the box was around 3 units large so there is not a lot of room to taper) 2 - There is a legitimate issue I have never encountered before because I never set resolutions on surfaces at the "edge" of my simulations (I always let the default mesh there, since I never expect boundaries to affect the physics I am solving for). As you can see, it can be hacked by embedding the Prism inside another, larger Prism with lower mesh order that we don't mesh. This turns the surfaces to entity-entity interfaces instead of entity-"None" interfaces which are handled differently. I will make a new issue with a note to this specific bug for better handling of boundaries. |
Thank you very much for the example and your explanations! In my example I had a single prism just to get familiar with the library, but let me give a couple of examples of what I'd like to mesh and simulate, so that, if you want, you may take these scenarios into account in future developments
Thanks again! |
This is great to consider, thank you! Beyond fixing the boundaries, I feel that modeling skin effect as you are describing might require a different mesh on the metal side vs dielectric side -- am I correct? It should be doable to add an "inside/outside" attribute or to modify the "sharing" attribute to allow a ResolutionSpec to be selectively applied inside vs outside a metal. This could allow different tapering of the resolution inside vs outside the metal. Should I make a new feature issue with this to take a look sometime soon? |
That would be great! The fields variation outside of the metal is definitely different from the one inside. |
should be fixed now on main, will make a new release soon! |
I'm trying to use meshwell to model passive mmW IC components. It's common to use thick metals (ca. 3um) at frequencies where the skin depth is a fraction of a um (0.2um -- 0.5um). For this reason I'm trying to have smaller elements close to the surfaces of a prism and larger ones in the bulk of the metal. I've tried using the new
ThresholdField
applied to surfaces, but they only apply to the polygon surface before extrusion.Is this possible? If yes, do you have an example?
The text was updated successfully, but these errors were encountered: