This notebook implements PROTEUS to develop a numerical solution to a case consisting of a sloshing wave in a tank. PROTEUS is initialised with a free-surface profile that will excite the first asymmetric sloshing mode. The free-surface slope is small, therefore we can consider that the flow evolution will obey linear sloshing theory. The output of PROTEUS can be compared with the analytical solution found in Ibrahim (2005), including only a symmetric mode. The computational domain is a 2D rectangular box with dimensions 0.1m x 0.1m and the mean level of the water is in the middle of the box. The initial conditions of the simulation are shown in the following figure.
where a is the amplitude of the sloshing wave.
This case tests the ability of PROTEUS to simulate the free-surface evolution. For more details, see runfiles or references.
The parun launcher is used to execute the split-operator module, in this case wavesloshing_so.py. Various arguments may also be implemented to define various runtime options. All available options are listed when executing parun -h in the command line. Common command-line options are as follows:
| Option | Description |
|---|---|
| -v | Print logging information to standard output |
| -O PETSCOPTIONSFILE | Text file of options to pass to Petsc library |
| -D DATADIR | Set data directory for output storage |
| -l LOGLEVEL | Store runtime information at the log level, 0 = none, 10 = everything |
| -b BATCHFILENAME | Text file of auxiliary commands to execute along with main program |
| -G gatherArchive | Collect data files into single file at end of simulation (will require more computational resources on large runs) |
| -H hotStart | Use the last step in the archive as the initial condition and continue appending to the archive |
Additionally, to run the case on more than one core, implement mpiexec -n <number of cores> before the use of parun on the command line.
In [ ]:
!mpiexec -np 2 parun wavesloshing_so.py -l 5 -C "refinement=8" -O ../../../inputTemplates/petsc.options.superlu_dist
In [1]:
import helpers
helpers.CreateFig()
In [2]:
!rm -f waveSloshing.mp4; avconv -i phi%4d.png -vcodec libx264 waveSloshing.mp4 -loglevel quiet
In [3]:
from IPython.core.display import HTML
data_uri_mp4 = open("waveSloshing.mp4", "rb").read().encode("base64").replace("\n", "")
video_tag = """<video controls>
<source type ="video/mp4" src="data:video/mp4;base64,{mp4}"/>
Your browser does not support the video tag
</video>""".format(mp4=data_uri_mp4)
HTML(data=video_tag)
Out[3]:
In [ ]: