Computation of phase and chemical equilibria of water-organic-inorganic mixtures is of significant interest in atmospheric aerosol modeling. A new version of the phase partitioning model, named UHAERO, is presented here, which allows one to compute the phase behavior for atmospheric aerosols containing inorganic electrolytes and organic compounds. The computational implementation of the model is based on standard minimization of the Gibbs free energy using a primal-dual method, coupled to a Newton iteration. Water uptake and deliquescence properties of mixtures of aqueous solutions of salts and dicarboxylic acids, including oxalic, malonic, succinic, glutaric, maleic, malic, or methyl succinic acids, are based on a hybrid thermodynamic approach for the modeling of activity coefficients (Clegg and Seinfeld, 2006a, 2006b). UHAERO currently considers ammonium salts and the neutralization of dicarboxylic acids and sulfuric acid. Phase diagrams for sulfate/ammonium/water/dicarboxylic acid systems are presented as a function of relative humidity at 298.15 K over the complete space of compositions.
 Atmospheric aerosols are composed of a mixture of water, inorganic compounds, organic compounds, mineral dust, black carbon, etc. The inorganic constituents of atmospheric particles typically consist of electrolytes of ammonium, sodium, calcium, sulfate, nitrate, chloride, carbonate, potassium, magnesium, etc. The mixture of inorganic and organic constituents in atmospheric particles is complex, as the number of organic components is large. The presence of organic species in solution may substantially influence phase transitions of the deliquescence and efflorescence of salts with changes in relative humidity [Erdakos and Pankow, 2004]. Reciprocally, dissolved electrolytes can have appreciable effects on the solubility of organic components in solution, see Salcedo  or Marcolli and Krieger . Therefore accounting for the influence of organic solutes in electrolyte mixtures is important in thermodynamic calculations.
 Dicarboxylic acids are ubiquitous in atmospheric particles and their behavior is representative of organics soluble in water, see for instance Kawamura et al.  or Yu et al. . Presented here is a phase equilibrium model for atmospheric aerosols containing inorganic electrolytes and organic species, with application to dicarb-oxylic acids: oxalic, malonic, succinic, glutaric, maleic, malic, or methyl succinic acids. The comprehensive mathematical model for mixed inorganic-organic atmospheric aerosols is capable of predicting phase stability and separation.
 When predicting the thermodynamic equilibrium for mixtures of inorganic and organic components with a standard approach, hybrid methods are required for computing activity coefficients in inorganic/organic mixtures, which incorporate different models, and for which relevant experimental data are often not available. Also, the computation of the thermodynamic equilibrium requires advanced computational techniques that can be numerically demanding.
 In the following, a computational framework (UHAERO) for the determination of the thermodynamic equilibrium of a mixture of inorganic and organic compounds is presented. In order to show the capabilities of UHAERO, a hybrid approach is used, namely the Pitzer-Simonson-Clegg (PSC) and UNIFAC activity coefficient models, together with a CSB approach [Clegg and Seinfeld, 2006b] for the modeling of interactions between inorganic electrolytes and organic dissociated components. It is flexible and can incorporate other models for the activity coefficients.
 A numerical technique for the efficient computation of the equilibrium is described in this article. One can calculate the composition of the aerosol either by solving the set of nonlinear algebraic equations derived from mass balances and chemical equilibrium or by performing a direct minimization of the Gibbs free energy. Since direct minimization of the Gibbs free energy has tended to be computationally demanding (making its use in large-scale atmospheric models unattractive, since thermodynamic calculations are implemented in principle for each grid cell and at each time step), we propose an approach based on solving the governing set of nonlinear equations. This approach is an extension of the solution method proposed by Amundson et al. [2006a] for calculation of the equilibrium of systems containing inorganic species only.
 The most challenging aspect of the numerical determination of the equilibrium is the prediction of the partitioning of aerosol components between aqueous and solid phases. A number of current methods rely on a priori specifications of the presence of certain phases at a certain relative humidity and overall composition. While these assumptions may facilitate numerical determination of the equilibrium, they lead to approximations in the phase diagram of the system that may be undesirable, see Ansari and Pandis .
 What is ultimately needed is an efficient computational model for the equilibrium partitioning of inorganic electrolytes and organic compounds between aqueous and solid phases that does not rely on a priori knowledge of the presence of certain phases at a given relative humidity and overall composition. For the organic composition, we focus here on dicarboxylic acids.
 We present a new version of the phase partitioning model for mixtures of inorganic electrolytes and dicarboxylic acids (UHAERO), which is an extension of the inorganic atmospheric aerosol phase equilibrium model presented by Amundson et al. [2006a].
 The next section summarizes the standard minimization problem; its mathematical foundation and computational implementation are presented by Amundson et al. [2005, 2006b]. The following sections are devoted to the modeling of the activity coefficients, the computational aspects of aerosol phase equilibria in the system composed of sulfate, nitrate, water and a dicarboxylic acid, and the simulation of such systems. Detailed phase diagrams of the sulfate/ammonium/water/dicarboxylic acid systems, including oxalic, malonic, succinic, glutaric, maleic, malic, and methyl succinic acids, are presented as a function of relative humidity at 298.15 K over the complete space of compositions.
