Polymer nanocomposites for water treatments