[FDTD/Fotran] detected reflection near boundary but don't know why

Click For Summary

Discussion Overview

The discussion revolves around a problem encountered in a 2D Finite-Difference Time-Domain (FDTD) simulation involving different permittivity values. The participant describes detecting reflections of a wave at the boundary where permittivity changes, seeking to understand the cause and potential solutions for the impedance mismatch that leads to these reflections.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant describes their FDTD code setup, including parameters for permittivity and the grid size, and notes reflections occurring at the boundary after a certain number of timesteps.
  • Another participant suggests that grid boundaries typically act as hard walls, causing waves to bounce back unless special treatments are applied.
  • A participant identifies the cause of the reflections as impedance mismatch due to differing permittivity values, explaining that wave impedance is inversely proportional to the square of permittivity.
  • The same participant expresses uncertainty about how to correct the impedance mismatch in their simulation after identifying the issue.
  • One participant admits to a lack of experience with FDTD and is unable to provide advice on the problem.

Areas of Agreement / Disagreement

Participants generally agree on the existence of impedance mismatch as a cause of reflections, but no consensus is reached on how to address the issue within the simulation.

Contextual Notes

The discussion highlights limitations related to the treatment of boundaries in FDTD simulations and the specific challenges of managing impedance mismatch when using different permittivity values.

s_hy
Messages
57
Reaction score
0
hi all,

i have wrote codes for 2d fdtd in different permittivity (epsilon). in this code, cell size is 200 x 200, start with eps=1 from center, and different permittivity started at boundary (i1,i2) = (25,75) = (j1,j2), epsilon = 2. the problem is, when the wave propagates and approach (i1,i2) = (25,75) = (j1,j2), i have detected some reflections happened to the wave at timesteps, n after 50, the reflections become obvious...i just wondering, why is that happened. i attached here the animation of the wave and my codes. i really have no idea how to solve this problem.

Code:
subroutine test7
implicit none

double precision                                     :: f0,A0
double precision                                     :: delta, deltat
double precision                                     :: eps0,epsr,miu0,miur
double precision                                     :: lamda
double precision                                     :: omega
double precision                                     :: S,k,c
integer                                                     :: i,j
integer                                                     :: ie,je,ic,jc,i1,i2,j1,j2
integer                                                     :: n
double precision,dimension(202,202)   :: Ez,Hy,Hx
double precision,dimension(202,202)   :: Ca,Cb,Da,Db,Dax,Dbx,Day,Dby
!double precision                                     :: Ca,Cb,Da,Db
double precision,dimension(202,202)   :: miu,eps,sigma, sigmat
double precision, parameter                 :: pi = 3.14159265
character(len=20)                                   :: filename

! parameters 
 f0 = 3.0e7
 eps0 = 8.8e-12
 miu0 =  4*pi*1e-7
 c = 3.e8
 lamda = c/f0
 omega = 2*pi*f0
 print *, 'lamda=',lamda
 A0 = 5.0
 k = 2*pi / lamda
 omega = c*k

!courant stability factor 
 !S = 1/sqrt(2.0)
! spatial and time grid steps
 delta = lamda/10
 deltat = delta/(2*c)
 print *, 'deltat=',deltat
 
!model size 
 ie = 100
 je = 100

 !source location
 ic = ie/2
 jc = je/2
 
 !boundary for different permittivity
 i1 = ie/4
 i2 = ie*3/4
 j1 = je/4
 j2 = je*3/4

print*, 'see me?'

!initialize Ez, Hx,Hy to zero at t=0
do i = 1,ie
 do j = 1,je
   Hx(i,j) = 0.0
   Hy(i,j) = 0.0
   Ez(i,j) = 0.0
 end do
end do


!medium's properties
 miur = 1.0
 epsr = 1.0
 
  do i = 1,ie
   do j = 1,je
     !initialize permittivity and permeability
     eps(i,j) = epsr*eps0
     miu(i,j) = miur*miu0
   end do
  end do
 
  do i = i1,i2
    do j = j1,j2
     eps(i,j) = 2*eps0
     miu(i,j) = 1*miu0
    end do
 end do
     
  !medium's properties
! initialize electric conductivity & magnetic conductivity
  do i = 1,ie
   do j = 1,je  
     sigma(i,j) = 0.0
     sigmat(i,j) = 0.0
     Ca(i,j) = (2*eps(i,j)-deltat*sigma(i,j))/(2*eps(i,j)+deltat*sigma(i,j))
     Cb(i,j) = (2*deltat)/(2*eps(i,j)+deltat*sigma(i,j))
     Da(i,j) = (2*miu(i,j)-deltat*sigmat(i,j))/(2*miu(i,j)+deltat*sigmat(i,j))
     Db(i,j) = (2*deltat)/(2*miu(i,j)+deltat*sigmat(i,j))     
   end do
  end do


! beginning of timesteps
 do n = 1,300
   
  write (filename, "('data',I3.3,'.dat')") n
  open (unit=130,file=filename)
 
 
!initiate sinusoidal wavepulse at center
  Ez(ic,jc) = A0*sin(2*pi*f0*n*deltat)
  
! calculate ez-field  
  do i = 2,ie-1
    do j = 2,je-1
          Ez(i,j) = Ca(i,j)*Ez(i,j) + Cb(i,j)*(Hy(i,j) - Hy(i-1,j) - Hx(i,j) + Hx(i,j-1))
          write (130,*) i,j,Ez(i,j)
          if (j == 99) write (130,*) ' '
!          !print *,'i=',i,'j=',j,'Ez(i,j)=',Ez(i,j)
    end do
  end do

  do i = 1,ie-1
    do j = 1,je-1
	  Hx(i,j) = Da(i,j)*Hx(i,j) + Db(i,j)*(Ez(i,j) - Ez(i,j+1))
          !print *,'i=',i,'j=',j,'Hx(i,j)=',Hx(i,j)
     end do
  end do
  
    do i = 1,ie-1
     do j = 1,je-1
          Hy(i,j) = Da(i,j)*Hy(i,j) + Db(i,j)*(Ez(i+1,j) - Ez(i,j))
          !print *,'i=',i,'j=',j,'Hy(i,j)=',Hy(i,j)
     end do
  end do

close (unit=130) 

end do !n

end SUBROUTINE test7

data042.jpg

data095.jpg
 
Technology news on Phys.org
thank you for the reply. i just found out the problem caused by impedance mismatch. it is happened when i use different epsilon. wave impedance inversely proportional to the square of epsilon. So epsilon =1 wave impedance value is 1.414 times greater than epsilon= 2. If there is any impedance mismatch between the two layers it will create reflection. then, another problem, i found the cause of problem, but have no idea how to correct impedance mismatch in my simulation. do you have any idea?
 
I'm sorry, but as I have never used FDTD or worked with that kind of problem, I have no advice to give you.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 8 ·
Replies
8
Views
7K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K