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

Method thermalConductance

src/model/Surface.cpp:634–689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

632 }
633
634 boost::optional<double> Surface_Impl::thermalConductance() const {
635 OptionalConstructionBase oConstruction = construction();
636 OptionalDouble result;
637
638 if (oConstruction) {
639 // from input
640 OptionalDouble inputResult = oConstruction->thermalConductance(filmResistance());
641
642 // from output
643 OptionalSqlFile sqlFile = model().sqlFile();
644 OptionalString constructionName = oConstruction->name();
645 OptionalDouble outputResult;
646 OptionalString surfaceName = name();
647
648 // opaque exterior
649 if (sqlFile && constructionName && oConstruction->isOpaque()) {
650 std::string query = R"(SELECT Value from TabularDataWithStrings
651 WHERE ReportName = 'EnvelopeSummary'
652 AND ReportForString = 'Entire Facility'
653 AND TableName = 'Opaque Exterior'
654 AND ColumnName = 'U-Factor no Film'
655 AND Units='W/m2-K'
656 AND RowName = ?;)";
657 outputResult = sqlFile->execAndReturnFirstDouble(query, to_upper_copy(*surfaceName));
658 }
659
660 // fenestration
661 if (sqlFile && constructionName && oConstruction->isFenestration()) {
662
663 // get u-factor, then subtract film coefficients
664 std::string query = R"(SELECT Value from TabularDataWithStrings
665 WHERE ReportName = 'EnvelopeSummary'
666 AND ReportForString = 'Entire Facility'
667 AND TableName = 'Exterior Fenestration'
668 AND ColumnName = 'Glass U-Factor'
669 AND Units='W/m2-K'
670 AND RowName = ?;)";
671 outputResult = sqlFile->execAndReturnFirstDouble(query, to_upper_copy(*surfaceName));
672
673 if (outputResult) {
674 outputResult = 1.0 / (1.0 / (*outputResult) - filmResistance());
675 }
676 }
677
678 if (inputResult) {
679 result = inputResult;
680 if (outputResult) {
681 compareInputAndOutput(*oConstruction, "thermal conductance", *inputResult, *outputResult, 1.0E-5);
682 }
683 } else {
684 result = outputResult;
685 }
686 }
687
688 return result;
689 }
690
691 bool Surface_Impl::setUFactor(double value) {

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected