This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
gtspring2009:schedule:chflow1 [2009/01/20 06:49] gibson created |
gtspring2009:schedule:chflow1 [2010/02/02 07:55] (current) |
||
---|---|---|---|
Line 16: | Line 16: | ||
* > 10^5-d state space, > 1 MB for each data point | * > 10^5-d state space, > 1 MB for each data point | ||
* Integration is computationally expensive | * Integration is computationally expensive | ||
+ | \\ | ||
+ | \\ | ||
//this changes your workflow...// | //this changes your workflow...// | ||
* integrate a flow and save velocity field to disk at regular intervals | * integrate a flow and save velocity field to disk at regular intervals | ||
* read saved data from disk for visualization, statistics, etc. | * read saved data from disk for visualization, statistics, etc. | ||
* run jobs on number crunchers (PACE), transfer files via scp, ... | * run jobs on number crunchers (PACE), transfer files via scp, ... | ||
+ | \\ | ||
+ | \\ | ||
//...and changes your analytic framework// | //...and changes your analytic framework// | ||
* can't represent du/dt = F(u) simply | * can't represent du/dt = F(u) simply | ||
- | * can't compute a 10^5 x 10^5 Jacobian matrix | + | * can't compute a 10^5 x 10^5 Jacobian matrix (even with sparse structure) |
- | * (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 | All this makes numerical analysis of fluid dynamics a hassle, compared to low-dimensional | ||
ODE systems. | ODE systems. | ||
Line 34: | Line 36: | ||
and algorithms and giving them simple, flexible, high-level interfaces: | and algorithms and giving them simple, flexible, high-level interfaces: | ||
* in C++ classes, for writing your own fluids codes | * in C++ classes, for writing your own fluids codes | ||
- | * in predefined utility programs, for | + | * in predefined utility programs, for common calculations |
+ | \\ | ||
+ | \\ | ||
We will discuss programming in channelflow another day. | We will discuss programming in channelflow another day. | ||
Today is about using predefined channelflow utility programs to do calculations. | Today is about using predefined channelflow utility programs to do calculations. | ||
+ | The utilities plus Matlab form a crude interactive system for CFD. | ||
===== Important concepts ===== | ===== Important concepts ===== | ||
- | |||
- | |||
==== FlowField ==== | ==== FlowField ==== | ||
Line 65: | Line 67: | ||
gridpoint, there's a utility for conversion (field2ascii). | gridpoint, there's a utility for conversion (field2ascii). | ||
- | ==== Channelflow utilities ==== | + | In channelflow utilities, velocity fields u(x,t) are **differences from the laminar flow** |
- | + | ||
- | FlowFields are binary file representations of velocity fields. | + | |
- | + | ||
- | Channelflow utilities are programs that operate on FlowField files or directories | + | |
- | of FlowField files saved at regular intervals. | + | |
- | + | ||
- | Examples: | + | |
- | ^ utility ^ action ^ | + | |
- | | fieldprops | print out properties of field: norms, symmetries, etc. | | + | |
- | | fieldplots | extract 2D slices of a velocity field for plotting | | + | |
- | | addfields | compute u' = sum a_n u_n and save to disk | | + | |
- | | couette | integrate an initial condition, save results to disk | | + | |
- | | seriesprops | compute statistics of saved fields | | + | |
- | | makebasis | Gram-Schmidt orthogonalize a set of fields | | + | |
- | | projectseries | project saved data onto basis set | | + | |
- | | findorbit | compute equilibria, traveling waves, periodic orbits | | + | |
- | | arnoldi | compute eigenvalues of solutions via Arnoldi iteration | | + | |
- | + | ||
- | The utilities are stand-alone command-line programs that are run from | + | |
- | the Unix shell. You can get brief built-in help information on each | + | |
- | utility by running it with a -h or --help option. For example, running | + | |
- | "couette --help" produces | + | |
- | + | ||
- | gibson@akbar$ couette --help | + | |
- | couette : | + | |
- | integrate an initial condition and save velocity fields to disk. | + | |
- | + | ||
- | options : | + | |
- | -T0 --T0 <real> default == 0 start time | + | |
- | -T1 --T1 <real> default == 100 end time | + | |
- | -vdt --variabledt adjust dt for CFL | + | |
- | -dt --dt <real> default == 0.03125 timestep | + | |
- | -dtmin --dtmin <real> default == 0.001 minimum time step | + | |
- | -dtmax --dtmax <real> default == 0.05 maximum time step | + | |
- | -dT --dT <real> default == 1 save interval | + | |
- | -CFLmin --CFLmin <real> default == 0.4 minimum CFL number | + | |
- | -CFLmax --CFLmax <real> default == 0.6 maximum CFL number | + | |
- | -ts --timestepping <string> default == sbdf3 timestepping algorithm | + | |
- | ... | + | |
- | -p --pressure print pressure grad | + | |
- | <flowfield> (trailing arg 1) initial condition | + | |
- | + | ||
- | The built-in help gives a brief description of each utility's purpose | + | |
- | and a list of its command-line options and arguments. Channelflow | + | |
- | utilities are invoked at the command line with syntax like | + | |
- | + | ||
- | utility -opt1 value -opt2 value -flag1 arg3 arg2 arg1 | + | |
- | + | ||
- | or concretely | + | |
- | + | ||
- | couette -T0 0 -T1 400 -vdt -dt 0.02 -ts sbdf4 u0.ff | + | |
- | + | ||
- | Utilities often store data at regular intervals dT into a output directory, specified with | + | |
- | -T0, -T1, and -dT, and -o options. E.g. | + | |
- | + | ||
- | couette -T0 0 -T1 400 -dt 0.02 -dT 2.0 -o data/ u0.ff | + | |
- | + | ||
- | integrates the flow from t=T0 to t=T1 with timestep dt=0.02 and stores a time series of | + | |
- | velocity fields at intervals dT=2.0 in the ''data/'' directory. The velocity fields have | + | |
- | filenames | + | |
- | + | ||
- | data/u0.ff | + | |
- | data/u1.ff | + | |
- | etc. | + | |
- | + | ||
- | where the label is the time t = T0 + n dT. If T0 or dT is not an integer, the label is rounded | + | |
- | to three decimal places. | + | |
- | + | ||
- | For utilities that //read// time series of velocity fields, you need to specify the same | + | |
- | (or compatible) time intervals. For the most part, the default dT=1 is a good, simple interval. | + | |
- | + | ||
- | ===== Example calculations ===== | + | |
- | + | ||
- | ==== Computing a 1d unstable manifold ==== | + | |
- | + | ||
- | The Nagata (1990) "lower-branch" equilibrium has a one-dimensional unstable manifold. | + | |
- | Here we compute the unstable manifold by integrating two 1d trajectories | + | |
<latex> | <latex> | ||
- | u_{\pm}(x,t) = f^t(u_{LB} \pm v_{LB}), t \in [0, \infty] | + | {\bf u}_{total}({\bx x}, t) = {\bf u}({\bx x}, t) + y {\bf e}_x |
</latex> | </latex> | ||
- | using several channelflow utilities: | + | so that they have Dirichlet boundary conditions and form a vector space. The Matlab visualization |
- | + | scripts add the laminar flow back on by default. | |
- | * ''fieldprops'' | + | |
- | * ''arnoldi'' | + | |
- | * ''addfields'' | + | |
- | * ''couette'' | + | |
- | * ''seriesprops'' | + | |
- | * ''makebasis'' | + | |
- | * ''projectseries'' | + | |
- | + | ||
- | 1. Download the solution from the [[http://www.channelflow.org/database|channelflow database]] | + | |
- | + | ||
- | wget http://channelflow.org/database/a1.14_g2.5_Re400/LB.ff | + | |
- | + | ||
- | + | ||
- | + | ||
- | 2. Examine the properties of the lower-branch solution with ''fieldprops'' | + | |
- | + | ||
- | fieldprops -g uLB | + | |
- | + | ||
- | + | ||
- | === addfields === | + | |
- | + | ||
- | Add a small pertubation along the unstable manifold | + | |
- | + | ||
- | addfields 1 uLB 0.01 uLBef1 uLBp01ef1 | + | |
- | addfields 1 uLB -0.01 uLBef1 uLBm01ef1 | + | |
- | + | ||
- | + | ||
- | === couette === | + | |
- | + | ||
- | Integrate the perturbations | + | |
- | + | ||
- | couette -T0 0 -T1 400 -o data-uLBp01ef1 uLBp01ef1 | + | |
- | couette -T0 0 -T1 400 -o data-uLBm01ef1 uLBm01ef1 | + | |
- | + | ||
- | + | ||
- | === seriesprops === | + | |
- | + | ||
- | Produce input vs dissipation curves for perturbations | + | |
- | + | ||
- | seriesprops -T0 0 -T1 400 -d data-uLBp01ef1 -o ivd-uLBp01ef1 | + | |
- | seriesprops -T0 0 -T1 400 -d data-uLBp01ef1 -o ivd-uLBm01ef1 | + | |
+ | **Note: I moved the rest of this class tutorial into the ** [[docs:tutorial|channelflow tutorial]]. //John Gibson 2009-01-29// |