Disclaimer: I'm not in any shape used to deal with physics and forgive me in advance if this question is either out of scope of wrongly formulated.
I have a very practical problem. I have a container that contains a liquid which is under pressure (the air above the liquid, inside the container, is under pressure). I also have a sensor inside the container that tells me, with very high frequency and precision, what is the current pressure of the air.
Now, imagine this container has a valve through which the liquid is expelled. Considering that there is no extra air being pumped into the container, I can perfectly observe the pressure dropping over time, by reviewing the data provided by the pressure sensor.
My question is: how can I compute the volume of liquid that was expelled by only looking at the pressure over time? I have naively assumed that I could just compute the upper integral of the pressure/time curve during the period the valve was open. Is this remotely near a correct answer?
EDIT: Actually what I am looking for is the flow-rate of the liquid that was expelled, not the volume per se.
EDIT 2: To elaborate better on the problem I've compiled the pictures/diagrams bellow.
The first image depicts the environment as I tried to describe above, hope it makes it clear.
The second image depicts a sample of readings from the pressure sensor during one opening of the valve. As you can tell it is clear that the pressure drops, my hope is that the rate (slope?) of the drop could indicate the flow rate of the expelled liquid.
Best,