SEThermalCompartment.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3#pragma once
4#include "cdm/blackbox/SEBlackBox.h"
5#include "cdm/compartment/SECompartment.h"
6#include "cdm/compartment/SECompartmentNodes.h"
7#include "cdm/circuit/thermal/SEThermalCircuitNode.h"
10
11class CDM_DECL SEThermalCompartment : public SECompartment
12{
13 friend class PBCompartment;//friend the serialization class
15 template<typename CompartmentType, typename CompartmentLinkType> friend class SECompartmentGraph;
16protected:
17 SEThermalCompartment(const std::string& name, Logger* logger);
18public:
19 virtual ~SEThermalCompartment();
20
21 void Clear() override;
22
23 const SEScalar* GetScalar(const std::string& name) override;
24
25 bool HasChildren() const override { return !m_Children.empty(); }
26 virtual const std::vector<SEThermalCompartment*>& GetChildren() { return m_Children; }
27 virtual const std::vector<SEThermalCompartment*>& GetLeaves() { return m_Leaves; }
28
29 virtual bool HasNodeMapping() const { return m_Nodes.HasMapping(); }
31 virtual void MapNode(SEThermalCircuitNode& node);
32
33 virtual void StateChange() override;
34
35 virtual bool HasHeatTransferRateIn() const;
36 virtual const SEScalarPower& GetHeatTransferRateIn() const;
37 virtual double GetHeatTransferRateIn(const PowerUnit& unit) const;
38
39 virtual bool HasHeatTransferRateOut() const;
40 virtual const SEScalarPower& GetHeatTransferRateOut() const;
41 virtual double GetHeatTransferRateOut(const PowerUnit& unit) const;
42
43 virtual bool HasHeat() const;
44 virtual SEScalarEnergy& GetHeat();
45 virtual double GetHeat(const EnergyUnit& unit) const;
46
47 virtual bool HasTemperature() const;
48 virtual SEScalarTemperature& GetTemperature();
49 virtual double GetTemperature(const TemperatureUnit& unit) const;
50
51 virtual void AddLink(SEThermalCompartmentLink& link);
52 virtual void RemoveLink(SEThermalCompartmentLink& link);
53 virtual void RemoveLinks();
54 virtual const std::vector<SEThermalCompartmentLink*>& GetLinks();
55
56 virtual bool HasChild(const SEThermalCompartment& cmpt);
57 virtual void AddChild(SEThermalCompartment& child);
58
59protected:
60 virtual double CalculateInFlow_W() const;
61 virtual double CalculateOutFlow_W() const;
62
67
68 std::vector<SEThermalCompartmentLink*> m_Links;
69 std::vector<SEThermalCompartmentLink*> m_IncomingLinks;
70 std::vector<SEThermalCompartmentLink*> m_OutgoingLinks;
71
72 std::vector<SEThermalCompartment*> m_Children;
73 std::vector<SEThermalCompartment*> m_Leaves;
75};
Definition: SEScalarEnergy.h:8
Definition: Logger.h:71
Definition: PBCompartment.h:28
Definition: SEScalarPower.h:8
Definition: SECompartmentGraph.h:11
virtual void RemoveLink(const CompartmentLinkType &link)
virtual const std::vector< CompartmentLinkType * > & GetLinks() const
virtual void AddLink(CompartmentLinkType &link)
Definition: SECompartment.h:14
virtual void Clear()
Definition: SECompartment.cpp:18
virtual const SEScalar * GetScalar(const std::string &name)=0
virtual void StateChange()=0
Definition: SECompartmentManager.h:25
Definition: SEScalarEnergy.h:27
Definition: SEScalar.h:19
Definition: SEScalarPower.h:29
Definition: SEScalarTemperature.h:27
Definition: SEThermalCircuitNode.h:10
Definition: SEThermalCompartment.h:12
virtual SECompartmentNodes< THERMAL_COMPARTMENT_NODE > & GetNodeMapping()
Definition: SEThermalCompartment.h:30
virtual const std::vector< SEThermalCompartment * > & GetLeaves()
Definition: SEThermalCompartment.h:27
SEScalarPower * m_HeatTransferRateIn
Definition: SEThermalCompartment.h:63
std::vector< SEThermalCompartmentLink * > m_OutgoingLinks
Definition: SEThermalCompartment.h:70
std::vector< SEThermalCompartment * > m_Children
Definition: SEThermalCompartment.h:72
SEScalarEnergy * m_Heat
Definition: SEThermalCompartment.h:65
SEScalarPower * m_HeatTransferRateOut
Definition: SEThermalCompartment.h:64
virtual bool HasNodeMapping() const
Definition: SEThermalCompartment.h:29
virtual const std::vector< SEThermalCompartment * > & GetChildren()
Definition: SEThermalCompartment.h:26
SECompartmentNodes< THERMAL_COMPARTMENT_NODE > m_Nodes
Definition: SEThermalCompartment.h:74
std::vector< SEThermalCompartment * > m_Leaves
Definition: SEThermalCompartment.h:73
SEScalarTemperature * m_Temperature
Definition: SEThermalCompartment.h:66
std::vector< SEThermalCompartmentLink * > m_Links
Definition: SEThermalCompartment.h:68
bool HasChildren() const override
Definition: SEThermalCompartment.h:25
std::vector< SEThermalCompartmentLink * > m_IncomingLinks
Definition: SEThermalCompartment.h:69
Definition: SEScalarTemperature.h:8

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.