Skip to content

Commit

Permalink
Added additional single layer systems to test
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenCzarnecki committed Dec 17, 2024
1 parent 278a7fd commit 1781192
Show file tree
Hide file tree
Showing 200 changed files with 10,838 additions and 8 deletions.
64 changes: 64 additions & 0 deletions test/1_layer_bsdf_xml_cgdb_14060.unit.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#include <memory>
#include <gtest/gtest.h>
#include <cstdlib>
#include <memory>
#include <iostream>
#include <filesystem>
#include <fstream>

#include "wincalc/wincalc.h"
#include "optical_calcs.h"
#include "util.h"
#include "convert_optics_parser.h"
#include "paths.h"


using namespace wincalc;
using namespace window_standards;

class Test_1_layer_bsdf_xml_cgdb_14060 : public testing::Test
{
protected:
std::shared_ptr<Glazing_System> glazing_system_u;
std::shared_ptr<Glazing_System> glazing_system_shgc;

virtual void SetUp()
{
std::filesystem::path shade_path(test_dir);
shade_path /= "products";
shade_path /= "cgdb_14060_Urban Loft River Stone.xml";

std::vector<OpticsParser::ProductData> parsed_products;
auto shade = OpticsParser::parseBSDFXMLFile(shade_path.string());
parsed_products.push_back(shade);

std::vector<std::shared_ptr<Tarcog::ISO15099::CIGUGapLayer>> gaps;

std::filesystem::path standard_path(test_dir);
standard_path /= "standards";
standard_path /= "W5_NFRC_2003.std";
Optical_Standard standard = load_optical_standard(standard_path.string());

auto bsdf_hemisphere =
SingleLayerOptics::BSDFHemisphere::create(SingleLayerOptics::BSDFBasis::Full);

glazing_system_u = std::make_shared<Glazing_System>(
standard, parsed_products, gaps, 1.0, 1.0, 90, nfrc_u_environments(), bsdf_hemisphere);
glazing_system_shgc = std::make_shared<Glazing_System>(
standard, parsed_products, gaps, 1.0, 1.0, 90, nfrc_shgc_environments(), bsdf_hemisphere);
}
};

TEST_F(Test_1_layer_bsdf_xml_cgdb_14060, Test_Optical)
{
test_optical_results("1_layer/bsdf_xml_cgdb_14060/full_basis", glazing_system_u, update_results);
}

TEST_F(Test_1_layer_bsdf_xml_cgdb_14060, Test_Thermal)
{
test_thermal_results("1_layer/bsdf_xml_cgdb_14060/full_basis", "thermal_U_Environment", glazing_system_u, update_results);
test_thermal_results("1_layer/bsdf_xml_cgdb_14060/full_basis", "thermal_SHGC_Environment", glazing_system_shgc, update_results);
}



Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
using namespace wincalc;
using namespace window_standards;

class Test_1_layer_nfrc_21467 : public testing::Test
class Test_1_layer_coated_nfrc_21467 : public testing::Test
{
protected:
std::shared_ptr<Glazing_System> glazing_system_u;
Expand Down Expand Up @@ -46,14 +46,14 @@ class Test_1_layer_nfrc_21467 : public testing::Test
};


TEST_F(Test_1_layer_nfrc_21467, Test_Thermal)
TEST_F(Test_1_layer_coated_nfrc_21467, Test_Thermal)
{
test_thermal_results("1_layer/nfrc_21467/default", "thermal_U_Environment", glazing_system_u, update_results);
test_thermal_results("1_layer/coated_nfrc_21467/default", "thermal_U_Environment", glazing_system_u, update_results);
test_thermal_results(
"1_layer/nfrc_21467/default", "thermal_SHGC_Environment", glazing_system_shgc, update_results);
"1_layer/coated_nfrc_21467/default", "thermal_SHGC_Environment", glazing_system_shgc, update_results);
}

TEST_F(Test_1_layer_nfrc_21467, Test_Optical)
TEST_F(Test_1_layer_coated_nfrc_21467, Test_Optical)
{
test_optical_results("1_layer/nfrc_21467/default", glazing_system_u, update_results);
test_optical_results("1_layer/coated_nfrc_21467/default", glazing_system_u, update_results);
}
75 changes: 75 additions & 0 deletions test/1_layer_genBSDF_pleated_shade_cgdb_24040.unit.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#include <memory>
#include <gtest/gtest.h>
#include <cstdlib>
#include <memory>
#include <iostream>
#include <filesystem>
#include <fstream>

