From 5d9fc8124a84b3db38cda7bb4decd2fe7875995d Mon Sep 17 00:00:00 2001
From: Valentin Sulzer <valentinsulzer@hotmail.com>
Date: Sun, 1 Nov 2020 21:14:48 -0500
Subject: [PATCH 1/2] #1224 add missing parameters

---
 CHANGELOG.md                                                   | 1 +
 .../lithium-ion/separators/separator_Ecker2015/parameters.csv  | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index f9c492050e..66030fb2f4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@
 
 ## Bug fixes
 
+-   Add missing separator thermal parameters for the Ecker parameter set ([#1226](https://github.com/pybamm-team/PyBaMM/pull/1226))
 -   Raise error if saving to matlab with variable names that matlab can't read, and give option of providing alternative variable names ([#1206](https://github.com/pybamm-team/PyBaMM/pull/1206))
 -   Raise error if the boundary condition at the origin in a spherical domain is other than no-flux ([#1175](https://github.com/pybamm-team/PyBaMM/pull/1175))
 -   Fix boundary conditions at r = 0 for Creating Models notebooks ([#1173](https://github.com/pybamm-team/PyBaMM/pull/1173))
diff --git a/pybamm/input/parameters/lithium-ion/separators/separator_Ecker2015/parameters.csv b/pybamm/input/parameters/lithium-ion/separators/separator_Ecker2015/parameters.csv
index b1f6cf21a9..d51a852b4d 100644
--- a/pybamm/input/parameters/lithium-ion/separators/separator_Ecker2015/parameters.csv
+++ b/pybamm/input/parameters/lithium-ion/separators/separator_Ecker2015/parameters.csv
@@ -4,3 +4,6 @@ Name [units],Value,Reference,Notes
 Separator porosity,0.508,,
 Separator Bruggeman coefficient (electrolyte),1.9804586773134942, Solve for permeability factor B=0.304=eps^b,
 Separator Bruggeman coefficient (electrode),0,No Bruggeman correction to solid conductivity,
+Separator density [kg.m-3],397,default,
+Separator specific heat capacity [J.kg-1.K-1],700,default,
+Separator thermal conductivity [W.m-1.K-1],0.16,default,
\ No newline at end of file

From 619d09a8d5dd2c78c35b991d2247fa73d606b5c7 Mon Sep 17 00:00:00 2001
From: Valentin Sulzer <valentinsulzer@hotmail.com>
Date: Sun, 1 Nov 2020 21:36:58 -0500
Subject: [PATCH 2/2] #1225 fix EC SEI submodel

---
 CHANGELOG.md                                          |  1 +
 .../submodels/interface/sei/ec_reaction_limited.py    | 11 ++++++++---
 .../submodels/interface/sei/reaction_limited.py       |  4 ++--
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 66030fb2f4..9424b85ad9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@
 
 ## Bug fixes
 
+-   Fix bug that was slowing down creation of the EC reaction SEI submodel ([#1227](https://github.com/pybamm-team/PyBaMM/pull/1227))
 -   Add missing separator thermal parameters for the Ecker parameter set ([#1226](https://github.com/pybamm-team/PyBaMM/pull/1226))
 -   Raise error if saving to matlab with variable names that matlab can't read, and give option of providing alternative variable names ([#1206](https://github.com/pybamm-team/PyBaMM/pull/1206))
 -   Raise error if the boundary condition at the origin in a spherical domain is other than no-flux ([#1175](https://github.com/pybamm-team/PyBaMM/pull/1175))
diff --git a/pybamm/models/submodels/interface/sei/ec_reaction_limited.py b/pybamm/models/submodels/interface/sei/ec_reaction_limited.py
index 72495bb27b..9c03cd9d54 100644
--- a/pybamm/models/submodels/interface/sei/ec_reaction_limited.py
+++ b/pybamm/models/submodels/interface/sei/ec_reaction_limited.py
@@ -87,13 +87,18 @@ def set_algebraic(self, variables):
         # it's ok to fall back on the total interfacial current density, j_tot
         # This should only happen when the interface submodel is "InverseButlerVolmer"
         # in which case j = j_tot (uniform) anyway
-        try:
+        if (
+            "Total "
+            + self.domain.lower()
+            + " electrode interfacial current density variable"
+            in variables
+        ):
             j = variables[
                 "Total "
                 + self.domain.lower()
-                + " electrode interfacial current density"
+                + " electrode interfacial current density variable"
             ]
-        except KeyError:
+        else:
             j = variables[
                 "X-averaged "
                 + self.domain.lower()
diff --git a/pybamm/models/submodels/interface/sei/reaction_limited.py b/pybamm/models/submodels/interface/sei/reaction_limited.py
index 0f6fd0ed37..a78c7a5a56 100644
--- a/pybamm/models/submodels/interface/sei/reaction_limited.py
+++ b/pybamm/models/submodels/interface/sei/reaction_limited.py
@@ -41,9 +41,9 @@ def get_coupled_variables(self, variables):
         # it's ok to fall back on the total interfacial current density, j_tot
         # This should only happen when the interface submodel is "InverseButlerVolmer"
         # in which case j = j_tot (uniform) anyway
-        try:
+        if self.domain + " electrode interfacial current density" in variables:
             j = variables[self.domain + " electrode interfacial current density"]
-        except KeyError:
+        else:
             j = variables[
                 "X-averaged "
                 + self.domain.lower()