Water Chemistry Overview
Water in an aquatic ecosystem is much more than just H2O. It is a soup of dissolved substances -- gases, minerals, acids, and nutrients -- that together create the chemical environment organisms live in. The model tracks these dissolved substances and simulates how they change over time as biology and physics interact.
pH: The Acidity Scale
pH is a number (roughly 0 to 14) that describes how acidic or alkaline (basic) the water is. A pH of 7 is neutral, lower numbers are acidic, and higher numbers are alkaline.
Why it matters: Most aquatic organisms can only survive within a certain pH range, typically around 6.5 to 9.0. Outside that range, their biology starts to break down. pH also controls the balance between ammonia (toxic) and ammonium (mostly harmless) in the water -- at high pH, more of the nitrogen exists as toxic unionized ammonia, which can harm or kill animals.
What drives pH in the model: pH is not set directly. Instead, it emerges from the balance of three things:
- CO2 in the water. When CO2 dissolves, it makes the water more acidic (lower pH). Photosynthesis removes CO2, pushing pH up. Respiration adds CO2, pushing pH down.
- Alkalinity. This is the water's built-in buffering capacity -- its ability to absorb acids without the pH changing much. Higher alkalinity means more stable pH.
- Biological activity. Different biological processes (nutrient uptake, nitrification, decomposition) release or consume charged molecules that shift the acid-base balance.
The model recalculates pH at every time step based on the current state of these factors.
Dissolved Gases: O2 and CO2
The model tracks three dissolved gases: oxygen (O2), carbon dioxide (CO2), and ammonia (NH3). Each exists in two places at once:
- Dissolved in the water, where organisms use them directly.
- In the headspace, the pocket of air above the water surface (like the air gap in a sealed jar).
Gases move back and forth between the water and headspace. If the water has more dissolved O2 than the headspace "wants" to supply (based on the gas pressure above), O2 leaves the water. If it has less, O2 enters the water. The same logic applies to CO2 and NH3. This process is called gas exchange, and it is driven by Henry's law -- a principle that says at equilibrium, the amount of gas dissolved in water is proportional to the partial pressure of the gas above the water.
For NH3, the amount available for gas exchange depends on pH: at high pH, more of the dissolved ammonia is in the volatile NH3 form rather than the non-volatile NH4+ form, so the rate of NH3 volatilization increases with pH.
In a sealed system, the total amount of O2 (water + headspace combined) is conserved. It just moves between the two compartments. The same applies to total CO2/DIC and total NH3/NH4. In an open or leaky system, the headspace slowly relaxes toward normal atmospheric composition, connecting the jar to the outside world.
The Carbonate System
When CO2 dissolves in water, it does not just stay as CO2. It reacts with water and exists as a mixture of three chemical forms:
- CO2(aq) -- dissolved CO2 gas
- Bicarbonate (HCO3-) -- the most common form at typical water pH
- Carbonate (CO3--) -- dominant only at high pH
The total of all three forms is called dissolved inorganic carbon (DIC). The balance between them shifts with pH: acidic water has more CO2, neutral water has mostly bicarbonate, and alkaline water has more carbonate.
This matters because only the CO2(aq) form can cross the water-air boundary during gas exchange. The bicarbonate and carbonate stay locked in the water. So even though DIC might be plentiful, the amount of CO2 available for gas exchange (or for some organisms to use) depends on the pH-driven speciation.
The carbonate system is also what connects DIC to pH. The model uses the carbonate equilibrium equations to calculate pH from the current DIC and alkalinity at every time step.
Alkalinity: The pH Buffer
Alkalinity measures the water's capacity to neutralize acids. Think of it as the water's "shock absorber" for pH. Water with high alkalinity can absorb a lot of acid (from respiration, decomposition, nitrification) without its pH changing much. Water with low alkalinity is fragile -- small changes in CO2 can cause big pH swings.
In the model, alkalinity is tracked as a conserved quantity (in equivalents per liter) that changes when biology moves charged species around. This is governed by the charge balance principle. The major biological processes that change alkalinity are:
| Process | Effect on alkalinity | Why |
|---|---|---|
| Algae take up NH4+ | Decreases (−1 eq per mol N) | Removing a cation from solution |
| Algae take up NO3− | Increases (+1 eq per mol N) | Removing an anion from solution |
| Nitrification (NH4+ → NO3−) | Decreases (−2 eq per mol N) | Net production of H+ ions |
| Decomposition releases NH4+ | Increases (+1 eq per mol N) | Adding a cation to solution |
| CaCO₃ shell building | Decreases (−2 eq per mol Ca) | Removing Ca²⁺ and CO₃²⁻ |
| CaCO₃ dissolution | Increases (+2 eq per mol Ca) | Releasing Ca²⁺ and CO₃²⁻ |
Alkalinity does not change when CO2 is added or removed from the water (photosynthesis and respiration move CO2 but do not move charge). This is a subtle but important point: photosynthesis changes pH by changing DIC, not by changing alkalinity. The pH swing from photosynthesis depends on how much buffering capacity (alkalinity) the water has to resist the change.
The default alkalinity of 2.5 mmol/L (5 meq/L) represents moderately buffered freshwater. Below about 1 mmol/L, pH becomes dangerously volatile -- a midday photosynthesis burst can push pH above 9.0, and nighttime respiration can drop it below 6.5 in the same 24-hour cycle.
How Biology Drives Chemistry: A Worked Example
To see how all these pieces connect, consider what happens during a single diurnal cycle in a small jar with algae, grazers, and nitrifying bacteria:
During the day (lights on): Algae photosynthesize vigorously, pulling dissolved CO2 out of the water. As CO2 drops, the carbonate equilibrium shifts -- bicarbonate converts to CO2 to replace what the algae consumed, and pH rises as a result. If the algae are using ammonium as their nitrogen source, alkalinity decreases slightly with each unit of NH4+ absorbed, weakening the buffer. Meanwhile, nitrifying bacteria are converting more ammonium to nitrate, consuming oxygen and further decreasing alkalinity. By mid-afternoon, pH might reach 8.5 or higher. At pH 8.5, about 10% of the remaining ammonia is in the toxic NH3 form -- five times the fraction at pH 7.5.
At night (lights off): Photosynthesis stops. Everything keeps respiring -- algae, grazers, bacteria -- adding CO2 back to the water. pH falls as DIC rises. Oxygen drops because no new O2 is being produced. By early morning, pH might be back down to 7.2, oxygen is at its daily minimum, and the ammonia toxicity risk has passed (only 1% NH3 at pH 7.2).
The critical balance: Whether pH trends upward or downward over multiple days depends on whether daytime CO2 removal (by photosynthesis) outpaces nighttime CO2 addition (by respiration and decomposition). In a system with very dense algae and short nights, pH drifts upward. In a system with heavy decomposition and long nights, it drifts downward. Alkalinity determines how large the daily pH swing is for a given amount of CO2 change -- high alkalinity dampens the swing, low alkalinity amplifies it.
This example also illustrates why chemistry, biology, and gas exchange cannot be understood in isolation. The algae affect the CO2, which affects the pH, which affects the ammonia toxicity, which affects the grazers, which affects the algae. Every piece feeds back into the others.
Further Reading
- The Carbonate System -- detailed treatment of DIC speciation, pH calculation, and biological effects on alkalinity
- Dissolved Gases and Gas Exchange -- detailed treatment of O2 and CO2 dynamics, Henry's law, headspace modeling, and sealed vs. open systems