Line data Source code
1 : /* 2 : * Module_base_s.hpp 3 : * 4 : * series-connected base Module 5 : * 6 : * Created on: 9 Dec 2019 7 : * Author(s): Jorn Reniers, Volkan Kumtepeli 8 : */ 9 : 10 : #pragma once 11 : 12 : #include "Module.hpp" 13 : #include "../settings/settings.hpp" 14 : #include "../cells/Cell.hpp" 15 : #include "../types/data_storage/cell_data.hpp" 16 : #include "../utility/utility.hpp" 17 : 18 : #include <string_view> 19 : #include <memory> 20 : 21 : namespace slide { 22 : class Module_s : public Module 23 : { 24 : public: 25 1 : Module_s() : Module("moduleS") {} //!< note this constructor should never be used. It can't determine which coolsystem to use 26 76 : Module_s(std::string_view ID_, double Ti, bool print, bool pari, int Ncells_, int coolControl, int cooltype) 27 76 : : Module(ID_, Ti, print, pari, Ncells_, coolControl, cooltype) {} 28 : //!< Module_s(std::string_view IDi, bool pari, int Ncells, std::unique_ptr<CoolSystem> &&cool_); #TODO 29 : 30 : //!< functions from Module_base 31 : // Since cells are in series following functions are just sum. 32 : double Vmin() const override { return transform_sum(SUs, free::get_Vmin<SU_t>); } //!< SUM all SUs' Vmin 33 : double VMIN() const override { return transform_sum(SUs, free::get_VMIN<SU_t>); } //!< SUM all SUs' VMIN 34 : double Vmax() const override { return transform_sum(SUs, free::get_Vmax<SU_t>); } //!< SUM all SUs' Vmax 35 : double VMAX() const override { return transform_sum(SUs, free::get_VMAX<SU_t>); } //!< SUM all SUs' VMAX 36 : 37 : double I() const override { return (SUs.empty() ? 0 : SUs[0]->I()); } //!< the current is the same in all cells, so we can use first value. Return zero if SUs empty. 38 : double Cap() const override { return transform_min(SUs, free::get_Cap<SU_t>); } //!< module capacity is the capacity of the smallest cell 39 : 40 : 41 : double getOCV() override; //!< module voltage (sum of cells), print is an optional argument 42 : double getRtot() override; 43 : double V() override; //!< module voltage (sum of cells), print is an optional argument 44 : 45 : Status setCurrent(double Inew, bool checkV = true, bool print = true) override; //!< set a module current 46 : void timeStep_CC(double dt, int steps = 1) override; 47 : 48 : Module_s *copy() override { return new Module_s(*this); } 49 : }; 50 : } // namespace slide