Energy recovery in capacitive deionization systems with inverted operation characteristics