Wouldn't v1 be a function of the pressure drop here? The LHS of the equation should be taken to as much detail as the RHS. Use the equation for compressible gas flow in a pipe for the LHS? You can't assume that the mass influx is constant by any stretch. At least not with a centrifugal or axial compressor. Maybe with a positive displacement pump you could but that isn't so common in gas transport as far as I know.
If Q is mass flow rate, M is mass in tank, then Q(P)=dM(P)/dt=MdP/dt, therefore t=integral(M/Q)dP or something along those lines, between P1 and pump supply pressure.
Note: in your equation, it should be d(Pi-P)/dt. Driving force decreases with time as stated above.
Going with an ideal gas, because I don't want to complicate things with z, M=P.V.MW/R/T. Simplify to M=k1.P
Q=((pi^2.D^5)/(8.rho.f.L))^.5(Psupply-P)^.5 using Bernoulli's. Lets simplify to Q=k2.(Psupply-P)^.5
Therefore I have t=integral(k1.P)/(k2.(Psupply-P)^.5)dt=[k1/k2.(P-Psupply.ln(Psupply-p)](Integrate between the P that indicates a full tank and P at t=0)
This is all rather quick and dirty, so if I've misremembered the gas flow through a pipe equation or made an error in my calcs feel free to weigh in but this is my take on things.
You could always do a numerical solution to get a feel for the answer too if the calculus is a bit much. I admit I had to google the integral of P/sqrt(Psupply-P). Matlab or whatever it is you use.
Hopefully I'm vaguely on track here. I'm really curious to see what the correct answer is actually.
Edit: I think I've used the calc for liquid flow in a pipe, but the idea should be roughly the same.
Edited by black friday, 16 September 2009 - 10:53 PM.