Pressurized tank emptying over time through a given area I having difficulty wrapping my head around a concept that I wish to solve. There exists a 10L tank of compressed air at 100psi. When an outlet hole of cross-sectional area of 0.115 $in^2$ is opened, I wish to develop a curve of pressure vs. time from $t=0$ until pressure drops from 100psi to atmospheric (0 psi). Many things can be neglected in this situation, such as friction etc., since I would like a general curve to compare with experimental data. I am unsure of how to apply fluid dynamics to a vessel that empties simply due to its own pressure difference through an area.
Temperature can be assumed to be constant at 25C as well.
 A: Starting with the conservation of mass for the system
$$ \frac{dm}{dt} = -\rho v A \tag{1}$$ 
with $m$ the mass of the gas, $\rho$ its density, $v$ its velocity and $A$ the area of the hole
where $m = n/M_w$ and $ n = PV/RT $, this simplifies to
$$ \frac{d}{dt}(\frac{PV}{RTM_w}) = -\rho v A \tag{2}$$ 
The gas volume will remain constant, but the pressure will not (im assuming constant T as well, it gets real messy if its not ).  Simplifying a bit substituting the density with the ideal gas law, we find
$$ \frac{V}{RTM_w}\frac{dP}{dt} = -\frac{M_wP}{RT} v A \tag{3}$$ 
Simplifying a bit
$$ \frac{1}{P}\frac{dP}{dt} = -\frac{M_w^2A}{V} v  \tag{4}$$ 
You wish to find $P$ but cant integrate just yet because $v$ is time and pressure dependent, so we need expressions for $v$
So, according to Bernoulli, 
$$v^2 = \frac{2(P-P_{atm})}{\rho} \tag{5}$$
again, replacing the density with ideal gas law,
$$v^2 = \frac{2(P-P_{atm})RT}{M_wP} \tag{6}$$
Simplifying a bit
$$v^2 = \frac{2RT}{M_w} - \frac{2RTP_{atm}}{M_w}\frac{1}{P} \tag{7}$$
Taking the square root and grouping constants,
$$v = \sqrt{\alpha - \beta\frac{1}{P}} \tag{8}$$
Substituting (8) into (4) and grouping the constants in (4), we end up with
$$\frac{dP}{dt} = -\gamma P \sqrt{\alpha - \beta\frac{1}{P}}  \tag{9}$$ 
Now you can integrate.  That is waaaay above my skill level to do analytically but wolfram did something
$$P(t) = \frac{e^{-c_1 \sqrt{\alpha}  -\gamma t \sqrt{a}} (\beta e^{\gamma t\sqrt{\alpha}} + e^{c_1 \sqrt{a} })^2}{4 a}$$
No idea if that is even remotely correct.  I would just do equation (9) numerically
EDIT:  Did it numerically with your data 

