Flash recovery system analysis and flashing tank optimization in desalination plants