Guilin Sun
Ansys Employee

Yes, you need to carefully set the simulation:

1: make sure the mesh is periodic along the periodic direction, eg, use integer number of mesh points with override mesh

2: place the dipole in its most effective location, eg, if the mode exhibits Ex property, place it in Ex location of the Yee cell. If you do not know, please at least 3 dipoles at Ex,Ey and Ez location in the Yee cell.

3: make sure the analysis group is set properly: you may need to modify the time monitor locations to where the field intensity is strong from a profile monitor. Thus this is an iterative simulation.

4: make sure to choose proper time segment in the analysis group, so the result is linear. 

https://optics.ansys.com/hc/en-us/articles/360041611774-Quality-factor-calculations-for-a-resonant-cavity

https://optics.ansys.com/hc/en-us/articles/1500006350801-Tips-for-simulating-high-Q-Photonic-Crystal-PhC-Cavity 

Please