Download as ppsx, pdf, or txt
Download as ppsx, pdf, or txt
You are on page 1of 176

The Finite Element Method

in Electromagnetics

Author
Prof. Miklós Kuczmann
Department of Automation
Széchenyi István University
Győr, Hungary
kuczmann@sze.hu

Reviewer
Prof. Anouar Belahcen
Aalto University, Helsinki, Finland
2014, 2016

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Timetable

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
At the end you will be able to …

• understand Maxwell’s equations from the viewpoint of numerical analysis;

• understand potential formulations in detail used in the CAD-software;

• understand finite element method in detail;

• write your own code if needed;

• modify, improve open-source codes;

• model any kind of electromagnetic field problem;

• understand a kind of nonlinearity and a solver.

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Let me introduce myself

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Let me introduce myself
~ 300 Arrabona – Roman military camp and city
~ 700 Hungarians arrive to Győr
1000- County and bishop’s seat
1300- Commerce and handwork industry
1700- Baroque age, rich merchants and craftsmen
1870- Rapid industrial development (food, textile)
1950- Extensive industrial development

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Let me introduce myself
Programmable logic controllers
Microcontroller applications
Design of ASIC circuits
Logical circuits
Robotics, mobile vehicles
Motors and electric drives
Control theory, soft computing
Numerical Field Computation

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Let me introduce myself

Short CV: Research field:


Born in 1977, Hungary • Numerical Electromagnetic Field Computation
Electrical Engineer MSc, 2000 • Finite Element Method
PhD, 2005 • Hysteresis Modeling
Dr. habil., 2011 • Antenna Simulation
DSc, 2015 • Control theory
Full Professor, 2011- • Programmable Logic Controllers
Head of Department of Automation, • Microcontroller applications
2011- • Robotics
Dean, 2015- • Motors and electric drives

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Your turn

Name

Country

Your research field

Are you familiar with FEM?

What software do you know?

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
References

Course materials:

http://maxwell.sze.hu/~kuczmann/Anouar

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
References
M. Kuczmann
Potential Formulations in Magnetics Applying the Finite Element Method
Lecture Notes, 2009
Available online: http://maxwell.sze.hu/docs/C4.pdf

M. Kuczmann, A. Iványi
The Finite Element Method in Magnetics
Akadémiai Kiadó (Academic Press), Budapest 2008
ISBN 978 963 05 8649 8

J. Jin
The Finite Element Method in Electromagnetics
John Wiley and Sons, New York, 2002

O. Bíró, K. R. Richter
CAD in electromagnetism
in Series Advances in Electronics and Electron Physics, Academic Press, New York, 82,
1991.

A. Ivanyi
Hysteresis Models in Electromagnetic Computation
Akadémiai Kiadó (Academic Press), Budapest 1997

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
References
J. D. Jackson
Classical Electrodynamics
J. Wiley, New York, 1962

G. Meunier
The Finite Element Method for Electromagnetic Modeling
John Wiley and Sons Inc., 2008

J. Luomi
Finite Element Methods for Electrical Machines
Chalmers University of Technology, Gőteborg, 1993

K. E. Lonngren, S. V. Savov
Fundamentals of Electromagnetics with Matlab
SciTech Publishing Inc., 2005

G. Bertotti, I. D. Mayergoyz
The Science of Hysteresis
Academic Press, New York, 2006

M. N. O. Sadiku
Numerical Techniques in Electromagnetics
CRC Press LLC, 2001
Prof. Dr. habil. Miklós Kuczmann, DSc, PhD
Department of Automation
Széchenyi István University, Győr, Hungary
Content
Introduction to the numerical electromagnetic field computation
Aim of the lectures
Why numerical field analysis?
Numerical electromagnetic field computation, representative problems
Maxwell’s equations
Groups of electrodynamics
Software

• Introduction to the Finite Element Method in electromagnetic field computatio


The Finite Element Method
Simple 1D and 2D problems from scratch
Potential formulations, examples
 