I cant figure how to change the colour of the graph in Polymath but I think its good enough to get a general idea.  The gas losses 99.99698% of its initial pressure over 150 seconds.  The wolfram analytical answer might actually be correct it seems
EDIT2:  In your practical experiments it might take longer because of cooling effects of the gas, but I dont know how much longer.  A good starting point if you want to derive such a system, is to start at equation (2) and use the chain rule on the P/T terms (Volume of the system is constant, so isochoric equations might help).  It produces the problem of having to find equations for P' and v as before, but also T'.  And I dont have a plan to do that at the moment because I cant seem to use the first law of thermo without producing another term (Q' in this case) because the PV work is zero, and therefor have no way of relating T' to anything else.
EDIT3:  Perhaps one could use an enthalpy approach.  $dH = TdS + VdP$ and $dS = dQ/T$ , so that $dH = dQ + VdP$.
Therefor $C_pdT = C_vdT + VdP$
Simplifying delivers $(C_p-C_v)dT = VdP$
Here is where it starts getting tricky again.  Normally, Cp and Cv are temperature dependent.  Divide them out, and then you have an equation for dT  (albeit dirty) that can be replaced in the modified equation (2) so that equation (2) is only an ODE in Pressure.  Solving that one and the temperature one simultaneously might produce a more realistic answer.  I could be wrong though, so take EDIT3 with a grain of salt
EDIT4:  Reply to comments got too long
Changing it to allow for a slightly larger initial pressure is a trivial exercise, really.  Graph shape will remain the same, initial condition only changes.  Regarding the "realism" of it, it might be faster in real life because a quick check on the gas velocity showed that it was just over the speed of sound (initially).  This means your well above the rule of thumb of mach 0.3 limit for in-compressible fluids.  I do not have enough practical or mathematical experience to give an estimate on how a real gas would change the system.  Doing that is a lot of work, where your choice of assumptions would definitely impact the result, e.g fugacity based approach.  For your second comment, yes of course.  Simply use the ideal gas law to relate the quantities.  $\rho = PM_w/RT$.  Doing it in chunks, yes of course.  I manually chose the run time of the model.  In chunks you will need better software than Polymath so that you have exit conditions and such for your loops.  Matlab would be great at it.  Simulink would work too if you know/can find out how triggers work.  If you want to iterate every 10psi to find a "simpler" solution to the problem, you will merely have an approximate version of what I have here.  Here, essentially, Im running it in 0.002psi increments. 
A: This can be solved as compressibel flow problem. You have to solve it by two different equations first one is for the choked flow and second is unchoked flow. You can find solution for choked flow in any compressible flow book like Zucrow etc. For unchoked flow search paper of D R Chenoweth on osti.org (section C ) specifically. or the paper of J.C.Dutton or R.E.CoverDill.
A: Well, I made the calculations and solved the diff eq analytically.
The tank with your data (10 liters, $p_0$=6.8 bar, the hole of 0.115 $in^2$, which is 9,7 mm in diameter) empties in 1.05 sec. which is a plausible value.
You made some errors in deriving your eq.
My eq is
$$
\frac {dx}{dt}=-\frac{A_0}{V_0}\sqrt{\frac{2RT}{M_w}}\sqrt{x(x-1)}
\tag{1}
$$
where $V_0$ is the volume of the tank and $A_0$ is the exit area, $x=\frac{p}{p_A}$, where p is the tank pressure, $p_A$ is the atmospheric pressure, so x is the pressure in bars. Let $x_0$ be the initial pressure.
Then, the exact solution of this equation will be
$$
x(t)=\frac 1 8 \frac{4(C e^{-Kt})^2+4Ce^{-Kt}+1}{Ce^{-Kt}}
\tag{2}
$$
with
$$
K=\frac{A_0}{V_0}\sqrt{\frac{2RT}{M_w}}
$$
and C is a constant found from initial condition $x(0)=x_0$
$$
C=x_0+\sqrt{x_0(x_0-1)}-\frac 1 2
$$
Then, the emptying time (i. e. t when $p=p_A \implies x=1 $) will be finite and equal to
$$
T_e=-\frac{\log\frac{1}{2C}}{K}
$$
Note that when $p_A=0$ then x-1 becomes x and equation (1) simplifies to
$$
\frac {dx}{dt}=-\frac{A_0}{V_0}\sqrt{\frac{2RT}{M_w}}x
$$
i. e.
$$
\frac {dx}{dt}=-Kx
$$
and in this case
$$
x(t)=x_0 e^{-Kt}
$$
so in vacuum the pressure will drop exponentially.
For 10-100x smaller leak areas this model gives acceptable results and the pressure drop is sufficiently slow to be isothermal.
A: This is not an easy problem as you're not working with an ideal incompressible gas, to solve this you need look equations that allow for compressible gas.
This throws easy equations such as Bernoulli out of the windows. Bernoulli
With liquids this is muchs easier to calculate often since you need higher pressures for compression. 
Also as it's compressible you'll get adiabatic expansion, this means that the tank/gas is actually going to cool down, due to the expanse and it's not a little bit (at least initially when the pressure is much higher than atmospheric).
You can not neglect this as it affects density, that makes this all a very complicated problem and not something that can be easily simplified.
Solutions are either take a look at the Navier-Stokes equation and use a simulation software like Comsol.
Or take a look at this paper that calculates what you are asking for, all the equations are already there:
Link to the article to do the calculations
It would take some time but in about 10-30 minutes you could solve your problem and plot it in excel/Matlab.
Ps just to give you an idea of how much it cools, form $25^oC$ to around $-130^oC$
Want to calculate it yourself go here


*

*moles 0.274 

*volume initiallly .01 $m^3$ 

*Final volum 0.031 $m^3$

*Initial Temp 298 $K$
