SLIDE  3.0.0
A simulator for lithium-ion battery pack degradation
Loading...
Searching...
No Matches
slide::Cell Class Referenceabstract

Abstract Class representing a single battery cell. More...

#include <Cell.hpp>

Inheritance diagram for slide::Cell:
[legend]
Collaboration diagram for slide::Cell:
[legend]

Public Member Functions

 Cell ()
 
 Cell (const std::string &ID_)
 
virtual ~Cell ()=default
 
double Cap () const final override
 
void setCapacity (double capacity)
 
constexpr double Vmin () const override
 lower voltage limit of the cell More...
 
constexpr double VMIN () const override
 safety cut off More...
 
constexpr double VMAX () const override
 safety cut off More...
 
constexpr double Vmax () const override
 upper voltage limit of the cell More...
 
constexpr double Tmax ()
 
constexpr double Tmin ()
 
double getVhigh () final
 return the voltage of the cell with the highest voltage More...
 
double getVlow () final
 return the voltage of the cell with the lowest voltage More...
 
virtual Status setSOC (double SOCnew, bool checkV=true, bool print=true)=0
 
virtual double SOC ()=0
 
virtual double getThotSpot () override
 the T of the hottest element in the SU More...
 
size_t getNcells () override final
 this is a single cell More...
 
virtual Status checkCurrent (bool checkV, bool print) noexcept
 
virtual Status checkVoltage (double &v, bool print) noexcept override
 Check the voltage status of the cell. More...
 
virtual double thermalModel (int Nneighb, double Tneighb[], double Kneighb[], double Aneighb[], double tim) override
 Calculate the thermal model of the cell. More...
 
virtual void storeData () override
 Add another data point in the array. More...
 
virtual void writeData (const std::string &prefix) override
 
virtual ThroughputData getThroughputs ()
 
virtual std::array< double, 4 > getVariations () const noexcept
 
- Public Member Functions inherited from slide::StorageUnit
 StorageUnit ()=default
 < basic getters and setters More...
 
 StorageUnit (std::string_view ID_)
 
 StorageUnit (std::string_view ID_, StorageUnit *parent_, bool blockDegAndTherm_)
 
virtual ~StorageUnit ()=default
 
const std::string & getID ()
 
void setID (std::string IDi)
 Return the full ID string, including the ID of the parent module. More...
 
virtual std::string getFullID ()
 
virtual double Cap () const =0
 
auto * getParent ()
 
virtual double I () const =0
 
virtual double getRtot ()=0
 
virtual size_t getNcells ()=0
 return the number of single cells connected to this SU More...
 
bool isCharging ()
 negative means charge. More...
 
bool isDischarging ()
 positive means discharge. More...
 
virtual void getStates (getStates_t s)=0
 returns one long array with the states More...
 
virtual viewStates_t viewStates ()
 Only for cells to see individual states. More...
 
void setBlockDegAndTherm (bool block)
 
virtual void setParent (StorageUnit *p)
 set the parent More...
 
virtual Status setCurrent (double Inew, bool checkV=true, bool print=true)=0
 
virtual Status setVoltage (double Vnew, bool checkI=true, bool print=true)
 
virtual Status setStates (setStates_t s, bool checkStates=true, bool print=true)=0
 opposite of getStates, check the states are valid? More...
 
virtual void backupStates ()
 Back-up states. More...
 
virtual void restoreStates ()
 restore backed-up states. More...
 
virtual double getOCV ()=0
 
virtual double V ()=0
 print is an optional argument More...
 
virtual Status checkVoltage (double &v, bool print) noexcept=0
 get the voltage and check if it is valid More...
 
virtual double getVhigh ()=0
 return the voltage of the cell with the highest voltage More...
 
virtual double getVlow ()=0
 return the voltage of the cell with the lowest voltage More...
 
virtual double Vmin () const =0
 lower voltage limit of the cell More...
 
virtual double VMIN () const =0
 safety cut off More...
 
virtual double Vmax () const =0
 upper voltage limit of the cell More...
 
virtual double VMAX () const =0
 safety cut off More...
 
virtual double T ()=0
 
virtual double getThotSpot ()=0
 the T of the hottest element in the SU More...
 
virtual double getThermalSurface ()=0
 return the 'A' for the thermal model of this SU (Q = hA*dT) More...
 
virtual double thermalModel (int Nneighb, double Tneighb[], double Kneighb[], double Aneighb[], double tim)=0
 calculate the thermal model of this SU More...
 
virtual void setT (double Tnew)=0
 functionality More...
 
virtual bool validStates (bool print=true)=0
 checks if a state array is valid More...
 
virtual StorageUnitcopy ()=0
 copy this SU to a new object More...
 
virtual void timeStep_CC (double dt, int steps=1)=0
 take a number of time steps More...
 
virtual void storeData ()=0
 
virtual void writeData (const std::string &prefix)=0
 

Static Public Attributes

static constexpr CellLimits limits { defaultCellLimits }
 

Protected Attributes

double capNom { 16 }
 capacity [Ah]. More...
 
CellData< settings::DATASTORE_CELLcellData
 Cell data storage. More...
 
- Protected Attributes inherited from slide::StorageUnit
std::string ID { "StorageUnit" }
 identification string More...
 
StorageUnitparent { nullptr }
 pointer to the SU 'above' this one [e.g. the module to which a cell is connected] More...
 
bool blockDegAndTherm { false }
 if true, degradation and the thermal ODE are ignored More...
 

Additional Inherited Members

- Protected Types inherited from slide::StorageUnit
using setStates_t = std::span< double > &
 To pass states to read, non-expandable container. More...
 
