Skip to content

Commit

Permalink
Call solve on the Tarcog system after setting it up to calculate la…
Browse files Browse the repository at this point in the history
…yer values like their temperatures, remove air-flow direction from forced ventilation as it does not matter, use the environment temperature as inlet temperature for at-edge gaps with forced ventilation and the gap temperature as out temperature, use about 10% absorptance for galsses and about 70% for shades, and adjust the expected values in tests accordingly
  • Loading branch information
simon-wacker committed Nov 11, 2022
1 parent 4bda8f0 commit 7dc4422
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 80 deletions.
21 changes: 12 additions & 9 deletions src/Tarcog/src/BaseShade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,19 +331,22 @@ namespace Tarcog
TgapOut = alpha * TavGap + beta * tempEnvironment;

AirVerticalDirection gapDirection = AirVerticalDirection::None;
if(TgapOut > tempEnvironment)
if(t_Gap->isVentilationForced())
{
gapDirection = t_Gap->isVentilationForced()
? forcedVentilation.VerticalDirection
: AirVerticalDirection::Up;
t_Gap->setFlowTemperatures(TgapOut, tempEnvironment, gapDirection);
t_Gap->setFlowTemperatures(tempEnvironment, TgapOut);
}
else
{
gapDirection = t_Gap->isVentilationForced()
? forcedVentilation.VerticalDirection
: AirVerticalDirection::Down;
t_Gap->setFlowTemperatures(tempEnvironment, TgapOut, gapDirection);
if(TgapOut > tempEnvironment)
{
gapDirection = AirVerticalDirection::Up;
t_Gap->setFlowTemperatures(TgapOut, tempEnvironment, gapDirection);
}
else
{
gapDirection = AirVerticalDirection::Down;
t_Gap->setFlowTemperatures(tempEnvironment, TgapOut, gapDirection);
}
}

tempGap = t_Gap->layerTemperature();
Expand Down
8 changes: 8 additions & 0 deletions src/Tarcog/src/IGUVentilatedGapLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ namespace Tarcog
resetCalculated();
}

void CIGUVentilatedGapLayer::setFlowTemperatures(double t_inTemperature,
double t_outTemperature)
{
m_inTemperature = t_inTemperature;
m_outTemperature = t_outTemperature;
resetCalculated();
}

void CIGUVentilatedGapLayer::setFlowSpeed(double const t_speed)
{
m_AirSpeed = t_speed;
Expand Down
1 change: 1 addition & 0 deletions src/Tarcog/src/IGUVentilatedGapLayer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ namespace Tarcog
void setFlowTemperatures(double t_topTemp,
double t_botTemp,
const AirVerticalDirection & t_Direction);
void setFlowTemperatures(double t_inTemperature, double t_outTemperature);
void setFlowSpeed(double t_speed);

double getAirflowReferencePoint(double t_GapTemperature);
Expand Down
7 changes: 2 additions & 5 deletions src/Tarcog/src/LayerInterfaces.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,11 @@ namespace Tarcog

struct ForcedVentilation
{
ForcedVentilation() : Speed(0), VerticalDirection(AirVerticalDirection::None){};
ForcedVentilation() : Speed(0){};

ForcedVentilation(const double t_Speed,
const AirVerticalDirection t_VerticalDirection) :
Speed(t_Speed), VerticalDirection(t_VerticalDirection){};
ForcedVentilation(const double t_Speed) : Speed(t_Speed){};

double Speed;
AirVerticalDirection VerticalDirection;
};

class CLayerGeometry : public virtual FenestrationCommon::CState
Expand Down
25 changes: 13 additions & 12 deletions src/Tarcog/tst/units/GapLayerAtEdgeForcedVentilation.unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ class TestGapLayerAtEdgeForcedVentilation : public testing::Test

auto gapThickness = 0.0127;
auto gapAirSpeed = 0.5;
auto gapVerticalDirection = Tarcog::ISO15099::AirVerticalDirection::Up;
Tarcog::ISO15099::ForcedVentilation forcedVentilation = {gapAirSpeed, gapVerticalDirection};
Tarcog::ISO15099::ForcedVentilation forcedVentilation = {gapAirSpeed};
auto gap = Tarcog::ISO15099::Layers::forcedVentilationGap(gapThickness, forcedVentilation);
ASSERT_TRUE(gap != nullptr);

Expand All @@ -78,6 +77,8 @@ class TestGapLayerAtEdgeForcedVentilation : public testing::Test
/////////////////////////////////////////////////////////
m_TarcogSystem = std::make_shared<Tarcog::ISO15099::CSingleSystem>(aIGU, Indoor, Outdoor);
ASSERT_TRUE(m_TarcogSystem != nullptr);

m_TarcogSystem->solve();
}

