Why don't we directly solve for the field in FEM?
Today, we’ll be talking about FEM a bit. FEM, aka the finite element method, is a numerical method for finding approximate solutions for partial differential equations. However, we usually obtain the solution via a potential of some kind, rather than directly solving for the quantity of interest. For me, that’s usually the vector potential.
But why do we take this convoluted route? This post will answer that question. Since this such a mathematical and equation-heavy topic, here’s a picture of a cat:
What to solve?
In my line of work, FEM is typically used to solve the Maxwell’s equations. In other words, the fundamental equations describing the dependence between magnetic and electric fields and flux densities. Since the frequencies included are usually somewhat low (compared to radio signals), we typically exclude the so-called displacement current term. This approximation is called quasi-static.
Let’s use the simplest case as an example, i.e. no eddy currents. Then, we only need three equations:
The first of these basically tells us how the magnetic field circles around any currents in the problem domain. The second one, with the divergence operator, says that no magnetic flux density is created out of nothing. No magnetic monopoles so far, that is. Sorry. Finally, the last equation ties and together through the material-dependent magnetic permeability .
How we solve it
So how do we solve this problem?
Well, we typically begin by determining a new quantity, the so-called vector potential . Specifically, we want the following relationship to hold between and
Nicely for us, this definition satisfies equation (2) automatically. Because of this, we can simply substitute into (3) and (1), to get
As you can see, we managed to reduce three equations into only one. Quite nice, isn’t it?
Anyway, this final equation we can then solve with our FEM tricks, and a bit of computing power.
Not so fast
Technically, the above is fully accurate only in 2 dimensions. You see, the relation
does not define a unique . Indeed, if we add any gradient field to , the resulting flux density will still be the same. Like this:
for any .
To ascertain the uniqueness, the so-called Coulomb’s gauge
is commonly used.
In typical 2-dimensional magnetic problems, this is satisfied automatically for the following reason. In order for to lie in the xy-plane, has to be purely z-directional. Since no z-dependency is assumed, it’s divergence will obviously be zero.
But, in 3D analysis the gauge will be taken into account by other means.
Why the potential?
Okay, so the vector potential works very nicely in 2D. But why is it still used in 3D problems? You might think that it might be just as easy to solve the Maxwell’s equations directly from
rather than going through the gauged vector potential formulation
To answer this, we need to briefly consider how the finite element method works.
They just work quite nicely
Basically, the idea is to write with a weighted sum
with some known functions and unknown coefficients .
However, the nature of the underlying physical problem sets some requirements for the functions . Using a little bit of maths, it is possible to show that the tangential component of the vector potential has to be continuous over any possible boundary in the problem. Since is a linear combination of , this is easily satisfied if the tangential components of are continuous.
The so-called edge elements fulfil this requirement, while at the same time fulfilling the gauge condition. Talk about a win-win. Thus, they are very commonly used in 3D analysis.
Well to be honest, edge elements do not fulfil the gauge condition automatically. It either has to be enforced manually, or dealt with using other means. But we take what we can get.
This same tangentiality requirement for and can also be deduced from the potential formulation itself. By using the Galerkin approach and doing a simple integration by parts, the left side of the curl-curl equation is reduced to a matrix with entries
If our functions are tangentially continuous, the curls will be finite everywhere. Hence, the integral is easy to evaluate.
Life without potentials
Let’s see what would happen if we tried to solve for directly. One of the easiest-to-understand ways would be to minimize the squared error
with the Galerkin’s method. Indeed, this is what the least-squares finite element method is about.
However, this approach would result in terms like
in our discretized equation.
However, now we see (you do see, right? RIGHT??) that
a) The functions should to be tangentially continuous, lest the term blow up
b) The functions should to be normally continuous, or blows up.
In case there are abrupt changes in (like, say, in an electrical machine) these two requirements are quite damn hard to satisfy at the same time.
Indeed, some special tricks would probably have to be applied, like trying to minimise the norm of the said discontinuities in the functions. However, these penalty methods are known to suffer from convergence issues, especially in nonlinear problems.
Indeed, the least squares methods, in general, seem pretty much unsuitable for the analysis of electrical machines. There are some esoteric adjoint-norm-based mathematical nightmare-approaches, but they don’t work well in any realistic problems.
I tried. Don’t do the same mistake.
Still awake? Here, have a cookie.
Need help with electric motor design or design software? Let's get in touch - satisfaction guaranteed!