Open-Source Automatic Nonuniform Mesh Generation for FDTD Simulation
Total Page:16
File Type:pdf, Size:1020Kb
This is a repository copy of Structured Mesh Generation : Open-source automatic nonuniform mesh generation for FDTD simulation. White Rose Research Online URL for this paper: https://eprints.whiterose.ac.uk/100155/ Version: Accepted Version Article: Berens, Michael, Flintoft, Ian David orcid.org/0000-0003-3153-8447 and Dawson, John Frederick orcid.org/0000-0003-4537-9977 (2016) Structured Mesh Generation : Open- source automatic nonuniform mesh generation for FDTD simulation. IEEE Antennas and Propagation Magazine. pp. 45-55. ISSN 1045-9243 https://doi.org/10.1109/MAP.2016.2541606 Reuse Items deposited in White Rose Research Online are protected by copyright, with all rights reserved unless indicated otherwise. They may be downloaded and/or printed for private study, or other acts as permitted by national copyright laws. The publisher or other rights holders may allow further reproduction and re-use of the full text version. This is indicated by the licence information on the White Rose Research Online record for the item. Takedown If you consider content in White Rose Research Online to be in breach of UK law, please notify us by emailing [email protected] including the URL of the record and the reason for the withdrawal request. [email protected] https://eprints.whiterose.ac.uk/ 1 Open Source Automatic Non-uniform Mesh Generation for FDTD Simulation Michael K. Berens, Ian D. Flintoft, Senior Member, IEEE, and John F. Dawson, Member, IEEE, Abstract—This article describes a cuboid structured mesh generator suitable for 3D numerical modelling using techniques such as finite-difference time-domain (FDTD) and transmission-line matrix (TLM). The mesh generator takes as its input an unstructured triangular surface mesh such as is available from many CAD systems, determines a suitable variable mesh discretisation and generates solid and surface meshes in a format suitable for import by the numerical solver. The mesher is implemented in the MATLAB language and is available as open source software. Index Terms—mesh generation, ray-casting, finite-difference time-domain, transmission-line matrix ✦ 1 INTRODUCTION the geometrical structure of the problem to be The finite-difference time-domain (FDTD) solved. For example, Figure 1 shows a sphere method is a numerical technique that is widely and a version of the sphere discretised using used to solve Maxwell’s differential equa- cubic elements. tions in the time domain [1]. Both space and Algorithms for automatic structured mesh time are discretised. Space is discretised into generation have been developed since the ca- rectangular-shaped elements in 2D or cuboid pabilities of the FDTD method and computer elements in 3D. Cuboid elements, where the hardware reached the point at which relatively electric fields are located on the edges of the complex geometries could be simulated. A se- cuboid and the magnetic fields normal to the lection of the techniques proposed are reported faces, are called Yee-cells and are the funda- in [3], [4], [5], [6], [7], [8], [9], [10], [11]. The mental elements of most FDTD methods [2]. process of generating a cuboid structured mesh By filling up the problem space with these from an arbitrary model geometry consists of cells, we obtain a 3D mesh, where neighbouring two main steps. The first is to determine an cells share edges and faces. Each cell has three efficient placement of the structured mesh lines, associated electric and magnetic field compo- constrained by the numerical requirements of nents, while the other field components be- the FDTD method, to “best fit” the model ge- long to adjacent cells. The properties of each ometry and the second is the identification of cell are adjusted to represent materials such which structured mesh cell belongs to which as dielectrics or conductors by adjusting the object, a process called material mapping. constitutive parameters used in the field equa- With regard to the mesh line placement an tions in the corresponding cells, hence forming interesting local approach was made in [12], where the non-uniform mesh of overlapping • J. F. Dawson, and I. D. Flintoft are with the Department of objects is considered as a constrained opti- Electronics, University of York, York YO10 5DD, U.K. (e-mail mization problem. By optimizing an objective [email protected], ian.fl[email protected]). function, which expresses all the constraints, • M. Berens is with the Institut f¨urGrundlagen der Elektrotech- such as the maximum and minimum cell sizes, nik und Meßtechnik, University of Hanover, Hanover D-30060, neighbouring cell size ratio and the influence Germany. of neighbouring intervals, an acceptable mesh IEEE ANTENNA AND PROPAGATION MAGAZINE 2 solution for many problems is found. Another local approach was proposed in [13], where the numerical error, caused by a rapid change of mesh size, is reduced by considering only the two cells on either side of a transition point between two intervals. There are also global approaches with a focus on all the in- tervals of a mesh [14]. Less constrained Carte- sian mesh generation algorithms have also been developed, e.g. for the Conformal FDTD al- gorithm [15], [16], [17] and for the hybrid FDTD/FETD algorithm [18]. Another indepen- dent category of non-uniform mesh generation is adaptive mesh refinement (AMR) [19], [20], [21]. This method is used to refine the mesh in regions of interest after (or during) a simulation without creating a completely new mesh. A number of different ray tracing methods have been reported for the material mapping stage. A good method should be fast, memory conserving and capable of handling different kinds of special cases, e.g. intersections in a very narrow angle or exactly in the object Fig. 1. Unstructured triangular mesh (top) and structured cubic plane, edge or node. These special cases can mesh (bottom) of a sphere. cause “singularities” and make the ray casting more difficult to implement. These issues are as a tool to aid the understanding of mesh explained in more detail in [22] and [23]. Very generation, and for experimentation with mesh efficient ray casting approachs are described generation techniques. in [24] and [25]. Although there are many freely available The geometry of structures to be modelled computer-aided design (CAD) or meshing pro- using an FDTD solver must be defined by grams that can directly create an unstructured some means which allows the production of polygonal mesh there are no freely available a suitable cuboid mesh. Here we assume the meshers that create structured cuboid meshes description is principally in the form of an with sufficient generality for practical EM sim- unstructured triangulated mesh describing the ulations of complex structures. Therefore we surface of each object, such as that shown in the have developed a MATLAB [27] code for uni- top part of Figure 1 for a sphere, since such a form and non-uniform structured mesh gener- representation can be generated by most CAD ation and published it as open source software. software packages. The code also works in GNU Octave [28]. The output data format has been kept quite generic 2 STRUCTURED MESH GENERATION so it can be easily adapted to create structured FOR FDTD SOLVERS output meshes for a wide range of numerical solvers. While the mesher is mostly based on In this section we consider the factors that affect the known algorithms briefly reviewed above, the placement of the mesh lines. Since the mesh we hope the open-source nature of the code cell size determines both the time step duration will make it useful to research and teaching and upper frequency limit, it is one of the most institutions that write and use their own nu- important factors limiting the FDTD simula- merical solvers. Moreover, the code can be used tion. In addition, the cell size has to be chosen IEEE ANTENNA AND PROPAGATION MAGAZINE 3 in such a way that the geometrical structure can to a number close to unity. Nevertheless there be represented appropriately and the numerical are advantages of non-uniform meshes, which error is acceptably small. However the smaller allow a fine mesh where geometrical detail or the cell size the larger the memory consumed field variation requires (for example material and the longer the run-time for a given prob- interfaces) and a coarse mesh elsewhere. This lem. Therefore a mesher should produce mesh allows a trade-off between numerical error and lines with the largest spacing that satisfies the computational efficiency. In addition, a variable above constraints. mesh cell size allows the mesh-to-object fitting to be adjusted, which can be important, for ex- 2.1 Numerical errors due to cell size and ample, to ensure accurate resonant frequencies cell size variation are obtained. Nevertheless, the ratio of adjacent mesh cell sizes needs to be constrained; in most Numerical errors are inherent undesired ef- cases it is sufficient to chose the upper limit for fects within the classical Yee-cell based FDTD- this ratio as di/di+1 < 1.5. methods that originate from numerical disper- sion and anisotropy. In other words they orig- inate from the dependence of the numerical 3 AN ALGORITHM FOR STRUCTURED wave propagation velocity in the mesh on fre- MESH GENERATION quency and direction [29]. Because numerical dispersion causes cumulative phase errors and 3.1 Input unstructured mesh non-physical refraction, it is necessary to min- Since most CAD packages are capable of ex- imize these effects. In general the dispersion porting an unstructured mesh, regardless of error per wavelength can be expressed as their internal representation, we chose to use λ an unstructured mesh, rather than a particular ψerr =2π · − 1 , (1) CAD representation as input to the mesher. For λ ! the internal unstructured and structured mesh where λ/λ is the ratio ofe the exact (continu- formats we created a format based on those ous space) wavelength to the numerical wave- defined in the AMELET-HDF specification [34].