1 / 21

EEE 431 Computational Methods in Electrodynamics

EEE 431 Computational Methods in Electrodynamics. Lecture 10 By Dr. Rasime Uyguroglu Rasime.uyguroglu@emu.edu.tr. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD). FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD). One dimensional free space formulation:

Download Presentation

EEE 431 Computational Methods in Electrodynamics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EEE 431Computational Methods in Electrodynamics Lecture 10 By Dr. Rasime Uyguroglu Rasime.uyguroglu@emu.edu.tr

  2. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD)

  3. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) • One dimensional free space formulation: • Assume a plane wave with the electric filed having Ex, magnetic field having Hy components and traveling in the z direction.

  4. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) • Maxwell’s Equations become:

  5. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) • Taking central difference approximation for both temporal and spectral derivatives:

  6. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD)

  7. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) • /* Bare-bones 1D FDTD simulation . */ • #include <stdio.h> • #include <math.h> • #define KE 200 • int main() • { • double ez[KE]={0.}, hy[KE]={0.}; • float dz=.1,c=3e8, eps0=8.85e-12,mu0=1.25663e-6; • float dt=dz/(2*c); • float dtedz=dt/(eps0*dz), dtmdz=dt/(mu0*dz); • int n, nTime=1000, k; • FILE *fp,*fp1; • fp1=fopen("E.dat","w");

  8. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) • /* do time stepping */ • for (n=0; n<nTime; n++) { • // printf( " %6.2f\n",nTime); • /* update magnetic field */ • for (k=0; k<KE-1; k++) • hy[k] = hy[k] + dtmdz*(ez[k+1] - ez[k]); • /* update electric field */ • for (k=1; k<KE; k++) • ez[k] = ez[k] + dtedz*(hy[k] - hy[k-1]); • /* hardwire a source node */ • ez[100] = exp(-(n-30.)*(n-30)/100);

  9. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) • fprintf(fp1,"%g\n",ez[50]); • if(n==150){ • fp=fopen("Ez.dat","w"); • for (k=1;k<=KE;k++) • {fprintf(fp,"%6.2f\n",ez[k]);} • fclose(fp); • /* Write Hy in a file "Hy"*/ • fp=fopen("Hy.dat","w"); • for(k=1;k<=KE;k++) • {fprintf(fp," %6.2f\n",hy[k]);} • fclose(fp);} • } • fclose(fp1); • return 0; • }

  10. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) • Source at k=0, field at k=50 w.r.t. the time, 250 time steps.

  11. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) • Source at k=100,Ex at k=100

  12. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) • Ez w.r.t. space steps

  13. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) • Ez w.r.t. the time steps.

  14. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) • Ez w.r.t. the time steps

  15. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) with ABC’s • Using the boundary condition discussed in Lecture 9 : • Store a value of Ex(1) for two time steps and then put it in Ex(0).

  16. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) with ABC’s • A.B.C.in C computer code assume that the domain ends at k=KE:

  17. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) with ABC’s • Ez w.r.t. the time steps

  18. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) with ABC’s • /* Bare-bones 1D FDTD simulation .with abc */ • #include <stdio.h> • #include <math.h> • #define KE 200 • int main() • { • double ez[KE]={0.}, hy[KE]={0.}; • float ez_low_m1=0,ez_low_m2=0,ez_high_m1=0,ez_high_m2=0; • float dz=.1,c=3e8; • float eps0=8.85e-12,mu0=1.25663e-6; • float dt=dz/(2*c); • float dtedz=dt/(eps0*dz); • float dtmdz=dt/(mu0*dz); • int n, nTime=1000, k; • FILE *fp,*fp1; • fp1=fopen("E.dat","w");

  19. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) with ABC’s • /* do time stepping */ • for (n=0; n<nTime; n++) { • // printf( " %6.2f\n",nTime); • /* update magnetic field */ • for (k=0; k<KE-1; k++) • hy[k] = hy[k] + dtmdz*(ez[k+1] - ez[k]); • /* update electric field */ • for (k=1; k<KE; k++) • ez[k] = ez[k] + dtedz*(hy[k] - hy[k-1]); • /*Absorbing Boundary Conditions*/ • ez[0] = ez_low_m2; • ez_low_m2 = ez_low_m1; • ez_low_m1 = ez[1]; • ez[KE-1] = ez_high_m2; • ez_high_m2 = ez_high_m1; • ez_high_m1 = ez[KE-2]; • /* hardwire a source node */

  20. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) with ABC’s • ez[100] = exp(-(n-30.)*(n-30)/100); • fprintf(fp1,"%g\n",ez[50]); • if(n==150){ • fp=fopen("Ez.dat","w"); • for (k=1;k<=KE;k++) • {fprintf(fp,"%6.2f\n",ez[k]);} • fclose(fp); • /* Write Hy in a file "Hy"*/ • fp=fopen("Hy.dat","w"); • for(k=1;k<=KE;k++) • {fprintf(fp," %6.2f\n",hy[k]);} • fclose(fp);} • } • fclose(fp1); • return 0; • }

  21. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) with ABC’s • Ez with ABC and without ABC

More Related