softpotato 3.2.2__tar.gz → 3.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {softpotato-3.2.2/src/softpotato.egg-info → softpotato-3.3.0}/PKG-INFO +45 -9
- {softpotato-3.2.2 → softpotato-3.3.0}/README.md +44 -8
- {softpotato-3.2.2 → softpotato-3.3.0}/pyproject.toml +1 -1
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/__init__.py +41 -2
- softpotato-3.3.0/src/softpotato/reactions/__init__.py +77 -0
- softpotato-3.3.0/src/softpotato/reactions/heterogeneous.py +1193 -0
- softpotato-3.3.0/src/softpotato/reactions/homogeneous.py +1245 -0
- softpotato-3.3.0/src/softpotato/reactions/mechanisms.py +787 -0
- softpotato-3.3.0/src/softpotato/reactions/species.py +256 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/solver/base.py +228 -55
- softpotato-3.3.0/src/softpotato/solver/scipy_ivp.py +450 -0
- {softpotato-3.2.2 → softpotato-3.3.0/src/softpotato.egg-info}/PKG-INFO +45 -9
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato.egg-info/SOURCES.txt +10 -0
- softpotato-3.3.0/tests/test_basic.py +5 -0
- softpotato-3.3.0/tests/test_reactions_benchmark.py +726 -0
- softpotato-3.3.0/tests/test_reactions_heterogeneous.py +519 -0
- softpotato-3.3.0/tests/test_reactions_homogeneous.py +600 -0
- softpotato-3.3.0/tests/test_reactions_solver.py +701 -0
- softpotato-3.3.0/tests/test_reactions_species.py +354 -0
- softpotato-3.2.2/src/softpotato/solver/scipy_ivp.py +0 -240
- softpotato-3.2.2/tests/test_basic.py +0 -5
- {softpotato-3.2.2 → softpotato-3.3.0}/LICENSE +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/setup.cfg +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/analytical/__init__.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/analytical/benchmark.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/analytical/fitting.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/analytical/hydrodynamics.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/analytical/kinetics.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/analytical/microelectrodes.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/analytical/secm.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/analytical/step.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/analytical/voltammetry.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/constants.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/geometry/__init__.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/geometry/base.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/geometry/cylindrical.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/geometry/planar.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/geometry/spherical.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/grid/__init__.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/grid/base.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/grid/exponential.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/grid/geometric.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/grid/uniform.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/py.typed +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/solver/__init__.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/solver/crank_nicolson.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/solver/explicit.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato/solver/implicit.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato.egg-info/dependency_links.txt +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato.egg-info/requires.txt +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/src/softpotato.egg-info/top_level.txt +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/tests/test_analytical_benchmark.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/tests/test_analytical_fitting.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/tests/test_analytical_hydrodynamics.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/tests/test_analytical_kinetics.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/tests/test_analytical_microelectrodes.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/tests/test_analytical_secm.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/tests/test_analytical_step.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/tests/test_analytical_voltammetry.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/tests/test_constants.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/tests/test_geometry.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/tests/test_grid.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/tests/test_grid_solvers.py +0 -0
- {softpotato-3.2.2 → softpotato-3.3.0}/tests/test_solvers.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: softpotato
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.3.0
|
|
4
4
|
Summary: Electrochemical simulation and analysis toolkit in Python.
|
|
5
5
|
Author-email: Oliver Rodriguez <oliver.rdz@softpotato.xyz>
|
|
6
6
|
License: BSD-3-Clause
|
|
@@ -65,9 +65,9 @@ Dynamic: license-file
|
|
|
65
65
|
**Soft Potato** is an open-source electrochemical simulation and analysis toolkit in Python.
|
|
66
66
|
|
|
67
67
|
> [!NOTE]
|
|
68
|
-
> **Active Development (Milestone
|
|
69
|
-
> The `main` branch contains work-in-progress features for **Milestone
|
|
70
|
-
> The current stable release available on [PyPI](https://pypi.org/project/softpotato/) is **v3.
|
|
68
|
+
> **Active Development (Milestone 4 in progress):**
|
|
69
|
+
> The `main` branch contains work-in-progress features for **Milestone 4** (v3.4.0: Techniques).
|
|
70
|
+
> The current stable release available on [PyPI](https://pypi.org/project/softpotato/) is **v3.3.0**.
|
|
71
71
|
> To test or use in-development features, install directly from GitHub:
|
|
72
72
|
> ```bash
|
|
73
73
|
> pip install git+https://github.com/oliverrdz/softpotato.git
|
|
@@ -82,15 +82,15 @@ Dynamic: license-file
|
|
|
82
82
|
Run Soft Potato directly in your browser with no local Python setup required:
|
|
83
83
|
- [**Launch Soft Potato v3 Starter in Google Colab**](https://colab.research.google.com/drive/1w9NfLV2j8ZZjjcVhAiPcogVnKb65wqE2)
|
|
84
84
|
|
|
85
|
-
### Stable Release (v3.
|
|
85
|
+
### Stable Release (v3.3.0)
|
|
86
86
|
|
|
87
|
-
Soft Potato v3.
|
|
87
|
+
Soft Potato v3.3.0 is available on [PyPI](https://pypi.org/project/softpotato/) and can be installed via pip:
|
|
88
88
|
|
|
89
89
|
```bash
|
|
90
90
|
pip install softpotato
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
### Development Version (Milestone
|
|
93
|
+
### Development Version (Milestone 4 in progress)
|
|
94
94
|
|
|
95
95
|
To install the latest development version directly from GitHub:
|
|
96
96
|
|
|
@@ -190,6 +190,40 @@ result = get_solver("scipy_ivp").solve(problem, t_span=(0.0, 2.0))
|
|
|
190
190
|
i_cathodic = result.currents["Ox"] # Faradaic current in Amperes (IUPAC convention)
|
|
191
191
|
```
|
|
192
192
|
|
|
193
|
+
## Chemical & Electrochemical Reaction Kinetics (`softpotato.reactions`)
|
|
194
|
+
|
|
195
|
+
Soft Potato's `reactions` module couples solution-phase homogeneous mechanisms (EC, EC', reversible, dimerization, disproportionation, and custom rate laws) and heterogeneous charge-transfer kinetics (`ButlerVolmer`, `TafelKinetics`, `NernstianEquilibrium`) directly to `DiffusionProblem` with automated analytical sparse Jacobians for stiff ODE solvers:
|
|
196
|
+
|
|
197
|
+
```python
|
|
198
|
+
from softpotato.grid import create_diffusion_mesh
|
|
199
|
+
from softpotato.reactions import (
|
|
200
|
+
CatalyticReaction,
|
|
201
|
+
ReactionNetwork,
|
|
202
|
+
Species,
|
|
203
|
+
SpeciesCollection,
|
|
204
|
+
)
|
|
205
|
+
from softpotato.solver import DiffusionProblem, DirichletBC, get_solver
|
|
206
|
+
|
|
207
|
+
ox = Species("Ox", diffusivity=1e-9, bulk_concentration=1.0, n_electrons=-1)
|
|
208
|
+
red = Species("Red", diffusivity=1e-9, bulk_concentration=0.0, n_electrons=1)
|
|
209
|
+
species = SpeciesCollection([ox, red])
|
|
210
|
+
reactions = ReactionNetwork([CatalyticReaction(reactant=red, regenerated=ox, k=5.0)])
|
|
211
|
+
|
|
212
|
+
mesh = create_diffusion_mesh(
|
|
213
|
+
D=1e-9, t_max=2.0, kind="geometric", n_points=80, gamma=1.06
|
|
214
|
+
)
|
|
215
|
+
problem = DiffusionProblem(
|
|
216
|
+
grid=mesh,
|
|
217
|
+
species=species,
|
|
218
|
+
reactions=reactions,
|
|
219
|
+
boundary_conditions={
|
|
220
|
+
"Ox": (DirichletBC(0.0), DirichletBC(1.0)),
|
|
221
|
+
"Red": (DirichletBC(1.0), DirichletBC(0.0)),
|
|
222
|
+
},
|
|
223
|
+
)
|
|
224
|
+
result = get_solver("scipy_ivp").solve(problem, t_span=(0.0, 2.0))
|
|
225
|
+
```
|
|
226
|
+
|
|
193
227
|
## Analytical Equations & Benchmarking (`softpotato.analytical`)
|
|
194
228
|
|
|
195
229
|
Soft Potato provides exact closed-form analytical solutions and empirical models for benchmarking numerical solvers and rapid parameter estimation:
|
|
@@ -216,6 +250,8 @@ Step-by-step Jupyter notebook tutorials are located in [`examples/`](examples/)
|
|
|
216
250
|
| **Cyclic Voltammetry** | Reversible Nernstian CV, concentration profiles, and Randles–Ševčík diagnostics | [`examples/cyclic_voltammetry.ipynb`](examples/cyclic_voltammetry.ipynb) |
|
|
217
251
|
| **Cottrell Across Geometries** | Planar, spherical, and cylindrical electrode transients and steady-state limits | [`examples/cottrell_geometries.ipynb`](examples/cottrell_geometries.ipynb) |
|
|
218
252
|
| **Non-Uniform Expanding Grids** | Geometric and exponential mesh clustering, convergence, and 5–20× solver speedups | [`examples/expanding_grids.ipynb`](examples/expanding_grids.ipynb) |
|
|
253
|
+
| **Catalytic EC' Mechanism** | Coupled catalytic chronoamperometry, reaction-layer profiles, and analytical benchmarking | [`examples/catalytic_ec.ipynb`](examples/catalytic_ec.ipynb) |
|
|
254
|
+
| **Heterogeneous Kinetics (Butler–Volmer CV)** | Reversible, quasi-reversible, and irreversible CV regimes and Nicholson $\Delta E_p$ analysis | [`examples/heterogeneous_kinetics.ipynb`](examples/heterogeneous_kinetics.ipynb) |
|
|
219
255
|
|
|
220
256
|
## Development Roadmap & Milestones
|
|
221
257
|
|
|
@@ -226,8 +262,8 @@ Soft Potato follows a staged milestone development roadmap for the 3.x series, m
|
|
|
226
262
|
| **Current Baseline** | `v3.0.0` | 1D multi-species diffusion solvers (`scipy_ivp`, Crank–Nicolson, BTCS, FTCS) | Released |
|
|
227
263
|
| **Milestone 1: Analytical Equations** | `v3.1.0` | Vectorized analytical models (`step`, `voltammetry`, `hydrodynamics`, `microelectrodes`, `secm`, `kinetics`), automated solver benchmarking (`benchmark`), and parameter fitting (`fitting`) | Released |
|
|
228
264
|
| **Milestone 2: Grids** | `v3.2.0` | Non-uniform, geometric, and exponentially expanding spatial discretization meshes (`grid`) and planar/spherical/cylindrical coordinate geometries (`geometry`) | Released |
|
|
229
|
-
| **Milestone 3: Reactions** | `v3.3.0` | Homogeneous chemical mechanisms (EC, EC', catalytic) and heterogeneous charge-transfer kinetics (`reactions`) |
|
|
230
|
-
| **Milestone 4: Techniques** | `v3.4.0` | Standard electrochemical experimental waveform generators (CV, CA, DPV, SWV, RDE) and high-level simulation pipelines (`techniques`) |
|
|
265
|
+
| **Milestone 3: Reactions** | `v3.3.0` | Homogeneous chemical mechanisms (EC, EC', catalytic) and heterogeneous charge-transfer kinetics (`reactions`) | Released |
|
|
266
|
+
| **Milestone 4: Techniques** | `v3.4.0` | Standard electrochemical experimental waveform generators (CV, CA, DPV, SWV, RDE) and high-level simulation pipelines (`techniques`) | In Development |
|
|
231
267
|
|
|
232
268
|
For detailed architectural plans and deliverable specifications, see the full [Roadmap](ROADMAP.md).
|
|
233
269
|
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
**Soft Potato** is an open-source electrochemical simulation and analysis toolkit in Python.
|
|
11
11
|
|
|
12
12
|
> [!NOTE]
|
|
13
|
-
> **Active Development (Milestone
|
|
14
|
-
> The `main` branch contains work-in-progress features for **Milestone
|
|
15
|
-
> The current stable release available on [PyPI](https://pypi.org/project/softpotato/) is **v3.
|
|
13
|
+
> **Active Development (Milestone 4 in progress):**
|
|
14
|
+
> The `main` branch contains work-in-progress features for **Milestone 4** (v3.4.0: Techniques).
|
|
15
|
+
> The current stable release available on [PyPI](https://pypi.org/project/softpotato/) is **v3.3.0**.
|
|
16
16
|
> To test or use in-development features, install directly from GitHub:
|
|
17
17
|
> ```bash
|
|
18
18
|
> pip install git+https://github.com/oliverrdz/softpotato.git
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
Run Soft Potato directly in your browser with no local Python setup required:
|
|
28
28
|
- [**Launch Soft Potato v3 Starter in Google Colab**](https://colab.research.google.com/drive/1w9NfLV2j8ZZjjcVhAiPcogVnKb65wqE2)
|
|
29
29
|
|
|
30
|
-
### Stable Release (v3.
|
|
30
|
+
### Stable Release (v3.3.0)
|
|
31
31
|
|
|
32
|
-
Soft Potato v3.
|
|
32
|
+
Soft Potato v3.3.0 is available on [PyPI](https://pypi.org/project/softpotato/) and can be installed via pip:
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
35
|
pip install softpotato
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
### Development Version (Milestone
|
|
38
|
+
### Development Version (Milestone 4 in progress)
|
|
39
39
|
|
|
40
40
|
To install the latest development version directly from GitHub:
|
|
41
41
|
|
|
@@ -135,6 +135,40 @@ result = get_solver("scipy_ivp").solve(problem, t_span=(0.0, 2.0))
|
|
|
135
135
|
i_cathodic = result.currents["Ox"] # Faradaic current in Amperes (IUPAC convention)
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
+
## Chemical & Electrochemical Reaction Kinetics (`softpotato.reactions`)
|
|
139
|
+
|
|
140
|
+
Soft Potato's `reactions` module couples solution-phase homogeneous mechanisms (EC, EC', reversible, dimerization, disproportionation, and custom rate laws) and heterogeneous charge-transfer kinetics (`ButlerVolmer`, `TafelKinetics`, `NernstianEquilibrium`) directly to `DiffusionProblem` with automated analytical sparse Jacobians for stiff ODE solvers:
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
from softpotato.grid import create_diffusion_mesh
|
|
144
|
+
from softpotato.reactions import (
|
|
145
|
+
CatalyticReaction,
|
|
146
|
+
ReactionNetwork,
|
|
147
|
+
Species,
|
|
148
|
+
SpeciesCollection,
|
|
149
|
+
)
|
|
150
|
+
from softpotato.solver import DiffusionProblem, DirichletBC, get_solver
|
|
151
|
+
|
|
152
|
+
ox = Species("Ox", diffusivity=1e-9, bulk_concentration=1.0, n_electrons=-1)
|
|
153
|
+
red = Species("Red", diffusivity=1e-9, bulk_concentration=0.0, n_electrons=1)
|
|
154
|
+
species = SpeciesCollection([ox, red])
|
|
155
|
+
reactions = ReactionNetwork([CatalyticReaction(reactant=red, regenerated=ox, k=5.0)])
|
|
156
|
+
|
|
157
|
+
mesh = create_diffusion_mesh(
|
|
158
|
+
D=1e-9, t_max=2.0, kind="geometric", n_points=80, gamma=1.06
|
|
159
|
+
)
|
|
160
|
+
problem = DiffusionProblem(
|
|
161
|
+
grid=mesh,
|
|
162
|
+
species=species,
|
|
163
|
+
reactions=reactions,
|
|
164
|
+
boundary_conditions={
|
|
165
|
+
"Ox": (DirichletBC(0.0), DirichletBC(1.0)),
|
|
166
|
+
"Red": (DirichletBC(1.0), DirichletBC(0.0)),
|
|
167
|
+
},
|
|
168
|
+
)
|
|
169
|
+
result = get_solver("scipy_ivp").solve(problem, t_span=(0.0, 2.0))
|
|
170
|
+
```
|
|
171
|
+
|
|
138
172
|
## Analytical Equations & Benchmarking (`softpotato.analytical`)
|
|
139
173
|
|
|
140
174
|
Soft Potato provides exact closed-form analytical solutions and empirical models for benchmarking numerical solvers and rapid parameter estimation:
|
|
@@ -161,6 +195,8 @@ Step-by-step Jupyter notebook tutorials are located in [`examples/`](examples/)
|
|
|
161
195
|
| **Cyclic Voltammetry** | Reversible Nernstian CV, concentration profiles, and Randles–Ševčík diagnostics | [`examples/cyclic_voltammetry.ipynb`](examples/cyclic_voltammetry.ipynb) |
|
|
162
196
|
| **Cottrell Across Geometries** | Planar, spherical, and cylindrical electrode transients and steady-state limits | [`examples/cottrell_geometries.ipynb`](examples/cottrell_geometries.ipynb) |
|
|
163
197
|
| **Non-Uniform Expanding Grids** | Geometric and exponential mesh clustering, convergence, and 5–20× solver speedups | [`examples/expanding_grids.ipynb`](examples/expanding_grids.ipynb) |
|
|
198
|
+
| **Catalytic EC' Mechanism** | Coupled catalytic chronoamperometry, reaction-layer profiles, and analytical benchmarking | [`examples/catalytic_ec.ipynb`](examples/catalytic_ec.ipynb) |
|
|
199
|
+
| **Heterogeneous Kinetics (Butler–Volmer CV)** | Reversible, quasi-reversible, and irreversible CV regimes and Nicholson $\Delta E_p$ analysis | [`examples/heterogeneous_kinetics.ipynb`](examples/heterogeneous_kinetics.ipynb) |
|
|
164
200
|
|
|
165
201
|
## Development Roadmap & Milestones
|
|
166
202
|
|
|
@@ -171,8 +207,8 @@ Soft Potato follows a staged milestone development roadmap for the 3.x series, m
|
|
|
171
207
|
| **Current Baseline** | `v3.0.0` | 1D multi-species diffusion solvers (`scipy_ivp`, Crank–Nicolson, BTCS, FTCS) | Released |
|
|
172
208
|
| **Milestone 1: Analytical Equations** | `v3.1.0` | Vectorized analytical models (`step`, `voltammetry`, `hydrodynamics`, `microelectrodes`, `secm`, `kinetics`), automated solver benchmarking (`benchmark`), and parameter fitting (`fitting`) | Released |
|
|
173
209
|
| **Milestone 2: Grids** | `v3.2.0` | Non-uniform, geometric, and exponentially expanding spatial discretization meshes (`grid`) and planar/spherical/cylindrical coordinate geometries (`geometry`) | Released |
|
|
174
|
-
| **Milestone 3: Reactions** | `v3.3.0` | Homogeneous chemical mechanisms (EC, EC', catalytic) and heterogeneous charge-transfer kinetics (`reactions`) |
|
|
175
|
-
| **Milestone 4: Techniques** | `v3.4.0` | Standard electrochemical experimental waveform generators (CV, CA, DPV, SWV, RDE) and high-level simulation pipelines (`techniques`) |
|
|
210
|
+
| **Milestone 3: Reactions** | `v3.3.0` | Homogeneous chemical mechanisms (EC, EC', catalytic) and heterogeneous charge-transfer kinetics (`reactions`) | Released |
|
|
211
|
+
| **Milestone 4: Techniques** | `v3.4.0` | Standard electrochemical experimental waveform generators (CV, CA, DPV, SWV, RDE) and high-level simulation pipelines (`techniques`) | In Development |
|
|
176
212
|
|
|
177
213
|
For detailed architectural plans and deliverable specifications, see the full [Roadmap](ROADMAP.md).
|
|
178
214
|
|
|
@@ -26,7 +26,7 @@ True
|
|
|
26
26
|
(101, 50)
|
|
27
27
|
"""
|
|
28
28
|
|
|
29
|
-
from . import analytical, constants, geometry, grid, solver
|
|
29
|
+
from . import analytical, constants, geometry, grid, reactions, solver
|
|
30
30
|
from .analytical import (
|
|
31
31
|
BenchmarkCaseResult,
|
|
32
32
|
BenchmarkMetrics,
|
|
@@ -157,6 +157,26 @@ from .grid import (
|
|
|
157
157
|
create_diffusion_mesh,
|
|
158
158
|
diffusion_layer_thickness,
|
|
159
159
|
)
|
|
160
|
+
from .reactions import (
|
|
161
|
+
ButlerVolmer,
|
|
162
|
+
CatalyticReaction,
|
|
163
|
+
CustomReaction,
|
|
164
|
+
DimerizationReaction,
|
|
165
|
+
DisproportionationReaction,
|
|
166
|
+
FirstOrderReaction,
|
|
167
|
+
HeterogeneousKinetics,
|
|
168
|
+
HomogeneousReaction,
|
|
169
|
+
MassActionReaction,
|
|
170
|
+
NernstianEquilibrium,
|
|
171
|
+
ReactionNetwork,
|
|
172
|
+
ReversibleReaction,
|
|
173
|
+
SecondOrderReaction,
|
|
174
|
+
Species,
|
|
175
|
+
SpeciesCollection,
|
|
176
|
+
Tafel,
|
|
177
|
+
TafelKinetics,
|
|
178
|
+
create_electrochemical_bcs,
|
|
179
|
+
)
|
|
160
180
|
from .solver import (
|
|
161
181
|
BaseSolver,
|
|
162
182
|
BoundaryCondition,
|
|
@@ -168,7 +188,7 @@ from .solver import (
|
|
|
168
188
|
list_solvers,
|
|
169
189
|
)
|
|
170
190
|
|
|
171
|
-
__version__ = "3.
|
|
191
|
+
__version__ = "3.3.0"
|
|
172
192
|
|
|
173
193
|
__all__ = [
|
|
174
194
|
"AVOGADRO",
|
|
@@ -184,35 +204,52 @@ __all__ = [
|
|
|
184
204
|
"BenchmarkMetrics",
|
|
185
205
|
"BenchmarkSuiteResult",
|
|
186
206
|
"BoundaryCondition",
|
|
207
|
+
"ButlerVolmer",
|
|
187
208
|
"ButlerVolmerFitResult",
|
|
209
|
+
"CatalyticReaction",
|
|
188
210
|
"ConvergenceResult",
|
|
189
211
|
"CottrellFitResult",
|
|
212
|
+
"CustomReaction",
|
|
190
213
|
"CylindricalGeometry",
|
|
191
214
|
"DiffusionProblem",
|
|
215
|
+
"DimerizationReaction",
|
|
192
216
|
"DirichletBC",
|
|
217
|
+
"DisproportionationReaction",
|
|
193
218
|
"ExponentialMesh",
|
|
194
219
|
"F",
|
|
220
|
+
"FirstOrderReaction",
|
|
195
221
|
"FitResult",
|
|
196
222
|
"GeometricExpandingMesh",
|
|
197
223
|
"Geometry",
|
|
198
224
|
"GridComparisonEntry",
|
|
199
225
|
"GridComparisonResult",
|
|
226
|
+
"HeterogeneousKinetics",
|
|
227
|
+
"HomogeneousReaction",
|
|
200
228
|
"KouteckyLevichFitResult",
|
|
201
229
|
"KouteckyLevichResult",
|
|
202
230
|
"LevichFitResult",
|
|
231
|
+
"MassActionReaction",
|
|
203
232
|
"MatsudaAyabeResult",
|
|
204
233
|
"Mesh1D",
|
|
205
234
|
"MicrodiscFitResult",
|
|
235
|
+
"NernstianEquilibrium",
|
|
206
236
|
"NeumannBC",
|
|
207
237
|
"NicholsonResult",
|
|
208
238
|
"PlanarGeometry",
|
|
209
239
|
"R",
|
|
210
240
|
"RRDEResult",
|
|
211
241
|
"RandlesSevcikFitResult",
|
|
242
|
+
"ReactionNetwork",
|
|
243
|
+
"ReversibleReaction",
|
|
212
244
|
"SECMApproachFitResult",
|
|
245
|
+
"SecondOrderReaction",
|
|
213
246
|
"SolverResult",
|
|
247
|
+
"Species",
|
|
248
|
+
"SpeciesCollection",
|
|
214
249
|
"SphericalGeometry",
|
|
250
|
+
"Tafel",
|
|
215
251
|
"TafelFitResult",
|
|
252
|
+
"TafelKinetics",
|
|
216
253
|
"TafelResult",
|
|
217
254
|
"Uniform1DMesh",
|
|
218
255
|
"UnknownGeometryError",
|
|
@@ -231,6 +268,7 @@ __all__ = [
|
|
|
231
268
|
"cottrell_spherical",
|
|
232
269
|
"cottrell_step",
|
|
233
270
|
"create_diffusion_mesh",
|
|
271
|
+
"create_electrochemical_bcs",
|
|
234
272
|
"diffusion_layer_thickness",
|
|
235
273
|
"estimate_convergence_order",
|
|
236
274
|
"exchange_current",
|
|
@@ -277,6 +315,7 @@ __all__ = [
|
|
|
277
315
|
"randles_sevcik",
|
|
278
316
|
"randles_sevcik_irreversible",
|
|
279
317
|
"randles_sevcik_quasi",
|
|
318
|
+
"reactions",
|
|
280
319
|
"register_geometry",
|
|
281
320
|
"ring_collection_current",
|
|
282
321
|
"ring_limiting_current",
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"""Chemical species and electrochemical reaction kinetics for Soft Potato.
|
|
2
|
+
|
|
3
|
+
This subpackage provides modular abstractions for chemical species metadata,
|
|
4
|
+
homogeneous (solution-phase) reaction kinetics with automated analytical
|
|
5
|
+
Jacobians, and heterogeneous charge-transfer kinetics.
|
|
6
|
+
|
|
7
|
+
Examples
|
|
8
|
+
--------
|
|
9
|
+
>>> from softpotato.reactions import ButlerVolmer, Species, SpeciesCollection
|
|
10
|
+
>>> ox = Species("Ox", diffusivity=1e-9, bulk_concentration=1.0, n_electrons=1)
|
|
11
|
+
>>> red = Species("Red", diffusivity=1e-9, bulk_concentration=0.0, n_electrons=-1)
|
|
12
|
+
>>> species = SpeciesCollection([ox, red])
|
|
13
|
+
>>> species.diffusivities
|
|
14
|
+
{'Ox': 1e-09, 'Red': 1e-09}
|
|
15
|
+
>>> bv = ButlerVolmer(k0=1e-4, alpha=0.5, E0=0.0, n=1)
|
|
16
|
+
>>> bv.rate_constants(0.0)
|
|
17
|
+
(0.0001, 0.0001)
|
|
18
|
+
|
|
19
|
+
Homogeneous reactions are combined in a :class:`ReactionNetwork`, which can be
|
|
20
|
+
passed directly to ``DiffusionProblem(..., reactions=network)``:
|
|
21
|
+
|
|
22
|
+
>>> from softpotato.reactions import FirstOrderReaction, ReactionNetwork
|
|
23
|
+
>>> network = ReactionNetwork([FirstOrderReaction(red, "P", k=1.0)])
|
|
24
|
+
>>> network.species
|
|
25
|
+
['Red', 'P']
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
from .heterogeneous import (
|
|
29
|
+
ButlerVolmer,
|
|
30
|
+
HeterogeneousKinetics,
|
|
31
|
+
NernstianEquilibrium,
|
|
32
|
+
Tafel,
|
|
33
|
+
TafelKinetics,
|
|
34
|
+
create_electrochemical_bcs,
|
|
35
|
+
)
|
|
36
|
+
from .homogeneous import (
|
|
37
|
+
CatalyticReaction,
|
|
38
|
+
CustomReaction,
|
|
39
|
+
DimerizationReaction,
|
|
40
|
+
DisproportionationReaction,
|
|
41
|
+
FirstOrderReaction,
|
|
42
|
+
HomogeneousReaction,
|
|
43
|
+
MassActionReaction,
|
|
44
|
+
ReactionNetwork,
|
|
45
|
+
ReversibleReaction,
|
|
46
|
+
SecondOrderReaction,
|
|
47
|
+
)
|
|
48
|
+
from .mechanisms import (
|
|
49
|
+
CustomMechanism,
|
|
50
|
+
ElectrochemicalStep,
|
|
51
|
+
Mechanism,
|
|
52
|
+
)
|
|
53
|
+
from .species import Species, SpeciesCollection
|
|
54
|
+
|
|
55
|
+
__all__ = [
|
|
56
|
+
"ButlerVolmer",
|
|
57
|
+
"CatalyticReaction",
|
|
58
|
+
"CustomMechanism",
|
|
59
|
+
"CustomReaction",
|
|
60
|
+
"DimerizationReaction",
|
|
61
|
+
"DisproportionationReaction",
|
|
62
|
+
"ElectrochemicalStep",
|
|
63
|
+
"FirstOrderReaction",
|
|
64
|
+
"HeterogeneousKinetics",
|
|
65
|
+
"HomogeneousReaction",
|
|
66
|
+
"MassActionReaction",
|
|
67
|
+
"Mechanism",
|
|
68
|
+
"NernstianEquilibrium",
|
|
69
|
+
"ReactionNetwork",
|
|
70
|
+
"ReversibleReaction",
|
|
71
|
+
"SecondOrderReaction",
|
|
72
|
+
"Species",
|
|
73
|
+
"SpeciesCollection",
|
|
74
|
+
"Tafel",
|
|
75
|
+
"TafelKinetics",
|
|
76
|
+
"create_electrochemical_bcs",
|
|
77
|
+
]
|