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?