Stand With Ukraine

Saturday, September 6, 2025

Physics problem: viscous flow in a cylindrical pipe

This problem is related to the previous one, where we discussed a setup with a fluid flow between two horizontal plates. The solution method is very similar, with a difference that here we select a cylindrical element and consider forces acting on it.

Problem statement

A liquid is pumped from one container to another through a long pipe of radius $R$ and length $l$. Determine the flow velocity in the pipe as a function of distance to its axis (i.e. to the center of the pipe). Given that the pressure drop between the two ends of the pipe is $\Delta P$ and the dynamic viscosity of the liquid is $\eta$.

Problem statement is taken from Savchenko et al (1981) book and translated by the post author.

Exploiting the symmetry around the axis of the pipe we select a coaxial cylinder of radius $r$ in the flow and investigate forces acting on it.

No description has been provided for this image
Figure 1: Flow in pipe of length $l$ and radius $R$.


If we denote the viscosity stress along the cylinder's sides and parallel to its axis as $\tau_x(r)$, then we can write the balance of the viscous and pressure gradient forces acting on it, along the $x$-axis, as:

\begin{align*} & \tau_x(r) \cdot 2\pi r l + \Delta P \cdot \pi r^2 = 0 & \Rightarrow \\ & \tau_x(r) = -\frac{\Delta P r}{2 l} & \end{align*}

Now we can use the expression linking viscous stress and flow velocity gradient through the dynamic viscosity to determine the flow velocity as follows:

\begin{align*} & \tau_x(r) = -\frac{\Delta P r}{2 l} = \eta \frac{dv}{dr} & \Rightarrow \\ & \frac{dv}{dr} = -\frac{\Delta P r}{2 l \eta} & \Rightarrow \\ & \int\limits_{R}^{r} \frac{dv}{dr}\,dr = -\int\limits_{R}^{r}\frac{\Delta P r}{2 l \eta}\,dr & \Rightarrow \\ & v(r) - v(R) = -\frac{\Delta P \left( r^{2} - R^{2} \right) }{4 l \eta} \\ \end{align*}

Now using the non-slip condition at the pipe walls (i.e. $v(R) = 0$), we get the final expression for the flow velocity at a distance $r$ from the pipe axis: \begin{align*} \boxed{ v(r) = -\frac{\Delta P \left( r^{2} - R^{2} \right) }{4 l \eta} }. \end{align*}

Saturday, August 30, 2025

Physics problem: viscous flow between two horizontal plates

Problem statement

Determine velocity of fluid in a stationary flow between two fixed horizontal plates as a function of position between the two plates. The distance between the plates is $h$ and the dynamic viscosity of the fluid is $\eta$. The pressure drop in the direction of the flow per unit length is $\frac{dP}{dx}=-\Delta P$. Additionally, compute the fluid discharge per unit of horizontal length perpendicular to the flow.

Problem statement is taken from Savchenko et al (1981) book and translated by the post author.

Solution

Tihs is not a praticularly complicated problem, but I find it important for understanding the momentum exchanges between layers of viscous fluids and it does not require very deep knowledge of the process but allows us to draw some interesting insights.

Let's introduce a coordinate system with $x$-axis along and pointing in the direction of flow, $z$-axis in the vertical direction upwards, and $y$-axis in the horizontal direction transversal to the flow and perpendicular to the plane formed by $x$ and $z$ axes. The origin of the coordinate system $O$ is on the lower plate (see Figure 1).

No description has been provided for this image
Figure 1: Vertical cross-section of the viscous flow between to horizontal plates. $y$-axis is perpendicular and points into the figure plane.


Since the flow is stationary and horizontally uniform the flow velocity is only a function of the vertical coordinate $z$: $v(z)$.

We assume a non-slip boundary condition near the horizontal plates: $v(z=0)=v(z=h)=0$. Additionally, we assume that the stress (friction force per unit of contact area between horizontal layers of the fluid, $\tau_x$) due to viscosity decreases towards the plane of symmetry of the flow: $z=h/2$, i.e the layers of the fluid closer to the middle have higher velocities. Therefore, we can determine $v(z)$ for $z \in [0, h/2]$ and then use the symmetry of the flow to find the velocity for $z \in [h/2, h]$.

Let's consider an element of fluid with dimensions $(\Delta x, \Delta y, \Delta z = h - 2z)$ with it's lower face at $z \in [0, h/2]$ and parallel to the axes $x$ and $y$. Assuming that the viscous stress $x$-coordinate $\tau_x(z)$ is negative, we can express the balance of the forces acting on the selected element of fluid along the $x$-axis as follows:

\begin{align*} \tau_x(z) \cdot \Delta x \cdot \Delta y + \tau_x(z + \Delta z) \cdot \Delta x \cdot \Delta y + \Delta P \cdot \Delta x \cdot \Delta y \cdot \Delta z = 0 \end{align*}

It is easy to see that with $\Delta z = h - 2z$ the upper and lower faces of the selected element are symmetric with respect to the middle plane of the flow ($z=h/2$), and are at the same distance from the upper and lower plates respectively (this is by design of our imaginary flow element) which means that $\tau_x(z + \Delta z) = \tau_x(z)$. Then we can simplify the above balance of forces as:

\begin{align*} & 2 \tau_x(z) + \Delta P \cdot \Delta z = 0 & \Rightarrow \\ & 2 \tau_x(z) + \Delta P \cdot (h - 2z) = 0 & \Rightarrow^{\,} \\ & \tau_x(z) = -\frac{\Delta P}{2} (h - 2z) & \end{align*}

The above expression for the stress is valid for $z \in [0, h/2]$.

Let's now determine $v(z)$ for $z \in [0, h/2]$ and then we'll use the symmetry of the flow to extend the solution to the whole range $z \in [0, h]$.

We can now use the relation between the velocity and the stress through the dynamic viscosity $\eta$:

\begin{align*} \tau_x(z) = -\eta\frac{dv}{dz}, \; z \in [0, h/2] \end{align*}

Using previously derived expression for $\tau_x(z)$ and then integrating we get:

\begin{align*} & -\frac{\Delta P}{2} (h - 2z) = -\eta\frac{dv}{dz} & \Rightarrow \\ & v(z) = \frac{\Delta P}{2\eta} \left( hz -z^{2} \right) + C & \end{align*}

where $C$ is the constant of integration.

Then using the non-slip condition at the plates we determine the integration constant as $C = v(z=0)=0 \Rightarrow C=0$ and the final expression for the velocity profile is:

\begin{align*} v(z) = \frac{\Delta P}{2\eta} z (h - z), \; z \in [0, h/2]. \end{align*}

Now for $z \in [h/2, h]$ we can use the flow symmetry to express the flow velocity as:

\begin{align*} \hat{v}(z) = v(h - z) = \frac{\Delta P}{2\eta} (h - z) z, \; z \in [h/2, h]. \end{align*} which, curiously, is the same expression as for $z \in [0, h/2]$, therefore finally the flow velocity profile can be expressed using a single formula:

\begin{align*} \boxed{v(z) = \frac{\Delta P}{2\eta} (h - z) z, \; z \in [0, h]} \end{align*}

In the second part of the problem we are asked to compute the flux density per unit of length in $y$ direction, i.e. $q=\frac{dQ}{dy}$. This is just a simplification for us to use a simpler flux expression ($\int{v\,dz}$) instead of the more general one ($\iint{v\,dy\,dz}$).

Therefore we obtain the flux density by integrating the above profile:

\begin{align*} &q=\int\limits_{0}^{h}v(z)\,dz & \Rightarrow \\ &q=\int\limits_{0}^{h} \frac{\Delta P}{2\eta} (h - z) z \,dz &\Rightarrow \\ &q= \frac{\Delta P}{2\eta} \left(\frac{h^{3}}{2} - \frac{h^{3}}{3} \right) & \Rightarrow \\ &\boxed{q= \frac{\Delta P h^{3}}{12\eta}} & \end{align*}

Wednesday, April 2, 2025

Setting up a screen lock with i3 on lightdm

As you might know there are many basic things, which are done automatically for you by GNOME and KDE, you have to do with i3 window manager yourself. One such thing is the screen locking functionality. If you are using lightdm login manager then there is a nice way to make it in the following manner:

# install the light locker (for arch-based distros)
yay light-locker
  
# add the following lines to your ~/.config/i3/config
exec_always --no-startup-id /usr/bin/light-locker
bindsym $mod+l exec --no-startup-id light-locker-command --lock
The last line is needed to be able to lock the screen with $mod+l combination. My $mod=Win, so I get to lock my screen with Win+l.

What I like about this approach is that it brings you to the lightdm login window, which is how I expected the locking to behave before I started using i3.

Wednesday, March 26, 2025

Physics problem: Collapsing spherical cavity (bubble) in a water pond

Consider a collapsing spherical cavity in a large pond of water. The initial pressure of water in the pond is $P_0$, the initial radius of the cavity is $R_0$. Determine the speed of the edge of the cavity when its radius reaches $r_0$ ($r_0 < R_0$). The water density is $\rho$.

Note: The problem statement is translated (and slightly modified) from the original text in Savchenko et al 1981.

Discussion

I did not plan on writing up this problem as it seemed trivial to me at first. I thought, ok there is some kind of differential equation to compose and solve.

I tried to use the Newton's law and the energy conservation equation approaches but could not really get it.

