EM solver, FDTD vs FEM - Page 1
Forum section: electronics / general

author: metebalci
author_rank: Frequent Contributor
timestamp: February 25, 2024, 09:13:06 am
content: I think Sonnet uses MoM and Ansys uses FEM and/or MoM for electronics (but FDTD for photonics in Lumerical). Recent Ansys blog post (https://www.ansys.com/blog/what-is-fdtd) says also FEM and MoM are "the predominant gold standard" in electronics. Why is FDTD not used in EM simulations in electronics ?

author: selcuk
author_rank: Frequent Contributor
timestamp: February 25, 2024, 10:55:19 am
content: Those are commercial products and companies usually advertise that their method is the best one.FDTD is being used in EM simulations. There is an open source tool for solving electromagnetic fields using the FDTD method.https://www.openems.deI'm using this one as well. It is not as user friendly or advanced as the commercial tools but does most of the job.

author: Nominal Animal
author_rank: Super Contributor
timestamp: February 25, 2024, 12:09:24 pm
content: Thecomputational electromagneticsarticle at Wikipedia provides a concise summary:"An eigenvalue problem formulation of computational electromagnetics (CEM) allows us to calculate steady state normal modes in a structure. Transient response and impulse field effects are more accurately modeled by CEM in time domain by FDTD. Curved geometrical objects are treated more accurately as finite elements FEM, or non-orthogonal grids. Beam propagation method (BPM) can solve for the power flow in waveguides. CEM is application specific, even if different techniques converge to the same field and power distributions in the modeled domain."If we created a graph of all the possible methods and approaches and transforms, you'd see they are all connected. The differences are exactly in their relative weaknesses and strengths, especially when computational complexity (wrt. memory and number of calculations needed) and accuracy in specific cases (like surfaces, shock waves, discontinuities in general) is considered.Combining different methods in a single simulation is also very, very hard to do efficiently/effectively. It is much easier to use a specific approach in the entire simulation, because then all the data structures and algorithms can be implemented and optimized for that specific approach. It is definitely not just changing a function call or two per time step;everythingtends to change with the approach, if you care about computational efficiency.

author: niconiconi
author_rank: Frequent Contributor
timestamp: February 25, 2024, 01:07:39 pm
content: QuoteIt's better to ask "what" before asking "why". If the question itself is flawed, the answer is meaningless. As a matter of fact, FDTD has many applications in EM simulations for electronics. The theoretical foundation of FDTD itself is also no less valid than FEM/MoM, since it literally simulates Maxwell's equations directly. Given the appropriate inputs, the robustness of the method has already been demonstrated by thousands of peer-reviewed papers published in the last 30 years. Commercial products based on FDTD also exist for electronics design, such as EMPIRE.So the real question is: Why is FDTD not commercially usedas widely asFEM/MoM in electronics design? What are the tradeoffs? Here are some reasons that I can think of.First, FDTD is a time-domain, general-purpose method. Given the correct inputs, it often can compute your solution from Maxwell's equations directly by brute-force, very little math analysis is needed. The simulation results also show the propagation of E&M field step by step, making it very straightforward. Meanwhile, to use FEM/MoM successfully, often, you need to do some math analysis about your problem first (often involves Green's function) before you can program a field solver. As a result, a basic FDTD solver is both more general-purpose and much more easier to program than a basic FEM/MoM solver. For large-scale problems, FDTD is also the method of choice since its computational complexity is O(n), where n is the number of cells in the simulation box. Meanwhile, FEM/MoM needs linear algebra and matrixmultiplicationinversion, which has a complexity around O(n^3) (for the basic textbook algorithm). However, on the other hand, it also means that if you have a very particular problem and the problem is not large, you can save a lot of work by doing some math first, then you can design a very specialized and efficient FEM/MoM algorithm for a particular problem, which is more efficient than FDTD. It's also why FEM/MoM was historically used first because practical FDTD was not feasible until computers have enough memory. For example, NEC can solve wire antenna problems within minutes because it's a very narrow problem - FDTD will be much slower. Meanwhile, if you want to simulate the specific absorption ratio of radio waves of a human head from a mobile phone, or to find the radar cross-section of an aircraft using a full-scale model, FDTD is the right choice.The time vs. frequency domain between FDTD and FEM/MoM is also a consideration. FDTD is great for ultra-wideband simulations since it works in the time domain and simulates a large number of frequencies simultaneously, making it very efficient under the right conditions. But it turned out to be a double-edged sword. The biggest limitation of basic FDTD is that the timestep size must be both small enough to resolve the smallest frequency, and to resolve the smallest physical object. It works great for most microwave components, but can be very problematic if you have an electrically-small object. This would require an impractical number of timesteps. Want to simulate an SMD capacitor at 1 MHz instead of 600 MHz? Want to directly simulate the 30 micrometer solder mask on a 1.6 mm circuit board without using any simplification? Good luck... There are some modifications to FDTD that would better handle these situations, but so far they haven't seen widespread use to my best knowledge. Another problem is that material and device characteristics are often frequency-dependent and are given in the frequency domain, such as permittivity or S-parameters, rather than in time domain. If you use frequency-domain methods, they can be accepted directly. But for time-domain methods modeling it would be a headache because you would need to develop an equivalent wideband time-domain model, or find a way to do frequency-domain operations in time-domain such as by using convolution. For example, for modeling permittivity, frequency-domain methods can simulate the material separately at several frequencies, but FDTD needs to find a numerical fit using the Drude/Lorentz material model.Yet another aspect is meshing. FDTD is generally done on a structured mesh, in particular the Cartesian mesh, because the formulation of FDTD itself involves the use of an staggered grid of E and H field. There are some variants that use other grid shapes with limited use. Meanwhile, FEM/MoM uses unstructured grid so it's more flexible on modeling irregular objects without suffering from the staircase effect.So in summary.FDTD:+General-purpose, simulates Maxwell's equations from first principles.+Simple to program, little math analysis.+Wideband solution in a single simulation run.+Show the evolution of E&M field in time.+No linear algebra, scale directly to very large problems.-Often slow and overkill for small-scale problems, or problems with specialized solutions.-Extremely slow or impractical at low frequency, for electrically-small object, or both. Improvements exist but not widely implemented.-Modeling frequency-dependent material or circuit properties is not straightforward.-Use structured mesh and often Cartesian mesh, which is less flexible than unstructured ones. To work around the problem of irregular shapes, "conformal FDTD" exists, but to my best knowledge are used for one-off research projects, and not widely implemented.FEM/MoM:+Already Invented and used before FDTD (from an era when computers had little memory)+Fast and efficient for problems with specialized solutions.+Straightforward modeling of frequency-dependent material or circuit properties.+Use unstructured mesh, which is more flexible for irregular shapes.-Difficult to program, need math analysis.-Solvers are often designed for special-purpose applications, new math analysis may be needed for each new application.-Need linear algebra explicitly, scale to large-scale problems can be difficult.-Wideband solution needs multiple simulation runs.For some reasons, the EDA industry has chosen FEM/MoM as the preferred solution.Disclaimer: I don't really understand any of the underlying E&M involved, take these claims with a grain of salt. However, this is based on my literature reading during my attempt to improve the speed of openEMS's FDTD engine (this work is still ongoing, stay tuned for doubled and even tripled simulation speed), so I believe my description is generally accurate.

