The linear and nonlinear harmonic methods are efficient frequency domain methods for analyzing time periodic unsteady flow fields. They have been widely used in both academia and industry. But the cost and complexity of developing a linear harmonic solver has been limiting its wider applications. On the other hand, the automatic differentiation (AD) has long been used in the CFD community with a focus on generating adjoint codes in a reverse mode. All those AD tools can do a much better job in generating linearized codes in a tangent mode, but so far very little, if any, attention is paid to using AD for developing linear harmonic solvers.
The linear harmonic method, in comparison with the harmonic balance method, has its own advantages. For example, it can capture small disturbances very effectively, and avoids aliasing errors which can lead to solution instability since each wave component is solved for separately.
This paper presents the effort of using an AD tool to generate major source codes for the development of a linear harmonic solver for analyzing time periodic unsteady flows. It includes the procedures and advice of using AD for such a purpose. A case study is also presented to validate the developed linear harmonic solver.