In this paper, the magnetic nanofluids and magnetic field are used to provide the coating around the wall of a channel. The magnetic field is induced by the direct current wire. Iron oxide is used as magnetic nanoparticles. A finite volume method is used to solve the Navier stokes equations and the Eulerian-Lagrangian approach is employed to track the magnetic nanoparticles. The effects of magnetic strength, the position of current wire, and the diameter of magnetic nanoparticles on the trajectory of magnetic nanoparticles and coating efficiency are investigated by providing contours are diagrams. The results showed that the length of coating decreases about 55% with increasing the particle diameter in the range of 500 nm to 1 μm. Further, the coating efficiency, defined as the ratio of the number of trapped particles on the wall to the number of injected particles at the inlet of the channel, improves by increasing the magnetic strength and decreasing the vertical position of current wire.