A numerical code for the simulation of transient multicomponent magma dynamics