NANDRAD Data Model Library  Version 2.0
NANDRAD
NANDRAD_HydraulicNetworkElement.h
1 /* The NANDRAD data model library.
2 
3  Copyright (c) 2012-today, Institut für Bauklimatik, TU Dresden, Germany
4 
5  Primary authors:
6  Andreas Nicolai <andreas.nicolai -[at]- tu-dresden.de>
7  Anne Paepcke <anne.paepcke -[at]- tu-dresden.de>
8 
9  This library is part of SIM-VICUS (https://github.com/ghorwin/SIM-VICUS)
10 
11  This library is free software: you can redistribute it and/or modify
12  it under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  This library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU General Public License for more details.
20 */
21 
22 #ifndef NANDRAD_HydraulicNetworkElementH
23 #define NANDRAD_HydraulicNetworkElementH
24 
25 #include <IBK_Parameter.h>
26 
27 #include "NANDRAD_CodeGenMacros.h"
28 #include "NANDRAD_Constants.h"
29 #include "NANDRAD_HydraulicNetworkHeatExchange.h"
30 
31 namespace NANDRAD {
32 
33 class HydraulicNetworkComponent;
34 class HydraulicNetworkPipeProperties;
35 class HydraulicNetwork;
36 class HydraulicNetworkControlElement;
37 class Project;
38 
39 /*! Contains data of a flow element inside a network.
40  Pipe-specific parameters are stored in HydraulicNetworkPipeProperties objects, referenced via m_pipeID. For
41  other elements, this ID is unused.
42 */
44 public:
45 
47  for(IBK::IntPara &i : m_intPara)
48  i.value = (int) NANDRAD::INVALID_ID;
49  }
50 
51 
52  /*! C'tor for a network element other than pipes. */
53  HydraulicNetworkElement(unsigned int id, unsigned int inletNodeId, unsigned int outletNodeId, unsigned int componentId):
54  m_id(id),
55  m_inletNodeId(inletNodeId),
56  m_outletNodeId(outletNodeId),
57  m_componentId(componentId),
59  {
60  }
61 
62  /*! Specific constructor to create pipe elements. */
63  HydraulicNetworkElement(unsigned int id, unsigned int inletNodeId, unsigned int outletNodeId,
64  unsigned int componentId, unsigned int pipeID, double length);
65 
66  /*! Parameters for the element . */
67  enum para_t {
68  P_Length, // Keyword: Length [m] 'Pipe length'
69  NUM_P
70  };
71 
72  /*! Whole number parameters. */
73  enum intPara_t {
74  IP_NumberParallelPipes, // Keyword: NumberParallelPipes 'Number of parallel pipes'
75  NUM_IP
76  };
77 
78 
79  // *** PUBLIC MEMBER FUNCTIONS ***
80 
81  NANDRAD_READWRITE
82  NANDRAD_COMPARE_WITH_ID
83 
84  bool operator!=(const HydraulicNetworkElement &other) const;
85 
86  /*! Checks for valid and required parameters (value ranges).
87  If referenced TSV file is given, this is read and checked and data is transferred into
88  variable m_tsvFileContent.
89  */
90  void checkParameters(const HydraulicNetwork & nw, const Project & prj);
91 
92  // *** PUBLIC MEMBER VARIABLES ***
93 
94  /*! Unique ID for this flow component.
95  ID is used for outputs and to reference heat sources/sinks connected to this element. For active elements,
96  this ID is used to connect control models.
97  */
98  IDType m_id = NANDRAD::INVALID_ID; // XML:A:required
99  /*! Inlet node ID. */
100  unsigned int m_inletNodeId = NANDRAD::INVALID_ID; // XML:A:required
101  /*! Outlet node ID. */
102  unsigned int m_outletNodeId = NANDRAD::INVALID_ID; // XML:A:required
103  /*! Hydraulic component ID. */
104  unsigned int m_componentId = NANDRAD::INVALID_ID; // XML:A:required
105  /*! Pipe ID (only needed for elements that are pipes). */
106  unsigned int m_pipePropertiesId = NANDRAD::INVALID_ID; // XML:A
107 
108  /*! Optional reference to a flow controller element. */
110 
111  /*! Display name. */
112  std::string m_displayName; // XML:A
113 
114  /*! Parameters of the flow component. */
115  IBK::Parameter m_para[NUM_P]; // XML:E
116 
117  /*! Integer parameters. */
118  IBK::IntPara m_intPara[NUM_IP]; // XML:E
119 
120  /*! Optional definition of heat exchange calculation model (if missing, flow element is adiabat). */
122 
123 
124  // *** Variables used only during simulation ***
125 
126  const HydraulicNetworkComponent *m_component = nullptr;
127  const HydraulicNetworkPipeProperties *m_pipeProperties = nullptr;
128  const HydraulicNetworkControlElement *m_controlElement = nullptr ;
129 
130 };
131 
132 } // namespace NANDRAD
133 
134 #endif // NANDRAD_HydraulicNetworkElementH
Contains all input data that describes a room with walls, floor, ceiling, usage, HVAC etc...
IBK::Parameter m_para[NUM_P]
Parameters of the flow component.
Contains global constants for the Nandrad data model.
unsigned int m_componentId
Hydraulic component ID.
IDType m_controlElementId
Optional reference to a flow controller element.
unsigned int m_pipePropertiesId
Pipe ID (only needed for elements that are pipes).
Parameters for a hydraulic component for the network.
unsigned int INVALID_ID
defines an invalid id
IBK::IntPara m_intPara[NUM_IP]
Integer parameters.
Contains data of a flow element inside a network.
This class contains parameters for a controller that is used for network elements.
IDType m_id
Unique ID for this flow component.
HydraulicNetworkElement(unsigned int id, unsigned int inletNodeId, unsigned int outletNodeId, unsigned int componentId)
C&#39;tor for a network element other than pipes.
HydraulicNetworkHeatExchange m_heatExchange
Optional definition of heat exchange calculation model (if missing, flow element is adiabat)...
void checkParameters(const HydraulicNetwork &nw, const Project &prj)
Checks for valid and required parameters (value ranges).
The namespace NANDRAD contains the data model classes that make up the NANDRAD solver input data...
Encapsulates all data defining heat exchange between flow elements and the environment or other model...
Contains all data for a hydraulic network.