I asked ChatGPT, and it came up with a solution based on the energy balance equation, the solution did resemble the correct one but it was off by a constant factor. ChatGPT mentioned the Rayleigh-Plesset equation which helped me to come up with my solution below. But here I decided to base the solution on the Newton's equation of motion to be able to present a self-contained solution, at least from my stand point.

Solution

Let's consider a water parcel at a distance $x$ from the center of the cavity $C$ (see the figure below).

No description has been provided for this image
Figure 1: Cross-section of collapsing cavity in a large pond. Dashed circles show positions of the cavity's edge when its sizes are $R_0, r, r_0$.

The pressure gradient will act to accelerate the parcel towards the point $C$.

\begin{equation} \rho \frac{dv}{dt} = -\frac{\partial P}{\partial x} \end{equation}

where $v=v(x, t)$ - is velocity of the water parcel at the distance $x$ from the center of the collapsing hollow cavity at time $t$.

We can express the derivative of $v(x(t), t)$ in the above equation by assuming that the parcell travels along a tragectory $x(t)$ and employing the compound function differentiation formula:

\begin{align*} \frac{dv}{dt} &= \frac{\partial v}{\partial t} + \frac{\partial v}{\partial x} \frac{d x}{d t} \\ &= \frac{\partial v}{\partial t} + v\frac{\partial v}{\partial x} \end{align*}

Therefore, the equation of motion takes the following form (this is also known as an Euler form of the equation of motion): \begin{align} \boxed{\frac{\partial v}{\partial t} + v\frac{\partial v}{\partial x} = -\frac{1}{\rho}\frac{\partial P}{\partial x}} \end{align}

Let's consider the continuity equation for the spheres with radii $x$ and $R_0$ and centered around the point $C$:

\begin{align*} & v(x, t) \cdot 4\pi x^2 = v(R_0, t) \cdot 4\pi R_0^2 & \Rightarrow \\ & v(x, t) \cdot x^2 = v(R_0, t) \cdot R_0^2 = F(t) & \Rightarrow \\ & \boxed{v(x, t) = \frac{F(t)}{x^2}} & \end{align*}

Now let's plug the above expression for $v(x, t)$ into the equation of motion:

\begin{align*} & \frac{1}{x^2} \frac{d F(t)}{d t} + \frac{F(t)^2}{x^2}\left(-\frac{2}{x^3} \right) = -\frac{1}{\rho}\frac{\partial P}{\partial x} & \Rightarrow \\ & \frac{1}{x^2} \frac{d F(t)}{d t} - \frac{2F(t)^2}{x^5} = -\frac{1}{\rho}\frac{\partial P}{\partial x} \end{align*}

Let's consider the above equation at a fixed moment in time when the radius of the hollow cavity is $r(t)$. Then integrating the above equation from $r(t)$ to $+\infty$ and using that $P(r) = 0$ and $P(+\infty)=P_0$ we get:

\begin{align*} & \frac{d F(t)}{d t}\int\limits_r^{+\infty}\frac{dx}{x^2} - 2F(t)^2\int\limits_r^{+\infty}\frac{dx}{x^5} = -\frac{1}{\rho}\int\limits_r^{+\infty}\frac{\partial P}{\partial x} dx & \Rightarrow \\ & \frac{1}{r}\frac{d F(t)}{d t} - \frac{1}{2} \frac{F(t)^2}{r^4} = -\frac{P_0}{\rho} & \end{align*}

We can express $F(t)$ using flux continuity at the edge of the cavity as follows:

\begin{align*} F(t) = u(t)r^2 \end{align*}

where $u(t) = dr/dt=\dot{r}$ - is the speed of the edge of the cavity at time $t$ when its radius is $r=r(t)$.

After plugging in the above expression for $F(t)$ into the integrated equation of motion, we get:

\begin{align*} \boxed{\dot{u}r + \frac{3}{2} u^2 = -\frac{P_0}{\rho}} \end{align*}

The above is a particular case of an existing named equation (Rayleigh-Plesset equation: $\ddot{r} r + \frac{3}{2} \dot{r}^2 = -P_0/\rho$, where $\dot{r}=u$).

Finally, to solve the equation we will invert the $r(t)$ function and will consider the speed of the edge of the cavity as a function of the radius of the cavity.

\begin{align*} \dot{u} = \frac{d u}{d r} \frac{1}{\dot{r}} \end{align*}

Replacing the temporal derivative $\dot{u}$, using the above formula, in the initial differential equation we get an easily separable first order differential equation with respect to $u=u(r)$:

\begin{align*} \frac{du}{dr}ur + \frac{3}{2} u^2 = -\frac{P_0}{\rho} \end{align*}

Further, we can separate $du$ and $dr$ and integrate the equation from $R_0$ to $r_0$, taking into account that $u(R_0) = 0$ (i.e. the velocity of the cavity edge was 0 in the beginning when its radius was $R_0$):

