2.4 Finite Element Method
2.4.4 Implementation
In order to focus on the application of the numerical simulations, rather than on the implementation of the solver itself, it was decided, at the beginning of the project, to opt for a commercially available implementation of the FEM. This allowed us to rely on external competence for the continuous update of the libraries of numerical subroutines and for the incorporation of the latest development in terms of solver algorithms, which would otherwise require the dedication of a large amount of time.
After a number of comparative tests on accuracy and computational time with alterna- tive numerical solvers which were available at the ORC (Multipole Method, Orthogonal Function Method, Beam Propagation Method and Plane Wave Expansion Method), it was concluded that COMSOL MULTIPHYSICSTM would provide an excellent solution, combining the advantages of the FEM (see Section 2.3) with a flexible and versatile platform.
COMSOL MULTIPHYSICSTM is a commercial implementation of the FEM, allowing the application of the method to a vast range of engineering problems, including acoustics, fluid dynamics, structural mechanics and electromagnetic problems. The software con- tains many physical models of interest (including the full vectorial Equation 2.5 or 2.16) and presents an integrated CAD for structural design, a mesh generator, an internal ma- trix assembler, various state-of-the-art numerical solvers for sparse matrices and several postprocessing features.
Despite all these characteristics, though, COMSOL MULTIPHYSICSTM is a general tool, not optimised for simulating electromagnetic propagation in MOFs. Its CAD interface, for example, can be useful and intuitive to use in certain circumstances, but it certainly is not adequate for frequent structural changes such as those required by an inverse design procedure. Besides the CAD however, the software also presents a Matlab scripting interface which allows full control of the various modelling phases. Therefore, a number of Matlabscripts allowing the automatic definition of the structure, the imposition of physical and boundary parameters, meshing and simulation of a vast range of MOFs have been developed, implemented and used throughout the project.
The principal steps to simulate the optical behaviour of a MOF are discussed in the following and are illustrated in Figure 2.1, by means of a simple example concerning a 5 ring index guiding holey fibre. Note that symmetry considerations allow the use of a
π/2 minimum sector for the study of the fundamental mode (see Section 1.2.3).
(a) 1 2 3 d 1 d 2 (b) (c) (d) (e) 1 1.2 1.4 1.6 −500 −400 −300 −200 −100 0 100 Wavelength [µm] D [ps/nm/km] (f)
Figure 2.1: Example of an FEM simulation: (a) structural design; (b) subdomain def-
inition; (c) setting of the boundary conditions; (d) mesh generation; (e) post-plotting; (f) calculation of the dispersion curve.
1. Geometrical definition. The first step is to define the transverse structure of the fibre. Depending on the fibre’s symmetry, a smaller sector may be considered (π/2 in this example), reducing the calculation domain without loosing any in- formation. For some studies however, such as those analysing many higher order modes, studying the full structure may be more convenient. In both cases the script automatically draws the inclusions with the required shape (here circular, with the same diameterd), and positions them on the desired lattice (here trian- gular, with constant pitch Λ). Note that, for the fibre in the example, the core is represented by a missing hole in the middle (shown in the bottom left corner). Alternatively, the contour of the cross section of a real fibre can be extracted from an SEM image; then it can be interpolated with splines and used as the structure to simulate. The boundaries of the Perfectly Matching Layers (PML), used to avoid reflections from the outer boundaries and emulate an infinite structure with a finite domain, also need to be drawn at this stage. Depending on the formulation, either square [as in Figure 2.1(a)] or circular shapes can be employed.
2. Subdomain setting. Next, the physical properties of the material in each sub- domain need to be set. The white holes in Figure 2.1(b) indicate the air region (refractive index equal to 1), while the cyan region corresponds to glass, whose refractive index can be set as function of frequency using the Sellmeier equation [6]: n2(ω) = 1 + m X j=1 Bjω2j ω2 j −ω2 (2.24) where the m resonant frequenciesωj and the strength of their resonances Bj de- pend on the glass.
The external, orange layers are thePerfectly Matched Layers (PMLs) introduced to limit the computational domain. PMLs are absorbing layers, specifically designed to introduce no reflections for any angle of incidence, polarisation or frequency of the incoming electromagnetic radiation, and are therefore perfectly suited to surround the simulation area. Their original concept was introduced by Berenger in 1994 [150], even though in that first definition they required the local modifi- cation of Maxwell’s equations. Shortly after, Sacks et al. demonstrated that the same absorbing and reflectionless behaviour could be achieved without modify- ing Maxwell’s equations, provided that the material was appropriately defined as anisotropic and complex [151]. This approach was much more easily implemented into standard numerical methods and immediately gained much popularity. Here the formulation for square PMLs surrounding theπ/2 sector of Figure 2.1(b) is presented. A similar formulation for the layers surrounding the full cross-section can be found in Ref. [152], while alternative definitions for circular and spherical PMLs are presented in Ref. [153, 154].
According to Sacks, the PMLs are defined as anisotropic materials, whose permit- tivity and permeability diagonal tensors are [151]:
[ε] =ε0n2[Λ] and [µ] =µ0[Λ] (2.25) with Λ = sy/sx 0 0 0 sx/sy 0 0 0 sxsy (2.26)
where ε0 and µ0 are the permittivity and permeability of free space, n is the
refractive index of the adjacent region and the PML parameters sx and sy are defined in Table 2.2 for region 1, 2 and 3 [see Figure 2.1(b)].
PML parameter PML region 1 2 3 sx 1 s2 s2 sy s1 s1 1 Table 2.2: PML parameters
Here si (i = 1,2) must be a complex number, the real part of which attenuates potential evanescent waves, while the imaginary part is effective in damping the propagating waves. In many studies (including the present one) the imaginary part is modelled by a polynomially increasing profile, so that
si =b+jamax µ ρ di ¶α i= 1,2 (2.27) where ρ is the distance from the beginning of the PML, di is the PML width in the horizontal or vertical direction,b,amax andαare PML free-parameters. After a number of tests and according to a frequent convention in preceding studies it was decided to fix a parabolic profile (α = 2) with b = 1 for all simulations. A number of convergence tests on the best value ofamax were also conducted; these are reported in Section 2.4.5.
3. Boundary setting. The physical properties of all boundaries of the simulation domain then have to be set. The boundary condition (BC) at an edge outside the PML is generally irrelevant, as the field at that point has been attenuated to a negligible level. Therefore the BCs for a full-structure simulation can be set arbitrarily. In contrast, if a smaller minimum sector is employed, the particular BC applied at the boundaries without PMLs allows one to distinguish between the various mode classes sharing the same sector (Section 1.2.3). For example, since the fundamental degenerate modes of hexagonal HFs belong to classes p= 3 and 4 of the original McIsaac’s definition [8], they can be distinguished by imposing,
at the bottom and left sides of the π/2 domain, either a perfectly electric – per- fectly magnetic (PE-PM) boundary condition or a (PM-PE) boundary condition, respectively. PE and PM boundary conditions are indicated in blue and black in Figure 2.1(c). A different combination of BCs may be needed in order to study higher order modes that belong to a different symmetry class. However note that, on the π/2 sector which is compatible with the definition of square PMLs, each combination of BCs allows two symmetry classes to be studied at the same time, as reported in Table 2.3. BC p (PE-PM) 4 and 8 (PM-PE) 3 and 7 (PE-PE) 6 and 2 (PM-PM) 5 and 1
Table 2.3: Mode classes that can be studied on aπ/2 sector by applying given BCs
to the (bottom, right) edge.
Internal boundaries between subdomains (in green in Figure 2.1(c)) need, inCOM- SOL MULTIPHYSICSTM, to be assigned the ‘internal boundary’ condition, which guarantees the continuity of both Displacement and Magnetic fields at the inter- faces. The scripts implemented automatically assign the desired BC to all the triangles lying at edges of the structure.
4. Meshing. Several mesh parameters can be adjusted, ultimately determining both accuracy of the solution and calculation time. As a general rule, a large number of triangles need to be positioned both around curved boundaries, in order to accurately define their shape, and where high accuracy is needed (e.g. where the field is more concentrated or where it changes more rapidly). An example is provided in Figure 2.1(d) where an inner hexagonal zone has been defined around the core with the only purpose of allowing a denser mesh. Generally a mesh convergence test is required in order to ensure that the structure has been properly meshed, and to minimise the related numerical errors (see Section 2.4.5).
5. Solving. As was mentioned in the previous section, ARPACK is the solver used by
COMSOL MULTIPHYSICSTM for all eigenvalue problems. A choice of linear solvers is however available, enabling both direct and iterative approaches to be selected. All solvers have been tested on a number of simulations, and in conclusion the direct solver UMFPACK3 was found to be the one generally providing the fastest
solution. UMFPACK is a set of routines for solving unsymmetric sparse linear systems, in the form [A]{x}={b}, using the Unsymmetric Multifrontal method.
Once the solvers have been chosen, various parameters need to be defined. Among the most important are the guess for the eigenvalue (σ) and the number of eigen- values to be calculated around this value. This is a critical choice, often requiring some knowledge of the structure to be simulated.
The scripts implemented during this project, are generally able to select automat- ically the desired mode of the structure, among the numerous solutions calculated. This can be done by exploiting symmetries and BCs, together with several possible additional criteria. For index guiding fibres, for example, the confinement loss is a good criterion for selecting the fundamental mode (for which it is generally the lowest); for hollow-core photonic bandgap fibres, a better indication is generally provided by the percentage of power in the core. Other rules can be set in order to recognise, without the need for manual intervention, cladding modes or surface modes.
6. Postprocessing. Once the eigenvalues and eigenvectors have been calculated, several postprocessing functions are available, for example for plotting or integrat- ing the eigensolution on specific edges or subdomains, directly from the values it assumes on the FEM mesh. Figure 2.1(e) shows, for example, intensity levels of the Poynting vector of the fundamental mode of the fibre. At this stage it is possi- ble to calculate the principal properties of the desired mode such as effective area, confinement loss, percentage of field in a given domain, etc. (see Section 1.2). As already observed, the main advantage of the scripting approach employed, as opposed to the manual use of the CAD, is that loops can be implemented easily. This can be used, for example, in order to scan the behaviour of the structure at different wavelengths and obtain dispersion curves (Figure 2.1(f)), or to perform convergence tests for the mesh or PML parameters, as will be reported in the next section.