![]() running Swan with the GUI Running SWAN
SWAN is not an interactive computer program like most programs running under Windows.
The procedure for a batch program as SWAN is as follows: the user prepares
one or more input files; he then starts the program and waits until the program
is completed. After the program is completed he can look at the results.
If the results are not satisfying he modifies the input and starts the program again.
The control file contains the commands for SWAN. These commands are described in the user manual of SWAN. An example of a control file is: $> Generated by Swan Professional. $> 20080307 2120 PROJECT 'mm' 'hv8' SET NAUTICAL MODE TWODIMENSIONAL CGRID -1042.2 2190.8 20.4 20217 23263.1 35 46 CIRCLE 36 0.05 1 30 INPGRID BOTTOM 0 0 30 87 116 250 250 READINP BOTTOM 1 'HARINGV2.BOT' 2 3 WIND 12 240 BOUNDPAR1 SHAPESPEC JONSWAP PEAK BOUNDPAR2 SIDE S CONSTANT PAR 2 8 260 2 BOUNDPAR2 SIDE W CONSTANT PAR 2 8 260 2 CURVE 'SWANPRO1' -4005.4 14167.3 30 13527.2 17377.5 POINTS 'SWANPRO2' -4005.4 14167.3 & -2252.14 14488.32 & -498.88 14809.34 & 1254.38 15130.36 & 3007.64 15451.38 & 4760.9 15772.4 & 6514.16 16093.42 & 8267.42 16414.44 & 10020.68 16735.46 & 11773.94 17056.48 & 13527.2 17377.5 SPECOUT 'SWANPRO2' SPEC1D RELATIVE 'hv8.SPE' SPECOUT 'SWANPRO2' SPEC2D RELATIVE 'hv8.SPC' PLOT 'SWANPRO2' FILE 'hv8.SPL' SPEC TABLE 'SWANPRO1' HEAD 'hv8.TBL' Distance DEP HS TM01 DIR DSPR & XP YP RTP PER PDIR PLOT 'COMPGRID' FILE 'hv8.PLT' ISO HS VEC DIR BLOCK 'COMPGRID' FILE 'hv8.BLK' XP YP DEP HS TM01 DIR DSPR TRIAD SITES 'goeree' 10875 14500 0 REGION COMPUTE STOPExercise: Analyse this control file using the user manual; find the function of each of the commands. The control file is a simple ASCII file. It can be written using e.g. Notepad or Wordpad. output file(s)
After SWAN has completed the computation a number of output files result.
There should be at least one output file; it is called the print file
although nowadays it is usually not printed.
The name of the print file is equal to the name of the control file;
only the extension is changed from .swn to .prt;
this file resides in the same directory as the corresponding control file.
Note: in the above command line to start SWAN you do not see the extension
.swn; this is correct: you prepare a control file called e.g.
cfile.swn, you start the computation with runswan.bat cfile,
and you obtain a print file called cfile.prt.
The print file and also most other output files of SWAN are simple ASCII,
so they can be read using an ASCII editor (e.g. Notepad).
Graphical User Interface
Digital Hydraulics also distributes a Graphical User Interface (GUI for short)
to help inexperienced users in making the control file and running SWAN.
The GUI has sub-menus for various tasks: choice of the bathymetry, wind and
incident waves, choice of the computational grid.
After all necessary data are gathered the GUI generates a control file
(the example above is made by the GUI), and the
SWAN computation can be started;
after the computation the GUI presents the results in graphical form.
|
Swan Course![]() |