Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Addresses #5227, updates to Controller:OutdoorAir #5237

Merged
merged 28 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e4e6558
Add humidistat control zone getters and setters.
joseph-robertson Aug 16, 2024
b9a8c14
Update ft and rt for humidistat control zone.
joseph-robertson Aug 16, 2024
7f2a379
Add a model test.
joseph-robertson Aug 16, 2024
07f5034
Formatting.
joseph-robertson Aug 16, 2024
ba9bc10
Add electronic enthalpy limit curve getters and setters.
joseph-robertson Aug 16, 2024
6f7f67b
Update ft and rt for curves and schedules.
joseph-robertson Aug 16, 2024
3f249dc
Formatting.
joseph-robertson Aug 16, 2024
4c58131
Clean up.
joseph-robertson Aug 19, 2024
f1c8943
Deprecate setHighHumidityControl and instead use setHumidistatControl…
joseph-robertson Aug 19, 2024
5d7a6bf
Update ft for checking that humidistat control zone has a zone contro…
joseph-robertson Aug 19, 2024
5d20d04
Clean up getters, ft, and model tests.
joseph-robertson Oct 4, 2024
4293bd4
Remove remaining extra getXXX methods.
joseph-robertson Oct 4, 2024
96e3ca8
Clean up cpp file.
joseph-robertson Oct 4, 2024
936ae1f
Fix typos in rt file.
joseph-robertson Oct 4, 2024
009e003
More typos, and update rt.
joseph-robertson Oct 4, 2024
4e54e88
Typos in model test.
joseph-robertson Oct 4, 2024
34fdbb3
Clean up old bool get methods.
joseph-robertson Oct 7, 2024
199d8ee
Fix setting high humidity control to Yes or No based on other fields.
joseph-robertson Oct 7, 2024
325ef2d
Make other humidity fields required, add vt, and deprecate humidity c…
joseph-robertson Oct 8, 2024
1202392
Formatting.
joseph-robertson Oct 8, 2024
457dae1
Typos in model test file.
joseph-robertson Oct 8, 2024
f3b874f
Update model and vt test files.
joseph-robertson Oct 8, 2024
26520c9
Remove optional from newly required fields and break getters.
joseph-robertson Oct 8, 2024
8790298
Typo in cpp file.
joseph-robertson Oct 8, 2024
c36adbe
Make the 3.8.0 release notes + update template with YAML header for p…
jmarrec Oct 9, 2024
1430a0e
Start a 3.9.0 release Notes and add the API break in there (and the u…
jmarrec Oct 9, 2024
622a258
Clean up and fix ctor.
joseph-robertson Oct 9, 2024
330ad0c
Update and fix vt tests.
joseph-robertson Oct 9, 2024
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
4 changes: 2 additions & 2 deletions resources/model/OpenStudio.idd
Original file line number Diff line number Diff line change
Expand Up @@ -22427,15 +22427,15 @@ OS:Controller:OutdoorAir,
\note This field is only used when the field High Humidity Control = Yes.
\type real
\minimum> 0
\default 1.0
\required-field
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Making this required. Updating ctor to set to 1.0. Requires vt.

A19, \field Control High Indoor Humidity Based on Outdoor Humidity Ratio
\note If No is selected, the outdoor air flow rate is modified any time indoor relative
\note humidity is above the humidistat setpoint. If Yes is selected, the outdoor air
\note flow rate is modified any time the indoor relative humidity is above the humidistat
\note setpoint and the outdoor humidity ratio is less than the indoor humidity ratio.
\note This field is only used when the field High Humidity Control = Yes.
\type choice
\default Yes
\required-field
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Making this required. Updating ctor to set to "Yes". Requires vt.

\key Yes
\key No
A20, \field Heat Recovery Bypass Control Type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#include "../../model/ControllerMechanicalVentilation.hpp"
#include "../../model/Node.hpp"
#include "../../model/Schedule.hpp"
#include "../../model/ThermalZone.hpp"
#include "../../model/Curve.hpp"
#include "../../model/ZoneControlHumidistat.hpp"
#include <utilities/idd/Controller_OutdoorAir_FieldEnums.hxx>
#include <utilities/idd/IddEnums.hxx>

Expand Down Expand Up @@ -119,9 +122,14 @@ namespace energyplus {
} else {
idfObject.setString(openstudio::Controller_OutdoorAirFields::EconomizerMaximumLimitDewpointTemperature, "");
}

///////////////////////////////////////////////////////////////////////////
// Field: Electronic Enthalpy Limit Curve Name ////////////////////////////
idfObject.setString(openstudio::Controller_OutdoorAirFields::ElectronicEnthalpyLimitCurveName, "");
if (boost::optional<model::Curve> curve = modelObject.electronicEnthalpyLimitCurve()) {
if (boost::optional<IdfObject> _curve = translateAndMapModelObject(curve.get())) {
idfObject.setString(Controller_OutdoorAirFields::ElectronicEnthalpyLimitCurveName, _curve->name().get());
}
}

///////////////////////////////////////////////////////////////////////////
// Field: Economizer Minimum Limit DryBulb Temperature ////////////////////
Expand Down Expand Up @@ -151,20 +159,28 @@ namespace energyplus {
}
}

// HumidistatControlZoneName
if (auto zone_ = modelObject.humidistatControlZone()) {
if (boost::optional<ZoneControlHumidistat> humidistat = zone_->zoneControlHumidistat()) {
idfObject.setString(openstudio::Controller_OutdoorAirFields::HumidistatControlZoneName, zone_->nameString());
} else {
LOG(Warn, modelObject.briefDescription() << " has a humidistat control zone " << zone_->nameString()
<< " without a zone control humidistat; humidistat control zone field will not be translated");
idfObject.setString(openstudio::Controller_OutdoorAirFields::HighHumidityControl, "No");
joseph-robertson marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

HumidistatControlZoneName is required when HighHumidityControl is "Yes"; so if we can't set HumidistatControlZoneName, then HighHumidityControl must be set to "No".

}
}

// HighHumidityOutdoorAirFlowRatio
d = modelObject.getHighHumidityOutdoorAirFlowRatio();
if (d) {
idfObject.setDouble(openstudio::Controller_OutdoorAirFields::HighHumidityOutdoorAirFlowRatio, *d);
}

// ControlHighIndoorHumidityBasedonOutdoorHumidityRatio
ob = modelObject.getControlHighIndoorHumidityBasedOnOutdoorHumidityRatio();
if (ob) {
if (*ob) {
idfObject.setString(openstudio::Controller_OutdoorAirFields::ControlHighIndoorHumidityBasedonOutdoorHumidityRatio, "Yes");
} else {
idfObject.setString(openstudio::Controller_OutdoorAirFields::ControlHighIndoorHumidityBasedonOutdoorHumidityRatio, "No");
}
if (modelObject.getControlHighIndoorHumidityBasedOnOutdoorHumidityRatio()) {
idfObject.setString(openstudio::Controller_OutdoorAirFields::ControlHighIndoorHumidityBasedonOutdoorHumidityRatio, "Yes");
} else {
idfObject.setString(openstudio::Controller_OutdoorAirFields::ControlHighIndoorHumidityBasedonOutdoorHumidityRatio, "No");
}

// HeatRecoveryBypassControlType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
#include "../ReverseTranslator.hpp"
#include "../../model/ControllerOutdoorAir.hpp"
#include "../../model/ControllerOutdoorAir_Impl.hpp"
#include "../../model/ThermalZone.hpp"
#include "../../model/ThermalZone_Impl.hpp"
#include "../../model/Space.hpp"
#include "../../model/Space_Impl.hpp"
#include "../../model/Curve.hpp"
#include "../../model/Curve_Impl.hpp"
#include "../../model/Schedule.hpp"
#include "../../model/Schedule_Impl.hpp"
#include <utilities/idd/Controller_OutdoorAir_FieldEnums.hxx>
#include "../../utilities/idd/IddEnums.hpp"
#include <utilities/idd/IddEnums.hxx>
Expand All @@ -22,6 +30,9 @@ namespace energyplus {
return boost::none;
}

boost::optional<WorkspaceObject> _wo;
boost::optional<ModelObject> _mo;

ControllerOutdoorAir mo(m_model);

boost::optional<std::string> s = workspaceObject.getString(Controller_OutdoorAirFields::Name);
Expand Down Expand Up @@ -64,9 +75,14 @@ namespace energyplus {
mo.setEconomizerMaximumLimitDewpointTemperature(value.get());
}

s = workspaceObject.getString(Controller_OutdoorAirFields::ElectronicEnthalpyLimitCurveName);
if (s) {
LOG(Error, "ControllerOutdoorAir " << workspaceObject.briefDescription() << " references a curve that is not supported");
if ((_wo = workspaceObject.getTarget(Controller_OutdoorAirFields::ElectronicEnthalpyLimitCurveName))) {
if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) {
if (boost::optional<Curve> _curve = _mo->optionalCast<Curve>()) {
mo.setElectronicEnthalpyLimitCurve(_curve.get());
} else {
LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'Electronic Enthalpy Limit Curve Name'");
}
}
}

value = workspaceObject.getDouble(Controller_OutdoorAirFields::EconomizerMinimumLimitDryBulbTemperature);
Expand All @@ -84,22 +100,34 @@ namespace energyplus {
mo.setMinimumLimitType(s.get());
}

s = workspaceObject.getString(Controller_OutdoorAirFields::MinimumOutdoorAirScheduleName);
if (s) {
LOG(Warn,
"ControllerOutdoorAir " << workspaceObject.briefDescription() << " references a minimum outdoor air schedule, which is not supported");
if ((_wo = workspaceObject.getTarget(Controller_OutdoorAirFields::MinimumOutdoorAirScheduleName))) {
if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) {
if (boost::optional<Schedule> _schedule = _mo->optionalCast<Schedule>()) {
mo.setMinimumOutdoorAirSchedule(_schedule.get());
} else {
LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'Minimum Outdoor Air Schedule Name'");
}
}
}

s = workspaceObject.getString(Controller_OutdoorAirFields::MinimumFractionofOutdoorAirScheduleName);
if (s) {
LOG(Warn, "ControllerOutdoorAir " << workspaceObject.briefDescription()
<< " references a minimum fraction of outdoor air schedule, which is not supported");
if ((_wo = workspaceObject.getTarget(Controller_OutdoorAirFields::MinimumFractionofOutdoorAirScheduleName))) {
if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) {
if (boost::optional<Schedule> _schedule = _mo->optionalCast<Schedule>()) {
mo.setMinimumFractionofOutdoorAirSchedule(_schedule.get());
} else {
LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'Minimum Fraction of Outdoor Air Schedule Name'");
}
}
}

s = workspaceObject.getString(Controller_OutdoorAirFields::MaximumFractionofOutdoorAirScheduleName);
if (s) {
LOG(Warn, "ControllerOutdoorAir " << workspaceObject.briefDescription()
<< " references a maximum fraction of outdoor air schedule, which is not supported");
if ((_wo = workspaceObject.getTarget(Controller_OutdoorAirFields::MaximumFractionofOutdoorAirScheduleName))) {
if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) {
if (boost::optional<Schedule> _schedule = _mo->optionalCast<Schedule>()) {
mo.setMaximumFractionofOutdoorAirSchedule(_schedule.get());
} else {
LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'Maximum Fraction of Outdoor Air Schedule Name'");
}
}
}

s = workspaceObject.getString(Controller_OutdoorAirFields::MechanicalVentilationControllerName);
Expand All @@ -108,24 +136,27 @@ namespace energyplus {
"ControllerOutdoorAir " << workspaceObject.briefDescription() << " references a mechanical ventilation controller, which is not supported");
}

