![]() |
SLIDE
3.0.0
A simulator for lithium-ion battery pack degradation
|
#include <Module_s.hpp>
Public Member Functions | |
Module_s () | |
note this constructor should never be used. It can't determine which coolsystem to use More... | |
Module_s (std::string_view ID_, double Ti, bool print, bool pari, int Ncells_, int coolControl, int cooltype) | |
Module_s(std::string_view IDi, bool pari, int Ncells, std::unique_ptr<CoolSystem> &&cool_); #TODO. More... | |
double | Vmin () const override |
SUM all SUs' Vmin. More... | |
double | VMIN () const override |
SUM all SUs' VMIN. More... | |
double | Vmax () const override |
SUM all SUs' Vmax. More... | |
double | VMAX () const override |
SUM all SUs' VMAX. More... | |
double | I () const override |
the current is the same in all cells, so we can use first value. Return zero if SUs empty. More... | |
double | Cap () const override |
module capacity is the capacity of the smallest cell More... | |
double | getOCV () override |
module voltage (sum of cells), print is an optional argument More... | |
double | getRtot () override |
double | V () override |
module voltage (sum of cells), print is an optional argument More... | |
Status | setCurrent (double Inew, bool checkV=true, bool print=true) override |
set a module current More... | |
void | timeStep_CC (double dt, int steps=1) override |
take a number of time steps More... | |
Module_s * | copy () override |
copy this SU to a new object More... | |
![]() | |
Module () | |
Module (std::string_view ID_) | |
Module (std::string_view ID_, double Ti, bool print, bool pari, int Ncells, int coolControl, int cooltype) | |
Module (std::string_view ID_, double Ti, bool print, bool pari, int Ncells, CoolSystem_t &&coolControlPtr, int cooltype) | |
common implementation for all base-modules More... | |
size_t | getNSUs () |
note that these child-SUs can be modules themselves (or they can be cells) More... | |
SUs_t & | getSUs () |
const auto & | operator[] (size_t i) const |
auto & | operator[] (size_t i) |
virtual 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... | |
void | getStates (getStates_t &s) override |
returns one long array with the states: getStates-array of each cell followed by the states of the module (Tmod) More... | |
virtual bool | validStates (bool print=true) override |
check if a state-array is valid for this module (uses setStates) More... | |
virtual Status | setStates (setStates_t s, bool checkV=true, bool print=true) override |
thermal model More... | |
double | T () override |
get the temperature of this module More... | |
double | getThermalSurface () override |
return the 'A' for the thermal model of this SU (Q = hA*dT) More... | |
double | getCoolingLoad () |
return the energy required to run the entire coolingsystem of this module and all its children More... | |
double | thermalModel (int Nneighbours, double Tneighbours[], double Kneighbours[], double Aneighb[], double tim) override |
calculate the thermal model of this SU More... | |
virtual void | setSUs (SUs_span_t c, bool checkCells=true, bool print=true) |
CoolSystem * | getCoolSystem () |
void | setRcontact (std::span< double > Rc) |
virtual Module * | copy () override=0 |
copy this SU to a new object More... | |
void | storeData () override |
void | writeData (const std::string &prefix) override |
void | setBlockDegAndTherm (bool block) |
void | setT (double Tnew) override |
set a module temperature More... | |
size_t | getNcells () override |
double | getThotSpot () override |
< get the maximum temperature of the cells or the module 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 |
Additional Inherited Members | |
![]() | |
using | SU_t = Deep_ptr< StorageUnit > |
< connected child SUs More... | |
using | SUs_t = std::vector< SU_t > |
using | SUs_span_t = std::span< SU_t > |
using | CoolSystem_t = Deep_ptr< CoolSystem > |
![]() | |
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 > |
![]() | |
size_t | calculateNcells () override |
double | thermalModel_cell () |
double | thermalModel_coupled (int Nneighbours, double Tneighbours[], double Kneighbours[], double Aneighb[], double tim) |
virtual size_t | calculateNcells () |
![]() | |
SUs_t | SUs |
std::vector< double > | Rcontact |
array with the contact resistance for cell i More... | |
CoolSystem_t | cool { nullptr } |
cooling system of this module //!< make<CoolSystem>(settings::MODULE_NSUs_MAX, 1); More... | |
ModuleThermalParam | therm |
voltage More... | |
size_t | Ncells |
Number of cells this module contains. More... | |
double | Vmodule { 0 } |
voltage of the module More... | |
bool | Vmodule_valid { false } |
boolean indicating if stored the voltage of the module is valid More... | |
bool | par { true } |
State< 0, settings::data::N_CumulativeModule > | st_module |
std::vector< double > | data |
Time data. 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... | |
|
inline |
note this constructor should never be used. It can't determine which coolsystem to use
|
inline |
Module_s(std::string_view IDi, bool pari, int Ncells, std::unique_ptr<CoolSystem> &&cool_); #TODO.
functions from Module_base
|
inlineoverridevirtual |
module capacity is the capacity of the smallest cell
Implements slide::StorageUnit.
|
inlineoverridevirtual |
copy this SU to a new object
Implements slide::Module.
|
overridevirtual |
module voltage (sum of cells), print is an optional argument
< sum of the open circuit voltage of all cells
< print if the (global) verbose-setting is above the threshold
Implements slide::StorageUnit.
|
overridevirtual |
Implements slide::StorageUnit.
|
inlineoverridevirtual |
the current is the same in all cells, so we can use first value. Return zero if SUs empty.
Implements slide::StorageUnit.
|
overridevirtual |
set a module current
< the current is the same in all cells
< print if the (global) verbose-setting is above the threshold
< Set the current, if checkVi this also gets the cell voltages
< we are changing the current, so the stored voltage is no longer valid
Implements slide::StorageUnit.
|
overridevirtual |
take a number of time steps
Data collection of cycling data (I, V, T, etc. for every cell)
< update the time since the last update of the thermal model
< Increase the heat from the contact resistances
< each resistor sees the total module current
< If this module has a parent module, this parent will call the thermal model with the correct parameters which will include heat exchange with the module's neighbours and cooling from the cooling system of the parent module.
< if there is no parent, this module is the top-level. It then directly exchanges heat with the environment at a fixed temperature through the HVAC system If there is no parent, assume we update T every nstep*dt. So update the temperature now
< double check that we have an HVAC coolsystem (see constructor)
< 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
< we have changed the SOC/concnetration, so the stored voltage is no longer valid
Implements slide::StorageUnit.
|
overridevirtual |
module voltage (sum of cells), print is an optional argument
< sum of the voltage of all cells bool verb = print && (settings::printBool::printCrit); //!< print if the (global) verbose-setting is above the threshold
< if the stored value is up to date, return that one
< else calculate the voltage
< SU has an invalid voltage.
Implements slide::StorageUnit.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
SUM all SUs' Vmin.
Implements slide::StorageUnit.
|
inlineoverridevirtual |
SUM all SUs' VMIN.
Implements slide::StorageUnit.