Giter Site home page Giter Site logo

trevortrevor / gmpnp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from divyabohra/gmpnp

0.0 0.0 0.0 22.12 MB

Finite element implementation of 1D and 3D generalized modified PNP system of equations using FEniCS project in Python.

License: GNU General Public License v3.0

Python 100.00%

gmpnp's Introduction

1D and 3D GMPNP

DOI

This repository contains the implementation of generalised modified Poisson-Nernst-Planck (GMPNP) for a CO2 electrocatalysis system using the FEniCS finite element package in Python. The implementation is available for

  1. a 1D system with CO2 dissolved in electrolyte (H-cell type) and
  2. a 3D cylindrical catalytic pore for a GDE-based system.

The parameter and mesh files for both the 1D and 3D cases can be found in the utilities folder. The script for the Stern layer solves the Poisson equation in the Stern region using the results obtained from the GMPNP model. Additionally, scripts to solve the reaction diffusion system for both 1D and 3D cases are available for comparison.

The 1D scripts were used to derive the results published in https://pubs.rsc.org/en/content/articlelanding/2019/ee/c9ee02485a#!divAbstract.

The environment.yml file can be used with conda to create the python environment needed to run the script using the command:

conda env create -f environment.yml

The environment name is the first line in the yaml file and is currently set as FEniCS.

Once the environment is created, activate it using:

conda activate FEniCS

To see the packages installed in the new environment, use:

conda env list

See https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html# for further help regarding managing enviroments using conda.

In order to run the scripts (both 1D and 3D), please check the basepath and basepath_utilities variables according to the location of the python file and the utilities folder on your local machine.

Activate the FEniCS virtual environment and run the MPNP script from the "1D" directory (as an example) using:

python MPNP_CO2ER_EDL.py

As you will see in the scripts, you can vary all relevant parameters using command line arguements like in the example below. This makes it simpler to submit multiple jobs on a computational cluster.

python MPNP_CO2ER_EDL.py --voltage_multiplier=-10.0 --cation='Cs'

The 3D pore scripts can be run following a similar procedure.

And you are good to go!

If you find this code useful, please cite it using the DOI: 10.5281/zenodo.4106373 or use the following BibTeX entry:

@software{divya_bohra_2020, author = {Divya Bohra}, title = {{divyabohra/GMPNP: First release of 1D and 3D GMPNP for CO2 electrocatalysis}}, month = oct, year = 2020, publisher = {Zenodo}, version = {v1.0.0}, doi = {10.5281/zenodo.4106373}, url = {https://doi.org/10.5281/zenodo.4106373} }

gmpnp's People

Contributors

divyabohra avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.