1 / 20

EEE 431 Computational Methods in Electrodynamics

Learn about FDTD method for solving Maxwell's Equations, implement 1D simulations, incorporate absorbing boundary conditions with code examples, and analyze field components.

alexisf
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) • The coefficients can be written as:

  8. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) • /* 1D FDTD simulation with a hard source. */ • #include <stdio.h> • #include <math.h> • #define KE 200 • int main() • { • double ez[KE]={0.}, hy[KE]={0.}, imp=377.0,s=0.5; • int n, nTime=250, k; • FILE *fp,*fp1; • fp1=fopen("E.dat","w"); • /* do time stepping */ • for (n=0; n<nTime; n++) { • /* update magnetic field */ • for (k=0; k<KE-1; k++) • hy[k] = hy[k] + s*(ez[k+1] - ez[k])/imp; • /* update electric field */ • for (k=1; k<KE; k++) • ez[k] = ez[k] + s*imp*(hy[k] - hy[k-1]); • /* source point */ • ez[0] = exp(-(n-30.)*(n-30)/100); • fprintf(fp1,"%g\n",ez[50]); • } • fclose(fp1); • return 0; • }

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

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

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

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

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

  14. 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).

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

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

  17. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) with ABC’s • /* 1D FDTD simulation with ABC. */ • #include <stdio.h> • #include <math.h> • #define KE 200 • int main() • { • double ez[KE]={0.}, hy[KE]={0.}, imp=377.0,s=0.5; • int n, nTime=1000, k; • float ez_low_m1=0,ez_low_m2=0,ez_high_m1=0,ez_high_m2=0; • FILE *fp,*fp1; • fp1=fopen("E.dat","w"); • /* do time stepping */ • for (n=0; n<nTime; n++) { • // printf( " %6.2f\n",nTime);

  18. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) with ABC’s • /* update magnetic field */ • for (k=0; k<KE-1; k++) • hy[k] = hy[k] + s*(ez[k+1] - ez[k])/imp; • /* update electric field */ • for (k=1; k<KE; k++) • ez[k] = ez[k] + s*imp*(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];

  19. FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD) with ABC’s • /* hardwire a source node */ • 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; • }

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

More Related