# How to model pressure loss over time for air in a cylinder with a hole

Related to an engineering project I will be working on.

The situation is that essentially I will have a closed cylinder with a small hole on the side, which allows the air inside to be at equilibrium pressure/temperature with the outside. Then a substance in the cylinder undergoes a chemical reaction to rapidly expand into a gas, pressurizing it. I am interested in looking at the pressure over time inside this cylinder.

The method I have in mind is using a calculation similar to the method described in http://www.efunda.com/formulae/fluids/calc_orifice_flowmeter.cfm (which is to describe volume flowrate as $Q = C_f A_{orifice} \sqrt{\frac{2\Delta P}{\rho}}$, then simply describe mass flowrate as $\rho Q$) to model the mass loss for some given time step, then recalculate the internal pressure based on PV = nRT with a reduced mass. However, I just want to make sure of a couple things. As I expect pressure and mass inside the volume to change over time, obviously I can't use a fixed density- is it sufficient to simply divide mass by the volume of the cylinder and assume that is the density of the fluid flowing through the orifice?

Additionally, I am unsure of how to approach finding the $\beta=\frac{D_0}{D_{inlet}}$ value they define near the bottom, as the hole in this case is not on the a circular face of the cylinder.

Edit: in general, a lot of sources on Bernoulli's principle I find are meant specifically for flow along a pipeline, which is not the situation I have here

Edit: Effusion is not a factor, the difference in pressure is expected to be about 1 atmosphere, the hole is about 15 mm, and the cylinder itself is 5.5 inches wide and 26 inches tall.