You are on page 1of 136

Lecture Notes in Electrical Engineering 230

For further volumes:


http://www.springer.com/series/7818
Piergiorgio Alotto, Fabio Freschi, Maurizio Repetto,
and Carlo Rosso

The Cell Method for


Electrical Engineering
and Multiphysics Problems
An Introduction

ABC
Authors
Prof. Piergiorgio Alotto Prof. Maurizio Repetto
Dipartimento di Ingegneria Industriale Dipartimento Energia
Università di Padova Politecnico di Torino
Padova Torino
Italy Italy

Prof. Fabio Freschi Prof. Carlo Rosso


Dipartimento Energia Dipartimento di Ingegneria Meccanica e
Politecnico di Torino Aerospaziale
Torino Politecnico di Torino
Italy Torino
Italy

ISSN 1876-1100 e-ISSN 1876-1119


ISBN 978-3-642-36100-5 e-ISBN 978-3-642-36101-2
DOI 10.1007/978-3-642-36101-2
Springer Heidelberg New York Dordrecht London
Library of Congress Control Number: 2012956288

c Springer-Verlag Berlin Heidelberg 2013


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of
the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology
now known or hereafter developed. Exempted from this legal reservation are brief excerpts in connection
with reviews or scholarly analysis or material supplied specifically for the purpose of being entered
and executed on a computer system, for exclusive use by the purchaser of the work. Duplication of
this publication or parts thereof is permitted only under the provisions of the Copyright Law of the
Publisher’s location, in its current version, and permission for use must always be obtained from Springer.
Permissions for use may be obtained through RightsLink at the Copyright Clearance Center. Violations
are liable to prosecution under the respective Copyright Law.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication
does not imply, even in the absence of a specific statement, that such names are exempt from the relevant
protective laws and regulations and therefore free for general use.
While the advice and information in this book are believed to be true and accurate at the date of pub-
lication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any
errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect
to the material contained herein.

Printed on acid-free paper


Springer is part of Springer Science+Business Media (www.springer.com)
To our beloved Claudia, Valeria, Silvia and Elisabetta.
Preface

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

The mimetic finite difference methods mimic important properties


of physical and mathematical models. As the result, conservation
laws, solution symmetries, and the fundamental identities of the
vector and tensor calculus are held for discrete models.

Other authors define a discrete calculus method as3 :

a general methodology for the solution of partial differential equa-


tions . . . in which the discretization of the calculus is exact and all
approximation occurs as an interpolation problem on the material
constitutive equations. The fact that the calculus is exact gives
these methods the ability to capture the physics of PDE systems
well.

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

However, the particular CM method presented here does not flawlessly


implement the dictates of Tonti’s vision. Some of his ideas of a perfect four
dimensional world in which each physical quantity belo ngs to a domain
with three dimensions from space and one from time, has sometimes been
distorted. The way engineers think, especially electrical ones, is that time is
considered as a domain on its own, separated from space. Even with these
small deviations from Tonti’s theory, the authors believe, and hope, that
the main basic concepts for a consistent foundation of the discrete solution
method can be found in this publication.
Another point about this book emerges from the particular engineering
point of view of the authors. One of the main objectives of this manuscript is
to show that the cell method is able to solve real problems originating from
real world applications. Thus, most of it is devoted to the presentation of test
cases from the authors’ research fields which can be used as examples of the
correctness, efficiency and ease of implementation of the method.
In addition, this book is also an attempt to stress another feature of the
CM: its high educational value. The possibility of defining the numerical
scheme directly on the physics of the problem and on basic geometrical and
topological concepts allows one to introduce an efficient numerical analysis
tool without the need of a high level of preparation in mathematics. Thus,
particular attention has been devoted to the level of detail which, for in-
stance, should allow graduate students to implement the CM in problems
of practical engineering interest. A complete analysis of the main phases of
the implementation of the numerical scheme in a high level programming
language is described and commented on.
According to the previously mentioned considerations, this volume starts
from Tonti’s main ideas and then proceeds with the implementation of the
CM. Tonti diagrams are introduced in chapter 1. Their transformation into
numerical schemes, through the cell method, requires the construction of two
separate sets of equations, topological and the constitutive ones, which are
treated separately in chapters 2 and 3, respectively. chapter 4 is devoted to the
description of classical physical problems, including static and dynamic ones.
The usefulness of the cell method for the solution of multiphysics problems is
highlighted in chapter 5, while, finally, details on the implementation of the
method are given in chapter 6.
The authors wish to thank the Doctorate School of the Politecnico of
Torino (SCUDO) for the financial support of the initiative.
Piergiorgio Alotto
Fabio Freschi
Maurizio Repetto
Carlo Rosso
Contents

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

4 Classical Physical Problems . . . . . . . . . . . . . . . . . . 49


4.1 Electrostatics and Electric Current Flow . . . . . . . . . . . 49
4.2 Magnetostatics . . . . . . . . . . . . . . . . . . . . . . . . . 54
4.2.1 Sources of the Magnetostatic Field . . . . . . . . . . 56
4.2.2 TEAM Problem 20 . . . . . . . . . . . . . . . . . . . 60
4.2.3 Force Computation . . . . . . . . . . . . . . . . . . . 61
4.3 Elastostatics . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
4.3.1 Elastostatics Definition . . . . . . . . . . . . . . . . 64
4.3.2 Finite Formulation of Elastostatics . . . . . . . . . . 71
4.3.3 Application of Elastostatic Formulation . . . . . . . 80
4.4 Thermal Transient . . . . . . . . . . . . . . . . . . . . . . . 83
4.5 Elastodynamics . . . . . . . . . . . . . . . . . . . . . . . . . 86
4.5.1 Eigenmode Analysis . . . . . . . . . . . . . . . . . . 87
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

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

Tonti diagrams [1], also known as classification diagrams, allow


a graphical representation of many physical theories to be made,
e.g. heat conduction, which will be used as an example in this
chapter, electromagnetism, solid mechanics and many more, and
they also provide the methodological framework for the develop-
ment of the cell method. A large number of such diagrams can be
found in [2]. At the heart of these diagrams is the classification of
physical variables into categories which clarify the roles they play
in the respective physical theories. Furthermore, these classifica-
tions allow one to obtain a clear understanding of the role played
by material laws. Another distinctive feature of this classification
is that it helps one recognize the natural association of physical
variables to space and time entities. This chapter is devoted to
an explanation of the above mentioned concepts and it forms the
basis of the development of the cell method.

1.1 Classification of the Physical Variables


The classification of the physical variables into categories endowed with par-
ticular features has a central role in physical theories [3, 4, 5, 6, 7, 8] and
provides useful hints on the properties such variables must have. According
to the classification scheme proposed by Tonti, all physical variables can be
classified as:
Definition 1. Configuration variables, which describe the configuration of
the field or system. They are linked to one another by sum, difference, limit,
differentiation and integration operations.
Definition 2. Source variables, which describe the sources of the field or the
forces acting on the system. They are linked to one another by sum, difference,
limit, differentiation and integration operations.
Definition 3. Energy variables, which are obtained as the product of a con-
figuration and a source variable. They are linked to one another by sum,
difference, limit, differentiation and integration operations.
P. Alotto et al.: The Cell Meth. for Electr. Eng. & Multiphys. Prob., LNEE 230, pp. 1–9.
DOI: 10.1007/978-3-642-36101-2_1 
c Springer-Verlag Berlin Heidelberg 2013
2 1 Tonti Diagrams

Table 1.1 Classification of variables and role of constitutive equations for station-
ary heat transfer problems

Configuration Constitutive Source


variable equation variable
Temperature Heat production density
Temperature gradient Fourier’s law Heat flux

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.

1.2 Local and Global Variables


Once the above classification has been established, a further logical step is
needed for the construction of Tonti diagrams. The standard mathematical
treatment of physical laws, namely the one based on partial differential equa-
tions, involves the use of point-wise scalar or vector quantities, which are
therefore local variables.
On the other hand, it is possible to consider, as primitive objects, entities
which do not depend on local quantities and are naturally and intrinsically
associated with space and time entities. In this framework (see e.g. Table 1.2),
global variables are defined as:
Definition 5. Global variables are domain functions, i.e. quantities associ-
ated to a space and/or time entity.
This approach offers an advantage in that domain functions are naturally
continuous, while local quantities are discontinuous at interfaces and need
additional conditions. However, as will become clearer later on, the concept
of continuum may to be reintroduced for the description of constitutive equa-
tions. Furthermore, the continuous or discrete treatment of time needs some
additional considerations which will be discussed later on in this chapter.

1.3 Cell Complexes


Differential formulations of physical laws are based on coordinate systems
in which local scalar or vector functions are defined. Formulations based on
global variables or domain functions instead deal with the cell complexes on
1.3 Cell Complexes 3

Table 1.2 Some local and global variables of stationary heat conduction

Differential setting Global setting


Temperature: T (K) Temperature: T (K)

Temperature gradient: 
g (K/m)  (K)
Temperature difference γ = g · dl

q (W/m2 )
Heat current density:  Heat current: Φ =  
q · dS (W)

Heat production density rate: σ (W/m3 ) Heat production p = σdV (W)

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:

• a point P , which has inner orientation if it is defined as a source (−) or a


sink (+);
• a line L, which has inner orientation if its boundary has inner orientation
(i.e. a direction has been defined on it);
• a surface S, which has inner orientation if its boundary has inner orienta-
tion;
• a volume V , which has inner orientation if its boundary has inner
orientation.

The outer orientation of a space entity is defined as:


• a volume Ṽ , which has outer orientation if normals have been defined
(i.e inside and outside can be distinguished);
• a surface S̃, which has outer orientation if one side is labelled + and the
other − (i.e. the direction of flow through it can be distinguished);
• a line L̃, which has outer orientation if a direction of rotation around it
has been fixed;
• a point P̃ , which has outer orientation if all lines originating from it have
an outer orientation.
It should be noted that, while the definition of inner orientation is inde-
pendent of the number of dimensions, the outer orientation depends on the
number of dimensions in which the space element is embedded, as shown in
Fig. 1.2 .
Once a tessellation (mesh) of space is built, a dual one can be built accord-
ing to simple rules, as shown in Fig. 1.3 for the case of triangular prisms. A
cell complex and its dual enjoy a particular property: once a primal complex
has been endowed with inner orientation, an outer orientation is induced on
its dual (see Fig. 1.4). In analogy with space, time also exhibits a dualism
(see Fig. 1.5):
4 1 Tonti Diagrams

V
L
P S


Ṽ P̃

Fig. 1.1 Inner and outer orientations



3D S̃

L̃ P̃
2D

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);

1.4 Variables and Orientation


An analysis of several physical theories reveals a close relationship between
the classification of the physical variables and the orientation of the cell
complexes which can be summarized in the following basic principles:
1.4 Variables and Orientation 5

Primal point Dual volume

Primal line Dual surface

Primal surface Dual line

Primal volume Dual point

Fig. 1.3 Primal and dual tessellations for triangular prisms


P

L P̃
S Ṽ

Fig. 1.4 Outer orientation induced on the dual by the primal

τ̃n

Dual t̃n t̃n+1

Primal tn−1 tn tn+1

τn τn+1

Fig. 1.5 Primal and dual time complexes


6 1 Tonti Diagrams

First Principle of the Classification Theory

• 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

Name Expression Space


Temperature P

Temperature difference γ = L ∇T · dl  L

Heat current Φ = S̃ q · dS
 S̃

Heat production p = Ṽ σdV Ṽ

Second Principle of the Classification Theory

• 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

Table 1.4 The second principle in stationary heat conduction

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

• do not involve metrical notions, i.e. lengths, areas, measures of volumes


and durations are not required;
• are “structural equations” or “topological equations”.

1.5 A Note on Time


In the above framework, time is treated in complete analogy with space and
this results in a very elegant theory. However, in order to represent some
physical theories, the following way of reasoning can sometimes be adopted:

• some quantities which depend on primal time instants can be thought as


being associated to dual time intervals;
• in this case, the primal instantaneous quantity can be interpreted as the
value of the average dual quantity;
• in practical studies of engineering problems, some variables and their order
of magnitude are well assessed: for instance a value of electrical current flow
measured in ampere would commonly be used in applications, while the
impulse of current flow, i.e., the electrical charge flowing through a surface
in a given interval of time, would be much more difficult to understand.

Therefore, in order to avoid such intricacies and to ease implementation,


e.g. in the case of sinusoidal steady-state problems or when particular time-
integration schemes are required, it is advisable to treat time as a contin-
uum, thus departing from Tonti’s classical theory without losing its main
advantages of dual space discretization.

1.6 Tonti Diagrams

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

• horizontal connections on the same plane represent reversible material


laws;
• front-to-back connections on opposite sides represent irreversible material
laws.

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

The cell method (CM) is a numerical scheme which implements