#include "wincalc/wincalc.h"
#include "optical_calcs.h"
#include "util.h"
#include "convert_optics_parser.h"
#include "paths.h"


using namespace wincalc;
using namespace window_standards;


class Test_1_layer_genBSDF_cgdb_24040 : public testing::Test
{
protected:
std::shared_ptr<Glazing_System> glazing_system_u;
std::shared_ptr<Glazing_System> glazing_system_shgc;

virtual void SetUp()
{
std::filesystem::path product_path(test_dir);
product_path /= "products";
product_path /=
"CS03_genBSDF.xml"; //"cgdb_24040_Intigral_SL_Vanity_C000_White_Pleated_Shade_20mm_genBSDF.xml";

std::vector<OpticsParser::ProductData> products;
auto shade = OpticsParser::parseBSDFXMLFile(product_path.string());
products.push_back(shade);

std::vector<std::shared_ptr<Tarcog::ISO15099::CIGUGapLayer>> gaps;

std::filesystem::path standard_path(test_dir);
standard_path /= "standards";
standard_path /= "W5_NFRC_2003.std";
Optical_Standard standard = load_optical_standard(standard_path.string());

auto bsdf_hemisphere =
SingleLayerOptics::BSDFHemisphere::create(SingleLayerOptics::BSDFBasis::Full);

glazing_system_u = std::make_shared<Glazing_System>(
standard, products, gaps, 1.0, 1.0, 90, nfrc_u_environments(), bsdf_hemisphere);
glazing_system_shgc = std::make_shared<Glazing_System>(
standard, products, gaps, 1.0, 1.0, 90, nfrc_shgc_environments(), bsdf_hemisphere);
}
};

TEST_F(Test_1_layer_genBSDF_cgdb_24040, Test_Thermal)
{
// The genBSDF XML files do not have conductivity and so cannot generate thermal results
EXPECT_THROW(glazing_system_u->gap_layers_effective_conductivities(Tarcog::ISO15099::System::Uvalue), std::runtime_error);
EXPECT_THROW(glazing_system_u->gap_layers_effective_conductivities(Tarcog::ISO15099::System::SHGC), std::runtime_error);
EXPECT_THROW(glazing_system_u->layer_temperatures(Tarcog::ISO15099::System::Uvalue), std::runtime_error);
EXPECT_THROW(glazing_system_u->layer_temperatures(Tarcog::ISO15099::System::SHGC), std::runtime_error);
EXPECT_THROW(glazing_system_u->relative_heat_gain(), std::runtime_error);
EXPECT_THROW(glazing_system_u->shgc(), std::runtime_error);
EXPECT_THROW(glazing_system_u->u(), std::runtime_error);
EXPECT_THROW(glazing_system_u->solid_layers_effective_conductivities(Tarcog::ISO15099::System::Uvalue), std::runtime_error);
EXPECT_THROW(glazing_system_u->solid_layers_effective_conductivities(Tarcog::ISO15099::System::SHGC), std::runtime_error);
EXPECT_THROW(glazing_system_u->system_effective_conductivity(Tarcog::ISO15099::System::Uvalue), std::runtime_error);
EXPECT_THROW(glazing_system_u->system_effective_conductivity(Tarcog::ISO15099::System::SHGC), std::runtime_error);


}

TEST_F(Test_1_layer_genBSDF_cgdb_24040, Test_Optical)
{
test_optical_results("1_layer/genBSDF_cgdb_24040/full_basis", glazing_system_u, update_results);
}
61 changes: 61 additions & 0 deletions test/1_layer_venetian_cgdb_24000.unit.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#include <memory>
#include <gtest/gtest.h>
#include <cstdlib>
#include <memory>
#include <iostream>
#include <filesystem>
#include <fstream>

#include "wincalc/wincalc.h"
#include "optical_calcs.h"
#include "util.h"
#include "convert_optics_parser.h"
#include "paths.h"


using namespace wincalc;
using namespace window_standards;

