Java Security Settings:
      This web page employs Java, which requires specific security settings for correct operation.
      If the applets on this page do not run correctly, consult the Virtual Chemistry Experiments FAQ
      or the Physlet Physics web site for establishing the correct security settings.

Dissolution of Calcium Carbonate in Air-Saturated Water

This page illustrates the use of the Equilibria package and the ChemEquilibria applet in solving equilibrium problems.

Each instance of the ChemEquilibria applet (a web page may contain multiple applets) describes a chemical system. The chemical system has several properties (e.g., temperature) and contains one or more phases. Each phase contains one or more chemical species (the same chemical species can exist in multiple phases). Each chemical species is described by a charge and a formula weight. A reaction consists of a set of chemical species with associated stoichiometric coefficients and an equilibrium constant. Once the chemical system is defined, the equilibrium problem may be solved and the equilibrium concentrations and partial pressures may be retrieved.

In the Equilibria package, each chemical system, phase, chemical species, and reaction is an object with various properties and methods. The ChemEquilibria applet provides an interface to these objects, properties, and methods based upon strings, which are conveniently programmed using JavaScript within a web page. Each object such as a phase or a reaction is given a descriptive label, which is used to identify and access that object.

To illustrate the use of this software, consider the dissolution of solid calcium carbonate in pure water in contact with the atmosphere, which contains 390 ppm carbon dioxide. In solving any equilibrium problem, one must (1) identify all chemical species involved in the problem, (2) identify the analytical amounts of each species, and (3) write all relevant chemical reactions involving these species.

Step 1. Define all Chemical Species

Use the createChemSpecies method to create the following chemical species:

Chemical Species Label Charge Formula Weight Ion-Size Parameter
calcium carbonate CaCO3 0 100.087 --
calcium ion Ca+2 +2 40.087 6.0
carbonic acid H2CO3 0 62.025 --
hydrogen carbonate ion HCO3- -1 61.017 4.5
carbonate ion CO3-2 -2 60.009 4.5
carbon dioxide CO2 0 44.010 --

The ion-size parameter is used in the extended Debye-Huckel equation to calculate the activity coefficient of a solute. The hydrogen ion (H+), hydroxide ion (OH-), and water (H2O) are automatically created by ChemEquilibria. In this example, carbonic acid represents the sum of both carbonic acid itself and dissolved carbon dioxide, as is the usual practice. If one desired, the equilibrium between dissolved carbon dioxide and carbonic acid could be explicitly modeled.

The chemical species are simply a description of a basic chemical entity and do not actually exist in the chemical system until they are explicitly added. A chemical species is always part of a specific phase; thus it is necessary to first create the phase and then add the species to the phase.

The relevant JavaScript code to create these chemical species is listed below. Note that the ChemEquilibria applet is given the name "chemEquilibria" in the APPLET tag.


A useful feature of the ChemEquilibria applet is the ability to read a text file that defines chemical species. (See the loadLibrary method for ChemEquilibria in the documentation.) Such files are easy to create (one such file is inorganic.library, which defines various inorganic species).

Step 2. Create the Phases

Phases are created using the appropriate create method. This chemical system has three phases: solid calcium carbonate, an aqueous phase, and a gas phase. The following instructions can be used to create these phases.


In the createSolidPhase method, the first label is the name of the phase, the second label is the name of the chemical species that makes up the solid, and the third value is the analytical moles. It is important that an excess of calcium carbonate be present, or the solubility reaction (yet to be defined) will not be at equilibrium and it will not be possible to solve the equilibrium problem.

In the createAqueousPhase method, the label is the label of the aqueous phase and the second term is the volume of the aqueous solution in liters. This method automatically sets the analytical amount of water, adds the hydrogen and hydroxide ions to the solution, and defines the autodissociation reaction.

In the createGasPhase method, the label is the label of the gas phase and the second term is the volume of the phase in liters. At this point, no species have been added to the gas phase, so it is essentially a vacuum. This hypothetical chemical system will not significantly deplete carbon dioxide from the atmosphere, thus we set the system to be isobaric at 0.000390 atm (390 ppm) of pure carbon dioxide (to be added in the next step) and make sure the volume of the gas phase is sufficiently large that the carbon dioxide will not be completely consumed. It would also be perfectly acceptable to create nitrogen and oxygen species and add those to the gas and set the pressure at 1 atm. Note that the setPressure and setIsIsobaric instructions may be omitted if these values are properly set by the PARAM options in the APPLET tag.

