Unsteady natural convection flow and heat transfer utilizing magnetic nanoparticles in the presence of a sloping magnetic field inside a square enclosure are simulated numerically following nonhomogeneous dynamic model. Four different thermal boundary conditions: constant, parabolic in space, sinusoidally in space, and time for the bottom hot wall are considered. The top wall of the enclosure is cold while the vertical walls are thermally insulated. Galerkin weighted residual finite element method is used to solve the governing nondimensional partial differential equations. For simulations, 12 types of nanofluids consisting magnetite (Fe 3 O 4 ), cobalt ferrite (CoFe 2 O 4 ), Mn–Zn ferrite (Mn–ZnFe 2 O 4 ), and silicon dioxide (SiO 2 ) nanoparticles along with water, engine oil, and kerosene as base fluids are used. The effects of the important model parameters such as Hartmann number, magnetic field sloping angle, and thermal Rayleigh number on the flow fields are investigated. The results show that the average Nusselt number, shear rate, as well as the nanofluid velocity decreases as the Hartmann number intensifies. Moreover, the rate of heat transfer in nanofluid exaggerates with the increase of the thermal Rayleigh number and the magnetic field sloping angle. Sinusoidally varied in space thermal boundary condition at the bottom wall provides the highest average Nusselt number and the shear rate compared to the other types of thermal boundary conditions studied here. For this case, the highest average Nusselt number is obtained for the Mn–ZnFe 2 O 4 –Ke nanofluid. On the other hand, Fe 3 O 4 –H 2 O nanofluid delivers the highest shear rate compared to the other premeditated nanofluids.