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

Update to shading airflow coefficients feb2022 #9314

Merged
merged 8 commits into from
Mar 21, 2022
8 changes: 4 additions & 4 deletions src/EnergyPlus/TARCOGParams.hh
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ Real64 constexpr C2_VENET_VERTICAL(0.000);
Real64 constexpr C3_VENET_VERTICAL(0.270);
Real64 constexpr C4_VENET_VERTICAL(0.012);

Real64 constexpr C1_SHADE(0.05);
Real64 constexpr C2_SHADE(1.08);
Real64 constexpr C3_SHADE(0.79);
Real64 constexpr C4_SHADE(0.50);
Real64 constexpr C1_SHADE(0.078);
Real64 constexpr C2_SHADE(1.2);
Real64 constexpr C3_SHADE(1.0);
Real64 constexpr C4_SHADE(1.0);

} // namespace EnergyPlus::TARCOGParams

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ TEST_F(TestSpecularLayer_102, TestSpecularDualBandSingleLayer1)
{
SCOPED_TRACE("Begin Test: Scattering Specular Layer with Dual Band Material.");

const auto thickness = 3.048e-3; // [m]
const auto TfSolar{0.6};
const auto TbSolar{0.6};
const auto RfSolar{0.074764};
Expand Down
4 changes: 4 additions & 0 deletions third_party/Windows-CalcEngine/src/Tarcog/src/BaseLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ namespace Tarcog
return 0;
}

bool CBaseLayer::isPermeable() const
{
return false;
}
} // namespace ISO15099

} // namespace Tarcog
4 changes: 4 additions & 0 deletions third_party/Windows-CalcEngine/src/Tarcog/src/BaseLayer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ namespace Tarcog

virtual double getThickness() const;

// This is to determine if layer is porous and leaking air from gap to the surrounding
// environment. Layer are non-porous by default.
virtual bool isPermeable() const;

virtual std::shared_ptr<CBaseLayer> clone() const = 0;

protected:
Expand Down
10 changes: 10 additions & 0 deletions third_party/Windows-CalcEngine/src/Tarcog/src/BaseShade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ namespace Tarcog
return m_FrontPorosity;
}

bool CShadeOpenings::isOpen() const
{
return m_Abot > 0 || m_Atop > 0 || m_Aleft > 0 || m_Aright > 0 || m_Afront > 0;
}

////////////////////////////////////////////////////////////////////////////////////////////////
/// CIGUShadeLayer
////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -112,6 +117,11 @@ namespace Tarcog
return std::make_shared<CIGUShadeLayer>(*this);
}

bool CIGUShadeLayer::isPermeable() const
{
return m_ShadeOpenings->isOpen();
}

void CIGUShadeLayer::calculateConvectionOrConductionFlow()
{
m_Conductivity =
Expand Down
6 changes: 5 additions & 1 deletion third_party/Windows-CalcEngine/src/Tarcog/src/BaseShade.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ namespace Tarcog
double Aeq_bot();
double Aeq_top();

double frontPorositiy() const;
[[nodiscard]] double frontPorositiy() const;

[[nodiscard]] bool isOpen() const;

private:
void initialize();
Expand Down Expand Up @@ -66,6 +68,8 @@ namespace Tarcog

std::shared_ptr<CBaseLayer> clone() const override;

bool isPermeable() const override;

private:
void calculateConvectionOrConductionFlow() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ namespace EffectiveLayers
double height,
double thickness,
const ShadeOpenness & openness) :
EffectiveLayer(width, height, thickness, openness, {0.05, 1.08, 0.79, 0.50})
EffectiveLayer(width, height, thickness, openness, {0.078, 1.2, 1.0, 1.0})
{}

EffectiveOpenness EffectiveLayerType1::getEffectiveOpenness()
Expand Down
26 changes: 19 additions & 7 deletions third_party/Windows-CalcEngine/src/Tarcog/src/IGU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ namespace Tarcog

if(t_IGU.m_DeflectionFromE1300Curves != nullptr)
{
m_DeflectionFromE1300Curves = std::make_unique<Deflection::DeflectionE1300>(*t_IGU.m_DeflectionFromE1300Curves);
m_DeflectionFromE1300Curves =
std::make_unique<Deflection::DeflectionE1300>(*t_IGU.m_DeflectionFromE1300Curves);
}

return *this;
Expand Down Expand Up @@ -260,7 +261,6 @@ namespace Tarcog

std::vector<double> CIGU::getPanesLoad() const
{

std::vector<double> paneLoad(getSolidLayers().size());

if(m_DeflectionFromE1300Curves != nullptr)
Expand Down Expand Up @@ -310,9 +310,19 @@ namespace Tarcog
auto result{0.0};
if(size > 1u)
{
std::map<Environment, size_t> envLayer = {{Environment::Indoor, size - 2},
{Environment::Outdoor, 1}};
result = m_Layers[envLayer.at(t_Environment)]->getGainFlow();
// This is important in order to get correct gap numbering. It will return the gap
// that is connected with the environment.
const std::map<Environment, size_t> envLayer = {{Environment::Indoor, size - 2},
{Environment::Outdoor, 1}};

// Need to make sure that solid layer is actually permeable as well
const std::map<Environment, size_t> solidLayerIndex = {{Environment::Indoor, size - 1},
{Environment::Outdoor, 0}};

if(m_Layers[solidLayerIndex.at(t_Environment)]->isPermeable())
{
result = m_Layers[envLayer.at(t_Environment)]->getGainFlow();
}
}
return result;
}
Expand Down Expand Up @@ -348,7 +358,8 @@ namespace Tarcog
std::vector<Deflection::LayerData> layerData;
for(const auto & layer : getSolidLayers())
{
layerData.emplace_back(layer->getThickness(), layer->density(), layer->youngsModulus());
layerData.emplace_back(
layer->getThickness(), layer->density(), layer->youngsModulus());
}

