This is an old revision of the document!
Channelflow is a software system for numerical analysis of the incompressible Navier-Stokes flow in channel geometries, written in C++. The core engine of Channelflow is a spectral CFD1) algorithm for integrating the Navier-Stokes equations. This engine drives a number of higher-level algorithms that (for example) compute equilibria, traveling waves, and periodic orbits of Navier-Stokes. Channelflow provides these algorithms in an easy-to-use, flexible, and intelligible form by using relatively modern software design. Channelflow consists of a software library for rapid, high-level development of spectral CFD codes and a set of predefined executable programs that perform common tasks involving CFD. Channelflow is customized for Fourier x Chebyshev x Fourier expansions appropriate for rectangular geometries with periodic boundary conditions in two directions and rigid walls in the remaining direction.
The main goals of Channelflow are
If you use channelflow in your research, please cite it in your publications.
2015-06-29 channelflow-1.5.1 release. Fixed bug in Newton-Krylov-hookstep search algorithm that caused failed searches in some cases. This bug was introduced in channelflow-1.5.0 during conversion to Eigen libraries.
2015-06-22 channelflow-1.5.0 release. Converted channelflow source code to use Eigen3 for linear algebra instead of Octave. Removal of the problematic Octave dependency allows for a simpler build structure: all library code is in
channelflow/ directory and all executable utilities are in
programs/. Advanced utilities such as
arnoldi should compile easily on most platforms, due to the simplicity and widespread availability of Eigen packages.
Channelflow includes about thirty predefined command-line utility programs that perform the most common calculations in our research, such as
Most utilities read in one or more velocities fields from disk, operate on them according to command-line options, print some output, and save resulting fields to disk.
Channelflow is written as a C++ class library. The classes act as building blocks for expressing particular channel-flow simulations and associated data analysis, and underneath these, the mathematical structures needed to perform the calculations. Channelflow provides classes for representing Chebyshev expansions, Fourier x Chebyshev x Fourier expansions, DNS2), and a number of differential equations. Each class has automatic memory management and a set of high-level elemental operations, so that auxiliary data fields and computations can be added to a program with a few lines of code.
In channelflow, even the DNS algorithm is an object. This greatly increases the flexibility of DNS computations. For example, a DNS can be reparameterized and restarted multiple times within a single program, multiple independent DNS computations can run side-by-side within the same program, and DNS computations can run as small components within a larger, more complex computations. As a result, comparative calculations that formerly required coordination of several programs through shell scripts and saved data files can be done within single program.
The following programs illustrate how channelflow's libraries can function as a high-level, Matlab-like language for CFD research. Each defines an initial condition and a base flow, configures a DNS algorithm method, runs a time-stepping loop, and produces output, in about a hundred lines of code. Note: these example codes are written for maximum simplicity and are not intended for production runs.
Channelflow uses object-oriented programming and data abstraction to maximize the organization and readability of its library code. Channelflow defines about a dozen C++ classes that act as abstract data types for the major components of spectral channel-flow simulation. Each class forms a level of abstraction in which a set of mathematical operations are performed in terms of lower-level abstractions, from time-stepping equations at the top to linear algebra at the bottom. The channelflow library code thus naturally reflects mathematical algorithm, both in overall structure and line-by-line. One can look at any part of the code and quickly understand what role it plays in the overall algorithm. One can learn the algorithm in stages, either top-down or bottom-up, by focusing on one level of abstraction at a time.
Channelflow is also
Channelflow's CFD core algorithm uses spectral discretization in spatial directions (Fourier x Chebyshev x Fourier), finite-differencing in time, and primitive variables (3d velocity and pressure) to integrate the incompressible Navier-Stokes equations. The algorithm is based on Kleiser and Schuman's primitive-variables formulation, which uses a Chebyshev tau method for enforcement of the no-slip conditions and influence-matrix and tau-correction algorithms to determine the pressure. Channelflow generalizes this algorithm in several ways, as described in the Channelflow User's Manual. Channelflow's generalizations include
The algorithms for computing invariant solutions for plane Couette flow were developed by Divakar Viswanath. These algorithms combine a “hookstep” trust-region modification of the classic Newton search with Krylov-subspace methods for solving the Newton-hookstep equations, and use Arnoldi iteration for linear stability analysis.
Channelflow began in 1999 as a part of my Ph.D. research in Theoretical and Applied Mechanics at Cornell University. It has been under active development since. Its DNS algorithms are verified as correct by the test suite: correct integration of Orr-Sommerfeld eigenfunctions, Poiseuille flow, and sinusoidal disturbances to Poiseuille flow. Channelflow has also been verified against independent codes in the computation of equilibria, eigenvalues, and periodic orbits of plane Couette flow. Channelflow's test suite is not exhaustive, so some inessential utility functions might still contain errors.
The channelflow website is hosted on a wiki in order to encourage discussion and collaborative maintenance of documentation. The main channelflow discussion forums are
A few other related discussion forums are also hosted here:
These sections of the wiki are under development and will remain here until they're ready to replace the handwritten-html versions from the old website.
This material is based upon work supported by the National Science Foundation under Grant No. 0807574.
Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.