{"version":1,"lectureId":"01M1ADAPT7200GP9R131FEAXDD","attempt":0,"publication":{"slug":"the-kim-moin-and-moser-kmm-velocity-vorticity-spectral-formulation","title":"The Kim, Moin, and Moser (KMM) Velocity-Vorticity Spectral Formulation","subject":"engineering","summary":"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.","metaDescription":"How the KMM velocity-vorticity formulation removes pressure from channel-flow DNS, and why Fourier mode decoupling makes it so fast.","transcript":"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. 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. 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. 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. 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. 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.","watch":{"version":1,"scenes":[{"title":"The Channel and the Pressure Problem","start":0,"end":189.96349999999995,"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":[{"start":0,"say":"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.","live":[],"does":[[0,"head_channel is shown on the screen, written out."],[0.488,"channel is shown on the screen, written out."],[6.049,"lower is shown on the screen, written out."],[6.826832044498712,"upper is shown on the screen, written out."],[7.326,"stream is shown on the screen, written out."]]},{"start":13.4405,"say":"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.","live":["channel","head_channel","lower","upper","stream"],"does":[[13.4405,"channel turns in its own slot."],[14.613,"The xy plane in channel is lit up."],[17.863999999999997,"note_geometry is shown on the screen, written out."],[22.624000000000002,"channel: retire a lit plane (unemphasize_plane)."]]},{"start":29.7265,"say":"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.","live":["channel","note_geometry","head_channel","lower","upper","stream"],"does":[[31.468000000000004,"lower is indicated — a transient flash."],[31.468000000000004,"upper is indicated — a transient flash."],[41.754000000000005,"channel is hidden from the screen — left the board."],[41.754000000000005,"lower is hidden from the screen — channel left the board."],[41.754000000000005,"upper is hidden from the screen — channel left the board."],[41.754000000000005,"stream is hidden from the screen — channel left the board."],[41.754000000000005,"head_channel is hidden from the screen — left the board."],[41.754000000000005,"note_geometry is hidden from the screen — left the board."]]},{"start":42.354,"say":"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.","live":[],"does":[[42.354,"head_target is shown on the screen, written out."],[51.271,"v_eq is shown on the screen, written out."]]},{"start":57.3855,"say":"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.","live":["v_eq","head_target"],"does":[[57.3855,"g_eq is shown on the screen, written out."],[62.55200000000001,"g_eq (the \"nu nabla^2 omega_y\" part) is emphasized."],[65.686,"g_eq (the \"nu nabla^2 omega_y\" part) is no longer emphasized."]]},{"start":67.842,"say":"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.","live":["v_eq","g_eq","head_target"],"does":[[68.933,"promise is shown on the screen, written out."],[72.753,"v_eq is indicated — a transient flash."],[73.03116711590296,"g_eq is indicated — a transient flash."],[82.366,"g_eq is hidden from the screen — left the board."],[82.366,"head_target is hidden from the screen — left the board."],[82.366,"promise is hidden from the screen — left the board."],[82.366,"v_eq is hidden from the screen — left the board."]]},{"start":82.966,"say":"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.","live":[],"does":[[82.966,"head_primitive is shown on the screen, written out."],[86.15899999999999,"primitive is shown on the screen, written out."],[91.87199999999999,"primitive is shown on the screen, written out."]]},{"start":94.01599999999999,"say":"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.","live":["head_primitive"],"does":[[102.09599999999999,"primitive (the \"frac(partial p, partial x_i)\" part) is emphasized."],[105.50899999999999,"primitive is indicated — a transient flash."]]},{"start":107.54899999999999,"say":"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.","live":null,"does":[[107.54899999999999,"primitive (the \"frac(partial p, partial x_i)\" part) is no longer emphasized."],[115.64099999999999,"primitive is shown on the screen, written out."],[119.681,"consequence is shown on the screen, written out."]]},{"start":122.139,"say":"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.","live":["consequence","head_primitive"],"does":[[126.43499999999999,"primitive is indicated — a transient flash."],[133.5285,"consequence is hidden from the screen — left the board."],[133.5285,"head_primitive is hidden from the screen — left the board."],[133.5285,"primitive is hidden from the screen — left the board."]]},{"start":134.1285,"say":"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.","live":[],"does":[[134.1285,"head_trouble is shown on the screen, written out."],[134.662,"trouble_1 is shown on the screen, written out."]]},{"start":145.108,"say":"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.","live":["trouble_1","head_trouble"],"does":[[145.584,"trouble_2 is shown on the screen, written out."]]},{"start":158.386,"say":"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.","live":["trouble_1","trouble_2","head_trouble"],"does":[[158.93099999999998,"trouble_3 is shown on the screen, written out."],[164.226,"trouble_3 (the \"nothing\" part) is emphasized."],[172.004,"trouble_3 (the \"nothing\" part) is no longer emphasized."]]},{"start":176.15699999999998,"say":"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.","live":["trouble_1","trouble_2","trouble_3","head_trouble"],"does":[[181.718,"trouble_1 is indicated — a transient flash."],[188.92183333333332,"head_trouble is hidden from the screen — left the board."],[188.92183333333332,"trouble_1 is hidden from the screen — left the board."],[188.92183333333332,"trouble_2 is hidden from the screen — left the board."],[188.92183333333332,"trouble_3 is hidden from the screen — left the board."]]}]},{"title":"Eliminating the Pressure","start":189.96349999999995,"end":396.88129166666664,"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":[{"start":189.96349999999995,"say":"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.","live":[],"does":[[189.96349999999995,"head_spin is shown on the screen, written out."],[198.49649999999994,"plane_view is shown on the screen, written out."],[200.27349999999996,"spin is shown on the screen, written out."]]},{"start":202.46399999999994,"say":"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.","live":["plane_view","head_spin","spin"],"does":[[205.36549999999994,"turn is shown on the screen, written out."],[212.99349999999995,"plane_view moves to a new place on the board."],[212.99349999999995,"spin_note is shown on the screen, written out."]]},{"start":214.59199999999996,"say":"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.","live":["spin_note","plane_view","head_spin","spin","turn"],"does":[[215.23049999999995,"omega_formula is shown on the screen, written out."],[222.05649999999997,"omega_formula (the \"frac(partial u, partial z)\" part) is emphasized."],[226.39949999999996,"omega_formula (the \"frac(partial u, partial z)\" part) is no longer emphasized."],[226.39949999999996,"omega_formula (the \"frac(partial w, partial x)\" part) is emphasized."],[227.54849999999996,"head_spin is hidden from the screen — left the board."],[227.54849999999996,"omega_formula is hidden from the screen — left the board."],[227.54849999999996,"plane_view is hidden from the screen — left the board."],[227.54849999999996,"spin is hidden from the screen — plane_view left the board."],[227.54849999999996,"turn is hidden from the screen — plane_view left the board."],[227.54849999999996,"spin_note is hidden from the screen — left the board."],[227.54849999999996,"omega_formula (the \"frac(partial w, partial x)\" part) is no longer emphasized."]]},{"start":228.14849999999996,"say":"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.","live":[],"does":[[228.14849999999996,"head_curl is shown on the screen, written out."],[233.05949999999996,"curl_work is shown on the screen, written out."],[236.22949999999997,"curl_work is shown on the screen, written out."]]},{"start":243.43499999999995,"say":"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.","live":["head_curl"],"does":[[247.81249999999997,"curl_work is shown on the screen, written out."],[252.17749999999995,"curl_work is indicated — a transient flash."]]},{"start":259.0704999999999,"say":"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.","live":null,"does":[[264.27149999999995,"curl_work is shown on the screen, written out."],[269.86749999999995,"curl_work (the \"nu nabla^2 omega_y\" part) is emphasized."],[272.15549999999996,"curl_work is shown on the screen, written out."],[272.15549999999996,"curl_work (the \"nu nabla^2 omega_y\" part) is no longer emphasized."],[275.4409999999999,"curl_work is hidden from the screen — left the board."],[275.4409999999999,"head_curl is hidden from the screen — left the board."]]},{"start":276.04099999999994,"say":"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.","live":[],"does":[[276.04099999999994,"head_double is shown on the screen, written out."],[281.91549999999995,"v_work is shown on the screen, written out."],[289.20649999999995,"v_work (the \"frac(partial N_j, partial x_j)\" part) is emphasized."],[292.6785,"v_work (the \"frac(partial N_j, partial x_j)\" part) is no longer emphasized."]]},{"start":293.27849999999995,"say":"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.","live":["head_double"],"does":[[298.79249999999996,"v_work is shown on the screen, written out."],[308.27849999999995,"v_work (the \"frac(partial, partial y) (nabla^2 p)\" part) is emphasized."],[313.5609999999999,"v_work (the \"frac(partial, partial y) (nabla^2 p)\" part) is no longer emphasized."]]},{"start":314.16099999999994,"say":"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.","live":null,"does":[[318.41049999999996,"v_work is shown on the screen, written out."],[326.32849999999996,"v_work (the \"nu nabla^4 v\" part) is emphasized."],[328.02349999999996,"v_work is shown on the screen, written out."],[328.02349999999996,"v_work (the \"nu nabla^4 v\" part) is no longer emphasized."]]},{"start":331.66549999999995,"say":"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.","live":null,"does":[[335.26449999999994,"identity is shown on the screen, written out."],[346.3515,"identity is indicated — a transient flash."],[351.36699999999996,"head_double is hidden from the screen — left the board."],[351.36699999999996,"identity is hidden from the screen — left the board."],[351.36699999999996,"v_work is hidden from the screen — left the board."]]},{"start":351.967,"say":"So here they are together. A fourth-order equation for the wall-normal velocity, and a second-order equation for the wall-normal vorticity.","live":[],"does":[[351.967,"head_pair is shown on the screen, written out."],[354.7415,"pair_v is shown on the screen, written out."],[358.3984999999999,"pair_g is shown on the screen, written out."]]},{"start":362.29599999999994,"say":"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.","live":["pair_v","pair_g","head_pair"],"does":[[363.05049999999994,"pair_note is shown on the screen, written out."],[364.7115,"pair_v (the \"h_v\" part) is emphasized."],[364.8771309012875,"pair_g (the \"h_g\" part) is emphasized."],[371.32949999999994,"pair_v (the \"h_v\" part) is no longer emphasized."],[371.5182995095033,"pair_g (the \"h_g\" part) is no longer emphasized."]]},{"start":375.7835,"say":"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.","live":["pair_v","pair_g","pair_note","head_pair"],"does":[[389.8544999999999,"pair_v is indicated — a transient flash."],[395.83962499999996,"head_pair is hidden from the screen — left the board."],[395.83962499999996,"pair_g is hidden from the screen — left the board."],[395.83962499999996,"pair_note is hidden from the screen — left the board."],[395.83962499999996,"pair_v is hidden from the screen — left the board."]]}]},{"title":"One Wavenumber Pair at a Time","start":396.88129166666664,"end":589.2235625,"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":[{"start":396.88129166666664,"say":"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.","live":[],"does":[[396.88129166666664,"head_modes is shown on the screen, written out."],[404.96229166666666,"e0 is shown on the screen, written out."],[411.41729166666664,"e0 (the \"hat(v)(k_x, k_z, y)\" part) is emphasized."],[414.57529166666666,"e0 (the \"hat(v)(k_x, k_z, y)\" part) is no longer emphasized."]]},{"start":415.1752916666666,"say":"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.","live":["e0","head_modes"],"does":[[420.22529166666664,"e1 is shown on the screen, written out."],[428.48029166666663,"e2 is shown on the screen, written out."],[433.20529166666665,"e2 (the \"k^2 = k_x^2 + k_z^2\" part) is emphasized."],[434.59279166666664,"e2 (the \"k^2 = k_x^2 + k_z^2\" part) is no longer emphasized."]]},{"start":435.19279166666666,"say":"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.","live":["e0","e1","e2","head_modes"],"does":[[439.6222916666666,"drastic is shown on the screen, written out."],[445.27579166666663,"drastic is hidden from the screen — left the board."],[445.27579166666663,"e0 is hidden from the screen — left the board."],[445.27579166666663,"e1 is hidden from the screen — left the board."],[445.27579166666663,"e2 is hidden from the screen — left the board."],[445.27579166666663,"head_modes is hidden from the screen — left the board."]]},{"start":445.87579166666666,"say":"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.","live":[],"does":[[445.87579166666666,"head_ode is shown on the screen, written out."],[450.28729166666665,"ode_v is shown on the screen, written out."],[450.5811610243055,"ode_g is shown on the screen, written out."]]},{"start":460.11729166666663,"say":"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.","live":["ode_v","ode_g","head_ode"],"does":[[464.32029166666666,"lattice is shown on the screen, written out."],[473.49129166666665,"grid is shown on the screen, written out."],[474.11829166666666,"mode is shown on the screen, written out."]]},{"start":476.40229166666666,"say":"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.","live":["ode_v","ode_g","lattice","head_ode","grid","mode"],"does":[[481.1392916666666,"mode is redrawn as the numbers it depends on change."],[481.1392916666666,"kx ticks to 2.0."],[481.1392916666666,"kz ticks to 1.0."],[483.55429166666664,"mode is redrawn as the numbers it depends on change."],[483.55429166666664,"kx ticks to 3.0."],[483.55429166666664,"kz ticks to -2.0."],[490.57729166666667,"ode_v (the \"k^2\" part) is emphasized."],[492.6442916666666,"head_ode is hidden from the screen — left the board."],[492.6442916666666,"ode_g is hidden from the screen — left the board."],[492.6442916666666,"ode_v is hidden from the screen — left the board."],[492.6442916666666,"ode_v (the \"k^2\" part) is no longer emphasized."]]},{"start":493.24429166666664,"say":"Where have u and w gone? Nowhere. They have become algebra. Continuity, transformed, is one linear relation between the three transformed components.","live":["lattice","grid","mode"],"does":[[493.24429166666664,"head_recover is shown on the screen, written out."],[499.78029166666664,"constraints is shown on the screen, written out."]]},{"start":506.6732916666666,"say":"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.","live":["lattice","grid","mode","head_recover"],"does":[[511.34029166666664,"constraints is shown on the screen, written out."],[517.5052916666666,"constraints (the \"D hat(v)\" part) is emphasized."],[520.8547916666666,"constraints (the \"D hat(v)\" part) is no longer emphasized."]]},{"start":521.4547916666667,"say":"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.","live":null,"does":[[522.2732916666666,"system is shown on the screen, written out."],[527.1372916666667,"system (the \"diagonal=anti\" part) is struck through — it is ruled out."],[527.1372916666667,"system (the \"diagonal=main\" part) is struck through — it is ruled out."],[532.2692916666667,"det is shown on the screen, written out."],[537.2612916666667,"The strike through system (the \"diagonal=anti\" part) is lifted."],[537.2612916666667,"The strike through system (the \"diagonal=main\" part) is lifted."],[541.6967916666666,"constraints is hidden from the screen — left the board."],[541.6967916666666,"det is hidden from the screen — left the board."],[541.6967916666666,"system is hidden from the screen — left the board."]]},{"start":542.2967916666666,"say":"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.","live":null,"does":[[546.9172916666666,"solutions is shown on the screen, written out."],[551.4102916666667,"solutions is shown on the screen, written out."]]},{"start":555.4587916666667,"say":"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.","live":null,"does":[[560.3232916666667,"solutions is indicated — a transient flash."],[564.4102916666667,"free_note is shown on the screen, written out."]]},{"start":573.7297916666666,"say":"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.","live":["lattice","grid","mode","head_recover","free_note"],"does":[[581.4962916666666,"mode is redrawn as the numbers it depends on change."],[581.4962916666666,"kx ticks to 0.0."],[581.4962916666666,"kz ticks to 0.0."],[583.6212916666666,"mode is indicated — a transient flash."],[588.1818958333333,"free_note is hidden from the screen — left the board."],[588.1818958333333,"head_recover is hidden from the screen — left the board."],[588.1818958333333,"lattice is hidden from the screen — left the board."],[588.1818958333333,"grid is hidden from the screen — lattice left the board."],[588.1818958333333,"mode is hidden from the screen — lattice left the board."],[588.1818958333333,"solutions is hidden from the screen — left the board."]]}]},{"title":"The Walls, and the Mode That Degenerates","start":589.2235625,"end":790.4727708333332,"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":[{"start":589.2235625,"say":"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.","live":[],"does":[[589.2235625,"head_bc is shown on the screen, written out."],[598.8945625,"gap is shown on the screen, written out."],[598.8945625,"wall_top is shown on the screen, written out."],[599.2353220161864,"wall_bot is shown on the screen, written out."]]},{"start":603.9180624999999,"say":"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.","live":["gap","head_bc","wall_top","wall_bot"],"does":[[605.1605625,"gap moves to a new place on the board."],[605.1605625,"b0 is shown on the screen, written out."],[613.6475624999999,"zero_axis is shown on the screen, written out."]]},{"start":616.3020624999999,"say":"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.","live":["b0","gap","head_bc","wall_top","wall_bot","zero_axis"],"does":[[626.4605624999999,"b1 is shown on the screen, written out."],[631.7085625,"vhat is shown on the screen, written out."]]},{"start":635.9190625,"say":"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.","live":["b0","b1","gap","head_bc","wall_top","wall_bot","zero_axis","vhat"],"does":[[639.7505625,"top_tag is shown on the screen, written out."],[639.9569061563436,"bot_tag is shown on the screen, written out."],[641.4215624999999,"vhat is indicated — a transient flash."]]},{"start":647.3855625,"say":"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.","live":["b0","b1","gap","head_bc","wall_top","wall_bot","zero_axis","vhat","top_tag","bot_tag"],"does":[[652.0065625,"b2 is shown on the screen, written out."],[657.1375625,"b2 (the \"= 0\" part) is emphasized."],[661.5730625,"b0 is hidden from the screen — left the board."],[661.5730625,"b1 is hidden from the screen — left the board."],[661.5730625,"b2 is hidden from the screen — left the board."],[661.5730625,"head_bc is hidden from the screen — left the board."],[661.5730625,"b2 (the \"= 0\" part) is no longer emphasized."]]},{"start":662.1730624999999,"say":"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.","live":["gap","wall_top","wall_bot","zero_axis","vhat","top_tag","bot_tag"],"does":[[662.1730624999999,"head_count is shown on the screen, written out."],[668.4425624999999,"bc_table is shown on the screen, written out."]]},{"start":673.0940625,"say":"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.","live":["gap","wall_top","wall_bot","zero_axis","vhat","top_tag","bot_tag","head_count"],"does":[[675.4395625,"bc_table is shown on the screen, written out."],[679.8745624999999,"bc_table (the \"row=2\" part) is emphasized."],[683.4385625,"bc_table (the \"row=2\" part) is no longer emphasized."]]},{"start":684.0385624999999,"say":"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.","live":null,"does":[[686.7325625,"bc_table is shown on the screen, written out."],[690.7955625,"bc_table (the \"row=3\" part) is emphasized."],[694.1275625,"nothing_guessed is shown on the screen, written out."],[694.1275625,"bc_table (the \"row=3\" part) is no longer emphasized."],[698.7370625,"bc_table is hidden from the screen — left the board."],[698.7370625,"gap is hidden from the screen — left the board."],[698.7370625,"wall_top is hidden from the screen — gap left the board."],[698.7370625,"wall_bot is hidden from the screen — gap left the board."],[698.7370625,"zero_axis is hidden from the screen — gap left the board."],[698.7370625,"vhat is hidden from the screen — gap left the board."],[698.7370625,"top_tag is hidden from the screen — gap left the board."],[698.7370625,"bot_tag is hidden from the screen — gap left the board."],[698.7370625,"head_count is hidden from the screen — left the board."],[698.7370625,"nothing_guessed is hidden from the screen — left the board."]]},{"start":699.3370625,"say":"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.","live":[],"does":[[699.3370625,"head_mean is shown on the screen, written out."],[714.0815624999999,"profile_axes is shown on the screen, written out."],[716.6825624999999,"mean_curve is shown on the screen, written out."]]},{"start":721.2530624999999,"say":"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.","live":["profile_axes","head_mean","mean_curve"],"does":[[731.9455624999999,"profile_axes moves to a new place on the board."],[731.9455624999999,"mean_v is shown on the screen, written out."],[738.6335624999999,"mean_v is indicated — a transient flash."]]},{"start":740.1970624999999,"say":"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.","live":["mean_v","profile_axes","head_mean","mean_curve"],"does":[[746.3155624999999,"mean_u is shown on the screen, written out."],[756.7875624999999,"mean_u (the \"frac(dif P, dif x)\" part) is emphasized."]]},{"start":758.6415625,"say":"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.","live":["mean_v","mean_u","profile_axes","head_mean","mean_curve"],"does":[[768.5455625,"mean_u (the \"frac(dif P, dif x)\" part) is no longer emphasized."]]},{"start":775.0430624999999,"say":"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.","live":null,"does":[[775.5075625,"mean_w is shown on the screen, written out."],[783.3445624999999,"mean_curve is indicated — a transient flash."],[789.4311041666666,"head_mean is hidden from the screen — left the board."],[789.4311041666666,"mean_u is hidden from the screen — left the board."],[789.4311041666666,"mean_v is hidden from the screen — left the board."],[789.4311041666666,"mean_w is hidden from the screen — left the board."],[789.4311041666666,"profile_axes is hidden from the screen — left the board."],[789.4311041666666,"mean_curve is hidden from the screen — profile_axes left the board."]]}]},{"title":"Chebyshev Across the Gap","start":790.4727708333332,"end":930.7285208333333,"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":[{"start":790.4727708333332,"say":"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.","live":[],"does":[[790.4727708333332,"head_cheb is shown on the screen, written out."],[797.5547708333332,"cheb_axes is shown on the screen, written out."],[799.8997708333333,"cheb_axes moves to a new place on the board."],[799.8997708333333,"basis_note is shown on the screen, written out."]]},{"start":804.4012708333332,"say":"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.","live":["basis_note","cheb_axes","head_cheb"],"does":[[806.8627708333332,"c1 is shown on the screen, written out."],[809.0107708333333,"c4 is shown on the screen, written out."],[812.9927708333332,"c8 is shown on the screen, written out."],[815.6167708333332,"c8 is indicated — a transient flash."]]},{"start":820.1057708333333,"say":"So the expansion is a finite sum, N plus one coefficients for each wavenumber pair, and those coefficients are what the code actually stores.","live":["basis_note","cheb_axes","head_cheb","c1","c4","c8"],"does":[[821.7307708333333,"cheb_expand is shown on the screen, written out."],[828.8127708333333,"cheb_expand (the \"a_n (k_x, k_z, t)\" part) is emphasized."],[829.7302708333333,"basis_note is hidden from the screen — left the board."],[829.7302708333333,"cheb_axes is hidden from the screen — left the board."],[829.7302708333333,"c1 is hidden from the screen — cheb_axes left the board."],[829.7302708333333,"c4 is hidden from the screen — cheb_axes left the board."],[829.7302708333333,"c8 is hidden from the screen — cheb_axes left the board."],[829.7302708333333,"cheb_expand is hidden from the screen — left the board."],[829.7302708333333,"head_cheb is hidden from the screen — left the board."],[829.7302708333333,"cheb_expand (the \"a_n (k_x, k_z, t)\" part) is no longer emphasized."]]},{"start":830.3302708333332,"say":"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.","live":[],"does":[[830.3302708333332,"head_grid is shown on the screen, written out."],[831.5027708333332,"wall_line is shown on the screen, written out."],[835.6127708333332,"nodes is shown on the screen, written out."],[835.6834326436247,"nodes_2 is shown on the screen, written out."],[835.754094453916,"nodes_3 is shown on the screen, written out."],[835.8247562642074,"nodes_4 is shown on the screen, written out."],[835.8954180744988,"nodes_5 is shown on the screen, written out."],[835.9660798847901,"nodes_6 is shown on the screen, written out."],[836.0367416950816,"nodes_7 is shown on the screen, written out."],[836.107403505373,"nodes_8 is shown on the screen, written out."],[836.1740367973754,"nodes_9 is shown on the screen, written out."]]},{"start":841.6812708333332,"say":"Look at the spacing. In the middle of the channel the points are as coarse as they ever get.","live":["wall_line","head_grid","nodes","nodes_2","nodes_3","nodes_4","nodes_5","nodes_6","nodes_7","nodes_8","nodes_9"],"does":[[843.7707708333332,"The segment (-0.3827, 0.0) to (0.0, 0.0) in wall_line is lit up."]]},{"start":847.3432708333332,"say":"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.","live":null,"does":[[847.3432708333332,"wall_line: retire a lit segment (unemphasize_line)."],[848.8407708333332,"The segment (0.9239, 0.0) to (1.0, 0.0) in wall_line is lit up."],[859.5457708333332,"grid_note is shown on the screen, written out."],[859.9977708333332,"wall_line: retire a lit segment (unemphasize_line)."],[861.7047708333332,"grid_note is hidden from the screen — left the board."],[861.7047708333332,"head_grid is hidden from the screen — left the board."],[861.7047708333332,"wall_line is hidden from the screen — left the board."],[861.7047708333332,"nodes is hidden from the screen — wall_line left the board."],[861.7047708333332,"nodes_2 is hidden from the screen — wall_line left the board."],[861.7047708333332,"nodes_3 is hidden from the screen — wall_line left the board."],[861.7047708333332,"nodes_4 is hidden from the screen — wall_line left the board."],[861.7047708333332,"nodes_5 is hidden from the screen — wall_line left the board."],[861.7047708333332,"nodes_6 is hidden from the screen — wall_line left the board."],[861.7047708333332,"nodes_7 is hidden from the screen — wall_line left the board."],[861.7047708333332,"nodes_8 is hidden from the screen — wall_line left the board."],[861.7047708333332,"nodes_9 is hidden from the screen — wall_line left the board."]]},{"start":862.3047708333332,"say":"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.","live":[],"does":[[862.3047708333332,"head_band is shown on the screen, written out."],[878.2797708333333,"band is shown on the screen, written out."]]},{"start":879.7157708333332,"say":"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.","live":["band","head_band"],"does":[[881.9337708333333,"band (the \"diagonal=main\" part) is emphasized."],[887.2387708333332,"econ_1 is shown on the screen, written out."],[887.2387708333332,"band (the \"diagonal=main\" part) is no longer emphasized."]]},{"start":895.3967708333332,"say":"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.","live":["band","econ_1","head_band"],"does":[[909.5147708333333,"econ_2 is shown on the screen, written out."]]},{"start":915.4322708333332,"say":"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.","live":["band","econ_1","econ_2","head_band"],"does":[[924.8597708333332,"econ_3 is shown on the screen, written out."],[929.6868541666665,"band is hidden from the screen — left the board."],[929.6868541666665,"econ_1 is hidden from the screen — left the board."],[929.6868541666665,"econ_2 is hidden from the screen — left the board."],[929.6868541666665,"econ_3 is hidden from the screen — left the board."],[929.6868541666665,"head_band is hidden from the screen — left the board."]]}]},{"title":"Marching in Time, and Why It Is Fast","start":930.7285208333333,"end":1185.1614166666666,"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":[{"start":930.7285208333333,"say":"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.","live":[],"does":[[930.7285208333333,"head_time is shown on the screen, written out."],[936.5105208333333,"march is shown on the screen, written out."],[940.7825208333333,"march (the \"frac(nu Delta t, 2) (D^2 - k^2)\" part) is emphasized."],[942.0485208333333,"march (the \"frac(nu Delta t, 2) (D^2 - k^2)\" part) is no longer emphasized."],[942.0485208333333,"march (the \"frac(nu Delta t, 2) (D^2 - k^2)#2\" part) is emphasized."]]},{"start":943.4030208333332,"say":"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.","live":["head_time"],"does":[[943.4030208333332,"march (the \"frac(nu Delta t, 2) (D^2 - k^2)#2\" part) is no longer emphasized."],[945.5395208333333,"march is shown on the screen, written out."],[949.2075208333333,"march (the \"frac(3, 2) hat(h)_g^n\" part) is emphasized."],[957.0795208333333,"march (the \"frac(3, 2) hat(h)_g^n\" part) is no longer emphasized."]]},{"start":957.6795208333333,"say":"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.","live":null,"does":[[961.0805208333333,"march (the \"(1 - frac(nu Delta t, 2) (D^2 - k^2))\" part) is indicated — a transient flash."]]},{"start":973.5695208333333,"say":"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.","live":null,"does":[[990.0315208333333,"explicit_cost is shown on the screen, written out."],[991.7495208333332,"stability is shown on the screen, written out."],[994.0835208333333,"explicit_cost is hidden from the screen — left the board."],[994.0835208333333,"head_time is hidden from the screen — left the board."],[994.0835208333333,"march is hidden from the screen — left the board."],[994.0835208333333,"stability is hidden from the screen — left the board."]]},{"start":994.6835208333333,"say":"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.","live":[],"does":[[994.6835208333333,"head_split is shown on the screen, written out."],[1001.8935208333332,"split is shown on the screen, written out."],[1005.3525208333333,"split is shown on the screen, written out."],[1011.3905208333333,"split is shown on the screen, written out."]]},{"start":1012.8260208333332,"say":"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.","live":["head_split"],"does":[[1013.6035208333333,"catch is shown on the screen, written out."],[1022.2535208333333,"split is indicated — a transient flash."]]},{"start":1027.4740208333333,"say":"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.","live":["catch","head_split"],"does":[[1038.5145208333333,"influence is shown on the screen, written out."],[1041.1615208333333,"influence (the \"c_1 hat(v)_1 + c_2 hat(v)_2\" part) is emphasized."],[1047.7680208333334,"catch is hidden from the screen — left the board."],[1047.7680208333334,"head_split is hidden from the screen — left the board."],[1047.7680208333334,"influence is hidden from the screen — left the board."],[1047.7680208333334,"split is hidden from the screen — left the board."],[1047.7680208333334,"influence (the \"c_1 hat(v)_1 + c_2 hat(v)_2\" part) is no longer emphasized."]]},{"start":1048.3680208333333,"say":"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.","live":[],"does":[[1048.3680208333333,"head_nl is shown on the screen, written out."],[1056.4025208333333,"nl_1 is shown on the screen, written out."],[1059.8275208333332,"nl_2 is shown on the screen, written out."],[1064.8655208333332,"nl_3 is shown on the screen, written out."]]},{"start":1066.7550208333332,"say":"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.","live":["nl_1","nl_2","nl_3","head_nl"],"does":[[1072.6995208333333,"convolution is shown on the screen, written out."],[1084.6455208333332,"convolution (the \"O(N log N)\" part) is emphasized."],[1085.8300208333333,"convolution (the \"O(N log N)\" part) is no longer emphasized."]]},{"start":1086.4300208333334,"say":"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.","live":["nl_1","nl_2","nl_3","convolution","head_nl"],"does":[[1090.6555208333334,"spectrum is shown on the screen, written out."],[1091.0625208333333,"The segment (-8.0, 0.0) to (8.0, 0.0) in spectrum is lit up."]]},{"start":1099.5105208333332,"say":"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.","live":["nl_1","nl_2","nl_3","convolution","spectrum","head_nl"],"does":[[1105.9425208333332,"cut_left is shown on the screen, written out."],[1106.156922518781,"cut_right is shown on the screen, written out."],[1109.7385208333333,"spectrum: retire a lit segment (unemphasize_line)."],[1113.8840208333334,"convolution is hidden from the screen — left the board."],[1113.8840208333334,"head_nl is hidden from the screen — left the board."],[1113.8840208333334,"nl_1 is hidden from the screen — left the board."],[1113.8840208333334,"nl_2 is hidden from the screen — left the board."],[1113.8840208333334,"nl_3 is hidden from the screen — left the board."],[1113.8840208333334,"spectrum is hidden from the screen — left the board."],[1113.8840208333334,"cut_left is hidden from the screen — spectrum left the board."],[1113.8840208333334,"cut_right is hidden from the screen — spectrum left the board."]]},{"start":1114.4840208333333,"say":"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.","live":[],"does":[[1114.4840208333333,"head_why is shown on the screen, written out."],[1118.2335208333334,"why_1 is shown on the screen, written out."],[1125.0145208333333,"why_2 is shown on the screen, written out."]]},{"start":1130.6765208333334,"say":"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.","live":["why_1","why_2","head_why"],"does":[[1135.3085208333332,"why_3 is shown on the screen, written out."],[1143.5985208333334,"why_4 is shown on the screen, written out."]]},{"start":1151.3270208333333,"say":"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.","live":["why_1","why_2","why_3","why_4","head_why"],"does":[[1154.4275208333333,"cost is shown on the screen, written out."],[1163.7035208333334,"A box is drawn around cost."]]},{"start":1166.9620208333333,"say":"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.","live":["why_1","why_2","why_3","why_4","cost","head_why"],"does":[[1169.4115208333333,"why_1 is indicated — a transient flash."],[1171.4555208333334,"why_3 is indicated — a transient flash."],[1180.8475208333334,"why_4 is indicated — a transient flash."],[1184.1197499999998,"cost is hidden from the screen — left the board."],[1184.1197499999998,"head_why is hidden from the screen — left the board."],[1184.1197499999998,"why_1 is hidden from the screen — left the board."],[1184.1197499999998,"why_2 is hidden from the screen — left the board."],[1184.1197499999998,"why_3 is hidden from the screen — left the board."],[1184.1197499999998,"why_4 is hidden from the screen — left the board."]]}]}]},"durationSeconds":1185,"chapters":[{"title":"The Channel and the Pressure Problem","startSeconds":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. 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."},{"title":"Eliminating the Pressure","startSeconds":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. 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."},{"title":"One Wavenumber Pair at a Time","startSeconds":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. 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."},{"title":"The Walls, and the Mode That Degenerates","startSeconds":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. 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."},{"title":"Chebyshev Across the Gap","startSeconds":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. 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."},{"title":"Marching in Time, and Why It Is Fast","startSeconds":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. 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."}]}}
