Plasma propulsion concepts that employ a guiding magnetic field raise the question of how the magnetically controlled plasma can detach from the spacecraft. This paper presents a detachment scenario relevant to high-power thrusters in which the plasma can stretch the magnetic field lines to infinity, similar to the solar wind. In previous work, the corresponding ideal magnetohydrodynamics equations have been solved analytically for a plasma flow in a slowly diverging nozzle. That solution indicates that efficient detachment is feasible if the nozzle is sufficiently long. In order to extend the previous model beyond the idealizations of analytical theory, a Lagrangian code is developed in this work to simulate steady-state kinetic plasma flows and to evaluate nozzle efficiency. The code is benchmarked against the analytical results and then used to examine situations that are not analytically tractable, including plasma behavior in the recent Detachment Demonstration Experiment at the National Aeronautics and Space Administration.