From energy conservation as in the derivation of Bernoulli's theorem, it reads
In the Eq. (1) u is the internal energy per unit mass and in this case is the thermal energy per unit mass of the gas . As the gas vessel is thermally insulated Qd = 0, also in our case.
Just inside the vessel u = CvT/M = RT/M(γ-1) also P/ρ = RT/M. Inside the vessel v = 0 also. Just outside p = 0, and u = 0. Ingeneral gz is not very significant for gases.
Thus applying Eq. (1) Just inside and outside the hole, we get
Note : The velocity here is the velocity of hydrodynamic flow of gas into vacum. This requires that the diameter of the hole is not too small (D > mean free path l). In the opposite case (D<<l) the flow is called effusion. Then the above result does not apply and kinetic theory method are needed.