class Test_1_layer_venetian_cgdb_24000 : public testing::Test
{
protected:
std::shared_ptr<Glazing_System> glazing_system_u;
std::shared_ptr<Glazing_System> glazing_system_shgc;

virtual void SetUp()
{
std::filesystem::path product_path(test_dir);
product_path /= "products";
product_path /= "cgdb_24000_Alabaster Venetian Blind Open (Intigral)_Alabaster_0_12.5.json";

std::vector<OpticsParser::ProductData> products;
auto product = OpticsParser::parseJSONFile(product_path.string());
products.push_back(product);

std::vector<std::shared_ptr<Tarcog::ISO15099::CIGUGapLayer>> gaps;

std::filesystem::path standard_path(test_dir);
standard_path /= "standards";
standard_path /= "W5_NFRC_2003.std";
Optical_Standard standard = load_optical_standard(standard_path.string());
auto bsdf_hemisphere =
SingleLayerOptics::BSDFHemisphere::create(SingleLayerOptics::BSDFBasis::Full);

glazing_system_u = std::make_shared<Glazing_System>(
standard, products, gaps, 1.0, 1.0, 90, nfrc_u_environments(), bsdf_hemisphere);
glazing_system_shgc = std::make_shared<Glazing_System>(
standard, products, gaps, 1.0, 1.0, 90, nfrc_shgc_environments(), bsdf_hemisphere);
}
};

TEST_F(Test_1_layer_venetian_cgdb_24000, Test_Thermal)
{
test_thermal_results("1_layer/venetian_cgdb_24000/full_basis", "thermal_U_Environment", glazing_system_u, update_results);
test_thermal_results(
"1_layer/venetian_cgdb_24000/full_basis", "thermal_SHGC_Environment", glazing_system_shgc, update_results);
}

TEST_F(Test_1_layer_venetian_cgdb_24000, Test_Optical)
{
test_optical_results("1_layer/venetian_cgdb_24000/full_basis", glazing_system_u, update_results);
}
61 changes: 61 additions & 0 deletions test/1_layer_venetian_cgdb_24001.unit.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#include <memory>
#include <gtest/gtest.h>
#include <cstdlib>
#include <memory>
#include <iostream>
#include <filesystem>
#include <fstream>

#include "wincalc/wincalc.h"
#include "optical_calcs.h"
#include "util.h"
#include "convert_optics_parser.h"
#include "paths.h"


using namespace wincalc;
using namespace window_standards;

class Test_1_layer_venetian_cgdb_24001 : public testing::Test
{
protected:
std::shared_ptr<Glazing_System> glazing_system_u;
std::shared_ptr<Glazing_System> glazing_system_shgc;

virtual void SetUp()
{
std::filesystem::path product_path(test_dir);
product_path /= "products";
product_path /= "cgdb_24001_Alabaster Venetian Blind Closed (Intigral)_Alabaster_+70_12.5.json";

std::vector<OpticsParser::ProductData> products;
auto product = OpticsParser::parseJSONFile(product_path.string());
products.push_back(product);

std::vector<std::shared_ptr<Tarcog::ISO15099::CIGUGapLayer>> gaps;

std::filesystem::path standard_path(test_dir);
standard_path /= "standards";
standard_path /= "W5_NFRC_2003.std";
Optical_Standard standard = load_optical_standard(standard_path.string());
auto bsdf_hemisphere =
SingleLayerOptics::BSDFHemisphere::create(SingleLayerOptics::BSDFBasis::Full);

glazing_system_u = std::make_shared<Glazing_System>(
standard, products, gaps, 1.0, 1.0, 90, nfrc_u_environments(), bsdf_hemisphere);
glazing_system_shgc = std::make_shared<Glazing_System>(
standard, products, gaps, 1.0, 1.0, 90, nfrc_shgc_environments(), bsdf_hemisphere);
}
};

TEST_F(Test_1_layer_venetian_cgdb_24001, Test_Thermal)
{
test_thermal_results("1_layer/venetian_cgdb_24001/full_basis", "thermal_U_Environment", glazing_system_u, update_results);
test_thermal_results(
"1_layer/venetian_cgdb_24001/full_basis", "thermal_SHGC_Environment", glazing_system_shgc, update_results);
}

