begin_html [use: jsMath] [use: doc/doc.css]
CLAWPACK Sample Code
Description
Swirling flow in a box
Edge velocities are stored in aux array (see [code:setaux.f]) with
velocity specified by differencing the streamfunction psi.f
The velocities are time-dependent giving reversing flow. These
velocities are computed in [code:b4step2.f]. The period is specified
by the parameter tperiod in setprob.data.
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
[link: amr/README.html ./amr]
This test problem was used in:
@article{rjl:advect,
author="R. J. LeVeque",
title="High-resolution conservative algorithms for advection in
incompressible flow",
journal="SIAM J. Numer. Anal.",
volume="33",
year="1996",
pages="627-665"
}
See [http://www.amath.washington.edu/~rjl/pubs/hiresadv]
See [link: #instructions Instructions]
Plots of results
After running this code and creating plots via "make .plots", you should be
able to view the plots in [link: _plots/_PlotIndex.html].
Fortran files
- [code: Makefile]
- Determines which version of fortran files
are used when compiling the code with make.
- [code: qinit.f95]
-
Sets initial conditions.
- [code: setprob.f]
-
A routine by this name is called by the library routine
[clawcode: clawpack/1d/lib/claw1ez.f]
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 [code: setprob.data].
- [code: setaux.f]
- Set values in the aux arrays.
- [code: psi.f]
- Stream function for advection velocities.
- [code: b4step2.f]
- Called before each time step. Used here to make advection velocity time
dependent.
- Riemann solvers:
- [code: rpn2ad1.f]
- Normal Riemann solver (normal to cell interface).
- [code: rpt2ad1.f]
- Transverse Riemann solver.
Data files
[code: claw2ez.data]
Standard parameter values that are read by library routine
[clawcode:clawpack/2d/lib/claw2ez.f]
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
[http://kingkong.amath.washington.edu/clawpack/users documentation].
[code: setprob.data]
Problem-specific parameters.
[code: setplot.data]
This file contains plotting parameters.
Python files
- [code:mapc2p.py]
- Maps the computational rectangular domain to the physical grid.
- [code: setplot.py]
- 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 [code: Makefile]
to determine which ones are used.
[name: instructions]
Instructions
To run code:
{{{
$ make .output
}}}
View plots interactively with Iplotclaw or use "make .plots" to create html
files.
end_html