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

ControllerOutdoorAir: new Economizer Operation Staging field #4948

Merged
merged 12 commits into from
Sep 26, 2023

Conversation

joseph-robertson
Copy link
Collaborator

@joseph-robertson joseph-robertson commented Aug 29, 2023

Pull request overview

  • Support new "Economizer Operation Staging" field for Controller:OutdoorAir.

Pull Request Author

  • Model API Changes / Additions
  • Any new or modified fields have been implemented in the EnergyPlus ForwardTranslator (and ReverseTranslator as appropriate)
  • Model API methods are tested (in src/model/test)
  • EnergyPlus ForwardTranslator Tests (in src/energyplus/Test)
  • If a new object or method, added a test in NREL/OpenStudio-resources: Add Link
  • If needed, added VersionTranslation rules for the objects (src/osversion/VersionTranslator.cpp)
  • Verified that C# bindings built fine on Windows, partial classes used as needed, etc.
  • All new and existing tests passes
  • If methods have been deprecated, update rest of code to use the new methods

Labels:

  • If change to an IDD file, add the label IDDChange
  • If breaking existing API, add the label APIChange
  • If deemed ready, add label Pull Request - Ready for CI so that CI builds your PR

Review Checklist

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • Code Style, strip trailing whitespace, etc.
  • All related changes have been implemented: model changes, model tests, FT changes, FT tests, VersionTranslation, OS App
  • Labeling is ok
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified

@joseph-robertson joseph-robertson added this to the OpenStudio SDK 3.7.0 milestone Aug 29, 2023
@joseph-robertson joseph-robertson self-assigned this Aug 29, 2023
@joseph-robertson joseph-robertson mentioned this pull request Aug 29, 2023
26 tasks
@joseph-robertson joseph-robertson added Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. IDDChange labels Aug 29, 2023
Comment on lines 21269 to 21273
A21; \field Economizer Operation Staging
\type choice
\key EconomizerFirst
\key InterlockedWithMechanicalCooling
\default InterlockedWithMechanicalCooling
Copy link
Collaborator

Choose a reason for hiding this comment

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

As usual, torn on whether we should make this required-field or not... The field above isn't.

@kbenne

Copy link
Contributor

Choose a reason for hiding this comment

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

I think because it is a new field we don't risk breaking an API so required field is better. That is, fewer options is better and I don't see much downside except perhaps being a little inconsistent with similar cases.

Comment on lines 122 to 123
boost::optional<std::string> getEconomizerOperationStaging() const;
bool setEconomizerOperationStaging(const std::string& v);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Pffff. Another one where the existing API doesn't follow the convention.

This should be std::string economizerOperationStaging() const. Not getXXXX. And it has a default (at least currently), so no need to return an optional.
And there should be a isEconomizerOperationStagingDefaulted and a resetEconomizerOperationStaging if we do intend to have a default instead of making it required-field.

@kbenne thoughts please.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like we can keep (and depricate) the existing "get" method and add the new (correct) std::string economizerOperationStaging() const. Is that right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No deprecation necessary - this is a new field. I'll follow the convention for required-field (which is "correct" but inconsistent with other fields on this object).

Copy link
Collaborator

Choose a reason for hiding this comment

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

This specific comment was more about fixing the existing API, not the new field.
You don't have to do it here, we have lots to do at the moment. But we should file an issue to fix it later if it's not done here.

Copy link
Collaborator

@jmarrec jmarrec Sep 26, 2023

Choose a reason for hiding this comment

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

Comment on lines +8603 to +8617
} else if (iddname == "OS:Controller:OutdoorAir") {

// 1 Field has been added from 3.6.1 to 3.7.0:
// -------------------------------------------
// * Economizer Operation Staging * 27
auto iddObject = idd_3_7_0.getObject(iddname);
IdfObject newObject(iddObject.get());

for (size_t i = 0; i < object.numFields(); ++i) {
if ((value = object.getString(i))) {
newObject.setString(i, value.get());
}
}

newObject.setString(27, "InterlockedWithMechanicalCooling");
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

"Economizer Operation Staging" is required, so we need VT...

Copy link
Collaborator

@jmarrec jmarrec left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +21661 to +21665
A21; \field Economizer Operation Staging
\type choice
\key EconomizerFirst
\key InterlockedWithMechanicalCooling
\required-field
Copy link
Collaborator

Choose a reason for hiding this comment

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

Required field, all good

Comment on lines +122 to +123
std::string economizerOperationStaging() const;
bool setEconomizerOperationStaging(const std::string& v);
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

EXPECT_TRUE(coa.isEmpty(24)); // High Humidity Outdoor Air Flow Ratio
EXPECT_TRUE(coa.isEmpty(25)); // Control High Indoor Humidity Based on Outdoor Humidity Ratio
EXPECT_EQ("BypassWhenWithinEconomizerLimits", coa.getString(26).get()); // Heat Recovery Bypass Control Type
EXPECT_EQ("InterlockedWithMechanicalCooling", coa.getString(27).get()); // Economizer Operation Staging
Copy link
Collaborator

Choose a reason for hiding this comment

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

GOod

@@ -597,6 +604,7 @@ namespace model {
setString(OS_Controller_OutdoorAirFields::HighHumidityOutdoorAirFlowRatio, "");
setString(OS_Controller_OutdoorAirFields::ControlHighIndoorHumidityBasedonOutdoorHumidityRatio, "");
setHeatRecoveryBypassControlType("BypassWhenWithinEconomizerLimits");
setEconomizerOperationStaging("InterlockedWithMechanicalCooling");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good

@@ -173,6 +173,9 @@ namespace energyplus {
idfObject.setString(openstudio::Controller_OutdoorAirFields::HeatRecoveryBypassControlType, *s);
}

// EconomizerOperationStaging
idfObject.setString(openstudio::Controller_OutdoorAirFields::EconomizerOperationStaging, modelObject.economizerOperationStaging());
Copy link
Collaborator

Choose a reason for hiding this comment

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

great

Comment on lines +150 to +153
s = workspaceObject.getString(Controller_OutdoorAirFields::EconomizerOperationStaging);
if (s) {
mo.setEconomizerOperationStaging(s.get());
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

If not present, uses the Ctor default, no problem here

@jmarrec jmarrec merged commit 455fc44 into v23.2.0-IOFreeze Sep 26, 2023
3 of 4 checks passed
@jmarrec jmarrec deleted the controller-outdoor-air branch September 26, 2023 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IDDChange Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants