Calculate Gas Behavior Step-by-Step in Simple Model

  • Thread starter Thread starter Innovine
  • Start date Start date
  • Tags Tags
    Gas Model
Click For Summary
The discussion focuses on creating a simple simulation of gas behavior between two tanks connected by a valve, aiming to calculate temperature and pressure changes over time. The user seeks guidance on modeling flow rates, particularly under conditions of choked flow, and expresses difficulty in understanding the necessary equations. Key points include the importance of pressure differentials in determining flow characteristics and the need to account for temperature changes during gas transfer. The conversation highlights the complexity of the problem, suggesting starting with simplified models and gradually adding complexity. Ultimately, the user aims for a workable approximation rather than precise accuracy in their simulation.
  • #31
There is no "right" flow time or rate other than what is required by a given system application. For example, in the pressure relief valve company where I gained the majority of my knowledge about gas and liquid flow they have a certified flow test laboratory where they test and certify the flow rates of all sizes of relief valves from very low pressures to up to 70 Barg; and, the nozzle used must remain at critical flow for test accuracy and to do that they require a set of flow nozzles of diameters ranging from 25.4mm to 100mm depending upon the pressure rating and flow capacity of the relief valve being tested.
So you need to establish why the tank oxygen is being vented and how the time it takes for venting relates to what the user is trying to accomplish to determine your appropriate flow rate and thereby your correct nozzle size.
 
Engineering news on Phys.org
  • #32
Of course there is, can you just give me a number. I told you the area. If I drill a hole and uncork it, gas will come out. Will it take 2 seconds or 2 minutes to empty?

Its getting kind of frustrating that you keep saying stuff like "to set the nozzle, pick a time to empty" and I ask "ok, what kind of time" and you reply with "that depends on the nozzle". Are you trolling me now?

Pick any nozzle. That will do. Its a lovely nozzle. How long does it take to empty the tank using that nozzle?

The reasons why the tank is being vented? Because there's a 0.001m ^2 hole in the side of it. That'll do. The user is trying to accomplish the emptying of the tank.

I think perhaps you enjoy discussing flows and nozzles, but really that is not helpful in this situation. I am making a video game, this is a tiny part, I just want to see the pressure needle decrease, and not have it so someone says "thats a bit fast". some rough numbers are all I need. Mnybe I would be bett'r off going to a scuba diving forum and asking how long it takes for a tank to empty if I cut the hose or put a hole in it. That's about the accuracy I require.
 
Last edited:
  • #33
That depends upon the size of the hole you drill.
Once again "the reason the user is venting the gas determines whether the flow should be in seconds i.e. to prevent a overpressure tank from exploding; or, you are simply depressurizing the tank for maintenance which could be several minutes to an hour for a large tank.
For my applications, a blowdown test could be only for a few seconds or a flow test could last for several minutes depending on how long the supply tank pressure will maintain the critical nozzle flow required to accomplish the required test goal.
 
  • #34
Addendum to the above: At your intended high pressure the person drilling the hole is probably going to killed by the escaping gas velocity anyway.
 
  • #35
Beyond all of the above, if you give me more information about how you are applying your venting program then maybe I can give you a better approximation of an appropriate venting time for that application but that will only apply for one given max tank pressure.

From your statement referencing a "player" it would appear that you are using this for an entertainment game and if so, as I stated in another thread regarding how realistic an event simulation needed to be for an game application, consistency of results to insure an even playing field across all player's scenarios is more important than precise accuracy of the simulation. In that respect, if a player needs to react in some manner to your tank venting, then a shorter venting time will be more demanding in terms of the reaction time demanded from the player.
 
  • #36
JBA said:
That depends upon the size of the hole you drill.
I mentioned the hole size of 0.001m^2 in posts #28, #30 AND #32.

JBA said:
Once again "the reason the user is venting the gas determines whether the flow should be in seconds
No, the reason the user does anything is irrelevant, the nozzle parameters and pressure determines the flow.

JBA said:
if you give me more information about how you are applying your venting program then maybe I can give you a better approximation of an appropriate venting time for that application
.. oh so the PROGRAM I use now determines the venting time??
You are just inventing problems now. If you go all the way back to post #1, you will see I am asking for simplifications, and you constantly drag up new unknowns and new fact1ors. If you would like to help, in an effective way, I suggest you try looking at what I am asking, and try and provide the relevant info, and only the relevant info. Too much information is NOT helpful, it is the exact opposite.To clarify, please answer the following... If I have a 1m^3 tank of O2, pressurized to at 273K, and there is a circular hole, with area 0.001m^2, which is uncorked by a player who intends to empty the tank to atmospheric pressure via said hole, simulated in Unity, for a game which does not require rapid reaction times from the player, and the weather in Shanghai is 30C, humid, and partially overcast, how long to the nearest 10s of seconds does it take for the tank pressure to fall to atmosphere (to within 1000Pa of atmosphere).
 
