-
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
Support undisturbed ground temperature models on GroundHeatExchangerVertical #4932
Merged
Merged
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
985ba97
Add undisturbed fields to idd.
joseph-robertson e89b2ff
update the ft.
joseph-robertson 190cc7e
Update src model files.
joseph-robertson abb2309
Formatting.
joseph-robertson 6d679a9
Updates for vt.
joseph-robertson 18af79f
Add vt test.
joseph-robertson 356402a
Formatting.
joseph-robertson 3b87d87
Fix formatting in vt.
joseph-robertson c247c22
Fix type problem.
joseph-robertson de311e3
More minor typos.
joseph-robertson 9979fc8
Use correct syntax.
joseph-robertson 17cd660
Fix up vt and tests.
joseph-robertson 275556c
Add ft test file for ghx vertical.
joseph-robertson c484cfc
Formatting.
joseph-robertson a9fd199
Clean up ft test.
joseph-robertson 36e6d52
Fix a few typos.
joseph-robertson 33fb99f
Minor cleanup in tests.
joseph-robertson 497f012
Typo in ft test.
joseph-robertson 4292d12
Bit of reorganization.
joseph-robertson 96d7504
Update the release notes.
joseph-robertson c10e1b7
Merge branch 'develop' into ghx-vert
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
121 changes: 121 additions & 0 deletions
121
src/energyplus/Test/GroundHeatExchangerVertical_GTest.cpp
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,121 @@ | ||
/*********************************************************************************************************************** | ||
* 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 "../ReverseTranslator.hpp" | ||
|
||
#include "../../model/Model.hpp" | ||
#include "../../model/GroundHeatExchangerVertical.hpp" | ||
#include "../../model/GroundHeatExchangerVertical_Impl.hpp" | ||
#include "../../model/PlantLoop.hpp" | ||
#include "../../model/Node.hpp" | ||
#include "../../model/Node_Impl.hpp" | ||
|
||
#include "../../utilities/idf/IdfFile.hpp" | ||
#include "../../utilities/idf/Workspace.hpp" | ||
#include "../../utilities/idf/IdfObject.hpp" | ||
#include "../../utilities/idf/WorkspaceObject.hpp" | ||
|
||
#include <utilities/idd/GroundHeatExchanger_System_FieldEnums.hxx> | ||
#include <utilities/idd/Site_GroundTemperature_Undisturbed_KusudaAchenbach_FieldEnums.hxx> | ||
#include <utilities/idd/GroundHeatExchanger_ResponseFactors_FieldEnums.hxx> | ||
#include <utilities/idd/GroundHeatExchanger_Vertical_Properties_FieldEnums.hxx> | ||
#include <utilities/idd/IddEnums.hxx> | ||
|
||
using namespace openstudio::energyplus; | ||
using namespace openstudio::model; | ||
using namespace openstudio; | ||
|
||
TEST_F(EnergyPlusFixture, ForwardTranslator_GroundHeatExchangerVertical) { | ||
|
||
ForwardTranslator ft; | ||
|
||
// Create a model | ||
Model m; | ||
|
||
GroundHeatExchangerVertical ghx(m); | ||
|
||
EXPECT_TRUE(ghx.setDesignFlowRate(0.004)); | ||
EXPECT_TRUE(ghx.setNumberofBoreHoles(100)); | ||
EXPECT_TRUE(ghx.setBoreHoleLength(80.0)); | ||
EXPECT_TRUE(ghx.setBoreHoleRadius(0.7E-01)); | ||
EXPECT_TRUE(ghx.setGroundThermalConductivity(0.7)); | ||
EXPECT_TRUE(ghx.setGroundThermalHeatCapacity(0.3E+07)); | ||
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. Like I mentioned. Do these methods do anything now? 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. These 2 still translate to the ghxVert object (see explanation above). |
||
EXPECT_TRUE(ghx.setGroundTemperature(14.0)); | ||
EXPECT_TRUE(ghx.setGroutThermalConductivity(0.7)); | ||
EXPECT_TRUE(ghx.setPipeThermalConductivity(0.4)); | ||
EXPECT_TRUE(ghx.setPipeOutDiameter(2.7E-02)); | ||
EXPECT_TRUE(ghx.setUTubeDistance(2.6E-02)); | ||
EXPECT_TRUE(ghx.setPipeThickness(2.5E-03)); | ||
EXPECT_TRUE(ghx.setMaximumLengthofSimulation(3)); | ||
EXPECT_TRUE(ghx.setGFunctionReferenceRatio(0.001)); | ||
|
||
PlantLoop p(m); | ||
EXPECT_TRUE(p.addSupplyBranchForComponent(ghx)); | ||
|
||
ASSERT_TRUE(ghx.inletModelObject()); | ||
ASSERT_TRUE(ghx.inletModelObject()->optionalCast<Node>()); | ||
ghx.inletModelObject()->cast<Node>().setName("GHX Inlet Node"); | ||
|
||
ASSERT_TRUE(ghx.outletModelObject()); | ||
ASSERT_TRUE(ghx.outletModelObject()->optionalCast<Node>()); | ||
ghx.outletModelObject()->cast<Node>().setName("GHX Outlet Node"); | ||
|
||
const Workspace w = ft.translateModel(m); | ||
|
||
WorkspaceObjectVector idfObjs = w.getObjectsByType(IddObjectType::GroundHeatExchanger_System); | ||
ASSERT_EQ(1u, idfObjs.size()); | ||
auto idfObject = idfObjs.front(); | ||
|
||
EXPECT_EQ("Ground Heat Exchanger Vertical 1", idfObject.getString(GroundHeatExchanger_SystemFields::Name).get()); | ||
EXPECT_EQ("GHX Inlet Node", idfObject.getString(GroundHeatExchanger_SystemFields::InletNodeName).get()); | ||
EXPECT_EQ("GHX Outlet Node", idfObject.getString(GroundHeatExchanger_SystemFields::OutletNodeName).get()); | ||
EXPECT_EQ(0.004, idfObject.getDouble(GroundHeatExchanger_SystemFields::DesignFlowRate).get()); | ||
|
||
EXPECT_EQ("Site:GroundTemperature:Undisturbed:KusudaAchenbach", | ||
idfObject.getString(GroundHeatExchanger_SystemFields::UndisturbedGroundTemperatureModelType).get()); | ||
|
||
ASSERT_TRUE(idfObject.getTarget(GroundHeatExchanger_SystemFields::UndisturbedGroundTemperatureModelName)); | ||
const WorkspaceObject kusuda = idfObject.getTarget(GroundHeatExchanger_SystemFields::UndisturbedGroundTemperatureModelName).get(); | ||
EXPECT_EQ(IddObjectType{IddObjectType::Site_GroundTemperature_Undisturbed_KusudaAchenbach}, kusuda.iddObject().type()); | ||
|
||
EXPECT_EQ(0.7, idfObject.getDouble(GroundHeatExchanger_SystemFields::GroundThermalConductivity).get()); | ||
EXPECT_EQ(0.3E+07, idfObject.getDouble(GroundHeatExchanger_SystemFields::GroundThermalHeatCapacity).get()); | ||
|
||
ASSERT_TRUE(idfObject.getTarget(GroundHeatExchanger_SystemFields::GHE_Vertical_ResponseFactorsObjectName)); | ||
const WorkspaceObject response = idfObject.getTarget(GroundHeatExchanger_SystemFields::GHE_Vertical_ResponseFactorsObjectName).get(); | ||
EXPECT_EQ(IddObjectType{IddObjectType::GroundHeatExchanger_ResponseFactors}, response.iddObject().type()); | ||
|
||
EXPECT_TRUE(idfObject.isEmpty(GroundHeatExchanger_SystemFields::gFunctionCalculationMethod)); | ||
ASSERT_FALSE(idfObject.getTarget(GroundHeatExchanger_SystemFields::GHE_Vertical_ArrayObjectName)); | ||
|
||
EXPECT_EQ(0.692626, kusuda.getDouble(Site_GroundTemperature_Undisturbed_KusudaAchenbachFields::SoilThermalConductivity).get()); | ||
EXPECT_EQ(920.0, kusuda.getDouble(Site_GroundTemperature_Undisturbed_KusudaAchenbachFields::SoilDensity).get()); | ||
EXPECT_DOUBLE_EQ(0.234700E+07 / 920.0, kusuda.getDouble(Site_GroundTemperature_Undisturbed_KusudaAchenbachFields::SoilSpecificHeat).get()); | ||
EXPECT_EQ(13.375, kusuda.getDouble(Site_GroundTemperature_Undisturbed_KusudaAchenbachFields::AverageSoilSurfaceTemperature).get()); | ||
EXPECT_EQ(3.2, kusuda.getDouble(Site_GroundTemperature_Undisturbed_KusudaAchenbachFields::AverageAmplitudeofSurfaceTemperature).get()); | ||
EXPECT_EQ(8.0, kusuda.getDouble(Site_GroundTemperature_Undisturbed_KusudaAchenbachFields::PhaseShiftofMinimumSurfaceTemperature).get()); | ||
|
||
ASSERT_TRUE(response.getTarget(GroundHeatExchanger_ResponseFactorsFields::GHE_Vertical_PropertiesObjectName)); | ||
const WorkspaceObject properties = response.getTarget(GroundHeatExchanger_ResponseFactorsFields::GHE_Vertical_PropertiesObjectName).get(); | ||
EXPECT_EQ(IddObjectType{IddObjectType::GroundHeatExchanger_Vertical_Properties}, properties.iddObject().type()); | ||
|
||
EXPECT_EQ(100, response.getDouble(GroundHeatExchanger_ResponseFactorsFields::NumberofBoreholes).get()); | ||
EXPECT_EQ(0.001, response.getDouble(GroundHeatExchanger_ResponseFactorsFields::GFunctionReferenceRatio).get()); | ||
|
||
EXPECT_EQ(1, properties.getDouble(GroundHeatExchanger_Vertical_PropertiesFields::DepthofTopofBorehole).get()); | ||
EXPECT_EQ(80.0, properties.getDouble(GroundHeatExchanger_Vertical_PropertiesFields::BoreholeLength).get()); | ||
EXPECT_EQ(0.7E-01 * 2, properties.getDouble(GroundHeatExchanger_Vertical_PropertiesFields::BoreholeDiameter).get()); | ||
EXPECT_EQ(0.7, properties.getDouble(GroundHeatExchanger_Vertical_PropertiesFields::GroutThermalConductivity).get()); | ||
EXPECT_EQ(3.90E+06, properties.getDouble(GroundHeatExchanger_Vertical_PropertiesFields::GroutThermalHeatCapacity).get()); | ||
EXPECT_EQ(0.4, properties.getDouble(GroundHeatExchanger_Vertical_PropertiesFields::PipeThermalConductivity).get()); | ||
EXPECT_EQ(1.77E+06, properties.getDouble(GroundHeatExchanger_Vertical_PropertiesFields::PipeThermalHeatCapacity).get()); | ||
EXPECT_EQ(2.7E-02, properties.getDouble(GroundHeatExchanger_Vertical_PropertiesFields::PipeOuterDiameter).get()); | ||
EXPECT_EQ(2.5E-03, properties.getDouble(GroundHeatExchanger_Vertical_PropertiesFields::PipeThickness).get()); | ||
EXPECT_EQ(2.6E-02, properties.getDouble(GroundHeatExchanger_Vertical_PropertiesFields::UTubeDistance).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
Oops, something went wrong.
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.
What happens to these fields if they are set on the GroundHeatExchangerVertical system? If looks like they might be ignored. Maybe the implementation of these methods like GroundHeatExchangerVertical::groundThermalHeatCapacity() should map to the contained ground temperature model?
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.
ghxVert.groundThermalConductivity()
andghxVert.groundThermalHeatCapacity()
both still get translated above.ghxVert.groundTemperature()
previously was only translated to thegroundTempModel
.AverageSoilSurfaceTemperature
for the kusuda object is now handled by its ownaverageSoilSurfaceTemperature()
method.This is basically the same approach we used for the
HorizontalTrench
implementation - theghxVert
gets thesoilThermalConductivity()
andsoilSpecificHeat
, and then kusuda FTs its ownaverageSoilSurfaceTemperature()
.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.
sorry missed the above. Got it.