SLIDE  3.0.0
A simulator for lithium-ion battery pack degradation
Loading...
Searching...
No Matches
Cell_KokamNMC.hpp
Go to the documentation of this file.
1/*
2 * Cell_KokamNMC.hpp
3 *
4 * One of the child classes of Cell which implements a real cell.
5 * The cycling parameters are for a high power 18650 NMC cell manufactured by Kokam.
6 * The degradation parameters are set such that each mechanism clearly affects the battery life (which is not the case in reality).
7 *
8 * Copyright (c) 2019, The Chancellor, Masters and Scholars of the University
9 * of Oxford, VITO nv, and the 'Slide' Developers.
10 * See the licence file LICENCE.txt for more information.
11 */
12
13#pragma once
14
15#include "State_SPM.hpp"
16#include "Cell_SPM.hpp"
18#include "../../utility/utility.hpp"
19
20#include <cmath>
21#include <iostream>
22#include <array>
23
24namespace slide {
25class Cell_KokamNMC : public Cell_SPM
26{
27public:
29 Cell_KokamNMC(Model_SPM *, int verbosei);
30 Cell_KokamNMC(Model_SPM *, DEG_ID &, int verbosei);
31};
32
33
34inline Cell_KokamNMC::Cell_KokamNMC(Model_SPM *MM, int verbosei)
35 : Cell_SPM(OCVcurves::makeOCVcurves(cellType::KokamNMC))
36{
37 /*
38 * Standard constructor to initialise the battery parameters
39 *
40 * IN
41 * M structure of the type Model, with the matrices of spatial discretisation for solid diffusion
42 * verbosei integer indicating how verbose the simulation has to be.
43 * The higher the number, the more output there is.
44 * Recommended value is 1, only use higher values for debugging
45 * From 4 (and above) there will be too much info printed to follow what is going on, but this might be useful for debugging to find where the error is and why it is happening
46 * 0 almost no messages are printed, only in case of critical errors related to illegal parameters
47 * 1 error messages are printed in case of critical errors which might crash the simulation
48 * 2 all error messages are printed, whether the simulation can recover from the errors or not
49 * 3 on top of the output from 2, a message is printed every time a function in the Cycler and BasicCycler is started and terminated
50 * 4 on top of the output from 3, the high-level flow of the program in the Cycler is printed (e.g. 'we are going to discharge the cell')
51 * 5 on top of the output from 4, the low-level flow of the program in the BasicCycler is printed (e.g. 'in time step 101, the voltage is 3.65V')
52 * 6 on top of the output from 5, we also print details of the nonlinear search for the current needed to do a CV phase
53 * 7 on top of the output from 6, a message is printed every time a function in the Cell is started and terminated
54 *
55 * THROWS
56 * 110 the matrices for the solid diffusion discretisation, produced by MATLAB, are wrong
57 */
58
60 Cmaxpos = 51385;
61 Cmaxneg = 30555;
62 C_elec = 1000;
63
65 n = 1;
66
68 setCapacity(16);
74
78 Qch = 90;
79 rho = 1626;
80 Cp = 750;
81
83 geo.L = 1.6850e-4;
84 geo.Rp = 8.5e-6;
85 geo.Rn = 1.25e-5;
86 geo.SAV = 252.9915;
87 geo.elec_surf = 0.0982;
88
91
93 kp = 5e-11;
94 kp_T = 58000;
95 kn = 1.7640e-11;
96 kn_T = 20000;
99 Dp_T = 29000;
100 Dn_T = 35000 / 5.0; // #TODO Ask Jorn why SLIDE didn't have 5.0
101
103 M = MM;
105
107 double Rdc = 0.0102;
108
109 double fp{ 0.689332 }, fn{ 0.479283 };
110
111
112 st.T() = 25.0_degC;
113
114
116 st.delta() = 1e-9;
119
120 st.LLI() = 0;
121 st.Dp() = 8e-14;
122 st.Dn() = 7e-14;
123 st.thickp() = 70e-6;
124 st.thickn() = 73.5e-6;
125 st.ep() = 0.5;
126 st.en() = 0.5;
127 st.ap() = 3 * st.ep() / geo.Rp;
128 st.an() = 3 * st.en() / geo.Rn;
129
130 st.CS() = 0.01 * st.an() * geo.elec_surf * st.thickn();
131
133 st.rDCp() = 2.8e-3;
134 st.rDCn() = 2.8e-3;
135 st.rDCcc() = 232.5e-6;
136
137 st.delta_pl() = 0;
138
139 s_ini = st;
140
142 try {
144 } catch (int e) {
145 std::cout << "Error in State::initialise, one of the states has an illegal value, throwing an error\n";
146 throw 12;
147 }
148
149 setC(fp, fn);
150
152 nsei = 1;
153 alphasei = 1;
154 OCVsei = 0.4;
155 rhosei = 100e3;
156 rsei = 2037.4;
157 Vmain = 13.0;
158 Vsei = 64.39;
159 c_elec0 = 4.541e-3;
162
165 csparam.CS1alpha = 4.25e-5;
166 csparam.CS2alpha = 6.3e-7;
167 csparam.CS3alpha = 2.31e-16;
168 csparam.CS4alpha = 4.3306e-8;
170 csparam.CS5k = 1e-18;
171 csparam.CS5k_T = -127040;
173
175 OCVnmc = 4.1;
178
180 npl = 1;
181 alphapl = 1;
182 OCVpl = 0;
183 rhopl = 10000e3;
185 pl_p.pl1k = 4.5e-10;
186 pl_p.pl1k_T = -2.014008e5;
187
190 deg_id.SEI_porosity = 0;
191
193 deg_id.CS_diffusion = 0;
194
196 deg_id.pl_id = 0;
197
199 for (auto cs_id : deg_id.CS_id)
200 sparam.s_dai = sparam.s_dai || cs_id == 2;
201
202 for (auto lam_id : deg_id.LAM_id)
203 sparam.s_dai = sparam.s_dai || lam_id == 1;
204
206 for (auto cs_id : deg_id.CS_id)
207 sparam.s_lares = sparam.s_lares || cs_id == 1;
208}
209
210inline Cell_KokamNMC::Cell_KokamNMC(Model_SPM *M_, DEG_ID &deg_id_, int verbosei) : Cell_KokamNMC(M_, verbosei)
211{
212 /*
213 * constructor to initialise the degradation parameters
214 *
215 * IN
216 * M structure of the type Model, with the matrices of spatial discretisation for solid diffusion
217 * degid structure of the type DEG_ID, with the identifications of which degradation model(s) to use
218 */
219
220 deg_id = deg_id_; // #TODO deg_id_ was not being assigned. I assigned now check if it is correct behaviour.
222 for (auto cs_id : deg_id.CS_id)
223 sparam.s_dai = sparam.s_dai || cs_id == 2;
224
225 for (auto lam_id : deg_id.LAM_id)
226 sparam.s_dai = sparam.s_dai || lam_id == 1;
227
229 for (auto cs_id : deg_id.CS_id)
230 sparam.s_lares = sparam.s_lares || cs_id == 1;
231}
232
233} // namespace slide
Definition: Cell_KokamNMC.hpp:26
Cell_KokamNMC(Model_SPM *, int verbosei)
< constructors
Definition: Cell_KokamNMC.hpp:34
Definition: Cell_SPM.hpp:39
double alphasei
charge transfer coefficient of the SEI reaction [-]
Definition: Cell_SPM.hpp:85
double C_elec
Li- concentration in electrolyte [mol m-3] standard concentration of 1 molar.
Definition: Cell_SPM.hpp:50
double kp_T
activation energy for the Arrhenius relation of kp
Definition: Cell_SPM.hpp:56
double T_env
environment temperature [K]
Definition: Cell_SPM.hpp:67
double Cp
thermal capacity of the battery #TODO = units missing.
Definition: Cell_SPM.hpp:74
double OCVnmc
equilibrium potential of the NMC dissolution side reaction [V]
Definition: Cell_SPM.hpp:98
double OCVpl
OCV of the plating reaction [V].
Definition: Cell_SPM.hpp:104
param::StressParam sparam
Stress parameters.
Definition: Cell_SPM.hpp:80
DEG_ID deg_id
structure with the identification of which degradation model(s) to use #TODO may be protected.
Definition: Cell_SPM.hpp:41
double kn_T
The diffusion constants at reference temperature are part of State because they can change over the b...
Definition: Cell_SPM.hpp:58
double Vmain
partial molar volume of the main reaction, see Ashwin et al, 2016
Definition: Cell_SPM.hpp:89
double kp
rate constant of main reaction at positive electrode at reference temperature
Definition: Cell_SPM.hpp:55
double n
number of electrons involved in the main reaction [-] #TODO if really constant?
Definition: Cell_SPM.hpp:52
double alphapl
charge transfer constant for the plating reaction [-]
Definition: Cell_SPM.hpp:103
State_SPM s_ini
the battery current/initial state, grouping all parameter which change over the battery's lifetime (s...
Definition: Cell_SPM.hpp:45
double rhosei
partial molar volume of the SEI layer [m3 mol-1]
Definition: Cell_SPM.hpp:87
double Cmaxpos
maximum lithium concentration in the cathode [mol m-3] value for NMC
Definition: Cell_SPM.hpp:48
param::PLparam pl_p
structure with the fitting parameters of the different plating models
Definition: Cell_SPM.hpp:106
double c_elec0
bulk concentration of the electrolyte molecule participating in the SEI growth (e....
Definition: Cell_SPM.hpp:88
double rhopl
density of the plated lithium layer
Definition: Cell_SPM.hpp:105
param::CSparam csparam
structure with the fitting parameters of the different crack growth models
Definition: Cell_SPM.hpp:95
double rsei
specific resistance times real surface area of the SEI film [Ohm m] ? #TODO if unit is correct....
Definition: Cell_SPM.hpp:83
double npl
number of electrons involved in the plating reaction [-]
Definition: Cell_SPM.hpp:102
double nsei
number of electrons involved in the SEI reaction [-]
Definition: Cell_SPM.hpp:84
double Dn_T
activation energy for the Arrhenius relation of Dn
Definition: Cell_SPM.hpp:61
param::LAMparam lam_p
structure with the fitting parameters of the different LAM models
Definition: Cell_SPM.hpp:99
double Dp_T
activation energy for the Arrhenius relation of Dp
Definition: Cell_SPM.hpp:60
double rho
density of the battery
Definition: Cell_SPM.hpp:73
double Qch
convective heat transfer coefficient per volume [W K-1 m-3]
Definition: Cell_SPM.hpp:72
double kn
rate constant of main reaction at negative electrode at reference temperature
Definition: Cell_SPM.hpp:57
param::SEIparam sei_p
structure with the fitting parameters of the different SEI growth models
Definition: Cell_SPM.hpp:92
double OCVsei
equilibrium potential of the SEI side reaction [V]
Definition: Cell_SPM.hpp:86
double Vsei
partial molar volume of the SEI side reaction, see Ashwin et al., 2016
Definition: Cell_SPM.hpp:90
void checkModelparam()
check if the inputs to the MATLAB code are the same as the ones here in the C++ code
Definition: Cell_SPM.cpp:660
double T_ref
reference temperature [K]
Definition: Cell_SPM.hpp:68
void setC(double cp0, double cn0)
void setCurrent(bool critical, bool check, double I); //!< set the cell's current to the specified va...
Definition: Cell_SPM.cpp:556
double getAnodeSurface() noexcept
get the anode pure surface area (without cracks) product of the effective surface area (an) with the ...
Definition: Cell_SPM.hpp:206
param::Geometry_SPM geo
other geometric parameters are part of State because they can change over the battery's lifetime
Definition: Cell_SPM.hpp:77
double Cmaxneg
maximum lithium concentration in the anode [mol m-3] value for C
Definition: Cell_SPM.hpp:49
State_SPM st
< protected such that child classes can access the class variables
Definition: Cell_SPM.hpp:45
Model_SPM * M
OCV curves.
Definition: Cell_SPM.hpp:109
void setCapacity(double capacity)
Definition: Cell.hpp:48
auto & rDCp()
specific resistance (resistance times real surface area of the combined electrodes) [Ohm m2]
Definition: State_SPM.hpp:90
auto & Dn()
diffusion constant at reference temperature of the anode [m s-1]
Definition: State_SPM.hpp:89
auto & LLI()
lost lithium [As]
Definition: State_SPM.hpp:80
auto & ep()
volume fraction of active material in the cathode [-]
Definition: State_SPM.hpp:83
auto & T()
cell temperature [K]
Definition: State_SPM.hpp:78
auto & Dp()
diffusion constant at reference temperature of the cathode [m s-1]
Definition: State_SPM.hpp:88
auto & thickp()
thickness of the cathode [m]
Definition: State_SPM.hpp:81
auto & rDCn()
specific resistance (resistance times real surface area of the combined electrodes) [Ohm m2]
Definition: State_SPM.hpp:91
auto & delta_pl()
thickness of the plated lithium layer [m]
Definition: State_SPM.hpp:93
auto & delta()
thickness of the SEI layer [m]
Definition: State_SPM.hpp:79
auto & thickn()
thickness of the anode [m]
Definition: State_SPM.hpp:82
auto & rDCcc()
specific resistance (resistance times real surface area of the combined electrodes) [Ohm m2]
Definition: State_SPM.hpp:92
auto & an()
effective surface area of the anode [m2 m-3]
Definition: State_SPM.hpp:86
auto & ap()
effective surface area of the cathode [m2 m-3]
Definition: State_SPM.hpp:85
auto & en()
volume fraction of active material in the anode [-]
Definition: State_SPM.hpp:84
auto & CS()
surface area of the cracks at the surface of the negative particle [m2]
Definition: State_SPM.hpp:87
constexpr double Kelvin
Definition: constants.hpp:20
constexpr LAMparam LAMparam_Kokam
lam1p
Definition: LAMparam_default.hpp:16
constexpr SEIparam SEIparam_Kokam
< fitting parameters of the models
Definition: SEIparam_default.hpp:17
constexpr StressParam StressParam_Kokam
< omegap, from Wu, Xiao, Wen, Zhang, Three-dimensional finite element study on stress generation in s...
Definition: StressParam_default.hpp:16
Slide namespace contains all the types, classes, and functions for the simulation framework.
Definition: Cell.hpp:27
void validState(State_SPM &s, State_SPM &s_ini)
< State related functions
cellType
Definition: enum_definitions.hpp:43
@ KokamNMC
Definition: enum_definitions.hpp:48
void add_model(data_t elem)
Adds a model to the array.
Definition: DEG_ID.hpp:36
DEG_ID structure handles the identifications of which degradation model(s) to use.
Definition: DEG_ID.hpp:23
DegArray CS_id
Array with identifications for which model to use for surface cracking. Max length 10.
Definition: DEG_ID.hpp:57
data_t pl_id
Integer deciding which model is to be used for li-plating.
Definition: DEG_ID.hpp:82
data_t SEI_porosity
Integer deciding whether we reduce the active volume fraction due to SEI growth.
Definition: DEG_ID.hpp:51
DegArray SEI_id
Array with identifications to decide which SEI models to use.
Definition: DEG_ID.hpp:43
data_t CS_diffusion
Integer deciding whether we reduce the negative diffusion constant due to surface cracks.
Definition: DEG_ID.hpp:67
DegArray LAM_id
Array with the integers deciding which models is to be used for loss of active material....
Definition: DEG_ID.hpp:73
Definition: Model_SPM.hpp:24
Definition: OCVcurves.hpp:16
value_type CS4alpha
fitting parameter of the 4th surface crack growth model
Definition: CSparam.hpp:20
value_type CS2alpha
fitting parameter of the 2nd surface crack growth model
Definition: CSparam.hpp:18
value_type CS5k
rate parameter of the 5th surface crack growth model at reference temperature
Definition: CSparam.hpp:24
value_type CS3alpha
fitting parameter of the 3rd surface crack growth model
Definition: CSparam.hpp:19
value_type CS_diffusion
fitting parameter to decrease the diffusion constant due to surface cracks
Definition: CSparam.hpp:27
value_type CS4Amax
maximum crack growth surface for the 4th surface crack growth model 5 * getAn() * getThickn() * elec_...
Definition: CSparam.hpp:22
value_type CS1alpha
fitting parameter of the 1st surface crack growth model
Definition: CSparam.hpp:17
value_type CS5k_T
activation energy of CS5k
Definition: CSparam.hpp:25
double L
thickness of one layer of the cell [m]
Definition: Geometry_SPM.hpp:17
double Rp
Definition: Geometry_SPM.hpp:22
double elec_surf
geometric surface area of the electrodes (electrode height * electrode width*layers) [m2] Doubly coat...
Definition: Geometry_SPM.hpp:19
double Rn
other geometric parameters are part of State because they can change over the battery'
Definition: Geometry_SPM.hpp:22
double SAV
surface area to volume-ratio of the cell [m2/m3]
Definition: Geometry_SPM.hpp:20
double pl1k_T
activation energy of pl1k
Definition: PLparam.hpp:18
double pl1k
rate constant of the li-plating side reaction at reference temperature in the 1st model
Definition: PLparam.hpp:17
bool s_lares
do we need to calculate the stress according to Laresgoiti's model?
Definition: StressParam.hpp:26
bool s_dai
do we need to calculate the stress according to Dai's model?
Definition: StressParam.hpp:25