2. Thermodynamic Equilibrium
 The multicomponent chemical equilibrium for a closed gas-aerosol system at constant temperature and pressure and a specified elemental abundance is the solution to the following problem arising from the minimization of the Gibbs free energy, G,
subject to g > , l > , s ≥ , and
where g, l, s are the concentration vectors in gas, liquid, and solid phases, respectively, g, l, s are the corresponding chemical potential vectors, Ag, Al, As are the component-based formula matrices, and is the component-based feed vector. Condition (2) expresses the fact, for example, that in calculating the partition of any chemical component (in electrolytes and/or organic species) between aqueous and solid phases the total concentration is conserved, while maintaining a charge balance in solution.
 The chemical potential vectors are given by
where R is the universal gas constant, T is the system temperature, g0, l0 and s0 are the standard chemical potentials of gas, liquid and solid species, respectively, and g and l are the activity vectors of the gas and liquid species. For ionic components the elements of the activity vector ai are equal to γimi, where γi and mi are the activity coefficient and molality (mol kg−1 water), respectively, of component i. The water activity is denoted by aw. The temperature dependence of the standard state chemical potentials is reported by Amundson et al. [2006a]. Particle curvature effects are neglected, but can easily be incorporated in the model.
Equations (1)–(5) represent a constrained nonlinear minimization problem. The standard method for its resolution is presented in section 4.
3. Modeling of Activity Coefficients
 The key issue in the equilibrium calculation when using the standard approach based on activity models, is the estimation of the activity coefficients. For aqueous inorganic electrolyte solutions, the Pitzer molality-based model [Pitzer, 1973, 1975; Pitzer and Mayorga, 1973] has been widely used, but it is restricted to high RH regions where solute molalities are low. These restrictions on the concentrations have been relaxed with the Pitzer, Simonson, Clegg (PSC) mole fraction-based model [see Clegg and Pitzer, 1992; Clegg et al., 1992].
 On a mole fraction scale, the activity of component i is expressed as ai = fixi, where fi is the mole fraction-based activity coefficient, and xi is the mole fraction of species i. The molality-based and mole fraction-based activity coefficients are related by fixw = γi.
 A number of methods exist for calculating the water activity aw. The most widely used is the Zdanovskii-Stokes-Robinson (ZSR) mixing rule [Clegg et al., 2003; Stokes and Robinson, 1966], in which only data on binary solute/water solutions are needed to predict the water content of a multicomponent mixture. A more accurate determination of the water content can be obtained using the solvent activity model of Clegg et al. [1998a, 1998b], which includes interactions between solutes, in addition to those between the solutes and water; in this case, the water activity is calculated from aw = fwxw.
 The organic components can dissociate in the liquid phase and they can form solid salts with the inorganic electrolytes. The soluble organic compounds have effects on the water content of the aerosol, and their dissociation will also affect the aerosol pH. This generalization leads to an extension of the species g, l, s in the gas, liquid and solid phases respectively. The interactions between dicarboxylic acids and inorganic components have to be modeled and the activity coefficients fi have to incorporate the organic dependencies, although data are not always available. Owing to the lack of data, the modeling of aqueous solutions containing both ions and uncharged solutes up to high concentrations (low equilibrium relative humidity) is still quite approximate [see, e.g., Griffin et al., 2005; Pun et al., 2002].
 The PSC model [Clegg et al., 1998a, 1998b] for inorganic (electrolyte) multicomponent solutions and the UNIFAC model [Fredenslund et al., 1977] for water/organic mixtures are combined in a self-consistent way to incorporate the mutual influence of ions and organic molecules on the activities of all components. The water uptake and deliquescence properties of aqueous solutions of dicarboxylic acids, and their mixtures with salts, can be treated using two different models, namely an extended ZSR approach, described by Clegg and Seinfeld [2004, 2006a] or the CSB model [see Clegg and Seinfeld, 2006b; Clegg et al., 2004].
 The first approach to model such interactions is an extension of the ZSR model as described by Clegg and Seinfeld . It uses Pitzer equations to calculate activity coefficients for the inorganic electrolytes and an extended ZSR model to evaluate interactions and the dissociation of organic solutes. Unfortunately, this approach is valid only for fixed concentrations of the different solutes, which is incompatible with dissociation of uncharged solutes and leads to a thermodynamic inconsistency. Therefore the ZSR approach is not used in this work.
 In a second approach, Clegg and Seinfeld [2006a] have extended the so-called CSB model. The activity coefficients for the electrolytes and the nonelectrolyte organics are computed independently, with the PSC and UNIFAC models, respectively. Additional terms are then added to the activity coefficients with the Pitzer molality-based model. We note that the terms in the Pitzer model can indeed take unrealistic values in concentrated solutions.
 Efficient simplifications of these models can improve the computational time of UHAERO. The discussion of the simplifications of the activity coefficients model is not our focus, and therefore we will present results based on this standard model.
 The CSB model is used in the present framework for the modeling of activity coefficients in inorganic/dicarboxylic acids mixtures. In this hybrid thermodynamic approach, the molal activity coefficients of an ion (γi) and an uncharged organic solute (γn) in a liquid mixture are given by:
 Both activity coefficients have two contributions: one incorporating the interactions with water and one incorporating the interactions between electrolytes and organics. We illustrate these interactions in the system of sulfate, ammonium, water and one dicarboxylic acid, denoted by H2R. The stepwise dissociation of the acid is given by the following two relations:
 Owing to a general lack of data, the interactions between electrolytes and dissociated acids have been modeled in a simplified way. The organic ions R2− and HR− are assumed to interact only with the positive inorganic ions. The corresponding values of the parameters in the model are the same as those for inorganic components SO42− and HSO4−, respectively. The organic ions are assumed not to interact with each other, and the neutral organic components H2R interact only with water.
 Finally, the inclusion of the PSC and UNIFAC models, together with the CSB model for interactions, illustrates that the UHAERO framework allows an arbitrary number of components with any activity coefficient model.
