src/isomodel/SolarRadiation.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 ISOMODEL_SOLARRADIATION_HPP | ||
| 7 | #define ISOMODEL_SOLARRADIATION_HPP | ||
| 8 | |||
| 9 | #include <cmath> | ||
| 10 | #include <algorithm> | ||
| 11 | #include <vector> | ||
| 12 | #include "TimeFrame.hpp" | ||
| 13 | #include "EpwData.hpp" | ||
| 14 | #include "../utilities/core/Logger.hpp" | ||
| 15 | |||
| 16 | namespace openstudio { | ||
| 17 | namespace isomodel { | ||
| 18 | |||
| 19 | class SolarRadiation | ||
| 20 | { | ||
| 21 | public: | ||
| 22 | SolarRadiation(const TimeFrame& frame, const EpwData& wdata, double tilt = 3.141592653589); | ||
| 23 | |||
| 24 | static const int NUM_SURFACES = 8; | ||
| 25 | static const int MONTHS = 12; | ||
| 26 | static const int HOURS = 24; | ||
| 27 | |||
| 28 | void Calculate(); | ||
| 29 | |||
| 30 | //outputs | ||
| 31 | const std::vector<std::vector<double>>& eglobe() const { | ||
| 32 | return m_eglobe; | ||
| 33 | } //total solar radiation from direct beam, ground reflect and diffuse | ||
| 34 | //averages | ||
| 35 | 3 | const std::vector<double>& monthlyDryBulbTemp() const { | |
| 36 | 3 | return m_monthlyDryBulbTemp; | |
| 37 | } | ||
| 38 | const std::vector<double>& monthlyDewPointTemp() const { | ||
| 39 | return m_monthlyDewPointTemp; | ||
| 40 | } | ||
| 41 | const std::vector<double>& monthlyRelativeHumidity() const { | ||
| 42 | return m_monthlyRelativeHumidity; | ||
| 43 | } | ||
| 44 | 3 | const std::vector<double>& monthlyWindspeed() const { | |
| 45 | 3 | return m_monthlyWindspeed; | |
| 46 | } | ||
| 47 | 3 | const std::vector<double>& monthlyGlobalHorizontalRadiation() const { | |
| 48 | 3 | return m_monthlyGlobalHorizontalRadiation; | |
| 49 | } | ||
| 50 | 3 | const std::vector<std::vector<double>>& monthlySolarRadiation() const { | |
| 51 | 3 | return m_monthlySolarRadiation; | |
| 52 | } | ||
| 53 | 3 | const std::vector<std::vector<double>>& hourlyDryBulbTemp() const { | |
| 54 | 3 | return m_hourlyDryBulbTemp; | |
| 55 | } | ||
| 56 | const std::vector<std::vector<double>>& hourlyDewPointTemp() const { | ||
| 57 | return m_hourlyDewPointTemp; | ||
| 58 | } | ||
| 59 | 3 | const std::vector<std::vector<double>>& hourlyGlobalHorizontalRadiation() const { | |
| 60 | 3 | return m_hourlyGlobalHorizontalRadiation; | |
| 61 | } | ||
| 62 | |||
| 63 | protected: | ||
| 64 | openstudio::isomodel::TimeFrame m_frame; | ||
| 65 | openstudio::isomodel::EpwData m_weatherData; | ||
| 66 | void calculateSurfaceSolarRadiation(); | ||
| 67 | void calculateAverages(); | ||
| 68 | void calculateMonthAvg(int midx, int cnt); | ||
| 69 | void clearMonthlyAvg(int midx); | ||
| 70 | |||
| 71 | //inputs | ||
| 72 | double m_surfaceTilt; | ||
| 73 | double m_localMeridian; //LSM | ||
| 74 | double m_longitude; | ||
| 75 | double m_latitude; //latitude in radians | ||
| 76 | |||
| 77 | //outputs | ||
| 78 | std::vector<std::vector<double>> m_eglobe; //total solar radiation from direct beam, ground reflect and diffuse | ||
| 79 | |||
| 80 | //averages | ||
| 81 | std::vector<double> m_monthlyDryBulbTemp; | ||
| 82 | std::vector<double> m_monthlyDewPointTemp; | ||
| 83 | std::vector<double> m_monthlyRelativeHumidity; | ||
| 84 | std::vector<double> m_monthlyWindspeed; | ||
| 85 | std::vector<double> m_monthlyGlobalHorizontalRadiation; | ||
| 86 | std::vector<std::vector<double>> m_monthlySolarRadiation; | ||
| 87 | std::vector<std::vector<double>> m_hourlyDryBulbTemp; | ||
| 88 | std::vector<std::vector<double>> m_hourlyDewPointTemp; | ||
| 89 | std::vector<std::vector<double>> m_hourlyGlobalHorizontalRadiation; | ||
| 90 | |||
| 91 | private: | ||
| 92 | REGISTER_LOGGER("openstudio.isomodel.SolarRadiation"); | ||
| 93 | }; | ||
| 94 | |||
| 95 | } // namespace isomodel | ||
| 96 | } // namespace openstudio | ||
| 97 | #endif // ISOMODEL_SOLARRADIATION_HPP | ||
| 98 |