SLIDE  3.0.0
A simulator for lithium-ion battery pack degradation
Loading...
Searching...
No Matches
running_LP_cases.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
16namespace slide::benchmarks {
17
19{
20 constexpr double T_ENV = 15.0_degC;
21
22 std::string ID = "PyBAMM_LP_SmallPack"; // + std::to_string(Crate) + '_'
23
24 auto c = Cell_SPM();
25 c.getStateObj().rDCn() = 0;
26 c.getStateObj().rDCp() = 0;
27 c.getStateObj().rDCcc() = 0;
28 c.setBlockDegAndTherm(true);
29
31 Deep_ptr<StorageUnit>(c.copy()) };
32
33 auto module = Module_p("SmallPack", T_ENV, true, false, std::size(cs), 1, 1);
34 module.setSUs(cs, false);
35
36 ThroughputData th{};
37 auto cyc = Cycler(&module, ID);
38
39 Clock clk;
40 cyc.CC(2, 2.7, 5 * 60, 1, 10, th);
41 std::cout << "Finished " << ID << " in " << clk << ".\n";
42 cyc.writeData();
43}
44
46{
47 constexpr double T_ENV = 15.0_degC;
48
49 std::string ID = "PyBAMM_LP_MediumPack"; // + std::to_string(Crate) + '_'
50
51 auto c = Cell_SPM();
52 c.getStateObj().rDCn() = 0;
53 c.getStateObj().rDCp() = 0;
54 c.getStateObj().rDCcc() = 0;
55 c.setBlockDegAndTherm(true);
56
57
59 constexpr size_t ns = 10;
60 constexpr size_t np = 32;
61 constexpr bool checkCells = true;
62
63 const double Rc_s = 1e-4;
64 const double Rc_p = 2e-4;
65
66 Deep_ptr<StorageUnit> MinS[np];
67 Deep_ptr<StorageUnit> CinM[ns];
68
69 double Rc2[np], Rc3[ns];
70 for (size_t is = 0; is < np; is++) {
71 for (size_t ic = 0; ic < ns; ic++) {
72 CinM[ic] = Deep_ptr<StorageUnit>(c.copy());
73 Rc3[ic] = Rc_s;
74 }
75 auto mi = make<Module_s>("s" + std::to_string(is), T_ENV, true, false, ns, 1, 1);
76
77 mi->setSUs(CinM, checkCells, true);
78 mi->setRcontact(Rc3);
79 MinS[is] = std::move(mi);
80 Rc2[is] = Rc_p;
81 }
82
83 auto module = Module_p("MediumPack", T_ENV, true, false, ns * np, 1, 1);
84 module.setSUs(MinS, false);
85 module.setRcontact(Rc2);
86
87 ThroughputData th{};
88 auto cyc = Cycler(&module, ID);
89
90 Clock clk;
91 cyc.CC(32, 2.7, 5 * 60, 1, 10, th);
92 std::cout << "Finished " << ID << " in " << clk << ".\n";
93 cyc.writeData();
94}
95
97{
98 constexpr double T_ENV = 15.0_degC;
99 std::string ID = "PyBAMM_LP_LargePack"; // + std::to_string(Crate) + '_'
100
101 auto c = Cell_SPM();
102 c.getStateObj().rDCn() = 0;
103 c.getStateObj().rDCp() = 0;
104 c.getStateObj().rDCcc() = 0;
105 c.setBlockDegAndTherm(true);
106
107
109 constexpr size_t ns = 10;
110 constexpr size_t np = 64;
111 constexpr bool checkCells = true;
112
113 const double Rc_s = 1e-4;
114 const double Rc_p = 2e-4;
115
116 Deep_ptr<StorageUnit> MinS[np];
117 Deep_ptr<StorageUnit> CinM[ns];
118
119 double Rc2[np], Rc3[ns];
120 for (size_t is = 0; is < np; is++) {
121 for (size_t ic = 0; ic < ns; ic++) {
122 CinM[ic] = Deep_ptr<StorageUnit>(c.copy());
123 Rc3[ic] = Rc_s;
124 }
125 auto mi = make<Module_s>("s" + std::to_string(is), T_ENV, true, false, ns, 1, 1);
126
127 mi->setSUs(CinM, checkCells, true);
128 mi->setRcontact(Rc3);
129 MinS[is] = std::move(mi);
130 Rc2[is] = Rc_p;
131 }
132
133 auto module = Module_p("LargePack", T_ENV, true, false, ns * np, 1, 1);
134 module.setSUs(MinS, false);
135 module.setRcontact(Rc2);
136
137 ThroughputData th{};
138 auto cyc = Cycler(&module, ID);
139
140 Clock clk;
141 cyc.CC(64, 2.7, 5 * 60, 1, 10, th);
142 std::cout << "Finished " << ID << " in " << clk << ".\n";
143 cyc.writeData();
144}
145
147{
148 constexpr double T_ENV = 15.0_degC;
149 std::string ID = "PyBAMM_LP_LargePackLong"; // + std::to_string(Crate) + '_'
150
151 auto c = Cell_SPM();
152 c.getStateObj().rDCn() = 0;
153 c.getStateObj().rDCp() = 0;
154 c.getStateObj().rDCcc() = 0;
155 c.setBlockDegAndTherm(true);
156
157
159 constexpr size_t ns = 10;
160 constexpr size_t np = 64;
161 constexpr bool checkCells = true;
162
163 const double Rc_s = 1e-4;
164 const double Rc_p = 2e-4;
165
166 Deep_ptr<StorageUnit> MinS[np];
167 Deep_ptr<StorageUnit> CinM[ns];
168
169 double Rc2[np], Rc3[ns];
170 for (size_t is = 0; is < np; is++) {
171 for (size_t ic = 0; ic < ns; ic++) {
172 CinM[ic] = Deep_ptr<StorageUnit>(c.copy());
173 Rc3[ic] = Rc_s;
174 }
175 auto mi = make<Module_s>("s" + std::to_string(is), T_ENV, true, false, ns, 1, 1);
176
177 mi->setSUs(CinM, checkCells, true);
178 mi->setRcontact(Rc3);
179 MinS[is] = std::move(mi);
180 Rc2[is] = Rc_p;
181 }
182
183 auto module = Module_p("LargePackLong", T_ENV, true, false, ns * np, 1, 1);
184 module.setSUs(MinS, false);
185 module.setRcontact(Rc2);
186
187 ThroughputData th{};
188 auto cyc = Cycler(&module, ID);
189
190 Clock clk;
191 for (size_t i_repeat{}; i_repeat < 3; i_repeat++) {
192 cyc.CC(-64, 2.7, 20 * 60, 1, 10, th);
193 cyc.rest(15 * 60, 1, 10, th);
194 cyc.CC(64, 2.7, 20 * 60, 1, 10, th);
195 cyc.rest(30 * 60, 1, 10, th);
196 }
197
198 std::cout << "Finished " << ID << " in " << clk << ".\n";
199 cyc.writeData();
200}
201
202
203} // namespace slide::benchmarks
Definition: Cell_SPM.hpp:39
Definition: Cycler.hpp:19
Definition: Deep_ptr.hpp:23
Definition: Module_p.hpp:19
Definition: benchmark_Cell_ECM.hpp:16
void run_LP_case_MediumPack()
Definition: running_LP_cases.hpp:45
void run_LP_case_LargePack()
Definition: running_LP_cases.hpp:96
void run_LP_case_LargePackLong()
Definition: running_LP_cases.hpp:146
void run_LP_case_SmallPack()
Definition: running_LP_cases.hpp:18
Definition: timing.hpp:21
Definition: State.hpp:24