Last edited:
  • #37
It is not the program that selects the flow rate or venting time, it is how you want the venting to interact with the program that determines the flow rate; and, if you don't have any target parameters for that, then just pick one of your above choices because your guess is as good as mine. I am not trying to make things more difficult, it is that without an application goal I have no basis for selecting any orifice size.

As for the orifice coefficient, once you have an orifice size; then, if the flow rate through that orifice size is greater than that you want, you can use the orifice coefficient decimal value below 1.00 to reduce (fine tune) the flow to your desired flow rate; but, if the flow rate for your selected orifice size is less that you want; then, you will need to either increase the orifice size to give exactly your desired rate or increase the orifice size to give just above your desired flow rate and use the orifice coefficient to reduce (fine tune) the flow rate to what you want. It is not that you can't use a coefficient greater than 1.00 to increase your nozzle's flow rate but to do so violates the proper use of the coefficient because that implies your manufactured orifice can flow at a rate greater than the ideal gas laws calculated value and that cannot happen with real life nozzles.
 
  • #38
Understood. Did you have a version of the formula with discharge coefficient, for non-choked flows?

And out of morbid curiosity, how complex do things get if I wanted to include heat, in a very, very, very approximate way?
 
  • #39
The nozzle coefficient for a nozzle is the same for both critical and subsonic (non-critical) flow; because, it addresses the physical properties of a nozzle such as nozzle entrance shape, bore diameter tolerance variations, nozzle bore surface finish, etc. and not flow properties.

If you have included the temperature adjustment we discussed to reduce the temperature decline rate to a rate that is less than the isentropic P vs T ideal gas law predicts your are already approximating the warming effect due to heat transfer into the tank from the surrounding ambient air and only the below process or a instrumented P vs T test blowdown on an actual tank can result in an accurate determination of an actual tank gas T vs P decline rate.

Just so you understand why I suggest you limit your method to the above, anything beyond that is going to require a full analysis of the heat transfer based upon based upon your tank size and configuration, the tank wall material heat transfer coefficient, area and thickness and the heat transfer coefficient for, assuming your tank is a horizontal cylinder, "an unforced convection flow of air around a horizontal cylinder" and the ΔT between the temperature of the gas inside the tank vs. the air outside the tank. The problem is made even more difficult by the fact that the temperature of the gas inside the tank is constantly reducing by expansion cooling relative to the outside air and, as a result, the ΔT is continuously increasing but at a substantially lower rate than the ideal gas laws predict. Ultimately what comes from this is just a same T vs P as the above original method but with a more accurate T vs P for one specific tank size and configuration.
 
  • #40
I was considering sending you the tank cooling rate graph for the depressurization T vs P from my previous project test, but that test is based on a stepped pressure reduction process that took 1 hour to complete, and it was then that I realized that another factor involved in the gas temperature decline during venting is the rate of depressurization of the tank. The tank's gas cooling rate will be exactly equal to the tank depressurization rate; but, the increase in heat transfer rate into the tank from the surrounding air is limited; so, for rapid depressurizations due to high gas venting rates, the heat input from the surrounding air will not be able to proportionally rise with the rapid gas cooling rate.
It is similar to the what happens when a chilled container is removed from a refrigerator freezer, first condensation and then ice forms on its surface and then slowly melts. It is possible to determine this effect by a detailed heat transfer analysis; but, apart from that, I have no idea how to estimate that gas cooling rate variable.
 
  • #41
Ok, thanks. I have T constant for the moment. It looks like my valve simulation is working, I can see the mass move, and the pressure stabilizes to the same values in two linked tanks, taking longer to stabilize as the pressure differental decreases. No idea if its realistic or not, but neither will anyone else so that's mission accomplished for now!
Next up is mixed gasses, and then maybe I'll look into temperature :)
 
  • #42
Congratulations on a well earned accomplishment when starting with very little knowledge of the subject!
 
  • Like
Likes Innovine
  • #43
Thanks for helping me out and putting up with my frustrations!
 
  • Like
Likes JBA
  • #44
I should have also included your unfailing determination to find a solution in my above post statement.
 
  • Like
Likes Innovine

Similar threads

Replies
1
Views
596
Replies
7
Views
2K
  • · Replies 45 ·
2
Replies
45
Views
5K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
18K
Replies
9
Views
7K
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K