HomerReid / scuff-em

A comprehensive and full-featured computational physics suite for boundary-element analysis of electromagnetic scattering, fluctuation-induced phenomena (Casimir forces and radiative heat transfer), nanophotonics, RF device engineering, electrostatics, and more. Includes a core library with C++ and python APIs as well as many command-line applications.
http://www.homerreid.com/scuff-em
GNU General Public License v2.0
126 stars 50 forks source link

How to make my surface PEC? [Mostly resolved -- see latest comment] #55

Closed sarahdh closed 9 years ago

sarahdh commented 9 years ago

Hi,

Not an issue, but a few clarifications.

I was looking through code of RGWGeometry, and I found the following:

ErrExit("%s:%i: REGIONs cannot be PEC (use an OBJECT instead)",GeoFileName,LineNum);

I'm trying to make a scuff-geo file for a geometry that looks similar to http://homerreid.dyndns.org/scuff-em/scuff-static/scuff-static-thumb.png, with all surfaces PEC and the interior region also PEC, so I was wondering if this is true... I don't see how you can make this geometry just using objects instead of regions/surfaces. Did you use PEC as the material for this geometry?

Also, what determines whether surfaces will or won't be PEC? It seems like you can only specify whether regions will be, not whether surfaces will be... and yet I'm getting the following error:

error: Gates:0: attempt to assign potential to non-PEC surface %s:%i: syntax error (aborting)

when I have a scuffgeo file of:

REGION Interior MATERIAL PEC

SURFACE Gates
        MESHFILE channel1520c.msh
        MESHTAG 35
        REGIONS Exterior Interior
ENDSURFACE

SURFACE ZeroPotential
        MESHFILE channel1520c.msh
        MESHTAG 50
        REGIONS Exterior Interior
ENDSURFACE

and a potential file of

Gates 1
ZeroPotential 0

Ideally, I'd like each of these surfaces to be PEC... speaking of which, is it a problem for surfaces at different potentials to touch?

Thanks!

sarahdh commented 9 years ago

In the link above, it seems like you have spaces separating your rectangular bottom surfaces; are these vacuum regions, or not regions at all? Is scuff-static okay with having areas like this where potential is unspecified? (I.e. can it still compute potential/electric field?) Incidentally, it seems that they are all touching the main surface... is this okay even if they're at a different potential from the main surface? In which case why aren't they touching each other? Thanks.

sarahdh commented 9 years ago

Ah... so on closer inspection, it looks like the rectangular regions are actually below the main surface, and therefore not touching it. It seems like this clears up a lot of what I was asking; however, the following error is still relevant:

error: Gates:0: attempt to assign potential to non-PEC surface %s:%i: syntax error (aborting)

In particular, in your scuffgeo file for the picture at the above link, how did you convince scuff-static that your rectangular regions were PEC, and what am I doing wrong for that in my own scuffgeo file? Thanks!

HomerReid commented 9 years ago

Some of the confusion here may be stemming from the fact that SCUFF-STATIC uses a slightly different formulation of the computational electromagnetism problem than is used by SCUFF-SCATTER and the other nonzero-frequency codes.

In the formulation used for nonzero-frequency problems (the so-called "PMCHWT" formulation), space is divided into two or more contiguous volumes ("regions") that are bounded by closed surfaces. Within each region, the fields are determined entirely by what is happening on the boundary of that region, and do not know about anything happening in other regions. Each region is its own little hermetically-sealed world. To compute the fields at a point in a region, I only need to know the surface currents on the closed surface that bounds that region. The mathematical problem solved by SCUFF-SCATTER and the other nonzero-frequency codes in SCUFF-EM is to solve simultaneously the boundary-value problems determining the fields within each region in terms of the boundary data on the region boundaries.

Although nonzero-frequency problems always involve two or more regions bounded by surfaces, in many cases we have simple geometries in which the regions are compact homogeneous bodies bounded by simple closed surfaces. For geometries like this it is easiest to use the OBJECT...ENDOBJECT syntax for specifying objects, even though each OBJECT definition is really defining a new REGION (the interior of the given object) which just happens to be bounded by a single closed surface, instead of a union of open surfaces that together constitute a closed surface.

The formulation used by SCUFF-STATIC is different. In this case, there are no hermetically-sealed subregions. Instead, there is only one big ginormous region (the entire universe) and in this region exist one or more embedded surfaces, which may be closed or open and which may be dielectric or PEC. To compute the field at a point anywhere in space I need to know the surface charges on all surfaces everywhere. These surface charges are determined by requiring that certain equations be satisfied on the embedded surfaces. There are two possible types of equation that may be demanded for a given surface: (1) The electrostatic potential must have value X on this surface. This is the case for PEC surfaces assigned a fixed potential X. (2) The normal component of the electrostatic field must have a jump across the surface with magnitude proportional to Eps_1 / Eps_2, the ratio of the interior and exterior dielectric constants. This is the case for surfaces that bound dielectric regions.

In your case, if all of your surfaces are PEC, you can simply write your .scuffgeo file to look like this:

SURFACE Gates
        MESHFILE channel1520c.msh
        MESHTAG 35
ENDSURFACE

SURFACE ZeroPotential
        MESHFILE channel1520c.msh
        MESHTAG 50
ENDSURFACE

No need for REGION or MATERIAL specifications. A .scuffgeo file consisting of just a bunch of SURFACE statements with no REGION or MATERIAL statements is just defining a collection of PEC surfaces embedded in vacuum.

I'm sorry for the confusion and the lack of documentation on this. I will try to get an actual worked example up on the documentation website sometime this week.

sarahdh commented 9 years ago

Thank you!