SLIDE  3.0.0
A simulator for lithium-ion battery pack degradation
Loading...
Searching...
No Matches
degradation.hpp File Reference
#include "Cell.hpp"
#include "settings/settings.hpp"
#include <cmath>
#include <iostream>
#include <fstream>
#include <cassert>
#include <memory>
Include dependency graph for degradation.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CycleAgeingConfig
 < Definitions of custom datatypes: More...
 
struct  CalendarAgeingConfig
 
struct  ProfileAgeingConfig
 Auxiliary functions for multi-threaded simulations. More...
 

Functions

void Calendar_one (const struct slide::Model_SPM &M, const struct DEG_ID &degid, int cellType, int verbose, double V, double Ti, int Time, int mode, int timeCycleData, int timeCheck, struct checkUpProcedure &proc, std::string name)
 
void Cycle_one (const struct slide::Model_SPM &M, const struct DEG_ID &degid, int cellType, int verbose, double Vma, double Vmi, double Ccha, bool CVcha, double Icutcha, double Cdis, bool CVdis, double Icutdis, double Ti, int timeCycleData, int nrCycles, int nrCap, struct checkUpProcedure &proc, std::string name)
 
void Profile_one (const struct slide::Model_SPM &M, const struct DEG_ID &degid, int cellType, int verbose, std::string profName, int n, int limit, double Vma, double Vmi, double Ti, int timeCycleData, int nrProfiles, int nrCap, struct checkUpProcedure &proc, std::string name)
 Degradation experiments. More...
 
void CycleAgeing (const struct slide::Model_SPM &M, std::string pref, const struct DEG_ID &degid, int cellType, int verbose)
 simulate a range of cycle ageing experiments (different temperatures, SOC windows, currents) More...
 
void CalendarAgeing (const struct slide::Model_SPM &M, std::string pref, const struct DEG_ID &degid, int cellType, int verbose)
 simulate a range of calendar ageing experiments (different temperatures, SOC levels) More...
 
void ProfileAgeing (const struct slide::Model_SPM &M, std::string pref, const struct DEG_ID &degid, int cellType, int verbose)
 simulate a range of drive cycle experiments (different cycles, different temperatures, etc.) More...
 
void Cycle_one (const struct slide::Model_SPM &M, const struct DEG_ID &degid, int cellType, int verbose, const struct CycleAgeingConfig &cycAgConfig, bool CVcha, double Icutcha, bool CVdis, double Icutdis, int timeCycleData, int nrCycles, int nrCap, struct checkUpProcedure &proc, const std::string &pref)
 < Include header files More...
 

Function Documentation

◆ Calendar_one()

void Calendar_one ( const struct slide::Model_SPM M,
const struct DEG_ID &  degid,
int  cellType,
int  verbose,
double  V,
double  Ti,
int  Time,
int  mode,
int  timeCycleData,
int  timeCheck,
struct checkUpProcedure &  proc,
std::string  name 
)

< settings of the cycler

< use a time step of 2 seconds

< a lower temperature allows a larger time step without numerical problems

< Make a cell, the type of the cell depending on the value of 'cellType' #TODO -> There is a cast.

< a high power NMC cell made by Kokam

< a high energy NMC cell made by LG Chem

< a user-defined cell

< Make the cycler

< Call the Calendar-function of the cycler. Wrap it in a try-catch to avoid fatal errors

< std::cout << "Throw test: " << 75 << '
';

< #TODO this is not valid anymore.

Parameters
verbosesimulate one calendar ageing experiment
Here is the caller graph for this function:

◆ CalendarAgeing()

void CalendarAgeing ( const struct slide::Model_SPM M,
std::string  pref,
const struct DEG_ID &  degid,
int  cellType,
int  verbose 
)

simulate a range of calendar ageing experiments (different temperatures, SOC levels)

< *********************************************************** 1 variables ***********************************************************************

< append the ageing identifiers to the prefix

< Make variables to describe the cycling regimes

< integer deciding how often to recharge the cells (due to degradation, the voltage will decrease over time. But no self-discharge is simulated) 0 means we recharge to the specified voltage only after a check-up 1 means we recharge to the specified voltage every day 2 means we float the cell at a constant voltage, rather than resting it floating at constant voltage takes very long to simulate

< time the cell has to rest [days]

< time between consecutive check-ups [days]

< time interval at which cycling data (voltage and temperature) has to be recorded [s] 0 means no data is recorded if not 0, data is recorded approximately every so many seconds

< *********************************************************** 2 check-up procedure ******************************************************************

< Make a struct to describe the check-up procedure

< boolean indicating if degradation is accounted for during the check-up, [RECOMMENDED: TRUE]

