Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
135 changes: 1 addition & 134 deletions resources/energyplus/ProposedEnergy+.idd
Original file line number Diff line number Diff line change
Expand Up @@ -10271,144 +10271,11 @@ ZoneMRTCalculation,
\note A People object expanded across multiple Spaces must use an expanded instance name
\note formed as "<Space Name> <People Name>"; its original input name is not accepted.
\note People instances in automatically generated remainder Spaces are not supported.
N1 , \field MRT Weighting Factor 1
N1 ; \field MRT Weighting Factor 1
\type real
\minimum 0.0
\maximum 1.0
\required-field
A3 , \field People 2 Name
\type object-list
\object-list PeopleNames
N2 , \field MRT Weighting Factor 2
\type real
\minimum 0.0
\maximum 1.0
A4 , \field People 3 Name
\type object-list
\object-list PeopleNames
N3 , \field MRT Weighting Factor 3
\type real
\minimum 0.0
\maximum 1.0
A5 , \field People 4 Name
\type object-list
\object-list PeopleNames
N4 , \field MRT Weighting Factor 4
\type real
\minimum 0.0
\maximum 1.0
A6 , \field People 5 Name
\type object-list
\object-list PeopleNames
N5 , \field MRT Weighting Factor 5
\type real
\minimum 0.0
\maximum 1.0
A7 , \field People 6 Name
\type object-list
\object-list PeopleNames
N6 , \field MRT Weighting Factor 6
\type real
\minimum 0.0
\maximum 1.0
A8 , \field People 7 Name
\type object-list
\object-list PeopleNames
N7 , \field MRT Weighting Factor 7
\type real
\minimum 0.0
\maximum 1.0
A9 , \field People 8 Name
\type object-list
\object-list PeopleNames
N8 , \field MRT Weighting Factor 8
\type real
\minimum 0.0
\maximum 1.0
A10 , \field People 9 Name
\type object-list
\object-list PeopleNames
N9 , \field MRT Weighting Factor 9
\type real
\minimum 0.0
\maximum 1.0
A11, \field People 10 Name
\type object-list
\object-list PeopleNames
N10, \field MRT Weighting Factor 10
\type real
\minimum 0.0
\maximum 1.0
A12, \field People 11 Name
\type object-list
\object-list PeopleNames
N11, \field MRT Weighting Factor 11
\type real
\minimum 0.0
\maximum 1.0
A13, \field People 12 Name
\type object-list
\object-list PeopleNames
N12, \field MRT Weighting Factor 12
\type real
\minimum 0.0
\maximum 1.0
A14, \field People 13 Name
\type object-list
\object-list PeopleNames
N13, \field MRT Weighting Factor 13
\type real
\minimum 0.0
\maximum 1.0
A15, \field People 14 Name
\type object-list
\object-list PeopleNames
N14, \field MRT Weighting Factor 14
\type real
\minimum 0.0
\maximum 1.0
A16, \field People 15 Name
\type object-list
\object-list PeopleNames
N15, \field MRT Weighting Factor 15
\type real
\minimum 0.0
\maximum 1.0
A17, \field People 16 Name
\type object-list
\object-list PeopleNames
N16, \field MRT Weighting Factor 16
\type real
\minimum 0.0
\maximum 1.0
A18, \field People 17 Name
\type object-list
\object-list PeopleNames
N17, \field MRT Weighting Factor 17
\type real
\minimum 0.0
\maximum 1.0
A19, \field People 18 Name
\type object-list
\object-list PeopleNames
N18, \field MRT Weighting Factor 18
\type real
\minimum 0.0
\maximum 1.0
A20, \field People 19 Name
\type object-list
\object-list PeopleNames
N19, \field MRT Weighting Factor 19
\type real
\minimum 0.0
\maximum 1.0
A21, \field People 20 Name
\type object-list
\object-list PeopleNames
N20; \field MRT Weighting Factor 20
\type real
\minimum 0.0
\maximum 1.0

\group Detailed Ground Heat Transfer

Expand Down
31 changes: 31 additions & 0 deletions resources/model/OpenStudio.idd
Original file line number Diff line number Diff line change
Expand Up @@ -6815,6 +6815,37 @@ OS:ZoneProperty:UserViewFactors:BySurfaceName,
\type real
\maximum 1.0

OS:ZoneMRTCalculation,
\min-fields 4
\memo Blends MRT values calculated for People instances into one Zone MRT.
\memo The weighting factors must sum to a value from 0.0 through 1.0.
\extensible:2 - repeat last two fields, remembering to remove ; from "inner" fields.
\memo Only one ZoneMRTCalculation object is allowed for each Zone.
\memo All referenced People instances must be in the named Zone and must select at least
\memo one Thermal Comfort Model Type.
A1, \field Handle
\type handle
\required-field
A2, \field Thermal Zone Name
\type object-list
\object-list ThermalZoneNames
\required-field
\note This field accepts a Zone name only, not a Space or SpaceList name.
A3, \field People 1 Name
\begin-extensible
\type object-list
\object-list PeopleNames
\required-field
\note A People object assigned directly to a Space retains its input name.
\note A People object expanded across multiple Spaces must use an expanded instance name
\note formed as "<Space Name> <People Name>"; its original input name is not accepted.
\note People instances in automatically generated remainder Spaces are not supported.
N1; \field MRT Weighting Factor 1
\type real
\minimum 0.0
\maximum 1.0
\required-field

