Inspired by the analogy between the magnetic field and velocity field of incompressible fluid flow, we propose a fluid dynamics approach for computing nonlinear force-free magnetic fields. This method has the advantage that the divergence-free condition is automatically satisfied, which is a sticky issue for many other algorithms, and we can take advantage of modern high resolution algorithms to process the force-free magnetic field. Several tests have been made based on the well-known analytic solution proposed by Low & Lou. The numerical results are in satisfactory agreement with the analytic ones. It is suggested that the newly proposed method is promising in extrapolating the active region or the whole sun magnetic fields in the solar atmosphere based on the observed vector magnetic field on the photosphere.
Sun: magnetic fields --- MHD --- methods: numberical