User Tools

Site Tools


simple_electrostatic_simulation_in_femm_-_step-by-step_tutorial

Simple ELECTROSTATIC simulation in FEMM - step-by-step tutorial

This page shows a step-by-step tutorial of a very simple magnetic simulation.

Helpful page? Support Encyclopedia Magnetica.

All we need is $0.25 per month? Come on… ;-)

Step 1 - solver

Open FEMM and start new problem, menu > File > New .

Select Electrostatic problem' from the pop-up window (Fig. 1).

Fig. 1. Select problem


Step 2 - problem

Set problem and unit conditions (Fig. 2-1) from menu > Problem, and choose: Planar, Millimeters, Depth = 100 mm (the rest leave with default values). If you use the settings as shown in Fig. 2 then you can compare with this tutorial if the calculation is correct.

Fig. 2. Set problem and unit conditions


Step 3 - points

Click on “Nodes” button (Operate on nodes) (Fig. 3-1).

Fig. 3-1. “Nodes” button selected

Press TAB (on keyboard) to manually input a node (point) with coordinates (Fig. 3-2). Enter the following points:

  1. point x = 0, y = 0
  2. point x = 0, y = 100
  3. point x = 10, y = 0
  4. point x = 10, y = 100
  5. point x = 20, y = 0
  6. point x = 20, y = 100
  7. point x = 30, y = 0
  8. point x = 30, y = 100

Fig. 3-2. Entering point with coordinates (0,0)

Click on the Zoom extents button (Fig. 3-3), which is the third one (white rectangle with a magnifying glass). (If not sure - hover a mouse over the buttons and see their description in the bottom left of the FEMM window.)

Then click on the Zoom out button once (magnifying glass with a minus).

Fig. 3-3. Zooming buttons, from left: Zoom in, Zoom out, Zoom extents, Zoom to window

If everything is done correctly, the window should look like in Fig. 3-4.

Fig. 3-4. Nodes created


Step 4 - lines

Select the “Line” button (Operate on segments, see also Fig. 3-1). Draw a line between two nodes by clicking on the first point, then on the second point. Draw all lines so that they look as in Fig. 4-1.

Fig. 4-1. Frame is created with straight lines


Step 5 - arc angle

Select the “Arc” button (Operate on arc segments) (see also Fig. 3-1). The arcs are always drawn in anti-clockwise direction, between two points. In the pop-up window, change the “angle” of arc to 180 degrees. This window will pop up for each new arc, so the value can be changed accordingly.

Fig. 5-1. Arc angle


Step 6 - arcs

So to draw a bottom arc as shown in Fig. 5-1 the points have to be clicked in the sequence “1” then “2”.

Fig. 6-1. Bottom arc from 1 to 2, top arc from 2 to 1


Step 7 - save

Save the file: menu > File > Save


Step 8 - circuits

To set the current in conductors or circuits go to: menu > Properties > Conductors

Fig. 8-1. Menu for “Conductors”

Several “Conductors” can be specified and used for separate electrodes. A new conductor can be added by Add Property (Fig. 8-2), and filling the value of current in the Circuit Property pop-up window.

The conditions can be prescribed either by voltage (value in volts, V) or as imposed electric charge (in coulombs, C).

(In FEMM calculation of capacitance is independent of voltage, so sometimes setting a voltage difference of 1 V is beneficial because it simplifies calculation of capacitance, as it is done in this example.)

Fig. 8-2. Add Conductor


Step 9 - material library

FEMM contains a library / database of materials, which can be used in the model, Fig. 9-1.

Fig. 9-1. Accessing Materials Library

The library window has two parts. On the left (“database” in Fig. 9-2), there are all the available materials as provided by FEMM. New materials can be added to it if needed.

The part on the right is for all the materials which will be accessible within the given model. Simply use the mouse to drag-and-drop method to drag the given material from the left to the right sub-window.

Fig. 9-2. Database (left) and model (right), drag-and-drop


Step 10 - boundary

FEM equations require boundary conditions to be solved. They act as a reference point. Many different conditions can be specified, but for a simple electrostatic simulation it is typically most useful to use the built-in “open boundary” feature. This boundary simulates an infinitely large volume (hence “open”), even though it can be positioned quite close to the simulated objects.

This “open boundary” method (Fig. 10-1) should be done only after all other geometry was created, because it can automatically set the right size of the boundary, suitably larger than the rest of the model. If this is the case then nothing needs to be changed in the pop-up window, and all the default values can be accepted with “OK”.

Fig. 10-1. Create open boundary automatically

After accepting there will be many circles created automatically, Fig. 10-2. There will be some block names appearing in the circles (as shown by the red arrows). These should be ignored, because they are needed for correct operation of the boundary.

Fig. 10-2. Open boundary created


Step 11 - block labels, materials, currents

Every part in the model must have a material data assigned to it, so FEMM know how to solve it. Each area completely surrounded by blue lines or arcs represents a “block”, and each such block has to have the material specified for it. This is done by using the green icon Operate on block labels, Fig. 11-1.

After selecting the option click somewhere (anywhere) inside of each block, as shown in Fig. 11-1. A green point called <none> will appear with each click. To remove it, just right-click on it (to select it, changes colour to red) and press Delete (on keyboard).

Fig. 11-1. Add block points

