It is not possible to measure the volume directly, and unfortunately there is no such device as a volume sensor, however if you know the dimensions of the space filled with liquid, you can easily determine the volume.
You can measure the height of a liquid using a level sensor, which can be based on various technology types such as float, capacitive, inductive, ultrasonic, radar, pressure, etc…
Pressure measurement devices are used to measure level, because there is a linear relationship between liquid height and pressure. Once the liquid height is known, you can calculate the volume by including the other dimensions of the tank/vessel.
For many liquid storage applications the only dimension to be concerned about is the changing height of the liquid, since the other dimensions are fixed or can be determined mathematically such as in the case of a rectangular tank or a vertical cylinder tank.
In the case of a horizontal cylinder tank the other dimensions will change as the tank fills up, but they can be determined using trigonometry.
For irregular shaped tanks it is a little more complicated, and it is necessary to estimate the dimensions by extrapolation, or divide the tank into segments which are easier to profile.
Example Calculation
Converting a measured pressure of 130 mbar from a mixture of glycerol/water with a density of 1200 kg/m³ in a rectangular tank with base dimensions of 150cm x 250 cm to a volume in Litres.
The first step is to convert the density to specific gravity, and the pressure to a height dimension. A density of 1200 kg/m³ converts to a specific gravity (SG) of 1.2, and a liquid column of 100 mbar with an SG = 1, will have a height of 110.47cm.
Now that you know the liquid height in centimetres you can calculate the volume of liquid by multiplying it by the area of the base, 110.47cm x 1500cm x 250cm = 4142.6L.
DPT200 Pressurised Tank Level Differential Pressure Transmitter
Diesel Fuel Tank Level Sensors
18.605 G Low Cost Submersible Diesel Fuel and Water Tank Level Sensor
LMK387 Cleanable Sewage and Sludge Pressure/Level Sensor