Hello,
An index monitor can be used to determine the refractive index in FDTD: https://optics.ansys.com/hc/en-us/articles/360034383134
You might find these grating coupler examples useful as well:
https://optics.ansys.com/hc/en-us/articles/360042305334
https://optics.ansys.com/hc/en-us/articles/360042304774