using getStates_t = std::vector< double > &
 To pass states to save, expandable container. More...
 
using viewStates_t = std::span< double >
 
- Protected Member Functions inherited from slide::StorageUnit
virtual size_t calculateNcells ()
 

Detailed Description

Abstract Class representing a single battery cell.

Constructor & Destructor Documentation

◆ Cell() [1/2]

slide::Cell::Cell ( )
inline

◆ Cell() [2/2]

slide::Cell::Cell ( const std::string &  ID_)
inline

◆ ~Cell()

virtual slide::Cell::~Cell ( )
virtualdefault

Member Function Documentation

◆ Cap()

double slide::Cell::Cap ( ) const
inlinefinaloverridevirtual

Implements slide::StorageUnit.

Here is the caller graph for this function:

◆ checkCurrent()

virtual Status slide::Cell::checkCurrent ( bool  checkV,
bool  print 
)
inlinevirtualnoexcept

< #TODO Current checking part is missing!

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkVoltage()

virtual Status slide::Cell::checkVoltage ( double &  v,
bool  print 
)
inlineoverridevirtualnoexcept

Check the voltage status of the cell.

Parameters
vReference to the voltage value.
printBoolean flag to indicate whether to print the result or not.
Returns
Status of the voltage check. thermal model virtual double getThermalSurface() = 0; //!< todo not implemented

Implements slide::StorageUnit.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNcells()

size_t slide::Cell::getNcells ( )
inlinefinaloverridevirtual

this is a single cell

Implements slide::StorageUnit.

◆ getThotSpot()

virtual double slide::Cell::getThotSpot ( )
inlineoverridevirtual

the T of the hottest element in the SU

Implements slide::StorageUnit.

Reimplemented in slide::Cell_ECM< N_RC >.

Here is the call graph for this function:

◆ getThroughputs()

virtual ThroughputData slide::Cell::getThroughputs ( )
inlinevirtual

Reimplemented in slide::Cell_ECM< N_RC >, and slide::Cell_SPM.

◆ getVariations()

virtual std::array< double, 4 > slide::Cell::getVariations ( ) const
inlinevirtualnoexcept

Reimplemented in slide::Cell_SPM.

◆ getVhigh()

double slide::Cell::getVhigh ( )
inlinefinalvirtual

return the voltage of the cell with the highest voltage

Implements slide::StorageUnit.

Here is the call graph for this function:

◆ getVlow()

double slide::Cell::getVlow ( )
inlinefinalvirtual

return the voltage of the cell with the lowest voltage

Implements slide::StorageUnit.

Here is the call graph for this function:

◆ setCapacity()

void slide::Cell::setCapacity ( double  capacity)
inline
Here is the caller graph for this function:

◆ setSOC()

virtual Status slide::Cell::setSOC ( double  SOCnew,
bool  checkV = true,
bool  print = true 
)
pure virtual

◆ SOC()

virtual double slide::Cell::SOC ( )
pure virtual

◆ storeData()

virtual void slide::Cell::storeData ( )
inlineoverridevirtual

Add another data point in the array.

Implements slide::StorageUnit.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ thermalModel()

virtual double slide::Cell::thermalModel ( int  Nneighb,
double  Tneighb[],
double  Kneighb[],
double  Aneighb[],
double  tim 
)
inlineoverridevirtual

Calculate the thermal model of the cell.

Parameters
NneighbNumber of neighboring cells.
TneighbPointer to an array of neighboring cells' temperatures.
KneighbPointer to an array of neighboring cells' thermal conductivities.
AneighbPointer to an array of neighboring cells' contact areas.
timTime duration for the thermal model calculation.
Returns
Cell temperature after thermal model calculation.
Note
The thermal model is not implemented yet. Requires something similar to an SPM cell (keep track of heat generation and time) and then solve the ODE here. dataStorage

Implements slide::StorageUnit.

Reimplemented in slide::Cell_SPM.

Here is the call graph for this function:

◆ Tmax()

constexpr double slide::Cell::Tmax ( )
inlineconstexpr
Here is the caller graph for this function:

◆ Tmin()

constexpr double slide::Cell::Tmin ( )
inlineconstexpr
Here is the caller graph for this function:

◆ VMAX()

constexpr double slide::Cell::VMAX ( ) const
inlineconstexproverridevirtual

safety cut off

thermal model

Implements slide::StorageUnit.

◆ Vmax()

constexpr double slide::Cell::Vmax ( ) const
inlineconstexproverridevirtual

upper voltage limit of the cell

Implements slide::StorageUnit.

Here is the caller graph for this function:

◆ Vmin()

constexpr double slide::Cell::Vmin ( ) const
inlineconstexproverridevirtual

lower voltage limit of the cell

Implements slide::StorageUnit.

Here is the caller graph for this function:

◆ VMIN()

constexpr double slide::Cell::VMIN ( ) const
inlineconstexproverridevirtual

safety cut off

Implements slide::StorageUnit.

◆ writeData()

virtual void slide::Cell::writeData ( const std::string &  prefix)
inlineoverridevirtual

Implements slide::StorageUnit.

Here is the call graph for this function:

Member Data Documentation

◆ capNom

double slide::Cell::capNom { 16 }
protected

capacity [Ah].

◆ cellData

CellData<settings::DATASTORE_CELL> slide::Cell::cellData
protected

Cell data storage.

◆ limits

constexpr CellLimits slide::Cell::limits { defaultCellLimits }
staticconstexpr

The documentation for this class was generated from the following file: