From 90c76888cc27832cdea9a9345cd8eebe081956ab Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Thu, 5 Jan 2023 17:51:58 +0100 Subject: [PATCH 01/33] Copy example GapLayerAtEdgeForcedVentilationInsideAir.unit.cpp and rename it as the first step to create a new example --- ...dGlassForcedVentilationOutsideAir.unit.cpp | 175 ++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 src/Tarcog/tst/units/GapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp diff --git a/src/Tarcog/tst/units/GapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp new file mode 100644 index 00000000..de35ef5a --- /dev/null +++ b/src/Tarcog/tst/units/GapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp @@ -0,0 +1,175 @@ +#include +#include + +#include "WCETarcog.hpp" + +using Tarcog::ISO15099::CIGUSolidLayer; +using Tarcog::ISO15099::CIGUGapLayer; + +class TestGapLayerAtEdgeForcedVentilationOutsideAir : public testing::Test +{ +private: + std::unique_ptr m_TarcogSystem; + +protected: + void SetUp() override + { + ///////////////////////////////////////////////////////// + // Outdoor + ///////////////////////////////////////////////////////// + auto outdoorTemperature = 255.15; // Kelvins + auto airSpeed = 5.5; // meters per second + auto tSky = 255.15; // Kelvins + auto solarRadiation = 0.0; + + auto Outdoor = + Tarcog::ISO15099::Environments::outdoor(outdoorTemperature, + airSpeed, + solarRadiation, + tSky, + Tarcog::ISO15099::SkyModel::AllSpecified); + ASSERT_TRUE(Outdoor != nullptr); + Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); + + ///////////////////////////////////////////////////////// + /// Indoor + ///////////////////////////////////////////////////////// + + auto roomTemperature = 295.15; + + auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); + ASSERT_TRUE(Indoor != nullptr); + + // IGU + const auto layer1Thickness = 0.005715; // [m] + const auto layer1Conductance = 1.0; + + auto solidLayer1 = + Tarcog::ISO15099::Layers::solid(layer1Thickness, layer1Conductance); + ASSERT_TRUE(solidLayer1 != nullptr); + + const auto layer2Thickness = 0.01; + const auto layer2Conductance = 160.0; + + auto shadeLayer = + Tarcog::ISO15099::Layers::solid(layer2Thickness, layer2Conductance); + ASSERT_TRUE(shadeLayer != nullptr); + + auto gapThickness = 0.0127; + auto GapLayer1 = Tarcog::ISO15099::Layers::gap(gapThickness); + ASSERT_TRUE(GapLayer1 != nullptr); + + // Now add forced ventilation to the gap + auto gapAirSpeed = 0.5; + auto gap = Tarcog::ISO15099::Layers::forcedVentilationGap( + GapLayer1, gapAirSpeed, outdoorTemperature); + ASSERT_TRUE(gap != nullptr); + + double windowWidth = 1; + double windowHeight = 1; + + Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); + aIGU.addLayers({solidLayer1, gap, shadeLayer}); + + ///////////////////////////////////////////////////////// + /// System + ///////////////////////////////////////////////////////// + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); + ASSERT_TRUE(m_TarcogSystem != nullptr); + + m_TarcogSystem->solve(); + } + +public: + [[nodiscard]] CIGUSolidLayer * GetFirstLayer() const + { + return m_TarcogSystem->getSolidLayers()[0].get(); + }; + + [[nodiscard]] CIGUGapLayer * GetGap() const + { + return m_TarcogSystem->getGapLayers()[0].get(); + }; + + [[nodiscard]] CIGUSolidLayer * GetSecondLayer() const + { + return m_TarcogSystem->getSolidLayers()[1].get(); + }; +}; + +TEST_F(TestGapLayerAtEdgeForcedVentilationOutsideAir, GapLayerSurfaceIRFlow) +{ + SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); + auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); + EXPECT_NEAR(261.579394, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(316.739416, backIRRadiationFlow, 1e-4); +} + +TEST_F(TestGapLayerAtEdgeForcedVentilationOutsideAir, GainEnergy) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gain Energy"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto gainEnergy = aLayer->getGainFlow(); + EXPECT_NEAR(-75.720712, gainEnergy, 1e-4); +} + +TEST_F(TestGapLayerAtEdgeForcedVentilationOutsideAir, FirstLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); + + auto aLayer = GetFirstLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(257.561838, frontTemperature, 1e-4); + EXPECT_NEAR(257.964452, backTemperature, 1e-4); +} + +TEST_F(TestGapLayerAtEdgeForcedVentilationOutsideAir, GapTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + auto layerTemperature = aLayer->layerTemperature(); + auto averageTemperature = aLayer->averageTemperature(); + EXPECT_NEAR(257.964452, frontTemperature, 1e-4); + EXPECT_NEAR(275.631339, backTemperature, 1e-4); + EXPECT_NEAR(260.505441, layerTemperature, 1e-4); + EXPECT_NEAR(266.797896, averageTemperature, 1e-4); +} + +TEST_F(TestGapLayerAtEdgeForcedVentilationOutsideAir, SecondLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); + + auto aLayer = GetSecondLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(275.631339, frontTemperature, 1e-4); + EXPECT_NEAR(275.640475, backTemperature, 1e-4); +} \ No newline at end of file From 840aae7c608f0a303a4894a64b9fa35ecee0f719 Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Wed, 18 Jan 2023 10:39:15 +0100 Subject: [PATCH 02/33] Rename the class `TestGapLayerAtEdgeForcedVentilationOutsideAir` to `TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir`. Test successfully. --- .gitignore | 1 + ...adingAndGlassForcedVentilationOutsideAir.unit.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index b40ec365..61df9aca 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ *.res *.so *.so.* +*.vscode* *~ .directory .DS_Store diff --git a/src/Tarcog/tst/units/GapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp index de35ef5a..05088d19 100644 --- a/src/Tarcog/tst/units/GapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp @@ -6,7 +6,7 @@ using Tarcog::ISO15099::CIGUSolidLayer; using Tarcog::ISO15099::CIGUGapLayer; -class TestGapLayerAtEdgeForcedVentilationOutsideAir : public testing::Test +class TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir : public testing::Test { private: std::unique_ptr m_TarcogSystem; @@ -97,7 +97,7 @@ class TestGapLayerAtEdgeForcedVentilationOutsideAir : public testing::Test }; }; -TEST_F(TestGapLayerAtEdgeForcedVentilationOutsideAir, GapLayerSurfaceIRFlow) +TEST_F(TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir, GapLayerSurfaceIRFlow) { SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); @@ -112,7 +112,7 @@ TEST_F(TestGapLayerAtEdgeForcedVentilationOutsideAir, GapLayerSurfaceIRFlow) EXPECT_NEAR(316.739416, backIRRadiationFlow, 1e-4); } -TEST_F(TestGapLayerAtEdgeForcedVentilationOutsideAir, GainEnergy) +TEST_F(TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir, GainEnergy) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gain Energy"); @@ -125,7 +125,7 @@ TEST_F(TestGapLayerAtEdgeForcedVentilationOutsideAir, GainEnergy) EXPECT_NEAR(-75.720712, gainEnergy, 1e-4); } -TEST_F(TestGapLayerAtEdgeForcedVentilationOutsideAir, FirstLayerSurfaceTemperatures) +TEST_F(TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir, FirstLayerSurfaceTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); @@ -140,7 +140,7 @@ TEST_F(TestGapLayerAtEdgeForcedVentilationOutsideAir, FirstLayerSurfaceTemperatu EXPECT_NEAR(257.964452, backTemperature, 1e-4); } -TEST_F(TestGapLayerAtEdgeForcedVentilationOutsideAir, GapTemperatures) +TEST_F(TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir, GapTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); @@ -159,7 +159,7 @@ TEST_F(TestGapLayerAtEdgeForcedVentilationOutsideAir, GapTemperatures) EXPECT_NEAR(266.797896, averageTemperature, 1e-4); } -TEST_F(TestGapLayerAtEdgeForcedVentilationOutsideAir, SecondLayerSurfaceTemperatures) +TEST_F(TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir, SecondLayerSurfaceTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); From 6c5799fd9994fbb1652bc5daa4d8747e01da0f8d Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Wed, 18 Jan 2023 13:58:55 +0100 Subject: [PATCH 03/33] The results of the new test indicate that the shading has zero absorptance. --- ...GlassForcedVentilationOutsideAir.unit.cpp} | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) rename src/Tarcog/tst/units/{GapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp => GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp} (82%) diff --git a/src/Tarcog/tst/units/GapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp similarity index 82% rename from src/Tarcog/tst/units/GapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp rename to src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp index 05088d19..409a1850 100644 --- a/src/Tarcog/tst/units/GapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp @@ -6,7 +6,7 @@ using Tarcog::ISO15099::CIGUSolidLayer; using Tarcog::ISO15099::CIGUGapLayer; -class TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir : public testing::Test +class TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir : public testing::Test { private: std::unique_ptr m_TarcogSystem; @@ -17,10 +17,10 @@ class TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir : public ///////////////////////////////////////////////////////// // Outdoor ///////////////////////////////////////////////////////// - auto outdoorTemperature = 255.15; // Kelvins + auto outdoorTemperature = 293.15; // Kelvins auto airSpeed = 5.5; // meters per second - auto tSky = 255.15; // Kelvins - auto solarRadiation = 0.0; + auto tSky = 293.15; // Kelvins + auto solarRadiation = 1000.0; auto Outdoor = Tarcog::ISO15099::Environments::outdoor(outdoorTemperature, @@ -35,27 +35,27 @@ class TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir : public /// Indoor ///////////////////////////////////////////////////////// - auto roomTemperature = 295.15; + auto roomTemperature = 293.15; auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); ASSERT_TRUE(Indoor != nullptr); // IGU - const auto layer1Thickness = 0.005715; // [m] + const auto layer1Thickness = 0.006; // [m] const auto layer1Conductance = 1.0; auto solidLayer1 = Tarcog::ISO15099::Layers::solid(layer1Thickness, layer1Conductance); ASSERT_TRUE(solidLayer1 != nullptr); - const auto layer2Thickness = 0.01; - const auto layer2Conductance = 160.0; + const auto shadeLayerThickness = 0.002; + const auto shadeLayerConductance = 0.16; auto shadeLayer = - Tarcog::ISO15099::Layers::solid(layer2Thickness, layer2Conductance); + Tarcog::ISO15099::Layers::solid(shadeLayerThickness, shadeLayerConductance); ASSERT_TRUE(shadeLayer != nullptr); - auto gapThickness = 0.0127; + auto gapThickness = 0.05; auto GapLayer1 = Tarcog::ISO15099::Layers::gap(gapThickness); ASSERT_TRUE(GapLayer1 != nullptr); @@ -69,7 +69,7 @@ class TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir : public double windowHeight = 1; Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); - aIGU.addLayers({solidLayer1, gap, shadeLayer}); + aIGU.addLayers({shadeLayer, gap, solidLayer1}); ///////////////////////////////////////////////////////// /// System @@ -97,7 +97,7 @@ class TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir : public }; }; -TEST_F(TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir, GapLayerSurfaceIRFlow) +TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir, GapLayerSurfaceIRFlow) { SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); @@ -112,7 +112,7 @@ TEST_F(TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir, GapLaye EXPECT_NEAR(316.739416, backIRRadiationFlow, 1e-4); } -TEST_F(TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir, GainEnergy) +TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir, GainEnergy) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gain Energy"); @@ -125,7 +125,7 @@ TEST_F(TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir, GainEne EXPECT_NEAR(-75.720712, gainEnergy, 1e-4); } -TEST_F(TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir, FirstLayerSurfaceTemperatures) +TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir, FirstLayerSurfaceTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); @@ -140,7 +140,7 @@ TEST_F(TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir, FirstLa EXPECT_NEAR(257.964452, backTemperature, 1e-4); } -TEST_F(TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir, GapTemperatures) +TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir, GapTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); @@ -159,7 +159,7 @@ TEST_F(TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir, GapTemp EXPECT_NEAR(266.797896, averageTemperature, 1e-4); } -TEST_F(TestGapBetweenExteriorShadingAndGlassForcedVentilationOutsideAir, SecondLayerSurfaceTemperatures) +TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir, SecondLayerSurfaceTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); From c748a12687859ea1e85588fa8a7eee833914d0f1 Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Wed, 18 Jan 2023 14:51:42 +0100 Subject: [PATCH 04/33] Fail to add absorptance as in DoubleOutsidePerforatedShade_SHGC.unit.cpp . Error message: `[----------] 5 tests from TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir [ RUN ] TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.GapLayerSurfaceIRFlow unknown file: Failure C++ exception with description "map::at" thrown in SetUp(). [ FAILED ] TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.GapLayerSurfaceIRFlow (0 ms) [ RUN ] TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.GainEnergy unknown file: Failure C++ exception with description "map::at" thrown in SetUp().` --- ...dGlassForcedVentilationOutsideAir.unit.cpp | 92 +++++++++++++------ 1 file changed, 65 insertions(+), 27 deletions(-) diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp index 409a1850..c901d62e 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp @@ -1,7 +1,10 @@ #include +#include #include +#include "WCEGases.hpp" #include "WCETarcog.hpp" +#include "WCECommon.hpp" using Tarcog::ISO15099::CIGUSolidLayer; using Tarcog::ISO15099::CIGUGapLayer; @@ -9,7 +12,7 @@ using Tarcog::ISO15099::CIGUGapLayer; class TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir : public testing::Test { private: - std::unique_ptr m_TarcogSystem; + std::unique_ptr m_TarcogSystem; protected: void SetUp() override @@ -17,17 +20,13 @@ class TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir ///////////////////////////////////////////////////////// // Outdoor ///////////////////////////////////////////////////////// - auto outdoorTemperature = 293.15; // Kelvins + auto outdoorTemperature = 298.15; // Kelvins auto airSpeed = 5.5; // meters per second - auto tSky = 293.15; // Kelvins + auto tSky = 298.15; // Kelvins auto solarRadiation = 1000.0; - auto Outdoor = - Tarcog::ISO15099::Environments::outdoor(outdoorTemperature, - airSpeed, - solarRadiation, - tSky, - Tarcog::ISO15099::SkyModel::AllSpecified); + auto Outdoor = Tarcog::ISO15099::Environments::outdoor( + airTemperature, airSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); ASSERT_TRUE(Outdoor != nullptr); Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); @@ -35,49 +34,88 @@ class TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir /// Indoor ///////////////////////////////////////////////////////// - auto roomTemperature = 293.15; + auto roomTemperature = 298.15; auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); ASSERT_TRUE(Indoor != nullptr); - // IGU - const auto layer1Thickness = 0.006; // [m] - const auto layer1Conductance = 1.0; + ///////////////////////////////////////////////////////// + /// IGU + ///////////////////////////////////////////////////////// + auto shadeLayerConductance = 0.12; - auto solidLayer1 = - Tarcog::ISO15099::Layers::solid(layer1Thickness, layer1Conductance); - ASSERT_TRUE(solidLayer1 != nullptr); + // make cell geometry + const auto thickness_31111{0.00023}; + const auto x = 0.00169; // m + const auto y = 0.00169; // m + const auto radius = 0.00058; // m + + const auto CellDimension{ + ThermalPermeability::Perforated::diameterToXYDimension(2 * radius)}; + + const auto frontOpenness{ThermalPermeability::Perforated::openness( + ThermalPermeability::Perforated::Geometry::Circular, + x, + y, + CellDimension.x, + CellDimension.y)}; + + const auto dl{0.0}; + const auto dr{0.0}; + const auto dtop{0.0}; + const auto dbot{0.0}; + + EffectiveLayers::ShadeOpenness openness{frontOpenness, dl, dr, dtop, dbot}; + + auto windowWidth = 1.0; + auto windowHeight = 1.0; - const auto shadeLayerThickness = 0.002; - const auto shadeLayerConductance = 0.16; + EffectiveLayers::EffectiveLayerPerforated effectiveLayerPerforated{ + windowWidth, windowHeight, thickness_31111, openness}; - auto shadeLayer = - Tarcog::ISO15099::Layers::solid(shadeLayerThickness, shadeLayerConductance); - ASSERT_TRUE(shadeLayer != nullptr); + EffectiveLayers::EffectiveOpenness effOpenness{ + effectiveLayerPerforated.getEffectiveOpenness()}; + + const auto effectiveThickness{effectiveLayerPerforated.effectiveThickness()}; + + auto Ef = 0.640892; + auto Eb = 0.623812; + auto Tirf = 0.257367; + auto Tirb = 0.257367; + + auto shadeLayer = Tarcog::ISO15099::Layers::shading( + effectiveThickness, shadeLayerConductance, effOpenness, Ef, Tirf, Eb, Tirb); + + shadeLayer->setSolarAbsorptance(0.106659, solarRadiation); auto gapThickness = 0.05; auto GapLayer1 = Tarcog::ISO15099::Layers::gap(gapThickness); ASSERT_TRUE(GapLayer1 != nullptr); + const auto solidLayerThickness = 0.003048; // [m] + const auto solidLayerConductance = 1.0; + auto solidLayer1 = + Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance); + ASSERT_TRUE(solidLayer1 != nullptr); + + aLayer2->setSolarAbsorptance(0.034677, solarRadiation); + // Now add forced ventilation to the gap - auto gapAirSpeed = 0.5; + auto gapAirSpeed = 0.1; auto gap = Tarcog::ISO15099::Layers::forcedVentilationGap( GapLayer1, gapAirSpeed, outdoorTemperature); ASSERT_TRUE(gap != nullptr); - double windowWidth = 1; - double windowHeight = 1; - Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); aIGU.addLayers({shadeLayer, gap, solidLayer1}); ///////////////////////////////////////////////////////// /// System ///////////////////////////////////////////////////////// - m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); ASSERT_TRUE(m_TarcogSystem != nullptr); - m_TarcogSystem->solve(); + //m_TarcogSystem->solve(); } public: From 6dd47466b42d265bcf9c4929cd23261b0d71d2b9 Mon Sep 17 00:00:00 2001 From: Simon Wacker Date: Thu, 19 Jan 2023 15:47:52 +0100 Subject: [PATCH 05/33] Do not upgrade gap layers that already are ventilated --- src/Tarcog/src/IGU.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Tarcog/src/IGU.cpp b/src/Tarcog/src/IGU.cpp index ff674148..e44246bd 100644 --- a/src/Tarcog/src/IGU.cpp +++ b/src/Tarcog/src/IGU.cpp @@ -523,7 +523,9 @@ namespace Tarcog { if(std::dynamic_pointer_cast(t_Layer) != nullptr) { - if(std::dynamic_pointer_cast(t_Layer->getPreviousLayer()) != nullptr) + if(std::dynamic_pointer_cast(t_Layer->getPreviousLayer()) != nullptr + && std::dynamic_pointer_cast(t_Layer->getPreviousLayer()) + == nullptr) { auto newLayer = std::make_shared( std::dynamic_pointer_cast(t_Layer->getPreviousLayer())); @@ -532,7 +534,8 @@ namespace Tarcog newLayer); } } - if(std::dynamic_pointer_cast(t_Layer) != nullptr) + if(std::dynamic_pointer_cast(t_Layer) != nullptr + && std::dynamic_pointer_cast(t_Layer) == nullptr) { if(std::dynamic_pointer_cast(t_Layer->getPreviousLayer()) != nullptr) From 7ba05b8fd5505079f2d49e5871b5c974ca5b3976 Mon Sep 17 00:00:00 2001 From: Simon Wacker Date: Thu, 19 Jan 2023 15:49:21 +0100 Subject: [PATCH 06/33] Remove unused includes --- ...ExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp index c901d62e..ee55978a 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp @@ -1,10 +1,7 @@ #include -#include #include -#include "WCEGases.hpp" #include "WCETarcog.hpp" -#include "WCECommon.hpp" using Tarcog::ISO15099::CIGUSolidLayer; using Tarcog::ISO15099::CIGUGapLayer; From 885d09b572f0966d65b4996c76fbc1ed1f2127a1 Mon Sep 17 00:00:00 2001 From: Simon Wacker Date: Thu, 19 Jan 2023 15:49:52 +0100 Subject: [PATCH 07/33] Use `CSingleSystem` as `m_TarcogSystem` --- ...teriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp index ee55978a..b287acd7 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp @@ -5,11 +5,12 @@ using Tarcog::ISO15099::CIGUSolidLayer; using Tarcog::ISO15099::CIGUGapLayer; +using Tarcog::ISO15099::CSingleSystem; class TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir : public testing::Test { private: - std::unique_ptr m_TarcogSystem; + std::unique_ptr m_TarcogSystem; protected: void SetUp() override @@ -109,7 +110,7 @@ class TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir ///////////////////////////////////////////////////////// /// System ///////////////////////////////////////////////////////// - m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); ASSERT_TRUE(m_TarcogSystem != nullptr); //m_TarcogSystem->solve(); From 1f1f6c1e891c1cefd3600045ea92e37d5de4067e Mon Sep 17 00:00:00 2001 From: Simon Wacker Date: Thu, 19 Jan 2023 15:50:32 +0100 Subject: [PATCH 08/33] Declare missing air temperature variable --- ...edExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp index b287acd7..2700763f 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp @@ -18,6 +18,7 @@ class TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir ///////////////////////////////////////////////////////// // Outdoor ///////////////////////////////////////////////////////// + auto airTemperature = 255.15; // Kelvins auto outdoorTemperature = 298.15; // Kelvins auto airSpeed = 5.5; // meters per second auto tSky = 298.15; // Kelvins From 1687b3ab6f17295b80bf497472d09183eea729f9 Mon Sep 17 00:00:00 2001 From: Simon Wacker Date: Thu, 19 Jan 2023 15:51:04 +0100 Subject: [PATCH 09/33] Assert non-nullness of shade layer --- ...dExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp index 2700763f..7c9b6eaa 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp @@ -84,8 +84,8 @@ class TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir auto shadeLayer = Tarcog::ISO15099::Layers::shading( effectiveThickness, shadeLayerConductance, effOpenness, Ef, Tirf, Eb, Tirb); - shadeLayer->setSolarAbsorptance(0.106659, solarRadiation); + ASSERT_TRUE(shadeLayer != nullptr); auto gapThickness = 0.05; auto GapLayer1 = Tarcog::ISO15099::Layers::gap(gapThickness); From a77ff0b9a3fc92e181a0531b32e40fc0e12ca826 Mon Sep 17 00:00:00 2001 From: Simon Wacker Date: Thu, 19 Jan 2023 15:54:35 +0100 Subject: [PATCH 10/33] Solve the system at end of test set-up --- ...dExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp index 7c9b6eaa..3e81acbd 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp @@ -114,7 +114,7 @@ class TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); ASSERT_TRUE(m_TarcogSystem != nullptr); - //m_TarcogSystem->solve(); + m_TarcogSystem->solve(); } public: From e9153962a6d81302be31ba1ba3272e346e5486c7 Mon Sep 17 00:00:00 2001 From: Simon Wacker Date: Thu, 19 Jan 2023 15:55:08 +0100 Subject: [PATCH 11/33] Give variables more readable and expressive names --- ...dGlassForcedVentilationOutsideAir.unit.cpp | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp index 3e81acbd..6888cebb 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp @@ -88,25 +88,23 @@ class TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir ASSERT_TRUE(shadeLayer != nullptr); auto gapThickness = 0.05; - auto GapLayer1 = Tarcog::ISO15099::Layers::gap(gapThickness); - ASSERT_TRUE(GapLayer1 != nullptr); + auto gapLayer = Tarcog::ISO15099::Layers::gap(gapThickness); + ASSERT_TRUE(gapLayer != nullptr); const auto solidLayerThickness = 0.003048; // [m] const auto solidLayerConductance = 1.0; - auto solidLayer1 = + auto solidLayer = Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance); - ASSERT_TRUE(solidLayer1 != nullptr); + solidLayer->setSolarAbsorptance(0.034677, solarRadiation); + ASSERT_TRUE(solidLayer != nullptr); - aLayer2->setSolarAbsorptance(0.034677, solarRadiation); - - // Now add forced ventilation to the gap auto gapAirSpeed = 0.1; - auto gap = Tarcog::ISO15099::Layers::forcedVentilationGap( - GapLayer1, gapAirSpeed, outdoorTemperature); - ASSERT_TRUE(gap != nullptr); + auto forcedGapLayer = + Tarcog::ISO15099::Layers::forcedVentilationGap(gapLayer, gapAirSpeed, outdoorTemperature); + ASSERT_TRUE(forcedGapLayer != nullptr); Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); - aIGU.addLayers({shadeLayer, gap, solidLayer1}); + aIGU.addLayers({shadeLayer, forcedGapLayer, solidLayer}); ///////////////////////////////////////////////////////// /// System From cf4de18fd2a4e5d54088b9f4d3259f02bb711f66 Mon Sep 17 00:00:00 2001 From: Simon Wacker Date: Thu, 19 Jan 2023 16:01:24 +0100 Subject: [PATCH 12/33] Correct expected numbers --- ...dGlassForcedVentilationOutsideAir.unit.cpp | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp index 6888cebb..c531cd51 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp @@ -143,8 +143,8 @@ TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAi ASSERT_TRUE(aLayer != nullptr); auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); - EXPECT_NEAR(261.579394, frontIRRadiationFlow, 1e-4); - EXPECT_NEAR(316.739416, backIRRadiationFlow, 1e-4); + EXPECT_NEAR(300.51850897417813, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); } TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir, GainEnergy) @@ -157,7 +157,7 @@ TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAi ASSERT_TRUE(aLayer != nullptr); auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(-75.720712, gainEnergy, 1e-4); + EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); } TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir, FirstLayerSurfaceTemperatures) @@ -171,8 +171,8 @@ TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAi ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(257.561838, frontTemperature, 1e-4); - EXPECT_NEAR(257.964452, backTemperature, 1e-4); + EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); + EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir, GapTemperatures) @@ -188,10 +188,10 @@ TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAi auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); auto layerTemperature = aLayer->layerTemperature(); auto averageTemperature = aLayer->averageTemperature(); - EXPECT_NEAR(257.964452, frontTemperature, 1e-4); - EXPECT_NEAR(275.631339, backTemperature, 1e-4); - EXPECT_NEAR(260.505441, layerTemperature, 1e-4); - EXPECT_NEAR(266.797896, averageTemperature, 1e-4); + EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); + EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); + EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); + EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir, SecondLayerSurfaceTemperatures) @@ -205,6 +205,6 @@ TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAi ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(275.631339, frontTemperature, 1e-4); - EXPECT_NEAR(275.640475, backTemperature, 1e-4); + EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); + EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); } \ No newline at end of file From ec900e5d542b66aacde80ee96e67bf7462775d94 Mon Sep 17 00:00:00 2001 From: Simon Wacker Date: Thu, 19 Jan 2023 16:16:59 +0100 Subject: [PATCH 13/33] Correct expected ventilated flow in `DoubleClarIndoorShadeAir` tests --- src/Tarcog/tst/units/DoubleClearIndoorShadeAir.unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tarcog/tst/units/DoubleClearIndoorShadeAir.unit.cpp b/src/Tarcog/tst/units/DoubleClearIndoorShadeAir.unit.cpp index 6059da16..ca7eb1f0 100644 --- a/src/Tarcog/tst/units/DoubleClearIndoorShadeAir.unit.cpp +++ b/src/Tarcog/tst/units/DoubleClearIndoorShadeAir.unit.cpp @@ -123,5 +123,5 @@ TEST_F(TestDoubleClearIndoorShadeAir, Test1) //EXPECT_EQ(43u, numOfIter); const auto ventilatedFlow = aSystem.getVentilationFlow(Tarcog::ISO15099::Environment::Indoor); - EXPECT_NEAR(40.879048, ventilatedFlow, Tolerance); + EXPECT_NEAR(40.879045167167362, ventilatedFlow, Tolerance); } From 01869203e0888d447d8ceeb730b35b1b67e5a58d Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Tue, 24 Jan 2023 14:20:55 +0100 Subject: [PATCH 14/33] Create three test cases for validation with the software Winther --- ...tilationInsideAirValidationSummer.unit.cpp | 190 ++++++++++++++++++ ...tilationInsideAirValidationWinter.unit.cpp | 186 +++++++++++++++++ ...anesNoVentilationValidationWinter.unit.cpp | 186 +++++++++++++++++ 3 files changed, 562 insertions(+) create mode 100644 src/Tarcog/tst/units/GapBetweenGlassPanesForcedVentilationInsideAirValidationSummer.unit.cpp create mode 100644 src/Tarcog/tst/units/GapBetweenGlassPanesForcedVentilationInsideAirValidationWinter.unit.cpp create mode 100644 src/Tarcog/tst/units/GapBetweenGlassPanesNoVentilationValidationWinter.unit.cpp diff --git a/src/Tarcog/tst/units/GapBetweenGlassPanesForcedVentilationInsideAirValidationSummer.unit.cpp b/src/Tarcog/tst/units/GapBetweenGlassPanesForcedVentilationInsideAirValidationSummer.unit.cpp new file mode 100644 index 00000000..d0e9e652 --- /dev/null +++ b/src/Tarcog/tst/units/GapBetweenGlassPanesForcedVentilationInsideAirValidationSummer.unit.cpp @@ -0,0 +1,190 @@ +#include +#include + +#include "WCETarcog.hpp" + +using Tarcog::ISO15099::CIGUSolidLayer; +using Tarcog::ISO15099::CIGUGapLayer; +using Tarcog::ISO15099::CSingleSystem; + +class TestGapBetweenGlassPanesForcedVentilationInsideAirValidationSummer : public testing::Test +{ +private: + std::unique_ptr m_TarcogSystem; + +protected: + void SetUp() override + { + ///////////////////////////////////////////////////////// + // Outdoor + ///////////////////////////////////////////////////////// + auto outdoorAirTemperature = 303.15; // Kelvins + auto outdoorAirSpeed = 2.75; // meters per second + auto tSky = 303.15; // Kelvins + auto solarRadiation = 1000.0; + + auto Outdoor = Tarcog::ISO15099::Environments::outdoor( + outdoorAirTemperature, outdoorAirSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); + ASSERT_TRUE(Outdoor != nullptr); + Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); + + ///////////////////////////////////////////////////////// + /// Indoor + ///////////////////////////////////////////////////////// + + auto indoorAirTemperature = 298.15; + + auto Indoor = Tarcog::ISO15099::Environments::indoor(indoorAirTemperature); + + auto convective_heat_transfer_coefficient_indoor = 3.9; // + radiative_heat_transfer_coefficient (4.1 W/(m²K) from EN 410) = 8 W/(m²K) + Indoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH, convective_heat_transfer_coefficient_indoor); + + + ASSERT_TRUE(Indoor != nullptr); + + ///////////////////////////////////////////////////////// + /// IGU + ///////////////////////////////////////////////////////// + + auto windowWidth = 1.0; + auto windowHeight = 1.0; + + const auto solidLayer1Thickness = 0.004; // [m] + const auto solidLayer1Conductance = 1.0; + auto emissivity1 = 0.84; + auto transmittance1 = 0; + auto solidLayer1 = Tarcog::ISO15099::Layers::solid(solidLayer1Thickness, + solidLayer1Conductance, + emissivity1, + transmittance1, + emissivity1, + transmittance1); + solidLayer1->setSolarAbsorptance(0.2, solarRadiation); + ASSERT_TRUE(solidLayer1 != nullptr); + + auto gapThickness = 0.01; + auto gapLayer = Tarcog::ISO15099::Layers::gap(gapThickness); + ASSERT_TRUE(gapLayer != nullptr); + auto gapAirSpeed = 1; + auto forcedGapLayer = + Tarcog::ISO15099::Layers::forcedVentilationGap(gapLayer, gapAirSpeed, indoorAirTemperature); + ASSERT_TRUE(forcedGapLayer != nullptr); + + const auto solidLayer2Thickness = 0.004; // [m] + const auto solidLayer2Conductance = 1.0; + auto emissivity2 = 0.84; + auto transmittance2 = 0; + auto solidLayer2 = Tarcog::ISO15099::Layers::solid(solidLayer2Thickness, + solidLayer2Conductance, + emissivity2, + transmittance2, + emissivity2, + transmittance2); + solidLayer2->setSolarAbsorptance(0.2, solarRadiation); + ASSERT_TRUE(solidLayer2 != nullptr); + + Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); + aIGU.addLayers({solidLayer1, forcedGapLayer, solidLayer2}); + + ///////////////////////////////////////////////////////// + /// System + ///////////////////////////////////////////////////////// + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); + ASSERT_TRUE(m_TarcogSystem != nullptr); + + m_TarcogSystem->solve(); + } + +public: + [[nodiscard]] CIGUSolidLayer * GetFirstLayer() const + { + return m_TarcogSystem->getSolidLayers()[0].get(); + }; + + [[nodiscard]] CIGUGapLayer * GetGap() const + { + return m_TarcogSystem->getGapLayers()[0].get(); + }; + + [[nodiscard]] CIGUSolidLayer * GetSecondLayer() const + { + return m_TarcogSystem->getSolidLayers()[1].get(); + }; +}; + +TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationSummer, GapLayerSurfaceIRFlow) +{ + SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); + auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); + EXPECT_NEAR(300.51850897417813, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); +} + +TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationSummer, GainEnergy) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gain Energy"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto gainEnergy = aLayer->getGainFlow(); + EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); +} + +TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationSummer, FirstLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); + + auto aLayer = GetFirstLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); + EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); +} + +TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationSummer, GapTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + auto layerTemperature = aLayer->layerTemperature(); + auto averageTemperature = aLayer->averageTemperature(); + EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); + EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); + EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); + EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); +} + +TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationSummer, SecondLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); + + auto aLayer = GetSecondLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); + EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); +} \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapBetweenGlassPanesForcedVentilationInsideAirValidationWinter.unit.cpp b/src/Tarcog/tst/units/GapBetweenGlassPanesForcedVentilationInsideAirValidationWinter.unit.cpp new file mode 100644 index 00000000..ad4dd066 --- /dev/null +++ b/src/Tarcog/tst/units/GapBetweenGlassPanesForcedVentilationInsideAirValidationWinter.unit.cpp @@ -0,0 +1,186 @@ +#include +#include + +#include "WCETarcog.hpp" + +using Tarcog::ISO15099::CIGUSolidLayer; +using Tarcog::ISO15099::CIGUGapLayer; +using Tarcog::ISO15099::CSingleSystem; + +class TestGapBetweenGlassPanesForcedVentilationInsideAirValidationWinter : public testing::Test +{ +private: + std::unique_ptr m_TarcogSystem; + +protected: + void SetUp() override + { + ///////////////////////////////////////////////////////// + // Outdoor + ///////////////////////////////////////////////////////// + + auto outdoorAirTemperature = 273.15; // Kelvins + auto outdoorAirSpeed = 2.75; // meters per second + auto tSky = 273.15; // Kelvins + auto solarRadiation = 0.0; + auto Outdoor = Tarcog::ISO15099::Environments::outdoor( + outdoorAirTemperature, outdoorAirSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); + ASSERT_TRUE(Outdoor != nullptr); + Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); + + ///////////////////////////////////////////////////////// + /// Indoor + ///////////////////////////////////////////////////////// + + auto indoorAirTemperature = 298.15; + auto Indoor = Tarcog::ISO15099::Environments::indoor(indoorAirTemperature); + auto convective_heat_transfer_coefficient_indoor = 3.9; // + radiative_heat_transfer_coefficient (4.1 W/(m²K) from EN 410) = 8 W/(m²K) + Indoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH, convective_heat_transfer_coefficient_indoor); + ASSERT_TRUE(Indoor != nullptr); + + ///////////////////////////////////////////////////////// + /// IGU + ///////////////////////////////////////////////////////// + + auto windowWidth = 1.0; + auto windowHeight = 1.0; + + const auto solidLayer1Thickness = 0.004; // [m] + const auto solidLayer1Conductance = 1.0; + auto emissivity1 = 0.84; + auto transmittance1 = 0; + auto solidLayer1 = Tarcog::ISO15099::Layers::solid(solidLayer1Thickness, + solidLayer1Conductance, + emissivity1, + transmittance1, + emissivity1, + transmittance1); + solidLayer1->setSolarAbsorptance(0.2, solarRadiation); + ASSERT_TRUE(solidLayer1 != nullptr); + + auto gapThickness = 0.01; + auto gapLayer = Tarcog::ISO15099::Layers::gap(gapThickness); + ASSERT_TRUE(gapLayer != nullptr); + auto gapAirSpeed = 1; + auto forcedGapLayer = + Tarcog::ISO15099::Layers::forcedVentilationGap(gapLayer, gapAirSpeed, indoorAirTemperature); + ASSERT_TRUE(forcedGapLayer != nullptr); + + const auto solidLayer2Thickness = 0.004; // [m] + const auto solidLayer2Conductance = 1.0; + auto emissivity2 = 0.84; + auto transmittance2 = 0; + auto solidLayer2 = Tarcog::ISO15099::Layers::solid(solidLayer2Thickness, + solidLayer2Conductance, + emissivity2, + transmittance2, + emissivity2, + transmittance2); + solidLayer2->setSolarAbsorptance(0.2, solarRadiation); + ASSERT_TRUE(solidLayer2 != nullptr); + + Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); + aIGU.addLayers({solidLayer1, forcedGapLayer, solidLayer2}); + + ///////////////////////////////////////////////////////// + /// System + ///////////////////////////////////////////////////////// + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); + ASSERT_TRUE(m_TarcogSystem != nullptr); + + m_TarcogSystem->solve(); + } + +public: + [[nodiscard]] CIGUSolidLayer * GetFirstLayer() const + { + return m_TarcogSystem->getSolidLayers()[0].get(); + }; + + [[nodiscard]] CIGUGapLayer * GetGap() const + { + return m_TarcogSystem->getGapLayers()[0].get(); + }; + + [[nodiscard]] CIGUSolidLayer * GetSecondLayer() const + { + return m_TarcogSystem->getSolidLayers()[1].get(); + }; +}; + +TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationWinter, GapLayerSurfaceIRFlow) +{ + SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); + auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); + EXPECT_NEAR(300.51850897417813, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); +} + +TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationWinter, GainEnergy) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gain Energy"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto gainEnergy = aLayer->getGainFlow(); + EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); +} + +TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationWinter, FirstLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); + + auto aLayer = GetFirstLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); + EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); +} + +TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationWinter, GapTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + auto layerTemperature = aLayer->layerTemperature(); + auto averageTemperature = aLayer->averageTemperature(); + EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); + EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); + EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); + EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); +} + +TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationWinter, SecondLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); + + auto aLayer = GetSecondLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); + EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); +} \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapBetweenGlassPanesNoVentilationValidationWinter.unit.cpp b/src/Tarcog/tst/units/GapBetweenGlassPanesNoVentilationValidationWinter.unit.cpp new file mode 100644 index 00000000..c1ddb88c --- /dev/null +++ b/src/Tarcog/tst/units/GapBetweenGlassPanesNoVentilationValidationWinter.unit.cpp @@ -0,0 +1,186 @@ +#include +#include + +#include "WCETarcog.hpp" + +using Tarcog::ISO15099::CIGUSolidLayer; +using Tarcog::ISO15099::CIGUGapLayer; +using Tarcog::ISO15099::CSingleSystem; + +class TestGapBetweenGlassPanesNoVentilationValidationWinter : public testing::Test +{ +private: + std::unique_ptr m_TarcogSystem; + +protected: + void SetUp() override + { + ///////////////////////////////////////////////////////// + // Outdoor + ///////////////////////////////////////////////////////// + + auto outdoorAirTemperature = 273.15; // Kelvins + auto outdoorAirSpeed = 2.75; // meters per second + auto tSky = 273.15; // Kelvins + auto solarRadiation = 0.0; + auto Outdoor = Tarcog::ISO15099::Environments::outdoor( + outdoorAirTemperature, outdoorAirSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); + ASSERT_TRUE(Outdoor != nullptr); + Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); + + ///////////////////////////////////////////////////////// + /// Indoor + ///////////////////////////////////////////////////////// + + auto indoorAirTemperature = 298.15; + auto Indoor = Tarcog::ISO15099::Environments::indoor(indoorAirTemperature); + auto convective_heat_transfer_coefficient_indoor = 3.9; // + radiative_heat_transfer_coefficient (4.1 W/(m²K) from EN 410) = 8 W/(m²K) + Indoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH, convective_heat_transfer_coefficient_indoor); + ASSERT_TRUE(Indoor != nullptr); + + ///////////////////////////////////////////////////////// + /// IGU + ///////////////////////////////////////////////////////// + + auto windowWidth = 1.0; + auto windowHeight = 1.0; + + const auto solidLayer1Thickness = 0.004; // [m] + const auto solidLayer1Conductance = 1.0; + auto emissivity1 = 0.84; + auto transmittance1 = 0; + auto solidLayer1 = Tarcog::ISO15099::Layers::solid(solidLayer1Thickness, + solidLayer1Conductance, + emissivity1, + transmittance1, + emissivity1, + transmittance1); + solidLayer1->setSolarAbsorptance(0.2, solarRadiation); + ASSERT_TRUE(solidLayer1 != nullptr); + + auto gapThickness = 0.01; + auto gapLayer = Tarcog::ISO15099::Layers::gap(gapThickness); + ASSERT_TRUE(gapLayer != nullptr); + auto gapAirSpeed = 0; + auto forcedGapLayer = + Tarcog::ISO15099::Layers::forcedVentilationGap(gapLayer, gapAirSpeed, indoorAirTemperature); + ASSERT_TRUE(forcedGapLayer != nullptr); + + const auto solidLayer2Thickness = 0.004; // [m] + const auto solidLayer2Conductance = 1.0; + auto emissivity2 = 0.84; + auto transmittance2 = 0; + auto solidLayer2 = Tarcog::ISO15099::Layers::solid(solidLayer2Thickness, + solidLayer2Conductance, + emissivity2, + transmittance2, + emissivity2, + transmittance2); + solidLayer2->setSolarAbsorptance(0.2, solarRadiation); + ASSERT_TRUE(solidLayer2 != nullptr); + + Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); + aIGU.addLayers({solidLayer1, forcedGapLayer, solidLayer2}); + + ///////////////////////////////////////////////////////// + /// System + ///////////////////////////////////////////////////////// + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); + ASSERT_TRUE(m_TarcogSystem != nullptr); + + m_TarcogSystem->solve(); + } + +public: + [[nodiscard]] CIGUSolidLayer * GetFirstLayer() const + { + return m_TarcogSystem->getSolidLayers()[0].get(); + }; + + [[nodiscard]] CIGUGapLayer * GetGap() const + { + return m_TarcogSystem->getGapLayers()[0].get(); + }; + + [[nodiscard]] CIGUSolidLayer * GetSecondLayer() const + { + return m_TarcogSystem->getSolidLayers()[1].get(); + }; +}; + +TEST_F(TestGapBetweenGlassPanesNoVentilationValidationWinter, GapLayerSurfaceIRFlow) +{ + SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); + auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); + EXPECT_NEAR(300.51850897417813, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); +} + +TEST_F(TestGapBetweenGlassPanesNoVentilationValidationWinter, GainEnergy) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gain Energy"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto gainEnergy = aLayer->getGainFlow(); + EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); +} + +TEST_F(TestGapBetweenGlassPanesNoVentilationValidationWinter, FirstLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); + + auto aLayer = GetFirstLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); + EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); +} + +TEST_F(TestGapBetweenGlassPanesNoVentilationValidationWinter, GapTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + auto layerTemperature = aLayer->layerTemperature(); + auto averageTemperature = aLayer->averageTemperature(); + EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); + EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); + EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); + EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); +} + +TEST_F(TestGapBetweenGlassPanesNoVentilationValidationWinter, SecondLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); + + auto aLayer = GetSecondLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); + EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); +} \ No newline at end of file From 0acb5e348342335ca3350f9b53084d80e4bb22af Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Wed, 25 Jan 2023 17:22:01 +0100 Subject: [PATCH 15/33] Create tests for interior screen with varying height and mass flow of the forced convection. --- ...dGlassForcedVentilationOutsideAir.unit.cpp | 41 ++-- ...ingFastForcedVentilationInsideAir.unit.cpp | 197 ++++++++++++++++++ ...ShadingForcedVentilationInsideAir.unit.cpp | 197 ++++++++++++++++++ ...tilationInsideAirThreeMeterHeight.unit.cpp | 197 ++++++++++++++++++ ...ssAndInteriorShadingNoVentilation.unit.cpp | 197 ++++++++++++++++++ 5 files changed, 802 insertions(+), 27 deletions(-) create mode 100644 src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir.unit.cpp create mode 100644 src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir.unit.cpp create mode 100644 src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight.unit.cpp create mode 100644 src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingNoVentilation.unit.cpp diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp index c531cd51..2ec3d94c 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp @@ -18,14 +18,12 @@ class TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir ///////////////////////////////////////////////////////// // Outdoor ///////////////////////////////////////////////////////// - auto airTemperature = 255.15; // Kelvins - auto outdoorTemperature = 298.15; // Kelvins - auto airSpeed = 5.5; // meters per second - auto tSky = 298.15; // Kelvins + auto outdoorAirTemperature = 298.15; // Kelvins + auto outdoorAirSpeed = 2.75; // meters per second + auto tSky = outdoorAirTemperature; // Kelvins auto solarRadiation = 1000.0; - auto Outdoor = Tarcog::ISO15099::Environments::outdoor( - airTemperature, airSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); + outdoorAirTemperature, outdoorAirSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); ASSERT_TRUE(Outdoor != nullptr); Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); @@ -34,75 +32,64 @@ class TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir ///////////////////////////////////////////////////////// auto roomTemperature = 298.15; - auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); ASSERT_TRUE(Indoor != nullptr); ///////////////////////////////////////////////////////// /// IGU ///////////////////////////////////////////////////////// - auto shadeLayerConductance = 0.12; + + auto windowWidth = 1.0; + auto windowHeight = 1.0; + auto shadeLayerConductance = 0.12; // make cell geometry const auto thickness_31111{0.00023}; const auto x = 0.00169; // m const auto y = 0.00169; // m const auto radius = 0.00058; // m - const auto CellDimension{ ThermalPermeability::Perforated::diameterToXYDimension(2 * radius)}; - const auto frontOpenness{ThermalPermeability::Perforated::openness( ThermalPermeability::Perforated::Geometry::Circular, x, y, CellDimension.x, CellDimension.y)}; - const auto dl{0.0}; const auto dr{0.0}; const auto dtop{0.0}; const auto dbot{0.0}; - EffectiveLayers::ShadeOpenness openness{frontOpenness, dl, dr, dtop, dbot}; - - auto windowWidth = 1.0; - auto windowHeight = 1.0; - EffectiveLayers::EffectiveLayerPerforated effectiveLayerPerforated{ windowWidth, windowHeight, thickness_31111, openness}; - EffectiveLayers::EffectiveOpenness effOpenness{ effectiveLayerPerforated.getEffectiveOpenness()}; - const auto effectiveThickness{effectiveLayerPerforated.effectiveThickness()}; - auto Ef = 0.640892; auto Eb = 0.623812; auto Tirf = 0.257367; auto Tirb = 0.257367; - auto shadeLayer = Tarcog::ISO15099::Layers::shading( effectiveThickness, shadeLayerConductance, effOpenness, Ef, Tirf, Eb, Tirb); - shadeLayer->setSolarAbsorptance(0.106659, solarRadiation); + shadeLayer->setSolarAbsorptance(0.35, solarRadiation); ASSERT_TRUE(shadeLayer != nullptr); auto gapThickness = 0.05; auto gapLayer = Tarcog::ISO15099::Layers::gap(gapThickness); ASSERT_TRUE(gapLayer != nullptr); + auto gapAirSpeed = 0.1; + auto forcedGapLayer = + Tarcog::ISO15099::Layers::forcedVentilationGap(gapLayer, gapAirSpeed, outdoorAirTemperature); + ASSERT_TRUE(forcedGapLayer != nullptr); const auto solidLayerThickness = 0.003048; // [m] const auto solidLayerConductance = 1.0; auto solidLayer = Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance); - solidLayer->setSolarAbsorptance(0.034677, solarRadiation); + solidLayer->setSolarAbsorptance(0.04, solarRadiation); ASSERT_TRUE(solidLayer != nullptr); - auto gapAirSpeed = 0.1; - auto forcedGapLayer = - Tarcog::ISO15099::Layers::forcedVentilationGap(gapLayer, gapAirSpeed, outdoorTemperature); - ASSERT_TRUE(forcedGapLayer != nullptr); - Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); aIGU.addLayers({shadeLayer, forcedGapLayer, solidLayer}); diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir.unit.cpp new file mode 100644 index 00000000..6cb40024 --- /dev/null +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir.unit.cpp @@ -0,0 +1,197 @@ +#include +#include + +#include "WCETarcog.hpp" + +using Tarcog::ISO15099::CIGUSolidLayer; +using Tarcog::ISO15099::CIGUGapLayer; +using Tarcog::ISO15099::CSingleSystem; + +class TestGapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir : public testing::Test +{ +private: + std::unique_ptr m_TarcogSystem; + +protected: + void SetUp() override + { + ///////////////////////////////////////////////////////// + // Outdoor + ///////////////////////////////////////////////////////// + auto outdoorAirTemperature = 298.15; // Kelvins + auto outdoorAirSpeed = 2.75; // meters per second + auto tSky = outdoorAirTemperature; // Kelvins + auto solarRadiation = 1000.0; + auto Outdoor = Tarcog::ISO15099::Environments::outdoor( + outdoorAirTemperature, outdoorAirSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); + ASSERT_TRUE(Outdoor != nullptr); + Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); + + ///////////////////////////////////////////////////////// + /// Indoor + ///////////////////////////////////////////////////////// + + auto roomTemperature = 298.15; + auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); + ASSERT_TRUE(Indoor != nullptr); + + ///////////////////////////////////////////////////////// + /// IGU + ///////////////////////////////////////////////////////// + + auto windowWidth = 1.0; + auto windowHeight = 1.0; + + const auto solidLayerThickness = 0.003048; // [m] + const auto solidLayerConductance = 1.0; + auto solidLayer = + Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance); + solidLayer->setSolarAbsorptance(0.04, solarRadiation); + ASSERT_TRUE(solidLayer != nullptr); + + auto gapThickness = 0.05; + auto gapLayer = Tarcog::ISO15099::Layers::gap(gapThickness); + ASSERT_TRUE(gapLayer != nullptr); + auto gapAirSpeed = 1.0; + auto forcedGapLayer = + Tarcog::ISO15099::Layers::forcedVentilationGap(gapLayer, gapAirSpeed, roomTemperature); + ASSERT_TRUE(forcedGapLayer != nullptr); + + auto shadeLayerConductance = 0.12; + // make cell geometry + const auto thickness_31111{0.00023}; + const auto x = 0.00169; // m + const auto y = 0.00169; // m + const auto radius = 0.00058; // m + const auto CellDimension{ + ThermalPermeability::Perforated::diameterToXYDimension(2 * radius)}; + const auto frontOpenness{ThermalPermeability::Perforated::openness( + ThermalPermeability::Perforated::Geometry::Circular, + x, + y, + CellDimension.x, + CellDimension.y)}; + const auto dl{0.0}; + const auto dr{0.0}; + const auto dtop{0.0}; + const auto dbot{0.0}; + EffectiveLayers::ShadeOpenness openness{frontOpenness, dl, dr, dtop, dbot}; + EffectiveLayers::EffectiveLayerPerforated effectiveLayerPerforated{ + windowWidth, windowHeight, thickness_31111, openness}; + EffectiveLayers::EffectiveOpenness effOpenness{ + effectiveLayerPerforated.getEffectiveOpenness()}; + const auto effectiveThickness{effectiveLayerPerforated.effectiveThickness()}; + auto Ef = 0.640892; + auto Eb = 0.623812; + auto Tirf = 0.257367; + auto Tirb = 0.257367; + auto shadeLayer = Tarcog::ISO15099::Layers::shading( + effectiveThickness, shadeLayerConductance, effOpenness, Ef, Tirf, Eb, Tirb); + shadeLayer->setSolarAbsorptance(0.35, solarRadiation); + ASSERT_TRUE(shadeLayer != nullptr); + + Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); + aIGU.addLayers({solidLayer, forcedGapLayer, shadeLayer}); + + ///////////////////////////////////////////////////////// + /// System + ///////////////////////////////////////////////////////// + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); + ASSERT_TRUE(m_TarcogSystem != nullptr); + + m_TarcogSystem->solve(); + } + +public: + [[nodiscard]] CIGUSolidLayer * GetFirstLayer() const + { + return m_TarcogSystem->getSolidLayers()[0].get(); + }; + + [[nodiscard]] CIGUGapLayer * GetGap() const + { + return m_TarcogSystem->getGapLayers()[0].get(); + }; + + [[nodiscard]] CIGUSolidLayer * GetSecondLayer() const + { + return m_TarcogSystem->getSolidLayers()[1].get(); + }; +}; + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir, GapLayerSurfaceIRFlow) +{ + SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); + auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); + EXPECT_NEAR(300.51850897417813, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir, GainEnergy) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gain Energy"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto gainEnergy = aLayer->getGainFlow(); + EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir, FirstLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); + + auto aLayer = GetFirstLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); + EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir, GapTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + auto layerTemperature = aLayer->layerTemperature(); + auto averageTemperature = aLayer->averageTemperature(); + EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); + EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); + EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); + EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir, SecondLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); + + auto aLayer = GetSecondLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); + EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); +} \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir.unit.cpp new file mode 100644 index 00000000..ab73710b --- /dev/null +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir.unit.cpp @@ -0,0 +1,197 @@ +#include +#include + +#include "WCETarcog.hpp" + +using Tarcog::ISO15099::CIGUSolidLayer; +using Tarcog::ISO15099::CIGUGapLayer; +using Tarcog::ISO15099::CSingleSystem; + +class TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir : public testing::Test +{ +private: + std::unique_ptr m_TarcogSystem; + +protected: + void SetUp() override + { + ///////////////////////////////////////////////////////// + // Outdoor + ///////////////////////////////////////////////////////// + auto outdoorAirTemperature = 298.15; // Kelvins + auto outdoorAirSpeed = 2.75; // meters per second + auto tSky = outdoorAirTemperature; // Kelvins + auto solarRadiation = 1000.0; + auto Outdoor = Tarcog::ISO15099::Environments::outdoor( + outdoorAirTemperature, outdoorAirSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); + ASSERT_TRUE(Outdoor != nullptr); + Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); + + ///////////////////////////////////////////////////////// + /// Indoor + ///////////////////////////////////////////////////////// + + auto roomTemperature = 298.15; + auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); + ASSERT_TRUE(Indoor != nullptr); + + ///////////////////////////////////////////////////////// + /// IGU + ///////////////////////////////////////////////////////// + + auto windowWidth = 1.0; + auto windowHeight = 1.0; + + const auto solidLayerThickness = 0.003048; // [m] + const auto solidLayerConductance = 1.0; + auto solidLayer = + Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance); + solidLayer->setSolarAbsorptance(0.04, solarRadiation); + ASSERT_TRUE(solidLayer != nullptr); + + auto gapThickness = 0.05; + auto gapLayer = Tarcog::ISO15099::Layers::gap(gapThickness); + ASSERT_TRUE(gapLayer != nullptr); + auto gapAirSpeed = 0.1; + auto forcedGapLayer = + Tarcog::ISO15099::Layers::forcedVentilationGap(gapLayer, gapAirSpeed, roomTemperature); + ASSERT_TRUE(forcedGapLayer != nullptr); + + auto shadeLayerConductance = 0.12; + // make cell geometry + const auto thickness_31111{0.00023}; + const auto x = 0.00169; // m + const auto y = 0.00169; // m + const auto radius = 0.00058; // m + const auto CellDimension{ + ThermalPermeability::Perforated::diameterToXYDimension(2 * radius)}; + const auto frontOpenness{ThermalPermeability::Perforated::openness( + ThermalPermeability::Perforated::Geometry::Circular, + x, + y, + CellDimension.x, + CellDimension.y)}; + const auto dl{0.0}; + const auto dr{0.0}; + const auto dtop{0.0}; + const auto dbot{0.0}; + EffectiveLayers::ShadeOpenness openness{frontOpenness, dl, dr, dtop, dbot}; + EffectiveLayers::EffectiveLayerPerforated effectiveLayerPerforated{ + windowWidth, windowHeight, thickness_31111, openness}; + EffectiveLayers::EffectiveOpenness effOpenness{ + effectiveLayerPerforated.getEffectiveOpenness()}; + const auto effectiveThickness{effectiveLayerPerforated.effectiveThickness()}; + auto Ef = 0.640892; + auto Eb = 0.623812; + auto Tirf = 0.257367; + auto Tirb = 0.257367; + auto shadeLayer = Tarcog::ISO15099::Layers::shading( + effectiveThickness, shadeLayerConductance, effOpenness, Ef, Tirf, Eb, Tirb); + shadeLayer->setSolarAbsorptance(0.35, solarRadiation); + ASSERT_TRUE(shadeLayer != nullptr); + + Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); + aIGU.addLayers({solidLayer, forcedGapLayer, shadeLayer}); + + ///////////////////////////////////////////////////////// + /// System + ///////////////////////////////////////////////////////// + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); + ASSERT_TRUE(m_TarcogSystem != nullptr); + + m_TarcogSystem->solve(); + } + +public: + [[nodiscard]] CIGUSolidLayer * GetFirstLayer() const + { + return m_TarcogSystem->getSolidLayers()[0].get(); + }; + + [[nodiscard]] CIGUGapLayer * GetGap() const + { + return m_TarcogSystem->getGapLayers()[0].get(); + }; + + [[nodiscard]] CIGUSolidLayer * GetSecondLayer() const + { + return m_TarcogSystem->getSolidLayers()[1].get(); + }; +}; + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir, GapLayerSurfaceIRFlow) +{ + SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); + auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); + EXPECT_NEAR(300.51850897417813, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir, GainEnergy) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gain Energy"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto gainEnergy = aLayer->getGainFlow(); + EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir, FirstLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); + + auto aLayer = GetFirstLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); + EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir, GapTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + auto layerTemperature = aLayer->layerTemperature(); + auto averageTemperature = aLayer->averageTemperature(); + EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); + EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); + EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); + EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir, SecondLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); + + auto aLayer = GetSecondLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); + EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); +} \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight.unit.cpp new file mode 100644 index 00000000..61963e9e --- /dev/null +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight.unit.cpp @@ -0,0 +1,197 @@ +#include +#include + +#include "WCETarcog.hpp" + +using Tarcog::ISO15099::CIGUSolidLayer; +using Tarcog::ISO15099::CIGUGapLayer; +using Tarcog::ISO15099::CSingleSystem; + +class TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight : public testing::Test +{ +private: + std::unique_ptr m_TarcogSystem; + +protected: + void SetUp() override + { + ///////////////////////////////////////////////////////// + // Outdoor + ///////////////////////////////////////////////////////// + auto outdoorAirTemperature = 298.15; // Kelvins + auto outdoorAirSpeed = 2.75; // meters per second + auto tSky = outdoorAirTemperature; // Kelvins + auto solarRadiation = 1000.0; + auto Outdoor = Tarcog::ISO15099::Environments::outdoor( + outdoorAirTemperature, outdoorAirSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); + ASSERT_TRUE(Outdoor != nullptr); + Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); + + ///////////////////////////////////////////////////////// + /// Indoor + ///////////////////////////////////////////////////////// + + auto roomTemperature = 298.15; + auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); + ASSERT_TRUE(Indoor != nullptr); + + ///////////////////////////////////////////////////////// + /// IGU + ///////////////////////////////////////////////////////// + + auto windowWidth = 1.0; + auto windowHeight = 3.0; + + const auto solidLayerThickness = 0.003048; // [m] + const auto solidLayerConductance = 1.0; + auto solidLayer = + Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance); + solidLayer->setSolarAbsorptance(0.04, solarRadiation); + ASSERT_TRUE(solidLayer != nullptr); + + auto gapThickness = 0.05; + auto gapLayer = Tarcog::ISO15099::Layers::gap(gapThickness); + ASSERT_TRUE(gapLayer != nullptr); + auto gapAirSpeed = 0.1; + auto forcedGapLayer = + Tarcog::ISO15099::Layers::forcedVentilationGap(gapLayer, gapAirSpeed, roomTemperature); + ASSERT_TRUE(forcedGapLayer != nullptr); + + auto shadeLayerConductance = 0.12; + // make cell geometry + const auto thickness_31111{0.00023}; + const auto x = 0.00169; // m + const auto y = 0.00169; // m + const auto radius = 0.00058; // m + const auto CellDimension{ + ThermalPermeability::Perforated::diameterToXYDimension(2 * radius)}; + const auto frontOpenness{ThermalPermeability::Perforated::openness( + ThermalPermeability::Perforated::Geometry::Circular, + x, + y, + CellDimension.x, + CellDimension.y)}; + const auto dl{0.0}; + const auto dr{0.0}; + const auto dtop{0.0}; + const auto dbot{0.0}; + EffectiveLayers::ShadeOpenness openness{frontOpenness, dl, dr, dtop, dbot}; + EffectiveLayers::EffectiveLayerPerforated effectiveLayerPerforated{ + windowWidth, windowHeight, thickness_31111, openness}; + EffectiveLayers::EffectiveOpenness effOpenness{ + effectiveLayerPerforated.getEffectiveOpenness()}; + const auto effectiveThickness{effectiveLayerPerforated.effectiveThickness()}; + auto Ef = 0.640892; + auto Eb = 0.623812; + auto Tirf = 0.257367; + auto Tirb = 0.257367; + auto shadeLayer = Tarcog::ISO15099::Layers::shading( + effectiveThickness, shadeLayerConductance, effOpenness, Ef, Tirf, Eb, Tirb); + shadeLayer->setSolarAbsorptance(0.35, solarRadiation); + ASSERT_TRUE(shadeLayer != nullptr); + + Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); + aIGU.addLayers({solidLayer, forcedGapLayer, shadeLayer}); + + ///////////////////////////////////////////////////////// + /// System + ///////////////////////////////////////////////////////// + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); + ASSERT_TRUE(m_TarcogSystem != nullptr); + + m_TarcogSystem->solve(); + } + +public: + [[nodiscard]] CIGUSolidLayer * GetFirstLayer() const + { + return m_TarcogSystem->getSolidLayers()[0].get(); + }; + + [[nodiscard]] CIGUGapLayer * GetGap() const + { + return m_TarcogSystem->getGapLayers()[0].get(); + }; + + [[nodiscard]] CIGUSolidLayer * GetSecondLayer() const + { + return m_TarcogSystem->getSolidLayers()[1].get(); + }; +}; + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight, GapLayerSurfaceIRFlow) +{ + SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); + auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); + EXPECT_NEAR(300.51850897417813, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight, GainEnergy) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gain Energy"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto gainEnergy = aLayer->getGainFlow(); + EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight, FirstLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); + + auto aLayer = GetFirstLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); + EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight, GapTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + auto layerTemperature = aLayer->layerTemperature(); + auto averageTemperature = aLayer->averageTemperature(); + EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); + EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); + EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); + EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight, SecondLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); + + auto aLayer = GetSecondLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); + EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); +} \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingNoVentilation.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingNoVentilation.unit.cpp new file mode 100644 index 00000000..efd4cee8 --- /dev/null +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingNoVentilation.unit.cpp @@ -0,0 +1,197 @@ +#include +#include + +#include "WCETarcog.hpp" + +using Tarcog::ISO15099::CIGUSolidLayer; +using Tarcog::ISO15099::CIGUGapLayer; +using Tarcog::ISO15099::CSingleSystem; + +class TestGapBetweenIrradiatedGlassAndInteriorShadingNoVentilation : public testing::Test +{ +private: + std::unique_ptr m_TarcogSystem; + +protected: + void SetUp() override + { + ///////////////////////////////////////////////////////// + // Outdoor + ///////////////////////////////////////////////////////// + auto outdoorAirTemperature = 298.15; // Kelvins + auto outdoorAirSpeed = 2.75; // meters per second + auto tSky = outdoorAirTemperature; // Kelvins + auto solarRadiation = 1000.0; + auto Outdoor = Tarcog::ISO15099::Environments::outdoor( + outdoorAirTemperature, outdoorAirSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); + ASSERT_TRUE(Outdoor != nullptr); + Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); + + ///////////////////////////////////////////////////////// + /// Indoor + ///////////////////////////////////////////////////////// + + auto roomTemperature = 298.15; + auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); + ASSERT_TRUE(Indoor != nullptr); + + ///////////////////////////////////////////////////////// + /// IGU + ///////////////////////////////////////////////////////// + + auto windowWidth = 1.0; + auto windowHeight = 1.0; + + const auto solidLayerThickness = 0.003048; // [m] + const auto solidLayerConductance = 1.0; + auto solidLayer = + Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance); + solidLayer->setSolarAbsorptance(0.04, solarRadiation); + ASSERT_TRUE(solidLayer != nullptr); + + auto gapThickness = 0.05; + auto gapLayer = Tarcog::ISO15099::Layers::gap(gapThickness); + ASSERT_TRUE(gapLayer != nullptr); + auto gapAirSpeed = 0.0; + auto forcedGapLayer = + Tarcog::ISO15099::Layers::forcedVentilationGap(gapLayer, gapAirSpeed, roomTemperature); + ASSERT_TRUE(forcedGapLayer != nullptr); + + auto shadeLayerConductance = 0.12; + // make cell geometry + const auto thickness_31111{0.00023}; + const auto x = 0.00169; // m + const auto y = 0.00169; // m + const auto radius = 0.00058; // m + const auto CellDimension{ + ThermalPermeability::Perforated::diameterToXYDimension(2 * radius)}; + const auto frontOpenness{ThermalPermeability::Perforated::openness( + ThermalPermeability::Perforated::Geometry::Circular, + x, + y, + CellDimension.x, + CellDimension.y)}; + const auto dl{0.0}; + const auto dr{0.0}; + const auto dtop{0.0}; + const auto dbot{0.0}; + EffectiveLayers::ShadeOpenness openness{frontOpenness, dl, dr, dtop, dbot}; + EffectiveLayers::EffectiveLayerPerforated effectiveLayerPerforated{ + windowWidth, windowHeight, thickness_31111, openness}; + EffectiveLayers::EffectiveOpenness effOpenness{ + effectiveLayerPerforated.getEffectiveOpenness()}; + const auto effectiveThickness{effectiveLayerPerforated.effectiveThickness()}; + auto Ef = 0.640892; + auto Eb = 0.623812; + auto Tirf = 0.257367; + auto Tirb = 0.257367; + auto shadeLayer = Tarcog::ISO15099::Layers::shading( + effectiveThickness, shadeLayerConductance, effOpenness, Ef, Tirf, Eb, Tirb); + shadeLayer->setSolarAbsorptance(0.35, solarRadiation); + ASSERT_TRUE(shadeLayer != nullptr); + + Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); + aIGU.addLayers({solidLayer, forcedGapLayer, shadeLayer}); + + ///////////////////////////////////////////////////////// + /// System + ///////////////////////////////////////////////////////// + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); + ASSERT_TRUE(m_TarcogSystem != nullptr); + + m_TarcogSystem->solve(); + } + +public: + [[nodiscard]] CIGUSolidLayer * GetFirstLayer() const + { + return m_TarcogSystem->getSolidLayers()[0].get(); + }; + + [[nodiscard]] CIGUGapLayer * GetGap() const + { + return m_TarcogSystem->getGapLayers()[0].get(); + }; + + [[nodiscard]] CIGUSolidLayer * GetSecondLayer() const + { + return m_TarcogSystem->getSolidLayers()[1].get(); + }; +}; + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNoVentilation, GapLayerSurfaceIRFlow) +{ + SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); + auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); + EXPECT_NEAR(300.51850897417813, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNoVentilation, GainEnergy) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gain Energy"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto gainEnergy = aLayer->getGainFlow(); + EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNoVentilation, FirstLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); + + auto aLayer = GetFirstLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); + EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNoVentilation, GapTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + auto layerTemperature = aLayer->layerTemperature(); + auto averageTemperature = aLayer->averageTemperature(); + EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); + EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); + EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); + EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNoVentilation, SecondLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); + + auto aLayer = GetSecondLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); + EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); +} \ No newline at end of file From c750c4e4ab691053178e21a16affbcfb6bfad234 Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Wed, 25 Jan 2023 17:36:35 +0100 Subject: [PATCH 16/33] Rename the validation tests to make them more consistend with the other `GapBetween*` tests. --- ...cedVentilationInsideAirWinterValidation.unit.cpp} | 0 ...GlassPanesNoVentilationWinterValidation.unit.cpp} | 12 ++++++------ ...cedVentilationInsideAirSummerValidation.unit.cpp} | 0 3 files changed, 6 insertions(+), 6 deletions(-) rename src/Tarcog/tst/units/{GapBetweenGlassPanesForcedVentilationInsideAirValidationWinter.unit.cpp => GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp} (100%) rename src/Tarcog/tst/units/{GapBetweenGlassPanesNoVentilationValidationWinter.unit.cpp => GapBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp} (93%) rename src/Tarcog/tst/units/{GapBetweenGlassPanesForcedVentilationInsideAirValidationSummer.unit.cpp => GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp} (100%) diff --git a/src/Tarcog/tst/units/GapBetweenGlassPanesForcedVentilationInsideAirValidationWinter.unit.cpp b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp similarity index 100% rename from src/Tarcog/tst/units/GapBetweenGlassPanesForcedVentilationInsideAirValidationWinter.unit.cpp rename to src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp diff --git a/src/Tarcog/tst/units/GapBetweenGlassPanesNoVentilationValidationWinter.unit.cpp b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp similarity index 93% rename from src/Tarcog/tst/units/GapBetweenGlassPanesNoVentilationValidationWinter.unit.cpp rename to src/Tarcog/tst/units/GapBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp index c1ddb88c..f1acc079 100644 --- a/src/Tarcog/tst/units/GapBetweenGlassPanesNoVentilationValidationWinter.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp @@ -7,7 +7,7 @@ using Tarcog::ISO15099::CIGUSolidLayer; using Tarcog::ISO15099::CIGUGapLayer; using Tarcog::ISO15099::CSingleSystem; -class TestGapBetweenGlassPanesNoVentilationValidationWinter : public testing::Test +class TestGapBetweenDarkGlassPanesNoVentilationWinterValidation : public testing::Test { private: std::unique_ptr m_TarcogSystem; @@ -108,7 +108,7 @@ class TestGapBetweenGlassPanesNoVentilationValidationWinter : public testing::Te }; }; -TEST_F(TestGapBetweenGlassPanesNoVentilationValidationWinter, GapLayerSurfaceIRFlow) +TEST_F(TestGapBetweenDarkGlassPanesNoVentilationWinterValidation, GapLayerSurfaceIRFlow) { SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); @@ -123,7 +123,7 @@ TEST_F(TestGapBetweenGlassPanesNoVentilationValidationWinter, GapLayerSurfaceIRF EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); } -TEST_F(TestGapBetweenGlassPanesNoVentilationValidationWinter, GainEnergy) +TEST_F(TestGapBetweenDarkGlassPanesNoVentilationWinterValidation, GainEnergy) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gain Energy"); @@ -136,7 +136,7 @@ TEST_F(TestGapBetweenGlassPanesNoVentilationValidationWinter, GainEnergy) EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); } -TEST_F(TestGapBetweenGlassPanesNoVentilationValidationWinter, FirstLayerSurfaceTemperatures) +TEST_F(TestGapBetweenDarkGlassPanesNoVentilationWinterValidation, FirstLayerSurfaceTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); @@ -151,7 +151,7 @@ TEST_F(TestGapBetweenGlassPanesNoVentilationValidationWinter, FirstLayerSurfaceT EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); } -TEST_F(TestGapBetweenGlassPanesNoVentilationValidationWinter, GapTemperatures) +TEST_F(TestGapBetweenDarkGlassPanesNoVentilationWinterValidation, GapTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); @@ -170,7 +170,7 @@ TEST_F(TestGapBetweenGlassPanesNoVentilationValidationWinter, GapTemperatures) EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); } -TEST_F(TestGapBetweenGlassPanesNoVentilationValidationWinter, SecondLayerSurfaceTemperatures) +TEST_F(TestGapBetweenDarkGlassPanesNoVentilationWinterValidation, SecondLayerSurfaceTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); diff --git a/src/Tarcog/tst/units/GapBetweenGlassPanesForcedVentilationInsideAirValidationSummer.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp similarity index 100% rename from src/Tarcog/tst/units/GapBetweenGlassPanesForcedVentilationInsideAirValidationSummer.unit.cpp rename to src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp From 8685f9da8428a286e631fc99a35b24dca759bedd Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Thu, 26 Jan 2023 10:57:43 +0100 Subject: [PATCH 17/33] Finish renaming the 8 tests for validation and explanation --- ...rcedVentilationInsideAirWinterValidation.unit.cpp | 12 ++++++------ ...rcedVentilationInsideAirSummerValidation.unit.cpp | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp index ad4dd066..23b8a9e1 100644 --- a/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp @@ -7,7 +7,7 @@ using Tarcog::ISO15099::CIGUSolidLayer; using Tarcog::ISO15099::CIGUGapLayer; using Tarcog::ISO15099::CSingleSystem; -class TestGapBetweenGlassPanesForcedVentilationInsideAirValidationWinter : public testing::Test +class TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation : public testing::Test { private: std::unique_ptr m_TarcogSystem; @@ -108,7 +108,7 @@ class TestGapBetweenGlassPanesForcedVentilationInsideAirValidationWinter : publi }; }; -TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationWinter, GapLayerSurfaceIRFlow) +TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, GapLayerSurfaceIRFlow) { SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); @@ -123,7 +123,7 @@ TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationWinter, GapLa EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); } -TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationWinter, GainEnergy) +TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, GainEnergy) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gain Energy"); @@ -136,7 +136,7 @@ TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationWinter, GainE EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); } -TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationWinter, FirstLayerSurfaceTemperatures) +TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, FirstLayerSurfaceTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); @@ -151,7 +151,7 @@ TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationWinter, First EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); } -TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationWinter, GapTemperatures) +TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, GapTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); @@ -170,7 +170,7 @@ TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationWinter, GapTe EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); } -TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationWinter, SecondLayerSurfaceTemperatures) +TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, SecondLayerSurfaceTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp index d0e9e652..7e188eb6 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp @@ -7,7 +7,7 @@ using Tarcog::ISO15099::CIGUSolidLayer; using Tarcog::ISO15099::CIGUGapLayer; using Tarcog::ISO15099::CSingleSystem; -class TestGapBetweenGlassPanesForcedVentilationInsideAirValidationSummer : public testing::Test +class TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation : public testing::Test { private: std::unique_ptr m_TarcogSystem; @@ -112,7 +112,7 @@ class TestGapBetweenGlassPanesForcedVentilationInsideAirValidationSummer : publi }; }; -TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationSummer, GapLayerSurfaceIRFlow) +TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, GapLayerSurfaceIRFlow) { SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); @@ -127,7 +127,7 @@ TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationSummer, GapLa EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); } -TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationSummer, GainEnergy) +TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, GainEnergy) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gain Energy"); @@ -140,7 +140,7 @@ TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationSummer, GainE EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); } -TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationSummer, FirstLayerSurfaceTemperatures) +TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, FirstLayerSurfaceTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); @@ -155,7 +155,7 @@ TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationSummer, First EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); } -TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationSummer, GapTemperatures) +TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, GapTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); @@ -174,7 +174,7 @@ TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationSummer, GapTe EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); } -TEST_F(TestGapBetweenGlassPanesForcedVentilationInsideAirValidationSummer, SecondLayerSurfaceTemperatures) +TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, SecondLayerSurfaceTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); From cdfaf88983998d82d2641433d98b654f53ce458a Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Thu, 26 Jan 2023 11:05:27 +0100 Subject: [PATCH 18/33] Use new lines consistently in the blocks of the 8 new tests --- ...lassPanesForcedVentilationInsideAirWinterValidation.unit.cpp | 1 + ...pBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp | 1 + ...dExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp | 2 ++ ...assAndInteriorShadingFastForcedVentilationInsideAir.unit.cpp | 2 ++ ...edGlassAndInteriorShadingForcedVentilationInsideAir.unit.cpp | 2 ++ ...orShadingForcedVentilationInsideAirThreeMeterHeight.unit.cpp | 2 ++ ...tweenIrradiatedGlassAndInteriorShadingNoVentilation.unit.cpp | 2 ++ ...lassPanesForcedVentilationInsideAirSummerValidation.unit.cpp | 2 ++ 8 files changed, 14 insertions(+) diff --git a/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp index 23b8a9e1..a0fe2cb6 100644 --- a/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp @@ -85,6 +85,7 @@ class TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation : p ///////////////////////////////////////////////////////// /// System ///////////////////////////////////////////////////////// + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); ASSERT_TRUE(m_TarcogSystem != nullptr); diff --git a/src/Tarcog/tst/units/GapBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp index f1acc079..0f42e4f3 100644 --- a/src/Tarcog/tst/units/GapBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp @@ -85,6 +85,7 @@ class TestGapBetweenDarkGlassPanesNoVentilationWinterValidation : public testing ///////////////////////////////////////////////////////// /// System ///////////////////////////////////////////////////////// + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); ASSERT_TRUE(m_TarcogSystem != nullptr); diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp index 2ec3d94c..2447dff7 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp @@ -18,6 +18,7 @@ class TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir ///////////////////////////////////////////////////////// // Outdoor ///////////////////////////////////////////////////////// + auto outdoorAirTemperature = 298.15; // Kelvins auto outdoorAirSpeed = 2.75; // meters per second auto tSky = outdoorAirTemperature; // Kelvins @@ -96,6 +97,7 @@ class TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir ///////////////////////////////////////////////////////// /// System ///////////////////////////////////////////////////////// + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); ASSERT_TRUE(m_TarcogSystem != nullptr); diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir.unit.cpp index 6cb40024..3a60919e 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir.unit.cpp @@ -18,6 +18,7 @@ class TestGapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInside ///////////////////////////////////////////////////////// // Outdoor ///////////////////////////////////////////////////////// + auto outdoorAirTemperature = 298.15; // Kelvins auto outdoorAirSpeed = 2.75; // meters per second auto tSky = outdoorAirTemperature; // Kelvins @@ -96,6 +97,7 @@ class TestGapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInside ///////////////////////////////////////////////////////// /// System ///////////////////////////////////////////////////////// + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); ASSERT_TRUE(m_TarcogSystem != nullptr); diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir.unit.cpp index ab73710b..3b99dd8b 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir.unit.cpp @@ -18,6 +18,7 @@ class TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir ///////////////////////////////////////////////////////// // Outdoor ///////////////////////////////////////////////////////// + auto outdoorAirTemperature = 298.15; // Kelvins auto outdoorAirSpeed = 2.75; // meters per second auto tSky = outdoorAirTemperature; // Kelvins @@ -96,6 +97,7 @@ class TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir ///////////////////////////////////////////////////////// /// System ///////////////////////////////////////////////////////// + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); ASSERT_TRUE(m_TarcogSystem != nullptr); diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight.unit.cpp index 61963e9e..5e3a4072 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight.unit.cpp @@ -18,6 +18,7 @@ class TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirT ///////////////////////////////////////////////////////// // Outdoor ///////////////////////////////////////////////////////// + auto outdoorAirTemperature = 298.15; // Kelvins auto outdoorAirSpeed = 2.75; // meters per second auto tSky = outdoorAirTemperature; // Kelvins @@ -96,6 +97,7 @@ class TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirT ///////////////////////////////////////////////////////// /// System ///////////////////////////////////////////////////////// + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); ASSERT_TRUE(m_TarcogSystem != nullptr); diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingNoVentilation.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingNoVentilation.unit.cpp index efd4cee8..9b2dfb23 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingNoVentilation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingNoVentilation.unit.cpp @@ -18,6 +18,7 @@ class TestGapBetweenIrradiatedGlassAndInteriorShadingNoVentilation : public test ///////////////////////////////////////////////////////// // Outdoor ///////////////////////////////////////////////////////// + auto outdoorAirTemperature = 298.15; // Kelvins auto outdoorAirSpeed = 2.75; // meters per second auto tSky = outdoorAirTemperature; // Kelvins @@ -96,6 +97,7 @@ class TestGapBetweenIrradiatedGlassAndInteriorShadingNoVentilation : public test ///////////////////////////////////////////////////////// /// System ///////////////////////////////////////////////////////// + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); ASSERT_TRUE(m_TarcogSystem != nullptr); diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp index 7e188eb6..47dba402 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp @@ -18,6 +18,7 @@ class TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidati ///////////////////////////////////////////////////////// // Outdoor ///////////////////////////////////////////////////////// + auto outdoorAirTemperature = 303.15; // Kelvins auto outdoorAirSpeed = 2.75; // meters per second auto tSky = 303.15; // Kelvins @@ -89,6 +90,7 @@ class TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidati ///////////////////////////////////////////////////////// /// System ///////////////////////////////////////////////////////// + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); ASSERT_TRUE(m_TarcogSystem != nullptr); From d0e7cc8af49ec2f045e25447fd66dc173f5a0a9f Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Thu, 26 Jan 2023 14:16:11 +0100 Subject: [PATCH 19/33] Add test with exterior shading and forced convection with roomTemperature for comparison. --- ...ndGlassForcedVentilationInsideAir.unit.cpp | 199 ++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir.unit.cpp diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir.unit.cpp new file mode 100644 index 00000000..c678da67 --- /dev/null +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir.unit.cpp @@ -0,0 +1,199 @@ +#include +#include + +#include "WCETarcog.hpp" + +using Tarcog::ISO15099::CIGUSolidLayer; +using Tarcog::ISO15099::CIGUGapLayer; +using Tarcog::ISO15099::CSingleSystem; + +class TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir : public testing::Test +{ +private: + std::unique_ptr m_TarcogSystem; + +protected: + void SetUp() override + { + ///////////////////////////////////////////////////////// + // Outdoor + ///////////////////////////////////////////////////////// + + auto outdoorAirTemperature = 298.15; // Kelvins + auto outdoorAirSpeed = 2.75; // meters per second + auto tSky = outdoorAirTemperature; // Kelvins + auto solarRadiation = 1000.0; + auto Outdoor = Tarcog::ISO15099::Environments::outdoor( + outdoorAirTemperature, outdoorAirSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); + ASSERT_TRUE(Outdoor != nullptr); + Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); + + ///////////////////////////////////////////////////////// + /// Indoor + ///////////////////////////////////////////////////////// + + auto roomTemperature = 298.15; + auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); + ASSERT_TRUE(Indoor != nullptr); + + ///////////////////////////////////////////////////////// + /// IGU + ///////////////////////////////////////////////////////// + + auto windowWidth = 1.0; + auto windowHeight = 1.0; + + auto shadeLayerConductance = 0.12; + // make cell geometry + const auto thickness_31111{0.00023}; + const auto x = 0.00169; // m + const auto y = 0.00169; // m + const auto radius = 0.00058; // m + const auto CellDimension{ + ThermalPermeability::Perforated::diameterToXYDimension(2 * radius)}; + const auto frontOpenness{ThermalPermeability::Perforated::openness( + ThermalPermeability::Perforated::Geometry::Circular, + x, + y, + CellDimension.x, + CellDimension.y)}; + const auto dl{0.0}; + const auto dr{0.0}; + const auto dtop{0.0}; + const auto dbot{0.0}; + EffectiveLayers::ShadeOpenness openness{frontOpenness, dl, dr, dtop, dbot}; + EffectiveLayers::EffectiveLayerPerforated effectiveLayerPerforated{ + windowWidth, windowHeight, thickness_31111, openness}; + EffectiveLayers::EffectiveOpenness effOpenness{ + effectiveLayerPerforated.getEffectiveOpenness()}; + const auto effectiveThickness{effectiveLayerPerforated.effectiveThickness()}; + auto Ef = 0.640892; + auto Eb = 0.623812; + auto Tirf = 0.257367; + auto Tirb = 0.257367; + auto shadeLayer = Tarcog::ISO15099::Layers::shading( + effectiveThickness, shadeLayerConductance, effOpenness, Ef, Tirf, Eb, Tirb); + shadeLayer->setSolarAbsorptance(0.35, solarRadiation); + ASSERT_TRUE(shadeLayer != nullptr); + + auto gapThickness = 0.05; + auto gapLayer = Tarcog::ISO15099::Layers::gap(gapThickness); + ASSERT_TRUE(gapLayer != nullptr); + auto gapAirSpeed = 0.1; + auto forcedGapLayer = + Tarcog::ISO15099::Layers::forcedVentilationGap(gapLayer, gapAirSpeed, roomTemperature); + ASSERT_TRUE(forcedGapLayer != nullptr); + + const auto solidLayerThickness = 0.003048; // [m] + const auto solidLayerConductance = 1.0; + auto solidLayer = + Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance); + solidLayer->setSolarAbsorptance(0.04, solarRadiation); + ASSERT_TRUE(solidLayer != nullptr); + + Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); + aIGU.addLayers({shadeLayer, forcedGapLayer, solidLayer}); + + ///////////////////////////////////////////////////////// + /// System + ///////////////////////////////////////////////////////// + + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); + ASSERT_TRUE(m_TarcogSystem != nullptr); + + m_TarcogSystem->solve(); + } + +public: + [[nodiscard]] CIGUSolidLayer * GetFirstLayer() const + { + return m_TarcogSystem->getSolidLayers()[0].get(); + }; + + [[nodiscard]] CIGUGapLayer * GetGap() const + { + return m_TarcogSystem->getGapLayers()[0].get(); + }; + + [[nodiscard]] CIGUSolidLayer * GetSecondLayer() const + { + return m_TarcogSystem->getSolidLayers()[1].get(); + }; +}; + +TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir, GapLayerSurfaceIRFlow) +{ + SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); + auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); + EXPECT_NEAR(300.51850897417813, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir, GainEnergy) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gain Energy"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto gainEnergy = aLayer->getGainFlow(); + EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir, FirstLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); + + auto aLayer = GetFirstLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); + EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir, GapTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + auto layerTemperature = aLayer->layerTemperature(); + auto averageTemperature = aLayer->averageTemperature(); + EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); + EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); + EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); + EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir, SecondLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); + + auto aLayer = GetSecondLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); + EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); +} \ No newline at end of file From 03a1d55774be8e4786ce05054eaa1eb7edf10160 Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Thu, 26 Jan 2023 14:19:44 +0100 Subject: [PATCH 20/33] Add tests to compare zero forced convection with the natural convection of a gap without forced convection. Why is there a difference? Relates to #5 --- ...dInteriorShadingNaturalConvection.unit.cpp | 195 ++++++++++++++++++ ...riorShadingZeroForcedVentilation.unit.cpp} | 12 +- 2 files changed, 201 insertions(+), 6 deletions(-) create mode 100644 src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection.unit.cpp rename src/Tarcog/tst/units/{GapBetweenIrradiatedGlassAndInteriorShadingNoVentilation.unit.cpp => GapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation.unit.cpp} (92%) diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection.unit.cpp new file mode 100644 index 00000000..f470c61b --- /dev/null +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection.unit.cpp @@ -0,0 +1,195 @@ +#include +#include + +#include "WCETarcog.hpp" + +using Tarcog::ISO15099::CIGUSolidLayer; +using Tarcog::ISO15099::CIGUGapLayer; +using Tarcog::ISO15099::CSingleSystem; + +class TestGapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection : public testing::Test +{ +private: + std::unique_ptr m_TarcogSystem; + +protected: + void SetUp() override + { + ///////////////////////////////////////////////////////// + // Outdoor + ///////////////////////////////////////////////////////// + + auto outdoorAirTemperature = 298.15; // Kelvins + auto outdoorAirSpeed = 2.75; // meters per second + auto tSky = outdoorAirTemperature; // Kelvins + auto solarRadiation = 1000.0; + auto Outdoor = Tarcog::ISO15099::Environments::outdoor( + outdoorAirTemperature, outdoorAirSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); + ASSERT_TRUE(Outdoor != nullptr); + Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); + + ///////////////////////////////////////////////////////// + /// Indoor + ///////////////////////////////////////////////////////// + + auto roomTemperature = 298.15; + auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); + ASSERT_TRUE(Indoor != nullptr); + + ///////////////////////////////////////////////////////// + /// IGU + ///////////////////////////////////////////////////////// + + auto windowWidth = 1.0; + auto windowHeight = 1.0; + + const auto solidLayerThickness = 0.003048; // [m] + const auto solidLayerConductance = 1.0; + auto solidLayer = + Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance); + solidLayer->setSolarAbsorptance(0.04, solarRadiation); + ASSERT_TRUE(solidLayer != nullptr); + + auto gapThickness = 0.05; + auto gapLayer = Tarcog::ISO15099::Layers::gap(gapThickness); + ASSERT_TRUE(gapLayer != nullptr); + + auto shadeLayerConductance = 0.12; + // make cell geometry + const auto thickness_31111{0.00023}; + const auto x = 0.00169; // m + const auto y = 0.00169; // m + const auto radius = 0.00058; // m + const auto CellDimension{ + ThermalPermeability::Perforated::diameterToXYDimension(2 * radius)}; + const auto frontOpenness{ThermalPermeability::Perforated::openness( + ThermalPermeability::Perforated::Geometry::Circular, + x, + y, + CellDimension.x, + CellDimension.y)}; + const auto dl{0.0}; + const auto dr{0.0}; + const auto dtop{0.0}; + const auto dbot{0.0}; + EffectiveLayers::ShadeOpenness openness{frontOpenness, dl, dr, dtop, dbot}; + EffectiveLayers::EffectiveLayerPerforated effectiveLayerPerforated{ + windowWidth, windowHeight, thickness_31111, openness}; + EffectiveLayers::EffectiveOpenness effOpenness{ + effectiveLayerPerforated.getEffectiveOpenness()}; + const auto effectiveThickness{effectiveLayerPerforated.effectiveThickness()}; + auto Ef = 0.640892; + auto Eb = 0.623812; + auto Tirf = 0.257367; + auto Tirb = 0.257367; + auto shadeLayer = Tarcog::ISO15099::Layers::shading( + effectiveThickness, shadeLayerConductance, effOpenness, Ef, Tirf, Eb, Tirb); + shadeLayer->setSolarAbsorptance(0.35, solarRadiation); + ASSERT_TRUE(shadeLayer != nullptr); + + Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); + aIGU.addLayers({solidLayer, gapLayer, shadeLayer}); + + ///////////////////////////////////////////////////////// + /// System + ///////////////////////////////////////////////////////// + + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); + ASSERT_TRUE(m_TarcogSystem != nullptr); + + m_TarcogSystem->solve(); + } + +public: + [[nodiscard]] CIGUSolidLayer * GetFirstLayer() const + { + return m_TarcogSystem->getSolidLayers()[0].get(); + }; + + [[nodiscard]] CIGUGapLayer * GetGap() const + { + return m_TarcogSystem->getGapLayers()[0].get(); + }; + + [[nodiscard]] CIGUSolidLayer * GetSecondLayer() const + { + return m_TarcogSystem->getSolidLayers()[1].get(); + }; +}; + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection, GapLayerSurfaceIRFlow) +{ + SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); + auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); + EXPECT_NEAR(300.51850897417813, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection, GainEnergy) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gain Energy"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto gainEnergy = aLayer->getGainFlow(); + EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection, FirstLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); + + auto aLayer = GetFirstLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); + EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection, GapTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + auto layerTemperature = aLayer->layerTemperature(); + auto averageTemperature = aLayer->averageTemperature(); + EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); + EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); + EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); + EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection, SecondLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); + + auto aLayer = GetSecondLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); + EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); +} \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingNoVentilation.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation.unit.cpp similarity index 92% rename from src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingNoVentilation.unit.cpp rename to src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation.unit.cpp index 9b2dfb23..c0f91d0e 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingNoVentilation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation.unit.cpp @@ -7,7 +7,7 @@ using Tarcog::ISO15099::CIGUSolidLayer; using Tarcog::ISO15099::CIGUGapLayer; using Tarcog::ISO15099::CSingleSystem; -class TestGapBetweenIrradiatedGlassAndInteriorShadingNoVentilation : public testing::Test +class TestGapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation : public testing::Test { private: std::unique_ptr m_TarcogSystem; @@ -121,7 +121,7 @@ class TestGapBetweenIrradiatedGlassAndInteriorShadingNoVentilation : public test }; }; -TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNoVentilation, GapLayerSurfaceIRFlow) +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation, GapLayerSurfaceIRFlow) { SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); @@ -136,7 +136,7 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNoVentilation, GapLayerSur EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); } -TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNoVentilation, GainEnergy) +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation, GainEnergy) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gain Energy"); @@ -149,7 +149,7 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNoVentilation, GainEnergy) EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); } -TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNoVentilation, FirstLayerSurfaceTemperatures) +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation, FirstLayerSurfaceTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); @@ -164,7 +164,7 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNoVentilation, FirstLayerS EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); } -TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNoVentilation, GapTemperatures) +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation, GapTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); @@ -183,7 +183,7 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNoVentilation, GapTemperat EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); } -TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNoVentilation, SecondLayerSurfaceTemperatures) +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation, SecondLayerSurfaceTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); From b78d795463a740e9e8dd52049f945c98b86fad0f Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Thu, 26 Jan 2023 14:59:42 +0100 Subject: [PATCH 21/33] Start test with 2 glass panes and 1 shading in between, but the test do not run properly. --- ...ntegratedShadingForcedVentilation.unit.cpp | 205 ++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation.unit.cpp diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation.unit.cpp new file mode 100644 index 00000000..e5923f5b --- /dev/null +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation.unit.cpp @@ -0,0 +1,205 @@ +#include +#include + +#include "WCETarcog.hpp" + +using Tarcog::ISO15099::CBaseIGULayer; +using Tarcog::ISO15099::CIGUSolidLayer; +using Tarcog::ISO15099::CIGUGapLayer; +using Tarcog::ISO15099::CSingleSystem; + +class TestGapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation : public testing::Test +{ +private: + std::unique_ptr m_TarcogSystem; + +protected: + void SetUp() override + { + ///////////////////////////////////////////////////////// + // Outdoor + ///////////////////////////////////////////////////////// + + auto airTemperature = 255.15; // Kelvins + auto airSpeed = 5.5; // meters per second + auto tSky = 255.15; // Kelvins + auto solarRadiation = 1000.0; + auto Outdoor = Tarcog::ISO15099::Environments::outdoor( + airTemperature, airSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); + ASSERT_TRUE(Outdoor != nullptr); + Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); + + ///////////////////////////////////////////////////////// + /// Indoor + ///////////////////////////////////////////////////////// + + auto roomTemperature = 295.15; + auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); + ASSERT_TRUE(Indoor != nullptr); + + ///////////////////////////////////////////////////////// + /// IGU + ///////////////////////////////////////////////////////// + + double windowWidth = 1; + double windowHeight = 1; + + auto solidLayerThickness = 0.005715; // [m] + auto solidLayerConductance = 1.0; + + auto layer1 = Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance); + layer1->setSolarAbsorptance(0.03, solarRadiation); + ASSERT_TRUE(layer1 != nullptr); + + auto layer2 = Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance); + layer2->setSolarAbsorptance(0.03, solarRadiation); + ASSERT_TRUE(layer2 != nullptr); + + auto shadeLayerThickness = 0.01; + auto shadeLayerConductance = 160.0; + auto Atop = 0.1; + auto Abot = 0.1; + auto Aleft = 0.1; + auto Aright = 0.1; + auto Afront = 0.2; + EffectiveLayers::ShadeOpenness openness{Afront, Aleft, Aright, Atop, Abot}; + EffectiveLayers::EffectiveLayerOther effectiveLayer{ + windowWidth, windowHeight, shadeLayerThickness, openness}; + EffectiveLayers::EffectiveOpenness effOpenness{effectiveLayer.getEffectiveOpenness()}; + auto shadeLayer = Tarcog::ISO15099::Layers::shading( + shadeLayerThickness, shadeLayerConductance, effOpenness); + shadeLayer->setSolarAbsorptance(0.35, solarRadiation); + ASSERT_TRUE(shadeLayer != nullptr); + + const auto gapThickness = 0.0127; + const auto gapAirSpeed = 0.5; + const auto aGap1 = Tarcog::ISO15099::Layers::gap(gapThickness); + ASSERT_TRUE(aGap1 != nullptr); + const auto gap1 = Tarcog::ISO15099::Layers::forcedVentilationGap( + aGap1, gapAirSpeed, roomTemperature); + ASSERT_TRUE(gap1 != nullptr); + auto aGap2 = Tarcog::ISO15099::Layers::gap(gapThickness); + ASSERT_TRUE(aGap2 != nullptr); + const auto gap2 = Tarcog::ISO15099::Layers::forcedVentilationGap( + aGap2, gapAirSpeed, roomTemperature); + + Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); + aIGU.addLayers({layer1, gap1, shadeLayer, gap2, layer2}); + + ///////////////////////////////////////////////////////// + /// System + ///////////////////////////////////////////////////////// + + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); + ASSERT_TRUE(m_TarcogSystem != nullptr); + } + +public: + [[nodiscard]] CBaseIGULayer * GetGap1() const + { + return m_TarcogSystem->getGapLayers()[0].get(); + }; + + [[nodiscard]] CBaseIGULayer * GetGap2() const + { + return m_TarcogSystem->getGapLayers()[1].get(); + }; + + [[nodiscard]] CIGUSolidLayer * GetFirstLayer() const + { + return m_TarcogSystem->getSolidLayers()[0].get(); + }; + + [[nodiscard]] CIGUSolidLayer * GetSecondLayer() const + { + return m_TarcogSystem->getSolidLayers()[1].get(); + }; + + [[nodiscard]] CIGUSolidLayer * GetThirdLayer() const + { + return m_TarcogSystem->getSolidLayers()[2].get(); + }; + +}; + +TEST_F(TestGapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation, VentilationFlow) +{ + SCOPED_TRACE("Begin Test: Test Ventilated Gap Layer - Intial Airflow"); + + auto aLayer = GetGap1(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto gainEnergy = aLayer->getGainFlow(); + EXPECT_NEAR(34.909058, gainEnergy, 1e-4); + + aLayer = GetGap2(); + ASSERT_TRUE(aLayer != nullptr); + gainEnergy = aLayer->getGainFlow(); + EXPECT_NEAR(-34.909058, gainEnergy, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation, FirstLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); + + auto aLayer = GetFirstLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); + EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); +} + +// TEST_F(TestGapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation, GapTemperatures) +// { +// SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); + +// auto aLayer = GetGap1(); + +// // Airflow iterations are set to 1e-4 and it cannot exceed that precision + +// ASSERT_TRUE(aLayer != nullptr); +// auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); +// auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); +// auto layerTemperature = aLayer->layerTemperature(); +// auto averageTemperature = aLayer->averageTemperature(); +// EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); +// EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); +// EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); +// EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); +// } + +TEST_F(TestGapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation, SecondLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); + + auto aLayer = GetSecondLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); + EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation, ThirdLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); + + auto aLayer = GetThirdLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); + EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); +} From 1d5827e2d52510a820dff5bb8b99e42a7569d8ef Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Tue, 31 Jan 2023 17:25:25 +0100 Subject: [PATCH 22/33] Fix test GapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation by adding `m_TarcogSystem->solve();` --- ...ssPanesWithIntegratedShadingForcedVentilation.unit.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation.unit.cpp index e5923f5b..c0f306d0 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation.unit.cpp @@ -20,9 +20,9 @@ class TestGapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation : // Outdoor ///////////////////////////////////////////////////////// - auto airTemperature = 255.15; // Kelvins + auto airTemperature = 298.15; // Kelvins auto airSpeed = 5.5; // meters per second - auto tSky = 255.15; // Kelvins + auto tSky = 298.15; // Kelvins auto solarRadiation = 1000.0; auto Outdoor = Tarcog::ISO15099::Environments::outdoor( airTemperature, airSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); @@ -33,7 +33,7 @@ class TestGapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation : /// Indoor ///////////////////////////////////////////////////////// - auto roomTemperature = 295.15; + auto roomTemperature = 298.15; auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); ASSERT_TRUE(Indoor != nullptr); @@ -92,6 +92,8 @@ class TestGapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation : m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); ASSERT_TRUE(m_TarcogSystem != nullptr); + + m_TarcogSystem->solve(); } public: From 180b8578270d78f407812728330ae4badf5127f3 Mon Sep 17 00:00:00 2001 From: Simon Wacker Date: Wed, 1 Feb 2023 13:08:21 +0100 Subject: [PATCH 23/33] Add getters for inlet and outlet temperatures --- src/Tarcog/src/IGUVentilatedGapLayer.cpp | 10 ++++++++++ src/Tarcog/src/IGUVentilatedGapLayer.hpp | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/Tarcog/src/IGUVentilatedGapLayer.cpp b/src/Tarcog/src/IGUVentilatedGapLayer.cpp index 01df8f51..56f68fd4 100644 --- a/src/Tarcog/src/IGUVentilatedGapLayer.cpp +++ b/src/Tarcog/src/IGUVentilatedGapLayer.cpp @@ -47,6 +47,16 @@ namespace Tarcog m_ReferenceGas.setTemperatureAndPressure(ReferenceTemperature, m_Pressure); } + double CIGUVentilatedGapLayer::inletTemperature() + { + return m_State.inletTemperature; + } + + double CIGUVentilatedGapLayer::outletTemperature() + { + return m_State.outletTemperature; + } + double CIGUVentilatedGapLayer::layerTemperature() { assert(m_Height != 0); diff --git a/src/Tarcog/src/IGUVentilatedGapLayer.hpp b/src/Tarcog/src/IGUVentilatedGapLayer.hpp index 3b55354e..6edb1f1c 100644 --- a/src/Tarcog/src/IGUVentilatedGapLayer.hpp +++ b/src/Tarcog/src/IGUVentilatedGapLayer.hpp @@ -38,6 +38,8 @@ namespace Tarcog double forcedVentilationInletTemperature, double forcedVentilationInletSpeed); + double inletTemperature(); + double outletTemperature(); double layerTemperature() override; void setFlowGeometry(double t_Ain, double t_Aout); From 723c4edf54b1d0aa35ed5c41816267225314ad3f Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Fri, 3 Feb 2023 15:44:35 +0100 Subject: [PATCH 24/33] Add example with very thick glass to calculate the external and internal heat transfer coefficients --- ...eenIndoorOutdoorAndVeryThickGlass.unit.cpp | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 src/Tarcog/tst/units/GapBetweenIndoorOutdoorAndVeryThickGlass.unit.cpp diff --git a/src/Tarcog/tst/units/GapBetweenIndoorOutdoorAndVeryThickGlass.unit.cpp b/src/Tarcog/tst/units/GapBetweenIndoorOutdoorAndVeryThickGlass.unit.cpp new file mode 100644 index 00000000..29a0a6e5 --- /dev/null +++ b/src/Tarcog/tst/units/GapBetweenIndoorOutdoorAndVeryThickGlass.unit.cpp @@ -0,0 +1,99 @@ +#include +#include + +#include "WCETarcog.hpp" + +using Tarcog::ISO15099::CIGUSolidLayer; +using Tarcog::ISO15099::CIGUGapLayer; +using Tarcog::ISO15099::CSingleSystem; + +class TestGapBetweenIndoorOutdoorAndVeryThickGlass : public testing::Test +{ +private: + std::unique_ptr m_TarcogSystem; + +protected: + void SetUp() override + { + ///////////////////////////////////////////////////////// + // This test is used to determine the external heat transfer coefficient between a very thick glass pane and exterior and the internal heat transfer coefficient between a very thick glass pane and the interior. + ///////////////////////////////////////////////////////// + + + ///////////////////////////////////////////////////////// + // Outdoor + ///////////////////////////////////////////////////////// + + auto outdoorAirTemperature = 273.15; // Kelvins + auto outdoorAirSpeed = 2.75; // meters per second + auto tSky = 273.15; // Kelvins + auto solarRadiation = 0.0; + auto Outdoor = Tarcog::ISO15099::Environments::outdoor( + outdoorAirTemperature, outdoorAirSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); + ASSERT_TRUE(Outdoor != nullptr); + Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); + + ///////////////////////////////////////////////////////// + /// Indoor + ///////////////////////////////////////////////////////// + + auto indoorAirTemperature = 298.15; + auto Indoor = Tarcog::ISO15099::Environments::indoor(indoorAirTemperature); + auto convective_heat_transfer_coefficient_indoor = 3.9; // + radiative_heat_transfer_coefficient (4.1 W/(m²K) from EN 410) = 8 W/(m²K) + Indoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH, convective_heat_transfer_coefficient_indoor); + ASSERT_TRUE(Indoor != nullptr); + + ///////////////////////////////////////////////////////// + /// IGU + ///////////////////////////////////////////////////////// + + auto windowWidth = 1.0; + auto windowHeight = 1.0; + + const auto solidLayer1Thickness = 1.0; // [m] + const auto solidLayer1Conductance = 1.0; + auto emissivity1 = 0.84; + auto transmittance1 = 0; + auto solidLayer1 = Tarcog::ISO15099::Layers::solid(solidLayer1Thickness, + solidLayer1Conductance, + emissivity1, + transmittance1, + emissivity1, + transmittance1); + solidLayer1->setSolarAbsorptance(0.2, solarRadiation); + ASSERT_TRUE(solidLayer1 != nullptr); + + Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); + aIGU.addLayers({solidLayer1}); + + ///////////////////////////////////////////////////////// + /// System + ///////////////////////////////////////////////////////// + + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); + ASSERT_TRUE(m_TarcogSystem != nullptr); + + m_TarcogSystem->solve(); + } + +public: + [[nodiscard]] CIGUSolidLayer * GetFirstLayer() const + { + return m_TarcogSystem->getSolidLayers()[0].get(); + }; +}; + +TEST_F(TestGapBetweenIndoorOutdoorAndVeryThickGlass, FirstLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); + + auto aLayer = GetFirstLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); + EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); +} \ No newline at end of file From 0a0fef4b0bc5428a87c6a28f1dd84406439e99cf Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Tue, 14 Mar 2023 15:58:48 +0100 Subject: [PATCH 25/33] Fail to print the indoor radiative heat transfer coefficient MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error message: /home/christoph/Documents/Windows-CalcEngine/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp:123:19: error: ‘CIndoorEnvironment’ does not name a type 123 | [[nodiscard]] CIndoorEnvironment * GetIndoorRadiativeHeatTransferCoefficient() const | ^~~~~~~~~~~~~~~~~~ /home/christoph/Documents/Windows-CalcEngine/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp:127:6: warning: extra ‘;’ [-Wpedantic] 127 | }; | ^ | - /home/christoph/Documents/Windows-CalcEngine/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp: In member function ‘virtual void TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation_IndoorHeatTransferCoefficients_Test::TestBody()’: /home/christoph/Documents/Windows-CalcEngine/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp:216:51: error: ‘GetIndoorRadiativeHeatTransferCoefficient’ was not declared in this scope; did you mean ‘indoorRadiativeHeatTransferCoefficient’? 216 | auto indoorRadiativeHeatTransferCoefficient = GetIndoorRadiativeHeatTransferCoefficient(); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | indoorRadiativeHeatTransferCoefficient make[1]: *** [src/Tarcog/CMakeFiles/Tarcog_tests.dir/build.make:776: src/Tarcog/CMakeFiles/Tarcog_tests.dir/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp.o] Error 1 --- ...tilationInsideAirSummerValidation.unit.cpp | 80 +++++++++++++------ 1 file changed, 55 insertions(+), 25 deletions(-) diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp index 47dba402..dd4246b5 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp @@ -6,8 +6,10 @@ using Tarcog::ISO15099::CIGUSolidLayer; using Tarcog::ISO15099::CIGUGapLayer; using Tarcog::ISO15099::CSingleSystem; +using Tarcog::ISO15099::CIndoorEnvironment; -class TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation : public testing::Test +class TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation + : public testing::Test { private: std::unique_ptr m_TarcogSystem; @@ -19,13 +21,17 @@ class TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidati // Outdoor ///////////////////////////////////////////////////////// - auto outdoorAirTemperature = 303.15; // Kelvins - auto outdoorAirSpeed = 2.75; // meters per second - auto tSky = 303.15; // Kelvins + auto outdoorAirTemperature = 303.15; // Kelvins + auto outdoorAirSpeed = 2.75; // meters per second + auto tSky = 303.15; // Kelvins auto solarRadiation = 1000.0; - auto Outdoor = Tarcog::ISO15099::Environments::outdoor( - outdoorAirTemperature, outdoorAirSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); + auto Outdoor = + Tarcog::ISO15099::Environments::outdoor(outdoorAirTemperature, + outdoorAirSpeed, + solarRadiation, + tSky, + Tarcog::ISO15099::SkyModel::AllSpecified); ASSERT_TRUE(Outdoor != nullptr); Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); @@ -37,8 +43,10 @@ class TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidati auto Indoor = Tarcog::ISO15099::Environments::indoor(indoorAirTemperature); - auto convective_heat_transfer_coefficient_indoor = 3.9; // + radiative_heat_transfer_coefficient (4.1 W/(m²K) from EN 410) = 8 W/(m²K) - Indoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH, convective_heat_transfer_coefficient_indoor); + auto convective_heat_transfer_coefficient_indoor = + 3.9; // + radiative_heat_transfer_coefficient (4.1 W/(m²K) from EN 410) = 8 W/(m²K) + Indoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH, + convective_heat_transfer_coefficient_indoor); ASSERT_TRUE(Indoor != nullptr); @@ -55,11 +63,11 @@ class TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidati auto emissivity1 = 0.84; auto transmittance1 = 0; auto solidLayer1 = Tarcog::ISO15099::Layers::solid(solidLayer1Thickness, - solidLayer1Conductance, - emissivity1, - transmittance1, - emissivity1, - transmittance1); + solidLayer1Conductance, + emissivity1, + transmittance1, + emissivity1, + transmittance1); solidLayer1->setSolarAbsorptance(0.2, solarRadiation); ASSERT_TRUE(solidLayer1 != nullptr); @@ -67,8 +75,8 @@ class TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidati auto gapLayer = Tarcog::ISO15099::Layers::gap(gapThickness); ASSERT_TRUE(gapLayer != nullptr); auto gapAirSpeed = 1; - auto forcedGapLayer = - Tarcog::ISO15099::Layers::forcedVentilationGap(gapLayer, gapAirSpeed, indoorAirTemperature); + auto forcedGapLayer = Tarcog::ISO15099::Layers::forcedVentilationGap( + gapLayer, gapAirSpeed, indoorAirTemperature); ASSERT_TRUE(forcedGapLayer != nullptr); const auto solidLayer2Thickness = 0.004; // [m] @@ -76,11 +84,11 @@ class TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidati auto emissivity2 = 0.84; auto transmittance2 = 0; auto solidLayer2 = Tarcog::ISO15099::Layers::solid(solidLayer2Thickness, - solidLayer2Conductance, - emissivity2, - transmittance2, - emissivity2, - transmittance2); + solidLayer2Conductance, + emissivity2, + transmittance2, + emissivity2, + transmittance2); solidLayer2->setSolarAbsorptance(0.2, solarRadiation); ASSERT_TRUE(solidLayer2 != nullptr); @@ -90,7 +98,7 @@ class TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidati ///////////////////////////////////////////////////////// /// System ///////////////////////////////////////////////////////// - + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); ASSERT_TRUE(m_TarcogSystem != nullptr); @@ -112,9 +120,16 @@ class TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidati { return m_TarcogSystem->getSolidLayers()[1].get(); }; + + [[nodiscard]] CIndoorEnvironment * GetIndoorRadiativeHeatTransferCoefficient() const + { + return Indoor->getHr(); + //->calculateHc() + }; }; -TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, GapLayerSurfaceIRFlow) +TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, + GapLayerSurfaceIRFlow) { SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); @@ -142,7 +157,8 @@ TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidat EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); } -TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, FirstLayerSurfaceTemperatures) +TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, + FirstLayerSurfaceTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); @@ -157,7 +173,8 @@ TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidat EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); } -TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, GapTemperatures) +TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, + GapTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); @@ -176,7 +193,8 @@ TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidat EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); } -TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, SecondLayerSurfaceTemperatures) +TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, + SecondLayerSurfaceTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); @@ -189,4 +207,16 @@ TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidat auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, + IndoorHeatTransferCoefficients) +{ + SCOPED_TRACE("Begin Test: Test The Indoor Heat Transfer Coefficients"); + + auto indoorRadiativeHeatTransferCoefficient = GetIndoorRadiativeHeatTransferCoefficient(); + + ASSERT_TRUE(indoorRadiativeHeatTransferCoefficient != nullptr); + + EXPECT_NEAR(0, indoorRadiativeHeatTransferCoefficient, 1e-4); } \ No newline at end of file From 49a8407d8d948fcbd6e6d7dcda800c2966ddb707 Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Tue, 14 Mar 2023 16:17:46 +0100 Subject: [PATCH 26/33] No error message anymore, but no results neither. --- ...cedVentilationInsideAirSummerValidation.unit.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp index dd4246b5..4c5eff8e 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp @@ -121,10 +121,15 @@ class TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidati return m_TarcogSystem->getSolidLayers()[1].get(); }; - [[nodiscard]] CIndoorEnvironment * GetIndoorRadiativeHeatTransferCoefficient() const + // [[nodiscard]] CIndoorEnvironment * GetIndoorRadiativeHeatTransferCoefficient() const + // { + // return Indoor->getHr(); + // //->calculateHc() + // }; + + [[nodiscard]] double GetIndoorRadiativeHeatTransferCoefficient() const { - return Indoor->getHr(); - //->calculateHc() + return m_TarcogSystem->CSingleSystem::getHc(Tarcog::ISO15099::Environment::Indoor); }; }; @@ -216,7 +221,7 @@ TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidat auto indoorRadiativeHeatTransferCoefficient = GetIndoorRadiativeHeatTransferCoefficient(); - ASSERT_TRUE(indoorRadiativeHeatTransferCoefficient != nullptr); + // ASSERT_TRUE(indoorRadiativeHeatTransferCoefficient != nullptr); EXPECT_NEAR(0, indoorRadiativeHeatTransferCoefficient, 1e-4); } \ No newline at end of file From c9a2ea42926253738bcf86b6004a173101df082c Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Wed, 15 Mar 2023 12:27:04 +0100 Subject: [PATCH 27/33] The heat transfer coefficients of the summer validation look fine --- ...tilationInsideAirSummerValidation.unit.cpp | 47 +++++++++++++++---- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp index 4c5eff8e..6d990d0b 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp @@ -121,16 +121,35 @@ class TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidati return m_TarcogSystem->getSolidLayers()[1].get(); }; - // [[nodiscard]] CIndoorEnvironment * GetIndoorRadiativeHeatTransferCoefficient() const - // { - // return Indoor->getHr(); - // //->calculateHc() - // }; + [[nodiscard]] double GetOutdoorConvectiveHeatTransferCoefficient() const + { + return m_TarcogSystem->CSingleSystem::getHc(Tarcog::ISO15099::Environment::Outdoor); + }; - [[nodiscard]] double GetIndoorRadiativeHeatTransferCoefficient() const + [[nodiscard]] double GetOutdoorRadiativeHeatTransferCoefficient() const + { + return m_TarcogSystem->CSingleSystem::getHr(Tarcog::ISO15099::Environment::Outdoor); + }; + + [[nodiscard]] double GetOutdoorHeatTransferCoefficient() const + { + return m_TarcogSystem->CSingleSystem::getH(Tarcog::ISO15099::Environment::Outdoor); + }; + + [[nodiscard]] double GetIndoorConvectiveHeatTransferCoefficient() const { return m_TarcogSystem->CSingleSystem::getHc(Tarcog::ISO15099::Environment::Indoor); }; + + [[nodiscard]] double GetIndoorRadiativeHeatTransferCoefficient() const + { + return m_TarcogSystem->CSingleSystem::getHr(Tarcog::ISO15099::Environment::Indoor); + }; + + [[nodiscard]] double GetIndoorHeatTransferCoefficient() const + { + return m_TarcogSystem->CSingleSystem::getH(Tarcog::ISO15099::Environment::Indoor); + }; }; TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, @@ -215,13 +234,21 @@ TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidat } TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, - IndoorHeatTransferCoefficients) + HeatTransferCoefficients) { - SCOPED_TRACE("Begin Test: Test The Indoor Heat Transfer Coefficients"); + SCOPED_TRACE("Begin Test: Test The Heat Transfer Coefficients"); + auto outdoorConvectiveHeatTransferCoefficient = GetOutdoorConvectiveHeatTransferCoefficient(); + auto outdoorRadiativeHeatTransferCoefficient = GetOutdoorRadiativeHeatTransferCoefficient(); + auto outdoorHeatTransferCoefficient = GetOutdoorHeatTransferCoefficient(); + auto indoorConvectiveHeatTransferCoefficient = GetIndoorConvectiveHeatTransferCoefficient(); auto indoorRadiativeHeatTransferCoefficient = GetIndoorRadiativeHeatTransferCoefficient(); + auto indoorHeatTransferCoefficient = GetIndoorHeatTransferCoefficient(); - // ASSERT_TRUE(indoorRadiativeHeatTransferCoefficient != nullptr); - + EXPECT_NEAR(0, outdoorConvectiveHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(0, outdoorRadiativeHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(0, outdoorHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(0, indoorConvectiveHeatTransferCoefficient, 1e-4); EXPECT_NEAR(0, indoorRadiativeHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(0, indoorHeatTransferCoefficient, 1e-4); } \ No newline at end of file From 83c4540683dc2991e50b939968345254b683fff3 Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Wed, 15 Mar 2023 12:51:20 +0100 Subject: [PATCH 28/33] Test the heat transfer coefficients of all three validation cases --- ...tilationInsideAirWinterValidation.unit.cpp | 105 ++++++++++++++---- ...anesNoVentilationWinterValidation.unit.cpp | 95 ++++++++++++---- ...tilationInsideAirSummerValidation.unit.cpp | 1 - 3 files changed, 157 insertions(+), 44 deletions(-) diff --git a/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp index a0fe2cb6..3f954ebd 100644 --- a/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp @@ -19,12 +19,16 @@ class TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation : p // Outdoor ///////////////////////////////////////////////////////// - auto outdoorAirTemperature = 273.15; // Kelvins - auto outdoorAirSpeed = 2.75; // meters per second - auto tSky = 273.15; // Kelvins + auto outdoorAirTemperature = 273.15; // Kelvins + auto outdoorAirSpeed = 2.75; // meters per second + auto tSky = 273.15; // Kelvins auto solarRadiation = 0.0; - auto Outdoor = Tarcog::ISO15099::Environments::outdoor( - outdoorAirTemperature, outdoorAirSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); + auto Outdoor = + Tarcog::ISO15099::Environments::outdoor(outdoorAirTemperature, + outdoorAirSpeed, + solarRadiation, + tSky, + Tarcog::ISO15099::SkyModel::AllSpecified); ASSERT_TRUE(Outdoor != nullptr); Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); @@ -34,8 +38,10 @@ class TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation : p auto indoorAirTemperature = 298.15; auto Indoor = Tarcog::ISO15099::Environments::indoor(indoorAirTemperature); - auto convective_heat_transfer_coefficient_indoor = 3.9; // + radiative_heat_transfer_coefficient (4.1 W/(m²K) from EN 410) = 8 W/(m²K) - Indoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH, convective_heat_transfer_coefficient_indoor); + auto convective_heat_transfer_coefficient_indoor = + 3.9; // + radiative_heat_transfer_coefficient (4.1 W/(m²K) from EN 410) = 8 W/(m²K) + Indoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH, + convective_heat_transfer_coefficient_indoor); ASSERT_TRUE(Indoor != nullptr); ///////////////////////////////////////////////////////// @@ -50,11 +56,11 @@ class TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation : p auto emissivity1 = 0.84; auto transmittance1 = 0; auto solidLayer1 = Tarcog::ISO15099::Layers::solid(solidLayer1Thickness, - solidLayer1Conductance, - emissivity1, - transmittance1, - emissivity1, - transmittance1); + solidLayer1Conductance, + emissivity1, + transmittance1, + emissivity1, + transmittance1); solidLayer1->setSolarAbsorptance(0.2, solarRadiation); ASSERT_TRUE(solidLayer1 != nullptr); @@ -62,8 +68,8 @@ class TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation : p auto gapLayer = Tarcog::ISO15099::Layers::gap(gapThickness); ASSERT_TRUE(gapLayer != nullptr); auto gapAirSpeed = 1; - auto forcedGapLayer = - Tarcog::ISO15099::Layers::forcedVentilationGap(gapLayer, gapAirSpeed, indoorAirTemperature); + auto forcedGapLayer = Tarcog::ISO15099::Layers::forcedVentilationGap( + gapLayer, gapAirSpeed, indoorAirTemperature); ASSERT_TRUE(forcedGapLayer != nullptr); const auto solidLayer2Thickness = 0.004; // [m] @@ -71,11 +77,11 @@ class TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation : p auto emissivity2 = 0.84; auto transmittance2 = 0; auto solidLayer2 = Tarcog::ISO15099::Layers::solid(solidLayer2Thickness, - solidLayer2Conductance, - emissivity2, - transmittance2, - emissivity2, - transmittance2); + solidLayer2Conductance, + emissivity2, + transmittance2, + emissivity2, + transmittance2); solidLayer2->setSolarAbsorptance(0.2, solarRadiation); ASSERT_TRUE(solidLayer2 != nullptr); @@ -85,7 +91,7 @@ class TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation : p ///////////////////////////////////////////////////////// /// System ///////////////////////////////////////////////////////// - + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); ASSERT_TRUE(m_TarcogSystem != nullptr); @@ -107,9 +113,40 @@ class TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation : p { return m_TarcogSystem->getSolidLayers()[1].get(); }; + + [[nodiscard]] double GetOutdoorConvectiveHeatTransferCoefficient() const + { + return m_TarcogSystem->CSingleSystem::getHc(Tarcog::ISO15099::Environment::Outdoor); + }; + + [[nodiscard]] double GetOutdoorRadiativeHeatTransferCoefficient() const + { + return m_TarcogSystem->CSingleSystem::getHr(Tarcog::ISO15099::Environment::Outdoor); + }; + + [[nodiscard]] double GetOutdoorHeatTransferCoefficient() const + { + return m_TarcogSystem->CSingleSystem::getH(Tarcog::ISO15099::Environment::Outdoor); + }; + + [[nodiscard]] double GetIndoorConvectiveHeatTransferCoefficient() const + { + return m_TarcogSystem->CSingleSystem::getHc(Tarcog::ISO15099::Environment::Indoor); + }; + + [[nodiscard]] double GetIndoorRadiativeHeatTransferCoefficient() const + { + return m_TarcogSystem->CSingleSystem::getHr(Tarcog::ISO15099::Environment::Indoor); + }; + + [[nodiscard]] double GetIndoorHeatTransferCoefficient() const + { + return m_TarcogSystem->CSingleSystem::getH(Tarcog::ISO15099::Environment::Indoor); + }; }; -TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, GapLayerSurfaceIRFlow) +TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, + GapLayerSurfaceIRFlow) { SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); @@ -137,7 +174,8 @@ TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, G EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); } -TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, FirstLayerSurfaceTemperatures) +TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, + FirstLayerSurfaceTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); @@ -171,7 +209,8 @@ TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, G EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); } -TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, SecondLayerSurfaceTemperatures) +TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, + SecondLayerSurfaceTemperatures) { SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); @@ -184,4 +223,24 @@ TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, S auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); +} + +TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, + HeatTransferCoefficients) +{ + SCOPED_TRACE("Begin Test: Test The Heat Transfer Coefficients"); + + auto outdoorConvectiveHeatTransferCoefficient = GetOutdoorConvectiveHeatTransferCoefficient(); + auto outdoorRadiativeHeatTransferCoefficient = GetOutdoorRadiativeHeatTransferCoefficient(); + auto outdoorHeatTransferCoefficient = GetOutdoorHeatTransferCoefficient(); + auto indoorConvectiveHeatTransferCoefficient = GetIndoorConvectiveHeatTransferCoefficient(); + auto indoorRadiativeHeatTransferCoefficient = GetIndoorRadiativeHeatTransferCoefficient(); + auto indoorHeatTransferCoefficient = GetIndoorHeatTransferCoefficient(); + + EXPECT_NEAR(0, outdoorConvectiveHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(0, outdoorRadiativeHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(0, outdoorHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(0, indoorConvectiveHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(0, indoorRadiativeHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(0, indoorHeatTransferCoefficient, 1e-4); } \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp index 0f42e4f3..b97dd785 100644 --- a/src/Tarcog/tst/units/GapBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp @@ -19,12 +19,16 @@ class TestGapBetweenDarkGlassPanesNoVentilationWinterValidation : public testing // Outdoor ///////////////////////////////////////////////////////// - auto outdoorAirTemperature = 273.15; // Kelvins - auto outdoorAirSpeed = 2.75; // meters per second - auto tSky = 273.15; // Kelvins + auto outdoorAirTemperature = 273.15; // Kelvins + auto outdoorAirSpeed = 2.75; // meters per second + auto tSky = 273.15; // Kelvins auto solarRadiation = 0.0; - auto Outdoor = Tarcog::ISO15099::Environments::outdoor( - outdoorAirTemperature, outdoorAirSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); + auto Outdoor = + Tarcog::ISO15099::Environments::outdoor(outdoorAirTemperature, + outdoorAirSpeed, + solarRadiation, + tSky, + Tarcog::ISO15099::SkyModel::AllSpecified); ASSERT_TRUE(Outdoor != nullptr); Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); @@ -34,8 +38,10 @@ class TestGapBetweenDarkGlassPanesNoVentilationWinterValidation : public testing auto indoorAirTemperature = 298.15; auto Indoor = Tarcog::ISO15099::Environments::indoor(indoorAirTemperature); - auto convective_heat_transfer_coefficient_indoor = 3.9; // + radiative_heat_transfer_coefficient (4.1 W/(m²K) from EN 410) = 8 W/(m²K) - Indoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH, convective_heat_transfer_coefficient_indoor); + auto convective_heat_transfer_coefficient_indoor = + 3.9; // + radiative_heat_transfer_coefficient (4.1 W/(m²K) from EN 410) = 8 W/(m²K) + Indoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH, + convective_heat_transfer_coefficient_indoor); ASSERT_TRUE(Indoor != nullptr); ///////////////////////////////////////////////////////// @@ -50,11 +56,11 @@ class TestGapBetweenDarkGlassPanesNoVentilationWinterValidation : public testing auto emissivity1 = 0.84; auto transmittance1 = 0; auto solidLayer1 = Tarcog::ISO15099::Layers::solid(solidLayer1Thickness, - solidLayer1Conductance, - emissivity1, - transmittance1, - emissivity1, - transmittance1); + solidLayer1Conductance, + emissivity1, + transmittance1, + emissivity1, + transmittance1); solidLayer1->setSolarAbsorptance(0.2, solarRadiation); ASSERT_TRUE(solidLayer1 != nullptr); @@ -62,8 +68,8 @@ class TestGapBetweenDarkGlassPanesNoVentilationWinterValidation : public testing auto gapLayer = Tarcog::ISO15099::Layers::gap(gapThickness); ASSERT_TRUE(gapLayer != nullptr); auto gapAirSpeed = 0; - auto forcedGapLayer = - Tarcog::ISO15099::Layers::forcedVentilationGap(gapLayer, gapAirSpeed, indoorAirTemperature); + auto forcedGapLayer = Tarcog::ISO15099::Layers::forcedVentilationGap( + gapLayer, gapAirSpeed, indoorAirTemperature); ASSERT_TRUE(forcedGapLayer != nullptr); const auto solidLayer2Thickness = 0.004; // [m] @@ -71,11 +77,11 @@ class TestGapBetweenDarkGlassPanesNoVentilationWinterValidation : public testing auto emissivity2 = 0.84; auto transmittance2 = 0; auto solidLayer2 = Tarcog::ISO15099::Layers::solid(solidLayer2Thickness, - solidLayer2Conductance, - emissivity2, - transmittance2, - emissivity2, - transmittance2); + solidLayer2Conductance, + emissivity2, + transmittance2, + emissivity2, + transmittance2); solidLayer2->setSolarAbsorptance(0.2, solarRadiation); ASSERT_TRUE(solidLayer2 != nullptr); @@ -85,7 +91,7 @@ class TestGapBetweenDarkGlassPanesNoVentilationWinterValidation : public testing ///////////////////////////////////////////////////////// /// System ///////////////////////////////////////////////////////// - + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); ASSERT_TRUE(m_TarcogSystem != nullptr); @@ -107,6 +113,36 @@ class TestGapBetweenDarkGlassPanesNoVentilationWinterValidation : public testing { return m_TarcogSystem->getSolidLayers()[1].get(); }; + + [[nodiscard]] double GetOutdoorConvectiveHeatTransferCoefficient() const + { + return m_TarcogSystem->CSingleSystem::getHc(Tarcog::ISO15099::Environment::Outdoor); + }; + + [[nodiscard]] double GetOutdoorRadiativeHeatTransferCoefficient() const + { + return m_TarcogSystem->CSingleSystem::getHr(Tarcog::ISO15099::Environment::Outdoor); + }; + + [[nodiscard]] double GetOutdoorHeatTransferCoefficient() const + { + return m_TarcogSystem->CSingleSystem::getH(Tarcog::ISO15099::Environment::Outdoor); + }; + + [[nodiscard]] double GetIndoorConvectiveHeatTransferCoefficient() const + { + return m_TarcogSystem->CSingleSystem::getHc(Tarcog::ISO15099::Environment::Indoor); + }; + + [[nodiscard]] double GetIndoorRadiativeHeatTransferCoefficient() const + { + return m_TarcogSystem->CSingleSystem::getHr(Tarcog::ISO15099::Environment::Indoor); + }; + + [[nodiscard]] double GetIndoorHeatTransferCoefficient() const + { + return m_TarcogSystem->CSingleSystem::getH(Tarcog::ISO15099::Environment::Indoor); + }; }; TEST_F(TestGapBetweenDarkGlassPanesNoVentilationWinterValidation, GapLayerSurfaceIRFlow) @@ -184,4 +220,23 @@ TEST_F(TestGapBetweenDarkGlassPanesNoVentilationWinterValidation, SecondLayerSur auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); +} + +TEST_F(TestGapBetweenDarkGlassPanesNoVentilationWinterValidation, HeatTransferCoefficients) +{ + SCOPED_TRACE("Begin Test: Test The Heat Transfer Coefficients"); + + auto outdoorConvectiveHeatTransferCoefficient = GetOutdoorConvectiveHeatTransferCoefficient(); + auto outdoorRadiativeHeatTransferCoefficient = GetOutdoorRadiativeHeatTransferCoefficient(); + auto outdoorHeatTransferCoefficient = GetOutdoorHeatTransferCoefficient(); + auto indoorConvectiveHeatTransferCoefficient = GetIndoorConvectiveHeatTransferCoefficient(); + auto indoorRadiativeHeatTransferCoefficient = GetIndoorRadiativeHeatTransferCoefficient(); + auto indoorHeatTransferCoefficient = GetIndoorHeatTransferCoefficient(); + + EXPECT_NEAR(0, outdoorConvectiveHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(0, outdoorRadiativeHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(0, outdoorHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(0, indoorConvectiveHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(0, indoorRadiativeHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(0, indoorHeatTransferCoefficient, 1e-4); } \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp index 6d990d0b..7bc2cadd 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp @@ -6,7 +6,6 @@ using Tarcog::ISO15099::CIGUSolidLayer; using Tarcog::ISO15099::CIGUGapLayer; using Tarcog::ISO15099::CSingleSystem; -using Tarcog::ISO15099::CIndoorEnvironment; class TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation : public testing::Test From 4f96c01d91611fbdb612cd3c01cb8265bf64d939 Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Wed, 15 Mar 2023 13:23:50 +0100 Subject: [PATCH 29/33] Describe when the is used --- ...assPanesForcedVentilationInsideAirWinterValidation.unit.cpp | 3 +++ ...BetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp | 3 +++ ...assPanesForcedVentilationInsideAirSummerValidation.unit.cpp | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp index 3f954ebd..04e6ca48 100644 --- a/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp @@ -40,6 +40,9 @@ class TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation : p auto Indoor = Tarcog::ISO15099::Environments::indoor(indoorAirTemperature); auto convective_heat_transfer_coefficient_indoor = 3.9; // + radiative_heat_transfer_coefficient (4.1 W/(m²K) from EN 410) = 8 W/(m²K) + // The convective_heat_transfer_coefficient_indoor is NOT USED if + // Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH. It is used in the + // cases `::HPrescribed` and `::HcPrescribed` Indoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH, convective_heat_transfer_coefficient_indoor); ASSERT_TRUE(Indoor != nullptr); diff --git a/src/Tarcog/tst/units/GapBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp index b97dd785..89d9a058 100644 --- a/src/Tarcog/tst/units/GapBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp @@ -40,6 +40,9 @@ class TestGapBetweenDarkGlassPanesNoVentilationWinterValidation : public testing auto Indoor = Tarcog::ISO15099::Environments::indoor(indoorAirTemperature); auto convective_heat_transfer_coefficient_indoor = 3.9; // + radiative_heat_transfer_coefficient (4.1 W/(m²K) from EN 410) = 8 W/(m²K) + // The convective_heat_transfer_coefficient_indoor is NOT USED if + // Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH. It is used in the + // cases `::HPrescribed` and `::HcPrescribed` Indoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH, convective_heat_transfer_coefficient_indoor); ASSERT_TRUE(Indoor != nullptr); diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp index 7bc2cadd..857fd58d 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp @@ -44,6 +44,9 @@ class TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidati auto convective_heat_transfer_coefficient_indoor = 3.9; // + radiative_heat_transfer_coefficient (4.1 W/(m²K) from EN 410) = 8 W/(m²K) + // The convective_heat_transfer_coefficient_indoor is NOT USED if + // Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH. It is used in the + // cases `::HPrescribed` and `::HcPrescribed` Indoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH, convective_heat_transfer_coefficient_indoor); From 43c36f4944303839aabab8a49f1566ce286d8d13 Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Tue, 21 Mar 2023 12:08:35 +0100 Subject: [PATCH 30/33] Add old test from Windows-CalcEngine --- .../GapLayerInBetweenVentilation.unit.cpp | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 src/Tarcog/tst/units/GapLayerInBetweenVentilation.unit.cpp diff --git a/src/Tarcog/tst/units/GapLayerInBetweenVentilation.unit.cpp b/src/Tarcog/tst/units/GapLayerInBetweenVentilation.unit.cpp new file mode 100644 index 00000000..1e25e5db --- /dev/null +++ b/src/Tarcog/tst/units/GapLayerInBetweenVentilation.unit.cpp @@ -0,0 +1,121 @@ +#include +#include + +#include "WCETarcog.hpp" + +class TestGapLayerInBetweenVentilation : public testing::Test +{ +private: + std::shared_ptr m_TarcogSystem; + +protected: + void SetUp() override + { + ///////////////////////////////////////////////////////// + // Outdoor + ///////////////////////////////////////////////////////// + auto airTemperature = 255.15; // Kelvins + auto airSpeed = 5.5; // meters per second + auto tSky = 255.15; // Kelvins + auto solarRadiation = 0.0; + + auto Outdoor = Tarcog::ISO15099::Environments::outdoor( + airTemperature, airSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); + ASSERT_TRUE(Outdoor != nullptr); + Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); + + ///////////////////////////////////////////////////////// + /// Indoor + ///////////////////////////////////////////////////////// + + auto roomTemperature = 295.15; + + auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); + ASSERT_TRUE(Indoor != nullptr); + + // IGU + auto solidLayerThickness = 0.005715; // [m] + auto solidLayerConductance = 1.0; + + auto layer1 = Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance); + ASSERT_TRUE(layer1 != nullptr); + + auto layer2 = Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance); + ASSERT_TRUE(layer2 != nullptr); + + auto shadeLayerThickness = 0.01; + auto shadeLayerConductance = 160.0; + auto Atop = 0.1; + auto Abot = 0.1; + auto Aleft = 0.1; + auto Aright = 0.1; + auto Afront = 0.2; + + EffectiveLayers::ShadeOpenness openness{Afront, Aleft, Aright, Atop, Abot}; + + double windowWidth = 1; + double windowHeight = 1; + + EffectiveLayers::EffectiveLayerOther effectiveLayer{ + windowWidth, windowHeight, shadeLayerThickness, openness}; + + EffectiveLayers::EffectiveOpenness effOpenness{effectiveLayer.getEffectiveOpenness()}; + + auto shadeLayer = Tarcog::ISO15099::Layers::shading( + shadeLayerThickness, shadeLayerConductance, effOpenness); + + ASSERT_TRUE(shadeLayer != nullptr); + + auto gapThickness = 0.0127; + auto gap1 = Tarcog::ISO15099::Layers::gap(gapThickness); + ASSERT_TRUE(gap1 != nullptr); + + auto gap2 = Tarcog::ISO15099::Layers::gap(gapThickness); + ASSERT_TRUE(gap2 != nullptr); + + Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); + aIGU.addLayers({layer1, gap1, shadeLayer, gap2, layer2}); + + // Alternative way of adding layers. + // aIGU.addLayer(layer1); + // aIGU.addLayer(gap1); + // aIGU.addLayer(shadeLayer); + // aIGU.addLayer(gap2); + // aIGU.addLayer(layer2); + + ///////////////////////////////////////////////////////// + /// System + ///////////////////////////////////////////////////////// + m_TarcogSystem = std::make_shared(aIGU, Indoor, Outdoor); + ASSERT_TRUE(m_TarcogSystem != nullptr); + } + +public: + std::shared_ptr GetGap1() const + { + return m_TarcogSystem->getGapLayers()[0]; + }; + + std::shared_ptr GetGap2() const + { + return m_TarcogSystem->getGapLayers()[1]; + }; +}; + +TEST_F(TestGapLayerInBetweenVentilation, VentilationFlow) +{ + SCOPED_TRACE("Begin Test: Test Ventilated Gap Layer - Intial Airflow"); + + auto aLayer = GetGap1(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto gainEnergy = aLayer->getGainFlow(); + EXPECT_NEAR(32.988234, gainEnergy, 1e-4); + + aLayer = GetGap2(); + ASSERT_TRUE(aLayer != nullptr); + gainEnergy = aLayer->getGainFlow(); + EXPECT_NEAR(-32.988234, gainEnergy, 1e-4); +} \ No newline at end of file From af0f0be70f64356a0bc49fe9fee96ca23aec02a0 Mon Sep 17 00:00:00 2001 From: christoph-maurer Date: Tue, 21 Mar 2023 12:10:13 +0100 Subject: [PATCH 31/33] Remove the tests which are replaced by the tests `GapBetween*` --- ...eenIndoorOutdoorAndVeryThickGlass.unit.cpp | 99 ------ ...rAtEdgeForcedVentilationInsideAir.unit.cpp | 175 ----------- ...AtEdgeForcedVentilationOutsideAir.unit.cpp | 175 ----------- ...ilationWithSolarRadiationInSummer.unit.cpp | 284 ------------------ ...ilationWithSolarRadiationInWinter.unit.cpp | 276 ----------------- ...ForcedVentilationWithZeroAirSpeed.unit.cpp | 177 ----------- .../units/GapLayerAtEdgeVentilation.unit.cpp | 168 ----------- ...apLayerInBetweenForcedVentilation.unit.cpp | 107 ------- ...BetweenThermallyDrivenVentilation.unit.cpp | 116 ------- 9 files changed, 1577 deletions(-) delete mode 100644 src/Tarcog/tst/units/GapBetweenIndoorOutdoorAndVeryThickGlass.unit.cpp delete mode 100644 src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilationInsideAir.unit.cpp delete mode 100644 src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilationOutsideAir.unit.cpp delete mode 100644 src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilationWithSolarRadiationInSummer.unit.cpp delete mode 100644 src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilationWithSolarRadiationInWinter.unit.cpp delete mode 100644 src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilationWithZeroAirSpeed.unit.cpp delete mode 100644 src/Tarcog/tst/units/GapLayerAtEdgeVentilation.unit.cpp delete mode 100644 src/Tarcog/tst/units/GapLayerInBetweenForcedVentilation.unit.cpp delete mode 100644 src/Tarcog/tst/units/GapLayerInBetweenThermallyDrivenVentilation.unit.cpp diff --git a/src/Tarcog/tst/units/GapBetweenIndoorOutdoorAndVeryThickGlass.unit.cpp b/src/Tarcog/tst/units/GapBetweenIndoorOutdoorAndVeryThickGlass.unit.cpp deleted file mode 100644 index 29a0a6e5..00000000 --- a/src/Tarcog/tst/units/GapBetweenIndoorOutdoorAndVeryThickGlass.unit.cpp +++ /dev/null @@ -1,99 +0,0 @@ -#include -#include - -#include "WCETarcog.hpp" - -using Tarcog::ISO15099::CIGUSolidLayer; -using Tarcog::ISO15099::CIGUGapLayer; -using Tarcog::ISO15099::CSingleSystem; - -class TestGapBetweenIndoorOutdoorAndVeryThickGlass : public testing::Test -{ -private: - std::unique_ptr m_TarcogSystem; - -protected: - void SetUp() override - { - ///////////////////////////////////////////////////////// - // This test is used to determine the external heat transfer coefficient between a very thick glass pane and exterior and the internal heat transfer coefficient between a very thick glass pane and the interior. - ///////////////////////////////////////////////////////// - - - ///////////////////////////////////////////////////////// - // Outdoor - ///////////////////////////////////////////////////////// - - auto outdoorAirTemperature = 273.15; // Kelvins - auto outdoorAirSpeed = 2.75; // meters per second - auto tSky = 273.15; // Kelvins - auto solarRadiation = 0.0; - auto Outdoor = Tarcog::ISO15099::Environments::outdoor( - outdoorAirTemperature, outdoorAirSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); - ASSERT_TRUE(Outdoor != nullptr); - Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); - - ///////////////////////////////////////////////////////// - /// Indoor - ///////////////////////////////////////////////////////// - - auto indoorAirTemperature = 298.15; - auto Indoor = Tarcog::ISO15099::Environments::indoor(indoorAirTemperature); - auto convective_heat_transfer_coefficient_indoor = 3.9; // + radiative_heat_transfer_coefficient (4.1 W/(m²K) from EN 410) = 8 W/(m²K) - Indoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH, convective_heat_transfer_coefficient_indoor); - ASSERT_TRUE(Indoor != nullptr); - - ///////////////////////////////////////////////////////// - /// IGU - ///////////////////////////////////////////////////////// - - auto windowWidth = 1.0; - auto windowHeight = 1.0; - - const auto solidLayer1Thickness = 1.0; // [m] - const auto solidLayer1Conductance = 1.0; - auto emissivity1 = 0.84; - auto transmittance1 = 0; - auto solidLayer1 = Tarcog::ISO15099::Layers::solid(solidLayer1Thickness, - solidLayer1Conductance, - emissivity1, - transmittance1, - emissivity1, - transmittance1); - solidLayer1->setSolarAbsorptance(0.2, solarRadiation); - ASSERT_TRUE(solidLayer1 != nullptr); - - Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); - aIGU.addLayers({solidLayer1}); - - ///////////////////////////////////////////////////////// - /// System - ///////////////////////////////////////////////////////// - - m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); - ASSERT_TRUE(m_TarcogSystem != nullptr); - - m_TarcogSystem->solve(); - } - -public: - [[nodiscard]] CIGUSolidLayer * GetFirstLayer() const - { - return m_TarcogSystem->getSolidLayers()[0].get(); - }; -}; - -TEST_F(TestGapBetweenIndoorOutdoorAndVeryThickGlass, FirstLayerSurfaceTemperatures) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); - - auto aLayer = GetFirstLayer(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); - auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); - EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); -} \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilationInsideAir.unit.cpp b/src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilationInsideAir.unit.cpp deleted file mode 100644 index e554404b..00000000 --- a/src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilationInsideAir.unit.cpp +++ /dev/null @@ -1,175 +0,0 @@ -#include -#include - -#include "WCETarcog.hpp" - -using Tarcog::ISO15099::CIGUSolidLayer; -using Tarcog::ISO15099::CIGUGapLayer; - -class TestGapLayerAtEdgeForcedVentilationInsideAir : public testing::Test -{ -private: - std::unique_ptr m_TarcogSystem; - -protected: - void SetUp() override - { - ///////////////////////////////////////////////////////// - // Outdoor - ///////////////////////////////////////////////////////// - auto outdoorTemperature = 255.15; // Kelvins - auto airSpeed = 5.5; // meters per second - auto tSky = 255.15; // Kelvins - auto solarRadiation = 0.0; - - auto Outdoor = - Tarcog::ISO15099::Environments::outdoor(outdoorTemperature, - airSpeed, - solarRadiation, - tSky, - Tarcog::ISO15099::SkyModel::AllSpecified); - ASSERT_TRUE(Outdoor != nullptr); - Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); - - ///////////////////////////////////////////////////////// - /// Indoor - ///////////////////////////////////////////////////////// - - auto roomTemperature = 295.15; - - auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); - ASSERT_TRUE(Indoor != nullptr); - - // IGU - const auto layer1Thickness = 0.005715; // [m] - const auto layer1Conductance = 1.0; - - auto solidLayer1 = - Tarcog::ISO15099::Layers::solid(layer1Thickness, layer1Conductance); - ASSERT_TRUE(solidLayer1 != nullptr); - - const auto layer2Thickness = 0.01; - const auto layer2Conductance = 160.0; - - auto shadeLayer = - Tarcog::ISO15099::Layers::solid(layer2Thickness, layer2Conductance); - ASSERT_TRUE(shadeLayer != nullptr); - - auto gapThickness = 0.0127; - auto GapLayer1 = Tarcog::ISO15099::Layers::gap(gapThickness); - ASSERT_TRUE(GapLayer1 != nullptr); - - // Now add forced ventilation to the gap - auto gapAirSpeed = 0.5; - auto gap = Tarcog::ISO15099::Layers::forcedVentilationGap( - GapLayer1, gapAirSpeed, roomTemperature); - ASSERT_TRUE(gap != nullptr); - - double windowWidth = 1; - double windowHeight = 1; - - Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); - aIGU.addLayers({solidLayer1, gap, shadeLayer}); - - ///////////////////////////////////////////////////////// - /// System - ///////////////////////////////////////////////////////// - m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); - ASSERT_TRUE(m_TarcogSystem != nullptr); - - m_TarcogSystem->solve(); - } - -public: - [[nodiscard]] CIGUSolidLayer * GetFirstLayer() const - { - return m_TarcogSystem->getSolidLayers()[0].get(); - }; - - [[nodiscard]] CIGUGapLayer * GetGap() const - { - return m_TarcogSystem->getGapLayers()[0].get(); - }; - - [[nodiscard]] CIGUSolidLayer * GetSecondLayer() const - { - return m_TarcogSystem->getSolidLayers()[1].get(); - }; -}; - -TEST_F(TestGapLayerAtEdgeForcedVentilationInsideAir, GapLayerSurfaceIRFlow) -{ - SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); - - auto aLayer = GetGap(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); - auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); - EXPECT_NEAR(286.605527, frontIRRadiationFlow, 1e-4); - EXPECT_NEAR(359.726794, backIRRadiationFlow, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationInsideAir, GainEnergy) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gain Energy"); - - auto aLayer = GetGap(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(131.545905, gainEnergy, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationInsideAir, FirstLayerSurfaceTemperatures) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); - - auto aLayer = GetFirstLayer(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); - auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(262.168262, frontTemperature, 1e-4); - EXPECT_NEAR(263.343360, backTemperature, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationInsideAir, GapTemperatures) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); - - auto aLayer = GetGap(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); - auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - auto layerTemperature = aLayer->layerTemperature(); - auto averageTemperature = aLayer->averageTemperature(); - EXPECT_NEAR(263.343360, frontTemperature, 1e-4); - EXPECT_NEAR(284.923046, backTemperature, 1e-4); - EXPECT_NEAR(284.769550, layerTemperature, 1e-4); - EXPECT_NEAR(274.133203, averageTemperature, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationInsideAir, SecondLayerSurfaceTemperatures) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); - - auto aLayer = GetSecondLayer(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); - auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(284.923046, frontTemperature, 1e-4); - EXPECT_NEAR(284.927676, backTemperature, 1e-4); -} \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilationOutsideAir.unit.cpp b/src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilationOutsideAir.unit.cpp deleted file mode 100644 index de35ef5a..00000000 --- a/src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilationOutsideAir.unit.cpp +++ /dev/null @@ -1,175 +0,0 @@ -#include -#include - -#include "WCETarcog.hpp" - -using Tarcog::ISO15099::CIGUSolidLayer; -using Tarcog::ISO15099::CIGUGapLayer; - -class TestGapLayerAtEdgeForcedVentilationOutsideAir : public testing::Test -{ -private: - std::unique_ptr m_TarcogSystem; - -protected: - void SetUp() override - { - ///////////////////////////////////////////////////////// - // Outdoor - ///////////////////////////////////////////////////////// - auto outdoorTemperature = 255.15; // Kelvins - auto airSpeed = 5.5; // meters per second - auto tSky = 255.15; // Kelvins - auto solarRadiation = 0.0; - - auto Outdoor = - Tarcog::ISO15099::Environments::outdoor(outdoorTemperature, - airSpeed, - solarRadiation, - tSky, - Tarcog::ISO15099::SkyModel::AllSpecified); - ASSERT_TRUE(Outdoor != nullptr); - Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); - - ///////////////////////////////////////////////////////// - /// Indoor - ///////////////////////////////////////////////////////// - - auto roomTemperature = 295.15; - - auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); - ASSERT_TRUE(Indoor != nullptr); - - // IGU - const auto layer1Thickness = 0.005715; // [m] - const auto layer1Conductance = 1.0; - - auto solidLayer1 = - Tarcog::ISO15099::Layers::solid(layer1Thickness, layer1Conductance); - ASSERT_TRUE(solidLayer1 != nullptr); - - const auto layer2Thickness = 0.01; - const auto layer2Conductance = 160.0; - - auto shadeLayer = - Tarcog::ISO15099::Layers::solid(layer2Thickness, layer2Conductance); - ASSERT_TRUE(shadeLayer != nullptr); - - auto gapThickness = 0.0127; - auto GapLayer1 = Tarcog::ISO15099::Layers::gap(gapThickness); - ASSERT_TRUE(GapLayer1 != nullptr); - - // Now add forced ventilation to the gap - auto gapAirSpeed = 0.5; - auto gap = Tarcog::ISO15099::Layers::forcedVentilationGap( - GapLayer1, gapAirSpeed, outdoorTemperature); - ASSERT_TRUE(gap != nullptr); - - double windowWidth = 1; - double windowHeight = 1; - - Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); - aIGU.addLayers({solidLayer1, gap, shadeLayer}); - - ///////////////////////////////////////////////////////// - /// System - ///////////////////////////////////////////////////////// - m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); - ASSERT_TRUE(m_TarcogSystem != nullptr); - - m_TarcogSystem->solve(); - } - -public: - [[nodiscard]] CIGUSolidLayer * GetFirstLayer() const - { - return m_TarcogSystem->getSolidLayers()[0].get(); - }; - - [[nodiscard]] CIGUGapLayer * GetGap() const - { - return m_TarcogSystem->getGapLayers()[0].get(); - }; - - [[nodiscard]] CIGUSolidLayer * GetSecondLayer() const - { - return m_TarcogSystem->getSolidLayers()[1].get(); - }; -}; - -TEST_F(TestGapLayerAtEdgeForcedVentilationOutsideAir, GapLayerSurfaceIRFlow) -{ - SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); - - auto aLayer = GetGap(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); - auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); - EXPECT_NEAR(261.579394, frontIRRadiationFlow, 1e-4); - EXPECT_NEAR(316.739416, backIRRadiationFlow, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationOutsideAir, GainEnergy) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gain Energy"); - - auto aLayer = GetGap(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(-75.720712, gainEnergy, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationOutsideAir, FirstLayerSurfaceTemperatures) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); - - auto aLayer = GetFirstLayer(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); - auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(257.561838, frontTemperature, 1e-4); - EXPECT_NEAR(257.964452, backTemperature, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationOutsideAir, GapTemperatures) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); - - auto aLayer = GetGap(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); - auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - auto layerTemperature = aLayer->layerTemperature(); - auto averageTemperature = aLayer->averageTemperature(); - EXPECT_NEAR(257.964452, frontTemperature, 1e-4); - EXPECT_NEAR(275.631339, backTemperature, 1e-4); - EXPECT_NEAR(260.505441, layerTemperature, 1e-4); - EXPECT_NEAR(266.797896, averageTemperature, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationOutsideAir, SecondLayerSurfaceTemperatures) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); - - auto aLayer = GetSecondLayer(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); - auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(275.631339, frontTemperature, 1e-4); - EXPECT_NEAR(275.640475, backTemperature, 1e-4); -} \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilationWithSolarRadiationInSummer.unit.cpp b/src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilationWithSolarRadiationInSummer.unit.cpp deleted file mode 100644 index 1f78c356..00000000 --- a/src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilationWithSolarRadiationInSummer.unit.cpp +++ /dev/null @@ -1,284 +0,0 @@ -#include -#include - -#include "WCETarcog.hpp" - -using Tarcog::ISO15099::CIGUSolidLayer; -using Tarcog::ISO15099::CIGUGapLayer; -using Tarcog::ISO15099::CSingleSystem; - -class TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInSummer : public testing::Test -{ -private: - std::unique_ptr m_TarcogSystem; - -protected: - void SetUp() override - { - ///////////////////////////////////////////////////////// - // Outdoor - ///////////////////////////////////////////////////////// - auto airTemperature = 305.15; // Kelvins - auto airSpeed = 5.5; // meters per second - auto tSky = 255.15; // Kelvins - auto solarRadiation = 783.0; - - auto Outdoor = Tarcog::ISO15099::Environments::outdoor( - airTemperature, airSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); - ASSERT_TRUE(Outdoor != nullptr); - Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); - - ///////////////////////////////////////////////////////// - /// Indoor - ///////////////////////////////////////////////////////// - - auto roomTemperature = 297.15; - - auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); - ASSERT_TRUE(Indoor != nullptr); - - // IGU - auto solidLayer1Thickness = 0.005715; // [m] - auto solidLayer1Conductance = 1.0; - auto solidLayer1SolarAbsorptance = 0.094189159572; - auto solidLayer1FrontEmissivity = 0.84; - auto solidLayer1FrontIRTransmittance = 0.0; - auto solidLayer1BackEmissivity = 0.84; - auto solidLayer1BackIRTransmittance = 0.0; - - auto solidLayer = Tarcog::ISO15099::Layers::solid(solidLayer1Thickness, - solidLayer1Conductance, - solidLayer1FrontEmissivity, - solidLayer1FrontIRTransmittance, - solidLayer1BackEmissivity, - solidLayer1BackIRTransmittance); - solidLayer->setSolarAbsorptance(solidLayer1SolarAbsorptance, solarRadiation); - ASSERT_TRUE(solidLayer != nullptr); - - const auto solidLayer2Thickness = 0.01; - const auto solidLayer2Conductance = 160.0; - const auto solidLayer2FrontEmissivity = 0.84; - const auto solidLayer2FrontTransmittance = 0.0; - const auto solidLayer2BackEmissivity = 0.84; - const auto solidLayer2BackTransmittance = 0.0; - const auto solidLayer2SolarAbsorptance = 0.687443971634; - - auto shadeLayer = Tarcog::ISO15099::Layers::solid(solidLayer2Thickness, - solidLayer2Conductance, - solidLayer2FrontEmissivity, - solidLayer2FrontTransmittance, - solidLayer2BackEmissivity, - solidLayer2BackTransmittance); - shadeLayer->setSolarAbsorptance(solidLayer2SolarAbsorptance, solarRadiation); - - ASSERT_TRUE(shadeLayer != nullptr); - - const auto gapThickness = 0.0127; - auto gapLayer = Tarcog::ISO15099::Layers::gap(gapThickness); - ASSERT_TRUE(gapLayer != nullptr); - - auto gapAirSpeed = 0.5; - auto gap = - Tarcog::ISO15099::Layers::forcedVentilationGap(gapLayer, gapAirSpeed, roomTemperature); - ASSERT_TRUE(gap != nullptr); - - const auto windowWidth{1.0}; - const auto windowHeight{1.0}; - - Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); - aIGU.addLayers({solidLayer, gap, shadeLayer}); - - ///////////////////////////////////////////////////////// - /// System - ///////////////////////////////////////////////////////// - m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); - ASSERT_TRUE(m_TarcogSystem != nullptr); - - m_TarcogSystem->solve(); - } - -public: - [[nodiscard]] CSingleSystem * GetSystem() const - { - return m_TarcogSystem.get(); - }; - - [[nodiscard]] CIGUSolidLayer * GetFirstLayer() const - { - return m_TarcogSystem->getSolidLayers()[0].get(); - }; - - [[nodiscard]] CIGUGapLayer * GetGap() const - { - return m_TarcogSystem->getGapLayers()[0].get(); - }; - - [[nodiscard]] CIGUSolidLayer * GetSecondLayer() const - { - return m_TarcogSystem->getSolidLayers()[1].get(); - }; -}; - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInSummer, GainEnergy) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge With Solar Radiation In " - "Summer - Gain Energy"); - - auto aLayer = GetGap(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(-130.503973, gainEnergy, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInSummer, SolidTemperatures) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge With Solar Radiation In " - "Summer - Solid Temperatures"); - - auto aLayer = GetFirstLayer(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); - auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(307.649406, frontTemperature, 1e-4); - EXPECT_NEAR(308.491542, backTemperature, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInSummer, SolidRadiosities) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge With Solar Radiation In " - "Summer - Solid Radiosities"); - - auto aLayer = GetFirstLayer(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontRadiosity = aLayer->J(FenestrationCommon::Side::Front); - auto backRadiosity = aLayer->J(FenestrationCommon::Side::Back); - EXPECT_NEAR(485.193494, frontRadiosity, 1e-4); - EXPECT_NEAR(534.495170, backRadiosity, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInSummer, GapTemperatures) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge With Solar Radiation In " - "Summer - Gap Temperatures"); - - auto aLayer = GetGap(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); - auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - auto layerTemperature = aLayer->layerTemperature(); - auto averageTemperature = aLayer->averageTemperature(); - EXPECT_NEAR(308.491542, frontTemperature, 1e-4); - EXPECT_NEAR(329.185903, backTemperature, 1e-4); - EXPECT_NEAR(308.524319, layerTemperature, 1e-4); - EXPECT_NEAR(318.838697, averageTemperature, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInSummer, GapRadiosities) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge With Solar Radiation In " - "Summer - Gap Radiosities"); - - auto aLayer = GetGap(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontRadiosity = aLayer->J(FenestrationCommon::Side::Front); - auto backRadiosity = aLayer->J(FenestrationCommon::Side::Back); - EXPECT_NEAR(534.495170, frontRadiosity, 1e-4); - EXPECT_NEAR(644.767023, backRadiosity, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInSummer, ShadeTemperatures) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge With Solar Radiation In " - "Summer - Shade Temperatures"); - - auto aLayer = GetSecondLayer(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); - auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(329.185903, frontTemperature, 1e-4); - EXPECT_NEAR(329.184144, backTemperature, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInSummer, ShadeRadiosities) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge With Solar Radiation In " - "Summer - Shade Radiosities"); - - auto aLayer = GetSecondLayer(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontRadiosity = aLayer->J(FenestrationCommon::Side::Front); - auto backRadiosity = aLayer->J(FenestrationCommon::Side::Back); - EXPECT_NEAR(644.767023, frontRadiosity, 1e-4); - EXPECT_NEAR(629.962476, backRadiosity, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInSummer, IndoorHeatFlow) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge With Solar Radiation In " - "Summer - Indoor Heat Flow"); - - auto aSystem = GetSystem(); - - auto convectiveHF = aSystem->getConvectiveHeatFlow(Tarcog::ISO15099::Environment::Indoor); - auto radiativeHF = aSystem->getRadiationHeatFlow(Tarcog::ISO15099::Environment::Indoor); - auto totalHF = aSystem->getHeatFlow(Tarcog::ISO15099::Environment::Indoor); - - EXPECT_NEAR(-109.364638, convectiveHF, 1e-5); - EXPECT_NEAR(-187.921002, radiativeHF, 1e-5); - EXPECT_NEAR(-297.285640, totalHF, 1e-5); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInSummer, IndoorValues) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge With Solar Radiation In " - "Summer - Indoor Values"); - - auto aSystem = GetSystem(); - - auto hInput = aSystem->getHInput(Tarcog::ISO15099::Environment::Indoor); - auto hCoefficientModel = aSystem->getHCoefficientModel(Tarcog::ISO15099::Environment::Indoor); - auto iRCalculatedOutside = - aSystem->getIRCalculatedOutside(Tarcog::ISO15099::Environment::Indoor); - - EXPECT_NEAR(0, hInput, 1e-5); - EXPECT_EQ(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH, hCoefficientModel); - EXPECT_NEAR(0, iRCalculatedOutside, 1e-5); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInSummer, OutdoorValues) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge With Solar Radiation In " - "Summer - Outdoor Values"); - - auto aSystem = GetSystem(); - - auto hInput = aSystem->getHInput(Tarcog::ISO15099::Environment::Outdoor); - auto hCoefficientModel = aSystem->getHCoefficientModel(Tarcog::ISO15099::Environment::Outdoor); - auto iRCalculatedOutside = - aSystem->getIRCalculatedOutside(Tarcog::ISO15099::Environment::Outdoor); - - EXPECT_NEAR(0, hInput, 1e-5); - EXPECT_EQ(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH, hCoefficientModel); - EXPECT_NEAR(0, iRCalculatedOutside, 1e-5); -} \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilationWithSolarRadiationInWinter.unit.cpp b/src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilationWithSolarRadiationInWinter.unit.cpp deleted file mode 100644 index 469897c7..00000000 --- a/src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilationWithSolarRadiationInWinter.unit.cpp +++ /dev/null @@ -1,276 +0,0 @@ -#include -#include - -#include "WCETarcog.hpp" - -using Tarcog::ISO15099::CIGUSolidLayer; -using Tarcog::ISO15099::CIGUGapLayer; -using Tarcog::ISO15099::CSingleSystem; - -class TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInWinter : public testing::Test -{ -private: - std::unique_ptr m_TarcogSystem; - -protected: - void SetUp() override - { - ///////////////////////////////////////////////////////// - // Outdoor - ///////////////////////////////////////////////////////// - auto airTemperature = 255.15; // Kelvins - auto airSpeed = 5.5; // meters per second - auto tSky = 255.15; // Kelvins - auto solarRadiation = 700.0; - - auto Outdoor = Tarcog::ISO15099::Environments::outdoor( - airTemperature, airSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); - ASSERT_TRUE(Outdoor != nullptr); - Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); - - ///////////////////////////////////////////////////////// - /// Indoor - ///////////////////////////////////////////////////////// - - auto roomTemperature = 297.15; - - auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); - ASSERT_TRUE(Indoor != nullptr); - - // IGU - auto solidLayer1Thickness = 0.005715; // [m] - auto solidLayer1Conductance = 1.0; - auto solidLayer1SolarAbsorptance = 0.094189159572; - auto solidLayer1FrontEmissivity = 0.84; - auto solidLayer1FrontIRTransmittance = 0.0; - auto solidLayer1BackEmissivity = 0.84; - auto solidLayer1BackIRTransmittance = 0.0; - - auto solidLayer = Tarcog::ISO15099::Layers::solid(solidLayer1Thickness, - solidLayer1Conductance, - solidLayer1FrontEmissivity, - solidLayer1FrontIRTransmittance, - solidLayer1BackEmissivity, - solidLayer1BackIRTransmittance); - solidLayer->setSolarAbsorptance(solidLayer1SolarAbsorptance, solarRadiation); - ASSERT_TRUE(solidLayer != nullptr); - - const auto solidLayer2Thickness = 0.01; - const auto solidLayer2Conductance = 160.0; - const auto solidLayer2FrontEmissivity = 0.84; - const auto solidLayer2FrontTransmittance = 0.0; - const auto solidLayer2BackEmissivity = 0.84; - const auto solidLayer2BackTransmittance = 0.0; - const auto solidLayer2SolarAbsorptance = 0.687443971634; - - auto shadeLayer = Tarcog::ISO15099::Layers::solid(solidLayer2Thickness, - solidLayer2Conductance, - solidLayer2FrontEmissivity, - solidLayer2FrontTransmittance, - solidLayer2BackEmissivity, - solidLayer2BackTransmittance); - shadeLayer->setSolarAbsorptance(solidLayer2SolarAbsorptance, solarRadiation); - - ASSERT_TRUE(shadeLayer != nullptr); - - const auto gapThickness = 0.0127; - auto gapLayer = Tarcog::ISO15099::Layers::gap(gapThickness); - ASSERT_TRUE(gapLayer != nullptr); - - auto gapAirSpeed = 0.5; - auto gap = - Tarcog::ISO15099::Layers::forcedVentilationGap(gapLayer, gapAirSpeed, roomTemperature); - ASSERT_TRUE(gap != nullptr); - - const auto windowWidth{1.0}; - const auto windowHeight{1.0}; - - Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); - aIGU.addLayers({solidLayer, gap, shadeLayer}); - - ///////////////////////////////////////////////////////// - /// System - ///////////////////////////////////////////////////////// - m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); - ASSERT_TRUE(m_TarcogSystem != nullptr); - - m_TarcogSystem->solve(); - } - -public: - [[nodiscard]] CSingleSystem * GetSystem() const - { - return m_TarcogSystem.get(); - }; - - [[nodiscard]] CIGUSolidLayer * GetSolidLayer1() const - { - return m_TarcogSystem->getSolidLayers()[0].get(); - }; - - [[nodiscard]] CIGUGapLayer * GetGap() const - { - return m_TarcogSystem->getGapLayers()[0].get(); - }; - - [[nodiscard]] CIGUSolidLayer * GetSolidLayer2() const - { - return m_TarcogSystem->getSolidLayers()[1].get(); - }; -}; - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInWinter, GainEnergy) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge With Solar Radiation In Winter - Gain Energy"); - - auto aLayer = GetGap(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(23.541540, gainEnergy, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInWinter, SolidLayer1Temperatures) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge With Solar Radiation In Winter - Solid Layer 1 Temperatures"); - - auto aLayer = GetSolidLayer1(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); - auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(269.257146, frontTemperature, 1e-4); - EXPECT_NEAR(271.441992, backTemperature, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInWinter, SolidLayer1Radiosities) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge With Solar Radiation In Winter - Solid Layer 1 Radiosities"); - - auto aLayer = GetSolidLayer1(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontRadiosity = aLayer->J(FenestrationCommon::Side::Front); - auto backRadiosity = aLayer->J(FenestrationCommon::Side::Back); - EXPECT_NEAR(288.774350, frontRadiosity, 1e-4); - EXPECT_NEAR(342.842260, backRadiosity, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInWinter, GapTemperatures) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge With Solar Radiation In Winter - Gap Temperatures"); - - auto aLayer = GetGap(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); - auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - auto layerTemperature = aLayer->layerTemperature(); - auto averageTemperature = aLayer->averageTemperature(); - EXPECT_NEAR(271.441992, frontTemperature, 1e-4); - EXPECT_NEAR(315.512561, backTemperature, 1e-4); - EXPECT_NEAR(295.166009, layerTemperature, 1e-4); - EXPECT_NEAR(293.477276, averageTemperature, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInWinter, GapRadiosities) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge With Solar Radiation In Winter - Gap Radiosities"); - - auto aLayer = GetGap(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontRadiosity = aLayer->J(FenestrationCommon::Side::Front); - auto backRadiosity = aLayer->J(FenestrationCommon::Side::Back); - EXPECT_NEAR(342.842260, frontRadiosity, 1e-4); - EXPECT_NEAR(526.815620, backRadiosity, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInWinter, SolidLayer2Temperatures) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge With Solar Radiation In Winter - Solid layer 2 Temperatures"); - - auto aLayer = GetSolidLayer2(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); - auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(315.512561, frontTemperature, 1e-4); - EXPECT_NEAR(315.517885, backTemperature, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInWinter, SolidLayer2Radiosities) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge With Solar Radiation In Winter - Solid Layer 2 Radiosities"); - - auto aLayer = GetSolidLayer2(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontRadiosity = aLayer->J(FenestrationCommon::Side::Front); - auto backRadiosity = aLayer->J(FenestrationCommon::Side::Back); - EXPECT_NEAR(526.815620, frontRadiosity, 1e-4); - EXPECT_NEAR(542.719352, backRadiosity, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInWinter, IndoorHeatFlow) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge With Solar Radiation In Winter - Indoor Heat Flow"); - - auto aSystem = GetSystem(); - - auto convectiveHF = aSystem->getConvectiveHeatFlow(Tarcog::ISO15099::Environment::Indoor); - auto radiativeHF = aSystem->getRadiationHeatFlow(Tarcog::ISO15099::Environment::Indoor); - auto totalHF = aSystem->getHeatFlow(Tarcog::ISO15099::Environment::Indoor); - - EXPECT_NEAR(-54.740403, convectiveHF, 1e-5); - EXPECT_NEAR(-100.677878, radiativeHF, 1e-5); - EXPECT_NEAR(-155.418281, totalHF, 1e-5); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInWinter, IndoorValues) -{ - SCOPED_TRACE( - "Begin Test: Test Forced Ventilated Gap Layer At Edge With Solar Radiation In Winter - Indoor Values"); - - auto aSystem = GetSystem(); - - auto hInput = aSystem->getHInput(Tarcog::ISO15099::Environment::Indoor); - auto hCoefficientModel = aSystem->getHCoefficientModel(Tarcog::ISO15099::Environment::Indoor); - auto iRCalculatedOutside = - aSystem->getIRCalculatedOutside(Tarcog::ISO15099::Environment::Indoor); - - EXPECT_NEAR(0, hInput, 1e-5); - EXPECT_EQ(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH, hCoefficientModel); - EXPECT_NEAR(0, iRCalculatedOutside, 1e-5); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiationInWinter, OutdoorValues) -{ - SCOPED_TRACE( - "Begin Test: Test Forced Ventilated Gap Layer At Edge With Solar Radiation In Winter - Outdoor Values"); - - auto aSystem = GetSystem(); - - auto hInput = aSystem->getHInput(Tarcog::ISO15099::Environment::Outdoor); - auto hCoefficientModel = aSystem->getHCoefficientModel(Tarcog::ISO15099::Environment::Outdoor); - auto iRCalculatedOutside = - aSystem->getIRCalculatedOutside(Tarcog::ISO15099::Environment::Outdoor); - - EXPECT_NEAR(0, hInput, 1e-5); - EXPECT_EQ(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH, hCoefficientModel); - EXPECT_NEAR(0, iRCalculatedOutside, 1e-5); -} \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilationWithZeroAirSpeed.unit.cpp b/src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilationWithZeroAirSpeed.unit.cpp deleted file mode 100644 index 4f5623ed..00000000 --- a/src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilationWithZeroAirSpeed.unit.cpp +++ /dev/null @@ -1,177 +0,0 @@ -#include -#include - -#include "WCETarcog.hpp" - -using Tarcog::ISO15099::CIGUSolidLayer; -using Tarcog::ISO15099::CIGUGapLayer; -using Tarcog::ISO15099::CSingleSystem; - -class TestGapLayerAtEdgeForcedVentilationWithZeroAirSpeed : public testing::Test -{ -private: - std::unique_ptr m_TarcogSystem; - -protected: - void SetUp() override - { - ///////////////////////////////////////////////////////// - // Outdoor - ///////////////////////////////////////////////////////// - auto airTemperature = 255.15; // Kelvins - auto airSpeed = 5.5; // meters per second - auto tSky = 255.15; // Kelvins - auto solarRadiation = 0.0; - - auto Outdoor = Tarcog::ISO15099::Environments::outdoor( - airTemperature, airSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); - ASSERT_TRUE(Outdoor != nullptr); - Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); - - ///////////////////////////////////////////////////////// - /// Indoor - ///////////////////////////////////////////////////////// - - auto roomTemperature = 297.15; - - auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); - ASSERT_TRUE(Indoor != nullptr); - - // IGU - auto solidLayer1Thickness = 0.005715; // [m] - auto solidLayer1Conductance = 1.0; - auto solidLayer1SolarAbsorptance = 0.094189159572; - auto solidLayer1FrontEmissivity = 0.84; - auto solidLayer1FrontIRTransmittance = 0.0; - auto solidLayer1BackEmissivity = 0.84; - auto solidLayer1BackIRTransmittance = 0.0; - - auto solidLayer = Tarcog::ISO15099::Layers::solid(solidLayer1Thickness, - solidLayer1Conductance, - solidLayer1FrontEmissivity, - solidLayer1FrontIRTransmittance, - solidLayer1BackEmissivity, - solidLayer1BackIRTransmittance); - solidLayer->setSolarAbsorptance(solidLayer1SolarAbsorptance, solarRadiation); - ASSERT_TRUE(solidLayer != nullptr); - - const auto solidLayer2Thickness = 0.01; - const auto solidLayer2Conductance = 160.0; - const auto solidLayer2FrontEmissivity = 0.84; - const auto solidLayer2FrontTransmittance = 0.0; - const auto solidLayer2BackEmissivity = 0.84; - const auto solidLayer2BackTransmittance = 0.0; - const auto solidLayer2SolarAbsorptance = 0.687443971634; - - auto shadeLayer = Tarcog::ISO15099::Layers::solid(solidLayer2Thickness, - solidLayer2Conductance, - solidLayer2FrontEmissivity, - solidLayer2FrontTransmittance, - solidLayer2BackEmissivity, - solidLayer2BackTransmittance); - shadeLayer->setSolarAbsorptance(solidLayer2SolarAbsorptance, solarRadiation); - - ASSERT_TRUE(shadeLayer != nullptr); - - const auto gapThickness = 0.0127; - auto gapLayer = Tarcog::ISO15099::Layers::gap(gapThickness); - ASSERT_TRUE(gapLayer != nullptr); - - auto gapAirSpeed = 0.0; - auto gap = - Tarcog::ISO15099::Layers::forcedVentilationGap(gapLayer, gapAirSpeed, roomTemperature); - ASSERT_TRUE(gap != nullptr); - - const auto windowWidth{1.0}; - const auto windowHeight{1.0}; - - Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); - aIGU.addLayers({solidLayer, gap, shadeLayer}); - - ///////////////////////////////////////////////////////// - /// System - ///////////////////////////////////////////////////////// - m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); - ASSERT_TRUE(m_TarcogSystem != nullptr); - - m_TarcogSystem->solve(); - } - -public: - [[nodiscard]] CIGUSolidLayer * GetSolidLayer1() const - { - return m_TarcogSystem->getSolidLayers()[0].get(); - }; - - [[nodiscard]] CIGUGapLayer * GetGap() const - { - return m_TarcogSystem->getGapLayers()[0].get(); - }; - - [[nodiscard]] CIGUSolidLayer * GetSolidLayer2() const - { - return m_TarcogSystem->getSolidLayers()[1].get(); - }; -}; - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithZeroAirSpeed, GainEnergy) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer With Zero Air Speed - Gain Energy"); - - auto aLayer = GetGap(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(0.0, gainEnergy, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithZeroAirSpeed, SolidLayer1Temperatures) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer With Zero Air Speed - Solid layer 1 Temperatures"); - - auto aLayer = GetSolidLayer1(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); - auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(259.139571, frontTemperature, 1e-4); - EXPECT_NEAR(259.806240, backTemperature, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithZeroAirSpeed, GapTemperatures) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer With Zero Air Speed - Gap Temperatures"); - - auto aLayer = GetGap(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); - auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - auto layerTemperature = aLayer->layerTemperature(); - auto averageTemperature = aLayer->averageTemperature(); - EXPECT_NEAR(259.806240, frontTemperature, 1e-4); - EXPECT_NEAR(281.591652, backTemperature, 1e-4); - EXPECT_NEAR(270.698946, layerTemperature, 1e-4); - EXPECT_NEAR(270.698946, averageTemperature, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeForcedVentilationWithZeroAirSpeed, SolidLayer2Temperatures) -{ - SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer With Zero Air Speed - Solid layer 2 Temperatures"); - - auto aLayer = GetSolidLayer2(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); - auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(281.591652, frontTemperature, 1e-4); - EXPECT_NEAR(281.598943, backTemperature, 1e-4); -} diff --git a/src/Tarcog/tst/units/GapLayerAtEdgeVentilation.unit.cpp b/src/Tarcog/tst/units/GapLayerAtEdgeVentilation.unit.cpp deleted file mode 100644 index ee8b9047..00000000 --- a/src/Tarcog/tst/units/GapLayerAtEdgeVentilation.unit.cpp +++ /dev/null @@ -1,168 +0,0 @@ -#include -#include - -#include "WCETarcog.hpp" - -class TestGapLayerAtEdgeVentilation : public testing::Test -{ -private: - std::shared_ptr m_TarcogSystem; - -protected: - void SetUp() override - { - ///////////////////////////////////////////////////////// - // Outdoor - ///////////////////////////////////////////////////////// - auto airTemperature = 255.15; // Kelvins - auto airSpeed = 5.5; // meters per second - auto tSky = 255.15; // Kelvins - auto solarRadiation = 0.0; - - auto Outdoor = Tarcog::ISO15099::Environments::outdoor( - airTemperature, airSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); - ASSERT_TRUE(Outdoor != nullptr); - Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); - - ///////////////////////////////////////////////////////// - /// Indoor - ///////////////////////////////////////////////////////// - - auto roomTemperature = 295.15; - - auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); - ASSERT_TRUE(Indoor != nullptr); - - // IGU - auto solidLayerThickness = 0.005715; // [m] - auto solidLayerConductance = 1.0; - - auto solidLayer = Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance); - ASSERT_TRUE(solidLayer != nullptr); - - auto shadeLayerThickness = 0.01; - auto shadeLayerConductance = 160.0; - auto Atop = 0.1; - auto Abot = 0.1; - auto Aleft = 0.1; - auto Aright = 0.1; - auto Afront = 0.2; - - EffectiveLayers::ShadeOpenness openness{Afront, Aleft, Aright, Atop, Abot}; - - double windowWidth = 1; - double windowHeight = 1; - - EffectiveLayers::EffectiveLayerOther effectiveLayer{ - windowWidth, windowHeight, shadeLayerThickness, openness}; - - EffectiveLayers::EffectiveOpenness effOpenness{effectiveLayer.getEffectiveOpenness()}; - - auto shadeLayer = Tarcog::ISO15099::Layers::shading( - shadeLayerThickness, shadeLayerConductance, effOpenness); - - ASSERT_TRUE(shadeLayer != nullptr); - - auto gapThickness = 0.0127; - auto gap = Tarcog::ISO15099::Layers::gap(gapThickness); - ASSERT_TRUE(gap != nullptr); - - Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); - aIGU.addLayers({solidLayer, gap, shadeLayer}); - - ///////////////////////////////////////////////////////// - /// System - ///////////////////////////////////////////////////////// - m_TarcogSystem = std::make_shared(aIGU, Indoor, Outdoor); - ASSERT_TRUE(m_TarcogSystem != nullptr); - - m_TarcogSystem->solve(); - } - -public: - std::shared_ptr GetSolidLayer() const - { - auto solidLayer = m_TarcogSystem->getSolidLayers()[0]; - assert(std::dynamic_pointer_cast(solidLayer) - != nullptr); - return std::dynamic_pointer_cast(solidLayer); - }; - - std::shared_ptr GetGap() const - { - auto gap = m_TarcogSystem->getGapLayers()[0]; - assert(std::dynamic_pointer_cast(gap) - != nullptr); - return std::dynamic_pointer_cast(gap); - }; - - std::shared_ptr GetShadeLayer() const - { - auto shadeLayer = m_TarcogSystem->getSolidLayers()[1]; - assert(std::dynamic_pointer_cast(shadeLayer) - != nullptr); - return std::dynamic_pointer_cast(shadeLayer); - }; -}; - -TEST_F(TestGapLayerAtEdgeVentilation, GainEnergy) -{ - SCOPED_TRACE("Begin Test: Test Ventilated Gap Layer - Gain Energy"); - - auto aLayer = GetGap(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(98.518206944209908, gainEnergy, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeVentilation, SolidTemperatures) -{ - SCOPED_TRACE("Begin Test: Test Ventilated Gap Layer - Solid Temperatures"); - - auto aLayer = GetSolidLayer(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); - auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(261.30757062774973, frontTemperature, 1e-4); - EXPECT_NEAR(262.33797584175301, backTemperature, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeVentilation, GapTemperatures) -{ - SCOPED_TRACE("Begin Test: Test Ventilated Gap Layer - Gap Temperatures"); - - auto aLayer = GetGap(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); - auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - auto layerTemperature = aLayer->layerTemperature(); - auto averageTemperature = aLayer->averageTemperature(); - EXPECT_NEAR(262.33797584175301, frontTemperature, 1e-4); - EXPECT_NEAR(283.91677515043358, backTemperature, 1e-4); - EXPECT_NEAR(282.17807803748229, layerTemperature, 1e-4); - EXPECT_NEAR(273.12737549609329, averageTemperature, 1e-4); -} - -TEST_F(TestGapLayerAtEdgeVentilation, ShadeTemperatures) -{ - SCOPED_TRACE("Begin Test: Test Ventilated Gap Layer - Shade Temperatures"); - - auto aLayer = GetShadeLayer(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); - auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(283.91677515043358, frontTemperature, 1e-4); - EXPECT_NEAR(283.92316397867683, backTemperature, 1e-4); -} diff --git a/src/Tarcog/tst/units/GapLayerInBetweenForcedVentilation.unit.cpp b/src/Tarcog/tst/units/GapLayerInBetweenForcedVentilation.unit.cpp deleted file mode 100644 index bc9abf75..00000000 --- a/src/Tarcog/tst/units/GapLayerInBetweenForcedVentilation.unit.cpp +++ /dev/null @@ -1,107 +0,0 @@ -#include -#include - -#include "WCETarcog.hpp" - -using Tarcog::ISO15099::CBaseIGULayer; - -class TestGapLayerInBetweenForcedVentilation : public testing::Test -{ -private: - std::unique_ptr m_TarcogSystem; - -protected: - void SetUp() override - { - ///////////////////////////////////////////////////////// - // Outdoor - ///////////////////////////////////////////////////////// - auto airTemperature = 255.15; // Kelvins - auto airSpeed = 5.5; // meters per second - auto tSky = 255.15; // Kelvins - auto solarRadiation = 0.0; - - auto Outdoor = Tarcog::ISO15099::Environments::outdoor( - airTemperature, airSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); - ASSERT_TRUE(Outdoor != nullptr); - Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); - - ///////////////////////////////////////////////////////// - /// Indoor - ///////////////////////////////////////////////////////// - - auto roomTemperature = 295.15; - - auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); - ASSERT_TRUE(Indoor != nullptr); - - // IGU - auto solidLayerThickness = 0.005715; // [m] - auto solidLayerConductance = 1.0; - - auto layer1 = Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance); - ASSERT_TRUE(layer1 != nullptr); - - auto layer2 = Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance); - ASSERT_TRUE(layer2 != nullptr); - - auto layer3 = Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance); - ASSERT_TRUE(layer2 != nullptr); - - const double windowWidth = 1; - const double windowHeight = 1; - - const auto gapThickness = 0.0127; - const auto gapAirSpeed = 0.5; - const auto aGap1 = Tarcog::ISO15099::Layers::gap(gapThickness); - ASSERT_TRUE(aGap1 != nullptr); - const auto gap1 = Tarcog::ISO15099::Layers::forcedVentilationGap( - aGap1, gapAirSpeed, roomTemperature); - ASSERT_TRUE(gap1 != nullptr); - - auto aGap2 = Tarcog::ISO15099::Layers::gap(gapThickness); - ASSERT_TRUE(aGap2 != nullptr); - const auto gap2 = Tarcog::ISO15099::Layers::forcedVentilationGap( - aGap2, gapAirSpeed, roomTemperature); - - Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); - aIGU.addLayers({layer1, gap1, layer2, gap2, layer3}); - - ///////////////////////////////////////////////////////// - /// System - ///////////////////////////////////////////////////////// - m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); - ASSERT_TRUE(m_TarcogSystem != nullptr); - - m_TarcogSystem->solve(); - } - -public: - [[nodiscard]] CBaseIGULayer * GetGap1() const - { - return m_TarcogSystem->getGapLayers()[0].get(); - }; - - [[nodiscard]] CBaseIGULayer * GetGap2() const - { - return m_TarcogSystem->getGapLayers()[1].get(); - }; -}; - -TEST_F(TestGapLayerInBetweenForcedVentilation, VentilationFlow) -{ - SCOPED_TRACE("Begin Test: Test Ventilated Gap Layer - Intial Airflow"); - - auto aLayer = GetGap1(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(134.001098, gainEnergy, 1e-4); - - aLayer = GetGap2(); - ASSERT_TRUE(aLayer != nullptr); - gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(43.748528, gainEnergy, 1e-4); -} diff --git a/src/Tarcog/tst/units/GapLayerInBetweenThermallyDrivenVentilation.unit.cpp b/src/Tarcog/tst/units/GapLayerInBetweenThermallyDrivenVentilation.unit.cpp deleted file mode 100644 index 6100d7d9..00000000 --- a/src/Tarcog/tst/units/GapLayerInBetweenThermallyDrivenVentilation.unit.cpp +++ /dev/null @@ -1,116 +0,0 @@ -#include -#include - -#include "WCETarcog.hpp" - -using Tarcog::ISO15099::CBaseIGULayer; - -class TestGapLayerInBetweenThermallyDrivenVentilation : public testing::Test -{ -private: - std::unique_ptr m_TarcogSystem; - -protected: - void SetUp() override - { - ///////////////////////////////////////////////////////// - // Outdoor - ///////////////////////////////////////////////////////// - auto airTemperature = 255.15; // Kelvins - auto airSpeed = 5.5; // meters per second - auto tSky = 255.15; // Kelvins - auto solarRadiation = 0.0; - - auto Outdoor = Tarcog::ISO15099::Environments::outdoor( - airTemperature, airSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); - ASSERT_TRUE(Outdoor != nullptr); - Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); - - ///////////////////////////////////////////////////////// - /// Indoor - ///////////////////////////////////////////////////////// - - auto roomTemperature = 295.15; - - auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); - ASSERT_TRUE(Indoor != nullptr); - - // IGU - auto solidLayerThickness = 0.005715; // [m] - auto solidLayerConductance = 1.0; - - auto layer1 = Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance); - ASSERT_TRUE(layer1 != nullptr); - - auto layer2 = Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance); - ASSERT_TRUE(layer2 != nullptr); - - auto shadeLayerThickness = 0.01; - auto shadeLayerConductance = 160.0; - auto Atop = 0.1; - auto Abot = 0.1; - auto Aleft = 0.1; - auto Aright = 0.1; - auto Afront = 0.2; - - EffectiveLayers::ShadeOpenness openness{Afront, Aleft, Aright, Atop, Abot}; - - double windowWidth = 1; - double windowHeight = 1; - - EffectiveLayers::EffectiveLayerOther effectiveLayer{ - windowWidth, windowHeight, shadeLayerThickness, openness}; - - EffectiveLayers::EffectiveOpenness effOpenness{effectiveLayer.getEffectiveOpenness()}; - - auto shadeLayer = Tarcog::ISO15099::Layers::shading( - shadeLayerThickness, shadeLayerConductance, effOpenness); - - ASSERT_TRUE(shadeLayer != nullptr); - - auto gapThickness = 0.0127; - auto gap1 = Tarcog::ISO15099::Layers::gap(gapThickness); - ASSERT_TRUE(gap1 != nullptr); - - auto gap2 = Tarcog::ISO15099::Layers::gap(gapThickness); - ASSERT_TRUE(gap2 != nullptr); - - Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); - aIGU.addLayers({layer1, gap1, shadeLayer, gap2, layer2}); - - ///////////////////////////////////////////////////////// - /// System - ///////////////////////////////////////////////////////// - m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); - ASSERT_TRUE(m_TarcogSystem != nullptr); - } - -public: - [[nodiscard]] CBaseIGULayer * GetGap1() const - { - return m_TarcogSystem->getGapLayers()[0].get(); - }; - - [[nodiscard]] CBaseIGULayer * GetGap2() const - { - return m_TarcogSystem->getGapLayers()[1].get(); - }; -}; - -TEST_F(TestGapLayerInBetweenThermallyDrivenVentilation, VentilationFlow) -{ - SCOPED_TRACE("Begin Test: Test Ventilated Gap Layer - Intial Airflow"); - - auto aLayer = GetGap1(); - - // Airflow iterations are set to 1e-4 and it cannot exceed that precision - - ASSERT_TRUE(aLayer != nullptr); - auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(34.909058, gainEnergy, 1e-4); - - aLayer = GetGap2(); - ASSERT_TRUE(aLayer != nullptr); - gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(-34.909058, gainEnergy, 1e-4); -} From 1167e317aa857bda040355fc570280e4c62acc75 Mon Sep 17 00:00:00 2001 From: Simon Wacker Date: Tue, 21 Mar 2023 16:30:07 +0100 Subject: [PATCH 32/33] Correct expected values --- ...tilationInsideAirWinterValidation.unit.cpp | 34 +++++++++---------- ...anesNoVentilationWinterValidation.unit.cpp | 34 +++++++++---------- ...ndGlassForcedVentilationInsideAir.unit.cpp | 22 ++++++------ ...dGlassForcedVentilationOutsideAir.unit.cpp | 22 ++++++------ ...ingFastForcedVentilationInsideAir.unit.cpp | 22 ++++++------ ...ShadingForcedVentilationInsideAir.unit.cpp | 22 ++++++------ ...tilationInsideAirThreeMeterHeight.unit.cpp | 22 ++++++------ ...dInteriorShadingNaturalConvection.unit.cpp | 22 ++++++------ ...eriorShadingZeroForcedVentilation.unit.cpp | 22 ++++++------ ...tilationInsideAirSummerValidation.unit.cpp | 34 +++++++++---------- ...ntegratedShadingForcedVentilation.unit.cpp | 16 ++++----- .../GapLayerInBetweenVentilation.unit.cpp | 4 +-- 12 files changed, 138 insertions(+), 138 deletions(-) diff --git a/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp index 04e6ca48..ff47aead 100644 --- a/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation.unit.cpp @@ -160,8 +160,8 @@ TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, ASSERT_TRUE(aLayer != nullptr); auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); - EXPECT_NEAR(300.51850897417813, frontIRRadiationFlow, 1e-4); - EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); + EXPECT_NEAR(363.6442313880292, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(406.34366147928824, backIRRadiationFlow, 1e-4); } TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, GainEnergy) @@ -174,7 +174,7 @@ TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, G ASSERT_TRUE(aLayer != nullptr); auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); + EXPECT_NEAR(106.17970021341233, gainEnergy, 1e-4); } TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, @@ -189,8 +189,8 @@ TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); - EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); + EXPECT_NEAR(280.81537988946332, frontTemperature, 1e-4); + EXPECT_NEAR(281.39944906386245, backTemperature, 1e-4); } TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, GapTemperatures) @@ -206,10 +206,10 @@ TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, G auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); auto layerTemperature = aLayer->layerTemperature(); auto averageTemperature = aLayer->averageTemperature(); - EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); - EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); - EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); - EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); + EXPECT_NEAR(281.39944906386245, frontTemperature, 1e-4); + EXPECT_NEAR(292.40517817543264, backTemperature, 1e-4); + EXPECT_NEAR(292.7187143602813, layerTemperature, 1e-4); + EXPECT_NEAR(286.90231361964754, averageTemperature, 1e-4); } TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, @@ -224,8 +224,8 @@ TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); - EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); + EXPECT_NEAR(292.40517817543264, frontTemperature, 1e-4); + EXPECT_NEAR(292.56452854907945, backTemperature, 1e-4); } TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, @@ -240,10 +240,10 @@ TEST_F(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, auto indoorRadiativeHeatTransferCoefficient = GetIndoorRadiativeHeatTransferCoefficient(); auto indoorHeatTransferCoefficient = GetIndoorHeatTransferCoefficient(); - EXPECT_NEAR(0, outdoorConvectiveHeatTransferCoefficient, 1e-4); - EXPECT_NEAR(0, outdoorRadiativeHeatTransferCoefficient, 1e-4); - EXPECT_NEAR(0, outdoorHeatTransferCoefficient, 1e-4); - EXPECT_NEAR(0, indoorConvectiveHeatTransferCoefficient, 1e-4); - EXPECT_NEAR(0, indoorRadiativeHeatTransferCoefficient, 1e-4); - EXPECT_NEAR(0, indoorHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(15, outdoorConvectiveHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(4.0489311300156681, outdoorRadiativeHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(19.048931130015667, outdoorHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(2.2234943063051422, indoorConvectiveHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(4.9088657390803361, indoorRadiativeHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(7.1323600453854787, indoorHeatTransferCoefficient, 1e-4); } \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp index 89d9a058..25044a46 100644 --- a/src/Tarcog/tst/units/GapBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenDarkGlassPanesNoVentilationWinterValidation.unit.cpp @@ -159,8 +159,8 @@ TEST_F(TestGapBetweenDarkGlassPanesNoVentilationWinterValidation, GapLayerSurfac ASSERT_TRUE(aLayer != nullptr); auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); - EXPECT_NEAR(300.51850897417813, frontIRRadiationFlow, 1e-4); - EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); + EXPECT_NEAR(342.30366908251926, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(384.12123352518552, backIRRadiationFlow, 1e-4); } TEST_F(TestGapBetweenDarkGlassPanesNoVentilationWinterValidation, GainEnergy) @@ -173,7 +173,7 @@ TEST_F(TestGapBetweenDarkGlassPanesNoVentilationWinterValidation, GainEnergy) ASSERT_TRUE(aLayer != nullptr); auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); + EXPECT_NEAR(0, gainEnergy, 1e-4); } TEST_F(TestGapBetweenDarkGlassPanesNoVentilationWinterValidation, FirstLayerSurfaceTemperatures) @@ -187,8 +187,8 @@ TEST_F(TestGapBetweenDarkGlassPanesNoVentilationWinterValidation, FirstLayerSurf ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); - EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); + EXPECT_NEAR(276.83340353098015, frontTemperature, 1e-4); + EXPECT_NEAR(277.11277736659969, backTemperature, 1e-4); } TEST_F(TestGapBetweenDarkGlassPanesNoVentilationWinterValidation, GapTemperatures) @@ -204,10 +204,10 @@ TEST_F(TestGapBetweenDarkGlassPanesNoVentilationWinterValidation, GapTemperature auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); auto layerTemperature = aLayer->layerTemperature(); auto averageTemperature = aLayer->averageTemperature(); - EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); - EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); - EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); - EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); + EXPECT_NEAR(277.11277736659969, frontTemperature, 1e-4); + EXPECT_NEAR(288.37356601094808, backTemperature, 1e-4); + EXPECT_NEAR(282.74317168877388, layerTemperature, 1e-4); + EXPECT_NEAR(282.74317168877388, averageTemperature, 1e-4); } TEST_F(TestGapBetweenDarkGlassPanesNoVentilationWinterValidation, SecondLayerSurfaceTemperatures) @@ -221,8 +221,8 @@ TEST_F(TestGapBetweenDarkGlassPanesNoVentilationWinterValidation, SecondLayerSur ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); - EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); + EXPECT_NEAR(288.37356601094808, frontTemperature, 1e-4); + EXPECT_NEAR(288.65293984656751, backTemperature, 1e-4); } TEST_F(TestGapBetweenDarkGlassPanesNoVentilationWinterValidation, HeatTransferCoefficients) @@ -236,10 +236,10 @@ TEST_F(TestGapBetweenDarkGlassPanesNoVentilationWinterValidation, HeatTransferCo auto indoorRadiativeHeatTransferCoefficient = GetIndoorRadiativeHeatTransferCoefficient(); auto indoorHeatTransferCoefficient = GetIndoorHeatTransferCoefficient(); - EXPECT_NEAR(0, outdoorConvectiveHeatTransferCoefficient, 1e-4); - EXPECT_NEAR(0, outdoorRadiativeHeatTransferCoefficient, 1e-4); - EXPECT_NEAR(0, outdoorHeatTransferCoefficient, 1e-4); - EXPECT_NEAR(0, indoorConvectiveHeatTransferCoefficient, 1e-4); - EXPECT_NEAR(0, indoorRadiativeHeatTransferCoefficient, 1e-4); - EXPECT_NEAR(0, indoorHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(15, outdoorConvectiveHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(3.9616636645399086, outdoorRadiativeHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(18.961663664539909, outdoorHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(2.541395138863741, indoorConvectiveHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(4.8128237212777485, indoorRadiativeHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(7.35421886014149, indoorHeatTransferCoefficient, 1e-4); } \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir.unit.cpp index c678da67..2587ca2d 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir.unit.cpp @@ -132,8 +132,8 @@ TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir ASSERT_TRUE(aLayer != nullptr); auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); - EXPECT_NEAR(300.51850897417813, frontIRRadiationFlow, 1e-4); - EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); + EXPECT_NEAR(514.09979648823617, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(494.62579436827116, backIRRadiationFlow, 1e-4); } TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir, GainEnergy) @@ -146,7 +146,7 @@ TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir ASSERT_TRUE(aLayer != nullptr); auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); + EXPECT_NEAR(-45.333884920391, gainEnergy, 1e-4); } TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir, FirstLayerSurfaceTemperatures) @@ -160,8 +160,8 @@ TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); - EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); + EXPECT_NEAR(312.84342610457981, frontTemperature, 1e-4); + EXPECT_NEAR(313.12896009393842, backTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir, GapTemperatures) @@ -177,10 +177,10 @@ TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); auto layerTemperature = aLayer->layerTemperature(); auto averageTemperature = aLayer->averageTemperature(); - EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); - EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); - EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); - EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); + EXPECT_NEAR(313.12896009393842, frontTemperature, 1e-4); + EXPECT_NEAR(305.04357261282178, backTemperature, 1e-4); + EXPECT_NEAR(302.78306814785384, layerTemperature, 1e-4); + EXPECT_NEAR(309.0862663533801, averageTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir, SecondLayerSurfaceTemperatures) @@ -194,6 +194,6 @@ TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationInsideAir ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); - EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); + EXPECT_NEAR(305.04357261282178, frontTemperature, 1e-4); + EXPECT_NEAR(304.94803305914581, backTemperature, 1e-4); } \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp index 2447dff7..f5e5ff62 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir.unit.cpp @@ -132,8 +132,8 @@ TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAi ASSERT_TRUE(aLayer != nullptr); auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); - EXPECT_NEAR(300.51850897417813, frontIRRadiationFlow, 1e-4); - EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); + EXPECT_NEAR(514.09979648823617, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(494.62579436827116, backIRRadiationFlow, 1e-4); } TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir, GainEnergy) @@ -146,7 +146,7 @@ TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAi ASSERT_TRUE(aLayer != nullptr); auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); + EXPECT_NEAR(-45.333884920391, gainEnergy, 1e-4); } TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir, FirstLayerSurfaceTemperatures) @@ -160,8 +160,8 @@ TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAi ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); - EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); + EXPECT_NEAR(312.84342610457981, frontTemperature, 1e-4); + EXPECT_NEAR(313.12896009393842, backTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir, GapTemperatures) @@ -177,10 +177,10 @@ TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAi auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); auto layerTemperature = aLayer->layerTemperature(); auto averageTemperature = aLayer->averageTemperature(); - EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); - EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); - EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); - EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); + EXPECT_NEAR(313.12896009393842, frontTemperature, 1e-4); + EXPECT_NEAR(305.04357261282178, backTemperature, 1e-4); + EXPECT_NEAR(302.78306814785384, layerTemperature, 1e-4); + EXPECT_NEAR(309.0862663533801, averageTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAir, SecondLayerSurfaceTemperatures) @@ -194,6 +194,6 @@ TEST_F(TestGapBetweenIrradiatedExteriorShadingAndGlassForcedVentilationOutsideAi ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); - EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); + EXPECT_NEAR(305.04357261282178, frontTemperature, 1e-4); + EXPECT_NEAR(304.94803305914581, backTemperature, 1e-4); } \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir.unit.cpp index 3a60919e..851235bf 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir.unit.cpp @@ -132,8 +132,8 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsid ASSERT_TRUE(aLayer != nullptr); auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); - EXPECT_NEAR(300.51850897417813, frontIRRadiationFlow, 1e-4); - EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); + EXPECT_NEAR(481.75485970781006, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(535.093104074444, backIRRadiationFlow, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir, GainEnergy) @@ -146,7 +146,7 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsid ASSERT_TRUE(aLayer != nullptr); auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); + EXPECT_NEAR(-165.41868220955854, gainEnergy, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir, FirstLayerSurfaceTemperatures) @@ -160,8 +160,8 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsid ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); - EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); + EXPECT_NEAR(301.83170279362213, frontTemperature, 1e-4); + EXPECT_NEAR(301.99678720311624, backTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir, GapTemperatures) @@ -177,10 +177,10 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsid auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); auto layerTemperature = aLayer->layerTemperature(); auto averageTemperature = aLayer->averageTemperature(); - EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); - EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); - EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); - EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); + EXPECT_NEAR(301.99678720311624, frontTemperature, 1e-4); + EXPECT_NEAR(317.82696151543445, backTemperature, 1e-4); + EXPECT_NEAR(299.60769752906231, layerTemperature, 1e-4); + EXPECT_NEAR(309.91187435927532, averageTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsideAir, SecondLayerSurfaceTemperatures) @@ -194,6 +194,6 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingFastForcedVentilationInsid ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); - EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); + EXPECT_NEAR(317.82696151543445, frontTemperature, 1e-4); + EXPECT_NEAR(317.9161383448461, backTemperature, 1e-4); } \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir.unit.cpp index 3b99dd8b..8e6ca019 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir.unit.cpp @@ -132,8 +132,8 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir ASSERT_TRUE(aLayer != nullptr); auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); - EXPECT_NEAR(300.51850897417813, frontIRRadiationFlow, 1e-4); - EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); + EXPECT_NEAR(497.73370409824713, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(564.05361722327848, backIRRadiationFlow, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir, GainEnergy) @@ -146,7 +146,7 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir ASSERT_TRUE(aLayer != nullptr); auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); + EXPECT_NEAR(-72.690847094264186, gainEnergy, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir, FirstLayerSurfaceTemperatures) @@ -160,8 +160,8 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); - EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); + EXPECT_NEAR(303.8464948610835, frontTemperature, 1e-4); + EXPECT_NEAR(304.13618821843897, backTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir, GapTemperatures) @@ -177,10 +177,10 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); auto layerTemperature = aLayer->layerTemperature(); auto averageTemperature = aLayer->averageTemperature(); - EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); - EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); - EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); - EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); + EXPECT_NEAR(304.13618821843897, frontTemperature, 1e-4); + EXPECT_NEAR(323.52950175138528, backTemperature, 1e-4); + EXPECT_NEAR(306.01312318292258, layerTemperature, 1e-4); + EXPECT_NEAR(313.83284498491213, averageTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir, SecondLayerSurfaceTemperatures) @@ -194,6 +194,6 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); - EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); + EXPECT_NEAR(323.52950175138528, frontTemperature, 1e-4); + EXPECT_NEAR(323.49077676587774, backTemperature, 1e-4); } \ 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 5e3a4072..a5fc0ba6 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight.unit.cpp @@ -132,8 +132,8 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir ASSERT_TRUE(aLayer != nullptr); auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); - EXPECT_NEAR(300.51850897417813, frontIRRadiationFlow, 1e-4); - EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); + EXPECT_NEAR(509.14498001108558, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(581.880250148615, backIRRadiationFlow, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight, GainEnergy) @@ -146,7 +146,7 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir ASSERT_TRUE(aLayer != nullptr); auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); + EXPECT_NEAR(-34.128540161354429, gainEnergy, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight, FirstLayerSurfaceTemperatures) @@ -160,8 +160,8 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); - EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); + EXPECT_NEAR(305.33843112508362, frontTemperature, 1e-4); + EXPECT_NEAR(305.72081655473085, backTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight, GapTemperatures) @@ -177,10 +177,10 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); auto layerTemperature = aLayer->layerTemperature(); auto averageTemperature = aLayer->averageTemperature(); - EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); - EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); - EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); - EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); + 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); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAirThreeMeterHeight, SecondLayerSurfaceTemperatures) @@ -194,6 +194,6 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingForcedVentilationInsideAir ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); - EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); + EXPECT_NEAR(326.86352010579054, frontTemperature, 1e-4); + EXPECT_NEAR(326.61372838866049, backTemperature, 1e-4); } \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection.unit.cpp index f470c61b..f31c808f 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection.unit.cpp @@ -128,8 +128,8 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection, GapLaye ASSERT_TRUE(aLayer != nullptr); auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); - EXPECT_NEAR(300.51850897417813, frontIRRadiationFlow, 1e-4); - EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); + EXPECT_NEAR(503.2725415073902, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(571.43594632791894, backIRRadiationFlow, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection, GainEnergy) @@ -142,7 +142,7 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection, GainEne ASSERT_TRUE(aLayer != nullptr); auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); + EXPECT_NEAR(-43.832687161547518, gainEnergy, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection, FirstLayerSurfaceTemperatures) @@ -156,8 +156,8 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection, FirstLa ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); - EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); + EXPECT_NEAR(304.60903517150138, frontTemperature, 1e-4); + EXPECT_NEAR(304.94605922753459, backTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection, GapTemperatures) @@ -173,10 +173,10 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection, GapTemp auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); auto layerTemperature = aLayer->layerTemperature(); auto averageTemperature = aLayer->averageTemperature(); - EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); - EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); - EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); - EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); + EXPECT_NEAR(304.94605922753459, frontTemperature, 1e-4); + EXPECT_NEAR(324.90604783261381, backTemperature, 1e-4); + EXPECT_NEAR(309.99149481933722, layerTemperature, 1e-4); + EXPECT_NEAR(314.92605353007423, averageTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection, SecondLayerSurfaceTemperatures) @@ -190,6 +190,6 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingNaturalConvection, SecondL ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); - EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); + EXPECT_NEAR(324.90604783261381, frontTemperature, 1e-4); + EXPECT_NEAR(324.83549933079962, backTemperature, 1e-4); } \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation.unit.cpp index c0f91d0e..1b7f5527 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation.unit.cpp @@ -132,8 +132,8 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation, Gap ASSERT_TRUE(aLayer != nullptr); auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); - EXPECT_NEAR(300.51850897417813, frontIRRadiationFlow, 1e-4); - EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); + EXPECT_NEAR(511.81723104105129, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(582.41366156336119, backIRRadiationFlow, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation, GainEnergy) @@ -146,7 +146,7 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation, Gai ASSERT_TRUE(aLayer != nullptr); auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); + EXPECT_NEAR(-0, gainEnergy, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation, FirstLayerSurfaceTemperatures) @@ -160,8 +160,8 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation, Fir ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); - EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); + EXPECT_NEAR(305.78475961830213, frontTemperature, 1e-4); + EXPECT_NEAR(306.1949449487222, backTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation, GapTemperatures) @@ -177,10 +177,10 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation, Gap auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); auto layerTemperature = aLayer->layerTemperature(); auto averageTemperature = aLayer->averageTemperature(); - EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); - EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); - EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); - EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); + EXPECT_NEAR(306.1949449487222, frontTemperature, 1e-4); + EXPECT_NEAR(326.91503360741098, backTemperature, 1e-4); + EXPECT_NEAR(316.55498927806661, layerTemperature, 1e-4); + EXPECT_NEAR(316.55498927806661, averageTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation, SecondLayerSurfaceTemperatures) @@ -194,6 +194,6 @@ TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation, Sec ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); - EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); + EXPECT_NEAR(326.91503360741098, frontTemperature, 1e-4); + EXPECT_NEAR(326.79740533508084, backTemperature, 1e-4); } \ No newline at end of file diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp index 857fd58d..fe74d22c 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation.unit.cpp @@ -166,8 +166,8 @@ TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidat ASSERT_TRUE(aLayer != nullptr); auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); - EXPECT_NEAR(300.51850897417813, frontIRRadiationFlow, 1e-4); - EXPECT_NEAR(352.30917088728245, backIRRadiationFlow, 1e-4); + EXPECT_NEAR(531.30318349223751, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(540.33210677944123, backIRRadiationFlow, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, GainEnergy) @@ -180,7 +180,7 @@ TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidat ASSERT_TRUE(aLayer != nullptr); auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(123.35122562642526, gainEnergy, 1e-4); + EXPECT_NEAR(-126.74249735960383, gainEnergy, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, @@ -195,8 +195,8 @@ TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidat ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); - EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); + EXPECT_NEAR(310.66416364252655, frontTemperature, 1e-4); + EXPECT_NEAR(310.8805621728074, backTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, @@ -213,10 +213,10 @@ TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidat auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); auto layerTemperature = aLayer->layerTemperature(); auto averageTemperature = aLayer->averageTemperature(); - EXPECT_NEAR(263.33651241783423, frontTemperature, 1e-4); - EXPECT_NEAR(282.70879216106016, backTemperature, 1e-4); - EXPECT_NEAR(285.74858839456721, layerTemperature, 1e-4); - EXPECT_NEAR(273.02265228944719, averageTemperature, 1e-4); + EXPECT_NEAR(310.8805621728074, frontTemperature, 1e-4); + EXPECT_NEAR(312.69446809156403, backTemperature, 1e-4); + EXPECT_NEAR(304.97929104242945, layerTemperature, 1e-4); + EXPECT_NEAR(311.78751513218572, averageTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, @@ -231,8 +231,8 @@ TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidat ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(282.70879216106016, frontTemperature, 1e-4); - EXPECT_NEAR(283.10709823028276, backTemperature, 1e-4); + EXPECT_NEAR(312.69446809156403, frontTemperature, 1e-4); + EXPECT_NEAR(312.61783661123928, backTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidation, @@ -247,10 +247,10 @@ TEST_F(TestGapBetweenIrradiatedGlassPanesForcedVentilationInsideAirSummerValidat auto indoorRadiativeHeatTransferCoefficient = GetIndoorRadiativeHeatTransferCoefficient(); auto indoorHeatTransferCoefficient = GetIndoorHeatTransferCoefficient(); - EXPECT_NEAR(0, outdoorConvectiveHeatTransferCoefficient, 1e-4); - EXPECT_NEAR(0, outdoorRadiativeHeatTransferCoefficient, 1e-4); - EXPECT_NEAR(0, outdoorHeatTransferCoefficient, 1e-4); - EXPECT_NEAR(0, indoorConvectiveHeatTransferCoefficient, 1e-4); - EXPECT_NEAR(0, indoorRadiativeHeatTransferCoefficient, 1e-4); - EXPECT_NEAR(0, indoorHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(15, outdoorConvectiveHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(5.5078888218611599, outdoorRadiativeHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(20.507888821861158, outdoorHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(2.8075327311167633, indoorConvectiveHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(5.4285203348942703, indoorRadiativeHeatTransferCoefficient, 1e-4); + EXPECT_NEAR(8.2360530660110332, indoorHeatTransferCoefficient, 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 c0f306d0..ccd2064d 100644 --- a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation.unit.cpp +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation.unit.cpp @@ -134,12 +134,12 @@ TEST_F(TestGapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation, ASSERT_TRUE(aLayer != nullptr); auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(34.909058, gainEnergy, 1e-4); + EXPECT_NEAR(3.7294499418281335, gainEnergy, 1e-4); aLayer = GetGap2(); ASSERT_TRUE(aLayer != nullptr); gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(-34.909058, gainEnergy, 1e-4); + EXPECT_NEAR(-3.7294499418281335, gainEnergy, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation, FirstLayerSurfaceTemperatures) @@ -153,8 +153,8 @@ TEST_F(TestGapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation, ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); - EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); + EXPECT_NEAR(306.04014011835119, frontTemperature, 1e-4); + EXPECT_NEAR(307.36367843102033, backTemperature, 1e-4); } // TEST_F(TestGapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation, GapTemperatures) @@ -187,8 +187,8 @@ TEST_F(TestGapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation, ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); - EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); + EXPECT_NEAR(334.87586844983286, frontTemperature, 1e-4); + EXPECT_NEAR(334.87882619192641, backTemperature, 1e-4); } TEST_F(TestGapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation, ThirdLayerSurfaceTemperatures) @@ -202,6 +202,6 @@ TEST_F(TestGapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVentilation, ASSERT_TRUE(aLayer != nullptr); auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); - EXPECT_NEAR(263.04855139463018, frontTemperature, 1e-4); - EXPECT_NEAR(263.33651241783423, backTemperature, 1e-4); + EXPECT_NEAR(318.08669652857139, frontTemperature, 1e-4); + EXPECT_NEAR(317.23853484124118, backTemperature, 1e-4); } diff --git a/src/Tarcog/tst/units/GapLayerInBetweenVentilation.unit.cpp b/src/Tarcog/tst/units/GapLayerInBetweenVentilation.unit.cpp index 1e25e5db..05fb7258 100644 --- a/src/Tarcog/tst/units/GapLayerInBetweenVentilation.unit.cpp +++ b/src/Tarcog/tst/units/GapLayerInBetweenVentilation.unit.cpp @@ -112,10 +112,10 @@ TEST_F(TestGapLayerInBetweenVentilation, VentilationFlow) ASSERT_TRUE(aLayer != nullptr); auto gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(32.988234, gainEnergy, 1e-4); + EXPECT_NEAR(34.909058114121649, gainEnergy, 1e-4); aLayer = GetGap2(); ASSERT_TRUE(aLayer != nullptr); gainEnergy = aLayer->getGainFlow(); - EXPECT_NEAR(-32.988234, gainEnergy, 1e-4); + EXPECT_NEAR(-34.909058114121649, gainEnergy, 1e-4); } \ No newline at end of file From 25815c73f796b0bcc51427c4aac2ffc028602b1d Mon Sep 17 00:00:00 2001 From: Simon Wacker Date: Tue, 21 Mar 2023 17:01:29 +0100 Subject: [PATCH 33/33] Add test with naturally ventilated and sealed gap to cross validate the forced ventilation test `TestGapBetweenIrradiatedGlassAndInteriorShadingZeroForcedVentilation` --- src/Tarcog/src/Layers.cpp | 15 ++ src/Tarcog/src/Layers.hpp | 8 + ...dInteriorShadingSealedVentilation.unit.cpp | 195 ++++++++++++++++++ 3 files changed, 218 insertions(+) create mode 100644 src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingSealedVentilation.unit.cpp diff --git a/src/Tarcog/src/Layers.cpp b/src/Tarcog/src/Layers.cpp index 8f1aa241..e0d615c6 100644 --- a/src/Tarcog/src/Layers.cpp +++ b/src/Tarcog/src/Layers.cpp @@ -94,6 +94,21 @@ namespace Tarcog std::make_shared(backEmissivity, backIRTransmittance)); } + std::shared_ptr + Layers::sealedLayer(double thickness, + double conductivity, + double frontEmissivity, + double frontIRTransmittance, + double backEmissivity, + double backIRTransmittance) + { + return std::make_shared( + thickness, + conductivity, + std::make_shared(0, 0, 0, 0, 0, 0), + std::make_shared(frontEmissivity, frontIRTransmittance), + std::make_shared(backEmissivity, backIRTransmittance)); + } std::shared_ptr Layers::addCircularPillar(const std::shared_ptr & gap, diff --git a/src/Tarcog/src/Layers.hpp b/src/Tarcog/src/Layers.hpp index eeb73e43..f4df45d4 100644 --- a/src/Tarcog/src/Layers.hpp +++ b/src/Tarcog/src/Layers.hpp @@ -41,6 +41,14 @@ namespace Tarcog double backEmissivity = 0.84, double backIRTransmittance = 0.0); + static std::shared_ptr + sealedLayer(double thickness, + double conductivity, + double frontEmissivity = 0.84, + double frontIRTransmittance = 0.0, + double backEmissivity = 0.84, + double backIRTransmittance = 0.0); + static std::shared_ptr gap(double thickness, double pressure = 101325); static std::shared_ptr gap(double thickness, const Gases::CGas & gas, double pressure = 101325); diff --git a/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingSealedVentilation.unit.cpp b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingSealedVentilation.unit.cpp new file mode 100644 index 00000000..58acec78 --- /dev/null +++ b/src/Tarcog/tst/units/GapBetweenIrradiatedGlassAndInteriorShadingSealedVentilation.unit.cpp @@ -0,0 +1,195 @@ +#include +#include + +#include "WCETarcog.hpp" + +using Tarcog::ISO15099::CIGUSolidLayer; +using Tarcog::ISO15099::CIGUGapLayer; +using Tarcog::ISO15099::CSingleSystem; + +class TestGapBetweenIrradiatedGlassAndInteriorShadingSealedVentilation : public testing::Test +{ +private: + std::unique_ptr m_TarcogSystem; + +protected: + void SetUp() override + { + ///////////////////////////////////////////////////////// + // Outdoor + ///////////////////////////////////////////////////////// + + auto outdoorAirTemperature = 298.15; // Kelvins + auto outdoorAirSpeed = 2.75; // meters per second + auto tSky = outdoorAirTemperature; // Kelvins + auto solarRadiation = 1000.0; + auto Outdoor = Tarcog::ISO15099::Environments::outdoor( + outdoorAirTemperature, outdoorAirSpeed, solarRadiation, tSky, Tarcog::ISO15099::SkyModel::AllSpecified); + ASSERT_TRUE(Outdoor != nullptr); + Outdoor->setHCoeffModel(Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH); + + ///////////////////////////////////////////////////////// + /// Indoor + ///////////////////////////////////////////////////////// + + auto roomTemperature = 298.15; + auto Indoor = Tarcog::ISO15099::Environments::indoor(roomTemperature); + ASSERT_TRUE(Indoor != nullptr); + + ///////////////////////////////////////////////////////// + /// IGU + ///////////////////////////////////////////////////////// + + auto windowWidth = 1.0; + auto windowHeight = 1.0; + + const auto solidLayerThickness = 0.003048; // [m] + const auto solidLayerConductance = 1.0; + auto solidLayer = + Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance); + solidLayer->setSolarAbsorptance(0.04, solarRadiation); + ASSERT_TRUE(solidLayer != nullptr); + + auto gapThickness = 0.05; + auto gapLayer = Tarcog::ISO15099::Layers::gap(gapThickness); + ASSERT_TRUE(gapLayer != nullptr); + + auto shadeLayerConductance = 0.12; + // make cell geometry + const auto thickness_31111{0.00023}; + const auto x = 0.00169; // m + const auto y = 0.00169; // m + const auto radius = 0.00058; // m + const auto CellDimension{ + ThermalPermeability::Perforated::diameterToXYDimension(2 * radius)}; + const auto frontOpenness{ThermalPermeability::Perforated::openness( + ThermalPermeability::Perforated::Geometry::Circular, + x, + y, + CellDimension.x, + CellDimension.y)}; + const auto dl{0.0}; + const auto dr{0.0}; + const auto dtop{0.0}; + const auto dbot{0.0}; + EffectiveLayers::ShadeOpenness openness{frontOpenness, dl, dr, dtop, dbot}; + EffectiveLayers::EffectiveLayerPerforated effectiveLayerPerforated{ + windowWidth, windowHeight, thickness_31111, openness}; + EffectiveLayers::EffectiveOpenness effOpenness{ + effectiveLayerPerforated.getEffectiveOpenness()}; + const auto effectiveThickness{effectiveLayerPerforated.effectiveThickness()}; + auto Ef = 0.640892; + auto Eb = 0.623812; + auto Tirf = 0.257367; + auto Tirb = 0.257367; + auto shadeLayer = Tarcog::ISO15099::Layers::sealedLayer( + effectiveThickness, shadeLayerConductance, Ef, Tirf, Eb, Tirb); + shadeLayer->setSolarAbsorptance(0.35, solarRadiation); + ASSERT_TRUE(shadeLayer != nullptr); + + Tarcog::ISO15099::CIGU aIGU(windowWidth, windowHeight); + aIGU.addLayers({solidLayer, gapLayer, shadeLayer}); + + ///////////////////////////////////////////////////////// + /// System + ///////////////////////////////////////////////////////// + + m_TarcogSystem = std::make_unique(aIGU, Indoor, Outdoor); + ASSERT_TRUE(m_TarcogSystem != nullptr); + + m_TarcogSystem->solve(); + } + +public: + [[nodiscard]] CIGUSolidLayer * GetFirstLayer() const + { + return m_TarcogSystem->getSolidLayers()[0].get(); + }; + + [[nodiscard]] CIGUGapLayer * GetGap() const + { + return m_TarcogSystem->getGapLayers()[0].get(); + }; + + [[nodiscard]] CIGUSolidLayer * GetSecondLayer() const + { + return m_TarcogSystem->getSolidLayers()[1].get(); + }; +}; + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingSealedVentilation, GapLayerSurfaceIRFlow) +{ + SCOPED_TRACE("Begin Test: Test gap layer surface temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Front); + auto backIRRadiationFlow = aLayer->J(FenestrationCommon::Side::Back); + EXPECT_NEAR(511.76877214318495, frontIRRadiationFlow, 1e-4); + EXPECT_NEAR(582.30303134960764, backIRRadiationFlow, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingSealedVentilation, GainEnergy) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gain Energy"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto gainEnergy = aLayer->getGainFlow(); + EXPECT_NEAR(-0.0096361494942099352, gainEnergy, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingSealedVentilation, FirstLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Solid Temperatures"); + + auto aLayer = GetFirstLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(305.77946516003101, frontTemperature, 1e-4); + EXPECT_NEAR(306.1893205312183, backTemperature, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingSealedVentilation, GapTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Gap Temperatures"); + + auto aLayer = GetGap(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + auto layerTemperature = aLayer->layerTemperature(); + auto averageTemperature = aLayer->averageTemperature(); + EXPECT_NEAR(306.1893205312183, frontTemperature, 1e-4); + EXPECT_NEAR(326.89421715622797, backTemperature, 1e-4); + EXPECT_NEAR(316.54063362165442, layerTemperature, 1e-4); + EXPECT_NEAR(316.54176884372316, averageTemperature, 1e-4); +} + +TEST_F(TestGapBetweenIrradiatedGlassAndInteriorShadingSealedVentilation, SecondLayerSurfaceTemperatures) +{ + SCOPED_TRACE("Begin Test: Test Forced Ventilated Gap Layer At Edge - Shade Temperatures"); + + auto aLayer = GetSecondLayer(); + + // Airflow iterations are set to 1e-4 and it cannot exceed that precision + + ASSERT_TRUE(aLayer != nullptr); + auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front); + auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back); + EXPECT_NEAR(326.89421715622797, frontTemperature, 1e-4); + EXPECT_NEAR(326.80965945509263, backTemperature, 1e-4); +}