# Tank draining with piston

I am trying to solve a problem which is close to the tank draining (as here Fuel tank draining) but with a piston a the top of the tank which means $$p_\mathrm A$$ different of $$p_\mathrm B$$.

I search the velocity $$V_\mathrm A$$ at which I have to push the piston to have an out flow rate $$Q$$ (which is imposed).

\begin{align} p_\mathrm A+\rho g z_\mathrm A+\frac12\rho V_\mathrm A^2&=p_\mathrm B+\rho g z_\mathrm B+\frac12\rho V_\mathrm B^2\\ z_\mathrm A-z_\mathrm B&=h\\ p_\mathrm B&=0\\ V_\mathrm AS_\mathrm A&=V_\mathrm BS_\mathrm B=Q \\ p_\mathrm A+\rho gh+\frac12\rho\left(V_\mathrm A^2-\frac{Q^2}{S_\mathrm B^2}\right)&=0 \end{align} But I have two unknows $$V_\mathrm A$$ and $$P_\mathrm A$$. Should I use something else to link the pressure to the velocity?

Your equations are correct. It's just that you have a degree of freedom. You can obtain a relationship between the force you exert and the velocity you obtain by modeling the piston itself: $M_p\frac{\partial^2 V_a}{\partial t^2}=S_ap_a$, where $M_p$ is the velocity of the pistol and assuming the friction forces are negligible.