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

#include <StorageUnit.hpp>

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

Public Member Functions

 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
 

Protected Types

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

virtual size_t calculateNcells ()
 

Protected Attributes

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...
 

Member Typedef Documentation

◆ getStates_t

using slide::StorageUnit::getStates_t = std::vector<double> &
protected

To pass states to save, expandable container.

◆ setStates_t

using slide::StorageUnit::setStates_t = std::span<double> &
protected

To pass states to read, non-expandable container.

◆ viewStates_t

using slide::StorageUnit::viewStates_t = std::span<double>
protected

Constructor & Destructor Documentation

◆ StorageUnit() [1/3]

slide::StorageUnit::StorageUnit ( )
default

< basic getters and setters

◆ StorageUnit() [2/3]

slide::StorageUnit::StorageUnit ( std::string_view  ID_)
inline

◆ StorageUnit() [3/3]

slide::StorageUnit::StorageUnit ( std::string_view  ID_,
StorageUnit parent_,
bool  blockDegAndTherm_ 
)
inline

◆ ~StorageUnit()

virtual slide::StorageUnit::~StorageUnit ( )
virtualdefault

Member Function Documentation

◆ backupStates()

virtual void slide::StorageUnit::backupStates ( )
inlinevirtual

Back-up states.

◆ calculateNcells()

virtual size_t slide::StorageUnit::calculateNcells ( )
inlineprotectedvirtual

Reimplemented in slide::Module.

◆ Cap()

virtual double slide::StorageUnit::Cap ( ) const
pure virtual

Implemented in slide::Cell, slide::Module_p, slide::Module_s, and slide::Battery.

Here is the caller graph for this function:

◆ checkVoltage()

virtual Status slide::StorageUnit::checkVoltage ( double &  v,
bool  print 
)
pure virtualnoexcept

get the voltage and check if it is valid

Implemented in slide::Cell, slide::Module, and slide::Battery.

Here is the caller graph for this function:

◆ copy()

virtual StorageUnit * slide::StorageUnit::copy ( )
pure virtual

◆ getFullID()

virtual std::string slide::StorageUnit::getFullID ( )
inlinevirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getID()

const std::string & slide::StorageUnit::getID ( )
inline
Here is the caller graph for this function:

◆ getNcells()

virtual size_t slide::StorageUnit::getNcells ( )
pure virtual

return the number of single cells connected to this SU

Implemented in slide::Module, slide::Battery, and slide::Cell.

◆ getOCV()

virtual double slide::StorageUnit::getOCV ( )
pure virtual

◆ getParent()

auto * slide::StorageUnit::getParent ( )
inline
Here is the caller graph for this function:

◆ getRtot()

virtual double slide::StorageUnit::getRtot ( )
pure virtual

◆ getStates()

virtual void slide::StorageUnit::getStates ( getStates_t  s)
pure virtual

returns one long array with the states

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

Here is the caller graph for this function:

◆ getThermalSurface()

virtual double slide::StorageUnit::getThermalSurface ( )
pure virtual

return the 'A' for the thermal model of this SU (Q = hA*dT)

Implemented in slide::Cell_ECM< N_RC >, slide::Cell_SPM, slide::Module, and slide::Battery.

◆ getThotSpot()

virtual double slide::StorageUnit::getThotSpot ( )
pure virtual

the T of the hottest element in the SU

Implemented in slide::Cell, slide::Cell_ECM< N_RC >, slide::Module, and slide::Battery.

Here is the caller graph for this function:

◆ getVhigh()

virtual double slide::StorageUnit::getVhigh ( )
pure virtual

return the voltage of the cell with the highest voltage

Implemented in slide::Cell, slide::Module, and slide::Battery.

◆ getVlow()

virtual double slide::StorageUnit::getVlow ( )
pure virtual

return the voltage of the cell with the lowest voltage

Implemented in slide::Cell, slide::Module, and slide::Battery.

Here is the caller graph for this function:

◆ I()

virtual double slide::StorageUnit::I ( ) const
pure virtual

Implemented in slide::Cell_ECM< N_RC >, slide::Cell_SPM, slide::Module_p, slide::Module_s, and slide::Battery.

Here is the caller graph for this function:

◆ isCharging()

bool slide::StorageUnit::isCharging ( )
inline

negative means charge.

Here is the call graph for this function:

◆ isDischarging()

bool slide::StorageUnit::isDischarging ( )
inline

positive means discharge.

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

◆ restoreStates()

virtual void slide::StorageUnit::restoreStates ( )
inlinevirtual

restore backed-up states.

virtual int getNstates() = 0; virtual double SOC() = 0; voltage

◆ setBlockDegAndTherm()