< boolean indicating if the capacity should be checked

< boolean indicating if the half-cell OCV curves should be checked

< boolean indicating if some CCCV cycles should be done as part of the check-up procedure

< boolean indicating if a pulse discharge test should be done as part of the check-up procedure

< boolean indicating if the cycling data from the check-up should be included in the cycling data of the cell or not

< number of different cycles to be simulated for the CCCV check-up (i.e. the length of the array crates), maximum 100 If you change this variable, also change it in the MATLAB script which reads the results from the check-up (the variable Crates in readAgeing_CCCV.m)

< do a 0.5C cycle as part of the CCCV check-up, must be positive If you change this variable, also change it in the MATLAB script which reads the results from the check-up (the variable Crates in readAgeing_CCCV.m)

< do a 1C cycle as part of the CCCV check-up, must be positive If you change this variable, also change it in the MATLAB script which reads the results from the check-up (the variable Crates in readAgeing_CCCV.m)

< do a 2C cycle as part of the CCCV check-up, must be positive If you change this variable, also change it in the MATLAB script which reads the results from the check-up (the variable Crates in readAgeing_CCCV.m)

< C rate of the cutoff current for the CV phase for the charges in the CCCV check-up, must be positive

< C rate of the cutoff current for the CV phase for the discharges in the CCCV check-up, must be positive if the cutoff is larger than the value in the CC phase, no CV phase is done

< name of the csv file which contains the current profile for the pulse test

< length of the current profiles for the pulse test (number of rows in the csv file)

< *********************************************************** Simulations ******************************************************************

< The cycling-window needs the voltage windows between which it should cycle the battery. Users typically find it easier to think in terms of state of charge windows. For the Kokam cell used here, the conversion is as follows (for other cells the user has to derive the conversion from the OCV curve) 0% 2.7V 10% 3.42V 20% 3.49V 50% 3.65V 80% 3.98V 90% 4.08V 100% 4.2V The voltages will be slightly different for the LG Chem cell because it has different OCV curves

< temperature at which the cell has to rest [oC]

< voltage at which the cell has to rest [V] above the minimum and below the maximum voltage of the cell

< Print a message that we are starting the simulations

Here is the call graph for this function:

◆ Cycle_one() [1/2]

void Cycle_one ( const struct slide::Model_SPM M,
const struct DEG_ID &  degid,
int  cellType,
int  verbose,
const struct CycleAgeingConfig cycAgConfig,
bool  CVcha,
double  Icutcha,
bool  CVdis,
double  Icutdis,
int  timeCycleData,
int  nrCycles,
int  nrCap,
struct checkUpProcedure &  proc,
const std::string &  pref 
)

< Include header files

< simulate one cycle ageing experiment

Parameters
verbosesimulate one cycle ageing experiment
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cycle_one() [2/2]

void Cycle_one ( const struct slide::Model_SPM M,
const struct DEG_ID &  degid,
int  cellType,
int  verbose,
double  Vma,
double  Vmi,
double  Ccha,
bool  CVcha,
double  Icutcha,
double  Cdis,
bool  CVdis,
double  Icutdis,
double  Ti,
int  timeCycleData,
int  nrCycles,
int  nrCap,
struct checkUpProcedure &  proc,
std::string  name 
)

< settings of the cycler

< use a time step of 2 seconds to ensure numerical stability

< a lower temperature allows a larger time step without numerical problems

< Make a cell, the type of the cell depending on the value of 'cellType' #TODO -> There is a cast.

< a high power NMC cell made by Kokam

< a high energy NMC cell made by LG Chem

< a user-defined cell

< Make the cycler

< Call the cycle ageing function from the cycler

< std::cout << "Throw test: " << 76 << '
';

< #TODO this is not valid anymore.

Parameters
Vmisimulate one cycle ageing experiment

◆ CycleAgeing()

void CycleAgeing ( const struct slide::Model_SPM M,
std::string  pref,
const struct DEG_ID &  degid,
int  cellType,
int  verbose 
)

simulate a range of cycle ageing experiments (different temperatures, SOC windows, currents)

< *********************************************************** 1 variables ***********************************************************************

< append the ageing identifiers to the prefix

< Make variables to describe the cycling regimes

< we want to have a CC CV charge (if false, then charge has only a CC phase)

< Crate of the cutoff current for the CV phase of the charge [-]

< we want to have a CC discharge (if true, then discharge has both a CC and CV phase)

< Crate of the cutoff current for the CV phase of the discharge [-]

< the number of cycles which has to be simulated

< the number of cycles between check-ups

< time interval at which cycling data (voltage and temperature) has to be recorded [s] 0 means no data is recorded if not 0, data is recorded approximately every so many seconds

< *********************************************************** 2 check-up procedure ******************************************************************

< Make a struct to describe the check-up procedure

< boolean indicating if degradation is accounted for during the check-up, [RECOMMENDED: TRUE]

< boolean indicating if the capacity should be checked

< boolean indicating if the half-cell OCV curves should be checked

< boolean indicating if some CCCV cycles should be done as part of the check-up procedure

< boolean indicating if a pulse discharge test should be done as part of the check-up procedure

< boolean indicating if the cycling data from the check-up should be included in the cycling data of the cell or not

< number of different cycles to be simulated for the CCCV check-up (i.e. the length of the array crates) If you change this variable, also change it in the MATLAB script which reads the results from the check-up (the variable Crates in readAgeing_CCCV.m)

< do a 0.5C cycle as part of the CCCV check-up, must be positive If you change this variable, also change it in the MATLAB script which reads the results from the check-up (the variable Crates in readAgeing_CCCV.m)

< do a 1C cycle as part of the CCCV check-up, must be positive If you change this variable, also change it in the MATLAB script which reads the results from the check-up (the variable Crates in readAgeing_CCCV.m)

< do a 2C cycle as part of the CCCV check-up, must be positive If you change this variable, also change it in the MATLAB script which reads the results from the check-up (the variable Crates in readAgeing_CCCV.m)

< C rate of the cutoff current for the CV phase for the charges in the CCCV check-up, must be positive

< C rate of the cutoff current for the CV phase for the discharges in the CCCV check-up, must be positive if the cutoff is larger than the value in the CC phase, no CV phase is done

< name of the csv file which contains the current profile for the pulse test

< length of the current profiles for the pulse test (number of rows in the csv file)

< *********************************************************** 3 simulations ******************************************************************

< The cycling-window needs the voltage windows between which it should cycle the battery. Users typically find it easier to think in terms of state of charge windows. For the Kokam cell used here, the conversion is as follows (for other cells the user has to derive the conversion from the OCV curve) 0% 2.7V 10% 3.42V 20% 3.49V 50% 3.65V 80% 3.98V 90% 4.08V 100% 4.2V The voltages will be slightly different for the LG Chem cell because it has different OCV curves

< Use for loops to create a cycle ageing experiment configuration.

< cycleAgConfigVec.emplace_back(4.08, 3.42, 45, 2, 1, 90, 10); //!< For debugging purposes.

< Crate of the CC charge

< Crate of the CC discharge

< Corresponds to SOC window 100% – 0%

< maximum and minimum voltages of the cycle [V] with corresponding SOC values [%].

< 45 and 25 Celsius degrees of environmental temperature.

< Corresponds to SOC window 80% – 0%

< 45 Celsius degrees of environmental temperature.

< Corresponds to SOC window 100% – 20%

< 45 Celsius degrees of environmental temperature.

< Corresponds to SOC window 90% – 10%

< 45, 25, and 5 Celsius degrees of environmental temperature.

< simulate one cycle ageing experiment

< Print a message that we are starting the simulations

< Runs individual simulation in parallel or sequential depending on settings.

Here is the call graph for this function:

◆ Profile_one()

void Profile_one ( const struct slide::Model_SPM M,
const struct DEG_ID &  degid,
int  cellType,
int  verbose,
std::string  profName,
int  n,
int  limit,
double  Vma,
double  Vmi,
double  Ti,
int  timeCycleData,
int  nrProfiles,
int  nrCap,
struct checkUpProcedure &  proc,
std::string  name 
)

Degradation experiments.

< Make a cell, the type of the cell depending on the value of 'cellType' #TODO -> There is a cast.

< a high power NMC cell made by Kokam

< a high energy NMC cell made by LG Chem

< a user-defined cell

< Make the cycler

< Print a warning if you want to store cycling data In profileAgeing, you are guaranteed to get one point per step in the profile so if the steps are very short (e.g. 1sec), you are storing a huge amount of data (e.g. every second) This seriously slowing down the code (taking hours instead of minutes) and produces huge amounts of data (several GB)

< Call the profile ageing function from the Cycler

< std::cout << "Throw test: " << 77 << '
';

< #TODO this is not valid anymore.

Parameters
limitsimulate one drive cycle ageing experiment
Here is the caller graph for this function:

◆ ProfileAgeing()

void ProfileAgeing ( const struct slide::Model_SPM M,
std::string  pref,
const struct DEG_ID &  degid,
int  cellType,
int  verbose 
)

simulate a range of drive cycle experiments (different cycles, different temperatures, etc.)

Configuration struct for above-given functions.

