OpenEMS Makes Electromagnetic Field Solving… Merely Difficult

To ordinary people electronics is electronics. However, we know that the guy you want wiring your industrial furnace isn’t the guy you want designing a CPU. Neither of those guys are likely to be the ones you want building an instrumentation amplifier. However, one of the darkest arts of the electronic sects is dealing with electromagnetic fields. Not only is it a rare specialty, but it requires a lot of high-powered math. Enter OpenEMS, a free and open electromagnetic field solver.

We would like to tell you that OpenEMS makes doing things like antenna analysis easy. But that’s like saying Microsoft Word makes it easy to write a novel. In one sense, yes, but you still need to know what you are doing. In fairness, though, the project does provide a good set of tutorials, ranging from a simple wave guide to a sophisticated phased array of patch antennas. Our advice? Start with the waveguide and work your way up from there.

The software uses Octave or MATLAB for scripting, plotting, and support. You can download it for Windows or Linux.

If you want to start with something more intuitive for electromagnetic field visualization, this might help. If you prefer your models more concrete and less abstract, perhaps you should work at Lincoln Lab.

21 thoughts on “OpenEMS Makes Electromagnetic Field Solving… Merely Difficult

      1. Bitcoin can’t be mined efficiently with a GPU.

        However, the thousands of cores in a GPU are very well suited to linear simulations, such as rigid, softbody, fluid, and particle physics, and even chemistry simulation. I’d assume it could do wonders for RF simulation.

      1. Correction: The actual computing isn’t heavy for small problem spaces (or spaces with a low ‘detail’ or grid size). For large problem spaces it gets damn heavy, both in memory needed and in CPU speed. I did a simulation that took about 15 hours on an i7 and took up most of the 32 gigs of RAM. It all depends on what you are simulating.

    1. OpenEMS does not use GPU for solving fields. The main speed bottleneck for openEMS is memory bandwidth. Intel processors perform much better than AMD when it comes to memory bandwidth in my experience with FDTD. I have seen some commercial solutions that claim to solve in GPU shaders with dramatic improvements in simulation times, but I have no experience with these. The other thing that can make a *huge* difference in simulation times is the mesh. Getting the mesh right can be a challenge.

      1. FDTD parallels incredibly well because of the structure of the equation so you can get amazing performance increases by doing computation on GPUs provided you have enough memory. It’s not to hard to implement in CUDA if you want a fun project for a couple of weeks.

        You can get several versions of NEC for free though and they are very fast when used appropriately and resource light.

  1. Hi HaD, Thank you for this article. Please allow me to add a bit of depth…

    openEMS is an interesting open Computational Electromagnetics (CEM) suite that’s been around for a couple/few years at my comment time (now end-July 2017). Installation of openEMS is not for the faint hearted. Like any tiered development chain, I recommend you start by installing openEMS in a virtual machine (VM) first before openEMS is allowed to affect a production system (dependency collisions, environment var corruption, etc. may occur).

    openEMS uses the Finite Difference Time Domain (FDTD) method. Hence you need to understand/decide if FDTD is best suited to the type of simulation you are doing. very simply put: consider surfaces/structures vs. wires, as well as the boundries of your simulation. After all, in the end any sort of classical domain elecromagnetic simulation is based on Maxwell’s Equations. Ref:

    https://en.wikipedia.org/wiki/Maxwell%27s_equations

    FDTD is probably more suited to things like patch microwave antennas and other planar oriented structures. A solution using the Method of Moments (MoM) is probably more suited to wire antenna structures. There are other modeling approaches, each with their own strengths and weaknesses (not to mention hybrids).

    If you are working with finite wire-based structures and (perhaps) ground planes, you are probably better off using a MoM based simulator rather than a FDTD based simulator like openEMS. See the “Numerical Electromagnetics Code” link below which includes links to various NEC based packages for Windows and/or Linux/Unix.

    References:

    * Computational electromagnetics (a decent overview)

    https://en.wikipedia.org/wiki/Computational_electromagnetics

    * Method of Moments (a.k.a. MoM or Boundary Element Method)

    https://en.wikipedia.org/wiki/Boundary_Element_Method

    * Numerical Electromagnetics Code (a.k.a. NEC, which uses MoM)

    https://en.wikipedia.org/wiki/Numerical_Electromagnetics_Code

    * Finite Difference Time Domain method (a.k.a. FDTD)

    https://en.wikipedia.org/wiki/Finite-difference_time-domain_method

    * Finite Element Method (a.k.a. FEM)

    https://en.wikipedia.org/wiki/Finite_element_method

    * Scattering Matrix Method (a.k.a. SMM)

    https://en.wikipedia.org/wiki/Scattering-matrix_method

    * Comparison of EM simulation software

    https://en.wikipedia.org/wiki/EM_simulation_software

    * Computational Electromagnetics – Codes (a list by K. Warnick 12/5/16)

    http://ece563web.groups.et.byu.net/notes/cem_codes.html

  2. Also Check Out onelab (which uses getdp as solver)…

    GPU is not really as helpful as you might think… Check out the petsc homepage vor more Information in this….

    73

  3. Well, to be picky and why not, I suspect they don’t solve the EM field equations. They use numerical methods and boundary conditions to integrate and differentiate and calculate the value at a point. Then do it again and again and again….

    Perhaps “Makes Electromagnetic Field Calculations…..Merely Difficult”.

    1. Well, not to be too picky, but… while you may be correct… can you name any equations that solve anything in reality? Sure Maxwell’s equations might not explain quantum entanglement, but if you are trying to “simulate” a solution to something like EM wave propagation through a volumetric stackup of materials that includes air-box, enclosures of various types, boundary conditions, etc, then the FDTD method is probably your best bet on getting *very* close to reality if you define all the physical properties of the materials properly. OpenEMS has user-definable parameters describing effects down to the molecular level (Lorentz-Debye).

    2. FDTD, FEM and every other EM solver does solve Maxwells equations using numerical methods. To be able to solve them, the simulation space is discretized and the equations are are written in a form to calculate the discretized model. Maxwells equations are fundamental to any EM solver.

      So far, I have found openEMS to be very good and results compare well to expensive commercial software for the models I have tried.

  4. I have written a couple of detailed tutorials showing how to setup a reflector antenna simulation, and another showing how to setup and design high performance corrugated horn antennas using openEMS and Octave. Here are the links to both tutorials.

    https://github.com/PaulKlasmann/Tutorial—Reflector-Simulation-with-openEMS

    https://github.com/PaulKlasmann/Corrugated-Horn-openEMS-Tutorial

    These are also on the openEMS forum if you search for them. The examples here are more realistic of real-world antennas. Note that the reflector antenna uses a simple circular waveguide as the feed horn, this should be replaced with the actual feed that you wish to use and the important parameters should be changed accordingly.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.