  Analyzing magnetohydrodynamic (MHD) flows requires accurate predictions of
the Lorentz force and energy conversion. Total energy, cross-helicity, and
magnetic helicity can be used to investigate energy conservation properties in
inviscid MHD flows. However, the conservation property of magnetic helicity has
not been fully clarified using the magnetic vector potential equation. This
study presents a numerical method to simultaneously relax magnetic vector and
electric potentials for incompressible MHD flows using a conservative finite
difference scheme that discretely conserves total energy. First, it was proven
that the transport equations of total energy, cross-helicity, and magnetic
helicity can be discretely derived from the equations of momentum, magnetic
flux density, and magnetic vector potential, thereby elucidating the
conservation properties of these quantities. Subsequently, five models for
steady and unsteady problems were analyzed to verify the accuracy and
convergence of the proposed numerical method. Additionally, the computational
approach involving the magnetic vector and electric potentials was validated. A
comparison of the calculated results with exact solutions in the analysis of
one- and two-dimensional flow models and Hartmann flow further validated the
numerical method. Unsteady analyses of two- and three-dimensional decaying
vortices were performed. The ideal periodic inviscid MHD flow exhibited good
conservation properties for total energy and cross-helicity. Magnetic helicity
was discretely preserved even in three-dimensional flow. Furthermore, in
viscous flow, the attenuation trends of total energy, cross-helicity, and
magnetic helicity aligned with the exact solution. The numerical method
accurately captured the decay trends of energy. Thus, the proposed method can
facilitate the investigation of energy conservation and conversion in
compressible MHD flows.