\begin{align*} & -\int\limits_{u(R_0)}^{u(r_0)} \frac{u du}{\frac{P_0}{\rho} + \frac{3}{2}u^2} = \int\limits_{R_0}^{r_0}\frac{dr}{r} & \Rightarrow \\ & \ln\left(\frac{\frac{P_0}{\rho} + \frac{3}{2}u_(r_0)^2}{\frac{P_0}{\rho}}\right) = -3 \ln\left(\frac{r_0}{R_0}\right) & \Rightarrow \\ & \frac{P_0}{\rho} + \frac{3}{2}u(r_0)^2 = \frac{P_0}{\rho}\left(\frac{R_0}{r_0}\right)^3 & \Rightarrow \\ & \boxed{\left| u(r_0)\right| = \sqrt{\frac{2}{3}\frac{P_0}{\rho}\frac{R_0^3 - r_0^3}{r_0^3}} } & \end{align*}

So the above expression is the formula for the speed of the edge of the collapsing cavity at the moment when its radius reaches $r_0$ from $R_0$. It is interesting to note that there is a singularity at $r_0 \rightarrow 0$, the speed of the cavity edge increases to infinity.

Sunday, March 9, 2025

Physics problem: acceleration of water level in a container due to draining from an opening in its bottom

Problem statement

From an opening at the bottom of a tall container, water drains out. The cross-section area of the container is $S$, and the cross-section area of the draining stream of water is $\sigma$. The water level in the vessel moves downward with constant acceleration. Determine this acceleration.

Solution

I'll describe two methods to solve the problem: the first one is the one I used and it is based on Bernoulli's law (energy conservation) and the second one is using the Toricelli's formula and accompanying assumptions from the get go. The second one I would guess a more experimented physicist would use and be done with it (see the approach 2). If I were to think about the second approach right away, this post would not happen.

Approach 1

Let's denote the speed of the water at the surface of the container and at the draining hole as $v_0$ and $v_1$ respectively. Then we can write energy and mass conservation expressions for the two cross-sections as follows:

\begin{align*} \begin{cases} \frac{v_0^2}{2} + gh = \frac{v_1^2}{2} \\ v_1\sigma = v_0 S \end{cases} \end{align*}

where $h$ is the current water level in the container, ang $g$ is the acceleration due to gravity.

Now, if we eliminate $v_1$ from the energy conservation equation and apply a time derivative to the both sides of the equation we will obtain the following relation (we use an upper dot to denote a time derivative, $\dot{x}=\frac{dx}{dt}$):

\begin{equation*} 2 v_0 \dot{v_0} + 2g\dot{h}=\left(\frac{S}{\sigma}\right)^2 2 v_0 \dot{v_0} \end{equation*}

Let's denote the acceleration of the water level as $a=\dot{v_0}$, and also note that $v_0 = -\dot{h}$ (the minus sign here is added because the level $h$ is decreasing with time and I prefer to consider $v_0$ as speed value without direction). Using this notation, the previous equation can be written as:

\begin{equation*} 2 v_0 a - 2gv_0=\left(\frac{S}{\sigma}\right)^2 2 v_0 a \end{equation*}

Simplifying we get the following expression for the water level acceleration in the container:

\begin{equation*} a = \frac{g}{1 - \left(\frac{S}{\sigma}\right)^2} \end{equation*}

Now we could consider that the conditions given in the problem statement imply $S\gg\sigma \rightarrow S/\sigma \gg 1$, therefore we can approximate the above expression as:

\begin{equation*} a \approx -g\left(\frac{\sigma}{S}\right)^2 \end{equation*}

Note that $a = \dot{v_0} < 0$, meaning that the water level descent in the container is slowing down with time.

Approach 2

For this approach we recognize right away that the problem conditions allow the use of Toricelli's formula for the speed $v_1$ of draining water from a large container with the water level at $h$:

\begin{equation*} v_1=\sqrt{2gh} \end{equation*}

The draining water will cause the change to the water level as follows: \begin{align*} \dot{h}=-v_1\sigma/S=-\frac{\sigma}{S}\sqrt{2gh} \end{align*}

If we apply a time derivative to the above equation and substitute $\dot{h}$, we obtain:

\begin{align*} \ddot{h} & =-\frac{\sigma}{S}\sqrt{2g}\frac{1}{2\sqrt{h}}\dot{h} \\ & = g\left(\frac{\sigma}{S}\right)^2 \end{align*}

Since the water level acceleration is $a = \dot{v_0} = d_t \left( -\dot{h} \right) = -\ddot{h}$, we obtain the final expression using the above relation for the second derivative of the water level as:

\begin{align*} a = -g\left(\frac{\sigma}{S}\right)^2 \end{align*}

Note that in this case we did not have to make any approximations as they were already applied for the Toricelli's formula to be valid (mainly that the speed of the water level $v_0$ is much lower than the draining speed $v_1$).