Chapter 4
Viscosity
Lift a spoonful of honey and it stretches out in a long, unbroken thread. Tip a jar of honey and it holds on for a while before it slowly runs. Water pours out at once. In honey, when one part moves, the fluid beside it is dragged along, and the fluid being dragged holds the moving part back. This sharing of velocity between neighbouring bits of fluid is viscosity. It is also why, in chapter 0, turning the viscosity up made the same stir roll up thick and smooth, with the small swirls dying out first. This chapter shows how viscosity shares velocity out, and what shape that gives to the flow near a wall and to the flow in a channel. The term highlighted in the equation bar is viscosity.
Sharing velocity with the neighbours
In the experiment below, a single thin layer in the middle slides to the right through fluid at rest. Of the engine’s terms, only the viscosity term is on. For the first 8 seconds the fluid is water; after that it is honey. The white arrows are the speed measured along one line on the left, and the green dashed line is the profile the equation below gives. The Fluid switch picks water or honey.
Side note
This experiment has only the viscosity term on; the outside force, advection and the pressure projection are off. In a flow that is the same everywhere along the stage, as this layer is, advection and pressure change nothing, so only what viscosity does is left. There are no walls: the top and bottom of the stage join, as its left and right do. The water and honey on screen do not have their real values. The water’s is 0.00001 and the honey’s 0.001 (dimensionless values), so the honey on screen is 100 times as viscous as the water. Real honey is thousands of times as viscous as water (see “Two misconceptions” below); at that ratio, in a few seconds either nothing would show in the water or the layer would spread out in an instant in the honey. In a browser without WebGPU, a recorded video plays instead, and the video cannot switch fluids.
In water, the layer has hardly changed after 8 seconds. Switch to honey, and the layer spreads up and down. The fast fluid in the middle drags the layers beside it and speeds them up, and they hold the middle back. So the layer widens and slows. Ten seconds after the switch to honey, the layer is nearly four times as wide as at the start, and its middle has slowed to about a quarter of its first speed. Yet the momentum the whole layer carries to the right stays the same: whatever the fast layer loses, its neighbours gain. Viscosity does not destroy momentum; it spreads it sideways. Momentum spreads the way a drop of ink spreads in water: viscosity is the diffusion of momentum. And there is no wall in this experiment. Viscosity is not friction against a wall; it is a force that neighbouring layers exert on each other inside the fluid.
The viscosity term: closing in on the neighbours’ average
In a layer whose velocity changes only with the height , the equation of motion with nothing but the viscosity term left is:
A second derivative measures a difference from the neighbours. Written with the two neighbours a distance above and below:
The bracket is the neighbours’ average minus the layer’s own velocity. A layer faster than the average of its neighbours gets a negative value and slows down; a slower one gets a positive value and speeds up. Every layer closes in on the average of its neighbours, and the differences in velocity smooth out. In the plane, looks at four neighbours, and it acts on both components of the velocity alike. This is the viscosity term of the Navier–Stokes equation:
is the kinematic viscosity: the viscosity , which measures how thick a fluid is, divided by the density , in units of m²/s. When this chapter talks about how viscous a fluid is, it means this . What sets how fast a difference in velocity spreads is , not : for the same pull from its neighbours, a denser fluid speeds up less.
The distance it spreads grows with the square root of time. The layer in the experiment widens like this, being its width (the standard deviation); the green dashed line follows it:
Since the distance grows as , a difference in velocity across a width takes a time of about to even out. Twice as wide takes four times as long, and 100 times the takes 1/100 of the time. That is why the layer on screen widened 100 times as fast in honey as in water.
Side note
The engine solves the viscosity term implicitly: it takes the velocity one step ahead as the unknown, writes for each cell an equation linking it to its neighbours, and runs a fixed number of red-black Gauss–Seidel sweeps. When is large, a fixed number of sweeps leaves the equation under-solved, and the velocity spreads more slowly than it should. This experiment’s grid is 242×136 on every device; for its honey the value is 0.31, so 20 sweeps a step are plenty: the growth of the layer’s variance matched within 0.02 %, and the profile matched the green dashed line within 0.3 % of the middle’s speed, as measured on the author’s computer.
Water sticks to walls
In the channels of chapters 1 and 2, the water slid along the walls. Formulas drew those flows, and their side notes said that real water sticks to the walls and stops. Fluid touching a solid surface moves with the surface’s velocity: at rest on a wall at rest, along with a wall that moves. This is called the no-slip condition. It is not derived from the equations; it is an observed fact, and it holds well for ordinary liquids and gases flowing at everyday scales. All a wall sets is the velocity of the single layer of fluid touching it. Carrying that velocity on beyond it is the work of viscosity inside the fluid.
In the experiment below, water fills the gap between a floor at rest and a plate that slides to the right along the top. The white arrows and the green dashed line are as in the experiment before. The Plate speed slider sets how fast the plate slides, and which way.
Side note
The moving plate is one of the engine’s obstacles: a rectangle filling the top of the stage, whose surface gives the fluid touching it the plate’s speed. The engine makes obstacles of whole cells, so the plate’s speed sits at the centre of its lowest row of cells, at height 0.9007, about a tenth of a cell above the face drawn on screen (0.9); the green dashed line takes that height for the plate. This experiment, too, has only the viscosity term on: for layers sliding past each other, the other terms change nothing. The water in this gap has a of 0.03, 3,000 times that of the first experiment’s water. The values are dimensionless, and in real water the same thing happens in the same time across a gap about 5 mm wide. The grid is 242×136 on every device, and the viscosity is solved with 80 sweeps a step. The white arrows matched the green dashed line within a little over 1 % of the plate’s speed, and within 0.02 % once the flow had settled into its straight line. In a browser without WebGPU, a recorded video plays instead, and the video cannot change the plate’s speed.
When the plate starts to move, the water touching it follows first, then the layer below is dragged along, then the one below that. The plate’s momentum spreads down toward the floor. After about 10 seconds, the speed across the gap is a straight line from the plate’s speed down to zero at the floor. On a straight line, every layer’s neighbours average exactly its own speed (the second derivative is zero), so the viscosity term is zero and the flow stops changing. The plate drags the water and the floor holds it back, and in every layer the pull from the layer above now equals the hold from the layer below. With the plate’s speed and the gap between plate and floor:
The straight line takes a time on the scale of to settle, as the estimate in the last section says; here is 27 seconds. The difference from the straight line shrinks to about a third every 2.7 seconds, so after 10 seconds only about 3 % of it is left; those 2.7 seconds are divided by . The estimate gives the scale of the time; the time a flow actually takes to even out is usually a good deal shorter. Reverse the plate, and the water nearest it turns first while the water near the floor runs on forward for a while. Stop the plate, and plate and floor both hold the water back, so all of it slowly comes to rest.
A parabola in a channel, and the pressure
Now go back to the channels of chapters 1 to 3. In the experiment below, water comes in at the left end at the same speed all across, passes between the two walls above and below, and leaves at the right end. This time the water sticks to the walls. The white arrows are the speed measured across one section far from the inlet. The Viscosity switch doubles the water’s viscosity, and you can stir the water by dragging the mouse across it, or a finger on a phone.
Side note
This channel is a flow in the plane, between two plates above and below. In a round pipe the profile is a parabola too, but its mean speed is 1/2 of its fastest (2/3 between plates), and the pressure difference is , where is the diameter. Every term is on. The water in this channel has a of 0.02, 2,000 times that of the first experiment’s water; it comes in at 0.2, and the channel’s width and the density are 1. The values are dimensionless: in real water this is the flow through a slot about 7 mm wide at about 1.4 mm/s. The grid is 240×135 on every device, and the viscosity is solved with 160 sweeps a step ( is 6.1, and 12.2 when doubled). The two corners of the inlet, where the water coming in evenly stops dead at the walls, make the pressure jump: the pressure layer shows them as bright spots. The section of the white arrows (x = 1.3) is far enough from the inlet that the flow no longer changes along the channel. The green dashed line is the solution for a flow starting at a fixed flow rate in such a channel, and it matched the white arrows within 1 % from half a second on. In a browser without WebGPU, a recorded video plays instead, and the video cannot change the viscosity or be stirred.
The water comes in at the same speed across the section. Then the water touching the walls stops and slows its neighbours, and since the same amount must pass every section in the same time (chapter 2), the middle speeds up by as much as the edges slow down. At the section of the white arrows the profile becomes a parabola in about 2 seconds, much sooner than the estimate: here is 50 seconds, but the difference from the parabola shrinks to about a third every 0.6 seconds ( divided by about 80). On the speed layer, the speed that was even at the inlet gathers toward the middle along the channel. Where the flow has settled and no longer changes in time or along the channel, only pressure and viscosity are left in the equation of motion:
The velocity changes only with height and the pressure only along the channel, so each term must be a constant. A profile whose second derivative is constant is a parabola. The parabola that is zero at the walls ( and ) and has the mean speed is the one below; its fastest point, in the middle, is 1.5 times the mean.
Pushing this profile along takes a pressure that falls evenly along the channel. Viscosity holds the water back at the walls, and a pressure difference must always push by as much. The two equations above give the pressure gradient:
For a channel of length , the pressure difference is . It grows with the length, the mean speed and the viscosity, and it is inversely proportional to the square of the channel’s width. Switch the pressure layer on: the pressure is high on the left (orange) and falls evenly toward the right. The experiment measures a gradient of −0.0485, within 1 % of the equation’s −0.048. Double the viscosity, and the pressure difference doubles too (a measured gradient of −0.0955, against the equation’s −0.096), but the flow rate is the same, so the parabola stays as it was.
This is the promise chapter 3 left. In a long channel of constant width, once the flow has developed, the water at every height keeps its speed all along the channel, yet the pressure falls along it. The speed along each streamline is the same, so by Bernoulli’s equation the pressure should be the same too; but this flow breaks the condition of no viscosity: the work the pressure difference does on the water does not build up as kinetic energy, and viscosity turns it into heat. Chapter 3’s venturi gauges leave viscosity out, so there the pressure past the throat came back to its first height; in a real venturi tube, as the end of chapter 3 said, it does not come all the way back, and what is missing is this same loss to viscosity. It is also why pumps keep running to send water through pipes.
Two misconceptions
Honey is not thick because it is heavy. Viscosity and density are different quantities. At room temperature, honey’s viscosity is about 2,000 to 10,000 times water’s, and its density about 1.4 times, so its is about 1,400 to 7,000 times water’s (it varies a lot with the honey’s water content and temperature). Mercury, the other way round, is 13.6 times as heavy as water, yet its viscosity is only about 1.7 times water’s, and its about 1/8 of water’s. Heavy fluids are not the thick ones.
Thinking of viscosity as friction against a wall is a misconception too. The first experiment had no wall at all, and the difference in velocity spread all the same. A wall only sets the velocity of the single layer touching it; viscosity inside the fluid carries it on from there. Water near a wall is slow not because the wall rubs it, but because the layer stopped at the wall slows its neighbour, which slows the next one in turn.
In every flow of this chapter, viscosity set the shape: the first two experiments had only the viscosity term on, and the channel flow was slow. In a fast flow, the way the flow carries its own momentum along (inertia) can outweigh viscosity. Weighing one against the other, to see which of them shapes a flow, comes in chapter 5.
In one sentence
The viscosity term is the force that shares velocity evenly between neighbouring bits of fluid, spreading differences in velocity out; because the fluid stuck at a wall slows its neighbours through this sharing, flow in a channel takes the shape of a parabola, and pushing it along takes a pressure that falls along the channel.
Something to think about
Estimate, with , how long a difference in velocity across a width of 1 cm takes to even out in water, whose is 0.000001 m²/s. How about across 2 cm? And across the same 1 cm in honey, with 3,000 times water’s ?
Show answer
Across 1 cm, s. Across 2 cm, four times as long: 400 s. Across the same 1 cm in honey, , about 0.03 s. So in honey a difference in velocity evens out almost at once, while in water even a swirl 1 cm across lasts a good while. This estimate gives only the scale of the time: in the plate experiment was 27 s, yet the line was straight after 10 s. The actual time is usually a good deal shorter, by a factor that depends on where the walls are and on how even counts as even.
Something to think about
The same amount of water flows between two plates. If the gap between the plates is halved, how many times the pressure difference does the same length need?
Show answer
Eight times. The pressure difference is . With the same flow rate, half the gap means twice the mean speed (chapter 2), and becomes a quarter, so the pressure difference grows by . That is how hard it is to push water through a narrow gap.