- #36
Juanda
Gold Member
- 426
- 150
Messy is an understatement for me. I had never seen this version of Bernoulli. Fluids are hard... Anyways, this just proves this problem is a chance to learn some new things for me.erobz said:I was wrong about this, it gets messy.
We need to be using "Unsteady -Bernoulli"1 which says in general:
$$ P_1 + \rho g z_1 + \frac{1}{2}\rho v_1^2 = \int_1^2 \rho \frac{\partial v_s}{\partial t} ds + P_2 + \rho g z_2 + \frac{1}{2}\rho v_2^2 \tag{1}$$
After reading the PDF you shared here's my attempt to show the equations before moving into coding where traceability will be much harder. I want to ensure we agree on the methodology before crunching numbers and plotting graphs. I'll express everything in terms of flow instead of velocities which I believe is more closely related to what we're interested in.
I'll need to redraw the diagram and rename a few things. I hate doing it at this stage but I need to do it to keep track of the relevant points and variables assigned to them.
$$\int_{P}^{D}\rho\frac{\partial v}{\partial t}ds +P_D + \frac{1}{2}\rho v_D^2+\rho g (H+z_D) - P_P-\frac{1}{2}\rho v_P^2 - \rho g z_P = 0 \tag{2}$$
Taking into account the height of ##P## is zero and writing the velocities in terms of flow yields ##(3)##
$$\int_{P}^{D}\rho\frac{\partial v}{\partial t}ds +P_D + \frac{1}{2}\rho \left ( \frac{Q_2}{S_T} \right ) ^2+\rho g (H+z_D) - P_P-\frac{1}{2}\rho \left ( \frac{Q}{S_p} \right ) ^2 = 0 \tag{3}$$
Considering ideal gas law and constant temperature then the pressure of the air inside tank 2 can be expressed in relation to its water level. That it'll be equation ##4##.
$$P_DV_2=m_2RT \ \left \{ V_2=S_T(H_T-z_D) \right \} \rightarrow P_D= \frac{m_2RT}{S_T(H_T-z_D)} \tag{4}$$
The water level ##z_D## is related to the water flow ##(5)##.
$$z_D = z_{D_0}+\frac{Q_2}{S_T}t \tag{5}$$
Combining ##(4)## and ##(5)##, ##(6)## is obtained.
$$P_D= \frac{m_2RT}{S_T(H_T-\left (z_{D_0}+\frac{Q_2}{S_T}t \right ))} \tag{6}$$
The equation ##(5)## can also be used on ##(3)##. The results from ##(6)## will be implemented too to give ##(7)##.
$$\int_{P}^{D}\rho\frac{\partial v}{\partial t}ds +\left (\frac{m_2RT}{S_T(H_T-\left (z_{D_0}+\frac{Q_2}{S_T}t \right ))} \right ) + \frac{1}{2}\rho \left ( \frac{Q_2}{S_T} \right ) ^2+\rho g (H+\left (z_{D_0}+\frac{Q_2}{S_T}t \right )) - P_P-\frac{1}{2}\rho \left ( \frac{Q}{S_p} \right ) ^2 = 0 \tag{7}$$
Pressure at P (##P_P##) is an input value for the problem so I'll consider it known. Its expression is ##(8)##.
$$P_P = P_{atm}+\rho g h_{pump}(Q)\rightarrow P_P = P_{atm}+ \rho g \left ( \alpha - \beta Q^2 \right ) \tag{8}$$
Using the information from ##(8)## into ##(7)## gives ##(9)##.
$$\int_{P}^{D}\rho\frac{\partial v}{\partial t}ds +\left (\frac{m_2RT}{S_T(H_T-\left (z_{D_0}+\frac{Q_2}{S_T}t \right ))} \right ) + \frac{1}{2}\rho \left ( \frac{Q_2}{S_T} \right ) ^2+\rho g (H+\left (z_{D_0}+\frac{Q_2}{S_T}t \right )) - \left (P_{atm}+ \rho g \left ( \alpha - \beta Q^2 \right ) \right )-\frac{1}{2}\rho \left ( \frac{Q}{S_p} \right ) ^2 = 0 \tag{9}$$
Finally, it is necessary to evaluate the path integral in ##(9)## that goes from ##P## to ##D##. Before doing it I want to clarify the change of variable to have it in terms of the flow instead of the velocity ##(10)##.
$$\rho\frac{\partial v}{\partial t}ds \rightarrow \left \{ v=\frac{Q}{S} \right \} \rightarrow \frac{\rho}{S}\frac{\partial Q}{\partial t}ds \tag{10}$$
Here is something that mathematically might not be expressed correctly because I'll go from a general variable ##Q## between the points ##P## and ##D## to the specific flows ##Q_2## and ##Q## in the pipes. I'll write the "generic" flow with ##Q_g## and the generic section with ##S_g## to be able to tell the difference. This will be the equation ##(11)##.
$$\int_{P}^{D}\rho\frac{\partial v}{\partial t}ds = \int_{P}^{D} \frac{\rho}{S_g}\frac{\partial Q_g}{\partial t}ds \tag{11}$$
According to the document from MIT, that integral from ##P## to ##D## can be simplified to the integral from ##P## to ##F## because ##S_T>>S_P## which only considers what's going on in the pipes. In this case, it is necessary to note the distinction in the flow from ##P## to ##A## and from ##B## to ##F## because the velocities/flow rates will not be the same. Equation ##(12)##.
$$\int_{P}^{D} \frac{\rho}{S_g}\frac{\partial Q_g}{\partial t}ds = \int_{P}^{A} \frac{\rho}{S_p}\frac{\partial Q}{\partial t}ds+\int_{B}^{F} \frac{\rho}{S_p}\frac{\partial Q_2}{\partial t}ds=\frac{\rho}{S_p}\left ( \frac{\partial Q}{\partial t}L_{PA} + \frac{\partial Q_2}{\partial t}(H+L_{JF})\right ) \tag{12}$$
The expression from ##(12)## can be plugged in ##(9)## to obtain the final expression of Unsteady Bernoulli from ##(2)## for Tank 2. Equation ##(13)##.
$$\frac{\rho}{S_p}\left ( \frac{\partial Q}{\partial t}L_{PA} + \frac{\partial Q_2}{\partial t}(H+L_{JF})\right ) +\left (\frac{m_2RT}{S_T(H_T-\left (z_{D_0}+\frac{Q_2}{S_T}t \right ))} \right ) + \frac{1}{2}\rho \left ( \frac{Q_2}{S_T} \right ) ^2+\rho g (H+\left (z_{D_0}+\frac{Q_2}{S_T}t \right )) - \left (P_{atm}+ \rho g \left ( \alpha - \beta Q^2 \right ) \right )-\frac{1}{2}\rho \left ( \frac{Q}{S_p} \right ) ^2 = 0 \tag{13}$$
Following the same logic it is possible to obtain the expression for Unsteady Bernoulli applied to Tank 1.
Finally, with the conservation of mass ##Q = Q_1+Q_2##, I feel there is enough information to solve the system and obtain the functions ##Q(t)##, ##Q_1(t)## and ##Q_2(t)## although I'd love to have confirmation about it if you know it for sure.
If we are on the same page about the procedure then I'd be ready to put it into Python to try solving it which will probably be a challenge in itself because I don't have a lot of experience with it.
Last edited: