Thermodynamics of polymer solutions under flow: Phase separation and polymer degradation