4. Computation of Inorganic Electrolytes/Organics Phase Equilibria
 Minimization algorithms applied for the prediction of gas-aerosol equilibrium are often related to sequential quadratic programming methods for nonlinear programming, combined with interior-point techniques for the handling of the nonnegativity constraints on the concentrations of salts. When nonlinear programming algorithms are applied as black boxes to solve gas-aerosol equilibrium problems, generic linear algebra routines are typically employed to solve linear systems arising in the algorithm. However, for gas-aerosol equilibrium problems, specific sparse direct linear solvers that take advantage of the special algebraic structure of gas-liquid and liquid-solid equilibrium relations have to be used in order to deal with scaling of the concentrations in the computation. A straightforward application of nonlinear programming algorithms is not effective for such problems.
 The numerical minimization technique of UHAERO, described in detail by Amundson et al. [2005, 2006b], is based on a primal-dual active-set algorithm that takes into account the special structure of the underlying system. The algorithm is elucidated from the analysis of the algebraic structure of the Karush-Kuhn-Tucker (KKT) optimality conditions for the minimization of the Gibbs free energy. For a given set of solids s that can occur in the system, the KKT optimality conditions are:
 The above KKT system is first reformulated to furnish the mass action laws in addition to the mass balance constraints (2). The mass action laws are expressed in a logarithmic form. An immediate consequence of the logarithmic form is that the mass action laws in the primal-dual form are linear with respect to the dual variables λ, which represent the logarithmic values of activities for component species at equilibrium. In this primal-dual form, the mass action laws involving solid phases become linear inequality constraints that are enforced via the dual variables so that the solution remains dual feasible with respect to salt saturations. The concentrations of saturated salts are the Lagrange multipliers of the dual linear constraints that are active, and thus can be eliminated from the KKT system by applying the so-called null-space method based on an active set of solid phases. The reduced KKT system of equations is obtained by projection of the original system on the active set of solid salts s and is given by:
where Azl and Azg are the matrices Al and Ag premultiplied by a null-space matrix of the subspace given by the active set of solid salts.
 Then, the algorithm applies Newton's method to the reduced KKT system of equations that is projected on the active set of solid phases to find the next primal-dual approximation of the solution. The primal-dual algorithm is based on the active-set strategy that makes a sequence of sets s of solids converging to the optimal active set s† of solid phases, i.e., the set of solids existing at the equilibrium. For each set s, we compute the Newton direction. If a solid salt becomes saturated, we introduce it into the set of active solids and restart a Newton method. When the algorithm converges, the salts with negative concentrations are removed from the active sets of solids salts.
 The active set method adds a solid salt when the components reach saturation and deletes a solid phase from the active set when its concentration violates the nonnegativity constraint. The analysis of linear algebra with matrices of block structure provides information about the inertia of the so-called KKT matrices which arise in the Newton iterations. This information is used, as phase stability criteria, in line-search based methods to modify, if necessary, the second-order information to ensure that the algorithm converges to a stable equilibrium rather than to any other first-order optimality point, such as a maximum, a saddle point, or an unstable local minimum. The concentration iterates follow a path that is not feasible with respect to the mass balance constraints in the first few iterations, but then converge quadratically to the minimum of the Gibbs free energy.
 The addition of organic species to the system does not change the underlying mathematical structure of the KKT optimality system, but merely increases the number of liquid components, the number of chemical reactions, and the number of potential salts.
 In case of a system that is equilibrated to a fixed relative humidity (RH), as the inorganic module described by Amundson et al. [2006a], the aerosol water content is directly computed from the minimization, i.e., without using an empirical relationship such as the ZSR equation. Also the equilibration of trace gases between the vapor and condensed phases can be enabled or disabled as required, as can the formation of solids (which allows the properties of liquid aerosols supersaturated with respect to solid phases to be investigated).
5. Simulation of Inorganic Electrolytes/Dicarboxylic Acids Phase Equilibria
 To reconstruct phase diagrams of the system SO42−/NH4+/H+/H2O/H2R, where H2R denotes the dicarboxylic acid considered, we use composition coordinates similar to those introduced by Amundson et al. [2006a]. The total species concentrations can be expressed in terms of the coordinates (NH4)2SO4/H2SO4/H2O/H2R for convenience:
