This notebook implements PROTEUS to develop a numerical solution to the simple case of quiescent water in a tank. The computational domain consists of a 2D rectangular box, initialised with a quiescent free surface, so that the computational domain includes both the air and the water phase. The flow variables (pressure and velocities) are not expected to vary in space and time, as the simulation progresses in time. The computational domain has rectangular dimensions of 3.22m x 1.8m and the level of water is at 0.6m. The initial conditions of the simulation are shown in the following figure.
This benchmark was selected to check the stability of PROTEUS and assess the precision of the “numerical gauge” function.
The parun launcher is used to execute the split-operator module, in this case quiescent_water_test_gauges_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 [3]:
!mpiexec -np 2 parun quiescent_water_test_gauges_so.py -l 5 -C "refinement=16" -O ../../../inputTemplates/petsc.options.superlu_dist
In [4]:
import helpers
helpers.CreateFig()
In [5]:
!rm -f quiescentWater.mp4; avconv -i phi%4d.png -vcodec libx264 quiescentWater.mp4 -loglevel quiet
In [6]:
from IPython.core.display import HTML
data_uri_mp4 = open("quiescentWater.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[6]:
In [ ]: