  Development of a two-phase incompressible solver for magnetic flows in the
magnetostatic case is presented. The proposed numerical toolkit couples the
Navier-Stokes equations of hydrodynamics with Maxwell's equations of
electromagnetism to model the behaviour of magnetic flows in the presence of a
magnetic field. To this end, a rigorous implementation of a second-order
two-phase solver for incompressible nonmagnetic flows is introduced first. This
solver is implemented in the finite-difference framework, where a fifth-order
conservative level set method is employed to capture the evolution of the
interface, along with an incompressible solver based on the projection scheme
to model the fluids. The solver demonstrates excellent performance even with
high density ratios across the interface (Atwood number $\approx 1$), while
effectively preserving the mass conservation property. Subsequently, the
numerical discretization of Maxwell's equations under the magnetostatic
assumption is described in detail, utilizing the vector potential formulation.
The primary second-order solver for two-phase flows is extended to the case of
magnetic flows, by incorporating the Lorentz force into the momentum equation,
accounting for high magnetic permeability ratios across the interface. The
implemented solver is then utilized for examining the deformation of ferrofluid
droplets in both quiescent and shear flow regimes across various susceptibility
values of the droplets. The results suggest that increasing the susceptibility
value of the ferrofluid droplet can affect its deformation and rotation in low
capillary regimes. In higher capillary flows, increasing the magnetic
permeability jump across the interface can further lead to droplet breakup as
well. The effect of this property is also investigated for the Rayleigh-Taylor
instability growth in magnetic fluids.