the classification of global variables, presented in the previous
chapter, in a numerical algorithm. This chapter is devoted to the
explanation of how Tonti diagrams can be directly translated into
a numerical procedure, how topological operators are translated
into matrices and how constitutive equations can be expressed in
terms of global variables. An extensive and mathematically rig-
orous presentation of many of the concepts summarized in this
chapter can be found, e.g., in [1].

2.1 The Numerical Scheme

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:

• the distinction between configuration and source variables;


• the inner or outer orientation of geometrical entities;
• the definition of pairs of dual grids;
• the framework provided by Tonti diagrams for the description of physical
laws.

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

Other fundamental parts of the cell method are:

• incidence or topological matrices, which are the discrete counterparts of


the differential operators usually found in the common partial differential
equation approach
• constitutive matrices, which are the discrete counterparts of the constitu-
tive equations commonly found in the field-equation setting

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:

• what is actually measured are integral quantities (current, charge, voltage),


and not point-wise ones treated by differential operators;
• solutions of the equations are most often found through numerical methods
which work at the discrete level
• only finite precision can be obtained.

These observations lead to the construction of a technique, called the CM,


which, starting from the framework provided by Tonti diagrams, leads di-
rectly to a numerical scheme.
2.2 Cell Complexes 13

Table 2.1 Basic entities of algebraic topology

Common name Algebraic topology name


Point 0-cell
Line 1-cell
Surface 2-cell
Volume 3-cell
Space-Time element 4-cell

2.2 Cell Complexes

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:

• triangles or quadrilaterals in 2d;


• tetrahedra or hexahedra in 3d.

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.

2.2.1 Basic Definitions of Algebraic Topology


and Cell Complexes

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

(a) 0-faces (b) 1-faces (c) 2-faces

Fig. 2.3 Faces of p-cells

(a) 0-faces (b) 1-faces (c) 2-faces

Fig. 2.4 Cofaces of a p-cell

Given a global physical quantity associated with a generic p-cell of a cell


complex, the knowledge of the amount of a physical variable associated with a
set of p-cells is called p-cochain. As an example, in heat conduction problems,
the assignment of the temperature to every node (0-cell) gives rise to a 0-
cochain. In electrostatic problems, the assignment of the electric voltage,
which in this case is a potential difference, to every edge (1-cell) gives rise to
a 1-cochain.

2.2.2 Coboundary Process

The coboundary process [3, 4] is a procedure which, starting from a p-cochain,


gives rise to a (p + 1)-cochain through a two-step process:

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 +1 -1


+1 e2
n1 e1
fk
ek +1
n2 e3
(a) ek = (−1)n1 + (b) fk = (+1)e1 +
(+1)n2 (−1)e2 + (+1)e3

+1
f3 f4
+1
f2
-1
vkk
-1
f1
(c) vk = (−1)f1 +
(−1)f2 + (+1)f3 + (+1)f4

Fig. 2.5 Coboundary process

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.

2.3 Topological Equations


Topological equations, which were described in the previous chapter, link
quantities in the same column of a Tonti diagram to each other and, according
to the second principle of the classification theory, represent the link between
the global variables referring to an oriented space-time element with others
referring to its oriented boundary.
16 2 Topological Equations

2.3.1 Incidence Numbers and Incidence Matrices

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:

• G, G̃: primal and dual edge-node matrices (discrete gradient)


• C, C̃: primal and dual face-edge matrices (discrete curl)
• D, D̃: primal and dual volume-face matrices (discrete divergence)

Ṽ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

Fig. 2.7 Primal and dual curl

Vk
dkj = −1 P̃k
dki = +1
Sj L̃j g̃jk = dT
kj
Si L̃i
g̃jk = −1
g̃ik = +1

Fig. 2.8 Primal divergence and dual curl


2.4 The Cell Method for Stationary Heat Conduction 17

It can easily be seen that the following equations hold:

D̃nṼ ×nS̃ = −GT


nP ×nL (2.1)
C̃nS̃ ×nL̃ = CT
nL ×nS (2.2)
G̃nL̃ ×nP̃ = DT
nS ×nV (2.3)

where nP , nL , nS and nV are the numbers of points, lines, surfaces and


volumes in the cell complex and nP̃ , nL̃ , nS̃ and nṼ are the number of
points, lines, surfaces and volumes in its dual complex. A further interesting
property is that the boundary of a boundary is the empty set.
Example: The ith row of C lists the signed edges bounding the ith face of
the cell complex in its columns. The corresponding rows in G list the signed
nodes defining such edges. Since the boundary is closed each node is taken
twice, once with a + sign and once with a - sign. The sum is therefore 0.
Expressed in matrix form, the above property translates into:

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.

2.4 The Cell Method for Stationary Heat Conduction


We now examine, in some detail, how all the previously presented concepts
allow the direct construction of a numerical scheme for the stationary heat
equation, while several more examples are presented in the next chapters in
order to highlight some specific features of the individual physical problems.
• Physical laws: The first step for the construction of a CM formulation
for a physical problem is the expression of such a problem in terms of
domain quantities (global variables). This follows from the first and second
principles of the classification theory presented in the previous chapter. In
the case of stationary heat conduction, conservation of energy states that
“The heat current referring to the boundary of a dual volume, endowed
with outer orientation, equals the heat production inside the dual volume
in the same time interval”. Material laws are also expressed in terms of
the same quantities, as described in the next chapter, and are indicated by
matrices M• .
18 2 Topological Equations

p Ṽ
P T

γ = GT p = D̃Φ

L γ Φ = −Mλ γ Φ S̃

Fig. 2.9 Tonti diagram for stationary heat conduction

• 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).

2.5 A Note for Practitioners


The formal construction of a CM formulation for a given problem relies on
the previously described steps. However, due to the analogies between the
2.6 Links with Other Numerical Methods 19

Table 2.2 Rules for the construction of the cell method formulation from a partial
differential equation

Partial differential equation Cell method


grad G or G̃
div D or D̃
curl C or C̃
Constitutive equation Square constitutive matrix

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:

∇ · (λ∇T ) = −σ. (2.12)

2.6 Links with Other Numerical Methods

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:

• the CM is similar to the finite integration technique, which was initially


implemented in the MAFIA code and is now part of the CST Microwave
Studio [6] commercial software;
• the CM is similar to the Tubes and Slices method proposed by Hammond
and Sykulski for electromagnetics [7];
• the CM is similar to the finite volume method, which is based on a strict
enforcement of conservation laws;
• some concepts of the CM can be found in modern finite element methods
(FEM) based on edge/facet elements (Nedelec, Raviart-Thomas, Whit-
ney), which are popular in the electromagnetic community [8, 9, 10];
• the CM with a leapfrog time-stepping scheme on a cubic mesh is very
similar to the finite difference in time domain based on Yee staggered cells
[11], and both are explicit schemes in time;
• in some cases, e.g. [12], equivalences with other methods, and in particular
with FEM, can be proven so that the convergence behavior of the CM can
be established by analogy.
20 References

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

A brief outline of some common characteristics of the computa-


tion of constitutive equations is presented hereafter and the for-
mulation of the constitutive problem will then be detailed for two
different kinds of discretization: structured and unstructured. The
thermal problem is used as an example of one kind of formula-
tion, whereas the magneto-static problem is employed to introduce
another material link formulation.

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

3.2 Example of a Constitutive Equation for a Simple


Problem
Constitutive equations have to be defined in many problems and one of these
problems concerns the solution of electrical networks. In this case, there are
two different sets of constraints:
• topological equations, usually called Kirchhoff’s laws, that are applied to
currents and voltages and which can easily be written once the network
topology has been defined in terms of nodes and meshes;
• constitutive equations.
In the case of a resistive network, a constitutive link is needed to define the
relationship between the current and voltage at the terminals of the resistor.
This link depends on the space dimensions of the resistor and on its material
characteristics. Although, in the general case, the definition of equation:
e = e(j) (3.1)
where e and j are the voltage and the current at the resistor terminals re-
spectively, is a complex problem, its definition can be drastically simplified
if the resistor has a simple geometry. In the case of a resistor made of a
cylinder with cross section S and length L and uniform material properties,
see Fig. 3.1, a well accepted hypothesis allows one to state that the current
crossing the resistor is distributed evenly over its cross section and gives rise
to a current density field that is directed along the axis of the cylinder and
whose magnitude is given by:
j
|J|
 = (3.2)
S
Once the magnitude and direction of the current density vector have been
defined, the field based constitutive equation ruling the current flow can be
applied. In the case of a linear material, at each point of the resistor the
relationship between current density J and electric field E,
 is given by:
 = ρJ
E (3.3)
where ρ is the electrical resistivity, which is a material property of the con-
ductor. Due to uniformity of J and the homogeneity of the material property
 is also uniform and directed along the cylinder axis. The elec-
distribution, E
tric voltage at the resistor terminals and the electric field are related through
the line integral operator defined on the cylinder axis:

e= E 
 · dl (3.4)
L


 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 Constitutive Equations for Orthogonal Grids


The use of an orthogonal subdivision of the problem domain implies that the
primal and dual cells are hexahedral volumes. This fact greatly simplifies the
computation of the constitutive equations. Two cases are of interest in many
physical problems:
Case 1. A relation that links a quantity defined on the primal edges to one
defined on the dual faces. One example worth mentioning is the case
of a temperature difference along the primal edge and a heat flux on
the dual face, or an electric voltage and the corresponding current;
Case 2. A relation that links a quantity on the primal face, for instance, a
magnetic flux on the primal face and a magneto-motive force on the
corresponding dual edge.

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

in a couple, defined by the property of duality, ensures that the material


parameter is always positive. The definition of the material relationship is
based on the assumption of field uniformity around the couple, in a similar
way to the one used for the computation of the resistance parameter in the
previous section. If a thermal flux Φ is defined on the dual face, the normal
component of the heat flux density vector Φn is given by:
Φ
Φn = (3.8)
S
where S is the area of the dual face. The tangential component of the tem-
perature gradient vector gt along the primal edge can be defined as:

γ = 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.

3.3.3 Constitutive Matrix Set-Up

The computation of constitutive parameters can be performed for each couple


of dual entities in the mesh to build a constitutive matrix that links every
quantity to its dual: if an array of NL elements γ contains all the temperature
differences on the problem domain, it can be related to the heat flux array
Φ defined in all the corresponding dual faces by means of a square matrix
of NL × NL dimensions that contains the parameter that was previously
computed as:
Φ = −Mλ γ (3.12)
square matrix Mλ is the thermal conductance matrix and (3.12) can be used
in the matrix algebra formulation of the problem.
28 3 Constitutive Equations

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.

Algorithm 1. Matrix set-up algorithm


1: procedure AssembleMatrix(geometry,material properties)
2: for all primal volumes do
3: build local interpolation local orientation
4: build local matrix
5: for all geometric entities do edges/faces
6: store local matrix in global matrix global orientation
7: end for
8: end for
9: end procedure

3.4 Constitutive Equations on Tetrahedral Grids


The use of unstructured meshes is closely connected to the application of
any numerical technique to any engineering problems. Complex geometries,
curved boundaries and objects with uneven spatial dimensions in the same
problem domain, make it necessary to use irregular spatial discretization.
The use of triangles/tetrahedra or distorted quadrilaterals/hexahedra is thus
often inescapable in many technical environments.
While the basic concepts about constitutive matrix set-ups are the same,
as in the case of an orthogonal mesh, the lack of geometric orthogonality
between dual entities again requires some hypotheses on local field behaviour.
This time the computation of constitutive parameters will in some way be
more complex than in the previous case.
As can be understood from the scientific literature on the topic, the defi-
nition of a unique and optimal way of computing constitutive equations on a
tetrahedron has not been yet obtained and several possibilities are available
for this task. The research work on this issue has defined some of the desider-
ata features that this optimal solution should have in terms of the property of
the resulting constitutive matrix [1]. Even though not all of these properties
are needed for a correct application of the CM, the main requirements that
are often required for the matrix are:
• symmetry of the whole constitutive matrix: in the case of tetrahedral
meshes, the constitutive matrix is sparse and usually not symmetric, al-
though in some cases the final assembled stiffness matrix may have this
useful property;
• positive definiteness;
• accuracy: intended as the property of reducing discretization errors to zero
when the mesh dimensions become small;
30 3 Constitutive Equations

• consistency: a property which should ensure that the constitutive matrix


correctly reconstructs a uniform physical field without introducing ficti-
tious variations.
These properties can be more important in some particular numerical appli-
cations of the CM than in others. A more exhaustive treatment of this topic
can be found in [2, 3, 4].
Among the possibilities defined by researchers, two main different ap-
proaches can be highlighted in the computation of constitutive matrices on
tetrahedra:
• a geometrical approach based on the application of simple geometric rules
to the tetrahedron;
• the definition of local interpolation functions on the tetrahedron. This
approach can take advantage of the previous experience gained in the ap-
plication of similar concepts in Finite Element.
The first approach is by far the simplest, when the physical characteristics
of the field to be treated satisfy the hypothesis of a uniform field inside a
tetrahedron. The other approach can be more convenient in case of more
complex field patterns, as will be explained in the following sections.

