User Tools

Site Tools


This is an old revision of the document!

Channelflow tutorial: using utility programs


What is channelflow?

  • set of C++ libraries for high-level programming
  • set of command-line utility programs
  • set of matlab scripts for visualization
  • database of invariant solutions
  • website with documentation, discussion forums

Why is CFD a hassle?

  • Navier-Stokes is a stiff, 3D, nonlinear, constrained PDE
  • Integration algorithms are complex, tailored to geometry
  • Turbulence has multiple scales, requires fine resolution
  • > 10^5-d state space, > 1 MB for each data point
  • Integration is computationally expensive

this changes your workflow…

  • integrate a flow and save velocity field to disk at regular intervals
  • read saved data from disk for visualization, statistics, etc.
  • run jobs on number crunchers (PACE), transfer files via scp, …

…and changes your analytic framework

  • can't represent du/dt = F(u) simply
  • can't compute a 10^5 x 10^5 Jacobian matrix (even with sparse structure)
  • hard to choose projections for state-space portraits

All this makes numerical analysis of fluid dynamics a hassle, compared to low-dimensional ODE systems.

Channelflow tries to lower the hassle factor by giving packaging important data structures and algorithms and giving them simple, flexible, high-level interfaces:

  • in C++ classes, for writing your own fluids codes
  • in predefined utility programs, for common calculations

We will discuss programming in channelflow another day.

Today is about using predefined channelflow utility programs to do calculations.

The utilities plus Matlab form a crude interactive system for CFD.

Important concepts


FlowField : C++ class representing spectral expansion of scalar, vector, tensor fields

  {\bf u}({\bf x},t) = \sum_{k_x k_y k_z} a_{k_x k_y k_z} T_{k_y}(y) \; e^{2 \pi i (k_x x / L_x + k_z z / L_z)}

FlowField class has a platform-independent binary file format that retains coefficients, geometrical parameters, and other state information. We will discuss FlowField as a C++ class later, when we cover programming with channelflow. For, now, just think of a FlowField as a velocity field stored as a binary file (file extension .ff).

Why not ASCII? Binary floating-point IO is exact and much more efficient than ASCII. Gives efficient, exactly invertible IO. Plus the ordering of multidimensional spectral coefficients with complex symmetries is tricky enough that ASCII is incomprehensible, too. However, if you want ASCII values of velocity at each gridpoint, there's a utility for conversion (field2ascii).

In channelflow utilities, velocity fields u(x,t) are differences from the laminar flow

{\bf u}_{total}({\bx x}, t) = {\bf u}({\bx x}, t) + y {\bf e}_x

so that they have Dirichlet boundary conditions and form a vector space. The Matlab visualization scripts add the laminar flow back on by default.

Note: I moved the rest of this class tutorial into the channelflow tutorial. John Gibson 2009-01-29

gtspring2009/schedule/chflow1.1233261867.txt.gz · Last modified: 2009/01/29 12:44 by gibson