Step 3. Add the Species to the Phases

It is now necessary to add the appropriate analytical amount of each species to the appropriate phase. The calcium carbonate solid has already been correctly defined, as have the water, hydrogen ion, and hydroxide ion species in the aqueous solution. The carbon dioxide must also be added to the gas phase. The following instructions perform this step.

document.chemEquilibria.addSpecies("CO2","g", 0.014714);

The first four instructions add species to the aqueous phase. Because the water is initially pure, the analytical amount of each species is zero. The 0.014714 moles of carbon dioxide will produce a partial pressure of 0.000390 atm when it expands to occupy 1000.0 liters are 298.15 K. Regardless of the amount of carbon dioxide specified, the volume of the gas phase will shrink or expand until the target system pressure of 0.000390 atm is reached, because the isIsobaric property is true.

Step 4. Define the Chemical Reactions

Now that all chemical species and phases have been created, it is time to define the chemical reactions. The reactions are defined by submitting a string containing the chemical equation. " = " represents the equilibrium arrows. Species on the same side of the equilibrium arrows are separated by " + ".

document.chemEquilibria.addReaction("solubility","CaCO3 (s) = Ca+2 (aq) + CO3-2 (aq)", 4.5E-9);
document.chemEquilibria.addReaction("first acid dissociation step","H2CO3 (aq) = H+ (aq) + HCO3- (aq)", 4.45E-7);
document.chemEquilibria.addReaction("second acid dissociation step","HCO3- (aq) = H+ (aq) + CO3-2 (aq)", 4.69E-11);
document.chemEquilibria.addReaction("carbon dioxide dissolution", "CO2 (g) + H2O (aq) = H2CO3 (aq)", 0.0344);

Bear in mind that the autodissociation reaction for water was automatically created when the aqueous phase was create; thus there is no need to create that reaction at this point. Note that each reaction also has a descriptive label.

It is good practice to explicitly include the phase, using the exact phase label used in the creation of the phase, but this is not strictly necessary. It is only necessary if the same chemical species exists in more than one phase.

The software checks to make sure each reaction is balanced with respect to charge, but there is no way to check whether the atoms are balanced, because the labels do not necessarily contain the molecular formula. Thus the equation "CO2 (g) + H2O (aq) = H2CO3 (aq)" could be replaced with "CO2 (g) = H2CO3 (aq)". The only difference is that the first reaction will consume some of the water in the aqueous solution while the second will not. Because the amount of water consumed is negligible, the same results are obtained in both cases.

Notice that the last reaction specifies "H2O (aq)". This notation is different from the usual chemical notation and does not indicate that water is a solute rather than a pure liquid (essentially). When defining chemical reactions for this software, the phase is the label that defines the phase and is not a physical state. Thus the water is in the phase named "aq" and thus "H2O (aq)" must be used rather than "H2O (l)", because there is no phase named "l".

Step 5. Solve the Equilibrium Problem

Before solving the equilibrium problem, one must decide whether the system behaves ideally or not. In this calculation, nonideal behavior will be assumed. (It is not necessary to explicitly change this setting, if it is correctly set in the PARAM option in the APPLET tag.)

var solveState = document.chemEquilibria.solve();

The solve method first parses the chemical system to ensure certain types of errors do not exist. The problem is then solved. The solve method returns true if the solution was obtained and false if no solution was found. In the event no solution was found, check the Java console for information on the nature of the problem.

Step 6. Access Equilibrium Properties

After the problem has been solved, the equilibrium properties of the various chemical species and phases can be obtained using the appropriate method. Examples are shown below. Concentrations are molar concentrations, but these values have been scaled to mmole/L for easy of reading.

JavaScript Code Results
[Ca+2] = mM
[H2CO3] = mM
[HCO3-] = mM
[CO3-2] = mM
[H+] = mM
[OH-] = mM
Partial Pressure of CO2 = torr
pH =
pOH =
Ionic Strength = M
Volume of Gas = L
Mass of Calcium Carbonate = g

Dissolution.html version 2.1
© 2001-2014 David N. Blauch