 # (beta) Proper water properties calculator: Depth

Warning!
If you calculate water depth assuming constant water density and constant gravity acceleration, you do it in a wrong way.
Take a look at this simple water depth calculator to make you estimations more precise and accurate!

## 0. Brief description. Very basic theory.

Calculation of depth by a given hydrostatic pressure comes from a simple equation:

P = ρ · g · h

Where P is pressure, generated by the water column with height h and density ρ. The depth h can be estimated as follows:

h = (P - P0) / (ρ · g)

Where P0 - is the atmospheric pressure above the water surface.
But neither ρ nor g is constants. As well as the atmospheric pressure P0 - which in some cases can vary hourly.

Gravity constant g in the simple case is a function of geographic latitude. Since the Earth rotates around an axis going through north and south poles, the gravity force is lower on equator due to centrifugal forces and higher on poles.

To estimate the adequate value of gravity acceleration we can use the WGS84 gravity formula .
In real-world applications water density ρ is a function of water temperature t, salinity s and pressure P. Its value can be estimated according to the UNESCO equation.

## 1. Depth calculation: an easy way

In this simplified calculation of water properties, we consider:
- homogenous temperature and salinity in the whole water body;
- water as non-compressible fluid (ok, almost).

Table 1. Input values
Parameter Notation Value Range Units
Water temperature t -4 .. 40 °C
Atmosperic pressure P0 870 .. 1090 mBar
Hydrostatic pressure P 103 .. 106 mBar
Geographic latitude φ -90 .. 90 °
Water salinity s 0 .. 42 PSU

Table 2. Output values
Parameter Notation Value Units Description
Water density ρ

kg/m3 For the point with given P and t
Gravity acceleration g

m/s2 For the specified φ
Depth hswg

m For ρ=1023.6 kg/m3, g=9.80665 m/s2
Depth hsw

m For ρ=1023.6 kg/m3, g=g(φ)
Depth hfwg

m For ρ=998.02 kg/m3, g=9.80665 m/s2
Depth hfw

m For ρ=998.02 kg/m3, g=g(φ)
Depth hρP0

m ρ=ρ(t,P0,s), g=g(φ)
Depth hρP

m ρ=ρ(t,P,s), g=g(φ)
Depth hρPm

m ρ=ρm=ρ(t,(P+P0)/2,s), g=g(φ)

It this calculation we assume that hρPm is the most precise value. Since the density of water ρ depends on pressure P almost linearly, we try to take into account the compressibility of water by calculating water density for the midpoint ρm=ρ(t,(P+P0)/2,s).

## 2. Depth calculation: harder, but not a proper way

In this simplified calculation of water properties, we consider:
- homogenous temperature and salinity in the whole water body;
- water as compressible fluid.

To take into account the change of water density with the pressure we divide the pressure of the whole water column by Np parts, every lower part will have a higher density (and smaller height) than higher part due to compression of water. It means that to estimate the proper value of depth we should calculate the following sum:

h = (ΔP / g) · ∑ [1 / ρ(t, P0 + ΔPi), s]

Estimating the water density for all parts of the water column.

We use all parameters from the Table. 1 and adding only one extra parameter: number Np of pressure intervals:

Table 3. Input values
Parameter Notation Value Range Units
Number of pressure intervals Np 2 .. 99999

Table 4. Output values
Parameter Notation Value Units Description
Gravity acceleration g

m/s2 For the specified φ
Depth hρP0

m ρ=ρ(t,P0,s), g=g(φ)
Depth hρP

m ρ=ρ(t,P,s), g=g(φ)
Depth hρPm

m ρ=ρm=ρ(t,(P+P0)/2,s), g=g(φ)
Depth hρ

m h = (ΔP / g) · ∑ [1 / ρ(t, P0 + ΔPi), s], i=1..Np, g=g(φ)

It this calculation we assume that hρ is the most precise value.

## 3. Depth calculation: proper way

In this calculation of water properties, we consider:
- temperature and salinity vary with depth according to a given profile;
- water as compressible fluid.

To perform this calculation we take all the parameters from tables 1. and 3. Also, we need a measured temperature and salinity profile. TS-Profile is the number of measurements of temperature and salinity made in different depths.

Table 5. Input values
Parameter Notation Value Units
Number of points Ntsp
Z coordinate step Zs m

Estimated depth values
Notation Value Units Description
hts

m h = (ΔP / g) · ∑ [1 / ρ(t, P0 + ΔPi), s], i=1..Np, g=g(φ), t=t(z), s=s(z)

This calculator is made with UCNLPhysics free and open source library.

Back to Online Utilities page
(C) Alek Dikarev, 2020
For bug reports, suggestions and questions, please feel free to reach me