• Hystesis in FEM • Some radio frequency problem


Magnetic hysteresis
Measurement and simulation  
Scalar and vector hysteresis • Outlook
The fixed point method Parallel computation
Polarization formulation  
Examples

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Part I

Introduction to the

numerical electromagnetic field computation


Aim of lecture
Provide the basic skills for numerical electromagnetic field analysis
by the finite element method.

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Why numerical field analysis?
• Cheaper than a laboratory when prototyping (e.g. measurement in a FAC or design
a new motor);

• Faster than measurements and modification in the laboratory (trial and error
method);

• Parameter sweep, there are extreme situations that can not be measured, but
can be simulated;

• It is possible to look inside the arrangement (e.g. eddy currents inside transformers
or near field can be simulated easily).
Fully Anechoic Chamber
Complement!

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Powertrain testbed
Load machine/dynamometer

~3million euro
Drive
Prof. Dr. habil. Miklós Kuczmann, DSc, PhD
Department of Automation
Széchenyi István University, Győr, Hungary
Numerical electromagnetic field computation
Design and simulation of electrical machines

• Voltage
• Current
• Characteristics
• Impedance
• Force
• Torque
• Heat
• Vibration
• Noise
Prof. Dr. habil. Miklós Kuczmann, DSc, PhD
Department of Automation
Széchenyi István University, Győr, Hungary
Numerical electromagnetic field computation
Effect of eddy currents – testing

Effect of eddy currents – heat

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Numerical electromagnetic field computation
Parameters of transmission lines
• Capacitance • Resistance
• Inductance • Conductance

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Numerical electromagnetic field computation
Waveguides

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Numerical electromagnetic field computation
Antenna simulation, design and measurements

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Heroes of electrodynamics

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Maxwell’s equations
Field quantities

H = H(r,t) magnetic field intensity, [H] = A/m


E = E(r,t) electric field intensity, [E] = V/m
J = J(r,t) current density, [J] = A/m2 Electromagnetic field
D = D(r,t) electric flux density, [D] = C/m2 representation

B = B(r,t) magnetic flux density, [B] = T


r = r(r,t) charge density, [r]=C/m3

1862, Maxwell’s equations


1873, A treatise on electricity and magnetism

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Let us warm up ;-)

(enjoy break)
Maxwell’s equations

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Maxwell’s equations

1820
1888

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Maxwell’s equations

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Maxwell’s equations

1831

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Maxwell’s equations

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Maxwell’s equations

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Constitutive relations

isotropic/anisotropic, frequency dependency, temperature dependency and so on


Prof. Dr. habil. Miklós Kuczmann, DSc, PhD
Department of Automation
Széchenyi István University, Győr, Hungary
Polarization formulation

characteristics

linear component

Direct characteristics Inverse characteristics

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Interface conditions

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Repeat …

Scalar product
Vector product

Integral

Nabla operator

Curl
Divergence
Gradient

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Maxwell’s equations

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Groups of field problems
• Electrostatics field

• Static magnetic field

• Currents in conducting materials

• Eddy current field

• Electromagnetic field

Partial differential equations

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Partial differential equations
• Electrostatics field (elliptic pde)

• Static magnetic field

• Eddy current field (parabolic pde)

• Electromagnetic field (hyperbolic pde)

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Electrostatic field

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Static magnetic field
Toroid transformer

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Eddy current field

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Electromagnetic field
Time harmonic situation

conical antenna

excitation

means perfect electric wall

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
enjoy break
Some simple problems by hand

• Capacitor

• Magnetic field around a wire

• Eddy currents inside a plate

• …

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Introduction to SciLab
www.scilab.org

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Introduction to SciLab

The very basics we need:

• Variables
• Vector, Matrix
• For cycle
• Linear algebra
• Plot

Let us write a code to plot the potential inside the capacitor!

Homework:

