Acidizing is a stimulation technique used to enhance the productivity of oil and gas wells. During acidizing, Carbon dioxide (CO2) is produced as a byproduct of the reaction between HCl and carbonate rocks. This CO2, depending on the system's pressure, temperature, and the concentration of produced salts such as CaCl2 and MgCl2, can exist in aqueous, liquid, gaseous, or supercritical phase. In modeling multiphase flow acidizing, it is crucial to have a thermodynamic model that can calculate CO2 solubility based on these thermodynamic conditions. Several models have been proposed to calculate CO2 solubility, including the widely used model of Duan and Sun. However, other species in the system, such as the H+ ion, might impact solubility, and these models do not account for the effect of H+ on solubility. In this work, a chemical framework, named CO2REAKT, using the open-source chemical simulator Reaktoro is developed for this purpose. Using 15 experimental studies and 1,094 data points, the model of Duan and Sun is validated. CO2REAKT is then validated, demonstrating that it can be extended to consider the impact of HCl on solubility. Using the extended framework, we concluded that not considering the effect of HCl on the solubility of CO2 in brines might lead to erroneous results and overestimate the solubility. Therefore, in addition to pressure, temperature, and salt concentration, the concentration of HCl in the system should be considered.