TEST_F(Test_1_layer_venetian_cgdb_24001, Test_Optical)
{
test_optical_results("1_layer/venetian_cgdb_24001/full_basis", glazing_system_u, update_results);
}
61 changes: 61 additions & 0 deletions test/1_layer_venetian_cgdb_24002.unit.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#include <memory>
#include <gtest/gtest.h>
#include <cstdlib>
#include <memory>
#include <iostream>
#include <filesystem>
#include <fstream>

#include "wincalc/wincalc.h"
#include "optical_calcs.h"
#include "util.h"
#include "convert_optics_parser.h"
#include "paths.h"


using namespace wincalc;
using namespace window_standards;

class Test_1_layer_venetian_cgdb_24002 : public testing::Test
{
protected:
std::shared_ptr<Glazing_System> glazing_system_u;
std::shared_ptr<Glazing_System> glazing_system_shgc;

virtual void SetUp()
{
std::filesystem::path product_path(test_dir);
product_path /= "products";
product_path /= "cgdb_24002_Alabaster Venetian Blind +45 (Intigral)_Alabaster_+45_12.5.json";

std::vector<OpticsParser::ProductData> products;
auto product = OpticsParser::parseJSONFile(product_path.string());
products.push_back(product);

std::vector<std::shared_ptr<Tarcog::ISO15099::CIGUGapLayer>> gaps;

std::filesystem::path standard_path(test_dir);
standard_path /= "standards";
standard_path /= "W5_NFRC_2003.std";
Optical_Standard standard = load_optical_standard(standard_path.string());
auto bsdf_hemisphere =
SingleLayerOptics::BSDFHemisphere::create(SingleLayerOptics::BSDFBasis::Full);

glazing_system_u = std::make_shared<Glazing_System>(
standard, products, gaps, 1.0, 1.0, 90, nfrc_u_environments(), bsdf_hemisphere);
glazing_system_shgc = std::make_shared<Glazing_System>(
standard, products, gaps, 1.0, 1.0, 90, nfrc_shgc_environments(), bsdf_hemisphere);
}
};

TEST_F(Test_1_layer_venetian_cgdb_24002, Test_Thermal)
{
test_thermal_results("1_layer/venetian_cgdb_24002/full_basis", "thermal_U_Environment", glazing_system_u, update_results);
test_thermal_results(
"1_layer/venetian_cgdb_24002/full_basis", "thermal_SHGC_Environment", glazing_system_shgc, update_results);
}

TEST_F(Test_1_layer_venetian_cgdb_24002, Test_Optical)
{
test_optical_results("1_layer/venetian_cgdb_24002/full_basis", glazing_system_u, update_results);
}
9 changes: 7 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/googletest-src
EXCLUDE_FROM_ALL)

add_executable(${PROJECT_TEST_NAME}
1_layer_genBSDF_pleated_shade_cgdb_24040.unit.cpp
1_layer_bsdf_xml_cgdb_14060.unit.cpp
1_layer_bsdf_xml_cgdb_46016.unit.cpp
1_layer_venetian_cgdb_24000.unit.cpp
1_layer_venetian_cgdb_24001.unit.cpp
1_layer_venetian_cgdb_24002.unit.cpp
1_layer_nfrc_102.unit.cpp
1_layer_CS03_genBSDF.unit.cpp
1_layer_bsdf_xml_cgdb_46016.unit.cpp
1_layer_nfrc_102_as_bsdf.unit.cpp
1_layer_pv_generic.unit.cpp
1_layer_perforated_screen_cgdb_18000.unit.cpp
Expand All @@ -40,7 +45,7 @@ add_executable(${PROJECT_TEST_NAME}
1_layer_coated_nfrc_6046.unit.cpp
1_layer_applied_film_nfrc_9223.unit.cpp
1_layer_coated_nfrc_18100.unit.cpp
1_layer_nfrc_21467.unit.cpp
1_layer_coated_nfrc_21467.unit.cpp
1_layer_coated_nfrc_6400.cpp
2_layers_nfrc_102_air_nfrc_102_deflection_youngs_modulus.unit.cpp
2_layers_nfrc_102_air_nfrc_102_deflection_tilt.unit.cpp
Expand Down
Loading

0 comments on commit 1781192

Please sign in to comment.