Calculation of Simultaneous Chemical Equilibria in Aqueous-Mineral-Gas Systems and its Application to Modeling Hydrothermal Processes