# The Kim, Moin, and Moser (KMM) Velocity-Vorticity Spectral Formulation

> The velocity-vorticity formulation of Kim, Moin and Moser for direct numerical simulation of turbulent plane channel flow, derived from the beginning. We start from the primitive equations and the three difficulties the pressure creates, take one curl to reach the second-order equation for the wall-normal vorticity and two to reach the fourth-order equation for the wall-normal velocity, and recover the horizontal components algebraically from continuity and the definition of the vorticity. Then the numerics: Fourier expansion in the two homogeneous directions, which uncouples the three-dimensional problem into an independent boundary value problem for every wavenumber pair, the six boundary conditions that no-slip supplies exactly, the degenerate mean mode, Chebyshev expansion across the gap with the banded prefactored systems it produces, and a semi-implicit time advance whose nonlinear terms are formed pseudospectrally and dealiased.

- Canonical watch page: [The Kim, Moin, and Moser (KMM) Velocity-Vorticity Spectral Formulation](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation)
- Publisher: [Academa, Inc.](https://academa.ai)
- Subject: Engineering
- Published: 2026-08-30T23:13:23.884Z
- Updated: 2026-08-30T23:13:23.884Z
- Duration: PT1185S (19 minutes 45 seconds)
- Chapters: 6
- Views: 0
- Language: en-US
- Access: Free
- Video stream: [HLS content](https://academa.ai/media/l/01M1ADAPT7200GP9R131FEAXDD/0/dark/master.m3u8)
- Audiovisual record: [Semantic JSON](https://academa.ai/media/l/01M1ADAPT7200GP9R131FEAXDD/0/semantic.json)
- Thumbnail: [Image](https://academa.ai/media/l/01M1ADAPT7200GP9R131FEAXDD/0/dark/poster.jpg)

## Description

How the KMM velocity-vorticity formulation removes pressure from channel-flow DNS, and why Fourier mode decoupling makes it so fast.

## Chapters

- [00:00–03:9.963 · The Channel and the Pressure Problem](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=0)
- [03:9.963–06:36.881 · Eliminating the Pressure](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=189.96349999999995)
- [06:36.881–09:49.224 · One Wavenumber Pair at a Time](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=396.88129166666664)
- [09:49.224–13:10.473 · The Walls, and the Mode That Degenerates](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=589.2235625)
- [13:10.473–15:30.729 · Chebyshev Across the Gap](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=790.4727708333332)
- [15:30.729–19:45 · Marching in Time, and Why It Is Fast](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=930.7285208333333)

## Transcript

### [00:00 · The Channel and the Pressure Problem](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=0)

A plane channel is the simplest wall-bounded turbulent flow we can simulate exactly. Two parallel walls, a fluid driven along the gap between them, and every eddy in that gap resolved on the grid rather than modelled. The two directions along the wall are statistically homogeneous, so we take them periodic: x downstream, and z across the span. The remaining direction, y, runs across the gap, from minus one at the lower wall to plus one at the upper. At each wall the fluid sticks: all three velocity components vanish there. That single condition, no-slip on a solid boundary, is the source of every difficulty in this lecture. Before deriving anything, let me put the destination on the board. Kim, Moin and Moser march two scalar fields. The first is the velocity component normal to the walls, and its equation is fourth order in space. The second is the vorticity component normal to the walls. Its own equation is a diffusion equation with a source term, and it is only second order in space. And look at what is missing. There is no pressure in either line. Two scalars have replaced three velocity components and a pressure, and every boundary condition the walls hand us will turn out to be a condition on something we are genuinely solving for. Here is the system we normally write down. Momentum for each of the three velocity components, with the pressure gradient sitting in it, and incompressible continuity beside it. Count them: four unknowns and four equations. But look at where the pressure sits. It enters only through its gradient in the momentum equations, and continuity does not contain it at all. Take the divergence of the momentum equations, use continuity, and the time derivative drops out. What is left is an elliptic problem: a Poisson equation whose right hand side is quadratic in the velocity. So the pressure is not marched at all. At every time step it is determined, everywhere at once, by the velocity field everywhere at once. And that is where the trouble starts. The first difficulty is the one we have just met. The pressure has no equation to march, so it has to be recovered from an elliptic solve at every step, over the whole channel at once. The second is that the velocity has to come out divergence free. Solve the momentum equations on their own and it will not. So velocity and pressure are two halves of one solve, not two solves in sequence. The third is the sharpest. The walls tell us the velocity there: it is zero. They tell us nothing at all about the pressure. And yet an elliptic problem demands a condition on every boundary, so whatever we supply is a numerical invention, sitting exactly where the interesting physics lives. Kim, Moin and Moser take the obvious way out. If the pressure is the problem, remove it from the equations altogether. That takes one vector identity and two derivatives, and it is the next thing we do.

### [03:9.963 · Eliminating the Pressure](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=189.96349999999995)

Vorticity is the curl of the velocity, and the component we are going to need points along the wall-normal direction. Here is a wall-parallel plane, with the horizontal velocity drawn on it. This particular field circulates. It turns about the wall-normal axis, which is perpendicular to the plane you are looking at, and that turning is exactly what omega y measures. In components, only the two wall-parallel derivatives appear: the rate at which the downstream velocity varies across the span, minus the rate at which the spanwise velocity varies downstream. Now the derivation. Collect every nonlinear term into one symbol, N, so that the momentum equation reads: rate of change equals N, minus the pressure gradient, plus viscous diffusion. Take the curl of that equation. The pressure term is the gradient of a scalar, and the curl of a gradient is identically zero, so it simply disappears. That is the whole trick, and the rest of this lecture is bookkeeping around it. What comes back is the vorticity transport equation. Take its wall-normal component and the second of our two governing equations is already there: omega y diffuses, and it is stirred by a source built out of the nonlinear terms alone. The velocity equation takes more work. Start from the same momentum equation and take its divergence. Continuity kills the time derivative, and what is left is a Poisson equation for the pressure with a right hand side made only of velocities. Now take the wall-normal component of the momentum equation and hit the whole line with a Laplacian. Three of the four terms are harmless. The pressure term becomes the Laplacian of a y derivative, which is the y derivative of a Laplacian, and we have just worked out what the Laplacian of the pressure is. Substitute it in and the pressure is gone for good. Rearranged, this is the fourth-order equation: the Laplacian of v is what evolves, viscosity acts through a fourth derivative, and the source h collects the nonlinear terms. There is a neater way to say what we just did. Minus the Laplacian of a divergence-free velocity is the curl of its vorticity, so applying the Laplacian to the wall-normal momentum equation is taking the curl twice. The fourth-order operator is what a double curl looks like. So here they are together. A fourth-order equation for the wall-normal velocity, and a second-order equation for the wall-normal vorticity. They are coupled, but only through the source terms h, which are quadratic in the velocity and will be evaluated explicitly. The linear operators on the right are completely independent of each other. Fourth order sounds expensive, and it is not, because we are about to solve it in one direction only. Two questions are still open, though. Where did the other two velocity components go, and what boundary conditions does a fourth-order equation want? Both answers arrive as soon as we go to Fourier space.

### [06:36.881 · One Wavenumber Pair at a Time](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=396.88129166666664)

Both wall-parallel directions are homogeneous and periodic, so both get Fourier series. Write the wall-normal velocity as a sum over modes: each mode carries a wavenumber in x, a wavenumber in z, and an amplitude that still depends on y and on time. Inside a single mode the wall-parallel derivatives are no longer derivatives. Differentiating in x multiplies by i k x, differentiating in z multiplies by i k z, and the Laplacian collapses to a second derivative in y minus k squared, where k squared is the sum of the two squares. That is the whole content of the transform, and it has already done something drastic. Neither of our two governing equations contains x or z at all any more. Put the two equations through that transform and what is left in each one is an ordinary differential equation in y alone, with time as a parameter. Fourth order for the velocity, second order for the vorticity. And here is the payoff the whole method is built on. Each pair of wavenumbers gets its own pair of equations, and those equations know nothing whatsoever about any other pair. The three-dimensional problem has come apart into a lattice of one-dimensional problems. Walk across that lattice. Here is one mode. Here is another, further out. And here is a third. Three completely independent boundary value problems, and the only thing that differs between them is the single number k squared sitting in the operator. Where have u and w gone? Nowhere. They have become algebra. Continuity, transformed, is one linear relation between the three transformed components. And the definition of the wall-normal vorticity, transformed, is a second linear relation between the same three. In both of them the y derivative of v hat is already known, because v is what we have just marched. So set them side by side as a two by two system for u hat and w hat. Multiply down one diagonal, multiply down the other, and subtract. The determinant is k x squared plus k z squared, which is k squared: nonzero for every mode but one, and we will come back to that exception. Solve it and the horizontal velocities fall out. u hat is one combination of the slope of v hat and the vorticity, w hat is another, and both are divided by k squared. No linear solve, no iteration, no elliptic problem: two multiplications and an addition, per mode, per step. And continuity is not being enforced here at all. It has been used, so the reconstructed field satisfies it identically, to machine precision. One thing is still missing, and it is not a small thing. This reconstruction divides by k squared, and there is exactly one mode in the lattice where k squared is zero. That mode, and the boundary conditions, come next.

### [09:49.224 · The Walls, and the Mode That Degenerates](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=589.2235625)

A fourth-order equation wants four boundary conditions, two at each wall. A second-order equation wants two. So we need six, and the walls appear to offer only one thing: the velocity vanishes. Start with what is given. At either wall all three components are zero, for every x and every z, so mode by mode every one of the three amplitudes is zero as well. That is v hat equal to zero at both walls: two conditions for the fourth-order equation. For the other two, put the wall values into the transformed continuity relation. Since u hat and w hat vanish there, the y derivative of v hat has to vanish there too. So the picture at each wall is this: v hat pinned to zero, and pinned flat. Four conditions, and not one of them was invented for numerical convenience. The vorticity is easier still. Wall-normal vorticity is built from u and w alone, and both of those are zero at the wall, so omega y hat vanishes there. Two conditions for a second-order equation. Let me count it once more, because this is the part that makes the formulation feel inevitable. Each unknown, its order in y, and what the walls hand us for it. The wall-normal velocity obeys a fourth-order equation, and the walls give exactly four conditions: the value, and the slope, at each of the two walls. The wall-normal vorticity obeys a second-order equation, and the walls give exactly two. Nothing is left over, and nothing has to be guessed. Compare that with a boundary condition for the pressure, which does not exist. Now the exception. The reconstruction of the horizontal velocities divided by k squared, and there is exactly one mode where k squared is zero: no variation in x and no variation in z. That mode is the mean flow, averaged over wall-parallel planes, and everything we have built so far says nothing about it. One of its components is free. Continuity for that mode says the y derivative of v hat is zero, and v hat is zero at the wall, so v hat is identically zero right across the gap. There is no mean flow through the walls, which is exactly what we should expect. The two horizontal means are not determined algebraically, so they are marched directly. Average the x momentum equation over a wall-parallel plane and you get a one-dimensional diffusion equation for u bar, forced by the mean nonlinear term and by the mean pressure gradient. And there is the one piece of the pressure that survives the whole construction: a single number, the mean streamwise gradient, which is what drives the flow. Either you fix it and let the flow rate settle, or you fix the flow rate and adjust it every step. The spanwise mean gets the same treatment with no imposed gradient. Both are one-dimensional diffusion equations with zero at each wall, and the machinery of the next part solves them without noticing that anything special has happened.

### [13:10.473 · Chebyshev Across the Gap](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=790.4727708333332)

The wall-normal direction is neither periodic nor homogeneous, so Fourier is the wrong basis there. Expand in Chebyshev polynomials instead, on the interval from minus one to plus one, which is exactly the gap. The first few look like this. T one is just y. T four already has four zeros inside the gap. T eight has eight, and notice where they crowd: the oscillations bunch up towards the two ends. So the expansion is a finite sum, N plus one coefficients for each wavenumber pair, and those coefficients are what the code actually stores. The collocation points come with the basis rather than being chosen. They are cosines of equally spaced angles, and here they are across the gap for N equal to eight. Look at the spacing. In the middle of the channel the points are as coarse as they ever get. Against the wall they are packed tight, with a spacing that shrinks like one over N squared. That is precisely the grid a wall-bounded flow wants, because the whole difficulty of this problem is a thin viscous layer against each wall. Now, what does the operator D squared minus k squared look like in this basis? Written for the coefficients, either as a tau formulation or as a Galerkin one, the second derivative connects a coefficient to only a few of its neighbours. The matrix is banded. For the second-order operator that means three diagonals. For the fourth-order operator, five. Either way it is a fixed number of entries per row, whatever N is, so one solve costs order N operations rather than order N cubed. Two further economies, and they are the ones that matter in practice. The matrix depends on the wavenumbers only through k squared, and on the time step, and neither of those changes as the simulation runs. So it is factored once, before the first step, and every step afterwards is a back substitution. And one more, which is free. The operator does not mix even polynomials with odd ones, so each system splits into two half-size systems, one per parity. All of that, for every wavenumber pair independently.

### [15:30.729 · Marching in Time, and Why It Is Fast](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=930.7285208333333)

Here is one time step for the vorticity equation, written the way it is usually implemented. The viscous term is treated implicitly, by Crank-Nicolson: half of it at the old level, half at the new. The nonlinear source is treated explicitly, by a two-step Adams-Bashforth: three halves of the current value, minus a half of the previous one. No solve is involved, because both are already known. And look at what the left hand side is. It is the banded, prefactored operator from a moment ago, one per wavenumber pair, unchanged from step to step. The whole advance is a back substitution per mode, plus the work of forming h. Now the stability, which is the real reason for treating viscosity implicitly. The time step is no longer limited by the wall-normal spacing at all. That spacing goes like one over N squared, so an explicit viscous treatment would need a step going like one over N to the fourth. On a fine grid that is simply unusable. The velocity equation needs one more idea. It is fourth order, so rather than building a fourth-order operator we split it into two second-order problems. First solve for phi, the Laplacian of v hat. Then solve for v hat itself, with phi as the source. There is a catch here, and it is worth naming. All four boundary conditions are conditions on v hat: two values and two slopes. Neither of the two second-order problems has any natural condition on phi at the walls. The standard remedy is a Green's function argument. Solve the pair once with the real forcing and zero conditions on phi, then twice more with unit conditions and no forcing, and take the combination of the three that makes the slope of v hat vanish at both walls. That is a two by two solve per mode on quantities computed before the run. That leaves the source terms h, which are the only nonlinear work in the method, and they are evaluated pseudospectrally. Transform the modes back to a physical grid. Form the products there, where a product is just a multiplication. Then transform the result back to modes. Why not form the products mode by mode instead? Because a product of two Fourier series is a convolution, which costs order N squared per direction, while two transforms and a multiplication cost order N log N. That single choice is what makes spectral direct simulation affordable at all. The price is aliasing. A product of two modes inside the retained band generates content outside it, and on a finite grid that content folds back onto the modes you are keeping, as error. So in both wall-parallel directions the products are formed on an enlarged grid and everything above the retained band is thrown away rather than folded back. That is the three-halves rule, and a phase shift scheme does the same job by a different route. So let me put the efficiency in one place. First: there is no elliptic pressure solve, at any step, because there is no pressure. Second: the reconstructed velocity is divergence free by construction, so nothing has to be projected or corrected afterwards. Third: the Fourier transform in the two homogeneous directions uncouples the three-dimensional problem into an independent, banded, already-factored boundary value problem for every wavenumber pair. Fourth: every boundary condition the method needs is one the walls actually give, so there is nothing invented near the wall. What is left, per step, is dominated by the transforms: order N log N in the wall-parallel directions, times the number of points across the gap. The solves themselves are linear in the number of Chebyshev modes. That is the whole of it. Two curls removed the pressure. Fourier removed two of the three space dimensions from every solve. Chebyshev put the points where the walls need them. And no-slip turned out to supply exactly the six boundary conditions the two equations were waiting for.

## About Academa, Inc.

Academa makes technical knowledge easier to understand through visual lectures and lets learners request new lecture videos on the topics they need.

## Complete audiovisual record

Immutable source: [semantic.json](https://academa.ai/media/l/01M1ADAPT7200GP9R131FEAXDD/0/semantic.json)

Record version: 1. Render attempt: 0.

### How to read this timeline

Each scene owns its object identifiers. A beat's board is the complete board when listed, empty when marked empty, and unchanged from the nearest earlier listed board in the same scene when marked unchanged. Action times are absolute positions in the published video.

### Scene 1: [The Channel and the Pressure Problem](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=0)

Span: 00:00–03:9.963 (0s–189.96349999999995s).

#### Objects

- channel: an Axes3D (x\_range=(0.0, 4.0), y\_range=(0.0, 2.0), z\_range=(-1.4, 1.4))
- consequence: a Text \[text\] that says "The pressure is never marched. It is set, everywhere at once, by the velocity field everywhere at once."
- g\_eq: a Math \[text\] that says "$frac(partial omega\_y, partial t) = nu nabla^2 omega\_y + h\_g$"
- head\_channel: a Heading that says "Plane Channel Flow"
- head\_primitive: a Heading that says "The Primitive Variables"
- head\_target: a Heading that says "What KMM Solve For"
- head\_trouble: a Heading that says "Three Difficulties"
- lower: a Plane \[gray\] labelled "y = -1" drawn in channel (point=(2.0, 1.0, -1.0), edge\_direction=(1.0, 0.0, 0.0), size=2.0)
- note\_geometry: a Text \[text\] that says "Periodic in $x$ and $z$, no-slip at $y = plus.minus 1$."
- primitive: a Derivation \[text\] that says "$frac(partial u\_i, partial t) + u\_j frac(partial u\_i, partial x\_j) &= - frac(partial p, partial x\_i) + nu nabla^2 u\_i \\ frac(partial u\_j, partial x\_j) &= 0 \\ nabla^2 p &= - frac(partial, partial x\_i) (u\_j frac(partial u\_i, partial x\_j))$"
- promise: a Panel that says "Two scalar unknowns: the velocity component normal to the walls, $v$, and the vorticity component normal to the walls, $omega\_y$. The pressure appears in neither line."
- stream: a Vector \[blue\] labelled "U(y)" drawn in channel (start=(0.6, 1.0, 0.0), end=(2.4, 1.0, 0.0))
- trouble\_1: a Text \[text\] that says "1. The pressure has no evolution equation of its own."
- trouble\_2: a Text \[text\] that says "2. Velocity and pressure have to be solved together, so that the result comes out divergence free."
- trouble\_3: a Text \[text\] that says "3. The walls prescribe the velocity, and prescribe nothing for the pressure."
- upper: a Plane \[gray\] labelled "y = +1" drawn in channel (point=(2.0, 1.0, 1.0), edge\_direction=(1.0, 0.0, 0.0), size=2.0)
- v\_eq: a Math \[text\] that says "$frac(partial, partial t) nabla^2 v = nu nabla^4 v + h\_v$"

#### Beats

##### [00:00](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=0)

Narration: A plane channel is the simplest wall-bounded turbulent flow we can simulate exactly. Two parallel walls, a fluid driven along the gap between them, and every eddy in that gap resolved on the grid rather than modelled.

Board: Empty.

Actions:
- [00:00](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=0): head\_channel is shown on the screen, written out.
- [00:0.488](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=0.488): channel is shown on the screen, written out.
- [00:6.049](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=6.049): lower is shown on the screen, written out.
- [00:6.827](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=6.826832044498712): upper is shown on the screen, written out.
- [00:7.326](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=7.326): stream is shown on the screen, written out.

##### [00:13.441](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=13.4405)

Narration: The two directions along the wall are statistically homogeneous, so we take them periodic: x downstream, and z across the span. The remaining direction, y, runs across the gap, from minus one at the lower wall to plus one at the upper.

Board: channel — an Axes3D (x\_range=(0.0, 4.0), y\_range=(0.0, 2.0), z\_range=(-1.4, 1.4)); head\_channel — a Heading that says "Plane Channel Flow"; lower — a Plane \[gray\] labelled "y = -1" drawn in channel (point=(2.0, 1.0, -1.0), edge\_direction=(1.0, 0.0, 0.0), size=2.0); upper — a Plane \[gray\] labelled "y = +1" drawn in channel (point=(2.0, 1.0, 1.0), edge\_direction=(1.0, 0.0, 0.0), size=2.0); stream — a Vector \[blue\] labelled "U(y)" drawn in channel (start=(0.6, 1.0, 0.0), end=(2.4, 1.0, 0.0))

Actions:
- [00:13.441](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=13.4405): channel turns in its own slot.
- [00:14.613](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=14.613): The xy plane in channel is lit up.
- [00:17.864](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=17.863999999999997): note\_geometry is shown on the screen, written out.
- [00:22.624](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=22.624000000000002): channel: retire a lit plane (unemphasize\_plane).

##### [00:29.727](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=29.7265)

Narration: At each wall the fluid sticks: all three velocity components vanish there. That single condition, no-slip on a solid boundary, is the source of every difficulty in this lecture.

Board: channel — an Axes3D (x\_range=(0.0, 4.0), y\_range=(0.0, 2.0), z\_range=(-1.4, 1.4)); note\_geometry — a Text \[text\] that says "Periodic in $x$ and $z$, no-slip at $y = plus.minus 1$."; head\_channel — a Heading that says "Plane Channel Flow"; lower — a Plane \[gray\] labelled "y = -1" drawn in channel (point=(2.0, 1.0, -1.0), edge\_direction=(1.0, 0.0, 0.0), size=2.0); upper — a Plane \[gray\] labelled "y = +1" drawn in channel (point=(2.0, 1.0, 1.0), edge\_direction=(1.0, 0.0, 0.0), size=2.0); stream — a Vector \[blue\] labelled "U(y)" drawn in channel (start=(0.6, 1.0, 0.0), end=(2.4, 1.0, 0.0))

Actions:
- [00:31.468](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=31.468000000000004): lower is indicated — a transient flash.
- [00:31.468](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=31.468000000000004): upper is indicated — a transient flash.
- [00:41.754](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=41.754000000000005): channel is hidden from the screen — left the board.
- [00:41.754](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=41.754000000000005): lower is hidden from the screen — channel left the board.
- [00:41.754](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=41.754000000000005): upper is hidden from the screen — channel left the board.
- [00:41.754](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=41.754000000000005): stream is hidden from the screen — channel left the board.
- [00:41.754](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=41.754000000000005): head\_channel is hidden from the screen — left the board.
- [00:41.754](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=41.754000000000005): note\_geometry is hidden from the screen — left the board.

##### [00:42.354](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=42.354)

Narration: Before deriving anything, let me put the destination on the board. Kim, Moin and Moser march two scalar fields. The first is the velocity component normal to the walls, and its equation is fourth order in space.

Board: Empty.

Actions:
- [00:42.354](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=42.354): head\_target is shown on the screen, written out.
- [00:51.271](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=51.271): v\_eq is shown on the screen, written out.

##### [00:57.386](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=57.3855)

Narration: The second is the vorticity component normal to the walls. Its own equation is a diffusion equation with a source term, and it is only second order in space.

Board: v\_eq — a Math \[text\] that says "$frac(partial, partial t) nabla^2 v = nu nabla^4 v + h\_v$"; head\_target — a Heading that says "What KMM Solve For"

Actions:
- [00:57.386](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=57.3855): g\_eq is shown on the screen, written out.
- [01:2.552](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=62.55200000000001): g\_eq (the "nu nabla^2 omega\_y" part) is emphasized.
- [01:5.686](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=65.686): g\_eq (the "nu nabla^2 omega\_y" part) is no longer emphasized.

##### [01:7.842](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=67.842)

Narration: And look at what is missing. There is no pressure in either line. Two scalars have replaced three velocity components and a pressure, and every boundary condition the walls hand us will turn out to be a condition on something we are genuinely solving for.

Board: v\_eq — a Math \[text\] that says "$frac(partial, partial t) nabla^2 v = nu nabla^4 v + h\_v$"; g\_eq — a Math \[text\] that says "$frac(partial omega\_y, partial t) = nu nabla^2 omega\_y + h\_g$"; head\_target — a Heading that says "What KMM Solve For"

Actions:
- [01:8.933](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=68.933): promise is shown on the screen, written out.
- [01:12.753](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=72.753): v\_eq is indicated — a transient flash.
- [01:13.031](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=73.03116711590296): g\_eq is indicated — a transient flash.
- [01:22.366](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=82.366): g\_eq is hidden from the screen — left the board.
- [01:22.366](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=82.366): head\_target is hidden from the screen — left the board.
- [01:22.366](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=82.366): promise is hidden from the screen — left the board.
- [01:22.366](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=82.366): v\_eq is hidden from the screen — left the board.

##### [01:22.966](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=82.966)

Narration: Here is the system we normally write down. Momentum for each of the three velocity components, with the pressure gradient sitting in it, and incompressible continuity beside it.

Board: Empty.

Actions:
- [01:22.966](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=82.966): head\_primitive is shown on the screen, written out.
- [01:26.159](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=86.15899999999999): primitive is shown on the screen, written out.
- [01:31.872](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=91.87199999999999): primitive is shown on the screen, written out.

##### [01:34.016](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=94.01599999999999)

Narration: Count them: four unknowns and four equations. But look at where the pressure sits. It enters only through its gradient in the momentum equations, and continuity does not contain it at all.

Board: head\_primitive — a Heading that says "The Primitive Variables"

Actions:
- [01:42.096](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=102.09599999999999): primitive (the "frac(partial p, partial x\_i)" part) is emphasized.
- [01:45.509](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=105.50899999999999): primitive is indicated — a transient flash.

##### [01:47.549](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=107.54899999999999)

Narration: Take the divergence of the momentum equations, use continuity, and the time derivative drops out. What is left is an elliptic problem: a Poisson equation whose right hand side is quadratic in the velocity.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [01:47.549](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=107.54899999999999): primitive (the "frac(partial p, partial x\_i)" part) is no longer emphasized.
- [01:55.641](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=115.64099999999999): primitive is shown on the screen, written out.
- [01:59.681](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=119.681): consequence is shown on the screen, written out.

##### [02:2.139](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=122.139)

Narration: So the pressure is not marched at all. At every time step it is determined, everywhere at once, by the velocity field everywhere at once. And that is where the trouble starts.

Board: consequence — a Text \[text\] that says "The pressure is never marched. It is set, everywhere at once, by the velocity field everywhere at once."; head\_primitive — a Heading that says "The Primitive Variables"

Actions:
- [02:6.435](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=126.43499999999999): primitive is indicated — a transient flash.
- [02:13.529](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=133.5285): consequence is hidden from the screen — left the board.
- [02:13.529](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=133.5285): head\_primitive is hidden from the screen — left the board.
- [02:13.529](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=133.5285): primitive is hidden from the screen — left the board.

##### [02:14.129](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=134.1285)

Narration: The first difficulty is the one we have just met. The pressure has no equation to march, so it has to be recovered from an elliptic solve at every step, over the whole channel at once.

Board: Empty.

Actions:
- [02:14.129](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=134.1285): head\_trouble is shown on the screen, written out.
- [02:14.662](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=134.662): trouble\_1 is shown on the screen, written out.

##### [02:25.108](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=145.108)

Narration: The second is that the velocity has to come out divergence free. Solve the momentum equations on their own and it will not. So velocity and pressure are two halves of one solve, not two solves in sequence.

Board: trouble\_1 — a Text \[text\] that says "1. The pressure has no evolution equation of its own."; head\_trouble — a Heading that says "Three Difficulties"

Actions:
- [02:25.584](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=145.584): trouble\_2 is shown on the screen, written out.

##### [02:38.386](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=158.386)

Narration: The third is the sharpest. The walls tell us the velocity there: it is zero. They tell us nothing at all about the pressure. And yet an elliptic problem demands a condition on every boundary, so whatever we supply is a numerical invention, sitting exactly where the interesting physics lives.

Board: trouble\_1 — a Text \[text\] that says "1. The pressure has no evolution equation of its own."; trouble\_2 — a Text \[text\] that says "2. Velocity and pressure have to be solved together, so that the result comes out divergence free."; head\_trouble — a Heading that says "Three Difficulties"

Actions:
- [02:38.931](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=158.93099999999998): trouble\_3 is shown on the screen, written out.
- [02:44.226](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=164.226): trouble\_3 (the "nothing" part) is emphasized.
- [02:52.004](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=172.004): trouble\_3 (the "nothing" part) is no longer emphasized.

##### [02:56.157](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=176.15699999999998)

Narration: Kim, Moin and Moser take the obvious way out. If the pressure is the problem, remove it from the equations altogether. That takes one vector identity and two derivatives, and it is the next thing we do.

Board: trouble\_1 — a Text \[text\] that says "1. The pressure has no evolution equation of its own."; trouble\_2 — a Text \[text\] that says "2. Velocity and pressure have to be solved together, so that the result comes out divergence free."; trouble\_3 — a Text \[text\] that says "3. The walls prescribe the velocity, and prescribe nothing for the pressure."; head\_trouble — a Heading that says "Three Difficulties"

Actions:
- [03:1.718](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=181.718): trouble\_1 is indicated — a transient flash.
- [03:8.922](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=188.92183333333332): head\_trouble is hidden from the screen — left the board.
- [03:8.922](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=188.92183333333332): trouble\_1 is hidden from the screen — left the board.
- [03:8.922](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=188.92183333333332): trouble\_2 is hidden from the screen — left the board.
- [03:8.922](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=188.92183333333332): trouble\_3 is hidden from the screen — left the board.

### Scene 2: [Eliminating the Pressure](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=189.96349999999995)

Span: 03:9.963–06:36.881 (189.96349999999995s–396.88129166666664s).

#### Objects

- curl\_work: a Derivation \[text\] that says "$N\_i &= - u\_j frac(partial u\_i, partial x\_j) \\ frac(partial u\_i, partial t) &= N\_i - frac(partial p, partial x\_i) + nu nabla^2 u\_i \\ nabla times nabla p &= 0 \\ frac(partial omega\_y, partial t) &= h\_g + nu nabla^2 omega\_y \\ h\_g &= frac(parti…$"
- head\_curl: a Heading that says "One Curl: the Wall-Normal Vorticity"
- head\_double: a Heading that says "Two Curls: the Wall-Normal Velocity"
- head\_pair: a Heading that says "The Pair We Will March"
- head\_spin: a Heading that says "What $omega\_y$ Measures"
- identity: a Math \[text\] that says "$nabla times (nabla times bold(u)) = - nabla^2 bold(u)$"
- omega\_formula: a Math \[text\] that says "$omega\_y = frac(partial u, partial z) - frac(partial w, partial x)$"
- pair\_g: a Math \[text\] that says "$frac(partial omega\_y, partial t) = nu nabla^2 omega\_y + h\_g$"
- pair\_note: a Panel that says "Two scalar equations, coupled only through the nonlinear sources $h$. The linear operators on the right know nothing about each other."
- pair\_v: a Math \[text\] that says "$frac(partial, partial t) nabla^2 v = nu nabla^4 v + h\_v$"
- plane\_view: an Axes (x\_range=(-1.7, 1.7), y\_range=(-1.7, 1.7), aspect=(1.0, 1.0))
- spin: a VectorField \[blue\] drawn in plane\_view (function=\<function\>, at=((-1.1333333333333333, -1.1333333333333333), (-1.13333333333333…, scale=0.2)
- spin\_note: a Text \[text\] that says "$omega\_y$ is the circulation of the horizontal velocity about the wall-normal direction."
- turn: a CurvedArrow \[yellow\] labelled "omega\_y" drawn in plane\_view (start=(1.25, 0.8), end=(1.25, -0.8), bend=0.4)
- v\_work: a Derivation \[text\] that says "$nabla^2 p &= frac(partial N\_j, partial x\_j) \\ nabla^2 frac(partial v, partial t) &= nabla^2 N\_2 - frac(partial, partial y) (nabla^2 p) + nu nabla^4 v \\ frac(partial, partial t) nabla^2 v &= nu nabla^4 v + h\_v \\ h\_v &= nabla^2 N\_2 - frac(pa…$"

#### Beats

##### [03:9.963](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=189.96349999999995)

Narration: Vorticity is the curl of the velocity, and the component we are going to need points along the wall-normal direction. Here is a wall-parallel plane, with the horizontal velocity drawn on it.

Board: Empty.

Actions:
- [03:9.963](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=189.96349999999995): head\_spin is shown on the screen, written out.
- [03:18.496](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=198.49649999999994): plane\_view is shown on the screen, written out.
- [03:20.273](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=200.27349999999996): spin is shown on the screen, written out.

##### [03:22.464](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=202.46399999999994)

Narration: This particular field circulates. It turns about the wall-normal axis, which is perpendicular to the plane you are looking at, and that turning is exactly what omega y measures.

Board: plane\_view — an Axes (x\_range=(-1.7, 1.7), y\_range=(-1.7, 1.7), aspect=(1.0, 1.0)); head\_spin — a Heading that says "What $omega\_y$ Measures"; spin — a VectorField \[blue\] drawn in plane\_view (function=\<function\>, at=((-1.1333333333333333, -1.1333333333333333), (-1.13333333333333…, scale=0.2)

Actions:
- [03:25.365](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=205.36549999999994): turn is shown on the screen, written out.
- [03:32.993](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=212.99349999999995): plane\_view moves to a new place on the board.
- [03:32.993](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=212.99349999999995): spin\_note is shown on the screen, written out.

##### [03:34.592](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=214.59199999999996)

Narration: In components, only the two wall-parallel derivatives appear: the rate at which the downstream velocity varies across the span, minus the rate at which the spanwise velocity varies downstream.

Board: spin\_note — a Text \[text\] that says "$omega\_y$ is the circulation of the horizontal velocity about the wall-normal direction."; plane\_view — an Axes (x\_range=(-1.7, 1.7), y\_range=(-1.7, 1.7), aspect=(1.0, 1.0)); head\_spin — a Heading that says "What $omega\_y$ Measures"; spin — a VectorField \[blue\] drawn in plane\_view (function=\<function\>, at=((-1.1333333333333333, -1.1333333333333333), (-1.13333333333333…, scale=0.2); turn — a CurvedArrow \[yellow\] labelled "omega\_y" drawn in plane\_view (start=(1.25, 0.8), end=(1.25, -0.8), bend=0.4)

Actions:
- [03:35.23](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=215.23049999999995): omega\_formula is shown on the screen, written out.
- [03:42.056](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=222.05649999999997): omega\_formula (the "frac(partial u, partial z)" part) is emphasized.
- [03:46.399](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=226.39949999999996): omega\_formula (the "frac(partial u, partial z)" part) is no longer emphasized.
- [03:46.399](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=226.39949999999996): omega\_formula (the "frac(partial w, partial x)" part) is emphasized.
- [03:47.548](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=227.54849999999996): head\_spin is hidden from the screen — left the board.
- [03:47.548](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=227.54849999999996): omega\_formula is hidden from the screen — left the board.
- [03:47.548](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=227.54849999999996): plane\_view is hidden from the screen — left the board.
- [03:47.548](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=227.54849999999996): spin is hidden from the screen — plane\_view left the board.
- [03:47.548](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=227.54849999999996): turn is hidden from the screen — plane\_view left the board.
- [03:47.548](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=227.54849999999996): spin\_note is hidden from the screen — left the board.
- [03:47.548](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=227.54849999999996): omega\_formula (the "frac(partial w, partial x)" part) is no longer emphasized.

##### [03:48.148](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=228.14849999999996)

Narration: Now the derivation. Collect every nonlinear term into one symbol, N, so that the momentum equation reads: rate of change equals N, minus the pressure gradient, plus viscous diffusion.

Board: Empty.

Actions:
- [03:48.148](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=228.14849999999996): head\_curl is shown on the screen, written out.
- [03:53.059](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=233.05949999999996): curl\_work is shown on the screen, written out.
- [03:56.229](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=236.22949999999997): curl\_work is shown on the screen, written out.

##### [04:3.435](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=243.43499999999995)

Narration: Take the curl of that equation. The pressure term is the gradient of a scalar, and the curl of a gradient is identically zero, so it simply disappears. That is the whole trick, and the rest of this lecture is bookkeeping around it.

Board: head\_curl — a Heading that says "One Curl: the Wall-Normal Vorticity"

Actions:
- [04:7.812](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=247.81249999999997): curl\_work is shown on the screen, written out.
- [04:12.177](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=252.17749999999995): curl\_work is indicated — a transient flash.

##### [04:19.07](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=259.0704999999999)

Narration: What comes back is the vorticity transport equation. Take its wall-normal component and the second of our two governing equations is already there: omega y diffuses, and it is stirred by a source built out of the nonlinear terms alone.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [04:24.271](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=264.27149999999995): curl\_work is shown on the screen, written out.
- [04:29.867](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=269.86749999999995): curl\_work (the "nu nabla^2 omega\_y" part) is emphasized.
- [04:32.155](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=272.15549999999996): curl\_work is shown on the screen, written out.
- [04:32.155](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=272.15549999999996): curl\_work (the "nu nabla^2 omega\_y" part) is no longer emphasized.
- [04:35.441](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=275.4409999999999): curl\_work is hidden from the screen — left the board.
- [04:35.441](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=275.4409999999999): head\_curl is hidden from the screen — left the board.

##### [04:36.041](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=276.04099999999994)

Narration: The velocity equation takes more work. Start from the same momentum equation and take its divergence. Continuity kills the time derivative, and what is left is a Poisson equation for the pressure with a right hand side made only of velocities.

Board: Empty.

Actions:
- [04:36.041](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=276.04099999999994): head\_double is shown on the screen, written out.
- [04:41.915](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=281.91549999999995): v\_work is shown on the screen, written out.
- [04:49.206](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=289.20649999999995): v\_work (the "frac(partial N\_j, partial x\_j)" part) is emphasized.
- [04:52.678](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=292.6785): v\_work (the "frac(partial N\_j, partial x\_j)" part) is no longer emphasized.

##### [04:53.278](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=293.27849999999995)

Narration: Now take the wall-normal component of the momentum equation and hit the whole line with a Laplacian. Three of the four terms are harmless. The pressure term becomes the Laplacian of a y derivative, which is the y derivative of a Laplacian, and we have just worked out what the Laplacian of the pressure is.

Board: head\_double — a Heading that says "Two Curls: the Wall-Normal Velocity"

Actions:
- [04:58.792](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=298.79249999999996): v\_work is shown on the screen, written out.
- [05:8.278](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=308.27849999999995): v\_work (the "frac(partial, partial y) (nabla^2 p)" part) is emphasized.
- [05:13.561](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=313.5609999999999): v\_work (the "frac(partial, partial y) (nabla^2 p)" part) is no longer emphasized.

##### [05:14.161](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=314.16099999999994)

Narration: Substitute it in and the pressure is gone for good. Rearranged, this is the fourth-order equation: the Laplacian of v is what evolves, viscosity acts through a fourth derivative, and the source h collects the nonlinear terms.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [05:18.41](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=318.41049999999996): v\_work is shown on the screen, written out.
- [05:26.328](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=326.32849999999996): v\_work (the "nu nabla^4 v" part) is emphasized.
- [05:28.023](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=328.02349999999996): v\_work is shown on the screen, written out.
- [05:28.023](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=328.02349999999996): v\_work (the "nu nabla^4 v" part) is no longer emphasized.

##### [05:31.665](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=331.66549999999995)

Narration: There is a neater way to say what we just did. Minus the Laplacian of a divergence-free velocity is the curl of its vorticity, so applying the Laplacian to the wall-normal momentum equation is taking the curl twice. The fourth-order operator is what a double curl looks like.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [05:35.264](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=335.26449999999994): identity is shown on the screen, written out.
- [05:46.351](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=346.3515): identity is indicated — a transient flash.
- [05:51.367](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=351.36699999999996): head\_double is hidden from the screen — left the board.
- [05:51.367](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=351.36699999999996): identity is hidden from the screen — left the board.
- [05:51.367](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=351.36699999999996): v\_work is hidden from the screen — left the board.

##### [05:51.967](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=351.967)

Narration: So here they are together. A fourth-order equation for the wall-normal velocity, and a second-order equation for the wall-normal vorticity.

Board: Empty.

Actions:
- [05:51.967](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=351.967): head\_pair is shown on the screen, written out.
- [05:54.741](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=354.7415): pair\_v is shown on the screen, written out.
- [05:58.398](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=358.3984999999999): pair\_g is shown on the screen, written out.

##### [06:2.296](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=362.29599999999994)

Narration: They are coupled, but only through the source terms h, which are quadratic in the velocity and will be evaluated explicitly. The linear operators on the right are completely independent of each other.

Board: pair\_v — a Math \[text\] that says "$frac(partial, partial t) nabla^2 v = nu nabla^4 v + h\_v$"; pair\_g — a Math \[text\] that says "$frac(partial omega\_y, partial t) = nu nabla^2 omega\_y + h\_g$"; head\_pair — a Heading that says "The Pair We Will March"

Actions:
- [06:3.05](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=363.05049999999994): pair\_note is shown on the screen, written out.
- [06:4.712](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=364.7115): pair\_v (the "h\_v" part) is emphasized.
- [06:4.877](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=364.8771309012875): pair\_g (the "h\_g" part) is emphasized.
- [06:11.329](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=371.32949999999994): pair\_v (the "h\_v" part) is no longer emphasized.
- [06:11.518](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=371.5182995095033): pair\_g (the "h\_g" part) is no longer emphasized.

##### [06:15.784](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=375.7835)

Narration: Fourth order sounds expensive, and it is not, because we are about to solve it in one direction only. Two questions are still open, though. Where did the other two velocity components go, and what boundary conditions does a fourth-order equation want? Both answers arrive as soon as we go to Fourier space.

Board: pair\_v — a Math \[text\] that says "$frac(partial, partial t) nabla^2 v = nu nabla^4 v + h\_v$"; pair\_g — a Math \[text\] that says "$frac(partial omega\_y, partial t) = nu nabla^2 omega\_y + h\_g$"; pair\_note — a Panel that says "Two scalar equations, coupled only through the nonlinear sources $h$. The linear operators on the right know nothing about each other."; head\_pair — a Heading that says "The Pair We Will March"

Actions:
- [06:29.854](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=389.8544999999999): pair\_v is indicated — a transient flash.
- [06:35.84](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=395.83962499999996): head\_pair is hidden from the screen — left the board.
- [06:35.84](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=395.83962499999996): pair\_g is hidden from the screen — left the board.
- [06:35.84](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=395.83962499999996): pair\_note is hidden from the screen — left the board.
- [06:35.84](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=395.83962499999996): pair\_v is hidden from the screen — left the board.

### Scene 3: [One Wavenumber Pair at a Time](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=396.88129166666664)

Span: 06:36.881–09:49.224 (396.88129166666664s–589.2235625s).

#### Objects

- constraints: a Derivation \[text\] that says "$i k\_x hat(u) + D hat(v) + i k\_z hat(w) &= 0 \\ i k\_z hat(u) - i k\_x hat(w) &= hat(omega)\_y$"
- det: a Math \[text\] that says "$op("det") = k\_x^2 + k\_z^2 = k^2$"
- drastic: a Text \[text\] that says "Neither governing equation contains $x$ or $z$ any longer. Only $y$ is left, and one number, $k^2$."
- e0: a Math \[text\] that says "$v(x, y, z) = sum\_(k\_x, k\_z) hat(v)(k\_x, k\_z, y) thin e^(i (k\_x x + k\_z z))$"
- e1: a Math \[text\] that says "$frac(partial, partial x) arrow.r i k\_x, quad frac(partial, partial z) arrow.r i k\_z$"
- e2: a Math \[text\] that says "$nabla^2 arrow.r D^2 - k^2, quad D = frac(dif, dif y), quad k^2 = k\_x^2 + k\_z^2$"
- free\_note: a Text \[text\] that says "Continuity is not imposed here. It has been used, so the reconstructed field satisfies it identically."
- grid: a Gridlines \[gray\] drawn in lattice (x\_range=(-3.0, 3.0), y\_range=(-3.0, 3.0), step=1.0)
- head\_modes: a Heading that says "Fourier in the Homogeneous Directions"
- head\_ode: a Heading that says "Two Ordinary Differential Equations"
- head\_recover: a Heading that says "Recovering $u$ and $w$"
- kx: a VariableNumber (initial\_value=1.0, format\_spec='.0f')
- kz: a VariableNumber (format\_spec='.0f')
- lattice: an Axes (x\_range=(-3.6, 3.6), y\_range=(-3.6, 3.6), aspect=(1.0, 1.0))
- mode: a Point \[yellow\] labelled "(1, 0)" drawn in lattice (marker\_radius=0.09)
- ode\_g: a Math \[text\] that says "$frac(partial hat(omega)\_y, partial t) = nu (D^2 - k^2) hat(omega)\_y + hat(h)\_g$"
- ode\_v: a Math \[text\] that says "$frac(partial, partial t) (D^2 - k^2) hat(v) = nu (D^2 - k^2)^2 hat(v) + hat(h)\_v$"
- solutions: a Derivation \[text\] that says "$hat(u) &= frac(i, k^2) (k\_x D hat(v) - k\_z hat(omega)\_y) \\ hat(w) &= frac(i, k^2) (k\_z D hat(v) + k\_x hat(omega)\_y)$"
- system: a Math \[text\] that says "$mat(i k\_x, i k\_z; i k\_z, - i k\_x) vec(hat(u), hat(w)) = vec(- D hat(v), hat(omega)\_y)$"

#### Beats

##### [06:36.881](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=396.88129166666664)

Narration: Both wall-parallel directions are homogeneous and periodic, so both get Fourier series. Write the wall-normal velocity as a sum over modes: each mode carries a wavenumber in x, a wavenumber in z, and an amplitude that still depends on y and on time.

Board: Empty.

Actions:
- [06:36.881](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=396.88129166666664): head\_modes is shown on the screen, written out.
- [06:44.962](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=404.96229166666666): e0 is shown on the screen, written out.
- [06:51.417](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=411.41729166666664): e0 (the "hat(v)(k\_x, k\_z, y)" part) is emphasized.
- [06:54.575](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=414.57529166666666): e0 (the "hat(v)(k\_x, k\_z, y)" part) is no longer emphasized.

##### [06:55.175](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=415.1752916666666)

Narration: Inside a single mode the wall-parallel derivatives are no longer derivatives. Differentiating in x multiplies by i k x, differentiating in z multiplies by i k z, and the Laplacian collapses to a second derivative in y minus k squared, where k squared is the sum of the two squares.

Board: e0 — a Math \[text\] that says "$v(x, y, z) = sum\_(k\_x, k\_z) hat(v)(k\_x, k\_z, y) thin e^(i (k\_x x + k\_z z))$"; head\_modes — a Heading that says "Fourier in the Homogeneous Directions"

Actions:
- [07:0.225](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=420.22529166666664): e1 is shown on the screen, written out.
- [07:8.48](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=428.48029166666663): e2 is shown on the screen, written out.
- [07:13.205](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=433.20529166666665): e2 (the "k^2 = k\_x^2 + k\_z^2" part) is emphasized.
- [07:14.593](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=434.59279166666664): e2 (the "k^2 = k\_x^2 + k\_z^2" part) is no longer emphasized.

##### [07:15.193](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=435.19279166666666)

Narration: That is the whole content of the transform, and it has already done something drastic. Neither of our two governing equations contains x or z at all any more.

Board: e0 — a Math \[text\] that says "$v(x, y, z) = sum\_(k\_x, k\_z) hat(v)(k\_x, k\_z, y) thin e^(i (k\_x x + k\_z z))$"; e1 — a Math \[text\] that says "$frac(partial, partial x) arrow.r i k\_x, quad frac(partial, partial z) arrow.r i k\_z$"; e2 — a Math \[text\] that says "$nabla^2 arrow.r D^2 - k^2, quad D = frac(dif, dif y), quad k^2 = k\_x^2 + k\_z^2$"; head\_modes — a Heading that says "Fourier in the Homogeneous Directions"

Actions:
- [07:19.622](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=439.6222916666666): drastic is shown on the screen, written out.
- [07:25.276](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=445.27579166666663): drastic is hidden from the screen — left the board.
- [07:25.276](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=445.27579166666663): e0 is hidden from the screen — left the board.
- [07:25.276](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=445.27579166666663): e1 is hidden from the screen — left the board.
- [07:25.276](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=445.27579166666663): e2 is hidden from the screen — left the board.
- [07:25.276](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=445.27579166666663): head\_modes is hidden from the screen — left the board.

##### [07:25.876](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=445.87579166666666)

Narration: Put the two equations through that transform and what is left in each one is an ordinary differential equation in y alone, with time as a parameter. Fourth order for the velocity, second order for the vorticity.

Board: Empty.

Actions:
- [07:25.876](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=445.87579166666666): head\_ode is shown on the screen, written out.
- [07:30.287](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=450.28729166666665): ode\_v is shown on the screen, written out.
- [07:30.581](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=450.5811610243055): ode\_g is shown on the screen, written out.

##### [07:40.117](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=460.11729166666663)

Narration: And here is the payoff the whole method is built on. Each pair of wavenumbers gets its own pair of equations, and those equations know nothing whatsoever about any other pair. The three-dimensional problem has come apart into a lattice of one-dimensional problems.

Board: ode\_v — a Math \[text\] that says "$frac(partial, partial t) (D^2 - k^2) hat(v) = nu (D^2 - k^2)^2 hat(v) + hat(h)\_v$"; ode\_g — a Math \[text\] that says "$frac(partial hat(omega)\_y, partial t) = nu (D^2 - k^2) hat(omega)\_y + hat(h)\_g$"; head\_ode — a Heading that says "Two Ordinary Differential Equations"

Actions:
- [07:44.32](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=464.32029166666666): lattice is shown on the screen, written out.
- [07:53.491](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=473.49129166666665): grid is shown on the screen, written out.
- [07:54.118](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=474.11829166666666): mode is shown on the screen, written out.

##### [07:56.402](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=476.40229166666666)

Narration: Walk across that lattice. Here is one mode. Here is another, further out. And here is a third. Three completely independent boundary value problems, and the only thing that differs between them is the single number k squared sitting in the operator.

Board: ode\_v — a Math \[text\] that says "$frac(partial, partial t) (D^2 - k^2) hat(v) = nu (D^2 - k^2)^2 hat(v) + hat(h)\_v$"; ode\_g — a Math \[text\] that says "$frac(partial hat(omega)\_y, partial t) = nu (D^2 - k^2) hat(omega)\_y + hat(h)\_g$"; lattice — an Axes (x\_range=(-3.6, 3.6), y\_range=(-3.6, 3.6), aspect=(1.0, 1.0)); head\_ode — a Heading that says "Two Ordinary Differential Equations"; grid — a Gridlines \[gray\] drawn in lattice (x\_range=(-3.0, 3.0), y\_range=(-3.0, 3.0), step=1.0); mode — a Point \[yellow\] labelled "(1, 0)" drawn in lattice (marker\_radius=0.09)

Actions:
- [08:1.139](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=481.1392916666666): mode is redrawn as the numbers it depends on change.
- [08:1.139](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=481.1392916666666): kx ticks to 2.0.
- [08:1.139](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=481.1392916666666): kz ticks to 1.0.
- [08:3.554](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=483.55429166666664): mode is redrawn as the numbers it depends on change.
- [08:3.554](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=483.55429166666664): kx ticks to 3.0.
- [08:3.554](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=483.55429166666664): kz ticks to -2.0.
- [08:10.577](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=490.57729166666667): ode\_v (the "k^2" part) is emphasized.
- [08:12.644](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=492.6442916666666): head\_ode is hidden from the screen — left the board.
- [08:12.644](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=492.6442916666666): ode\_g is hidden from the screen — left the board.
- [08:12.644](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=492.6442916666666): ode\_v is hidden from the screen — left the board.
- [08:12.644](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=492.6442916666666): ode\_v (the "k^2" part) is no longer emphasized.

##### [08:13.244](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=493.24429166666664)

Narration: Where have u and w gone? Nowhere. They have become algebra. Continuity, transformed, is one linear relation between the three transformed components.

Board: lattice — an Axes (x\_range=(-3.6, 3.6), y\_range=(-3.6, 3.6), aspect=(1.0, 1.0)); grid — a Gridlines \[gray\] drawn in lattice (x\_range=(-3.0, 3.0), y\_range=(-3.0, 3.0), step=1.0); mode — a Point \[yellow\] labelled "(1, 0)" drawn in lattice (marker\_radius=0.09)

Actions:
- [08:13.244](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=493.24429166666664): head\_recover is shown on the screen, written out.
- [08:19.78](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=499.78029166666664): constraints is shown on the screen, written out.

##### [08:26.673](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=506.6732916666666)

Narration: And the definition of the wall-normal vorticity, transformed, is a second linear relation between the same three. In both of them the y derivative of v hat is already known, because v is what we have just marched.

Board: lattice — an Axes (x\_range=(-3.6, 3.6), y\_range=(-3.6, 3.6), aspect=(1.0, 1.0)); grid — a Gridlines \[gray\] drawn in lattice (x\_range=(-3.0, 3.0), y\_range=(-3.0, 3.0), step=1.0); mode — a Point \[yellow\] labelled "(1, 0)" drawn in lattice (marker\_radius=0.09); head\_recover — a Heading that says "Recovering $u$ and $w$"

Actions:
- [08:31.34](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=511.34029166666664): constraints is shown on the screen, written out.
- [08:37.505](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=517.5052916666666): constraints (the "D hat(v)" part) is emphasized.
- [08:40.855](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=520.8547916666666): constraints (the "D hat(v)" part) is no longer emphasized.

##### [08:41.455](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=521.4547916666667)

Narration: So set them side by side as a two by two system for u hat and w hat. Multiply down one diagonal, multiply down the other, and subtract. The determinant is k x squared plus k z squared, which is k squared: nonzero for every mode but one, and we will come back to that exception.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [08:42.273](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=522.2732916666666): system is shown on the screen, written out.
- [08:47.137](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=527.1372916666667): system (the "diagonal=anti" part) is struck through — it is ruled out.
- [08:47.137](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=527.1372916666667): system (the "diagonal=main" part) is struck through — it is ruled out.
- [08:52.269](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=532.2692916666667): det is shown on the screen, written out.
- [08:57.261](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=537.2612916666667): The strike through system (the "diagonal=anti" part) is lifted.
- [08:57.261](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=537.2612916666667): The strike through system (the "diagonal=main" part) is lifted.
- [09:1.697](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=541.6967916666666): constraints is hidden from the screen — left the board.
- [09:1.697](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=541.6967916666666): det is hidden from the screen — left the board.
- [09:1.697](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=541.6967916666666): system is hidden from the screen — left the board.

##### [09:2.297](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=542.2967916666666)

Narration: Solve it and the horizontal velocities fall out. u hat is one combination of the slope of v hat and the vorticity, w hat is another, and both are divided by k squared.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [09:6.917](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=546.9172916666666): solutions is shown on the screen, written out.
- [09:11.41](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=551.4102916666667): solutions is shown on the screen, written out.

##### [09:15.459](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=555.4587916666667)

Narration: No linear solve, no iteration, no elliptic problem: two multiplications and an addition, per mode, per step. And continuity is not being enforced here at all. It has been used, so the reconstructed field satisfies it identically, to machine precision.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [09:20.323](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=560.3232916666667): solutions is indicated — a transient flash.
- [09:24.41](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=564.4102916666667): free\_note is shown on the screen, written out.

##### [09:33.73](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=573.7297916666666)

Narration: One thing is still missing, and it is not a small thing. This reconstruction divides by k squared, and there is exactly one mode in the lattice where k squared is zero. That mode, and the boundary conditions, come next.

Board: lattice — an Axes (x\_range=(-3.6, 3.6), y\_range=(-3.6, 3.6), aspect=(1.0, 1.0)); grid — a Gridlines \[gray\] drawn in lattice (x\_range=(-3.0, 3.0), y\_range=(-3.0, 3.0), step=1.0); mode — a Point \[yellow\] labelled "(1, 0)" drawn in lattice (marker\_radius=0.09); head\_recover — a Heading that says "Recovering $u$ and $w$"; free\_note — a Text \[text\] that says "Continuity is not imposed here. It has been used, so the reconstructed field satisfies it identically."

Actions:
- [09:41.496](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=581.4962916666666): mode is redrawn as the numbers it depends on change.
- [09:41.496](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=581.4962916666666): kx ticks to 0.0.
- [09:41.496](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=581.4962916666666): kz ticks to 0.0.
- [09:43.621](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=583.6212916666666): mode is indicated — a transient flash.
- [09:48.182](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=588.1818958333333): free\_note is hidden from the screen — left the board.
- [09:48.182](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=588.1818958333333): head\_recover is hidden from the screen — left the board.
- [09:48.182](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=588.1818958333333): lattice is hidden from the screen — left the board.
- [09:48.182](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=588.1818958333333): grid is hidden from the screen — lattice left the board.
- [09:48.182](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=588.1818958333333): mode is hidden from the screen — lattice left the board.
- [09:48.182](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=588.1818958333333): solutions is hidden from the screen — left the board.

### Scene 4: [The Walls, and the Mode That Degenerates](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=589.2235625)

Span: 09:49.224–13:10.473 (589.2235625s–790.4727708333332s).

#### Objects

- b0: a Math \[text\] that says "$hat(u) = hat(v) = hat(w) = 0 quad upright("at") thin y = plus.minus 1$"
- b1: a Math \[text\] that says "$D hat(v) = - i k\_x hat(u) - i k\_z hat(w) = 0$"
- b2: a Math \[text\] that says "$hat(omega)\_y = i k\_z hat(u) - i k\_x hat(w) = 0$"
- bc\_table: a Table \[text\] that says "Unknown Order in $y$ Conditions the walls give $hat(v)$ 4 $hat(v) = 0$ and $D hat(v) = 0$, at each wall $hat(omega)\_y$ 2 $hat(omega)\_y = 0$, at each wall" (rows=(('Unknown', 'Order in $y$', 'Conditions the walls give'), ('$h…, header=True)
- bot\_tag: a Math \[yellow\] that says "$hat(v) = 0, thin D hat(v) = 0$" drawn in gap
- gap: a Figure (x\_range=(0.0, 3.0), y\_range=(-1.7, 1.7), aspect=(3.0, 2.8))
- head\_bc: a Heading that says "Where Six Conditions Come From"
- head\_count: a Heading that says "The Count Comes Out Exactly"
- head\_mean: a Heading that says "The Mode That Degenerates"
- mean\_curve: a ParametricCurve \[blue\] labelled "overline(u)(y)" drawn in profile\_axes (function=\<function\>, t\_range=(-1.0, 1.0))
- mean\_u: a Math \[text\] that says "$frac(partial overline(u), partial t) = nu D^2 overline(u) - frac(dif P, dif x) + overline(N\_1)$"
- mean\_v: a Math \[text\] that says "$hat(v)(0, 0, y) = 0$"
- mean\_w: a Math \[text\] that says "$frac(partial overline(w), partial t) = nu D^2 overline(w) + overline(N\_3)$"
- nothing\_guessed: a Text \[text\] that says "Nothing is left over and nothing has to be invented, which is exactly what the pressure could not offer."
- profile\_axes: an Axes (x\_range=(0.0, 1.2), y\_range=(-1.15, 1.15), aspect=(2.0, 2.6))
- top\_tag: a Math \[yellow\] that says "$hat(v) = 0, thin D hat(v) = 0$" drawn in gap
- vhat: a ParametricCurve \[blue\] labelled "hat(v)(y)" drawn in gap (function=\<function\>, t\_range=(-1.0, 1.0))
- wall\_bot: a Line \[gray\] drawn in gap (start=(0.0, -1.0), end=(3.0, -1.0))
- wall\_top: a Line \[gray\] drawn in gap (start=(0.0, 1.0), end=(3.0, 1.0))
- zero\_axis: a Line \[gray\] drawn in gap (start=(1.4, -1.0), end=(1.4, 1.0), dashed=True)

#### Beats

##### [09:49.224](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=589.2235625)

Narration: A fourth-order equation wants four boundary conditions, two at each wall. A second-order equation wants two. So we need six, and the walls appear to offer only one thing: the velocity vanishes.

Board: Empty.

Actions:
- [09:49.224](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=589.2235625): head\_bc is shown on the screen, written out.
- [09:58.895](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=598.8945625): gap is shown on the screen, written out.
- [09:58.895](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=598.8945625): wall\_top is shown on the screen, written out.
- [09:59.235](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=599.2353220161864): wall\_bot is shown on the screen, written out.

##### [10:3.918](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=603.9180624999999)

Narration: Start with what is given. At either wall all three components are zero, for every x and every z, so mode by mode every one of the three amplitudes is zero as well.

Board: gap — a Figure (x\_range=(0.0, 3.0), y\_range=(-1.7, 1.7), aspect=(3.0, 2.8)); head\_bc — a Heading that says "Where Six Conditions Come From"; wall\_top — a Line \[gray\] drawn in gap (start=(0.0, 1.0), end=(3.0, 1.0)); wall\_bot — a Line \[gray\] drawn in gap (start=(0.0, -1.0), end=(3.0, -1.0))

Actions:
- [10:5.161](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=605.1605625): gap moves to a new place on the board.
- [10:5.161](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=605.1605625): b0 is shown on the screen, written out.
- [10:13.648](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=613.6475624999999): zero\_axis is shown on the screen, written out.

##### [10:16.302](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=616.3020624999999)

Narration: That is v hat equal to zero at both walls: two conditions for the fourth-order equation. For the other two, put the wall values into the transformed continuity relation. Since u hat and w hat vanish there, the y derivative of v hat has to vanish there too.

Board: b0 — a Math \[text\] that says "$hat(u) = hat(v) = hat(w) = 0 quad upright("at") thin y = plus.minus 1$"; gap — a Figure (x\_range=(0.0, 3.0), y\_range=(-1.7, 1.7), aspect=(3.0, 2.8)); head\_bc — a Heading that says "Where Six Conditions Come From"; wall\_top — a Line \[gray\] drawn in gap (start=(0.0, 1.0), end=(3.0, 1.0)); wall\_bot — a Line \[gray\] drawn in gap (start=(0.0, -1.0), end=(3.0, -1.0)); zero\_axis — a Line \[gray\] drawn in gap (start=(1.4, -1.0), end=(1.4, 1.0), dashed=True)

Actions:
- [10:26.461](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=626.4605624999999): b1 is shown on the screen, written out.
- [10:31.709](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=631.7085625): vhat is shown on the screen, written out.

##### [10:35.919](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=635.9190625)

Narration: So the picture at each wall is this: v hat pinned to zero, and pinned flat. Four conditions, and not one of them was invented for numerical convenience.

Board: b0 — a Math \[text\] that says "$hat(u) = hat(v) = hat(w) = 0 quad upright("at") thin y = plus.minus 1$"; b1 — a Math \[text\] that says "$D hat(v) = - i k\_x hat(u) - i k\_z hat(w) = 0$"; gap — a Figure (x\_range=(0.0, 3.0), y\_range=(-1.7, 1.7), aspect=(3.0, 2.8)); head\_bc — a Heading that says "Where Six Conditions Come From"; wall\_top — a Line \[gray\] drawn in gap (start=(0.0, 1.0), end=(3.0, 1.0)); wall\_bot — a Line \[gray\] drawn in gap (start=(0.0, -1.0), end=(3.0, -1.0)); zero\_axis — a Line \[gray\] drawn in gap (start=(1.4, -1.0), end=(1.4, 1.0), dashed=True); vhat — a ParametricCurve \[blue\] labelled "hat(v)(y)" drawn in gap (function=\<function\>, t\_range=(-1.0, 1.0))

Actions:
- [10:39.751](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=639.7505625): top\_tag is shown on the screen, written out.
- [10:39.957](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=639.9569061563436): bot\_tag is shown on the screen, written out.
- [10:41.422](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=641.4215624999999): vhat is indicated — a transient flash.

##### [10:47.386](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=647.3855625)

Narration: The vorticity is easier still. Wall-normal vorticity is built from u and w alone, and both of those are zero at the wall, so omega y hat vanishes there. Two conditions for a second-order equation.

Board: b0 — a Math \[text\] that says "$hat(u) = hat(v) = hat(w) = 0 quad upright("at") thin y = plus.minus 1$"; b1 — a Math \[text\] that says "$D hat(v) = - i k\_x hat(u) - i k\_z hat(w) = 0$"; gap — a Figure (x\_range=(0.0, 3.0), y\_range=(-1.7, 1.7), aspect=(3.0, 2.8)); head\_bc — a Heading that says "Where Six Conditions Come From"; wall\_top — a Line \[gray\] drawn in gap (start=(0.0, 1.0), end=(3.0, 1.0)); wall\_bot — a Line \[gray\] drawn in gap (start=(0.0, -1.0), end=(3.0, -1.0)); zero\_axis — a Line \[gray\] drawn in gap (start=(1.4, -1.0), end=(1.4, 1.0), dashed=True); vhat — a ParametricCurve \[blue\] labelled "hat(v)(y)" drawn in gap (function=\<function\>, t\_range=(-1.0, 1.0)); top\_tag — a Math \[yellow\] that says "$hat(v) = 0, thin D hat(v) = 0$" drawn in gap; bot\_tag — a Math \[yellow\] that says "$hat(v) = 0, thin D hat(v) = 0$" drawn in gap

Actions:
- [10:52.007](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=652.0065625): b2 is shown on the screen, written out.
- [10:57.138](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=657.1375625): b2 (the "= 0" part) is emphasized.
- [11:1.573](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=661.5730625): b0 is hidden from the screen — left the board.
- [11:1.573](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=661.5730625): b1 is hidden from the screen — left the board.
- [11:1.573](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=661.5730625): b2 is hidden from the screen — left the board.
- [11:1.573](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=661.5730625): head\_bc is hidden from the screen — left the board.
- [11:1.573](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=661.5730625): b2 (the "= 0" part) is no longer emphasized.

##### [11:2.173](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=662.1730624999999)

Narration: Let me count it once more, because this is the part that makes the formulation feel inevitable. Each unknown, its order in y, and what the walls hand us for it.

Board: gap — a Figure (x\_range=(0.0, 3.0), y\_range=(-1.7, 1.7), aspect=(3.0, 2.8)); wall\_top — a Line \[gray\] drawn in gap (start=(0.0, 1.0), end=(3.0, 1.0)); wall\_bot — a Line \[gray\] drawn in gap (start=(0.0, -1.0), end=(3.0, -1.0)); zero\_axis — a Line \[gray\] drawn in gap (start=(1.4, -1.0), end=(1.4, 1.0), dashed=True); vhat — a ParametricCurve \[blue\] labelled "hat(v)(y)" drawn in gap (function=\<function\>, t\_range=(-1.0, 1.0)); top\_tag — a Math \[yellow\] that says "$hat(v) = 0, thin D hat(v) = 0$" drawn in gap; bot\_tag — a Math \[yellow\] that says "$hat(v) = 0, thin D hat(v) = 0$" drawn in gap

Actions:
- [11:2.173](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=662.1730624999999): head\_count is shown on the screen, written out.
- [11:8.443](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=668.4425624999999): bc\_table is shown on the screen, written out.

##### [11:13.094](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=673.0940625)

Narration: The wall-normal velocity obeys a fourth-order equation, and the walls give exactly four conditions: the value, and the slope, at each of the two walls.

Board: gap — a Figure (x\_range=(0.0, 3.0), y\_range=(-1.7, 1.7), aspect=(3.0, 2.8)); wall\_top — a Line \[gray\] drawn in gap (start=(0.0, 1.0), end=(3.0, 1.0)); wall\_bot — a Line \[gray\] drawn in gap (start=(0.0, -1.0), end=(3.0, -1.0)); zero\_axis — a Line \[gray\] drawn in gap (start=(1.4, -1.0), end=(1.4, 1.0), dashed=True); vhat — a ParametricCurve \[blue\] labelled "hat(v)(y)" drawn in gap (function=\<function\>, t\_range=(-1.0, 1.0)); top\_tag — a Math \[yellow\] that says "$hat(v) = 0, thin D hat(v) = 0$" drawn in gap; bot\_tag — a Math \[yellow\] that says "$hat(v) = 0, thin D hat(v) = 0$" drawn in gap; head\_count — a Heading that says "The Count Comes Out Exactly"

Actions:
- [11:15.44](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=675.4395625): bc\_table is shown on the screen, written out.
- [11:19.875](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=679.8745624999999): bc\_table (the "row=2" part) is emphasized.
- [11:23.439](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=683.4385625): bc\_table (the "row=2" part) is no longer emphasized.

##### [11:24.039](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=684.0385624999999)

Narration: The wall-normal vorticity obeys a second-order equation, and the walls give exactly two. Nothing is left over, and nothing has to be guessed. Compare that with a boundary condition for the pressure, which does not exist.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [11:26.733](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=686.7325625): bc\_table is shown on the screen, written out.
- [11:30.796](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=690.7955625): bc\_table (the "row=3" part) is emphasized.
- [11:34.128](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=694.1275625): nothing\_guessed is shown on the screen, written out.
- [11:34.128](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=694.1275625): bc\_table (the "row=3" part) is no longer emphasized.
- [11:38.737](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=698.7370625): bc\_table is hidden from the screen — left the board.
- [11:38.737](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=698.7370625): gap is hidden from the screen — left the board.
- [11:38.737](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=698.7370625): wall\_top is hidden from the screen — gap left the board.
- [11:38.737](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=698.7370625): wall\_bot is hidden from the screen — gap left the board.
- [11:38.737](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=698.7370625): zero\_axis is hidden from the screen — gap left the board.
- [11:38.737](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=698.7370625): vhat is hidden from the screen — gap left the board.
- [11:38.737](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=698.7370625): top\_tag is hidden from the screen — gap left the board.
- [11:38.737](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=698.7370625): bot\_tag is hidden from the screen — gap left the board.
- [11:38.737](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=698.7370625): head\_count is hidden from the screen — left the board.
- [11:38.737](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=698.7370625): nothing\_guessed is hidden from the screen — left the board.

##### [11:39.337](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=699.3370625)

Narration: Now the exception. The reconstruction of the horizontal velocities divided by k squared, and there is exactly one mode where k squared is zero: no variation in x and no variation in z. That mode is the mean flow, averaged over wall-parallel planes, and everything we have built so far says nothing about it.

Board: Empty.

Actions:
- [11:39.337](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=699.3370625): head\_mean is shown on the screen, written out.
- [11:54.082](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=714.0815624999999): profile\_axes is shown on the screen, written out.
- [11:56.683](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=716.6825624999999): mean\_curve is shown on the screen, written out.

##### [12:1.253](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=721.2530624999999)

Narration: One of its components is free. Continuity for that mode says the y derivative of v hat is zero, and v hat is zero at the wall, so v hat is identically zero right across the gap. There is no mean flow through the walls, which is exactly what we should expect.

Board: profile\_axes — an Axes (x\_range=(0.0, 1.2), y\_range=(-1.15, 1.15), aspect=(2.0, 2.6)); head\_mean — a Heading that says "The Mode That Degenerates"; mean\_curve — a ParametricCurve \[blue\] labelled "overline(u)(y)" drawn in profile\_axes (function=\<function\>, t\_range=(-1.0, 1.0))

Actions:
- [12:11.946](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=731.9455624999999): profile\_axes moves to a new place on the board.
- [12:11.946](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=731.9455624999999): mean\_v is shown on the screen, written out.
- [12:18.634](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=738.6335624999999): mean\_v is indicated — a transient flash.

##### [12:20.197](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=740.1970624999999)

Narration: The two horizontal means are not determined algebraically, so they are marched directly. Average the x momentum equation over a wall-parallel plane and you get a one-dimensional diffusion equation for u bar, forced by the mean nonlinear term and by the mean pressure gradient.

Board: mean\_v — a Math \[text\] that says "$hat(v)(0, 0, y) = 0$"; profile\_axes — an Axes (x\_range=(0.0, 1.2), y\_range=(-1.15, 1.15), aspect=(2.0, 2.6)); head\_mean — a Heading that says "The Mode That Degenerates"; mean\_curve — a ParametricCurve \[blue\] labelled "overline(u)(y)" drawn in profile\_axes (function=\<function\>, t\_range=(-1.0, 1.0))

Actions:
- [12:26.316](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=746.3155624999999): mean\_u is shown on the screen, written out.
- [12:36.788](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=756.7875624999999): mean\_u (the "frac(dif P, dif x)" part) is emphasized.

##### [12:38.642](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=758.6415625)

Narration: And there is the one piece of the pressure that survives the whole construction: a single number, the mean streamwise gradient, which is what drives the flow. Either you fix it and let the flow rate settle, or you fix the flow rate and adjust it every step.

Board: mean\_v — a Math \[text\] that says "$hat(v)(0, 0, y) = 0$"; mean\_u — a Math \[text\] that says "$frac(partial overline(u), partial t) = nu D^2 overline(u) - frac(dif P, dif x) + overline(N\_1)$"; profile\_axes — an Axes (x\_range=(0.0, 1.2), y\_range=(-1.15, 1.15), aspect=(2.0, 2.6)); head\_mean — a Heading that says "The Mode That Degenerates"; mean\_curve — a ParametricCurve \[blue\] labelled "overline(u)(y)" drawn in profile\_axes (function=\<function\>, t\_range=(-1.0, 1.0))

Actions:
- [12:48.546](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=768.5455625): mean\_u (the "frac(dif P, dif x)" part) is no longer emphasized.

##### [12:55.043](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=775.0430624999999)

Narration: The spanwise mean gets the same treatment with no imposed gradient. Both are one-dimensional diffusion equations with zero at each wall, and the machinery of the next part solves them without noticing that anything special has happened.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [12:55.508](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=775.5075625): mean\_w is shown on the screen, written out.
- [13:3.345](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=783.3445624999999): mean\_curve is indicated — a transient flash.
- [13:9.431](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=789.4311041666666): head\_mean is hidden from the screen — left the board.
- [13:9.431](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=789.4311041666666): mean\_u is hidden from the screen — left the board.
- [13:9.431](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=789.4311041666666): mean\_v is hidden from the screen — left the board.
- [13:9.431](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=789.4311041666666): mean\_w is hidden from the screen — left the board.
- [13:9.431](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=789.4311041666666): profile\_axes is hidden from the screen — left the board.
- [13:9.431](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=789.4311041666666): mean\_curve is hidden from the screen — profile\_axes left the board.

### Scene 5: [Chebyshev Across the Gap](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=790.4727708333332)

Span: 13:10.473–15:30.729 (790.4727708333332s–930.7285208333333s).

#### Objects

- band: a Math \[text\] that says "$mat(a\_0, b\_0, c\_0, 0, 0; d\_1, a\_1, b\_1, c\_1, 0; 0, d\_2, a\_2, b\_2, c\_2; 0, 0, d\_3, a\_3, b\_3; 0, 0, 0, d\_4, a\_4)$"
- basis\_note: a Text \[text\] that says "Not periodic, not homogeneous: the wall-normal direction gets polynomials, on the interval that is the gap."
- c1: a FunctionPlot \[green\] labelled "T\_1" drawn in cheb\_axes (function=\<function\>)
- c4: a FunctionPlot \[yellow\] labelled "T\_4" drawn in cheb\_axes (function=\<function\>)
- c8: a FunctionPlot \[blue\] labelled "T\_8" drawn in cheb\_axes (function=\<function\>)
- cheb\_axes: an Axes (x\_range=(-1.0, 1.0), y\_range=(-1.25, 1.25), aspect=(2.0, 1.4))
- cheb\_expand: a Math \[text\] that says "$hat(v) = sum\_(n=0)^N a\_n (k\_x, k\_z, t) T\_n (y)$"
- econ\_1: a Text \[text\] that says "A fixed number of nonzero entries per row, whatever $N$ is."
- econ\_2: a Text \[text\] that says "The matrix depends only on $k^2$ and the time step, so it is factored once, before the run."
- econ\_3: a Text \[text\] that says "Even and odd polynomials never mix, which halves each solve again."
- grid\_note: a Text \[text\] that says "The basis puts resolution where the viscous layer is, with nobody stretching a grid by hand."
- head\_band: a Heading that says "Banded, and Factored Once"
- head\_cheb: a Heading that says "A Basis for a Direction With Walls"
- head\_grid: a Heading that says "Where the Points Go"
- nodes: a Point \[yellow\] drawn in wall\_line (location=(1.0, 0.0), marker\_radius=0.05)
- nodes\_2: a Point \[yellow\] drawn in wall\_line (location=(0.9238795325112867, 0.0), marker\_radius=0.05)
- nodes\_3: a Point \[yellow\] drawn in wall\_line (location=(0.7071067811865476, 0.0), marker\_radius=0.05)
- nodes\_4: a Point \[yellow\] drawn in wall\_line (location=(0.38268343236508984, 0.0), marker\_radius=0.05)
- nodes\_5: a Point \[yellow\] drawn in wall\_line (location=(6.123233995736766e-17, 0.0), marker\_radius=0.05)
- nodes\_6: a Point \[yellow\] drawn in wall\_line (location=(-0.3826834323650897, 0.0), marker\_radius=0.05)
- nodes\_7: a Point \[yellow\] drawn in wall\_line (location=(-0.7071067811865475, 0.0), marker\_radius=0.05)
- nodes\_8: a Point \[yellow\] drawn in wall\_line (location=(-0.9238795325112867, 0.0), marker\_radius=0.05)
- nodes\_9: a Point \[yellow\] drawn in wall\_line (location=(-1.0, 0.0), marker\_radius=0.05)
- wall\_line: a NumberLine labelled "y" (x\_range=(-1.0, 1.0), include\_numbers=True, ticks\_every=0.5)

#### Beats

##### [13:10.473](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=790.4727708333332)

Narration: The wall-normal direction is neither periodic nor homogeneous, so Fourier is the wrong basis there. Expand in Chebyshev polynomials instead, on the interval from minus one to plus one, which is exactly the gap.

Board: Empty.

Actions:
- [13:10.473](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=790.4727708333332): head\_cheb is shown on the screen, written out.
- [13:17.555](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=797.5547708333332): cheb\_axes is shown on the screen, written out.
- [13:19.9](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=799.8997708333333): cheb\_axes moves to a new place on the board.
- [13:19.9](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=799.8997708333333): basis\_note is shown on the screen, written out.

##### [13:24.401](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=804.4012708333332)

Narration: The first few look like this. T one is just y. T four already has four zeros inside the gap. T eight has eight, and notice where they crowd: the oscillations bunch up towards the two ends.

Board: basis\_note — a Text \[text\] that says "Not periodic, not homogeneous: the wall-normal direction gets polynomials, on the interval that is the gap."; cheb\_axes — an Axes (x\_range=(-1.0, 1.0), y\_range=(-1.25, 1.25), aspect=(2.0, 1.4)); head\_cheb — a Heading that says "A Basis for a Direction With Walls"

Actions:
- [13:26.863](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=806.8627708333332): c1 is shown on the screen, written out.
- [13:29.011](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=809.0107708333333): c4 is shown on the screen, written out.
- [13:32.993](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=812.9927708333332): c8 is shown on the screen, written out.
- [13:35.617](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=815.6167708333332): c8 is indicated — a transient flash.

##### [13:40.106](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=820.1057708333333)

Narration: So the expansion is a finite sum, N plus one coefficients for each wavenumber pair, and those coefficients are what the code actually stores.

Board: basis\_note — a Text \[text\] that says "Not periodic, not homogeneous: the wall-normal direction gets polynomials, on the interval that is the gap."; cheb\_axes — an Axes (x\_range=(-1.0, 1.0), y\_range=(-1.25, 1.25), aspect=(2.0, 1.4)); head\_cheb — a Heading that says "A Basis for a Direction With Walls"; c1 — a FunctionPlot \[green\] labelled "T\_1" drawn in cheb\_axes (function=\<function\>); c4 — a FunctionPlot \[yellow\] labelled "T\_4" drawn in cheb\_axes (function=\<function\>); c8 — a FunctionPlot \[blue\] labelled "T\_8" drawn in cheb\_axes (function=\<function\>)

Actions:
- [13:41.731](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=821.7307708333333): cheb\_expand is shown on the screen, written out.
- [13:48.813](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=828.8127708333333): cheb\_expand (the "a\_n (k\_x, k\_z, t)" part) is emphasized.
- [13:49.73](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=829.7302708333333): basis\_note is hidden from the screen — left the board.
- [13:49.73](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=829.7302708333333): cheb\_axes is hidden from the screen — left the board.
- [13:49.73](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=829.7302708333333): c1 is hidden from the screen — cheb\_axes left the board.
- [13:49.73](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=829.7302708333333): c4 is hidden from the screen — cheb\_axes left the board.
- [13:49.73](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=829.7302708333333): c8 is hidden from the screen — cheb\_axes left the board.
- [13:49.73](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=829.7302708333333): cheb\_expand is hidden from the screen — left the board.
- [13:49.73](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=829.7302708333333): head\_cheb is hidden from the screen — left the board.
- [13:49.73](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=829.7302708333333): cheb\_expand (the "a\_n (k\_x, k\_z, t)" part) is no longer emphasized.

##### [13:50.33](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=830.3302708333332)

Narration: The collocation points come with the basis rather than being chosen. They are cosines of equally spaced angles, and here they are across the gap for N equal to eight.

Board: Empty.

Actions:
- [13:50.33](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=830.3302708333332): head\_grid is shown on the screen, written out.
- [13:51.503](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=831.5027708333332): wall\_line is shown on the screen, written out.
- [13:55.613](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=835.6127708333332): nodes is shown on the screen, written out.
- [13:55.683](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=835.6834326436247): nodes\_2 is shown on the screen, written out.
- [13:55.754](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=835.754094453916): nodes\_3 is shown on the screen, written out.
- [13:55.825](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=835.8247562642074): nodes\_4 is shown on the screen, written out.
- [13:55.895](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=835.8954180744988): nodes\_5 is shown on the screen, written out.
- [13:55.966](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=835.9660798847901): nodes\_6 is shown on the screen, written out.
- [13:56.037](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=836.0367416950816): nodes\_7 is shown on the screen, written out.
- [13:56.107](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=836.107403505373): nodes\_8 is shown on the screen, written out.
- [13:56.174](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=836.1740367973754): nodes\_9 is shown on the screen, written out.

##### [14:1.681](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=841.6812708333332)

Narration: Look at the spacing. In the middle of the channel the points are as coarse as they ever get.

Board: wall\_line — a NumberLine labelled "y" (x\_range=(-1.0, 1.0), include\_numbers=True, ticks\_every=0.5); head\_grid — a Heading that says "Where the Points Go"; nodes — a Point \[yellow\] drawn in wall\_line (location=(1.0, 0.0), marker\_radius=0.05); nodes\_2 — a Point \[yellow\] drawn in wall\_line (location=(0.9238795325112867, 0.0), marker\_radius=0.05); nodes\_3 — a Point \[yellow\] drawn in wall\_line (location=(0.7071067811865476, 0.0), marker\_radius=0.05); nodes\_4 — a Point \[yellow\] drawn in wall\_line (location=(0.38268343236508984, 0.0), marker\_radius=0.05); nodes\_5 — a Point \[yellow\] drawn in wall\_line (location=(6.123233995736766e-17, 0.0), marker\_radius=0.05); nodes\_6 — a Point \[yellow\] drawn in wall\_line (location=(-0.3826834323650897, 0.0), marker\_radius=0.05); nodes\_7 — a Point \[yellow\] drawn in wall\_line (location=(-0.7071067811865475, 0.0), marker\_radius=0.05); nodes\_8 — a Point \[yellow\] drawn in wall\_line (location=(-0.9238795325112867, 0.0), marker\_radius=0.05); nodes\_9 — a Point \[yellow\] drawn in wall\_line (location=(-1.0, 0.0), marker\_radius=0.05)

Actions:
- [14:3.771](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=843.7707708333332): The segment (-0.3827, 0.0) to (0.0, 0.0) in wall\_line is lit up.

##### [14:7.343](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=847.3432708333332)

Narration: Against the wall they are packed tight, with a spacing that shrinks like one over N squared. That is precisely the grid a wall-bounded flow wants, because the whole difficulty of this problem is a thin viscous layer against each wall.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [14:7.343](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=847.3432708333332): wall\_line: retire a lit segment (unemphasize\_line).
- [14:8.841](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=848.8407708333332): The segment (0.9239, 0.0) to (1.0, 0.0) in wall\_line is lit up.
- [14:19.546](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=859.5457708333332): grid\_note is shown on the screen, written out.
- [14:19.998](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=859.9977708333332): wall\_line: retire a lit segment (unemphasize\_line).
- [14:21.705](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=861.7047708333332): grid\_note is hidden from the screen — left the board.
- [14:21.705](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=861.7047708333332): head\_grid is hidden from the screen — left the board.
- [14:21.705](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=861.7047708333332): wall\_line is hidden from the screen — left the board.
- [14:21.705](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=861.7047708333332): nodes is hidden from the screen — wall\_line left the board.
- [14:21.705](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=861.7047708333332): nodes\_2 is hidden from the screen — wall\_line left the board.
- [14:21.705](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=861.7047708333332): nodes\_3 is hidden from the screen — wall\_line left the board.
- [14:21.705](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=861.7047708333332): nodes\_4 is hidden from the screen — wall\_line left the board.
- [14:21.705](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=861.7047708333332): nodes\_5 is hidden from the screen — wall\_line left the board.
- [14:21.705](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=861.7047708333332): nodes\_6 is hidden from the screen — wall\_line left the board.
- [14:21.705](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=861.7047708333332): nodes\_7 is hidden from the screen — wall\_line left the board.
- [14:21.705](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=861.7047708333332): nodes\_8 is hidden from the screen — wall\_line left the board.
- [14:21.705](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=861.7047708333332): nodes\_9 is hidden from the screen — wall\_line left the board.

##### [14:22.305](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=862.3047708333332)

Narration: Now, what does the operator D squared minus k squared look like in this basis? Written for the coefficients, either as a tau formulation or as a Galerkin one, the second derivative connects a coefficient to only a few of its neighbours. The matrix is banded.

Board: Empty.

Actions:
- [14:22.305](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=862.3047708333332): head\_band is shown on the screen, written out.
- [14:38.28](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=878.2797708333333): band is shown on the screen, written out.

##### [14:39.716](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=879.7157708333332)

Narration: For the second-order operator that means three diagonals. For the fourth-order operator, five. Either way it is a fixed number of entries per row, whatever N is, so one solve costs order N operations rather than order N cubed.

Board: band — a Math \[text\] that says "$mat(a\_0, b\_0, c\_0, 0, 0; d\_1, a\_1, b\_1, c\_1, 0; 0, d\_2, a\_2, b\_2, c\_2; 0, 0, d\_3, a\_3, b\_3; 0, 0, 0, d\_4, a\_4)$"; head\_band — a Heading that says "Banded, and Factored Once"

Actions:
- [14:41.934](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=881.9337708333333): band (the "diagonal=main" part) is emphasized.
- [14:47.239](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=887.2387708333332): econ\_1 is shown on the screen, written out.
- [14:47.239](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=887.2387708333332): band (the "diagonal=main" part) is no longer emphasized.

##### [14:55.397](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=895.3967708333332)

Narration: Two further economies, and they are the ones that matter in practice. The matrix depends on the wavenumbers only through k squared, and on the time step, and neither of those changes as the simulation runs. So it is factored once, before the first step, and every step afterwards is a back substitution.

Board: band — a Math \[text\] that says "$mat(a\_0, b\_0, c\_0, 0, 0; d\_1, a\_1, b\_1, c\_1, 0; 0, d\_2, a\_2, b\_2, c\_2; 0, 0, d\_3, a\_3, b\_3; 0, 0, 0, d\_4, a\_4)$"; econ\_1 — a Text \[text\] that says "A fixed number of nonzero entries per row, whatever $N$ is."; head\_band — a Heading that says "Banded, and Factored Once"

Actions:
- [15:9.515](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=909.5147708333333): econ\_2 is shown on the screen, written out.

##### [15:15.432](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=915.4322708333332)

Narration: And one more, which is free. The operator does not mix even polynomials with odd ones, so each system splits into two half-size systems, one per parity. All of that, for every wavenumber pair independently.

Board: band — a Math \[text\] that says "$mat(a\_0, b\_0, c\_0, 0, 0; d\_1, a\_1, b\_1, c\_1, 0; 0, d\_2, a\_2, b\_2, c\_2; 0, 0, d\_3, a\_3, b\_3; 0, 0, 0, d\_4, a\_4)$"; econ\_1 — a Text \[text\] that says "A fixed number of nonzero entries per row, whatever $N$ is."; econ\_2 — a Text \[text\] that says "The matrix depends only on $k^2$ and the time step, so it is factored once, before the run."; head\_band — a Heading that says "Banded, and Factored Once"

Actions:
- [15:24.86](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=924.8597708333332): econ\_3 is shown on the screen, written out.
- [15:29.687](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=929.6868541666665): band is hidden from the screen — left the board.
- [15:29.687](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=929.6868541666665): econ\_1 is hidden from the screen — left the board.
- [15:29.687](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=929.6868541666665): econ\_2 is hidden from the screen — left the board.
- [15:29.687](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=929.6868541666665): econ\_3 is hidden from the screen — left the board.
- [15:29.687](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=929.6868541666665): head\_band is hidden from the screen — left the board.

### Scene 6: [Marching in Time, and Why It Is Fast](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=930.7285208333333)

Span: 15:30.729–19:45.161 (930.7285208333333s–1185.1614166666666s).

#### Objects

- catch: a Panel that says "All four conditions are on $hat(v)$. Neither second-order problem has a natural condition on $phi$ at the walls."
- convolution: a Math \[text\] that says "$O(N^2) arrow.r O(N log N)$"
- cost: a Math \[text\] that says "$O(N\_x N\_z N\_y log (N\_x N\_z))$"
- cut\_left: a Point \[red\] labelled "upright("cut")" drawn in spectrum (location=(-13.0, 0.0))
- cut\_right: a Point \[red\] labelled "upright("cut")" drawn in spectrum (location=(13.0, 0.0))
- explicit\_cost: a Math \[text\] that says "$Delta t\_(upright("explicit")) prop N^(-4)$"
- head\_nl: a Heading that says "The Nonlinear Terms"
- head\_split: a Heading that says "The Fourth-Order Solve, in Two Halves"
- head\_time: a Heading that says "Semi-Implicit Time Advance"
- head\_why: a Heading that says "Why It Is Fast, and Stable"
- influence: a Math \[text\] that says "$hat(v) = hat(v)\_p + c\_1 hat(v)\_1 + c\_2 hat(v)\_2$"
- march: a Derivation \[text\] that says "$(1 - frac(nu Delta t, 2) (D^2 - k^2)) hat(omega)\_y^(n+1) &= (1 + frac(nu Delta t, 2) (D^2 - k^2)) hat(omega)\_y^n \\ &+ Delta t (frac(3, 2) hat(h)\_g^n - frac(1, 2) hat(h)\_g^(n-1))$"
- nl\_1: a Text \[text\] that says "1. Transform the modes back to a physical grid."
- nl\_2: a Text \[text\] that says "2. Form the products there, where they are local."
- nl\_3: a Text \[text\] that says "3. Transform back, and drop the content above the retained band."
- spectrum: a NumberLine labelled "k\_x" (x\_range=(-17.0, 17.0), include\_numbers=True, ticks\_every=8.0)
- split: a Derivation \[text\] that says "$phi &= (D^2 - k^2) hat(v) \\ (1 - frac(nu Delta t, 2) (D^2 - k^2)) phi^(n+1) &= dots.h \\ (D^2 - k^2) hat(v)^(n+1) &= phi^(n+1)$"
- stability: a Text \[text\] that says "With the viscous term implicit, the time step is set by the flow, not by the wall-normal spacing."
- why\_1: a Text \[text\] that says "1. No elliptic pressure solve, at any step."
- why\_2: a Text \[text\] that says "2. The field is divergence free by construction, not by correction."
- why\_3: a Text \[text\] that says "3. Every wavenumber pair is an independent banded solve, prefactored."
- why\_4: a Text \[text\] that says "4. Every boundary condition is one the walls actually give."

#### Beats

##### [15:30.729](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=930.7285208333333)

Narration: Here is one time step for the vorticity equation, written the way it is usually implemented. The viscous term is treated implicitly, by Crank-Nicolson: half of it at the old level, half at the new.

Board: Empty.

Actions:
- [15:30.729](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=930.7285208333333): head\_time is shown on the screen, written out.
- [15:36.511](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=936.5105208333333): march is shown on the screen, written out.
- [15:40.783](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=940.7825208333333): march (the "frac(nu Delta t, 2) (D^2 - k^2)" part) is emphasized.
- [15:42.049](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=942.0485208333333): march (the "frac(nu Delta t, 2) (D^2 - k^2)" part) is no longer emphasized.
- [15:42.049](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=942.0485208333333): march (the "frac(nu Delta t, 2) (D^2 - k^2)#2" part) is emphasized.

##### [15:43.403](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=943.4030208333332)

Narration: The nonlinear source is treated explicitly, by a two-step Adams-Bashforth: three halves of the current value, minus a half of the previous one. No solve is involved, because both are already known.

Board: head\_time — a Heading that says "Semi-Implicit Time Advance"

Actions:
- [15:43.403](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=943.4030208333332): march (the "frac(nu Delta t, 2) (D^2 - k^2)#2" part) is no longer emphasized.
- [15:45.54](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=945.5395208333333): march is shown on the screen, written out.
- [15:49.208](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=949.2075208333333): march (the "frac(3, 2) hat(h)\_g^n" part) is emphasized.
- [15:57.08](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=957.0795208333333): march (the "frac(3, 2) hat(h)\_g^n" part) is no longer emphasized.

##### [15:57.68](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=957.6795208333333)

Narration: And look at what the left hand side is. It is the banded, prefactored operator from a moment ago, one per wavenumber pair, unchanged from step to step. The whole advance is a back substitution per mode, plus the work of forming h.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [16:1.081](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=961.0805208333333): march (the "(1 - frac(nu Delta t, 2) (D^2 - k^2))" part) is indicated — a transient flash.

##### [16:13.57](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=973.5695208333333)

Narration: Now the stability, which is the real reason for treating viscosity implicitly. The time step is no longer limited by the wall-normal spacing at all. That spacing goes like one over N squared, so an explicit viscous treatment would need a step going like one over N to the fourth. On a fine grid that is simply unusable.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [16:30.032](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=990.0315208333333): explicit\_cost is shown on the screen, written out.
- [16:31.75](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=991.7495208333332): stability is shown on the screen, written out.
- [16:34.084](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=994.0835208333333): explicit\_cost is hidden from the screen — left the board.
- [16:34.084](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=994.0835208333333): head\_time is hidden from the screen — left the board.
- [16:34.084](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=994.0835208333333): march is hidden from the screen — left the board.
- [16:34.084](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=994.0835208333333): stability is hidden from the screen — left the board.

##### [16:34.684](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=994.6835208333333)

Narration: The velocity equation needs one more idea. It is fourth order, so rather than building a fourth-order operator we split it into two second-order problems. First solve for phi, the Laplacian of v hat. Then solve for v hat itself, with phi as the source.

Board: Empty.

Actions:
- [16:34.684](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=994.6835208333333): head\_split is shown on the screen, written out.
- [16:41.894](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1001.8935208333332): split is shown on the screen, written out.
- [16:45.353](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1005.3525208333333): split is shown on the screen, written out.
- [16:51.391](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1011.3905208333333): split is shown on the screen, written out.

##### [16:52.826](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1012.8260208333332)

Narration: There is a catch here, and it is worth naming. All four boundary conditions are conditions on v hat: two values and two slopes. Neither of the two second-order problems has any natural condition on phi at the walls.

Board: head\_split — a Heading that says "The Fourth-Order Solve, in Two Halves"

Actions:
- [16:53.604](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1013.6035208333333): catch is shown on the screen, written out.
- [17:2.254](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1022.2535208333333): split is indicated — a transient flash.

##### [17:7.474](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1027.4740208333333)

Narration: The standard remedy is a Green's function argument. Solve the pair once with the real forcing and zero conditions on phi, then twice more with unit conditions and no forcing, and take the combination of the three that makes the slope of v hat vanish at both walls. That is a two by two solve per mode on quantities computed before the run.

Board: catch — a Panel that says "All four conditions are on $hat(v)$. Neither second-order problem has a natural condition on $phi$ at the walls."; head\_split — a Heading that says "The Fourth-Order Solve, in Two Halves"

Actions:
- [17:18.515](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1038.5145208333333): influence is shown on the screen, written out.
- [17:21.162](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1041.1615208333333): influence (the "c\_1 hat(v)\_1 + c\_2 hat(v)\_2" part) is emphasized.
- [17:27.768](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1047.7680208333334): catch is hidden from the screen — left the board.
- [17:27.768](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1047.7680208333334): head\_split is hidden from the screen — left the board.
- [17:27.768](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1047.7680208333334): influence is hidden from the screen — left the board.
- [17:27.768](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1047.7680208333334): split is hidden from the screen — left the board.
- [17:27.768](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1047.7680208333334): influence (the "c\_1 hat(v)\_1 + c\_2 hat(v)\_2" part) is no longer emphasized.

##### [17:28.368](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1048.3680208333333)

Narration: That leaves the source terms h, which are the only nonlinear work in the method, and they are evaluated pseudospectrally. Transform the modes back to a physical grid. Form the products there, where a product is just a multiplication. Then transform the result back to modes.

Board: Empty.

Actions:
- [17:28.368](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1048.3680208333333): head\_nl is shown on the screen, written out.
- [17:36.403](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1056.4025208333333): nl\_1 is shown on the screen, written out.
- [17:39.828](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1059.8275208333332): nl\_2 is shown on the screen, written out.
- [17:44.866](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1064.8655208333332): nl\_3 is shown on the screen, written out.

##### [17:46.755](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1066.7550208333332)

Narration: Why not form the products mode by mode instead? Because a product of two Fourier series is a convolution, which costs order N squared per direction, while two transforms and a multiplication cost order N log N. That single choice is what makes spectral direct simulation affordable at all.

Board: nl\_1 — a Text \[text\] that says "1. Transform the modes back to a physical grid."; nl\_2 — a Text \[text\] that says "2. Form the products there, where they are local."; nl\_3 — a Text \[text\] that says "3. Transform back, and drop the content above the retained band."; head\_nl — a Heading that says "The Nonlinear Terms"

Actions:
- [17:52.7](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1072.6995208333333): convolution is shown on the screen, written out.
- [18:4.646](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1084.6455208333332): convolution (the "O(N log N)" part) is emphasized.
- [18:5.83](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1085.8300208333333): convolution (the "O(N log N)" part) is no longer emphasized.

##### [18:6.43](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1086.4300208333334)

Narration: The price is aliasing. A product of two modes inside the retained band generates content outside it, and on a finite grid that content folds back onto the modes you are keeping, as error.

Board: nl\_1 — a Text \[text\] that says "1. Transform the modes back to a physical grid."; nl\_2 — a Text \[text\] that says "2. Form the products there, where they are local."; nl\_3 — a Text \[text\] that says "3. Transform back, and drop the content above the retained band."; convolution — a Math \[text\] that says "$O(N^2) arrow.r O(N log N)$"; head\_nl — a Heading that says "The Nonlinear Terms"

Actions:
- [18:10.656](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1090.6555208333334): spectrum is shown on the screen, written out.
- [18:11.063](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1091.0625208333333): The segment (-8.0, 0.0) to (8.0, 0.0) in spectrum is lit up.

##### [18:19.511](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1099.5105208333332)

Narration: So in both wall-parallel directions the products are formed on an enlarged grid and everything above the retained band is thrown away rather than folded back. That is the three-halves rule, and a phase shift scheme does the same job by a different route.

Board: nl\_1 — a Text \[text\] that says "1. Transform the modes back to a physical grid."; nl\_2 — a Text \[text\] that says "2. Form the products there, where they are local."; nl\_3 — a Text \[text\] that says "3. Transform back, and drop the content above the retained band."; convolution — a Math \[text\] that says "$O(N^2) arrow.r O(N log N)$"; spectrum — a NumberLine labelled "k\_x" (x\_range=(-17.0, 17.0), include\_numbers=True, ticks\_every=8.0); head\_nl — a Heading that says "The Nonlinear Terms"

Actions:
- [18:25.943](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1105.9425208333332): cut\_left is shown on the screen, written out.
- [18:26.157](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1106.156922518781): cut\_right is shown on the screen, written out.
- [18:29.739](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1109.7385208333333): spectrum: retire a lit segment (unemphasize\_line).
- [18:33.884](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1113.8840208333334): convolution is hidden from the screen — left the board.
- [18:33.884](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1113.8840208333334): head\_nl is hidden from the screen — left the board.
- [18:33.884](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1113.8840208333334): nl\_1 is hidden from the screen — left the board.
- [18:33.884](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1113.8840208333334): nl\_2 is hidden from the screen — left the board.
- [18:33.884](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1113.8840208333334): nl\_3 is hidden from the screen — left the board.
- [18:33.884](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1113.8840208333334): spectrum is hidden from the screen — left the board.
- [18:33.884](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1113.8840208333334): cut\_left is hidden from the screen — spectrum left the board.
- [18:33.884](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1113.8840208333334): cut\_right is hidden from the screen — spectrum left the board.

##### [18:34.484](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1114.4840208333333)

Narration: So let me put the efficiency in one place. First: there is no elliptic pressure solve, at any step, because there is no pressure. Second: the reconstructed velocity is divergence free by construction, so nothing has to be projected or corrected afterwards.

Board: Empty.

Actions:
- [18:34.484](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1114.4840208333333): head\_why is shown on the screen, written out.
- [18:38.234](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1118.2335208333334): why\_1 is shown on the screen, written out.
- [18:45.015](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1125.0145208333333): why\_2 is shown on the screen, written out.

##### [18:50.677](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1130.6765208333334)

Narration: Third: the Fourier transform in the two homogeneous directions uncouples the three-dimensional problem into an independent, banded, already-factored boundary value problem for every wavenumber pair. Fourth: every boundary condition the method needs is one the walls actually give, so there is nothing invented near the wall.

Board: why\_1 — a Text \[text\] that says "1. No elliptic pressure solve, at any step."; why\_2 — a Text \[text\] that says "2. The field is divergence free by construction, not by correction."; head\_why — a Heading that says "Why It Is Fast, and Stable"

Actions:
- [18:55.309](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1135.3085208333332): why\_3 is shown on the screen, written out.
- [19:3.599](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1143.5985208333334): why\_4 is shown on the screen, written out.

##### [19:11.327](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1151.3270208333333)

Narration: What is left, per step, is dominated by the transforms: order N log N in the wall-parallel directions, times the number of points across the gap. The solves themselves are linear in the number of Chebyshev modes.

Board: why\_1 — a Text \[text\] that says "1. No elliptic pressure solve, at any step."; why\_2 — a Text \[text\] that says "2. The field is divergence free by construction, not by correction."; why\_3 — a Text \[text\] that says "3. Every wavenumber pair is an independent banded solve, prefactored."; why\_4 — a Text \[text\] that says "4. Every boundary condition is one the walls actually give."; head\_why — a Heading that says "Why It Is Fast, and Stable"

Actions:
- [19:14.428](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1154.4275208333333): cost is shown on the screen, written out.
- [19:23.704](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1163.7035208333334): A box is drawn around cost.

##### [19:26.962](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1166.9620208333333)

Narration: That is the whole of it. Two curls removed the pressure. Fourier removed two of the three space dimensions from every solve. Chebyshev put the points where the walls need them. And no-slip turned out to supply exactly the six boundary conditions the two equations were waiting for.

Board: why\_1 — a Text \[text\] that says "1. No elliptic pressure solve, at any step."; why\_2 — a Text \[text\] that says "2. The field is divergence free by construction, not by correction."; why\_3 — a Text \[text\] that says "3. Every wavenumber pair is an independent banded solve, prefactored."; why\_4 — a Text \[text\] that says "4. Every boundary condition is one the walls actually give."; cost — a Math \[text\] that says "$O(N\_x N\_z N\_y log (N\_x N\_z))$"; head\_why — a Heading that says "Why It Is Fast, and Stable"

Actions:
- [19:29.412](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1169.4115208333333): why\_1 is indicated — a transient flash.
- [19:31.456](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1171.4555208333334): why\_3 is indicated — a transient flash.
- [19:40.848](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1180.8475208333334): why\_4 is indicated — a transient flash.
- [19:44.12](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1184.1197499999998): cost is hidden from the screen — left the board.
- [19:44.12](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1184.1197499999998): head\_why is hidden from the screen — left the board.
- [19:44.12](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1184.1197499999998): why\_1 is hidden from the screen — left the board.
- [19:44.12](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1184.1197499999998): why\_2 is hidden from the screen — left the board.
- [19:44.12](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1184.1197499999998): why\_3 is hidden from the screen — left the board.
- [19:44.12](https://academa.ai/@apo/lectures/the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation?t=1184.1197499999998): why\_4 is hidden from the screen — left the board.
