Black powder flowing with hydrocarbons in a hydrocarbon pipeline is converted into a magnetorheological slurry by implementing wet scrubbing in the hydrocarbon pipeline. A flow of the magnetorheological slurry through the hydrocarbon pipeline is controlled.