author: metebalci
author_rank: Frequent Contributor
timestamp: February 25, 2024, 01:27:53 pm
content: Quote from: Nominal Animal on February 25, 2024, 12:09:24 pmIs there an application or area specific or common reason to mainly select one of these methods or does it all depend on the problem (and the type of results one looking for) ? For example, in antenna research or radar etc. is one of these methods mainly used ?The reason I wonder this is, I understand if a company or research group most often develops, uses and promotes only one method, but as far as I understand Ansys has all types of solvers but still either offers or recommends (I only know Ansys a bit from the free version, I dont know if it is possible to use any method for electronics in a commercially licensed version) FDTD for photonics and FEM/MoM for high-freq electronics.

author: metebalci
author_rank: Frequent Contributor
timestamp: February 25, 2024, 01:30:00 pm
content: Quote from: selcuk on February 25, 2024, 10:55:19 amI know about openems, another is I think (not tried yet) meep,https://meep.readthedocs.io/en/latest/

author: metebalci
author_rank: Frequent Contributor
timestamp: February 25, 2024, 01:56:27 pm
content: I read or heard about most of the major differences but:Quote from: niconiconi on February 25, 2024, 01:07:39 pmI did not think this would be the reason of FEM's wide acceptance, because I thought the commercial use is mostly high-freq electronics, am I wrong ? Is it also commonly used for electrically-short cases ?Quote from: niconiconi on February 25, 2024, 01:07:39 pmI was not aware of this.Quote from: niconiconi on February 25, 2024, 01:07:39 pmIs this only because a finer mesh is needed with FDTD (and this will cause an increase in computational needs) or FEM's unstructured mesh provides a better (more accurate) result independent of FDTD's finer mesh ? (I know a bit about FDTD, not much about FEM)Quote from: niconiconi on February 25, 2024, 01:07:39 pmQuote from: niconiconi on February 25, 2024, 01:07:39 pmI didnt know the comparative history of the methods, thanks for the explanation, very helpful.

author: niconiconi
author_rank: Frequent Contributor
timestamp: February 25, 2024, 11:14:33 pm
content: Quote from: metebalci on February 25, 2024, 01:56:27 pmI believe low-frequency simulation is needed at least for some applications. For example, inductors and transformers for power electronics like wireless charging or switched-mode power supplies. Also, do you remember those "current density on the reference plane at different frequencies" visualization images from EMC books? The near-DC case needs a simulation under 1 MHz. Unmodified textbook FDTD can't do those.Also, "the electrically-small object" problem exists whenever you have an object with very small details, this is really common in even many basic problems. For starter, a 1.6 mm PCB has 35-micrometer thick traces. If you model the traces as-is for a PCB populated with components, an FDTD simulation would probably run forever (but you can analyze empty boards by brute-force if you only want to study the microstrip itself). Instead, practical FDTD solvers use simplified behavioral-models like zero-thickness conducting sheets instead of applying the actual Maxwell's equations. On the other hand, as far as I know, a 2D transmission line solver based on FEM/MoM can usually handle those without major problems. But you're right, the low-frequency / small-detail problem can't be the full story, it cannot completely explain the preference of FEM/MoM for commercial applications. According to an old Agilent application note , MoM is advantageous for planar structures, so that can also be a reason,Quote---QuoteI think it's both, in a sense. For irregular shapes, given a sufficiently fine Cartesian mesh, the results will gradually approximate the ideal results, but an unstructured mesh can do the same at a cost similar to regular shapes.QuoteSame. I have a working knowledge of FDTD but not FEM/MoM. We need a FEM/MoM expert to solve the missing puzzle.QuoteFDTD is great for large 3D problems, but often overkill if you have a very specialized problem that can be made to work within MoM. FDTD was proposed in the 1960s, but only began to see significant real-world uses in the 1980s on supercomputers, and it became a standard method after the 1990s after computers have enough memory. Meanwhile, MININEC could run on 32 kB Apple II computers to solve wire antenna problems - andonlywire antenna problems.Allen Taflove says ,Quotehttp://web.archive.org/web/20220701194537/https://xdevs.com/doc/HP/pub/5990-3225EN.pdf Pile, David. "Numerical solution: Interview with Allen Taflove". Nature Photonics. 9: 5–6. doi:10.1038/nphoton.2014.305.

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 26, 2024, 12:45:30 am
content: I'm going to evaluate Elmer FEM btw:http://www.elmerfem.org/blog/It does more than just EM simulation though, and there is some learning curve. I'm curious to see what we're able to get with it.

author: switchabl
author_rank: Frequent Contributor
timestamp: February 26, 2024, 12:46:36 am
content: The problem with large(-ish) FDTD simulations is that you run out of memory really fast. This is true for all volume methods to some degree but having to refine the cartesian grid around small/curved structures makes it worse.It is also not particularly well suited for resonant structures (think filters, antennas). If the quality factor is high, the simulation time required for the source energy to decay can become very long.MoM can be very efficient if you can decompose your problem into multiple regions of homogeneous material because you only need to discretize the surfaces separating them and not the volume itself. You also get radiation boundary conditions basically for free. There is no need to simulate the sorrounding space and no need for PMLs. That makes it very attractive for things like antenna design and EMC simulations.You do end up with a dense matrix in principle but it is still possible to solve it in O(n) using the fast multipole method (FMM). It is not exactly trivial to implement this. Building a MoM code with FMM from scratch is much, much harder than an FDTD code.FDTD is much more flexible though. It is reasonably easy to include inhomogeneous, anisotropic and even non-linear materials. That is a big reason why it is so popular in the photonics space.

author: niconiconi
author_rank: Frequent Contributor
timestamp: February 26, 2024, 02:42:30 am
content: Quote from: switchabl on February 26, 2024, 12:46:36 amGreat point. I completely forgot to mention it. Yeah, waiting for the energy to decay takes almost forever in an FDTD simulation when you have a resonator...

