SLIDE  3.0.0
A simulator for lithium-ion battery pack degradation
Loading...
Searching...
No Matches
CoolSystemData.hpp
Go to the documentation of this file.
1/*
2 * CoolSystemData.hpp
3 *
4 * Created on: 02 Jun 2022
5 * Author(s): Jorn Reniers, Volkan Kumtepeli
6 */
7
8#pragma once
9
10#include "cool_data.hpp"
11
12#include <string>
13#include <fstream>
14
15namespace slide {
16class CoolSystem;
17
19{
21 [[no_unique_address]] CoolSystemData_t tData;
22
23public:
24 void initialise(CoolSystem &cs);
25
26 void storeCumulativeData(auto Qchildren, auto Qtotal, auto t, auto E)
27 {
28 cData.Qevac_life += Qchildren;
29 cData.Qevac += Qchildren;
30 cData.Qabs_life += Qtotal;
31 cData.t_life += t;
32 cData.time += t;
33 cData.time_life += t;
34 cData.E += E;
35 cData.Eoperate += E;
36 }
37
38 void storeData(CoolSystem &cs);
39
40 void writeData(CoolSystem &cs, const std::string &prefix);
41
42private:
43 void initialise(CoolSystem &, auto &) {}
44
46 void initialise(CoolSystem &cs, CoolSystemHist_t &data);
47 //------------------------
48 void storeData(CoolSystem &, auto &)
49 {
53
54 }
55
56 void storeData(CoolSystem &cs, CoolSystemHist_t &data);
57 void storeData(CoolSystem &cs, CoolSystemInst_t &data);
58
60 auto openFile(const std::string &prefix);
61
62 void writeData(CoolSystem &, auto &, auto &)
63 {
65 std::cerr << "ERROR in CoolSystem::writeData, the settings in constants.hpp are "
66 << "forbidding from storing data. DATASTORE_COOL = " << settings::DATASTORE_COOL
67 << '\n';
68 }
69
70 void writeData(CoolSystem &cs, const std::string &prefix, CoolSystemHist_t &data);
71 void writeData(CoolSystem &cs, const std::string &prefix, CoolSystemInst_t &data);
72};
73} // namespace slide
Definition: CoolSystem.hpp:22
constexpr auto printNonCrit
threshold of verbose of when to print error messages for noncritical errors
Definition: derived_settings.hpp:31
constexpr int DATASTORE_COOL
Definition: settings.hpp:62
Slide namespace contains all the types, classes, and functions for the simulation framework.
Definition: Cell.hpp:27
std::vector< CoolSystemInst > CoolSystemInst_t
Definition: cool_data.hpp:49
std::conditional_t< settings::DATASTORE_COOL==1, CoolSystemHist_t, std::conditional_t< settings::DATASTORE_COOL==2, CoolSystemInst_t, Empty > > CoolSystemData_t
Definition: cool_data.hpp:53
CoolSystemHist CoolSystemHist_t
Definition: cool_data.hpp:50
Definition: cool_data.hpp:22
double Qevac_life
variable for unit testing, total heat evacuated from child SUs over the entire lifetime [J]
Definition: cool_data.hpp:24
double Eoperate
total energy required to operate the coolsystem [J]
Definition: cool_data.hpp:28
double Qevac
heat evacuated from the child SUs in the past data-collection period [J]
Definition: cool_data.hpp:23
double time
total time in the past data-collection period [s]
Definition: cool_data.hpp:29
double Qabs_life
variable for unit testing, total heat absorbed by heating up the coolant [J]
Definition: cool_data.hpp:25
double time_life
total time since start of simulations
Definition: cool_data.hpp:30
double E
total energy required to run the fans of the cooling system in the past data-collection period [J]
Definition: cool_data.hpp:27
double t_life
total time in the module's life [s]
Definition: cool_data.hpp:26
Definition: CoolSystemData.hpp:19
void storeData(CoolSystem &cs)
Do nothing.
Definition: CoolSystemData.cpp:22
void initialise(CoolSystem &cs)
Do nothing.
Definition: CoolSystemData.cpp:17
void writeData(CoolSystem &cs, const std::string &prefix)
N=1.
Definition: CoolSystemData.cpp:28
CoolSystemCumulative cData
Cumulative variables.
Definition: CoolSystemData.hpp:20
void storeCumulativeData(auto Qchildren, auto Qtotal, auto t, auto E)
Definition: CoolSystemData.hpp:26
CoolSystemData_t tData
Time data (histogram or basic data)
Definition: CoolSystemData.hpp:21