void slide::StorageUnit::setBlockDegAndTherm ( bool  block)
inline
Here is the caller graph for this function:

◆ setCurrent()

virtual Status slide::StorageUnit::setCurrent ( double  Inew,
bool  checkV = true,
bool  print = true 
)
pure virtual

Implemented in slide::Cell_ECM< N_RC >, slide::Cell_SPM, slide::Module_p, slide::Module_s, and slide::Battery.

Here is the caller graph for this function:

◆ setID()

void slide::StorageUnit::setID ( std::string  IDi)
inline

Return the full ID string, including the ID of the parent module.

◆ setParent()

virtual void slide::StorageUnit::setParent ( StorageUnit p)
inlinevirtual

set the parent

◆ setStates()

virtual Status slide::StorageUnit::setStates ( setStates_t  s,
bool  checkStates = true,
bool  print = true 
)
pure virtual

opposite of getStates, check the states are valid?

Implemented in slide::Cell_ECM< N_RC >, slide::Battery, slide::Module, and slide::Cell_SPM.

Here is the caller graph for this function:

◆ setT()

virtual void slide::StorageUnit::setT ( double  Tnew)
pure virtual

◆ setVoltage()

virtual Status slide::StorageUnit::setVoltage ( double  Vnew,
bool  checkI = true,
bool  print = true 
)
inlinevirtual

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

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

◆ storeData()

virtual void slide::StorageUnit::storeData ( )
pure virtual

Implemented in slide::Cell, slide::Module, and slide::Battery.

Here is the caller graph for this function:

◆ T()

virtual double slide::StorageUnit::T ( )
pure virtual

Implemented in slide::Cell_SPM, slide::Cell_ECM< N_RC >, slide::Module, and slide::Battery.

Here is the caller graph for this function:

◆ thermalModel()

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

calculate the thermal model of this SU

Implemented in slide::Cell, slide::Cell_SPM, slide::Battery, and slide::Module.

◆ timeStep_CC()

virtual void slide::StorageUnit::timeStep_CC ( double  dt,
int  steps = 1 
)
pure virtual

take a number of time steps

Data collection of cycling data (I, V, T, etc. for every cell)

Implemented in slide::Cell_ECM< N_RC >, slide::Cell_SPM, slide::Module_p, slide::Module_s, and slide::Battery.

Here is the caller graph for this function:

◆ V()

virtual double slide::StorageUnit::V ( )
pure virtual

print is an optional argument

Implemented in slide::Cell_ECM< N_RC >, slide::Cell_SPM, slide::Module_p, slide::Module_s, and slide::Battery.

Here is the caller graph for this function:

◆ validStates()

virtual bool slide::StorageUnit::validStates ( bool  print = true)
pure virtual

checks if a state array is valid

Implemented in slide::Cell_ECM< N_RC >, slide::Cell_SPM, slide::Module, and slide::Battery.

◆ viewStates()

virtual viewStates_t slide::StorageUnit::viewStates ( )
inlinevirtual

Only for cells to see individual states.

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

◆ Vmax()

virtual double slide::StorageUnit::Vmax ( ) const
pure virtual

upper voltage limit of the cell

Implemented in slide::Cell, slide::Module_p, slide::Module_s, and slide::Battery.

Here is the caller graph for this function:

◆ VMAX()

virtual double slide::StorageUnit::VMAX ( ) const
pure virtual

safety cut off

thermal model

Implemented in slide::Cell, slide::Module_p, slide::Module_s, and slide::Battery.

Here is the caller graph for this function:

◆ Vmin()

virtual double slide::StorageUnit::Vmin ( ) const
pure virtual

lower voltage limit of the cell

Implemented in slide::Cell, slide::Module_p, slide::Module_s, and slide::Battery.

Here is the caller graph for this function:

◆ VMIN()

virtual double slide::StorageUnit::VMIN ( ) const
pure virtual

safety cut off

Implemented in slide::Cell, slide::Module_p, slide::Module_s, and slide::Battery.

Here is the caller graph for this function:

◆ writeData()

virtual void slide::StorageUnit::writeData ( const std::string &  prefix)
pure virtual

Implemented in slide::Cell, slide::Module, and slide::Battery.

Here is the caller graph for this function:

Member Data Documentation

◆ blockDegAndTherm

bool slide::StorageUnit::blockDegAndTherm { false }
protected

if true, degradation and the thermal ODE are ignored

◆ ID

std::string slide::StorageUnit::ID { "StorageUnit" }
protected

identification string

◆ parent

StorageUnit* slide::StorageUnit::parent { nullptr }
protected

pointer to the SU 'above' this one [e.g. the module to which a cell is connected]


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