1.) Try to find the analytical solution of a capacitor with two dielectrics!
2.) Find a paper for beginners in the course material (33 pages)!
3.) View YouTube videos about SciLab!

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Timetable

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Part II
Introduction to the
Finite Element Method (FEM) in
electromagnetic field computation

Maxwell behind a mesh


Aim of lecture
Provide the basic skills for numerical electromagnetic field analysis
by the finite element method.

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Why numerical field analysis?
• Cheaper than a laboratory when prototyping (e.g. measurement in a FAC or design
a new motor);

• Faster than measurements and modification in the laboratory (trial and error
method);

• Parameter sweep, there are extreme situations that can not be measured, but
can be simulated;

• It is possible to look inside the arrangement (e.g. eddy currents inside transformers
or near field can be simulated easily).
Fully Anechoic Chamber
Complement!

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
The origin

Walter Ritz (1878-1909) Borisz Grigorjevics Galjorkin (1871-1945)

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Main steps of numerical analysis (FEM)
• Problem definition, Model setup
• Geometry, Symmetries, Simplifications
• Appropriate equations and conditions
• Material data
• Mesh (discretization of geometry)

• Mathematical formulation
• Partial differential equations
• Boundary conditions
• Weak formulation and Galerkin technique
• Equations of one finite element

• Discretiazion in time if necessary

• Assembly and solve the equations

• Post processing the results


Prof. Dr. habil. Miklós Kuczmann, DSc, PhD
Department of Automation
Széchenyi István University, Győr, Hungary
Main steps of numerical analysis (FEM)

eq
ua
tio
ns
,s
ol
ve
r,

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Laplace-Poisson equation

Electric scalar potential

+ boundary conditions

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Case study in COMSOL Multiphysics 3.5.a
2D – AC/DC Module – Static, Electric – Electrostatics

Physics – Subdomain Settings


E2-E1

Physics – Boundary Settings

• Draw two circles E1 and E2


• Compose E2-E1
• Set Physics
• Mesh by default mesh
• Solve by default solver
• Post process

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Case study in COMSOL Multiphysics 3.5.a

Capacitance:

34.6 pF/m

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Case study in Infolytica MotorSolve

Brushless DC Motor design

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Case study in Infolytica MotorSolve

TEMPLATES

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Case study in Infolytica MotorSolve

Torque: -68Nm

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Case study in Comsol with Matlab

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
ANSYS Maxwell 3D

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
ANSYS HFSS

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Free: FEMM, Gmsh, FreeFEM, Agros2D, …

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Our code

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Our code

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
The Finite Element Method (FEM)
Partial differential equations with
boundary conditions

Multiply by a weight N or W, and


integrate over the domain W
Weighted residual method

Weak formulation is obtained after some math

Galerkin method = weighted residual method +


weighting functions and approximation
functions are the same

This results in FEM


Prof. Dr. habil. Miklós Kuczmann, DSc, PhD
Department of Automation
Széchenyi István University, Győr, Hungary
What FEM is about
• f(x) is an unknown function and h(x)
a known function, define c1 and c2
for the best fit  1,1  1,2  c1   f 1   1,0c0   1,3c3 
Y      
 2,1  c
2,2   2   2f   c
2,0 0   c
2,3 3 

y  c1 y  c3

f ( x )  h( x )  0
f ( a)  c0
y  c0 y  c2
f (b )  c 3

x 0  a x1
X
x1 x 3  b
Prof. Dr. habil. Miklós Kuczmann, DSc, PhD
Department of Automation
Széchenyi István University, Győr, Hungary
Simple 1D problem from scratch – capacitor

í U

Capacitor

1D model

x=0 x
x=d
Analytical solution is known!

Let us solve by FEM! – Details are shown in the course using blackboard!

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Weak formulation

PDE

W.R.

Gauss
theorem