3.4.1 Uniform Field


The hypothesis of local uniformity of the field variables has been introduced
to write a connection between the global variables and their corresponding
field counterparts. If tetrahedra are used as the primal volumes, there are
some particular cases where uniformity of the field variables inside primal
volumes is a consequence of the basic properties of the physical field. In these
situations, particular approximations can be defined inside primal volumes.
Conservative fields can be treated by means of the uniformity approach.

Case 1: Example of a Thermal Problem

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)

temperature differences γj , j = 1, . . . , 6 to the six heat fluxes on the partial


dual face Φj , j = 1, . . . , 6. All these quantities refer to a local orientation of
the geometrical patches; for instance primal edge 1 is oriented from the first
to the second node of the tetrahedron. As already mentioned, the complete
constitutive matrix is then assembled by summing all relevant contributions
with proper orientations as shown in Fig. 3.8. The thermal field is conserva-
tive since the line integral of the temperature gradient field along a closed
line must be zero. Using the contour of the triangular faces of the tetrahe-
dron as closed lines, only two out of three temperature differences γ along the
primal edges will be independent. For example by looking at edge numbering
reported in Fig. 3.10 and applying a line integral to the contour of face f1 ,
it can be obtained that:

γ1 − γ4 − γ2 = 0 ⇒ γ4 = γ1 − γ2 (3.14)
32 3 Constitutive Equations

As a consequence, only three out of the six temperature differences defined


along the primal edges of a tetrahedron are independent for the whole tetra-
hedron. The other three differences can in fact be computed as dependent
quantities. As reported in Fig. 3.10, the three independent temperature dif-
ferences can be selected by defining a tree along the primal edges of the
primal volume. The three independent variables, for instance γ1 , γ2 and γ3 ,
are compatible the number of degrees of freedom of an unknown uniform
temperature gradient field g = (gx , gy , gz ) inside a three-dimensional primal
volume. On the basis of this, a linear system of equations can be set-up by
geometrically linking the unknown components of g to the three independent
temperature differences. The link between the vector field components and
the global variables should come out of a line integral operator. By exploiting
the uniformity of g, this operation can be surrogated by a scalar product of
the gradient vector with the primal edge vector:

γ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:

Φ = χ(loc) Φ (3.22)

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)

therefore (3.23) can be written in terms of global variables as:

(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

Case 2: Example of a Magnetic Problem

The magnetic constitutive equation should link configuration variable mag-


netic flux b, defined on the primal faces to the line integral of the magneto-
motive force h along the dual edges. Again, as in the previous section, the
entire dual edge does not belong to just one primal cell, as can be seen in
Fig. 3.11, therefore the two contributes that correspond to the parts of the
dual edge should be computed separately and then summed in the global con-
stitutive matrix. Solenoidality of the magnetic flux density vector B  holds
for any time varying condition and can be used to highlight a basic prop-
erty inside the tetrahedra. Referring to primal volume shown in Fig. 3.11,
solenoidality of the magnetic flux density imposes that:
b1 + b2 + b3 + b4 = 0 (3.27)
where bi is the magnetic flux through the ith primal face. On the basis of
(3.27), one magnetic flux in the primal volume can be expressed as a function
of the other, for instance:
b4 = −b1 − b2 − b3 (3.28)
thus only 3 independent fluxes can be defined in a tetrahedron, the fourth
being dependent on the others. As in the aforementioned case of temperature
difference, this condition is consistent with a uniform magnetic flux density
inside the tetrahedron. By defining the area vector Si associated with the
primal face, the magnetic flux can be defined as:
 ·S
bi = B i = Bx Six + By Siy + Bz Siz (3.29)
by arranging the area vector components on the rows of a 3 × 3 matrix S,
and the components of B in a 3 × 1 column vector, B, equations such as 3.29
can be written as:
b = SB (3.30)
3.4 Constitutive Equations on Tetrahedral Grids 35

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)

An augmented Q matrix can be introduced to match result of (3.31) with


flux vector which contains four entries, by adding a column of zeros in corre-
spondence to the dependent flux, so that Qa is a 3 × 4 matrix.
In the case of homogeneous materials, a uniform B  implies a uniform
 inside the primal volume:
magnetic field H
 = νB
H  (3.32)

where, in general, ν is a scalar value in isotropic materials which could become


a 3 × 3 tensor in the case of anisotropic materials. Magneto-motive forces
can be obtained by projecting the magnetic field onto dual edge vectors
 = (L̃ , L̃ , L̃ ) so that:

i ix iy iz
 ·H
hi = L̃  (3.33)
i

again, by rearranging the dual edge components inside a 4 × 3 matrix L̃,


magneto-motive forces can be obtained as:

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.

Case 3: Contribution of Permanent Magnets

Evaluating magnetic field H  must take into account possible magnetization


sources present in the material. These sources can be due to permanent mag-
nets or, in general, to magnetic materials with hysteresis. In this case the
field based constitutive relation becomes:

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

Fig. 3.12 Material characteristic of a permanent magnet

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)

The treatment of assigned magnetization sources is mandatory in the case


of permanent magnet materials, but this technique can also be useful for
the treatment of nonlinear magnetic materials. A detailed description of this
topic in contained in [6].

3.4.2 Non-uniform Field


In the previous sections, the field uniformity inside volumes was compatible
with the static regime of the problem. Unfortunately, this hypothesis does
3.4 Constitutive Equations on Tetrahedral Grids 37

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

A micro-cell is defined as the intersection of a primal volume with a dual one.


An example of a micro-cell in a two-dimensional space is shown in Fig. 3.13.
The number of micro-cells inside a primal volume is equal to the number of
primal nodes. An example of a micro-cell inside a tetrahedron is shown in
Fig. 3.14. If Ohm’s constitutive equation is considered:
 = ρJ
E (3.41)

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

 Focusing on the α micro-cell and considering that edges


resistivity ρ by J.
k, j and n are incident on node α (see Fig. 3.15), a relation can be written
that links currents jk , jj and jn to current density vector Jα
⎡ ⎤ ⎡ ⎤⎡ ⎤
jk S̃kx S̃ky S̃kz Jxα
⎢ ⎥ ⎢ ⎥⎢ ⎥ α α
⎢ j  ⎥ = ⎢ S̃jx S̃jz ⎥ ⎢ α ⎥ α
⎣ j ⎦ ⎣ S̃jy ⎦ ⎣ Jy ⎦ ⇒ j = S̃ J (3.42)
jn S̃nx S̃ny S̃nz Jzα

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)

and by rearranging the local matrices of (3.46) as functions of the local


current vector with six components and adding suitable rows or columns full
of zeros in correspondence to the missing entries in the micro-cell vectors of
thecurrents, the final expression of the local constitutive matrix is obtained:
e = M(loc)
ρ j (3.47)

Again, as in the previous cases, the coefficients matrix M(loc)


ρ must be as-
sembled with the global constitutive matrix, after a proper orientation of the
primal edge is considered.

3.4.3 Whitney Interpolation


An alternative way of defining the material operator is to use of Whitney
elements (or, more precisely, Whitney forms) [8, 9]. The idea of using this
kind of vector, which interpolates functions inside the tetrahedron and uses
them to define constitutive equations for the cell method, was firstly presented
in [10] in 2d form and extended in 3d magnetostatics in [7]. Four different
basis functions are used to describe different fields [11]:
40 3 Constitutive Equations

• 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 h, k, l are the nodes that define the ith face;


• piecewise constant functions (see Fig. 3.16d) are used for scalar volume
quantities.
Whitney elements are endowed with a continuity property at the element
boundaries. Considering edge elements, continuity of the tangential compo-
nent of the local field between adjacent elements is ensured if:

E  1 if i = j
 j · dl =
w (3.50)
Li 0 if i = j

In the context of the CM, Whitney elements are used as interpolators of


point-wise physical quantities which have the corresponding global variables
as degrees of freedom. Considering, for example, the electric problem,
the electric field inside each tetrahedron is interpolated by means of edge
elements:
6
 r) =
E(  iE (r )xi
w (3.51)
i=1

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

(a) Nodal basis function. (b) Edge basis function.

(c) Face basis function. (d) Volume basis function.

Fig. 3.16 Whitney basis function of lowest order

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

with local contributions equal to:



mν,ji =  iF · dL
νw  (3.59)
L̃j

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].

The Galerkin Approach

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

Finally, the constitutive matrix is made up of terms of the form:




mε,ji =  jE · w
εw  iE dV (3.64)
Vm

When this approach is adopted, the constitutive matrix is clearly symmetric


and therefore the final system matrix is also symmetric. Furthermore, it can
easily be shown that the final system matrix coincides with the matrix that
can be obtained through the use of a finite element method based on nodal
shape functions.
The procedure can easily be extended to the magnetic constitutive matrix.
By imposing equality of the magnetic energy, calculated from the energy
density and from global quantities:

1
4
1 
Wm = B · HdV = bi hi (3.65)
Vm 2 2 i=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

3.5 Thermal Mass Matrix

None of the previous approaches explains how to build a constitutive ma-


trix that links the quantities defined on the primal nodes to those defined
on the dual volumes. This can instead be obtained using the mass matrix in
the thermal transient problems (see chapter 4). The methodology follows the
Whitney interpolation procedure closely. The point-wise constitutive equa-
tion that links specific internal energy U to temperature T is:

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

Temperature is then interpolated by means of Lagrangian nodal shape func-


tions. Equation (3.68) reads:
 
4 
4 
uj = u0 + ρc wiN Ti dV = u0 + Ti ρcwiN dV (3.69)
Ṽj i=1 i=1 Ṽj

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

It could be advantageous to assemble Mρc as a diagonal matrix , e.g. when


explicit methods are used to solve transient problems (see chapter 4). The
use of Lagrangian nodal functions gives rise to sparse matrices, with non-
null off diagonal elements (3.70). The idea is to use a different interpolation
of the temperature field inside the simplex: the temperature, inside each
dual volume, is constant and equal to the temperature of the corresponding
primal node. This is equivalent to choosing piece-wise constant interpolating
functions (pulse basis function) pNi with the dual volume as a finite support.
The resulting local contribution to the constitutive matrix becomes:
 
 N Ṽj
ρcdV if i = j
mρc,ji = ρcpi dV = (3.71)
Ṽj 0 if i = j

This approach is the same as the well known technique of mass lumping,
which is common in finite elements [13].

3.6 Boundary Conditions

Boundary conditions are used to constrain the solution behaviour of specific


geometrical entities. This behaviour can either be due to the physical charac-
teristics of the problem or to symmetries. An example of this situation can be
observed through the two-dimensional domain shown in Fig. 3.17. A hollow
rectangular domain has two imposed temperature values on the inner and the
outer boundaries. These values are obtained from the physical condition of
the system and should be imposed in the computational scheme. In addition
to the physical constraints, other considerations concerning domain bound-
aries can be made: owing to the geometrical symmetry, the shown solution
is constrained to be symmetric with respect to lines AA and BB  so it is
sufficient to analyze only one quarter of the domain and reduce the number
of unknowns in solution. By cutting the original problem to one fourth, its
boundaries are partly made by assigned temperature values (with reference
to Fig. 3.19, segments AB, BC, DE and EF ) and partly without any phys-
ical constraint (segments CD and F A). It can be noted that, in the case of
3.6 Boundary Conditions 45

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 

segments with imposed temperature values, the solution is characterized by


temperature iso-value lines that are approximately parallel to the segment.
In this condition, the gradient of temperature T is normally directed to the
boundary, that is ∇T · t = 0 when t is the unit vector tangential to the
boundary segment.
In the other case, symmetry imposes that the temperature iso-value lines
meet boundary segments orthogonally and the tangential component of tem-
perature gradient is null, or that ∇T ·n = 0, when n is the unit vector normal
to the boundary segment. This particular configuration implies that the tem-
perature gradient is parallel to the segment and that the entire thermal flux
on the boundary is tangential to it. The primal nodes lying on imposed tem-
perature boundaries are not the unknowns of the problem and no equation
therefore must be written for them. On the contrary, primal nodes belong-
ing to the other kind of segments have an unknown temperature value and
46 3 Constitutive Equations

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

should therefore be constrained by an equation. In order to do so, some


considerations must be made, taking into account that if a primal node lies on
a symmetry boundary, the surface of its dual volume is partly inside the grid
and partly outside, as can be seen in Fig. 3.20. In order to impose the balance
of thermal fluxes on this dual volume (referring to the previously mentioned
Tonti diagram reported in Fig. 2.9), some considerations on symmetry must
be made. A virtual part of the dual volume must be constructed outside the
mesh. Due to symmetry, the thermal fluxes on the virtual part of the dual cell
(drawn in dashed lines in Fig. 3.20) must be equal to those contained inside
the mesh. On the basis of this hypothesis, the balance in thermal fluxes on
the dual surfaces can be written as:

Φ1 + Φ2 + Φ3 + Φ1 + Φ2 + Φ3 = 0 ⇒ 2(Φ1 + Φ2 + Φ3 ) = 0 (3.72)


