- #1
Innovine
- 22
- 5
- TL;DR Summary
- I wish to model a simple system with two pressurized gas containers connected by a valve.
Hi,
I wish to write a simple simulation of gas behavior. I have two tanks, connected by a valve. When the valve is opened, the gas will obviously flow and after some time it will reach an equilibrium.
I could really do with some help in calculating the rates of change of the temperatures and pressures. My code has an Update function which gets called 50 times a second, and in there I want to calculate the current state of the system.
I've been looking at ideal gas laws and valve flow rate equations but everything I've seen so far just seems to describe the steady state at the end. Can anyone help me work out how to do this step by step as the gas flows.
I guess I need some kind of flow rate parameter on the valve too.
It's fine to simplify the model a lot, I just want to get a gross idea of how this behaves..
Any help would be greatly appreciated!
I wish to write a simple simulation of gas behavior. I have two tanks, connected by a valve. When the valve is opened, the gas will obviously flow and after some time it will reach an equilibrium.
I could really do with some help in calculating the rates of change of the temperatures and pressures. My code has an Update function which gets called 50 times a second, and in there I want to calculate the current state of the system.
I've been looking at ideal gas laws and valve flow rate equations but everything I've seen so far just seems to describe the steady state at the end. Can anyone help me work out how to do this step by step as the gas flows.
I guess I need some kind of flow rate parameter on the valve too.
It's fine to simplify the model a lot, I just want to get a gross idea of how this behaves..
Any help would be greatly appreciated!