Add unit test for broadband sources at fixed angle in a periodic cell (BFAST) #2722
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a unit test for broadband sources at fixed angle in a cell with periodic boundaries (BFAST). This is to be merged after #2609. The test is an extension of
python/tests/test_refl_angular.py
and involves verifying that the reflectance from an interface of two lossless, frequency-independent dielectrics (index of 1.4 and 3.5) given a broadband input planewave at normal and oblique (20.6°) incidence with P polarization matches the Fresnel equations. There are two separate runs: without and with the BFAST feature.There is a large and unexpected discrepancy in the BFAST results and the Fresnel equations for the case of oblique incidence. See the output in 2b below. This required increasing the error threshold by nearly two orders of magnitude compared to the without BFAST case in order for this test to pass:
This discrepancy did not diminish by reducing the
Courant
parameter. In fact, the choice of theCourant
parameter had practically no impact on the results. As such, it would be good to investigate whether it is actually necessary to reduce the Courant as the oblique input angle increases. The results for normal incidence are fine.The results in 2b require more investigation. There could a bug in (1) the way I am using this feature in the test (which is based on its use in the function
planar_reflectance
in the colab in #2609) or (2) the implementation in #2609.1. Without BFAST
a) incident angle = 0°
b) incident angle = 20.6°
2. With BFAST
a) incident angle = 0°
b) incident angle = 20.6°
cc @Dan2357