References 47

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

The cell method presented in the previous chapters can be applied


to different classes of physical problems. Some of these classes are
presented in this chapter, in both static and time-varying formu-
lations, together with a short explanation of their main charac-
teristics. All the CM results have been obtained by means of the
DualLab research software [1].

4.1 Electrostatics and Electric Current Flow


Both electrostatic and stationary current flow problems are solved by asso-
ciating variables to points. Moreover, since the physical laws that describe
these problems are almost identical to each other, their numerical treatment
can be unified with the help of the CM.
The formulation of an electric current flow inside biological tissues is pre-
sented as a case of interest for the application of the CM.
The electrical activity of the brain can be illustrated by means of an elec-
troencephalographic test: physiological electric currents, created by neuron
firing, give rise to an electric potential distribution inside the head which can
be recorded on the scalp [2]. The electric potential study allows the effect
of single or multiple current dipoles on the scalp potentials to be simulated
and therefore be used to reconstruct the unknown distribution of dipoles in-
side the brain. While the main research activity on this topic is related to
the inverse problem, that is, finding the unknown source - the dipole - once
potential values are known, the direct problem, that is, finding the poten-
tial distribution considering the dipole position and magnitude as known,
presents some difficulties. The geometry and materials of the head are in fact
unevenly distributed and their structure must be obtained through a medical
examination on the patient’s head. The number of unknowns in this prob-
lem can become unbearably high and the geometrical structure is not simple.
The CM is used for direct problem solution of the electrical conduction prob-
lem, according to the scheme of the Tonti diagram shown in Fig. 4.1, and in
analogy with the derivation of (2.11), the following is obtained:

∇ · (σ∇v) = −∇ · Js (4.1)


P. Alotto et al.: The Cell Meth. for Electr. Eng. & Multiphys. Prob., LNEE 230, pp. 49–90.
DOI: 10.1007/978-3-642-36101-2_4 
c Springer-Verlag Berlin Heidelberg 2013
50 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

where σ is the electrical conductivity of the materials, v is the electric scalar


potential and Js is the imposed source electric current, which represents the
neuronal electrical activity, and which is discretized as:

D̃Mσ Gv = Kv = −D̃js (4.2)

where D̃ is the dual discrete divergence operator (volume-face incidence ma-


trix equal to GT ), Mσ the conductance constitutive matrix, G the discrete
gradient operator (edge-node incidence matrix), K the stiffness matrix given
by the product of D̃Mσ G and js is the imposed currents defined on the
primal edges [3].
The anatomy of a head of a volunteer has been reconstructed using semi-
automatic procedures, starting from the images provided by MRI. The voxels
of the model have 1.14 mm × 1.14 mm × 1.5 mm dimensions: 1.6 × 106 nodes
belong to the whole model. A semi-automatic segmentation process was used
to reconstruct tissues from the MRI data and a model, consisting of seven
materials, whose properties are reported in Table 4.1, was used. The activa-
tion region of the brain was studied during a motor stimulus that consisted
of the repeated flexing and extending of the five fingers on the right hand
by the volunteer adopting a block design, in which five periods of activation
were alternated with five periods of rest. The active region, as defined during
a MRI test [4], is shown in Fig. 4.3. The potential distribution obtained is
shown in Fig. 4.4

Remark: Current Flow Problems and Analogies with the Network


Theory

The educational value of the CM is particularly evident when students are


familiar with general network analysis methods. This is mainly due to the
fact that they are used to working with incidence matrices [1].
Tonti diagrams for resistive networks are shown in Fig. 4.5. It should
be noted that this diagram is related to dimensionless cells, i.e. graphs.
4.1 Electrostatics and Electric Current Flow 51

Table 4.1 Conductivity of some biological tissues at low frequencies

Tissue Conductivity (Sm−1 )


Grey matter 0.33
White matter 0.14
Cerebrospinal fluid 1.54
Muscle 0.1
Bone 0.00625
Fat 0.04
Skin 0.43

Fig. 4.2 Distribution of the materials inside the head

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)

similarly, mesh analysis is obtained by solving the network in terms of mesh


currents
MRMT i = 0. (4.4)
Independent current (voltage) sources in nodal (mesh) analysis [5] are as-
signed as boundary conditions, i.e. currents (voltages) are imposed on some
edges. It is easy to see that the construction process of the linear system from
the Tonti diagram is similar to that of other field theories. The analogies be-
tween circuit and fields are not new, and can be found in the pioneer work
of Branin which was published in 1966 [6].
This great similarity between field and circuit formulations can be ex-
plained as follows:
4.1 Electrostatics and Electric Current Flow 53

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

Fig. 4.5 Tonti diagram of the network theory


54 4 Classical Physical Problems

1. The use of an algebraic structure is based on global variables which are


the same as those used in the circuit theory. Voltages and currents are
in fact obtained by integrating the local quantities on the spatial element
they belong to;
2. Under the basic hypothesis of the circuit theory, the application of Kirch-
hoff laws transforms the irrotationality of the electric field and the
solenoidality of the electric current density into matrix equations and this
process is similar to the one that is applied in algebraic formulation;
3. Constitutive equations contain all the necessary metric information on
the physical components (extension, length and material characteristics)
so that the spatial dependence of the parameters disappears in the final
equations and only a time dependence of the network variables is left.

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

The complete formulation of electromagnetic equations implies the coupling


of electric and magnetic fields in the case of time varying phenomena. Under
static conditions, if the variables in the field do not all depend on time, the
Maxwell equations can be simplified, because some terms that link magnetic
to electric quantities disappear. This is the case of magnetostatics, that is, the
special version of electromagnetic equations which only deals with magnetic
quantities. In this state, the two equations that are useful for the study of
magnetostatic phenomena are:

• 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:

• electric current flow, j, the source variable associated to dual faces;


• magneto-motive force, h, the source variable associated to dual edges;
• magnetic flux, b, the configuration variable associated to primal faces.

A direct formulation, in terms of the afore-mentioned global variables, is


possible but, in order to reduce the number of unknowns in the problem so-
lution, potentials are usually used instead. Two potentials can be defined in
magnetostatics and have been widely used in the literature. One potential is
the magnetic scalar potential which can be defined in all regions of space in
which the magnetic field is irrotational [7]. This mathematical condition is
4.2 Magnetostatics 55

L a j S̃

b = Ca j = C̃h

S b h = Mν b h L̃

Fig. 4.6 Tonti diagram of magnetostatic problems

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)

which can be combined in one solution equation as:

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].

4.2.1 Sources of the Magnetostatic Field


The RHS of equation 4.8 contains two kinds of sources: current and mag-
netization sources. The second ones were treated in the previous chapter
and are physically due to phenomena of hysteresis in ferromagnetic materials
and permanent magnets (see (3.36)). As has already been pointed out, these
sources are material dependent, are defined on primal volumes and are in-
serted into the equation multiplied by CT . They are intrinsically divergence
free and thus consistent with the LHS equation. The same property does not
necessarily hold for the distribution of j, especially if this is obtained from
the geometrical relation defined in the geometry discretization phase.
The RHS term that depends on magnetization can also be related to “com-
putational” magnetization sources. In fact, ferromagnetic nonlinear materi-
als require a special solution that involves an iterative linearization scheme.
Using the fixed Point (F P ) technique [12], the nonlinear material character-
istics can be expressed as:
H = H(B) = νFP B + MR (4.10)
where νFP is a constant reluctivity and MR is a nonlinear residual, which is
updated iteratively throughout the solution process. The FP theory gives an
optimal value of νFP , which can be obtained from the slopes of the nonlinear
curve. This nonlinear residual can be interpreted as a magnetization source
[13], and obtained from the previous nonlinear iteration. In this case, it is
considered, for the current iteration, as a known magnetization.
In order to ensure the consistency of:
C̃Mν Ca = j (4.11)
it is necessary that the right-hand-side is divergence free on the dual dis-
cretization. This is due to the fact that if the dual discrete divergence is
applied to (4.11):
4.2 Magnetostatics 57

(a) (b)

Fig. 4.7 Coil and cut edges

D̃C̃ ≡ 0 ⇒ D̃C̃Mν Ca = D̃j = 0 (4.12)


different approaches are possible. A reduced magnetic scalar potential is used
in [14]. The authors obtained a suitable edge element representation of the
rotational part of the magnetic field from a given source current distribution.
A method to obtain the current density with divergence-free in the facet-
element space has been proposed in [15]. An iterative technique, based on
tree co-tree decomposition of primal edges, starting from a known current
density in source conductors, has been adopted in [16] to ensure solenoidality
of the source current.
An alternative method that applies to conductors of any shape, and which
does not require any initial hypothesis on the current density field is here
presented. The method can also be applied when the source conductor is cut,
due to symmetry properties of the domain.
The method is based on two steps:
1. Solution of the current field problem;
2. Computation of divergence free currents.

Coils in magnetostatic problems are characterized by uniform current density


in their cross-section. This is due to the fact that winding is often earned
out in many turns and stranded coils emerge. The geometrical dimensions
of a single wire in the winding is much smaller than the other geometrical
dimensions and they are therefore represented in the problem as massive
conductors. Even though this approach is simple, it is not physical because
the current density in massive conductors naturally increases the intensity
in correspondence to short radius bends, while in stranded conductors it is
constrained to be parallel to the conductor geometry. A fictitious current field
problem is solved to impose a current through a closed conductor. A cut-set
or a cross section of the conductor is identified by a set of dual facets. Each
of these facets is one-to-one linked to the primal edges. The primal edges
(dual faces) belonging to this cut-set are identified by means of the incidence
58 4 Classical Physical Problems

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

The final system is symmetric if Mσ is symmetric. The computational cost


is negligible, since the domain is only restricted to the coil, with nodal scalar
unknowns.
If the conductor reaches the boundary of the domain under study,
e.g. when the domain is restricted due to symmetry properties of the prob-
lem, the current field solution is even simpler, since the current field problem
is driven by imposed potentials at the boundary of the domain.
Once the solution is available, the current density J is post-processed and
normalized in order to obtain unit vectors that indicate the direction of J in
each kth element
Jk
Jkn = (4.16)
|Jk |
For this reason, it is clear that the conductivity value σ used in this fictitious
problem does not have any physical meaning and it can assume any finite value.
Once the directions of the currents have been defined, the next step is to
develop a method which guarantees that the resulting currents through the
dual faces are divergence free. By definition, the currents are linked to the
current densities through the relation:

jkn = Jkn · dS
 (4.17)
S̃k

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

Fig. 4.8 Dual face corresponding to a primal edge

the remaining nE −nN +1 edges belong to C. The vector of currents assembled


by (4.17) is reordered according to the tree-cotree decomposition:
 
  jn
T
D̃j = D̃T D̃C =0 (4.18)
jnC

If the cotree currents are considered as known, (4.18) reads:

D̃T jnT = −D̃C jnC (4.19)

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 )

4.2.2 TEAM Problem 20


A standard TEAM (testing electromagnetic analysis methods) problem is
presented as an application example of a nonlinear magnetostatic formula-
tion,. TEAM is a class of problems that has been defined inside the electro-
magnetic research community to provide a test-bench that can be used to
compare different computational techniques [18].
The model structure is shown in Fig. 4.10 and in Fig. 4.11, while a more
complete description of the problem can be found in [19]. The centre pole
4.2 Magnetostatics 61

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.

4.2.3 Force Computation

Force computation in electromagnetic problems can be approached in several


ways, but it should be always considered a critical issue when a numerical
method is used to evaluate the field, see, for example, [20]. Computation of the
force using Maxwell’s stress tensor should always be treated with attention
when the magnetic field is evaluated by means of a volume discretization
technique. The value computed by the integration of the Maxwell tensor can,
in particular, be affected by a large error when the integration surface crosses
62 4 Classical Physical Problems

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

Table 4.2 Computational times of the different phases

Current (A) Factorization (s) Solution (s) Force (s)


1000 334 0.43
3000 250 0.24
4
4500 189 0.28
5000 185 0.35

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

of Maxwell’s stress tensor is negligible compared to the solution time. The


obtained results are shown in Fig. 4.14. Two forces are computed: one acting
on the centre pole and one acting on the yoke. The two different values should
be equal, on the basis of the third law of dynamics, but they are different
due to numerical errors and their difference can be used as a measure of the
computation error. They are compared with reference values obtained from
direct measurements and the relative mean error between the measured and
computed values is about 5.6%.

4.3 Elastostatics

4.3.1 Elastostatics Definition


Elastostatics is the field of physics that analyzes the way in which a body
deforms under an external action. In particular, it studies all the relation-
ships between forces and displacements, in order to predict the final shape
and the capability of the components to overcome their mission without fail-
ing. Elastostatics is based on the equilibrium equations of the body and it
4.3 Elastostatics 65

is used to study its quasi-static or steady-state conditions. It is a sub case


