Source file:   README.txt
 Directory:   /Users/rjl/git/rjleveque/clawpack-4.6.3/apps/advection/2d/swirl
 Converted:   Mon Jan 21 2013 at 20:15:23   using clawcode2html
 This documentation file will not reflect any later changes in the source file.

$\phantom{******** If you see this on the webpage then the browser could not locate *********}$
$\phantom{******** the jsMath file load.js *********}$

$\newcommand{\vector}[1]{\left[\begin{array}{c} #1 \end{array}\right]}$ $\newenvironment{matrix}{\left[\begin{array}{cccccccccc}} {\end{array}\right]}$ $\newcommand{\A}{{\cal A}}$ $\newcommand{\W}{{\cal W}}$


CLAWPACK Sample Code


Swirling flow in a box

Edge velocities are stored in aux array (see setaux.f [.html]) with velocity specified by differencing the streamfunction psi.f

The velocities are time-dependent giving reversing flow. These velocities are computed in b4step2.f [.html]. The period is specified by the parameter tperiod in

In theory the solution should agree with the initial data at times t = N*tperiod/2 for all integers N, but because of the numerical diffusion this won't happen.

As a special case, if tperiod = 0, then the velocities are constant in time and b4step2 does nothing. The velocities specified in setaux.f are then used at all times.

An example using AMRCLAW is also included in directory ./amr

This test problem was used in:

  author="R. J. LeVeque",
  title="High-resolution conservative algorithms for advection in
  incompressible flow",
  journal="SIAM J. Numer. Anal.",


See Instructions

Plots of results

After running this code and creating plots via "make .plots", you should be able to view the plots in _plots/_PlotIndex.html .

Fortran files

Makefile [.html]
Determines which version of fortran files are used when compiling the code with make.

qinit.f95 [.html]
Sets initial conditions.

setprob.f [.html]
A routine by this name is called by the library routine clawpack/1d/lib/claw1ez.f [.html] and is generally used to set any values needed for the specific problem being solved. In this example, the value of the advection velocity $u$ and a parameter $\beta$ used in setting the initial conditions are read from the file [.html].

setaux.f [.html]
Set values in the aux arrays.

psi.f [.html]
Stream function for advection velocities.

b4step2.f [.html]
Called before each time step. Used here to make advection velocity time dependent.

Riemann solvers:

rpn2ad1.f [.html]
Normal Riemann solver (normal to cell interface).

rpt2ad1.f [.html]
Transverse Riemann solver.

Data files [.html]
Standard parameter values that are read by library routine clawpack/2d/lib/claw2ez.f [.html] Each line contains one or more values to be read in, followed by comments that are ignored by the Fortran code but used by the Python read or write methods of class clawtools.ClawData.

Some parameters that you might want to modify are described in the documentation . [.html]
Problem-specific parameters. [.html]
This file contains plotting parameters.

Python files [.html]
Maps the computational rectangular domain to the physical grid. [.html]
This file contains commands that are executed on start-up, and sets various plotting parameters.

Library routines

In addition to the Fortran routines in this library, several library routines from $CLAW/clawpack/2d/lib are used. See the Makefile [.html] to determine which ones are used.


To run code:

    $ make .output

View plots interactively with Iplotclaw or use "make .plots" to create html files.