diff --git a/src/Tarcog/src/EffectiveOpenness.cpp b/src/Tarcog/src/EffectiveOpenness.cpp index dc7c48bd..d7c73484 100644 --- a/src/Tarcog/src/EffectiveOpenness.cpp +++ b/src/Tarcog/src/EffectiveOpenness.cpp @@ -8,33 +8,41 @@ 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), FrontPorosity(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.FrontPorosity == 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, 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) : @@ -95,11 +103,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() @@ -111,7 +143,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_PermeabilityFactor}; } double EffectiveLayerCommonType::effectiveThickness() @@ -123,35 +155,39 @@ 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, 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 +197,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..c4d38cb9 100644 --- a/src/Tarcog/src/EffectiveOpenness.hpp +++ b/src/Tarcog/src/EffectiveOpenness.hpp @@ -18,20 +18,28 @@ 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 FrontPorosity; + double PermeabilityFactor; }; bool isClosed(const EffectiveOpenness & effectiveOpenness); @@ -55,7 +63,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 +78,8 @@ namespace EffectiveLayers ShadeOpenness m_ShadeOpenness; Coefficients coefficients; + + double m_PermeabilityFactor; }; class EffectiveVenetian : public EffectiveLayer @@ -112,20 +123,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, @@ -140,10 +164,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, @@ -158,7 +183,8 @@ namespace EffectiveLayers EffectiveLayerBSDF(double width, double height, double thickness, - const ShadeOpenness & openness); + const ShadeOpenness & openness, + double permeabilityFactor); }; class EffectiveLayerOther : public EffectiveLayer @@ -167,7 +193,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..ff27164b 100644 --- a/src/Tarcog/src/Layers.cpp +++ b/src/Tarcog/src/Layers.cpp @@ -131,8 +131,8 @@ namespace Tarcog::ISO15099::Layers effectiveOpenness.Abot, effectiveOpenness.Al, effectiveOpenness.Ar, - effectiveOpenness.Ah, - effectiveOpenness.FrontPorosity), + effectiveOpenness.EffectiveFrontThermalOpennessArea, + effectiveOpenness.PermeabilityFactor), std::make_shared(frontEmissivity, frontIRTransmittance), std::make_shared(backEmissivity, backIRTransmittance)); } diff --git a/src/Tarcog/src/PermeabilityFactor.cpp b/src/Tarcog/src/PermeabilityFactor.cpp index f9cdc0cf..dc4cc707 100644 --- a/src/Tarcog/src/PermeabilityFactor.cpp +++ b/src/Tarcog/src/PermeabilityFactor.cpp @@ -51,40 +51,51 @@ 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/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/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, diff --git a/src/Tarcog/tst/units/EffectiveLayers.unit.cpp b/src/Tarcog/tst/units/EffectiveLayers.unit.cpp index 6116e319..617d67b8 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."); @@ -30,10 +23,10 @@ TEST_F(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_F(TestEffectiveLayers, TestVenetianHorizontalEffectiveLayerWithTopAndBotOpenness) +TEST(TestEffectiveLayers, TestVenetianHorizontalEffectiveLayerWithTopAndBotOpenness) { SCOPED_TRACE("Begin Test: Venetian horizontal effective layer properties."); @@ -53,14 +46,14 @@ TEST_F(TestEffectiveLayers, TestVenetianHorizontalEffectiveLayerWithTopAndBotOpe 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); EXPECT_NEAR(0, effectiveOpenness.Ar, 1e-8); } -TEST_F(TestEffectiveLayers, TestVenetianVerticalEffectiveLayerWithTopAndBotOpenness) +TEST(TestEffectiveLayers, TestVenetianVerticalEffectiveLayerWithTopAndBotOpenness) { SCOPED_TRACE("Begin Test: Venetian horizontal effective layer properties."); @@ -80,14 +73,14 @@ TEST_F(TestEffectiveLayers, TestVenetianVerticalEffectiveLayerWithTopAndBotOpenn 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); EXPECT_NEAR(0, effectiveOpenness.Ar, 1e-8); } -TEST_F(TestEffectiveLayers, TestVenetianVerticalEffectiveLayerWithTopAndBotOpenness45Deg) +TEST(TestEffectiveLayers, TestVenetianVerticalEffectiveLayerWithTopAndBotOpenness45Deg) { SCOPED_TRACE("Begin Test: Venetian horizontal effective layer properties."); @@ -107,14 +100,14 @@ TEST_F(TestEffectiveLayers, TestVenetianVerticalEffectiveLayerWithTopAndBotOpenn 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); EXPECT_NEAR(0, effectiveOpenness.Ar, 1e-8); } -TEST_F(TestEffectiveLayers, TestPerforatedEffectiveOpenness) +TEST(TestEffectiveLayers, TestPerforatedEffectiveOpenness) { SCOPED_TRACE("Begin Test: Venetian horizontal effective layer properties."); @@ -132,14 +125,14 @@ TEST_F(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); 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."); @@ -149,21 +142,24 @@ TEST_F(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()}; 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); 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..a64fe7d1 --- /dev/null +++ b/src/Tarcog/tst/units/EffectiveOpenness.unit.cpp @@ -0,0 +1,133 @@ +#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.EffectiveFrontThermalOpennessArea, 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.EffectiveFrontThermalOpennessArea, 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.EffectiveFrontThermalOpennessArea, 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.EffectiveFrontThermalOpennessArea, 1e-8); +} \ No newline at end of file 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 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..62b9a4ed 100644 --- a/src/Tarcog/tst/units/TripleShadeInside_UValue.unit.cpp +++ b/src/Tarcog/tst/units/TripleShadeInside_UValue.unit.cpp @@ -80,16 +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 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}; + 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; @@ -104,14 +101,13 @@ 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: - Tarcog::ISO15099::CSystem * GetSystem() const + [[nodiscard]] Tarcog::ISO15099::CSystem & GetSystem() const { - return m_TarcogSystem.get(); + return *m_TarcogSystem; }; }; @@ -119,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)}; - EXPECT_NEAR(0.039814, systemKeff, 1e-6); + aSystem.getEffectiveSystemConductivity(Tarcog::ISO15099::System::Uvalue)}; + EXPECT_NEAR(0.039813, systemKeff, 1e-6); - const auto uval = aSystem->getUValue(); - EXPECT_NEAR(1.195383, uval, 1e-6); + 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); - EXPECT_NEAR(34.545727, heatflow, 1e-6); + aSystem.getHeatFlow(Tarcog::ISO15099::System::Uvalue, Tarcog::ISO15099::Environment::Indoor); + EXPECT_NEAR(34.545165, heatflow, 1e-6); }