3D simulation of arcs in internal and external magnetic fields