Self similar solutions in shallow water equations