https://github.com/battmodels/electrochemicalkinetics.jl

Electrochemical reaction rate modeling and nonequilibrium phase maps (via AD)

https://github.com/battmodels/electrochemicalkinetics.jl

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 9 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.7%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Electrochemical reaction rate modeling and nonequilibrium phase maps (via AD)

Basic Info
  • Host: GitHub
  • Owner: BattModels
  • License: mit
  • Language: Julia
  • Default Branch: main
  • Homepage:
  • Size: 30.2 MB
Statistics
  • Stars: 23
  • Watchers: 2
  • Forks: 8
  • Open Issues: 6
  • Releases: 0
Created almost 5 years ago · Last pushed almost 3 years ago

https://github.com/BattModels/ElectrochemicalKinetics.jl/blob/main/

# ElectrochemicalKinetics.jl

This package implements a variety of models for rates of electrochemical reactions. The goal is to have a generic interface where different model types can be easily swapped in.

## Usage/Examples
### Building and Evaluating Models
We can construct a simple Butler-Volmer model with symmetric electron transfer as follows:
```julia
julia> bv = ButlerVolmer()
ButlerVolmer(A=1.0, =0.5)
```
To evaluate the model and find the reaction rate at a given voltage is as simple as:
```julia
julia> bv(0.1)
6.865409234059785
```
(note that this is equivalent to `rate_constant(0.1, bv)`, but this "callable" syntax is often convenient)

By default, this computes the net reaction rate. We can also get the rate only in the oxidative direction by passing the `ox` flag:
```julia
julia> bv(0.1, true)
7.0081012366762145
```
Let's try a fancier model now. The `MarcusHushChidseyDOS` model requires information about the density of states of the electrode, which we can read from a file:
```julia
julia> mhcd = MarcusHushChidseyDOS(20, 0.2, "data/DOSes/Cu_111_dos.txt")
MarcusHushChidseyDOS(A=20.0, =0.2)
```
In this case, since `MarcusHushChidseyDOS<:IntegralModel`, we can't directly evaluate the object as a callable because it's ambiguous if we want the integrand or the full integrated rate constant, and we must specify:
```julia
julia> rate_constant(0.1, mhcd)
3.426690873746331
```
By default, the integration bounds are chosen to be the energy bounds over which the DOS is defined, which we can easily check:
```julia
julia> mhcd.dos
DOSData: avg value 6.7 from energy -8.6 to 18.0
```
The `DOSData` struct stores information about the DOS constructed from file. In particular, it houses an interpolation function that is used in the quadrature when evaluating the integral to compute the rate constant.

Another feature we support for `MarcusHushChidseyDOS` models is incorporating the effects of quantum capacitance. In this case, we simply need to pass a few more arguments...

```julia
julia> mhcd = MarcusHushChidseyDOS(0.82, "data/DOSes/bernal_graphene.txt")
MarcusHushChidseyDOS(A=1.0, =0.82)

julia> rate_constant(0.15, mhcd, true; calc_cq=true, Vq_min=-0.3, Vq_max=0.3, E_min = -0.6, E_max=0.6)
2.8017566534572208e-5
```

### Fitting and Comparing Models
The package also supports fitting model parameters to experimental data. This is where the generic syntax and the magic of Julia multiple dispatch really shine! Let's say we want to try fitting a few different types of models to some experimental data...the following script is enough to do it:
```julia
# load in some dependency packages
using DelimitedFiles
using Statistics
using ElectrochemicalKinetics

# Source the data...feel free to try other options included in the `data/` folder of the repo!
dosfile = joinpath("data", "DOSes", "Cu_111_dos.txt")
expfile = joinpath("data", "exp_data", "ecdec.txt")
exp_data = readdlm(expfile, ',')

# set the types of models to fit
model_types = [ButlerVolmer, Marcus, MarcusHushChidseyDOS]

# this is all it takes to fit the models!
models = [fit_model(exp_data, model_type; dos_file=dosfile) for model_type in model_types]

# There's a convenience function to compare results
plot_exp_and_models(exp_data, models)
```
The resulting plot looks like:

models_expts

But we might also want to see the higher-voltage behavior and compare the models absent the experimental data. There's another function for that (by default it plots to +/- 1V)...
```julia
julia> plot_models(models)
```
models

### Electrochemical Phase Diagrams
For more on this, see upcoming paper: [arxiv link placeholder]

## Supported Models
### Butler-Volmer
Probably the most basic (and largely empirical) kinetic model. The rate constants are given by:

