Where does the relation between simulation time and mesh step size for FDTD simulations come from? I am using Lumerical FDTD solutions to simulate a planewave through a region of space and some of my analysis requires me to know the relation between the simulation mesh step size and the time taken for the simulation to run.
The relationship between the simulation time and mesh step size, for 2D simulations, is stated on the Lumerical website as being:
$${\rm simulation\: time} \sim A(\lambda/dx)^3$$
where A is the region area, $\lambda$ is the wavelength of the light pulse, and dx is the mesh step size. I have only been able to find this relation in one textbook but neither in this textbook nor in the Lumerical web page does it explain how this relation is derived. Could someone help me understand where this relation came from?
Source of the relation stated above.
 A: Obeying the speed of light and computation time are not exactly the same. FDTD simulations take a long time because the algorithm has to solve maxwell equations for each Yee lattice unite, both for the E and H fields of course. This means multiplying a range of numbers for each cell and that takes up both time and memory in a computer.
The formula you found simply states that the simulation time grows with the size of the simulation space A and the number of grid cells per wavelength to the third power. One thing that may seem counterintuitive is the 3th power in 2D space, and where lambda suddenly comes from.
Basically we have $\frac{A}{(dx/\lambda)^3}$ , which takes the total area and divides it by the number of wavelengths per unit cell. You could write  $\frac{A}{dx^3}*{\lambda^3}$ which helps in understanding this. The third power is some sort of space-time like thing, because the number of required timesteps is linked to the Courant condition you mentioned in the comments. So 2 space dimensions + 1 time dimension, et voila.
Now we have the area dived by the unit cell size, which gives N as the total number of cells. This number is then related to wavelength, which I believe relates to the fact that this time domain method needs to run longer to cover a larger wavelength. For interference effects and resonances and wave effects this is important, and this for the 2 space and 1 time dimension.
You could stop your simulation to early, but you will get a very bad non-converged simulation result. That's why in practice, in a good simulation setup, the number of wavelengths per unit cell size matters. Usually one will choose $dx<\lambda$, so remember that this number is larger than 1! But even if your steps dx are small enough (i.e. $dx<\lambda/10$), the total simulation time needs to extend long enough so enough wavelengths are taken into account to capture all interferences and resonances and wave phenomena.
I hope this somewhat helps in the understanding and i have not made a mistake.