author: selcuk
author_rank: Frequent Contributor
timestamp: February 26, 2024, 07:15:16 am
content: Quote from: metebalci on February 25, 2024, 01:30:00 pmThank you for the recommendation for another open source tool.There is a detailed book chapter about the topic. It compares different solver tools tested on planar antennas.A Practical Guide to 3D Electromagnetic Software Tools (Guy A. E. Vandenbosch and Alexander Vasylchenko)

author: metebalci
author_rank: Frequent Contributor
timestamp: February 26, 2024, 12:07:03 pm
content: Quote from: switchabl on February 26, 2024, 12:46:36 amIt seems the optimization Ansys (in Lumerical FDTD) has is to change the mesh in different materials based on the refractive index and also using a much finer mesh when there is a high contrast interface.Quote from: switchabl on February 26, 2024, 12:46:36 amYes, I am aware of this, in general I guess if the energy does not leave the grid quickly, then there is this issue, when to stop the simulation. I dont know if it is correct to say this, but on the other hand, this is probably the result one is looking for in the transient response, so maybe it is expected or natural.Quote from: switchabl on February 26, 2024, 12:46:36 amI didnt know MoM discretizes only the boundary, I should read more about it. I thought it is similar to FEM but other than being in frequency domain it sounds they are pretty different.Quote from: switchabl on February 26, 2024, 12:46:36 amI know nothing about photonics but what you said sounds very relevant. I saw Ansys also mentions this, nonlinear materials and anisotropy in Lumerical product pages. Is this a need for electronics ? I dont remember I saw something about these for signal integrity in PCBs but I dont know much about RF and Microwave.

author: metebalci
author_rank: Frequent Contributor
timestamp: February 26, 2024, 01:16:21 pm
content: Quote from: niconiconi on February 25, 2024, 11:14:33 pmThis was actually the first thing I wondered, if they are created using FDTD, or if not if they can be created using FDTD.Thanks for sharing the link to the Agilent white paper, it is a very short but a good summary, what I was looking for with specific applications. It also answers my question why at least the large companies (Ansys, Agilent etc.) do not provide all solver types for electronics. I thought Agilent only has FEM (and maybe MoM), I read they also have an FDTD solver.In the interview with Taflove, I like the part: "Not many people know that Kane Yee was simply learning how to program in Fortran, as he told me 20 years later. He chose Maxwell’s time-dependent curl equations as the basis of his self-study because he wanted an initial-value problem that had both time and space derivatives.". I will give the example if someone asks me how to start learning a new programming language.Also I read somewhere (Edit: quoting a paper , using 1/100 lambda grid, it has a solution within +- 1.5dB of the exact solution) that the numerical dispersion in FDTD can be an issue, in the sense that its error increases with time and it can reach an unacceptable level comparing to FEM or MoM. I dont know to what extent this is true but this made me wonder if the issue with simulating resonant structures is also because of this. Maybe the time it takes is half of the problem, and the other half is the increasing error with increasing simulation time.https://opg.optica.org/oe/fulltext.cfm?uri=oe-12-7-1214&id=79442

author: Nominal Animal
author_rank: Super Contributor
timestamp: February 26, 2024, 11:47:24 pm
content: Quote from: metebalci on February 25, 2024, 01:27:53 pmProperties of the system being investigated dictates mostly which methods are most efficient and produce most useful results. Some do parallelize/distribute better than others, though.I don't know these simulations well enough to say exactly what properties are key in selecting the method.Quote from: metebalci on February 25, 2024, 01:27:53 pmPerhaps that is because FTDT requires explicit modeling of the EM wave propagation in materials. (For optics, this is the dispersion stuff, and well known for typical materials. I imagine the full EM spectrum frequency-dependent behaviour is not fully known for materials used in high-freq electronics. So, it may not be an issue with the method per se, but simply a consequence of not having the necessary real-world data that the method needs.)Just a guess, though.

