| 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) { |
nothing calls this directly
no test coverage detected