Approximation

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Linear shape functions

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Sample code in SciLab
clear; clc // Element equation
Ke = [gN1; gN2] * eps * [gN1, gN2] * (x2 - x1);
// Constants be = rho * [(x2 - x1)/2; (x2 - x1)/2];
eps = 8.854e-12 * 10;
rho = 1e-2; K(e,e) = K(e,e) + Ke(1,1);
d = 1/1000; K(e,e+1) = K(e,e+1) + Ke(1,2);
U = 10; K(e+1,e) = K(e+1,e) + Ke(2,1);
K(e+1,e+1) = K(e+1,e+1) + Ke(2,2);
// FEM mesh b(e) = b(e) + be(1);
N = 9; b(e+1) = b(e+1) + be(2);
X = 0:d/N:d; end // of for e
// Boundary conditions
// K*f=b, initialization K(1,:) = K(1,:) * 0;
K = zeros(N+1,N+1); K(1,1) = 1;
b = zeros(N+1,1); b(1) = 0;
K(N+1,:) = K(1,:) * 0;
// Assembly K(N+1,N+1) = 1;
for e = 1 : N b(N+1) = U;
// x1 and x2
x1 = X(e); // Solution
x2 = X(e+1); fi = K \ b;

// Gradients // Post processing


gN1 = -1 / (x2 - x1); a_fi = -1/2*(rho/eps)*X.^2+(U/d+(1/2)*(rho/eps)*d)*X;
gN2 = 1 / (x2 - x1); plot(X, fi, X, a_fi, 'ro');
Prof. Dr. habil. Miklós Kuczmann, DSc, PhD
Department of Automation
Széchenyi István University, Győr, Hungary
Solution
N=9 N=4

N=100

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
hFEM vs pFEM
Let us use 2nd order approximation!

Details are shown on course’s material.

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
1D nodal elements

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Homework
1.)
Prepare the equations of the 3rd order approximation
Modify the code
Check the results

2.)
Simulate a capacitor with two different dielectric (linear or second order)

3.)
Neumann boundary condition

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Timetable

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Part II - continued
Introduction to the
Finite Element Method (FEM) in
electromagnetic field computation

Maxwell behind a mesh


Static magnetic field – blackboard
Toroid transformer

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Static magnetic field problem

Problem is solved from scratch on the blackboard!

Please study the code written in SciLab!

A-formulation and F-formulation

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Area functions

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Area functions

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
2D nodal triangular elements

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
2nd order
3rd order
2D nodal triangular elements

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Homework
1.)
Write the equations of the 2nd order approximation of A
Study the SciLab code of the 2nd order approximation of A

2.)
Realize the code for the 2nd order approximation of scalar potential

3.)
Study the following problem (see next slides)

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Wave equation – inhomogeneous

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Wave equation – homogeneous
Charge-free and current-free situation
(wavegauides and cavities)

Magnetic vector potential A also can be used with Lorentz gauge!

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Simple 2D problem from scratch – waveguide
Nodes = ... Connect = ...
[0,5;... [1,6,7;...
2,5;... 1,7,2;...
4,5;... 2,7,8;...
6,5;... 2,8,3;...
8,5;... 3,8,9;...
0,3.5;... 3,9,4;...
2,3.5;... 4,9,5;...
4,3.5;... 5,9,10;...
6,3.5;... 6,11,12;...
8,3.5;... 6,12,7;...
0,1.5;... 7,12,13;...
2,1.5;... 7,13,8;...
4,1.5;... 8,13,9;...
6,1.5;... 9,13,14;...
8,1.5;... 9,14,10;...
0,0;... 10,14,15;...
2,0;... 11,16,12;...
4,0;... 12,16,17;...
6,0;... 12,17,18;...
8,0]/100; 12,18,13;...
13,18,19;...
13,19,14;...
14,19,20;...
Dirichlet = [1,2,3,4,5,6,10,11,15,16,17,18,19,20]; 15,14,20];
Prof. Dr. habil. Miklós Kuczmann, DSc, PhD
Department of Automation
Széchenyi István University, Győr, Hungary
Weak formulation

PDE
eigenvalue problem

W.R.

Gauss
theorem

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Assembly
• Global matrix terms differ from zero only if both nodes
corresponding to sub-indices belong to the same
element:
• Sij  0if node i and node j do not belong to the same
element
• Global matrix is assembled from element matrices by
adding the element matrix terms to the corresponding
row and column of the global matrix.
1 2 4 2 7
1 3
2 4
3 4 5 1 8
5 7
S14  S41  0 6 8
6 3 9

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Sample code
W = [1/3 1/3 1/3];
L = [2/3 1/6 1/6; 1/6 1/6 2/3; 1/6 2/3 1/6];

K = zeros(size(Connect,1),size(Connect,1));
B = zeros(size(Connect,1),1);

for i = 1:size(Connect,1),
// Point number of an element
p1 = Connect(i,1); p2 = Connect(i,2); p3 = Connect(i,3);

// Coordinates of the nodes of element


x1 = Nodes(p1,1); x2 = Nodes(p2,1); x3 = Nodes(p3,1);
y1 = Nodes(p1,2); y2 = Nodes(p2,2); y3 = Nodes(p3,2);

// Area of the triangle


D = 0.5 * det( [1 x1 y1; 1 x2 y2; 1 x3 y3] );

// Gradient of the basis functions


gN1x = 0.5 * (y2-y3) / D; gN2x = 0.5 * (y3-y1) / D; gN3x = 0.5 * (y1-y2) / D;
gN1y = 0.5 * (x3-x2) / D; gN2y = 0.5 * (x1-x3) / D; gN3y = 0.5 * (x2-x1) / D;

// Left hand side matrix


Ke = ( [gN1x;gN2x;gN3x] * [gN1x gN2x gN3x] + [gN1y;gN2y;gN3y] * [gN1y gN2y gN3y] ) * D;

……

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Sample code
……
// Gaussian quadrature
Be = zeros(3,3);
a = x2-x1; b = x3-x1; c = x1;
d = y2-y1; e = y3-y1; f = y1;
for j = 1:3,
kszi = L(j,2); eta = L(j,3);
x = a*kszi + b*eta + c;
y = d*kszi + e*eta + f;

D1 = 0.5 * det( [1 x y; 1 x2 y2; 1 x3 y3] ); N1 = D1/D;


D2 = 0.5 * det( [1 x1 y1; 1 x y; 1 x3 y3] ); N2 = D2/D;
D3 = 0.5 * det( [1 x1 y1; 1 x2 y2; 1 x y] ); N3 = D3/D;

Be = Be + W(j) * ( [N1;N2;N3] * [N1 N2 N3] ) * D;


end;

// Assembly
K(p1,p1) = K(p1,p1) + Ke(1,1); K(p1,p2) = K(p1,p2) + Ke(1,2); K(p1,p3) = K(p1,p3) + Ke(1,3);
K(p2,p1) = K(p2,p1) + Ke(2,1); K(p2,p2) = K(p2,p2) + Ke(2,2); K(p2,p3) = K(p2,p3) + Ke(2,3);
K(p3,p1) = K(p3,p1) + Ke(3,1); K(p3,p2) = K(p3,p2) + Ke(3,2); K(p3,p3) = K(p3,p3) + Ke(3,3);

B(p1,p1) = B(p1,p1) + Be(1,1); B(p1,p2) = B(p1,p2) + Be(1,2); B(p1,p3) = B(p1,p3) + Be(1,3);


B(p2,p1) = B(p2,p1) + Be(2,1); B(p2,p2) = B(p2,p2) + Be(2,2); B(p2,p3) = B(p2,p3) + Be(2,3);
B(p3,p1) = B(p3,p1) + Be(3,1); B(p3,p2) = B(p3,p2) + Be(3,2); B(p3,p3) = B(p3,p3) + Be(3,3);
end;

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Sample code
// Dirichlet boundary conditions
for i = 1:length(Dirichlet),
K(Dirichlet(i),:) = K(Dirichlet(i),:) * 0;
K(Dirichlet(i),Dirichlet(i)) = 1;

B(Dirichlet(i),:) = B(Dirichlet(i),:) * 0;
B(:,Dirichlet(i)) = B(:,Dirichlet(i)) * 0;
end;

// Eigenvalues
[E,lambda] = eig(K,B);
[k,ki] = sort(sqrt(diag(lambda)));

// Numerical solution
k(1) -> 80.9

// Analytical solution wavenumber


sqrt((pi/0.05)^2+(pi/0.08)^2) -> 74.1

COMSOL -> 71.1

RF Module – Perpendicular Waves – TM Wave


Prof. Dr. habil. Miklós Kuczmann, DSc, PhD
Department of Automation
Széchenyi István University, Győr, Hungary
Timetable

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Part II - continued
Introduction to the
Finite Element Method (FEM) in
electromagnetic field computation

Maxwell behind a mesh


Eddy current field

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Eddy current field problem

Problem is solved from scratch on the blackboard!

Please study the code written in SciLab!

A-formulation and T,F-F-formulation

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Area functions

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Area functions

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Comments on the mesh – edge elements
Nodes = ... Edges = ...
11 12 [0,5;... [6,1;...
2,5;... 7,5;...
4,5;... 7,2;...
... 8,2;...
1 2 3 4 5 0,3.5;... 8,3;...
2,3.5;... 11,6;...
4,3.5;... 6,12;...
... 12,7;...
13 14 0,1.5;... ...
...]; ...];

Connect = ...
[1,6,7,-1,13,2;...
1,7,2, -2,3,-11;...
6 7 8 9 10 2,7,8, -3,14,4;...
2,8,3, -4,5,-12;...
...
6,11,12,-6,15,-7;...
6,12,7, 7,8,-13;...
15 16 7,12,13,-8,16,-9;...
7,13,8, 9,10,-14;...
...];

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
2D vector triangular elements

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Potential formulations
• Reduced magnetic scalar potential, F-formulation

static magnetic
• Total magnetic scalar potential, Y-formulation

field
Combination of magnetic scalar potentials, F-Y-formulation
• Applying F-formulation with appropriate representation of source current
• Magnetic vector potentail, A-formulation
• A, F-formulation

current field
• Current vector potential and magnetic scalar potential, T-F-formulation

eddy
• Magnetic vector potential and electric scalar potential, A-V-formulation
• Modified vector potential, A*-formulation

• T,F-F-formulation
• A,V-A-formulation gauged version with nodal finite elements
• A*-A-formulation
• T,F-A-formulation
• T,F-A-F-formulation ungauged version with edge finite elements
• A,V-F-formulation
• A,V-A-F-formulation

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Coupling of formulations

A,V A
T,F F
A*

T,F-F, A,V-A , A*-A, T,F-A, T,F-A-F, A,V-F, A,V-A-F (gauged and ungauged)
Prof. Dr. habil. Miklós Kuczmann, DSc, PhD
Department of Automation
Széchenyi István University, Győr, Hungary
Homework
1.)
Study the formulations in the book

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Timetable

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Part III

Hysteresis in FEM
Magnetic hysteresis

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Measuring scalar hysteresis

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Measuring scalar hysteresis

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Modelling scalar hysteresis – Preisach model

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Modelling scalar hysteresis – Preisach model

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Modelling scalar hysteresis – Preisach model

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Modelling scalar hysteresis

Dynamic model

eddy current effect viscosity


static model
in one lamination modelling excess loss

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Measuring vector hysteresis

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Measuring vector hysteresis

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Measuring vector hysteresis

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Measuring vector hysteresis

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Measuring vector hysteresis

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Modelling vector hysteresis

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Modelling vector hysteresis

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Modelling vector hysteresis

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Modelling vector hysteresis

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Modelling vector hysteresis

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Modelling vector hysteresis
Dynamic model

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
The fixed point method

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
The fixed point method

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Polarization Formulation (I)

