#include <cmath>
Go to the source code of this file.
Functions | |
double | pressure_correction (double pressure_mmhg=760.0) |
Approximates the effect of barometric pressure on dissolved oxygen (DO) solubility. More... | |
double | salinity_correction (double temperature_k, double salinity_ppt) |
Computes the salinity correction factor for dissolved oxygen solubility. More... | |
double | calculate_do_saturation_fresh (double temperature_k) |
Calculates the saturation concentration of dissolved oxygen in freshwater at 1 atm and 0 ppt salinity. More... | |
double | calculate_dissolved_oxygen_solubility (double temperature_celsius, double salinity_ppt, double pressure_mmhg=760.0) |
Calculates the dissolved oxygen (DO) solubility in mg/L, corrected for temperature, salinity, and pressure. More... | |
double | calculate_do_saturation_percent (double do_raw, double do_max) |
Calculates dissolved oxygen (DO) percent saturation. More... | |
double calculate_dissolved_oxygen_solubility | ( | double | temperature_celsius, |
double | salinity_ppt, | ||
double | pressure_mmhg = 760.0 |
||
) |
Calculates the dissolved oxygen (DO) solubility in mg/L, corrected for temperature, salinity, and pressure.
This function estimates the maximum amount of oxygen that water can hold under the given conditions. It uses the Weiss (1970) equation for DO saturation at 0 ppt salinity and 1 atm pressure, then applies salinity and pressure correction factors to reflect real-world conditions.
The result represents oxygen solubility at equilibrium with the atmosphere — useful for calculating % saturation or comparing measured DO values to environmental capacity.
temperature_celsius | Water temperature in degrees Celsius. |
salinity_ppt | Salinity in parts per thousand (ppt). |
pressure_mmhg | Barometric pressure in mmHg (default is standard: 760 mmHg). |
References:
Definition at line 98 of file dissolved_oxygen_compensation.h.
double calculate_do_saturation_fresh | ( | double | temperature_k | ) |
Calculates the saturation concentration of dissolved oxygen in freshwater at 1 atm and 0 ppt salinity.
This is based on the Benson & Krause (1984) equation recommended by USGS for high-accuracy DO solubility estimates. It returns the maximum possible DO (mg/L) at a given temperature in °C.
temperature_k | Water temperature in degrees Kelvin. |
Reference:
Definition at line 60 of file dissolved_oxygen_compensation.h.
double calculate_do_saturation_percent | ( | double | do_raw, |
double | do_max | ||
) |
Calculates dissolved oxygen (DO) percent saturation.
This function expresses the measured DO concentration as a percentage of the theoretical maximum solubility under current temperature, salinity, and pressure conditions.
Percent saturation >100% indicates supersaturation (e.g., from photosynthesis), while <100% indicates undersaturation (e.g., from respiration or pollution).
do_raw | Measured dissolved oxygen concentration in mg/L. |
do_max | DO solubility in mg/L under current environmental conditions. |
Definition at line 124 of file dissolved_oxygen_compensation.h.
double pressure_correction | ( | double | pressure_mmhg = 760.0 | ) |
Approximates the effect of barometric pressure on dissolved oxygen (DO) solubility.
This function applies a simple linear scaling based on the ratio of the measured pressure to standard sea-level pressure (760 mmHg). It is suitable for most field applications where high-precision correction is not required.
For more precise calculations, especially at high elevations or in scientific contexts, a more complex model accounting for non-ideal gas behavior, water vapor pressure, and oxygen mole fraction is available in equations (9)–(11) of the USGS WQ.2011.03 memo.
pressure_mmhg | Barometric pressure in mmHg (default: 760 mmHg). |
Reference:
Definition at line 20 of file dissolved_oxygen_compensation.h.
double salinity_correction | ( | double | temperature_k, |
double | salinity_ppt | ||
) |
Computes the salinity correction factor for dissolved oxygen solubility.
This factor adjusts the oxygen solubility downward based on increased salinity.
temperature_k | Water temperature in Kelvin. |
salinity_ppt | Salinity in parts per thousand (ppt). |
Reference: Garcia & Gordon (1992), also adopted by USGS:
Definition at line 34 of file dissolved_oxygen_compensation.h.