Insight into the dynamics of ferrohydrodynamic (FHD) and magnetohydrodynamic (MHD) nanofluids inside a hexagonal cavity in the presence of a non-uniform magnetic field