Professional Documents
Culture Documents
ABC
Authors
Prof. Piergiorgio Alotto Prof. Maurizio Repetto
Dipartimento di Ingegneria Industriale Dipartimento Energia
Università di Padova Politecnico di Torino
Padova Torino
Italy Italy
This book stems from an engineering post-graduate level course held by the
authors in the winter of 2010 at the Politecnico of Torino. The rationale
behind this course was twofold: to present an algebraic solution method for
field phenomena originating from different areas of physics and to show the
potentiality of this framework in the treatment of several physical problems.
Both these issues seem to be important in the current computational physics
evolution in which new and challenging problems arise continuously from
various application fields.
These introductory notes are an attempt to justify the existence of this
book, which presents the cell method and to answer two simple questions:
is a new numerical method really necessary in the computational physics
environment and, if so, in which way is this really new ?
The first answer, in the authors’ opinion, is affirmative, because several
discrete numerical methods have already been around for many decades and
have approached the simulation of different phenomena. They have obtained
good results, but they seem to lack common ground. Numerical methods,
based on the variational approach, are usually considered within the frame-
work of the finite element method and it is there that they find their role
and mathematical background. Other discrete numerical techniques have be-
come because of their results but they still are considered different from one
another and are therefore often judged as useful tools but, at the same time,
at the border of the real mathematical kingdom. In spite of their different
origins, these methods often declare similar objectives.
For instance, in the finite volume method, it is stated that1 :
The finite volume method is locally conservative because it is
based on a “balance” approach: a local balance is written on each
discretization cell which is often called “control volume”; by the
divergence formula, an integral formulation of the fluxes over the
boundary of the control volume is then obtained.
In similar words, it has been stated that the main characteristics of the
mimetic finite difference are2 :
1 Eymard, R., Gallou, T., Herbin, R.: Finite Volume Methods. In: Ciarlet, P.G., Lions,
J.L. (eds.) Hand-book of Numerical Analysis, vol. 7, pp. 713-1020 (2006)
2 Gyrya, V., Lipnikov, K.: High-order mimetic finite difference methods on arbitrary
meshes. Mathematical Modeling and Analysis, Los Alamos National Laboratory (2010),
http://math.lanl.gov/
VIII Preface
Many other examples of these statements can be found for successful discrete
methods such as the finite integration technique and the finite difference time
domain. Thus, even a small step in the direction of a unifying approach to
these numerical schemes seems to be an important novelty. A framework in
which the previous concepts can fall into place could be considered a step
forward in the understanding of these classes of numerical methods.
However, is this method really new ? In the authors’ opinion, the answer
is again affirmative because, in spite of the many similarities it shares with
other discrete methods, it is based on a solid and general theoretical frame-
work which introduces some new features. The work of Tonti concerning
the classification of physical variables and their appropriate association with
space and time sets is, in fact, a solid theoretical background that many of
the previously numerical schemes share. In particular, its key point is the
application of a particular discrete simulation procedure that is based on the
coboundary process of algebraic topology, which has general validity since it
is not related to any particular branch of physics.
The aim of this text is therefore to present the cell method (CM), while
providing the needed theoretical links to Tonti’s work and paying particular
attention to the common treatment of different physical theories.
The first connection between the CM and Tonti’s ideas relies on its inti-
mate relationship with Tonti diagrams: in fact the CM transforms each block
of a Tonti diagram into a numerical representation, usually a matrix, in this
way making it suitable for direct computer implementation.
The other link of the CM with Tonti’s work is its ability to describe dif-
ferent physical phenomena with the same formalism. This quality can best
be exploited in the treatment of multiphysics problems in which the same
operators can be used for all the interacting phenomena to ensure a homoge-
neous treatment of all the physical aspects and a consistent computation of
the physical coupling terms.
3 Perot, J.B., Subramanian, V.: Discrete calculus methods for diffusion. Journal of Com-
putational Physics, 224 (2007)
Preface IX
1 Tonti Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Classification of the Physical Variables . . . . . . . . . . . . 1
1.2 Local and Global Variables . . . . . . . . . . . . . . . . . . 2
1.3 Cell Complexes . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Variables and Orientation . . . . . . . . . . . . . . . . . . . 4
1.5 A Note on Time . . . . . . . . . . . . . . . . . . . . . . . . 7
1.6 Tonti Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . 7
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2 Topological Equations . . . . . . . . . . . . . . . . . . . . . 11
2.1 The Numerical Scheme . . . . . . . . . . . . . . . . . . . . . 11
2.2 Cell Complexes . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.2.1 Basic Definitions of Algebraic Topology
and Cell Complexes . . . . . . . . . . . . . . . . . . 13
2.2.2 Coboundary Process . . . . . . . . . . . . . . . . . . 14
2.3 Topological Equations . . . . . . . . . . . . . . . . . . . . . 15
2.3.1 Incidence Numbers and Incidence Matrices . . . . . 16
2.4 The Cell Method for Stationary Heat Conduction . . . . . . 17
2.5 A Note for Practitioners . . . . . . . . . . . . . . . . . . . . 18
2.6 Links with Other Numerical Methods . . . . . . . . . . . . 19
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3 Constitutive Equations . . . . . . . . . . . . . . . . . . . . . 21
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.2 Example of a Constitutive Equation for a Simple
Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.3 Constitutive Equations for Orthogonal Grids . . . . . . . . 24
3.3.1 Case 1 . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.3.2 Case 2 . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.3.3 Constitutive Matrix Set-Up . . . . . . . . . . . . . . 27
3.4 Constitutive Equations on Tetrahedral Grids . . . . . . . . 29
3.4.1 Uniform Field . . . . . . . . . . . . . . . . . . . . . . 30
3.4.2 Non-uniform Field . . . . . . . . . . . . . . . . . . . 36
3.4.3 Whitney Interpolation . . . . . . . . . . . . . . . . . 39
3.5 Thermal Mass Matrix . . . . . . . . . . . . . . . . . . . . . 43
3.6 Boundary Conditions . . . . . . . . . . . . . . . . . . . . . . 44
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
XII Contents
5 Multiphysics Problems . . . . . . . . . . . . . . . . . . . . . 91
5.1 Coupled Problems . . . . . . . . . . . . . . . . . . . . . . . 91
5.2 Electro-thermo-mechanical Coupling . . . . . . . . . . . . . 92
5.2.1 Electro-thermal Coupling Term . . . . . . . . . . . . 92
5.2.2 Thermo-mechanical Coupling Term . . . . . . . . . . 93
5.2.3 Complete System of Equations . . . . . . . . . . . . 94
5.2.4 Example: MEMS Microbeam . . . . . . . . . . . . . 95
5.3 Induction Heating . . . . . . . . . . . . . . . . . . . . . . . 98
5.3.1 Eddy Current Numerical Formulation . . . . . . . . 99
5.3.2 Unstationary Thermal Problem . . . . . . . . . . . . 103
5.3.3 Test Case: Heating Inductor . . . . . . . . . . . . . . 105
5.4 Thermo-mechanical Coupling . . . . . . . . . . . . . . . . . 105
5.4.1 Thermal Model . . . . . . . . . . . . . . . . . . . . . 109
5.4.2 Structural Model . . . . . . . . . . . . . . . . . . . . 111
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
6 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . 115
6.1 Development Environment . . . . . . . . . . . . . . . . . . . 115
6.2 Anatomy of the Code . . . . . . . . . . . . . . . . . . . . . 116
6.3 Phase 1: Data Structures . . . . . . . . . . . . . . . . . . . 116
6.4 Phase 2: Material Properties . . . . . . . . . . . . . . . . . 120
6.5 Phase 3: Constitutive and Stiffness Matrices . . . . . . . . . 120
6.6 Phase 4: Sources . . . . . . . . . . . . . . . . . . . . . . . . 122
6.7 Phase 5: Boundary Conditions . . . . . . . . . . . . . . . . 123
6.8 Phase 6: Solution . . . . . . . . . . . . . . . . . . . . . . . . 124
6.9 Phase 7: Plotting Maps . . . . . . . . . . . . . . . . . . . . 125
6.10 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
6.11 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Chapter 1
Tonti Diagrams
Table 1.1 Classification of variables and role of constitutive equations for station-
ary heat transfer problems
Once this distinction has been established, the role of constitutive equations
in physical theories (see Table 1.1 for the case of heat conduction) emerges
naturally as:
Definition 4. Constitutive equations, which link configuration with source
variables and contain material and system parameters.
Table 1.2 Some local and global variables of stationary heat conduction
which they are defined. Furthermore, the notion of inner and outer orientation
(see Fig. 1.1), which is fundamental in global formulations, is largely neglected
in the differential setting. The inner orientation of a space entity is defined as:
V
L
P S
L̃
Ṽ P̃
S̃
L̃
P̃
3D S̃
Ṽ
L̃ P̃
2D
S̃
L̃ P̃
1D
Fig. 1.2 The outer orientation depends on the dimensions of the embedding space
• primal time instants (inner orientation) are one-to-one related to dual time
intervals (outer orientation);
• primal time intervals (inner orientation) are one-to-one related to dual time
instants (outer orientation);
S̃
P
L̃
L P̃
S Ṽ
τ̃n
τn τn+1
• Global configuration variables are associated with space and time elements
endowed with inner orientation;
• Global source variables are associated with space and time elements en-
dowed with outer orientation.
The rationale of this principle is that source variables are used in balance
equations which require the definition of normals. The association of variables
to complexes endowed with inner or outer orientation is shown in Table 1.3
for the case of stationary heat conduction . It should be noted that the
association to entities with inner or outer orientation is not arbitrary, but is
based on observation:
• temperature difference: requires a direction along a path (inner
orientation);
• heat production: associated to the “inside” of a region, requires normals
(outer orientation);
• heat current: requires a surface normal (outer orientation) to distinguish
between inflowing and outflowing heat
Table 1.3 Configuration and source variables for stationary heat conduction
problems
• In every physical theory there are physical laws that link the global vari-
ables that refer to an oriented space-time element with others that refer
to its oriented boundary (for instance Stokes and divergence theorems)
In the case of stationary heat conduction, the energy conservation law, shown
in Table 1.4, conforms to the second principle. Note that physical laws of this
type:
• link physical variables of the same kind, i.e. configuration variables are
linked to configuration variables and source variables are linked to source
variables;
• are valid in any medium and are free from material parameters;
1.5 A Note on Time 7
Law Statement
Energy conservation The heat current referring to the boundary of
a dual volume endowed with outer orientation
equals the heat production inside the dual vol-
ume in the same time interval
All the concepts presented in the previous sections allow the construction of
classification diagrams, i.e. graphical representations of physical theories in
which the role and relationships of variables, space and time entities, as well
as physical and material laws are explicitly represented [2]. The general form
of such a diagram is shown in Fig. 1.6 and its features are:
8 1 Tonti Diagrams
P, t̃ Ṽ , τ
P, τ̃ Ṽ , t
L, t̃ S̃, τ
L, τ̃ S̃, t
S, t̃ L̃, τ
S, τ̃ L̃, t
V, t̃ P̃ , τ
V, τ̃ P̃ , t
Fig. 1.6 Generic Tonti diagram. The vertical red lines represent topological oper-
ators (partial differential operators), the blue horizontal lines constitutive matrices
(constitutive equations), and the green lines time differences (time derivatives).
Constitutive relations that go from front to back layers represent irreversible laws.
• the quantities on the left side refer to the primal space and time entities,
while the quantities on the right side refer to the dual space and time
entities;
• the different vertical levels correspond to different space entities;
• the front and back planes host entities that refer to the same time entities
in each column;
• the vertical connections between levels represent the action of topological
laws;
• front-to-back connections on the same side represent the time difference
action;
References 9
The next two chapters present a description of how the topological and ma-
terial laws can be represented algebraically.
References
[1] Tonti, E.: The reasons for analogies between physical theories. Applied Mathe-
matical Modelling 1(1), 37–50 (1976)
[2] Tonti, E.: Discrete Physics,
http://www.dic.units.it/perspage/discretephysics/
(accessed December 4, 2012)
[3] Tonti, E.: On the mathematical structure of a large class of physical theories.
Rendiconti Accademia Nazionale dei Lincei, pp. 48–56 (1972)
[4] Hallen, E.: Electromagnetic Theory. Chapman & Hall (1962)
[5] Penfield, P., Haus, H.: Electrodynamics of moving media. M.I.T. Press (1967)
[6] Truesdell, C., Toupin, R.: The classical field theories. Springer (1960)
[7] Pauli, W., Thellung, A.: Vorlesung von Prof. Dr. W. Pauli über Elektrodynamik.
Verlag des Vereins der Mathematiker und Physiker an der E.T.H (1949)
[8] Dantzig, D.: Electromagnetism, independent of metrical geometry: The founda-
tions. Number v. 1. Koninklijke Akademie van Wetenschappen te Amsterdam
(1934)
Chapter 2
Topological Equations
Many partial differential equations are the local expressions of some sets of
integral laws which express the conservation of some quantities. If such con-
servation laws are not enforced on all the possible lines, surfaces, etc., but
only on those generated by a discretization mesh, one obtains a numerical
scheme with the desired conservation properties. However, something is obvi-
ously lost in the process: constitutive laws, as a rule, are not satisfied exactly:
this is where the discretization error lies (a basic problem of all approxima-
tion methods). In standard approaches of numerical methods for the solution
of physical problems, the path that is followed is the one shown in Fig. 2.1,
where a partial differential equation (PDE) is numerically integrated in order
to obtain an algebraic system of equations. Instead, in the cell method [2],
an approximate solution is obtained directly according to the scheme shown
in Fig. 2.2. The CM is based on some concepts that were presented in the
previous chapters, namely:
P. Alotto et al.: The Cell Meth. for Electr. Eng. & Multiphys. Prob., LNEE 230, pp. 11–20.
DOI: 10.1007/978-3-642-36101-2_2
c Springer-Verlag Berlin Heidelberg 2013
12 2 Topological Equations
always
Physical laws Algebraic equations Approximate solution
Finite Elements
...
Boundary Elements
rarely
Differential equations Exact solution
Fig. 2.1 The classical approach to the numerical solution of physical problems
always
Physical laws Algebraic equations Approximate solution
Finite differences
rarely
Differential equations Exact solution
Fig. 2.2 The cell method approach to the numerical solution of physical problems
The former are the subject of this chapter, while the latter will be examined
in chapter 3. It should be observed that, in the classical approach, differential
equations have become the “natural” way of describing physical problems.
However:
Cell complexes, which are tesselations of space (and time, depending on the
specific implementation), are a fundamental aspect of the CM, and their
features are described in this section. Although, in principle, any space and
time tessellation is admissible, it is convenient if the elements forming it have
a simple structure such as:
As will become clear later on, the duality of cell complexes is a central concept
of the CM. It should also be noted that the same ideas form the basis of
algebraic topology, as show in Table 2.1. Since algebraic topology, which
deals with cell complexes, provides a rigorous and rich framework which is
useful for the development of the CM, some basic notions are summarized in
the next subsection.
The faces of a p-cell are those (p − 1)-cells that are incident on that cell.
Fig. 2.3 shows the faces of an edge (1-cell), face (2-cell), and volume (3-cell).
The set of all the faces of a p-cell forms the boundary of that cell. (p− 1)-faces
are associated to p-cells by means of a proper incidence number.
The (p + 1)-cells that share a generic common p-cell are called cofaces.
Examples of cofaces are reported in Fig. 2.4. The set of all the cofaces of a
p-cell forms the coboundary of that cell. Now let us consider a general domain
partitioned by a set of p-cells ck , each one endowed with its own orientation
(inner/outer), denoted by an incidence number nk . The aggregate of the p-cell
ck and the incidence number nk is called chain.
ck nk
k
14 2 Topological Equations
1. for every p-cell, the value of the physical variable associated with it is
transferred to all the cofaces of the p-cell, with the correct incidence
number;
2. for every (p + 1)-cell all these values are added together. In this way
one obtains a new physical variable, with the same physical dimensions,
associated with every (p + 1)-cell. In this way, a new (p + 1)-cochain is
obtained.
2.3 Topological Equations 15
+1
f3 f4
+1
f2
-1
vkk
-1
f1
(c) vk = (−1)f1 +
(−1)f2 + (+1)f3 + (+1)f4
These steps are graphically represented in Fig. 2.5 . For example, let us
consider the discrete gradient operator. In terms of algebraic topology, this
operator is identical to the coboundary process operator that is applied to
the cochains of degree zero, i.e. the degrees of freedom allocated on a zero-
dimensional chain (point), resulting in a cochain of degree two, i.e. a degree of
freedom connected to a one-dimensional chain line (Fig. 2.5a). The cobound-
ary process is the theoretical background of all topological laws based on a
discrete gradient, curl and divergence. Since these operators are built as a
coboundary process, it is easy to understand why they can be represented by
incidence matrices. The most important consequence is that the coboundary
process is a purely topological operation, and it is thus not related to a spe-
cific physical theory but is common to different problems. When studying a
multiphysics problem, if the different fields share the same discretization, the
discrete operators that are representative of a gradient, curl and divergence
remain the same for all the problems.
As shown in the previous section the, coboundary process forms the basis of
the construction of topological equations, which are examined here in more
detail.
Fig. 2.6 shows the construction of the primal discrete gradient and dual
discrete divergence incidence matrices. Fig. 2.7 shows the construction of the
discrete primal and dual curl, while Fig. 2.8 shows the construction of the
primal discrete divergence and dual discrete gradient operators. Once all
the incidence numbers of a cell complex are assembled in a matrix, the
following discrete counterparts of the continuous differential operators are
obtained:
Ṽi Ṽj
Pi Lk Pj
d˜jk = −1 d˜jk = −gkj
T
d˜ik = +1
gki = −1 gkj = +1
S̃k
Fig. 2.6 Primal gradient and dual divergence
ckj = −1
Lj S̃j
c̃jk = −1 c̃ik = +1
Sk Li c̃kj = cT
L̃k jk
cki = +1
S̃i
Vk
dkj = −1 P̃k
dki = +1
Sj L̃j g̃jk = dT
kj
Si L̃i
g̃jk = −1
g̃ik = +1
CG = 0 (2.4)
C̃G̃ = 0 (2.5)
DC = 0 (2.6)
D̃C̃ = 0 (2.7)
These relations are the discrete counterparts of the well-known vector calculus
identities ∇ × (∇•) = 0 and ∇ · (∇ × •) = 0.
p Ṽ
P T
γ = GT p = D̃Φ
L γ Φ = −Mλ γ Φ S̃
• Tonti diagram: The previous step allows the construction of the Tonti dia-
gram for the problem at hand, which can be seen in Fig. 2.9. The cobound-
ary process states which matrices connect the global variables at different
levels of the diagram, while the construction of the material matrices is
described in the next chapter. It should be noted that the product of the
primal configuration variable γ and the dual source variable Φ in Fig. 2.9
does not give an energy, as prescribed by the Tonti’s theory. A perfect
match with theory can be established by resorting to the Tonti diagram
expressed in terms of entropy. However, in this formulation, Fourier’s law
does not appear in its usual form and it is therefore not commonly used
in engineering practice for stationary thermal problems.
• Matrix representation: Next, matrix equations are taken directly from
the Tonti diagram, and, for the stationary heat conduction problem, one
obtains:
D̃Φ = p (2.8)
γ = GT (2.9)
Φ = −Mλ γ (2.10)
• Final linear system: The previous equations, together with the identity
D̃ = −GT , allow the construction of the final system of linear equations:
GT Mλ GT = p (2.11)
• Postprocessing: After the previous system has been solved by means of a
suitable numerical technique for large sparse algebraic systems of equa-
tions, other quantities can be obtained very easily. For example, thermal
currents can be obtained by combining (2.9) and (2.10).
Table 2.2 Rules for the construction of the cell method formulation from a partial
differential equation
coboundary process and the theory of differential forms (see e.g. [5]), such
a construction can be obtained very quickly by applying simple rules to a
given partial differential equation. Such rules, which express a formal corre-
spondence between differential operators and incidence matrices and between
material laws and material matrices, are summarized in Table 2.2. It can be
seen that such rules allow one to derive (2.11) directly from the partial dif-
ferential equation for the thermal heat conduction problem:
The CM is similar to other numerical methods that are based on space and/or
time tessellations, and therefore shares the same strengths and weaknesses.
Without going into a detailed description of such similarities and their theo-
retical reasons, the reader should at least be aware that:
References
[1] Grady, L., Polimeni, J.R.: Discrete Calculus: Applied Analysis on Graphs for
Computational Science. Springer (2010)
[2] Tonti, E.: A direct discrete formulation of field laws: The cell method. Com-
puter Modeling in Engineering & Sciences 2(2), 237–258 (2001)
[3] Tonti, E.: The reasons for analogies between physical theories. Applied Math-
ematical Modelling 1(1), 37–50 (1976)
[4] Gross, P.W., Kotiuga, P.R.: Electromagnetic theory and computation: a topo-
logical approach. Mathematical Sciences Research Institute publications. Cam-
bridge University Press (2004)
[5] Deschamps, G.A.: Electromagnetics and differential forms. Proceedings of the
IEEE 69(6), 676–696 (1981)
[6] CST EM Studio, http://www.cst.com (accessed December 4, 2012)
[7] Hammond, P., Sykulski, J.K.: Tubes and slices: A new way of teaching the prin-
ciples of electric and magnetic fields. IEEE Transactions on Education 35(4),
300–306 (1992)
[8] Nédéelec, J.C.: Mixed finite elements in R3 . Numerische Mathematik 35(3),
315–341 (1980)
[9] Raviart, P., Thomas, J.: A mixed finite element method for 2nd order elliptic
problems. In: Galligani, I., Mayera, E. (eds.) Mathematical Aspects of the
Finite Element Method. Lecture Notes on Mathematics, pp. 293–315. Springer
(1977)
[10] Bossavit, A.: Computational electromagnetism. Academic Press (1998)
[11] Yee, K.S.: Discrete calculus methods for diffusion. IEEE Transactions on An-
tennas and Propagation AP-14, 302–307 (1966)
[12] Alotto, P., Perugia, I.: Matrix properties of a vector potential cell method for
magnetostatics. IEEE Transactions on Magnetics 40(2), 1045–1048 (2004)
Chapter 3
Constitutive Equations
3.1 Introduction
Constitutive equations constrain the behaviour of physical phenomena to the
characteristics of the media involved in the domain and, together with topo-
logical equations, they provide a unique solution of the field configuration.
As has already been pointed out, the structure of Tonti diagram requires
that these equations supply a link between global variables of a different na-
ture, that is, one source and one configuration variable. In other words, they
connect a couple of variables defined on dual entities, such as, for instance,
a temperature difference along the primal edge and a thermal flux on the
corresponding dual face.
As the geometric sets that define the variables are different, the link must
be effective on a region of space close to or surrounding them. As can be pre-
sumed, this intimate relationship between the material equations and space
also implies a dependance on the way in which the problem domain has been
discretized into cell complexes. The extrapolation of some local variation in
space of field quantities that depend on global variables introduces some de-
gree of arbitrariness: a hypothesis on the local variation of quantities has to
be defined, for instance, local uniformity of the fields. This hypothesis intro-
duces a first cause of uncertainty into the equation, since it arbitrarily assigns
behaviour that approximates the real one imposed by physics.
The second cause of uncertainty, which affects the constitutive equations,
resides in the quantitative evaluation of the physical properties of the medium
involved in the problem. Even though the basic mechanisms of interaction
of the fields with matter are often known, the characteristic parameters are
evaluated by means of experiments that have intrinsic sources of errors.
P. Alotto et al.: The Cell Meth. for Electr. Eng. & Multiphys. Prob., LNEE 230, pp. 21–47.
DOI: 10.1007/978-3-642-36101-2_3
c Springer-Verlag Berlin Heidelberg 2013
22 3 Constitutive Equations
and dl
thanks to the uniformity of the field variables and to the fact that E
are directed along the same direction. Equation (3.4) becomes:
= Lρ|J|
= Lρ j L
e = L|E| = ρ j = Rj (3.5)
S S
3.2 Example of a Constitutive Equation for a Simple Problem 23
j S
J
e
Fig. 3.1 Cylindrical resistor of cross section S and length L
where R is defined as the electrical resistance of the conductor, and its value,
thanks to the hypotheses, only depends on the geometrical data and on the
material properties of the conductor. As pointed out in the previous chapter,
the value of R is affected by errors for two different reasons:
• uncertainty on the field distribution: would the uniformity hypothesis also
hold close to the point in which the current is injected into the cylinder.
How would this non-uniformity region affect the computed value of R?
• resistivity value: are the actual conditions of the current flow problems
equal to those in which the parameter was measured? Are some corrections
needed?
The uncertainty of the value of the resistance R surely influences the solution
of the network problem.
The above described approach can also be used to define the value of
resistance in slightly different problems. In the case of a cylinder divided into
two sections, one of length L1 and the other L2 , with two different material
properties, ρ1 and ρ2 , as shown in Fig. 3.2, the current flows through two
materials. By applying the topological relation for two resistors connected in
series, an equivalent parameter can be obtained as:
L1 L2
R = R1 + R2 = ρ1 + ρ2 (3.6)
S S
In a similar way, if the cylinder were subdivided into two by a plane containing
its axis, see Fig. 3.3, and if the uniformity of the current density distribution
hypothesis is again applied, the two regions could be seen as two resistors
connected in parallel. In this case, it is much more efficient to formulate
the material characteristics in terms of the inverse of resistance so that the
equivalent value of conductance can written as:
S S
2 2
G = G1 + G2 = + (3.7)
ρ1 L ρ2 L
The previous basic concepts are used in analogy in the building of the
constitutive equation.
24 3 Constitutive Equations
L1 L2
j
S
e
Fig. 3.2 Cylindrical resistor made of two materials with interface parallel to the
base
1 L
S
2
j S
e
Fig. 3.3 Cylindrical resistor made of two materials with the interface along the
axis
3.3.1 Case 1
If reference is made to the thermal problem, it is necessary to write one
equation that links the temperature difference γ along the primal edge to the
thermal flux Φ defined on the dual face. As can be seen in Fig. 3.4, the two
dual quantities, primal edge and dual face, are characterized by their respec-
tively outer and inner orientations. The coherence of these two orientations
3.3 Constitutive Equations for Orthogonal Grids 25
Fig. 3.4 Primal edge and dual face: the orientation of edge (sense of the rotation
around it) and face (verse of the normal vector to it) are coherent
γ = Lgt (3.9)
By exploiting the collinearity of the normal component of the heat flux den-
sity vector and of the tangential component of the temperature gradient
vector, the constitutive equation can be written as:
Φn = −λgt (3.10)
by rearranging the terms, the constitutive equation can now be written as:
Φ γ S
= −λ ⇒ Φ = −λ γ (3.11)
S L L
S
The parameter λ L only depends on the space quantities and the material
characteristics and is the thermal conductance that links the dual variables
of the primal edge/dual face couple.
The thermal conductance parameter has been computed by considering
local uniformity of the fields. This hypothesis is arbitrary but it becomes
similar to the actual distribution of the field quantities when the dimensions
of the homogeneity region are made small. The discretization thus introduces
an error which, in the case of an arbitrary space distribution of the field,
26 3 Constitutive Equations
y
x
z
Fig. 3.5 Primal edge and dual face highlighted in the orthogonal mesh
can be made small by reducing the mesh dimensions. The homogeneity of the
material characteristics λ, in the region surrounding the primal edge/dual face
couple, cannot be satisfied if the primal edge lies on a material interface. As
shown in Fig. 3.5, the dual face linked to the primal edge is shared by different
cells. Looking at the mesh reported in Fig. 3.5, in the plane containing the
dual face, as reported in Fig. 3.6, it can be observed how this face would be in
four different primal cells (identified by hollow dual nodes). If the materials
of these cells are different, that is, the primal edge belongs to the interface
between at least two different media, the situation is different from that
reported in Fig. 3.4. In this case, the relation that links the temperature
difference along the primal edge to the heat flux on the dual face should take
into account this new situation. The example presented in Fig. 3.3 can be
used for the computation: by considering that each of the four portions of
the dual face takes on the characteristic of the material of the cell to which
it belongs, the four contributions can be computed on their own and then
aggregated as if they were four thermal conductances connected in parallel
and summed as in (3.7).
3.3.2 Case 2
A material relation that links a quantity on a primal face with one on a dual
edge can, in case of material homogeneity, be treated in exactly the same way
as in the previous case. The situation is slightly different when the primal face
would act as an interface between two cells of different materials. As shown
in Fig. 3.7, the dual edge is shared by two primal cells: if the materials of
these cells are different, then material homogeneity would be lost. In this case,
the computation of the material parameter can resort to the case reported in
3.3 Constitutive Equations for Orthogonal Grids 27
y
z
x
Fig. 3.6 Interaction between the primal mesh and the dual face for the same mesh
shown in Fig. 3.5. Material 1 dashed, material 2 dotted
y
x
z
Fig. 3.7 Interaction between the primal face (light grey) and the dual edge (dashed
line)
Fig. 3.2, in which the two parts of the dual edge can be computed with the
material characteristics of the corresponding cell and are then summed as if
they would be for two series of connected resistors.
Thanks to the orthogonality of the mesh, the heat flux on a dual face only
depends on the corresponding temperature difference on the primal edge, as
in (3.11). This allows one to state that matrix Mλ is a diagonal matrix. This
property is shared by all constitutive matrices defined on orthogonal meshes.
The computation of the constitutive matrix in orthogonal meshes can be
performed by means of formulas like the one in (3.11). This computation can
therefore be performed by running a loop, for instance, along all the primal
edges and storing the corresponding parameters on the diagonal of the ma-
trix. In the presence of material interfaces, the need to split the computation
of the material coefficient into sub-portions of the space entity, as previously
explained, can make it more convenient to approach the set-up in another
way: by looping along all primal volume cells, the material parameters, due
to the sub-portions of the dual entities contained inside the cell, can be com-
puted. The contributions can then be summed in the proper matrix position.
This approach can involve a slight drawback, due to the local orientation
of the geometric entities. On the basis of the Möbius rule, the orientations
of two adjacent faces are opposite on the common dual edge, for example,
when the kth face, shown in grey in Fig. 3.8, is shared by the ith and jth
primal cells. Because of the different local orientations of the cells, the face
will have the same orientation as that of the ith cell but will have the opposite
orientation of the jth one. The information on the interaction between the
local orientation of the face and its global one is contained in the incidence
matrix, which will have χik = +1 for the ith cell and χjk = −1 for the jth
one in the volume-face incidence matrix.
The summing of the all constitutive parameters ck should take into account
this fact and the corresponding sum of the two components should be written
as:
(i) (j)
ck = χik ck + χjk ck (3.13)
kth face
orientation
ith cell jth cell
local orientation
Fig. 3.8 Primal face in grey shared by two primal cells
3.4 Constitutive Equations on Tetrahedral Grids 29
(i) (j)
where ck and ck are contributions to the material coefficients of kth face
due to the ith and the jth cell respectively.
A simple pseudocode for the constitutive matrix set-up process is shown
in Algorithm 1.
For the constitutive equation, in the thermal case, a link must be found
between: the temperature differences γ defined along the primal edges and
the thermal fluxes Φ along the linked dual faces. As in the case of an or-
thogonal mesh, the constitutive matrix is usually built on an element-wise
basis, so that the computation must link the temperature difference along
the primal edge to the portion of the dual face that is contained inside
the tetrahedron, as shown in Fig. 3.9. Despite the geometric complexity of
the dual complex, it should be pointed out that the portions of the dual
faces (four point polygons) lye on a plane. This particular geometric prop-
erty can easily be proved by considering that all the vertices of the part of
the dual face are obtained as middle points of a simplex geometrical shape.
The local constitutive matrix is thus built by linking the six primal edge
3.4 Constitutive Equations on Tetrahedral Grids 31
e1 e3
e2
e5
e4 e6
Fig. 3.9 Tetrahedral primal cell, ei are edges shown together with portion of dual
cell contained inside tetrahedron (highlighted in grey the portion of dual face linked
to edge e1
e1 e3
e2
f1 e5
e4 e6
Fig. 3.10 Tetrahedral primal cell, ei edges, are partitioned in tree edges (solid line)
and co-tree branches (dashed line)
γ1 − γ4 − γ2 = 0 ⇒ γ4 = γ1 − γ2 (3.14)
32 3 Constitutive Equations
γi = g · L
i = gx Lix + gy Liy + gz Liz (3.15)
where L i , (i = 1, 2, 3) is the primal edge vector directed along the ith edge
with length Li as its absolute value. In matrix form, the geometric data of
the edge can be written as:
⎡ ⎤
L1x L1y L1z
⎢ ⎥
L=⎢ ⎣ L2x L2y L2z ⎦
⎥ (3.16)
L3x L3y L3z
γ3 = Lg (3.17)
by inverting matrix L:
g = L−1 γ3 = Pγ3 (3.18)
where γ3 is the array of three independent γ values. In order to write a system
of equations in which all six temperature differences along the primal edges
belonging to the tetrahedron would appear, a fictitious matrix Pa can be
defined, starting from P, and adding three columns of zeros in correspondence
to the dependent γ values. By considering a linear homogeneous material that
fills the primal volume with thermal conductivity λ, the heat current density
q inherits the uniformity property from the gradient one and can be obtained
as:
q = −λg
(3.19)
This vector should be integrated on the portion of dual faces to obtain its
flux over them. Because of the previously introduced planarity of the portion
of dual faces, this operation can be performed by projecting onto the area
vectors of the portion of dual faces contained inside the primal volume and
written in S̃, the the heat flux vector can be obtained as:
Φ = S̃λPa γ = Mλ
(loc)
γ6 (3.20)
3.4 Constitutive Equations on Tetrahedral Grids 33
where γ6 is the local array of all six temperature differences of the tetrahedron
(loc)
and matrix Mλ in (3.20) is a local 6 × 6 matrix whose entries must be
inserted inside global Mλ matrix.
(loc)
It should be pointed out that, in general, matrix Mλ is a full matrix
that links all six temperature differences to all the heat fluxes. This is due to
the lack of orthogonality between the dual entities. This characteristic leads
to a global constitutive matrix which is no longer diagonal but sparse. Matrix
(loc)
Mλ is positive definite but is not usually symmetric.
By considering that the local six entry flux vector Φ is related to the
global one, by means of a proper change in orientation, the contribution of
the local thermal conductance matrix can be taken into account correctly.
This operation can be performed by introducing a local diagonal incidence
matrix χ(loc) whose dimensions are 6×6. Since the orientation of the dual face
is inherited by the one of the primal edge linked to it, the local orientation
matrix contains the following information:
(loc) +1 if jth edge has congruent global/local orientation,
χjj = (3.21)
−1 if jth edge has opposite global/local orientation
Matrix χ(loc) can be used to link local flux Φ to the global one Φ as:
where Φ is the portion of the thermal flux with global orientation, and
which can be introduced into 3.20 as:
Φ = χ(loc) Mλ
(loc)
γ6 (3.23)
the global temperature difference can be written as function of the local one
as:
γ = χ(loc) γ6 (3.24)
and owing to the structure of matrix χ(loc) , the matrix is equal to its inverse,
so that:
γ6 = (χ(loc) )−1 γ = χ(loc) γ (3.25)
(loc)
Φ = χ(loc) Mλ χ(loc) γ = Mλ γ
(loc)
(3.26)
(loc)
the terms of the newly defined Mλ are now ready for insertion into the
global matrix Mλ , an this is obtained by summing them with the entries that
correspond to the same dual couple introduced in (3.7).
34 3 Constitutive Equations
f2
f1 f3
f4
Fig. 3.11 Tetrahedron used as a primal volume with portions of dual edges (dashed
lines) belonging to it
where b is the reduced flux vector when b4 has been removed. By inverting
the 3 × 3 matrix S, the value of the uniform magnetic flux density inside the
primal volume can be obtained as:
B = S−1 b = Qb (3.31)
h = L̃νQa b = M(loc)
ν b (3.34)
The use of a magnetic flux on the faces of the tetrahedron, together with
the use of a uniform field hypothesis, ensures that the normal component of
magnetic flux density is continuous across the cell boundaries.
Matrix M(loc)
ν of (3.34) is a local 4 × 4 matrix whose entries must be
inserted inside global Mν a square matrix of dimensions equal to the number
of primal faces in the mesh, to obtain the final constitutive equation in the
form:
h = Mν b (3.35)
Local and global orientations of the geometric entities can be dealt with as
in the previous case of a thermal field.
H −M
= νB (3.36)
where M is a term that has the same physical dimensions as the magnetic
field and phenomenologically takes into account the property of permanent
36 3 Constitutive Equations
Br
−Hc H
magnets which are able to create a magnetic field, even in the absence of
external sources. This additional magnetic source is considered to be known
from the material characteristics [5]. In the case of a permanent magnet with
a linear characteristic in the second quadrant of the H − B plane defined by
residual magnetization Br and coercive field Hc , as shown in Fig. 3.12, the
absolute value of magnetization can be obtained from the material charac-
teristics as:
M = (μr − 1)H − μr Hc (3.37)
where μr is the relative permeability of the material which can be computed
from the slope of the characteristic as:
Br
μr = (3.38)
μ 0 Hc
In the case, which is often found in practice, in which μr = 1, the magnetiza-
tion coincides, apart from the sign, with the coercive field Hc . This material
dependent source of the problem should be assigned to the dual complex,
since it will contribute to Ampere’s law, and the magneto-motive force due
to magnetization along a generic dual edge k, can easily be obtained by line
integration as:
hMk = M
· dl (3.39)
L̃k
As a consequence, the global constitutive equation can be obtained:
h = Mν b − hM (3.40)
dual volume i
primal
volume j
micro-cell
node i
Fig. 3.13 Definition of a micro-cell in a two dimensional domain as the intersection
of dual volume i with primal cell j
not always hold. This is the case, for instance, of time-varying field in which
electromagnetic induction must be considered. If the electric field is not ir-
rotational, all six voltages of the primal edges are independent, so that a
uniform electric field can no longer represent them anymore. In this case, a
higher order interpolation must be used inside the volume. This can be done
either by defining more than one uniform value inside a tetrahedron or by
using at least an affine interpolation law: in the former case the constitutive
matrix can be computed by means of the micro-cell approach [4], while in
the latter case it can be computed by some interpolating functions defined
inside the tetrahedron [7].
Micro-cell Approach
where J and E are the current density and electric field vector, respectively,
and ρ is the electrical resistivity of the material, a link between the cur-
rents on dual faces and the voltages on primal edges must be set. Using the
micro-cell approach, it is assumed that the current density vector is uniform
inside each micro-cell, so that four vectors are considered (Jα , Jβ , Jγ , Jδ )
for a tetrahedron. By considering a linear homogeneous material, four uni-
form values of the electric field can be obtained by multiplying the electric
38 3 Constitutive Equations
micro-cell α
γ
α
δ
Fig. 3.14 Definition of a microcell in a tetrahedron
β
k
ge
ed
edge n γ
α
edg
ej
δ
Fig. 3.15 Microcell α and its global variables
where S̃ α coefficients are components of area vectors like the one defined in
equation (3.29), however this time they refer to parts of a dual face contained
α
inside a primal volume. By inverting the 3 × 3 matrix S̃ , the current density
can be obtained as:
3.4 Constitutive Equations on Tetrahedral Grids 39
⎡ ⎤ ⎡ ⎤
Jxα jk
⎢ ⎥ ⎢ ⎥
⎢ J α ⎥ = (S̃α )−1 ⎢ j ⎥ (3.43)
⎣ y ⎦ ⎣ j ⎦
Jzα jn
Once the current density vector has been obtained, it should be considered
that only a portion of the primal edge is contained in the micro-cell, for
instance as shown in Fig. 3.15, where half of edge k is contained in micro-cell
α and the other half is in the β cell. By considering that the integral of the
electric field along the primal edge is additive, its voltage can be written as:
β
ek = eα
k + ek (3.44)
where eαk is the line integral of the electric field along the part of the primal
edge k that is contained inside micro-cell α. The contribution of micro-cell α
to the voltages on edges k, j and n can be computed as:
α
eα = Lα ρ(Sα )−1 j (3.45)
α
where j is the sub-set of currents belonging to the αth micro-cell, Lα are
vectors directed along the edges incident to node α and whose measure is
equal to the mid edge length. Equations like (3.45) can be written for the
other micro-cells of the tetrahedron. Once all these terms have been written,
a complete matrix is obtained for tetrahedron by exploiting additivity of the
voltages. For example, by looking at (3.44) and considering, for the sake of
simplicity, electric resistivity as a scalar value, one obtains:
ek = eα + eβ = ρ Lα (Sα )−1 jα + Lβ (Sβ )−1 jβ (3.46)
• scalar quantities associated with nodes (e.g. electric scalar potential, tem-
perature) can be interpolated by means of the classic Lagrange nodal basis
function wkN (r) which is an affine function inside the simplex that is equal
to 1 at node k and zero at the others (see Fig. 3.16a);
• vector quantities associated with edges (e.g. electric field, temperature gra-
dient) can be interpolated with Nedéléc edge elements (see Fig. 3.16b):
E
w
m (r) = wkN (r)∇whN − whN (r)∇wkN ; (3.48)
where h and k are the nodes that bound the mth edge.
• Whitney facet elements (see Fig. 3.16c) are used to interpolate vector quan-
tities associated with faces (e.g. magnetic flux density):
iF (R)
w = 2 wN (r)∇wN × wN (r)+
h k l
wkN (r)∇wlN × whN (r) + wlN (r)∇whN × wkN (r) (3.49)
where xi , i = 1, . . . , 6 are the degrees of freedom. The voltage value along the
jth edge is:
6
6
E
ej =
E · dl = w
i xi · dl = xi iE · dl
w = xj (3.52)
Lj Lj i=1 i=1 Lj
Similarly, for magnetic flux density, the continuity of the normal component
of the magnetic flux density ensures the use of magnetic fluxes as degrees of
freedom:
1 if i = j 4
F
w
j · dS = ⇒ B(
r) = iF (r)bi
w (3.53)
Si 0 if i = j i=1
3.4 Constitutive Equations on Tetrahedral Grids 41
Elements of the constitutive matrices can be built, on the basis of the point-
wise constitutive equation by means of interpolation with Whitney elements.
Considering, for example, the electric problem, the electric flux through the
jth portion of dual face S̃j inside a tetrahedron is:
6
dj = D =
· dS εE =
· dS ε iE ei
w
· dS (3.54)
S̃j S̃j S̃j i=1
6
6
= ei iE · dS
εw = mε,ji ei (3.55)
i=1 S̃j i=1
42 3 Constitutive Equations
In (3.54), the flux dj is obtained as a linear combination of all the voltages
along the edges of the tetrahedron. The local contribution to the constitutive
matrix are the coefficients:
mε,ji = iE · dS
εw (3.56)
S̃j
The constitutive matrix that links magnetomotive forces along the dual edges
to magnetic fluxes through the primal faces can be built using a similar pro-
cedure, by locally calculating the magnetomotive force along the jth portion
of the dual edge L̃j inside a generic tetrahedron:
4
h =
j H =
· dl νB =
· dL ν F bi · dL
w (3.57) i
L̃j L̃j L̃j i=1
4
4
= bi iF · dL
νw = mν,ji bi (3.58)
i=1 L̃j i=1
The final assembled constitutive matrix is not symmetric. This might not be
a problem, because its nonsymmetric part can vanish in the multiplication
with the topological operator matrices [12].
A different way of building the constitutive matrix is to ensure that the energy
calculated as the volume integral of the energy density in each element W is
equal to the discrete energy calculated by resorting to global quantities. For
electric problems
1
6
We = ei di (3.60)
2 i=1
For the generic mth tetrahedron, the energy density is
1 1
D · E = εE
we = ·E (3.61)
2 2
By using interpolator (3.51), the total energy becomes:
6 ⎛ 6 ⎞
1
We = ε iE ei · ⎝
w w jE ej ⎠ dV
2 Vm i=1 j=1
⎛ ⎞
1
6 6
E ⎝ E ⎠
= ei εwi · j ej dV
w (3.62)
2 i=1 Vm j=1
3.5 Thermal Mass Matrix 43
Imposing equality of (3.62) and (3.60), the following definition of electric flux
holds: ⎛ ⎞
6
di = iE · ⎝
εw jE ej ⎠ dV
w (3.63)
Vm j=1
and using (3.53), it is easy to obtain the local term of constitutive matrix:
mν,ji = jF · w
νw iF dV (3.66)
Vm
U = U0 + ρcT (3.67)
where ρ is the density of the material and c its thermal capacitance. The
internal energy in each portion of the jth dual volume that belongs to a
tetrahedron is given by:
uj = U0 dV + ρcT dV = u0 + ρcT dV (3.68)
Ṽj Ṽj Ṽj
44 3 Constitutive Equations
where Ti are the nodal temperatures. Neglecting the constant term u0 , for
the sake of simplicity, each term in the local constitutive matrix has the form:
mρc,ji = ρcwiN dV (3.70)
Ṽj
This approach is the same as the well known technique of mass lumping,
which is common in finite elements [13].
T = T2
T = T1
Fig. 3.17 Thermal problem made by a hollow rectangle with an imposed value of
temperature of both inner and outer boundary: the iso-value lines of temperature
are shown
T = T2 A
T = T1
B B
A
Fig. 3.18 Geometrical and physical symmetries with respect to lines AA and BB
A T = T2 B
F T = T1 E
D C
Fig. 3.19 Reduced computational domain
2
1 3
1 3 direction of
temperature
2 gradient
isovalue lines
of temperature
Fig. 3.20 Dual cell (in red) relevant to a primal node on a ∇T · n = 0 boundary:
solid lines are part of the mesh, dashed lines are parts lying outside of the meshed
domain
which is equivalent to writing the equation only for the portion of dual volume
that lyes inside the mesh, that is:
Φ1 + Φ2 + Φ3 = 0 (3.73)
Thus, from the implementation point of view, nodes lying on boundaries with
∇T · n = 0 can be treated in the same way as bulk ones, without setting any
additional constraints. The main characteristics highlighted in the previous
example can be extended to other physical fields, taking into account the zero-
tangential and zero-normal condition that have to be applied to a gradient
field on symmetry boundaries.
References
[1] Bossavit, A., Kettunen, L.: Yee-like schemes on staggered cellular grids: A
synthesis between FIT and FEM approaches. IEEE Transaction on Magnet-
ics 36(4), 861–867 (2000)
[2] Bossavit, A.: Generating whitney forms of polynomial degree one and higher.
IEEE Transaction on Magnetics 38(2), 341–344 (2002)
[3] Codecasa, L., Specogna, R., Trevisan, F.: Symmetric positive-definite constitu-
tive matrices for discrete eddy-current problems. IEEE Transactions on Mag-
netics 43(2), 510–515 (2007)
[4] Marrone, M.: A new consistent way to build symmetric constitutive matrices
on general 2-d grids. IEEE Transactions on Magnetics 40(2), 1420–1423 (2004)
[5] Binns, K.J., Lawrenson, P.J., Trowbridge, C.W.: The analytical and numerical
solution of electric and magnetic fields. Wiley (1995)
[6] Giuffrida, C., Gruosso, G., Repetto, M.: Finite formulation of nonlinear
magneto-statics with integral boundary conditions. IEEE Transactions on
Magnetics 42(5), 1503–1511 (2006)
[7] Repetto, M., Trevisan, F.: Global formulation for 3D magneto-static using
flux and gauged potential approaches. Int. Journal on Numerical Methods in
Engineering 60, 755–772 (2004)
[8] Whitney, H.: Geometric Integration Theory. Princeton University Press,
Princeton (1957)
[9] Bossavit, A.: Computational electromagnetism. Academic Press (1998)
[10] Schuhmann, R., Schmidt, P., Weiland, T.: A new whitney-based material oper-
ator for the finite-integration technique on triangular grids. IEEE Transaction
on Magnetics 38(2), 409–412 (2002)
[11] Castillo, P., Koning, J., Rieben, R., Stowell, M., White, D.: Discrete differen-
tial forms: A novel methodology for robust computational electromagnetics.
Technical Report UCRL-ID-151522, Lawrence Livermore National Laboratory
(2003)
[12] Alotto, P., Perugia, I.: Matrix properties of a vector potential cell method for
magnetostatics. IEEE Transactions on Magnetics 40(2), 1045–1048 (2004)
[13] Alotto, P., Specogna, R., Trevisan, F.: A θ-method for eddy currents in time-
domain with a discrete geometric approach. IEEE Transaction on Magnet-
ics 42(4), 779–782 (2006)
Chapter 4
Classical Physical Problems
P v 0 Ṽ
e = −Gv 0 = D̃j
L e j = Mσ e j S̃
Fig. 4.1 Tonti diagram of the current flow problem: jS is the imposed current
density that simulates the neural electrical activity
Thus, the analogy with Tonti diagrams of physical theories is limited to the
classification of the electric quantities and the subdivision of the topolog-
ical and constitutive equations. The notation is such that v is the vector
of the node-to-datum voltages, v are the branch voltages, j are the branch
52 4 Classical Physical Problems
Fig. 4.3 Active region in which brain activity took place during the experiment
currents, and i are the mesh currents. The branch-to-node incidence matrix
AT is identical to the discrete gradient G, while the mesh-to-branch matrix
M is the discrete curl matrix C. If the network is solved, with respect to the
node-to-datum voltages, the nodal analysis equation becomes:
AGAT e = 0 (4.3)
Fig. 4.4 Isolevel lines of the electric scalar potential distribution on the scalp due
to a current dipole being placed in the centre of the active area
v 0
e = AT v 0 = Aj
j = Ge
e j
e = Rj
0 = Me j = MT i
0 i
Even though the analogy between fields and circuits is not always as simple
as expressed in the previous points, and can be much more complicated to
explain in the presence of inductive and capacitive parameters’, students,
who are used to operating with node and mesh analysis methods, can make
use of their knowledge of the numerical analysis of circuits for the numerical
study of fields using only matrix operations.
4.2 Magnetostatics
• Ampère’s theorem, which links the electric current to the magnetic field;
• solenoidality of the magnetic flux density.
The global physical variables that are involved in the formulation are:
L a j S̃
b = Ca j = C̃h
S b h = Mν b h L̃
quite stringent for practical problems because it imposes that current carry-
ing sources must be removed from the problem domain. Furthermore unicity
of the scalar potential values requires that the problem domain should be
simply connected so that the removal of current conducting regions often
conflicts with this requirement. Even though this operation is possible, it has
been used extensively in the first numerical solutions of magnetic fields [8],
and it is still used for particular applications [9], the majority of magneto-
static field formulations are currently written in terms of the magnetic vector
potential. The magnetic vector potential is connected to the magnetic flux
density and thus is a configuration variable. The definition of the magnetic
vector potential, in differential terms, is related to the curl operator, and the
corresponding global variable is associated to primal edges. The full scheme
of the Maxwell equations, in the case of magnetostatics, can be simplified as
shown in Fig. 4.6. The equations that govern the problem can therefore be
expressed as:
CT h = j (4.5)
Ca = b (4.6)
h = M ν b − hM (4.7)
CT Mν Ca = j + CT hM (4.8)
The solution of the previous equation is not unique, since an arbitrary gradi-
ent field can be added to the magnetic vector potential distribution without
changing the magnetic flux density, as can be seen in (4.6). This is a well
known problem in differential formulations and their numerical solution has
been treated and solved by means of different gaugings of the solution, see
for instance, [10].
The problem can also be solved in terms of finite formulation of the mag-
netostatic field by looking at the number of physical degrees of freedom that
56 4 Classical Physical Problems
the solution has. Given a discretization with nF primal faces and nV primal
volumes, the number of degrees of freedom of the solution is equal to the
maximum number of linearly independent fluxes. This number is equal to
nF − nV , since a conservation of flux equation can be written for each primal
volume thus constraining one value of the flux to be linearly dependent on
the other fluxes of the primal volume faces (see (3.28)).
The number of independent fluxes can be expressed by means of the well
known Euler characteristics:
nV − nF + nE − nN + 1 = 0 ⇒ nF − nV = nE − (nN − 1) (4.9)
the number nN − 1 is the number of edges that belong to a tree, therefore the
solution can be made unique by using only the co-tree edges a as unknowns
and setting the tree edges to zero. Complete proof of this statement can be
found in [11].
(a) (b)
vector Q. Q is made of {0, 1, −1}, and if the edges do not belong to the
cut-set, it crosses the cut surface positively or negatively (see Fig. 4.7). An
unknown fictitious voltage e0 is applied to the cut edges [17]. The resulting
constitutive equation is modified as:
j = Mσ (e + Qe0 ) (4.13)
An integral constraint is then imposed on the cut currents to obtain the total
current j0 :
QT j = j0 (4.14)
These equations are coupled with those of the current field problem, and the
following is obtained:
GT Mσ G −GT Mσ Q v 0
= (4.15)
−QT MTσG QT Mσ Q e0 j0
where S̃k is the total dual kth surface (Fig. 4.8). This process generates a
vector of currents that does not in general comply with (4.12). Solenoidality
of the current is enforced by resorting to tree-cotree decomposition of the
primal edges (one-to-one linked with dual faces).
Let T be a spanning tree of the graph G made of primal nodes and primal
edges of the conductor mesh, and C the associated cotree. If nN is the number
of nodes and nE is the number of edges, T is made up of nN −1 edges, whereas
4.2 Magnetostatics 59
From a circuit analysis point of view, (4.19) is Kirchhoff’s current law applied
to the nN nodes of the primal mesh. According to a common result of the
circuit theory [5], only nN −1 of these equations are linearly independent, thus
one arbitrary equation can be removed. The resulting (nN −1)×(nN −1) linear
system can be solved in order to calculate the tree currents that automatically
satisfy (4.12). The final result is then rescaled in order to impose the total
current j0 through the conductor cross section:
j0
j = jn (4.20)
QT j n
As far as computational complexity is concerned, the following theorem holds:
Theorem 1. The computational cost to solve (4.19) is O(nN ).
Proof. The proof consists of two steps. The first step has the aim of proving
that the matrix D̃T reduced by one row is the permutation of a triangu-
lar matrix. Given a generic tree with nN nodes and nN − 1 edges (see e.g.
Fig. 4.9), the edges and nodes can be labelled as follows:
• The process starts from a node that is the vertex of only one edge. This
node is labelled with N and the incident edge is labelled with nN − 1.
• The remaining incident node is labelled with nN − 1.
• Each edge that is incident to node nN − 1 is then labelled as nN − 2, nN −
3, . . . and the opposite vertices are labelled as nN − 2, nN − 3, . . . .
60 4 Classical Physical Problems
8 5
8 5
7 4 1
9 1
4
7
6
2
3
6 2
3
Fig. 4.9 Oriented graph. The tree edges are in red.
• The process is repeated until all the nodes and edges are labelled.
By referring to the example in Fig. 4.9, the corresponding D̃T is:
⎡ ⎤
−1
⎢ ⎥
⎢ −1 ⎥
⎢ ⎥
⎢ ⎥
⎢ +1 ⎥
⎢ ⎥
⎢ +1 +1 −1 +1 ⎥
⎢ ⎥
⎢ ⎥
D̃T = ⎢ −1 −1 ⎥ (4.21)
⎢ ⎥
⎢ −1 ⎥
⎢ ⎥
⎢ ⎥
⎢ +1 +1 +1 ⎥
⎢ ⎥
⎢ −1 −1 ⎥
⎣ ⎦
+1
This process guarantees that the vertices of an arbitrary edge are labelled
with numbers that are greater than or equal to the label of the edge. If node
nN is removed, the resulting matrix is a lower triangular, full rank square
incidence matrix. The cost of solving a triangular system is O(n2N ), but since
the matrix has only two nonzeros per column, the overall complexity reduces
to O(nN )
z
50 27 50
1.7
center pole
25
coil
yoke
25
98.5
100
25 18 1
1.7
1.5
25
Fig. 4.10 TEAM problem 20: front view of the magnetic structure. The dimensions
are in millimeters.
and yoke are made of steel. The coil is excited by a dc current. The ampere-
turn values are 1000, 3000, 4500 and 5000 A, which are high enough values,
to saturate the steel. The problem is that of calculating the magnetic field
and electromagnetic force. The problem is solved in the model reported in
Fig. 4.12, which is made up of 79839 tetrahedra and 97885 edges. The system
matrix is only factorized once. The four different magneto-motive force values
are obtained through a simple re-evaluation of the known term. The number
of nonlinear iterations required to reach a relative accuracy of 10−4 is different
from case to case, depending on the saturation level, and ranges from 100 to
140. The computational time of the different phases are reported in Table 4.2
and refers to a standard notebook with Intel Core 2 Duo at 2.4 GHz and
4 GB of RAM.
y
coil
yoke
25
10 x
39
center pole
75
Fig. 4.11 TEAM problem 20: cross section of the magnetic structure. The dimen-
sions are in millimeters.
Fig. 4.12 TEAM problem 20: discretization used for the TEAM 20 problem
4.2 Magnetostatics 63
Fig. 4.13 Details of the union of the dual surfaces used to integrate Maxwell’s
stress tensor
the mesh, due to local inaccuracies of the computed values of the magnetic
flux density.
Once the solution has been obtained, force computation is performed at
the post-processing level by specifying a surface that encloses the body on
which the force has to be computed [7]:
F = T · ndS (4.22)
S
The components of the Maxwell stress tensor are defined using the flux den-
and its components along the three coordinate axes:
sity B
⎡ ⎤
Bx2 − 12 B 2 Bx By Bx Bz
1 ⎢⎢ By Bx
⎥
⎥
T = ⎣ By2 − 12 B 2 By Bz ⎦ (4.23)
μ0
Bz Bx Bz By Bz − 2 B
2 1 2
When applied to the described TEAM problem 20, to obtain the force acting
on the moving central part, the closed surface is obtained through the union
of the dual facets that enclose the object under computation. Fig. 4.13 shows
the union of these dual faces enclosing the central iron parallelepiped. Each
dual surface is decomposed into planar quadrilateral patches that lie inside
the tetrahedra. A one point Gaussian integration rule is adopted for each of
these surfaces, since the magnetic flux density is uniform inside the cells.
It is worth noting that, by using the fixed point technique for the nonlinear
solution, only has to be factorized once. The solution time in Table 4.2 refers
to a non linear iteration. Furthermore, the time required for the integration
64 4 Classical Physical Problems
90
80
70
60
Force (N)
50 reference
center pole
40 yoke
30
20
10
0
1000 1500 2000 2500 3000 3500 4000 4500 5000
Current (A)
Fig. 4.14 TEAM problem 20: comparison between the computed and measured
force values
4.3 Elastostatics
Considering an object in space, each point of its volume has a defined position
with respect to the reference frame. When a force acts, the position of each
point can change, due to two effects:
• rigid body motion, i.e. rototranslation in the space
• deformation of the body shape
Displacement is defined as the difference in position of the same point before
(x, y, z) and after (x , y , z ) an external action
⎡ ⎤
x − x
⎢ ⎥
u=⎢
⎣ y −y ⎦
⎥ (4.24)
z − z
By studying the two parts of the displacement, it is possible to note the rigid
displacement and its two important components. Rigid displacement can in
fact be divided into two contributions: rigid rotation and rigid translation.
Rigid translation consists of the motion of a body along a direction that
does not cause a change of the body shape or volume. As an example, see
Fig. 4.15, the shape and volume of a rectangle do not change during transla-
tion, as the edges remain parallel to each other and have the same dimensions.
Rigid rotation is the dual concept of rigid translation. A body is rotated
around a point, without its shape or volume changing. In the same rectangle
in Fig. 4.15, it can be seen that rigid rotation consists of a change in posi-
tion of all the edges, which do not remain parallel to each other, but whose
lengths remain unchanged before and after rotation, as shown in Fig. 4.16.
Deformation of the body shape is the other component of body motion. In
this case, the volume and the shape of the body change. It is possible to note
two components of body deformation, one due to a change in dimensions,
without a change in shape, called expansion or compression, and one due to
a change in the body shape, without any modification of the volume, named
distortion. Fig. 4.17 and 4.18 show these basic concepts. All the motion con-
tributions can be analytically expressed on the basis of a study of the image
in Fig. 4.19. Considering two initial points, P and Q, the distance between
the two initial points is U . Let us now consider the motion of point P in P
and describe this using the vector dUP and, in the same way, the motion of
point Q in Q is depicted by the vector dUQ . The distance between the final
66 4 Classical Physical Problems
x
Fig. 4.15 Definition of rigid translation
x
Fig. 4.16 Definition of rigid rotation
and simplifying
dh = dUP − dUQ (4.26)
4.3 Elastostatics 67
L
x
Fig. 4.17 Expansion or compression
L
x
Fig. 4.18 Shape distorsion
Equation (4.26) highlights that the rigid translation is not relevant for body
shape modification. Hence, in order to define the effect of body modification
in elastostatics, rigid rotation and deformation have to be considered and
studied, because, in this case dh = 0 will always hold. Using a differential
notation, the variation in distance dh can also be expressed in its coordinate
components, and, rewritten in matrix form. It should be mentioned that rigid
rotation and deformation are summarized in the Jacobian matrix [21].
68 4 Classical Physical Problems
P
dh
dUP
P
U
U
Q
dUQ
Q
Fig. 4.19 Definition of deformation (the vectors have been drawn twice in dashed
lines for the sake of clarity
⎡ ⎤ ⎡ ⎤
∂u ∂u ∂u
dxP − dxQ ∂x ∂y ∂z
⎢ ⎥ ⎢ ⎥
dh = ⎢
⎣ dy P − dy Q
⎥=⎢
⎦ ⎣
∂v
∂x
∂v
∂y
∂v
∂z
⎥ dU = JdU
⎦ (4.27)
∂w ∂w ∂w
dzP − dzQ ∂x ∂y ∂z
The Jacobian matrix can be decomposed into its anti-symmetric and sym-
metric parts
1 1 1 1
J = J − JT + J + JT (4.28)
2 2 2 2
where the first two adding terms give the rotation matrix
⎡ ⎤
1 ∂u ∂v 1 ∂u ∂w
0 (
2 ∂y − ∂x ) (
2 ∂z − ∂x )
⎢ ⎥
Ω=⎢ 1 ∂u ∂v
⎣ 2 ( ∂y − ∂x ) 0 1 ∂v ∂w ⎥
2 ( ∂z − ∂y ) ⎦
(4.29)
1 ∂u ∂w 1 ∂v ∂w
2 ( ∂z − ∂x ) 2 ( ∂z − ∂y ) 0
Stresses can be divided into two types: normal and tangential. The first is
normal to the surface on which it acts and it is usually called σ, the second
is applied to the surface, and acts along one of the two tangential directions
and it is usually called τ .
Considering (4.34) and Fig. 4.23, the force increment can be rewritten as
⎡ ⎤ ⎡ ⎤ ⎡ ⎤
σx τyx τzx
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
= ⎢ τxy ⎥ dydz + ⎢ σy ⎥ dxdz + ⎢ τzy ⎥ dxdy
dt (4.36)
⎣ ⎦ ⎣ ⎦ ⎣ ⎦
τxz τyz σz
70 4 Classical Physical Problems
l
ε
l
x
Fig. 4.20 Physical meaning of normal strain
du
π
−γ
2
dv
l
x
Fig. 4.21 Physical meaning of shear strain
Hence, (4.33) can be exploded along Cartesian directions, writing (for exam-
ple along x):
∂σx ∂τxy ∂τxz
dx dydz+ dy dxdz+ dz dydx−fx dxdydz = 0 (4.37)
∂x ∂y ∂z
4.3 Elastostatics 71
y
ty + dt
df
x
tx + dt
dy tx
z
tz + dt
ty dz
dx
Fig. 4.22 Surface and Volume forces in an infinitesimal volume. The normal surface
forces are in cyan and the volume forces in red.
Then, by reordering (4.37) and the other equations along y and z, it is possible
to write in vectorial form:
⎡ ⎤
σx
⎡ ⎤⎢ ⎥
⎢ σy ⎥ ⎡ ⎤
∂
0 0 ∂ ∂
0 ⎢ ⎥ dt
⎥ ⎢ σz ⎥
x
⎢ ∂x ∂y ∂z
⎥ ⎢ ⎥
⎢ 0 ∂ ⎥⎢
⎣
∂
0 ∂x ∂
0 ∂z ⎦⎢ ⎥=⎢ ⎣ dty ⎥
T
⎦ = ∂ dt (4.38)
∂y ⎢ γxy ⎥
∂
0 ∂z 0 ∂x ∂y ⎢ ∂ ∂ ⎢ ⎥
0 ⎥ dtz
⎣ γxz ⎦
γyz
τzy σzz
τxz
τyx x
τyz
σyy
z
Fig. 4.23 Cauchy tetrahedron for stress equilibrium: normal (purple arrows) and
shear (green arrows) stress
Topological Equations
Table 4.3 Elastostatics: global variables and their association with primal and
dual complexes
e1 e3
e2
e5
e4 e6
Fig. 4.24 Tetrahedral element for domain discretization. The portion of the dual
face dual to edge 1 inside the tetrahedron is in grey.
⎡ ⎤ ⎡ ⎤
hx1 u1
⎢ ⎥ ⎢ ⎥
⎢ hy1 ⎥ ⎢ v1 ⎥
⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥
⎢ hz1 ⎥ ⎢ w1 ⎥
⎢ ⎥ ⎡ ⎤⎢ ⎥
⎢ hx2 ⎥ I3 −I3 03 03 ⎢ u2 ⎥
⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥⎢ ⎥
⎢ hy2 ⎥ ⎢ I3 03 −I3 03 ⎥ ⎢ v2 ⎥
⎢ ⎥ ⎢ ⎥⎢ ⎥
⎢ hz2 ⎥ ⎢ −I3 ⎥ ⎢ w2 ⎥
⎢ ⎥ ⎢ I3 03 03 ⎥⎢ ⎥
⎢ ⎥=⎢ ⎥⎢ ⎥ (4.39)
⎢ hx3 ⎥ ⎢ 03 I3 −I3 03 ⎥ ⎢ u3 ⎥
⎢ ⎥ ⎢ ⎥⎢ ⎥
⎢ ⎥ ⎢ ⎥⎢ ⎥
⎢ hy3 ⎥ ⎣ 03 I3 03 −I3 ⎦ ⎢ v3 ⎥
⎢ ⎥ ⎢ ⎥
⎢ hz3 ⎥ 03 03 I3 −I3 ⎢ w3 ⎥
⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥
⎢ hx4 ⎥ ⎢ u4 ⎥
⎢ ⎥ ⎢ ⎥
⎢ hy4 ⎥ ⎢ v4 ⎥
⎣ ⎦ ⎣ ⎦
hz4 w4
74 4 Classical Physical Problems
− D̃3 t = f (4.42)
GT
3 t = f. (4.43)
The subscript 3, e.g. in G3 , refers to the fact that the incidence matrices are
here related to the vector of the displacements, which has three unknowns
for each node. The result is a discrete primal gradient (and dual divergence),
G3 , which is the permutation of a tri-block diagonal matrix, in which each
block is made of G.
The approach that has been described up to now, does not change accord-
ing to the material of the studied body. The relationship between the source
and the configuration spaces should be related to the material medium in-
side which these actions are exchanged. According to the classical continuum
4.3 Elastostatics 75
mechanics theory [21], the relationship between stress and strain is defined
on the basis of the material properties in the linear elastic field, and it is
measured by means of tensile tests. In formula form
⎡ ⎤ ⎡ ⎤
σx εx
⎢ ⎥ ⎢ ⎥
⎢ σy ⎥ ⎡ ⎤⎢ εy ⎥
⎢ ⎥ ⎢ ⎥
⎢ ⎥ (1−ν)E
0 ⎢ εz ⎥
⎢ σz ⎥ (1−2ν)(1+ν) 3×3
⎦⎢ ⎥
⎢ ⎥=⎣ ⎢ ⎥ (4.44)
⎢ ⎥
τxy ⎥ 0 E ⎢ γxy ⎥
⎢ (1+ν) ⎢ ⎥
⎢ ⎥ 3×3 ⎢ ⎥
⎣ τxz ⎦ ⎣ γxz ⎦
τyz γyz
h − h
εt = (4.45)
h
The procedure to obtain ν is almost the same as that used for E. In fact,
when a strain gauge is used to measure the longitudinal strain, another strain
gauge usually measures the transverse strain at the same time.
The CM topological equations are not written with respect to strains and
stresses, as they are local variables, but in terms of global variables: dis-
placements and forces. As a first step, stress should be related to the force;
this is possible by considering the discretization and the dual surface. In a
tetrahedral solid element:
Rm
Rp02
arctan(E)
0.002 ε
h
h
l
νε
Fig. 4.26 Graphical expression of the Poisson coefficient
4.3 Elastostatics 77
and, by writing (4.47) for each dual face inside a tetrahedron, the relationship
between the surface force and stress can be written as:
⎡ ⎤ ⎡ ⎤
t1x ãx1 0 0 ãy1 0 ãz1
⎢ ⎥ ⎢ ⎥
⎢ t1y ⎥ ⎢ 0 ãy1 0 ãx1 ãz1 0 ⎥
⎢ ⎥ ⎢ ⎥⎡ ⎤
⎢ ⎥ ⎢ 0 ãy1 ãx1 ⎥
⎢ t1z ⎥ ⎢ 0 0 ãz1 ⎥ σx
⎢ ⎥ ⎢ ⎥⎢ ⎥
⎢ t ⎥ ⎢ ãx2 0 ãz2 ⎥
⎢ 2x ⎥ ⎢ 0 0 ãy2 ⎥⎢⎢
σy ⎥
⎥
⎢ ⎥ ⎢ ⎥
⎢ t2y ⎥ ⎢ 0 ãy2 0 ãx2 ãz2 0 ⎥⎢ ⎢ σ z
⎥
⎥
⎢ ⎥=⎢ ⎥⎢
⎢ t ⎥ ⎢ 0 ⎥⎢ τ ⎥ (4.50)
⎢ 2z ⎥ ⎢ 0 ã z2 0 ã y2 ã x2 ⎥ ⎢ xy ⎥⎥
⎢ ⎥ ⎢ .. ⎥ ⎢ ⎥
⎢ . . . ⎥ ⎢ ... .. .. .. ..
. ⎥
⎢ ⎥ ⎢ . . . . ⎥ ⎣ τxz ⎦
⎢ ⎥ ⎢ ⎥
⎢ t6x ⎥ ⎢ ãx6 0 0 ãy6 0 ãz6 ⎥ τyz
⎢ ⎥ ⎢ ⎥
⎢ t ⎥ ⎢ ⎥
⎣ 6y ⎦ ⎣ 0 ãy6 0 ãx6 ãz6 0 ⎦
t6z 0 0 ãz6 0 ãy6 ãx6
where ã are components of the area vectors of the portion of dual face con-
tained inside a volume element, as introduced in chapter 3. In compact form:
t = Aσ (4.51)
where the H components are constant. Writing the the relative displacements
along the x direction of the primal nodes one obtains:
and noting that the last three equations are linearly dependent on the first
three (in analogy with what introduced in (3.14)), the formulation can be
rewritten as:
⎡ ⎤ ⎡ ⎤⎡ ⎤
hx1 L1x L1y L1z Hxx
⎢ ⎥ ⎢ ⎥⎢ ⎥
⎢ hx2 ⎥ = ⎢ L2x L2y L2z ⎥ ⎢ ⎥ (4.61)
⎣ ⎦ ⎣ ⎦ ⎣ Hxy ⎦
hx3 L3x L3y L3z Hxz
The matrix containing components of the edge vectors are defined as:
⎡ ⎤
L1x L1y L1z
⎢ ⎥
L=⎢
⎣ L2x L2y L2z ⎥
⎦ (4.62)
L3x L3y L3z
By operating on the matrices written for each spatial direction, and using
the components of matrix P , one obtains:
⎡ ⎤ ⎡ ⎤⎡ ⎤
Hxx Hyx Hzx Px1 Px2 Px3 hx1 hy1 hz1
⎢ ⎥ ⎢ ⎥⎢ ⎥
⎢ Hxy Hyy Hzy ⎥ = H T
= ⎢ Py1 Py2 Py3 ⎥ ⎢ hz2 ⎥
⎣ ⎦ ⎣ ⎦ ⎣ hx2 hy2 ⎦
Hxz Hyz Hzz Pz1 Pz2 Pz3 hx3 hy3 hz3
(4.64)
P u f Ṽ
h = G3 u f = −D̃3 t
L h = Ph ε σ = E σ t = Aσ t S̃
⎡ ⎤
hx1
⎢ ⎥
⎢ ⎥
⎤⎢ ⎥
hy1
⎡ ⎤ ⎡ ⎢ ⎥
εx Px1 0 0 Px2 0 0 Px3 0 0 ⎢ hz1 ⎥
⎢ ⎥ ⎢ ⎥⎢ ⎥
⎢ ⎥ ⎢ ⎥⎢ ⎥
⎥⎢ ⎥
εy 0 Py1 0 0 Py2 0 0 Py3 0 hx2
⎢ ⎥ ⎢
⎢ ⎥ ⎢ ⎥⎢ ⎥
⎢ ⎥ ⎢ ⎥⎢ ⎥
⎥⎢ ⎥
εz 0 0 Pz1 0 0 Pz2 0 0 Pz3 hy2
⎢ ⎥=⎢
⎥⎢ ⎥
06×9
⎢ ⎥ ⎢
⎢ γxy
⎥ ⎢ Py1 Px1 0 Py2 Px2 0 Py3 Px3 0
⎥⎢ hz2 ⎥
⎢ ⎥ ⎢ ⎥⎢ ⎥
⎣ γyz ⎦ ⎣ 0 Pz1 Py1 0 Pz2 Py2 0 Pz3 Py3 ⎦⎢
⎢ ...
⎥
⎥
⎢ ⎥
γzx Pz1 0 Px1 Pz2 0 Px2 Pz3 0 Px3 ⎢ hx6 ⎥
⎢ ⎥
⎢ ⎥
⎣ hy6
⎦
hz6
(4.65)
where the columns containing zeros correspond to the position of edges from
four to six. In compact form, the final relation becomes:
ε = Ph (4.66)
It is thus possible to write the solution equation, considering the Tonti dia-
gram of the elastic problem shown in Fig. 4.27, as:
GT
3 AEPG3 u = f (4.67)
Table 4.4 Maximum stress value σmax computed by analytical approach (E-B),
finite element (FEM) and cell method (CM) with different discretizations
My 100 × 200
σz = x= 5 = 60 MPa (4.71)
Iy 1
12 × 103 × 20
and the maximum stress in the beam is therefore the sum of the result of
(4.70) and (4.71), which is resulting in 90 MPa. If the same study is conducted
by means of a finite element model:
The nodes are locked at one end to the beam in the z direction, but the
nodes lying on a diagonal of its cross section, corresponding to the neutral
axis of the bending action, are locked in all directions. In such a way, the
system is not underdetermined and the boundary conditions are as similar as
possible to the Euler-Bernoulli beam problem. The same reasoning is made
for the load: all the nodes of the other end are loaded by means of a nodal
force, which is computed as a fraction of the total load, and is a function of
the area of each element. The results of the stress values are summarized in
Table 4.4 and shown in Fig. 4.28 and Fig. 4.29. The same meshes are used
in the NASTRAN finite element commercial software [25] and in DualLab.
As can be seen, both formulations converge to the analytical value, but the
CM results seem to be more accurate than those of the FEM. This is due to
the post processing nodal averaging procedure used in NASTRAN. Fig. 4.30
shows the trend of the error on the maximum value of stress with respect to
the analytical estimation versus the average edge length of the mesh. Even
though this is not a true convergence analysis, it shows the consistency of
the CM.
4.3 Elastostatics 81
(a)
(b)
Fig. 4.28 Distribution of the stress along the z axis computed by means of the (a)
FEM and (b) the CM with a coarse mesh
82 4 Classical Physical Problems
(a)
(b)
Fig. 4.29 Distribution of the stress along the z axis computed by means of (a) the
FEM and (b) the CM with a fine mesh
4.4 Thermal Transient 83
100
10
relative error (%)
0.1
1.E-04 1.E-03 1.E-02 1.E-01
edge length (m)
Fig. 4.30 Relative error of the maximum stress value versus average edge length
because of the arbitrary time and space settings and, by applying the diver-
gence theorem, one obtains:
∂U
= σ−∇·
q (4.73)
∂t
q and U are then expressed as functions of the temperature T , according to
Fourier’s law
q = −λ∇T
(4.74)
and the state equation
U = ρcT (4.75)
Substituting (4.74) and (4.75) in (4.73), one obtains the partial differential
equation
∂T
ρc − ∇ · λ∇T = σ (4.76)
∂t
This equation is usually discretized using a standard technique such as FEM,
and results in the typical process already described in Fig. 2.1. The CM
84 4 Classical Physical Problems
P, t̃ p Ṽ , τ
p = dt u + D̃Φ
P, τ̃ T u = u0 + Mρc T u Ṽ , t
γ = GT L, t̃ Φ S̃, τ
Φ = −Mλ γ
L, τ̃ γ S̃, t
approach is instead based on the construction of the Tonti diagram for the
physical phenomenon and its direct translation into a numerical method. For
the thermal transient problem, the basic considerations for the construction
of the diagram are:
• the definition of the heat flux q requires normals and therefore q must
be associated to surfaces endowed with outer orientation (time and space,
dual mesh, surface);
• topological equations link variables with the same orientation. ∇ · q is
above q (dual volume) and is one piece of σ; dU
dt is the other part of σ and
is in front of it;
• constitutive equations link pairs of dual variables: T is on the left of dU
dt
(primal point, inner orientation)
• the same rules as above: g = ∇T is below T (primal lines); the constitutive
equation links g and
q.
These rules are sufficient for the construction of the corresponding Tonti
diagram, according to the rules described in chapter 1, and the resulting
diagram is shown in Fig. 4.31 Once the Tonti diagram has been created, the
CM allows it to be immediately translated into a numerical method. If time is
treated as a continuum, the following system of differential equations arises:
dT
Mρc + GT Mλ GT = p (4.77)
dt
The source term p may both be either explicitly given or it could arise from
other physical problems. (4.77) is then solved with a Θ-method approach. In
order to simplify the notation, it is convenient to rewrite (4.77) as:
Cẋ + Kx = b (4.78)
where K = GT Mλ G is the stiffness matrix, C = Mρc is the damping matrix,
x = T and the dot superscript indicates derivation with respect to time.
4.4 Thermal Transient 85
Assuming that the time step is sufficiently small so that C does not change
too much in the τ = tn+1 − tn interval, the following iterative scheme arises:
1
θKn+1 + C xn+1 =
τ
1
− (1 − θ) Kn − C xn + θbn+1 + (1 − θ) bn (4.79)
τ
4.5 Elastodynamics
Elastodynamics studies the time dependent evolution of a system subject to
a stress and strain set that varies in time.
The elastodynamic problem involves the definition of the mass matrix.
When the CM is used, the inertial properties of the single dual cell are related
to the primal. Let us consider (4.33), in which the inertia contribution to force
equilibrium is due to the volume force generated by the acceleration field.
The volume force is related to the dual volume, therefore, using duality, each
primal node undergoes the inertial force of the dual volume. Considering
a single primal element, only a portion of mass is related to a node. This
consideration allows mass matrix to be expressed as a diagonal matrix, in
which each element of the diagonal is the inertial property portion that refers
to the related primal node. In the 2d case, mass matrix M can be expressed
as:
⎡ ⎤
mi 0 0 0 0 0
⎢ ⎥
⎢ 0 mi 0 0 0 0 ⎥
⎢ ⎥
⎢ 0 0 ⎥
⎢ 0 mj 0 0 ⎥
M=⎢ ⎥ (4.80)
⎢ 0 0 0 mj 0 0 ⎥
⎢ ⎥
⎢ ⎥
⎣ 0 0 0 0 mk 0 ⎦
0 0 0 0 0 mk
where mi,j,k are the masses of the dual cells related to the i, j, k primal
nodes and, considering an affine discretization, each nodal mass is equal to
the overall mass of the element divided by the number of nodes. In this case,
for example, the masses mi = mj = mk are equal to the overall mass divided
by 3, that is, the number of element nodes.
The mechanical energy of a system is the sum of three contributions:
potential energy, kinetic energy (in a conservative system these two contri-
butions are sufficient to describe the time evolution) and energy lost through
damping, friction or general dissipation. The kinetic contribution is related
to the system inertia, whereas the potential energy is related to the elastic
properties of the system. The motion equation is therefore written using the
contribution from the elastic properties, the stiffness matrix, the contribution
coming from the inertia, i.e. the mass matrix, and the contribution from dis-
sipation, the damping matrix. All these contributions can be in equilibrium
or under external excitation, in formula:
The analysis can be different on the basis of the presence or lack of an exter-
nal force. If no external force is considered, the solution expresses the natural
behaviour of the system, otherwise the time evolution of the system can be
4.5 Elastodynamics 87
studied using the external force. In the first case, the performed analysis is the
eigenmode analysis, while in the second case, the transient analysis method
is adopted.
(a) First natural frequency: 440 Hz (b) Second natural frequency: 875 Hz
(c) Third natural frequency: 1354 Hz (d) Fourth natural frequency: 1859 Hz
Fig. 4.34 Free-free response of a diapason. The colour maps represent normalized
displacement magnitudes from dark blue to red.
References 89
References
[1] Freschi, F., Giaccone, L., Repetto, M.: Educational value of the algebraic nu-
merical methods in electromagnetism. COMPEL - The International Jour-
nal for Computation and Mathematics in Electrical and Electronic Engineer-
ing 27(6), 1343–1357 (2008)
[2] Herz, A.V.M., Gollisch, T., Machens, C.K., Jaeger, D.: Modelling single neu-
ron dynamics and computations: a balance of details and abstraction. Sci-
ence 314(5796), 80–85 (2006)
[3] Tonti, E.: Finite Formulation of Electromagnetic Field. IEEE Transactions on
Magnetics 38, 333–336 (2002)
[4] Di Barba, P., Freschi, F., Mognaschi, M.E., Pichiecchio, A., Repetto, M.,
Savini, A., Vultaggio, A.: A source identification problem for the electrical ac-
tivity of brain during hand movement. IEEE Transactions on Magnetics 47(5),
878–881 (2011)
[5] Desoer, C.A., Kuh, E.S.: Basic Circuit Theory. McGraw-Hill, New York (1969)
[6] Branin Jr., F.H.: The algebraic-topological basis for network analogies and the
vector calculus. In: Proceedings of Symposium on Generalized Networks, April
12-14, pp. 453–491. Polytechnic Institute of Brooklin (1966)
[7] Binns, K.J., Lawrenson, P.J., Trowbridge, C.W.: The analytical and numerical
solution of electric and magnetic fields. Wiley (1995)
[8] Simkin, J., Trowbridge, C.W.: Three-dimensional nonlinear electromagnetic
field computations, using scalar potentials. IEE Proceedings, Part B 127(6),
368–374 (1980)
[9] Abert, C., Selke, G., Kruger, B., Drews, A.: A fast finite-difference method
for micromagnetics using the magnetic scalar potential. IEEE Transaction on
Magnetics 99, 368–374 (2011)
[10] Albanese, R., Rubinacci, G.: Magnetostatic field computation in terms of two-
component vector potential. International Journal Numerical Method in En-
gineering 29, 515–532 (1990)
[11] Repetto, M., Trevisan, F.: Global formulation for 3D magneto-static using
flux and gauged potential approaches. Int. Journal on Numerical Methods in
Engineering 60, 755–772 (2004)
[12] Chiampi, M., Chiarabaglio, D., Repetto, M.: An accurate investigation on nu-
merical methods for nonlinear magnetic field problems. Journal of Magnetism
and Magnetic Materials 133, 591–595 (1994)
[13] Canova, A., Gruosso, G., Repetto, M.: Integral methods for analysis and design
of low-frequency conductive shields. IEEE Transaction on Magnetics 39, 2009–
2017 (2003)
[14] Bı́ró, O., Preis, K., Vrisk, G., Richter, K.R., Ticar, I.: Computation of 3-D
magnetostatic fields using a reduced scalar potential. IEEE Transaction on
Magnetics 29(2), 1329–1332 (1993)
[15] Le Menach, Y., Clenet, S., Piriou, F.: Determination and utilization of the
source field in 3d magnetostatic problems. IEEE Transaction on Magnet-
ics 34(5), 2509–2512 (1998)
[16] Specogna, R., Trevisan, F.: Discrete constitutive equations in a − χ geometric
eddy-current formulation. IEEE Transactions on Magnetics 41(4), 1259–1263
(2005)
90 References
[17] De Gersem, H., Weiland, T.: Field-circuit coupling for time-harmonic models
discretized by the finite integration technique. IEEE Transaction on Magnet-
ics 40(2), 1334–1337 (2004)
[18] Team website, www.compumag.org/jsite/team.html,
(accessed December 4, 2012)
[19] Takahashi, N., Nakata, T., Morishige, H.: Summary of results for problem 20
(3-D static force problem). COMPEL - The International Journal for Com-
putation and Mathematics in Electrical and Electronic Engineering 14(2/3),
57–75 (1995)
[20] Pichon, L., Razek, A.: Force calculation in axisymmetric induction devices
using a hybrid FEM-BEM technique. IEEE Transactions on Magnetics 26,
1050–1053 (1990)
[21] Timoshenko, S.P., Goodier, J.N.: Theory of Elasticity. McGraw-Hill, Auckland
(1970)
[22] Tonti, E., Zarantonello, F.: Algebraic formulation of elastostatics: the cell
method. Computer Modeling in Engineering & Sciences 39(3), 201–236 (2009)
[23] Delprete, C., Freschi, F., Repetto, M., Rosso, C.: Thermo-mechanical analysis
using a multiphysics approach. Journal of Physics: Conference Series 181(1)
(2009)
[24] Delprete, C., Freschi, F., Repetto, M., Rosso, C.: Experimental validation of
a numerical multiphysics technique for electro-thermo-mechanical problem.
The International Journal for Computation and Mathematics in Electrical and
Electronic Engineering 29(6), 1642–1652 (2010)
[25] Nastran,
www.mscsoftware.com/products/cae-tools/msc-nastran.aspx,
(accessed December 4, 2012)
[26] Alotto, P., De Cian, A., Molinari, G.: A time-domain 3-D full-Maxwell solver
based on the Cell Method. IEEE Transactions on Magnetics 42(4), 799–802
(2006)
[27] Zienkiewicz, O.C., Taylor, R.L.: The Finite Element Method - Volume 1: The
Basis, 5th edn. Butterworth-Heinemann (2000)
[28] Meirovitch, L.: Elements of VIbration Analysis. McGraw-Hill (1975)
Chapter 5
Multiphysics Problems
P. Alotto et al.: The Cell Meth. for Electr. Eng. & Multiphys. Prob., LNEE 230, pp. 91–114.
DOI: 10.1007/978-3-642-36101-2_5
c Springer-Verlag Berlin Heidelberg 2013
92 5 Multiphysics Problems
• weak coupling: one physical problem is first solved and the coupling vari-
ables are then transferred to the second physical problem without feedback.
This can be seen as the sequential solution of different problems;
• strong coupling: instead refers to the contemporary solution of the whole
set of interacting problems.
GT Mλ GT = p (5.2)
GT
3 ME G3 u = f (5.3)
While the solution of each subproblem is straightforward, some additional
comments are needed to calculate the coupling terms.
In the next sections of this chapter, strong coupling will be considered,
under the hypothesis that the mechanical displacements are small enough
that the deformations of the elements can be neglected.
The integral in (5.4) gives the electric current jk . By assuming a uniform
current density inside the element:
jk = J ·
w
k dV. (5.5)
Vm
5.2 Electro-thermo-mechanical Coupling 93
Since the integral in (5.5) equals the kth dual face area vector, as shown in
Lemma 1 of [4]:
w
k dV = S̃ (5.6)
Vm
one obtains:
· JdV
E = ek jk (5.7)
Vm k
where Vm is the volume of the simplex, ek is the voltage defined across the
kth primal edge and jk is the portion of the current defined on the kth dual
surface that belongs to the mth simplex. Equation (5.7) shows that the power
in each element can be evaluated starting from global quantities which are
directly available from the CM formulation. All the powers defined for each
primal edge/dual face couple can be collected in a vector pE
pE = e ◦ j (5.8)
region of influence
of power
pk = ek jk
ek
jk
Table 5.1 Condition numbers. The numbers refer to the example in section 5.2.4.
The solution of (5.14) requires particular attention. The solution of the com-
plete system requires a proper scaling of the variables, since the vector of the
unknowns is characterized by heterogeneous variables in physical dimensions
and magnitude. The use of black-box solvers can lead to solutions that are
not satisfactory, in terms of accuracy, since the condition number becomes
large.
An interesting alternative is to exploit the block-triangular structure of
the matrix and apply a block forward substitution. The latter case requires
the cascade solution of three sub-problems, in which the stiffness matrices
are the diagonal blocks of (5.14):
A11 v = b1 →v (5.15)
A22 T = b2 − A21 v →T (5.16)
A33 u = b3 − A32 T →u (5.17)
This method requires less memory consumption and computational time than
the solution of the complete problem, and it make it possible to take advan-
tage of the symmetry and positive definiteness of the subproblem matrices.
The condition numbers of the two approaches are reported in Table 5.1. They
refer to the test case defined in section 5.2.4.
The nonlinear problem is solved through relaxed successive approxima-
tions, but other more efficient schemes are possible.
Fig. 5.4 Comparisons of the z displacement computed along a line in the middle
of the beam
• current intensities: 1 − 10 kA
• frequencies: 1 − 10 kHz
• high saturation levels of the magnetic material close to its surface
• complex geometries of the inductors
• reduced penetration depth
• dependance of the parameters on the temperature
• different time scales between magnetic and thermal problems
The magnetic problem has already been dealt with in [6] in which a com-
plete solution obtained by means of a commercial code, is compared with an
approximate approach that decouples the three dimensional geometric com-
plexity and the heavy saturation effects. The results provided by the state-
of-the-art software FLUX [7] are not satisfactory because the software is
dramatically slow in convergence (see Table 5.4) and this makes the coupling
between thermal and nonlinear magneto-quasistatic analysis prohibitive. The
aim of this section is to overcome these limitations, to exploit the different
5.3 Induction Heating 99
Table 5.4 Computational times for a commercial code and a hybrid 1d-3d approach
time scales between the thermal (seconds) and magnetic problem (tens of mi-
croseconds) and to improve the convergence of the nonlinear magnetic scheme
by taking into account the thermal dependent physical characteristics.
b = Ca (5.20)
C̃h = j + jS (5.21)
D̃j = 0 (5.22)
e = −Gv − iωa (5.23)
while the electric and magnetic constitutive equations are:
h = Mν b (5.24)
j = Mσ e (5.25)
100 5 Multiphysics Problems
P 0 Ṽ
0 = D̃j
P v Ṽ
L a j S̃
e = −Gv − iωa j = Mσ e
e j = C̃h
L b = Ca S̃
S b h = Mν b h L̃
0 = Ce + iωb
S 0 L̃
a − v and a∗ Formulations
The first formulation uses the line integral of the magnetic vector potential
a and the electric scalar potential v as the unknowns. By collecting (5.20),
(5.21), (5.23) with the constitutive equations, one obtains:
C̃Mν C + iωMσ a + Mσ Gv = jS (5.26)
Kirchhoff’s current law (5.22) is explicitly imposed, and the following is ob-
tained:
− iω D̃Mσ a − D̃Mσ Gv = 0 (5.27)
v
In order to symmetrize the complex system, iω is used as the unknown:
C̃Mν C + iωMσ iωMσ G a jS
v
= (5.28)
iωGMσ iωGMσ G iω
0
Both formulations are ungauged and therefore singular. If the righthand side
is divergence free, the system is consistent and can be solved using specialized
iterative solvers for complex symmetric systems [11]. When direct solvers are
used, the vector potential a in (5.28) must be explicitly gauged (see section
4.2 in chapter 4). The gauge is limited to the nonconductive region through
formulation (5.29) [12].
From a computational point of view, the a∗ formulation is faster and offers
better conditioning [13] than a − v. Fig. 5.6
Induction heating system are characterized by inductors whose currents
are imposed by electronic power supply systems. A correct modelling requires
an integral constraint in order to impose the total current through the source
conductors. The implementation of source coils with an impressed current
has already been described for the deduction of (4.14) and can be used in
the same fashion:
j = Mσ (e + Qe0 ) (5.31)
Finally, the integral constraint used to impose the total current j0 is:
QT j = j0 (5.32)
This formulation offers the advantage of keeping the final system symmetric.
CT Mν C + iωMσ −Mσ Q a∗ js
= (5.33)
−QT Mσ 1 T
iω Q Mσ Q e0 1
iω j0
400 3.5
350 3.0
300
2.5
comp. time (s)
250
speedup
2.0
200
A-χ 1.5
150 A*
speedup
1.0
100
50 0.5
0 0.0
0 50 100 150 200
# of unknowns x 1000
Magnetic Nonlinearity
Bmax
H
Heq
3.0
2.5
2.0
1.5 time0mm
magnetic flux density (T)
1.0 harm0mm
0.5
0.0
-0.5
-1.0
-1.5
-2.0
-2.5
-3.0
0.00 0.02 0.04 0.06 0.08 0.10 0.12
time (ms)
Fig. 5.8 Distorted and equivalent sinusoidal waveforms calculated with nonlinear
transient and energy equivalence formulation
1.2
1.0
0.8
kθ
0.6
0.4
0.2
0.0
0 200 400 600 800 1000 1200 1400
θ (°C)
1.E+04
9.E+03
8.E+03
7.E+03
6.E+03
c (J/kg/K)
5.E+03
4.E+03
3.E+03
2.E+03
1.E+03
0.E+00
0 200 400 600 800 1000 1200 1400
θ (°C)
Fig. 5.10 Specific thermal capacity vs. temperature in proximity of the Curie point
Fig. 5.11 Geometry under study: Workpiece in blue, inductor in red and flux
concentrators in green
Table 5.5 Computational data for the strong coupled eddy current-thermal tran-
sient simulation
Phase Value
No. unknowns 209513
factorization time (direct solver) 151 s
nonlinear solution time 435 s (see Fig. 5.12)
equispaced time steps 201
total time about 32 hours
900
800
700
temperature (°C)
600
500
400
300
200
100
0
0 1 2 3 4 5 6 7 8 9 10
time (s)
8.E+08
7.E+08 t = 1 s
t = 4 s
6.E+08
t = 7 s
Jabs (A/m^2)
5.E+08 t = 10 s
4.E+08
3.E+08
2.E+08
1.E+08
0.E+00
0.E+00 2.E-03 4.E-03 6.E-03 8.E-03 1.E-02
workpiece depth (m)
Fig. 5.14 Eddy current density profile along the workpiece depth
23496 2d three-node triangular elements which are then used to create the
3d mesh with first order four-node tetrahedral elements using a commercial
pre-processing code: the final mesh is made of 13567 nodes and 45990 solid
elements, see Fig. 5.17. This mesh has been used in both thermal and me-
chanical analysis, without changing the element size and it has been analyzed
both with a commercial FEM code and the CM. A commercial cast iron, com-
monly adopted for exhaust manifolds has been used in the simulations. The
last step of the pre-processing technique is the creation of the node sets for
the specification of the loads and boundary conditions. The following node
sets have been created:
108 5 Multiphysics Problems
900
800
700
600
temperature (°C)
500
400
300
t = 1 s
200
t = 4 s
100 t = 7 s
t = 10 s
0
0.E+00 2.E-03 4.E-03 6.E-03 8.E-03 1.E-02
workpiece depth (m)
• the lower surface in contact with the cylinder head (for the thermal and
structural analysis);
• three sets with 3d boundary nodes of the manifold internal skin (thermal
analysis only);
• external surface of the turbocharger (structural analysis only).
5.4 Thermo-mechanical Coupling 109
Fig. 5.18 Thermal boundary conditions: the high temperature zone is in green,
the medium temperature in red, the low temperature area in yellow and the tem-
perature of the collar is in blue
and the values of the boundary conditions are summarized in Fig. 5.18 and
Table 5.7. The ambient temperature was 80 ◦ C, a value that is close to the
actual conditions encountered in the engine compartment.
Four exhaust gas temperature cycles have been imposed in the transient
thermal analysis, see Fig. 5.19, for a total simulation time of 3000 s. Moreover
the temperature of the exhaust collar in contact with the cylinder head is
linearly increased from 80 ◦ C to 140 ◦ C during the first 350 s and then
it remains constant until the end of the simulation. The results are stored
every 10 s.
Temperature E ν ρ α
◦ −6
C GPa - kg/m 3
×10 K −1
20 204 0.3 7100 12
200 202 0.3 7100 12
400 195 0.3 7100 12.5
600 122 0.3 7100 13.2
800 97 0.3 7100 14.2
The nodal temperatures calculated during the previous thermal analysis were
imported into the structural model as thermal loads. An encastre on the nodes
of the lower surface of the manifold and a concentrated force equivalent to
4 kg on the nodes of the turbocharger collar have also been specified for
the structural analysis, as can be seen in Fig. 5.20. The material has been
modelled introducing values of the Young Modulus E and thermal expansion
α, that depend on the temperature, together with the Poisson ratio ν and
density ρ, whose values are constant with temperature, as shown in Table 5.8.
Tables containing the coordinates of the nodes and solid elements of the
FEM models have been extracted from the input files of the FEM. In order
to ensure a fair comparison, the FEM and CM shared the same mesh.
The temperature and the displacement computed for both the FEM and
CM are plotted in Fig. 5.21 and 5.22, respectively. These results correspond to
the last imposed thermal cycle time step, in which the maximum temperature
values are reached. Four nodes have been analyzed in order to compare the
112 5 Multiphysics Problems
• only one model is required for the complete thermo-structural analysis and
the time spent on its preparation can be appreciably reduced;
• the CM provides a low-level coupling of the physical laws which makes it
easy to solve multiphysics problems, including time dependent ones;
References 113
(a) (b)
Fig. 5.21 Comparison between temperature maps computed by means of (a) FEM
and (b) CM
(a) (b)
Fig. 5.22 Comparison between displacement maps computed by means of (a) FEM
and (b) CM
References
[1] Alotto, P., Freschi, F., Repetto, M.: Multiphysics problems via the cell method:
The role of tonti diagrams. IEEE Transactions on Magnetics 46(8), 2959–2962
(2010)
[2] Meunier, G.: The finite element method for electromagnetic modeling. Wiley
(2008)
[3] Mankame, N.D., Ananthasuresh, G.K.: Comprehensive thermal modelling and
characterization of an electro-thermal-compliant microactuator. Journal of Mi-
cromechanics and Microengineering 11(5), 452–462 (2001)
114 References
However, as will become clear in the next sections, a correct MATLAB pro-
gramming, involving preallocation, vectorization and indexing arrays (see
MATLAB Documentation) makes MATLAB performances comparable with
other lower-level paradigms. The remaining, inevitable, slow part can be fur-
ther improved by using FORTRAN or C/C++ code and directly linking it to
MATLAB via mex-files (see MATLAB Documentation). On the other hand
the most computational intensive operations are in the solving phase, and
are obtained from built-in optimized functions. For these reasons, the au-
thors preferred to use a fast developing language at the expense of slightly
poorer performances, compared to others.
Other examples of MATLAB implementations of numerical methods for
PDE can be found in the literature: iFEM [4], IFISS [5] are a couple of
examples of finite element toolbox packages, as is [6]. An efficient MATLAB
implementation of 3d CM is DualLab [7].
GT Mλ GT = p
T = TD on ∂ΩD
All the data concerning the geometric data structure mesh are stored in
a MATLAB structure, in order to make the input/output of the subsequent
functions easy. From now on, the data structure refers to the local numbering
of the nodes, edge, and faces reported in Fig. 6.1.
e1 e2
f1
f2 f3
e3
e4 3
2
f4
e5 e6
4
Fig. 6.1 Local numbering of the nodes, edges and faces
118 6 Implementation
The first step is to load P,T,M into the struct mesh. In order to have an
unambiguous representation of the tetrahedra, the nodes are sorted accord-
ing to an increasing index, i.e. T(k,i) < T(k,i+1). The result is easily
obtained with the built-in function sort:
1 function mesh = preprocessor(P,T,M)
2 % nodes
3 mesh.P = P;
4 % tetrahedra
5 mesh.T = sort(T,2);
6 % material codes
7 mesh.M = M;
8 % number of nodes
9 mesh.nP = size(P,1);
10 % number of tetrahedra
11 mesh.nT = size(T,1);
Note the use of the unique function to remove all the repeated faces.
In spite of the effectiveness of the code, when mesh.nT is large, the for
i = 1:mesh.nT loop is not efficient in MATLAB. It is possible to develop
a fully vectorized version of the code, with the same functionalities:
1 % local numbering
2 eloc = [1 2 1 3 1 4 2 3 2 4 3 4];
3 % edge-to-node with repetitions
4 e2n = reshape(mesh.T(:,eloc)’,2,6*mesh.nT)’;
5 % remove repetitions and get edges
6 [mesh.e2n,˜,v2e] = unique(e2n,’rows’);
7 mesh.v2e = reshape(v2e,6,mesh.nT)’;
8 % number of edges
9 mesh.nE = size(mesh.e2n,1);
The tetra-to-edge connectivity matrix is obtained for free as the third output
of the unique function. In a similar way, the face-to-node is the nS × 3
matrix that contains the nodes which form a (triangular) face. The four face
tetrahedra have local numbering: 1-2-3, 1-2-4, 1-3-4, and 2-3-4 and the tetra-
to-face connectivity matrix is obtained as a free result. This last matrix is
useful to identify surface faces, an operation that is required to impose the
boundary conditions and for postprocessing.
6.3 Phase 1: Data Structures 119
1 % local numbering
2 floc = [1 2 3 1 2 4 1 3 4 2 3 4];
3 % face-to-node with repetitions
4 f2n = reshape(mesh.T(:,floc)’,3,4*mesh.nT)’;
5 % remove repetitions and get faces
6 [mesh.f2n,˜,v2f] = unique(f2n,’rows’);
7 mesh.v2f = reshape(v2f,4,mesh.nT)’;
8 % number of faces
9 mesh.nF = size(mesh.f2n,1);
The use of these local numberings makes the recognition of duplicated nodes
automatic, since both the edges and faces have nodes with the lower number
listed first. It is worth noting that these auxiliary structures are created with
a fully vectorized MATLAB code, and loops are not necessary. At the expense
of readability (at least for beginners), the performances are dramatically im-
proved. The last topological structure required for the implementation of the
code is the gradient matrix. Referring to chapter 2, it can be seen that the
gradient matrix is a nE ×nN incidence matrix made up of −1, 0, +1. Each row
has only two nonzeros: −1 in the column corresponding to the starting node
and +1 in that of the end node. This matrix is created properly with the use
of the sparse matrix structure in MATLAB [10]. The best ways of assembling
sparse matrices is by referencing the nonzero entries with the coordinate for-
mat : two vectors are pointers to the row and column of the nonzero entry,
while a third vector is filled with the nonzero value. The matrix is assembled
by the sparse function in MATLAB. All the linear algebra operations are
implemented in MATLAB and are transparent to the user. As far as the gra-
dient matrix is concerned, the three vectors have exactly 2nE nonzeros and
can be created starting from the mesh.e2n matrix:
1 % create pointer to rows
2 i = (1:mesh.nE)’;
3 i = [i; i];
4 j = mesh.e2n(:);
5 % nonzero entries
6 s = [-ones(mesh.nE,1); ones(mesh.nE,1)];
7 mesh.G = sparse(i,j,s);
Remark 1. Only essential structures for the formulation under study have
been considered. In order to increase flexibility of the code (but, unfortunately,
this also decrease the performances), other structures can be built: the face-to-
edge matrix, sparse curl and div discrete matrices, identification of boundary
tetrahedra-faces-edges-nodes,. . .
Remark 2. The previous data structures are not optimal for memory stor-
age, since all the data are, by default, stored as double precision numbers.
Several matrices deal with integer numbers. The casting of variables has not
been considered here in order to improve readability of the code.
Remark 3. MATLAB R2009a can handle 3d meshes with the TriRep class.
Unfortunately, the class methods do not provide the data structure required
for the later phases of the code.
120 6 Implementation
Now the field kT can be set up with the right value, e.g. to set a thermal con-
ductivity of 20 Wm−1 K−1 to material 2, the command in the main MATLAB
script is:
1 mat.kT(2) = 20;
The first step involves building and inverting the primal edge matrix, con-
sidering only those edges that belong to a local tree. With the numbering
adopted, the first three edges of each tetrahedron are connected to the first
node, and thus form a tree. The tree edges are taken to build the edge matrix.
1 % tree edges in local numbering
2 itree = [1 2 3];
3 % local faces at right of edges
4 f1loc = [1 2 4; 1 2 3; 1 3 4; 2 3 4; 1 2 4; 2 3 4];
5 % local faces at left of edges
6 f2loc = [1 2 3; 1 3 4; 1 2 4; 1 2 3; 2 3 4; 1 3 4];
7 % local edge numbering
8 eloc = [1 2; 1 3; 1 4; 2 3; 2 4; 3 4];
9 % loop over tetrahedra
10 for i = 1:mesh.nT
11 % build primal edge length matrix
12 iedg = mesh.v2e(i,itree);
13 % edge vectors
14 L = mesh.P(mesh.e2n(iedg,2),:)-mesh.P(mesh.e2n(iedg,1),:);
15 % invert edge vector matrix
16 P = inv(L);
17 % add zeros obtaining augmented inverted matrix
18 Pa = [P zeros(3,3)];
The portion of the dual faces inside the tetrahedron must then be created.
The dual face corresponding to the kth edge has the barycenter of the tetrahe-
dron, the barycenters of the faces connected to the kth edge and the midpoint
of the common edge as vertices. The dual face area vector can be calculated
by halving the cross product of the face diagonals. In order to have compat-
ible orientations, the dual faces must have the same direction as the primal
edges they are linked to. According to the local ordering that has been used,
each edge is shared by two faces, one on its left and one on its right. This
correspondence is reported in Table 6.1.
1 % calculate tetrahedron barycenter
2 BT = sum(mesh.P(mesh.T(i,:),:),1)/4;
3 % get global edge numbering
4 eglo = reshape(mesh.T(i,eloc),6,2);
5 % edge barycenters
6 BE = (mesh.P(eglo(:,1),:)+mesh.P(eglo(:,2),:))/2;
7 % get global right face numbering
8 f1glo = reshape(mesh.T(i,f1loc),6,3);
9 % right face barycenters
10 BF1 = (mesh.P(f1glo(:,1),:)+mesh.P(f1glo(:,2),:)+mesh.P(f1glo(:,3),:))/3;
11 % get global left face numbering
12 f2glo = reshape(mesh.T(i,f2loc),6,3);
13 % left face barycenters
14 BF2 = (mesh.P(f2glo(:,1),:)+mesh.P(f2glo(:,2),:)+mesh.P(f2glo(:,3),:))/3;
15 % BT-BE edge vectors
16 v1 = BE-repmat(BT,6,1);
17 % BF2-BF1 edge vectorss
122 6 Implementation
18 v2 = BF1-BF2;
19 % dual face area vector
20 S = .5*cross(v2,v1,2);
21 % calculate volume of tetrahedron
22 V = dot(cross(L(1,:),L(2,:),2),L(3,:),2);
23 % correction for tetrahedra with negative volume
24 if V < 0
25 S = -S;
26 end
The local constitutive matrix is obtained by multiplying the dual area vectors
S 6 × 3 by the material property (thermal conductivity) and by augmenting
the inverse matrix of the primal edge length 3×6. The material property could
be an anisotropic tensor 3 × 3. The local matrix will be stored in coordinate
vectors that are preallocated at the beginning of the function. Once the for
loop has ended, the matrix can be assembled with the sparse function:
1 % local matrix
2 Mloc = S*mat.kT(mesh.M(i))*Pa;
3 % block of 36 indices belonging to i-th tetrahedron
4 idx = 36*(i-1)+1:36*i;
5 % row pointers
6 irow(idx) = repmat(mesh.v2e(i,:)’,6,1);
7 % column pointers
8 jcol(idx) = reshape(repmat(mesh.v2e(i,:),6,1),36,1);
9 % nonzeros
10 s(idx) = Mloc(:);
11 end
12 % assemble sparse matrix
13 M = sparse(irow,jcol,s);
power generated in W/m3 is known as input, and that the source region can
be identified with a specific code. For this reason, the dual volumes are built
on-the-fly, starting from volumes of primal tetrahedra. It is possible to see
that, when barycentric dual grids are used, the portion of dual volumes inside
each tetrahedron is exactly one-fourth of the primal cell volume. By summing
the contributions of all the portions that surround each node, it is possible
to calculate the dual volume measure. This last operation is done with the
accumarray function, which is analogous to the sparse function but is
used for full matrices.
1 % find cells of specified obj code
2 icell = mesh.M == obj;
3 % nodes attached to cells of obj
4 inod = mesh.T(icell,:);
5 % volumes of tetrahedra: 1/6 of mixed product of vectors starting from node 1
6 v21 = mesh.P(mesh.T(:,2),:)-mesh.P(mesh.T(:,1),:);
7 v31 = mesh.P(mesh.T(:,3),:)-mesh.P(mesh.T(:,1),:);
8 v41 = mesh.P(mesh.T(:,4),:)-mesh.P(mesh.T(:,1),:);
9 V = abs(dot(cross(v21,v31,2),v41,2))/6;
10 % partial volumes under the competence of nodes (nT x 4)
11 Vnod = repmat(V,1,4)/4;
12 % dual volumes
13 Vdua = accumarray(inod(:),Vnod(:),[mesh.nP,1]);
14 % power inside each dual volume
15 b = p*Vdua;
In other cases all the boundary nodes have imposed values. In order to keep
the code as simple as possible, the specification of the boundary conditions
is left to the final script.
The free unknowns can be obtained by solving the first block row in (6.1):
The second block row in (6.1) is of no interest. The vector of the unknowns
is not sorted, but is addressed by vector indexing to implement (6.2) and
assemble efficiently the final solution vector:
1 function x = solveproblem(A,b,idfix,xfix)
2 % get number of unknowns
3 n = length(b);
4 % move to rhs the Dirichlet values
5 b = b-A(:,idfix)*xfix;
6 % get indices of free variables
7 ifree = setdiff(1:n,idfix);
8 % reduce stiffness and rhs
9 A = A(:,ifree);
10 A = A(ifree,:);
11 b = b(ifree,:);
The problem is then solved with respect to the unknowns and the complete
solution vector is assembled accordingly. The built-in MATLAB sparse direct
solver is selected by using the “backslash” \ operator. The algorithm auto-
matically chooses the right solver and pre-ordering, depending on the matrix
properties [11]. The use of iterative solvers is straightforward, but they must
be used with caution, since they cannot be used as black-box solvers.
1 % solve with built-in method
2 xred = A\b;
3 % initialize complete vector of solution
4 x = zeros(n,1);
5 % load solution
6 x(ifree) = xred;
7 % load Dirichlet values
8 x(idfix) = xfix;
6.10 Example 125
6.10 Example
The test case is a cylindric cable with an inner conductor made of copper
(λ = 386 Wm−1 K−1 ) and the insulation made of XLPE (λ = 0.29 Wm−1 K−1 ).
The conductor is heated by power generation from the electrical currents.
Here, the specific heat power is considered as input W = 20 kWm−3 . The
temperature is kept fixed at both sides of the cable (T0 = 30 ◦ C). The mesh
is generated directly through MATLAB instructions, due to the simple ge-
ometry. The dimensions and mesh size are controlled by the initial set of
parameters. The meshgrid function creates the regular grid discretization
126 6 Implementation
The functions defined in the previous section are then run. The only modifi-
cation that is made is the introduction of time counters into all the functions,
in order to have an idea of the computational complexity of each function.
1 % create data structure
2 mesh = preprocessor(P,T,M);
3 % display data structure information
4 disp(mesh);
5 % plot mesh
6 h1 = plotmesh(mesh,[]);
7 % create material data structure and assign material properties
8 mat = setmaterial(mesh);
9 mat.kT(2) = 386; % copper
10 mat.kT(3) = 0.29; % xlpe
11 % build constitutive matrix
12 M = constitutive(mesh,mat);
13 % assign boundary conditions
14 idfix = find(mesh.P(:,3) == z1);
15 xfix = T0*ones(size(idfix));
16 % assemble stiffness
17 A = mesh.G’*M*mesh.G;
18 % calculate source term to be used as rhs
19 b = heatsource(mesh,2,w);
20 % solve
21 x = solveproblem(A,b,idfix,xfix);
22 % plot result
23 h2 = plotmesh(mesh,x);
1
36
0.9
0.8 35
0.7
0.6 34
0.5
33
0.4
0.3 32
0.2
0.1 31
0
−0.02 30
0
0.02 0−0.02
0.02
Fig. 6.3 Map of the temperatures obtained with the plotmesh function
6.11 Discussion
A basic implementation of the CM applied to stationary thermal conduction
has been presented in this chapter. The code is made up of six routines, the
longest of which has about 30 lines (comments excluded). The presented code
exploits the rules to write a fast MATLAB code: vectorization, preallocation,
and array indexing. The algorithm is not optimized, with respect to mem-
ory consumption, and additional speedup can be obtained by re-coding the
constitutive matrix function in low-level language. In spite of these issues,
the code is suitable for medium-scale problems and can be considered a good
starting point for the implementation of additional features, starting with
the introduction of additional boundary conditions.
It is interesting to note that the code can be used “as it is” to solve
electrostatic problems and current field problems.
References 129
References
[1] Matlab, http://www.mathworks.com, (accessed December 4, 2012)
[2] Octave, http://www.gnu.org/software/octave/,
(accessed December 4, 2012)
[3] Scilab, http://www.scilab.org, (accessed December 4, 2012)
[4] Chen, L.: iFEM: an innovative finite element methods package in MATLAB.
Technical report, University of California, Irvine (2008)
[5] Elman, H.C., Ramage, A., Silvester, D.J.: Algorithm 886: IFISS, A Matlab
toolbox for modelling incompressible flow. ACM Transactions on Mathemati-
cal Software 33(2), 1–18 (2007)
[6] Alberty, J., Carstensen, C., Funken, S.F.: Remarks around 50 lines of Matlab:
short finite element implementation. Numerical Algorithms 20, 117–137 (1999)
[7] Freschi, F., Giaccone, L., Repetto, M.: Educational value of the algebraic nu-
merical methods in electromagnetism. COMPEL - The International Jour-
nal for Computation and Mathematics in Electrical and Electronic Engineer-
ing 27(6), 1343–1357 (2008)
[8] Persson, P.-O., Strang, G.: A simple mesh generator in matlab. SIAM Re-
view 46(2), 329–345 (2004)
[9] George, P.L.: Automatic Mesh Generation: Application to Finite Element
Methods. John Wiley & Sons Ltd. (1991)
[10] Gilbert, J.R., Moler, C., Schreiber, R.: Sparse matrices in MATLAB: de-
sign and implementation. SIAM Journal on Matrix Analysis and Applica-
tions 13(1), 333–356 (1992)
[11] Davis, T.A.: Direct Methods for Sparse Linear Systems. Series on the Funda-
mentals of Algorithms. SIAM (2006)