This paper presents a thermal and flow analysis of an unsteady squeezing nanofluid flow and heat transfer using nanofluid based on Brinkman model in presence of variable magnetic field. Galerkin Method (GM) is used to solve the nonlinear differential equations governing the problem. Squeezing flow between parallel plates are very applicable in the many industries and it means that one or both of the parallel plates have vacillation. The effects of active parameters such as the Hartman number, squeeze number and heat source parameter are discussed. Results for temperature distribution and velocity profile, Nusselt number and skin friction coefficient by Galerkin Method (GM) are presented. As can be seen in results, the values of Nusselt number and skin friction coefficient for CuO is better than Al2O3’s. Also, according to figures, as nanofluid volume fraction increases, Nusselt number increases and skin friction coefficient decreases, increase in the Hartman number results in an increase in velocity and temperature profiles and an increase in squeeze number can be associated with the decrease in the velocity.