author: niconiconi
author_rank: Frequent Contributor
timestamp: February 27, 2024, 07:56:12 am
content: Quote from: metebalci on February 26, 2024, 12:07:03 pmFR-4 is inhomogeneous and anisotropic (e.g. see "fiber weave effect"), so yeah, modeling those is useful for signal integrity research. But for most non-research PCB simulations, the modeling rarely goes to that level of detail (unless you're doing research). Using a standard frequency-dependent lossy/dispersive material model is sufficient.Quote from: metebalci on February 26, 2024, 01:16:21 pmUsing a 1/100 lambda grid is an extreme decision. In the research paper, they're using it for research and validation, so this decision understandable. For most practical problems, this kind of pathological cases hopefully won't show up, but if you ever find yourself in need of running FDTD at this resolution in an engineering context, FDTD is probably not the correct method to use. If one insists on using FDTD, one should consider using high-order differentiation. Classical FDTD is a second-order, central-difference algorithm, which is simple, fully-analyzed and works okay for practical uses. But if you're pushing for accuracy, 4th-order FDTD should be seriously considered. There are several papers on high-order FDTD for E&M, and also interestingly, room acoustics.Quote from: metebalci on February 26, 2024, 01:16:21 pmFor low-frequency simulations, a similar problem is "low-frequency breakdown", if you have an electrically-small structure, numerical stability may eventually start to collapse, so you would find yourself unable to simulate it even with a big computer cluster (which is already a dramatic waste of energy when MoM/FEM would solve it immediately).There are several modifications to FDTD that may overcome this "many timesteps" problem. Many involve the use of implicit methods, and the most well-known one is ADI-FDTD, which is unconditionally stable and allows one to use large timesteps, which can help too. But the downside of implicit methods is that the update equations are no longer fully iterative and involves linear algebra, albeit relatively lightweight.All of these modifications such as 4th-order FDTD, ADI-FDTD are not widely implemented, most are in-house research code. This is the peculiar feature of FDTD - the basic algorithm is simple so everyone keeps coming up with their own ideas about how to add something new to make it work better for them...

author: metebalci
author_rank: Frequent Contributor
timestamp: March 03, 2024, 11:11:36 am
content: I realized I confuse the discretization method (mesh vs. grid) with the actual (numerical) solver. I thought they are strongly coupled. Because of that and also I saw FEM and steady-state together too often, I thought FEM is for frequency domain solutions, and I thought Ansys HFSS/FEM solver is only working in frequency domain (which seems to be the case until ~2010), but then how transient simulations are done in Ansys. So, learning something new everyday, I saw HFSS also has a transient/time-domain solver(s) and it is either based on discontinuous Galerkin time domain (DGTD) (which seems to be also used in optics) or finite element time difference (FETD) method. They are still using the same HFSS/FEM mesh, hence all is under the name HFSS. HFSS also has other solvers (at least 3 more), as far as I understand, they are for larger structures (not for PCB).

author: switchabl
author_rank: Frequent Contributor
timestamp: March 03, 2024, 01:53:41 pm
content: So FEM is basically the swiss army knife of PDE solvers. It can be used with or without time-stepping as well as for non-linear problems. The same solver could be applied to EM, structural analysis, acoustics, thermal analysis, fluid dynamics... potentially at the same time. As a result, there are a lot of FEM codes and the mathematical theory is well-developed.If you start with full Maxwell's equations, you end up with a time-domain version of FEM that is more or less the weak/integral equivalent of FDTD. On the other hand, it is also possible to develop a finite-difference method from the time-harmonic equations, resulting in the somewhat more obscure FDFD (finite-difference frequency-domain).The choice between frequency- and time-domain approaches is as much about the nature of your problem as the type of analysis you are ultimately interested in. It may be more efficient to reconstruct transient behaviour from a set of time-harmonic solutions (particularly if the simulation time would otherwise be very long as in the case of the high-Q resonator mentioned above). And of course it is also extremely common to use broadband pulse sources and fourier transform monitors in FDTD for frequency-domain analysis. In many cases, full wave simulation is just an intermediate step anyway where the goal is just to extract s-parameters for use in SPICE/harmonic balance/signal integrity simulations.

author: metebalci
author_rank: Frequent Contributor
timestamp: March 03, 2024, 03:04:01 pm
content: Quote from: switchabl on March 03, 2024, 01:53:41 pmI thought it is showing the transient solution with something like that but it seems there is also a time-domain solver.Quote from: switchabl on March 03, 2024, 01:53:41 pmYes, I am slowly putting the pieces together but far from seeing the whole picture yet.

author: rhb
author_rank: Super Contributor
timestamp: March 03, 2024, 09:00:06 pm
content: Having done a lot of elastic and acoustic simulations by every method *except* FEM I'd like to note that *every* solver has a unique set of artifacts.Correct choice of method takes the effect of the artifacts into account as well as the problem statement.Have Fun!Reg