of elastodynamics, and is used to define all the variables of the mechani-
cal problem: displacement, strain (configuration variables) force and stress
(source variable). The main operative quantities of elastostatics will be intro-
duced hereafter and their relations will then be highlighted with differential
notation according the classical approach described in [21].

Displacement and Strain, Configuration Variables

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

points P  and Q , named U  , is therefore equal to the initial distance U , plus


a variation, which is called dh in the following. By looking at Fig. 4.19 and
the above-depicted relationships, it is possible to write the equation

dUP + U = dUQ + U  = dUQ + U + dh (4.25)

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

and the second ones give the deformation matrix


⎡ ⎤
∂u 1 ∂u ∂v 1 ∂u ∂w
⎢ ∂x 2 ( ∂y + ∂x ) 2 ( ∂z + ∂x ) ⎥
⎢ ∂u ∂v
ε = ⎣ 2 ( ∂y + ∂x )
1 ∂v 1 ∂v ∂w ⎥= (4.30)
∂y 2 ( ∂z + ∂y ) ⎦
1 ∂u ∂w 1 ∂v ∂w ∂w
2 ( ∂z + ∂x ) 2 ( ∂z + ∂y ) ∂z
⎡ ⎤
1 1
εxx 2 γxy 2 γxz
⎢ ⎥
⎢ 1 1 ⎥ (4.31)
⎣ 2 γxy εyy 2 γyz ⎦
1 1
2 γxz 2 γyz εzz
4.3 Elastostatics 69

Hence, adopting the notation introduced by Timoshenko [21], that organizes


the elements of the symmetric matrix ε in a six element vector (see (4.32),
it is possible to express the relationship between body shape and volume
modification and displacement of its points.
⎡ ⎤ ⎡ ∂ ⎤
εxx ∂x 0 0
⎢ ⎥ ⎢ ⎥
⎢ εyy ⎥ ⎢ 0 ∂y ∂
0 ⎥⎡ ⎤
⎢ ⎥ ⎢ ⎥ u
⎢ ε ⎥ ⎢ 0 ∂ ⎥⎢ ⎥
⎢ zz ⎥ ⎢ 0 ∂z ⎥⎢
ε=⎢ ⎥=⎢ ∂ ⎥⎣ v ⎥⎦ = ∂U (4.32)
⎢ γxy ⎥ ⎢ ∂
0 ⎥
⎢ ⎥ ⎢ ∂y ∂x ⎥ w
⎢ ⎥ ⎢ ∂ ∂ ⎥
⎣ γxz ⎦ ⎣ ∂z 0 ∂x ⎦
∂ ∂
γyz 0 ∂z ∂y

The physical meaning of each term in vector ε can be understood by ana-


lyzing Figs. 4.20 and 4.21. The first image represents the expansion or the
normal strain of a line, i.e. the normal variation of the line length after defor-
mation, which, in formula, is: dudx = εx . The second image depicts the angular
deformation or shear strain of a square vertex after body motion, which, in
formula, is: γxy = du dv
dy + dx .

Force and Stress Source Variables

Equilibrium in a body is expressed in terms of two kinds of forces: volume and


surface forces. Considering Fig. 4.22, for an infinitesimal volume, equilibrium
can be written as:
 x + dt
dt  y + dt
 z − df
 =0 (4.33)

All the infinitesimal surface forces dt are in equilibrium with the infinitesimal
volume force df. This means that the surface force difference across the
volume is equal to zero if no volume forces are present. Stress is defined as
dt
lim =σ (4.34)
S−→0
dS
and, due to the infinitesimal dimension of the area, its moment is
dm
lim =0 (4.35)
S−→0 dS

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

4.3.2 Finite Formulation of Elastostatics


Relationship between Source and Configuration Variables

By observing (4.32) and (4.38), it is possible to note that the differential


operator that appears in these equations is the same, only transposed. This
is the first important element in the analysis of an elastic field. The CM
highlights this duality by considering the geometrical quantities in which
displacements and forces are defined. Displacements are in fact defined related
to a point (4.24). The dual geometrical element of a point is a volume, and
field forces are defined related to a volume (4.33).
72 4 Classical Physical Problems

τzy σzz

σxx τxy τzx 


dt

τxz
τyx x
τyz
σyy

z
Fig. 4.23 Cauchy tetrahedron for stress equilibrium: normal (purple arrows) and
shear (green arrows) stress

Because of the physical characteristics of


• displacements (4.27), which are related to the inner orientation of one
edges, and
• forces (4.36), which are related to surface normals inherent to the outer
orientation,
the strategy is to associate displacements and their variations to the primal
complex, and surface and volume forces to the dual complex. By considering
the geometrical relationships between the elements, it is possible to high-
light the duality in elastostatics, as pointed out in [22] and summarized in
Table 4.3.
The CM operators are discrete, but they are closely linked to the differen-
tial operators, and the relationships between differential and finite difference
operators are the same.

Topological Equations

By considering the primal volume in Fig. 4.24, it is possible to identify


the four n1 , n2 , n3 , and n4 nodes, and the e1 , . . . , e6 edges that connect
the nodes. Each edge is one-to-one related to a dual surface, and is indi-
cated by fi . The dual volumes are defined by the dual surfaces and they
are related to each node. As far as the configuration variables are concerned,
4.3 Elastostatics 73

Table 4.3 Elastostatics: global variables and their association with primal and
dual complexes

physical entity symbol geometrical entity


displacements u primal node
displacement variations h primal edge
surface forces t dual surface
volume forces f dual volume

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.

deformation equation (4.27) can be rewritten in the CM considering an edge


and the difference between the displacements of the two related nodes. Con-
sidering a tetrahedral element made of four nodes, one obtains:

⎡ ⎤ ⎡ ⎤
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

where I3 and 03 are the 3 × 3 identity and null matrices, respectively. In


a dual way, the source (4.33) variable can also be rewritten in the CM by
considering the portion of the dual surface that belongs to the primal volume:
⎡ ⎤
tx1
⎢ ⎥
⎢ ty1 ⎥
⎢ ⎥
⎢ ⎥
⎢ tz1 ⎥
⎢ ⎥
⎢ tx2 ⎥
⎡ ⎤⎢⎢ ⎥

−I3 −I3 −I3 03 03 03 ⎢ ty2 ⎥
⎢ ⎥⎢⎢ t ⎥

⎢ I3 03 −I3 −I3 03 ⎥
⎢ 03 ⎥⎢⎢
z2 ⎥
⎥=f (4.40)
⎢ 0 03 −03 ⎥
⎣ 3 I3 03 I3 ⎦⎢⎢ tx3 ⎥

⎢ ⎥
03 03 I3 03 I3 I3 ⎢ ty3 ⎥
⎢ ⎥
⎢ tz3 ⎥
⎢ ⎥
⎢ ⎥
⎢ tx4 ⎥
⎢ ⎥
⎢ t ⎥
⎣ y4 ⎦
tz4

By referring to the previously expressed duality, (4.39) and (4.40) can be


simplified, as:
h = G3 u (4.41)

− D̃3 t = f (4.42)

and then, using duality D̃3 = −GT


3 , the source equilibrium becomes:

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.

Elastic Constitutive Equation

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

where E is Young’s modulus of the material and ν is the Poisson ratio of


the material, determined by means of tensile tests. A tensile or compression
test is performed, using a testing machine, to measure the Young’s modulus.
The slope of the linear part of the curve is Young’s modulus, as depicted
in Fig. 4.25. The Poisson coefficient is the shrinkage of the material mea-
sured in the orthogonal direction of the tensile stress, as shown in Fig. 4.26.
The expression of the transverse strain is:

h − h
εt = (4.45)
h

the relationship between transverse and longitudinal strain is the Poisson


ratio, which is defined as
εt
ν=− (4.46)
εl

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:

tx = σxx ãx + σxy ãy + σxz ãz (4.47)

ty = σyx ãx + σyy ãy + σyz ãz (4.48)

tz = σzx ãx + σzy ãy + σzz ãz (4.49)


76 4 Classical Physical Problems

Rm

Rp02

arctan(E)

0.002 ε

Fig. 4.25 Example of the mechanical behaviour of a material

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)

As a second step, strain has to be related to the displacement gradient. By


considering a tetrahedral element with four nodes and affine behaviour of the
displacement components u, v, w with respect to the spatial coordinates, the
displacement can be written as a function of (x, y, z) as:

u(x, y, z) = Hxx x + Hxy y + Hxz z + cu (4.52)


v(x, y, z) = Hyx x + Hyy y + Hyz z + cv (4.53)
w(x, y, z) = Hzx x + Hyz y + Hzz z + cw (4.54)

where the H components are constant. Writing the the relative displacements
along the x direction of the primal nodes one obtains:

hx1 = u1 − u2 = Hxx (x1 − x2 ) + Hxy (y1 − y2 ) + Hxz (z1 − z2 ) (4.55)


hx2 = u1 − u3 = Hxx (x1 − x3 ) + Hxy (y1 − y3 ) + Hxz (z1 − z3 ) (4.56)
hx3 = u1 − u4 = Hxx (x1 − x4 ) + Hxy (y1 − y4 ) + Hxz (z1 − z4 ) (4.57)
hx4 = u2 − u3 = −hx1 + hx2 (4.58)
hx5 = u2 − u4 = −hx1 + hx3 (4.59)
hx6 = u3 − u4 = −hx2 + hx3 (4.60)
78 4 Classical Physical Problems

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

In order to compute components H, matrix P can be obtained as:


⎡ ⎤
Px1 Px2 Px3
⎢ ⎥
P = L−1 = ⎢
⎣ Py1 Py2 Py3 ⎥
⎦ (4.63)
Pz1 Pz2 Pz3

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)

By rearranging all the components in a vector expression, and recalling that


only the first three edges are needed to define the affine behaviour of the
displacement gradient, the components of matrix P can be used, considering
the definition of the strain of (4.32), to define a new matrix P that defines
the relationship between the strain and displacement as:
4.3 Elastostatics 79

P u f Ṽ

h = G3 u f = −D̃3 t

L h  = Ph ε σ = E σ t = Aσ t S̃

Fig. 4.27 Tonti’s diagram of the elastic problem

⎡ ⎤
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)

and in compact form:


GT
3 ME G3 u = f (4.68)

Finally, considering the stiffness formulation of the elastic problem, (4.68)


can be expressed as:
Ku = f (4.69)

More details can be found in [23, 24].


80 4 Classical Physical Problems

Table 4.4 Maximum stress value σmax computed by analytical approach (E-B),
finite element (FEM) and cell method (CM) with different discretizations

No. of No. of σmax E-B σmax FEM σmax CM


Mesh
nodes tetrahedra MPa MPa MPa
coarse 1206 4697 57 83
90
fine 9912 47008 83 92

4.3.3 Application of Elastostatic Formulation


A rectangular shaped beam is studied, as an example. The beam has a 20 mm
height (y direction) and 10 mm thick (x direction) cross section and a length
of 200 mm (z direction). It is clamped at one end and loaded by two identical
forces (100 N in each transverse direction, along x and y axes) on the other.
Using the Euler-Bernoulli analytical approach, stress can be computed as:
Mx 100 × 200
σz = y= 10 = 30 MPa (4.70)
Ix 1
12× 203 × 10

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

4.4 Thermal Transient


The standard PDE approach for the formulation of the transient thermal
problem is based on the conservation of energy, which states that the energy
variation in a volume over a period of time is equal to the difference between
the heat produced and the outflowing heat.
   
ΔU = σdV dt − 
q · dSdt (4.72)
τ V τ S=∂V

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

Fig. 4.31 Tonti diagram for the thermal transient problem

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

Fig. 4.32 Thermal transient problem: 3d CM vs. axisymmetric FEM

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)
τ

The method is asymptotically unconditionally stable for θ ≥ 0.5. It should


be noted that an explicit scheme, i.e. one which does not need the solution of
a linear system at each time step, can be obtained by choosing θ = 0 if C is
diagonal. This can occur e.g. for 2d problems if a proper construction of Mρc
is used. Such a scheme, however, is only conditionally stable, and suitably
small time steps should therefore be adopted.
It also interesting to note that the application of the θ-method is not the
only path that can be followed to arrive at (4.79). In fact, it has been shown
[26] that if time is also treated as a discrete quantity and the physical variables
are associated to suitable primal and dual time discretizations, (4.79) can be
obtained by moving the dual time instant between two successive primal time
instants according to τ˜n = tn + θ(tn+1 − tn ).
Fig. 4.32 shows a comparison between the heating of a cylinder computed
with a three dimensional CM code, and, the heating obtained with an axi-
symmetric FEM code.
86 4 Classical Physical Problems

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:

Mü + Cu̇ + Ku = f (4.81)

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.

4.5.1 Eigenmode Analysis


