Quickstart Guide

Installation

First, please install the open-source finite element library Firedrake. On a Mac with Homebrew installed or on an Ubuntu workstation with sudo access, it can be installed using the default configuration as detailed here. To get started quickly, a Docker image is also available. Note that you may need to increase the default memory allocation for Docker in order to run some of the EchemFEM examples.

EchemFEM is hosted on GitHub, and should be cloned from there.

To use EchemFEM, first install it using pip within the Firedrake virtual environment. From the echemfem parent directory:

(firedrake) $ pip install -e .

To test your installation, you can run the tests in echemfem/tests using pytest. This can take some time, so it is probably enough to run this test:

(firedrake) $ pytest test_advection_diffusion_migration.py

Alternatively, you can run some of the examples below.

Running Examples

To get started, a demo for a flow reactor is available here. Several examples can be found in echemfem/examples. Examples using the generalized modified Poisson-Nernst-Planck model (GMPNP) can be found in FireCat, where it is coupled with a microkinetics model.

To run an example:

(firedrake) $ python example_name.py

And to run it in parallel with n_proc processors:

(firedrake) $ mpiexec -n n_proc python example_name.py

Visualization

The solution fields are stored for visualization with Paraview in results/collection.pvd. Alternatively, 1D and 2D functions can be visualized using matplotlib. More about Firedrake visualization.