SLIDE  3.0.0
A simulator for lithium-ion battery pack degradation
Loading...
Searching...
No Matches
Cell_LGChemNMC.hpp
Go to the documentation of this file.
1/*
2 * Cell_LGChemNMC.cpp
3 *
4 * One of the child classes that implements a real cell.
5 * The cycling parameters are for a high energy 18650 NMC cell manufactured by LG Chem.
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#include "Cell_SPM.hpp"
14#include "../../utility/utility.hpp"
16
17#include <cmath>
18#include <iostream>
19
20namespace slide {
22{
23public:
24 Cell_LGChemNMC(Model_SPM *, int verbosei);
25 Cell_LGChemNMC(Model_SPM *M, DEG_ID &, int verbosei);
26};
27
28
30 : Cell_SPM(OCVcurves::makeOCVcurves(cellType::LGChemNMC))
31{
32 /* OCVcurves::makeOCVcurves(cellType::KokamNMC)
33 * Standard constructor to initialise the battery parameters
34 *
35 * IN
36 * M structure of the type Model, with the matrices of spatial discretisation for solid diffusion
37 * verbosei integer indicating how verbose the simulation has to be.
38 * The higher the number, the more output there is.
39 * Recommended value is 1, only use higher values for debugging
40 * 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
41 * 0 almost no messages are printed, only in case of critical errors related to illegal parameters
42 * 1 error messages are printed in case of critical errors which might crash the simulation
43 * 2 all error messages are printed, whether the simulation can recover from the errors or not
44 * 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
45 * 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')
46 * 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')
47 * 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
48 * 7 on top of the output from 6, a message is printed every time a function in the Cell is started and terminated
49 *
50 * THROWS
51 * 110 the matrices for the solid diffusion discretisation, produced by MATLAB, are wrong
52 * 111 the OCV curves are too long
53 */
54
56 Cmaxpos = 51385;
57 Cmaxneg = 30555;
58 C_elec = 1000;
59
61 n = 1;
62
64 setCapacity(3.5);
65 // Vmax = 4.2; //!< value for an NMC/C cell
66 // Vmin = 2.7; //!< value for an NMC/C cell
67 // dIcell = 1.0; //!< ramp at 1A
68 // dt_I = 1e-2; //!< ramp at 10ms so changing the current goes fast
69 // //!< now changing the current takes 0.01 second per A
70
74 Qch = 40;
75 rho = 1626;
76 Cp = 750;
77
79 geo.L = 1.6850e-4;
80 geo.Rp = 8.5e-6;
81 geo.Rn = 1.25e-5;
82 geo.SAV = 252.9915;
83 geo.elec_surf = 0.132360185255877;
84
87
89 kp = 0.9e-12;
90 kp_T = 58000;
91 kn = 4e-10;
92 kn_T = 20000;
95 Dp_T = 29000;
96 Dn_T = 35000; // #TODO Ask Jorn why SLIDE didn't have 5.0
97
99 M = MM;
101
103 State_SPM::z_type up, un;
104 double fp, fn, T, delta;
105 double Rdc = 0.0102;
106 fp = 0.651673;
107 fn = 0.297109;
108 T = 25_degC;
109 delta = 1e-9;
112 LLI = 0;
113 thickp = 70e-6;
114 thickn = 1.170972150305478e-4;
115 ep = 0.5;
116 en = 0.5;
117 ap = 3 * ep / geo.Rp;
118 an = 3 * en / geo.Rn;
119 CS = 0.01 * an * geo.elec_surf * thickn;
120 Dp = 1e-14;
121 Dn = 3e-14;
122 R = Rdc * ((thickp * ap * geo.elec_surf + thickn * an * geo.elec_surf) / 2);
123 delta_pl = 0;
124 s_ini.initialise(up, un, T, delta, LLI, thickp, thickn, ep, en, ap, an, CS, Dp, Dn, R, delta_pl);
125 st = s_ini;
126
128 try {
129 validState();
130 } catch (int e) {
131 std::cout << "Error in State::initialise, one of the states has an illegal value, throwing an error\n";
132 throw 12;
133 }
134 setC(fp, fn);
135
137 nsei = 1;
138 alphasei = 1;
139 OCVsei = 0.4;
140 rhosei = 100e3;
141 rsei = 2037.4;
142 Vmain = 13.0;
143 Vsei = 64.39;
144 c_elec0 = 4.541e-3;
145
148
151 csparam.CS1alpha = 7.5e-4;
152 csparam.CS2alpha = 7.5e-7;
153 csparam.CS3alpha = 3.75e-15;
154 csparam.CS4alpha = 7.44e-8;
156 csparam.CS5k = 1e-15;
157 csparam.CS5k_T = 130000;
159
161 OCVnmc = 4.1;
164
166 npl = 1;
167 alphapl = 1;
168 OCVpl = 0;
169 rhopl = 10000e3;
171 pl_p.pl1k = 2.25e-8;
172 pl_p.pl1k_T = -1.0070e5;
173
175 deg.SEI_id.add_model(0);
176 deg.SEI_porosity = 0;
177
178 deg.CS_id.add_model(0);
179 deg.CS_diffusion = 0;
180
181 deg.LAM_id.add_model(0);
182 deg.pl_id = 0;
183
185 for (auto cs_id : deg_id.CS_id)
186 sparam.s_dai = sparam.s_dai || cs_id == 2;
187
188 for (auto lam_id : deg_id.LAM_id)
189 sparam.s_dai = sparam.s_dai || lam_id == 1;
190
192 for (auto cs_id : deg_id.CS_id)
193 sparam.s_lares = sparam.s_lares || cs_id == 1;
194}
195
196inline Cell_LGChemNMC::Cell_LGChemNMC(Model_SPM *M, DEG_ID &deg_id, int verbosei) : Cell_LGChemNMC(M, verbosei)
197{
198 /*
199 * constructor to initialise the degradation parameters
200 *
201 * IN
202 * M structure of the type Model, with the matrices of the state space model for solid diffusion
203 * degid structure of the type DEG_ID, with the identifications of which degradation model(s) to use
204 */
205
207 for (auto cs_id : deg_id.CS_id)
208 sparam.s_dai = sparam.s_dai || cs_id == 2;
209
210 for (auto lam_id : deg_id.LAM_id)
211 sparam.s_dai = sparam.s_dai || lam_id == 1;
212
214 for (auto cs_id : deg_id.CS_id)
215 sparam.s_lares = sparam.s_lares || cs_id == 1;
216}
217}; // namespace slide
Definition: Cell_LGChemNMC.hpp:22
Cell_LGChemNMC(Model_SPM *, int verbosei)
constructor
Definition: Cell_LGChemNMC.hpp:29
Definition: Cell_SPM.hpp:39
double alphasei
charge transfer coefficient of the SEI reaction [-]
Definition: Cell_SPM.hpp:85
void CS(double OCVnt, double etan, double *isei_multiplyer, double *dCS, double *dDn)
calculate the effect of surface crack growth
Definition: Cell_SPM_degradation.cpp:129
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 T() noexcept override
returns the uniform battery temperature in [K]
Definition: Cell_SPM.hpp:159
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
std::array< value_type, nch > z_type
Definition: State_SPM.hpp:63
constexpr double Kelvin
Definition: constants.hpp:20
constexpr StressParam StressParam_LGCChemNMC
< omegap, from Wu, Xiao, Wen, Zhang, Three-dimensional finite element study on stress generation in s...
Definition: StressParam_default.hpp:35
constexpr LAMparam LAMparam_LGCChemNMC
lam1p
Definition: LAMparam_default.hpp:30
constexpr SEIparam SEIparam_LGCChemNMC
sei_porosity
Definition: SEIparam_default.hpp:53
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
@ LGChemNMC
Definition: enum_definitions.hpp:49
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
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