< *********************************************************** 1 variables ***********************************************************************

< append the ageing identifiers to the prefix

< find the number of parallel threads that are optimal to use unsigned int Ncor = std::thread::hardware_concurrency(); //!< Ncor is the number of (logical) cores, 0 if c++ can't identify it

< Give the current profile which should be followed the first column must give the current [A] which should be followed >0 is discharge

< the second column should give the time [sec] for which this current should be maintained

< 5 example current profiles are provided: name length description Current Profile random.csv 100 a random current profile with a maximum current of 5A, each current step takes maximum 1000 seconds

< Current Profile drive cycle US06.csv 601 US06 drive cycle with a maximum current of 8.1A (= 3C), each current step takes 1 second

< length of the profile (number of rows)

< what to do if the voltage limits are reached while following the profile: 0 immediately go to the next current step of the profile (i.e. reduce the time of this step) 1 keep the voltage constant for the rest of this step of the profile (i.e. reduce the current of this step)

< number of times the current profile should be repeated [-]

< number of times the current profile should be repeated between consecutive check-ups [-]

< time interval at which cycling data (voltage and temperature) has to be recorded [s] 0 means no data is recorded if not 0, data is recorded approximately every so many seconds For this function (profileAgeing) it is highly recommended to keep timeCycleData at 0. Otherwise, a huge amount of data is generated (many GB) and consequently the code slows down dramatically This is because you are guaranteed to get one data point per step in the current profile if timeCycleData is bigger than 0, independent of the time interval at which you are otherwise collecting data (i.e. even if you set it to 100, you will still get a data point every step) As many drive cycles will have a step per second (i.e. the current changes every second), this means you store a data point every second (even if timeCycleData = 100) which is obviously a huge amount of data if you simulate long term battery usage

< *********************************************************** 2 check-up procedure ******************************************************************

< Make a struct to describe the check-up procedure

< boolean indicating if degradation is accounted for during the check-up, [RECOMMENDED: TRUE]

< boolean indicating if the capacity should be checked

< boolean indicating if the half-cell OCV curves should be checked

< boolean indicating if some CCCV cycles should be done as part of the check-up procedure

< boolean indicating if a pulse discharge test should be done as part of the check-up procedure

< boolean indicating if the cycling data from the check-up should be included in the cycling data of the cell or not

< number of different cycles to be simulated for the CCCV check-up (i.e. the length of the array crates). If you change this variable, also change it in the MATLAB script which reads the results from the check-up (the variable Crates in readAgeing_CCCV.m)

< do a 0.5C cycle as part of the CCCV check-up, must be positive If you change this variable, also change it in the MATLAB script which reads the results from the check-up (the variable Crates in readAgeing_CCCV.m)

< do a 1C cycle as part of the CCCV check-up, must be positive If you change this variable, also change it in the MATLAB script which reads the results from the check-up (the variable Crates in readAgeing_CCCV.m)

< do a 2C cycle as part of the CCCV check-up, must be positive If you change this variable, also change it in the MATLAB script which reads the results from the check-up (the variable Crates in readAgeing_CCCV.m)

< C rate of the cutoff current for the CV phase for the charges in the CCCV check-up, must be positive

< C rate of the cutoff current for the CV phase for the discharges in the CCCV check-up, must be positive if the cutoff is larger than the value in the CC phase, no CV phase is done

< name of the csv file which contains the current profile for the pulse test

< length of the current profiles for the pulse test (number of rows in the csv file)

< *********************************************************** 3 simulations ******************************************************************

< The cycling-window needs the voltage windows between which it should cycle the battery. Users typically find it easier to think in terms of state of charge windows. For the Kokam cell used here, the conversion is as follows (for other cells the user has to derive the conversion from the OCV curve) 0% 2.7V 10% 3.42V 20% 3.49V 50% 3.65V 80% 3.98V 90% 4.08V 100% 4.2V The voltages will be slightly different for the LG Chem cell because it has different OCV curves

< Use for loops to create a profile ageing experiment configuration.

< names of the csv file with the current profile:

< identification strings for each experiment (will also be used to name the folder so must have the same restrictions as the prefix, i.e. no spaces, no special characters, etc.)

< Should be same size as profile_arr.

< Profile file names.

< Corresponds to SOC window 100% – 0%

< maximum and minimum voltages which the cell should stay while following the current profile [V] with corresponding SOC values [%].

< 45 and 25 Celsius degrees of environmental temperature while the cell is following the profile [oC]

< Corresponds to SOC window 90% – 10%

< 25 Celsius degree of environmental temperature.

< simulate one profile ageing experiment

< Print a message that we are starting the simulations

Here is the call graph for this function: