next up previous contents
Next: Tidal forcing Up: SUNTANS Examples Previous: SUNTANS Examples   Contents

Running the examples

Each example is located in one of the directories in the examples directory in the main source directory. As an example, consider the internal waves example located in examples/iwaves. The internal waves simulation in this directory is defined by the following files in the examples/iwaves directory:

All examples are run in the same way. The makefile in the iwaves directory compiles and links the initial and boundary condition files with the main sun executable in the source directory. Then it copies the parameter file (suntans.dat) and the planar straight line graph file to the directory data in the particular example directory. Then the main sun executable is run with
../../sun -t -g -s -vv --datadir=data
where the particular flags may depend on the example, but the executable is run from the main source directory and the data is local to the particular examples directory. In order to compile and run an example, enter that example directory and type make test. This will run the example simulation and place the output data into the data directory in the examples directory. While the simulation is running, the data can be viewed from another command line from the main source directory with
./sunplot --datadir=examples/iwaves/data
It is important that you run make clobber between successive tests in other test directories to ensure that you are recompiling the ../../sun executable with the correct initial and boundary condition files each time. Without clobbering, rerunning make test will run the test case while only reflecting changes in suntans.dat. Therefore, it is not necessary to clobber if the same test is being run with different parameters in suntans.dat. The following test cases exist in the examples directory. The first 5 are discussed in detail in what follows. Note that many examples directories also contain an mfile directory that has useful mfiles for analyzing output.
  1. tides: Example tidal forcing in Monterey Bay
  2. accuracy: Demonstrates second-order time accuracy using an internal waves seiche
  3. boundaries: River plume example
  4. cavity: Cavity flow example with no-slip boundary conditions
  5. lockexchange: Lock exchange flow with closed boundaries
  6. iwaves: Internal tide generation over a simplified continental shelf
  7. channel: Simple channel flow demonstrating use of the turbulence model
  8. cylinder: Formation of vortex street in lee of a cylinder
  9. estuary: Tidal flow in a simple estuary with specified river inflow
  10. tides-restart: Same as tides, but shows how to use restart filed
  11. wetdry: Example of wetting and drying
  12. windstress: Constant wind and heat forcing over a parabolic lake

next up previous contents
Next: Tidal forcing Up: SUNTANS Examples Previous: SUNTANS Examples   Contents