From cf9f7314543592237ae37376aac81a5d06fa7774 Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Wed, 18 Dec 2024 14:24:48 -0700 Subject: [PATCH 01/16] Add bore hole top depth field to idd. --- resources/model/OpenStudio.idd | 36 +++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/resources/model/OpenStudio.idd b/resources/model/OpenStudio.idd index edffc20040..20895af736 100644 --- a/resources/model/OpenStudio.idd +++ b/resources/model/OpenStudio.idd @@ -17112,8 +17112,8 @@ OS:DistrictHeating:Steam, OS:GroundHeatExchanger:Vertical, \extensible:2 - \min-fields 22 - \max-fields 220 + \min-fields 23 + \max-fields 221 \memo Variable short time step vertical ground heat exchanger model based on \memo Yavuztruk, C., J.D.Spitler. 1999. A Short Time Step response Factor Model for \memo Vertical Ground Loop Heat Exchangers @@ -17143,67 +17143,71 @@ OS:GroundHeatExchanger:Vertical, N2, \field Number of Bore Holes \type integer \minimum> 0.0 - N3, \field Bore Hole Length + N3, \field Bore Hole Top Depth + \type real + \units m + \minimum 0.0 + N4, \field Bore Hole Length \type real \units m \minimum> 0.0 - N4, \field Bore Hole Radius + N5, \field Bore Hole Radius \type real \units m \minimum> 0.0 - N5, \field Ground Thermal Conductivity + N6, \field Ground Thermal Conductivity \type real \units W/m-K \ip-units Btu-in/hr-ft2-R \minimum> 0.0 - N6, \field Ground Thermal Heat Capacity + N7, \field Ground Thermal Heat Capacity \type real \units J/m3-K \minimum> 0.0 - N7, \field Ground Temperature + N8, \field Ground Temperature \type real \units C \minimum> 0.0 - N8, \field Grout Thermal Conductivity + N9, \field Grout Thermal Conductivity \type real \units W/m-K \ip-units Btu-in/hr-ft2-R \minimum> 0.0 - N9, \field Pipe Thermal Conductivity + N10, \field Pipe Thermal Conductivity \type real \units W/m-K \ip-units Btu-in/hr-ft2-R \minimum> 0.0 - N10, \field Pipe Out Diameter + N11, \field Pipe Out Diameter \type real \units m \minimum> 0.0 \ip-units in - N11, \field U-Tube Distance + N12, \field U-Tube Distance \type real \units m \minimum> 0.0 - N12, \field Pipe Thickness + N13, \field Pipe Thickness \type real \units m \minimum> 0.0 \ip-units in - N13, \field Maximum Length of Simulation + N14, \field Maximum Length of Simulation \type real \minimum> 0.0 A5, \field Undisturbed Ground Temperature Model \required-field \type object-list \object-list UndisturbedGroundTempModels - N14, \field G-Function Reference Ratio + N15, \field G-Function Reference Ratio \type real \units dimensionless \minimum> 0.0 \default 0.0005 - N15, \field G-Function Ln(T/Ts) Value + N16, \field G-Function Ln(T/Ts) Value \type real \begin-extensible - N16; \field G-Function G Value + N17; \field G-Function G Value \type real OS:GroundHeatExchanger:HorizontalTrench, From c66bcda70eed648f31a14c76326c62a6242806ba Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Wed, 18 Dec 2024 14:25:02 -0700 Subject: [PATCH 02/16] Update model source files. --- src/model/GroundHeatExchangerVertical.cpp | 34 +++++++++++++++++++ src/model/GroundHeatExchangerVertical.hpp | 6 ++++ .../GroundHeatExchangerVertical_Impl.hpp | 6 ++++ .../GroundHeatExchangerVertical_GTest.cpp | 9 +++++ 4 files changed, 55 insertions(+) diff --git a/src/model/GroundHeatExchangerVertical.cpp b/src/model/GroundHeatExchangerVertical.cpp index 75ffb69dd9..66fe4e5562 100644 --- a/src/model/GroundHeatExchangerVertical.cpp +++ b/src/model/GroundHeatExchangerVertical.cpp @@ -57,6 +57,10 @@ namespace model { return getInt(OS_GroundHeatExchanger_VerticalFields::NumberofBoreHoles, true); } + boost::optional GroundHeatExchangerVertical_Impl::boreHoleTopDepth() const { + return getDouble(OS_GroundHeatExchanger_VerticalFields::BoreHoleTopDepth, true); + } + boost::optional GroundHeatExchangerVertical_Impl::boreHoleLength() const { return getDouble(OS_GroundHeatExchanger_VerticalFields::BoreHoleLength, true); } @@ -139,6 +143,22 @@ namespace model { OS_ASSERT(result); } + bool GroundHeatExchangerVertical_Impl::setBoreHoleTopDepth(boost::optional boreHoleTopDepth) { + bool result(false); + if (boreHoleTopDepth) { + result = setDouble(OS_GroundHeatExchanger_VerticalFields::BoreHoleTopDepth, boreHoleTopDepth.get()); + } else { + resetBoreHoleTopDepth(); + result = true; + } + return result; + } + + void GroundHeatExchangerVertical_Impl::resetBoreHoleTopDepth() { + bool result = setString(OS_GroundHeatExchanger_VerticalFields::BoreHoleTopDepth, ""); + OS_ASSERT(result); + } + bool GroundHeatExchangerVertical_Impl::setBoreHoleLength(boost::optional boreHoleLength) { bool result(false); if (boreHoleLength) { @@ -443,6 +463,7 @@ namespace model { OS_ASSERT(getImpl()); setNumberofBoreHoles(120); + setBoreHoleTopDepth(1); setBoreHoleLength(76.2); setBoreHoleRadius(0.635080E-01); setGroundThermalConductivity(0.692626); @@ -513,6 +534,7 @@ namespace model { << undisturbedGroundTemperatureModel.briefDescription() << "."); } setNumberofBoreHoles(120); + setBoreHoleTopDepth(1); setBoreHoleLength(76.2); setBoreHoleRadius(0.635080E-01); setGroundThermalConductivity(0.692626); @@ -596,6 +618,10 @@ namespace model { return getImpl()->numberofBoreHoles(); } + boost::optional GroundHeatExchangerVertical::boreHoleTopDepth() const { + return getImpl()->boreHoleTopDepth(); + } + boost::optional GroundHeatExchangerVertical::boreHoleLength() const { return getImpl()->boreHoleLength(); } @@ -664,6 +690,14 @@ namespace model { getImpl()->resetNumberofBoreHoles(); } + bool GroundHeatExchangerVertical::setBoreHoleTopDepth(double boreHoleTopDepth) { + return getImpl()->setBoreHoleTopDepth(boreHoleTopDepth); + } + + void GroundHeatExchangerVertical::resetBoreHoleTopDepth() { + getImpl()->resetBoreHoleTopDepth(); + } + bool GroundHeatExchangerVertical::setBoreHoleLength(double boreHoleLength) { return getImpl()->setBoreHoleLength(boreHoleLength); } diff --git a/src/model/GroundHeatExchangerVertical.hpp b/src/model/GroundHeatExchangerVertical.hpp index 984621e2a9..d69a5959a6 100644 --- a/src/model/GroundHeatExchangerVertical.hpp +++ b/src/model/GroundHeatExchangerVertical.hpp @@ -69,6 +69,8 @@ namespace model { boost::optional numberofBoreHoles() const; + boost::optional boreHoleTopDepth() const; + boost::optional boreHoleLength() const; boost::optional boreHoleRadius() const; @@ -108,6 +110,10 @@ namespace model { void resetNumberofBoreHoles(); + bool setBoreHoleTopDepth(double boreHoleTopDepth); + + void resetBoreHoleTopDepth(); + bool setBoreHoleLength(double boreHoleLength); void resetBoreHoleLength(); diff --git a/src/model/GroundHeatExchangerVertical_Impl.hpp b/src/model/GroundHeatExchangerVertical_Impl.hpp index 307b508d2d..971a2bd28f 100644 --- a/src/model/GroundHeatExchangerVertical_Impl.hpp +++ b/src/model/GroundHeatExchangerVertical_Impl.hpp @@ -56,6 +56,8 @@ namespace model { boost::optional numberofBoreHoles() const; + boost::optional boreHoleTopDepth() const; + boost::optional boreHoleLength() const; boost::optional boreHoleRadius() const; @@ -94,6 +96,10 @@ namespace model { void resetNumberofBoreHoles(); + bool setBoreHoleTopDepth(double boreHoleTopDepth); + + void resetBoreHoleTopDepth(); + bool setBoreHoleLength(boost::optional boreHoleLength); void resetBoreHoleLength(); diff --git a/src/model/test/GroundHeatExchangerVertical_GTest.cpp b/src/model/test/GroundHeatExchangerVertical_GTest.cpp index d89e056cfc..a69da56f8e 100644 --- a/src/model/test/GroundHeatExchangerVertical_GTest.cpp +++ b/src/model/test/GroundHeatExchangerVertical_GTest.cpp @@ -40,6 +40,8 @@ TEST_F(ModelFixture, GroundHeatExchangerVertical_GroundHeatExchangerVertical) { EXPECT_EQ(0.0033, gh.designFlowRate().get()); ASSERT_TRUE(gh.numberofBoreHoles()); EXPECT_EQ(120, gh.numberofBoreHoles().get()); + ASSERT_TRUE(gh.boreHoleTopDepth()); + EXPECT_EQ(1.0, gh.boreHoleTopDepth().get()); ASSERT_TRUE(gh.boreHoleLength()); EXPECT_EQ(76.2, gh.boreHoleLength().get()); ASSERT_TRUE(gh.boreHoleRadius()); @@ -79,6 +81,8 @@ TEST_F(ModelFixture, GroundHeatExchangerVertical_GroundHeatExchangerVertical) { EXPECT_EQ(0.0033, gh.designFlowRate().get()); ASSERT_TRUE(gh.numberofBoreHoles()); EXPECT_EQ(120, gh.numberofBoreHoles().get()); + ASSERT_TRUE(gh.boreHoleTopDepth()); + EXPECT_EQ(1.0, gh.boreHoleTopDepth().get()); ASSERT_TRUE(gh.boreHoleLength()); EXPECT_EQ(76.2, gh.boreHoleLength().get()); ASSERT_TRUE(gh.boreHoleRadius()); @@ -117,6 +121,7 @@ TEST_F(ModelFixture, GroundHeatExchangerVertical_SetGetFields) { EXPECT_TRUE(gh.setDesignFlowRate(0.004)); EXPECT_TRUE(gh.setNumberofBoreHoles(100)); + EXPECT_TRUE(gh.setBoreHoleTopDepth(1.25)); EXPECT_TRUE(gh.setBoreHoleLength(80.0)); EXPECT_TRUE(gh.setBoreHoleRadius(0.7E-01)); EXPECT_TRUE(gh.setGroundThermalConductivity(0.7)); @@ -137,6 +142,8 @@ TEST_F(ModelFixture, GroundHeatExchangerVertical_SetGetFields) { EXPECT_EQ(0.004, gh.designFlowRate().get()); ASSERT_TRUE(gh.numberofBoreHoles()); EXPECT_EQ(100, gh.numberofBoreHoles().get()); + ASSERT_TRUE(gh.boreHoleTopDepth()); + EXPECT_EQ(1.25, gh.boreHoleTopDepth().get()); ASSERT_TRUE(gh.boreHoleLength()); EXPECT_EQ(80.0, gh.boreHoleLength().get()); ASSERT_TRUE(gh.boreHoleRadius()); @@ -174,6 +181,8 @@ TEST_F(ModelFixture, GroundHeatExchangerVertical_SetGetFields) { EXPECT_EQ(0.004, gh.designFlowRate().get()); ASSERT_TRUE(gh.numberofBoreHoles()); EXPECT_EQ(100, gh.numberofBoreHoles().get()); + ASSERT_TRUE(gh.boreHoleTopDepth()); + EXPECT_EQ(1.25 gh.boreHoleTopDepth().get()); ASSERT_TRUE(gh.boreHoleLength()); EXPECT_EQ(80.0, gh.boreHoleLength().get()); ASSERT_TRUE(gh.boreHoleRadius()); From 8cb6a6c3c241835d0dc439e706597814f14f13a9 Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Wed, 18 Dec 2024 14:25:24 -0700 Subject: [PATCH 03/16] Update ft files. --- .../ForwardTranslateGroundHeatExchangerVertical.cpp | 4 +++- src/energyplus/Test/GroundHeatExchangerVertical_GTest.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateGroundHeatExchangerVertical.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateGroundHeatExchangerVertical.cpp index d573a1c679..c6fcd73576 100644 --- a/src/energyplus/ForwardTranslator/ForwardTranslateGroundHeatExchangerVertical.cpp +++ b/src/energyplus/ForwardTranslator/ForwardTranslateGroundHeatExchangerVertical.cpp @@ -146,7 +146,9 @@ namespace energyplus { auto propertiesObjectName = modelObject.nameString() + " Properties"; propertiesIdfObject.setName(propertiesObjectName); - propertiesIdfObject.setDouble(GroundHeatExchanger_Vertical_PropertiesFields::DepthofTopofBorehole, 1); + if ((value = modelObject.boreHoleTopDepth())) { + propertiesIdfObject.setDouble(GroundHeatExchanger_Vertical_PropertiesFields::DepthofTopofBorehole, value.get()); + } if ((value = modelObject.boreHoleLength())) { propertiesIdfObject.setDouble(GroundHeatExchanger_Vertical_PropertiesFields::BoreholeLength, value.get()); diff --git a/src/energyplus/Test/GroundHeatExchangerVertical_GTest.cpp b/src/energyplus/Test/GroundHeatExchangerVertical_GTest.cpp index f7f3b7e853..e3f208664a 100644 --- a/src/energyplus/Test/GroundHeatExchangerVertical_GTest.cpp +++ b/src/energyplus/Test/GroundHeatExchangerVertical_GTest.cpp @@ -42,6 +42,7 @@ TEST_F(EnergyPlusFixture, ForwardTranslator_GroundHeatExchangerVertical) { EXPECT_TRUE(ghx.setDesignFlowRate(0.004)); EXPECT_TRUE(ghx.setNumberofBoreHoles(100)); + EXPECT_TRUE(ghx.setBoreHoleTopDepth(1.35)); EXPECT_TRUE(ghx.setBoreHoleLength(80.0)); EXPECT_TRUE(ghx.setBoreHoleRadius(0.7E-01)); EXPECT_TRUE(ghx.setGroundThermalConductivity(0.7)); @@ -109,6 +110,7 @@ TEST_F(EnergyPlusFixture, ForwardTranslator_GroundHeatExchangerVertical) { EXPECT_EQ(0.001, response.getDouble(GroundHeatExchanger_ResponseFactorsFields::GFunctionReferenceRatio).get()); EXPECT_EQ(1, properties.getDouble(GroundHeatExchanger_Vertical_PropertiesFields::DepthofTopofBorehole).get()); + EXPECT_EQ(1.35, 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()); From ee9e734ed28d145c904f240b060e3443c445f80b Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Wed, 18 Dec 2024 14:25:32 -0700 Subject: [PATCH 04/16] Update vt files. --- src/osversion/VersionTranslator.cpp | 45 ++++++++ src/osversion/VersionTranslator.hpp | 1 + .../test_vt_GroundHeatExchangerVertical.osm | 106 ++++++++++++++++++ .../test_vt_GroundHeatExchangerVertical.rb | 9 ++ .../test/VersionTranslator_GTest.cpp | 18 +++ 5 files changed, 179 insertions(+) create mode 100644 src/osversion/test/3_9_1/test_vt_GroundHeatExchangerVertical.osm create mode 100644 src/osversion/test/3_9_1/test_vt_GroundHeatExchangerVertical.rb diff --git a/src/osversion/VersionTranslator.cpp b/src/osversion/VersionTranslator.cpp index 507dc9d1d8..bf9382ee18 100644 --- a/src/osversion/VersionTranslator.cpp +++ b/src/osversion/VersionTranslator.cpp @@ -9640,5 +9640,50 @@ namespace osversion { } // end update_3_8_0_to_3_9_0 + std::string VersionTranslator::update_3_9_0_to_3_9_1(const IdfFile& idf_3_9_0, const IddFileAndFactoryWrapper& idd_3_9_1) { + std::stringstream ss; + boost::optional value; + + ss << idf_3_9_0.header() << '\n' << '\n'; + IdfFile targetIdf(idd_3_9_0.iddFile()); + ss << targetIdf.versionObject().get(); + + for (const IdfObject& object : idd_3_9_1.objects()) { + auto iddname = object.iddObject().name(); + + if (iddname == "OS:GroundHeatExchanger:Vertical") { + + // 1 Field has been inserted from 3.9.0 to 3.9.1: + // ---------------------------------------------- + // * Bore Hole Top Depth * 6 + + auto iddObject = idd_3_9_0.getObject(iddname); + IdfObject newObject(iddObject.get()); + + for (size_t i = 0; i < object.numFields(); ++i) { + if ((value = object.getString(i))) { + if (i < 6) { + newObject.setString(i, value.get()); + } else { + newObject.setString(i + 1, value.get()); + } + } + } + + newObject.setDouble(6, 1.0); // this value of 1 is what we previously had hardcoded in FT + + ss << newObject; + m_refactored.emplace_back(std::move(object), std::move(newObject)); + + // No-op + } else { + ss << object; + } + } + + return ss.str(); + + } // end update_3_9_0_to_3_9_1 + } // namespace osversion } // namespace openstudio diff --git a/src/osversion/VersionTranslator.hpp b/src/osversion/VersionTranslator.hpp index 4600c2faa7..9ea4e977e4 100644 --- a/src/osversion/VersionTranslator.hpp +++ b/src/osversion/VersionTranslator.hpp @@ -237,6 +237,7 @@ namespace osversion { std::string update_3_6_1_to_3_7_0(const IdfFile& idf_3_6_1, const IddFileAndFactoryWrapper& idd_3_7_0); std::string update_3_7_0_to_3_8_0(const IdfFile& idf_3_7_0, const IddFileAndFactoryWrapper& idd_3_8_0); std::string update_3_8_0_to_3_9_0(const IdfFile& idf_3_8_0, const IddFileAndFactoryWrapper& idd_3_9_0); + std::string update_3_9_0_to_3_9_1(const IdfFile& idf_3_9_0, const IddFileAndFactoryWrapper& idd_3_9_1); IdfObject updateUrlField_0_7_1_to_0_7_2(const IdfObject& object, unsigned index); diff --git a/src/osversion/test/3_9_1/test_vt_GroundHeatExchangerVertical.osm b/src/osversion/test/3_9_1/test_vt_GroundHeatExchangerVertical.osm new file mode 100644 index 0000000000..2d894123b0 --- /dev/null +++ b/src/osversion/test/3_9_1/test_vt_GroundHeatExchangerVertical.osm @@ -0,0 +1,106 @@ + +OS:Version, + {c23de9a0-083e-49b9-843c-3008f64ac27b}, !- Handle + 3.9.0; !- Version Identifier + +OS:GroundHeatExchanger:Vertical, + {bc2f2f69-fa65-42c9-8f1b-5887bfebd17d}, !- Handle + Ground Heat Exchanger Vertical 1, !- Name + , !- Inlet Node Name + , !- Outlet Node Name + 0.0033, !- Design Flow Rate {m3/s} + 120, !- Number of Bore Holes + 76.2, !- Bore Hole Length {m} + 0.063508, !- Bore Hole Radius {m} + 0.692626, !- Ground Thermal Conductivity {W/m-K} + 2347000, !- Ground Thermal Heat Capacity {J/m3-K} + 13.375, !- Ground Temperature {C} + 0.692626, !- Grout Thermal Conductivity {W/m-K} + 0.391312, !- Pipe Thermal Conductivity {W/m-K} + 0.0266667, !- Pipe Out Diameter {m} + 0.0253977, !- U-Tube Distance {m} + 0.00241285, !- Pipe Thickness {m} + 2, !- Maximum Length of Simulation + {1da197d6-5c3f-4d28-af88-8d9f74332cd4}, !- Undisturbed Ground Temperature Model + 0.0005, !- G-Function Reference Ratio {dimensionless} + -15.2996, !- G-Function Ln(T/Ts) Value 1 + -0.348322, !- G-Function G Value 1 + -14.201, !- G-Function Ln(T/Ts) Value 2 + 0.022208, !- G-Function G Value 2 + -13.2202, !- G-Function Ln(T/Ts) Value 3 + 0.412345, !- G-Function G Value 3 + -12.2086, !- G-Function Ln(T/Ts) Value 4 + 0.867498, !- G-Function G Value 4 + -11.1888, !- G-Function Ln(T/Ts) Value 5 + 1.357839, !- G-Function G Value 5 + -10.1816, !- G-Function Ln(T/Ts) Value 6 + 1.852024, !- G-Function G Value 6 + -9.1815, !- G-Function Ln(T/Ts) Value 7 + 2.345656, !- G-Function G Value 7 + -8.6809, !- G-Function Ln(T/Ts) Value 8 + 2.593958, !- G-Function G Value 8 + -8.5, !- G-Function Ln(T/Ts) Value 9 + 2.679, !- G-Function G Value 9 + -7.8, !- G-Function Ln(T/Ts) Value 10 + 3.023, !- G-Function G Value 10 + -7.2, !- G-Function Ln(T/Ts) Value 11 + 3.32, !- G-Function G Value 11 + -6.5, !- G-Function Ln(T/Ts) Value 12 + 3.681, !- G-Function G Value 12 + -5.9, !- G-Function Ln(T/Ts) Value 13 + 4.071, !- G-Function G Value 13 + -5.2, !- G-Function Ln(T/Ts) Value 14 + 4.828, !- G-Function G Value 14 + -4.5, !- G-Function Ln(T/Ts) Value 15 + 6.253, !- G-Function G Value 15 + -3.963, !- G-Function Ln(T/Ts) Value 16 + 7.894, !- G-Function G Value 16 + -3.27, !- G-Function Ln(T/Ts) Value 17 + 11.82, !- G-Function G Value 17 + -2.864, !- G-Function Ln(T/Ts) Value 18 + 15.117, !- G-Function G Value 18 + -2.577, !- G-Function Ln(T/Ts) Value 19 + 18.006, !- G-Function G Value 19 + -2.171, !- G-Function Ln(T/Ts) Value 20 + 22.887, !- G-Function G Value 20 + -1.884, !- G-Function Ln(T/Ts) Value 21 + 26.924, !- G-Function G Value 21 + -1.191, !- G-Function Ln(T/Ts) Value 22 + 38.004, !- G-Function G Value 22 + -0.497, !- G-Function Ln(T/Ts) Value 23 + 49.919, !- G-Function G Value 23 + -0.274, !- G-Function Ln(T/Ts) Value 24 + 53.407, !- G-Function G Value 24 + -0.051, !- G-Function Ln(T/Ts) Value 25 + 56.632, !- G-Function G Value 25 + 0.196, !- G-Function Ln(T/Ts) Value 26 + 59.825, !- G-Function G Value 26 + 0.419, !- G-Function Ln(T/Ts) Value 27 + 62.349, !- G-Function G Value 27 + 0.642, !- G-Function Ln(T/Ts) Value 28 + 64.524, !- G-Function G Value 28 + 0.873, !- G-Function Ln(T/Ts) Value 29 + 66.412, !- G-Function G Value 29 + 1.112, !- G-Function Ln(T/Ts) Value 30 + 67.993, !- G-Function G Value 30 + 1.335, !- G-Function Ln(T/Ts) Value 31 + 69.162, !- G-Function G Value 31 + 1.679, !- G-Function Ln(T/Ts) Value 32 + 70.476, !- G-Function G Value 32 + 2.028, !- G-Function Ln(T/Ts) Value 33 + 71.361, !- G-Function G Value 33 + 2.275, !- G-Function Ln(T/Ts) Value 34 + 71.79, !- G-Function G Value 34 + 3.003, !- G-Function Ln(T/Ts) Value 35 + 72.511; !- G-Function G Value 35 + +OS:Site:GroundTemperature:Undisturbed:KusudaAchenbach, + {1da197d6-5c3f-4d28-af88-8d9f74332cd4}, !- Handle + Site Ground Temperature Undisturbed Kusuda Achenbach 1, !- Name + 0.692626, !- Soil Thermal Conductivity {W/m-K} + 920, !- Soil Density {kg/m3} + 2551.08695652174, !- Soil Specific Heat {J/kg-K} + 13.375, !- Average Soil Surface Temperature {C} + 3.2, !- Average Amplitude of Surface Temperature {deltaC} + 8; !- Phase Shift of Minimum Surface Temperature {days} + diff --git a/src/osversion/test/3_9_1/test_vt_GroundHeatExchangerVertical.rb b/src/osversion/test/3_9_1/test_vt_GroundHeatExchangerVertical.rb new file mode 100644 index 0000000000..a9d062e320 --- /dev/null +++ b/src/osversion/test/3_9_1/test_vt_GroundHeatExchangerVertical.rb @@ -0,0 +1,9 @@ +#require '/usr/local/openstudio-3.9.0/Ruby/openstudio' + +include OpenStudio::Model + +m = Model.new + +ghe_vert = GroundHeatExchangerVertical.new(m) + +m.save('test_vt_GroundHeatExchangerVertical.osm', true) diff --git a/src/osversion/test/VersionTranslator_GTest.cpp b/src/osversion/test/VersionTranslator_GTest.cpp index de25c25a3b..d0ef927fd2 100644 --- a/src/osversion/test/VersionTranslator_GTest.cpp +++ b/src/osversion/test/VersionTranslator_GTest.cpp @@ -4524,3 +4524,21 @@ TEST_F(OSVersionFixture, update_3_8_0_to_3_9_0_SizingZone) { EXPECT_EQ("Coincident", sizing_zone.getString(39).get()); // Sizing Option } + +TEST_F(OSVersionFixture, update_3_9_0_to_3_9_1_GroundHeatExchangerVertical) { + openstudio::path path = resourcesPath() / toPath("osversion/3_9_0/test_vt_GroundHeatExchangerVertical.osm"); + osversion::VersionTranslator vt; + boost::optional model = vt.loadModel(path); + ASSERT_TRUE(model) << "Failed to load " << path; + + openstudio::path outPath = resourcesPath() / toPath("osversion/3_9_0/test_vt_GroundHeatExchangerVertical_updated.osm"); + model->save(outPath, true); + + std::vector ghe_verts = model->getObjectsByType("OS:GroundHeatExchanger:Vertical"); + ASSERT_EQ(1u, ghe_verts.size()); + WorkspaceObject ghe_vert = ghe_verts[0]; + + EXPECT_EQ(120, ghe_vert.getInt(5).get()); // Number of Bore Holes + EXPECT_EQ(1.0, ghe_vert.getDouble(6).get()); // Bore Hole Top Depth + EXPECT_EQ(76.2, ghe_vert.getDouble(7).get()); // Bore Hole Length +} From 4e310e85144ee03e2acaae39e0558dfb9f13bd08 Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Wed, 18 Dec 2024 14:25:47 -0700 Subject: [PATCH 05/16] Formatting. --- src/osversion/test/VersionTranslator_GTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osversion/test/VersionTranslator_GTest.cpp b/src/osversion/test/VersionTranslator_GTest.cpp index d0ef927fd2..ac54ff8fb9 100644 --- a/src/osversion/test/VersionTranslator_GTest.cpp +++ b/src/osversion/test/VersionTranslator_GTest.cpp @@ -4538,7 +4538,7 @@ TEST_F(OSVersionFixture, update_3_9_0_to_3_9_1_GroundHeatExchangerVertical) { ASSERT_EQ(1u, ghe_verts.size()); WorkspaceObject ghe_vert = ghe_verts[0]; - EXPECT_EQ(120, ghe_vert.getInt(5).get()); // Number of Bore Holes - EXPECT_EQ(1.0, ghe_vert.getDouble(6).get()); // Bore Hole Top Depth + EXPECT_EQ(120, ghe_vert.getInt(5).get()); // Number of Bore Holes + EXPECT_EQ(1.0, ghe_vert.getDouble(6).get()); // Bore Hole Top Depth EXPECT_EQ(76.2, ghe_vert.getDouble(7).get()); // Bore Hole Length } From 044393b42da1dcd97d339426bedf766d392fdfe5 Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Wed, 18 Dec 2024 14:24:48 -0700 Subject: [PATCH 06/16] Add bore hole top depth field to idd. --- resources/model/OpenStudio.idd | 36 +++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/resources/model/OpenStudio.idd b/resources/model/OpenStudio.idd index edffc20040..20895af736 100644 --- a/resources/model/OpenStudio.idd +++ b/resources/model/OpenStudio.idd @@ -17112,8 +17112,8 @@ OS:DistrictHeating:Steam, OS:GroundHeatExchanger:Vertical, \extensible:2 - \min-fields 22 - \max-fields 220 + \min-fields 23 + \max-fields 221 \memo Variable short time step vertical ground heat exchanger model based on \memo Yavuztruk, C., J.D.Spitler. 1999. A Short Time Step response Factor Model for \memo Vertical Ground Loop Heat Exchangers @@ -17143,67 +17143,71 @@ OS:GroundHeatExchanger:Vertical, N2, \field Number of Bore Holes \type integer \minimum> 0.0 - N3, \field Bore Hole Length + N3, \field Bore Hole Top Depth + \type real + \units m + \minimum 0.0 + N4, \field Bore Hole Length \type real \units m \minimum> 0.0 - N4, \field Bore Hole Radius + N5, \field Bore Hole Radius \type real \units m \minimum> 0.0 - N5, \field Ground Thermal Conductivity + N6, \field Ground Thermal Conductivity \type real \units W/m-K \ip-units Btu-in/hr-ft2-R \minimum> 0.0 - N6, \field Ground Thermal Heat Capacity + N7, \field Ground Thermal Heat Capacity \type real \units J/m3-K \minimum> 0.0 - N7, \field Ground Temperature + N8, \field Ground Temperature \type real \units C \minimum> 0.0 - N8, \field Grout Thermal Conductivity + N9, \field Grout Thermal Conductivity \type real \units W/m-K \ip-units Btu-in/hr-ft2-R \minimum> 0.0 - N9, \field Pipe Thermal Conductivity + N10, \field Pipe Thermal Conductivity \type real \units W/m-K \ip-units Btu-in/hr-ft2-R \minimum> 0.0 - N10, \field Pipe Out Diameter + N11, \field Pipe Out Diameter \type real \units m \minimum> 0.0 \ip-units in - N11, \field U-Tube Distance + N12, \field U-Tube Distance \type real \units m \minimum> 0.0 - N12, \field Pipe Thickness + N13, \field Pipe Thickness \type real \units m \minimum> 0.0 \ip-units in - N13, \field Maximum Length of Simulation + N14, \field Maximum Length of Simulation \type real \minimum> 0.0 A5, \field Undisturbed Ground Temperature Model \required-field \type object-list \object-list UndisturbedGroundTempModels - N14, \field G-Function Reference Ratio + N15, \field G-Function Reference Ratio \type real \units dimensionless \minimum> 0.0 \default 0.0005 - N15, \field G-Function Ln(T/Ts) Value + N16, \field G-Function Ln(T/Ts) Value \type real \begin-extensible - N16; \field G-Function G Value + N17; \field G-Function G Value \type real OS:GroundHeatExchanger:HorizontalTrench, From e3a175868dc136ac622e86304f45806361777d1b Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Wed, 18 Dec 2024 14:25:02 -0700 Subject: [PATCH 07/16] Update model source files. --- src/model/GroundHeatExchangerVertical.cpp | 34 +++++++++++++++++++ src/model/GroundHeatExchangerVertical.hpp | 6 ++++ .../GroundHeatExchangerVertical_Impl.hpp | 6 ++++ .../GroundHeatExchangerVertical_GTest.cpp | 9 +++++ 4 files changed, 55 insertions(+) diff --git a/src/model/GroundHeatExchangerVertical.cpp b/src/model/GroundHeatExchangerVertical.cpp index 75ffb69dd9..66fe4e5562 100644 --- a/src/model/GroundHeatExchangerVertical.cpp +++ b/src/model/GroundHeatExchangerVertical.cpp @@ -57,6 +57,10 @@ namespace model { return getInt(OS_GroundHeatExchanger_VerticalFields::NumberofBoreHoles, true); } + boost::optional GroundHeatExchangerVertical_Impl::boreHoleTopDepth() const { + return getDouble(OS_GroundHeatExchanger_VerticalFields::BoreHoleTopDepth, true); + } + boost::optional GroundHeatExchangerVertical_Impl::boreHoleLength() const { return getDouble(OS_GroundHeatExchanger_VerticalFields::BoreHoleLength, true); } @@ -139,6 +143,22 @@ namespace model { OS_ASSERT(result); } + bool GroundHeatExchangerVertical_Impl::setBoreHoleTopDepth(boost::optional boreHoleTopDepth) { + bool result(false); + if (boreHoleTopDepth) { + result = setDouble(OS_GroundHeatExchanger_VerticalFields::BoreHoleTopDepth, boreHoleTopDepth.get()); + } else { + resetBoreHoleTopDepth(); + result = true; + } + return result; + } + + void GroundHeatExchangerVertical_Impl::resetBoreHoleTopDepth() { + bool result = setString(OS_GroundHeatExchanger_VerticalFields::BoreHoleTopDepth, ""); + OS_ASSERT(result); + } + bool GroundHeatExchangerVertical_Impl::setBoreHoleLength(boost::optional boreHoleLength) { bool result(false); if (boreHoleLength) { @@ -443,6 +463,7 @@ namespace model { OS_ASSERT(getImpl()); setNumberofBoreHoles(120); + setBoreHoleTopDepth(1); setBoreHoleLength(76.2); setBoreHoleRadius(0.635080E-01); setGroundThermalConductivity(0.692626); @@ -513,6 +534,7 @@ namespace model { << undisturbedGroundTemperatureModel.briefDescription() << "."); } setNumberofBoreHoles(120); + setBoreHoleTopDepth(1); setBoreHoleLength(76.2); setBoreHoleRadius(0.635080E-01); setGroundThermalConductivity(0.692626); @@ -596,6 +618,10 @@ namespace model { return getImpl()->numberofBoreHoles(); } + boost::optional GroundHeatExchangerVertical::boreHoleTopDepth() const { + return getImpl()->boreHoleTopDepth(); + } + boost::optional GroundHeatExchangerVertical::boreHoleLength() const { return getImpl()->boreHoleLength(); } @@ -664,6 +690,14 @@ namespace model { getImpl()->resetNumberofBoreHoles(); } + bool GroundHeatExchangerVertical::setBoreHoleTopDepth(double boreHoleTopDepth) { + return getImpl()->setBoreHoleTopDepth(boreHoleTopDepth); + } + + void GroundHeatExchangerVertical::resetBoreHoleTopDepth() { + getImpl()->resetBoreHoleTopDepth(); + } + bool GroundHeatExchangerVertical::setBoreHoleLength(double boreHoleLength) { return getImpl()->setBoreHoleLength(boreHoleLength); } diff --git a/src/model/GroundHeatExchangerVertical.hpp b/src/model/GroundHeatExchangerVertical.hpp index 984621e2a9..d69a5959a6 100644 --- a/src/model/GroundHeatExchangerVertical.hpp +++ b/src/model/GroundHeatExchangerVertical.hpp @@ -69,6 +69,8 @@ namespace model { boost::optional numberofBoreHoles() const; + boost::optional boreHoleTopDepth() const; + boost::optional boreHoleLength() const; boost::optional boreHoleRadius() const; @@ -108,6 +110,10 @@ namespace model { void resetNumberofBoreHoles(); + bool setBoreHoleTopDepth(double boreHoleTopDepth); + + void resetBoreHoleTopDepth(); + bool setBoreHoleLength(double boreHoleLength); void resetBoreHoleLength(); diff --git a/src/model/GroundHeatExchangerVertical_Impl.hpp b/src/model/GroundHeatExchangerVertical_Impl.hpp index 307b508d2d..971a2bd28f 100644 --- a/src/model/GroundHeatExchangerVertical_Impl.hpp +++ b/src/model/GroundHeatExchangerVertical_Impl.hpp @@ -56,6 +56,8 @@ namespace model { boost::optional numberofBoreHoles() const; + boost::optional boreHoleTopDepth() const; + boost::optional boreHoleLength() const; boost::optional boreHoleRadius() const; @@ -94,6 +96,10 @@ namespace model { void resetNumberofBoreHoles(); + bool setBoreHoleTopDepth(double boreHoleTopDepth); + + void resetBoreHoleTopDepth(); + bool setBoreHoleLength(boost::optional boreHoleLength); void resetBoreHoleLength(); diff --git a/src/model/test/GroundHeatExchangerVertical_GTest.cpp b/src/model/test/GroundHeatExchangerVertical_GTest.cpp index d89e056cfc..a69da56f8e 100644 --- a/src/model/test/GroundHeatExchangerVertical_GTest.cpp +++ b/src/model/test/GroundHeatExchangerVertical_GTest.cpp @@ -40,6 +40,8 @@ TEST_F(ModelFixture, GroundHeatExchangerVertical_GroundHeatExchangerVertical) { EXPECT_EQ(0.0033, gh.designFlowRate().get()); ASSERT_TRUE(gh.numberofBoreHoles()); EXPECT_EQ(120, gh.numberofBoreHoles().get()); + ASSERT_TRUE(gh.boreHoleTopDepth()); + EXPECT_EQ(1.0, gh.boreHoleTopDepth().get()); ASSERT_TRUE(gh.boreHoleLength()); EXPECT_EQ(76.2, gh.boreHoleLength().get()); ASSERT_TRUE(gh.boreHoleRadius()); @@ -79,6 +81,8 @@ TEST_F(ModelFixture, GroundHeatExchangerVertical_GroundHeatExchangerVertical) { EXPECT_EQ(0.0033, gh.designFlowRate().get()); ASSERT_TRUE(gh.numberofBoreHoles()); EXPECT_EQ(120, gh.numberofBoreHoles().get()); + ASSERT_TRUE(gh.boreHoleTopDepth()); + EXPECT_EQ(1.0, gh.boreHoleTopDepth().get()); ASSERT_TRUE(gh.boreHoleLength()); EXPECT_EQ(76.2, gh.boreHoleLength().get()); ASSERT_TRUE(gh.boreHoleRadius()); @@ -117,6 +121,7 @@ TEST_F(ModelFixture, GroundHeatExchangerVertical_SetGetFields) { EXPECT_TRUE(gh.setDesignFlowRate(0.004)); EXPECT_TRUE(gh.setNumberofBoreHoles(100)); + EXPECT_TRUE(gh.setBoreHoleTopDepth(1.25)); EXPECT_TRUE(gh.setBoreHoleLength(80.0)); EXPECT_TRUE(gh.setBoreHoleRadius(0.7E-01)); EXPECT_TRUE(gh.setGroundThermalConductivity(0.7)); @@ -137,6 +142,8 @@ TEST_F(ModelFixture, GroundHeatExchangerVertical_SetGetFields) { EXPECT_EQ(0.004, gh.designFlowRate().get()); ASSERT_TRUE(gh.numberofBoreHoles()); EXPECT_EQ(100, gh.numberofBoreHoles().get()); + ASSERT_TRUE(gh.boreHoleTopDepth()); + EXPECT_EQ(1.25, gh.boreHoleTopDepth().get()); ASSERT_TRUE(gh.boreHoleLength()); EXPECT_EQ(80.0, gh.boreHoleLength().get()); ASSERT_TRUE(gh.boreHoleRadius()); @@ -174,6 +181,8 @@ TEST_F(ModelFixture, GroundHeatExchangerVertical_SetGetFields) { EXPECT_EQ(0.004, gh.designFlowRate().get()); ASSERT_TRUE(gh.numberofBoreHoles()); EXPECT_EQ(100, gh.numberofBoreHoles().get()); + ASSERT_TRUE(gh.boreHoleTopDepth()); + EXPECT_EQ(1.25 gh.boreHoleTopDepth().get()); ASSERT_TRUE(gh.boreHoleLength()); EXPECT_EQ(80.0, gh.boreHoleLength().get()); ASSERT_TRUE(gh.boreHoleRadius()); From e207bb19ffd84b70409f9392f58d705fbf07d425 Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Wed, 18 Dec 2024 14:25:24 -0700 Subject: [PATCH 08/16] Update ft files. --- .../ForwardTranslateGroundHeatExchangerVertical.cpp | 4 +++- src/energyplus/Test/GroundHeatExchangerVertical_GTest.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateGroundHeatExchangerVertical.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateGroundHeatExchangerVertical.cpp index d573a1c679..c6fcd73576 100644 --- a/src/energyplus/ForwardTranslator/ForwardTranslateGroundHeatExchangerVertical.cpp +++ b/src/energyplus/ForwardTranslator/ForwardTranslateGroundHeatExchangerVertical.cpp @@ -146,7 +146,9 @@ namespace energyplus { auto propertiesObjectName = modelObject.nameString() + " Properties"; propertiesIdfObject.setName(propertiesObjectName); - propertiesIdfObject.setDouble(GroundHeatExchanger_Vertical_PropertiesFields::DepthofTopofBorehole, 1); + if ((value = modelObject.boreHoleTopDepth())) { + propertiesIdfObject.setDouble(GroundHeatExchanger_Vertical_PropertiesFields::DepthofTopofBorehole, value.get()); + } if ((value = modelObject.boreHoleLength())) { propertiesIdfObject.setDouble(GroundHeatExchanger_Vertical_PropertiesFields::BoreholeLength, value.get()); diff --git a/src/energyplus/Test/GroundHeatExchangerVertical_GTest.cpp b/src/energyplus/Test/GroundHeatExchangerVertical_GTest.cpp index f7f3b7e853..e3f208664a 100644 --- a/src/energyplus/Test/GroundHeatExchangerVertical_GTest.cpp +++ b/src/energyplus/Test/GroundHeatExchangerVertical_GTest.cpp @@ -42,6 +42,7 @@ TEST_F(EnergyPlusFixture, ForwardTranslator_GroundHeatExchangerVertical) { EXPECT_TRUE(ghx.setDesignFlowRate(0.004)); EXPECT_TRUE(ghx.setNumberofBoreHoles(100)); + EXPECT_TRUE(ghx.setBoreHoleTopDepth(1.35)); EXPECT_TRUE(ghx.setBoreHoleLength(80.0)); EXPECT_TRUE(ghx.setBoreHoleRadius(0.7E-01)); EXPECT_TRUE(ghx.setGroundThermalConductivity(0.7)); @@ -109,6 +110,7 @@ TEST_F(EnergyPlusFixture, ForwardTranslator_GroundHeatExchangerVertical) { EXPECT_EQ(0.001, response.getDouble(GroundHeatExchanger_ResponseFactorsFields::GFunctionReferenceRatio).get()); EXPECT_EQ(1, properties.getDouble(GroundHeatExchanger_Vertical_PropertiesFields::DepthofTopofBorehole).get()); + EXPECT_EQ(1.35, 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()); From 42c1d9f38fafe38e29ee015d1af95f9f446de7b0 Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Wed, 18 Dec 2024 14:25:32 -0700 Subject: [PATCH 09/16] Update vt files. --- src/osversion/VersionTranslator.cpp | 45 ++++++++ src/osversion/VersionTranslator.hpp | 1 + .../test_vt_GroundHeatExchangerVertical.osm | 106 ++++++++++++++++++ .../test_vt_GroundHeatExchangerVertical.rb | 9 ++ .../test/VersionTranslator_GTest.cpp | 18 +++ 5 files changed, 179 insertions(+) create mode 100644 src/osversion/test/3_9_1/test_vt_GroundHeatExchangerVertical.osm create mode 100644 src/osversion/test/3_9_1/test_vt_GroundHeatExchangerVertical.rb diff --git a/src/osversion/VersionTranslator.cpp b/src/osversion/VersionTranslator.cpp index 507dc9d1d8..bf9382ee18 100644 --- a/src/osversion/VersionTranslator.cpp +++ b/src/osversion/VersionTranslator.cpp @@ -9640,5 +9640,50 @@ namespace osversion { } // end update_3_8_0_to_3_9_0 + std::string VersionTranslator::update_3_9_0_to_3_9_1(const IdfFile& idf_3_9_0, const IddFileAndFactoryWrapper& idd_3_9_1) { + std::stringstream ss; + boost::optional value; + + ss << idf_3_9_0.header() << '\n' << '\n'; + IdfFile targetIdf(idd_3_9_0.iddFile()); + ss << targetIdf.versionObject().get(); + + for (const IdfObject& object : idd_3_9_1.objects()) { + auto iddname = object.iddObject().name(); + + if (iddname == "OS:GroundHeatExchanger:Vertical") { + + // 1 Field has been inserted from 3.9.0 to 3.9.1: + // ---------------------------------------------- + // * Bore Hole Top Depth * 6 + + auto iddObject = idd_3_9_0.getObject(iddname); + IdfObject newObject(iddObject.get()); + + for (size_t i = 0; i < object.numFields(); ++i) { + if ((value = object.getString(i))) { + if (i < 6) { + newObject.setString(i, value.get()); + } else { + newObject.setString(i + 1, value.get()); + } + } + } + + newObject.setDouble(6, 1.0); // this value of 1 is what we previously had hardcoded in FT + + ss << newObject; + m_refactored.emplace_back(std::move(object), std::move(newObject)); + + // No-op + } else { + ss << object; + } + } + + return ss.str(); + + } // end update_3_9_0_to_3_9_1 + } // namespace osversion } // namespace openstudio diff --git a/src/osversion/VersionTranslator.hpp b/src/osversion/VersionTranslator.hpp index 4600c2faa7..9ea4e977e4 100644 --- a/src/osversion/VersionTranslator.hpp +++ b/src/osversion/VersionTranslator.hpp @@ -237,6 +237,7 @@ namespace osversion { std::string update_3_6_1_to_3_7_0(const IdfFile& idf_3_6_1, const IddFileAndFactoryWrapper& idd_3_7_0); std::string update_3_7_0_to_3_8_0(const IdfFile& idf_3_7_0, const IddFileAndFactoryWrapper& idd_3_8_0); std::string update_3_8_0_to_3_9_0(const IdfFile& idf_3_8_0, const IddFileAndFactoryWrapper& idd_3_9_0); + std::string update_3_9_0_to_3_9_1(const IdfFile& idf_3_9_0, const IddFileAndFactoryWrapper& idd_3_9_1); IdfObject updateUrlField_0_7_1_to_0_7_2(const IdfObject& object, unsigned index); diff --git a/src/osversion/test/3_9_1/test_vt_GroundHeatExchangerVertical.osm b/src/osversion/test/3_9_1/test_vt_GroundHeatExchangerVertical.osm new file mode 100644 index 0000000000..2d894123b0 --- /dev/null +++ b/src/osversion/test/3_9_1/test_vt_GroundHeatExchangerVertical.osm @@ -0,0 +1,106 @@ + +OS:Version, + {c23de9a0-083e-49b9-843c-3008f64ac27b}, !- Handle + 3.9.0; !- Version Identifier + +OS:GroundHeatExchanger:Vertical, + {bc2f2f69-fa65-42c9-8f1b-5887bfebd17d}, !- Handle + Ground Heat Exchanger Vertical 1, !- Name + , !- Inlet Node Name + , !- Outlet Node Name + 0.0033, !- Design Flow Rate {m3/s} + 120, !- Number of Bore Holes + 76.2, !- Bore Hole Length {m} + 0.063508, !- Bore Hole Radius {m} + 0.692626, !- Ground Thermal Conductivity {W/m-K} + 2347000, !- Ground Thermal Heat Capacity {J/m3-K} + 13.375, !- Ground Temperature {C} + 0.692626, !- Grout Thermal Conductivity {W/m-K} + 0.391312, !- Pipe Thermal Conductivity {W/m-K} + 0.0266667, !- Pipe Out Diameter {m} + 0.0253977, !- U-Tube Distance {m} + 0.00241285, !- Pipe Thickness {m} + 2, !- Maximum Length of Simulation + {1da197d6-5c3f-4d28-af88-8d9f74332cd4}, !- Undisturbed Ground Temperature Model + 0.0005, !- G-Function Reference Ratio {dimensionless} + -15.2996, !- G-Function Ln(T/Ts) Value 1 + -0.348322, !- G-Function G Value 1 + -14.201, !- G-Function Ln(T/Ts) Value 2 + 0.022208, !- G-Function G Value 2 + -13.2202, !- G-Function Ln(T/Ts) Value 3 + 0.412345, !- G-Function G Value 3 + -12.2086, !- G-Function Ln(T/Ts) Value 4 + 0.867498, !- G-Function G Value 4 + -11.1888, !- G-Function Ln(T/Ts) Value 5 + 1.357839, !- G-Function G Value 5 + -10.1816, !- G-Function Ln(T/Ts) Value 6 + 1.852024, !- G-Function G Value 6 + -9.1815, !- G-Function Ln(T/Ts) Value 7 + 2.345656, !- G-Function G Value 7 + -8.6809, !- G-Function Ln(T/Ts) Value 8 + 2.593958, !- G-Function G Value 8 + -8.5, !- G-Function Ln(T/Ts) Value 9 + 2.679, !- G-Function G Value 9 + -7.8, !- G-Function Ln(T/Ts) Value 10 + 3.023, !- G-Function G Value 10 + -7.2, !- G-Function Ln(T/Ts) Value 11 + 3.32, !- G-Function G Value 11 + -6.5, !- G-Function Ln(T/Ts) Value 12 + 3.681, !- G-Function G Value 12 + -5.9, !- G-Function Ln(T/Ts) Value 13 + 4.071, !- G-Function G Value 13 + -5.2, !- G-Function Ln(T/Ts) Value 14 + 4.828, !- G-Function G Value 14 + -4.5, !- G-Function Ln(T/Ts) Value 15 + 6.253, !- G-Function G Value 15 + -3.963, !- G-Function Ln(T/Ts) Value 16 + 7.894, !- G-Function G Value 16 + -3.27, !- G-Function Ln(T/Ts) Value 17 + 11.82, !- G-Function G Value 17 + -2.864, !- G-Function Ln(T/Ts) Value 18 + 15.117, !- G-Function G Value 18 + -2.577, !- G-Function Ln(T/Ts) Value 19 + 18.006, !- G-Function G Value 19 + -2.171, !- G-Function Ln(T/Ts) Value 20 + 22.887, !- G-Function G Value 20 + -1.884, !- G-Function Ln(T/Ts) Value 21 + 26.924, !- G-Function G Value 21 + -1.191, !- G-Function Ln(T/Ts) Value 22 + 38.004, !- G-Function G Value 22 + -0.497, !- G-Function Ln(T/Ts) Value 23 + 49.919, !- G-Function G Value 23 + -0.274, !- G-Function Ln(T/Ts) Value 24 + 53.407, !- G-Function G Value 24 + -0.051, !- G-Function Ln(T/Ts) Value 25 + 56.632, !- G-Function G Value 25 + 0.196, !- G-Function Ln(T/Ts) Value 26 + 59.825, !- G-Function G Value 26 + 0.419, !- G-Function Ln(T/Ts) Value 27 + 62.349, !- G-Function G Value 27 + 0.642, !- G-Function Ln(T/Ts) Value 28 + 64.524, !- G-Function G Value 28 + 0.873, !- G-Function Ln(T/Ts) Value 29 + 66.412, !- G-Function G Value 29 + 1.112, !- G-Function Ln(T/Ts) Value 30 + 67.993, !- G-Function G Value 30 + 1.335, !- G-Function Ln(T/Ts) Value 31 + 69.162, !- G-Function G Value 31 + 1.679, !- G-Function Ln(T/Ts) Value 32 + 70.476, !- G-Function G Value 32 + 2.028, !- G-Function Ln(T/Ts) Value 33 + 71.361, !- G-Function G Value 33 + 2.275, !- G-Function Ln(T/Ts) Value 34 + 71.79, !- G-Function G Value 34 + 3.003, !- G-Function Ln(T/Ts) Value 35 + 72.511; !- G-Function G Value 35 + +OS:Site:GroundTemperature:Undisturbed:KusudaAchenbach, + {1da197d6-5c3f-4d28-af88-8d9f74332cd4}, !- Handle + Site Ground Temperature Undisturbed Kusuda Achenbach 1, !- Name + 0.692626, !- Soil Thermal Conductivity {W/m-K} + 920, !- Soil Density {kg/m3} + 2551.08695652174, !- Soil Specific Heat {J/kg-K} + 13.375, !- Average Soil Surface Temperature {C} + 3.2, !- Average Amplitude of Surface Temperature {deltaC} + 8; !- Phase Shift of Minimum Surface Temperature {days} + diff --git a/src/osversion/test/3_9_1/test_vt_GroundHeatExchangerVertical.rb b/src/osversion/test/3_9_1/test_vt_GroundHeatExchangerVertical.rb new file mode 100644 index 0000000000..a9d062e320 --- /dev/null +++ b/src/osversion/test/3_9_1/test_vt_GroundHeatExchangerVertical.rb @@ -0,0 +1,9 @@ +#require '/usr/local/openstudio-3.9.0/Ruby/openstudio' + +include OpenStudio::Model + +m = Model.new + +ghe_vert = GroundHeatExchangerVertical.new(m) + +m.save('test_vt_GroundHeatExchangerVertical.osm', true) diff --git a/src/osversion/test/VersionTranslator_GTest.cpp b/src/osversion/test/VersionTranslator_GTest.cpp index de25c25a3b..d0ef927fd2 100644 --- a/src/osversion/test/VersionTranslator_GTest.cpp +++ b/src/osversion/test/VersionTranslator_GTest.cpp @@ -4524,3 +4524,21 @@ TEST_F(OSVersionFixture, update_3_8_0_to_3_9_0_SizingZone) { EXPECT_EQ("Coincident", sizing_zone.getString(39).get()); // Sizing Option } + +TEST_F(OSVersionFixture, update_3_9_0_to_3_9_1_GroundHeatExchangerVertical) { + openstudio::path path = resourcesPath() / toPath("osversion/3_9_0/test_vt_GroundHeatExchangerVertical.osm"); + osversion::VersionTranslator vt; + boost::optional model = vt.loadModel(path); + ASSERT_TRUE(model) << "Failed to load " << path; + + openstudio::path outPath = resourcesPath() / toPath("osversion/3_9_0/test_vt_GroundHeatExchangerVertical_updated.osm"); + model->save(outPath, true); + + std::vector ghe_verts = model->getObjectsByType("OS:GroundHeatExchanger:Vertical"); + ASSERT_EQ(1u, ghe_verts.size()); + WorkspaceObject ghe_vert = ghe_verts[0]; + + EXPECT_EQ(120, ghe_vert.getInt(5).get()); // Number of Bore Holes + EXPECT_EQ(1.0, ghe_vert.getDouble(6).get()); // Bore Hole Top Depth + EXPECT_EQ(76.2, ghe_vert.getDouble(7).get()); // Bore Hole Length +} From ea74e19e52ab030972be651572d17250d0213591 Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Wed, 18 Dec 2024 14:25:47 -0700 Subject: [PATCH 10/16] Formatting. --- src/osversion/test/VersionTranslator_GTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osversion/test/VersionTranslator_GTest.cpp b/src/osversion/test/VersionTranslator_GTest.cpp index d0ef927fd2..ac54ff8fb9 100644 --- a/src/osversion/test/VersionTranslator_GTest.cpp +++ b/src/osversion/test/VersionTranslator_GTest.cpp @@ -4538,7 +4538,7 @@ TEST_F(OSVersionFixture, update_3_9_0_to_3_9_1_GroundHeatExchangerVertical) { ASSERT_EQ(1u, ghe_verts.size()); WorkspaceObject ghe_vert = ghe_verts[0]; - EXPECT_EQ(120, ghe_vert.getInt(5).get()); // Number of Bore Holes - EXPECT_EQ(1.0, ghe_vert.getDouble(6).get()); // Bore Hole Top Depth + EXPECT_EQ(120, ghe_vert.getInt(5).get()); // Number of Bore Holes + EXPECT_EQ(1.0, ghe_vert.getDouble(6).get()); // Bore Hole Top Depth EXPECT_EQ(76.2, ghe_vert.getDouble(7).get()); // Bore Hole Length } From e99b335f0d08db5b912f54796becbd24e92a1478 Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Wed, 18 Dec 2024 15:24:17 -0700 Subject: [PATCH 11/16] Fix setter in impl. --- src/model/GroundHeatExchangerVertical_Impl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/model/GroundHeatExchangerVertical_Impl.hpp b/src/model/GroundHeatExchangerVertical_Impl.hpp index 971a2bd28f..9821b23f42 100644 --- a/src/model/GroundHeatExchangerVertical_Impl.hpp +++ b/src/model/GroundHeatExchangerVertical_Impl.hpp @@ -96,7 +96,7 @@ namespace model { void resetNumberofBoreHoles(); - bool setBoreHoleTopDepth(double boreHoleTopDepth); + bool setBoreHoleTopDepth(boost::optional boreHoleTopDepth); void resetBoreHoleTopDepth(); From a0827aa1172562cef841b48e3011cf9713df3c5f Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Thu, 19 Dec 2024 11:54:10 +0100 Subject: [PATCH 12/16] Update src/model/test/GroundHeatExchangerVertical_GTest.cpp --- src/model/test/GroundHeatExchangerVertical_GTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/model/test/GroundHeatExchangerVertical_GTest.cpp b/src/model/test/GroundHeatExchangerVertical_GTest.cpp index a69da56f8e..1f8a076d8b 100644 --- a/src/model/test/GroundHeatExchangerVertical_GTest.cpp +++ b/src/model/test/GroundHeatExchangerVertical_GTest.cpp @@ -182,7 +182,7 @@ TEST_F(ModelFixture, GroundHeatExchangerVertical_SetGetFields) { ASSERT_TRUE(gh.numberofBoreHoles()); EXPECT_EQ(100, gh.numberofBoreHoles().get()); ASSERT_TRUE(gh.boreHoleTopDepth()); - EXPECT_EQ(1.25 gh.boreHoleTopDepth().get()); + EXPECT_EQ(1.25, gh.boreHoleTopDepth().get()); ASSERT_TRUE(gh.boreHoleLength()); EXPECT_EQ(80.0, gh.boreHoleLength().get()); ASSERT_TRUE(gh.boreHoleRadius()); From 61a87f2cd30ee6b7db78b1a05e5d2b0c7bb177ae Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Thu, 19 Dec 2024 12:48:22 -0700 Subject: [PATCH 13/16] Make top depth a required field. --- resources/model/OpenStudio.idd | 1 + ...rdTranslateGroundHeatExchangerVertical.cpp | 4 +-- src/model/GroundHeatExchangerVertical.cpp | 27 +++++-------------- src/model/GroundHeatExchangerVertical.hpp | 4 +-- .../GroundHeatExchangerVertical_Impl.hpp | 6 ++--- 5 files changed, 12 insertions(+), 30 deletions(-) diff --git a/resources/model/OpenStudio.idd b/resources/model/OpenStudio.idd index 20895af736..dd56d97269 100644 --- a/resources/model/OpenStudio.idd +++ b/resources/model/OpenStudio.idd @@ -17144,6 +17144,7 @@ OS:GroundHeatExchanger:Vertical, \type integer \minimum> 0.0 N3, \field Bore Hole Top Depth + \required-field \type real \units m \minimum 0.0 diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateGroundHeatExchangerVertical.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateGroundHeatExchangerVertical.cpp index c6fcd73576..4465d3c06a 100644 --- a/src/energyplus/ForwardTranslator/ForwardTranslateGroundHeatExchangerVertical.cpp +++ b/src/energyplus/ForwardTranslator/ForwardTranslateGroundHeatExchangerVertical.cpp @@ -146,9 +146,7 @@ namespace energyplus { auto propertiesObjectName = modelObject.nameString() + " Properties"; propertiesIdfObject.setName(propertiesObjectName); - if ((value = modelObject.boreHoleTopDepth())) { - propertiesIdfObject.setDouble(GroundHeatExchanger_Vertical_PropertiesFields::DepthofTopofBorehole, value.get()); - } + propertiesIdfObject.setDouble(GroundHeatExchanger_Vertical_PropertiesFields::DepthofTopofBorehole, modelObject.boreHoleTopDepth()); if ((value = modelObject.boreHoleLength())) { propertiesIdfObject.setDouble(GroundHeatExchanger_Vertical_PropertiesFields::BoreholeLength, value.get()); diff --git a/src/model/GroundHeatExchangerVertical.cpp b/src/model/GroundHeatExchangerVertical.cpp index 66fe4e5562..39a03cde3b 100644 --- a/src/model/GroundHeatExchangerVertical.cpp +++ b/src/model/GroundHeatExchangerVertical.cpp @@ -57,8 +57,10 @@ namespace model { return getInt(OS_GroundHeatExchanger_VerticalFields::NumberofBoreHoles, true); } - boost::optional GroundHeatExchangerVertical_Impl::boreHoleTopDepth() const { - return getDouble(OS_GroundHeatExchanger_VerticalFields::BoreHoleTopDepth, true); + double GroundHeatExchangerVertical_Impl::boreHoleTopDepth() const { + boost::optional value = getDouble(OS_GroundHeatExchanger_VerticalFields::BoreHoleTopDepth, true); + OS_ASSERT(value); + return value.get(); } boost::optional GroundHeatExchangerVertical_Impl::boreHoleLength() const { @@ -143,22 +145,11 @@ namespace model { OS_ASSERT(result); } - bool GroundHeatExchangerVertical_Impl::setBoreHoleTopDepth(boost::optional boreHoleTopDepth) { - bool result(false); - if (boreHoleTopDepth) { - result = setDouble(OS_GroundHeatExchanger_VerticalFields::BoreHoleTopDepth, boreHoleTopDepth.get()); - } else { - resetBoreHoleTopDepth(); - result = true; - } + bool GroundHeatExchangerVertical_Impl::setBoreHoleTopDepth(double boreHoleTopDepth) { + bool result = setDouble(OS_GroundHeatExchanger_VerticalFields::BoreHoleTopDepth, boreHoleTopDepth); return result; } - void GroundHeatExchangerVertical_Impl::resetBoreHoleTopDepth() { - bool result = setString(OS_GroundHeatExchanger_VerticalFields::BoreHoleTopDepth, ""); - OS_ASSERT(result); - } - bool GroundHeatExchangerVertical_Impl::setBoreHoleLength(boost::optional boreHoleLength) { bool result(false); if (boreHoleLength) { @@ -618,7 +609,7 @@ namespace model { return getImpl()->numberofBoreHoles(); } - boost::optional GroundHeatExchangerVertical::boreHoleTopDepth() const { + double GroundHeatExchangerVertical::boreHoleTopDepth() const { return getImpl()->boreHoleTopDepth(); } @@ -694,10 +685,6 @@ namespace model { return getImpl()->setBoreHoleTopDepth(boreHoleTopDepth); } - void GroundHeatExchangerVertical::resetBoreHoleTopDepth() { - getImpl()->resetBoreHoleTopDepth(); - } - bool GroundHeatExchangerVertical::setBoreHoleLength(double boreHoleLength) { return getImpl()->setBoreHoleLength(boreHoleLength); } diff --git a/src/model/GroundHeatExchangerVertical.hpp b/src/model/GroundHeatExchangerVertical.hpp index d69a5959a6..3f337ff6a3 100644 --- a/src/model/GroundHeatExchangerVertical.hpp +++ b/src/model/GroundHeatExchangerVertical.hpp @@ -69,7 +69,7 @@ namespace model { boost::optional numberofBoreHoles() const; - boost::optional boreHoleTopDepth() const; + double boreHoleTopDepth() const; boost::optional boreHoleLength() const; @@ -112,8 +112,6 @@ namespace model { bool setBoreHoleTopDepth(double boreHoleTopDepth); - void resetBoreHoleTopDepth(); - bool setBoreHoleLength(double boreHoleLength); void resetBoreHoleLength(); diff --git a/src/model/GroundHeatExchangerVertical_Impl.hpp b/src/model/GroundHeatExchangerVertical_Impl.hpp index 9821b23f42..739598f0db 100644 --- a/src/model/GroundHeatExchangerVertical_Impl.hpp +++ b/src/model/GroundHeatExchangerVertical_Impl.hpp @@ -56,7 +56,7 @@ namespace model { boost::optional numberofBoreHoles() const; - boost::optional boreHoleTopDepth() const; + double boreHoleTopDepth() const; boost::optional boreHoleLength() const; @@ -96,9 +96,7 @@ namespace model { void resetNumberofBoreHoles(); - bool setBoreHoleTopDepth(boost::optional boreHoleTopDepth); - - void resetBoreHoleTopDepth(); + bool setBoreHoleTopDepth(double boreHoleTopDepth); bool setBoreHoleLength(boost::optional boreHoleLength); From 9d64254b4990d5f1bde1d3e22741c8096099fcb3 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 20 Dec 2024 08:43:47 +0100 Subject: [PATCH 14/16] Apply suggestions from code review --- src/model/test/GroundHeatExchangerVertical_GTest.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/model/test/GroundHeatExchangerVertical_GTest.cpp b/src/model/test/GroundHeatExchangerVertical_GTest.cpp index 1f8a076d8b..3e659eed41 100644 --- a/src/model/test/GroundHeatExchangerVertical_GTest.cpp +++ b/src/model/test/GroundHeatExchangerVertical_GTest.cpp @@ -40,8 +40,7 @@ TEST_F(ModelFixture, GroundHeatExchangerVertical_GroundHeatExchangerVertical) { EXPECT_EQ(0.0033, gh.designFlowRate().get()); ASSERT_TRUE(gh.numberofBoreHoles()); EXPECT_EQ(120, gh.numberofBoreHoles().get()); - ASSERT_TRUE(gh.boreHoleTopDepth()); - EXPECT_EQ(1.0, gh.boreHoleTopDepth().get()); + EXPECT_EQ(1.0, gh.boreHoleTopDepth()); ASSERT_TRUE(gh.boreHoleLength()); EXPECT_EQ(76.2, gh.boreHoleLength().get()); ASSERT_TRUE(gh.boreHoleRadius()); @@ -81,8 +80,7 @@ TEST_F(ModelFixture, GroundHeatExchangerVertical_GroundHeatExchangerVertical) { EXPECT_EQ(0.0033, gh.designFlowRate().get()); ASSERT_TRUE(gh.numberofBoreHoles()); EXPECT_EQ(120, gh.numberofBoreHoles().get()); - ASSERT_TRUE(gh.boreHoleTopDepth()); - EXPECT_EQ(1.0, gh.boreHoleTopDepth().get()); + EXPECT_EQ(1.0, gh.boreHoleTopDepth()); ASSERT_TRUE(gh.boreHoleLength()); EXPECT_EQ(76.2, gh.boreHoleLength().get()); ASSERT_TRUE(gh.boreHoleRadius()); @@ -142,8 +140,7 @@ TEST_F(ModelFixture, GroundHeatExchangerVertical_SetGetFields) { EXPECT_EQ(0.004, gh.designFlowRate().get()); ASSERT_TRUE(gh.numberofBoreHoles()); EXPECT_EQ(100, gh.numberofBoreHoles().get()); - ASSERT_TRUE(gh.boreHoleTopDepth()); - EXPECT_EQ(1.25, gh.boreHoleTopDepth().get()); + EXPECT_EQ(1.25, gh.boreHoleTopDepth()); ASSERT_TRUE(gh.boreHoleLength()); EXPECT_EQ(80.0, gh.boreHoleLength().get()); ASSERT_TRUE(gh.boreHoleRadius()); @@ -181,8 +178,7 @@ TEST_F(ModelFixture, GroundHeatExchangerVertical_SetGetFields) { EXPECT_EQ(0.004, gh.designFlowRate().get()); ASSERT_TRUE(gh.numberofBoreHoles()); EXPECT_EQ(100, gh.numberofBoreHoles().get()); - ASSERT_TRUE(gh.boreHoleTopDepth()); - EXPECT_EQ(1.25, gh.boreHoleTopDepth().get()); + EXPECT_EQ(1.25, gh.boreHoleTopDepth()); ASSERT_TRUE(gh.boreHoleLength()); EXPECT_EQ(80.0, gh.boreHoleLength().get()); ASSERT_TRUE(gh.boreHoleRadius()); From 2d882617600cfb3a0bc55a247a4abe1294679c15 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Mon, 23 Dec 2024 16:11:55 +0100 Subject: [PATCH 15/16] Fix VT tests (older versions, and wrong path for the new test) --- .../test/VersionTranslator_GTest.cpp | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/osversion/test/VersionTranslator_GTest.cpp b/src/osversion/test/VersionTranslator_GTest.cpp index 746120cb16..a6daebd33e 100644 --- a/src/osversion/test/VersionTranslator_GTest.cpp +++ b/src/osversion/test/VersionTranslator_GTest.cpp @@ -1721,9 +1721,9 @@ TEST_F(OSVersionFixture, update_3_2_1_to_3_3_0_GroundHeatExchangerVertical) { EXPECT_EQ(1.15, ghe.getDouble(4).get()); // Field before deletion - EXPECT_EQ(13.385, ghe.getDouble(10).get()); + EXPECT_EQ(13.385, ghe.getDouble(11).get()); // Field right after deleted - EXPECT_EQ(0.71111, ghe.getDouble(11).get()); + EXPECT_EQ(0.71111, ghe.getDouble(12).get()); EXPECT_EQ(35, ghe.numExtensibleGroups()); } @@ -2515,19 +2515,20 @@ TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_GroundHeatExchangerVertical) { EXPECT_TRUE(ghx.isEmpty(3)); // Outlet Node Name EXPECT_EQ(0.0033, ghx.getDouble(4).get()); // Design Flow Rate EXPECT_EQ(120, ghx.getInt(5).get()); // Number of Bore Holes - EXPECT_EQ(76.2, ghx.getDouble(6).get()); // Bore Hole Length - EXPECT_EQ(0.063508, ghx.getDouble(7).get()); // Bore Hole Radius - EXPECT_EQ(0.692626, ghx.getDouble(8).get()); // Ground Thermal Conductivity - EXPECT_EQ(2347000, ghx.getDouble(9).get()); // Ground Thermal Heat Capacity - EXPECT_EQ(13.375, ghx.getDouble(10).get()); // Ground Temperature - EXPECT_EQ(0.692626, ghx.getDouble(11).get()); // Grout Thermal Conductivity - EXPECT_EQ(0.391312, ghx.getDouble(12).get()); // Pipe Thermal Conductivity - EXPECT_EQ(0.0266667, ghx.getDouble(13).get()); // Pipe Out Diameter - EXPECT_EQ(0.0253977, ghx.getDouble(14).get()); // U-Tube Distance - EXPECT_EQ(0.00241285, ghx.getDouble(15).get()); // Pipe Thickness - EXPECT_EQ(2, ghx.getInt(16).get()); // Maximum Length of Simulation - EXPECT_NE("", ghx.getString(17).get()); // Undisturbed Ground Temperature Model - EXPECT_EQ(0.0005, ghx.getDouble(18).get()); // G-Function Reference Ratio {dimensionless} + EXPECT_EQ(1.0, ghx.getDouble(6).get()); // Bore Hole Top Depth {m} (added 3.9.1) + EXPECT_EQ(76.2, ghx.getDouble(7).get()); // Bore Hole Length + EXPECT_EQ(0.063508, ghx.getDouble(8).get()); // Bore Hole Radius + EXPECT_EQ(0.692626, ghx.getDouble(9).get()); // Ground Thermal Conductivity + EXPECT_EQ(2347000, ghx.getDouble(10).get()); // Ground Thermal Heat Capacity + EXPECT_EQ(13.375, ghx.getDouble(11).get()); // Ground Temperature + EXPECT_EQ(0.692626, ghx.getDouble(12).get()); // Grout Thermal Conductivity + EXPECT_EQ(0.391312, ghx.getDouble(13).get()); // Pipe Thermal Conductivity + EXPECT_EQ(0.0266667, ghx.getDouble(14).get()); // Pipe Out Diameter + EXPECT_EQ(0.0253977, ghx.getDouble(15).get()); // U-Tube Distance + EXPECT_EQ(0.00241285, ghx.getDouble(16).get()); // Pipe Thickness + EXPECT_EQ(2, ghx.getInt(17).get()); // Maximum Length of Simulation + EXPECT_NE("", ghx.getString(18).get()); // Undisturbed Ground Temperature Model + EXPECT_EQ(0.0005, ghx.getDouble(19).get()); // G-Function Reference Ratio {dimensionless} EXPECT_EQ(35u, ghx.numExtensibleGroups()); auto eg1 = ghx.extensibleGroups()[0]; @@ -2540,9 +2541,9 @@ TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_GroundHeatExchangerVertical) { std::vector ukas = model->getObjectsByType("OS:Site:GroundTemperature:Undisturbed:KusudaAchenbach"); ASSERT_EQ(1u, ukas.size()); - ASSERT_TRUE(ghx.getTarget(17)); - WorkspaceObject uka = ghx.getTarget(17).get(); - EXPECT_EQ(uka.nameString(), ghx.getTarget(17)->nameString()); + ASSERT_TRUE(ghx.getTarget(18)); + WorkspaceObject uka = ghx.getTarget(18).get(); + EXPECT_EQ(uka.nameString(), ghx.getTarget(18)->nameString()); EXPECT_EQ(IddObjectType(IddObjectType::OS_Site_GroundTemperature_Undisturbed_KusudaAchenbach), uka.iddObject().type()); EXPECT_EQ("Site Ground Temperature Undisturbed Kusuda Achenbach 1", uka.getString(1).get()); // Name EXPECT_EQ(0.692626, uka.getDouble(2).get()); // Soil Thermal Conductivity @@ -4552,12 +4553,12 @@ TEST_F(OSVersionFixture, update_3_9_0_to_3_9_1_WaterHeaterHeatPump) { } TEST_F(OSVersionFixture, update_3_9_0_to_3_9_1_GroundHeatExchangerVertical) { - openstudio::path path = resourcesPath() / toPath("osversion/3_9_0/test_vt_GroundHeatExchangerVertical.osm"); + openstudio::path path = resourcesPath() / toPath("osversion/3_9_1/test_vt_GroundHeatExchangerVertical.osm"); osversion::VersionTranslator vt; boost::optional model = vt.loadModel(path); ASSERT_TRUE(model) << "Failed to load " << path; - openstudio::path outPath = resourcesPath() / toPath("osversion/3_9_0/test_vt_GroundHeatExchangerVertical_updated.osm"); + openstudio::path outPath = resourcesPath() / toPath("osversion/3_9_1/test_vt_GroundHeatExchangerVertical_updated.osm"); model->save(outPath, true); std::vector ghe_verts = model->getObjectsByType("OS:GroundHeatExchanger:Vertical"); From 4639c7ef518f9c4882bcc6b8c54adc9430cb6839 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Mon, 23 Dec 2024 16:13:52 +0100 Subject: [PATCH 16/16] Fix FT test --- src/energyplus/Test/GroundHeatExchangerVertical_GTest.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/energyplus/Test/GroundHeatExchangerVertical_GTest.cpp b/src/energyplus/Test/GroundHeatExchangerVertical_GTest.cpp index e3f208664a..3dae57dfb3 100644 --- a/src/energyplus/Test/GroundHeatExchangerVertical_GTest.cpp +++ b/src/energyplus/Test/GroundHeatExchangerVertical_GTest.cpp @@ -109,7 +109,6 @@ TEST_F(EnergyPlusFixture, ForwardTranslator_GroundHeatExchangerVertical) { 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(1.35, 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());