A 3D CAD-based FDTD conformal grid automatic generation method and device
By introducing a three-dimensional contour equivalent dielectric constant conformal mesh calculation method in three-dimensional FDTD, combined with the three-dimensional CAD model for scanning and calculation, the problem of insufficient accuracy in three-dimensional FDTD in the prior art is solved, and more efficient and accurate electromagnetic field simulation is achieved.
Patent Information
- Application Number
- CN202211453241.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-21
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2042-11-21
AI Technical Summary
The existing two-dimensional FDTD conformal mesh technology cannot be directly applied in three-dimensional FDTD, resulting in insufficient accuracy and waste of computing resources in three-dimensional electromagnetic field simulation.
A method of automatic generation of FDTD conformal mesh based on three-dimensional CAD is proposed. Using Faraday's integrated law and Ampere integral law, a three-dimensional contour equivalent dielectric constant conformal mesh calculation method can be derived for three-dimensional FDTD, and a three-dimensional CAD model is combined for longitudinal ray scanning and transverse plane scanning, the geometric information and material information of each boundary lattice are calculated, and the FDTD conformal mesh model is generated.
It improves the quality and efficiency of FDTD grid generation, reduces computational complexity, improves simulation accuracy, and shows better convergence when the resolution is improved.
Smart Images

Figure CN115758492B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of numerical calculation of electromagnetic fields, and particularly relates to a method and device for generating FDTD conformal grids. Background Art
[0002] The finite-difference time-domain (FDTD) method for electromagnetic fields directly solves Maxwell's equations or wave equations in the time domain to obtain the electric and magnetic field strengths at spatial nodes in the time domain, and can accurately reflect the response law of electromagnetic waves in a specific waveguide structure. In FDTD, the spatial arrangement of discrete electric and magnetic field calculation nodes is as Figure 1 shown. Each electric field component is surrounded by four magnetic field components orthogonal to it, and the same is true for the magnetic field. At the same time, this regular cuboid grid usually cannot fit complex simulation devices, so it is inevitable that the Yee cell modeling cannot completely match the actual object, which will surely introduce a large error. In the early FDTD grids, one Yee cell could only be of one material. Therefore, the curved surface appears as a stepped shape in this grid model, so it is called a stepped grid. After the commercial simulation software of FDTD was launched, many FDTD conformal grid technologies have been implemented in commercial software. The representative FDTD simulation software is the FDTD module of Lumerical software of Ansys Corporation; the representative conformal grids include the volume averaging method, the two-dimension contour path effective permittivity method (abbreviated as 2D-CP-EP), and the volume-average polarized effective permittivity method (abbreviated as VP-EP). The volume averaging method simply calculates the volume ratio of various materials in a field component grid and uses the volume ratio as a weighting coefficient to calculate the weighted average of multiple material coefficients; the latter two consider the normal vector information of the dielectric interface. The two-dimension contour path effective permittivity method considers the boundary conditions of the electromagnetic field and can calculate the equivalent material coefficient more accurately. It is also a conformal grid technology publicly used in Ansys Lumerical software. FDTD conformal grids can effectively improve the simulation accuracy with almost no additional computing resources.
[0003] Compared with the stepped grid, different conformal grids can improve the accuracy without changing the computing resources when simulating the same model and using the same resolution. However, when different FDTD conformal grid generation methods are commercialized, there will be slight differences in the conformal grid calculations of simulation software developed on different platforms. These differences are mainly due to the architecture of the grid generator and the way of processing geometric model information. For example, the accuracy of calculating the filling volume of different materials in a grid and the way of processing when two or more materials fill a grid simultaneously, etc., will all show differences in the finally generated grid. Summary of the Invention
[0004] In order to improve the quality and efficiency of grid generation by a general FDTD grid generator, in view of the problem that the existing conformal grid of the two-dimensional contour equivalent permittivity method for two-dimensional FDTD cannot be used in three-dimensional FDTD, the boundary conditions of the electromagnetic field are considered, and the electromagnetic field within the same medium in a field component grid is regarded as uniformly distributed. By using Faraday's integral law and Ampere's integral law, a calculation method for three-dimensional contour equivalent permittivity conformal grid for three-dimensional FDTD is derived. In addition to FDTD, this method can also be extended to hexahedron grids used in other algorithms.
[0005] The technical solution adopted by the present invention to solve its technical problems is: an automatic generation method for FDTD conformal grid based on three-dimensional CAD:
[0006] Use CAD software to generate a three-dimensional model based on triangular facets, and divide the grid lines of FDTD on the three-dimensional model;
[0007] Perform longitudinal ray scanning and transverse plane scanning on the three-dimensional model according to the FDTD grid lines, and calculate the geometric information and material information of each boundary grid;
[0008] Substitute the geometric information of the boundary grid and the calculated material information into the 3D-CP-EP algorithm formula group, and calculate the 3D-CP-EP conformal grid parameters of the three direction components at the same time to generate an FDTD conformal grid model; the 3D-CP-EP algorithm formula group is:
[0009]
[0010] Where: m is any one of the directions x, y or z, ε SP is the permittivity at the sampling point, ε l,O is the average value of the materials other than ε SP on the scanning line parallel to m and passing through the sampling point, r l,SP is the length ratio of ε SP on the scanning line, r l,o is the length ratio of ε l,oThe length ratio, ε s,O is the average value of materials on the scanning plane that is perpendicular to m and passes through the oversampling points, excluding ε SP and r s,SP is the area ratio of material ε SP on the scanning plane, and r s,O is the area ratio of ε s, on the scanning plane.
[0011] Furthermore, the internal electric field of the same material within the same grid is evenly distributed.
[0012] Furthermore, the relationship between the internal electric fields of two adjacent materials within the same grid is as follows:
[0013]
[0014] where and are the electric fields on both sides, and ε1 and ε2 are the dielectric constants of the two materials respectively; is the identity matrix, and its geometric meaning is the vector after projecting the electric field onto the normal vector direction.
[0015] Furthermore, the rectangle clipping algorithm and the line segment clipping algorithm are used to calculate the ratio information of various materials and the interface normal vector information on the boundary grids.
[0016] Furthermore, the present invention also provides an FDTD conformal grid automatic generation device based on 3D CAD, and the device includes: an FDTD parameter setting data reading module and a conformal grid generation module; wherein, the FDTD parameter setting data reading module is used to read a 3D model based on triangular facets generated by CAD software and divide the grid lines of FDTD on the 3D model; the conformal grid generation module is used to perform longitudinal ray scanning and transverse plane scanning on the 3D model, calculate the geometric information and material information of each boundary grid, and substitute the geometric information and material information of the boundary grid into the 3D-CP-EP algorithm formula group to calculate the 3D-CP-EP conformal grid parameters of the three direction components, and generate an FDTD conformal grid model.
[0017] Compared with the prior art, the present invention has the following beneficial effects: The grid generation rate of the present invention is greatly improved, and the calculation complexity of the present invention is smaller compared with the existing traditional grid technology. The grid quality also reaches the grid quality of the mainstream FDTD simulation software. And with the increase of the resolution (the number of grids per unit wavelength), the present invention shows better convergence. Brief Description of the Drawings
[0018] Figure 1 is the FDTD Yee cell model;
[0019] Figure 2 Schematic diagram of material boundary within the grid; among which, (a) Plane P0P1P2P3 divides the unit cell into two parts; (b) Intersection information of the scanning plane and scanning lines with the material boundary; (c) Geometric information of the material on the scanning plane ABCD; (d) Geometric information of the material on the scanning line EF;
[0020] Figure 3 Schematic illustration of conformal grid geometric information processing in the method of the present invention; among which, (a) Longitudinal (parallel field component) line scanning; (b) Transverse (perpendicular field component) plane scanning;
[0021] Figure 4 Schematic flow diagram of the automatic generation method of FDTD conformal grid based on 3D CAD of the present invention;
[0022] Figure 5 Process of generating a voxel grid from a surface triangular mesh for a torus; (a) Torus; (b); (c) ε obtained by meshing through a 3D-CP-EP grid generator eff,x Voxel model; (d) A layer of voxels obtained by slicing the model in (c) in the z direction;
[0023] Figure 6 Comparison of the time taken for meshing the torus to generate FDTD conformal grids by the method of the present invention and the prior art;
[0024] Figure 7 Schematic diagram of a DC directional coupler; among which, (a) Sketch of the DC directional coupler (z - direction span 0.22μm); (b) Schematic diagram of the positions of the mode source and monitor;
[0025] Figure 8 Schematic diagram of data comparison between the default conformal grid of Lum software and the conformal grid generated by the method of the present invention during simulation of the DC coupler; among which, (a) Forward - propagation normalized spectrum of the Through Monitor; (b) Forward - propagation normalized spectrum of the Cross Monitor; (c) Relative error of the Through Monitor at different resolutions; (d) Relative error of the Cross Monitor at different resolutions. Detailed implementation manners
[0026] For the convenience of understanding the present invention, the present invention will be described in more detail below in conjunction with the accompanying drawings and specific embodiments. The preferred embodiments of the present invention are given in the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described in this specification. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosed content of the present invention more thorough and comprehensive.
[0027] Embodiment 1
[0028] In the embodiments of the present invention, all vectors used are column vectors, and the transpose symbol is used when row vectors are needed. For example
[0029] Electric field representation method: Or
[0030] Normal vector representation method: Or
[0031] Normal vector direction projection matrix representation method:
[0032] In the FDTD simulation of a stepped grid, the electric field in a cell is regarded as uniformly distributed, while in a conformal grid, a more accurate estimation method is used within a cell. For example, the 2D-CPEP method considers that the electric field within the same material in a grid is uniformly distributed, and for the first time, the boundary conditions of the electromagnetic field are considered in the conformal grid.
[0033] Under the passive condition, the boundary condition of the electric field at the interface between two materials is:
[0034]
[0035] is the boundary normal vector, and are the electric fields on both sides respectively, and ε1 and ε2 are the dielectric constants of the two dielectrics respectively. Writing it in the form of matrix operation:
[0036]
[0037] is the identity matrix, and its geometric meaning is the vector after projecting the electric field onto the normal vector direction, such as
[0038] Through the boundary relationship, the electric field on one side of the boundary can be used to replace the electric field on the other side:
[0039]
[0040] The theoretical starting point of the 3D-CP-EP conformal grid algorithm (three-dimensional contour equivalent permittivity method) proposed by the present invention is as follows:
[0041] 1. The electric field within the same material in a grid is uniformly distributed.
[0042] 2. The boundary relationship of the electric field between two adjacent materials within a grid is
[0043] 3. Faraday's law of integration and Ampere's law of integration.
[0044] The derivation process of the 3D-CP-EP conformal grid algorithm proposed by the present invention is as follows:
[0045] Since the calculation methods of the component grids in the x, y, and z directions are the same, the component ε in the z direction is taken as an example for detailed introduction here. eff,z For example, a detailed introduction is given.
[0046] Figure 2 In (a), it shows a case where a z-component grid is filled with two materials, and the intersection surface of the material interface and the grid is the polygon P0P1P2P3. Figure 2 In (b), it shows that the transverse sampling surface in the z-component grid is the rectangle ABCD, with an area of s. The areas occupied by material 1 and material 2 are s1 and s2 respectively. The average normal vector at the intersection line of the two material interfaces and the rectangle ABCD is The longitudinal sampling line is the line segment EF, with a length of l. The line segments occupied by material 1 and material 2 are FG and GE, with lengths of l2 and l2 respectively. The normal vector at the intersection point of the two material interfaces and EF is Let The electric fields in material 1 and material 2 are respectively and
[0047] As Figure 2 shown in (b), by expanding Ampere's circuital law without sources on the rectangle ABCD, it can be obtained that:
[0048]
[0049] and are the uniform electric displacement vectors in medium 1 and medium 2 respectively. The equivalent uniform electric field displacement vector is The average electric field on the rectangle ABCD and the equivalent dielectric constant ε s are calculated by the following formula.
[0050]
[0051] After that, according to the method in (c), except for the central point, the electric fields are renamed with the electric field at the central point as Figure 2 The other electric fields are named as Then, according to the material ε at the central point The area ratio related to it is renamed as r s,SP s,SP In order to handle the case of filling with more than two materials, the other materials directly use the area ratio weighted average to calculate ε s,O s,O, and the total area ratio r of other materials s,O . After modifying the subscripts of formula (3), we get:
[0052]
[0053] Since the boundary condition is a matrix operation, convert equation (5) into a matrix operation and then substitute the boundary condition to eliminate So we have:
[0054] ε s E z = E s,SP,z [ε s,SP r s,SP + ε s,O r s,O A s,zz (7)
[0055] In the above formula As Figure 2 shown in (d), integrating the electric field along line segment EF, the energy is conserved whether before or after equivalence, and formula (8) is obtained.
[0056]
[0057] Similarly, as Figure 2 shown in (d), according to the materials at the sampling points, rename the subscripts of the variables in formula (3) to get:
[0058]
[0059] Similarly, as Figure 2 shown in (d), according to the materials at the sampling points, rename the subscripts of the variables and use formula (9) to eliminate to get:
[0060] r l,SP E l,SP,z + r l,O E l,SP,z A l,zz = E z (10)
[0061] In the above formula Since E s,SP,z and E l,SP,z are both the electric fields inside the central material, so E s,SP,z = E l,SP,z , and since ε s,SP and ε l,SP are both the dielectric constants at the sampling points, so ε SP = ε s,SP = ε l,SP, the 3D-CP-EP algorithm formula group can be obtained from formula (7) and formula (10):
[0062]
[0063] Since x, y, and z have rotational symmetry, for the calculation in the y direction, only the directions in formula (11) and Figure 2 need to be rotated, that is, (x, y, z) becomes (z, x, y), and for the calculation in the x direction, (x, y, z) becomes (y, z, x).
[0064] Based on the 3D-CP-EP conformal grid algorithm, the present invention provides a method for automatically generating FDTD conformal grids based on 3D CAD. The process of introducing the algorithm still takes ε eff,z as an example and starts from the simplest STL file model, that is, a tetrahedron, for introduction. The algorithm is also applicable to any solid model composed of surface triangular meshes.
[0065] As Figure 3 shown in (a) therein, the four vertices of the tetrahedron are P1P2P3P4. The light ray in the positive z direction passes through the Gaussian surface (tetrahedron) and intersects at points Z0 and Z1, and the outer normal vectors of the triangular surface elements at the intersection points Then, by using the z-direction grid to clip the line segment Z0Z1, the proportion of various materials on the longitudinal scan line in each field component cell can be obtained. As Figure 3 shown in (b) therein, the scanning plane perpendicular to the z direction scans the Gaussian surface (tetrahedron surface) to obtain the polygon F1F2F3, and the outer normal vectors of the triangular surface elements corresponding to each side length and At the same time, the grids divided by the grid lines on the scanning plane are used to clip the scanned polygon, and the area proportion of various materials on the transverse scanning plane in each field component cell can be obtained.
[0066] In summary, the method for automatically generating FDTD conformal grids based on 3D CAD provided by the present invention has a brief process as Figure 4 shown and includes the following steps:
[0067] 1. Read the 3D graphic file based on triangular surface elements generated by CAD software, such as a *.STL file, set the FDTD parameters, and divide the FDTD grid lines.
[0068] 2. Perform longitudinal ray scanning and transverse surface scanning on the model according to the FDTD grid lines, and use the rectangular clipping algorithm and the line segment clipping algorithm to calculate the proportion information of various materials on each grid and the interface normal vector information. Since the grids passed by the transverse scanning polygon or the grids with two or more types of materials in the longitudinal scanning line are boundary grids, this simple logic is used to distinguish the boundaries and non-boundaries, so that the complex calculation of step 2 only involves the boundary grids, thereby reducing the overall complexity.
[0069] 3. The material information and geometric information of the boundary grid calculated in step 2 are brought into the 3D-CP-EP conformal mesh algorithm, while the non-boundary grid is directly determined by the material of the sampling point. The 3D-CP-EP conformal meshes of the three sets of field components are calculated simultaneously using parallel computing, and finally the FDTD conformal mesh model is output.
[0070] Based on the above method, the present invention also provides an automatic FDTD conformal grid generation device based on three-dimensional CAD, which includes: an FDTD parameter setting data reading module and a conformal grid generation module; wherein the FDTD parameter setting data reading module is used to read a three-dimensional model based on triangular face elements generated by CAD software, and divide the FDTD grid lines on the three-dimensional model; the conformal grid generation module is used to perform longitudinal ray scanning and transverse surface scanning on the three-dimensional model, calculate the proportion information and interface normal vector information of various materials on each grid, bring the calculated geometric information and material information into the 3D-CP-EP algorithm formula group, calculate the 3D-CP-EP conformal grid parameters of the three directional components, and generate an FDTD conformal grid model.
[0071] Figure 5 (a) and (b) are torus models based on triangulated surface modeling, and (c) is the ε obtained by 3D-CP-EP mesh generator. eff,x Voxel model, (d) is a layer of voxels obtained by slicing the model in (c) in the z direction.
[0072] Example 2
[0073] The present invention is compared with mainstream FDTD simulation software in terms of conformal grid generation rate and grid quality. The specific implementation scheme is to use the same STL file to import the model, involving three three-dimensional graphics of sphere, cube and torus, and compare the speed of the 3D-CP-EP conformal grid generator of the present invention with the conformal grid generator of mainstream FDTD simulation software. The same DC coupler modeling is used for conformal grid generation, and FDTD simulation is performed for accuracy comparison.
[0074] (1) Comparison of grid generation rate:
[0075] The simulation space is 12*12*12μm, and the grid is divided into a uniform grid of 400*400*400. The 3D-CP-EP grid generator outputs the grid to the disk in a sparse storage manner, that is, the background material grid is not stored. The number of grid elements output in the table refers to the number of grids output to the disk. Simulation environment: The CPU is Intel(R) Core(TM) i5-9400, the Ram is 16G, and the operating system is Windows11. Compare with commercial software and its release version: Ansys Lumerical 2020R2 FDTD Solver Version 8.24.2387 (Windows 64bit), and the conformal grid type of the comparison software is conformal variant 0 (Lum-CV-0). The CPU time occupied by the Lumerical grid generator in Table 1 is the Meshing Time given in the log file output by the software.
[0076] It can be seen from the data in Table 1 that the grid generation rate of the 3D-CP-EP conformal grid generator of the present invention is much faster than that of the grid generator of Ansys Lumerical FDTD Solver. When the number of output grids exceeds the 1e7 level, the time required for Lumerical FDTD grid generation increases significantly. In addition, the speeds of the 3D-CP-EP conformal grid generator and the comparison software for meshing the torus at different grid resolutions are also tested. The comparison data is as Figure 6 shown. The abscissa is V region which is the volume of the simulation space. The simulation space is set as a cube, and V cell is the volume of a single cell under the uniform grid. The ordinate is the CPU time occupied when generating the conformal grid. It can be obtained from Figure 6 that the computational complexity of the 3D-CP-EP conformal grid generator is smaller than that of the comparison software.
[0077] Table 1 Comparison data table of FDTD conformal grid meshing of different 3D models by the two grid generators
[0078]
[0079] (2). Comparison of device simulation accuracy:
[0080] Figure 7 In (a) is a sketch of the xy plane and a schematic diagram of the 3D model of the DC directional coupler. The waveguide material is Si, and the background material is SiO2. The DC coupler has symmetric upper and lower arms, and the unit is μm. (b) is a schematic diagram of the source incident position and the monitor position in the XY plane, with the unit of μm, and the wavelength of the mode source is 1.5 - 1.6μm. The simulation results are as Figure 8 shown.Figure 8 In (a), it is the forward (x positive direction) transmission rate of the fundamental mode frequency domain monitored by the Lum software and 3D-CP-EP on the Through Monitor at a resolution of 66. Figure 7 In (b), it is the forward transmission rate of the fundamental mode frequency domain monitored by the Lum software and 3D-CP-EP at the Cross Monitor at a resolution of 66.
[0081] Figure 8 The calculation method of the relative errors in (c) and (d) is as follows: where the subscript r is the resolution (the number of grids per unit wavelength).
[0082] From Figure 8 It can be seen from (c) and (d) that the 3D-CP-EP conformal grid generator also achieves the grid quality of the mainstream FDTD simulation software in terms of grid quality. And with the increase of the resolution, the 3D-CP-EP conformal grid generator of the present invention shows better convergence.
Claims
1. A method for automatically generating FDTD conformal grids based on 3D CAD, characterized in that, It includes the following steps: Generate a three-dimensional model based on triangular facets using CAD software; Divide the FDTD grid lines on the three-dimensional model; Perform longitudinal ray scanning and transverse plane scanning on the three-dimensional model according to the FDTD grid lines, and calculate the geometric information and material information of each boundary cell; Substitute the geometric information and material information of the boundary cells into the 3D-CP-EP algorithm formula set, and calculate the 3D-CP-EP conformal grid parameters of the three direction components at the same time to generate an FDTD conformal grid model; The 3D-CP-EP algorithm formula set is as follows: ; Where: m is any one of the x, y, or z directions, is the dielectric constant at the sampling point, is the average value of the material on the scan line parallel to m and passing through the sampling point except , is the length ratio of on the scan line, is the length ratio of on the scan line, is the average value of the material on the scan plane perpendicular to m and passing through the sampling point except ; is the area ratio of the material on the scan plane, is the area ratio of on the scan plane.
2. The method for automatically generating FDTD conformal grids based on 3D CAD according to claim 1, characterized in that: The internal electric field is uniformly distributed within the same material in the same grid.
3. The method for automatically generating FDTD conformal grids based on 3D CAD according to claim 2, characterized in that: The relationship between the internal electric fields of two adjacent materials in the same grid is: ; Among them, are the electric fields on both sides, and are the dielectric constants of the two materials respectively; is the identity matrix, , and its geometric meaning is the vector after projecting the electric field onto the normal vector direction.
4. The method for automatically generating FDTD conformal grids based on 3D CAD according to claim 1, characterized in that: Use the rectangular clipping algorithm and the line segment clipping algorithm to calculate the proportion information and interface normal vector information of various materials on the boundary cells.
5. A device for automatically generating FDTD conformal grids based on 3D CAD, which is used to implement the method described in claim 1, characterized in that, The device includes: an FDTD parameter setting data reading module and a conformal grid generation module; wherein, the FDTD parameter setting data reading module is used to read the three-dimensional model based on triangular facets generated by CAD software, and divide the FDTD grid lines on the three-dimensional model; the conformal grid generation module is used to perform longitudinal ray scanning and transverse plane scanning on the three-dimensional model, calculate the geometric information and material information of each boundary cell, substitute the geometric information and material information of the boundary cells into the 3D-CP-EP algorithm formula set to calculate the 3D-CP-EP conformal grid parameters of the three direction components, and finally generate an FDTD conformal grid model.
Citation Information
Patent Citations
FDTD fast algorithm for estimating target scattering characteristics
CN110222418A
DGTD electromagnetic transient simulation method based on Cole-Cole model
CN113536626A