Stability of nanofluids in quiescent and shear flow fields