Exploring Navier Stokes and Rebuilding Channelflow
Channelflow is a C++ library developed by John Gibson for simulating incompressible fluid flow in channel geometries. It has been used in many research papers to explore the dynamics of shear flows, including the discovery of exact coherent states and the study of transition to turbulence. However, the C++ codebase has become difficult to maintain and extend over time. I am working on a Julia version of Channelflow, called Channelflow.jl, to make it more accessible and easier to use for researchers in fluid dynamics.
Background
Incompressible Navier-Stokes Equations
Channelflow solves the incompressible Navier-Stokes equations in a channel geometry using spectral methods. The flow is driven by a mean pressure gradient, which we let be , in the -direction, with constant viscosity . We consider the two-dimensional subcase, for ease of implementation. The equations are then written as:
where with and denoting the velocity components in the and directions. here denotes the actual pressure minus the contribution from the mean pressure gradient. is the unit vector]] in the direction. We additionally impose the periodic [[Boundary Conditions]] in and no-slip boundary conditions in :
What we mean here is that there is a pressure forcing the fluid down the pipe, in the direction. The pressure term in the incompressible Navier Stokes equations can then be simplified slightly, using our special definition of . We let be a column vector representing the velocity components, and enforce natural boundary conditions that the fluid is not flowing along the rigid walls. We often further enforce periodic boundary conditions in and .
Spectral Methods
For spectral methods, we typically use a Fourier representation in and a Chebyshev representation in . The latter could be replaced by any of the Jacobi Polynomials. In the more complicated case of three dimensions, we add a Fourier representation in . With that in mind, we get the discrete representations in of the form
and the pressure as
Then, we define the Chebyshev polynomial representations in of the form
and
For all of these, we typically use
where, as usual, is the length of the box in the direction.
Channelflow
According to the original website,
The main goals of Channelflow are
- to lower the barrier to entry to numerical research in fluid dynamics
- to enable creation of short, readable, easily-modified CFD codes
- to provide easy access to advanced algorithms for computing exact solutions of Navier-Stokes
It was written in C++ by John Gibson, and has been used in many research papers to explore the dynamics of shear flows, including the discovery of exact coherent states and the study of transition to turbulence. However, the C++ codebase has become difficult to maintain and extend over time. I am working on a Julia version of Channelflow, called Channelflow.jl, to make it more accessible and easier to use for researchers in fluid dynamics. For now, follow my progress on GitHub. More updates to come.