Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1547 fix esoh model in pouch cell #1548

Merged
merged 3 commits into from
Jul 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@

## Bug fixes

- Fixed ElectrodeSOH model for multi-dimensional simulations ([#1548](https://github.com/pybamm-team/PyBaMM/pull/1548))
- Removed the overly-restrictive check "each variable in the algebraic eqn keys must appear in the eqn" ([#1510](https://github.com/pybamm-team/PyBaMM/pull/1510))
- Made parameters importable through pybamm ([#1475](https://github.com/pybamm-team/PyBaMM/pull/1475))

Original file line number Diff line number Diff line change
@@ -62,7 +62,14 @@ def _get_standard_active_material_variables(self, eps_solid):
L = param.L_p
c_s_max = param.c_p_max

C = eps_solid_av * L * param.A_cc * c_s_max * param.F / 3600
C = (
pybamm.yz_average(eps_solid_av)
* L
* param.A_cc
* c_s_max
* param.F
/ 3600
)
variables.update({self.domain + " electrode capacity [A.h]": C})

if self.domain == "Negative":
Original file line number Diff line number Diff line change
@@ -139,7 +139,7 @@ def _get_total_concentration_electrolyte(self, c_e, epsilon):
L_x = self.param.L_x
A = self.param.A_cc

c_e_av = pybamm.x_average(epsilon * c_e)
c_e_av = pybamm.yz_average(pybamm.x_average(epsilon * c_e))

variables = {"Total lithium in electrolyte [mol]": c_e_typ * L_x * A * c_e_av}

5 changes: 4 additions & 1 deletion pybamm/models/submodels/particle/base_particle.py
Original file line number Diff line number Diff line change
@@ -133,7 +133,10 @@ def _get_total_concentration_variables(self, variables):
+ "volume-averaged concentration [mol.m-3]": c_s_vol_av * c_scale,
"Total lithium in "
+ self.domain.lower()
+ " electrode [mol]": c_s_vol_av * eps_s_av * c_scale * L * A,
+ " electrode [mol]": pybamm.yz_average(c_s_vol_av * eps_s_av)
* c_scale
* L
* A,
}
)
return variables
29 changes: 18 additions & 11 deletions pybamm/solvers/solution.py
Original file line number Diff line number Diff line change
@@ -733,17 +733,24 @@ def get_cycle_summary_variables(cycle_solution, esoh_sim):
esoh_sim.built_model.set_initial_conditions_from(
{"x_100": x_100_init, "C": C_init}
)
esoh_sol = esoh_sim.solve(
[0],
inputs={
"V_min": V_min,
"V_max": V_max,
"C_n": C_n,
"C_p": C_p,
"n_Li": n_Li,
},
solver=solver,
)

try:
esoh_sol = esoh_sim.solve(
[0],
inputs={
"V_min": V_min,
"V_max": V_max,
"C_n": C_n,
"C_p": C_p,
"n_Li": n_Li,
},
solver=solver,
)
except pybamm.SolverError: # pragma: no cover
raise pybamm.SolverError(
"Could not solve for summary variables, run "
"`sim.solve(calc_esoh=False)` to skip this step"
)
for var in esoh_sim.built_model.variables:
cycle_summary_variables[var] = esoh_sol[var].data[0]