When the velocity of the system evolution is comparable with the steady
state elastic wave speed propagation, the equilibrium equation of the system
has to consider the kinetic mechanical energy component. In this case, no
external forces are considered, and only the balance between kinetic and
potential energy is analyzed. Motion (4.81) is simplified. The normal modes
are determined avoiding the contribution of damping, because the resonance
condition, that is the worst condition, is defined on the exclusive basis of the
conservative mechanical energy. The motion equation can be expressed as:
Mü + Ku = 0 (4.82)
In order to solve the motion equation, the differential equation in time can be
studied considering a harmonic solution, i.e. u = u0 eiωt , and the acceleration
can be expressed as ü = −ω 2 u0 eiωt . Under this consideration, the harmonic
part can be avoided and the motion equation can be rewritten as
− ω 2 Mu0 + Ku0 = 0 (4.83)
In this way, the eigenproblem is written, by collecting the vector u0
 2 
−ω M + K u0 = 0 (4.84)
and, solving the determinant of the matrix, it is possible to compute the
natural frequencies ω that represent the square of the eigenvalues. It is then
possible to compute a vector u0ωi for each eigenvalue, which represents the
eigenvector related to the ωi square eigenvalue. The eigenvector, also called
mode, is the shape that the system takes on when an elastic wave passes
through the system at the same frequency value as the corresponding eigen-
value. It represents the way in which the body responds to a harmonic excita-
tion. The resonance condition corresponds to the complete balance between
kinetic and potential energy [27, 28].
The eingenmode analysis can often give an operative criterion to help
understand what the most efficient way of simulating a structure is under
time-varying conditions: if the external forces vary in a time comparable
with the period of the stationary elastic wave represented by the eigenvector,
the problem has to be solved with elastodynamics. If the variation time is
much lower than the elastic wave period, the solution can be found using
elastostatics.
In the following, a modal analysis of a diapason is conducting using Dual-
Lab with an eigenproblem solution. The model of a diapason is depicted in
Fig. 4.33; the first four natural frequencies of the diapason are computed and
the results are shown in Fig. 4.34.
88 4 Classical Physical Problems

Fig. 4.33 Diapason model

(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

The formulation of different physical laws, in terms of algebraic


operators, was presented in the previous chapters. From an anal-
ysis of the Tonti diagrams, it emerges that they are not related to
a specific physical phenomenon, but they can be considered as a
common framework for several theories, that is, a scaffolding into
which the variables that arise from different physics are rigorously
placed. From this general consideration, it is natural to think it
would be possible to exploit the underlying structure provided by
the Tonti diagrams and apply this to develop a multiphysics envi-
ronment for numerical techniques.
The aim of this chapter is to show that the Tonti diagrams are
a natural underlying structure that can be used to develop multi-
physics numerical formulations. When the same discretization is
shared by different problems, topological operators can only be built
once and used to assemble the stiffness matrices that correspond
to different problems and the coupling terms [1]

5.1 Coupled Problems


Multidisciplinary, multiphysics or coupled problems attract the attention of
researchers in many research fields, because these kinds of phenomena are
quite common in nature and in new technological areas. There are many
examples in which different physical phenomena interact: welding and cast-
ing processes (thermal and mechanical fields), piezoelectricity (electric and
mechanical fields), magnetostriction (magnetic and mechanical fields), flu-
id/structure interaction, acoustic disturbances in elastic structures, magneto-
hydrodynamics, induction heating, micro electro-mechanical systems, and
radio-frequency ablation to mention just a few.
According to [2], modelling coupled problems can roughly be classified
into two categories: strong and weak coupling, which can be schematically
defined as:

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.

5.2 Electro-thermo-mechanical Coupling


The study of electro-thermo-mechanical devices is currently a highly active
research field, especially in micro electro-mechanical systems technology [3],
since actuators based on this principle provide high displacements and high
actuation forces.
Variables, Tonti diagrams and equations for electric, thermal and mechan-
ical disjoint problems were introduced in previous chapters. The final equa-
tions are here reported for the reader’s convenience:
GT Mσ Gv = −GT jS (5.1)

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.

5.2.1 Electro-thermal Coupling Term


The first term of nonlinear coupling between thermal and electrical prob-
lems refers to the dependance of the electrical and thermal conductivities on
temperature.
The source term of the thermal problem refers to the volume heat gen-
eration due to the electrical currents (Joule’s effect). Using first-order edge
shape functions w  the power losses in each
 to interpolate the electric field E,
simplex m are:
   
E · JdV
 =  k · JdV
ek w 
Vm Vm k
  (5.4)
= ek  k · JdV.
w 
k Vm

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)

where ◦ defines the Hadamard element-wise product (in MATLAB notation,


this product is expressed as .*). Since the thermal formulation requires a
heat source to be defined on the dual volumes, these edge-related values have
to be projected onto dual volumes.
In order to obtain a matrix-compatible formulation of the coupling term,
it is useful to define the support region of the generic kth component of the
vector of pE . Among the several possibilities, a reasonable choice is to assign
the power pk to the region obtained by connecting the primal edge extrema
to the vertices of the corresponding dual face, as shown in Fig. 5.1 for the
case of 2d domains. This region is sometime called trial. In this case, it is easy
to project the powers pE onto the dual volumes by using the node-to-edge
connectivity matrix G, since the dual volumes are one-to-one related to the
primal nodes:
1  
 1  

p = GT  pE = GT  (Gv) ◦ (Mσ Gv) (5.9)
2 2
The term 12 is due to the fact that the power related to each primal edge/dual
face couple is shared by two adjacent dual volumes.

5.2.2 Thermo-mechanical Coupling Term


Thermal loads can be applied as external sources to the elastic structure.
Recalling the treatment of elastostatics in the previous chapter, it can be
stated that strains are properties associated to elements, and it is therefore
necessary to define a single value for the temperature of the element. It is
natural to assume the temperature of the baricenter as the temperature of the
element. By interpolating nodal temperatures with nodal shape functions,
and evaluating them on the barycenter, the resulting temperature of the
94 5 Multiphysics Problems

region of influence
of power
pk = ek jk

ek
jk

Fig. 5.1 Possible choice for the region of influence of pk = ek jk

element is the mean value of nodal temperatures. By using the volume-to-


node connectivity matrix S, the average temperatures of the elements can be
expressed in 3d as:
1
T̄ = ST (5.10)
4
Thermal strains are then obtained from the thermal expansion coefficients,
through the law:
 
  1
TH = αTH T̄ − T0 = αTH ST − T0 . (5.11)
4

Since the strains are small by assumption, superposition holds, so that


 = M + TH , and the thermal loads can therefore be expressed by the
forces  
1
T
f TH = G ADαTH ST − T0 (5.12)
4

5.2.3 Complete System of Equations


The complete set of equations collects (5.1) as well as the coupling terms
(5.9) and (5.12). All the material properties can depend on the temperature.
Under these hypotheses, the equations become:


 = −G jS
T T

⎨ G M  σ Gv
 
− 21 GT  (Gϕ) ◦ (Mσ Gv) + GT Mλ GT = 0 (5.13)


⎩ − 1 GT ADα ST + GT M G u = f − GT ADα T
4 TH 3 E 3 TH 0
5.2 Electro-thermo-mechanical Coupling 95

Table 5.1 Condition numbers. The numbers refer to the example in section 5.2.4.

Condition no. Problem


complete 6.7302e+12 -
1.5681e+04 electric
block 1.5681e+04 thermal
7.9502e+05 mechanical

which can be written in block form as:


⎡ ⎤⎡ ⎤ ⎡ ⎤
A11 0 0 v b1
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢ A21 A22 ⎥ ⎢ ⎥ ⎢
0 ⎦ ⎣ T ⎦ = ⎣ b2 ⎥ (5.14)
⎣ ⎦
0 A32 A33 u b3

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.

5.2.4 Example: MEMS Microbeam


The aforementioned formulation has been applied to an MEMS benchmark
problem that is available in the COMSOL model library. The results pro-
vided by COMSOL Multiphysics finite element program [5] are used as a
96 5 Multiphysics Problems

Table 5.2 Material characteristics of the MEMS microbeam

Property Symbol Value


σ0
conductivity σ 1+αθ (θ−θ0 )
−1
reference conductivity σ0 58.1 × 10 Sm
6

temperature coefficient αT 3.9 × 10−3 K−1


reference temperature T0 0 ◦C
thermal conductivity λ 400 Wm−1 K−1
Young’s modulus E 120 × 109 Pa
Poisson’s ratio ν 0.34
thermal expansion αTH 16.6 × 10−6 K−1
density ρ 8960 kg m−3

reference. A voltage of 0.2 V is applied between the feet of a microbeam


fixed to a substrate. The electric current generates a temperature increase
and the resulting thermal stress deforms the beam. Details of the model can
be found on the COMSOL website [5]. The beam is discretized by 23612
first-order tetrahedra (5267 nodes), and the same mesh is shared by both the
COMSOL program and the CM. The total number of unknowns is 26335.
The characteristics of the materials are reported in Table 5.2.
The coupled problem is nonlinear, since the electrical conductivity depends
on the temperature. Nonlinearity is here solved by means of the simple itera-
tion technique: the problem is solved by starting from an initial guess of the
temperature distribution. The temperature solution is used at each iteration
to update the electrical conductivity in each element. The material property
at the kth step is updated by the iterative formula:
σ(θ(k) ) = σ(θ(k−1) ) + δ(σ(θ(k) ) − σ(θ(k−1) )) (5.18)
where δ is a dumping factor used to enforce convergence. Setting δ = 0.7,
the method requires 16 iterations to reach a relative error on the solution of
10−6 (Fig. 5.2)
Fig. 5.3 shows the maps of the electric potential, temperature, von Mises
equivalent stresses and deformation. Due to nonlinearity, the electrical con-
ductivity is lower when the temperature is higher, as reported in Fig. 5.3d.
From a comparison of the results in Table 5.3 and Fig. 5.4, it is possible to
draw some considerations. The proposed method produces results that are in
good agreement with those produced by a state-of-the-art commercial soft-
ware for multiphysics. The differences between the input and output currents
calculated with COMSOL is due to the fact that the divergence equation is
imposed in weak form by the finite element formulation, while it is exact in
the discrete form.
5.2 Electro-thermo-mechanical Coupling 97

Fig. 5.2 Nonlinear convergence of the simple iteration method

(a) Electric potential (V) (b) Temperature (K)

(c) von Mises stresses (Pa) (d) Electrical conductivity (S/m)

Fig. 5.3 Electro-thermo-mechanical analysis (steady state)

The proposed formulation exploits the discrete operators and proposes


their use for all the physical problems involved and their re-use for the cal-
culation of the coupling terms. Since these operators are described in matrix
form, the computation of the coupling terms is performed in an efficient
way by means of sparse matrix algebra and does not require any numerical
integration.
98 5 Multiphysics Problems

Fig. 5.4 Comparisons of the z displacement computed along a line in the middle
of the beam

Table 5.3 Comparisons between COMSOL and DualLab

Quantity Units COMSOL DualLab


input current A 0.384968 0.381570
output current A -0.382021 -0.381566
joule losses mW 76.321 76.314
max T K 679.048 679.120
max Δz m 4.15013e-8 4.15068e-8

5.3 Induction Heating

The heating of conductive ferromagnetic materials by means of eddy currents


is a challenging problem from the computational point of view:

• 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

Quantity FLUX 3d CST 1d-3d


CPU XEON X5355 Opteron MD 865
clock 2.66 GHz 2.2 GHz
allocated memory 6 GB 5 GB
formulation A−V E
number of volumic elements ≈ 1.2 M ≈ 0.8 M
computational time (one iteration) ≈ 24 hours ≈ 70 minutes
number of iterations 30 15
total time ≈ 1 month ≈ 17.5 hours

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.

5.3.1 Eddy Current Numerical Formulation


The eddy current problem is formulated in frequency domain. Several for-
mulations have been proposed in the literature for eddy current problems
in finite element context [8], and most of them have also been proposed ac-
counting to the algebraic scheme [9, 10]. Here, two formulations are presented
and compared, in terms of computational cost: a two-potential formulation
(magnetic vector potential and electric scalar potential) and a single-potential
formulation (reduced magnetic vector potential).
Considering the Tonti diagram for Maxwell’s equations in sinusoidal steady-
state (see Fig. 5.5), under the hypothesis of magnetic quasi-stationary field
(the displacement currents are neglected), the topological equations are:
Ce = −iωb (5.19)

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̃

Fig. 5.5 Tonti diagram of Maxwell’s equation for magneto-quasi-stationary formu-


lation in steady-state conditions

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

Another possible formulation considers as the unknown the reduced magnetic


vector potential: e
b=C − = Ca∗ (5.29)

5.3 Induction Heating 101

which gives the following as the final system:



CT Mν C + iωMσ a∗ = jS (5.30)

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

Fig. 5.6 Computational time for a − v and a∗ formulations


102 5 Multiphysics Problems

Magnetic Nonlinearity

The source quantities in a time-harmonic problem have sinusoidal time de-


