GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 1 / 1 / 2
Functions: 100.0% 1 / 1 / 2
Branches: -% 0 / 1 / 1

src/model/GasMixture_Impl.hpp
Line Branch Exec Source
1 /***********************************************************************************************************************
2 * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC.
3 * See also https://openstudio.net/license
4 ***********************************************************************************************************************/
5
6 #ifndef MODEL_GASMIXTURE_IMPL_HPP
7 #define MODEL_GASMIXTURE_IMPL_HPP
8
9 #include "ModelAPI.hpp"
10 #include "GasLayer_Impl.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 namespace detail {
16
17 /** GasMixture_Impl is a GasLayer_Impl that is the implementation class for GasMixture.*/
18 class MODEL_API GasMixture_Impl : public GasLayer_Impl
19 {
20
21 public:
22 /** @name Constructors and Destructors */
23 //@{
24
25 GasMixture_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle);
26
27 GasMixture_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle);
28
29 GasMixture_Impl(const GasMixture_Impl& other, Model_Impl* model, bool keepHandle);
30
31 4 virtual ~GasMixture_Impl() override = default;
32
33 //@}
34
35 /** @name Virtual Methods */
36 //@{
37
38 virtual const std::vector<std::string>& outputVariableNames() const override;
39
40 virtual IddObjectType iddObjectType() const override;
41
42 //@}
43 /** @name Getters */
44 //@{
45
46 /** Get the thickness of the material. */
47 virtual double thickness() const override;
48
49 /** Get the type of gas at index, where index starts at 0. Throws if unavailable. */
50 std::string getGasType(unsigned index) const;
51
52 double getGasFraction(unsigned index) const;
53
54 /** The conductivity (W/m*K) at temperature (K). Will throw if necessary values are not
55 * available. */
56 double getThermalConductivity(double temperature) const;
57
58 /** The conductance (W/m^2*K) at temperature (K). Will throw if necessary values are not
59 * available. */
60 double getThermalConductance(double temperature) const;
61
62 /** The resistivity (m*K/W) at temperature (K). Will throw if necessary values are not
63 * available. */
64 double getThermalResistivity(double temperature) const;
65
66 /** The resistance (m^2*K/W) at temperature (K). Will throw if necessary values are not
67 * available. */
68 double getThermalResistance(double temperature) const;
69
70 double getViscosity(double temperature) const;
71
72 double getSpecificHeat(double temperature) const;
73
74 int numberofGasesinMixture() const;
75
76 std::string gas1Type() const;
77
78 double gas1Fraction() const;
79
80 std::string gas2Type() const;
81
82 double gas2Fraction() const;
83
84 std::string gas3Type() const;
85
86 boost::optional<double> gas3Fraction() const;
87
88 std::string gas4Type() const;
89
90 boost::optional<double> gas4Fraction() const;
91
92 //@}
93 /** @name Setters */
94 //@{
95
96 /** Set thickness to value (m). */
97 virtual bool setThickness(double value) override;
98
99 /** Set the gas at index, if index <= numGases. */
100 bool setGas(unsigned index, const std::string& type, double fraction);
101
102 bool setGasType(unsigned index, const std::string& type);
103
104 bool setGasFraction(unsigned index, double fraction);
105
106 /** Append gas if numGases < 4. */
107 bool addGas(const std::string& type, double fraction);
108
109 /** Set the gas fractions. Length of vector should be equal to numGases, and sum should be
110 * openstudio::equal(1.0). If all fractions except the last is < 1.0, will set last fraction
111 * value if necessary (and issue warning). */
112 bool setFractions(const std::vector<double>& fractions);
113
114 /** Assign gas fraction at index to 1.0 - sum(other gas fractions), if index < numGases. */
115 bool balanceFractions(unsigned index);
116
117 bool setNumberofGasesinMixture(int numberofGasesinMixture);
118
119 bool setGas1Type(const std::string& gas1Type);
120
121 void resetGas1Type();
122
123 bool setGas1Fraction(double gas1Fraction);
124
125 void resetGas1Fraction();
126
127 bool setGas2Type(const std::string& gas2Type);
128
129 void resetGas2Type();
130
131 bool setGas2Fraction(double gas2Fraction);
132
133 void resetGas2Fraction();
134
135 bool setGas3Type(boost::optional<std::string> gas3Type);
136
137 void resetGas3Type();
138
139 bool setGas3Fraction(boost::optional<double> gas3Fraction);
140
141 void resetGas3Fraction();
142
143 bool setGas4Type(boost::optional<std::string> gas4Type);
144
145 void resetGas4Type();
146
147 bool setGas4Fraction(boost::optional<double> gas4Fraction);
148
149 void resetGas4Fraction();
150
151 //@}
152 /** @name Queries */
153 //@{
154
155 unsigned numGases() const;
156
157 //@}
158 /** @name Other */
159 //@{
160
161 //@}
162 protected:
163 private:
164 − REGISTER_LOGGER("openstudio.model.GasMixture");
165
166 unsigned mf_getGasTypeFieldIndex(unsigned gasIndex) const;
167
168 unsigned mf_getGasFractionFieldIndex(unsigned gasIndex) const;
169
170 std::vector<std::string> gas1TypeValues() const;
171 std::vector<std::string> gas2TypeValues() const;
172 std::vector<std::string> gas3TypeValues() const;
173 std::vector<std::string> gas4TypeValues() const;
174 };
175
176 } // namespace detail
177
178 } // namespace model
179 } // namespace openstudio
180
181 #endif // MODEL_GASMIXTURE_IMPL_HPP
182