Convergence Order COMSOL
Convergence Order COMSOL
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 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
7. References