-
Notifications
You must be signed in to change notification settings - Fork 192
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
BoilerHotWater: new Off Cycle Parasitic Fuel Load field #4949
Merged
Merged
Changes from 8 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
caf0249
Add new parasitic fuel load field to idd for boiler hot water.
joseph-robertson 5500856
Update boiler hot water source files for new field.
joseph-robertson e2bee4c
Update ft for new boiler hot water field.
joseph-robertson bc8423b
Update model tests for new boiler hot water field.
joseph-robertson 6499a44
Wrong return type.
joseph-robertson 5958bb8
Merge branch 'v23.2.0-IOFreeze' into boiler-hot-water
joseph-robertson e80f409
Add new ft test file for boiler hot water.
joseph-robertson 45ff12b
Formatting.
joseph-robertson 6e15795
Add required for new off cycle field and adjust min fields.
joseph-robertson 55c43ea
Fix new ft test.
joseph-robertson ad00249
Move off cycle alongside on cycle, and add vt.
joseph-robertson 5532e12
Formatting.
joseph-robertson af1238f
Few more updates to idd.
joseph-robertson 085c138
Merge branch 'v23.2.0-IOFreeze' into boiler-hot-water
joseph-robertson 9babb44
Set actual before values in new vt test.
joseph-robertson 9ea0a19
Bunch of wrong expect types in vt test.
joseph-robertson 6f98eea
Bunch of get typos in new vt test.
joseph-robertson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/*********************************************************************************************************************** | ||
* OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC. | ||
* See also https://openstudio.net/license | ||
***********************************************************************************************************************/ | ||
|
||
#include <gtest/gtest.h> | ||
#include "EnergyPlusFixture.hpp" | ||
|
||
#include "../ForwardTranslator.hpp" | ||
|
||
#include "../../model/Model.hpp" | ||
#include "../../model/BoilerHotWater.hpp" | ||
#include "../../model/Node.hpp" | ||
#include "../../model/PlantLoop.hpp" | ||
#include "../../model/CurveQuadratic.hpp" | ||
|
||
#include <utilities/idd/Boiler_HotWater_FieldEnums.hxx> | ||
|
||
#include <utilities/idd/IddEnums.hxx> | ||
#include "../../utilities/idf/IdfObject.hpp" | ||
#include "../../utilities/idf/IdfObject_Impl.hpp" | ||
|
||
#include "../../utilities/idf/WorkspaceObject.hpp" | ||
#include "../../utilities/idf/WorkspaceObject_Impl.hpp" | ||
|
||
using namespace openstudio::energyplus; | ||
using namespace openstudio::model; | ||
using namespace openstudio; | ||
|
||
TEST_F(EnergyPlusFixture, ForwardTranslator_BoilerHotWater) { | ||
Model m; | ||
|
||
PlantLoop plant_loop(m); | ||
|
||
BoilerHotWater bhw(m); | ||
|
||
EXPECT_TRUE(bhw.setFuelType("Propane")); | ||
EXPECT_TRUE(bhw.setNominalCapacity(1.0)); | ||
EXPECT_TRUE(bhw.setNominalThermalEfficiency(2.0)); | ||
EXPECT_TRUE(bhw.setEfficiencyCurveTemperatureEvaluationVariable("EnteringBoiler")); | ||
CurveQuadratic curve1(m); | ||
EXPECT_TRUE(bhw.setNormalizedBoilerEfficiencyCurve(curve1)); | ||
EXPECT_TRUE(bhw.setDesignWaterFlowRate(3.0)); | ||
EXPECT_TRUE(bhw.setMinimumPartLoadRatio(4.0)); | ||
EXPECT_TRUE(bhw.setMaximumPartLoadRatio(5.0)); | ||
EXPECT_TRUE(bhw.setOptimumPartLoadRatio(6.0)); | ||
EXPECT_TRUE(bhw.setWaterOutletUpperTemperatureLimit(7.0)); | ||
EXPECT_TRUE(bhw.setBoilerFlowMode("LeavingSetpointModulated")); | ||
EXPECT_TRUE(bhw.setParasiticElectricLoad(8.0)); | ||
EXPECT_TRUE(bhw.setSizingFactor(9.0)); | ||
EXPECT_TRUE(bhw.setEndUseSubcategory("Test")); | ||
EXPECT_TRUE(bhw.setOffCycleParasiticFuelLoad(10.0)); | ||
|
||
EXPECT_TRUE(plant_loop.addSupplyBranchForComponent(bhw)); | ||
joseph-robertson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
ForwardTranslator ft; | ||
Workspace w = ft.translateModel(m); | ||
|
||
EXPECT_EQ(1u, w.getObjectsByType(IddObjectType::Boiler_HotWater).size()); | ||
EXPECT_EQ(1u, w.getObjectsByType(IddObjectType::Curve_Quadratic).size()); | ||
|
||
IdfObject idf_bhw = w.getObjectsByType(IddObjectType::Boiler_HotWater)[0]; | ||
|
||
EXPECT_EQ(bhw.nameString(), idf_bhw.getString(Boiler_HotWaterFields::Name, false).get()); | ||
EXPECT_EQ("Propane", idf_bhw.getString(Boiler_HotWaterFields::FuelType, false).get()); | ||
EXPECT_EQ(1.0, idf_bhw.getDouble(Boiler_HotWaterFields::NominalCapacity, false).get()); | ||
EXPECT_EQ(2.0, idf_bhw.getDouble(Boiler_HotWaterFields::NominalThermalEfficiency, false).get()); | ||
EXPECT_EQ("EnteringBoiler", idf_bhw.getString(Boiler_HotWaterFields::EfficiencyCurveTemperatureEvaluationVariable, false).get()); | ||
EXPECT_EQ(curve1.nameString(), idf_bhw.getString(Boiler_HotWaterFields::NormalizedBoilerEfficiencyCurveName, false).get()); | ||
EXPECT_EQ(3.0, idf_bhw.getDouble(Boiler_HotWaterFields::DesignWaterFlowRate, false).get()); | ||
EXPECT_EQ(4.0, idf_bhw.getDouble(Boiler_HotWaterFields::MinimumPartLoadRatio, false).get()); | ||
EXPECT_EQ(5.0, idf_bhw.getDouble(Boiler_HotWaterFields::MaximumPartLoadRatio, false).get()); | ||
EXPECT_EQ(6.0, idf_bhw.getDouble(Boiler_HotWaterFields::OptimumPartLoadRatio, false).get()); | ||
EXPECT_EQ(bhw.inletModelObject().get().nameString(), idf_bhw.getString(Boiler_HotWaterFields::BoilerWaterInletNodeName, false).get()); | ||
EXPECT_EQ(bhw.outletModelObject().get().nameString(), idf_bhw.getString(Boiler_HotWaterFields::BoilerWaterOutletNodeName, false).get()); | ||
EXPECT_EQ(7.0, idf_bhw.getDouble(Boiler_HotWaterFields::WaterOutletUpperTemperatureLimit, false).get()); | ||
EXPECT_EQ("LeavingSetpointModulated", idf_bhw.getString(Boiler_HotWaterFields::BoilerFlowMode, false).get()); | ||
EXPECT_EQ(8.0, idf_bhw.getDouble(Boiler_HotWaterFields::OnCycleParasiticElectricLoad, false).get()); | ||
EXPECT_EQ(9.0, idf_bhw.getDouble(Boiler_HotWaterFields::SizingFactor, false).get()); | ||
EXPECT_EQ("Test", idf_bhw.getString(Boiler_HotWaterFields::EndUseSubcategory, false).get()); | ||
EXPECT_EQ(10.0, idf_bhw.getDouble(Boiler_HotWaterFields::OffCycleParasiticFuelLoad, false).get()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,20 @@ TEST_F(ModelFixture, BoilerHotWater_BoilerHotWater) { | |
exit(0); | ||
}, | ||
::testing::ExitedWithCode(0), ""); | ||
|
||
Model m; | ||
BoilerHotWater boiler(m); | ||
|
||
ASSERT_TRUE(boiler.parasiticElectricLoad()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Side note but this should never have returned an optional) |
||
EXPECT_EQ(0.0, boiler.parasiticElectricLoad().get()); | ||
EXPECT_EQ(0.0, boiler.offCycleParasiticFuelLoad()); | ||
|
||
EXPECT_TRUE(boiler.setParasiticElectricLoad(0.5)); | ||
ASSERT_TRUE(boiler.parasiticElectricLoad()); | ||
EXPECT_EQ(0.5, boiler.parasiticElectricLoad().get()); | ||
|
||
EXPECT_TRUE(boiler.setOffCycleParasiticFuelLoad(0.8)); | ||
EXPECT_EQ(0.8, boiler.offCycleParasiticFuelLoad()); | ||
} | ||
|
||
TEST_F(ModelFixture, BoilerHotWater_connections) { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add required-field. And adjust \min-fields above.
Following E+ and putting it as the end. I know this is less work because no VT needed, but it's lazy. It should have been next to the On Cycle Parasitic Electric Load in E+.
Perhaps we should do it anyways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was me. Yes, I was being
lazyefficient.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't blame you. Especially since Transition in E+ forces you to go to fortran hell :)
For us, VT will need to happen anyways to hard code it to zero, so it's two lines extra to move it in the right location