NANDRAD Data Model Library  Version 2.0
NANDRAD
NANDRAD_Interface.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_InterfaceH
23 #define NANDRAD_InterfaceH
24 
25 #include <IBK_Parameter.h>
26 #include <IBK_Flag.h>
27 
28 #include "NANDRAD_InterfaceAirFlow.h"
29 #include "NANDRAD_InterfaceHeatConduction.h"
30 #include "NANDRAD_InterfaceSolarAbsorption.h"
31 #include "NANDRAD_InterfaceLongWaveEmission.h"
32 #include "NANDRAD_InterfaceVaporDiffusion.h"
33 #include "NANDRAD_CodeGenMacros.h"
34 #include "NANDRAD_Constants.h"
35 
36 namespace NANDRAD {
37 
38 class Zone;
39 
40 /*! An Interface identifies a surface of a wall and stores all data that are needed for boundary
41  condition calculation. Each ConstructionInstance contains two member variables of type
42  Interface, which uniquely define the boundary condition parameters at side
43  A or B of the construction (A - layer index 0, B - other side).
44 
45  The zone at the other side of the wall surface is identified by its zone ID.
46  The zone ID = 0 indicates ambient climate. If the construction is adiabatic,
47  there must not be an interface defined for this side.
48 */
49 class Interface {
50  NANDRAD_READWRITE_PRIVATE
51 public:
52 
53  // *** PUBLIC MEMBER FUNCTIONS ***
54 
55  void readXML(const TiXmlElement * element);
56  TiXmlElement * writeXML(TiXmlElement * parent) const;
57 
58  NANDRAD_COMPARE_WITH_ID
59 
60  /*! Checks for valid parameters.
61  \note This function throws an exception if invalid parameters are defined or parameters are missing.
62  */
63  void checkParameters() const;
64 
65  /*! Special form of comparison operator, tests if parameters that have an
66  impact on result calculation are the same (zone, location, physical parameters).
67  */
68  bool behavesLike(const Interface & other) const {
69  return (m_zoneId == other.m_zoneId &&
74  }
75 
76  /*! Updates the comment regarding the zone this interface is connected to. */
77  void updateComment(const std::vector<Zone> & zones);
78 
79  /*! Returns true, if any of the parameters blocks have boundary conditions defined.
80  If the model ID m_id is INVALID_ID, the function returns false (the default).
81  A boundary condition parameter block counts as defined, if the modelType is not NUM_MT.
82  */
83  bool haveBCParameters() const;
84 
85  // *** PUBLIC MEMBER VARIABLES ***
86 
87  /*! ID of the referenced surface/interface. */
88  unsigned int m_id = INVALID_ID; // XML:A:required
89  /*! The id number of the neighboring zone. */
90  unsigned int m_zoneId = 0; // XML:A
91 
92  // Boundary condition parameters
93  /*! Model for convective heat transfer. */
95  /*! Model for solar absorption. */
97  /*! Model for long wave emissivity. */
99  /*! Model for vapor diffusion (requires enabled moisture balance). */
101  /*! Model for air flow calculation. */
103 
104  /*! Comment, indicating the zone this interface links to.
105  \warning This comment is set automatically when the project is written
106  with Project::writeXML(). Any existing text will be overwritten.
107  */
108  std::string m_comment; // XML:C
109 };
110 
111 } // namespace NANDRAD
112 
113 #endif // NANDRAD_InterfaceH
Contains parameters for vapor diffusion flux calculation.
InterfaceHeatConduction m_heatConduction
Model for convective heat transfer.
InterfaceLongWaveEmission m_longWaveEmission
Model for long wave emissivity.
Contains parameters for convenctive air flow through construction.
Contains global constants for the Nandrad data model.
Contains parameters for long wave radiation exchange (outside).
NANDRAD_COMPARE_WITH_ID void checkParameters() const
Checks for valid parameters.
Parametrization for solar absorption (short wave radiation boundary condition).
unsigned int m_zoneId
The id number of the neighboring zone.
Contains parameters for convenctive heat exchange between walls and zones/ambient climate...
unsigned int INVALID_ID
defines an invalid id
unsigned int m_id
ID of the referenced surface/interface.
InterfaceSolarAbsorption m_solarAbsorption
Model for solar absorption.
std::string m_comment
Comment, indicating the zone this interface links to.
bool haveBCParameters() const
Returns true, if any of the parameters blocks have boundary conditions defined.
An Interface identifies a surface of a wall and stores all data that are needed for boundary conditio...
void updateComment(const std::vector< Zone > &zones)
Updates the comment regarding the zone this interface is connected to.
InterfaceVaporDiffusion m_vaporDiffusion
Model for vapor diffusion (requires enabled moisture balance).
The namespace NANDRAD contains the data model classes that make up the NANDRAD solver input data...
InterfaceAirFlow m_airFlow
Model for air flow calculation.
bool behavesLike(const Interface &other) const
Special form of comparison operator, tests if parameters that have an impact on result calculation ar...