0% found this document useful (0 votes)
98 views6 pages

Convergence Order COMSOL

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views6 pages

Convergence Order COMSOL

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

On the Convergence Order of COMSOL Solutions

A. Bradji*,1 and E. Holzbecher2


1
Charles University, Prague (CZECH Rep.)
2
Weierstrass Institute for Applied Analysis and Stochastics (WIAS), Berlin (GERMANY)
*Corresponding author: KNM MFF UK, Sokolovska 83, CZ-18675 Praha 8, [email protected]

Abstract: The convergence of numerical boundary conditions and right hand sides. We
solutions is mainly determined by the use different Finite Element spaces, and compute
convergence order, which quantifies the the gain from using adaptive meshing. We also
improvement of the solution, when the mesh is compare with theoretical results: for most
refined. models the convergence order lies between 2 and
In the paper we examine various different 3 (for default quadratic elements), i.e. between a
differential equations and the convergence linear and a quadratic increase of accuracy with
behavior of their COMSOL Finite Element the spatial grid size.
solutions. In the first part we describe the general
procedure, how for irregular meshes the 2. Determination of Convergence Order
convergence order is determined.
In the main part of the paper several systems The convergence order ϑ is defined by the
(modes, equations) are studied. We start with relationship
e = O ( hϑ )
classical application modes, as the Laplace
equation and the Poisson equation, the latter for (1)
smooth and non-smooth right hand sides (like
where e denotes the error, .. a norm, and h the
Dirac's function). We proceed with more
complex Navier-Stokes equations and finally typical element size.
with a (multi-physics) flow and transport In order to determine the convergence order from
example. numerical runs, the errors of runs with different
The numerically observed convergence rates are refinement level have to be related. As it is
compared with theoretical results, as far as these difficult to evaluate the mean size of the
are available. The examples show that for the elements h, one may alternatively use the
studied cases the convergence rate of COMSOL degrees of freedom (DOF) for the determination
numerics is identical to the theoretically derived of the convergence rate. Jänicke & Kost (1999)
convergence rates. propose the formula
ln ( e1 ) − ln ( e2 )
Keywords: Finite Elements, convergence order, ϑ = −2 (2)
adaptive meshes, Poisson equation, potential ln ( DOF1 ) − ln ( DOF2 )
equation where subscripts denote run number (1999).
Formula (2) is valid for 2D problems and has to
1. Introduction be replaced by corresponding formulae for 1D or
3D problems, because the characteristic grid
The convergence of a numerical solution towards spacing h decreases with number of DOF.
the analytical solution of a set-up of one or
several partial differential equations generally 3. Poisson Equation with 1st Type
depends on various characteristics of the Boundary Condition and Non-singular
problem and of the numerical algorithm. The
Right Hand Side
convergence order is a measure for the
improvement of the solution as a consequence of
3.1 Testcase 1
mesh refinement.
Here we examine several test problems in 2D
The first test problem concerns the Poisson
using classical partial differential equations
equation
(Poisson- and Laplace equations), and from
different application fields, from electrostatics to −∇ 2 u = 1 within the unit circle (3)
fluid dynamics. We explore various set-ups with
one or two differential equations, with different
with boundary condition of Dirichlet type: u = 0 3.2 ite Testcase 2
at all positions of the circle. The analytical
solution is given by: Another testcase, tackled in the literature (Köster
u ( x, y ) = −( x 2 + y 2 − 1) / 4 (4) & Turek 2006), concerns the function
In case of quadratic Lagrange elements, the u ( x, y ) = sin ( xy ) sin ( (1 − x)(1 − y ) ) (5)
COMSOL default setting, one obtains the exact
solution in the interior (the solution is a quadratic in the unit square. The results for linear and
function); only in the vicinity of the boundaries quadratic elements are given in Table 2. The
there are deviations, because the element shape convergence order for linear elements is 2, the
at the boundary follows the geometry and the convergence order for quadratic elements is 3.
relationship between local and global coordinates For coarse grids the error for quadratic elements
is not linear (see also: COMSOL model library is much less than for linear elements, even if
compared for the same DOF. Tables 3a and 3b
→ benchmarks → Poisson unit disk).
show results for the testcase with adaptive
meshing. Default parameters were used for the
adaption process. Convergence orders are in the
same range as in the fixed mesh case. Moreover
the results show clearly that adaptive meshing
does not deliver a higher accuracy. That may be
attributed to the fact that high resolution is
required at all boundaries, where highest errors
appear. The small remaining part in the interior
of the region with coarser resolution does not
count.

Table 2: Results for the Poisson testcase 2 with


Dirichlet- boundary conditions; subscripts for
error (max.-norm) e and convergence order ϑ
Figure 1. COMSOL numerical solution for the
testcase 1 Poisson problem; the solution is according to element order
depicted as surface plot; the color represents the
error for linear elements and for a refined grid DOF e 1 ϑ1 e 2 ϑ2
-4
520 4.1 10 1.81
Figure 1 depicts the solution and the error
-4
distribution for the testcase. The results in case 2017 1.2 10 1.97 9.4 10-6 3.00
of linear Lagrange elements, i.e. degrees of 7945 3.1 10 -5
1.97 1.2 10 -6
2.98
freedom (DOF), the error in the L2-norm and the -6 -7
resulting values for the convergence rate are 31537 8.0 10 2.01 1.5 10 3.11
given in Table 1. The theoretical value of 2 1.25 2.0 10-6 1.8 10-8
(Ciarlet 1991) for that situation is confirmed by 105 2.00 2.97
the numerical simulations. 5 10 5
5.0 10 -7
2.3 10 -9

Table 1: Results for the Poisson testcase 1 with


Dirichlet- boundary conditions Table 3a: Results for the Poisson testcase 2 with
adaptive meshing; linear elements
DOF e ϑ
DOF1 e 1 ϑ1
1561 0.0017
1.95
11397 2.9 10-5 2.09
6145 0.00044
2.00 -6
42119 7.4 10 1.83
24383 0.00011
1.98
151207 2.3 10-6
97163 0.000028
1.95
537232 6.7 10-7
Table 3b: Results for the Poisson testcase 2 with Table 4: Results for the Poisson problem with
adaptive meshing; quadratic elements Dirac right hand side
DOF2 e 2 ϑ2 DOF e ϑ

11033 1.4 10-6 2.64 1561 0.0021


1.015
-7
57053 1.6 10 3.10 6145 0.00010
1.01
288053 1.3 10-8 24383 0.00005
1.00
97163 0.000025

5. Laplace equation with Dirichlet and


Neumann Boundary Conditions

An example of a 2D potential problem was


suggested by Jänicke & Kost (1999). There are
Neumann and Dirichlet-conditions at the
boundaries as can be seen in Figure 3 (Neumann
at the left and the upper right boundary). The
numerical solution is compared to the analytical
solution. The latter was programmed using
Schwarz-Christoffel transformations applying
the Schwarz–Christoffel Toolbox (Driscoll)
Figure 2: COMSOL numerical solution for the
written in MATLAB®. The COMSOL results
Poisson problem with Dirac right hand side; the
are exported to MATLAB®, in order to compare
figure shows the solution as surface, streamlines
solutions and the calculate error norms.
and arrows

4. Poisson Equation with Dirac Right


Hand Side
The second test problem concerns the differential
equation
−∇ 2 u = δ (0) within the unit circle (6)
with Dirac's δ-function on the right hand side.
The boundary conditions are again of Dirichlet
type: u = 0 on all positions of the unit circle. The
analytical solution is given by the logarithmic
function:
u ( x, y ) = − ln(r ) / 2π = − ln(r 2 ) / 4π (7)
(see also: 'Implementing a point source' in the
COMSOL Users Guide and the point-source
benchmark example). The solution is visualized
in Figure 2.
We chose the default quadratic elements.
Table 4 provides the results for the test-case. The Figure 3. COMSOL numerical solution for the
theoretical result of first order convergence potential problem with Dirichlet- and Neumann
(Clain, 1995) is confirmed. The quadratic boundary conditions
convergence, which is valid for the smooth right
hand side, can obviously not be reached for the Table 5 shows results for the initial mesh and 2
non-smooth situation. refinements. The convergence rate of COMSOL
is better than the one reported for another Finite Table 6 lists the results for quadratic elements,
Element implementation (Jänicke & Kost 1999). showing an increasing convergence rate in the
considered range.
Table 5: Results for the potential problem with Table 7 and Table 8 show the errors and
Dirichlet- and Neumann boundary conditions, convergence rates, if the option for adaptive
for linear elements mesh refinement is selected. It clearly turns out
# lin. e that adaptive meshing is an advantage in this
DOF
elements ϑ testcase. This is due to the fact that the
527 992 0.249 'degenerate' behavior is restricted to the very few
0.95 locations, where the type of the boundary
2045 3968 0.129
1.07 condition changes.
8057 15872 0.0614
1.05
31985 63488 0.0297
1.02 6. The Navier-Stokes Equations
127457 253952 0.0146

Table 6: Results for the potential problem with As an example for a non-linear set of equations
Dirichlet- and Neumann boundary conditions, we tested the dimensionless Navier-Stokes
for quadratic elements equations:

( )
# quad.
( u ⋅ ∇ ) u = ∇ ⋅  − pI +
e 1 T 
DOF
elem. ϑ ∇u + ( ∇u ) 
 Re  (8)
2045 992 0.1366
8045 3968 0.0702
0.96 ∇ ⋅u = 0
1.08 In the steady state case the Reynolds-number Re
31985 15872 0.0332
1.23 remains the only parameter. Dependent variables
127457 63488 0.0142
are the velocity u and pressure p.
Table 7: Results for the potential problem with For test we chose an application problem: flow
Dirichlet- and Neumann boundary conditions, through a U-turn, as they are examined in
for linear elements and adaptive meshing meander studies (Nguyen et al. 2004,
# lin. Holzbecher 2006). We chose characteristic
DOF e ϑ boundary conditions, as described in the former
elements
3.3 publication. Figure 4 depicts the geometry.
2369 4603 Channel width and also the spacing between the
10-2
2.22 two straight legs was chosen as 1. The Reynolds
6.8
9797 19318 -3 number is set to 100.
10
1.86 Figure 4 also shows the velocity, represented by
1.9
38531 76495 -3 colours (red= high, blue=low), streamlines and
10
1.90 arrows in flow direction. Moreover the location
5.3
147906 294740 -4 of the maximum and minimum pressure are
10
indicated.
As there is no analytical solution for the
Table 8: Results for the potential problem with
problem, we determined the reference solution,
Dirichlet- and Neumann boundary conditions,
which represents the analytical solution in the
for quadratic elements and adaptive meshing
error calculations, by COMSOL also. It was
# quad. e
DOF
elements ϑ produced by using a fine initial mesh and
adaptive meshing and has 271351 DOFs.
1.3
13518 6659 The numerical models to be checked started with
10-3
3.72 an initial coarse mesh (DOF: 844), which was
5.5 refined four times (DOFs: 3017, 11359, 44027
74114 36823 -5
10 and 173299) without adaptive meshing.
3.25
4.1 As Finite Elements we took the default P2P1-
366399 182686 -6
10 Lagrange elements and did not utilize any
artificial diffusion scheme.
Table 9: Results for the potential problem with
Dirichlet- and Neumann boundary conditions,
for quadratic elements and adaptive meshing

Rate ep ep eu eu
∞ 2 ∞ 2

ϑ01 1.13 3.54 0.69 2.54


ϑ12 1.16 1.80 1.70 2.09
ϑ23 2.10 1.47 1.25 1.73
ϑ34 1.55 0.80 3.13 1.60

In contrast to the cases examined before there is


no clear tendency concerning the convergence
rates. Values are mainly between 1 and 2. The
theoretical value of 2 for ϑ was not reached in
the mean, but was even surpassed several times.
It turned out that convergence rates are also quite
different, concerning the chosen norm and the
chosen variable. The example shows that various
different effects may be valid or invalid in
different stages of grid refinement, as it is
characteristic for real application cases. Here the
accuracy of the solution is mainly determined by
the accuracy near the half circle. Especially the
refinement at the two inner corners are crucial:
the details of the flow regime in the vicinity of
these corners were not captured: even in the most
refined grid the pressure minimum is taken at the
outlet, while the reference solution shows a
minimum near the upstream inner corner (see
Figure 4).

7. Connected Flow and Transport

We also tested the coupled system of equations:


∇ 2ϕ = 4 ∇ 2T = − ∇ϕ
2
(9)
where the equation for the electric potential ϕ is
coupled with the heat transport equation,
including heat diffusion and Ohmic losses, the
latter related to the gradient of the potential.
With zero Dirichlet boundary conditions for both
Figure 4. COMSOL numerical solution for the variables, in the unit square of corner (0,0), the
Navier-Stokes equations solution of system (9) is:

As post-processing task we computed the errors ϕ = x2 + y2 T =−


3
( x + y4 )
1 4
(10)
for pressures (p) and x-velocities (u) in the
maximum norm e ∞ and L2- norm e 2 .and The solution is visualized in Figures 5 and 6.
derived the convergence rates according to
formula (2). The latter are shown in Table 9.
We found a convergence rate of 2 for both the
potential and the transport variable T (see Tables
10 and 11). This confirms the theoretical result
of Elliot & Larsson (1995).

7. References

1. Ciarlet Ph. P., Basic error estimates for


elliptic problems, in: Handbook of Numerical
Analysis II, Finite Element Methods (Part 1),
P.G. Ciarlet & J.L. Lions (eds.), North-Holand,
Amsterdam, 17-352, 1991
Figure 5. COMSOL numerical solution for the 2. Clain, S., Finite element approximation for
potential with Dirichlet- boundary conditions the Laplace operator with right-hand side
measure, Math. Models Methods Appl. Sci. 6,
713-719, 1995.
3. Driscoll T.A., Schwarz–Christoffel Toolbox
User’s Guide, Version 2.3
4. Elliott, Ch. M. & Larsson, S., A finite
element model for the time dependent Joule
heating problems. Math. Comp. 64 (212), 1433-
1453, 1995
5. Gallouet, T & Herbin, R.: Convergence of
linear finite elements for diffusion equations
with measure data. C. R. Math. Acad. Sci. Paris,
Ser. I 338 (1), 81-84, 2004
6. Jänicke L. & Kost A., Convergence
Figure 6. COMSOL numerical solution for the
Properties of the Finite Element Method, IEEE
temperature with Dirichlet- boundary conditions Transactions on Magnetics 35 (3), 1414-1417,
1999
Table 10: Results for the Potential solution with
7. Jänicke L. & Kost A., Error Estimation and
Dirichlet condition-, for linear elements
Adaptive Mesh Generation in the 2D and 3D
Finite Element Method, IEEE Transactions on
DOF e ϑ
Magnetics 32 (3), 1334-1337, 1996
8. Holzbecher E., Meandering Flow in
520 9.6125 10-4
2.022 Microchannels, COMSOL Anwenderkonferenz
2017 2.4413 10-4 2006, Frankfurt a.M., FEMLAB GmbH (ed),
2.00 170-172, 2006
7945 6.1400 10-5 9. Köster M. & Turek S., The influence of
2.006
31537 1.5395 10-5 higher order FEM discretisations on multigrid
convergence, Intern. Math. Journ. 6(2), 221-232,
2006
Table 11: Results for the Temperature solution 10. Nguyen P.T., Berning T., Djilali N.,
with Dirichlet condition-, for linear elements Computational model of a PEM fuel cell with
serpentine gas flow channels, J. of Power
DOF e ϑ Sources 130, 149-157, 2004

1040 7.0427 10-4 8. Acknowledgements


2.022
-4
4034 1.7889 10 The work of the first author was supported by the Czech
2.00
-5 Ministry of Education and Research, grant No. LC06052.
15890 4.4944 10 The work of the second author was supported by the German
2.006
Federal Ministry of Education and Research, grant No.
63074 1.269 10-5 03SF0311A.

You might also like