How to calculate the mass of gas in a tank?

In summary, to calculate the mass of gas in a tank, first measure the volume of gas in the tank. Next, determine the gas's density, which can vary with temperature and pressure. Finally, use the formula: mass = volume × density. Ensure that all measurements are in compatible units to obtain an accurate mass value.
  • #36
Leopold89 said:
No. What I mean is that I could for example measure a temperature of 25°C with a pressure of 10bar, then 26°C with a pressure of 8bar, 24°C with 4bar, 25°C with 2bar and so on. So what I mean is that my measurements may not be close to the line I calculated in post #32.
Is this what you are measuring inside the tank?
 
Science news on Phys.org
  • #37
Somwhat yes. I have also included a plot of my data of one gas tank.

Edit: I think I understand now. The integrated curve is the same as the p-T-curve in the phase diagrams, so once I am above or below it, the model has to change between a pure liquid, a liquid-vapour mixture and a pure vapour/gas, right?
 

Attachments

  • temp_pressure_pairs2.png
    temp_pressure_pairs2.png
    9.7 KB · Views: 10
  • #38
Leopold89 said:
Somwhat yes. I have also included a plot of my data of one gas tank.

Edit: I think I understand now. The integrated curve is the same as the p-T-curve in the phase diagrams, so once I am above or below it, the model has to change between a pure liquid, a liquid-vapour mixture and a pure vapour/gas, right?
Yes.
 
  • #39
I am afraid I still don't understand. I attached here a mass plot of a tank with only vapour content. I used the ideal gas equation corrected for van der Waals forces, but not the thermal inertia. Now what we see is a contradiction with the experiment: You can only release gas, not introduce it other by replacing the whole tank, what did not happen during this measurement.
 

Attachments

  • crazy_mass.png
    crazy_mass.png
    9.1 KB · Views: 10
  • #40
The first law open system equation for introducing gas is different from the equation we used for removing gas. It should read $$dU=h_{out}dm$$ where ##h_{out}## is the enthalpy of the gas outside the valve.
 
  • #41
Chestermiller said:
The first law open system equation for introducing gas is different from the equation we used for removing gas. It should read $$dU=h_{out}dm$$ where ##h_{out}## is the enthalpy of the gas outside the valve.
But I am not introducing gas, only releasing.
 
  • #42
Leopold89 said:
But I am not introducing gas, only releasing.
So the temperature rises because of heat flow from the surroundings?
 
  • #43
The (room) temperature is the same as in post #3, so the temperature change is slower than the oscillation in the mass. The pressure data shows these weird peaks and only for this one gas (##\mathrm{CO}_2##), not the others, but I still get unplausible mass increases for the other gases, just not as dramatic as for ##\mathrm{CO}_2##. If the surrounding would give off heat, then I would have expected to see these peaks in other gas tanks as well, but I don't.
 
  • #44
@Leopold89 I have been watching the thread for a while and I think it's very interesting. I'm not nearly as experienced as @Chestermiller but maybe the input can still be useful.

You mentioned you're mainly interested in knowing the mass remaining in the tank. Before diving into thermodynamic properties and equations, would it be possible just to weigh the loaded and unloaded tank? Or maybe knowing how much you put in and later weighing the discharged gas into a reservoir so you can know how much remains.

If it's not possible, let me first say that the information available is very limited. Knowing extensive properties (mass, internal energy [J], etc) from only intensive properties (pressure, density/specific volume, temperature, etc) is very hard. I'm not even sure is possible. You may be able to fully define the thermodynamic state of a substance but you don't know how much of it there is. At some point, some extensive information must be added.

In this scenario, only the pressure is known which we can assume is uniform within the tank. Even the temperature of the content isn't really measured since you said it's measured in the room ##(\tau)## and not in the tank ##(T)##. As you mentioned in point (2) in the OP, why isn't it possible to measure the temperature inside? I guess it could be derived from other equations but it makes everything a little more complex than it already is and more assumptions are necessary to be able to run the numbers. If you end up being able to install temperature sensors, I'd install a bunch of them at different locations (somewhere in the middle, the bottom, near the valves, etc.). I'd assume the temperature is uniform though just like the pressure although it depends on how rapid the process is. If it's very quick, the area near the valve will be different and, if there is a mixture of liquid and gas, they might not be in equilibrium where they would have the same pressure and temperature.

Assuming none of what I said before is possible, could you characterize the valve? That way, the output mass could be derived from the properties of the gasses.

(NOTE: For all my calculations I'll assume the properties to be uniform so pressure and temperature are the same for everything inside the tank although internal energy, enthalpy and so on will depend on whether it's liquid or gas. Basically, I'm assuming the content is going from A→B through equilibrium states.)
If the full content of the tank were a gas, the approximation to find the mass isn't too difficult depending on how much accuracy you want. Ideal gas law will give you a quick result since you already know the pressure, the temperature, and the total volume (this would be your extensive property) of the tank. As long as you check from the property tables that you don't have a saturated mixture you could use the simple ideal gas law (or use tabulated values).
$$PV = mRT \rightarrow m = \frac{PV}{RT}$$
So the problem lies in the saturated mixture of which we don't know the proportion of gas to liquid or "vapor quality" ##x##. I'll focus on modeling the problem for the time when that mixture is in the tank. As time goes on, more liquid will continue to evaporate until it's 100% gas and you switch to the model previously mentioned.
Using a control volume which is the tank, I'll apply the conservation of mass and conservation of energy.

CONSERVATION OF MASS
$$\frac{d}{dt}\int_{CV}\rho dV=\dot{m}_{in}-\dot{m}_{out}$$
In this problem, gas is only coming out of the tank so we can make ##\dot{m}_{in}=0##. Because of the sign convention used, ##\dot{m}_{out}## will be positive.
The integral on the left side can be evaluated as:
$$\int_{CV}\rho dV = m_{g}+m_{f}$$
Where ##m_g## is the mass of saturated gas in the mixture and ##m_f## is the mass of the saturated fluid.
The end result of the conservation of mass applied on the control volume is:
$$\frac{dm_{g}}{dt}+\frac{dm_{f}}{dt}=-\dot{m}_{out}$$
(I have intentionally not used the · sign for derivatives on the left side because, although it's mass changing over time, that's not really "flow".
The functions ##m_g(t)## and ##m_f(t)## are what we need. To calculate them, we need to know more about the output mass flow ##\dot{m}_{out}##. If you experimentally measure it, then that's it. Use that function. If you can't measure it but you can characterize the valve, then the mass flow should be possible to be expressed using the characteristics of the valve and the properties of the gas. If you can't characterize the valve, you'll have to solve the problem several times using different values for the characteristics of the valve and checking if the results are similar to the experimental values of ##P## and ##T## that you already have.
Anyway, we have two functions so we need two boundary conditions, which will be the initial masses of the system, and two equations. For the second equation, we use conservation of energy.

CONSERVATION OF ENERGY
$$\frac{dE_{CV}}{dt}=\dot{Q}-\dot{W}+\dot{m}_{in}h_{in}-\dot{m}_{out}h_{out}$$
From that equation, we know we're not introducing or extracting work in the system so ##\dot{W}=0##.
The heat input ##\dot{Q}## will be a function of the temperature difference and the thermal resistance. The temperature difference I assume is known from the room temperature which I consider constant and whatever function you're using to find out the temperature inside the tank from the value ##(\tau)##. You mentioned the thermal resistance in another post so it's known too.
The input flow we have already said it's ##\dot{m}_{in}=0##.
The output flow ##\dot{m}_{out}## is a function whose properties have already been discussed in the previous equation.
The enthalpy of the output ##h_{out}## flow is known since you know the temperature and pressure of the saturated mix at any moment so you can find it in tables (notice that it'll change as time passes).
Lastly, the energy in the control volume ##E_{CV}## will be only the internal energy of the gas and liquid because it's not flowing. It can be expressed as:
$$\frac{dE_{CV}}{dt}=\frac{dU_{g}}{dt}+\frac{dU_{l}}{dt}$$
Since it's a saturated mixture, it's going through a phase change. Therefore, its pressure and temperature should be constant.
$$\frac{dU_{g}}{dt}=\frac{d(cmT)_{g}}{dt}=c_g T_g \frac{dm_{g}}{dt}$$
$$\frac{dU_{l}}{dt}=\frac{d(cmT)_{l}}{dt}=c_l T_l \frac{dm_{l}}{dt}$$
As a result, the expression for the conservation of energy during the discharge of the saturated mixture is:
$$c_g T_g \frac{dm_{g}}{dt}+c_l T_l \frac{dm_{l}}{dt}=\dot{Q}-\dot{m}_{out}h_{out}$$

That system of differential equations should be solvable from the information I described. For greater clarity, here are the two equations together.
$$\frac{dm_{g}}{dt}+\frac{dm_{f}}{dt}=-\dot{m}_{out}$$
$$c_g T_g \frac{dm_{g}}{dt}+c_l T_l \frac{dm_{l}}{dt}=\dot{Q}-\dot{m}_{out}h_{out}$$


PS:
I'm aware my approach seems different from what you've been doing in the thread. Maybe what I'm doing is oversimplified and won't capture the actual behavior you're observing experimentally. Still, since you're getting some strange artifacts from your current approach to the problem, it might still be worth trying this method and comparing the results. I assume the differential equations should produce a non-stopping decline in mass within the tank as long as there is a mass output. Pressure and temperature will remain constant until there is no more liquid and then you switch to ideal gas or something similar because your experimental data is enough to determine the mass without having to solve a differential equation.
By the way, are you sure you have a saturated mixture in the tank? I think you haven't shared what's the chemical inside in detail so I couldn't check with some tables (if there are any for that compound).
From your data, I'm not sure if it's OK to assume the properties remain constant during the phase change although it's impossible to judge without knowing how are the discharges (how much it opens, for how long, etc.). In the red arrows, I'd expect to see a more constant behavior because the amount of liquid there should be greatest. However, I only see a constant behavior in the blue arrows. Since the temperature keeps dropping slightly, I assume it's discharging but the pressure is not changing. In theory, temperature should not change either within the chamber but you're not measuring at that point but in the room. Also, as previously mentioned, if the process is too violent the tank's content won't have time to equalize. Still, maybe there is liquid and the process is not as violent at the blue arrows so that phase change can be more easily observed.
1724112559802.png


The condensed amount might be very small. Have you tried ignoring it and comparing the results to your experimental data? It might give you a good enough approximation.
 
  • #45
Juanda said:
That system of differential equations should be solvable from the information I described. For greater clarity, here are the two equations together.
$$\frac{dm_{g}}{dt}+\frac{dm_{f}}{dt}=-\dot{m}_{out}$$
$$c_g T_g \frac{dm_{g}}{dt}+c_l T_l \frac{dm_{l}}{dt}=\dot{Q}-\dot{m}_{out}h_{out}$$
I'm now realizing that, as the discharge happens, the liquid will evaporate while temperature and pressure remain constant due to the phase change. Then, once it's all gas, its expansion will start cooling down the remaining gas.
Could that cooling condense it back?
Picture source: Thermodynamics_ An Engineering Approach by Yunus A. Çengel, Michael A. Boles and Mehmet Kanoglu from McGraw Hill (2023)

1724114146721.png


What I described in the previous post is using differential equations to model the straight segment. Once you're out of the bell (it's all gas), I thought it'd be fine to use the ideal gas law or something similar to find the remaining gas within the tank from the experimental data but I don't know if the path it follows is the red line bordering the bell or something else like the blue line. I don't think it'd be able to get inside the bell again due to its own cooling though.
Maybe it'd be interesting to model the behavior outside the bell with differential equations too to see how close to the experimental data you can get it instead of directly using the experimental data (PTV) to try to get the mass inside the tank by using ideal gas law.
 
  • #46
Juanda said:
@Leopold89 I have been watching the thread for a while and I think it's very interesting. I'm not nearly as experienced as @Chestermiller but maybe the input can still be useful.

You mentioned you're mainly interested in knowing the mass remaining in the tank. Before diving into thermodynamic properties and equations, would it be possible just to weigh the loaded and unloaded tank? Or maybe knowing how much you put in and later weighing the discharged gas into a reservoir so you can know how much remains.

If it's not possible, let me first say that the information available is very limited. Knowing extensive properties (mass, internal energy [J], etc) from only intensive properties (pressure, density/specific volume, temperature, etc) is very hard. I'm not even sure is possible. You may be able to fully define the thermodynamic state of a substance but you don't know how much of it there is. At some point, some extensive information must be added.
As I said in a previous post, extensive information is not necessary if you calculate the mass per unit volume. All other information is present in the thermodynamic tables for the substance (e.g., the steam tables for water).
Juanda said:
In this scenario, only the pressure is known which we can assume is uniform within the tank. Even the temperature of the content isn't really measured since you said it's measured in the room ##(\tau)## and not in the tank ##(T)##. As you mentioned in point (2) in the OP, why isn't it possible to measure the temperature inside? I guess it could be derived from other equations but it makes everything a little more complex than it already is and more assumptions are necessary to be able to run the numbers. If you end up being able to install temperature sensors, I'd install a bunch of them at different locations (somewhere in the middle, the bottom, near the valves, etc.). I'd assume the temperature is uniform though just like the pressure although it depends on how rapid the process is. If it's very quick, the area near the valve will be different and, if there is a mixture of liquid and gas, they might not be in equilibrium where they would have the same pressure and temperature.

Assuming none of what I said before is possible, could you characterize the valve? That way, the output mass could be derived from the properties of the gasses.

If the full content of the tank were a gas, the approximation to find the mass isn't too difficult depending on how much accuracy you want. Ideal gas law will give you a quick result since you already know the pressure, the temperature, and the total volume (this would be your extensive property) of the tank. As long as you check from the property tables that you don't have a saturated mixture you could use the simple ideal gas law (or use tabulated values).
$$PV = mRT \rightarrow m = \frac{PV}{RT}$$
So the problem lies in the saturated mixture of which we don't know the proportion of gas to liquid or "vapor quality" ##x##. I'll focus on modeling the problem for the time when that mixture is in the tank. As time goes on, more liquid will continue to evaporate until it's 100% gas and you switch to the model previously mentioned.
Using a control volume which is the tank, I'll apply the conservation of mass and conservation of energy.

CONSERVATION OF MASS
$$\frac{d}{dt}\int_{CV}\rho dV=\dot{m}_{in}-\dot{m}_{out}$$
In this problem, gas is only coming out of the tank so we can make ##\dot{m}_{in}=0##. Because of the sign convention used, ##\dot{m}_{out}## will be positive.
The integral on the left side can be evaluated as:
$$\int_{CV}\rho dV = m_{g}+m_{f}$$
Where ##m_g## is the mass of saturated gas in the mixture and ##m_f## is the mass of the saturated fluid.
The end result of the conservation of mass applied on the control volume is:
$$\frac{dm_{g}}{dt}+\frac{dm_{f}}{dt}=-\dot{m}_{out}$$
Juanda said:
(I have intentionally not used the · sign for derivatives on the left side because, although it's mass changing over time, that's not really "flow".
The functions ##m_g(t)## and ##m_f(t)## are what we need. To calculate them, we need to know more about the output mass flow ##\dot{m}_{out}##. If you experimentally measure it, then that's it. Use that function. If you can't measure it but you can characterize the valve, then the mass flow should be possible to be expressed using the characteristics of the valve and the properties of the gas. If you can't characterize the valve, you'll have to solve the problem several times using different values for the characteristics of the valve and checking if the results are similar to the experimental values of ##P## and ##T## that you already have.
Anyway, we have two functions so we need two boundary conditions, which will be the initial masses of the system, and two equations. For the second equation, we use conservation of energy.

CONSERVATION OF ENERGY
$$\frac{dE_{CV}}{dt}=\dot{Q}-\dot{W}+\dot{m}_{in}h_{in}-\dot{m}_{out}h_{out}$$
From that equation, we know we're not introducing or extracting work in the system so ##\dot{W}=0##.
The heat input ##\dot{Q}## will be a function of the temperature difference and the thermal resistance. The temperature difference I assume is known from the room temperature which I consider constant and whatever function you're using to find out the temperature inside the tank from the value ##(\tau)##. You mentioned the thermal resistance in another post so it's known too.
The input flow we have already said it's ##\dot{m}_{in}=0##.
The output flow ##\dot{m}_{out}## is a function whose properties have already been discussed in the previous equation.
The enthalpy of the output ##h_{out}## flow is known since you know the temperature and pressure of the saturated mix at any moment so you can find it in tables (notice that it'll change as time passes).
You have not specified whether the output flow from the tank is pure vapor or a combination of vapor and liquid (say at the mass fractions as in the tank). I assumed that the process is taking place slowly in a gravitational field, and that the output is saturated vapor only.
Juanda said:
Lastly, the energy in the control volume ##E_{CV}## will be only the internal energy of the gas and liquid because it's not flowing. It can be expressed as:
$$\frac{dE_{CV}}{dt}=\frac{dU_{g}}{dt}+\frac{dU_{l}}{dt}$$
Since it's a saturated mixture, it's going through a phase change. Therefore, its pressure and temperature should be constant.
This is only true if the system is forced to be at constant pressure. In a case like this, of constant total volume, both the temperature and the pressure are changing along the equilibrium saturation line and the proportions of vapor and liquid are changing.
Juanda said:
$$\frac{dU_{g}}{dt}=\frac{d(cmT)_{g}}{dt}=c_g T_g \frac{dm_{g}}{dt}$$
$$\frac{dU_{l}}{dt}=\frac{d(cmT)_{l}}{dt}=c_l T_l \frac{dm_{l}}{dt}$$
These equations are not correct because the temperature and pressure is changing along with the proportion of liquid and vapor. Also, the heat of vaporization is not included. I derived the correct energy balance in an early post, although I had tentatively assumed that the heat transfer was negligible.
Juanda said:
As a result, the expression for the conservation of energy during the discharge of the saturated mixture is:
$$c_g T_g \frac{dm_{g}}{dt}+c_l T_l \frac{dm_{l}}{dt}=\dot{Q}-\dot{m}_{out}h_{out}$$
See my comments above.
Juanda said:
That system of differential equations should be solvable from the information I described. For greater clarity, here are the two equations together.
$$\frac{dm_{g}}{dt}+\frac{dm_{f}}{dt}=-\dot{m}_{out}$$
$$c_g T_g \frac{dm_{g}}{dt}+c_l T_l \frac{dm_{l}}{dt}=\dot{Q}-\dot{m}_{out}h_{out}$$


PS:
I'm aware my approach seems different from what you've been doing in the thread. Maybe what I'm doing is oversimplified and won't capture the actual behavior you're observing experimentally. Still, since you're getting some strange artifacts from your current approach to the problem, it might still be worth trying this method and comparing the results. I assume the differential equations should produce a non-stopping decline in mass within the tank as long as there is a mass output. Pressure and temperature will remain constant until there is no more liquid and then you switch to ideal gas or something similar because your experimental data is enough to determine the mass without having to solve a differential equation.
By the way, are you sure you have a saturated mixture in the tank? I think you haven't shared what's the chemical inside in detail so I couldn't check with some tables (if there are any for that compound).
If you correct the few points that I indicated above, you might get an approximation this way. But first see the derivation that I gave in my posts, which only omits the heat exchange with the surroundings.
Juanda said:
From your data, I'm not sure if it's OK to assume the properties remain constant during the phase change although it's impossible to judge without knowing how are the discharges (how much it opens, for how long, etc.).
The temperature and pressure do not remain constant during the phase change in a constant volume tank.
 
  • #47
Juanda said:
I'm now realizing that, as the discharge happens, the liquid will evaporate while temperature and pressure remain constant due to the phase change. Then, once it's all gas, its expansion will start cooling down the remaining gas.
This is not correct because the temperature and pressure both change in this constant tank volume situation.
 
  • #48
Thanks for the corrections @Chestermiller. I'll read the thread again and try the problem from another angle.
The reason I tried this in the first place is that I couldn't understand some points in the thread though.

I have a few comments about your last posts.

Chestermiller said:
As I said in a previous post, extensive information is not necessary if you calculate the mass per unit volume. All other information is present in the thermodynamic tables for the substance (e.g., the steam tables for water).
Yeah but OP said he's interested in knowing the mass inside the tank, right? At some point, some extensive property must be added. For example, assuming an initial mass and data from the output mass.

Chestermiller said:
You have not specified whether the output flow from the tank is pure vapor or a combination of vapor and liquid (say at the mass fractions as in the tank). I assumed that the process is taking place slowly in a gravitational field, and that the output is saturated vapor only.
True. I didn't write it explicitly but I assumed the mass output was saturated vapor while in the chamber remains saturated vapor and saturated liquid whose properties can all be found in tables.

Chestermiller said:
(This is about my claim about temperature and pressure remaining constant due to the phase change)

This is only true if the system is forced to be at constant pressure. In a case like this, of constant total volume, both the temperature and the pressure are changing along the equilibrium saturation line and the proportions of vapor and liquid are changing.

These equations are not correct because the temperature and pressure is changing along with the proportion of liquid and vapor. Also, the heat of vaporization is not included. I derived the correct energy balance in an early post, although I had tentatively assumed that the heat transfer was negligible.

The temperature and pressure do not remain constant during the phase change in a constant volume tank.
Can you explain why the pressure and temperature are not constant during the phase change? It's one of those things I remember as a golden rule during phase change. I admit I was surprised about the temperature and pressure graphs supplied by @Leopold89 but I thought I didn't see it happening there because either the phenomenon was too violent so the mix is not in equilibrium, the sensors were not reading correctly, or any other complicated reason that often arises when dealing with real-world problems.


Lastly, @Leopold89 you are interested in knowing the remaining mass in the tank. We have already stated that the problem occurs when there is a mixture of gas and liquid inside because your sensors don't provide enough information by themselves. I tried to propose some engineering solutions that don't involve complicated calculations such as weighing the tank but that might be difficult. How about installing a floater so you can know how much liquid there is inside? For example:
1724152481727.png



Once the volume of liquid is known, you'd easily find the mass in the tank once the properties of both liquid and gas are known.
 
  • #49
Juanda said:
Thanks for the corrections @Chestermiller. I'll read the thread again and try the problem from another angle.
The reason I tried this in the first place is that I couldn't understand some points in the thread though.

I have a few comments about your last posts.


Yeah but OP said he's interested in knowing the mass inside the tank, right? At some point, some extensive property must be added. For example, assuming an initial mass and data from the output mass.
The required extensive property is the constant tank volume V.
Juanda said:
True. I didn't write it explicitly but I assumed the mass output was saturated vapor while in the chamber remains saturated vapor and saturated liquid whose properties can all be found in tables.


Can you explain why the pressure and temperature are not constant during the phase change? It's one of those things I remember as a golden rule during phase change. I admit I was surprised about the temperature and pressure graphs supplied by @Leopold89 but I thought I didn't see it happening there because either the phenomenon was too violent so the mix is not in equilibrium, the sensors were not reading correctly, or any other complicated reason that often arises when dealing with real-world problems.
What you remember is that, for a phase change at constant pressure, the temperature is constant.
 
  • #50
Chestermiller said:
The required extensive property is the constant tank volume V.
But that's only enough if we knew the content is 100% gas because it'd occupy the full volume or 100% liquid as long as it is at 100% capacity.

Chestermiller said:
What you remember is that, for a phase change at constant pressure, the temperature is constant.
That's probably it. I'm a little rusty on this but, from what I remember, power cycles involving vapor always have that constant behavior inside the bell.
I checked THE book (Çengel) again and the constant pressure is mentioned. I assumed the constant pressure (and temperature) was a result of the phase change but the phase change is actually not even mentioned. So it is imposing a constant pressure inside the bell that is causing the constant temperature during that part of the process.
1724153755623.png


I don't know how to describe a phase change where the pressure is not held constant then. I feel I need more information.
 
  • #51
Juanda said:
But that's only enough if we knew the content is 100% gas because it'd occupy the full volume or 100% liquid as long as it is at 100% capacity.
Another variable in the equations I presented was the mass fraction vapor, which is an intensive property. See the equations I derived in my analysis.
Juanda said:
That's probably it. I'm a little rusty on this but, from what I remember, power cycles involving vapor always have that constant behavior inside the bell.
No way. The temperature and mass fraction vapor are sufficient to fully establish conditions within the bell.
Juanda said:
I checked THE book (Çengel) again and the constant pressure is mentioned. I assumed the constant pressure (and temperature) was a result of the phase change but the phase change is actually not even mentioned. So it is imposing a constant pressure inside the bell that is causing the constant temperature during that part of the process.
View attachment 350155
There is a big difference between constant pressure spatially and constant pressure temporally (i.e., during the process). In the Rankine cycle, the boiler is operated at constant pressure because the hydrodynamic pressure drop in the boiler tubes is low, and, in the condenser tubes, the pressure drop of the water vapor and liquid water combination flowing through the tubes is hydrodynamicallly low. These are mechanical constraints of the process equipment rather than thermodynamics.
Juanda said:
I don't know how to describe a phase change where the pressure is not held constant then. I feel I need more information.
Please review the analysis I did in post #11 and get back with me regarding any questions. There are only a few equations presented in that post.
 
Last edited:
  • #52
Thank you for your input, I really appreciate that you took so much time out of your day.
Juanda said:
would it be possible just to weigh the loaded and unloaded tank?
In theory at some point in the future one could measure these masses, but not in the short term.
Juanda said:
why isn't it possible to measure the temperature inside?
The main reason is that I don't have the right thermometers for that. Before your comment I did not even know I could do that, but if I could find a suitable thermometer to integrate into the setup, I could also measure the temperature directly.
Juanda said:
could you characterize the valve?
I don't understand. Could you give me an example?
Juanda said:
If the full content of the tank were a gas, the approximation to find the mass isn't too difficult depending on how much accuracy you want.
I have posted a plot of only gas/vapour in post #39, but I can also upload plots in this post as well.

Juanda said:
I'm aware my approach seems different from what you've been doing in the thread.
I don't mind. Even if it should not work, it is a welcomed exercise to get practice in thermodynamics. I just need some time for the implementation.
Juanda said:
By the way, are you sure you have a saturated mixture in the tank? I think you haven't shared what's the chemical inside in detail so I couldn't check with some tables (if there are any for that compound).
Not in all tanks, but in one I believe yes. For most chemicals I did a mistake like for ##\mathrm{CO}_2##, where I followed Wiki, where they said you have liquid carbondioxide above 5.2bar and below 31°C, but after Chestermiller's explanation, I have corrected my mistake.
Juanda said:
Since the temperature keeps dropping slightly, I assume it's discharging but the pressure is not changing.
In my interpretation the dropping temperature is caused by the daytime (evening) and maybe the pressure does not follow, because the atmospheric pressure increased at that time. Btw I could also get a time series of the atmospheric pressure, but from another room, and then correct the gas pressure for the surrounding pressure.
 

Attachments

  • co2_plots.png
    co2_plots.png
    14.5 KB · Views: 13
  • #53
Leopold89 said:
(Referencing the different approach I initially took in #44 and #45)
I don't mind. Even if it should not work, it is a welcomed exercise to get practice in thermodynamics. I just need some time for the implementation.
I'm actually now trying to follow what you and Chester did before. As he said, maybe by correcting the points he marked it'd be possible to approximate the system.

Leopold89 said:
(Referencing the characterization of the valve)
I don't understand. Could you give me an example?
You could install valves that measure the volumetric flow. If the density of the vapor is known (should be possible to find it from thermodynamic properties) then you can know the mass output.
Alternatively, if you knew the characteristics of the valve, you could calculate the output flow from the thermodynamic properties.
1724171966976.png


By the way, did you consider the floater or a similar sensor to find the amount of liquid inside?
Juanda said:
Lastly, @Leopold89 you are interested in knowing the remaining mass in the tank. We have already stated that the problem occurs when there is a mixture of gas and liquid inside because your sensors don't provide enough information by themselves. I tried to propose some engineering solutions that don't involve complicated calculations such as weighing the tank but that might be difficult. How about installing a floater so you can know how much liquid there is inside? For example:
View attachment 350153


Once the volume of liquid is known, you'd easily find the mass in the tank once the properties of both liquid and gas are known.
 

Attachments

  • 1724171538948.png
    1724171538948.png
    12.7 KB · Views: 14
  • #54
Juanda said:
By the way, did you consider the floater or a similar sensor to find the amount of liquid inside?
Yes, but it is not possible.
Juanda said:
Alternatively, if you knew the characteristics of the valve, you could calculate the output flow from the thermodynamic properties.
Maybe I can aquire these from the manufacturer. I think I would need the area of inlet and outlet an then scale the pressure measurement to the outlet area. I just don't understand the "Alternativly", because I would still need to measure ##Q_G##.
 
  • #55
Leopold89 said:
Yes, but it is not possible.
That's a shame. Calculations it is then. At least in the short run. As you said, if weighing the content is possible in the future it might prove to be the best approach if you can't manage to model the system in a way that provides reliable results that match the real behavior you're observing with your current sensors.

Leopold89 said:
Maybe I can aquire these from the manufacturer. I think I would need the area of inlet and outlet an then scale the pressure measurement to the outlet area. I just don't understand the "Alternativly", because I would still need to measure ##Q_G##.
I meant I think you have 3 alternatives regarding the valve.
  1. Measure the flow experimentally.
  2. Characterize the valve and measure the flow indirectly using calculations. Then check the results with your experimentally measured P-T graphs to ensure your results make sense.
  3. Similar to the previous options but without characterizing the valve. You'll have to solve the problem several times assuming different valve characteristics hoping that, for some values for the valve, the results match what your experimental measurements of P-T are reading.
By the way, probably there are books, articles or other webpages covering the characterization of valves in more detail or in more convenient units (those 816 and 962 might be converting factors but I don't really know it).
 
  • #56
What are the dimensions of your actual tank (schematic sketch?)
 
  • #57
Chestermiller said:
What are the dimensions of your actual tank (schematic sketch?)
Volume of the tank is 50 liters, the outer diameter is 229 mm and length is 1655 mm. No sketch available. Why is this important?

I have tried to compute the differential equation by @Juanda in the attached image, but for a pure CO##_2## gas: ##\dot m = \frac{\dot q -c_V \dot T}{c_VT - h_\mathrm{out} -q}m##
It starts out well, but somewhere seems to be an error and the mass jumps around 0. What seems strange to me is that the specific enthalpies and internal energies are below zero. I get those from the Python package pyromat.

Edit: Found the implementation error. The ode should now be computed correctly, but the result is still implausible.
 

Attachments

  • mass_plots.png
    mass_plots.png
    18.6 KB · Views: 12
Last edited:
  • #58
Juanda said:
could you characterize the valve?
Inlet: DIN 477-5 Nr. 57 (W 30 x 2 LH)
Outlet: 1/4 NPT-M

But this is the valve for hydrogen tanks, not 100% sure if others are the same.
 
  • #59
Leopold89 said:
Inlet: DIN 477-5 Nr. 57 (W 30 x 2 LH)
Outlet: 1/4 NPT-M

But this is the valve for hydrogen tanks, not 100% sure if others are the same.
That's something but by itself, it's not of much use. You either input the geometry in CFD software or experimentally characterize the valve to determine how the flow is through it depending on the boundary conditions.

I still couldn't invest time on this thread again. It's a hard one and I'd need time to focus on it.
 
  • #60
Leopold89 said:
The main reason is that I don't have the right thermometers for that. Before your comment I did not even know I could do that, but if I could find a suitable thermometer to integrate into the setup, I could also measure the temperature directly.
You can measure the temperature with thermocouples. They are often mounted thru the tank wall using a thermowell, which is essentially a closed-end threaded tube that attaches thru a threaded hole in the tank and contains the thermocouple.

The other implementation is feed the thermocouple thru the top of the tank using a gland fitting. This has the advantage that you can place the thermo-couple at various adjustable positions within the tank.

The disadvantage is that some electronics is needed for a thermocouple because their output is in the millivolt range.

If all you need is the liquid level in the tank, there are ultrasonic sensor systems that install in the top of the tank and measure the distance to the fluid level.

Another possibility that may or may not work for you: There is usually (always?) a temperature difference of a couple degrees on the tank walls depending on whether there is liquid or vapor at that level. One implementation is a stick-on strip of a Liquid Crystal thermometer strip; unfortunately the ones I've run across need a human to read them.

A variation on finding the liquid/gas boundary is placing some heater+temperature sensors on the outside wall. The liquid will conduct the thermal energy away faster that the vapor will. That results in the sensors at the liquid showing a lower temperature that the ones at the gas level.

Another possibility (maybe the simplest) is two pressure gauges, one at the top of the tank and one at the bottom. Read the bottom pressure, subtract the top pressure, and you end up with the hydrostatic pressure of the liquid. Knowing the density of the liquid, you can calculate the liquid depth.

Well, that's my off-the-cuff brain dump on the subject.

When you get something working please let us know. We like to learn too!

Cheers,
Tom
 
  • Informative
Likes Leopold89 and Juanda
  • #61
Leopold89 said:
Volume of the tank is 50 liters, the outer diameter is 229 mm and length is 1655 mm. No sketch available. Why is this important?

I have tried to compute the differential equation by @Juanda in the attached image, but for a pure CO##_2## gas: ##\dot m = \frac{\dot q -c_V \dot T}{c_VT - h_\mathrm{out} -q}m##
It starts out well, but somewhere seems to be an error and the mass jumps around 0. What seems strange to me is that the specific enthalpies and internal energies are below zero. I get those from the Python package pyromat.

Edit: Found the implementation error. The ode should now be computed correctly, but the result is still implausible.
What are your initial conditions for the CO2 case you ran?
Temperature
Pressure
Mass
 
  • #62
Tom.G said:
The other implementation is feed the thermocouple thru the top of the tank using a gland fitting. This has the advantage that you can place the thermo-couple at various adjustable positions within the tank.
You gave a lot of input. I don't understand how exactly I can insert a thermocouple into the tank, because as I understand it I would need an empty tank. But I get full tanks from the manufacturer and did not see him offer these thermocouples.
Chestermiller said:
What are your initial conditions for the CO2 case you ran?
Temperature
Pressure
Mass
I first computed the specific heat from the change in specific internal energy and ##h_\mathrm{out}## from the change in specific enthalpies ##h_{i-1} -h_{i}##, so I got a n-1 long time series. Then I passed on the temperature and pressure without the first entry and calculated the initial mass with the equation for ideal gases given the second temperature-pressure pair in the time series.
 
Last edited:
  • #63
Leopold89 said:
You gave a lot of input. I don't understand how exactly I can insert a thermocouple into the tank, because as I understand it I would need an empty tank. But I get full tanks from the manufacturer and did not see him offer these thermocouples.

I first computed the specific heat from the change in specific internal energy and ##h_\mathrm{out}## from the change in specific enthalpies ##h_{i-1} -h_{i}##, so I got a n-1 long time series. Then I passed on the temperature and pressure without the first entry and calculated the initial mass with the equation for ideal gases given the second temperature-pressure pair in the time series.
All I'm asking for are the initial conditions in the tank (initial parameter values).
 
  • #64
Chestermiller said:
All I'm asking for are the initial conditions in the tank (initial parameter values).
##T=297.138375\mathrm{K}, p=5438467.5\mathrm{Pa}, m_0= 4.84398743373488\mathrm{kg}##
 
  • #65
Leopold89 said:
##T=297.138375\mathrm{K}, p=5438467.5\mathrm{Pa}, m_0= 4.84398743373488\mathrm{kg}##
At that temperature, the equilibrium vapor pressure of CO2 is 6.3 MPa, not 5.4 MPa. Are you saying that, initially, you have all vapor below the saturation pressure?
 
  • #66
Chestermiller said:
At that temperature, the equilibrium vapor pressure of CO2 is 6.3 MPa, not 5.4 MPa. Are you saying that, initially, you have all vapor below the saturation pressure?
Leopold89 said:
Not in all tanks, but in one I believe yes. For most chemicals I did a mistake like for CO2, where I followed Wiki, where they said you have liquid carbondioxide above 5.2bar and below 31°C, but after Chestermiller's explanation, I have corrected my mistake.
Yes. After your explanation I checked my data over the last three months and found that for example the CO##_2## tank has a maximum pressure of 6.1MPa.
 
  • #67
Leopold89 said:
4.84398743373488 kg
If you need to know the mass to a picogram, we can stop right now. Not going to happen.
 
  • #68
Leopold89 said:
Yes. After your explanation I checked my data over the last three months and found that for example the CO##_2## tank has a maximum pressure of 6.1MPa.
297 K and 5.4 MPa are inconsistent with 4.84 kg iii a 20 liter tank.

You initially have a superheated vapor, and the gas in the tank decreases in temperature and pressure isentropically as the tank empties until you hit the equilibbium bell. At that point, a liquid phase begins to form.
 
  • #69
Vanadium 50 said:
If you need to know the mass to a picogram, we can stop right now. Not going to happen.
I was just copy-pasting python output. It is not meant as desired precision.
Chestermiller said:
297 K and 5.4 MPa are inconsistent with 4.84 kg iii a 20 liter tank.
Leopold89 said:
Volume of the tank is 50 liters, the outer diameter is 229 mm and length is 1655 mm.
 
  • #70
Leopold89 said:
I was just copy-pasting python output. It is not meant as desired precision.
4.84 kg is not consistent with 50 liters, 297K and 5.84 MPa either.
 

Similar threads

Back
Top