Skip to content

Commit

Permalink
#923 Rob and Scott comments
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsulzer committed Apr 2, 2020
1 parent 26b40c4 commit 3c1c6cf
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Surface Form

.. toctree::

full_surface_form_stefan_maxwell_conductivity
leading_surface_form_stefan_maxwell_conductivity
full_surface_form_conductivity
leading_surface_form_conductivity
6 changes: 3 additions & 3 deletions examples/scripts/compare_lead_acid.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

# load models
models = [
# pybamm.lead_acid.LOQS(),
# # pybamm.lead_acid.FOQS(),
# pybamm.lead_acid.Composite(),
pybamm.lead_acid.LOQS(),
pybamm.lead_acid.FOQS(),
pybamm.lead_acid.Composite(),
pybamm.lead_acid.Full(),
]

Expand Down
3 changes: 1 addition & 2 deletions pybamm/models/full_battery_models/base_battery_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ class BaseBatteryModel(pybamm.BaseModel):
(default), 1 or 2.
* "surface form" : bool or str, optional
Whether to use the surface formulation of the problem. Can be False
(default), "differential" or "algebraic". Must be 'False' for
lithium-ion models.
(default), "differential" or "algebraic".
* "convection" : bool or str, optional
Whether to include the effects of convection in the model. Can be
False (default), "differential" or "algebraic". Must be 'False' for
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Full order models
from .full_surface_form_stefan_maxwell_conductivity import (
from .full_surface_form_conductivity import (
FullAlgebraic,
FullDifferential,
)

# Leading-order models
from .leading_surface_form_stefan_maxwell_conductivity import (
from .leading_surface_form_conductivity import (
LeadingOrderDifferential,
LeadingOrderAlgebraic,
)
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,6 @@ def _get_standard_flux_variables(self, N_e):

return variables

def set_boundary_conditions(self, variables):

c_e = variables["Electrolyte concentration"]

self.boundary_conditions = {
c_e: {
"left": (pybamm.Scalar(0), "Neumann"),
"right": (pybamm.Scalar(0), "Neumann"),
}
}

def set_events(self, variables):
c_e = variables["Electrolyte concentration"]
self.events.append(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ def get_coupled_variables(self, variables):
param = self.param

N_e_diffusion = -tor_0 * param.D_e(c_e_0_av, T_0) * pybamm.grad(c_e)
# N_e_migration = (param.C_e * param.t_plus) / param.gamma_e * i_e
# N_e_convection = c_e * v_box_0

# N_e = N_e_diffusion + N_e_migration + N_e_convection

if v_box_0.id == pybamm.Scalar(0).id:
N_e = N_e_diffusion
Expand Down Expand Up @@ -111,3 +107,14 @@ def set_initial_conditions(self, variables):
c_e = variables["Electrolyte concentration"]

self.initial_conditions = {c_e: self.param.c_e_init}

def set_boundary_conditions(self, variables):

c_e = variables["Electrolyte concentration"]

self.boundary_conditions = {
c_e: {
"left": (pybamm.Scalar(0), "Neumann"),
"right": (pybamm.Scalar(0), "Neumann"),
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,3 @@ def get_fundamental_variables(self):

return variables

def set_boundary_conditions(self, variables):
return None
11 changes: 11 additions & 0 deletions pybamm/models/submodels/electrolyte_diffusion/full_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,14 @@ def set_initial_conditions(self, variables):
c_e = variables["Electrolyte concentration"]

self.initial_conditions = {c_e: self.param.c_e_init}

def set_boundary_conditions(self, variables):

c_e = variables["Electrolyte concentration"]

self.boundary_conditions = {
c_e: {
"left": (pybamm.Scalar(0), "Neumann"),
"right": (pybamm.Scalar(0), "Neumann"),
}
}

0 comments on commit 3c1c6cf

Please sign in to comment.