MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / netSiteEnergy

Method netSiteEnergy

src/utilities/sql/SqlFile_Impl.cpp:943–971  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

941 }
942
943 boost::optional<double> SqlFile_Impl::netSiteEnergy() const {
944 boost::optional<double> hours = hoursSimulated();
945 if (!hours) {
946 LOG(Warn, "Reporting Net Site Energy with unknown number of simulation hours");
947 } else if (*hours != 8760) {
948 LOG(Warn, "Reporting Net Site Energy with " << *hours << " hrs");
949 }
950
951 std::string s = R"(SELECT Value FROM TabularDataWithStrings
952 WHERE ReportName='AnnualBuildingUtilityPerformanceSummary'
953 AND ReportForString='Entire Facility'
954 AND TableName='Site and Source Energy'
955 AND RowName='Net Site Energy'
956 AND ColumnName='Total Energy'
957 AND Units='GJ')";
958 boost::optional<double> d = execAndReturnFirstDouble(s);
959
960 if (!d) {
961 LOG(Warn, "Tabular results were not found, trying to calculate it ourselves");
962 std::string s = " \
963 select sum(VariableValue)/1000000000 from ReportMeterData, ReportMeterDataDictionary \
964 where (ReportMeterData.ReportMeterDataDictionaryIndex = ReportMeterDataDictionary.ReportMeterDataDictionaryIndex and variablename not like '%EnergyTransfer%')\
965 group by ReportingFrequency;\
966 ";
967 d = execAndReturnFirstDouble(s);
968 }
969
970 return d;
971 }
972
973 boost::optional<double> SqlFile_Impl::netSourceEnergy() const {
974 boost::optional<double> hours = hoursSimulated();

Callers

nothing calls this directly

Calls 1

execAndReturnFirstDoubleFunction · 0.70

Tested by

no test coverage detected