Skip to content

Commit

Permalink
Merge pull request #3981 from NREL/2977_VAVReheatMethodName
Browse files Browse the repository at this point in the history
Fix #2977 - Make VAVReheat Method consistent with IDD and other objects
  • Loading branch information
tijcolem authored Jun 4, 2020
2 parents 959d499 + de1a08c commit 57eeafd
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ boost::optional<IdfObject> ForwardTranslator::translateAirTerminalSingleDuctVAVN
idfObject.setString(AirTerminal_SingleDuct_VAV_NoReheatFields::MaximumAirFlowRate,"Autosize");
}

// ZoneMinimumAirFlowMethod
// ZoneMinimumAirFlowInputMethod
s = modelObject.zoneMinimumAirFlowInputMethod();
if( s )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ boost::optional<IdfObject> ForwardTranslator::translateAirTerminalSingleDuctVAVR
idfObject.setString(AirTerminal_SingleDuct_VAV_ReheatFields::MaximumAirFlowRate,"Autosize");
}

// ZoneMinimumAirFlowMethod
s = modelObject.zoneMinimumAirFlowMethod();
// ZoneMinimumAirFlowInputMethod
s = modelObject.zoneMinimumAirFlowInputMethod();
if( s )
{
idfObject.setString(AirTerminal_SingleDuct_VAV_ReheatFields::ZoneMinimumAirFlowInputMethod,s.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ OptionalModelObject ReverseTranslator::translateAirTerminalSingleDuctVAVReheat(
s = workspaceObject.getString(AirTerminal_SingleDuct_VAV_ReheatFields::ZoneMinimumAirFlowInputMethod);
if( s )
{
airTerminal->setZoneMinimumAirFlowMethod(s.get());
airTerminal->setZoneMinimumAirFlowInputMethod(s.get());
}

// ConstantMinimumAirFlowFraction
Expand Down
28 changes: 20 additions & 8 deletions src/model/AirTerminalSingleDuctVAVReheat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,12 @@ namespace detail{
return false;
}

std::string AirTerminalSingleDuctVAVReheat_Impl::zoneMinimumAirFlowMethod()
std::string AirTerminalSingleDuctVAVReheat_Impl::zoneMinimumAirFlowInputMethod()
{
return this->getString(OS_AirTerminal_SingleDuct_VAV_ReheatFields::ZoneMinimumAirFlowInputMethod).get();
}

bool AirTerminalSingleDuctVAVReheat_Impl::setZoneMinimumAirFlowMethod( std::string value )
bool AirTerminalSingleDuctVAVReheat_Impl::setZoneMinimumAirFlowInputMethod(const std::string& value)
{
if( istringEqual(value,"Constant") )
{
Expand Down Expand Up @@ -483,7 +483,7 @@ namespace detail{
return this->getString(OS_AirTerminal_SingleDuct_VAV_ReheatFields::DamperHeatingAction).get();
}

bool AirTerminalSingleDuctVAVReheat_Impl::setDamperHeatingAction( std::string value )
bool AirTerminalSingleDuctVAVReheat_Impl::setDamperHeatingAction(const std::string& value)
{
return setString(OS_AirTerminal_SingleDuct_VAV_ReheatFields::DamperHeatingAction,value);;
}
Expand Down Expand Up @@ -798,7 +798,7 @@ AirTerminalSingleDuctVAVReheat::AirTerminalSingleDuctVAVReheat( const Model& mod

autosizeMaximumAirFlowRate();

setZoneMinimumAirFlowMethod("Constant");
setZoneMinimumAirFlowInputMethod("Constant");

setConstantMinimumAirFlowFraction(0.3);

Expand Down Expand Up @@ -861,14 +861,26 @@ bool AirTerminalSingleDuctVAVReheat::isMaximumAirFlowRateAutosized() const
return getImpl<detail::AirTerminalSingleDuctVAVReheat_Impl>()->isMaximumAirFlowRateAutosized();
}

std::string AirTerminalSingleDuctVAVReheat::zoneMinimumAirFlowInputMethod()
{
return getImpl<detail::AirTerminalSingleDuctVAVReheat_Impl>()->zoneMinimumAirFlowInputMethod();
}

std::string AirTerminalSingleDuctVAVReheat::zoneMinimumAirFlowMethod()
{
return getImpl<detail::AirTerminalSingleDuctVAVReheat_Impl>()->zoneMinimumAirFlowMethod();
LOG(Warn,"zoneMinimumAirFlowMethod is deprecated, please use zoneMinimumAirFlowInputMethod");
return zoneMinimumAirFlowInputMethod();
}

bool AirTerminalSingleDuctVAVReheat::setZoneMinimumAirFlowInputMethod(const std::string& value )
{
return getImpl<detail::AirTerminalSingleDuctVAVReheat_Impl>()->setZoneMinimumAirFlowInputMethod(value);
}

bool AirTerminalSingleDuctVAVReheat::setZoneMinimumAirFlowMethod( std::string value )
bool AirTerminalSingleDuctVAVReheat::setZoneMinimumAirFlowMethod(const std::string& value )
{
return getImpl<detail::AirTerminalSingleDuctVAVReheat_Impl>()->setZoneMinimumAirFlowMethod(value);
LOG(Warn,"setZoneMinimumAirFlowMethod is deprecated, please use setZoneMinimumAirFlowInputMethod");
return setZoneMinimumAirFlowInputMethod(value);
}

boost::optional<double> AirTerminalSingleDuctVAVReheat::constantMinimumAirFlowFraction() const
Expand Down Expand Up @@ -968,7 +980,7 @@ std::string AirTerminalSingleDuctVAVReheat::damperHeatingAction()
return getImpl<detail::AirTerminalSingleDuctVAVReheat_Impl>()->damperHeatingAction();
}

bool AirTerminalSingleDuctVAVReheat::setDamperHeatingAction( std::string value )
bool AirTerminalSingleDuctVAVReheat::setDamperHeatingAction(const std::string& value)
{
return getImpl<detail::AirTerminalSingleDuctVAVReheat_Impl>()->setDamperHeatingAction(value);
}
Expand Down
12 changes: 9 additions & 3 deletions src/model/AirTerminalSingleDuctVAVReheat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "StraightComponent.hpp"
#include "Connection.hpp"
#include "ModelAPI.hpp"
#include "../utilities/core/Deprecated.hpp"

namespace openstudio {

Expand Down Expand Up @@ -84,12 +85,17 @@ class MODEL_API AirTerminalSingleDuctVAVReheat : public StraightComponent {
bool isMaximumAirFlowRateAutosized() const;

/** Returns the value of the MaximumAirFlowRate field. */
std::string zoneMinimumAirFlowMethod();
std::string zoneMinimumAirFlowInputMethod();
/** deprecated **/
OS_DEPRECATED std::string zoneMinimumAirFlowMethod();

/** Sets the value of the MaximumAirFlowRate field.
* Options are FixedFlowRate and Scheduled.
*/
bool setZoneMinimumAirFlowMethod( std::string value );
bool setZoneMinimumAirFlowInputMethod(const std::string& value );
/** deprecated **/
OS_DEPRECATED bool setZoneMinimumAirFlowMethod(const std::string& value );


/** Returns the value of the ConstantMinimumAirFlowFraction field. */
boost::optional<double> constantMinimumAirFlowFraction() const;
Expand Down Expand Up @@ -154,7 +160,7 @@ class MODEL_API AirTerminalSingleDuctVAVReheat : public StraightComponent {
/** Sets the value of the DamperHeatingAction field.
* Options are Normal and Reverse.
*/
bool setDamperHeatingAction( std::string value );
bool setDamperHeatingAction(const std::string& value);

/** Returns the value of the MaximumFlowPerZoneFloorAreaDuringReheat field. */
boost::optional<double> maximumFlowPerZoneFloorAreaDuringReheat();
Expand Down
6 changes: 3 additions & 3 deletions src/model/AirTerminalSingleDuctVAVReheat_Impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ namespace detail {

bool isMaximumAirFlowRateAutosized() const;

std::string zoneMinimumAirFlowMethod();
std::string zoneMinimumAirFlowInputMethod();

bool setZoneMinimumAirFlowMethod( std::string value );
bool setZoneMinimumAirFlowInputMethod(const std::string& value );

boost::optional<double> constantMinimumAirFlowFraction() const;
bool isConstantMinimumAirFlowFractionAutosized() const;
Expand Down Expand Up @@ -135,7 +135,7 @@ namespace detail {

std::string damperHeatingAction();

bool setDamperHeatingAction( std::string value );
bool setDamperHeatingAction(const std::string& value);

boost::optional<double> maximumFlowPerZoneFloorAreaDuringReheat();

Expand Down
6 changes: 3 additions & 3 deletions src/sdd/MapHVAC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4990,17 +4990,17 @@ boost::optional<model::ModelObject> ReverseTranslator::translateTrmlUnit(const p
pugi::xml_node minAirFracSchRefElement = trmlUnitElement.child("MinAirFracSchRef");
if( boost::optional<model::Schedule> minAirFracSch = model.getModelObjectByName<model::Schedule>(minAirFracSchRefElement.text().as_string()) )
{
terminal.setZoneMinimumAirFlowMethod("Scheduled");
terminal.setZoneMinimumAirFlowInputMethod("Scheduled");
terminal.setMinimumAirFlowFractionSchedule(minAirFracSch.get());
}
else if( primaryAirFlowMin )
{
terminal.setZoneMinimumAirFlowMethod("FixedFlowRate");
terminal.setZoneMinimumAirFlowInputMethod("FixedFlowRate");
terminal.setFixedMinimumAirFlowRate(primaryAirFlowMin.get());
}
else
{
terminal.setZoneMinimumAirFlowMethod("Constant");
terminal.setZoneMinimumAirFlowInputMethod("Constant");
terminal.setConstantMinimumAirFlowFraction(0.2);
}

Expand Down

0 comments on commit 57eeafd

Please sign in to comment.