📜 ⬆️ ⬇️

openEMS is an open source electromagnetic simulator

This post talks about openEMS open source electromagnetic simulator. The author of the project is Thorsten Liebig (Germany, University of Duisburg-Essen). Project site - openems.de . Github repository: github.com/thliebig/openEMS-Project . The simulator is cross-platform and works under Linux and Windows.

When I first saw this project, I did not believe that this could be created. Creating an electromagnetic simulator is a fairly time-consuming task, and I used to think that this is beyond the power of the open-source community. However, openEMS refutes this view. This is a full electromagnetic simulator. Of course, he does not reach the level of HFSS, but this is already a very worthy result.

Here is an example of using a simulator. This is a 15 GHz horn antenna radiation pattern obtained using openEMS.
')


Key features


A distinctive feature of this simulator is that it does not have its own graphical interface, but is embedded in Octave or Matlab. The simulation task is an Octave or Matlab script, and the Paraview program is used to view the results. For example, a horn antenna models such a script.

The electromagnetic simulator is designed to calculate the distribution of the electromagnetic field in various systems, excited both from the source of alternating voltage and the external electromagnetic field.

1. Calculation of the electromagnetic field (electrodynamics) by the FDTD method (finite difference method in the time domain)

2. Calculation of S-parameters of electromagnetic systems

3. Calculation of the electromagnetic field in the near and far zone

4. Calculation of antenna patterns

5. Visualization of results

The advantage of openEMS is that it is embedded in Matlab / Octave, and therefore we have unlimited possibilities for parameterizing models. For the post-processing of results, you can also use the full power of these systems of numerical mathematics. It does not require fussing with exporting the results and stuffing them into the mathematical system, but you can immediately get graphs and insert them into articles.

The disadvantage of openEMS is a higher entry threshold. The simulator is not intuitive. To understand what to do with it, you must read the manuals. Without knowledge of Matlab / Octave, working with him is impossible at all.

Installation


Installation instructions are here www.openems.de/index.php/OpenEMS#Installation

For installation under Linux, you can use ready-made packages for your distribution by connecting a third-party openEMS repository. For example, for Debian 7, the installation is done in two steps. First add the repository:

wget -O- 'http://download.opensuse.org/repositories/home:/sibbi77:/openEMS/Debian_7.0/Release.key' 2>/dev/null | apt-key add - echo 'deb http://download.opensuse.org/repositories/home:/sibbi77:/openEMS/Debian_7.0/ /' > /etc/apt/sources.list.d/openems.list 

And then install the packages:
 apt-get update apt-get install openems appcsxcad 

For Slackware14.1 there is SlackBuild from me: github.com/ra3xdh/openEMS.SlackBuild

If there are no ready packages for your distribution, you will need to build openEMS from source. Assembly instructions are located here: www.openems.de/index.php/Compile_from_Source

You will need the following libraries to build:


It should be noted that openEMS requires the VTK5 library, which is incompatible with VTK6. So if you have a VTK6 distribution kit, then you need to build and install VTK5 first. You can get VTK5 here www.vtk.org/download .
To view the simulation results, you need to install Paraview. It is usually in your distribution and is installed using the package manager.

Setup after installation


Now you need to register the paths to the openEMS package in the Octave or Matlab configuration file. Suppose that openEMS is installed in / opt / openEMS. Then in the $ HOME / .octaverc file you need to add:

 addpath('/opt/openEMS/share/openEMS/matlab'); addpath('/opt/openEMS/share/CSXCAD/matlab'); 

For Matlab, the same thing needs to be added to the startup.m file

Now you can get to work.

Trial run


First we check that the openEMS kernel itself is running. To do this, go to the console in the directory where you installed openEMS, and then run openEMS. For example for the case of installation in / opt / openEMS:

 cd /opt/openEMS/bin/ ./openEMS 

You should get something like this in the console:

  ---------------------------------------------------------------------- | openEMS 64bit -- version v0.0.32-14-g63adb58 | (C) 2010-2013 Thorsten Liebig <thorsten.liebig@gmx.de> GPL license ---------------------------------------------------------------------- Used external libraries: CSXCAD -- Version: v0.5.2-15-gcb5b3cf hdf5 -- Version: 1.8.13 compiled against: HDF5 library version: 1.8.13 tinyxml -- compiled against: 2.6.2 fparser boost -- compiled against: 1_54 vtk -- Version: 5.10.1 compiled against: 5.10.1 

If it worked out, then we can continue. Otherwise, something is not established.
So.

Now we check the interface with Octave. Run Octave or Matlab and check that everything works. First, we check that there is interaction with CSXCAD, a program for previewing a 3D model. You need to enter the InitCSX () command and the system should give something like this:

 octave:1> InitCSX() ans = scalar structure containing the fields: Properties = [](0x0) ATTRIBUTE = scalar structure containing the fields: CoordSystem = 0 

Now you need to check the interface to create a finite difference space in the time domain:

 octave:2> InitFDTD(0,0) ans = scalar structure containing the fields: ATTRIBUTE = scalar structure containing the fields: NumberOfTimesteps = 0 endCriteria = 0 

Now we try to start openEMS from Matlab / Octave with a nonexistent task:

 octave:4> RunOpenEMS('.','nonexistent.xml','.') ---------------------------------------------------------------------- | openEMS 64bit -- version v0.0.32-14-g63adb58 | (C) 2010-2013 Thorsten Liebig <thorsten.liebig@gmx.de> GPL license ---------------------------------------------------------------------- [....] openEMS - unknown argument: . openEMS: Error File-Loading failed!!! File: nonexistent.xml 

Now we are trying to launch the CSXCAD geometry viewer. To do this, inside Octave, type the command (it launches CSXCAD with some empty file):

 CSXGeomPlot('nonexistant.xml') 

In response, you should receive an error message in which we click OK and then the CSXCAD window should open. It looks like this:



If all these steps are completed, then you can begin to master the simulator. The next part will explain how to simulate the propagation of an electromagnetic wave in the space between two parallel plates.

OpenEMS resources


  1. Sai project: openems.de
  2. Github: github.com/thliebig/openEMS-Project
  3. Wiki: openems.de/index.php/Main_Page
  4. List of functions: openems.de/index.php/List_of_Functions

Source: https://habr.com/ru/post/255317/


All Articles