Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6807402
#4648 #4654 - naive IDD addition for SurfaceProperty:GroundSurfaces a…
jmarrec Sep 8, 2022
8996bab
IDD adjustments
jmarrec Sep 8, 2022
0ca9ce1
Start to implement model files for SurfacePropertyIncidentSolarMultip…
jmarrec Sep 8, 2022
af7bee0
Add a TODO: not sure if I want IncidentSolarMultiplierSchedule to bre…
jmarrec Sep 8, 2022
4e32b57
Add extensible schedule registry for SurroundingSurfaces (existing ob…
jmarrec Sep 8, 2022
658456e
Start model gtests
jmarrec Sep 8, 2022
60ac7ba
Commit FT/RT stubs from generate class
jmarrec Sep 8, 2022
ae317ea
Missing a public implementation
jmarrec Sep 9, 2022
cc9e9c7
Finish model tests and fixup issues
jmarrec Sep 9, 2022
e5f9cb1
Adjust object-list in IDD
jmarrec Sep 12, 2022
c33e284
add a getter SubSurface::surfacePropertyIncidentSolarMultiplier()
jmarrec Sep 12, 2022
a826977
Register + Test for FT and RT
jmarrec Sep 12, 2022
6f50d6b
Write a FT and RT for SurfacePropertyIncidentSolarMultiplier and Surf…
jmarrec Sep 12, 2022
a412757
Merge remote-tracking branch 'origin/v22.2.0-IOFreeze' into 4648_4654…
jmarrec Sep 12, 2022
40a0f91
remove debug save
jmarrec Sep 12, 2022
7fc202f
Regression test is showing the subsurface that has the IncidentSolarM…
jmarrec Sep 12, 2022
19cc1e2
I was actually getting owned by SurfacePropertyLocalEnvironment
jmarrec Sep 12, 2022
bb0ca64
Fixup issue where SubSurface is duplicated during FT: register the Su…
jmarrec Sep 12, 2022
e9de771
Merge branch 'v22.2.0-IOFreeze' into 4648_4654_SurfaceProperties
joseph-robertson Sep 12, 2022
111288a
Formatting.
joseph-robertson Sep 12, 2022
62c0196
Merge branch 'v22.2.0-IOFreeze' into 4648_4654_SurfaceProperties
jmarrec Sep 15, 2022
a32c51a
Remove "Schedule" from schedule type registry to match GenerateClass.rb
jmarrec Sep 15, 2022
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
2 changes: 1 addition & 1 deletion developer/ruby/GenerateClass.rb
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def forwardTranslate(options)

# VIRTUAL DESTRUCTORS

hpp << " virtual ~" << className << "() {}\n\n"
hpp << " virtual ~" << className << "() = default;\n\n"
hpp << " //@}\n\n"

if pImpl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def cppPublicClassProtectedImpl()
if @baseClassName.empty?
result << " : m_impl(impl)\n"
else
result << " : " << baseClassName << "(impl)\n"
result << " : " << baseClassName << "(std::move(impl))\n"
end
result << "{}\n"
end
Expand Down
49 changes: 49 additions & 0 deletions resources/energyplus/ProposedEnergy+.idd
Original file line number Diff line number Diff line change
Expand Up @@ -9703,6 +9703,28 @@ SurfaceProperty:SolarIncidentInside,
\type object-list
\object-list ScheduleNames

SurfaceProperty:IncidentSolarMultiplier,
\min-fields 3
A1, \field Surface Name
\required-field
\type object-list
\object-list GlazedExtSubSurfNames
\note Enter the name of an exterior window outside surface object
N1, \field Incident Solar Multiplier
\note a constant multiplier for window solar transmittance
\note and visible transmittance. If the Shading Multiplier Schedule Name is
\note defined, the product of these two will be the final shading multiplier.
\type real
\units dimensionless
\minimum 0
\maximum 1
\default 1.0
A2; \field Incident Solar Multiplier Schedule Name
\note The schedule values should be greater than or equal
\note to 0 and less than or equal to 1.
\type object-list
\object-list ScheduleNames

SurfaceProperty:LocalEnvironment,
\min-fields 3
\memo This object defines the local environment properties of an exterior surface.
Expand Down Expand Up @@ -9789,6 +9811,33 @@ SurfaceProperty:SurroundingSurfaces,
\object-list ScheduleNames
\note Schedule values are real numbers, -100.0 to 100.0, units C

SurfaceProperty:GroundSurfaces,
\min-fields 3
\memo This object defines a list of ground surfaces for use with an exterior surface.
\extensible:4 -- duplicate last set of ground surface properties (the last four fields), remembering to remove ; from "inner" fields.
A1, \field Name
\required-field
\type alpha
\reference GroundSurfacesNames
A2, \field Ground Surface 1 Name
\begin-extensible
\required-field
\type alpha
N1, \field Ground Surface 1 View Factor
\type real
\units dimensionless
\minimum 0.0
\maximum 1.0
A3, \field Ground Surface 1 Temperature Schedule Name
\type alpha
\type object-list
\object-list ScheduleNames
\note Schedule values are real numbers, -100.0 to 100.0, units C
A4; \field Ground Surface 1 Reflectance Schedule Name
\type object-list
\object-list ScheduleNames
\note Schedule values are fraction, 0.0 to 1.0, units dimensionless

ComplexFenestrationProperty:SolarAbsorbedLayers,
\memo Used to provide solar radiation absorbed in fenestration layers. References surface-construction pair
\memo and if that pair is used in a simulation, then program will use value provided in schedules instead of calculating it.
Expand Down
62 changes: 60 additions & 2 deletions resources/model/OpenStudio.idd
Original file line number Diff line number Diff line change
Expand Up @@ -6697,7 +6697,7 @@ OS:SurfaceProperty:SurroundingSurfaces,
\type object-list
\object-list ScheduleNames
\note Schedule values are real numbers, -100.0 to 100.0, units C
\note If the field is left blank the global sky temperature is be used
\note If the field is left blank the global sky temperature is used
N2, \field Ground View Factor
\minimum 0.0
\maximum 1.0
Expand Down Expand Up @@ -6747,10 +6747,68 @@ OS:SurfaceProperty:LocalEnvironment,
\type object-list
\object-list SurroundingSurfacesNames
\note Enter the name of a SurfaceProperty:SurroundingSurfaces object
A6; \field Outdoor Air Node Name
A6, \field Outdoor Air Node Name
\type object-list
\object-list OutdoorAirNodeNames
\note Enter the name of an OutdoorAir:Node object
A7; \field Ground Surfaces Object Name
\type object-list
\object-list GroundSurfacesNames

OS:SurfaceProperty:GroundSurfaces,
\min-fields 4
\memo This object defines a list of ground surfaces for use with an exterior surface.
\extensible:4 -- duplicate last set of ground surface properties (the last four fields), remembering to remove ; from "inner" fields.
A1, \field Handle
\type handle
\required-field
A2, \field Name
\required-field
\type alpha
\reference GroundSurfacesNames
A3, \field Ground Surface 1 Name
\begin-extensible
\required-field
\type alpha
N1, \field Ground Surface 1 View Factor
\type real
\units dimensionless
\minimum 0.0
\maximum 1.0
\autocalculatable
A4, \field Ground Surface 1 Temperature Schedule Name
\type object-list
\object-list ScheduleNames
\note Schedule values are real numbers, -100.0 to 100.0, units C
A5; \field Ground Surface 1 Reflectance Schedule Name
\type object-list
\object-list ScheduleNames
\note Schedule values are fraction, 0.0 to 1.0, units dimensionless

OS:SurfaceProperty:IncidentSolarMultiplier,
\min-fields 4
A1, \field Handle
\type handle
\required-field
A2, \field Surface Name
\required-field
\type object-list
\object-list GlazedExtSubSurfNames
\note Enter the name of an exterior window outside surface object
N1, \field Incident Solar Multiplier
\note a constant multiplier for window solar transmittance
\note and visible transmittance. If the Shading Multiplier Schedule Name is
\note defined, the product of these two will be the final shading multiplier.
\type real
\units dimensionless
\minimum 0
\maximum 1
\required-field
A3; \field Incident Solar Multiplier Schedule Name
\note The schedule values should be greater than or equal
\note to 0 and less than or equal to 1.
\type object-list
\object-list ScheduleNames

\group OpenStudio Space Loads

Expand Down
6 changes: 6 additions & 0 deletions src/energyplus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ set(${target_name}_src
ForwardTranslator/ForwardTranslateSurfacePropertyOtherSideCoefficients.cpp
ForwardTranslator/ForwardTranslateSurfacePropertyOtherSideConditionsModel.cpp
ForwardTranslator/ForwardTranslateSurfacePropertySurroundingSurfaces.cpp
ForwardTranslator/ForwardTranslateSurfacePropertyGroundSurfaces.cpp
ForwardTranslator/ForwardTranslateSurfacePropertyIncidentSolarMultiplier.cpp
ForwardTranslator/ForwardTranslateSwimmingPoolIndoor.cpp
ForwardTranslator/ForwardTranslateTableMultiVariableLookup.cpp
ForwardTranslator/ForwardTranslateTableLookup.cpp
Expand Down Expand Up @@ -588,6 +590,8 @@ set(${target_name}_src
ReverseTranslator/ReverseTranslateSurfacePropertyExposedFoundationPerimeter.cpp
ReverseTranslator/ReverseTranslateSurfacePropertyLocalEnvironment.cpp
ReverseTranslator/ReverseTranslateSurfacePropertySurroundingSurfaces.cpp
ReverseTranslator/ReverseTranslateSurfacePropertyGroundSurfaces.cpp
ReverseTranslator/ReverseTranslateSurfacePropertyIncidentSolarMultiplier.cpp
ReverseTranslator/ReverseTranslateSwimmingPoolIndoor.cpp
ReverseTranslator/ReverseTranslateTableLookup.cpp
ReverseTranslator/ReverseTranslateTableIndependentVariable.cpp
Expand Down Expand Up @@ -761,6 +765,8 @@ set(${target_name}_test_src
Test/SurfacePropertyConvectionCoefficients_GTest.cpp
Test/SurfacePropertyLocalEnvironment_GTest.cpp
Test/SurfacePropertySurroundingSurfaces_GTest.cpp
Test/SurfacePropertyGroundSurfaces_GTest.cpp
Test/SurfacePropertyIncidentSolarMultiplier_GTest.cpp
Test/SwimmingPoolIndoor_GTest.cpp
Test/TableMultiVariableLookup_GTest.cpp
Test/TableLookup_GTest.cpp
Expand Down
10 changes: 10 additions & 0 deletions src/energyplus/ForwardTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2853,6 +2853,16 @@ namespace energyplus {
retVal = translateSurfacePropertySurroundingSurfaces(obj);
break;
}
case openstudio::IddObjectType::OS_SurfaceProperty_GroundSurfaces: {
model::SurfacePropertyGroundSurfaces obj = modelObject.cast<SurfacePropertyGroundSurfaces>();
retVal = translateSurfacePropertyGroundSurfaces(obj);
break;
}
case openstudio::IddObjectType::OS_SurfaceProperty_IncidentSolarMultiplier: {
model::SurfacePropertyIncidentSolarMultiplier obj = modelObject.cast<SurfacePropertyIncidentSolarMultiplier>();
retVal = translateSurfacePropertyIncidentSolarMultiplier(obj);
break;
}
case openstudio::IddObjectType::OS_SubSurface: {
model::SubSurface subSurface = modelObject.cast<SubSurface>();
retVal = translateSubSurface(subSurface);
Expand Down
6 changes: 6 additions & 0 deletions src/energyplus/ForwardTranslator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,8 @@ namespace model {
class SurfacePropertyOtherSideCoefficients;
class SurfacePropertyOtherSideConditionsModel;
class SurfacePropertySurroundingSurfaces;
class SurfacePropertyGroundSurfaces;
class SurfacePropertyIncidentSolarMultiplier;
class SwimmingPoolIndoor;
class TableMultiVariableLookup;
class TableLookup;
Expand Down Expand Up @@ -1428,6 +1430,10 @@ namespace energyplus {

boost::optional<IdfObject> translateSurfacePropertySurroundingSurfaces(model::SurfacePropertySurroundingSurfaces& modelObject);

boost::optional<IdfObject> translateSurfacePropertyGroundSurfaces(model::SurfacePropertyGroundSurfaces& modelObject);

boost::optional<IdfObject> translateSurfacePropertyIncidentSolarMultiplier(model::SurfacePropertyIncidentSolarMultiplier& modelObject);

boost::optional<IdfObject> translateSwimmingPoolIndoor(model::SwimmingPoolIndoor& modelObject);

OS_DEPRECATED boost::optional<IdfObject> translateTableMultiVariableLookup(model::TableMultiVariableLookup& modelObject);
Expand Down
47 changes: 27 additions & 20 deletions src/energyplus/ForwardTranslator/ForwardTranslateSubSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "../../model/SurfacePropertyOtherSideConditionsModel.hpp"
#include "../../model/SurfacePropertyConvectionCoefficients.hpp"
#include "../../model/SurfacePropertyLocalEnvironment.hpp"
#include "../../model/SurfacePropertyIncidentSolarMultiplier.hpp"

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

Expand All @@ -66,10 +67,31 @@ namespace energyplus {

idfObject.setString(FenestrationSurface_DetailedFields::Name, modelObject.name().get());

openstudio::Vector3d offset(0, 0, 0);
idfObject.clearExtensibleGroups();
for (const Point3d& point : modelObject.vertices()) {
IdfExtensibleGroup group = idfObject.pushExtensibleGroup();
if (group.empty()) {
LOG(Error,
"Currently unable to translate " << modelObject.briefDescription() << ", because it has more vertices than allowed by EnergyPlus.");
return boost::none;
}

Point3d newPoint = point + offset;

group.setDouble(0, newPoint.x());
group.setDouble(1, newPoint.y());
group.setDouble(2, newPoint.z());
}

// Register and emplace into m_map, so that any child object such as translateSurfacePropertyIncidentSolarMultiplier
// can retrieve the subsurface namestring and we don't risk duplicating the subsurface when that child also calls
// translateAndMapModelObject(subSurface)
m_idfObjects.push_back(idfObject);
m_map.insert(std::make_pair(modelObject.handle(), idfObject));

std::string subSurfaceType = modelObject.subSurfaceType();
if (istringEqual("FixedWindow", subSurfaceType)) {
subSurfaceType = "Window";
} else if (istringEqual("OperableWindow", subSurfaceType)) {
if (istringEqual("FixedWindow", subSurfaceType) || istringEqual("OperableWindow", subSurfaceType)) {
subSurfaceType = "Window";
} else if (istringEqual("OverheadDoor", subSurfaceType)) {
subSurfaceType = "Door";
Expand Down Expand Up @@ -140,7 +162,6 @@ namespace energyplus {
}

boost::optional<WindowPropertyFrameAndDivider> frameAndDivider = modelObject.windowPropertyFrameAndDivider();
openstudio::Vector3d offset(0, 0, 0);
if (frameAndDivider) {
if (!frameAndDivider->isOutsideRevealDepthDefaulted()) {
offset = -frameAndDivider->outsideRevealDepth() * modelObject.outwardNormal();
Expand All @@ -152,24 +173,10 @@ namespace energyplus {
idfObject.setDouble(FenestrationSurface_DetailedFields::Multiplier, modelObject.multiplier());
}

idfObject.clearExtensibleGroups();
for (const Point3d& point : modelObject.vertices()) {
IdfExtensibleGroup group = idfObject.pushExtensibleGroup();
if (group.empty()) {
LOG(Error,
"Currently unable to translate " << modelObject.briefDescription() << ", because it has more vertices than allowed by EnergyPlus.");
return boost::none;
}

Point3d newPoint = point + offset;

group.setDouble(0, newPoint.x());
group.setDouble(1, newPoint.y());
group.setDouble(2, newPoint.z());
if (boost::optional<SurfacePropertyIncidentSolarMultiplier> spMult_ = modelObject.surfacePropertyIncidentSolarMultiplier()) {
translateAndMapModelObject(spMult_.get());
}

m_idfObjects.push_back(idfObject);

return idfObject;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/***********************************************************************************************************************
* OpenStudio(R), Copyright (c) 2008-2022, 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/SurfacePropertyGroundSurfaces.hpp"
#include "../../model/Schedule.hpp"

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

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

using namespace openstudio::model;

namespace openstudio {

namespace energyplus {

boost::optional<IdfObject> ForwardTranslator::translateSurfacePropertyGroundSurfaces(model::SurfacePropertyGroundSurfaces& modelObject) {
boost::optional<IdfObject> result;

// Instantiate an IdfObject of the class to store the values
IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::SurfaceProperty_GroundSurfaces, modelObject);

for (const auto& group : modelObject.groundSurfaceGroups()) {

IdfExtensibleGroup eg = idfObject.pushExtensibleGroup();
eg.setString(SurfaceProperty_GroundSurfacesExtensibleFields::GroundSurfaceName, group.groundSurfaceName());
eg.setDouble(SurfaceProperty_GroundSurfacesExtensibleFields::GroundSurfaceViewFactor, group.viewFactor());
if (auto sch_ = group.temperatureSchedule()) {
if (boost::optional<IdfObject> _owo = translateAndMapModelObject(sch_.get())) {
eg.setString(SurfaceProperty_GroundSurfacesExtensibleFields::GroundSurfaceTemperatureScheduleName, _owo->nameString());
} // TODO: handle failure?
}
if (auto sch_ = group.reflectanceSchedule()) {
if (boost::optional<IdfObject> _owo = translateAndMapModelObject(sch_.get())) {
eg.setString(SurfaceProperty_GroundSurfacesExtensibleFields::GroundSurfaceReflectanceScheduleName, _owo->nameString());
} // TODO: handle failure?
}
}

return idfObject;
} // End of translate function

} // end namespace energyplus
} // end namespace openstudio
Loading