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

Method uFactor

src/model/Surface.cpp:583–632  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

581 }
582
583 boost::optional<double> Surface_Impl::uFactor() const {
584 OptionalConstructionBase oConstruction = construction();
585 OptionalDouble result;
586
587 if (oConstruction) {
588 // from input
589 OptionalDouble inputResult = oConstruction->uFactor(filmResistance());
590
591 // from output
592 OptionalSqlFile sqlFile = model().sqlFile();
593 OptionalString constructionName = oConstruction->name();
594 OptionalDouble outputResult;
595 OptionalString surfaceName = name();
596
597 // opaque exterior
598 if (sqlFile && constructionName && oConstruction->isOpaque()) {
599 std::string query = R"(SELECT Value from TabularDataWithStrings
600 WHERE ReportName = 'EnvelopeSummary'
601 AND ReportForString = 'Entire Facility'
602 AND TableName = 'Opaque Exterior'
603 AND ColumnName = 'U-Factor with Film'
604 AND Units='W/m2-K'
605 AND RowName = ?;)";
606 outputResult = sqlFile->execAndReturnFirstDouble(query, to_upper_copy(*surfaceName));
607 }
608
609 // fenestration
610 if (sqlFile && constructionName && oConstruction->isFenestration()) {
611 std::string query = R"(SELECT Value from TabularDataWithStrings
612 WHERE ReportName = 'EnvelopeSummary'
613 AND ReportForString = 'Entire Facility'
614 AND TableName = 'Exterior Fenestration'
615 AND ColumnName = 'Glass U-Factor'
616 AND Units='W/m2-K'
617 AND RowName = ?;)";
618 outputResult = sqlFile->execAndReturnFirstDouble(query, to_upper_copy(*surfaceName));
619 }
620
621 if (inputResult) {
622 result = inputResult;
623 if (outputResult) {
624 compareInputAndOutput(*oConstruction, "uFactor", *inputResult, *outputResult, 1.0E-3);
625 }
626 } else {
627 result = outputResult;
628 }
629 }
630
631 return result;
632 }
633
634 boost::optional<double> Surface_Impl::thermalConductance() const {
635 OptionalConstructionBase oConstruction = construction();

Callers 10

runMethod · 0.45
osm2iso.rbFile · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
Surface_GTest.cppFile · 0.45
translateModelMethod · 0.45

Calls 7

nameClass · 0.85
compareInputAndOutputFunction · 0.85
sqlFileMethod · 0.80
nameMethod · 0.45
isOpaqueMethod · 0.45
isFenestrationMethod · 0.45

Tested by 2

TEST_FFunction · 0.36
TEST_FFunction · 0.36