HomerReid / scuff-em

A comprehensive and full-featured computational physics suite for boundary-element analysis of electromagnetic scattering, fluctuation-induced phenomena (Casimir forces and radiative heat transfer), nanophotonics, RF device engineering, electrostatics, and more. Includes a core library with C++ and python APIs as well as many command-line applications.
http://www.homerreid.com/scuff-em
GNU General Public License v2.0
126 stars 50 forks source link

incorrect values of reflection/transmission for plane geometry #157

Closed shastrirahul closed 6 years ago

shastrirahul commented 6 years ago

files.zip

files.zip I am trying to reproduce simple given example of thinfilms. I am getting below output

0.01 0.000000e+00 8.034651e-01 -8.034653e-01

Here the 4th column supposed to give reflection but it is giving a negative value which is incorrect. I have attached the required files that i have used.

My future aim is to compute reflection/transmission/absorption using scuff-transmission for the gold infinite mirror. Looking forward to your reply.

HomerReid commented 6 years ago

Thanks for the bug report. This is not actually a bug in the code, but rather a case of out-of-date documentation---the output-file format has changed since I wrote the scuff-transmission tutorials, and I haven't updated it yet. I will do that, but in the meantime you can look at the preamble of the output file to see what is being reported on what line:

# scuff-transmission run on reynolds-CELSIUS-R920 (11/08/17::12:25:31)
# data file columns: 
# 1:      omega 
# 2:      theta (incident angle) (theta=0 --> normal incidence)
# 3:      upward   flux / vacuum plane-wave flux (TE)
# 4:      downward flux / vacuum plane-wave flux (TE)
# 5:      upward   flux / vacuum plane-wave flux (TM)
# 6:      downward flux / vacuum plane-wave flux (TM)
# 
# 7,8:    mag, phase a_Upper(TE -> TE)
# 9,10:   mag, phase a_Upper(TE -> TM)
# 11,12   mag, phase a_Upper(TM -> TE)
# 13,14   mag, phase a_Upper(TM -> TM)
# 15,16   mag, phase a_Lower(TE -> TE)
# 17,18   mag, phase a_Lower(TE -> TM)
# 19,20   mag, phase a_Lower(TM -> TE)
# 21,22   mag, phase a_Lower(TM -> TM)

As you see, the fourth column is reporting downward-traveling flux, which is why there's a minus sign.

You probably want to plot the transmission and reflection coefficients, which are columns 7 and 15, i.e. in gnuplot you could do

gnuplot> plot 'ThinFilm_58.transmission' u 1:7, '' u 1:15 

This produces a plot like this:

trvw

shastrirahul commented 6 years ago

Thank you for clearing the doubt!! The problem is solved!

shastrirahul commented 6 years ago

Hello,

Thank you for resolving the above issue. Now I am trying geometry consisting of infinite Au mirror with Au sphere separated by some gap. I computing the reflectance coefficient but it is not giving the correct answer (checked with cst). All the files are attached below. Can you look into this matter ASAP. Thank you again for helping.

Regards

On Thu, Nov 9, 2017 at 2:30 AM, Homer Reid notifications@github.com wrote:

Thanks for the bug report. This is not actually a bug in the code, but rather a case of out-of-date documentation---the output-file format has changed since I wrote the scuff-transmission tutorials, and I haven't updated it yet. I will do that, but in the meantime you can look at the preamble of the output file to see what is being reported on what line:

scuff-transmission run on reynolds-CELSIUS-R920 (11/08/17::12:25:31)

data file columns:

1: omega

2: theta (incident angle) (theta=0 --> normal incidence)

3: upward flux / vacuum plane-wave flux (TE)

4: downward flux / vacuum plane-wave flux (TE)

5: upward flux / vacuum plane-wave flux (TM)

6: downward flux / vacuum plane-wave flux (TM)

#

7,8: mag, phase a_Upper(TE -> TE)

9,10: mag, phase a_Upper(TE -> TM)

11,12 mag, phase a_Upper(TM -> TE)

13,14 mag, phase a_Upper(TM -> TM)

15,16 mag, phase a_Lower(TE -> TE)

17,18 mag, phase a_Lower(TE -> TM)

19,20 mag, phase a_Lower(TM -> TE)

21,22 mag, phase a_Lower(TM -> TM)

As you see, the fourth column is reporting downward-traveling flux, which is why there's a minus sign.

You probably want to plot the transmission and reflection coefficients, which are columns 7 and 15, i.e. in gnuplot you could do

gnuplot> plot 'ThinFilm_58.transmission' u 1:7, '' u 1:15

This produces a plot like this:

[image: trvw] https://mailtrack.io/trace/link/02b5c761e556c1ca33ae3cbe904ba2405f601b47?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F920123%2F32585513-c5b6f082-c4cb-11e7-866c-fd6a1a8309ee.png&userId=2256383&signature=e16757824f3c4457

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://mailtrack.io/trace/link/af33bc821fc0ced02efb039de2156eb06a9a449a?url=https%3A%2F%2Fgithub.com%2FHomerReid%2Fscuff-em%2Fissues%2F157%23issuecomment-343028390&userId=2256383&signature=b4647b0826a57f26, or mute the thread https://mailtrack.io/trace/link/9a5ec7f4a208071fab905af0044ef12ce907616d?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAf7V1lC2qAbiL9cuNbZlra0kD-0F-UATks5s0mOugaJpZM4QV9LZ&userId=2256383&signature=cc84e4dff16b87d6 .