This is a more practical problem than theoretical, so hopefully that's acceptable on this site.
I'm trying to fill a small tank with a gas from a larger tank at much higher pressure. The two tanks are connected by a solenoid valve, and the small tank has a pressure sensor with excellent response time. The pressure sensor is monitoring while filling the small tank for several seconds, and at a specified pressure the solenoid valve is closed.
What happens next is what I'd like to understand. The pressure in the small tank actually goes down about 3% after the valve is closed. The time constant of the pressure decay is around 7 seconds. Conversely, when gas is released from the small tank to an evacuated large tank, the pressure goes up after the solenoid valve is closed.
I'm sure this phenomenon is well known and studied, but I haven't been able to find an explanation. Is it simply a heating/cooling phenomenon as the gas is added/removed, then a return to ambient over the next several seconds? Is there any way to predict the pressure drop/increase after closing/opening the valve during filling/emptying? Or, is this comment the answer?
Here are some additional details if relevant:
small cylinder description: 1 l, stainless steel, pressure sensor mounted on opposite side of tank from input
large cylinder description: 49 l, steel, 30 psi
target pressure: 14 psi
ambient conditions: room temperature