$$k_{\text{ox}}^{\text{BV}}(\eta)=A\exp\left(\frac{\alpha\eta}{k_{\text B}T}\right)\\ k_{\text{red}}^{\text{BV}}(\eta)=A\exp\left(\frac{(1-\alpha)\eta}{k_{\text B}T}\right)$$

It is implemented in the package as `ButlerVolmer`, possessing two fields: the prefactor `A` and the transfer coefficient ``.

### Marcus
One step up with a bit of mechanism...

$$k_{\text{red/ox}}^{\text{Marcus}}(\eta) = A\exp\left(-\frac{(\lambda\pm\eta)^2}{4k_{\text B}T}\right)$$

Implemented in the package as `Marcus`, with parameters for prefactor `A` and reorganization energy ``.

### Marcus-Hush-Chidsey
Originated from [Chidsey's 1991 paper](https://dx.doi.org/10.1126/science.251.4996.919).

$$k_{\text{red/ox}}^{\text{MHC}}(\eta) = A\int_{-\infty}^\infty \exp\left(-\frac{(\varepsilon-\lambda\mp\eta)^2}{4k_{\text B}T}\right)f_{\text{FD}}(\varepsilon, T)\mathrm d\varepsilon$$

Implemented as `MarcusHushChidsey`, with prefactor `A`, reorganization energy ``, and also an `average_dos` parameter (which defaults to 1.0), which is useful for making direct comparisons against `MarcusHushChidseyDOS` (see below).

### Asymptotic Marcus-Hush-Chidsey
Originated from [Zeng et al. 2014](https://dx.doi.org/10.1016/j.jelechem.2014.09.038d) (equation 17). We have corrected it to recover the correct temperature scaling, [paper link placeholder]

Implemented as `AsymptoticMarcusHushChidsey` with parameters `A` and ``.

### Marcus-Hush-Chidsey + DOS
Originated from [Kurchin and Viswanathan 2020](https://dx.doi.org/10.1063/5.0023611 ).

$$k_{\text{ox}}^{\text{MHCKV}}(\eta)=A\int_{-\infty}^\infty\mathcal{D}(\varepsilon)\exp\left(-\frac{(\lambda-\eta+\varepsilon)^2}{4\lambda k_{\text{B}}T}\right)(1-f_{\text{FD}}(\varepsilon,T))\mathrm{d}\varepsilon\\
k_{\text{red}}^{\text{MHCKV}}(\eta)=A\int_{-\infty}^\infty\mathcal{D}(\varepsilon)\exp\left(-\frac{(\lambda+\eta-\varepsilon)^2}{4\lambda k_{\text{B}}T}\right)f_{\text{FD}}(\varepsilon,T)\mathrm{d}\varepsilon$$


Implemented as `MarcusHushChidseyDOS`, with parameters `A`, ``, and `dos`, which must be a `DOSData` object (can be automatically constructed from a two-column text file of energies and DOS values).

## Contributing
We are happy to take pull requests for new features, new models, etc. by pull request! It is suggested (though not required) that you first open an issue to discuss.

Owner

  • Name: BatteryModels
  • Login: BattModels
  • Kind: organization
  • Email: venkvis@cmu.edu

This will consist of first-principles, multi-physics battery and electric mobility models developed in group of V. Viswanathan at Carnegie Mellon.

GitHub Events

Total
  • Watch event: 1
  • Fork event: 1
Last Year
  • Watch event: 1
  • Fork event: 1

Issues and Pull Requests

Last synced: 12 months ago

All Time
  • Total issues: 12
  • Total pull requests: 45
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 23 days
  • Total issue authors: 3
  • Total pull request authors: 6
  • Average comments per issue: 1.92
  • Average comments per pull request: 1.11
  • Merged pull requests: 34
  • Bot issues: 0
  • Bot pull requests: 17
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • rkurchin (10)
  • tinosulzer (1)
  • JuliaTagBot (1)
Pull Request Authors
  • github-actions[bot] (17)
  • rkurchin (17)
  • DhairyaLGandhi (8)
  • longemen3000 (1)
  • tinosulzer (1)
  • holdymoldy (1)
Top Labels
Issue Labels
enhancement (3) bug (1) good first issue (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 9
juliahub.com: ElectrochemicalKinetics

Electrochemical reaction rate modeling and nonequilibrium phase maps (via AD)

  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 9.9%
Forks count: 19.4%
Average: 23.7%
Stargazers count: 26.7%
Dependent packages count: 38.9%
Last synced: 10 months ago