Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create more examples of gaps with forced ventilation #5

Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
90c7688
Copy example GapLayerAtEdgeForcedVentilationInsideAir.unit.cpp and re…
christoph-maurer Jan 5, 2023
840aae7
Rename the class `TestGapLayerAtEdgeForcedVentilationOutsideAir` to `…
christoph-maurer Jan 18, 2023
6c5799f
The results of the new test indicate that the shading has zero absorp…
christoph-maurer Jan 18, 2023
c748a12
Fail to add absorptance as in DoubleOutsidePerforatedShade_SHGC.unit.…
christoph-maurer Jan 18, 2023
6dd4746
Do not upgrade gap layers that already are ventilated
simon-wacker Jan 19, 2023
7ba05b8
Remove unused includes
simon-wacker Jan 19, 2023
885d09b
Use `CSingleSystem` as `m_TarcogSystem`
simon-wacker Jan 19, 2023
1f1f6c1
Declare missing air temperature variable
simon-wacker Jan 19, 2023
1687b3a
Assert non-nullness of shade layer
simon-wacker Jan 19, 2023
a77ff0b
Solve the system at end of test set-up
simon-wacker Jan 19, 2023
e915396
Give variables more readable and expressive names
simon-wacker Jan 19, 2023
cf4de18
Correct expected numbers
simon-wacker Jan 19, 2023
ec900e5
Correct expected ventilated flow in `DoubleClarIndoorShadeAir` tests
simon-wacker Jan 19, 2023
3c66501
Merge pull request #6 from ise-bipv/fix-outside-air-test
christoph-maurer Jan 23, 2023
0186920
Create three test cases for validation with the software Winther
christoph-maurer Jan 24, 2023
0acb5e3
Create tests for interior screen with varying height and mass flow of…
christoph-maurer Jan 25, 2023
c750c4e
Rename the validation tests to make them more consistend with the oth…
christoph-maurer Jan 25, 2023
8685f9d
Finish renaming the 8 tests for validation and explanation
christoph-maurer Jan 26, 2023
cdfaf88
Use new lines consistently in the blocks of the 8 new tests
christoph-maurer Jan 26, 2023
d0e7cc8
Add test with exterior shading and forced convection with roomTempera…
christoph-maurer Jan 26, 2023
03a1d55
Add tests to compare zero forced convection with the natural convecti…
christoph-maurer Jan 26, 2023
b78d795
Start test with 2 glass panes and 1 shading in between, but the test …
christoph-maurer Jan 26, 2023
1d5827e
Fix test GapBetweenIrradiatedGlassPanesWithIntegratedShadingForcedVen…
christoph-maurer Jan 31, 2023
180b857
Add getters for inlet and outlet temperatures
simon-wacker Feb 1, 2023
e59d39a
Merge pull request #7 from ise-bipv/add-getters-for-inlet-and-oulet-t…
christoph-maurer Feb 2, 2023
723c4ed
Add example with very thick glass to calculate the external and inter…
christoph-maurer Feb 3, 2023
0a0fef4
Fail to print the indoor radiative heat transfer coefficient
christoph-maurer Mar 14, 2023
49a8407
No error message anymore, but no results neither.
christoph-maurer Mar 14, 2023
c9a2ea4
The heat transfer coefficients of the summer validation look fine
christoph-maurer Mar 15, 2023
83c4540
Test the heat transfer coefficients of all three validation cases
christoph-maurer Mar 15, 2023
1131b07
Merge pull request #8 from ise-bipv/print-heat-transfer-coefficients
christoph-maurer Mar 15, 2023
4f96c01
Describe when the is used
christoph-maurer Mar 15, 2023
43c36f4
Add old test from Windows-CalcEngine
christoph-maurer Mar 21, 2023
af0f0be
Remove the tests which are replaced by the tests `GapBetween*`
christoph-maurer Mar 21, 2023
1167e31
Correct expected values
simon-wacker Mar 21, 2023
25815c7
Add test with naturally ventilated and sealed gap to cross validate t…
simon-wacker Mar 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*.res
*.so
*.so.*
*.vscode*
*~
.directory
.DS_Store
Expand Down
7 changes: 5 additions & 2 deletions src/Tarcog/src/IGU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,9 @@ namespace Tarcog
{
if(std::dynamic_pointer_cast<CIGUShadeLayer>(t_Layer) != nullptr)
{
if(std::dynamic_pointer_cast<CIGUGapLayer>(t_Layer->getPreviousLayer()) != nullptr)
if(std::dynamic_pointer_cast<CIGUGapLayer>(t_Layer->getPreviousLayer()) != nullptr
&& std::dynamic_pointer_cast<CIGUVentilatedGapLayer>(t_Layer->getPreviousLayer())
== nullptr)
{
auto newLayer = std::make_shared<CIGUVentilatedGapLayer>(
std::dynamic_pointer_cast<CIGUGapLayer>(t_Layer->getPreviousLayer()));
Expand All @@ -532,7 +534,8 @@ namespace Tarcog
newLayer);
}
}
if(std::dynamic_pointer_cast<CIGUGapLayer>(t_Layer) != nullptr)
if(std::dynamic_pointer_cast<CIGUGapLayer>(t_Layer) != nullptr
&& std::dynamic_pointer_cast<CIGUVentilatedGapLayer>(t_Layer) == nullptr)
{
if(std::dynamic_pointer_cast<CIGUShadeLayer>(t_Layer->getPreviousLayer())
!= nullptr)
Expand Down
2 changes: 1 addition & 1 deletion src/Tarcog/tst/units/DoubleClearIndoorShadeAir.unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
#include <memory>
#include <gtest/gtest.h>

#include "WCETarcog.hpp"

using Tarcog::ISO15099::CIGUSolidLayer;
using Tarcog::ISO15099::CIGUGapLayer;
using Tarcog::ISO15099::CSingleSystem;

class TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation : public testing::Test
{
private:
std::unique_ptr<CSingleSystem> 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<CSingleSystem>(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(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, 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(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, 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(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, 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(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, 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(TestGapBetweenDarkGlassPanesForcedVentilationInsideAirWinterValidation, 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);
}
Loading