User Tools

Site Tools


docs:tutorial

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:tutorial [2009/02/13 07:28]
gibson
docs:tutorial [2010/02/02 07:55] (current)
Line 1: Line 1:
 ====== Channelflow Tutorial ====== ====== Channelflow Tutorial ======
- 
-===== Intro ===== 
  
 So you've installed channelflow. Now what? Well, computational fluid So you've installed channelflow. Now what? Well, computational fluid
Line 19: Line 17:
 of my own research. Probably the best way to get started with of my own research. Probably the best way to get started with
 channelflow is to step through a few examples of run-of-the-mill channelflow is to step through a few examples of run-of-the-mill
-calculations using these utilities. If you want to get right to these +calculations using these utilities. ​
-examples, skip to Section 3. +
-===== Overview of channelflow utility programs ===== +
- +
-Here's a list of current channelflow utilities. The first three +
-are taken out of alphabetical order because they'​re featured in +
-Section 3, Example Calculations. +
- +
-^ program name ^ purpose ^ +
-| [[docs:​utils:​randomfield]] ​  | build a random initial velocity field, save to disk | +
-| [[docs:​utils:​couette]] ​      | integrate an initial condition, save results to disk | +
-| [[docs:​utils:​fieldprops]] ​   | print out norms, symmetries, geometrical data of a stored field | +
-| [[docs:​utils:​makemovie]] ​    | extract slices of fields in order to make a movie | +
-| [[docs:​utils:​addfields]] ​    | compute sum a_n u_n and store result to disk | +
-| [[docs:​utils:​arnoldi]] ​      | compute the eigenvalues and eigenfunctions of eqbs and orbits | +
-| [[docs:​utils:​ascii2field]] ​  | convert a file of ASCII data to a channelflow FlowField | +
-| [[docs:​utils:​changegrid]] ​   | change the discretization or box size of a field | +
-| [[docs:​utils:​field2ascii]] ​  | convert a channelflow FlowField to a file of ASCII data | +
-| [[docs:​utils:​fieldplots]] ​   | extract a number of 2D slices of the 3D field, good for plots | +
-| [[docs:​utils:​findorbit]] ​    | compute an equilibrium or periodic orbit of plane Couette | +
-| [[docs:​utils:​L2Dist]] ​       | compute the L2 distance between two fields | +
-| [[docs:​utils:​L2IP]] ​         | compute the L2 inner product | +
-| [[docs:​utils:​makebasis]] ​    | construct an orthonormal basis from a set of fields | +
-| [[docs:​utils:​makeheatmode]] ​ | construct a field that decays in time according to Laplace eqn | +
-| [[docs:​utils:​makestokesmode]] | construct a stokes eigenfunction of laminar equilibrium | +
-| [[docs:​utils:​perturbfield]] ​ | add random perturbations to a given field | +
-| [[docs:​utils:​projectfields]] | project a set of fields onto a given basis | +
-| [[docs:​utils:​projectseries]] | project a sequence of fields onto a given basis | +
-| [[docs:​utils:​seriesprops]] ​  | compute statistics on a sequence of data | +
-| [[docs:​utils:​symmetrize]] ​   | find the phase shift of a field that optimize a given symmetry | +
-| [[docs:​utils:​symmetryop]] ​   | apply a given symmetry to a field | +
- +
-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 -vdt -dt 0.02 -ts sbdf4 u0.ff +
- +
- +
-"​Options"​ (e.g. -opt1 value) are used to reset default values +
-of parameters. For options, the first two columns in the built-in +
-help give the short and long form of the option (e.g. -ts and +
---timestepping),​ the third column indicates the type of parameter +
-expected (e.g. real, int, bool, string), and the fourth gives the +
-the default value. For example, "​couette -dt 0.02 -ts cnab2" sets +
-the time stepping method to 2nd order Crank-Nicolson Adams-Bashforth +
-with dt=0.02. +
- +
-"​Flags"​ simply turn on boolean options that would otherwise be set +
-to false. For example, calling "​couette -vdt" turns on variable-dt +
-timestepping,​ which adjusts dt at fixed intervals to keep the CFL +
-number within bounds. For flags the third and fourth columns of +
-built-in help are left blank.+
  
-"​Arguments"​ always come after all options ​and flags. Arguments usually +Please refer to [[:​docs#​utilities|Utilities]] and [[docs:​utils:​options|Utility Options]] 
-specify the filenames ​of binary velocity fields that the utility will +for a detailed guide of individual utilities ​and their optionsYou can also run any  
-load and operate onMost channelflow programs have one required +utility with a ''-h''​ or ''​--help'' ​option ​to get brief description of the 
-argument (e.g. "​couette u0.ff"​) some two (e.g. "​L2Dist u0.ff u2.ff"​). +utility'​s purpose ​and options, e.
-Others take variable number of arguments (e.g. makebasis u0 u1 u2"​). +
-Unfortunately it's difficult to document variable-number arguments +
-properly in the four-column ​option ​system, so variable-number arguments +
-are usually documented with "​usage:​ line right after the description +
-of the utility'​s purpose.+
  
-So, as you read work through the Example Calculations,​ you can run the +<​code>​ 
-suggested command with a --help ​option to clarify what the options are +  ​couette ​--help 
-doing and what other options are possible.+</​code>​
  
  
Line 122: Line 34:
 ===1. Generate an initial condition and examine its properties === ===1. Generate an initial condition and examine its properties ===
  
-  gibson@akbar$ randomfield -Nx 48 -Ny 35 -Nz 48 -lx 0.875 -lz 0.6 -m 0.20 u0.ff+  gibson@akbar$ randomfield -Nx 48 -Ny 33 -Nz 48 -lx -lz -m 0.20 u0.ff
  
 This command generates a no-slip, divergence-free velocity field with This command generates a no-slip, divergence-free velocity field with
-random spectral coefficients on a 48 x 35 x 48 grid, on [0, 2pi] x+random spectral coefficients on a 48 x 33 x 48 grid, on [0, 2pi] x
 [-1, 1] x [0, pi], with magnitude 1/V \integral_V |u|^2 dx = 0.2. The [-1, 1] x [0, pi], with magnitude 1/V \integral_V |u|^2 dx = 0.2. The
 field is a perturbation from the laminar flow --by default, velocity field is a perturbation from the laminar flow --by default, velocity
Line 308: Line 220:
  
   couette -T0 0 -T1 400 -o data-LBp01 LBp01ef1   couette -T0 0 -T1 400 -o data-LBp01 LBp01ef1
-  couette -T1 0 -T1 400 -o data-LBm01 LBm01ef1+  couette -T0 0 -T1 400 -o data-LBm01 LBm01ef1
  
  
Line 328: Line 240:
  
 From here you can adapt the [[#​make_a_movie_from_extracted_data|movie-making instructions]] from above. From here you can adapt the [[#​make_a_movie_from_extracted_data|movie-making instructions]] from above.
 +
 ===== Project movie data onto state-space coordinates ===== ===== Project movie data onto state-space coordinates =====
  
docs/tutorial.1234538901.txt.gz · Last modified: 2009/02/13 07:28 by gibson