Adaptive refinement for 2D triangular meshes (Electrical Machine) Part 2

By

Additional refinement rules

Marking the edges to be refined is performed in four steps to improve the quality of the generated mesh, even in regions where no elements have to be refined.

• To improve the initial average aspect ratio of the new elements, the edges of elements with an aspect ratiotmp101058_thumb[2]are marked in a special way (Fig. 5.62).

• All edges of an element to be refined are marked.

• All non-outline edges that touch two outlines are marked for refinement during the first adaptation step (Fig. 5.63).

• All edges that touch an outline edge to be refined are marked (Fig. 5.64).

Refinement of elements with an aspect ratio

Fig. 5.62. Refinement of elements with an aspect ratiotmp101061_thumb[2]

Refinement of non-outline edges touching two outlines.

Fig. 5.63. Refinement of non-outline edges touching two outlines.

Refinement of edges touching an outline edge i.

Fig. 5.64. Refinement of edges touching an outline edge i.

A posteriori error estimation

An a posteriori error estimator evaluates the local errortmp101066_thumb[2]per element, based on a previously computed solution. This error estimation can be performed in two different ways:

• model based and

• region, label based.

Fig. 5.64. Refinement of edges touching an outline edge i.

To obtain a local error betweentmp101068_thumb[2]for the model based strategy,it is normalised, i.e. divided by the maximum error over all elements in the model.

tmp101071_thumb[2]

This type of estimation is called model error estimation. A maximum accepted local errortmp101072_thumb[2]can be specified and all elements with a larger error bound are considered for refinement.

tmp101075_thumb[2]

The elements are arranged according to their local error and the elements with the highest error are refined first. The number of refined elements is determined by the maximum percentage of new elements p specified (e.g. 100 %). The maximum number of elementstmp101076_thumb[2]marked for refinement is given by:

tmp101079_thumb[2]

withtmp101080_thumb[2]the number of elements, c a constant depending on the refinement method. The constant c indicates the ratio of the number of refined elements to the number of new elements:tmp101081_thumb[2]for an edge-based refinement andtmp101082_thumb[2]for an element-based refinement.

Determining the elements to be refined.

Fig. 5.65. Determining the elements to be refined.

A label-based error estimator calculates the local error within each region label separately and the error is normalised by division with the maximum error within the label. The maximum number of elementstmp101090_thumb[2]to be refined is determined by the number of elementstmp101091_thumb[2]inside the label.

tmp101094_thumb[2]

Elements are refined all over the model, but also in regions (labels) where it is probably not necessary. This, if not desired explicitly, represents a disadvantage of a label-based refinement.

The local error can be evaluated in various ways. The error indicator has influence on the generated mesh and its proper choice is dependent on the problem definition as such, time-harmonic or static magnet field solution and on the strategy of refinement, minimum or quality meshing. Therefore, no indication regarding use of a particular estimator or estimation scheme will be given.

Energy in an element The energytmp101096_thumb[2]in an element is an indication for the local errortmp101097_thumb[2]

tmp101100_thumb[2]

Flux density at a node The magnetic flux densitytmp101103_thumb[2]at a nodetmp101104_thumb[2]is the weighted average of the values of the magnetic flux densitytmp101105_thumb[2] of the surrounding elements k belonging to the same label (Fig. 5.66). The weighting factor is the areatmp101106_thumb[2]of the elements.

tmp101111_thumb[2]

The local errortmp101116_thumb[2]of an element is calculated as the difference between the magnetic flux density of the element and the average of the nodal values.

tmp101118_thumb[2]

 

Calculation of the magnetic flux density at a node.

Fig. 5.66. Calculation of the magnetic flux density at a node.

Magnetic flux density in a node weighted with the energy The local errortmp101121_thumb[2]based on the magnetic flux density in a node is weighted with the energytmp101122_thumb[2]in an element.

tmp101125_thumb[2]

Numerical implementation

Error estimation and mesh enhancements require computation time. Searching in very large data structures absorbs most of this time. To optimise such efforts with respect to the computational costs towards a better approximation of a field solution, ‘intelligent’ data structures are recommended to accelerate the search routines.

Starting from the element matrix ‘eletti’ indicating how the elements are built out of the nodes, the node-to-element matrix ‘nodeeleni is built in a straightforward way (Fig. 5.67). This matrix gives for each node the surrounding elements. The number of surrounding elements is stored in the vector ‘surrelem’. Fig. 5.68 gives the element matrix for the initial triangulation of Fig. 5.56 and Fig. 5.69 the node-to-element matrix and the number-of-surrounding-elements vector.

Building the node-to-element matrix.

Fig. 5.67. Building the node-to-element matrix.

Element matrix.

Fig. 5.68. Element matrix.

Node-to-element matrix and number-of-surrounding-elements vector.

Fig. 5.69. Node-to-element matrix and number-of-surrounding-elements vector.

The neighbouring-element matrix is now built. For each edge of an element the neighbouring element is determined. The two rows of the node-to-element matrix are searched for the common element numbers. The element itself is found and if another element number is found, it is that of the neighbouring element. As shown in Fig. 5.69, the rows of the node-to-element matrix are sorted and the number of surrounding elements is almost a constant. This means that very effective and fast search algorithms can be used. Fig. 5.70 shows the neighbouring-element matrix for the initial triangulation. Binary constraints are dealt with during the building of the neighbouring-element matrix. Elements connected through binary constraints are neighbouring elements.

Neighbouring-element matrix.

Fig. 5.70. Neighbouring-element matrix.

Edge-based refinement An edge-based refinement is implemented using a neighbouring-element matrix. The refinement of an element influences the neighbouring elements. An error estimator marks the elements to be refined. All the edges of the marked elements are marked for refinement. Putting the number of the new node according to the edge to be refined in the to-be-refined-edges matrix ‘re/edge" does this. At the same time, the appropriate edge of the neighbouring element is marked with the same node number. When two elements are connected through binary constraints, the next node number is used. Fig. 5.71 shows the to-be-reflned-edges matrix according to the refinement of Fig. 5.56. Again only element 6 is to be refined ("Red’ element). Elements 5, 7 and 9 are ‘Green I elements.

To-be-refined-edges matrix.

Fig. 5.71. To-be-refined-edges matrix.

Edge-based refinement.

Fig. 5.72. Edge-based refinement.

After all edges are marked for refinement, each element is refined according Fig. 5.72. Testing as to whether the intermediate triangulation is a Delaunay triangulation is not done. A Delaunay triangulation is unique and therefore it is sufficient to use a global Delaunay algorithm to obtain a Delaunay triangulation with the new nodes. A possible algorithm is a loop over all nodes and testing all pairs of two adjacent surrounding elements. The number of swapped diagonals is counted and the loop is repeated until there are no swaps performed. The resulting triangulation is a Delaunay triangulation (Fig. 5.72c). In practice, the loop is repeated until the number of swaps is less than 10 % of the number of swaps in the first loop. Because the number of swaps is rather low for an edge-based refinement, the quality of the generated mesh is high, but the mesh is strictly speaking not a Delaunay triangulation.