From 86b92b1d2b9c803a251fc02d8b74eb378f3aba1c Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Mon, 9 Sep 2024 10:10:32 -0700 Subject: [PATCH 1/8] Tests for effective openness and thickness are added. --- src/Tarcog/src/PermeabilityFactor.cpp | 62 ++++++++++++------- src/Tarcog/tst/units/EffectiveLayers.unit.cpp | 21 +++---- .../tst/units/EffectiveOpenness.unit.cpp | 36 +++++++++++ 3 files changed, 81 insertions(+), 38 deletions(-) create mode 100644 src/Tarcog/tst/units/EffectiveOpenness.unit.cpp diff --git a/src/Tarcog/src/PermeabilityFactor.cpp b/src/Tarcog/src/PermeabilityFactor.cpp index f9cdc0cf..c2c55d6f 100644 --- a/src/Tarcog/src/PermeabilityFactor.cpp +++ b/src/Tarcog/src/PermeabilityFactor.cpp @@ -51,40 +51,54 @@ namespace ThermalPermeability return curvature; } - double frontOpenness(const double t_TiltAngle, - const double t_SlatSpacing, - const double t_MatThickness, - const double t_SlatCurvature, - const double t_SlatWidth) + double frontOpenness(const double tiltAngle, + const double slatSpacing, + const double matThickness, + const double slatCurvature, + const double slatWidth) { - const auto aRise{calculateRise(t_SlatCurvature, t_SlatWidth)}; - const auto h{aRise > 1e-6 ? aRise : 1e-6}; - const auto temp{h + pow(t_SlatWidth, 2) / (4 * h)}; - const auto Ls{asin(t_SlatWidth / temp) * temp}; - const auto angleMax{maxAngle(t_SlatSpacing, t_MatThickness)}; - const auto slatAngle{std::fmin(std::abs(t_TiltAngle), angleMax)}; - - double cosPhi = std::cos(slatAngle * ConstantsData::WCE_PI / 180); - double sinPhi = std::sin(std::abs(slatAngle) * ConstantsData::WCE_PI / 180); - if((slatAngle == 90) || (slatAngle == -90)) - cosPhi = 0; - auto opennessFactor{ - 1 - - (t_MatThickness * Ls) - / ((Ls * cosPhi + t_MatThickness * sinPhi) * (t_SlatSpacing + t_MatThickness))}; + // Calculate rise based on slat curvature and width + const auto rise = calculateRise(slatCurvature, slatWidth); + const auto effectiveRise = (rise > 1e-6) ? rise : 1e-6; + + // Calculate the length of slat arc (Ls) + const auto temp = effectiveRise + pow(slatWidth, 2) / (4 * effectiveRise); + const auto slatArcLength = asin(slatWidth / temp) * temp; + + // Determine the maximum allowable angle and the effective slat angle + const auto effectiveSlatAngle = + std::fmin(std::abs(tiltAngle), maxAngle(slatSpacing, matThickness)); + + // Handle special cases where slat angle is 90 degrees + const double adjustedCosPhi = + (effectiveSlatAngle == 90 || effectiveSlatAngle == -90) + ? 0 + : std::cos(FenestrationCommon::radians(effectiveSlatAngle)); + + // Compute the openness factor + auto opennessFactor = + 1.0 + - (matThickness * slatArcLength) + / ((slatArcLength * adjustedCosPhi + + matThickness * std::sin(FenestrationCommon::radians(effectiveSlatAngle))) + * (slatSpacing + matThickness)); + + // Ensure openness factor is non-negative if(opennessFactor < 0) opennessFactor = 0; + return opennessFactor; } + } // namespace Venetian namespace Perforated { double frontOpenness(Type t_Type, - double t_SpacingX, - double t_SpacingY, - double t_DimensionX, - double t_DimensionY) + double t_SpacingX, + double t_SpacingY, + double t_DimensionX, + double t_DimensionY) { const auto cellArea{t_SpacingX * t_SpacingY}; std::map> opennessFraction{ diff --git a/src/Tarcog/tst/units/EffectiveLayers.unit.cpp b/src/Tarcog/tst/units/EffectiveLayers.unit.cpp index 6116e319..e9dd7cf3 100644 --- a/src/Tarcog/tst/units/EffectiveLayers.unit.cpp +++ b/src/Tarcog/tst/units/EffectiveLayers.unit.cpp @@ -3,14 +3,7 @@ #include -class TestEffectiveLayers : public testing::Test -{ -protected: - void SetUp() override - {} -}; - -TEST_F(TestEffectiveLayers, TestVenetianHorizontalEffectiveLayer) +TEST(TestEffectiveLayers, TestVenetianHorizontalEffectiveLayer) { SCOPED_TRACE("Begin Test: Venetian horizontal effective layer properties."); @@ -33,7 +26,7 @@ TEST_F(TestEffectiveLayers, TestVenetianHorizontalEffectiveLayer) EXPECT_NEAR(1.592911e-2, effectiveOpenness.Ah, 1e-8); } -TEST_F(TestEffectiveLayers, TestVenetianHorizontalEffectiveLayerWithTopAndBotOpenness) +TEST(TestEffectiveLayers, TestVenetianHorizontalEffectiveLayerWithTopAndBotOpenness) { SCOPED_TRACE("Begin Test: Venetian horizontal effective layer properties."); @@ -60,7 +53,7 @@ TEST_F(TestEffectiveLayers, TestVenetianHorizontalEffectiveLayerWithTopAndBotOpe EXPECT_NEAR(0, effectiveOpenness.Ar, 1e-8); } -TEST_F(TestEffectiveLayers, TestVenetianVerticalEffectiveLayerWithTopAndBotOpenness) +TEST(TestEffectiveLayers, TestVenetianVerticalEffectiveLayerWithTopAndBotOpenness) { SCOPED_TRACE("Begin Test: Venetian horizontal effective layer properties."); @@ -87,7 +80,7 @@ TEST_F(TestEffectiveLayers, TestVenetianVerticalEffectiveLayerWithTopAndBotOpenn EXPECT_NEAR(0, effectiveOpenness.Ar, 1e-8); } -TEST_F(TestEffectiveLayers, TestVenetianVerticalEffectiveLayerWithTopAndBotOpenness45Deg) +TEST(TestEffectiveLayers, TestVenetianVerticalEffectiveLayerWithTopAndBotOpenness45Deg) { SCOPED_TRACE("Begin Test: Venetian horizontal effective layer properties."); @@ -114,7 +107,7 @@ TEST_F(TestEffectiveLayers, TestVenetianVerticalEffectiveLayerWithTopAndBotOpenn EXPECT_NEAR(0, effectiveOpenness.Ar, 1e-8); } -TEST_F(TestEffectiveLayers, TestPerforatedEffectiveOpenness) +TEST(TestEffectiveLayers, TestPerforatedEffectiveOpenness) { SCOPED_TRACE("Begin Test: Venetian horizontal effective layer properties."); @@ -139,7 +132,7 @@ TEST_F(TestEffectiveLayers, TestPerforatedEffectiveOpenness) EXPECT_NEAR(7.2e-3, effectiveOpenness.Ar, 1e-8); } -TEST_F(TestEffectiveLayers, TestOtherShadingEffectiveOpenness) +TEST(TestEffectiveLayers, TestOtherShadingEffectiveOpenness) { SCOPED_TRACE("Begin Test: Venetian horizontal effective layer properties."); @@ -163,7 +156,7 @@ TEST_F(TestEffectiveLayers, TestOtherShadingEffectiveOpenness) EXPECT_NEAR(0.0072, effectiveOpenness.Ar, 1e-8); } -TEST_F(TestEffectiveLayers, RadiusFromRise) +TEST(TestEffectiveLayers, RadiusFromRise) { double curvature{23.88962765}; double slatWidth{14.8}; diff --git a/src/Tarcog/tst/units/EffectiveOpenness.unit.cpp b/src/Tarcog/tst/units/EffectiveOpenness.unit.cpp new file mode 100644 index 00000000..97d2256c --- /dev/null +++ b/src/Tarcog/tst/units/EffectiveOpenness.unit.cpp @@ -0,0 +1,36 @@ +#include + +#include + +/// Results are compared vs Robert Hart's blindOpenness.xlsx spreadsheet + +TEST(TestEffectiveOpenness, Venetian0DegFrontOpenness) +{ + SCOPED_TRACE("Begin Test: Venetian blind effective openness calculations (slat tilt = 0 deg."); + + const auto materialThickness{0.0001}; // m + const auto slatTiltAngle{0.0}; + const auto slatWidth{0.00125}; // m + const auto slatSpacing{0.001}; // m + const auto slatCurvature{0.0}; + + auto opennessFactor{ThermalPermeability::Venetian::frontOpenness( + slatTiltAngle, slatSpacing, materialThickness, slatCurvature, slatWidth)}; + + EXPECT_NEAR(0.909091, opennessFactor, 1e-6); + + EffectiveLayers::ShadeOpenness openness{opennessFactor, 0, 0, 0, 0}; + + const auto width{1.0}; // m + const auto height{1.0}; // m + + EffectiveLayers::EffectiveHorizontalVenetian venetian{ + width, height, materialThickness, openness, slatTiltAngle, slatWidth}; + + const auto effectiveThickness{venetian.effectiveThickness()}; + + EXPECT_NEAR(0.05375e-03, effectiveThickness, 1e-9); + + const auto effectiveOpenness{venetian.getEffectiveOpenness()}; + EXPECT_NEAR(0.01521184, effectiveOpenness.Ah, 1e-8); +} \ No newline at end of file From a439d0096a6063f359cb8fc928e0cb71ea2263bc Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Wed, 11 Sep 2024 09:19:35 -0700 Subject: [PATCH 2/8] Several unit tests added that are calculating openness factor based on the geometry. --- src/Tarcog/src/PermeabilityFactor.cpp | 7 +- .../tst/units/EffectiveOpenness.unit.cpp | 97 +++++++++++++++++++ 2 files changed, 99 insertions(+), 5 deletions(-) diff --git a/src/Tarcog/src/PermeabilityFactor.cpp b/src/Tarcog/src/PermeabilityFactor.cpp index c2c55d6f..dc4cc707 100644 --- a/src/Tarcog/src/PermeabilityFactor.cpp +++ b/src/Tarcog/src/PermeabilityFactor.cpp @@ -77,11 +77,8 @@ namespace ThermalPermeability // Compute the openness factor auto opennessFactor = - 1.0 - - (matThickness * slatArcLength) - / ((slatArcLength * adjustedCosPhi - + matThickness * std::sin(FenestrationCommon::radians(effectiveSlatAngle))) - * (slatSpacing + matThickness)); + 1.0 - (matThickness * slatArcLength) / ((slatArcLength * adjustedCosPhi + + matThickness * std::sin(FenestrationCommon::radians(effectiveSlatAngle))) * (slatSpacing + matThickness)); // Ensure openness factor is non-negative if(opennessFactor < 0) diff --git a/src/Tarcog/tst/units/EffectiveOpenness.unit.cpp b/src/Tarcog/tst/units/EffectiveOpenness.unit.cpp index 97d2256c..33a68654 100644 --- a/src/Tarcog/tst/units/EffectiveOpenness.unit.cpp +++ b/src/Tarcog/tst/units/EffectiveOpenness.unit.cpp @@ -33,4 +33,101 @@ TEST(TestEffectiveOpenness, Venetian0DegFrontOpenness) const auto effectiveOpenness{venetian.getEffectiveOpenness()}; EXPECT_NEAR(0.01521184, effectiveOpenness.Ah, 1e-8); +} + +TEST(TestEffectiveOpenness, Venetian0DegFrontOpenness1) +{ + SCOPED_TRACE("Begin Test: Venetian blind effective openness calculations (slat tilt = 0 deg."); + + const auto materialThickness{0.0006}; // m + const auto slatTiltAngle{0.0}; + const auto slatWidth{0.016}; // m + const auto slatSpacing{0.0114}; // m + const auto slatCurvature{0.0}; + + auto opennessFactor{ThermalPermeability::Venetian::frontOpenness( + slatTiltAngle, slatSpacing, materialThickness, slatCurvature, slatWidth)}; + + EXPECT_NEAR(0.95, opennessFactor, 1e-6); + + EffectiveLayers::ShadeOpenness openness{opennessFactor, 0, 0, 0, 0}; + + const auto width{1.0}; // m + const auto height{1.0}; // m + + EffectiveLayers::EffectiveHorizontalVenetian venetian{ + width, height, materialThickness, openness, slatTiltAngle, slatWidth}; + + const auto effectiveThickness{venetian.effectiveThickness()}; + + EXPECT_NEAR(0.688e-3, effectiveThickness, 1e-9); + + const auto effectiveOpenness{venetian.getEffectiveOpenness()}; + EXPECT_NEAR(0.015570892, effectiveOpenness.Ah, 1e-8); +} + +TEST(TestEffectiveOpenness, Venetian45DegFrontOpenness1) +{ + SCOPED_TRACE("Begin Test: Venetian blind effective openness calculations (slat tilt = 0 deg."); + + const auto materialThickness{0.0006}; // m + const auto slatTiltAngle{45.0}; + const auto slatWidth{0.016}; // m + const auto slatSpacing{0.0114}; // m + const auto slatCurvature{0.0}; + + auto opennessFactor{ThermalPermeability::Venetian::frontOpenness( + slatTiltAngle, slatSpacing, materialThickness, slatCurvature, slatWidth)}; + + EXPECT_NEAR(0.931845, opennessFactor, 1e-6); + + EffectiveLayers::ShadeOpenness openness{opennessFactor, 0, 0, 0, 0}; + + const auto width{1.0}; // m + const auto height{1.0}; // m + + EffectiveLayers::EffectiveHorizontalVenetian venetian{ + width, height, materialThickness, openness, slatTiltAngle, slatWidth}; + + const auto effectiveThickness{venetian.effectiveThickness()}; + + EXPECT_NEAR(0.504733e-3, effectiveThickness, 1e-9); + + const auto effectiveOpenness{venetian.getEffectiveOpenness()}; + EXPECT_NEAR(0.01730331, effectiveOpenness.Ah, 1e-8); +} + +TEST(TestEffectiveOpenness, Venetian0DegWithRise) +{ + SCOPED_TRACE("Begin Test: Venetian blind effective openness calculations (slat tilt = 0 deg."); + + const auto materialThickness{0.0006}; // m + const auto slatTiltAngle{0.0}; // deg + const auto slatWidth{0.016}; // m + const auto slatSpacing{0.0114}; // m + const auto slatRise{0.002}; // m + + auto opennessFactor{ThermalPermeability::Venetian::frontOpenness( + slatTiltAngle, + slatSpacing, + materialThickness, + ThermalPermeability::Venetian::calculateCurvature(slatRise, slatWidth), + slatWidth)}; + + EXPECT_NEAR(0.95, opennessFactor, 1e-6); + + EffectiveLayers::ShadeOpenness openness{opennessFactor, 0, 0, 0, 0}; + + const auto width{1.0}; // m + const auto height{1.0}; // m + + EffectiveLayers::EffectiveHorizontalVenetian venetian{ + width, height, materialThickness, openness, slatTiltAngle, slatWidth}; + + const auto effectiveThickness{venetian.effectiveThickness()}; + + EXPECT_NEAR(0.688e-3, effectiveThickness, 1e-9); + + const auto effectiveOpenness{venetian.getEffectiveOpenness()}; + EXPECT_NEAR(0.015570892, effectiveOpenness.Ah, 1e-8); } \ No newline at end of file From 3c6b75b40e2a65880ea9cfc017dbfe0464e794b3 Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Tue, 17 Sep 2024 16:25:13 -0700 Subject: [PATCH 3/8] EffectiveLayer now have PermeabilityFactor. --- src/Tarcog/src/EffectiveOpenness.cpp | 17 ++++++++++------- src/Tarcog/src/EffectiveOpenness.hpp | 10 +++++++--- src/Tarcog/src/Layers.cpp | 2 +- .../units/DoubleClearIndoorShadeAir.unit.cpp | 4 +++- .../units/DoubleClearOutdoorShadeAir.unit.cpp | 3 ++- src/Tarcog/tst/units/EffectiveLayers.unit.cpp | 5 ++++- ...hIntegratedShadingForcedVentilation.unit.cpp | 3 ++- .../units/GapLayerInBetweenVentilation.unit.cpp | 3 ++- src/Tarcog/tst/units/ShadeOut.unit.cpp | 11 +++++++---- .../tst/units/TripleInBetweenShadeAir.unit.cpp | 3 ++- .../units/TripleInBetweenShadeAirArgon.unit.cpp | 3 ++- .../tst/units/TripleShadeInside_UValue.unit.cpp | 3 ++- 12 files changed, 44 insertions(+), 23 deletions(-) diff --git a/src/Tarcog/src/EffectiveOpenness.cpp b/src/Tarcog/src/EffectiveOpenness.cpp index dc7c48bd..341f9725 100644 --- a/src/Tarcog/src/EffectiveOpenness.cpp +++ b/src/Tarcog/src/EffectiveOpenness.cpp @@ -14,27 +14,29 @@ namespace EffectiveLayers const double atop, const double abot, const double frontPorosity) : - Ah(ah), Al(al), Ar(ar), Atop(atop), Abot(abot), FrontPorosity(frontPorosity) + Ah(ah), Al(al), Ar(ar), Atop(atop), Abot(abot), PermeabilityFactor(frontPorosity) {} bool isClosed(const EffectiveOpenness & effectiveOpenness) { return effectiveOpenness.Ah == 0.0 && effectiveOpenness.Al == 0.0 && effectiveOpenness.Ar == 0.0 && effectiveOpenness.Atop == 0.0 - && effectiveOpenness.Abot == 0.0 && effectiveOpenness.FrontPorosity == 0.0; + && effectiveOpenness.Abot == 0.0 && effectiveOpenness.PermeabilityFactor == 0.0; } EffectiveLayer::EffectiveLayer(double width, double height, double thickness, const ShadeOpenness & openness, - const Coefficients & coefficients) : + const Coefficients & coefficients, + double permeabilityFactor) : m_Width(width), m_Height(height), m_Thickness(thickness), m_ShadeOpenness( openness.Ah * width * height, openness.Dl, openness.Dr, openness.Dtop, openness.Dbot), - coefficients{coefficients} + coefficients(coefficients), + m_PermeabilityFactor(permeabilityFactor) {} Coefficients::Coefficients(double c1, double c2, double c3, double c4) : @@ -150,8 +152,9 @@ namespace EffectiveLayers EffectiveLayerOther::EffectiveLayerOther(double width, double height, double thickness, - const ShadeOpenness & openness) : - EffectiveLayer(width, height, thickness, openness) + const ShadeOpenness & openness, + double permeabilityFactor) : + EffectiveLayer(width, height, thickness, openness, Coefficients(0, 0, 0, 0), permeabilityFactor) {} EffectiveOpenness EffectiveLayerOther::getEffectiveOpenness() @@ -161,7 +164,7 @@ namespace EffectiveLayers m_ShadeOpenness.Dr * m_Height, m_ShadeOpenness.Dtop * m_Width, m_ShadeOpenness.Dbot * m_Width, - m_ShadeOpenness.Ah}; + m_PermeabilityFactor}; } double EffectiveLayerOther::effectiveThickness() diff --git a/src/Tarcog/src/EffectiveOpenness.hpp b/src/Tarcog/src/EffectiveOpenness.hpp index 7580fe8c..8afbc8d6 100644 --- a/src/Tarcog/src/EffectiveOpenness.hpp +++ b/src/Tarcog/src/EffectiveOpenness.hpp @@ -31,7 +31,7 @@ namespace EffectiveLayers double Atop; double Abot; // Geometrical openness used to calculate equivalent layer conductivity - double FrontPorosity; + double PermeabilityFactor; }; bool isClosed(const EffectiveOpenness & effectiveOpenness); @@ -55,7 +55,8 @@ namespace EffectiveLayers double height, double thickness, const ShadeOpenness & openness, - const Coefficients & coefficients = {0.0, 0.0, 0.0, 0.0}); + const Coefficients & coefficients = {0.0, 0.0, 0.0, 0.0}, + double permeabilityFactor = 0.0); virtual EffectiveOpenness getEffectiveOpenness() = 0; @@ -69,6 +70,8 @@ namespace EffectiveLayers ShadeOpenness m_ShadeOpenness; Coefficients coefficients; + + double m_PermeabilityFactor; }; class EffectiveVenetian : public EffectiveLayer @@ -167,7 +170,8 @@ namespace EffectiveLayers EffectiveLayerOther(double width, double height, double thickness, - const ShadeOpenness & openness); + const ShadeOpenness & openness, + double permeabilityFactor); EffectiveOpenness getEffectiveOpenness() override; double effectiveThickness() override; diff --git a/src/Tarcog/src/Layers.cpp b/src/Tarcog/src/Layers.cpp index 6b2c4396..b57e422b 100644 --- a/src/Tarcog/src/Layers.cpp +++ b/src/Tarcog/src/Layers.cpp @@ -132,7 +132,7 @@ namespace Tarcog::ISO15099::Layers effectiveOpenness.Al, effectiveOpenness.Ar, effectiveOpenness.Ah, - effectiveOpenness.FrontPorosity), + effectiveOpenness.PermeabilityFactor), std::make_shared(frontEmissivity, frontIRTransmittance), std::make_shared(backEmissivity, backIRTransmittance)); } diff --git a/src/Tarcog/tst/units/DoubleClearIndoorShadeAir.unit.cpp b/src/Tarcog/tst/units/DoubleClearIndoorShadeAir.unit.cpp index 1250fe23..b81d1bc3 100644 --- a/src/Tarcog/tst/units/DoubleClearIndoorShadeAir.unit.cpp +++ b/src/Tarcog/tst/units/DoubleClearIndoorShadeAir.unit.cpp @@ -51,13 +51,15 @@ class TestDoubleClearIndoorShadeAir : public testing::Test auto dleft = 0.1; auto dright = 0.1; auto Afront = 0.2; + auto PermeabilityFactor = 0.2; + EffectiveLayers::ShadeOpenness openness{Afront, dleft, dright, dtop, dbot}; auto windowWidth = 1.0; auto windowHeight = 1.0; EffectiveLayers::EffectiveLayerOther effectiveLayer{ - windowWidth, windowHeight, shadeLayerThickness, openness}; + windowWidth, windowHeight, shadeLayerThickness, openness, PermeabilityFactor}; auto layer3 = Tarcog::ISO15099::Layers::shading( shadeLayerThickness, shadeLayerConductance, effectiveLayer.getEffectiveOpenness()); diff --git a/src/Tarcog/tst/units/DoubleClearOutdoorShadeAir.unit.cpp b/src/Tarcog/tst/units/DoubleClearOutdoorShadeAir.unit.cpp index 7917db47..ae2129cc 100644 --- a/src/Tarcog/tst/units/DoubleClearOutdoorShadeAir.unit.cpp +++ b/src/Tarcog/tst/units/DoubleClearOutdoorShadeAir.unit.cpp @@ -48,6 +48,7 @@ class TestDoubleClearOutdoorShadeAir : public testing::Test auto dleft = 0.1; auto dright = 0.1; auto Afront = 0.2; + auto PermeabilityFactor = 0.2; EffectiveLayers::ShadeOpenness openness{Afront, dleft, dright, dtop, dbot}; @@ -55,7 +56,7 @@ class TestDoubleClearOutdoorShadeAir : public testing::Test double windowHeight = 1; EffectiveLayers::EffectiveLayerOther effectiveLayer{ - windowWidth, windowHeight, shadeLayerThickness, openness}; + windowWidth, windowHeight, shadeLayerThickness, openness, PermeabilityFactor}; auto layer1 = Tarcog::ISO15099::Layers::shading( shadeLayerThickness, shadeLayerConductance, effectiveLayer.getEffectiveOpenness()); diff --git a/src/Tarcog/tst/units/EffectiveLayers.unit.cpp b/src/Tarcog/tst/units/EffectiveLayers.unit.cpp index e9dd7cf3..e333e3ea 100644 --- a/src/Tarcog/tst/units/EffectiveLayers.unit.cpp +++ b/src/Tarcog/tst/units/EffectiveLayers.unit.cpp @@ -142,7 +142,10 @@ TEST(TestEffectiveLayers, TestOtherShadingEffectiveOpenness) EffectiveLayers::ShadeOpenness openness{0.087265995, 0.005, 0.004, 0.01, 0.008}; - EffectiveLayers::EffectiveLayerOther perforated{width, height, materialThickness, openness}; + constexpr double PermeabilityFactor{0.0}; + + EffectiveLayers::EffectiveLayerOther perforated{ + width, height, materialThickness, openness, PermeabilityFactor}; const auto effectiveThickness{perforated.effectiveThickness()}; diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation.unit.cpp index ea16bf5d..e8d0a4a3 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation.unit.cpp @@ -62,10 +62,11 @@ class TestGapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation : auto Aleft = 0.1; auto Aright = 0.1; auto Afront = 0.2; + auto PermeabilityFactor = 0.2; EffectiveLayers::ShadeOpenness openness{Afront, Aleft, Aright, Atop, Abot}; EffectiveLayers::EffectiveLayerOther effectiveLayer{ - windowWidth, windowHeight, shadeLayerThickness, openness}; + windowWidth, windowHeight, shadeLayerThickness, openness, PermeabilityFactor}; auto shadeLayer = Tarcog::ISO15099::Layers::shading( shadeLayerThickness, shadeLayerConductance, effectiveLayer.getEffectiveOpenness()); diff --git a/src/Tarcog/tst/units/GapLayerInBetweenVentilation.unit.cpp b/src/Tarcog/tst/units/GapLayerInBetweenVentilation.unit.cpp index 0cce1cc3..7672b722 100644 --- a/src/Tarcog/tst/units/GapLayerInBetweenVentilation.unit.cpp +++ b/src/Tarcog/tst/units/GapLayerInBetweenVentilation.unit.cpp @@ -50,6 +50,7 @@ class TestGapLayerInBetweenVentilation : public testing::Test auto Aleft = 0.1; auto Aright = 0.1; auto Afront = 0.2; + auto PermeabilityFactor = 0.0; EffectiveLayers::ShadeOpenness openness{Afront, Aleft, Aright, Atop, Abot}; @@ -57,7 +58,7 @@ class TestGapLayerInBetweenVentilation : public testing::Test double windowHeight = 1; EffectiveLayers::EffectiveLayerOther effectiveLayer{ - windowWidth, windowHeight, shadeLayerThickness, openness}; + windowWidth, windowHeight, shadeLayerThickness, openness, PermeabilityFactor}; auto shadeLayer = Tarcog::ISO15099::Layers::shading( shadeLayerThickness, shadeLayerConductance, effectiveLayer.getEffectiveOpenness()); diff --git a/src/Tarcog/tst/units/ShadeOut.unit.cpp b/src/Tarcog/tst/units/ShadeOut.unit.cpp index 9780764f..b4d0b5f1 100644 --- a/src/Tarcog/tst/units/ShadeOut.unit.cpp +++ b/src/Tarcog/tst/units/ShadeOut.unit.cpp @@ -48,6 +48,7 @@ class TestShadeOut : public testing::Test auto Aleft = 0.0; auto Aright = 0.0; auto Afront = 0.5; + auto PermeabilityFactor = 0.99; EffectiveLayers::ShadeOpenness openness{Afront, Aleft, Aright, Atop, Abot}; @@ -55,11 +56,13 @@ class TestShadeOut : public testing::Test double windowHeight = 1; EffectiveLayers::EffectiveLayerOther effectiveLayer{ - windowWidth, windowHeight, shadeLayerThickness, openness}; + windowWidth, windowHeight, shadeLayerThickness, openness, PermeabilityFactor}; + + auto effectiveThermal = effectiveLayer.getEffectiveOpenness(); auto layer1 = Tarcog::ISO15099::Layers::shading(shadeLayerThickness, shadeLayerConductance, - effectiveLayer.getEffectiveOpenness(), + effectiveThermal, emissivity, transmittance, emissivity, @@ -118,7 +121,7 @@ TEST_F(TestShadeOut, Test1) const auto aSystem = GetSystem(); const auto Temperature = aSystem->getTemperatures(); - const std::vector correctTemperature{256.991898, 256.992301, 269.666385, 270.128448}; + const std::vector correctTemperature{256.98924905242745, 257.00908910176321, 269.67211159465268, 270.13404194545456}; ASSERT_EQ(correctTemperature.size(), Temperature.size()); for(auto i = 0u; i < correctTemperature.size(); ++i) @@ -127,7 +130,7 @@ TEST_F(TestShadeOut, Test1) } const auto Radiosity = aSystem->getRadiosities(); - const std::vector correctRadiosity{249.992982, 250.921614, 292.000161, 419.703062}; + const std::vector correctRadiosity{249.98676196927647, 250.97825831600656, 292.03061975484945, 419.70403266542121}; ASSERT_EQ(correctRadiosity.size(), Radiosity.size()); for(auto i = 0u; i < correctRadiosity.size(); ++i) diff --git a/src/Tarcog/tst/units/TripleInBetweenShadeAir.unit.cpp b/src/Tarcog/tst/units/TripleInBetweenShadeAir.unit.cpp index 88b695c1..ca592497 100644 --- a/src/Tarcog/tst/units/TripleInBetweenShadeAir.unit.cpp +++ b/src/Tarcog/tst/units/TripleInBetweenShadeAir.unit.cpp @@ -55,6 +55,7 @@ class TestInBetweenShadeAir : public testing::Test auto Aleft = 0.1; auto Aright = 0.1; auto Afront = 0.2; + auto PermeabilityFactor = 0.2; EffectiveLayers::ShadeOpenness openness{Afront, Aleft, Aright, Atop, Abot}; @@ -62,7 +63,7 @@ class TestInBetweenShadeAir : public testing::Test double windowHeight = 1; EffectiveLayers::EffectiveLayerOther effectiveLayer{ - windowWidth, windowHeight, shadeLayerThickness, openness}; + windowWidth, windowHeight, shadeLayerThickness, openness, PermeabilityFactor}; auto aLayer2 = Tarcog::ISO15099::Layers::shading( shadeLayerThickness, shadeLayerConductance, effectiveLayer.getEffectiveOpenness()); diff --git a/src/Tarcog/tst/units/TripleInBetweenShadeAirArgon.unit.cpp b/src/Tarcog/tst/units/TripleInBetweenShadeAirArgon.unit.cpp index 3c176bc0..abe850ee 100644 --- a/src/Tarcog/tst/units/TripleInBetweenShadeAirArgon.unit.cpp +++ b/src/Tarcog/tst/units/TripleInBetweenShadeAirArgon.unit.cpp @@ -56,6 +56,7 @@ class TestInBetweenShadeAirArgon : public testing::Test auto Aleft = 0.1; auto Aright = 0.1; auto Afront = 0.2; + auto PermeabilityFactor = 0.2; EffectiveLayers::ShadeOpenness openness{Afront, Aleft, Aright, Atop, Abot}; @@ -63,7 +64,7 @@ class TestInBetweenShadeAirArgon : public testing::Test double windowHeight = 1; EffectiveLayers::EffectiveLayerOther effectiveLayer{ - windowWidth, windowHeight, shadeLayerThickness, openness}; + windowWidth, windowHeight, shadeLayerThickness, openness, PermeabilityFactor}; auto layer2 = Tarcog::ISO15099::Layers::shading( shadeLayerThickness, shadeLayerConductance, effectiveLayer.getEffectiveOpenness()); diff --git a/src/Tarcog/tst/units/TripleShadeInside_UValue.unit.cpp b/src/Tarcog/tst/units/TripleShadeInside_UValue.unit.cpp index 8481c11b..0601dfc6 100644 --- a/src/Tarcog/tst/units/TripleShadeInside_UValue.unit.cpp +++ b/src/Tarcog/tst/units/TripleShadeInside_UValue.unit.cpp @@ -81,10 +81,11 @@ class TestTripleShadeInside_UValue : public testing::Test const auto dtop{0.0}; const auto dbot{0.0}; const auto frontOpenness{0.9}; + const auto PermeabilityFactor = 0.9; EffectiveLayers::ShadeOpenness openness{frontOpenness, dl, dr, dtop, dbot}; EffectiveLayers::EffectiveLayerOther effLayer{ - windowWidth, windowHeight, shadeThickness, openness}; + windowWidth, windowHeight, shadeThickness, openness, PermeabilityFactor}; //const auto Ef = 7.379264e-01; //const auto Eb = 7.437828e-01; From 25d325885b466e0b5de131287ac819106d2b9e48 Mon Sep 17 00:00:00 2001 From: vidanovic Date: Tue, 17 Sep 2024 19:19:55 -0700 Subject: [PATCH 4/8] Results for TripleShadeInside_UValue updated to match reasonable value of permeability factor. --- .../tst/units/TripleShadeInside_UValue.unit.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/Tarcog/tst/units/TripleShadeInside_UValue.unit.cpp b/src/Tarcog/tst/units/TripleShadeInside_UValue.unit.cpp index 0601dfc6..0e047af6 100644 --- a/src/Tarcog/tst/units/TripleShadeInside_UValue.unit.cpp +++ b/src/Tarcog/tst/units/TripleShadeInside_UValue.unit.cpp @@ -80,17 +80,13 @@ class TestTripleShadeInside_UValue : public testing::Test const auto dr{0.0}; const auto dtop{0.0}; const auto dbot{0.0}; - const auto frontOpenness{0.9}; - const auto PermeabilityFactor = 0.9; + const auto frontOpenness{0.9}; // m2 + const auto PermeabilityFactor = 0.3; // fraction EffectiveLayers::ShadeOpenness openness{frontOpenness, dl, dr, dtop, dbot}; EffectiveLayers::EffectiveLayerOther effLayer{ windowWidth, windowHeight, shadeThickness, openness, PermeabilityFactor}; - //const auto Ef = 7.379264e-01; - //const auto Eb = 7.437828e-01; - //const auto Tirf = 2.124426e-01; - //const auto Tirb = 2.124426e-01; const auto Ef = 0.9; const auto Eb = 0.9; const auto Tirf = 0; @@ -105,8 +101,7 @@ class TestTripleShadeInside_UValue : public testing::Test ///////////////////////////////////////////////////////// /// System ///////////////////////////////////////////////////////// - m_TarcogSystem = std::unique_ptr( - new Tarcog::ISO15099::CSystem(aIGU, Indoor, Outdoor)); + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); } public: @@ -127,12 +122,12 @@ TEST_F(TestTripleShadeInside_UValue, Test1) const auto systemKeff{ aSystem->getEffectiveSystemConductivity(Tarcog::ISO15099::System::Uvalue)}; - EXPECT_NEAR(0.039814, systemKeff, 1e-6); + EXPECT_NEAR(0.039813, systemKeff, 1e-6); const auto uval = aSystem->getUValue(); - EXPECT_NEAR(1.195383, uval, 1e-6); + EXPECT_NEAR(1.195377, uval, 1e-6); const auto heatflow = aSystem->getHeatFlow(Tarcog::ISO15099::System::Uvalue, Tarcog::ISO15099::Environment::Indoor); - EXPECT_NEAR(34.545727, heatflow, 1e-6); + EXPECT_NEAR(34.545165, heatflow, 1e-6); } From a2459902719ea831b23f111465b18a33ea5c774b Mon Sep 17 00:00:00 2001 From: vidanovic Date: Tue, 17 Sep 2024 19:23:28 -0700 Subject: [PATCH 5/8] Some minor cleanups in Triple shade inside unit test. --- .../tst/units/TripleShadeInside_UValue.unit.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Tarcog/tst/units/TripleShadeInside_UValue.unit.cpp b/src/Tarcog/tst/units/TripleShadeInside_UValue.unit.cpp index 0e047af6..62b9a4ed 100644 --- a/src/Tarcog/tst/units/TripleShadeInside_UValue.unit.cpp +++ b/src/Tarcog/tst/units/TripleShadeInside_UValue.unit.cpp @@ -105,9 +105,9 @@ class TestTripleShadeInside_UValue : public testing::Test } public: - Tarcog::ISO15099::CSystem * GetSystem() const + [[nodiscard]] Tarcog::ISO15099::CSystem & GetSystem() const { - return m_TarcogSystem.get(); + return *m_TarcogSystem; }; }; @@ -115,19 +115,19 @@ TEST_F(TestTripleShadeInside_UValue, Test1) { SCOPED_TRACE("Begin Test: Outside venetian shade."); - const auto aSystem = GetSystem(); + auto & aSystem = GetSystem(); auto effectiveLayerConductivities{ - aSystem->getSolidEffectiveLayerConductivities(Tarcog::ISO15099::System::Uvalue)}; + aSystem.getSolidEffectiveLayerConductivities(Tarcog::ISO15099::System::Uvalue)}; const auto systemKeff{ - aSystem->getEffectiveSystemConductivity(Tarcog::ISO15099::System::Uvalue)}; + aSystem.getEffectiveSystemConductivity(Tarcog::ISO15099::System::Uvalue)}; EXPECT_NEAR(0.039813, systemKeff, 1e-6); - const auto uval = aSystem->getUValue(); + const auto uval = aSystem.getUValue(); EXPECT_NEAR(1.195377, uval, 1e-6); const auto heatflow = - aSystem->getHeatFlow(Tarcog::ISO15099::System::Uvalue, Tarcog::ISO15099::Environment::Indoor); + aSystem.getHeatFlow(Tarcog::ISO15099::System::Uvalue, Tarcog::ISO15099::Environment::Indoor); EXPECT_NEAR(34.545165, heatflow, 1e-6); } From 06760b022c927cc9a73824f49e4d21651eb54696 Mon Sep 17 00:00:00 2001 From: vidanovic Date: Tue, 17 Sep 2024 19:33:16 -0700 Subject: [PATCH 6/8] Permeability factor calculations scaled correctly for effective layers (Woven, Perforated). --- src/Tarcog/src/EffectiveOpenness.cpp | 2 +- ...tilationInsideAirThreeMeterHeight.unit.cpp | 22 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Tarcog/src/EffectiveOpenness.cpp b/src/Tarcog/src/EffectiveOpenness.cpp index 341f9725..2c5ccfa8 100644 --- a/src/Tarcog/src/EffectiveOpenness.cpp +++ b/src/Tarcog/src/EffectiveOpenness.cpp @@ -113,7 +113,7 @@ namespace EffectiveLayers const auto Ar_eff{m_ShadeOpenness.Dr * m_Height * coefficients.C3}; const auto Atop_eff{m_ShadeOpenness.Dtop * m_Width * coefficients.C4}; const auto Abop_eff{m_ShadeOpenness.Dbot * m_Width * coefficients.C4}; - return {Ah_eff, Al_eff, Ar_eff, Atop_eff, Abop_eff, m_ShadeOpenness.Ah}; + return {Ah_eff, Al_eff, Ar_eff, Atop_eff, Abop_eff, m_ShadeOpenness.Ah / area}; } double EffectiveLayerCommonType::effectiveThickness() diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight.unit.cpp index 4105dd93..e04c3339 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight.unit.cpp @@ -137,8 +137,8 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir ASSERT_TRUE(aLayer != nullptr); auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); - EXPECT_NEAR(509.14498001108558, frontIRRadiationFlow, 1e-4); - EXPECT_NEAR(581.880250148615, backIRRadiationFlow, 1e-4); + EXPECT_NEAR(508.90655825943702, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(581.30670106198215, backIRRadiationFlow, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight, @@ -152,7 +152,7 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir ASSERT_TRUE(aLayer != nullptr); auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(-34.128540161354429, gainEnergy, 1e-4); + EXPECT_NEAR(-34.006215984653799, gainEnergy, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight, @@ -167,8 +167,8 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->surfaceTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->surfaceTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(305.33843112508362, frontTemperature, 1e-4); - EXPECT_NEAR(305.72081655473085, backTemperature, 1e-4); + EXPECT_NEAR(305.31306518540885, frontTemperature, 1e-4); + EXPECT_NEAR(305.69387165119053, backTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight, @@ -185,10 +185,10 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir auto backTemperature = aLayer->surfaceTemperature(FenestrationCommon::Side::Back); auto layerTemperature = aLayer->averageLayerTemperature(); auto averageTemperature = aLayer->averageSurfaceTemperature(); - EXPECT_NEAR(305.72081655473085, frontTemperature, 1e-4); - EXPECT_NEAR(326.86352010579054, backTemperature, 1e-4); - EXPECT_NEAR(312.6686330843001, layerTemperature, 1e-4); - EXPECT_NEAR(316.29216833026067, averageTemperature, 1e-4); + EXPECT_NEAR(305.69387165119053, frontTemperature, 1e-4); + EXPECT_NEAR(326.75524848331747, backTemperature, 1e-4); + EXPECT_NEAR(312.61018079711931, layerTemperature, 1e-4); + EXPECT_NEAR(316.224560067254, averageTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight, @@ -203,6 +203,6 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->surfaceTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->surfaceTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(326.86352010579054, frontTemperature, 1e-4); - EXPECT_NEAR(326.61372838866049, backTemperature, 1e-4); + EXPECT_NEAR(326.75524848331747, frontTemperature, 1e-4); + EXPECT_NEAR(326.70074994801291, backTemperature, 1e-4); } \ No newline at end of file From 7e20b773dcd4392ec4debeb8d3713381b75a960b Mon Sep 17 00:00:00 2001 From: vidanovic Date: Tue, 17 Sep 2024 19:44:42 -0700 Subject: [PATCH 7/8] Diffuse and BSDF layer now have permeability factor that needs to be passed as argument. --- src/Tarcog/src/EffectiveOpenness.cpp | 47 +++++++++++++++---- src/Tarcog/src/EffectiveOpenness.hpp | 27 ++++++++--- .../DoubleIGU_With_TIR_and_Openness.unit.cpp | 3 +- ...bleIGU_With_TIR_and_Openness_SHGC.unit.cpp | 3 +- 4 files changed, 62 insertions(+), 18 deletions(-) diff --git a/src/Tarcog/src/EffectiveOpenness.cpp b/src/Tarcog/src/EffectiveOpenness.cpp index 2c5ccfa8..56670afd 100644 --- a/src/Tarcog/src/EffectiveOpenness.cpp +++ b/src/Tarcog/src/EffectiveOpenness.cpp @@ -97,11 +97,35 @@ namespace EffectiveLayers width, height, thickness, slatAngle, slatWidth, openness, {0.041, 0.0, 0.27, 0.012}) {} + EffectiveLayerLinearPermeability::EffectiveLayerLinearPermeability( + double width, double height, double thickness, const ShadeOpenness & openness) : + EffectiveLayer(width, height, thickness, openness, {0.078, 1.2, 1.0, 1.0}) + {} + + EffectiveOpenness EffectiveLayerLinearPermeability::getEffectiveOpenness() + { + const auto area{m_Width * m_Height}; + const auto Ah_eff{area * coefficients.C1 + * (std::pow(m_ShadeOpenness.Ah / area, coefficients.C2))}; + const auto Al_eff{m_ShadeOpenness.Dl * m_Height * coefficients.C3}; + const auto Ar_eff{m_ShadeOpenness.Dr * m_Height * coefficients.C3}; + const auto Atop_eff{m_ShadeOpenness.Dtop * m_Width * coefficients.C4}; + const auto Abop_eff{m_ShadeOpenness.Dbot * m_Width * coefficients.C4}; + return {Ah_eff, Al_eff, Ar_eff, Atop_eff, Abop_eff, m_ShadeOpenness.Ah / area}; + } + + double EffectiveLayerLinearPermeability::effectiveThickness() + { + return m_Thickness; + } + EffectiveLayerCommonType::EffectiveLayerCommonType(double width, double height, double thickness, - const ShadeOpenness & openness) : - EffectiveLayer(width, height, thickness, openness, {0.078, 1.2, 1.0, 1.0}) + const ShadeOpenness & openness, + double permeabilityFactor) : + EffectiveLayer( + width, height, thickness, openness, {0.078, 1.2, 1.0, 1.0}, permeabilityFactor) {} EffectiveOpenness EffectiveLayerCommonType::getEffectiveOpenness() @@ -113,7 +137,7 @@ namespace EffectiveLayers const auto Ar_eff{m_ShadeOpenness.Dr * m_Height * coefficients.C3}; const auto Atop_eff{m_ShadeOpenness.Dtop * m_Width * coefficients.C4}; const auto Abop_eff{m_ShadeOpenness.Dbot * m_Width * coefficients.C4}; - return {Ah_eff, Al_eff, Ar_eff, Atop_eff, Abop_eff, m_ShadeOpenness.Ah / area}; + return {Ah_eff, Al_eff, Ar_eff, Atop_eff, Abop_eff, m_PermeabilityFactor}; } double EffectiveLayerCommonType::effectiveThickness() @@ -125,28 +149,30 @@ namespace EffectiveLayers double height, double thickness, const ShadeOpenness & openness) : - EffectiveLayerCommonType(width, height, thickness, openness) + EffectiveLayerLinearPermeability(width, height, thickness, openness) {} EffectiveLayerDiffuse::EffectiveLayerDiffuse(double width, double height, double thickness, - const ShadeOpenness & openness) : - EffectiveLayerCommonType(width, height, thickness, openness) + const ShadeOpenness & openness, + double permeabilityFactor) : + EffectiveLayerCommonType(width, height, thickness, openness, permeabilityFactor) {} EffectiveLayerWoven::EffectiveLayerWoven(double width, double height, double thickness, const ShadeOpenness & openness) : - EffectiveLayerCommonType(width, height, thickness, openness) + EffectiveLayerLinearPermeability(width, height, thickness, openness) {} EffectiveLayerBSDF::EffectiveLayerBSDF(double width, double height, double thickness, - const ShadeOpenness & openness) : - EffectiveLayerCommonType(width, height, thickness, openness) + const ShadeOpenness & openness, + double permeabilityFactor) : + EffectiveLayerCommonType(width, height, thickness, openness, permeabilityFactor) {} EffectiveLayerOther::EffectiveLayerOther(double width, @@ -154,7 +180,8 @@ namespace EffectiveLayers double thickness, const ShadeOpenness & openness, double permeabilityFactor) : - EffectiveLayer(width, height, thickness, openness, Coefficients(0, 0, 0, 0), permeabilityFactor) + EffectiveLayer( + width, height, thickness, openness, Coefficients(0, 0, 0, 0), permeabilityFactor) {} EffectiveOpenness EffectiveLayerOther::getEffectiveOpenness() diff --git a/src/Tarcog/src/EffectiveOpenness.hpp b/src/Tarcog/src/EffectiveOpenness.hpp index 8afbc8d6..fbfbe342 100644 --- a/src/Tarcog/src/EffectiveOpenness.hpp +++ b/src/Tarcog/src/EffectiveOpenness.hpp @@ -115,20 +115,33 @@ namespace EffectiveLayers double slatWidth); }; - //! \brief Used for effective calculations for Perforated, Woven, Diffuse shade and BSDF + //! \brief Used for effective calculations where permeability is linear with frontOpenness Ah + class EffectiveLayerLinearPermeability : public EffectiveLayer + { + public: + EffectiveLayerLinearPermeability(double width, + double height, + double thickness, + const ShadeOpenness & openness); + + EffectiveOpenness getEffectiveOpenness() override; + double effectiveThickness() override; + }; + class EffectiveLayerCommonType : public EffectiveLayer { public: EffectiveLayerCommonType(double width, double height, double thickness, - const ShadeOpenness & openness); + const ShadeOpenness & openness, + double permeabilityFactor); EffectiveOpenness getEffectiveOpenness() override; double effectiveThickness() override; }; - class EffectiveLayerPerforated : public EffectiveLayerCommonType + class EffectiveLayerPerforated : public EffectiveLayerLinearPermeability { public: EffectiveLayerPerforated(double width, @@ -143,10 +156,11 @@ namespace EffectiveLayers EffectiveLayerDiffuse(double width, double height, double thickness, - const ShadeOpenness & openness); + const ShadeOpenness & openness, + double permeabilityFactor); }; - class EffectiveLayerWoven : public EffectiveLayerCommonType + class EffectiveLayerWoven : public EffectiveLayerLinearPermeability { public: EffectiveLayerWoven(double width, @@ -161,7 +175,8 @@ namespace EffectiveLayers EffectiveLayerBSDF(double width, double height, double thickness, - const ShadeOpenness & openness); + const ShadeOpenness & openness, + double permeabilityFactor); }; class EffectiveLayerOther : public EffectiveLayer diff --git a/src/Tarcog/tst/units/DoubleIGU_With_TIR_and_Openness.unit.cpp b/src/Tarcog/tst/units/DoubleIGU_With_TIR_and_Openness.unit.cpp index cf49c78e..ffb1b3e2 100644 --- a/src/Tarcog/tst/units/DoubleIGU_With_TIR_and_Openness.unit.cpp +++ b/src/Tarcog/tst/units/DoubleIGU_With_TIR_and_Openness.unit.cpp @@ -53,6 +53,7 @@ class DoubleIGU_With_TIR_and_Openness : public testing::Test auto dleft = 0.0; auto dright = 0.0; auto Afront = 0.049855; + auto PermeabilityFactor = 0.049855; EffectiveLayers::ShadeOpenness openness{Afront, dleft, dright, dtop, dbot}; @@ -60,7 +61,7 @@ class DoubleIGU_With_TIR_and_Openness : public testing::Test double windowHeight = 1; EffectiveLayers::EffectiveLayerBSDF effectiveLayer{ - windowWidth, windowHeight, shadeLayerThickness, openness}; + windowWidth, windowHeight, shadeLayerThickness, openness, PermeabilityFactor}; auto layer2 = Tarcog::ISO15099::Layers::shading(shadeLayerThickness, shadeLayerConductance, diff --git a/src/Tarcog/tst/units/DoubleIGU_With_TIR_and_Openness_SHGC.unit.cpp b/src/Tarcog/tst/units/DoubleIGU_With_TIR_and_Openness_SHGC.unit.cpp index c8b3da40..f6fdfa62 100644 --- a/src/Tarcog/tst/units/DoubleIGU_With_TIR_and_Openness_SHGC.unit.cpp +++ b/src/Tarcog/tst/units/DoubleIGU_With_TIR_and_Openness_SHGC.unit.cpp @@ -53,6 +53,7 @@ class DoubleIGU_With_TIR_and_Openness_SHGC : public testing::Test auto dleft = 0.0; auto dright = 0.0; auto Afront = 0.049855; + auto PermeabilityFactor = 0.049855; EffectiveLayers::ShadeOpenness openness{Afront, dleft, dright, dtop, dbot}; @@ -60,7 +61,7 @@ class DoubleIGU_With_TIR_and_Openness_SHGC : public testing::Test double windowHeight = 1; EffectiveLayers::EffectiveLayerBSDF effectiveLayer{ - windowWidth, windowHeight, shadeLayerThickness, openness}; + windowWidth, windowHeight, shadeLayerThickness, openness, PermeabilityFactor}; auto layer2 = Tarcog::ISO15099::Layers::shading(shadeLayerThickness, shadeLayerConductance, From d346d2be2acbbba0f65c8664c885f0b3d790bc83 Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Thu, 19 Sep 2024 09:11:39 -0700 Subject: [PATCH 8/8] Front thermal openness renamed to effective front thermal openness area. --- src/Tarcog/src/EffectiveOpenness.cpp | 16 ++++++++---- src/Tarcog/src/EffectiveOpenness.hpp | 26 ++++++++++++------- src/Tarcog/src/Layers.cpp | 2 +- src/Tarcog/tst/units/EffectiveLayers.unit.cpp | 12 ++++----- .../tst/units/EffectiveOpenness.unit.cpp | 8 +++--- 5 files changed, 39 insertions(+), 25 deletions(-) diff --git a/src/Tarcog/src/EffectiveOpenness.cpp b/src/Tarcog/src/EffectiveOpenness.cpp index 56670afd..d7c73484 100644 --- a/src/Tarcog/src/EffectiveOpenness.cpp +++ b/src/Tarcog/src/EffectiveOpenness.cpp @@ -8,20 +8,26 @@ namespace EffectiveLayers Ah(ah), Dl(dl), Dr(dr), Dtop(dtop), Dbot(dbot) {} - EffectiveOpenness::EffectiveOpenness(const double ah, + EffectiveOpenness::EffectiveOpenness(const double effectiveFrontThermalOpennessArea, const double al, const double ar, const double atop, const double abot, const double frontPorosity) : - Ah(ah), Al(al), Ar(ar), Atop(atop), Abot(abot), PermeabilityFactor(frontPorosity) + EffectiveFrontThermalOpennessArea(effectiveFrontThermalOpennessArea), + Al(al), + Ar(ar), + Atop(atop), + Abot(abot), + PermeabilityFactor(frontPorosity) {} bool isClosed(const EffectiveOpenness & effectiveOpenness) { - return effectiveOpenness.Ah == 0.0 && effectiveOpenness.Al == 0.0 - && effectiveOpenness.Ar == 0.0 && effectiveOpenness.Atop == 0.0 - && effectiveOpenness.Abot == 0.0 && effectiveOpenness.PermeabilityFactor == 0.0; + return effectiveOpenness.EffectiveFrontThermalOpennessArea == 0.0 + && effectiveOpenness.Al == 0.0 && effectiveOpenness.Ar == 0.0 + && effectiveOpenness.Atop == 0.0 && effectiveOpenness.Abot == 0.0 + && effectiveOpenness.PermeabilityFactor == 0.0; } EffectiveLayer::EffectiveLayer(double width, diff --git a/src/Tarcog/src/EffectiveOpenness.hpp b/src/Tarcog/src/EffectiveOpenness.hpp index fbfbe342..c4d38cb9 100644 --- a/src/Tarcog/src/EffectiveOpenness.hpp +++ b/src/Tarcog/src/EffectiveOpenness.hpp @@ -18,17 +18,25 @@ namespace EffectiveLayers //! \brief Effective frontOpenness of shading layer that is necessary for thermal calculations. //! - //! Thermal frontOpenness of shading layer will not match physical frontOpenness and because of - //! that some calculations are required. + //! struct EffectiveOpenness { - EffectiveOpenness( - double ah, double al, double ar, double atop, double abot, double frontPorosity); - - double Ah; + EffectiveOpenness(double effectiveFrontThermalOpennessArea, + double al, + double ar, + double atop, + double abot, + double frontPorosity); + + //!< Effective openness of the layer for thermal calculations between the gaps + double EffectiveFrontThermalOpennessArea; + //!< Area of the left side openness where the air is flowing between the gaps double Al; + //!< Area of the right side openness where the air is flowing between the gaps double Ar; + //!< Area of the top side openness where the air is flowing between the gaps double Atop; + //!< Area of the bottom side openness where the air is flowing between the gaps double Abot; // Geometrical openness used to calculate equivalent layer conductivity double PermeabilityFactor; @@ -120,9 +128,9 @@ namespace EffectiveLayers { public: EffectiveLayerLinearPermeability(double width, - double height, - double thickness, - const ShadeOpenness & openness); + double height, + double thickness, + const ShadeOpenness & openness); EffectiveOpenness getEffectiveOpenness() override; double effectiveThickness() override; diff --git a/src/Tarcog/src/Layers.cpp b/src/Tarcog/src/Layers.cpp index b57e422b..ff27164b 100644 --- a/src/Tarcog/src/Layers.cpp +++ b/src/Tarcog/src/Layers.cpp @@ -131,7 +131,7 @@ namespace Tarcog::ISO15099::Layers effectiveOpenness.Abot, effectiveOpenness.Al, effectiveOpenness.Ar, - effectiveOpenness.Ah, + effectiveOpenness.EffectiveFrontThermalOpennessArea, effectiveOpenness.PermeabilityFactor), std::make_shared(frontEmissivity, frontIRTransmittance), std::make_shared(backEmissivity, backIRTransmittance)); diff --git a/src/Tarcog/tst/units/EffectiveLayers.unit.cpp b/src/Tarcog/tst/units/EffectiveLayers.unit.cpp index e333e3ea..617d67b8 100644 --- a/src/Tarcog/tst/units/EffectiveLayers.unit.cpp +++ b/src/Tarcog/tst/units/EffectiveLayers.unit.cpp @@ -23,7 +23,7 @@ TEST(TestEffectiveLayers, TestVenetianHorizontalEffectiveLayer) EXPECT_NEAR(6.364e-4, effectiveThickness, 1e-9); const auto effectiveOpenness{venetian.getEffectiveOpenness()}; - EXPECT_NEAR(1.592911e-2, effectiveOpenness.Ah, 1e-8); + EXPECT_NEAR(1.592911e-2, effectiveOpenness.EffectiveFrontThermalOpennessArea, 1e-8); } TEST(TestEffectiveLayers, TestVenetianHorizontalEffectiveLayerWithTopAndBotOpenness) @@ -46,7 +46,7 @@ TEST(TestEffectiveLayers, TestVenetianHorizontalEffectiveLayerWithTopAndBotOpenn EXPECT_NEAR(6.364e-4, effectiveThickness, 1e-9); const auto effectiveOpenness{venetian.getEffectiveOpenness()}; - EXPECT_NEAR(3.727412206e-2, effectiveOpenness.Ah, 1e-8); + EXPECT_NEAR(3.727412206e-2, effectiveOpenness.EffectiveFrontThermalOpennessArea, 1e-8); EXPECT_NEAR(1.3e-2, effectiveOpenness.Atop, 1e-8); EXPECT_NEAR(1.04e-2, effectiveOpenness.Abot, 1e-8); EXPECT_NEAR(0, effectiveOpenness.Al, 1e-8); @@ -73,7 +73,7 @@ TEST(TestEffectiveLayers, TestVenetianVerticalEffectiveLayerWithTopAndBotOpennes EXPECT_NEAR(9.144e-4, effectiveThickness, 1e-9); const auto effectiveOpenness{venetian.getEffectiveOpenness()}; - EXPECT_NEAR(9.589398567e-2, effectiveOpenness.Ah, 1e-8); + EXPECT_NEAR(9.589398567e-2, effectiveOpenness.EffectiveFrontThermalOpennessArea, 1e-8); EXPECT_NEAR(1.3e-2, effectiveOpenness.Atop, 1e-8); EXPECT_NEAR(1.04e-2, effectiveOpenness.Abot, 1e-8); EXPECT_NEAR(0, effectiveOpenness.Al, 1e-8); @@ -100,7 +100,7 @@ TEST(TestEffectiveLayers, TestVenetianVerticalEffectiveLayerWithTopAndBotOpennes EXPECT_NEAR(6.474269e-4, effectiveThickness, 1e-9); const auto effectiveOpenness{venetian.getEffectiveOpenness()}; - EXPECT_NEAR(9.589398567e-2, effectiveOpenness.Ah, 1e-8); + EXPECT_NEAR(9.589398567e-2, effectiveOpenness.EffectiveFrontThermalOpennessArea, 1e-8); EXPECT_NEAR(1.3e-2, effectiveOpenness.Atop, 1e-8); EXPECT_NEAR(1.04e-2, effectiveOpenness.Abot, 1e-8); EXPECT_NEAR(0, effectiveOpenness.Al, 1e-8); @@ -125,7 +125,7 @@ TEST(TestEffectiveLayers, TestPerforatedEffectiveOpenness) EXPECT_NEAR(6e-4, effectiveThickness, 1e-9); const auto effectiveOpenness{perforated.getEffectiveOpenness()}; - EXPECT_NEAR(9.779677e-3, effectiveOpenness.Ah, 1e-8); + EXPECT_NEAR(9.779677e-3, effectiveOpenness.EffectiveFrontThermalOpennessArea, 1e-8); EXPECT_NEAR(13.0e-3, effectiveOpenness.Atop, 1e-8); EXPECT_NEAR(10.4e-3, effectiveOpenness.Abot, 1e-8); EXPECT_NEAR(9.0e-3, effectiveOpenness.Al, 1e-8); @@ -152,7 +152,7 @@ TEST(TestEffectiveLayers, TestOtherShadingEffectiveOpenness) EXPECT_NEAR(6e-4, effectiveThickness, 1e-9); const auto effectiveOpenness{perforated.getEffectiveOpenness()}; - EXPECT_NEAR(0.2042024283, effectiveOpenness.Ah, 1e-8); + EXPECT_NEAR(0.2042024283, effectiveOpenness.EffectiveFrontThermalOpennessArea, 1e-8); EXPECT_NEAR(0.013, effectiveOpenness.Atop, 1e-8); EXPECT_NEAR(0.0104, effectiveOpenness.Abot, 1e-8); EXPECT_NEAR(0.009, effectiveOpenness.Al, 1e-8); diff --git a/src/Tarcog/tst/units/EffectiveOpenness.unit.cpp b/src/Tarcog/tst/units/EffectiveOpenness.unit.cpp index 33a68654..a64fe7d1 100644 --- a/src/Tarcog/tst/units/EffectiveOpenness.unit.cpp +++ b/src/Tarcog/tst/units/EffectiveOpenness.unit.cpp @@ -32,7 +32,7 @@ TEST(TestEffectiveOpenness, Venetian0DegFrontOpenness) EXPECT_NEAR(0.05375e-03, effectiveThickness, 1e-9); const auto effectiveOpenness{venetian.getEffectiveOpenness()}; - EXPECT_NEAR(0.01521184, effectiveOpenness.Ah, 1e-8); + EXPECT_NEAR(0.01521184, effectiveOpenness.EffectiveFrontThermalOpennessArea, 1e-8); } TEST(TestEffectiveOpenness, Venetian0DegFrontOpenness1) @@ -63,7 +63,7 @@ TEST(TestEffectiveOpenness, Venetian0DegFrontOpenness1) EXPECT_NEAR(0.688e-3, effectiveThickness, 1e-9); const auto effectiveOpenness{venetian.getEffectiveOpenness()}; - EXPECT_NEAR(0.015570892, effectiveOpenness.Ah, 1e-8); + EXPECT_NEAR(0.015570892, effectiveOpenness.EffectiveFrontThermalOpennessArea, 1e-8); } TEST(TestEffectiveOpenness, Venetian45DegFrontOpenness1) @@ -94,7 +94,7 @@ TEST(TestEffectiveOpenness, Venetian45DegFrontOpenness1) EXPECT_NEAR(0.504733e-3, effectiveThickness, 1e-9); const auto effectiveOpenness{venetian.getEffectiveOpenness()}; - EXPECT_NEAR(0.01730331, effectiveOpenness.Ah, 1e-8); + EXPECT_NEAR(0.01730331, effectiveOpenness.EffectiveFrontThermalOpennessArea, 1e-8); } TEST(TestEffectiveOpenness, Venetian0DegWithRise) @@ -129,5 +129,5 @@ TEST(TestEffectiveOpenness, Venetian0DegWithRise) EXPECT_NEAR(0.688e-3, effectiveThickness, 1e-9); const auto effectiveOpenness{venetian.getEffectiveOpenness()}; - EXPECT_NEAR(0.015570892, effectiveOpenness.Ah, 1e-8); + EXPECT_NEAR(0.015570892, effectiveOpenness.EffectiveFrontThermalOpennessArea, 1e-8); } \ No newline at end of file