public:
Expand Down Expand Up @@ -116,7 +117,7 @@ TEST_F(TestGapLayerAtEdgeForcedVentilation, GainEnergy)

ASSERT_TRUE(aLayer != nullptr);
auto gainEnergy = aLayer->getGainFlow();
EXPECT_NEAR(-173.19394352133912, gainEnergy, 1e-4);
EXPECT_NEAR(131.54792253693392, gainEnergy, 1e-4);
}

TEST_F(TestGapLayerAtEdgeForcedVentilation, SolidTemperatures)
Expand All @@ -130,8 +131,8 @@ TEST_F(TestGapLayerAtEdgeForcedVentilation, SolidTemperatures)
ASSERT_TRUE(aLayer != nullptr);
auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front);
auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back);
EXPECT_NEAR(256.16484206520363, frontTemperature, 1e-4);
EXPECT_NEAR(261.96466446784217, backTemperature, 1e-4);
EXPECT_NEAR(262.1681784128499, frontTemperature, 1e-4);
EXPECT_NEAR(263.34326181929191, backTemperature, 1e-4);
}

TEST_F(TestGapLayerAtEdgeForcedVentilation, GapTemperatures)
Expand All @@ -147,10 +148,10 @@ TEST_F(TestGapLayerAtEdgeForcedVentilation, GapTemperatures)
auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back);
auto layerTemperature = aLayer->layerTemperature();
auto averageTemperature = aLayer->averageTemperature();
EXPECT_NEAR(261.96466446784217, frontTemperature, 1e-4);
EXPECT_NEAR(274.85315869592796, backTemperature, 1e-4);
EXPECT_NEAR(268.40891158188504, layerTemperature, 1e-4);
EXPECT_NEAR(268.40891158188504, averageTemperature, 1e-4);
EXPECT_NEAR(263.34326181929191, frontTemperature, 1e-4);
EXPECT_NEAR(284.92247564626859, backTemperature, 1e-4);
EXPECT_NEAR(284.76940122170021, layerTemperature, 1e-4);
EXPECT_NEAR(274.13286873278025, averageTemperature, 1e-4);
}

TEST_F(TestGapLayerAtEdgeForcedVentilation, ShadeTemperatures)
Expand All @@ -164,8 +165,8 @@ TEST_F(TestGapLayerAtEdgeForcedVentilation, ShadeTemperatures)
ASSERT_TRUE(aLayer != nullptr);
auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front);
auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back);
EXPECT_NEAR(274.85315869592796, frontTemperature, 1e-4);
EXPECT_NEAR(285.00157934796397, backTemperature, 1e-4);
EXPECT_NEAR(284.92247564626859, frontTemperature, 1e-4);
EXPECT_NEAR(284.92826182710292, backTemperature, 1e-4);
}

TEST_F(TestGapLayerAtEdgeForcedVentilation, AirflowReferencePoint)
Expand All @@ -178,5 +179,5 @@ TEST_F(TestGapLayerAtEdgeForcedVentilation, AirflowReferencePoint)

ASSERT_TRUE(aLayer != nullptr);
auto airflowReferencePoint = aLayer->getAirflowReferencePoint(0.5);
EXPECT_NEAR(6911.7392493523666, airflowReferencePoint, 1e-4);
EXPECT_NEAR(6912.4803431270711, airflowReferencePoint, 1e-4);
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ class TestGapLayerAtEdgeForcedVentilationWithSolarRadiation : public testing::Te
// IGU
auto solidLayerThickness = 0.005715; // [m]
auto solidLayerConductance = 1.0;
auto solarAbsorptance = 0.194422408938;
auto solidLayerSolarAbsorptance = 0.094189159572;

auto solidLayer = Tarcog::ISO15099::Layers::solid(solidLayerThickness, solidLayerConductance);
solidLayer->setSolarAbsorptance(solarAbsorptance, solarRadiation);
solidLayer->setSolarAbsorptance(solidLayerSolarAbsorptance, solarRadiation);
ASSERT_TRUE(solidLayer != nullptr);

auto shadeLayerThickness = 0.01;
auto shadeLayerConductance = 160.0;
auto shadeLayerSolarAbsorptance = 0.687443971634;
auto Atop = 0.1;
auto Abot = 0.1;
auto Aleft = 0.1;
Expand All @@ -62,14 +63,13 @@ class TestGapLayerAtEdgeForcedVentilationWithSolarRadiation : public testing::Te

auto shadeLayer = Tarcog::ISO15099::Layers::shading(
shadeLayerThickness, shadeLayerConductance, effOpenness);
shadeLayer->setSolarAbsorptance(solarAbsorptance, solarRadiation);
shadeLayer->setSolarAbsorptance(shadeLayerSolarAbsorptance, solarRadiation);

ASSERT_TRUE(shadeLayer != nullptr);

auto gapThickness = 0.0127;
auto gapAirSpeed = 0.5;
auto gapVerticalDirection = Tarcog::ISO15099::AirVerticalDirection::Up;
Tarcog::ISO15099::ForcedVentilation forcedVentilation = {gapAirSpeed, gapVerticalDirection};
Tarcog::ISO15099::ForcedVentilation forcedVentilation = {gapAirSpeed};
auto gap = Tarcog::ISO15099::Layers::forcedVentilationGap(gapThickness, forcedVentilation);
ASSERT_TRUE(gap != nullptr);

Expand Down Expand Up @@ -126,7 +126,7 @@ TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiation, GainEnergy)

ASSERT_TRUE(aLayer != nullptr);
auto gainEnergy = aLayer->getGainFlow();
EXPECT_NEAR(-139.59481412256093, gainEnergy, 1e-4);
EXPECT_NEAR(16.449907386063828, gainEnergy, 1e-4);
}

TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiation, SolidTemperatures)
Expand All @@ -140,8 +140,8 @@ TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiation, SolidTemperatures)
ASSERT_TRUE(aLayer != nullptr);
auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front);
auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back);
EXPECT_NEAR(262.23621939132738, frontTemperature, 1e-4);
EXPECT_NEAR(263.03385493193178, backTemperature, 1e-4);
EXPECT_NEAR(268.85563831728786, frontTemperature, 1e-4);
EXPECT_NEAR(270.97231009255381, backTemperature, 1e-4);
}

TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiation, SolidRadiosities)
Expand All @@ -155,8 +155,8 @@ TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiation, SolidRadiosities)
ASSERT_TRUE(aLayer != nullptr);
auto frontRadiosity = aLayer->J(FenestrationCommon::Side::Front);
auto backRadiosity = aLayer->J(FenestrationCommon::Side::Back);
EXPECT_NEAR(263.66860454791521, frontRadiosity, 1e-4);
EXPECT_NEAR(285.40802497669085, backRadiosity, 1e-4);
EXPECT_NEAR(287.28456598343178, frontRadiosity, 1e-4);
EXPECT_NEAR(339.73558433006201, backRadiosity, 1e-4);
}

TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiation, GapTemperatures)
Expand All @@ -172,10 +172,10 @@ TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiation, GapTemperatures)
auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back);
auto layerTemperature = aLayer->layerTemperature();
auto averageTemperature = aLayer->averageTemperature();
EXPECT_NEAR(263.03385493193178, frontTemperature, 1e-4);
EXPECT_NEAR(284.79254238038499, backTemperature, 1e-4);
EXPECT_NEAR(262.70769813727009, layerTemperature, 1e-4);
EXPECT_NEAR(273.91319865615839, averageTemperature, 1e-4);
EXPECT_NEAR(270.97231009255381, frontTemperature, 1e-4);
EXPECT_NEAR(314.20685654711355, backTemperature, 1e-4);
EXPECT_NEAR(293.77207512587205, layerTemperature, 1e-4);
EXPECT_NEAR(292.58958331983365, averageTemperature, 1e-4);
}

TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiation, GapRadiosities)
Expand All @@ -189,8 +189,8 @@ TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiation, GapRadiosities)
ASSERT_TRUE(aLayer != nullptr);
auto frontRadiosity = aLayer->J(FenestrationCommon::Side::Front);
auto backRadiosity = aLayer->J(FenestrationCommon::Side::Back);
EXPECT_NEAR(285.40802497669085, frontRadiosity, 1e-4);
EXPECT_NEAR(358.96053800492643, backRadiosity, 1e-4);
EXPECT_NEAR(339.73558433006201, frontRadiosity, 1e-4);
EXPECT_NEAR(518.55433901363858, backRadiosity, 1e-4);
}

TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiation, ShadeTemperatures)
Expand All @@ -204,8 +204,8 @@ TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiation, ShadeTemperatures)
ASSERT_TRUE(aLayer != nullptr);
auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front);
auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back);
EXPECT_NEAR(284.79254238038499, frontTemperature, 1e-4);
EXPECT_NEAR(284.80371912441331, backTemperature, 1e-4);
EXPECT_NEAR(314.20685654711355, frontTemperature, 1e-4);
EXPECT_NEAR(314.21313360489381, backTemperature, 1e-4);
}

TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiation, ShadeRadiosities)
Expand All @@ -219,8 +219,8 @@ TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiation, ShadeRadiosities)
ASSERT_TRUE(aLayer != nullptr);
auto frontRadiosity = aLayer->J(FenestrationCommon::Side::Front);
auto backRadiosity = aLayer->J(FenestrationCommon::Side::Back);
EXPECT_NEAR(358.96053800492643, frontRadiosity, 1e-4);
EXPECT_NEAR(382.18607905779663, backRadiosity, 1e-4);
EXPECT_NEAR(518.55433901363858, frontRadiosity, 1e-4);
EXPECT_NEAR(533.07538128082308, backRadiosity, 1e-4);
}

TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiation, AirflowReferencePoint)
Expand All @@ -233,7 +233,7 @@ TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiation, AirflowReferencePo

ASSERT_TRUE(aLayer != nullptr);
auto airflowReferencePoint = aLayer->getAirflowReferencePoint(0.5);
EXPECT_NEAR(6911.4593095243026, airflowReferencePoint, 1e-4);
EXPECT_NEAR(6912.8529362264735, airflowReferencePoint, 1e-4);
}

TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiation, IndoorHeatFlow)
Expand All @@ -246,7 +246,7 @@ TEST_F(TestGapLayerAtEdgeForcedVentilationWithSolarRadiation, IndoorHeatFlow)
auto radiativeHF = aSystem->getRadiationHeatFlow(Tarcog::ISO15099::Environment::Indoor);
auto totalHF = aSystem->getHeatFlow(Tarcog::ISO15099::Environment::Indoor);

EXPECT_NEAR(26.945883008974519, convectiveHF, 1e-5);
EXPECT_NEAR(48.074175638495092, radiativeHF, 1e-5);
EXPECT_NEAR(75.020058647469611, totalHF, 1e-5);
EXPECT_NEAR(-57.440502097412043, convectiveHF, 1e-5);
EXPECT_NEAR(-102.81512658453136, radiativeHF, 1e-5);
EXPECT_NEAR(-160.25562868194339, totalHF, 1e-5);
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ class TestGapLayerAtEdgeForcedVentilationWithZeroAirSpeed : public testing::Test

