====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
gtspring2009:schedule:chflow1 [2009/01/20 08:16] gibson |
gtspring2009:schedule:chflow1 [2010/02/02 07:55] (current) |
||
---|---|---|---|
Line 43: | Line 43: | ||
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 74: | Line 73: | ||
</latex> | </latex> | ||
- | so that they have Dirichlet boundary conditions and form a vector space. | + | so that they have Dirichlet boundary conditions and form a vector space. The Matlab visualization |
- | + | scripts add the laminar flow back on by default. | |
- | + | ||
- | ==== Channelflow utilities ==== | + | |
- | + | ||
- | 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. | + | |
- | + | ||
- | Reynolds number defaults to 400. | + | |
- | + | ||
- | Most utilities save their command-line arguments into a file ''utilityname''.args for future reference. | + | |
- | + | ||
- | ===== 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> | + | |
- | u_{\pm}(x,t) = f^t(u_{LB} \pm v_{LB}), t \in [0, \infty] | + | |
- | </latex> | + | |
- | + | ||
- | using several channelflow utilities: | + | |
- | + | ||
- | * ''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 | + | |
- | \\ | + | |
- | \\ | + | |
- | 3. Plot the LB with "fieldplots" and matlab script "plotbox" (bad | + | |
- | + | ||
- | fieldplots -o plot uLB | + | |
- | + | ||
- | then within Matlab, ''plotbox('LB')''. | + | |
- | \\ | + | |
- | \\ | + | |
- | + | ||
- | 4. Compute the eigenfunctions with ''arnoldi'' (skip this?) | + | |
- | + | ||
- | arnoldi --flow LB.ff | + | |
- | + | ||
- | This produces eigenfunctions ''ef0.ff, ef1.ff,'' ... and a file of eigenvalues ''lambda.asc''. | + | |
- | \\ | + | |
- | \\ | + | |
- | 5. Perturbation along the unstable manifold with ''addfields'' | + | |
- | + | ||
- | addfields 1 uLB 0.01 uLBef1 uLBp01ef1 | + | |
- | addfields 1 uLB -0.01 uLBef1 uLBm01ef1 | + | |
- | \\ | + | |
- | \\ | + | |
- | 6. Integrate the perturbations with ''couette'' | + | |
- | + | ||
- | couette -T0 0 -T1 400 -o data-uLBp01ef1 uLBp01ef1 | + | |
- | couette -T0 0 -T1 400 -o data-uLBm01ef1 uLBm01ef1 | + | |
- | \\ | + | |
- | \\ | + | |
- | 7. Produce input vs dissipation curves for perturbations with ''seriesprops'' | + | |
- | seriesprops -T0 0 -T1 400 -d data-uLBp01ef1 -o ivd-uLBp01ef1 | + | **Note: I moved the rest of this class tutorial into the ** [[docs:tutorial|channelflow tutorial]]. //John Gibson 2009-01-29// |
- | seriesprops -T0 0 -T1 400 -d data-uLBp01ef1 -o ivd-uLBm01ef1 | + |