Week 6: Finishing up the Algorithm (and Next Steps)
April 17, 2024
Hello everyone, and welcome back to my blog. Today I have some very exciting news: I’ve finished coding most of the features that I’ve planned to implement, including PMLs (Perfectly Matched Layers) and simulating objects. This week, I’ll be giving a quick overview of the new features as well as discussing the challenges I encountered while implementing them. Also, I’ll be discussing my plans for deploying the algorithm as a web app.
PML (Perfectly Matched Layer)
A PML, or Perfectly Matched Layer, is essentially a more powerful version of the simple absorbing boundary condition we implemented earlier. The PML works by introducing a lossy layer in order to absorb all fields normal to the boundary surface while allowing the tangential fields to remain intact. For more on the unnecessarily brain-damaging math, read this.
Disclaimer: my PML is not actually properly implemented and the code is buggy. When implementing the PML, I spent hours trying to find the bug but nothing came up. It’s also really hard to debug the program when I have to implement my own test cases, so hopefully I will find the bug by the end of next week.
Implementing Objects
So far, all of our simulations have been in free space. This means that we assume the relative permeability and emissivity to both be equal to 1 and for there to be no loss (electric and magnetic conductivity are equal to zero). This places a limit on the versatility of the simulation software. Because of this, I wanted to implement a feature that would allow objects such as conductors and dielectrics to be placed into the grid for simulation.
There are a wide variety of objects to implement, but ultimately all of them have some common features. For instance, each object has a certain domain in space in which constants such as permittivity and conductivity have specially modified values. To implement objects, I first coded a general Object class from which different types of objects could inherit.
The Object class allows for objects to specify their spatial domain as well as custom update parameters and even custom update equations. For instance, a PerfectConductor class that inherits from the Object class can set the electric fields inside its spatial domain to zero using custom update equations.
Conclusion
All of the core features of my algorithm are now complete. The next step is to give access to the algorithm to a wide audience through deploying a web app and designing an effective UI. In the coming weeks, I will shift from a computational physics perspective to a more software-design based perspective as I prepare my algorithm to be effectively deployed. For any readers who wish to see the full code, come here. Otherwise, stay tuned!
Sources:
https://eecs.wsu.edu/~schneidj/ufdtd/
https://github.com/flaport/fdtd?tab=readme-ov-file
https://engineering.purdue.edu/wcchew/ece604s20/Lecture%20Notes/Lect37.pdf
https://ijariie.com/AdminUploadPdf/TFSF_boundary_implementation_in_the_FDTD_Algorithm_for_the_Study_of_the_Propagation_of_Electromagnetic_Waves_in_Vacuum_ijariie10883.pdf
(Next: Coding and Deploying the Web App)
Leave a Reply
You must be logged in to post a comment.