Dissolved Gases and Gas Exchange
For a general introduction to water chemistry, see Chemistry.
Why Gas Exchange Is the Ecosystem's Lifeline
In a sealed jar, the only way to replenish dissolved oxygen when biology consumes it faster than photosynthesis produces it is to pull O₂ back from the headspace — and the headspace is finite. Gas exchange across the water surface is the lifeline that connects the dissolved world where organisms live to the gas reservoir above. How fast gases cross that interface, whether the system is sealed or open to the atmosphere, and how large the headspace is relative to the water volume all determine whether the ecosystem can survive a bad night or a bacterial bloom.
CO₂ moves through the same interface in the opposite direction, linking gas exchange to pH. When respiration loads the water with CO₂ faster than it escapes to the headspace, pH drops. When photosynthesis strips CO₂ from the water faster than the headspace can resupply it, pH rises. The rate of gas exchange sets the speed limit on both of these corrections — a system with fast exchange dampens pH and O₂ swings; a sealed system with slow exchange amplifies them.
Three Gases, Two Compartments
The model tracks three gases that move across the water surface: oxygen, carbon dioxide, and ammonia. Each exists in two places:
- Dissolved in the water — oxygen lives in the water as dissolved O₂. CO₂ is carried as part of the dissolved inorganic carbon (DIC) pool, and dissolved ammonia (NH₃) is part of the total ammonia pool, since it is in fast equilibrium with the ammonium ion (NH₄⁺).
- In the headspace — the gas volume above the water, like the air pocket in a sealed jar. Oxygen, CO₂, and ammonia in this gas phase are each tracked separately.
Gases continuously move between these two compartments. The direction and rate depend on whether the water is over-saturated or under-saturated relative to the gas pressure in the headspace above it.
Henry's Law: How Much Gas Dissolves
Henry's law is the fundamental principle governing gas solubility. At equilibrium, the concentration of a gas dissolved in water is proportional to the partial pressure of that gas in the air above it. The proportionality constant — the Henry's-law constant — is different for every gas and depends on conditions.
The differences between gases are large and they matter. CO₂ is roughly twenty-six times more soluble than O₂, and ammonia is extraordinarily soluble — tens of thousands of times more soluble than oxygen. This last fact is why, under normal conditions, almost all ammonia stays dissolved in the water rather than escaping to the air. Two corrections shift these solubilities during a run:
- Temperature. All gases become less soluble as the water warms — warm water simply holds less dissolved gas. This is why a heated tank sits closer to the edge of an oxygen crisis than a cool one at the same biological load.
- Salinity. Dissolved salt also reduces gas solubility, an effect known as salting out. It is modest in freshwater and becomes significant only in brackish or marine water.
Both corrections are applied automatically as temperature and salinity change. The exact Henry's-law constants and the temperature and salinity coefficients are tabulated in the Parameter Reference.
O₂ Saturation
Oxygen saturation — the dissolved O₂ concentration the water settles to when it is in equilibrium with the atmosphere — is computed from the standard oceanographic formula of Garcia & Gordon (1992), which accounts for both temperature and salinity. A few useful anchor points:
- Cool to room-temperature freshwater holds roughly 8 to 9 mg/L of dissolved oxygen at saturation (about 8.3 mg/L at 25 °C).
- Full-strength seawater holds only about 80% of that (around 6.8 mg/L at 25 °C), because dissolved salt squeezes oxygen out.
These are the ceilings the water is pulled toward by gas exchange. For context, most aquatic animals begin to struggle once dissolved oxygen falls below about 2–3 mg/L — the threshold of hypoxia — so the gap between a saturated 8 mg/L and a stressed 2 mg/L is the entire margin a tank has to work with overnight.
Gas Exchange: Moving Between Water and Headspace
Gas exchange is the process by which oxygen, CO₂, and ammonia move between the water and the headspace. The logic is the same for each gas:
- Find the headspace pressure. The headspace is treated as an ideal gas, so the partial pressure of each gas follows directly from how many moles of it are in the headspace, the temperature, and the headspace volume.
- Find the equilibrium dissolved concentration. Henry's law gives the dissolved concentration the water would reach if it were in perfect equilibrium with that headspace pressure.
- Measure the departure from equilibrium. The gap between that target concentration and the water's actual current concentration is the driving force for transfer.
- Apply the transfer rate. The gas flux is that driving force multiplied by a transfer coefficient and the water volume. The transfer coefficient — the kLa — accounts for how readily molecules cross the thin films at the surface. Scenarios specify a single value for oxygen; the coefficients for CO₂ and ammonia are derived from it automatically. A higher coefficient means faster equilibration.
When gas moves into the water it is added to the dissolved pool and removed from the headspace; when it leaves, the reverse happens. This is a zero-sum transfer — no gas is created or destroyed, only moved.
CO₂ exchange: only the dissolved-CO₂ fraction can leave
There is an important subtlety for CO₂. The DIC pool holds three chemical forms: dissolved CO₂, bicarbonate, and carbonate. Only dissolved CO₂ can actually cross the water–air interface — bicarbonate and carbonate are charged ions and cannot evaporate into the gas phase.
So before exchanging CO₂, the model first works out how much of the DIC is currently in the dissolved-CO₂ form, using the carbonate speciation (which depends on pH and alkalinity). Only that fraction participates. The practical consequence is that at high pH — where almost none of the DIC is dissolved CO₂ — CO₂ exchange slows dramatically even when total DIC is high. A high-pH planted tank can be carbon-starved despite a large carbon reservoir, simply because so little of it is in the form that crosses the surface.
Ammonia exchange: pH-dependent volatilization
Ammonia adds a third gas to the system, and unlike oxygen and CO₂ the amount available to exchange depends strongly on pH. At low pH nearly all dissolved nitrogen is locked up as the ammonium ion, which cannot leave the water. At high pH a larger fraction exists as free dissolved ammonia, which can escape to the headspace. The split between the two is governed by an acid–base equilibrium with a balance point near pH 9.25 at 25 °C, so the toxic, volatile ammonia fraction climbs steeply as the water turns alkaline.
In most freshwater tanks ammonia volatilization is a minor flux, for three compounding reasons:
- Ammonia is so soluble that the air side of the interface, not the water side, becomes the bottleneck — slowing the overall transfer by roughly an order of magnitude (see the two-film model below).
- At typical freshwater pH (7–8) only a few percent of total ammonia is in the volatile form at all.
- In a sealed system the small headspace quickly equilibrates with the trace of ammonia in the water, after which there is no net loss.
In high-pH systems (above 9) or open systems that continually vent ammonia, though, volatilization can become a meaningful nitrogen-loss pathway. When ammonia crosses the surface it also shifts alkalinity: each unit entering the water raises alkalinity by one equivalent, and each unit leaving lowers it.
The Two-Film Model
When a gas molecule crosses the water–air interface it has to diffuse through two thin, stagnant boundary layers: a liquid film on the water side and a gas film on the air side. The bulk water and bulk air on either side are well mixed, so the bottleneck is always one or both of these films. This is the two-film model (Whitman 1923; Liss & Slater 1974), and the overall resistance to transfer is simply the two film resistances added together. Which one dominates depends on how soluble the gas is:
| Gas | Where its molecules sit at equilibrium | Limiting film | Net effect on transfer |
|---|---|---|---|
| Oxygen, CO₂ (sparingly soluble) | mostly in the gas phase | the liquid film | the gas film barely matters — a liquid-side-only treatment is accurate |
| Ammonia (extremely soluble) | almost entirely in the liquid | the gas film | the stagnant air layer is a severe bottleneck — overall transfer is roughly fifteen times slower than a liquid-side-only estimate |
For oxygen and CO₂ the gas film is so transparent that the surface transfer is governed almost entirely by the water side — which is why simple models that track only the liquid side work well for them. For ammonia the opposite is true: there is so little of it in the gas phase that there is almost no concentration gradient to push it through the stagnant air layer, and the gas-phase resistance ends up dominating. The model derives each gas's water-side transfer coefficient from the user-specified oxygen value (scaling by the relative diffusivity of each gas in water), then applies the two-film correction; the correction is negligible for oxygen and CO₂ and large for ammonia. The exact scaling factors live in the Parameter Reference.
Floating mats suffocate the surface. When floating plants — Salvinia, duckweed, and the like — cover the water, the wind-driven and convective turbulence that normally renews the surface is suppressed, and gas exchange slows across the board. The model multiplies the surface transfer by a blocking factor that depends on how much of the surface is covered and on each plant's physical mat structure (Salvinia's hairy, layered mat is more porous than duckweed's flat single layer). This is why a tank smothered in duckweed can suffocate at night even when healthy submerged plants are growing below it — the lifeline is simply throttled. The mechanism and per-species values are described under Air–water gas exchange suppression in the macrophytes page.
The Headspace
The headspace — the air volume above the water — is modeled as an ideal gas. Its volume is set in the scenario, its contents are tracked as oxygen, CO₂, and ammonia, and its partial pressures follow from those amounts together with temperature and volume.
The headspace acts as a gas reservoir that buffers the water against the day/night cycle. When daytime photosynthesis produces oxygen faster than respiration burns it, the excess dissolves and then transfers up into the headspace. At night, when respiration dominates, that oxygen flows back down into the water. The headspace therefore smooths dissolved-gas swings that would otherwise be far more violent — but only up to the limit of how much gas it can hold.
Sealed, Semi-Sealed, and Open Systems
The model spans a continuum from a perfectly sealed jar to a fully open surface, set by how quickly the headspace exchanges with the outside air.
Sealed systems
With no leak at all, the system is completely closed. No gas enters or leaves from outside, and the total amount of each gas (dissolved plus headspace) is strictly conserved — it can only be shuffled between water and headspace, or transformed by biology through photosynthesis and respiration.
This is the mode for simulating sealed-jar ecosystems, and it carries an important practical lesson: if you see dissolved O₂ declining, the system is not necessarily losing oxygen. The oxygen may simply have moved into the headspace. To know whether there is a true deficit you have to check total system oxygen — water plus headspace — not the dissolved concentration alone.
Semi-sealed systems
With a slow leak, the headspace still behaves as a finite reservoir but gradually relaxes toward the composition of the outside air. The model nudges each headspace gas toward its atmospheric level — about 21% oxygen, roughly 400 ppm CO₂, and effectively zero ammonia — at a rate set by the leak. A faster leak means faster relaxation. This represents an imperfect seal or intentional slow venting: mostly closed, but quietly exchanging with the room. Because the leak carries ammonia away too, any that accumulates in the headspace is slowly lost to the atmosphere, making volatilization a real nitrogen-loss pathway.
Open-top systems
Once the leak is fast enough that the air above the water turns over in a couple of hours, the headspace is indistinguishable from the open room, and the model treats the system as fully open: dissolved gases equilibrate directly with atmospheric levels rather than with a finite buffer.
An open top cannot build up or deplete headspace gases, so it is far more forgiving of biological imbalance — excess CO₂ from respiration simply vents away, and oxygen is continuously replenished from the air. The trade-offs are that volatile ammonia is lost to the room (a nitrogen drain), and CO₂ is held near atmospheric levels rather than being allowed to accumulate, which can limit photosynthesis in carbon-hungry planted tanks.
Choosing a System Mode
These three modes represent a spectrum of ecological risk and resilience. A sealed system is the most demanding: every molecule of oxygen must be produced internally, every molecule of CO₂ must be consumed internally, and the headspace is a finite buffer that can run out. A semi-sealed system buys time by slowly exchanging with the atmosphere, softening the consequences of temporary imbalances. An open system is the most forgiving — it can always pull oxygen from the air and vent excess CO₂ — but it leaks volatile nitrogen as ammonia, making a closed nutrient budget harder to maintain. The choice of mode is one of the most consequential decisions in scenario design, because it sets how much margin the biology has before chemistry turns hostile.
| Sealed | Semi-sealed | Open-top | |
|---|---|---|---|
| Oxygen supply | internal only | mostly internal, slow top-up | continuous from air |
| CO₂ behavior | free to build up or crash | slowly anchored | held near atmospheric |
| Nitrogen budget | fully closed | slow ammonia loss | ongoing ammonia loss |
| pH swings | largest | moderate | most damped |
| Forgiveness of imbalance | least | moderate | most |
Why Gas Exchange Matters
- In sealed systems, gas exchange is how the water "breathes." By day, photosynthesis makes oxygen and consumes CO₂; the surplus oxygen moves to the headspace and CO₂ moves down into the water. At night the flow reverses. Without this exchange, dissolved oxygen would spike each afternoon and crash each night.
- pH regulation. Because CO₂ exchange changes how much DIC the water holds, it directly moves pH. In an open system, exchange with the atmosphere acts as a pH anchor; in a sealed system, pH is free to drift with the biology.
- Long-term oxygen balance. Gas exchange only redistributes oxygen between water and headspace — it cannot create it. In a sealed system, if respiration outpaces photosynthesis over a full 24-hour cycle, total oxygen declines with no way to recover it. This is why the 24-hour balance of production against consumption is the decisive question for sealed-ecosystem survival.
- Connecting to the outside world. In open or leaky systems, the headspace leak is the doorway to the atmosphere — the route by which oxygen is replenished and excess CO₂ vented, and what makes these systems more forgiving of biological imbalance.
Further Reading
- The Carbonate System — how dissolved CO₂ participates in acid–base equilibria and determines pH
- Oxygen Cycle — the per-process oxygen budget (production vs. consumption)
- Carbon Cycle — the complete carbon budget, including gas exchange
- Stability and Failure — how an oxygen collapse cascades into ecosystem failure
- Parameter Reference — the Henry's-law constants, transfer coefficients, and scaling factors behind this page, with citations
Key references
- Garcia, H.E. & Gordon, L.I. (1992). Oxygen solubility in seawater: better fitting equations. Limnology and Oceanography 37, 1307–1312.
- Liss, P.S. & Slater, P.G. (1974). Flux of gases across the air–sea interface. Nature 247, 181–184.
- Sander, R. (2015). Compilation of Henry's law constants for water as solvent. Atmospheric Chemistry and Physics 15, 4399–4981.
- Wanninkhof, R. (1992). Relationship between wind speed and gas exchange over the ocean. Journal of Geophysical Research 97(C5), 7373–7382.
- Weiss, R.F. (1974). Carbon dioxide in water and seawater: the solubility of a non-ideal gas. Marine Chemistry 2, 203–215.
- Whitman, W.G. (1923). The two-film theory of gas absorption. Chemical and Metallurgical Engineering 29, 146–148.
- Cussler, E.L. (2009). Diffusion: Mass Transfer in Fluid Systems, 3rd ed. Cambridge University Press.