This very simple example of a grating demonstrates how the ray approximation breaks down as the structure feature size becomes wavelength scale.
The structure in this example is a simple grating with an index contrast of 1.5:1. If the illumination is at normal incidence, a very simple application of Snell's law suggests that the fields should be completely reflected, since the angle of incidence on the grating surface is 45 degrees which is beyond the critical angle of 41.8 degrees.
The same system setup in FDTD.
Notice that the span is 20um.
Simulation results when the source wavelength is 0.4um. The key point is to recognize that 0.4um is much smaller than the period of the structure (20um). In this situation, the behavior of the system is basically predicted by the simple ray approximation; most of the fields are reflected.
switchtolayout;
save("400nm.fsp");
setnamed("source","center wavelength",400e-9);
run;
Simulation results when the source wavelength is 4um. The key point is to recognize that 4um is much closer in scale to the period of the structure (20um). In this situation, the behavior of the system is quite different. A significant fraction of power is transmitted through the device.
switchtolayout;
save("4000nm.fsp");
setnamed("source","center wavelength",4000e-9);
run;