![]() |
SLIDE
3.0.0
A simulator for lithium-ion battery pack degradation
|
#include <Battery.hpp>
Public Member Functions | |
Battery () | |
Battery (std::string IDi) | |
void | setModule (Deep_ptr< Module > &&module) |
void | setSeriesandParallel (unsigned int ser, unsigned int par) |
basic getters and setters More... | |
double | Cap () const override |
double | Vmin () const override |
lower voltage limit of the cell More... | |
double | VMIN () const override |
safety cut off More... | |
double | Vmax () const override |
upper voltage limit of the cell More... | |
double | VMAX () const override |
safety cut off More... | |
double | I () const override |
double | getRtot () override |
size_t | getNcells () override |
return the number of single cells connected to this SU More... | |
Module * | getCells () |
int getNstates() { return cells->getNstates() + 1; } //!< +1 for the temperature of this battery More... | |
void | getStates (getStates_t &s) override |
returns one long array with the states More... | |
void | setBlockDegAndTherm (bool block) |
Status | setCurrent (double Inew, bool checkV=true, bool print=true) override |
Status | setStates (setStates_t s, bool checkStates=true, bool print=true) override |
opposite of getStates, check the states are valid? More... | |
double | getAndResetConvLosses () |
double | getConvLosses_total () |
void | resetConvLosses () |
voltage More... | |
double | getOCV () override |
double | V () override |
print is an optional argument More... | |
Status | checkVoltage (double &v, bool print) noexcept override |
get the voltage and check if it is valid More... | |
double | getVhigh () override |
return the voltage of the cell with the highest voltage More... | |
double | getVlow () override |
return the voltage of the cell with the lowest voltage More... | |
double | T () override |
double | getThotSpot () override |
the T of the hottest element in the SU More... | |
double | getThermalSurface () override |
return the 'A' for the thermal model of this SU (Q = hA*dT) More... | |
double | thermalModel (int Nneighb, double Tneighb[], double Kneighb[], double Aneighb[], double tim) override |
calculate the thermal model of this SU More... | |
void | setT (double Tnew) override |
functionality More... | |
auto * | getCoolSystem () |
double | getCoolingLoad () |
return the energy required to run the entire coolingsystem of this module and all its children More... | |
bool | validStates (bool print=true) override |
checks if a state array is valid More... | |
void | timeStep_CC (double dt, int steps=1) override |
take a number of time steps More... | |
void | storeData () override |
void | writeData (const std::string &prefix) override |
Battery * | copy () override |
copy this SU to a new object More... | |
![]() | |
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 StorageUnit * | copy ()=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 Attributes | |
Deep_ptr< Module > | cells {} |
Module with the cells of this battery. More... | |
Deep_ptr< CoolSystem_HVAC > | cool {} |
HVAC system of the battery. More... | |
Converter | conv {} |
power electronic converter. Dual step DC/DC and DC/AC More... | |
unsigned int | nseries { 1 } |
unsigned int | nparallel { 1 } |
number of series/parallel 'copies' of this module More... | |
double | convlosses {} |
losses in the converter during a given period (set to 0 by reset_convlosses) More... | |
double | convlosses_tot {} |
total cumulative losses in the converter during the entire lifetime More... | |
![]() | |
std::string | ID { "StorageUnit" } |
identification string More... | |
StorageUnit * | parent { 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 | |
![]() | |
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 > |
![]() | |
virtual size_t | calculateNcells () |
slide::Battery::Battery | ( | ) |
slide::Battery::Battery | ( | std::string | IDi | ) |
|
inlineoverridevirtual |
|
overridevirtualnoexcept |
get the voltage and check if it is valid
Implements slide::StorageUnit.
|
inlineoverridevirtual |
copy this SU to a new object
Implements slide::StorageUnit.
double slide::Battery::getAndResetConvLosses | ( | ) |
|
inline |
int getNstates() { return cells->getNstates() + 1; } //!< +1 for the temperature of this battery
|
inline |
double slide::Battery::getCoolingLoad | ( | ) |
return the energy required to run the entire coolingsystem of this module and all its children
functionality
< heat of the coolsystem of this battery
< energy to run coolsystem of this module
< reset to 0
< coolsystem of child cells
|
inline |
|
inlineoverridevirtual |
return the number of single cells connected to this SU
Implements slide::StorageUnit.
|
inlineoverridevirtual |
Implements slide::StorageUnit.
|
inlineoverridevirtual |
Implements slide::StorageUnit.
|
override |
returns one long array with the states
< States of the cells and the temperature of the battery
|
inlineoverridevirtual |
return the 'A' for the thermal model of this SU (Q = hA*dT)
Implements slide::StorageUnit.
|
inlineoverridevirtual |
the T of the hottest element in the SU
Implements slide::StorageUnit.
|
inlineoverridevirtual |
return the voltage of the cell with the highest voltage
Implements slide::StorageUnit.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
inline |
voltage
void slide::Battery::setBlockDegAndTherm | ( | bool | block | ) |
|
inlineoverridevirtual |
Implements slide::StorageUnit.
< check the Module is compatible has no parent yet does not have an HVAC cool system
< set the parent of the module to this
< make HVAC coolsystem
< idle losses of the converter (due to switching and others)
< Scale the power electronic converter correspondingly
void slide::Battery::setSeriesandParallel | ( | unsigned int | ser, |
unsigned int | par | ||
) |
basic getters and setters
|
overridevirtual |
opposite of getStates, check the states are valid?
< #TODO probably here we need to check?
Implements slide::StorageUnit.
|
inlineoverridevirtual |
|
overridevirtual |
< Store data of the cells and the cooling system
< store local data
Implements slide::StorageUnit.
|
inlineoverridevirtual |
|
overridevirtual |
calculate the thermal model of this SU
< Calculate the model of the cells, the battery's HVAC coolsystem will cool the cells
< The battery heats up from cooling all cells
< cooling energy extracted from the children
< double Qcells = Echildren;
< and from the losses in the converter
< there are no neighbours or parents, so ignore inputs
< update the battery temperature
< cout<<"Battery thermal balance: Qcells = "<<Qcells<<", converter "<<conv->getLosses(cells->V(), cells->I())*tim<<" resutling in new T "<<Tbatt<<" for battery power "<<cells->V()*cells->I()<<endl;
< Check the new temperature is valid
< #TODO -> 75.0 is magical number.
Implements slide::StorageUnit.
|
overridevirtual |
take a number of time steps
Data collection of cycling data (I, V, T, etc. for every cell)
< integrate in time for the cells
< increase the losses from the converter
< losses [J] during this period
< Calculate the thermal model
< Call the thermal model without heat exchanges with neighbours or parents (since this module doesn't have any)
< Make the arrays even though they will not be used (length should be 0 but I don't think you can make an array of length 0)
< the 0 signals there are no neighbours or parents
< data storage
Implements slide::StorageUnit.
|
inlineoverridevirtual |
print is an optional argument
Implements slide::StorageUnit.
|
inlineoverridevirtual |
checks if a state array is valid
Implements slide::StorageUnit.
|
inlineoverridevirtual |
upper voltage limit of the cell
Implements slide::StorageUnit.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
lower voltage limit of the cell
Implements slide::StorageUnit.
|
inlineoverridevirtual |
safety cut off
Implements slide::StorageUnit.
|
overridevirtual |
< Write data for the cooling system DATASTORE_COOL > 0
< write data for the cells
< write local data
Implements slide::StorageUnit.
|
protected |
power electronic converter. Dual step DC/DC and DC/AC
|
protected |
losses in the converter during a given period (set to 0 by reset_convlosses)
|
protected |
total cumulative losses in the converter during the entire lifetime
|
protected |
HVAC system of the battery.
|
protected |
number of series/parallel 'copies' of this module
|
protected |