Skip to content

Commit

Permalink
#923 fix composite extended model
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsulzer committed Apr 5, 2020
1 parent 3c1c6cf commit 796f8d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/scripts/compare_lead_acid.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
models = [
pybamm.lead_acid.LOQS(),
pybamm.lead_acid.FOQS(),
pybamm.lead_acid.Composite(),
pybamm.lead_acid.CompositeExtended(),
pybamm.lead_acid.Full(),
]

# load parameter values and process models and geometry
param = models[0].default_parameter_values
param.update({"Current function [A]": 10, "Initial State of Charge": 1})
param.update({"Current function [A]": 85, "Initial State of Charge": 1})
for model in models:
param.process_model(model)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,17 @@ def _get_source_terms_leading_order(self, variables):
)

def _get_source_terms_first_order(self, variables):
param = self.param
c_e_n = variables["Negative electrolyte concentration"]
c_e_p = variables["Positive electrolyte concentration"]

return sum(
pybamm.Concatenation(
reaction["Negative"]["s"] * variables[reaction["Negative"]["aj"]],
(reaction["Negative"]["s"] - param.t_plus(c_e_n))
* variables[reaction["Negative"]["aj"]],
pybamm.FullBroadcast(0, "separator", "current collector"),
reaction["Positive"]["s"] * variables[reaction["Positive"]["aj"]],
(reaction["Positive"]["s"] - param.t_plus(c_e_p))
* variables[reaction["Positive"]["aj"]],
)
/ self.param.gamma_e
for reaction in self.reactions.values()
Expand Down

0 comments on commit 796f8d0

Please sign in to comment.