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
125 stars 50 forks source link

scuff-cas3D for PEC #112

Closed wmkwmkwmk closed 7 years ago

wmkwmkwmk commented 7 years ago

Hi, I want to ask a simple question about geometry setting for scuff-cas3D.

For instance, if I want to change the silicon/Vacuum boundaries for the example "Casimir forces between infinite-area silicon slabs (2D periodicity)" to PEC/Vaccum, can I just change these two lines?

REGION UpperSlab MATERIAL Silicon
REGION LowerSlab MATERIAL Silicon

After that the program looks like:

LATTICE
    VECTOR 2.0 0.0
    VECTOR 0.0 2.0
ENDLATTICE

REGION UpperSlab MATERIAL PEC
REGION Gap       MATERIAL Vacuum
REGION LowerSlab MATERIAL PEC

SURFACE UpperSurface
    MESHFILE Square_L2_40.msh
    REGIONS UpperSlab Gap
    DISPLACED 0 0 0.5
ENDOBJECT

SURFACE LowerSurface
    MESHFILE Square_L2_40.msh
    REGIONS LowerSlab Gap
ENDOBJECT

I tried to do that. However the program become very slow. The "scuff-cas3D.log" stuck 6 hours at:

08/29/16::15:15:04: Creating interpolation grid with 156 grid points... 
08/29/16::15:15:12: Applying transform -1.95... 
08/29/16::15:15:12:  Assembling U(0,1) 
08/29/16::15:15:12: Assembling BEM matrix block (0,1) 
08/29/16::15:15:12:  Step 1: Contributions of innermost grid cells... 
08/29/16::15:15:36:  Step 2: Contributions of outer grid cells... 
08/29/16::15:15:38:   Initializing 6x26 interpolation table with  
08/29/16::15:15:38:   X points at [0:0.04:0.2]  
08/29/16::15:15:38:   Rho points at (0.00e+00, 3.42e-02, 7.89e-02, 2.41e-01, 2.90e-01, 3.42e-01, 4.00e-01, 4.65e-01, 5.42e-01, 6.37e-01, 7.65e-01, 9.86e-01, 1.24e+00, 1.49e+00, 1.77e+00, 2.10e+00, 2.47e+00, 2.92e+00, 3.46e+00, 4.10e+00, 4.88e+00, 5.83e+00, 7.02e+00, 8.50e+00, 1.04e+01, 1.06e+01) 
08/29/16::15:15:38: Creating interpolation grid with 156 grid points... 

Am I doing wrong? Can you tell me what is happening here? Thanks!

wmkwmkwmk commented 7 years ago

My program looks like:

#!/bin/bash

echo beg

ARGS=""
ARGS="${ARGS} --geometry HB.scuffgeo"
ARGS="${ARGS} --TransFile translist"
ARGS="${ARGS} --zforce"
ARGS="${ARGS} --RelTol 2.0e-1"
#ARGS="${ARGS} --UseExistingData"

scuff-cas3D ${ARGS}
echo en

If I set the material to doped silicon:

# doped silicon
MATERIAL SILICON_DOPED
    epsf = 1.02;     # \epsilon_infinity
    eps0 = 11;      # \epsilon_0
    wp = 6e15;       # \plasmon frequency
    gammap = 7.6e13;
    wpp = 4.5e14;       # \plasmon frequency
    Eps(w) = epsf + (eps0-epsf)/(1-(w/wp)^2)- wpp^2/(w*(w+I*gammap));
ENDMATERIAL

Within one night it can finish. With ",byXi" show as:

# data file columns: 
#1: transform tag
#2: imaginary angular frequency
#3: z-force Xi integrand
#4: z-force error due to numerical Brillouin-zone integration 
-1.95 1.000000e-03 -5.43376255e+00 9.50815568e-01 
-1.95 1.575516e+00 -1.95450074e+00 -8.96811203e-01 
-1.95 3.150032e+00 -1.66344969e+00 -8.15282932e-01 
-1.95 6.299063e+00 -1.16217806e+00 -6.15423850e-01 
-1.95 9.448095e+00 -7.34646356e-01 -4.22752739e-01 
-1.95 1.574616e+01 -2.33644423e-01 -1.61920568e-01 
-1.95 2.204422e+01 -6.26046434e-02 -5.24349413e-02 
-1.95 3.464035e+01 -3.44642712e-03 -3.64803540e-03 
-1.95 4.723647e+01 -1.81806765e-04 -2.28871541e-04 
-1.95 5.983260e+01 -1.01042879e-05 -1.41833457e-05 
-1.95 7.242873e+01 -5.99244679e-07 -8.91860755e-07 

However, if I use same prgram, just change material to PEC REGION UpperSlab MATERIAL PEC It becomes etremly slow.... After one day running. ".byXi" file is still empty.".byXikBlock" file only has one row

# data file columns: 
#1: transform tag
#2: imaginary angular frequency
#3: bloch wavevector kx 
#4: z-force Brillouin-zone integrand
-1.95 1.000000e-03 -1.570796e+01 -0.00000000e+00 

Do you know what happened here? How can I improve it?

HomerReid commented 7 years ago
  1. For 1d-periodic geometries you generally don't need REGION/SURFACE statements because the exterior medium is never disconnected.
  2. Also, for any geometry you don't want to declare entire REGIONS to be PEC.

If you want to study Casimir forces between perfectly-conducting metallic plates (or infinite PEC half-spaces, which is physically equivalent) then just use this .scuffgeo file:

LATTICE
    VECTOR 2.0 0.0
    VECTOR 0.0 2.0
ENDLATTICE

OBJECT UpperPlate
    MESHFILE Square_L2_40.msh
    DISPLACED 0 0 0.5
ENDOBJECT

OBJECT LowerPlate
    MESHFILE Square_L2_40.msh
ENDOBJECT
wmkwmkwmk commented 7 years ago

Thanks a lot, it perfectly solved my problem!

HomerReid commented 7 years ago

Feel free to keep this issue alive by asking more questions, or else close the issue if satisfied.