flaport / fdtd

A 3D electromagnetic FDTD simulator written in Python with optional GPU support
https://fdtd.readthedocs.io
MIT License
454 stars 116 forks source link

Question regarding conductivity implementation in code #37

Closed pingpongballz closed 2 years ago

pingpongballz commented 2 years ago

Hi,

I was browsing through objects.py when I came upon this, lines 192-199,

 self.absorption_factor = (
            0.5
            * self.grid.courant_number
            * self.inverse_permittivity
            * self.conductivity
            * self.grid.grid_spacing
            / const.eps0
        )

which is f = 0.5*sc*inv(ε)*σe*du/ε0 In https://github.com/flaport/fdtd#lossy-medium, the following is written:

f = 0.5*dt*σ, where σ := inv(ε)*σe/ε0

by taking dt = sc * du/c I can expand f = (0.5*sc*inv(ε)*σe*du)/(ε0*c)

My question is, why wasn't 1/speed of light, 1/c included in self.absorption_factor ? There must be something I'm missing, right?

Any clarification to my confusion would be most appreciated 😄

flaport commented 2 years ago

Hi @pingpongballz ,

My apologies for my very late answer. I wanted to re-derive the equations and then forgot about this issue. It seems you are indeed correct! There is a 1/c factor missing. I have updated the code and the README.