## Surface with a function(x,y)

How to use openEMS. Discussion on examples, tutorials etc

Moderator: thorsten

pedro
Posts: 7
Joined: Tue 15 Mar 2016, 15:42

### Surface with a function(x,y)

Hi Thorsten,

First, thank you for sharing and releasing this great software under GPL3.

I want to model surface plasmons on metallic films.
I have searched and wanted to ask you if it is possible to add a geometry that is a 2D function such as h(x,y) = sin[(2π/Λ)x] + sin[(2π/Λ)y] (defining a surface corrugation profile).
From this then I could construct a 3D film defined as the volume between two surfaces like h(x,y), given a thickness.

I believe it is not possible right now. But what would be the best way to add this feature? Or, faster, how to build it using the current primitives and transforms?

Thank you,

Pedro

thorsten
Posts: 1412
Joined: Mon 27 Jun 2011, 12:26

### Re: Surface with a function(x,y)

Hi,

wouldn't a polygon (LinPoly) do the trick? Just use enough edge sample points?

regards
Thorsten

lolicon945
Posts: 21
Joined: Sat 18 May 2013, 08:13

### Re: Surface with a function(x,y)

thorsten wrote:Hi,

wouldn't a polygon (LinPoly) do the trick? Just use enough edge sample points?

regards
Thorsten
I was struggling with the AddPolyhedron() to build a hexagonal prism (with 24 triangle faces ), and definitely the AddLinPoly() is better.
However, I still have a question on AddPolyhedron(): what is the standard of the order of the vertices in a face?

regards
lolicon

thorsten
Posts: 1412
Joined: Mon 27 Jun 2011, 12:26

### Re: Surface with a function(x,y)

Some information about the polyhedrons can be found here: http://openems.de/index.php/Polyhedron

Please add any missing information or let me know of anything is unclear.

regards
Thorsten

pedro
Posts: 7
Joined: Tue 15 Mar 2016, 15:42

### Re: Surface with a function(x,y)

thorsten wrote:Hi,

wouldn't a polygon (LinPoly) do the trick? Just use enough edge sample points?

regards
Thorsten

Looking at the AddLinPloy wikipage I see what you mean. But generating a sine corrugated surface would be too inefficient and would be hard to modulate it through some parameters as it would through a continuous function. Could this continuous function be implemented in openEMS code? If so, could you point me out where could I start looking at? Or maybe there is a way to put octave generate sufficient polyheadron or linpoly points for sufficiently describe the sine corrugated surface that I need. I should look better at the later.

Anyway I proceeded with importSTL. I generated the STL on SolidWorks where you can modulate any parameters.

If I find a better way to illustrate what I want I will post here and if agreed I will post on the wiki.

Thank you.

thorsten
Posts: 1412
Joined: Mon 27 Jun 2011, 12:26

### Re: Surface with a function(x,y)

There might be one other type of primitive, that is described by a formula.
E.g. "r<10" would be a sphere with radius 10. But I think there is no Matlab/Octave interface for this primitive (yet).

As far as I see it, the best way is to use FreeCad or SolidWorks to model STL objects as you did.

Maybe you can attach a picture of your antenna?

regards
Thorsten

pedro
Posts: 7
Joined: Tue 15 Mar 2016, 15:42

### Re: Surface with a function(x,y)

Hi,

Attached is the continuous metal layer I am interested. I am trying to simulate surface plasmons.

Regards,
Pedro
Attachments
Metal grating
SineGrating.png (72.91 KiB) Viewed 10152 times

thorsten
Posts: 1412
Joined: Mon 27 Jun 2011, 12:26

### Re: Surface with a function(x,y)

Hi,

sounds like a challenge.
I would recommend to start doing only a 2D simulation first? According to your picture doing only yz-plane?
Modelling this metal layer I would define a linear extruded polygone (AddLinPoly). Flat on the bottom and the sinusoidal shape on the top.

But this is going to be not so easy. Excitation, meshing and so on will be a challenge.
You could experience instability too, if you do, reduce the time step manually.

Edit: Have a look at this paper (page 11) maybe

regards
Thorsten