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

Support "No Load Supply Air Flow Rate Ratio" on UnitarySystemPerformance:Multispeed #4749

Merged
merged 14 commits into from
Dec 9, 2022

Conversation

joseph-robertson
Copy link
Collaborator

@joseph-robertson joseph-robertson commented Nov 28, 2022

Pull request overview

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 component - Model Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. labels Nov 28, 2022
@joseph-robertson joseph-robertson self-assigned this Nov 28, 2022
@joseph-robertson joseph-robertson changed the base branch from develop to bump-vt November 29, 2022 15:41
Base automatically changed from bump-vt to develop November 30, 2022 16:19
@joseph-robertson joseph-robertson marked this pull request as ready for review November 30, 2022 18:20
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.

Made a couple of very minor changes. All good. Once CI reports success, we can merge. Thanks @joseph-robertson

Comment on lines +11364 to +11370
N1 , \field No Load Supply Air Flow Rate Ratio
\required-field
\type real
\minimum 0
\maximum 1
\note Used to define the no load operating air flow rate when the system fan
\note is specified to operate continuously.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, default of 1 is changed to be a required-field, 👍

Comment on lines +83 to +92
double UnitarySystemPerformanceMultispeed_Impl::noLoadSupplyAirflowRateRatio() const {
boost::optional<double> value = getDouble(OS_UnitarySystemPerformance_MultispeedFields::NoLoadSupplyAirFlowRateRatio, true);
OS_ASSERT(value);
return value.get();
}

bool UnitarySystemPerformanceMultispeed_Impl::setNoLoadSupplyAirflowRateRatio(double noLoadSupplyAirflowRateRatio) {
bool result = setDouble(OS_UnitarySystemPerformance_MultispeedFields::NoLoadSupplyAirFlowRateRatio, noLoadSupplyAirflowRateRatio);
return result;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

A new getter and a setter (no reset), all good.

Comment on lines +218 to +219
bool ok = setNoLoadSupplyAirflowRateRatio(1.0);
OS_ASSERT(ok);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ctor sets the required field, good.

Comment on lines +108 to +110
// No Load Supply Air Flow Rate Ratio
sysPerf.setDouble(UnitarySystemPerformance_MultispeedFields::NoLoadSupplyAirFlowRateRatio, modelObject.noLoadSupplyAirflowRateRatio());

Copy link
Collaborator

Choose a reason for hiding this comment

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

FT sets the field, which is required, so no if optional, 👍

Copy link
Collaborator

Choose a reason for hiding this comment

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

ideally a FT test would ensure this works appropriately.

Comment on lines +69 to +72
// No Load
EXPECT_EQ(1.0, testObject.noLoadSupplyAirflowRateRatio());
EXPECT_TRUE(testObject.setNoLoadSupplyAirflowRateRatio(0.5));
EXPECT_EQ(0.5, testObject.noLoadSupplyAirflowRateRatio());
Copy link
Collaborator

@jmarrec jmarrec Dec 9, 2022

Choose a reason for hiding this comment

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

No problem here

Comment on lines 7674 to 7675
auto value = object.getString(i);
if (value) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
auto value = object.getString(i);
if (value) {
if ((value = object.getString(i))) {

Comment on lines +7676 to +7687
if (i < 3) {
newObject.setString(i, value.get());
} else {
newObject.setString(i + 1, value.get());
}
}
}

newObject.setDouble(3, 1.0);

m_refactored.push_back(RefactoredObjectData(object, newObject));
ss << newObject;
Copy link
Collaborator

Choose a reason for hiding this comment

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

No problem here, all good.

Comment on lines 2409 to 2411
EXPECT_EQ("Unitary System Performance Multispeed 1", perf.getString(OS_UnitarySystemPerformance_MultispeedFields::Name).get());
EXPECT_EQ("No", perf.getString(OS_UnitarySystemPerformance_MultispeedFields::SingleModeOperation).get());
EXPECT_EQ(1.0, perf.getDouble(OS_UnitarySystemPerformance_MultispeedFields::NoLoadSupplyAirFlowRateRatio).get());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Undefined OS_UnitarySystemPerformance_MultispeedFields

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm, these weren't working?

Copy link
Collaborator

Choose a reason for hiding this comment

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

unless you #include the specific Object_FieldEnums.hxx it doesn't no. I'm torn about whether we want to start using the FieldEnums or not... it's going to create problems where we need to update them even if it's just the casing that changes, so I chose not to

@jmarrec
Copy link
Collaborator

jmarrec commented Dec 9, 2022

@joseph-robertson I don't have jenkins access here, could you check why the Windows runner is failing please?

@jmarrec jmarrec merged commit bd130bb into develop Dec 9, 2022
@jmarrec jmarrec deleted the unitarysysperf-noload branch December 9, 2022 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component - Model 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.

Support "No Load Supply Air Flow Rate Ratio" on UnitarySystemPerformance:Multispeed
3 participants