where the concentrations and are subject to electroneutrality. We also define the organic fraction Y′ as
5.1. Sulfate/Ammonium/Dicarboxylic Acid Systems
 We present the construction of the phase diagrams at 298.15 K for systems composed of sulfate, ammonium, water and a dicarboxylic acid (H2R). Six dicarboxylic acids are considered and the corresponding phase diagrams are shown, respectively, in Figure 1 (oxalic acid), Figure 2 (glutaric acid), Figure 3 (malic acid), Figure 4 (malonic acid), Figure 5 (maleic acid), and Figure 6 (methyl succinic acid). As defined earlier, the abscissa X is the cation mole fraction arising from NH4+, with the remainder coming from H+. This can be considered as the degree of neutralization of the particle. The ordinate Y′ is the organic mole fraction arising from R2−, with the balance being made up of SO42−. The phase diagrams are therefore represented in the barycentric coordinates of H2SO4 (bottom left), (NH4)2SO4 (bottom right) and H2R (top). Three possible inorganic solid phases exist in the system SO42−/NH4+/H+/H2O/H2R. They are labeled as A through C: A denotes ammonium sulfate, (NH4)2SO4 (AS); B denotes letovicite, (NH4)3H(SO4)2 (LET); C denotes ammonium bisulfate, NH4HSO4 (AHS). In Figures 1–6, we assume that H2R(s) is the only organic solid that can occur in the system. As in the work by Clegg and Seinfeld [2006b], the limitations on the set of possible dicarboxylate solids treated in the system is a result of the lack of available thermodynamic data.
 The first salt to crystallize in system with high organic concentrations is H2R(s) in all cases. The threshold for the organic fraction that allows the organic salt to crystallize first depends on the system considered and of the ammonium fraction. For a low ammonium fraction, the organic salt is crystallizing, while for large ammonium fraction, the inorganic salts are still the ones that appear first at equilibrium. On each of these figures, horizontal cuts for a given organic fraction provide the same kind of results as those presented by Amundson et al. [2006a].
 For the sulfate/ammonium/water/succinic acid system, the succinate solids that can occur in the system at 298.15 K are H2Succ(s), NH4HSucc(s), and (NH4)2Succ · H2O(s). Figures 7 and 8 illustrate the phase diagrams of the system in the absence and presence of the two additional salts NH4HSucc(s), and (NH4)2Succ · H2O(s). The abscissa X and the ordinate Y′ are the same as before. The phase diagrams are represented in the barycentric coordinates of H2Succ (top left), (NH4)2Succ (top right), H2SO4 (bottom left), (NH4)2SO4 (bottom right). One can observe that the topology changes in the phase diagrams owing to the presence of the additional two salts. The addition of the two salts NH4HSucc(s), and (NH4)2Succ · H2O(s) does not alter the lower left part of the phase diagram. On the other hand, the influence of organic solids is clear for the upper right part. Therefore the incorporation of organic salts is crucial in the modeling of hygroscopicity properties as well as multistage growth of organic/inorganic mixtures.
 In Figures 1–8, regions outlined by heavy black lines show the first solid that reaches saturation with decreasing RH. The thin labeled solid lines are deliquescence relative humidity contours, and the dotted lines give the aqueous phase X-Y′ composition variation with decreasing relative humidity as more solid crystallizes. These so-called liquidus lines have been introduced by Potukuchi and Wexler .
 In order to validate the UHAERO model and observe the influence of the activity coefficient model, the ExUNIQUAC model described by Thomsen and Rasmussen  is used to replace the PSC model. The parameters for H2O, H+, NH4+, SO42− and HSO4− are taken from Thomsen and Rasmussen . In this work, volume and surface area parameters, r and q, for the organic ions R2− and HR− and parameters for the interaction between water and the organic ions R2− and HR− and between the organic ions R2− and HR− and the positive inorganic ions are assumed to be the same as those for inorganic components SO42− and HSO4−, respectively. The organic ions are assumed not to interact with each other, and the neutral organic components H2R interact only with water.
Figure 9 shows the phase diagram reconstructed with the ExUNIQUAC model for the sulfate/ammonium/glutaric acid system. Compared to the phase diagram reconstructed with the PSC model as illustrated in Figure 2, one can observe that the two phase diagrams have identical topological phase structures. Differences in the RH values at which the first salt crystallizes are mostly confined to the H2SO4 corner region of the phase diagrams.
 Efflorescence and hysteresis for mixtures of inorganic and organic species can be modeled with UHAERO in a similar fashion as in the work by Amundson et al. [2006a] for pure inorganic systems.
 Extensions of the model, in terms of hydrated salt compounds or crustal species as in the works by Fountoukis and Nenes  or Metzger and Lelieveld  can be considered in the future. To that extent, the limitations of the UHAERO framework are those of the activity coefficient model.
