Quiescent Water


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.

Running the numerical model in the shell

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


TriangleBaseMesh nbase=1 baseFlags= VApq30Dena0.00130617 TriangleBaseMesh nbase=1 baseFlags= VApq30Dena0.00130617 

ApplyTriangulate flags= VApq30Dena0.00130617
Constructing Delaunay triangulation by divide-and-conquer method.
  Sorting vertices.
  Forming triangulation.
  Removing ghost triangles.
Delaunay milliseconds:  0
Recovering segments in Delaunay triangulation.
    Constructing mapping from vertices to triangles.
  Recovering PSLG segments.
Segment milliseconds:  0
Removing unwanted triangles.
  Marking concavities (external triangles) for elimination.
Spreading regional attributes.
Hole milliseconds:  0
Adding Steiner points to enforce quality.
  Looking for encroached subsegments.
  Making a list of bad triangles.
  Splitting bad triangles.
Quality milliseconds:  4

Writing vertices.
Writing triangles.
Writing segments.
Writing edges.
Writing neighbors.

Output milliseconds:  0
Total running milliseconds:  5

Statistics:

  Input vertices: 4
  Input segments: 4
  Input holes: 0

  Mesh vertices: 3614
  Mesh triangles: 6987
  Mesh edges: 10600
  Mesh exterior boundary edges: 239
  Mesh interior boundary edges: 0
  Mesh subsegments (constrained edges): 239

Mesh quality statistics:

  Smallest area:       0.00028541   |  Largest area:        0.0013052
  Shortest edge:            0.025   |  Longest edge:         0.074654
  Shortest altitude:     0.017148   |  Largest aspect ratio:   3.1937

  Triangle aspect ratio histogram:
  1.1547 - 1.5       :      2811    |     15 - 25         :         0
     1.5 - 2         :      2925    |     25 - 50         :         0
       2 - 2.5       :      1012    |     50 - 100        :         0
     2.5 - 3         :       226    |    100 - 300        :         0
       3 - 4         :        13    |    300 - 1000       :         0
       4 - 6         :         0    |   1000 - 10000      :         0
       6 - 10        :         0    |  10000 - 100000     :         0
      10 - 15        :         0    | 100000 -            :         0
  (Aspect ratio is longest edge divided by shortest altitude)

  Smallest angle:          30.014   |  Largest angle:          115.89

  Angle histogram:
      0 -  10 degrees:         0    |     90 - 100 degrees:       709
     10 -  20 degrees:         0    |    100 - 110 degrees:       302
     20 -  30 degrees:         0    |    110 - 120 degrees:        40
     30 -  40 degrees:      1809    |    120 - 130 degrees:         0
     40 -  50 degrees:      4413    |    130 - 140 degrees:         0
     50 -  60 degrees:      5105    |    140 - 150 degrees:         0
     60 -  70 degrees:      4852    |    150 - 160 degrees:         0
     70 -  80 degrees:      2216    |    160 - 170 degrees:         0
     80 -  90 degrees:      1515    |    170 - 180 degrees:         0

Memory allocation statistics:

  Maximum number of vertices: 3614
  Maximum number of triangles: 6987
  Maximum number of subsegments: 239
  Maximum number of encroached subsegments: 2
  Maximum number of bad triangles: 5737
  Maximum number of stacked triangle flips: 4
  Approximate heap memory use (bytes): 967304

Algorithmic statistics:

  Number of incircle tests: 30904
  Number of 2D orientation tests: 19959
  Number of triangle circumcenter computations: 3607

ApplyTriangulate done
now destroying triangulateio
/home/jovyan/proteus/proteus/TriangleUtils.py:92: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  if nodes == None: #ok to do nothing of nodes is empy
/home/jovyan/proteus/proteus/TriangleUtils.py:116: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  if markers != None:
/home/jovyan/proteus/proteus/TriangleUtils.py:146: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  if elems == None: #ok to do nothing of nodes is empy
/home/jovyan/proteus/proteus/TriangleUtils.py:167: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  if attrib != None:
/home/jovyan/proteus/proteus/TriangleUtils.py:206: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  if nodes == None: #ok to do nothing of nodes is empy
/home/jovyan/proteus/proteus/TriangleUtils.py:208: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  if segments == None:
/home/jovyan/proteus/proteus/TriangleUtils.py:244: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  if pmarkers != None:
/home/jovyan/proteus/proteus/TriangleUtils.py:264: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  if smarkers != None:
/home/jovyan/proteus/proteus/TriangleUtils.py:289: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  if regions != None:
/home/jovyan/proteus/proteus/TriangleUtils.py:360: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  if edges == None: #ok to do nothing if elemAreas is empty
/home/jovyan/proteus/proteus/TriangleUtils.py:380: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  if markers != None:
/home/jovyan/proteus/proteus/TriangleUtils.py:407: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  if neigs == None: #ok to do nothing if elemAreas is empty
now destroying triangulateionow destroying triangulateio
now destroying triangulateio

now destroying triangulateio
WARNING! There are options you set that were not used!
WARNING! could be spelling mistake, etc!
Option left: name:-dissipation_ksp_type value: preonly
Option left: name:-dissipation_pc_factor_mat_solver_package value: superlu_dist
Option left: name:-dissipation_pc_type value: lu
Option left: name:-kappa_ksp_type value: preonly
Option left: name:-kappa_pc_factor_mat_solver_package value: superlu_dist
Option left: name:-kappa_pc_type value: lu
Option left: name:-mesh_ksp_type value: preonly
Option left: name:-mesh_pc_factor_mat_solver_package value: superlu_dist
Option left: name:-mesh_pc_type value: lu

Post-process the numerical solution


In [4]:
import helpers
helpers.CreateFig()

In [5]:
!rm -f quiescentWater.mp4; avconv -i phi%4d.png -vcodec libx264 quiescentWater.mp4 -loglevel quiet


avconv: /home/jovyan/proteus/linux2/lib/liblzma.so.5: no version information available (required by /lib/x86_64-linux-gnu/libsystemd.so.0)

Display the solution


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 [ ]: