Question on FluxRegion vs. DFT field (Python) #2732
-
Hello, I am trying to understand the difference between a FluxRegion and the DFT_Fields commands in the Python interface. My motivation for this is to reproduce the values from a FluxRegion using the DFT_Fields post-simulation, so that I can separate out in the contribution of one electric field component from the other in the calculation of the Poynting flux, and thus the different power contributions of the two (linear) polarizations in only a single simulation run. If there's another way to do this (other than running two simulations), please do let me know! Following the example in the "Computing Quantities Defined by Integrals of Field-Dependent Functions Over Grid Regions" section of the Python User Interface documents with the header " # x-directed Poynting flux through monitor from frequency-domain fields", here's the abbreviated code:
The first few frequency results from sim.display_fluxes(refl) From the "manual_flux" variable calculated using refl (the FluxRegion): From the "manual_flux" variable calculated using dft_fields: Since the "manual" values are ~2 orders of magnitude off from the display_fluxes(...) values, I suspect that they represent the values of the Poynting vector at the end of the simulation instead of having been accumulated over a few hundred timesteps. Thus, I gather that somehow the FluxRegion is able to accumulate the result of a field function (Poynting calculation), while the DFT_field does not. Is this correct? Otherwise, is there something incorrect in my "manual" calculation? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You have a lot of questions, I'll just focus on the root of what you're trying to do:
Typically we use mode monitors for this (although you should be able to make this work with dft monitors too if you're careful). You can overlap with as many modes (or polarization states) as you want with a single run. If you do an infinite number, then the sum of their powers converges to the poynting flux. |
Beta Was this translation helpful? Give feedback.
You have a lot of questions, I'll just focus on the root of what you're trying to do:
Typically we use mode monitors for this (although you should be able to make this work with dft monitors too if you're careful).
You can overlap with as many modes (or polarization states) as you want with a single run. If you do an infinite number, then the sum of their powers converges to the poynting flux.