OS:SurfaceProperty:SurroundingSurfaces,
\min-fields 9
\memo This object defines a list of surrounding surfaces for an exterior surface.
Expand Down
3 changes: 3 additions & 0 deletions src/energyplus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ set(${target_name}_src
ForwardTranslator/ForwardTranslateZoneHVACUnitVentilator.cpp
ForwardTranslator/ForwardTranslateZoneHVACWaterToAirHeatPump.cpp
ForwardTranslator/ForwardTranslateZoneMixing.cpp
ForwardTranslator/ForwardTranslateZoneMRTCalculation.cpp
ForwardTranslator/ForwardTranslateZonePropertyUserViewFactorsBySurfaceName.cpp
ForwardTranslator/ForwardTranslateZoneVentilationDesignFlowRate.cpp
ForwardTranslator/ForwardTranslateZoneVentilationWindandStackOpenArea.cpp
Expand Down Expand Up @@ -650,6 +651,7 @@ set(${target_name}_src
ReverseTranslator/ReverseTranslateZoneInfiltrationFlowCoefficient.cpp
ReverseTranslator/ReverseTranslateZoneList.cpp
ReverseTranslator/ReverseTranslateZoneMixing.cpp
ReverseTranslator/ReverseTranslateZoneMRTCalculation.cpp
ReverseTranslator/ReverseTranslateZonePropertyUserViewFactorsBySurfaceName.cpp
ReverseTranslator/ReverseTranslateZoneVentilationDesignFlowRate.cpp
ReverseTranslator/ReverseTranslateZoneVentilationWindandStackOpenArea.cpp
Expand Down Expand Up @@ -875,6 +877,7 @@ set(${target_name}_test_src
Test/ZoneHVACUnitHeater_GTest.cpp
Test/ZoneHVACWaterToAirHeatPump_GTest.cpp
Test/ZoneMixing_GTest.cpp
Test/ZoneMRTCalculation_GTest.cpp
Test/ZonePropertyUserViewFactorsBySurfaceName_GTest.cpp
Test/ZoneVentilationDesignFlowRate_GTest.cpp
Test/ZoneVentilationWindandStackOpenArea_GTest.cpp
Expand Down
6 changes: 6 additions & 0 deletions src/energyplus/ForwardTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3348,6 +3348,11 @@ namespace energyplus {
retVal = translateZoneMixing(mo);
break;
}
case openstudio::IddObjectType::OS_ZoneMRTCalculation: {
auto mo = modelObject.cast<ZoneMRTCalculation>();
retVal = translateZoneMRTCalculation(mo);
break;
}
case openstudio::IddObjectType::OS_ZoneProperty_UserViewFactors_BySurfaceName: {
auto mo = modelObject.cast<ZonePropertyUserViewFactorsBySurfaceName>();
retVal = translateZonePropertyUserViewFactorsBySurfaceName(mo);
Expand Down Expand Up @@ -3504,6 +3509,7 @@ namespace energyplus {
IddObjectType::OS_ShadingSurfaceGroup,
IddObjectType::OS_ShadingSurface,

IddObjectType::OS_ZoneMRTCalculation,
IddObjectType::OS_ZoneProperty_UserViewFactors_BySurfaceName,

IddObjectType::OS_Daylighting_Control,
Expand Down
3 changes: 3 additions & 0 deletions src/energyplus/ForwardTranslator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ namespace model {
class ZoneHVACUnitVentilator;
class ZoneHVACWaterToAirHeatPump;
class ZoneMixing;
class ZoneMRTCalculation;
class ZonePropertyUserViewFactorsBySurfaceName;
class ZoneVentilationDesignFlowRate;
class ZoneVentilationWindandStackOpenArea;
Expand Down Expand Up @@ -1616,6 +1617,8 @@ namespace energyplus {

boost::optional<IdfObject> translateZoneMixing(model::ZoneMixing& modelObject);

boost::optional<IdfObject> translateZoneMRTCalculation(model::ZoneMRTCalculation& modelObject);

boost::optional<IdfObject> translateZonePropertyUserViewFactorsBySurfaceName(model::ZonePropertyUserViewFactorsBySurfaceName& modelObject);

boost::optional<IdfObject> createAirLoopHVACSupplyPath(const model::Node& demandInletNode);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/***********************************************************************************************************************
* OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC.
* See also https://openstudio.net/license
***********************************************************************************************************************/

#include "../ForwardTranslator.hpp"

#include "../../model/Model.hpp"
#include "../../model/People.hpp"
#include "../../model/People_Impl.hpp"
#include "../../model/PeopleDefinition.hpp"
#include "../../model/PeopleDefinition_Impl.hpp"
#include "../../model/Space.hpp"
#include "../../model/Space_Impl.hpp"
#include "../../model/ThermalZone.hpp"
#include "../../model/ThermalZone_Impl.hpp"
#include "../../model/ZoneMRTCalculation.hpp"
#include "../../model/ZoneMRTCalculation_Impl.hpp"

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

#include <utilities/idd/IddEnums.hxx>
#include <utilities/idd/ZoneMRTCalculation_FieldEnums.hxx>

using namespace openstudio::model;

namespace openstudio {

namespace energyplus {

boost::optional<IdfObject> ForwardTranslator::translateZoneMRTCalculation(ZoneMRTCalculation& modelObject) {
ThermalZone zone = modelObject.thermalZone();
boost::optional<IdfObject> _zone = translateAndMapModelObject(zone);
if (!_zone) {
LOG(Error, "ZoneMRTCalculation references a zone '" << zone.nameString() << "' that was not translated, so it will not be translated either");
return boost::none;
}

std::vector<MRTWeightingFactor> mrtWeightingFactors = modelObject.mrtWeightingFactors();
if (mrtWeightingFactors.empty()) {
LOG(Error,
"ZoneMRTCalculation for zone '" << zone.nameString() << "' doesn't have at least one MRT weighting factor, it will not be translated.");
return boost::none;
}

std::vector<std::pair<std::string, double>> translatedMRTWeightingFactors;
double sum = 0.0;

for (const MRTWeightingFactor& mrtWeightingFactor : mrtWeightingFactors) {
People people = mrtWeightingFactor.people();

boost::optional<Space> space = people.space();
boost::optional<ThermalZone> thermalZone;
if (space) {
thermalZone = space->thermalZone();
}

if (!thermalZone || (thermalZone->handle() != zone.handle())) {
LOG(Error, "Could not translate an MRTWeightingFactor group for " << modelObject.briefDescription() << " because "
<< people.briefDescription()
<< " is not assigned to the ZoneMRTCalculation ThermalZone.");
continue;
}

if (people.peopleDefinition().numThermalComfortModelTypes() == 0) {
LOG(Error, "Could not translate an MRTWeightingFactor group for " << modelObject.briefDescription() << " because "
<< people.briefDescription()
<< " does not select at least one Thermal Comfort Model Type.");
continue;
}

boost::optional<IdfObject> _people = translateAndMapModelObject(people);

if (_people) {
Comment on lines +49 to +74

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double value = mrtWeightingFactor.mrtWeightingFactor();
sum += value;
if (sum > 1.0) {
LOG(Error, "Could not translate an MRTWeightingFactor group for " << modelObject.briefDescription()
<< " because the MRT Weighting Factors would sum to " << sum
<< ", which is greater than 1.");
sum -= value;
continue;
}

translatedMRTWeightingFactors.emplace_back(_people->name().get(), value);
} else {
LOG(Error, "Could not translate an MRTWeightingFactor group for " << modelObject.briefDescription() << ". Continuing with the rest.");
}
}

if (translatedMRTWeightingFactors.empty()) {
LOG(Error, "ZoneMRTCalculation for zone '" << zone.nameString()
<< "' doesn't have at least one valid MRT weighting factor, it will not be translated.");
return boost::none;
}

IdfObject idfObject(openstudio::IddObjectType::ZoneMRTCalculation);
m_idfObjects.push_back(idfObject);

idfObject.setString(ZoneMRTCalculationFields::ZoneName, _zone->name().get());

for (const auto& translatedMRTWeightingFactor : translatedMRTWeightingFactors) {
auto eg = idfObject.pushExtensibleGroup();
eg.setString(ZoneMRTCalculationExtensibleFields::PeopleName, translatedMRTWeightingFactor.first);
eg.setDouble(ZoneMRTCalculationExtensibleFields::MRTWeightingFactor, translatedMRTWeightingFactor.second);
}

return idfObject;
}

} // namespace energyplus

} // namespace openstudio
4 changes: 4 additions & 0 deletions src/energyplus/ReverseTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,10 @@ namespace energyplus {
modelObject = translateZoneMixing(workspaceObject);
break;
}
case openstudio::IddObjectType::ZoneMRTCalculation: {
modelObject = translateZoneMRTCalculation(workspaceObject);
break;
}
case openstudio::IddObjectType::ZoneProperty_UserViewFactors_BySurfaceName: {
modelObject = translateZonePropertyUserViewFactorsBySurfaceName(workspaceObject);
break;
Expand Down
2 changes: 2 additions & 0 deletions src/energyplus/ReverseTranslator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,8 @@ namespace energyplus {

boost::optional<model::ModelObject> translateZoneMixing(const WorkspaceObject& workspaceObject);

boost::optional<model::ModelObject> translateZoneMRTCalculation(const WorkspaceObject& workspaceObject);

boost::optional<model::ModelObject> translateZonePropertyUserViewFactorsBySurfaceName(const WorkspaceObject& workspaceObject);

boost::optional<model::ModelObject> translateZoneVentilationDesignFlowRate(const WorkspaceObject& workspaceObject);
Expand Down
Loading
Loading