Previous topic

Base Model

Next topic

Event

This Page

Base Battery Model

class pybamm.BaseBatteryModel(options=None, name='Unnamed battery model')[source]

Base model class with some default settings and required variables Extends: pybamm.BaseModel

new_empty_copy()[source]

See pybamm.BaseModel.new_empty_copy()

process_parameters_and_discretise(symbol, parameter_values, disc)[source]

Process parameters and discretise a symbol using supplied parameter values and discretisation. Note: care should be taken if using spatial operators on dimensional symbols. Operators in pybamm are written in non-dimensional form, so may need to be scaled by the appropriate length scale. It is recommended to use this method on non-dimensional symbols.

Parameters
Returns

Processed symbol

Return type

pybamm.Symbol

set_degradation_variables()[source]

Set variables that quantify degradation. This function is overriden by the base battery models

set_external_circuit_submodel()[source]

Define how the external circuit defines the boundary conditions for the model, e.g. (not necessarily constant-) current, voltage, etc

set_soc_variables()[source]

Set variables relating to the state of charge. This function is overriden by the base battery models

class pybamm.BatteryModelOptions(extra_options)[source]
options

A dictionary of options to be passed to the model. The options that can be set are listed below. Note that not all of the options are compatible with each other and with all of the models implemented in PyBaMM. Each option is optional and takes a default value if not provided. In general, the option provided must be a string, but there are some cases where a 2-tuple of strings can be provided instead to indicate a different option for the negative and positive electrodes.

  • “cell geometry”str

    Sets the geometry of the cell. Can be “pouch” (default) or “arbitrary”. The arbitrary geometry option solves a 1D electrochemical model with prescribed cell volume and cross-sectional area, and (if thermal effects are included) solves a lumped thermal model with prescribed surface area for cooling.

  • “convection”str

    Whether to include the effects of convection in the model. Can be “none” (default), “uniform transverse” or “full transverse”. Must be “none” for lithium-ion models.

  • “current collector”str

    Sets the current collector model to use. Can be “uniform” (default), “potential pair” or “potential pair quite conductive”.

  • “dimensionality”int

    Sets the dimension of the current collector problem. Can be 0 (default), 1 or 2.

  • “electrolyte conductivity”str

    Can be “default” (default), “full”, “leading order”, “composite” or “integrated”.

  • “external submodels”list

    A list of the submodels that you would like to supply an external variable for instead of solving in PyBaMM. The entries of the lists are strings that correspond to the submodel names in the keys of self.submodels.

  • “hydrolysis”str

    Whether to include hydrolysis in the model. Only implemented for lead-acid models. Can be “false” (default) or “true”. If “true”, then “surface form” cannot be ‘false’.

  • “lithium plating”str, optional

    Sets the model for lithium plating. Can be “none” (default), “reversible” or “irreversible”.

  • “loss of active material”str

    Sets the model for loss of active material. Can be “none” (default), “stress-driven”, or “reaction-driven”. A 2-tuple can be provided for different behaviour in negative and positive electrodes.

  • “operating mode”str

    Sets the operating mode for the model. Can be “current” (default), “voltage” or “power”. Alternatively, the operating mode can be controlled with an arbitrary function by passing the function directly as the option. In this case the function must define the residual of an algebraic equation. The applied current will be solved for such that the algebraic constraint is satisfied.

  • “particle”str

    Sets the submodel to use to describe behaviour within the particle. Can be “Fickian diffusion” (default), “uniform profile”, “quadratic profile”, or “quartic profile”.

  • “particle shape”str

    Sets the model shape of the electrode particles. This is used to calculate the surface area to volume ratio. Can be “spherical” (default), “user” or “no particles”. For the “user” option the surface area per unit volume can be passed as a parameter, and is therefore not necessarily consistent with the particle shape.

  • “particle size”str

    Sets the model to include a single active particle size or a distribution of sizes at any macroscale location. Can be “single” (default) or “distribution”. Option applies to both electrodes.

  • “particle mechanics”str

    Sets the model to account for mechanical effects such as particle swelling and cracking. Can be “none” (default), “swelling only”, or “swelling and cracking”. A 2-tuple can be provided for different behaviour in negative and positive electrodes.

  • “SEI”str

    Set the SEI submodel to be used. Options are:

  • “SEI film resistance”str

    Set the submodel for additional term in the overpotential due to SEI. The default value is “none” if the “SEI” option is “none”, and “distributed” otherwise. This is because the “distributed” model is more complex than the model with no additional resistance, which adds unnecessary complexity if there is no SEI in the first place

    • “none”: no additional resistance
      \[\eta_r = \frac{F}{RT} * (\phi_s - \phi_e - U)\]
    • “distributed”: properly included additional resistance term
      \[\eta_r = \frac{F}{RT} * (\phi_s - \phi_e - U - R_{sei} * L_{sei} * j)\]
    • “average”: constant additional resistance term (approximation to the true model). This model can give similar results to the “distributed” case without needing to make j an algebraic state
      \[\eta_r = \frac{F}{RT} * (\phi_s - \phi_e - U - R_{sei} * L_{sei} * \frac{I}{aL})\]
  • “SEI porosity change”str

    Whether to include porosity change due to SEI formation, can be “false” (default) or “true”.

  • “surface form”str

    Whether to use the surface formulation of the problem. Can be “false” (default), “differential” or “algebraic”.

  • “thermal”str

    Sets the thermal model to use. Can be “isothermal” (default), “lumped”, “x-lumped”, or “x-full”.

  • “total interfacial current density as a state”str

    Whether to make a state for the total interfacial current density and solve an algebraic equation for it. Default is “false”, unless “SEI film resistance” is distributed in which case it is automatically set to “true”.

  • “working electrode”: str

    Which electrode(s) intercalates and which is counter. If “both” (default), the model is a standard battery. Otherwise can be “negative” or “positive” to indicate a half-cell model.

Type

dict

\*\*Extends
Type

** dict

print_detailed_options()[source]

Print the docstring for Options

print_options()[source]

Print the possible options with the ones currently selected