std::vector<Deflection::GapData> gapData;
Expand Down Expand Up @@ -476,7 +487,8 @@ namespace Tarcog

auto deflectionResults{m_DeflectionFromE1300Curves->results()};

// This is borrowed from Timschenko. It will be used till E1300 calculations are actually doing this.
// This is borrowed from Timschenko. It will be used till E1300 calculations are
// actually doing this.
const auto deflectionRatio = Ldmean() / Ldmax();

auto solidLayers{getSolidLayers()};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,23 +91,23 @@ class DoubleIGU_With_TIR_and_Openness : public testing::Test
}

public:
std::shared_ptr<Tarcog::ISO15099::CSingleSystem> getSystem() const
[[nodiscard]] std::shared_ptr<Tarcog::ISO15099::CSingleSystem> getSystem() const
{
return m_TarcogSystem;
};
}
};

TEST_F(DoubleIGU_With_TIR_and_Openness, Test1)
{
SCOPED_TRACE("Begin Test: Outdoor Shade - Air");

auto aSystem = getSystem();
const auto aSystem = getSystem();

auto temperature = aSystem->getTemperatures();
auto radiosity = aSystem->getRadiosities();
const auto temperature = aSystem->getTemperatures();
const auto radiosity = aSystem->getRadiosities();

std::vector<double> correctTemp = {259.333390, 259.706267, 279.738283, 280.415196};
std::vector<double> correctJ = {253.860589, 272.423758, 348.553579, 349.022496};
const std::vector correctTemp{259.350462, 259.724865, 279.767733, 280.443187};
const std::vector correctJ{253.917317, 272.505694, 348.677765, 349.142912};

EXPECT_EQ(correctTemp.size(), temperature.size());
EXPECT_EQ(correctJ.size(), radiosity.size());
Expand All @@ -121,9 +121,12 @@ TEST_F(DoubleIGU_With_TIR_and_Openness, Test1)
const auto numOfIter = aSystem->getNumberOfIterations();
EXPECT_EQ(20, int(numOfIter));

const auto ventilatedFlow = aSystem->getVentilationFlow(Tarcog::ISO15099::Environment::Outdoor);
EXPECT_NEAR(8.433710, ventilatedFlow, 1e-6);
const auto ventilatedFlowOutdoor = aSystem->getVentilationFlow(Tarcog::ISO15099::Environment::Outdoor);
EXPECT_NEAR(0.0, ventilatedFlowOutdoor, 1e-6);

const auto ventilatedFlowIndoor = aSystem->getVentilationFlow(Tarcog::ISO15099::Environment::Indoor);
EXPECT_NEAR(9.152949, ventilatedFlowIndoor, 1e-6);

const auto uValue = aSystem->getUValue();
EXPECT_NEAR(3.136796, uValue, 1e-6);
EXPECT_NEAR(3.149632, uValue, 1e-6);
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,25 +91,23 @@ class DoubleIGU_With_TIR_and_Openness_SHGC : public testing::Test
}

public:
std::shared_ptr<Tarcog::ISO15099::CSystem> getSystem() const
[[nodiscard]] std::shared_ptr<Tarcog::ISO15099::CSystem> getSystem() const
{
return m_TarcogSystem;
};
}
};

TEST_F(DoubleIGU_With_TIR_and_Openness_SHGC, Test1)
{
SCOPED_TRACE("Begin Test: Indoor Shade");

auto aSystem = getSystem();
const auto aSystem = getSystem();

auto temperature = aSystem->getTemperatures(Tarcog::ISO15099::System::SHGC);
auto radiosity = aSystem->getRadiosities(Tarcog::ISO15099::System::SHGC);
const auto temperature = aSystem->getTemperatures(Tarcog::ISO15099::System::SHGC);
const auto radiosity = aSystem->getRadiosities(Tarcog::ISO15099::System::SHGC);

std::vector<double> correctTemp = {
311.16511198886826, 311.35084358843835, 312.56143334708418, 312.18578373706208};
std::vector<double> correctJ = {
525.13728201703634, 532.26392522289359, 529.47497000248063, 528.72274402817823};
const std::vector correctTemp{311.156776, 311.341981, 312.547758, 312.172916};
const std::vector correctJ{525.089442, 532.199938, 529.393517, 528.645065};

EXPECT_EQ(correctTemp.size(), temperature.size());
EXPECT_EQ(correctJ.size(), radiosity.size());
Expand All @@ -121,12 +119,12 @@ TEST_F(DoubleIGU_With_TIR_and_Openness_SHGC, Test1)
}

const auto numOfIter = aSystem->getNumberOfIterations(Tarcog::ISO15099::System::SHGC);
EXPECT_EQ(1, int(numOfIter));
EXPECT_EQ(1u, numOfIter);

const auto uValue = aSystem->getUValue();
EXPECT_NEAR(3.2151172563457391, uValue, 1e-6);
EXPECT_NEAR(3.219847, uValue, 1e-6);

const auto Ttot_sol{0.119033947587};
const auto shgc = aSystem->getSHGC(Ttot_sol);
EXPECT_NEAR(0.25575797028047931, shgc, 1e-6);
EXPECT_NEAR(0.255930, shgc, 1e-6);
}
Loading