karban numerical solution of coupled problems using code agros2d
TRANSCRIPT
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
1/28
Computing (2013) 95 (Suppl 1):S381S408DOI 10.1007/s00607-013-0294-4
Numerical solution of coupled problems using
code Agros2D
Pavel Karban Frantiek Mach Pavel Kus
David Pnek Ivo Doleel
Received: 5 November 2012 / Accepted: 9 January 2013 / Published online: 26 January 2013 Springer-Verlag Wien 2013
Abstract New code Agros2D for 2D numerical solution of coupled problems is
presented. This code is based on the fully adaptive higher-order finite element method
and works with library Hermes2D containing the most advanced numerical algorithms
for the numerical processing of systems of second-order partial differential equations.
It is characterized by several quite unique features such as work with hanging nodes of
any level, multimesh technology (every physical field can be calculated on a different
mesh generally varying in time) and a possibility of combining triangular, quadrilateraland curved elements. The power of the code is illustrated by three typical coupled
problems.
Keywords Higher-order finite element method Coupled problems Monolithic solution hp-adaptivity Hanging nodes
Mathematics Subject Classification 65M60 68N01
P. Karban (B) F. Mach P. Kus D. Pnek I. DoleelDepartment of Theory of Electrical Engineering,
University of West Bohemia, Pilsen, Czech Republic
e-mail: [email protected]
F. Mach
e-mail: [email protected]
P. Kuse-mail: [email protected]
D. Pnek
e-mail: [email protected]
I. Doleel
e-mail: [email protected]
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
2/28
S382 P. Karban et al.
1 Introduction
Numerous physical phenomena are characterized by an interaction of several physical
fields, influencing mutually one another. From a wide spectrum we can mention, for
example, thermal and force effects of electromagnetic fields, changes in solid andliquid structures subject to varying temperature or pressure, or behavior of plasma in
different external conditions. Let us illustrate this category of phenomena by a typical
technical exampleinduction heating of a steel cylinder (a heat-treatment technology
widely used in many industrial applications) in an inductor carrying time variable,
mostly periodic current, see Fig.1.
The current passing through the inductor produces in its vicinity time-variable
magnetic field that generates induced currents in the cylinder. These currents (whose
density Ji(t) lag by almost 180 behind the field current density J(t)) produce in
it the Joule losses that are transformed into heat. The temperature of the cylinderstarts growing. We can say that the primary harmonic magnetic field in the inductor
produces the secondary temperature field in the heated billet. On the other hand, it is
well known that the physical properties of heated materials vary with their temperature.
This also holds for electrical conductivity and magnetic permeability of steel that start
decreasing. Thus, the secondary temperature field in the billet affects the primary
magnetic field in the inductor. It is obvious that both physical fields influence one
another.
When analyzing the process in more details, we can add, moreover, that heating
of the cylinder slightly influences its geometrical dimension that increase. This effectis in practice not important and in most cases can be neglected, but strictly speaking,
the above geometrical variations also slightly affect both magnetic and temperature
fields.
Modeling of such multiphysics (called also coupled) phenomena is still a very chal-
lenging business. Their continuous mathematical models consist of systems of often
nonlinear and nonstationary partial differential equations describing the distributions
of relevant physical fields, that are often supplemented with a set of ordinary differ-
ential equations describing behavior of present circuits (electric, magnetic, thermal,
mechanical, hydraulic, pneumatic, etc.). The coefficients of all these equations are
mostly complicated functions of physical parameters of present materials and media
that, however, depend on the state variables such as temperature or pressure.
Fig. 1 Induction heating of a cylindrical billet in an inductor
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
3/28
Numerical solution of coupled problems using code Agros2D S383
The most difficult task is numerical processing of these continuous models that
should be acceptably fast, robust, and that should provide sufficiently accurate results.
The accuracy of results, however, does not depend only on the quality of the used algo-
rithms, but also on the accuracy of the input data and prescribed initial and boundary
conditions.Nowadays, there exist several packages of ever developing codes that allow process-
ing such coupled problems, mostly in technical domains. They can be split into two
groups commercial professional codes developed by software companies and used
both in industry and academy, and open source codes developed and used mostly in
the academic sphere. The industrial commercial codes (ANSYS [1], Flux [2], Opera
[15], Infolytica [8] and others) are mostly based on lower-order finite element meth-
ods, work with elements of the first and second orders and miss advanced adaptive
techniques. On the other hand, they may be considered user-friendly (they contain
very well elaborated preprocessors and postprocessors). A more powerful code in thisgroup is COMSOL Multiphysics[3] whose latest versions work with elements up to
the fifth order and a standard is h-adaptivity implemented in it.
The development of codes with advanced adaptive methods is intensively conducted
mostly in the open-source academia groups (such as FEniCS [25], deal.ii [5], Sundance
[26], FreeFem++[6] and GetFEM++[7]). But even when they often contain strong
algorithms and procedures, their user friendliness is rather low and some of them are
yet not suitable for solving complicated technical problems. Nevertheless, even in this
domain the progress is fast. Our group has been developing for years software Agros2D
[24] based on the library Hermes2D [36]. And the aim of this paper is to show thestructure of the code, its features, feasibilities and several illustrative examples solved
by this software.
2 Specific features of our codes
Unlike the mentioned professional codes, Agros2D and Hermes2D exhibit quite
unique features. We can mention the full hp-adaptivity, support of hanging nodes of
any level, multimesh technology (every physical field can be calculated on a different
mesh generally varying in time) and a possibility of combining triangular, quadrilateral
and curved elements. Details are provided in the following subsections.
2.1 Implemented adaptivity techniques
Generally, the algorithms of adaptivity start to be applied at the moment when some
local error of solution is higher than the acceptable tolerance. Consider an equation
L f= 0 , (1)
whereL denotes a differential operator and f a function whose distribution over some
domain is to be found. If fis its approximation obtained by the numerical solutionof(1), the absolute and percentage relative errors and are defined by the relations
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
4/28
S384 P. Karban et al.
= f f = 100 f . (2)
Not only the above errors can be used for evaluating the quality of the results. Errors
can also be estimated by means of norms. Hermes2D works with three of them:
Basic energetic norm that is defined by the formula
e =
(L) d
12
. (3)
L2 norm defined by the relation
eL 2=
2 d
12
. (4)
H1 norm defined by the relation
e
H1
=
2 +grad
grad d
12
. (5)
Unfortunately, the exact solution f is usually known only in very simple, analyti-
cally solvable cases. Moreover, there exists no general method that would provide a
good estimation of the error for an arbitrary PDE (although for several classes of linear
PDEs we can find it). Moreover, in the case of the hp adaptivity the traditional error
estimate (one number per element) is not enough; we must know its distribution over
the whole element. In principle, it might be possible to obtain this information from
the estimates of local higher derivatives, but this approach is not very practical. That
is why we work[35] with the reference solution frefinstead, that is obtained eitherby a refinement of the whole mesh (h-adaptivity), by enlargement of the polynomial
degree (p-adaptivity) or by both above techniques (hp-adaptivity). In this manner we
get the candidates for adaptivity even without knowledge of the exact solution f. The
library Hermes2D works with very sophisticated and subtle tools based on the above
considerations.
Before the adaptivity loop is applied, the code must initialize the refinement selector
that determines what kind of adaptivity is to be applied. The selector performs the
following steps:
Selection of the candidates for refinement, computation of their local errors, which
is realized by projecting the reference solution on their FE spaces.
Computation of the number of the degrees of freedom for every candidate.
Evaluation of the score for each candidate and sorting the candidates according to
their values.
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
5/28
Numerical solution of coupled problems using code Agros2D S385
Selection of the candidate with the highest score.
As mentioned before, the adaptivity algorithm in Hermes needs an actual mesh
solution and another solution realized on globally refined mesh (the reference solution).
These solutions are subtracted in each adaptivity step in order to obtain an errorestimate (as a function of the position). This function is used to decide which elements
need to be refined and in which way. Hence, the adaptivity loop begins with the global
refinement of the mesh and calculation of the reference solution.
If the error is higher than a given threshold, the adaptation process is started. The
calculated local error in the candidate is first evaluated with respect to the way of
adaptivity that should be used. Its weight is selected in the following way:
w = 2 for theh-adaptivity, w = 1 for thep-adaptivity, w = 2 for thehp-adaptivity.
The scores of a candidate is given by the formula
s=log10
0
(d d0) , (6)
where is the estimated error in the candidate,ddenotes its number of DOFs,0and
d0 are selected parameters and stands for the convergence exponent.
The particular kinds of adaptivity are realized in the following manner:
h-adaptivitywhile the original large finite element is split to several smaller ele-
ments, the degree of the polynomials replacing the real distribution of the inves-
tigated quantity in them remains the same. This is clear from Fig.2left, where
both large element and smaller elements are described by polynomials of the same
order.
p-adaptivitythe shapes of elements in the region do not change, but we increase
the orders of the polynomial approximating the distribution of the investigated
quantity. The situation is depicted in Fig.3right.
hp-adaptivitycombination of both above ways [32]. This way belongs to the
most flexible and powerful techniques characterized by an extremely fast (expo-
nential) convergence of results. A typical possibility of its application is depicted in
Fig.3.
2.2 Multimesh technology
Each physical field involved in the coupled task can be solved on quite a different
mesh that best corresponds to its particulars. For example, electromagnetic-thermal
problems are characterized by the influence of electromagnetic and temperature fields.
While the domains in which electromagnetic fields are calculated, are discretized with
respect to their behavior (a very fine discretization in the subdomains with currents
induced by the skin or proximity effect), temperature fields are usually smooth and
the corresponding mesh can consist of larger elements. Special powerful higher-order
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
6/28
S386 P. Karban et al.
techniques of mapping are then used to avoid any numerical errors in the process
of assembly of the stiffness matrix. All meshes can, moreover, change in time, in
accordance with the real evolution of the corresponding physical quantities. Their
application will be shown in the section with examples.
2.3 Hanging nodes
Hermes2D supports hanging nodes of any level [33]. Usually, the hanging nodes bring
about a considerable increase of the number of the degrees of freedom (DOFs). The
code contains higher-order algorithms for respecting these nodes without any need of
an additional refinement of the external parts neighboring with the refined subdomain.
2.4 Types of elements
Agros2D generates meshes that may generally consist of triangular, quadrilateral and
curvilinear elements. While creation of common triangular and quadrilateral elements
is well known and will not be discussed here, we will show creation of the curvilinear
elements suitable for covering areas adjacent to curved boundaries and interfaces (this
technique is original and we do not know any commercial software that would use
something like that).
Agros2D discretizes 2D domains on the base of software Triangle [30] that provides
a high-quality triangular mesh. The corresponding input data for modeling curvilinear
boundaries or interfaces in Triangle are given by a series of points lying on this line
(together with the markers carrying information that these points belong to such a
line) while the output is represented by a set of triangular elements (see Fig. 4). In the
Fig. 2 Part of a discretization mesh afterh-adaptive (left) andp-adaptive (right) process:light linesbefore
adaptivity,dark linesafter adaptivity, thedarker colourof the element, the higher polynomial
Fig. 3 Part of a discretization
mesh afterhp-adaptive process:
thedarker colourof the element,
the higher polynomial, some
elements are, moreover, split
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
7/28
Numerical solution of coupled problems using code Agros2D S387
Fig. 4 Input data for SW Triangle (left) and output mesh (right)
Fig. 5 Projection of a newly generated node on the curve (left) and resultant s elements formed in Agros2D
(right)
second step Agros2D repeats analyzing the curved lines and when any of the newly
generated nodes approximating the curve (see Fig.4,right part) does not lie on it, it
is automatically projected on the original arc, see Fig. 5. At the same time a special
procedure determines the corresponding angles of projection.
In the course of numerical processing of the task the curvilinear elements are
mapped back on normal triangles where all remaining operations (such as Gaussian
numerical integration) are carried out and only in the final step (postprocessing) they
are mapped again to the curvilinear elements.
3 Main features of Agros2D
Agros2D (see Fig.6) is a powerful code for numerical solutions of 2D coupled prob-
lems in technical disciplines. Its principal part is a user interface serving for com-
plete preprocessing and postprocessing of the tasks (it contains sophisticated tools for
building geometrical models and input of data, generators of meshes, tables of weak
forms for the partial differential equations and tools for evaluating results and drawing
graphs and maps). The processor is based on the library Hermes2D containing the most
advanced numerical algorithms for monolithic and fully adaptive solution of systems
of generally nonlinear and nonstationary partial differential equations (PDEs) based on
the finite element method of higher order of accuracy. Both parts of the code are written
in C++. They are freely distributed under the GNU General Public License v2.1.
The development of the application Agros2D was started in 2009 at the Department
of Theory of Electrical Engineering at the University of West Bohemia in Pilsen.
It has been successfully used for research and teaching at several universities and
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
8/28
S388 P. Karban et al.
Fig. 6 Main window of Agros2D
scientific institutions. Moreover, it has been used by several companies for modeling
and development of various technical devices.
3.1 XML description of modules
The main ambition of Agros2D is to be universal tool for solution of various types of
partial differential equation. The core of the program is thus written generally, with no
dependence on properties of individual physical fields. All field-related data are stored
in separate XML files. This system makes it simple to create new modules, since the
code does not need to be changed, only a new XML file has to be created.
XML files describing modules and couplings can be converted into C++ code.
Agros2D uses several tools for transforming. For reading XML files, library Xerces-
C++[16] is used. After reading, the data are processed by our own lexical and syntactic
analyzer. The lexical analyzer creates the vector of tokens, which are, after basic
syntactic check, replaced using required grammar. All the necessary files are then
generated using ctemplate library[4]. The source files are prepared for usage as Qt
plugins. Therefore, it is possible to change modules and couplings and compile them
during run-time.
A XML describing physical field consists of following parts. After the initial part
describing the field properties and considered types of analyses, follows the defini-
tion of volumetric weak forms (different for linear and nonlinear case and for planar
and antisymmetric coordinate system). In the next part, surface properties, especially
boundary condition types, are defined. Information from those two parts are used for
creation of weak forms and discretization of the problem. The following parts are
used to generate the graphical user interface (GUI). Material quantities are described
(to be filled in by the user) and formulas for postprocessor quantities and surface and
volume integrals are given. Note that in the sample file shown in the appendix, most
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
9/28
Numerical solution of coupled problems using code Agros2D S389
of the quantities are omitted to save space. By creating such file, a new physical field
together with GUI can be completely created with no changes in the code itself.
3.2 Physical fields
At the present moment, Agros2D is capable of solution of the following fields:
electric currents,
electrostatics,
magnetic fields,
heat transfer,
structural mechanics
radio frequency,
acoustics, incompressible flow,
mathematics (Laplace, Poisson, Helmholtz, diffusion, convection-diffusion, wave
equation).
The above fields may be solved in different modes (steady-states, transients, harmonic
fields) where appropriate. Nonlinear material properties may also be respected during
the solution process.
3.3 Coupled problems
For the solution of complex problems, interaction of more physical fields has to be con-
sidered. There are two fundamentally different approaches towards this complicated
issue, referred to as weak and hard coupling.
The weak coupling is simpler to implement, since individual fields are calculated
separately. In the situation, where terms comprising values of one field are present
in the equation describing the other one, but not vice-versa (the case of one-way
coupling), this method is usually preferable. In the case of both-way coupling, the
use of the weak approach leads to the necessity of several repetitions of consecutivesolution of the individual fields, where the values of the second field are taken
from the previous iteration. This is obviously rather time-consuming and also
the convergence is a big issue. For such problems, the following method is more
suitable.
Using the hard coupling approach, where is no need for iterating, since only one
discrete system is created and then solved using linear or nonlinear solver. It is,
however, much more complicated to implement and therefore the majority of finite
element codes use some variation of the weak coupling.
This being a rather novel feature of our code, we have implemented and tested threecoupling possibilities up to now:
electric currents and heat transfer,
magnetic fields and heat transfer,
heat transfer and structural mechanics.
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
10/28
S390 P. Karban et al.
More options should be available soon. More than two fields may be coupled for
complicated problems, such as magnetic, heat and elasticity, as it is shown in illustrative
example in Sect.4.2.
As described in Sect.3.1,all information related to the individual fields (equations,
boundary conditions, material parameters, postprocessor quantities, etc.) are separatedfrom the computational core and stored in XML modules. The same model is used for
couplings definition. For each pair of fields A and B, whose coupling is considered,
one separate XML module is created with specification of coupling terms that are
to be added into the weak formulation for each combination of types of analyses of
A and B (steady state, transient or harmonic) and desired type of coupling (weak or
hard). Files are written in such a manner that no contents of field modules has to be
duplicated. C++ source codes are generated from coupling modules in the same way
as for the field modules, as it was described previously.
3.4 Time dependent problems
A lot of interest is usually paid to the spatial discretization and to the effort to minimize
its error with reasonable computational cost. It is equally important to try to minimize
the number of time steps, since the total computational time is proportional to it. The
basic implicit or explicit Euler method simply does not suffice. The usual strategy of
solving transient problems is to discretize the equation in space, solve it and, hence,
obtain a system of ordinary differential equations in time, which can then be handled
separately using standard tools for solution of ordinary differential equations. This is
not an option in our code, since the mesh may be different in each time step due to
possible space adaptivity. We have to use the Rothe method instead, carrying out the
time discretization first.
The continuous time-dependent problem can be written in the form
y
t= F(y, t) . (7)
To discretize the time derivative, we have implemented a variant of backward differ-ential method (BDF)
ni=0
iyki= F(yk, tk) , (8)
where tkare time levels,yk= y(tk) corresponding solutions and coefficients idependon the lengths of previous steps and thus allow the time step to be changed (in the
case of time adaptivity, which will be discussed later). After the time discretization is
done using this formula, the space discretization can be performed in the same way as
it would be for a steady state problem. The only difference is the necessity to provide
values of solutions from n previous time steps, projected to the current mesh. This
is possible thanks to capabilities of the Hermes library. We have implemented the
method of ordersn= 1, 2, 3.
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
11/28
Numerical solution of coupled problems using code Agros2D S391
Fig. 7 Basic arrangement of
transient problem
Fig. 8 Dependence of resulting temperature at a selected point of the domain on the number of time steps
Using higher order time discretization can bring significant speed improvement
itself, but it can be further used to develop an adaptive time-step method. Solving the
problem using two different orders, an estimate of the error can be obtained. It can then
be used to determine the length of the next time step (enlarge or shorten) in order to keep
the error as close to the prescribed tolerance as possible and thus obtain solution with
desired accuracy using as few time steps as possible. Obviously, the question of choos-
ing the right value of the tolerance and generally the relation of the errors caused by spa-
tial and time discretizations is very complicated and is beyond the scope of this article.
The advantages of adaptive selection of the time step length will be shown on an
illustrative example shown in Fig.7.
Figure8depicts the dependence of the resultant temperature at a selected pointof the domain on the number of time steps (in the logarithmic scale) for fixed and
adaptive step lengths. All methods converge to the same value, but adaptive methods
(marked by squares) much faster than those with a fixed step (marked by discs).
3.5 Particle tracing
The movement of the particle obeys the equations for its velocityvand trajectorysin
the forms
mdv
dt= F, ds
dt= v, (9)
where F is the sum of all forces acting on the particle. The corresponding initial
conditions read
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
12/28
S392 P. Karban et al.
s(0) = s0, v(0) = v0, (10)
wheres0 is the entry position and v0 is the entry velocity of the particle.
The following forces have to be considered.
The force acting on the charged particle in electromagnetic field is called Lorentz
force. This force is given by the relation
FL= Q(E + v B) , (11)
where E denotes the local value of the electric field and B stands for the local value
of magnetic flux density. Q denotes the charge of the particle andv its velocity.
The gravitational force is given by the formula
Fg= mg, (12)
wherem denotes the mass of the particle andg is the gravitational acceleration.
The aerodynamic resistance is given by the formula
Fa= v1
2cSv, (13)
cbeing the friction coefficient (depending on geometry of the particle), denotes
the density of ambient air,Sis the characteristic surface of the particle and vstandsfor the module of its velocity.
This set of two equations is strongly nonlinear due to the forces on the right-hand
side. For numerical solution of the trajectory of the particle we use the RungeKutta
Fehlberg method. This method uses anO (h4)method together with an O (h5)method
that works with all the points of the O(h4)method, and, hence, it is often referred to
as an RKF45 method. Our code is fully adaptive and optimal time step is chosen.
3.6 Structure of Agros2D
The work-flow of Agros2D, as for most of the commercial codes, can be divided into
three main phases. First the user has to specify the problem and create geometry. Than
the actual solution takes place. After the field is resolved, various postprocessor tools
may be used.
3.6.1 Preprocessor
One of the main advantages of commercial codes over most of the academical projects,
which is of great importance for practitioners, is a presence of advanced preprocessor
tools. In Agros2D, we have implemented all features that are necessary for creation
of complex engineering problem (see Fig.9). After selection of considered physical
fields and types of analyses, the user starts with geometry definition. It comprises of
creation of nodes, edges and areas. Curved edges can be used to create more realistic
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
13/28
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
14/28
S394 P. Karban et al.
Fig. 10 Window of postprocessor (distribution of temperature after 45 min)
is carried out by supplying assembled matrix and vector to the external linear solver.
We usually use the well known direct solver UMFPACK [18], but MUMPS[10] and
SuperLU [19] can be also called, depending on users preferences.
3.6.3 Postprocessor
A very important part of software Agros2D is an advanced postprocessor. In technical
practice, it is necessary to work with a variety of derived variables. Agros2D allows dis-
playing scalar variables in the form of color map or contour lines, for the vector quan-
tities it is possible to display their modules, components or vector field (see Fig.10).
There are implemented integrals of surface and volume calculations. Other features
include determination of the point values, cross-section graphs and particle tracing.Agros2D itself contains only general support for postprocessing. The relations for cal-
culation of the local and the integral quantities are part of each specific module. There-
fore, it is easy to add postprocessor quantities by modifying the relevant XML file.
3.7 Scripting language
Agros2D also contains an engine for scripting language Python [13]. This engine
extends abilities of preprocessing, processing and also postprocessing. It is possible
to use Python expressions and defined variables for entering model data (geometry,
material and boundary parameters, etc.) in GUI. This functionality is advantageous
for work with complex models. But the main advantage of this engine is a full control
of model by using object-oriented wrappers available as special Python module of
Agros2D.
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
15/28
Numerical solution of coupled problems using code Agros2D S395
Fig. 11 Main window of PythonLab
Scripting in Agros2D allows making advanced analysis. For example, it is possible
to use scripts for parametric analysis, result analysis and their visualisation or couple
solved model with other models using computed results. Scripting also allows extend-
ing the basic functionality of Agros2D. Now, under development there is a Python
module for optimization, which allows using special algorithms for optimizing the
modeled problem.
It is possible to use the editor PythonLab (see Fig. 11) for editing scripts. PythonLab
is developed mainly for Agros2D and allows using:
code completion,
syntax highlighting,
code bugs and quality checking with PyLint[12] and PyFlakes [11] and
converter from model to script.
Python contains many modules that are possible to be used in Agros2D. It is one
of the main advantages of using Python. For example, SciPy [14] adds a support for
scientific computing, matplotlib [9] adds plotting capabilities.
4 Illustrative examples
The power of code Agros2D is documented by three following examples from the
domain of electrical engineering:
induction heating of rotating nonmagnetic billets in static magnetic field generated
by permanent magnets,
accurate setting of position based on thermoelastic principle,
separation of plastic particles based on triboelectric effect.
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
16/28
S396 P. Karban et al.
The purpose of this demonstration is not only to show the unique capabilities of
the Hermes library (which has been already done in many papers, see, e.g.,[21,32
34]), but also to show user-friendliness of the Agros2D software. The three following
examples have been selected in such a way to facilitate various aspects (adaptivity,
coupling, time-dependence, nonlinearities, etc.). Even when all such situations mightbe handled by various existing codes, it would sometimes require a lot of work just
to describe the calculation (using many calls to the library or writing large script). In
Agros2D, everything can be done from graphical user interface, which is very fast,
efficient and less prone to errors.
Agros2D, however, is not just a GUI to the Hermes library. It should be viewed
as a higher level of the code, which utilizes low-level calls to the library to construct
everything necessary for the solution of the given problem. It is designed to help
engineers to select from various range of fields with predefined boundary conditions
types and materials, define their mutual interactions and finally to view values ofdifferent quantities related to the field or to calculate surface or volume integrals.
Such things are usually not priorities of academical codes developers, which makes
them extremely difficult to use for the practitioners. The software is, however, written
in such a way, that it allows large control over the calculation. Therefore a more
advanced user can chose from various settings.
In the following examples, we decided not to show screen-shots from the calcu-
lations. The GUI itself is quite simple to use and this paper is not intended to be a
manual. The purpose is to show how complicated situations can be solved thanks to
the Agros2D layer over the Hermes with no need to write new single-purpose codescalling Hermes routines, which might be very time consuming.
4.1 Induction heating of nonmagnetic cylindrical billets rotating in a system of static
permanent magnets
Induction heating of cylindrical billets of various nonmagnetic metals (mostly alu-
minum) is a widely spread technological process often used for their softening before
hot forming[17]. This process is usually realized using the two following ways:
heating of an unmoving billet in a system of static, harmonic currents carrying
inductors,
heating of a rotating billet in static magnetic field generated by static inductors.
Heating of billets placed inside harmonic current-carrying inductors belongs to the
classical ways of heat treatment. This technology has been employed since the thirties
of the twentieth century. But its effectiveness is rather low due to high Joule losses in
the inverter and inductor themselves (that must be transferred away by an appropriate
cooling medium). The efficiency of the process typically does not exceed 3040 %.
Heating of a rotating billet in static magnetic field produced by direct current-
carrying inductor was proposed about 10 years ago and modeled by several groups of
authors, such as [22,27]. The most important of them is generation of a sufficiently
high magnetic field and corresponding eddy currents in the billet. As its revolutions
are rather limited (in case of massive billets with diameters over 0.1 m their value
does not exceed 750 rpm), the only possible solution is using very high field currents,
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
17/28
Numerical solution of coupled problems using code Agros2D S397
Fig. 12 Basic arrangement (left) and experimental device (right)
which usually requires superconducting devices with all necessary infrastructure. Inthis case, the Joule losses (due to low resistance of the field windings) are not crucial,
but certain amount of energy is consumed by the cooling devices and rotation of the
billet. The overall efficiency of the process is reported to be about 6580 %.
In our case, the static magnetic field is generated by appropriately arranged high-
parameter permanent magnets. A typical disposition is depicted in Fig. 12.
This version of heating is characterized by the absence of the field coils (and the
corresponding Joule losses), thus the only losses in the system are the mechanical
losses. A physical model built in our laboratory is depicted in Fig.12right.
4.1.1 Mathematical model
The continuous mathematical model of heating consists of two nonlinear partial dif-
ferential equations providing the distribution of static magnetic field and evolutionary
temperature field in the system. The distribution of magnetic field is described in terms
of magnetic vector potentialA by the equation
curl 1
curl A Hc (v curl A) = 0 , (14)where stands for the magnetic permeability, is the electrical conductivity, v is
the local velocity of movement at a point, and Hcis the coercive force. A sufficiently
distant artificial boundary is characterized by the Dirichlet condition A = 0.The temperature field in the system obeys the equation
div gradT c dTdt
= pJ, (15)
where is the thermal conductivity, is the specific mass, andc denotes the specific
heat at a constant pressure. Finally, the symbol pJ denotes the time average internal
sources of heat represented by the volumetric Joule losses. These are given by the
formula
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
18/28
S398 P. Karban et al.
pJ=Jeddy2
, whereJeddy= (v curl A) . (16)
This equation is supplemented with the boundary condition respecting convection
Tn
= (T Text) ,
whereText is the temperature of ambient air. As the temperature of the magnetic circuit
is low (it does not exceed 50 C), the influence of radiation was neglected at this stageof the research.
4.1.2 Example
The magnetic circuit of the experimental stand is made of standard carbon steel 12,040
whose magnetization characteristic is depicted in Fig. 13left. The heated billet fixed
by a specific mechanism is driven by a 3 kW induction motor. The dependence of
physical parameters of aluminum on temperature are depicted in Figs. 13 and 14.
The radius of the billet is 60 mm. The nominal speed of the motor is 1, 500 rpm.
The permanent magnets are of type VMM10 and exhibit the remanent magnetic flux
density Br= 1.28 T and relative permeability in the second quadrantr= 1.11.
Fig. 13 Magnetization characteristic of steel 12,040 and dependence of thermal conductivity of aluminum
on temperature
Fig. 14 Dependence of mass density (left) and specific heat (right) of aluminum on temperature
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
19/28
Numerical solution of coupled problems using code Agros2D S399
Fig. 15 Distribution of magnetic flux densityB
Fig. 16 Distribution of permeabilityr and temperatureTat timet= 180 s
4.1.3 Results
Figure 15 shows the distribution of magnetic flux density in the system and Fig. 16 leftthe corresponding distribution of magnetic permeability in the part of the magnetic
circuit. Finally, Fig.16right depicts the distribution of temperature in the system after
180 s of heating.
4.2 Accurate setting of position based on thermoelastic principle
Thermoelastic deformations of metal bodies produced by induction heating are
exploited in numerous industrial technologies (hot pressing, production of high forces
etc. [20,31]). But thermoelasticity may also be advantageous for producing small,
but well controllable shifts. A schematic arrangement of the corresponding device is
depicted in Fig.17.A dilatation element made of appropriate metal is inserted into
a current-carrying coil in a fixing ferromagnetic frame. The whole system is placed
in the insulating shell. The device is clamped by its bottom part (insulating front) in
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
20/28
S400 P. Karban et al.
Fig. 17 Basic arrangement of the device
the basement (ideally stiff wall). The time-variable magnetic field generated by the
field coil induces in the dilatation element eddy currents that produce its heating and
consequent geometrical changes of the thermoelastic origin.
4.2.1 Mathematical model
Distribution of electromagnetic field in the system in the period of heating is described
by the equation for magnetic vector potential A
curl1
curlA + A
t= Jext, (17)
where denotes the magnetic permeability, is the electric conductivity and Jextstands for the vector of external harmonic current density in the inductor. Parameter
is generally a function of the temperature T and is a function of temperature Tand magnetic flux densityB = curlA.
But solution to equation 17is practically unfeasible. The reason consists in the
deep disproportion between the frequency f(10 or 100 Hz) of the field current and
time of heating (tens of seconds or minutes). That is why the model was somewhat
simplified using the assumption that the magnetic field is harmonic. In such a case it
can be described by the Helmholtz equation for the phasor A of the magnetic vector
potentialA
curl curl A +j A = Jext, (18)where is the angular frequency, and J
extis the phasor of the external harmonic current
density in the field coil. The conditions along the axis of the device and artificial
boundary placed at a sufficient distance from the system are of the Dirichlet type
A = 0.The temperature field in the system is described by the heat transfer equation
div(T) gradT
(T) c(T)
T
t = pJ, (19)
where (T) is the thermal conductivity, (T) denotes the mass density and symbol
c(T) stands for the specific heat (all of these parameters are generally temperature-
dependent functions). Finally, pJdenotes the time average volume Joule losses due to
eddy currents in electrically conductive parts that are given by the formula
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
21/28
Numerical solution of coupled problems using code Agros2D S401
pJ=J
eddy2
, J
eddy= j A . (20)
The boundary conditions take into account only convection
Tn
= (T Text) ,
where Text is external temperature. Since the dilatation element with the coil are
covered by the insulation (that is characterized by a poor thermal conductivity), we
can, without any significant error, neglect the influence of radiation.
The solution of the thermoelastic problem starts from the vector Lam equation
that reads
( + )grad div u + u (3 + 2) T gradT= f, (21)
where and are coefficients associated with material parameters by relations
= E(1 + )(1 2) , =
E
2(1 + ) .
HereEdenotes the modulus of elasticity and the Poisson coefficient of the transverse
contraction,Tis the coefficient of the linear thermal dilatability of material andfthe
vector of the internal volume forces. Finally u = (ur, u , uz )represents the resultantdisplacement vector.
4.2.2 Example
The geometry of the investigated device follows from Fig. 17. The material of the
dilatation element is zinc with electrical conductivity= 16 MS/m, Young modulusE
= 130 GPa, Poisson number
= 0.331, thermal expansion coefficient T
=27 106 K1. Finally, its thermal conductivity(T), mass density (T)and specificheatc(T)are temperature-dependent functions depicted in Figs.18and19.The field
coil is wound by a copper conductor (its thermal conductivity = 385 W m1 K1,mass density = 8, 700 kg m3 and specific heatc= 380 J kg1 K1) and carriesharmonic current of densityJext= 10 MA m2 and frequency f= 500 Hz. Thermalinsulation is made of Teflon with thermal conductivity = 0.23 W m1 K1, massdensity= 2, 200 kg m3 and specific heatc = 1, 000 J kg1 K1.
Figure20shows the three independent meshes (at the initial stage) for computation
of magnetic field, temperature field and field of thermoelastic displacements.
4.2.3 Results
Figure21shows (from left to right) the distribution of magnetic field, temperature
field and field of thermoelastic displacements after 30 s of heating.
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
22/28
S402 P. Karban et al.
Fig. 18 Dependence of thermal conductivity (left) and mass density (right) of zinc on temperature
Fig. 19 Dependence of specific
heat of zinc on temperature
Fig. 20 Used meshes (fromleft to right) for computation of magnetic field, heat transfer and thermoelas-
ticity (multimesh technology)
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
23/28
Numerical solution of coupled problems using code Agros2D S403
Fig. 21 Solution at timet= 30 s (magnetic field, heat transfer and thermoelasticity)
Fig. 22 Time dependence of average temperature of the dilatation element and axial displacement of the
topin the dilatation element
Figure22left shows the time evolution of the avarage temperature of the dilatationelement and Fig.22 right depicts an analogous evolution of the displacement of the
top end of the dilatation element.
Due to very efficient thermal insulation of the device, the process of heating is almost
adiabatic, so that both dependencies are practically linear within the investigated range
of temperatures.
4.3 Device for electrostatic separation of plastic particles
Nowadays, an intensive research is conducted worldwide, aimed at the possibilities of
recycling plastic materials, because in a lot of applications they may well replace the
new ones. The necessary prerequisite of this reprocessing is a high-quality separation
of particular kinds of plastics that are (at the first step of the process) grinded into
small sphere-shaped particles. One of the advanced techniques of separation of these
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
24/28
S404 P. Karban et al.
Fig. 23 Basic arrangement and dimensions of a typical separator
particles is based on the triboelectric effect [28,29,37]. It is known, that when electri-
cally non-conducting particles of two different levels come into contact with electric
charge, one of them becomes more positive (or negative) with respect to another one.
And when such charged particles get into electric field, their movement is then mainly
affected by the charge that they carry.
More accurately, the trajectories of the charged particles moving in electric field
are influenced by the Coulomb force exerted on them by this field, gravity, and dragaerodynamic forces. And these trajectories predetermine their impact points, in other
words, the places where they fall down. It is clear from Fig. 23 left showing the scheme
of a typical separator of this kind.
The separator consists of two electrodes, one of them being grounded. The voltage
of the other electrode is used to be on the order of tens kV. The electrodes may
be covered by Teflon or another insulating material that prevents recharging of the
particles in case of the direct impact with them. The mixture of charged particles is
delivered by the feeder. At the bottom of the device there are several recycle bins used
for accumulating of particular levels of plastics. One of the principal demands is totune the shape of the electrodes and widths of the bins so that the particles of different
levels should fall down exactly to the corresponding bins.
4.3.1 Mathematical model
Electric field in the working space of the separator is described by the equation for the
electric potential
div grad = 0 , (22)
whereis the dielectric permittivity. The boundary conditions are given by the known
values of the electric potential on the electrodes and the Neumann condition along the
artificial boundary placed at a sufficiently distance from the device.
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
25/28
Numerical solution of coupled problems using code Agros2D S405
The movement of the particle obeys the equations for its velocity v and trajectory
sin the forms
mdv
dt =Fe
+Fa
+Fg,
ds
dt =v , (23)
where Fe is the Coulomb force acting on the particle. This force is given by the relation
Fe= QE = Q grad , (24)
whereE denotes the local value of the electric field strength. Symbol Fa represents
the aerodynamic resistance given by (13)and gravity forceFg is described by(12).
4.3.2 Example
Consider the basic arrangement depicted in Fig. 23right. The particles of plastics of
charge Q= 0.5 C, mass density = 1, 370 kg m3, radius R= 2 mm andinitial velocity v0= 0 get to the space between two electrodes, one of them beinggrounded. There they are deflected according to their charge and fall down into the
recycle bins (presently, we neglect the Coulomb forces acting among the particles, so
that their movement is affected only by the external electric field). The task is to find
their trajectories and evaluate the effectiveness of separation. The voltage between the
electrodes isU= 45 kV.4.3.3 Results
Table1shows the convergence of results for different adaptive techniques used for the
numerical solution. The lowercase letterp denotes the starting order of the polynomials
and (x) the relative error of computation. Figure 24left shows initial mesh before
adaptive process and Figs.24 right and25 depict the discretization meshes after the
corresponding adaptive processes.
Finally, Fig. 26 shows typical trajectories of the PVC and PET particles in the
separator.
5 Conclusions and outlooks to the future
In our paper, we have presented the current state of our open-source project Agros2D. It
combines advanced numerical algorithms for solution of partial differential equations
Table 1 Convergence forh , p
andh p adaptivity techniques Start (x) DOFs (-) Steps (-) Time (s)
h-adaptivity p= 2 0.139 28086 9 72.811
p-adaptivity p= 1 0.177 13939 11 50.473
hp-adaptivity p= 1 0.197 12154 11 50.222
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
26/28
S406 P. Karban et al.
Fig. 24 Initial mesh (left),h-adaptivity, p= 2 (right)
Fig. 25 p-adaptivity, p= 1 (left),h p-adaptivity, p= 1 (right)
with modern and efficient graphical user interface. This combination makes it possible
for the practitioners to benefit from fast and reliable algorithms with no need to study
details of numerical mathematics. The advanced GUI is also useful for the development
of algorithms itself, since it is much simpler to maintain, test and modify such program
than it is for traditional academical one-purpose codes.
The work is, of course, far from being finished. Even though Agros2D is capable of
solving problems from various fields, few additional modules could be added. Thanks
to a complete separation of computational logic from the definition of individual
fields, addition of new modules is quiet simple, since the code itself does not need
to be changed. The next important issue, that has been addressed recently, is making
1 3
-
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
27/28
Numerical solution of coupled problems using code Agros2D S407
Fig. 26 Trajectories of selected particles (PVC and PET)
the code more efficient. Parallelization of the code is important toll in achieving this.
At the present moment, we use it on the OpenMP level only. For an efficient deployment
on cluster computers, usage of MPI is necessary. It is, however, much more demanding
and requires substantional refactoring of the code.
Acknowledgements This work was supported by the European Regional Development Fund and Ministry
of Education, Youth and Sports of the Czech Republic (Project No. CZ.1.05/2.1.00/03.0094: Regional
Innovation Centre for Electrical Engineering - RICE) and Grant project GACR P102/11/0498.
References
1. ANSYS. http://www.ansys.com
2. CEDRAT Flux. http://www.cedrat.com
3. COMSOL Multiphysics.http://www.comsol.com
4. ctemplate.http://code.google.com/p/ctemplate5. deal.ii. http://www.dealii.org
6. FreeFem++. http://www.freefem.org/ff++
7. GetFEM++.http://download.gna.org/getfem/html/homepage/index.html
8. infolytica.http://www.infolytica.com
9. matplotlib.http://matplotlib.org
10. MUMPS.http://graal.ens-lyon.fr/MUMPS
11. PyFlakes.http://pypi.python.org/pypi/pyflakes
12. PyLint.http://www.logilab.org/project/pylint
13. Python. http://www.python.org
14. SciPy.http://www.scipy.org
15. Vector Fields Software - Opera.http://www.cobham.com/about-cobham/aerospace-and-security/abo16. Xerces CPP.http://xerces.apache.org/xerces-c
17. Cavaliere P (2002) Hot and warm forming of 2618 aluminum alloy. J Light Met 2:247252
18. Davis TA (2004) A column pre-ordering strategy for the unsymmetric-pattern multifrontal method.
ACM Trans Math Soft 30(2):165195
19. Demmel JW, Eisenstat SC, Gilbert JR, Li XS, Liu JWH (1999) A supernodal approach to sparse partial
pivoting. SIAM J Matrix Anal Appl 20(3):720755
1 3
http://www.ansys.com/http://www.cedrat.com/http://www.comsol.com/http://code.google.com/p/ctemplatehttp://www.dealii.org/http://www.freefem.org/ff++http://download.gna.org/getfem/html/homepage/index.htmlhttp://www.infolytica.com/http://matplotlib.org/http://graal.ens-lyon.fr/MUMPShttp://pypi.python.org/pypi/pyflakeshttp://www.logilab.org/project/pylinthttp://www.python.org/http://www.scipy.org/http://www.cobham.com/about-cobham/aerospace-and-security/abohttp://xerces.apache.org/xerces-chttp://xerces.apache.org/xerces-chttp://www.cobham.com/about-cobham/aerospace-and-security/abohttp://www.scipy.org/http://www.python.org/http://www.logilab.org/project/pylinthttp://pypi.python.org/pypi/pyflakeshttp://graal.ens-lyon.fr/MUMPShttp://matplotlib.org/http://www.infolytica.com/http://download.gna.org/getfem/html/homepage/index.htmlhttp://www.freefem.org/ff++http://www.dealii.org/http://code.google.com/p/ctemplatehttp://www.comsol.com/http://www.cedrat.com/http://www.ansys.com/ -
8/10/2019 KARBAN Numerical Solution of Coupled Problems Using Code Agros2D
28/28
S408 P. Karban et al.
20. Dolezel I, Karban P, Ulrych B, Pantelyat M, Matyukhin M, Gontarowskiy P, Shulzhenko M (2008)
Limit operation regimes of actuators working on principle of thermoelasticity. IEEE Trans Magn
44:810813
21. Dubcova L, Solin P, Cerveny J, Kus P (2010) Space and time adaptive two-mesh hp-fem for transient
microwave heating problems. Electromagnetics 30:2340
22. Fabbri M, Morandi A, RibanyL (2008)Dc induction heating of aluminum billets using superconductingmagnets. COMPEL 27:480490
23. Geuzaine C, Remacle JF (2009) Gmsh: a three-dimensional finite element mesh generator with built-in
pre- and post-processing facilities. Int J Numer Meth Eng 79:13091331
24. Karban P, et al. Multiplatform C++ application for the solution of PDEs.http://agros2d.org(online)
25. Logg A, Mardal KA, Wells GN et al (2012) Automated Solution of Differential Equations by the Finite
Element Method, Springer, Berlin. doi:10.1007/978-3-642-23099-8
26. Long KR, Kirby RC (2010) Unified embedded parallel finite element computations via software-based
frechet differentiation. SIAM J Sci Comput 32(6):33233351
27. Magnusson N, Bersas R, Runde M (2004) Induction heating of aluminum billets using hts dc coils.
Ins Phy Conf Ser 2:11041109
28. Moesner FM, Toshiro H (1997) Contactless manipulation of microparts by electric field traps. Proc
SPIEs Int Symp Microrobot Microsyst Fabr 3202:168175
29. Saeki M (2008) Triboelectric separation of three-component plastic mixture. Part Sci Technol 26:494
506
30. Shewchuk JR (1996) Triangle: engineering a 2d quality mesh generator and delaunay triangulator.
Applied Computational Geometry: towards Geometric Engineering 1148:203222. http://www.cs.
cmu.edu/quake/triangle.html
31. Skopek M, Ulrych B, Dolezel I (2001) Optimized regime of induction heating of a disk before its
pressing on shaft. IEEE Trans Magn 37:33803383
32. Solin P, Andrs D, Cerveny J, Simko M (2010) Pde-independent adaptive hp-fem based on hierarchic
extension of finite element spaces. J Comput Appl Math 233:30863094
33. Solin P, Cerveny J, Dolezel I (2008) Arbitrary-level hanging nodes and automatic adaptivity in the
hp-fem. Math Comput Simul 77:11713234. Solin P, Korous L (2012) Adaptive higher-order finite element methods for transient pde problems
based on embedded higher-order implicit runge-kutta methods. J Comput Phy 231:16351649
35. Solin P, Segeth K, Dolezel I (2003) Higher-Order Finite Element Methods. CRC Press, Boca Raton
36. Solin P et al (2012) Hermes-higher-order modular finite element system (users guide).http://hpfem.
org(online)
37. Yanar DK, Kwetkus BA (1995) Journal of electrostatics. IEEE Trans Magn 36:257266
http://agros2d.org/http://dx.doi.org/10.1007/978-3-642-23099-8http://dx.doi.org/10.1007/978-3-642-23099-8http://www.cs.cmu.edu/quake/triangle.htmlhttp://www.cs.cmu.edu/quake/triangle.htmlhttp://hpfem.org/http://hpfem.org/http://hpfem.org/http://hpfem.org/http://www.cs.cmu.edu/quake/triangle.htmlhttp://www.cs.cmu.edu/quake/triangle.htmlhttp://dx.doi.org/10.1007/978-3-642-23099-8http://agros2d.org/