Fill a scuba cylinder and it becomes hot enough to be uncomfortable to hold, which the steady-flow energy equation has nothing to say about, because a cylinder being filled is not steady.
The assumption that just broke
Every result so far rested on the same claim: nothing inside the control volume changes with time. That let the mass balance collapse to inflow equals outflow, and it let the energy balance drop the term describing energy accumulating inside. Both collapses are what made the analysis arithmetic.
Charging and discharging break the claim on purpose. A compressed air receiver being filled has rising mass, rising pressure and rising temperature inside it. A gas cylinder being vented has all three falling. A steam accumulator absorbing a load swing exists precisely to store and release, and a boiler drum whose level moves during a load change is storing water and energy in a way no steady balance can see.
These are not exotic cases. Every plant spends its riskiest hours starting up and shutting down, safety relief devices operate only in transients, and a large fraction of pressure-vessel incidents happen during filling or emptying. The analysis needed is not much harder, but it has one extra term and one new modelling decision.
The transient balance
Keep the same control volume and stop deleting the accumulation terms. Conservation of mass, integrated over a process from state to state , gives
and conservation of energy, with the energy inside the control volume written as since it is not moving anywhere,
Both are exact. Notice which energy appears where: the contents of the control volume are counted with , because nothing is pushing them anywhere, while everything crossing a port is counted with , because it had to be pushed. That distinction, arbitrary-looking when enthalpy was first introduced, is doing real work here, and getting it backwards is the standard way to produce a wrong answer that looks reasonable.
The new modelling decision is what value of to use at a port, since the state at the port can change during the process. The uniform-flow model assumes it does not: the fluid crossing each port has one fixed state for the whole process, and the contents of the control volume, while changing in time, are uniform in space at any instant. For a bottle filled from a large line at fixed pressure and temperature this is very good. For a bottle discharging, the fluid leaving is at the instantaneous state inside, which is changing, and the model is worse. That case is handled below.
Filling an empty bottle
Take the simplest possible case and let it produce a result nobody expects.
A rigid, insulated, evacuated bottle is connected to a large line carrying air at fixed pressure and temperature, and the valve is opened until the pressure inside equals the line pressure. The bottle is rigid so , insulated so , initially evacuated so , and nothing leaves. The energy balance reduces to a single line:
and the mass balance says . Cancel it:
The final internal energy inside the bottle equals the enthalpy of the fluid in the line. That is the whole result, and it is remarkable because there is no heating of any kind: nothing burned, nothing rubbed, no work crossed the boundary. What happened is that the line did flow work per kilogram to shove the air through the valve, and that work had nowhere to go but into the internal energy of the air now sitting inside.
For an ideal gas with constant specific heats, and , so
The gas in the bottle ends up hotter than the supply by the factor , which for air is . Air from a line at K fills a bottle at K, a rise of K, independent of the pressure, the volume and the size of the valve. Anyone who has filled a diving cylinder or a car tyre from a compressor has felt this, and much of what they felt was this rather than the compressor's own heat.
Example. A rigid, insulated, evacuated m³ vessel is filled from a line carrying air at kPa and K until the pressure inside reaches kPa. Find the final temperature and the mass admitted, taking kJ kg⁻¹ K⁻¹ and .
The temperature follows immediately: K, or degrees Celsius. The mass then comes from the ideal gas law at the final state, kg. Had the filling somehow been isothermal at K, the bottle would have held kg, forty per cent more. The vessel will in fact reach that mass only if it is refilled after cooling.
Now you. A rigid, insulated, evacuated m³ vessel is filled from a line at MPa and K. Find the final temperature and the mass admitted.
Answer
K, and kg.
The corollary matters commercially. Let the filled bottle sit until it returns to K and its pressure falls to kPa, since the mass and volume are fixed. A cylinder charged to its rated pressure while hot is not full once it cools, which is why a properly filled cylinder is either filled slowly, filled in a water bath, or topped up afterwards.
Filling a bottle that is not empty
Drop the requirement that the vessel starts empty and the algebra grows one term. With already inside at temperature , the energy balance is , and for an ideal gas that reads
The unknowns are and , and the second equation needed is the ideal gas law at the final state, , whose right-hand side is entirely known. Substituting turns the pair into one linear equation in .
Example. The same rigid insulated m³ vessel already contains air at kPa and K. It is filled from the same line at kPa and K until the pressure inside reaches kPa. Find the final temperature and mass. Use and kJ kg⁻¹ K⁻¹.
The initial mass is kg. The product is fixed by the final pressure: kg K. Put both into the balance:
The left side is kJ. The right side is , so and kg. Then K. The air already present, which does not have to be pushed in and so brings no flow work, drags the final temperature below the K of the empty case.
Now you. The same vessel starts at kPa and K instead. Find and .
Answer
kg. The balance becomes , so , giving kg and K.
Blowing a vessel down
Discharge is the harder direction, because the fluid leaving is at the state inside the vessel, and that state is changing throughout. The uniform-flow assumption of a fixed port state is simply false.
There is a clean way through it for the commonest case. Follow the gas that remains in the vessel at the end. It never crossed the boundary, so it is a closed system. It expanded, because the gas that left made room for it. If the vessel is insulated and the expansion is slow enough to stay near equilibrium, that remaining gas has undergone a reversible adiabatic expansion, and for an ideal gas the isentropic relation applies directly:
No transient balance was needed. The trick is choosing the system: the residual gas, not the vessel's contents as a whole.
Example. The m³ vessel above, holding air at kPa and K, is vented to atmosphere at kPa through a valve. Taking the process as adiabatic and the remaining gas as expanding reversibly, find the final temperature and the mass left.
The pressure ratio is and the exponent is , so K, which is degrees Celsius. The mass left is kg, against kg initially, so three quarters of the air has gone.
Now you. The same vessel is vented only to kPa. Find the final temperature and the mass remaining.
Answer
K, or degrees Celsius, and kg, so per cent has escaped.
That degrees Celsius is visible: vent a gas cylinder quickly and frost forms on it, and the valve can ice up hard enough to jam. It is also a hazard, since carbon steel loses toughness as it cools and a vessel designed for ambient temperature may be blown down into a range where it is brittle. Depressurisation rates in process plant are limited for exactly this reason.
Where the model earns its keep, and where it fails
The uniform-flow model is a genuine approximation and it is worth being specific about what it costs.
It assumes the contents are uniform at every instant. In a bottle being filled fast, the incoming jet is nothing like uniform, and the gas near the inlet is much hotter than the gas at the far end until mixing catches up. The final equilibrium temperature is still right, because the balance only used end states, but any statement about what the gas was doing halfway through is not.
It assumes the process is slow enough that the pressure inside is meaningful. Fast discharge through a small orifice is choked, the flow is sonic at the throat, and the gas inside is not in equilibrium with itself. The isentropic blowdown result then overestimates the cooling, because heat leaks in from the vessel walls, which have far more heat capacity than the gas and act as a reservoir. Real blowdown of a steel cylinder is nearer isothermal than isentropic for slow vents and nearer isentropic for fast ones, and both bounds are worth computing to bracket the answer.
It assumes, in the filling result, that the gas is ideal with constant specific heats. For air at these pressures that is fine. For a bottle being charged to bar it is not, and the compressibility factor has to come back.
None of these transients said anything about how much of the process was avoidable. Filling a bottle from a line at K and ending at K wastes something: that heat leaks away and the cylinder ends up holding less gas than it could. The energy balance is perfectly happy and reports no loss at all, because energy was conserved exactly. To say that the process was wasteful, and by how much, needs a quantity that increases when something irreversible happens, and applying that quantity to control volumes is the next lesson.