direct model inverse model

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Polarization Formulation (II)

inverse model direct model

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Losses inside laminations

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Lamination model

Problem is solved from scratch on the blackboard!

See code!

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Losses inside laminations

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Losses inside laminations

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Three phase transformer

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Homework
1.)
Prepare the equations of the 2nd order approximation
Modify the code
Check the results

2.)
Study the Preisach model

3.)
Run the code applying Preisach model (Matlab)

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Another field – out of scope of this course
Part IV

Some radio frequency problem


Measurement and simulation of a dipole

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Model

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Feeding Models

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
COMSOL Multiphysics

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Finite Element Mesh

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Convergence vs. Mesh

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Simulation Results

2D 3D

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Simulation Results

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Simulation Results

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Simulation Results

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Hat feed – illustrative example

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Hat feed – illustrative example
COMSOL Multiphysics – PDE Modes – Classical PDEs – Helmholtz Equation

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Hat feed – illustrative example

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Hat feed – illustrative example

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Hat feed – illustrative example

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
A closing 3D example
RF Module – Electromagnetic Waves

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
A closing 3D example

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
A closing 3D example

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Part V

Outlook

Parallel computation
A simple test problem
2D electrostatic problem for case study

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
A simple test problem
Maxwell’s equations of electrostatics

 E  0   ( )  
 D  
~
D E   N   d   N  d
 
Scalar potential

E   K  b

~ I
    D  i 1 Ni  i
Prof. Dr. habil. Miklós Kuczmann, DSc, PhD
Department of Automation
Széchenyi István University, Győr, Hungary
The idea of domain decomposition

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
The idea of domain decomposition
Graph partitioning with METIS
Dual graph of the finite element mesh

http://glaros.dtc.umn.edu/gkhome/views/metis
Prof. Dr. habil. Miklós Kuczmann, DSc, PhD
Department of Automation
Széchenyi István University, Győr, Hungary
Decomposition of the FEM Mesh

partdmesh meshfile n

http://glaros.dtc.umn.edu/gkhome/views/metis
Prof. Dr. habil. Miklós Kuczmann, DSc, PhD
Department of Automation
Széchenyi István University, Győr, Hungary
Domain Decomposition Method
MPI – Message Passing Interface

1 2  K 11

0 0 0 K 15  1   b1 
   
 0 K 22 0 0 K 25   2  b 2 
5  0 0 K 33 0 K 35   3   b 3 
    
 0 0 0 K 44 K 45   4  b 4 
3 4
K
 51 K 52 K 53 K 54 K 55   5  b 5 

 4  4
K 55 

 K 5i K ii1K i 5  5  b 5 

 K 5i K ii1 b i
i 1 i 1

with LDLT factorization


K ii i  b i  K i5  5
Internal nodes and communication nodes.
Local and global numbering of the nodes.
Prof. Dr. habil. Miklós Kuczmann, DSc, PhD
Department of Automation
Széchenyi István University, Győr, Hungary
Sub-solutions

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Solution

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Comparisons

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Environment

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
Future Works
• More complex problems

• The FETI method (Finite Element Tearing and Interconnecting)

• Parallel (distributed) Supercomputer – Blade Center

• GPU processing

Prof. Dr. habil. Miklós Kuczmann, DSc, PhD


Department of Automation
Széchenyi István University, Győr, Hungary
There are many other questions…
• Gaussian elimination
• LU decomposition
• Gauss-Seidel method
• Gradient based methods
• …

• Higher order approximation (p-FEM)

• Integration by Gaussian quadrature

• Vector elements

• Three dimensional problems

• Potenital formulations in details

• Time stepping

• Implementation
Prof. Dr. habil. Miklós Kuczmann, DSc, PhD
Department of Automation
Széchenyi István University, Győr, Hungary

You might also like