In this work, the three-dimensional free convection flow in a modeled room was studied for various Grashof numbers (Gr = 2 × 104 and 2 × 105) and Hartmann numbers (Ha = 0 and 100) by the lattice Boltzmann method (LBM), and the effect of magnetic field on the flow and temperature field was investigated. For consideration of the effect of magnetic field on particle behavior in a three-dimensional modeled room, 50,000 particles with sizes of 1 and 10 μm were injected into the room. The number of deposited particles on the different walls of the room was obtained, and it was observed that by increasing the Grashof number, the total number of deposited particles for both particle sizes and both Hartmann numbers enhances. Moreover, for Ha = 100, the number of deposited 10 μm particles on the walls increases. Therefore the number of suspended particles in the modeled room decreases, which is environmentally desirable. However, the number of deposited 1 μm particles on the walls decreases in the presence of the magnetic field. Furthermore, it was found that the gravity force has a significant effect on the particle deposition, as the number of deposited 10 μm particles on the floor is much larger than 1 μm particles.