GCC Code Coverage Report


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

src/model/CurveFunctionalPressureDrop.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_CURVEFUNCTIONALPRESSUREDROP_HPP
7 #define MODEL_CURVEFUNCTIONALPRESSUREDROP_HPP
8
9 #include "ModelAPI.hpp"
10 #include "Curve.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 namespace detail {
16
17 class CurveFunctionalPressureDrop_Impl;
18
19 } // namespace detail
20
21 /** CurveFunctionalPressureDrop is a Curve that wraps the OpenStudio IDD object
22 * 'OS:Curve:Functional:PressureDrop'. The functional form is
23 * \f[\displaystyle \begin{array}{lll}
24 * \Delta P = \left(K + f \cdot \frac{L}{D} \right) \cdot \frac{\rho V^2}{2}\\\\
25 * \text{Where:}\\\\
26 * K & = & \text{minorLossCoefficient}\\
27 * f & = & \text{calculated from roughness and Moody-chart, or set by fixed friction factor}\\
28 * L & = & \text{length}\\
29 * D & = & \text{diameter}\\
30 * \rho & = & V\ \text{from plant simulation}\\
31 * \end{array}\f] */
32 class MODEL_API CurveFunctionalPressureDrop : public Curve
33 {
34 public:
35 /** @name Constructors and Destructors */
36 //@{
37
38 /** Sets \f$D = 0.05\f$ */
39 explicit CurveFunctionalPressureDrop(const Model& model);
40
41 1 virtual ~CurveFunctionalPressureDrop() override = default;
42 // Default the copy and move operators because the virtual dtor is explicit
43 ✗ CurveFunctionalPressureDrop(const CurveFunctionalPressureDrop& other) = default;
44 ✗ CurveFunctionalPressureDrop(CurveFunctionalPressureDrop&& other) = default;
45 ✗ CurveFunctionalPressureDrop& operator=(const CurveFunctionalPressureDrop&) = default;
46 ✗ CurveFunctionalPressureDrop& operator=(CurveFunctionalPressureDrop&&) = default;
47
48 //@}
49
50 static IddObjectType iddObjectType();
51
52 /** @name Getters */
53 //@{
54
55 double diameter() const;
56
57 boost::optional<double> minorLossCoefficient() const;
58
59 boost::optional<double> length() const;
60
61 boost::optional<double> roughness() const;
62
63 boost::optional<double> fixedFrictionFactor() const;
64
65 //@}
66 /** @name Setters */
67 //@{
68
69 bool setDiameter(double diameter);
70
71 bool setMinorLossCoefficient(double minorLossCoefficient);
72
73 void resetMinorLossCoefficient();
74
75 bool setLength(double length);
76
77 void resetLength();
78
79 bool setRoughness(double roughness);
80
81 void resetRoughness();
82
83 bool setFixedFrictionFactor(double fixedFrictionFactor);
84
85 void resetFixedFrictionFactor();
86
87 //@}
88 /** @name Other */
89 //@{
90
91 //@}
92 protected:
93 /// @cond
94 using ImplType = detail::CurveFunctionalPressureDrop_Impl;
95
96 explicit CurveFunctionalPressureDrop(std::shared_ptr<detail::CurveFunctionalPressureDrop_Impl> impl);
97
98 friend class detail::CurveFunctionalPressureDrop_Impl;
99 friend class Model;
100 friend class IdfObject;
101 friend class openstudio::detail::IdfObject_Impl;
102
103 /// @endcond
104 private:
105 REGISTER_LOGGER("openstudio.model.CurveFunctionalPressureDrop");
106 };
107
108 /** \relates CurveFunctionalPressureDrop*/
109 using OptionalCurveFunctionalPressureDrop = boost::optional<CurveFunctionalPressureDrop>;
110
111 /** \relates CurveFunctionalPressureDrop*/
112 using CurveFunctionalPressureDropVector = std::vector<CurveFunctionalPressureDrop>;
113
114 } // namespace model
115 } // namespace openstudio
116
117 #endif // MODEL_CURVEFUNCTIONALPRESSUREDROP_HPP
118