s = workspaceObject.getString(Controller_OutdoorAirFields::TimeofDayEconomizerControlScheduleName);
if (s) {
LOG(Warn, "ControllerOutdoorAir " << workspaceObject.briefDescription()
<< " references a time of day economizer control schedule, which is not supported");
}

s = workspaceObject.getString(Controller_OutdoorAirFields::HighHumidityControl);
if (s) {
if (istringEqual("Yes", s.get())) {
mo.setHighHumidityControl(true);
} else {
mo.setHighHumidityControl(false);
if ((_wo = workspaceObject.getTarget(Controller_OutdoorAirFields::TimeofDayEconomizerControlScheduleName))) {
if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) {
if (boost::optional<Schedule> _schedule = _mo->optionalCast<Schedule>()) {
mo.setTimeofDayEconomizerControlSchedule(_schedule.get());
} else {
LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'Time of Day Economizer Control Schedule Name'");
}
}
}

s = workspaceObject.getString(Controller_OutdoorAirFields::HumidistatControlZoneName);
if (s) {
LOG(Warn, "ControllerOutdoorAir " << workspaceObject.briefDescription() << " references a high humidity control zone, which is not supported");
if ((_wo = workspaceObject.getTarget(Controller_OutdoorAirFields::HumidistatControlZoneName))) {
if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) {
// Zone is translated, and a Space is returned instead
if (boost::optional<Space> space_ = _mo->optionalCast<Space>()) {
if (auto z_ = space_->thermalZone()) {
mo.setHumidistatControlZone(z_.get());
}
} else {
LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'Humidistat Control Zone Name'");
}
}
}

value = workspaceObject.getDouble(Controller_OutdoorAirFields::HighHumidityOutdoorAirFlowRatio);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ namespace energyplus {
}
}
}

// Night Ventilation Mode Pressure Rise: Optional Double
if (boost::optional<double> _nightVentilationModePressureRise =
workspaceObject.getDouble(Fan_SystemModelFields::NightVentilationModePressureRise)) {
Expand Down
1 change: 0 additions & 1 deletion src/model/AirConditionerVariableRefrigerantFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,6 @@ namespace model {

bool AirConditionerVariableRefrigerantFlow_Impl::setHeatPumpWasteHeatRecovery(bool heatPumpWasteHeatRecovery) {
return setBooleanFieldValue(OS_AirConditioner_VariableRefrigerantFlowFields::HeatPumpWasteHeatRecovery, heatPumpWasteHeatRecovery);
;
}

bool AirConditionerVariableRefrigerantFlow_Impl::setEquivalentPipingLengthusedforPipingCorrectionFactorinCoolingMode(
Expand Down
Loading
Loading