Skip to content
Hybrid High-Order scheme for the Peaceman model
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Implementation of the HHO numerical algorithm for the Peaceman model

The Peaceman model is a nonlinear coupled system of elliptic-parabolic equations that describe the flow of a miscible fluid in a porous medium. The Hybrid High-Order (HHO) method is an arbitrary order numerical scheme for diffusion equations on generic grids. This repository contains the code for an implementation of the HHO method for the Peaceman model, as described here.

How to build

The code has been built and tested on Ubuntu 16.04, for which we provide instructions. Other environments should work if set up correctly. You will need to install the following tools / libraries in order to build the code:

Make sure that you have the development version of boost installed. For example, on Ubuntu, install libboost-dev, libboost-filesystem-dev and libboost-program-options-dev.

Once you have installed all of the required dependencies, set up the build directory and generate the build files by running the following from the repository root:

mkdir build
cd build
cmake ..

The test code can then be built from the build directory by running make.

To use the visualisation tools, you will need Python3 with the Numpy and Matplotlib libraries. For plotting convergence graphs, you will also need mpltools


The code requires a set of test meshes to be present in order to work. The meshes should be placed in a subdirectory /meshes/ in the location of the test executable. For example, the unit test meshes should be placed in ./build/UnitTests/meshes, and the solver test meshes should be placed in ./build/PeacemanTests/meshes. The test meshes used in our tests can be found in the meshes directory of the repository. They should be copied or symlinked into the relevant locations. For example, on Ubuntu, if the repository is located at ~/hho/, you can create the relevant symbolic links by writing

ln -s ~/hho/meshes/UnitTests ~/hho/build/UnitTests/meshes
ln -s ~/hho/meshes/PeacemanTests ~/hho/build/PeacemanTests/meshes

Running the tests

There are two types of tests included; unit tests and solver tests. The unit tests test an individual component of the solver. For example, the test test_darcy_flux checks that the flux reconstructed from the numerical velocity converges to the correct value. To run this test, you could write

cd build/UnitTests
make test_darcy_flux

The results are output to build/UnitTests/output/convergence and can be visualised using the tools mentioned below.

The solver tests run the complete solver and examine the solution for a particular quality. The generic tests are test_peaceman0, test_peaceman1, test_peaceman2 and test_peaceman3, which test the degree k=0,1,2,3 schemes respectively. For example, to run the scheme with degree k=2, with 100 time steps for the time interval [0,2000] on the mesh scaled_2_2.typ1, write

cd build/PeacemanTests
make test_peaceman2
./test_peaceman2 --nsteps=100 --time=2000 --mesh=scaled_2_2.typ1

The results are output to build/PeacemanTests/output/peaceman as VTU data files.

Visualising the results

The numerical scheme outputs the resulting functions as VTU data files. One option to view VTU data files is to use ParaView. Alternatively, the repository includes a number of convenient Python3 scripts for visualising the results. For instance, the script produces surface plots using the matplotlib library. To produce a surface plot of the concentration function generated by the test program, you might write ./output/peaceman/concentration.vtu

which will produce a plot that looks like this:


There are also the scripts which produces contour plots, and the script which produces line graphs for visualising the results of tests that measure convergence or timing. For example, writing ./output/convergence/Isotropic_diffusion_fluxes-Triangular_meshes

from the UnitTest build directory after running the Darcy flux unit tests will produce a convergence result like the following:



The code for handling the meshes is a prelimary version of what became the DiSk++ library by Matteo Cicuttin. The code for assembling the high order operators is based on code written by Danielle Di Pietro for similar HHO schemes.


This code is licenced under the Mozilla Public License. If you use this code or parts of it for scientific publications, you are required to cite it as following:

An arbitrary order scheme on generic meshes for miscible displacements in porous media. Daniel Anderson, Jerome Droniou SIAM Journal on Scientific Computing, 40 (4), B1020-B1054, 2018

You can’t perform that action at this time.