Skip to content
New issue

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

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

Already on GitHub? # to your account

Addresses #4380, completing SDK support of Tubular Daylighting Devices (TDDs) #4382

Merged
merged 35 commits into from
Aug 18, 2021
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ecfcec8
Add tubular and lightwell to idd.
joseph-robertson Jul 23, 2021
9012e96
Stub model files.
joseph-robertson Jul 23, 2021
c610d36
Update new model files.
joseph-robertson Jul 23, 2021
3569499
Stub new methods in subsurface.
joseph-robertson Jul 23, 2021
f388bdd
Stub model tests.
joseph-robertson Jul 23, 2021
99c5422
Stub ft files.
joseph-robertson Jul 23, 2021
08025a5
Stub ft tests.
joseph-robertson Jul 23, 2021
0be5a99
Update cmakelists, etc.
joseph-robertson Jul 23, 2021
bcfc6cb
Apply clang.
joseph-robertson Jul 23, 2021
97c4b4b
Fill out subsurface methods.
joseph-robertson Jul 26, 2021
b060d60
Refine subsurface methods.
joseph-robertson Jul 26, 2021
2040ef0
Fill out tubular methods.
joseph-robertson Jul 26, 2021
b7a3b85
Fill out lightwell methods.
joseph-robertson Jul 26, 2021
495828c
Fill out ft.
joseph-robertson Jul 26, 2021
3b9823d
Merge branch 'develop' into issue-4380
joseph-robertson Aug 2, 2021
2845b71
Update ctor for light well.
joseph-robertson Aug 2, 2021
aa3659e
Fill out model tests.
joseph-robertson Aug 2, 2021
2b18dca
Add construction to tubular model test.
joseph-robertson Aug 2, 2021
902f8c0
Add convenience ctors.
joseph-robertson Aug 2, 2021
2321337
Fill out ft tests.
joseph-robertson Aug 2, 2021
1efb7de
Clean up model and ft tests.
joseph-robertson Aug 3, 2021
78ea8a4
Update subsurface set type method.
joseph-robertson Aug 3, 2021
922c00b
Update tubular model files.
joseph-robertson Aug 3, 2021
603b5a9
Update model tests.
joseph-robertson Aug 3, 2021
39dd3c3
Update ft tests.
joseph-robertson Aug 3, 2021
2d1fd79
Add transition zone to model geometry properly.
joseph-robertson Aug 3, 2021
050e195
Merge remote-tracking branch 'origin/develop' into issue-4380
jmarrec Aug 9, 2021
a1cdd8c
C# SWIG: Move TransitionZone helper class to ThermalZone.hpp/cpp sinc…
jmarrec Aug 9, 2021
322902f
Fix an issue unrelated to this PR: trying to output an boost::optiona…
jmarrec Aug 9, 2021
1de173a
clang format
jmarrec Aug 9, 2021
071bd80
Translate and map sub surfaces in ft.
joseph-robertson Aug 10, 2021
bd96477
Warn when changing subsurface type and removing daylighting device.
joseph-robertson Aug 10, 2021
87787d3
Merge branch 'develop' into issue-4380
joseph-robertson Aug 13, 2021
8f7103c
Minor changes during code review. Enhance messages in SubSurface::set…
jmarrec Aug 17, 2021
8c1835f
clang format [chore]
jmarrec Aug 18, 2021
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
94 changes: 94 additions & 0 deletions resources/model/OpenStudio.idd
Original file line number Diff line number Diff line change
Expand Up @@ -4912,6 +4912,61 @@ OS:Building,
\units m
\minimum> 0

OS:DaylightingDevice:Tubular,
\memo Defines a tubular daylighting device (TDD) consisting of three components:
\memo a dome, a pipe, and a diffuser. The dome and diffuser are defined separately using the
\memo FenestrationSurface:Detailed object.
\extensible:2 Duplicate the last two fields Transition Zone Name and Transition Zone Length
\extensible:2
\min-fields 8
A1, \field Handle
\type handle
\required-field
A2 , \field Name
\type alpha
\required-field
\reference SpaceItemNames
A3 , \field Dome Name
\note This must refer to a subsurface object of type TubularDaylightDome
\required-field
\type object-list
\object-list SubSurfNames
A4 , \field Diffuser Name
\note This must refer to a subsurface object of type TubularDaylightDiffuser
\note Delivery zone is specified in the diffuser object
\required-field
\type object-list
\object-list SubSurfNames
A5 , \field Construction Name
\required-field
\type object-list
\object-list ConstructionNames
N1 , \field Diameter
\required-field
\units m
\type real
\minimum> 0
N2 , \field Total Length
\note The exterior exposed length is the difference between total and sum of zone lengths
\required-field
\units m
\type real
\minimum> 0
N3 , \field Effective Thermal Resistance
\note R value between TubularDaylightDome and TubularDaylightDiffuser
\units m2-K/W
\type real
\minimum> 0
\required-field
A6 , \field Transition Zone Name 1
\begin-extensible
\type object-list
\object-list ThermalZoneNames
N4 ; \field Transition Zone Length 1
\units m
\type real
\minimum 0.0

OS:DaylightingDevice:Shelf,
\min-fields 1
A1, \field Handle
Expand All @@ -4937,6 +4992,45 @@ OS:DaylightingDevice:Shelf,
\minimum 0
\maximum 1

OS:DaylightingDevice:LightWell,
\min-fields 7
\memo Applies only to exterior windows in daylighting-controlled zones or
\memo in zones that share an interior window with a daylighting-controlled zone.
\memo Generally used with skylights.
A1, \field Handle
\type handle
\required-field
A2, \field Name
\type alpha
\required-field
\reference SpaceItemNames
A3, \field Exterior Window Name
\required-field
\type object-list
\object-list SubSurfNames
N1, \field Height of Well
\note Distance from Bottom of Window to Bottom of Well
\required-field
\type real
\units m
\minimum 0.0
N2, \field Perimeter of Bottom of Well
\required-field
\units m
\type real
\minimum> 0.0
N3, \field Area of Bottom of Well
\required-field
\type real
\units m2
\minimum> 0.0
N4; \field Visible Reflectance of Well Walls
\required-field
\type real
\units dimensionless
\minimum 0.0
\maximum 1.0

OS:Facility,
\unique-object
\required-object
Expand Down
4 changes: 4 additions & 0 deletions src/energyplus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ set(${target_name}_src
ForwardTranslator/ForwardTranslateCurveTriquadratic.cpp
ForwardTranslator/ForwardTranslateDaylightingControl.cpp
ForwardTranslator/ForwardTranslateDaylightingDeviceShelf.cpp
ForwardTranslator/ForwardTranslateDaylightingDeviceTubular.cpp
ForwardTranslator/ForwardTranslateDaylightingDeviceLightWell.cpp
ForwardTranslator/ForwardTranslateDaylightRedirectionDevice.cpp
ForwardTranslator/ForwardTranslateDesignDay.cpp
ForwardTranslator/ForwardTranslateDesignSpecificationOutdoorAir.cpp
Expand Down Expand Up @@ -648,6 +650,8 @@ set(${target_name}_test_src
Test/CurveQuintLinear_GTest.cpp
Test/DaylightingControl_GTest.cpp
Test/DaylightingDeviceShelf_GTest.cpp
Test/DaylightingDeviceTubular_GTest.cpp
Test/DaylightingDeviceLightWell_GTest.cpp
Test/DesignSpecificationOutdoorAir_GTest.cpp
Test/ElectricEquipment_GTest.cpp
Test/ElectricEquipmentITEAirCooled_GTest.cpp
Expand Down
12 changes: 12 additions & 0 deletions src/energyplus/ForwardTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,16 @@ namespace energyplus {
retVal = translateDaylightingDeviceShelf(daylightingDeviceShelf);
break;
}
case openstudio::IddObjectType::OS_DaylightingDevice_Tubular: {
model::DaylightingDeviceTubular daylightingDeviceTubular = modelObject.cast<DaylightingDeviceTubular>();
retVal = translateDaylightingDeviceTubular(daylightingDeviceTubular);
break;
}
case openstudio::IddObjectType::OS_DaylightingDevice_LightWell: {
model::DaylightingDeviceLightWell daylightingDeviceLightWell = modelObject.cast<DaylightingDeviceLightWell>();
retVal = translateDaylightingDeviceLightWell(daylightingDeviceLightWell);
break;
}
case openstudio::IddObjectType::OS_DefaultConstructionSet: {
// no-op
return retVal;
Expand Down Expand Up @@ -3147,6 +3157,8 @@ namespace energyplus {

result.push_back(IddObjectType::OS_Daylighting_Control);
result.push_back(IddObjectType::OS_DaylightingDevice_Shelf);
result.push_back(IddObjectType::OS_DaylightingDevice_Tubular);
result.push_back(IddObjectType::OS_DaylightingDevice_LightWell);
result.push_back(IddObjectType::OS_IlluminanceMap);

// Definition objects will be translated as needed by instance objects.
Expand Down
6 changes: 6 additions & 0 deletions src/energyplus/ForwardTranslator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ namespace model {
class CurveTriquadratic;
class DaylightingControl;
class DaylightingDeviceShelf;
class DaylightingDeviceTubular;
class DaylightingDeviceLightWell;
class DaylightRedirectionDevice;
class DesignDay;
class DesignSpecificationOutdoorAir;
Expand Down Expand Up @@ -860,6 +862,10 @@ namespace energyplus {

boost::optional<IdfObject> translateDaylightingDeviceShelf(model::DaylightingDeviceShelf& modelObject);

boost::optional<IdfObject> translateDaylightingDeviceTubular(model::DaylightingDeviceTubular& modelObject);

boost::optional<IdfObject> translateDaylightingDeviceLightWell(model::DaylightingDeviceLightWell& modelObject);

boost::optional<IdfObject> translateDaylightRedirectionDevice(model::DaylightRedirectionDevice& modelObject);

boost::optional<IdfObject> translateDesignDay(model::DesignDay& modelObject);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/***********************************************************************************************************************
* OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* (1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following
* disclaimer.
*
* (2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the distribution.
*
* (3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse or promote products
* derived from this software without specific prior written permission from the respective party.
*
* (4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other derivative works
* may not use the "OpenStudio" trademark, "OS", "os", or any other confusingly similar designation without specific prior
* written permission from Alliance for Sustainable Energy, LLC.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE UNITED STATES GOVERNMENT, OR THE UNITED
* STATES DEPARTMENT OF ENERGY, NOR ANY OF THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
***********************************************************************************************************************/

#include "../ForwardTranslator.hpp"

#include "../../model/Model.hpp"
#include "../../model/DaylightingDeviceLightWell.hpp"
#include "../../model/DaylightingDeviceLightWell_Impl.hpp"
#include "../../model/SubSurface.hpp"
#include "../../model/SubSurface_Impl.hpp"

#include <utilities/idd/DaylightingDevice_LightWell_FieldEnums.hxx>
#include "../../utilities/idd/IddEnums.hpp"
#include <utilities/idd/IddEnums.hxx>

using namespace openstudio::model;

using namespace std;

namespace openstudio {

namespace energyplus {

boost::optional<IdfObject> ForwardTranslator::translateDaylightingDeviceLightWell(model::DaylightingDeviceLightWell& modelObject) {
IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::DaylightingDevice_LightWell, modelObject);

SubSurface subSurface = modelObject.subSurface();
if (boost::optional<IdfObject> subSurf = translateAndMapModelObject(subSurface)) {
idfObject.setString(DaylightingDevice_LightWellFields::ExteriorWindowName, subSurf->name().get());
}

idfObject.setDouble(DaylightingDevice_LightWellFields::HeightofWell, modelObject.heightofWell());

idfObject.setDouble(DaylightingDevice_LightWellFields::PerimeterofBottomofWell, modelObject.perimeterofBottomofWell());

idfObject.setDouble(DaylightingDevice_LightWellFields::AreaofBottomofWell, modelObject.areaofBottomofWell());

idfObject.setDouble(DaylightingDevice_LightWellFields::VisibleReflectanceofWellWalls, modelObject.visibleReflectanceofWellWalls());

return idfObject;
}

} // namespace energyplus

} // namespace openstudio
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ namespace energyplus {

IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::DaylightingDevice_Shelf, modelObject);

idfObject.setString(DaylightingDevice_ShelfFields::WindowName, window.name().get());
if (boost::optional<IdfObject> w = translateAndMapModelObject(window)) {
idfObject.setString(DaylightingDevice_ShelfFields::WindowName, w->name().get());
}

// inside shelf is converted to a surface
if (insideShelf) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/***********************************************************************************************************************
* OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* (1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following
* disclaimer.
*
* (2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the distribution.
*
* (3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse or promote products
* derived from this software without specific prior written permission from the respective party.
*
* (4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other derivative works
* may not use the "OpenStudio" trademark, "OS", "os", or any other confusingly similar designation without specific prior
* written permission from Alliance for Sustainable Energy, LLC.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE UNITED STATES GOVERNMENT, OR THE UNITED
* STATES DEPARTMENT OF ENERGY, NOR ANY OF THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
***********************************************************************************************************************/

#include "../ForwardTranslator.hpp"

#include "../../model/Model.hpp"
#include "../../model/DaylightingDeviceTubular.hpp"
#include "../../model/DaylightingDeviceTubular_Impl.hpp"
#include "../../model/SubSurface.hpp"
#include "../../model/SubSurface_Impl.hpp"
#include "../../model/ConstructionBase.hpp"
#include "../../model/ConstructionBase_Impl.hpp"

#include "../../utilities/idf/IdfExtensibleGroup.hpp"

#include <utilities/idd/DaylightingDevice_Tubular_FieldEnums.hxx>
#include "../../utilities/idd/IddEnums.hpp"
#include <utilities/idd/IddEnums.hxx>

using namespace openstudio::model;

using namespace std;

namespace openstudio {

namespace energyplus {

boost::optional<IdfObject> ForwardTranslator::translateDaylightingDeviceTubular(model::DaylightingDeviceTubular& modelObject) {
IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::DaylightingDevice_Tubular, modelObject);

SubSurface subSurfaceDome = modelObject.subSurfaceDome();
if (boost::optional<IdfObject> subSurfDome = translateAndMapModelObject(subSurfaceDome)) {
idfObject.setString(DaylightingDevice_TubularFields::DomeName, subSurfDome->name().get());
}

SubSurface subSurfaceDiffuser = modelObject.subSurfaceDiffuser();
if (boost::optional<IdfObject> subSurfDiffuser = translateAndMapModelObject(subSurfaceDiffuser)) {
idfObject.setString(DaylightingDevice_TubularFields::DiffuserName, subSurfDiffuser->name().get());
}

ConstructionBase construction = modelObject.construction();
idfObject.setString(DaylightingDevice_TubularFields::ConstructionName, construction.name().get());

idfObject.setDouble(DaylightingDevice_TubularFields::Diameter, modelObject.diameter());

idfObject.setDouble(DaylightingDevice_TubularFields::TotalLength, modelObject.totalLength());

idfObject.setDouble(DaylightingDevice_TubularFields::EffectiveThermalResistance, modelObject.effectiveThermalResistance());

std::vector<TransitionZone> transitionZones = modelObject.transitionZones();
if (!transitionZones.empty()) {
for (const TransitionZone& transitionZone : transitionZones) {
auto eg = idfObject.pushExtensibleGroup();
eg.setString(DaylightingDevice_TubularExtensibleFields::TransitionZoneName, transitionZone.thermalZone().name().get());
eg.setDouble(DaylightingDevice_TubularExtensibleFields::TransitionZoneLength, transitionZone.length());
}
}

return idfObject;
}

} // namespace energyplus

} // namespace openstudio
Loading