Does anybody know what tool(s) and process I would use to measure the volume of gas contained in something? For example - imagine I have a 3 liter bottle filled all the top with jellybeans, and the inside of the bottle is at regular atmospheric pressure. What tool would I use to measure how many millimeters of gas the bottle contains? Footnote: try not to get caught up in this exact example. The container can be anything, the solid matter inside the container can be anything, and the gas can be anything. I just want to know of the tool(s) and process part for returning the measurement.

Eh? You've just said you know the volume: 3 litres. (You don't measure volume in mm, obviously - I assume this was a typo). Or do you mean the volume left in the gaps left between the jelly beans? For that I would suggest calculating the volume of the jelly beans and then obtaining the volume of the gaps by difference. You could count or weigh the jelly beans and then, if you knew the density of jelly beans or the volume each jelly bean occupies, could work out the volume left in the gaps. You could get the volume of a jelly bean by Archimedes's method, viz. seeing how much liquid a known number of jelly beans displaces from a previously measured volume. Perhaps fill a cook's measuring jug to a set level, add a number of jelly beans and see how much the water level increases. If you weigh a number of jelly beans you will know the average weight of one. (Doing it by weight will save you the labour of counting all the jelly beans in the jar.). OK you have to sacrifice a few jelly beans by getting them wet, but it is all in the cause of science.

Meant milliliters. That was indeed a typo. And yes, measuring the total volume of gas contained in the gaps between the jellybeans.

OK. Anyway that's how I think I would do it. I can't immediately think of a method that does not sacrifice some jelly beans by exposing them to water.

Just out of curiosity, let’s move the goalpost slightly: Let’s say there are 10 trillion Jellybeans - or some other insane number that would make measurement of each one impossible. Maybe instead of jellybeans, the solid matter is coarse grit sand. How would you measure volume of gas? Or in the original 2.5 liter example, assuming you measured the volume of all the jellybeans, then wanted to empirically prove your gas calculation was correct, how would you do it? filling it with liquid and measuring displacement seems reasonable assuming the solid does not absorb any of it, or the gas is unable to escape for some reason (in a cavity for example).

To overcome problems with the liquid failing to penetrate tiny spaces, e.g. due to surface tension, you would need to use a pycnometer instead: https://en.wikipedia.org/wiki/Gas_pycnometer. This relies on the pressure change when two chambers with gases at different pressures are allowed to communicate. This should be able to measure all interstitial volumes apart from closed pores. But you won't have one of those in your sweet shop or kitchen - if you are a normal person.Please Register or Log in to view the hidden image!

My apologies, but you’re tossing around an unrelated tidbit of information without explaining how it ties into anything.

One issue with this is you would need to put a sample of your porous material, whether sand or jelly beans, into one chamber, use this to get a general value for the interstitial volume of the material as a % of the total volume or mass, and then apply it to specific cases like your sweet jar. So with a very lumpy material like jelly beans there would be an error, due to the fact that the alignment the jelly beans happen to take up in the jar might not be quite the same as in the sample in the pycnometer. But for a material with smaller "grains", the error would be less.