Thermodynamic Model for Energy-Constrained Open-System Evolution of Crustal Magma Bodies Undergoing Simultaneous Recharge, Assimilation and Crystallization: the Magma Chamber Simulator