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

Method for calculation of average power #25

Closed CharlesDove closed 2 years ago

CharlesDove commented 2 years ago

Hi @flaport! For a project I'm working on, I need to calculate the average power (intensity) of light. Ex. simulate imaging it on a detector. Is there a method that you'd recommend for doing that? I've tried using a detector to average the intensity over the last X simulation timesteps, but that so far doesn't seem to give correct results. Thanks!

flaport commented 2 years ago

Hmmm this has been a while for me since I did these kind of calculations... Anyway... the average power going through a detector should be related to the poynting vector S=E×H (or in the simulation units used here: S=cE×H). The average power flowing through a detector with surface area A should hence be given by something like this:

P = AS·n

with n unit vector in the direction of the normal of the surface (detector)