pendence, as well as derived quantities like the magnetic field H and magnetic
flux density B. In reality, when the field computation domain includes non-
linear magnetic materials, the magnetic field H and/or the magnetic flux
density B cannot have sinusoidal time dependence simultaneously. In order
to take into consideration the previously stated contradictions, approxima-
tions are carried out in the magnetization models. The B(H) dependence is
modified, with reference to the nonlinear magnetization, on the basis of an
equivalence of the magnetic energy. As proposed in [14], an equivalent B(H)
characteristic, based on an energetic equivalence method, can be computed.
Thus, it is possible to evaluate an equivalent magnetic field Heq that gives
the same magnetic energy W for each possible peak value of magnetic flux
density Bmax , see Fig. 5.7. The result is a fictitious magnetization curve that
is based on this energetic equivalence. The equivalent B(H) characteristic
is calculated in such a way that the density of the time average magnetic
energy-per-period of magnetic field time variation, obtained starting from
the real B(H) curve, should be equal to the density of the magnetic energy
given by the equivalent B(H) dependence. It is worth noting that instanta-
neous point-wise quantities are still sinusoidal, also in case of high saturation.
These values can be considered as approximations of the real waveforms, as
shown in Fig. 5.8. The numerical values of the integral quantities, that is
the post-processed quantities that depend on the energy (force, power, in-
ductance, etc.) corresponds to the steady state value obtained through a
nonlinear transient analysis.
In this work, a sinusoidal magnetic flux density has been assumed, thus
the magnetic energy W is defined as:
 Bmax
1
W = HdB = Heq Bmax (5.34)
0 2
hence:
2W
Heq = . (5.35)
Bmax
The definition of these equivalent material properties transforms a nonlinear
magnetic problem into an inhomogeneous linear problem. The material char-
acteristics can be iteratively updated through standard nonlinear schemes
(Picard-Banach, Newton-Raphson). Since the Newton-Raphson technique
shows a lack of accuracy in high saturation regions [15], nonlinearities
are taken into account by using the fixed-point polarization method in the
time harmonic regime. A linearization term is added to the magnetic
characteristic:
    
CT Mν C + iωMσ −Mσ Q a∗ jS − CT hFP
= (5.36)
−QT Mσ 1 T
iω Q Mσ Q e0 1
iω j0
5.3 Induction Heating 103

Bmax

H

Heq

Fig. 5.7 Energetic equivalence

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

5.3.2 Unstationary Thermal Problem


The formulation of the transient thermal problem is more standard:
dT
Mρc + GT Mλ GT = p (5.37)
dt
104 5 Multiphysics Problems

1.2

1.0

0.8
kθ

0.6

0.4

0.2

0.0
0 200 400 600 800 1000 1200 1400
θ (°C)

Fig. 5.9 Temperature coefficient for B − H curve

The ordinary differential equation is discretized using the Crank-Nicolson


method. The system is nonlinear, since all the physical properties of the
materials are temperature dependent, but are considered constant in each
time step.
Another source of nonlinearity is constituted by the temperature depen-
dence of the ferromagnetic properties. In fact, when the temperature goes
beyond the Curie value, the magnetic material looses its magnetic property
and becomes amagnetic. The transition is not abrupt and it is modelled as
follows (Fig. 5.9):
B = μ0 H + kT (B0 (H) − μ0 H) (5.38)
Equation (5.38) shows thatkT = 1 for low temperatures, that is, the magnetic
characteristic is the standard cold one, while kT approaches to zero for high
temperatures, beyond the Curie value, and the magnetic characteristic is that
of air. The effect of the temperature on the electrical conductivity cannot be
neglected. The dependance can be expressed by the equation:
1
σ(T ) = (5.39)
1 + αT (T − T0 )
where αT is the temperature coefficient. From the physical point of view,
the transition from magnetic to amagnetic characteristic around the Curie
temperature requires a “latent heat”, that is, part of the generated heat is
necessary to establish the phase transition. Numerically, this effect is taken
into account in the model through a specific thermal capacity that depends on
the temperature: across the Curie temperature, the specific thermal capacity
increases in order to allow the material to store energy. A typical curve is
represented in Fig. 5.10.
5.4 Thermo-mechanical Coupling 105

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

5.3.3 Test Case: Heating Inductor


The test case is represented by a hollow conductor (for cooling purposes)
supplied by an AC current I = 4000 A at 8 kHz. Six flux concentrators made
of laminated iron (no eddy currents) are inserted to increase the magnetic
flux density in correspondence to the workpiece with a depth of 1 cm. The
thermal transient ends after 10 s. The model is discretized with hexahedra
and, because of symmetry, only one fourth of the structure is simulated.
Table 5.5 shows the computational time of the complete simulation. Typical
results are shown in Fig. 5.13, 5.15 5.14 and 5.16. The nonlinear thermal
capacitance is demonstrated to be effective in modelling the thermostatic
effect during the magnetic transition around the Curie temperature shown
in Fig. 5.13. The effect of high magnetic saturation can be seen in Fig. 5.14
by looking at the curve for t = 1 s. It is also possible to see that heating
the workpiece results in a decrease in the apparent relative permeability,
and consequently an increase in the penetration depth. The current density
penetrates into the workpiece, giving rise to a more uniform temperature
distribution (Fig. 5.15). The current density map is shown in Fig. 5.16.

5.4 Thermo-mechanical Coupling

A commercial exhaust manifold of a 1.9L compression ignition engine is mod-


elled as an example of thermo-mechanical analysis. The other components
linked to the exhaust manifold, such as cylinder head, bolts and gasket,
have not been modelled in order to simplify the case study for the com-
parison between the two solution techniques. This model is first meshed with
106 5 Multiphysics Problems

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

Fig. 5.12 Nonlinear convergence


5.4 Thermo-mechanical Coupling 107

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)

Fig. 5.13 Temperature on workpiece surface

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)

Fig. 5.15 Temperature profile along the workpiece depth

Fig. 5.16 Eddy current density map at 1 s

• 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.17 Domain discretization of the manifold

Table 5.6 Material properties with respect to temperature

Material properties Units 20 ◦ C 400 ◦ C 600 ◦ C 800 ◦ C


density, ρ kg/m3 7100 7100 7100 7100
thermal conductivity, λ W/(mK) 34.3 34 33.8 33.8
thermal capacity, cp J/(kgK) 440 480 503 503

5.4.1 Thermal Model


The first step of the standard thermo-structural methodology involving FEM
is a transient thermal analysis which is conducted in order to compute the
temperature distribution over the component. The temperature-dependent
thermal properties have been specified in the thermal FEM model, as sum-
marized in Table 5.6 Boundary conditions have been created, in terms of ex-
haust gas temperature in the manifold [16, 17]. The gas temperature values
Tgas and convective heat exchange coefficients hc have been specified for the
three internal node sets created. These values were obtained from a previous
CFD analysis of the manifold. It has also been imposed that the maximum
temperature value on the lower surface of the manifold collar does not exceed
140 ◦ C, in order to take into account cylinder head cooling. The node sets
110 5 Multiphysics Problems

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.

Table 5.7 Thermal boundary condition distribution

Parameter Units High Medium Low Collar



Temperature, T C 780 720 720 140
2
Convective coefficient, hc W/m K 410 340 80 3180
5.4 Thermo-mechanical Coupling 111

Fig. 5.19 The thermal cycles imposed during the analysis

Table 5.8 Structural material parameters with respect to the temperature

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

5.4.2 Structural Model

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

Fig. 5.20 Mechanical load and boundary conditions

Table 5.9 Output comparison between the FEM and CM

Temperature Displacement Total Strain



C mm %
Node FEM CM FEM CM FEM CM
1 780 774 1.79 1.84 0.01 0.03
2 593 590 0.29 0.31 1.11 1.14
3 720 706 1.04 1.09 0.13 0.15
4 149 156 0.03 0.05 0.15 0.16

results : node 1 is located on the top of the turbocharger collar, node 2 is on


the fillet between the right end runner and the reinforcement, node 3 belongs
to the left runner and node 4 is located on the manifold collar. Table 5.9
summarizes the results.
It can be concluded that:

• 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

• with the proposed technique, it is possible to evaluate thermal and mechan-


ical strains for each time step at the same time, to obtain more accurate
results and to save computation time;
• the comparison between the FEM and CM results has shown a close cor-
relation, which means that this new technique could be applied in thermo-
structural analysis as a substitute of the FEM.

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

[4] Bossavit, A.: Computational electromagnetism and geometry (5) The


“Galerkin hodge”. Journal of the Japan Society of Applied Electromagnet-
ics 8(2), 203–209 (2000)
[5] COMSOL Multiphysics, www.comsol.com, (accessed December 4, 2012)
[6] Canova, A., Dughiero, F., Fasolo, F., Forzan, M., Freschi, F., Giaccone, L.,
Repetto, M.: Simplified approach for 3d nonlinear induction heating problems.
IEEE Transaction on Magnetics 45(3), 1855–1858 (2009)
[7] Flux 3d,
http://www.cedrat-groupe.com/en/software-solutions.html,
(accessed December 4, 2012)
[8] Bı́ró, O., Preis, K., Richter, K.R.: Various FEM formulations for the calcula-
tion of transient 3D eddy currents in nonlinear media. IEEE Transactions on
Magnetics 31(3), 1307–1312 (1995)
[9] Specogna, R., Trevisan, F.: Discrete constitutive equations in a − χ geometric
eddy-current formulation. IEEE Transactions on Magnetics 41(4), 1259–1263
(2005)
[10] Specogna, R., Trevisan, F.: Eddy-currents computation with t-ω discrete geo-
metric formulation for a NDE problem. IEEE Transactions on Magnetics 44(6),
698–701 (2008)
[11] Clemens, M., Weiland, T., van Rienen, U.: Comparison of krylov-type methods
for complex linear systems applied to high-voltage problems. IEEE Transaction
on Magnetics 34(5), 3335–3338 (1998)
[12] Clemens, M., Weiland, T.: Regularization of eddy-current formulations using
discrete grad–div operators. IEEE Transaction on Magnetics 38(2), 569–572
(2002)
[13] Alotto, P., Gruosso, G., Moro, F., Repetto, M.: A boundary integral formula-
tion for eddy current problems based on the cell method. IEEE Transaction
on Magnetics 44(6), 770–773 (2008)
[14] Vassent, E., Meunier, G., Sabonnadier, J.C.: Simulation of induction machine
operation using complex magnetodynamic finite elements. IEEE Transaction
on Magnetics 25(4), 3064–3066 (1989)
[15] 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)
[16] Delprete, C., Rosso, C.: Exhaust manifold thermo-structural simulation
methodology. SAE Technical Paper Series (2005-01-1076) (2005)
[17] Su, X., Zubeck, M., Lasecki, J., Engler-Pinto Jr., C., Tang, C., Sehitoglu, H.,
Allison, J.: Thermal fatigue analysis of cast aluminium cylinder heads. SAE
Technical Paper Series (2002-01-0657) (2002)
Chapter 6
Implementation

The practical implementation of the cell method, which was pre-


sented in the previous parts of the book, can be performed in a
very simple and compact way using a high-level programming lan-
guage. In the following a description of the main phases of the
implementation of a simple procedure are presented together with
some choices that the authors have considered to be important in
code writing.

6.1 Development Environment

Starting from a suitable discretization obtained from standard mesh genera-


tors (not considered in this chapter), the three main phases of each numerical
code dealing with partial differential equations (PDE) solution are:

• preprocessing: builds the data structures, as well as the material operators,


assembles the stiffness matrices and the right-hand-side;
• solver : imposes the boundary conditions and solve the final system (sta-
tionary or transient solutions);
• postprocessing: calculates the derived quantities and plots the solution
(scalar and vectorial quantities).

MATLAB [1] was chosen as implementation language. This choice is due to


the simplicity of the coding, the popularity of the language and the availabil-
ity of optimized linear algebra routines. MATLAB is a high level program-
ming language, available for almost all hardware architecture and operating
systems.
The main drawbacks of this choice are related to the use of a commer-
cial platform and to the efficiency of the code. As far as the first problem
is concerned, the functions explained in the next sections do not use any
particular MATLAB Toolbox and should be compatible with all MATLAB
free clones, e.g. Octave [2] and Scilab [3]. MATLAB licenses are available
at many university labs, making MATLAB available to almost all under-
graduate and graduate students. As far as performances are concerned, it is
true that MATLAB is not optimal, from the computational point of view.
P. Alotto et al.: The Cell Meth. for Electr. Eng. & Multiphys. Prob., LNEE 230, pp. 115–129.
DOI: 10.1007/978-3-642-36101-2_6 c Springer-Verlag Berlin Heidelberg 2013
116 6 Implementation

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].

6.2 Anatomy of the Code


The objective of the code is to solve a thermal problem discretized by first-
order tetrahedra. The code is structured in functions, each of which performs
a specific task. The main tasks required by the CM are:
1. describing the geometry and generating the mesh;
2. building auxiliary data structures;
3. building the gradient matrix;
4. building a data structure for the material properties;
5. building the constitutive matrix;
6. setting the boundary conditions;
7. assembling the final system;
8. finding the solution;
9. plotting the map of the nodal quantities.
These phases are analyzed in depth in the remainder of the chapter, with
reference to the theoretical part developed in the previous chapters.
Stationary thermal conduction with Dirichlet boundary conditions is taken
as reference for the implementation:

