NANDRAD Data Model Library  Version 2.0
NANDRAD
NANDRAD_HydraulicNetworkHeatExchange.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_HydraulicNetworkHeatExchangeH
23 #define NANDRAD_HydraulicNetworkHeatExchangeH
24 
25 #include "NANDRAD_LinearSplineParameter.h"
26 #include "NANDRAD_HydraulicNetworkComponent.h"
27 
28 #include <IBK_IntPara.h>
29 
30 namespace NANDRAD {
31 
32 class ConstructionInstance;
33 class Zone;
34 
35 /*! Encapsulates all data defining heat exchange between flow elements and
36  the environment or other models/elements.
37 
38  Definition of heat exchange is done in each flow element definition. If missing, the flow
39  element is treated as adiabat.
40 */
42 public:
43 
44  // *** PUBLIC MEMBER FUNCTIONS ***
45 
46  /*! Defines the type of heat exchange */
47  enum ModelType {
48  T_TemperatureConstant, // Keyword: TemperatureConstant 'Difference to constant temperature'
49  T_TemperatureSpline, // Keyword: TemperatureSpline 'Difference to time-dependent temperature from spline'
50  T_TemperatureSplineEvaporator, // Keyword: TemperatureSplineEvaporator 'Evaporator medium temperature for heat pump'
51  T_TemperatureZone, // Keyword: TemperatureZone 'Difference to zone air temperature'
52  T_TemperatureConstructionLayer, // Keyword: TemperatureConstructionLayer 'Difference to active construction layer (floor heating)'
53  T_HeatLossConstant, // Keyword: HeatLossConstant 'Constant heat loss'
54  T_HeatLossSpline, // Keyword: HeatLossSpline 'Heat loss from spline'
55  /*! Heat loss from condenser is not the heat loss of the fluid, hence different parameter than T_HeatLossSpline. */
56  T_HeatLossSplineCondenser, // Keyword: HeatLossSplineCondenser 'Heat loss of condenser in heat pump model'
57  NUM_T
58  };
59 
61  for (unsigned int & i : m_idReferences) i = INVALID_ID;
62  }
63 
66  m_modelType = modelType;
67  }
68 
69  NANDRAD_READWRITE
70 
71  /*! Tests all parameter and initializes linear spline parameters for calculation,
72  including reading of potentially referenced TSV files.
73  */
74  void checkParameters(const std::map<std::string, IBK::Path> &placeholders,
75  const std::vector<Zone> &zones,
76  const std::vector<ConstructionInstance> &conInstances);
77 
78  bool operator!=(const HydraulicNetworkHeatExchange & other) const;
79 
80  /*! Parameters for the element . */
81  enum para_t {
82  P_Temperature, // Keyword: Temperature [C] 'Temperature for heat exchange'
83  P_HeatLoss, // Keyword: HeatLoss [W] 'Constant heat flux out of the element (heat loss)'
84  P_ExternalHeatTransferCoefficient, // Keyword: ExternalHeatTransferCoefficient [W/m2K] 'External heat transfer coeffient for the outside boundary'
85  NUM_P
86  };
87 
88  /*! Spline parameter as functions of time. Defined similarly as time series for location object (i.e. with start time shift). */
89  enum splinePara_t {
90  SPL_Temperature, // Keyword: Temperature [C] 'Temperature for heat exchange'
91  /*! Heat loss spline is used for models T_HeatLossSpline and T_HeatLossSplineCondenser. */
92  SPL_HeatLoss, // Keyword: HeatLoss [W] 'Constant heat flux out of the element (heat loss)'
93  NUM_SPL
94  };
95 
96  /*! Integer/whole number parameters. */
97  enum References {
98  ID_ZoneId, // Keyword: ZoneId [-] 'ID of coupled zone for thermal exchange'
99  ID_ConstructionInstanceId, // Keyword: ConstructionInstanceId [-] 'ID of coupled construction instance for thermal exchange'
100  NUM_ID
101  };
102 
103  /*! Model/type of heat exchange. */
104  ModelType m_modelType = NUM_T; // XML:A
105 
106  /*! Integer parameters. */
107  IDType m_idReferences[NUM_ID]; // XML:E
108 
109  /*! Parameter */
110  IBK::Parameter m_para[NUM_P]; // XML:E
111 
112  /*! Time-series of heat flux or temperature (can be spline or tsv-file). */
113  LinearSplineParameter m_splPara[NUM_SPL]; // XML:E
114 
115 
116  // *** Static functions ***
117 
118  static std::vector<ModelType> availableHeatExchangeTypes(const HydraulicNetworkComponent::ModelType modelType);
119 };
120 
121 
122 } // namespace NANDRAD
123 
124 #endif // NANDRAD_HydraulicNetworkHeatExchangeH
ModelType m_modelType
Model/type of heat exchange.
splinePara_t
Spline parameter as functions of time.
ModelType
The various types (equations) of the hydraulic component.
Class LinearSplineParameter stores a linear spline curve, the corresponding parameter name and a unit...
unsigned int INVALID_ID
defines an invalid id
Heat loss from condenser is not the heat loss of the fluid, hence different parameter than T_HeatLoss...
LinearSplineParameter m_splPara[NUM_SPL]
Time-series of heat flux or temperature (can be spline or tsv-file).
NANDRAD_READWRITE void checkParameters(const std::map< std::string, IBK::Path > &placeholders, const std::vector< Zone > &zones, const std::vector< ConstructionInstance > &conInstances)
Tests all parameter and initializes linear spline parameters for calculation, including reading of po...
The namespace NANDRAD contains the data model classes that make up the NANDRAD solver input data...
Heat loss spline is used for models T_HeatLossSpline and T_HeatLossSplineCondenser.
Encapsulates all data defining heat exchange between flow elements and the environment or other model...