auto gapThickness = 0.0127;
auto gapAirSpeed = 0.0;
auto gapVerticalDirection = Tarcog::ISO15099::AirVerticalDirection::Up;
Tarcog::ISO15099::ForcedVentilation forcedVentilation = {gapAirSpeed, gapVerticalDirection};
Tarcog::ISO15099::ForcedVentilation forcedVentilation = {gapAirSpeed};
auto gap = Tarcog::ISO15099::Layers::forcedVentilationGap(gapThickness, forcedVentilation);
ASSERT_TRUE(gap != nullptr);

Expand All @@ -78,6 +77,8 @@ class TestGapLayerAtEdgeForcedVentilationWithZeroAirSpeed : public testing::Test
/////////////////////////////////////////////////////////
m_TarcogSystem = std::make_shared<Tarcog::ISO15099::CSingleSystem>(aIGU, Indoor, Outdoor);
ASSERT_TRUE(m_TarcogSystem != nullptr);

m_TarcogSystem->solve();
}

public:
Expand Down Expand Up @@ -130,8 +131,8 @@ TEST_F(TestGapLayerAtEdgeForcedVentilationWithZeroAirSpeed, SolidTemperatures)
ASSERT_TRUE(aLayer != nullptr);
auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front);
auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back);
EXPECT_NEAR(256.16484206520363, frontTemperature, 1e-4);
EXPECT_NEAR(261.96466446784217, backTemperature, 1e-4);
EXPECT_NEAR(258.91110457502356, frontTemperature, 1e-4);
EXPECT_NEAR(259.53950291109692, backTemperature, 1e-4);
}

TEST_F(TestGapLayerAtEdgeForcedVentilationWithZeroAirSpeed, GapTemperatures)
Expand All @@ -147,10 +148,10 @@ TEST_F(TestGapLayerAtEdgeForcedVentilationWithZeroAirSpeed, GapTemperatures)
auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back);
auto layerTemperature = aLayer->layerTemperature();
auto averageTemperature = aLayer->averageTemperature();
EXPECT_NEAR(261.96466446784217, frontTemperature, 1e-4);
EXPECT_NEAR(274.85315869592796, backTemperature, 1e-4);
EXPECT_NEAR(268.40891158188504, layerTemperature, 1e-4);
EXPECT_NEAR(268.40891158188504, averageTemperature, 1e-4);
EXPECT_NEAR(259.53950291109692, frontTemperature, 1e-4);
EXPECT_NEAR(280.27229464776792, backTemperature, 1e-4);
EXPECT_NEAR(269.90589877943239, layerTemperature, 1e-4);
EXPECT_NEAR(269.90589877943239, averageTemperature, 1e-4);
}

TEST_F(TestGapLayerAtEdgeForcedVentilationWithZeroAirSpeed, ShadeTemperatures)
Expand All @@ -164,8 +165,8 @@ TEST_F(TestGapLayerAtEdgeForcedVentilationWithZeroAirSpeed, ShadeTemperatures)
ASSERT_TRUE(aLayer != nullptr);
auto frontTemperature = aLayer->getTemperature(FenestrationCommon::Side::Front);
auto backTemperature = aLayer->getTemperature(FenestrationCommon::Side::Back);
EXPECT_NEAR(274.85315869592796, frontTemperature, 1e-4);
EXPECT_NEAR(285.00157934796397, backTemperature, 1e-4);
EXPECT_NEAR(280.27229464776792, frontTemperature, 1e-4);
EXPECT_NEAR(280.28088462967912, backTemperature, 1e-4);
}

TEST_F(TestGapLayerAtEdgeForcedVentilationWithZeroAirSpeed, AirflowReferencePoint)
Expand All @@ -178,5 +179,5 @@ TEST_F(TestGapLayerAtEdgeForcedVentilationWithZeroAirSpeed, AirflowReferencePoin

ASSERT_TRUE(aLayer != nullptr);
auto airflowReferencePoint = aLayer->getAirflowReferencePoint(0.5);
EXPECT_NEAR(6911.7392493523666, airflowReferencePoint, 1e-4);
EXPECT_NEAR(6911.8107937942486, airflowReferencePoint, 1e-4);
}
Loading

0 comments on commit 7dc4422

Please sign in to comment.