GT Mλ GT = p
T = TD on ∂ΩD

6.3 Phase 1: Data Structures


The description of complex geometries and the subsequent creation of a tetra-
hedral mesh are not easy tasks.
Fortunately many programs exist that can do this work. A few examples
are NetGen, TetGen, and GMSH, wich can be downloaded freely from the
developers’ websites. They are endowed with simple geometric modellers and
6.3 Phase 1: Data Structures 117

stable mesh generators that are based on different meshing algorithms. A


possible MATLAB implementation of a 3d mesh generator is DISTMESH
[8], but the reader should be aware that DISTMESH can produce “slivers”,
that is, elements with bad shapes due to almost null volumes. Details on
mesh generation can be found in dedicated textbooks, e.g. [9]. Specific CAD
modelling tools become necessary for geometries with very complex shapes.
Once the geometry is generated, it can be imported, by mesh generators, to
create a suitable discretization for numerical simulation.
It is worth noting that MATLAB has some built-in functions that can be
used to generate Delaunay triangulations, starting from node coordinates.
The main limitation is that it is not possible to create a triangulation/tetra-
hedralization from scratch, starting just from the geometry description. The
reader should refer to MATLAB help using “delaunay” as keyword.
Starting from any mesh generator, it is assumed that the input data for
the PDE solver consist of three matrices:

• node coordinates P: nN × 3 matrix of double numbers, for example


P(k,1:3) containing the x-, y- and z-coordinates of the kth node;
• tetrahedra connectivity T: nV × 4 matrix of integers. No particular rule is
assumed for the sequence of the nodes;
• material code M: nV × 1 vector of integers with a material code for each
element.

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);

The first structure is the edge-to-node connectivity matrix. This is a nE × 2


matrix of integers so that e2n(k,1:2) contains the nodes that are the ex-
trema of the kth edge. With local numbering (related to a single tetrahedron),
the six edges are 1-2, 1-3, 1-4, 2-3, 2-4, and 3-4. One intuitive way of obtaining
this structure is with a loop over the tetrahedra:
1 % local numbering
2 eloc = [1 2; 1 3; 1 4; 2 3; 2 4; 3 4];
3 % initialize e2n to be empty
4 e2n = [];
5 % loop over tetrahedra
6 for i = 1:mesh.nT
7 % loop over edge of i-th tetrahedron
8 for j = 1:6
9 e2n = [e2n; mesh.T(i,eloc(j,1)) mesh.T(i,eloc(j,2))];
10 end
11 end
12 % remove duplicated edges
13 mesh.e2n = unique(e2n,’rows’);
14 % number of edges
15 mesh.nE = size(mesh.e2n,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

6.4 Phase 2: Material Properties


The material properties are necessary to specify the constitutive matrix.
Commercial and research codes have very detailed libraries of both linear
and nonlinear material properties. However, the definition of such libraries
is not the purpose of this chapter. Only linear material properties have been
considered here, with the possibility of specifying different materials in the
domain.
In order to guarantee flexibility of the code, a specific structure, mat, has
been created to contain the material properties. Each field of the structure is
a different property. Different materials are identified with different codes, in
order to access the right data, it is therefore necessary to specify one value
for each material defined in vector mesh.M.
1 function mat = setmaterial(mesh)
2 % count number of materials
3 mat.nM = length(unique(primal.M));
4 % set void thermal conductivity field
5 mat.kT = zeros(mat.nM,1);

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;

Remark 4. More complex operations can be implemented, e.g. loading the


material properties from the library. Here, the code is intentionally left as
essential as possible.

6.5 Phase 3: Constitutive and Stiffness Matrices


The constitutive matrix for thermal problems links the primal edges to the
dual faces. This sparse matrix can be built adopting different approaches. In
this section the hypothesis of uniform irrotational field inside the
element is used and the constitutive matrix is built accordingly (See chap-
ter 3 for details). The reader should implement other approaches (edge-
element, micro-cell approach, . . . ) and compare different methods, in terms of
accuracy.
The global constitutive matrix is assembled by processing one tetrahedron
at a time and building the local matrix. The local entries are then mapped
from the local to the global setting. This process inevitably relies on a loop
over the tetrahedra and, as a result, a sparse nE × nE matrix is obtained.
Since each edge is shared by several tetrahedra, each nonzero of the global
constitutive matrix is obtained by summing all contributions obtained from
those tetrahedra that have those edges in common. To this aim the use of the
sparse function makes it possible an efficient implementation in MATLAB
style. If there are duplicated values of rows and columns, the values are added
together through the sparse function.
6.5 Phase 3: Constitutive and Stiffness Matrices 121

Good practice in MATLAB is the preallocation of the vectors. Taking into


account repetitions, each tetrahedron contributes with 6 × 6 nonzeros
1 function M = constitutive(mesh,mat)
2 % preallocation: row indices
3 irow = zeros(36*mesh.nT,1);
4 % preallocation: column indices
5 jcol = zeros(36*mesh.nT,1);
6 % preallocation: nonzeros
7 s = zeros(36*mesh.nT,1);

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

Table 6.1 Correspondence between the edges and faces

local edge right face left face


1-2 1-2-4 1-2-3
1-3 1-2-3 1-3-4
1-4 1-2-4 1-3-4
2-3 1-2-3 2-3-4
2-4 1-2-4 2-3-4
3-4 1-3-4 2-3-4

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);

It is only necessary to use sparse matrix algebra to assemble the stiffness


matrix:
1 A = mesh.G’*M*mesh.G;

6.6 Phase 4: Sources


The heat generation inside the domain constitutes the thermal sources. Unlike
the finite element method, source terms are linked to the dual structure, and
in particular to dual volumes. It is assumed that the uniform specific heat
6.7 Phase 5: Boundary Conditions 123

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;

6.7 Phase 5: Boundary Conditions


Thermal problems have four kinds of boundary conditions
• assigned temperature (Dirichlet boundary conditions): T = T0 on ∂ΩD ;
• imposed thermal flux (Neumann boundary conditions): Φ = kT ∂T ∂n = Φ0
on ∂ΩN ;
• thermal convection (Robin boundary conditions): Φ = kT ∂T
∂n = h(T − T0 )
on ∂ΩR ;
• thermal radiation: Φ = kT ∂T
∂n = (T − T0 ) on ∂Ω .
4 4

Attention will here be focused on Dirichlet boundary conditions: other types


require the identification of the boundary dual surface in order to define the
thermal fluxes. This implementation is left to the reader as an exercise. The
first step is to identify boundary nodes. Boundary nodes are those nodes that
belong to the boundary faces. The boundary faces can be identified because
they are only referenced by one tetrahedron.
1 % get faces with duplicated indices
2 ifac = mesh.v2f(:);
3 % get boundary faces
4 bfac = accumarray(ifac,1) == 1;
5 % get boundary nodes
6 bnod = unique(mesh.f2n(bfac,:));

The extraction of a subset of boundary nodes depends on the case under


study: if the domain under study is a brick it is possible to define another
function that extracts nodes according to xmin , xmax , ymin , ymax , zmin, zmax .
124 6 Implementation

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.

6.8 Phase 6: Solution


At this point, the stiffness matrix and rhs are built. It is also supposed that
the indices of the Dirichlet nodes and their corresponding value have been
identified and collected in idfix and xfix vectors, respectively.
With a suitable renumbering of the unknowns, it is possible to distinguish,
in the solution vector, free unknowns x from unknowns constrained by the
Dirichlet boundary conditions xD :
    
A11 A12 x b
= . (6.1)
A21 AD xD bD

The free unknowns can be obtained by solving the first block row in (6.1):

A11 x = b − A12 xD (6.2)

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.9 Phase 7: Plotting Maps


MATLAB offers some built-in functions to visualize volumes. Unfortunately,
most of these functions presume a discretization on a regular grid rather
than one made by tetrahedra. The tetramesh function plots tetrahedron
meshes, but all the faces are plotted, thus making the plotting of large meshes
inefficient. For these reasons, an ad-hoc function has been developed, to plot
the colour maps of the solutions. Another useful function is the plot of the
temperature value along a specified line. This operation requires the identi-
fication of the tetrahedron that contains the specified point. This task is not
easy to implement efficiently, and for this reason it has been neglected here
for the sake of simplicity.
The plot of the maps of the solutions requires the identification of the
boundary faces and their connectivity. It is the necessary to assign a colour to
each node that is related to the magnitude of the solution. Inside the element,
colors are linearly interpolated. This last task is performed efficiently by the
lower level MATLAB function patch. The same function can be used to plot
the mesh of the structure under study.
1 function h = plotmesh(mesh,x)
2 % open figure and get handle
3 h = figure;
4 % get faces with duplicated indices
5 ifac = mesh.v2f(:);
6 % get boundary faces
7 bfac = accumarray(ifac,1) == 1;
8 % boundary face connectivity
9 bf2n = mesh.f2n(bfac,:);
10 % plot surface mesh
11 if isempty(x)
12 patch(’Faces’,bf2n,’Vertices’,mesh.P,...
13 ’FaceColor’,[.9 .9 .9],’EdgeColor’,’k’);
14 % plot colormap
15 else
16 patch(’Faces’,bf2n,’Vertices’,mesh.P,...
17 ’FaceVertexCData’,x,’FaceColor’,’interp’,’EdgeColor’,’k’);
18 colorbar;
19 end
20 % rescale axis
21 axis equal
22 % set view
23 view([1 1 1]);

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

Fig. 6.2 Detail of the mesh used for the example

in cylindrical coordinates, which are then transformed into Cartesian coor-


dinates and the tessellation is generated by delaunay3. A logical condition
on the barycenters of tetrahedra is used to distinguish between the conduc-
tive region and the insulating region. The resulting mesh is made of 34398
elements and 6200 nodes (see Fig. 6.2).
1 % clean workspace
2 clear variables, close all
3 % parameters
4 r1 = .01; % radius of conductor
5 r2 = .03; % radius of insulation
6 z1 = 0; % z_min
7 z2 = 1; % z_max
8 % number of divisions
9 Nr1 = 3;
10 Nr2 = 8;
11 Ntheta = 15;
12 Nz = 20;
13 % simulation constant
14 w = 20e3; % W/mˆ3
15 T0 = 30; % C
16 % set division of r-axis
17 r = [linspace(0,r1,Nr1) linspace(r1,r2,Nr2)];
18 r = unique(r);
19 % set divisions of theta-axis
20 theta = linspace(0,2*pi,Ntheta);
21 % remove first entry of theta since 0 == 2*pi
22 theta = theta(2:end);
23 % set divisions of z-axis
24 z = linspace(z1,z2,Nz);
25 % create grid of points in cylindrical coordinates
26 [R,THETA,Z] = meshgrid(r,theta,z);
27 % cylindrical-to-cartesian coordinates
28 P = [R(:).*cos(THETA(:)) R(:).*sin(THETA(:)) Z(:)];
6.10 Example 127

29 % remove duplicated points on z-axis


30 P = unique(P,’rows’);
31 % create Delaunay tessellation
32 T = delaunay3(P(:,1),P(:,2),P(:,3));
33 % assign default material
34 M = 3*ones(size(T,1),1);
35 % element barycenters
36 B = (P(T(:,1),:)+P(T(:,2),:)+P(T(:,3),:)+P(T(:,4),:))/4;
37 % distance of barycenters from z-axis
38 dB = sqrt(B(:,1).ˆ2+B(:,2).ˆ2);
39 % change material for conductor elements
40 M(dB < r1) = 2;

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);

The output of the script is:


1 Building data structure... done 0.27 sec
2 P: [6200x3 double]
3 T: [34398x4 double]
4 M: [34398x1 double]
5 nP: 6200
6 nT: 34398
7 e2n: [41437x2 double]
8 v2e: [34398x6 double]
9 nE: 41437
10 f2n: [69636x3 double]
11 v2f: [34398x4 double]
12 nF: 69636
13 G: [41437x6200 double]
14
15 Building material data structure... done 0.00 sec
16 Building constitutive matrix... done 14.24 sec
17 Building source term... done 0.02 sec
18 Problem solution... done 0.38 sec
19 Plotting mesh... done 0.18 sec

The temperature map obtained at the postprocessing phase is shown in


Fig. 6.3 The most computationally intensive phase is the construction of
the constitutive matrix. This is due to the use of a loop over the number of
128 6 Implementation

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

elements, which is a slow operation in MATLAB. A possible remedy is to


implement of the function in a lower level language (FORTRAN or C/C++)
and compile it as a mex-file. In order to have an idea of the possible gain
in computational time, a FORTRAN implemented function used to assemble
the constitutive matrix takes 0.85 seconds, with a speedup of about 16. All
the timings refer to a standard laptop.

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)

You might also like