Numerical simulation of mass injection for the formation of prominence magnetic field configurations