Skip to content

Commit

Permalink
Merge pull request #48 from LBNL-ETA/VariableAirflowCoefficients
Browse files Browse the repository at this point in the history
Variable airflow coefficients
  • Loading branch information
vidanovic authored Jun 26, 2024
2 parents 7b7d32f + 06e0e3a commit 3853d31
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
matrix:
os: [windows-2019]
arch: [x86, x64]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]

steps:
- name: Checkout repository
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
# There is documentation here https://github.com/pypa/cibuildwheel/blob/main/docs/cpp_standards.md on how to
# set it but I could not get it to work while using the standard images provided by github actions does work.
os: [macos-latest]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
env:
SYSTEM_VERSION_COMPAT: 0

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists-WinCalc.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include(ExternalProject)

ExternalProject_Add(wincalc
GIT_REPOSITORY https://github.com/LBNL-ETA/WinCalc.git
GIT_TAG "VacuumDec2023"
GIT_TAG "VariableAirflowCoefficients"

UPDATE_COMMAND ""
PATCH_COMMAND ""
Expand Down
6 changes: 3 additions & 3 deletions pywincalc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
from wincalcbindings import AirHorizontalDirection, BSDF, BSDFBasisType, BSDFDirection, BSDFDirections, BSDFHemisphere, \
BSDFIntegrator, BoundaryConditionsCoefficientModelType, CMABestWorstUFactors, CMAResult, CMAWindow, \
CMAWindowDualVisionHorizontal, CMAWindowDualVisionVertical, CMAWindowSingleVision, CellSpacingType, PolygonType, pillar_cell_area, \
PillarData, CylindricalPillar, SphericalPillar, RectangularPillar, PolygonalPillar, LinearBearingPillar, TruncatedConePillar, Glass, PillarMeasurement, \
AnnulusCylinderPillar, UniversalSupportPillar, CylindricalPillarLayer, SphericalPillarLayer, RectangularPillarLayer, \
PillarData, CylindricalPillar, SphericalPillar, RectangularPillar, TriangularPillar, PentagonPillar, HexagonPillar, LinearBearingPillar, TruncatedConePillar, Glass, PillarMeasurement, \
AnnulusCylinderPillar, CShapedCylinderPillar, UniversalSupportPillar, CylindricalPillarLayer, SphericalPillarLayer, RectangularPillarLayer, \
TriangularPillarLayer, PentagonPillarLayer, HexagonPillarLayer, LinearBearingPillarLayer, TruncatedConePillarLayer, \
AnnulusCylinderPillarLayer, MeasuredPillarLayer, CoatedSide, \
AnnulusCylinderPillarLayer, CShapedCylinderPillarLayer, MeasuredPillarLayer, CoatedSide, \
ColorResult, DeflectionResults, DistributionMethodType, DualBandBSDF, EffectiveOpenness, Environment, Environments, \
FlippableSolidLayer, Gas, GasCoefficients, GasData, GlazingSystem as _GlazingSystem, GlazingSystemDimensions, \
IGUGapLayer, IntegrationRule, IntegrationRuleType, Lab, Layers, MaterialType, \
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pywincalc
version = 3.4.0
version = 3.5.0
description = A Python library for calculating thermal and optical properties of glazing systems
long_description = file: README.md
long_description_content_type = text/markdown; charset=UTF-8
Expand Down
98 changes: 74 additions & 24 deletions src/wincalcbindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,39 +263,57 @@ PYBIND11_MODULE(wincalcbindings, m) {
.def(py::init<Tarcog::ISO15099::CIGUGapLayer const &,
Tarcog::ISO15099::RectangularPillar const &>(),
py::arg("gap_layer"), py::arg("rectangular_pillar"));

py::class_<Tarcog::ISO15099::PolygonalPillar, Tarcog::ISO15099::PillarData,
std::shared_ptr<Tarcog::ISO15099::PolygonalPillar>>(
m, "PolygonalPillar")
.def(py::init<double, double, double, double,
Tarcog::ISO15099::PolygonType>(),
py::arg("height"), py::arg("material_conductivity"),
py::arg("cell_area"), py::arg("length"), py::arg("polygon_type"))
.def_readwrite("length", &Tarcog::ISO15099::PolygonalPillar::length)
.def_readwrite("polygon_type", &Tarcog::ISO15099::PolygonalPillar::type);

py::class_<Tarcog::ISO15099::PolygonalPillar,
Tarcog::ISO15099::PillarData,
std::shared_ptr<Tarcog::ISO15099::PolygonalPillar>>(m, "PolygonalPillar")
.def(py::init<double, double, double, double>(), py::arg("height"),
py::arg("material_conductivity"), py::arg("cell_area"), py::arg("length"))
.def_readwrite("legnth", &Tarcog::ISO15099::PolygonalPillar::length);

py::class_<Tarcog::ISO15099::TriangularPillar,
Tarcog::ISO15099::PolygonalPillar,
Tarcog::ISO15099::PillarData,
std::shared_ptr<Tarcog::ISO15099::TriangularPillar>>(m, "TriangularPillar")
.def(py::init<double, double, double, double>(), py::arg("height"),
py::arg("material_conductivity"), py::arg("cell_area"), py::arg("length"));

py::class_<Tarcog::ISO15099::TriangularPillarLayer,
Tarcog::ISO15099::UniversalSupportPillar,
std::shared_ptr<Tarcog::ISO15099::TriangularPillarLayer>>(
m, "TriangularPillarLayer")
.def(py::init<Tarcog::ISO15099::CIGUGapLayer const &,
Tarcog::ISO15099::PolygonalPillar const &>(),
Tarcog::ISO15099::TriangularPillar const &>(),
py::arg("gap_layer"), py::arg("polygon_pillar"));

py::class_<Tarcog::ISO15099::PentagonPillar,
Tarcog::ISO15099::PolygonalPillar,
Tarcog::ISO15099::PillarData,
std::shared_ptr<Tarcog::ISO15099::PentagonPillar>>(m, "PentagonPillar")
.def(py::init<double, double, double, double>(), py::arg("height"),
py::arg("material_conductivity"), py::arg("cell_area"), py::arg("length"));

py::class_<Tarcog::ISO15099::PentagonPillarLayer,
Tarcog::ISO15099::UniversalSupportPillar,
std::shared_ptr<Tarcog::ISO15099::PentagonPillarLayer>>(
m, "PentagonPillarLayer")
.def(py::init<Tarcog::ISO15099::CIGUGapLayer const &,
Tarcog::ISO15099::PolygonalPillar const &>(),
Tarcog::ISO15099::PentagonPillar const &>(),
py::arg("gap_layer"), py::arg("polygon_pillar"));

py::class_<Tarcog::ISO15099::HexagonPillar,
Tarcog::ISO15099::PolygonalPillar,
Tarcog::ISO15099::PillarData,
std::shared_ptr<Tarcog::ISO15099::HexagonPillar>>(m, "HexagonPillar")
.def(py::init<double, double, double, double>(), py::arg("height"),
py::arg("material_conductivity"), py::arg("cell_area"), py::arg("length"));

py::class_<Tarcog::ISO15099::HexagonPillarLayer,
Tarcog::ISO15099::UniversalSupportPillar,
std::shared_ptr<Tarcog::ISO15099::HexagonPillarLayer>>(
m, "HexagonPillarLayer")
.def(py::init<Tarcog::ISO15099::CIGUGapLayer const &,
Tarcog::ISO15099::PolygonalPillar const &>(),
Tarcog::ISO15099::HexagonPillar const &>(),
py::arg("gap_layer"), py::arg("polygon_pillar"));

py::class_<Tarcog::ISO15099::LinearBearingPillar,
Expand Down Expand Up @@ -356,6 +374,29 @@ PYBIND11_MODULE(wincalcbindings, m) {
.def(py::init<Tarcog::ISO15099::CIGUGapLayer const &,
Tarcog::ISO15099::AnnulusCylinderPillar const &>(),
py::arg("gap_layer"), py::arg("annulus_cylinder_pillar"));

py::class_<Tarcog::ISO15099::CShapedCylinderPillar,
Tarcog::ISO15099::PillarData,
std::shared_ptr<Tarcog::ISO15099::CShapedCylinderPillar>>(
m, "CShapedCylinderPillar")
.def(py::init<double, double, double, double, double, double>(),
py::arg("height"), py::arg("material_conductivity"),
py::arg("cell_area"), py::arg("inner_radius"),
py::arg("outer_radius"), py::arg("fraction_covered"))
.def_readwrite("inner_radius",
&Tarcog::ISO15099::CShapedCylinderPillar::innerRadius)
.def_readwrite("outer_radius",
&Tarcog::ISO15099::CShapedCylinderPillar::outerRadius)
.def_readwrite("fraction_covered",
&Tarcog::ISO15099::CShapedCylinderPillar::fractionCovered);

py::class_<Tarcog::ISO15099::CShapedCylinderPillarLayer,
Tarcog::ISO15099::UniversalSupportPillar,
std::shared_ptr<Tarcog::ISO15099::CShapedCylinderPillarLayer>>(
m, "CShapedCylinderPillarLayer")
.def(py::init<Tarcog::ISO15099::CIGUGapLayer const &,
Tarcog::ISO15099::CShapedCylinderPillar const &>(),
py::arg("gap_layer"), py::arg("cshaped_cylinder_pillar"));

py::class_<Tarcog::ISO15099::Glass, std::shared_ptr<Tarcog::ISO15099::Glass>>(
m, "Glass")
Expand Down Expand Up @@ -756,12 +797,11 @@ PYBIND11_MODULE(wincalcbindings, m) {
py::class_<wincalc::Product_Data_Thermal, wincalc::Flippable_Solid_Layer,
std::shared_ptr<wincalc::Product_Data_Thermal>>(
m, "ProductDataThermal")
.def(py::init<double, double, bool, double, double, double, double,
double>(),
.def(py::init<double, double, bool, double, double, double, double, double>(),
py::arg("conductivity"), py::arg("thickness_meters"),
py::arg("flipped") = false, py::arg("opening_top") = 0,
py::arg("opening_bottom") = 0, py::arg("opening_left") = 0,
py::arg("opening_right") = 0)
py::arg("opening_right") = 0, py::arg("opening_front") = 0)
.def_readwrite("conductivity",
&wincalc::Product_Data_Thermal::conductivity)
.def_readwrite("opening_top", &wincalc::Product_Data_Thermal::opening_top)
Expand All @@ -771,10 +811,6 @@ PYBIND11_MODULE(wincalcbindings, m) {
&wincalc::Product_Data_Thermal::opening_left)
.def_readwrite("opening_right",
&wincalc::Product_Data_Thermal::opening_right)
.def_readwrite("effective_openness",
&wincalc::Product_Data_Thermal::effective_openness)
.def_readwrite("effective_thickness",
&wincalc::Product_Data_Thermal::effective_thickness)
.def_readwrite("youngs_modulus",
&wincalc::Product_Data_Thermal::youngs_modulus)
.def_readwrite("density", &wincalc::Product_Data_Thermal::density);
Expand Down Expand Up @@ -923,7 +959,7 @@ PYBIND11_MODULE(wincalcbindings, m) {
SingleLayerOptics::BSDFHemisphere const &, double,
std::optional<double>, std::optional<double>,
std::optional<double>, std::optional<double>, double,
bool>(),
bool, bool>(),
py::arg("solar_transmittance_front"),
py::arg("solar_transmittance_back"),
py::arg("solar_reflectance_front"),
Expand All @@ -937,7 +973,7 @@ PYBIND11_MODULE(wincalcbindings, m) {
py::arg("ir_transmittance_back") = std::optional<double>(),
py::arg("emissivity_front") = std::optional<double>(),
py::arg("emissivity_back") = std::optional<double>(),
py::arg("permeability_factor") = 0.0, py::arg("flipped") = false)
py::arg("permeability_factor") = 0.0, py::arg("flipped") = false, py::arg("user_defined_effective_values") = false)
.def_readwrite("solar_transmittance_front",
&wincalc::Product_Data_Dual_Band_Optical_BSDF::tf_solar)
.def_readwrite("solar_transmittance_back",
Expand All @@ -954,6 +990,8 @@ PYBIND11_MODULE(wincalcbindings, m) {
&wincalc::Product_Data_Dual_Band_Optical_BSDF::rf_visible)
.def_readwrite("visible_reflectance_back",
&wincalc::Product_Data_Dual_Band_Optical_BSDF::rb_visible)
.def_readwrite("user_defined_effective_values",
&wincalc::Product_Data_Dual_Band_Optical_BSDF::user_defined_effective_values)
.def("effective_thermal_values",
&wincalc::Product_Data_Dual_Band_Optical_BSDF::
effective_thermal_values);
Expand Down Expand Up @@ -1796,9 +1834,21 @@ PYBIND11_MODULE(wincalcbindings, m) {
py::arg("pillar"), py::arg("pressure"))
.def_static(
"create_pillar",
py::overload_cast<Tarcog::ISO15099::PolygonalPillar const &, double>(
py::overload_cast<Tarcog::ISO15099::TriangularPillar const &, double>(
&Tarcog::ISO15099::Layers::createPillar),
"Static function to add a triangular pillar to a Tarcog gap",
py::arg("pillar"), py::arg("pressure"))
.def_static(
"create_pillar",
py::overload_cast<Tarcog::ISO15099::PentagonPillar const &, double>(
&Tarcog::ISO15099::Layers::createPillar),
"Static function to add a pentagon pillar to a Tarcog gap",
py::arg("pillar"), py::arg("pressure"))
.def_static(
"create_pillar",
py::overload_cast<Tarcog::ISO15099::HexagonPillar const &, double>(
&Tarcog::ISO15099::Layers::createPillar),
"Static function to add a polygonal pillar to a Tarcog gap",
"Static function to add a hexagon pillar to a Tarcog gap",
py::arg("pillar"), py::arg("pressure"))
.def_static(
"create_pillar",
Expand Down

0 comments on commit 3853d31

Please sign in to comment.