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

Addressed EIRFuelFiredHeatPump object electric energy consumption output variable reports zero value #10425

Merged
merged 2 commits into from Mar 15, 2024

Conversation

Nigusse
Copy link
Contributor

@Nigusse Nigusse commented Mar 5, 2024

Pull request overview

NOTE: ENHANCEMENTS MUST FOLLOW A SUBMISSION PROCESS INCLUDING A FEATURE PROPOSAL AND DESIGN DOCUMENT PRIOR TO SUBMITTING CODE

Pull Request Author

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • If any diffs are expected, author must demonstrate they are justified using plots and descriptions
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions
  • If any defect files are updated to a more recent version, upload new versions here or on DevSupport
  • If IDD requires transition, transition source, rules, ExpandObjects, and IDFs must be updated, and add IDDChange label
  • If structural output changes, add to output rules file and add OutputChange label
  • If adding/removing any LaTeX docs or figures, update that document's CMakeLists file dependencies

Reviewer

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • 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
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally
  • Check any new function arguments for performance impacts
  • Verify IDF naming conventions and styles, memos and notes and defaults
  • If new idf included, locally check the err file and other outputs

@Nigusse Nigusse added the Defect Includes code to repair a defect in EnergyPlus label Mar 5, 2024
@Nigusse Nigusse added this to the EnergyPlus 24.1 milestone Mar 5, 2024
Copy link
Contributor Author

@Nigusse Nigusse left a comment

Choose a reason for hiding this comment

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

Code change walk-through.

@@ -1862,8 +1862,7 @@ void EIRFuelFiredHeatPump::doPhysics(EnergyPlusData &state, Real64 currentLoad)
auto &thisInletNode = state.dataLoopNodes->Node(this->loadSideNodes.inlet);
auto &thisOutletNode = state.dataLoopNodes->Node(this->loadSideNodes.outlet);
auto &sim_component = DataPlant::CompData::getPlantComponent(state, this->loadSidePlantLoc);
bool RunFlag = true;
if ((this->EIRHPType == DataPlant::PlantEquipmentType::HeatPumpFuelFiredHeating && currentLoad <= 0.0) || !RunFlag) {
if (this->EIRHPType == DataPlant::PlantEquipmentType::HeatPumpFuelFiredHeating && currentLoad <= 0.0) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The RunFlag flag is always true, so it is redundant logic and must be removed.

@@ -2250,7 +2249,7 @@ void EIRFuelFiredHeatPump::doPhysics(EnergyPlusData &state, Real64 currentLoad)
this->powerUsage += this->standbyElecPower;

this->fuelEnergy = this->fuelRate * reportingInterval;
this->powerEnergy = this->powerEnergy * reportingInterval;
this->powerEnergy = this->powerUsage * reportingInterval;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using the correct equation.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, good fix.

@@ -4363,6 +4364,7 @@ TEST_F(EnergyPlusFixture, GAHP_HeatingSimulate_AirSource_with_Defrost)
// expect it to meet setpoint and have some pre-evaluated conditions
// EXPECT_NEAR(specifiedLoadSetpoint, thisHeatingPLHP->loadSideOutletTemp, 0.001);
EXPECT_NEAR(curLoad, thisHeatingPLHP->loadSideHeatTransfer, 0.001);
EXPECT_NEAR(18020.0, thisEIRPlantLoopHP->powerUsage, 0.001);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

modified an existing unit test to show the fix.

@@ -4381,6 +4383,7 @@ TEST_F(EnergyPlusFixture, GAHP_HeatingSimulate_AirSource_with_Defrost)
thisHeatingPLHP->simulate(*state, myLoadLocation, firstHVAC, curLoad, runFlag);
EXPECT_NEAR(28800.0, thisHeatingPLHP->fuelRate, 0.001);
EXPECT_NEAR(25920000.0, thisHeatingPLHP->fuelEnergy, 0.001);
EXPECT_NEAR(18020.0, thisEIRPlantLoopHP->powerUsage, 0.001);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

modified an existing unit test to show the fix.

@@ -4402,6 +4405,7 @@ TEST_F(EnergyPlusFixture, GAHP_HeatingSimulate_AirSource_with_Defrost)
// expect it to miss setpoint and be at max capacity
EXPECT_NEAR(45.0, thisHeatingPLHP->loadSideOutletTemp, 0.001);
EXPECT_NEAR(30.0, thisHeatingPLHP->sourceSideOutletTemp, 0.001);
EXPECT_NEAR(0.0, thisEIRPlantLoopHP->powerUsage, 0.001);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same as above.

@Nigusse
Copy link
Contributor Author

Nigusse commented Mar 6, 2024

The difference in regression results is expected in an example idf PlantLoopHeatPump_Fuel-Fired.idf. The Fuel-fired Absorption HeatPump Electricity Energy report variable is impacted due to this fix.

@Nigusse
Copy link
Contributor Author

Nigusse commented Mar 6, 2024

I see the EvaluateChillerHeaterChangeoverOpSchemeTest unit test fail, but it passes on my local machine, and this branch should not impact it.

@Myoldmopar
Copy link
Member

One file with big diffs.....as you would expect when we were calculating the energy report variable incorrectly. Good to go. Thanks @Nigusse !

@Myoldmopar Myoldmopar merged commit fbb6f6a into develop Mar 15, 2024
17 checks passed
@Myoldmopar Myoldmopar deleted the eirPlantLoopHP-HeatPump-powerEnergy branch March 15, 2024 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Includes code to repair a defect in EnergyPlus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EIRFuelFiredHeatPump object electric energy consumption output variable reports zero value
7 participants