PyBaMM uses the Finite Volume Method (FVM) to convert systems of partial differential equations (PDEs) into systems of ordinary differential equations (ODEs) and differential algebraic equations (DAEs).Documentation Index
Fetch the complete documentation index at: https://docs.ionworks.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The FVM discretizes the domain into a series of “volumes” and tracks the average value of each state variable across each volume.Flux Calculation
Fluxes at each interface are calculated via the central difference method. For the interface at , the flux is given by: where is the harmonic mean of and .We use the harmonic mean to find the values of transport properties at interfaces, and the arithmetic mean for other properties.
Rate of Change
The rate of change of is calculated by taking the boundary integral of the fluxes in and out of each volume: For the 1D case, this simplifies to:Extrapolation and Boundary Values
One important consequence of using the finite volume method is that we do not directly calculate the value of state variables at the boundaries of the domain. For example, when simulating a battery, we do not directly calculate the potential of the positive electrode at the current collector (i.e., the terminal voltage of the cell). Instead, we must extrapolate from the nearest volume.Extrapolation Methods
Constant
Uses the value from the nearest volume directly
Linear
Linearly extrapolates from the two volumes nearest the boundary (default in PyBaMM)
Quadratic
Fits a quadratic polynomial to the three volumes nearest the boundary
- The steepness of the state variable near the boundary
- The size of the mesh