Say you have water and oil in tank....Is there any thing out there that can tell me how much water is in the tank and how much oil is in the tank???
Since water will eventually separate from the oil if the fluid in the tank is kept still, then it is easy to use ultrasonic sensor.
E.g. You have a tank, that has water and oil already separated after some amount of time:
| | | water | |__________| | | | oil | |__________|
In this case You'd clearly see a reflection of sound wave from the conjunction of water and oil. Knowing the speed of sound in the oil and water You can measure the height and finally find the numbers You need.