Skip to content

Commit

Permalink
#1405 changelog and rob comments
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsulzer committed May 24, 2021
1 parent c765988 commit 6835652
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Features

- Added a new "reaction-driven" model for LAM from Reniers et al (2019)
- Some features ("loss of active material" and "particle mechanics") can now be specified separately for the negative electrode and positive electrode by passing a 2-tuple
- Added a new "reaction-driven" model for LAM from Reniers et al (2019) ([#1490](https://github.com/pybamm-team/PyBaMM/pull/1490))
- Some features ("loss of active material" and "particle mechanics") can now be specified separately for the negative electrode and positive electrode by passing a 2-tuple ([#1490](https://github.com/pybamm-team/PyBaMM/pull/1490))
- `plot` and `plot2D` now take and return a matplotlib Axis to allow for easier customization ([#1472](https://github.com/pybamm-team/PyBaMM/pull/1472))
- `ParameterValues.evaluate` can now return arrays to allow function parameters to be easily evaluated ([#1472](https://github.com/pybamm-team/PyBaMM/pull/1472))
- Added Batch Study class ([#1455](https://github.com/pybamm-team/PyBaMM/pull/1455))
Expand All @@ -12,7 +12,7 @@

## Optimizations

- Models that mostly use x-averaged quantities (SPM and SPMe) now use x-averaged degradation models
- Models that mostly use x-averaged quantities (SPM and SPMe) now use x-averaged degradation models ([#1490](https://github.com/pybamm-team/PyBaMM/pull/1490))
- Improved how the CasADi solver's "safe" mode finds events ([#1450](https://github.com/pybamm-team/PyBaMM/pull/1450))
- Perform more automatic simplifications of the expression tree ([#1449](https://github.com/pybamm-team/PyBaMM/pull/1449))
- Reduce time taken to hash a sparse `Matrix` object ([#1449](https://github.com/pybamm-team/PyBaMM/pull/1449))
Expand All @@ -23,7 +23,7 @@

## Breaking changes

- Changed how options are specified for the "loss of active material" and "particle cracking" submodels. "loss of active material" can now be one of "none", "stress-driven", or "reaction-driven", or a 2-tuple for different options in negative and positive electrode. Similarly "particle cracking" (now called "particle mechanics") can now be "none", "swelling only", "swelling and cracking", or a 2-tuple
- Changed how options are specified for the "loss of active material" and "particle cracking" submodels. "loss of active material" can now be one of "none", "stress-driven", or "reaction-driven", or a 2-tuple for different options in negative and positive electrode. Similarly "particle cracking" (now called "particle mechanics") can now be "none", "swelling only", "swelling and cracking", or a 2-tuple ([#1490](https://github.com/pybamm-team/PyBaMM/pull/1490))
- Changed the variable in the full diffusion model from "Electrolyte concentration" to "Porosity times concentration" ([#1476](https://github.com/pybamm-team/PyBaMM/pull/1476))
- Renamed `lithium-ion` folder to `lithium_ion` and `lead-acid` folder to `lead_acid` in parameters ([#1464](https://github.com/pybamm-team/PyBaMM/pull/1464))

Expand Down
1 change: 1 addition & 0 deletions pybamm/models/full_battery_models/lithium_ion/dfn.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class DFN(BaseModel):

def __init__(self, options=None, name="Doyle-Fuller-Newman model", build=True):
super().__init__(options, name)
# For degradation models we use the full form since this is a full-order model
self.x_average = False

self.set_external_circuit_submodel()
Expand Down
2 changes: 2 additions & 0 deletions pybamm/models/full_battery_models/lithium_ion/spm.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class SPM(BaseModel):

def __init__(self, options=None, name="Single Particle Model", build=True):
super().__init__(options, name)
# For degradation models we use the "x-average" form since this is a
# reduced-order model with uniform current density in the electrodes
self.x_average = True

self.set_external_circuit_submodel()
Expand Down
2 changes: 2 additions & 0 deletions pybamm/models/full_battery_models/lithium_ion/spme.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def __init__(
self, options=None, name="Single Particle Model with electrolyte", build=True
):
super().__init__(options, name)
# For degradation models we use the "x-average" form since this is a
# reduced-order model with uniform current density in the electrodes
self.x_average = True

self.set_external_circuit_submodel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,20 @@ def get_coupled_variables(self, variables):
return variables

def set_rhs(self, variables):
Domain = self.domain + " electrode"
domain = self.domain.lower() + " electrode"
if self.x_average is True:
eps_solid = variables[
"X-averaged " + Domain.lower() + " active material volume fraction"
"X-averaged " + domain + " active material volume fraction"
]
deps_solid_dt = variables[
"X-averaged "
+ Domain.lower()
+ " active material volume fraction change"
"X-averaged " + domain + " active material volume fraction change"
]
else:
eps_solid = variables[Domain + " active material volume fraction"]
eps_solid = variables[
self.domain + " electrode active material volume fraction"
]
deps_solid_dt = variables[
Domain + " active material volume fraction change"
self.domain + " electrode active material volume fraction change"
]

self.rhs = {eps_solid: deps_solid_dt}
Expand Down

0 comments on commit 6835652

Please sign in to comment.