Then each green point has to be configured. Right-click on a given point and press Space (on keyboard). Alternatively, after selecting (it turns to red) use: menu > Operation > Open selected. A pop-up window will appear, Fig. 11-2.

In the window, use the drop down list to select material type or “Block type”. For example, Air is chosen for the point in Fig. 11-2. Click OK to accept.

The drop down list will also contain the u1, u2, u3… materials for the open boundary. These should be ignored.

Notes:

  • You can select more than one point, and all the selected points can be configured simultaneously.
  • Unchecking the box allows setting manual mesh size (described below).
  • The “In group” variable can be used to group some objects. All objects have by definition group = 0. But this can be set to other value so that several objects can be a part of the same group. This is useful for editing (move, copy, rotate) or results analysis (select all objects in the group easily).

Fig. 11-2. Configure block labels

The geometry represents a capacitor with two plates. The inside of each plate will have by definition the same potential, so it does not matter which material is assigned (but it needs to have some material, so Air will do).

Fig. 11-3. Configured labels for all blocks

Now each plate needs to have the voltage assigned to ALL the lines and arcs which belong to that plate. Lines and arcs need to be set separately.

Select the “line” icon and right click on both lines of the left plate, and press Space. Then choose the previously defined “zero” voltage option to configure the conductor.

Fig. 11-4. Assign voltage to lines

Fig. 11-5. Assign voltage to arcs

Repeat the same for the right plate, to assign “positive” voltage.

Fig. 11-6. Assign voltage to arcs


Step 12 - mesh

Before meshing - save the file! A very large mesh can sometimes cause problems, so it is a good idea to save before meshing.

For simple models it is sufficient to use the automatic settings of mesh. Just click on the “mesh” button, Fig. 12-1. If all materials were assigned to all blocks then the pop-up message states just the number of nodes of the mesh, meaning that all is correct.

If some block label was left undefined then this message will say something like:

Created mesh with 11957 nodes.
Grey mesh lines denote regions that have no block label.

It is necessary to define ALL block labels.

Fig. 12-1. Mesh (automatically generated)


Step 13 - analyse / solve

Analysis is executed by clicking the “cranked cog” icon (red arrow in Fig. 13-1). A pop-up window appears which shows the progress of calculations. Just wait until it finishes. No message is shown if all finishes correctly, which for small models it can be less than 1 second.

As soon as the small window disappears the results can be viewed by clicking the “glasses” button (black arrow).

If there are errors in the model or material data the solution might not converge. If the computation time is excessive typically there is a problem somewhere in the model (block labels, double labels, wrong boundary, etc.)

Fig. 13-1. Analyse / solve


Step 14 - results

Clicking the button shown by the black arrow in Fig. 13-1 opens a new window (post-processing), with the results of the simulation loaded. Depending on the configuration of FEMM there could be lines or colours, or no lines and no colours.

The type of data can be selected by using the “lines” or “rainbow” buttons, Fig. 14-1.

These two options can be accessed also through: menu > View > Contour plot and menu > View > Density plot.

Fig. 14-1. Results window, without equipotential lines, and colour map

Clicking the “rainbow” button shows the small window, which which the type of variable can be selected: Voltage V, Flux density D, or Field intensity E. Limits are scaled automatically between the min. and max. value present in the model, but they can be adjusted manually as needed.

Don't forget to tick the “Show Density Plot” box!


Step 15 - plot data along line

In the solution window, use the “red line” icon (Fig. 15-1) to draw a path of lines or arcs, between any two existing points (left-click of mouse) or between any arbitrary points (right-click of mouse). Once the path is created, various values can be plotter along that line, from the beginning to its end, in the same order as it was drawn.

Use “line” icon (red arrow), draw the line between the points of interest, then click on the “graph” icon (black arrow), and select the type of plot in the pop up window.

The path can end at the same point it started.

To plot, press the “graph” icon (Fig. 15-1). A pop-up window will open and the variable to be plotted can be selected. The graph will be plotted in a new window.

Note that there is an option to export/write the data to a file, which can be then used with any spreadsheet software.

Fig. 15-1. Draw path to plot data

Fig. 15-2. Plotted graph


Step 16 - line integral

Some values can be integrated over lines or blocks. Draw a line, and then chose the integral icon, Fig. 16-1.

The calculated voltage is exactly -1 V, as defined in the conductors. Because the line was drawn from left to right, from “zero” to “positive”, so the integral is evaluated correctly.

Fig. 16-1. Select block


Step 17 - conductor info

Info about the given conductor with the “Conductor properties” icon, Fig. 17-1.

If there is more than one conductor defined then it can be selected from the drop-down list.

Capacitance is charge over voltage, C = q/V, and because the voltage was set to 1 V, the capacitance of this capacitor is 3.6e-13 F, or 0.36 pF.

Fig. 17-1. Conductor properties


Step 18 - values at any point

Data for any point, anywhere in the model can be easily displayed by enabling the Output Window (Fig. 18-1) and left-clicking anywhere in the model.

If snap-to-grid is enabled then only the grid positions will be available.

Fig. 18-1. Click anywhere to get values


Step 19 - that's it!

And that's all - now you can run a simple FEMM electrostatic simulation!

Helpful page? Support Encyclopedia Magnetica.

All we need is $0.25 per month? Come on… ;-)
simple_electrostatic_simulation_in_femm_-_step-by-step_tutorial.txt · Last modified: 2021/05/11 22:08 by stanzurek