Understanding the thermodynamics associated with ion mixing and separation processes is important in order to meet the rising demands for clean energy and water production. Several electrochemical-based technologies such as capacitive deionization and capacitive mixing (CapMix) are capable of achieving desalination and energy production through ion mixing and separation processes, yet experimental investigations suggest energy conversion occurs with low second law (thermodynamic) efficiency. Here, we explore the maximum attainable efficiency for different CapMix cycles to investigate the impact cycle operation has on energy extraction. All investigated cycles are analogous to well documented heat engine cycles. In order to analyze CapMix cycles, we develop a physics-based model of the electric double layer based on the Gouy-Chapman-Stern theory. Evaluating CapMix cycles for energy generation revealed that cycles where ion mixing occurs at constant concentration and switching occurs at constant charge (a cycle analogous to the Stirling engine) attained the highest overall first law (electrical energy) efficiency (39%). This first law efficiency is nearly 300% greater than the first law efficiency of the Otto, Diesel, Brayton, and Atkinson analog cycles where ion mixing occurs while maintaining a constant number of ions. Additionally, the maximum first law efficiency was 89% with a maximum work output of 0.5 kWh per m3 of solution mixed (V = 1.0V) using this same Stirling cycle. Here the salinity gradient was CH = 600 mM and CL = 1 mM (ΔGmix = 0.56 kWh/m3). The effect of voltage was also examined at CH = 600 mM (seawater) and CL = 20 mM (river water). CapMix cycles operated at lower voltage (V < 1.0V), resulted in the Otto cycle yielding the highest first law efficiency of approximately 25% (compared to under 20% for the Stirling cycle); however, this was at the expense of a reduction (50x) in net electrical energy extracted from the same mixing process (0.01 kWh per m3).