bmlite.SPM.domains#

Contains classes to construct the battery for SPM simulations. Each class reads in keyword arguments that define parameters relevant to its specific domain. For example, the area and temperature are Battery level parameters because they are the same everywhere, but the discretization Nr may be different for the anode and cathode domains.

Classes#

Battery

A class for battery-level attributes.

Electrode

A class for the electrode-specific attributes and methods.

Electrolyte

A class for the electrolyte attributes and methods.

Module Contents#

class bmlite.SPM.domains.Battery(**kwargs)[source]#

A class for battery-level attributes.

Parameters:

**kwargs (dict, required) –

Keyword arguments to set the battery-level attributes. The required keys and descriptions are given below:

Key

Description [units] (type)

cap

nominal battery capacity [A*h] (float)

temp

temperature [K] (float)

area

area normal to the current collectors [m2] (float)

update()[source]#

Updates any secondary/dependent parameters. At present, this method does not do anything for the Battery class.

class bmlite.SPM.domains.Electrode(name, **kwargs)[source]#

A class for the electrode-specific attributes and methods.

This class is used to build both the anode and cathode for P2D simulations.

Parameters:
  • name (str) – Name of the electrode, must be either ‘anode’ or ‘cathode’.

  • **kwargs (dict, required) –

    Keyword arguments to set the electrode attributes. The required keys and descriptions are given below:

    Key

    Description [units] (type)

    Nr

    number of r discretizations [-] (int)

    thick

    electrode thickness [m] (float)

    R_s

    represenatative particle radius [m] (float)

    eps_el

    electrolyte volume fraction [-] (float)

    eps_CBD

    carbon binder domain volume fraction [-] (float)

    eps_void

    Void volume fraction [-] (float)

    alpha_a

    Butler-Volmer anodic symmetry factor [-] (float)

    alpha_c

    Butler-Volmer cathodic symmetry factor [-] (float)

    Li_max

    max solid-phase Li concentration [kmol/m3] (float)

    x_0

    initial solid Li intercalation fraction [-] (float)

    i0_deg

    i0 degradation factor [-] (float)

    Ds_deg

    Ds degradation factor [-] (float)

    material

    class name from bmlite.materials [-] (str)

    csvfile

    path to CSV file with OCV data (optional) (str)

    submodels

    submodels classes to include (dict[dict])

get_Ds(x, T, fluxdir)[source]#

Calculate the lithium diffusivity in the solid phase given the local intercalation fraction x and temperature T.

Parameters:
  • x (float | 1D array) – Lithium intercalation fraction [-].

  • T (float) – Battery temperature [K].

  • fluxdir (float) – Lithiation direction: +1 for lithiation, -1 for delithiation, 0 for rest. Used for direction-dependent parameters. Ensure the zero case is handled explicitly or via a default (lithiating or delithiating).

Returns:

Ds (float | 1D array) – Lithium diffusivity in the solid phase [m2/s].

get_Eeq(x)[source]#

Calculate the equilibrium potential given the surface intercalation fraction x at the particle surface.

Parameters:

x (float) – Lithium intercalation fraction at r = R_s [-].

Returns:

Eeq (float) – Equilibrium potential [V].

get_Mhyst(x)[source]#

Calculate the hysteresis magnitude given the surface intercalation fraction x at the particle surface.

Parameters:

x (float | 1D array) – Lithium intercalation fraction at r = R_s [-].

Returns:

M_hyst (float | 1D array) – Hysteresis magnitude [V].

get_i0(x, C_Li, T, fluxdir)[source]#

Calculate the exchange current density given the surface intercalation fraction x at the particle surface, the local lithium ion concentration C_Li, and temperature T.

Parameters:
  • x (float) – Lithium intercalation fraction at r = R_s [-].

  • C_Li (float) – Lithium ion concentration in the local electrolyte [kmol/m3].

  • T (float) – Battery temperature [K].

  • fluxdir (float) – Lithiation direction: +1 for lithiation, -1 for delithiation, 0 for rest. Used for direction-dependent parameters. Ensure the zero case is handled explicitly or via a default (lithiating or delithiating).

Returns:

i0 (float) – Exchange current density [A/m2].

make_mesh(pshift=0)[source]#

Determines/sets the r locations for all of the “minus” interfaces rm, “plus” interfaces rp, and control volume centers r based on the representative particle radius and Nr discretization. At present, only a uniform mesh is supported.

Parameters:

pshift (int, optional)

See also

batmods.mesh.r_ptr, batmods.mesh.uniform_mesh

update()[source]#

Updates any secondary/dependent parameters. For the Electrode class, this initializes the material class, and sets the following:

  • Void-phase volume fraction [-]:

    eps_void = 1 - eps_s - eps_el

  • Activate material volume fraction [-]:

    eps_AM = eps_s - eps_CBD

  • Specific particle surface area [m2/m3]:

    A_s = 3 * eps_AM / R_s

class bmlite.SPM.domains.Electrolyte(**kwargs)[source]#

A class for the electrolyte attributes and methods.

Parameters:

**kwargs (dict, required) –

Keyword arguments to set the electrolyte attributes. The required keys and descriptions are given below:

Key

Description [units] (type)

li_0

initial Li+ concentration [kmol/m3] (float)

update()[source]#

Updates any secondary/dependent parameters. At present, this method does not do anything for the Electrolyte class.