5.2. Computational Efficiency
 The UHAERO module can be run in two modes, depending on the circumstances of its application. The so-called “cold start” mode is used when no information on the system is available a priori. The system is therefore initialized as an infinitely dilute solution. The so-called “warm start” mode initializes the system with the convergent solution at a neighboring state. The latter case is the one relevant in a 3-D chemical transport model when using the convergent solution at the previous time step. The computational cost of the inorganic module has been discussed by Amundson et al. [2006b]. We present here results for the computational cost of UHAERO, with the PSC model for the activity coefficients of inorganic electrolytes and when the warm-start strategy is applied, for the reconstruction of the phase diagrams presented in section 5.1.
 The calculations are performed on a Linux PC equipped with Intel(R) Pentium(R) 4 3.20 GHz processor. The tolerance for stopping the iterations is set to 10−8, i.e., the residuals for both the mass balances and the liquid mass action laws are set to be less than 10−8 in absolute value.
 Let us consider first the case of fixed water content calculations. For the system involving a dicarboxylic acid, an average number of 3.5 Newton iterations per grid point is required for the convergence solution, with an average CPU time of 49.5 μs per Newton iteration. The computational time can be split into the activity coefficient calculations and the solution of the nonlinear system. The average CPU percentage per Newton iteration for activity coefficient calculations is 75.0%. For the system without dicarboxylic acids (i.e., the sulfate-ammonium-water system), an average number of 3.0 Newton iterations per grid point is needed for the convergence solution with an average CPU time of 24.7 μs per iteration. The average CPU percentage per Newton iteration for activity coefficient calculations is 64.3%. One can conclude that the addition of dicarboxylic acids does not increase the average number of iterations per grid point, but that each iteration is approximately twice as costly in terms of CPU times.
 Let us now compare the calculations with fixed RH. For the system involving a dicarboxylic acid, an average number of 3.7 Newton iterations per grid point is required for the convergence solution with an average CPU time of 71.7 μs per Newton iteration. The computation of the activity coefficients takes 71.2% of the total computational time. For the system without dicarboxylic acid (i.e., the sulfate-ammonium-water system), an average number of 3.3 Newton iterations per grid point is needed for the convergent solution with an average CPU time of 35.3 μs per iteration. The average CPU percentage per Newton iteration for activity coefficient calculations is 67.4%. Again, the addition of dicarboxylic acids does not increase the average number of iterations, but again each iteration is approximately twice as expensive in terms of CPU times.
 We can draw two conclusions. First, the computational effort required to calculate the equilibrium state in addition to the calculation of the activity coefficient is small (the major fraction of the time being the evaluation of the accurate model for the activity coefficients). Secondly, the additional computational effort to take into account the organic components with respect to the inorganic code presented by Amundson et al. [2006a] does not change the number of iterations but the cost of each iteration is increased.
 In the light of these results, the overall computational performance of UHAERO depends significantly on the efficiency and precision of the activity coefficient model. The computational time used for the evaluation of the activity coefficients could be reduced by considering simpler models.
 A new version of the phase equilibrium model for atmospheric aerosols for mixtures of inorganic electrolytes and organic compounds has been introduced. Modeling results are presented for the phase behavior in the sulfate/ammonium/water/dicarboxylic acid system, using the Pitzer-Simonson-Clegg (PSC) and UNIFAC activity coefficient models, together with a CSB approach for the modeling of interactions between inorganic electrolytes and organic dissociated components. Sensitivity analysis has been performed by using the ExUNIQUAC activity coefficient model in place of the PSC model for the inorganic compounds. The UHAERO code has been prepared so that it may be easily used as a computational framework by the community.
 This research has been supported by U.S. Environmental Protection Agency grant X-83234201. The authors thank S. L. Clegg for providing the data for the CSB model based activity coefficient calculation. The second author is partially supported by University of Houston new faculty grant I094138.