SLIDE  3.0.0
A simulator for lithium-ion battery pack degradation
Loading...
Searching...
No Matches
benchmark_Cell_ECM.hpp
Go to the documentation of this file.
1/*
2 * running_Cell_Bucket.hpp
3 *
4 * Benchmark file for Cell_Bucket
5 *
6 * Created on: 07 Aug 2022
7 * Author(s): Volkan Kumtepeli
8 */
9
10#pragma once
11
12#include "../src/slide.hpp"
13
14#include <string>
15
17
19{
20 // Benchmark with default parameters:
21 std::string ID = "Cell_ECM_single_default_pulse"; // + std::to_string(Crate) + '_'
22 auto c = Cell_ECM();
23 c.setBlockDegAndTherm(true);
24
25 ThroughputData th{};
26 auto cyc = Cycler(&c, ID);
27
28 Clock clk;
29 constexpr size_t Nrepeat = 3;
30 for (size_t i = 0; i < Nrepeat; i++) {
31 cyc.CC(16, 2.7, 5 * 60, 0.1, 5, th);
32 cyc.CC(-16, 4.2, 5 * 60, 0.1, 5, th);
33 }
34
35 std::cout << "Finished " << ID << " in " << clk << ".\n";
36 cyc.writeData();
37}
38
40{
41 // Benchmark with default parameters:
42 std::string ID = "Cell_ECM_single_default_CCCV"; // + std::to_string(Crate) + '_'
43 auto c = Cell_ECM();
44 c.setBlockDegAndTherm(true);
45
46 ThroughputData th{};
47 auto cyc = Cycler(&c, ID);
48
49 Clock clk;
50 constexpr size_t Nrepeat = 3;
51 for (size_t i = 0; i < Nrepeat; i++) {
52 cyc.CCCV(16, 2.7, 50e-3, 0.1, 5, th);
53 cyc.rest(10 * 60, 0.1, 10, th);
54 cyc.CCCV(16, 4.2, 50e-3, 0.1, 5, th);
55 cyc.rest(10 * 60, 0.1, 10, th);
56 }
57
58 std::cout << "Finished " << ID << " in " << clk << ".\n";
59 cyc.writeData();
60}
61
62
64{
65 // Benchmark with default parameters:
66 std::string ID = "Cell_ECM_2_RC_single_default_pulse"; // + std::to_string(Crate) + '_'
67 auto c = Cell_ECM<2>();
68 c.setBlockDegAndTherm(true);
69
70 ThroughputData th{};
71 auto cyc = Cycler(&c, ID);
72
73 Clock clk;
74 constexpr size_t Nrepeat = 3;
75 for (size_t i = 0; i < Nrepeat; i++) {
76 cyc.CC(16, 2.7, 5 * 60, 0.1, 5, th);
77 cyc.CC(-16, 4.2, 5 * 60, 0.1, 5, th);
78 }
79
80 std::cout << "Finished " << ID << " in " << clk << ".\n";
81 cyc.writeData();
82}
83
85{
86 // Benchmark with default parameters:
87 std::string ID = "Cell_ECM_2_RC_single_default_CCCV"; // + std::to_string(Crate) + '_'
88 auto c = Cell_ECM<2>();
89 c.setBlockDegAndTherm(true);
90
91 ThroughputData th{};
92 auto cyc = Cycler(&c, ID);
93
94 Clock clk;
95 constexpr size_t Nrepeat = 3;
96 for (size_t i = 0; i < Nrepeat; i++) {
97 cyc.CCCV(16, 2.7, 50e-3, 0.1, 5, th);
98 cyc.rest(10 * 60, 0.1, 10, th);
99 cyc.CCCV(16, 4.2, 50e-3, 0.1, 5, th);
100 cyc.rest(10 * 60, 0.1, 10, th);
101 }
102
103 std::cout << "Finished " << ID << " in " << clk << ".\n";
104 cyc.writeData();
105}
106
107
109{
110 constexpr double T_ENV = 15.0_degC;
111 // Benchmark with default parameters:
112 std::string ID = "Cell_ECM_parallel_3_default_pulse"; // + std::to_string(Crate) + '_'
113
114 double capin{ 16 }, SOCin{ 0.5 }, Rdc_{ 2e-3 };
115 constexpr double Cp0 = 38e3; // first parallel capacitance
116 constexpr double Rp0 = 15.8e-3;
117 std::array<double, 1> Rp_{ Rp0 }, inv_tau{ 1.0 / (Rp0 * Cp0) };
118
119 Deep_ptr<StorageUnit> cs[3] = {
120 make<Cell_ECM<1>>("1", capin, SOCin, 1e-3, Rp_, inv_tau),
121 make<Cell_ECM<1>>("2", capin, SOCin, Rdc_, Rp_, inv_tau),
122 make<Cell_ECM<1>>("3", capin, SOCin, Rdc_, Rp_, inv_tau)
123 };
124
125 auto module = Module_p("Par3", T_ENV, true, false, std::size(cs), 1, 1);
126 module.setSUs(cs, false);
127
128 module.setBlockDegAndTherm(true);
129
130 ThroughputData th{};
131 auto cyc = Cycler(&module, ID);
132
133
134 Clock clk;
135 constexpr size_t Nrepeat = 3;
136 for (size_t i = 0; i < Nrepeat; i++) {
137 cyc.CC(16, 2.7, 5 * 60, 0.1, 5, th);
138 cyc.CC(-16, 4.2, 5 * 60, 0.1, 5, th);
139 }
140
141 std::cout << "Finished " << ID << " in " << clk << ".\n";
142 cyc.writeData();
143}
144
146{
147 constexpr double T_ENV = 15.0_degC;
148
149 // Benchmark with default parameters:
150 std::string ID = "Cell_ECM_parallel_3_default_CCCV"; // + std::to_string(Crate) + '_'
151 double capin{ 16 }, SOCin{ 0.5 }, Rdc_{ 2e-3 };
152 constexpr double Cp0 = 38e3; // first parallel capacitance
153 constexpr double Rp0 = 15.8e-3;
154 std::array<double, 1> Rp_{ Rp0 }, inv_tau{ 1.0 / (Rp0 * Cp0) };
155
156 Deep_ptr<StorageUnit> cs[] = {
157 make<Cell_ECM<1>>("1", capin, SOCin, 1e-3, Rp_, inv_tau),
158 make<Cell_ECM<1>>("2", capin, SOCin, 3e-3, Rp_, inv_tau),
159 make<Cell_ECM<1>>("3", capin, SOCin, Rdc_, Rp_, inv_tau)
160 };
161
162 auto module = Module_p("Par3", T_ENV, true, false, std::size(cs), 1, 1);
163 module.setSUs(cs, false);
164
165 module.setBlockDegAndTherm(true);
166
167 ThroughputData th{};
168 auto cyc = Cycler(&module, ID);
169
170 Clock clk;
171 constexpr size_t Nrepeat = 3;
172 for (size_t i = 0; i < Nrepeat; i++) {
173 cyc.CCCV(16, 2.7, 50e-3, 0.1, 5, th);
174 cyc.rest(10 * 60, 0.1, 10, th);
175 cyc.CCCV(16, 4.2, 50e-3, 0.1, 5, th);
176 cyc.rest(10 * 60, 0.1, 10, th);
177 }
178
179 std::cout << "Finished " << ID << " in " << clk << ".\n";
180 cyc.writeData();
181}
182
184{
185 constexpr double T_ENV = 15.0_degC;
186 // Benchmark with default parameters:
187 std::string ID = "Cell_ECM_parallel_3_withRcontact_CCCV"; // + std::to_string(Crate) + '_'
188 double capin{ 16 }, SOCin{ 0.5 }, Rdc_{ 2e-3 };
189 constexpr double Cp0 = 38e3; // first parallel capacitance
190 constexpr double Rp0 = 15.8e-3;
191 std::array<double, 1> Rp_{ Rp0 }, inv_tau{ 1.0 / (Rp0 * Cp0) };
192
193 std::vector<double> Rcontact{ 0.5e-3, 1e-3, 0.7e-3 };
194
195 Deep_ptr<StorageUnit> cs[3] = {
196 make<Cell_ECM<1>>("1", capin, SOCin, 1e-3, Rp_, inv_tau),
197 make<Cell_ECM<1>>("2", capin, SOCin, 3e-3, Rp_, inv_tau),
198 make<Cell_ECM<1>>("3", capin, SOCin, Rdc_, Rp_, inv_tau)
199 };
200
201 auto module = Module_p("Par3", T_ENV, true, false, std::size(cs), 1, 1);
202 module.setSUs(cs, false);
203 module.setRcontact(Rcontact);
204
205 module.setBlockDegAndTherm(true);
206
207 ThroughputData th{};
208 auto cyc = Cycler(&module, ID);
209
210 Clock clk;
211 constexpr size_t Nrepeat = 3;
212 for (size_t i = 0; i < Nrepeat; i++) {
213 cyc.CCCV(16, 2.7, 50e-3, 0.1, 1, th);
214 cyc.rest(10 * 60, 0.1, 1, th);
215 cyc.CCCV(16, 4.2, 50e-3, 0.1, 5, th);
216 cyc.rest(10 * 60, 0.1, 10, th);
217 }
218
219 std::cout << "Finished " << ID << " in " << clk << ".\n";
220 cyc.writeData();
221}
222
223
225{
226 constexpr double T_ENV = 15.0_degC;
227 // Benchmark with default parameters:
228 std::string ID = "Cell_ECM_series_3_withRcontact_CCCV"; // + std::to_string(Crate) + '_'
229 double capin{ 16 }, SOCin{ 0.5 }, Rdc_{ 2e-3 };
230 constexpr double Cp0 = 38e3; // first parallel capacitance
231 constexpr double Rp0 = 15.8e-3;
232 std::array<double, 1> Rp_{ Rp0 }, inv_tau{ 1.0 / (Rp0 * Cp0) };
233
234 std::vector<double> Rcontact{ 0.5e-3, 1e-3, 0.7e-3 };
235
236
237 Deep_ptr<StorageUnit> cs[3] = {
238 make<Cell_ECM<1>>("1", capin, SOCin, 1e-3, Rp_, inv_tau),
239 make<Cell_ECM<1>>("2", capin, SOCin, 3e-3, Rp_, inv_tau),
240 make<Cell_ECM<1>>("3", capin, SOCin, Rdc_, Rp_, inv_tau)
241 };
242
243 auto module = Module_s("Ser3", T_ENV, true, false, std::size(cs), 1, 1);
244 module.setSUs(cs, false);
245 module.setRcontact(Rcontact);
246
247 module.setBlockDegAndTherm(true);
248
249 ThroughputData th{};
250 auto cyc = Cycler(&module, ID);
251
252
253 Clock clk;
254 constexpr size_t Nrepeat = 3;
255 for (size_t i = 0; i < Nrepeat; i++) {
256 cyc.CCCV(16, module.Vmin(), 50e-3, 0.1, 1, th);
257 cyc.rest(10 * 60, 0.1, 1, th);
258 cyc.CCCV(16, module.Vmax(), 50e-3, 0.1, 5, th);
259 cyc.rest(10 * 60, 0.1, 10, th);
260 }
261
262 std::cout << "Finished " << ID << " in " << clk << ".\n";
263 cyc.writeData();
264}
265
266
268{
269 constexpr double T_ENV = 15.0_degC;
270 std::string ID = "Cell_ECM_SmallPack"; // + std::to_string(Crate) + '_'
271
272 auto c = Cell_ECM();
273
274 c.setBlockDegAndTherm(true);
275
277 Deep_ptr<StorageUnit>(c.copy()) };
278
279 auto module = Module_p("SmallPack", T_ENV, true, false, std::size(cs), 1, 1);
280 module.setSUs(cs, false);
281
282 ThroughputData th{};
283 auto cyc = Cycler(&module, ID);
284
285 Clock clk;
286 cyc.CC(2, 2.7, 5 * 60, 1, 10, th);
287 std::cout << "Finished " << ID << " in " << clk << ".\n";
288 cyc.writeData();
289}
290
292{
293 constexpr double T_ENV = 15.0_degC;
294 std::string ID = "Cell_ECM_MediumPack"; // + std::to_string(Crate) + '_'
295
296 auto c = Cell_ECM();
297 c.setBlockDegAndTherm(true);
298
299
301 constexpr size_t ns = 10;
302 constexpr size_t np = 32;
303 constexpr bool checkCells = true;
304
305 const double Rc_s = 1e-4;
306 const double Rc_p = 2e-4;
307
308 Deep_ptr<StorageUnit> MinS[np];
309 Deep_ptr<StorageUnit> CinM[ns];
310
311 double Rc2[np], Rc3[ns];
312 for (size_t is = 0; is < np; is++) {
313 for (size_t ic = 0; ic < ns; ic++) {
314 CinM[ic] = Deep_ptr<StorageUnit>(c.copy());
315 Rc3[ic] = Rc_s;
316 }
317 auto mi = make<Module_s>("s" + std::to_string(is), T_ENV, true, false, ns, 1, 1);
318
319 mi->setSUs(CinM, checkCells, true);
320 mi->setRcontact(Rc3);
321 MinS[is] = std::move(mi);
322 Rc2[is] = Rc_p;
323 }
324
325 auto module = Module_p("MediumPack", T_ENV, true, false, ns * np, 1, 1);
326 module.setSUs(MinS, false);
327 module.setRcontact(Rc2);
328
329 ThroughputData th{};
330 auto cyc = Cycler(&module, ID);
331
332 Clock clk;
333 cyc.CC(32, 2.7, 5 * 60, 1, 10, th);
334 std::cout << "Finished " << ID << " in " << clk << ".\n";
335 cyc.writeData();
336}
337
339{
340 constexpr double T_ENV = 15.0_degC;
341 std::string ID = "Cell_ECM_LargePack"; // + std::to_string(Crate) + '_'
342
343 auto c = Cell_ECM();
344 c.setBlockDegAndTherm(true);
345
346
348 constexpr size_t ns = 10;
349 constexpr size_t np = 64;
350 constexpr bool checkCells = true;
351
352 const double Rc_s = 1e-4;
353 const double Rc_p = 2e-4;
354
355 Deep_ptr<StorageUnit> MinS[np];
356 Deep_ptr<StorageUnit> CinM[ns];
357
358 double Rc2[np], Rc3[ns];
359 for (size_t is = 0; is < np; is++) {
360 for (size_t ic = 0; ic < ns; ic++) {
361 CinM[ic] = Deep_ptr<StorageUnit>(c.copy());
362 Rc3[ic] = Rc_s;
363 }
364 auto mi = make<Module_s>("s" + std::to_string(is), T_ENV, true, false, ns, 1, 1);
365
366 mi->setSUs(CinM, checkCells, true);
367 mi->setRcontact(Rc3);
368 MinS[is] = std::move(mi);
369 Rc2[is] = Rc_p;
370 }
371
372 auto module = Module_p("LargePack", T_ENV, true, false, ns * np, 1, 1);
373 module.setSUs(MinS, false);
374 module.setRcontact(Rc2);
375
376 ThroughputData th{};
377 auto cyc = Cycler(&module, ID);
378
379 Clock clk;
380 cyc.CC(64, 2.7, 5 * 60, 1, 10, th);
381 std::cout << "Finished " << ID << " in " << clk << ".\n";
382 cyc.writeData();
383}
384
386{
387 constexpr double T_ENV = 15.0_degC;
388 std::string ID = "Cell_ECM_LargePackLong"; // + std::to_string(Crate) + '_'
389
390 auto c = Cell_ECM();
391
392 c.setBlockDegAndTherm(true);
393
395 constexpr size_t ns = 10;
396 constexpr size_t np = 64;
397 constexpr bool checkCells = true;
398
399 const double Rc_s = 1e-4;
400 const double Rc_p = 2e-4;
401
402 Deep_ptr<StorageUnit> MinS[np];
403 Deep_ptr<StorageUnit> CinM[ns];
404
405 double Rc2[np], Rc3[ns];
406 for (size_t is = 0; is < np; is++) {
407 for (size_t ic = 0; ic < ns; ic++) {
408 CinM[ic] = Deep_ptr<StorageUnit>(c.copy());
409 Rc3[ic] = Rc_s;
410 }
411 auto mi = make<Module_s>("s" + std::to_string(is), T_ENV, true, false, ns, 1, 1);
412
413 mi->setSUs(CinM, checkCells, true);
414 mi->setRcontact(Rc3);
415 MinS[is] = std::move(mi);
416 Rc2[is] = Rc_p;
417 }
418
419 auto module = Module_p("LargePackLong", T_ENV, true, false, ns * np, 1, 1);
420 module.setSUs(MinS, false);
421 module.setRcontact(Rc2);
422
423 ThroughputData th{};
424 auto cyc = Cycler(&module, ID);
425
426 Clock clk;
427 for (size_t i_repeat{}; i_repeat < 3; i_repeat++) {
428 cyc.CC(-64, 2.7, 20 * 60, 1, 10, th);
429 cyc.rest(15 * 60, 1, 10, th);
430 cyc.CC(64, 2.7, 20 * 60, 1, 10, th);
431 cyc.rest(30 * 60, 1, 10, th);
432 }
433
434 std::cout << "Finished " << ID << " in " << clk << ".\n";
435 cyc.writeData();
436}
437
438
439} // namespace slide::benchmarks
Definition: Cell_ECM.hpp:29
Definition: Cycler.hpp:19
Definition: Deep_ptr.hpp:23
Definition: Module_p.hpp:19
Definition: Module_s.hpp:23
Definition: benchmark_Cell_ECM.hpp:16
void run_Cell_ECM_parallel_3_withRcontact_CCCV()
Definition: benchmark_Cell_ECM.hpp:183
void run_Cell_ECM_2_RC_single_default_CCCV()
Definition: benchmark_Cell_ECM.hpp:84
void run_Cell_ECM_single_default_pulse()
Definition: benchmark_Cell_ECM.hpp:18
void run_Cell_ECM_LargePackLong()
Definition: benchmark_Cell_ECM.hpp:385
void run_Cell_ECM_parallel_3_default_CCCV()
Definition: benchmark_Cell_ECM.hpp:145
void run_Cell_ECM_parallel_3_default_pulse()
Definition: benchmark_Cell_ECM.hpp:108
void run_Cell_ECM_LargePack()
Definition: benchmark_Cell_ECM.hpp:338
void run_Cell_ECM_2_RC_single_default_pulse()
Definition: benchmark_Cell_ECM.hpp:63
void run_Cell_ECM_SmallPack()
Definition: benchmark_Cell_ECM.hpp:267
void run_Cell_ECM_series_3_withRcontact_CCCV()
Definition: benchmark_Cell_ECM.hpp:224
void run_Cell_ECM_MediumPack()
Definition: benchmark_Cell_ECM.hpp:291
void run_Cell_ECM_single_default_CCCV()
Definition: benchmark_Cell_ECM.hpp:39
Deep_ptr< T > make(Args &&...args)
Makes storage units.
Definition: Deep_ptr.hpp:120
Definition: timing.hpp:21
Definition: State.hpp:24