Skip to content

Boundary reflection when using macroscopic medium and PML boundary condition #5497

Open
@Wang-Zhongwei

Description

@Wang-Zhongwei

Hi, WarpX developers

Description

Simulation Overview

I am conducting a 2D Particle-In-Cell (PIC) simulation to test the reflection from a semi-infinite dielectric material occupying z > 0 space. The laser is coming at normal incidence.

Simulation Parameters

  • Grid: [[-10, 10], [-10, 10]] um
  • Cells: [1024, 1024]
  • Pulse duration (tau): 20 fs
  • Dielectric refractive index (n): 1.53
  • Boundary condition: Perfectly Matched Layer (PML) with 10 cells

Expected behavior

Given that there is only one dielectric boundary in the simulation domain, I expect to observe only one reflection and reflectivity is

$$R = (\frac{n-1}{n+1})^2 = 0.044 $$.

However, there seems to be two reflecting waves: one from the boundary of vacuum-dielectric interface, the other from the z ~ 8um interface (close to zmax boundary but not the same). And R = 8.4%. If I throw out the second wave, R = 4.3% close to the prediction.

You can clearly see the two reflecting waves from the Poynting vectors:
image
image
image
image
and energy fluences
image

How to reproduce

Input deck

dielectric_troubleshoot_1.txt

analysis scripts

%matplotlib inline
import matplotlib.pyplot as plt

def plot_Sx_Sz(time=0):
    Ex, ex_meta = fields.get_field("E", "x", t=time)
    Ey, ey_meta = fields.get_field("E", "y", t=time)
    Ez, ez_meta = fields.get_field("E", "z", t=time)


    Bx, bx_meta = fields.get_field("B", "x", t=time)
    By, by_meta = fields.get_field("B", "y", t=time)
    Bz, bz_meta = fields.get_field("B", "z", t=time)

    Sx = Ey * Bz - Ez * Bx
    Sz = Ex * By - Ey * Bx

    iteration = ey_meta.iteration
    t = ey_meta.time

    fig, axs = plt.subplots(1, 2, figsize=(12, 6))
    fig.suptitle(f"iteration = {iteration} (t = {t*1e15:.1f} fs)")

    axs[0].grid(True)
    im0 = axs[0].pcolor(ey_meta.x, ey_meta.z, Sx, cmap='bwr')
    plt.colorbar(im0, ax=axs[0], label='Sx')
    axs[0].set_title(f'Sx')
    axs[0].set_ylabel(ey_meta.axes[0])
    axs[0].set_xlabel(ey_meta.axes[1])

    axs[1] = plt.subplot(122)
    axs[1].grid(True)

    max_abs_Sz = np.max(np.abs(Sz))
    vmin = -max_abs_Sz
    vmax = max_abs_Sz
    
    im1 = axs[1].pcolor(ey_meta.x, ey_meta.z, Sz, vmin=vmin, vmax=vmax, cmap='bwr')
    plt.colorbar(im1, ax=axs[1], label='Sz')
    axs[1].set_title(f'Sz')
    axs[1].set_xlabel(ey_meta.axes[0])
    axs[1].set_ylabel(ey_meta.axes[1])

    plt.tight_layout()
    plt.show()

System information

Please check all relevant boxes and provide details.

  • Operating system (name and version):
    • Linux: RHEL 9.2
    • macOS: e.g., macOS Monterey 12.4
    • Windows: e.g., Windows 11 Pro
  • Version of WarpX: 24.8
  • Installation method:
    • Conda
    • Spack
    • PyPI
    • Brew
    • From source with CMake
    • Module system on an HPC cluster
  • Other dependencies: yes/no, describe
  • Computational resources:
    • MPI: 16 MPI processes
    • OpenMP: 2 OpenMP threads
    • CPU: 32 CPUs
    • GPU: e.g., 2 GPUs (NVIDIA, AMD, etc.)

If you encountered the issue on an HPC cluster, please check our HPC documentation to see if your HPC cluster is already supported.

Additional information

PML seems not work very well for macroscopic medium. I didn't see such reflection if I set a finite thickness for the dielectric.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions