src/energyplus/ForwardTranslator/ForwardTranslateGroundHeatExchangerVertical.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #include "../ForwardTranslator.hpp" | ||
| 7 | #include "../../model/Model.hpp" | ||
| 8 | #include "../../model/Node.hpp" | ||
| 9 | #include "../../model/Node_Impl.hpp" | ||
| 10 | #include "../../model/GroundHeatExchangerVertical.hpp" | ||
| 11 | #include "../../model/GroundHeatExchangerVertical_Impl.hpp" | ||
| 12 | #include "../../utilities/core/Logger.hpp" | ||
| 13 | #include "../../utilities/core/Assert.hpp" | ||
| 14 | #include "../../utilities/idf/IdfExtensibleGroup.hpp" | ||
| 15 | #include <utilities/idd/GroundHeatExchanger_System_FieldEnums.hxx> | ||
| 16 | #include <utilities/idd/GroundHeatExchanger_Vertical_Properties_FieldEnums.hxx> | ||
| 17 | #include <utilities/idd/GroundHeatExchanger_ResponseFactors_FieldEnums.hxx> | ||
| 18 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 19 | #include <utilities/idd/IddEnums.hxx> | ||
| 20 | #include <utilities/idd/IddFactory.hxx> | ||
| 21 | |||
| 22 | using namespace openstudio::model; | ||
| 23 | |||
| 24 | using namespace std; | ||
| 25 | |||
| 26 | namespace openstudio { | ||
| 27 | |||
| 28 | namespace energyplus { | ||
| 29 | |||
| 30 | 1 | boost::optional<IdfObject> ForwardTranslator::translateGroundHeatExchangerVertical(GroundHeatExchangerVertical& modelObject) { | |
| 31 | 1 | boost::optional<std::string> s; | |
| 32 | 1 | boost::optional<double> value; | |
| 33 | 1 | boost::optional<ModelObject> temp; | |
| 34 | |||
| 35 | // 1 { GroundHeatExchanger_VerticalFields::Name, "Name", "Name"}, | ||
| 36 | // 2 { GroundHeatExchanger_VerticalFields::InletNodeName, "InletNodeName", "Inlet Node Name"}, | ||
| 37 | // 3 { GroundHeatExchanger_VerticalFields::OutletNodeName, "OutletNodeName", "Outlet Node Name"}, | ||
| 38 | // 4 { GroundHeatExchanger_VerticalFields::DesignFlowRate, "DesignFlowRate", "Design Flow Rate"}, | ||
| 39 | // 5 { GroundHeatExchanger_VerticalFields::NumberofBoreHoles, "NumberofBoreHoles", "Number of Bore Holes"}, | ||
| 40 | // 6 { GroundHeatExchanger_VerticalFields::BoreHoleLength, "BoreHoleLength", "Bore Hole Length"}, | ||
| 41 | // 7 { GroundHeatExchanger_VerticalFields::BoreHoleRadius, "BoreHoleRadius", "Bore Hole Radius"}, | ||
| 42 | // 8 { GroundHeatExchanger_VerticalFields::GroundThermalConductivity, "GroundThermalConductivity", "Ground Thermal Conductivity"}, | ||
| 43 | // 9 { GroundHeatExchanger_VerticalFields::GroundThermalHeatCapacity, "GroundThermalHeatCapacity", "Ground Thermal Heat Capacity"}, | ||
| 44 | // 10 { GroundHeatExchanger_VerticalFields::GroundTemperature, "GroundTemperature", "Ground Temperature"}, | ||
| 45 | // 11 { GroundHeatExchanger_VerticalFields::GroutThermalConductivity, "GroutThermalConductivity", "Grout Thermal Conductivity"}, | ||
| 46 | // 12 { GroundHeatExchanger_VerticalFields::PipeThermalConductivity, "PipeThermalConductivity", "Pipe Thermal Conductivity"}, | ||
| 47 | // 13 { GroundHeatExchanger_VerticalFields::PipeOutDiameter, "PipeOutDiameter", "Pipe Out Diameter"}, | ||
| 48 | // 14 { GroundHeatExchanger_VerticalFields::UTubeDistance, "UTubeDistance", "U-Tube Distance"}, | ||
| 49 | // 15 { GroundHeatExchanger_VerticalFields::PipeThickness, "PipeThickness", "Pipe Thickness"}, | ||
| 50 | // 16 { GroundHeatExchanger_VerticalFields::MaximumLengthofSimulation, "MaximumLengthofSimulation", "Maximum Length of Simulation"}, | ||
| 51 | // 17 { GroundHeatExchanger_VerticalFields::GFunctionReferenceRatio, "GFunctionReferenceRatio", "G-Function Reference Ratio"}, | ||
| 52 | // 18 { GroundHeatExchanger_VerticalFields::NumberofDataPairsoftheGFunction, "NumberofDataPairsoftheGFunction", "Number of Data Pairs of the G Function"}, | ||
| 53 | |||
| 54 | // 1 { GroundHeatExchanger_SystemFields::Name, "Name", "Name"}, | ||
| 55 | // 2 { GroundHeatExchanger_SystemFields::InletNodeName, "InletNodeName", "Inlet Node Name"}, | ||
| 56 | // 3 { GroundHeatExchanger_SystemFields::OutletNodeName, "OutletNodeName", "Outlet Node Name"}, | ||
| 57 | // 4 { GroundHeatExchanger_SystemFields::DesignFlowRate, "DesignFlowRate", "Design Flow Rate"}, | ||
| 58 | // 5 { GroundHeatExchanger_SystemFields::UndisturbedGroundTemperatureModelType, "UndisturbedGroundTemperatureModelType", "Undisturbed Ground Temperature Model Type"}, | ||
| 59 | // 6 { GroundHeatExchanger_SystemFields::UndisturbedGroundTemperatureModelName, "UndisturbedGroundTemperatureModelName", "Undisturbed Ground Temperature Model Name"}, | ||
| 60 | // 7 { GroundHeatExchanger_SystemFields::GroundThermalConductivity, "GroundThermalConductivity", "Ground Thermal Conductivity"}, | ||
| 61 | // 8 { GroundHeatExchanger_SystemFields::GroundThermalHeatCapacity, "GroundThermalHeatCapacity", "Ground Thermal Heat Capacity"}, | ||
| 62 | // 9 { GroundHeatExchanger_SystemFields::GHE_Vertical_ResponseFactorsObjectName, "GHE_Vertical_ResponseFactorsObjectName", "GHE:Vertical:ResponseFactors Object Name"}, | ||
| 63 | // 10 { GroundHeatExchanger_SystemFields::GHE_Vertical_ArrayObjectName, "GHE_Vertical_ArrayObjectName", "GHE:Vertical:Array Object Name"}, | ||
| 64 | |||
| 65 | // 1 { GroundHeatExchanger_Vertical_PropertiesFields::Name, "Name", "Name"}, | ||
| 66 | // 2 { GroundHeatExchanger_Vertical_PropertiesFields::DepthofTopofBorehole, "DepthofTopofBorehole", "Depth of Top of Borehole"}, | ||
| 67 | // 3 { GroundHeatExchanger_Vertical_PropertiesFields::BoreholeLength, "BoreholeLength", "Borehole Length"}, | ||
| 68 | // 4 { GroundHeatExchanger_Vertical_PropertiesFields::BoreholeDiameter, "BoreholeDiameter", "Borehole Diameter"}, | ||
| 69 | // 5 { GroundHeatExchanger_Vertical_PropertiesFields::GroutThermalConductivity, "GroutThermalConductivity", "Grout Thermal Conductivity"}, | ||
| 70 | // 6 { GroundHeatExchanger_Vertical_PropertiesFields::GroutThermalHeatCapacity, "GroutThermalHeatCapacity", "Grout Thermal Heat Capacity"}, | ||
| 71 | // 7 { GroundHeatExchanger_Vertical_PropertiesFields::PipeThermalConductivity, "PipeThermalConductivity", "Pipe Thermal Conductivity"}, | ||
| 72 | // 8 { GroundHeatExchanger_Vertical_PropertiesFields::PipeThermalHeatCapacity, "PipeThermalHeatCapacity", "Pipe Thermal Heat Capacity"}, | ||
| 73 | // 9 { GroundHeatExchanger_Vertical_PropertiesFields::PipeOuterDiameter, "PipeOuterDiameter", "Pipe Outer Diameter"}, | ||
| 74 | // 10 { GroundHeatExchanger_Vertical_PropertiesFields::PipeThickness, "PipeThickness", "Pipe Thickness"}, | ||
| 75 | // 11 { GroundHeatExchanger_Vertical_PropertiesFields::UTubeDistance, "UTubeDistance", "U-Tube Distance"}, | ||
| 76 | |||
| 77 | // 1 { Site_GroundTemperature_Undisturbed_KusudaAchenbachFields::Name, "Name", "Name"}, | ||
| 78 | // 2 { Site_GroundTemperature_Undisturbed_KusudaAchenbachFields::SoilThermalConductivity, "SoilThermalConductivity", "Soil Thermal Conductivity"}, | ||
| 79 | // 3 { Site_GroundTemperature_Undisturbed_KusudaAchenbachFields::SoilDensity, "SoilDensity", "Soil Density"}, | ||
| 80 | // 4 { Site_GroundTemperature_Undisturbed_KusudaAchenbachFields::SoilSpecificHeat, "SoilSpecificHeat", "Soil Specific Heat"}, | ||
| 81 | // 5 { Site_GroundTemperature_Undisturbed_KusudaAchenbachFields::AverageSoilSurfaceTemperature, "AverageSoilSurfaceTemperature", "Average Soil Surface Temperature"}, | ||
| 82 | // 6 { Site_GroundTemperature_Undisturbed_KusudaAchenbachFields::AverageAmplitudeofSurfaceTemperature, "AverageAmplitudeofSurfaceTemperature", "Average Amplitude of Surface Temperature"}, | ||
| 83 | // 7 { Site_GroundTemperature_Undisturbed_KusudaAchenbachFields::PhaseShiftofMinimumSurfaceTemperature, "PhaseShiftofMinimumSurfaceTemperature", "Phase Shift of Minimum Surface Temperature"}, | ||
| 84 | |||
| 85 | // 1 { GroundHeatExchanger_ResponseFactorsFields::Name, "Name", "Name"}, | ||
| 86 | // 2 { GroundHeatExchanger_ResponseFactorsFields::GHE_Vertical_PropertiesObjectName, "GHE_Vertical_PropertiesObjectName", "GHE:Vertical:Properties Object Name"}, | ||
| 87 | // 3 { GroundHeatExchanger_ResponseFactorsFields::NumberofBoreholes, "NumberofBoreholes", "Number of Boreholes"}, | ||
| 88 | // 4 { GroundHeatExchanger_ResponseFactorsFields::GFunctionReferenceRatio, "GFunctionReferenceRatio", "G-Function Reference Ratio"}, | ||
| 89 | |||
| 90 | // 1 { GroundHeatExchanger_ResponseFactorsExtensibleFields::gFunctionLn_T_Ts_Value, "gFunctionLn_T_Ts_Value", "g-Function Ln(T/Ts) Value"}, | ||
| 91 | // 2 { GroundHeatExchanger_ResponseFactorsExtensibleFields::gFunctiongValue, "gFunctiongValue", "g-Function g Value"}, | ||
| 92 | |||
| 93 | // UndisturbedGroundTemperatureModelName, is required, so start by that | ||
| 94 |
1/1✓ Branch 1 taken 1 time.
|
1 | ModelObject undisturbedGroundTemperatureModel = modelObject.undisturbedGroundTemperatureModel(); |
| 95 |
1/1✓ Branch 1 taken 1 time.
|
1 | boost::optional<IdfObject> _undisturbedGroundTemperatureModel = translateAndMapModelObject(undisturbedGroundTemperatureModel); |
| 96 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (_undisturbedGroundTemperatureModel) { |
| 97 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | s = _undisturbedGroundTemperatureModel->name().get(); |
| 98 | } else { | ||
| 99 | ✗ | LOG(Warn, modelObject.briefDescription() << " cannot be translated as its undisturbed ground temperature model object cannot be translated: " | |
| 100 | << undisturbedGroundTemperatureModel.briefDescription() << "."); | ||
| 101 | ✗ | return boost::none; | |
| 102 | } | ||
| 103 | |||
| 104 | // Name | ||
| 105 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::GroundHeatExchanger_System, modelObject); |
| 106 | |||
| 107 | // Inlet Node Name | ||
| 108 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
✗ Branch 6 not taken.
|
2 | if ((temp = modelObject.inletModelObject())) { |
| 109 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(GroundHeatExchanger_SystemFields::InletNodeName, temp->name().get()); |
| 110 | } | ||
| 111 | |||
| 112 | // Outlet Node Name | ||
| 113 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
✗ Branch 6 not taken.
|
2 | if ((temp = modelObject.outletModelObject())) { |
| 114 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(GroundHeatExchanger_SystemFields::OutletNodeName, temp->name().get()); |
| 115 | } | ||
| 116 | |||
| 117 | // Design Flow Rate | ||
| 118 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((value = modelObject.designFlowRate())) { |
| 119 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(GroundHeatExchanger_SystemFields::DesignFlowRate, value.get()); |
| 120 | } | ||
| 121 | |||
| 122 | // Undisturbed Ground Temperature Model Type | ||
| 123 |
1/1✓ Branch 1 taken 1 time.
|
1 | idfObject.setString(GroundHeatExchanger_SystemFields::UndisturbedGroundTemperatureModelType, |
| 124 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
2 | _undisturbedGroundTemperatureModel->iddObject().name()); |
| 125 | |||
| 126 | // Undisturbed Ground Temperature Model Name | ||
| 127 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setString(GroundHeatExchanger_SystemFields::UndisturbedGroundTemperatureModelName, s.get()); |
| 128 | |||
| 129 | // Ground Thermal Conductivity | ||
| 130 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((value = modelObject.groundThermalConductivity())) { |
| 131 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(GroundHeatExchanger_SystemFields::GroundThermalConductivity, value.get()); |
| 132 | } | ||
| 133 | |||
| 134 | // Ground Thermal Heat Capacity | ||
| 135 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((value = modelObject.groundThermalHeatCapacity())) { |
| 136 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(GroundHeatExchanger_SystemFields::GroundThermalHeatCapacity, value.get()); |
| 137 | } | ||
| 138 | |||
| 139 | // GHE:Vertical:ResponseFactors Object Name | ||
| 140 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | auto responseFactorsObjectName = modelObject.nameString() + " Response Factors"; |
| 141 |
1/1✓ Branch 1 taken 1 time.
|
1 | idfObject.setString(GroundHeatExchanger_SystemFields::GHE_Vertical_ResponseFactorsObjectName, responseFactorsObjectName); |
| 142 | |||
| 143 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | IdfObject propertiesIdfObject(IddObjectType::GroundHeatExchanger_Vertical_Properties); |
| 144 |
1/1✓ Branch 1 taken 1 time.
|
1 | m_idfObjects.push_back(propertiesIdfObject); |
| 145 | |||
| 146 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | auto propertiesObjectName = modelObject.nameString() + " Properties"; |
| 147 |
1/1✓ Branch 1 taken 1 time.
|
1 | propertiesIdfObject.setName(propertiesObjectName); |
| 148 | |||
| 149 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | propertiesIdfObject.setDouble(GroundHeatExchanger_Vertical_PropertiesFields::DepthofTopofBorehole, modelObject.boreHoleTopDepth()); |
| 150 | |||
| 151 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((value = modelObject.boreHoleLength())) { |
| 152 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | propertiesIdfObject.setDouble(GroundHeatExchanger_Vertical_PropertiesFields::BoreholeLength, value.get()); |
| 153 | } | ||
| 154 | |||
| 155 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((value = modelObject.boreHoleRadius())) { |
| 156 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | propertiesIdfObject.setDouble(GroundHeatExchanger_Vertical_PropertiesFields::BoreholeDiameter, value.get() * 2.0); |
| 157 | } | ||
| 158 | |||
| 159 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((value = modelObject.groutThermalConductivity())) { |
| 160 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | propertiesIdfObject.setDouble(GroundHeatExchanger_Vertical_PropertiesFields::GroutThermalConductivity, value.get()); |
| 161 | } | ||
| 162 | |||
| 163 |
1/1✓ Branch 1 taken 1 time.
|
1 | propertiesIdfObject.setDouble(GroundHeatExchanger_Vertical_PropertiesFields::GroutThermalHeatCapacity, 3.90E+06); |
| 164 | |||
| 165 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((value = modelObject.pipeThermalConductivity())) { |
| 166 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | propertiesIdfObject.setDouble(GroundHeatExchanger_Vertical_PropertiesFields::PipeThermalConductivity, value.get()); |
| 167 | } | ||
| 168 | |||
| 169 |
1/1✓ Branch 1 taken 1 time.
|
1 | propertiesIdfObject.setDouble(GroundHeatExchanger_Vertical_PropertiesFields::PipeThermalHeatCapacity, 1.77E+06); |
| 170 | |||
| 171 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((value = modelObject.pipeOutDiameter())) { |
| 172 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | propertiesIdfObject.setDouble(GroundHeatExchanger_Vertical_PropertiesFields::PipeOuterDiameter, value.get()); |
| 173 | } | ||
| 174 | |||
| 175 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((value = modelObject.pipeThickness())) { |
| 176 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | propertiesIdfObject.setDouble(GroundHeatExchanger_Vertical_PropertiesFields::PipeThickness, value.get()); |
| 177 | } | ||
| 178 | |||
| 179 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((value = modelObject.uTubeDistance())) { |
| 180 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | propertiesIdfObject.setDouble(GroundHeatExchanger_Vertical_PropertiesFields::UTubeDistance, value.get()); |
| 181 | } | ||
| 182 | |||
| 183 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | IdfObject rfIdfObject(IddObjectType::GroundHeatExchanger_ResponseFactors); |
| 184 |
1/1✓ Branch 1 taken 1 time.
|
1 | m_idfObjects.push_back(rfIdfObject); |
| 185 | |||
| 186 |
1/1✓ Branch 1 taken 1 time.
|
1 | rfIdfObject.setName(responseFactorsObjectName); |
| 187 | |||
| 188 |
1/1✓ Branch 1 taken 1 time.
|
1 | rfIdfObject.setString(GroundHeatExchanger_ResponseFactorsFields::GHE_Vertical_PropertiesObjectName, propertiesObjectName); |
| 189 | |||
| 190 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
|
2 | if ((value = modelObject.numberofBoreHoles())) { |
| 191 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | rfIdfObject.setDouble(GroundHeatExchanger_ResponseFactorsFields::NumberofBoreholes, value.get()); |
| 192 | } | ||
| 193 | |||
| 194 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
|
2 | if ((value = modelObject.gFunctionReferenceRatio())) { |
| 195 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | rfIdfObject.setDouble(GroundHeatExchanger_ResponseFactorsFields::GFunctionReferenceRatio, value.get()); |
| 196 | } | ||
| 197 | |||
| 198 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto gFunctions = modelObject.gFunctions(); |
| 199 |
2/2✓ Branch 5 taken 35 times.
✓ Branch 6 taken 1 time.
|
36 | for (const auto& gFunction : gFunctions) { |
| 200 |
1/1✓ Branch 1 taken 35 times.
|
35 | auto eg = rfIdfObject.pushExtensibleGroup(); |
| 201 | |||
| 202 |
2/2✓ Branch 1 taken 35 times.
✓ Branch 4 taken 35 times.
|
35 | eg.setDouble(GroundHeatExchanger_ResponseFactorsExtensibleFields::gFunctionLn_T_Ts_Value, gFunction.lnValue()); |
| 203 |
2/2✓ Branch 1 taken 35 times.
✓ Branch 4 taken 35 times.
|
35 | eg.setDouble(GroundHeatExchanger_ResponseFactorsExtensibleFields::gFunctiongValue, gFunction.gValue()); |
| 204 | 35 | } | |
| 205 | |||
| 206 | //// Number of Bore Holes | ||
| 207 | //if( (value = modelObject.numberofBoreHoles()) ) | ||
| 208 | //{ | ||
| 209 | // idfObject.setDouble(GroundHeatExchanger_VerticalFields::NumberofBoreHoles,value.get()); | ||
| 210 | //} | ||
| 211 | |||
| 212 | //// Bore Hole Length | ||
| 213 | //if( (value = modelObject.boreHoleLength()) ) | ||
| 214 | //{ | ||
| 215 | // idfObject.setDouble(GroundHeatExchanger_VerticalFields::BoreHoleLength,value.get()); | ||
| 216 | //} | ||
| 217 | |||
| 218 | //// Bore Hole Radius | ||
| 219 | //if( (value = modelObject.boreHoleRadius()) ) | ||
| 220 | //{ | ||
| 221 | // idfObject.setDouble(GroundHeatExchanger_VerticalFields::BoreHoleRadius,value.get()); | ||
| 222 | //} | ||
| 223 | |||
| 224 | //// Ground Thermal Conductivity | ||
| 225 | //if( (value = modelObject.groundThermalConductivity()) ) | ||
| 226 | //{ | ||
| 227 | // idfObject.setDouble(GroundHeatExchanger_VerticalFields::GroundThermalConductivity,value.get()); | ||
| 228 | //} | ||
| 229 | |||
| 230 | //// Ground Thermal Heat Capacity | ||
| 231 | //if( (value = modelObject.groundThermalHeatCapacity()) ) | ||
| 232 | //{ | ||
| 233 | // idfObject.setDouble(GroundHeatExchanger_VerticalFields::GroundThermalHeatCapacity,value.get()); | ||
| 234 | //} | ||
| 235 | |||
| 236 | //// Ground Temperature | ||
| 237 | //if( (value = modelObject.groundTemperature()) ) | ||
| 238 | //{ | ||
| 239 | // idfObject.setDouble(GroundHeatExchanger_VerticalFields::GroundTemperature,value.get()); | ||
| 240 | //} | ||
| 241 | |||
| 242 | //// Design Flow Rate | ||
| 243 | //if( (value = modelObject.designFlowRate()) ) | ||
| 244 | //{ | ||
| 245 | // idfObject.setDouble(GroundHeatExchanger_VerticalFields::DesignFlowRate,value.get()); | ||
| 246 | //} | ||
| 247 | |||
| 248 | //// Grout Thermal Conductivity | ||
| 249 | //if( (value = modelObject.groutThermalConductivity()) ) | ||
| 250 | //{ | ||
| 251 | // idfObject.setDouble(GroundHeatExchanger_VerticalFields::GroutThermalConductivity,value.get()); | ||
| 252 | //} | ||
| 253 | |||
| 254 | //// Pipe Thermal Conductivity | ||
| 255 | //if( (value = modelObject.pipeThermalConductivity()) ) | ||
| 256 | //{ | ||
| 257 | // idfObject.setDouble(GroundHeatExchanger_VerticalFields::PipeThermalConductivity,value.get()); | ||
| 258 | //} | ||
| 259 | |||
| 260 | //// Pipe Out Diameter | ||
| 261 | //if( (value = modelObject.pipeOutDiameter()) ) | ||
| 262 | //{ | ||
| 263 | // idfObject.setDouble(GroundHeatExchanger_VerticalFields::PipeOutDiameter,value.get()); | ||
| 264 | //} | ||
| 265 | |||
| 266 | //// U-Tube Distance | ||
| 267 | //if( (value = modelObject.uTubeDistance()) ) | ||
| 268 | //{ | ||
| 269 | // idfObject.setDouble(GroundHeatExchanger_VerticalFields::UTubeDistance,value.get()); | ||
| 270 | //} | ||
| 271 | |||
| 272 | //// Pipe Thickness | ||
| 273 | //if( (value = modelObject.pipeThickness()) ) | ||
| 274 | //{ | ||
| 275 | // idfObject.setDouble(GroundHeatExchanger_VerticalFields::PipeThickness,value.get()); | ||
| 276 | //} | ||
| 277 | |||
| 278 | //// Maximum Length of Simulation | ||
| 279 | //if( (value = modelObject.maximumLengthofSimulation()) ) | ||
| 280 | //{ | ||
| 281 | // idfObject.setDouble(GroundHeatExchanger_VerticalFields::MaximumLengthofSimulation,value.get()); | ||
| 282 | //} | ||
| 283 | |||
| 284 | //// G-Function Reference Ratio | ||
| 285 | //if( (value = modelObject.gFunctionReferenceRatio()) ) | ||
| 286 | //{ | ||
| 287 | // idfObject.setDouble(GroundHeatExchanger_VerticalFields::GFunctionReferenceRatio,value.get()); | ||
| 288 | //} | ||
| 289 | |||
| 290 | //std::vector< GFunction > gFunctions = modelObject.gFunctions(); | ||
| 291 | |||
| 292 | //// Number of Data Pairs of the G Function | ||
| 293 | //idfObject.setInt(GroundHeatExchanger_VerticalFields::NumberofDataPairsoftheGFunction,gFunctions.size()); | ||
| 294 | |||
| 295 | //if( !gFunctions.empty() ) | ||
| 296 | //{ | ||
| 297 | // for( const auto & gFunction : gFunctions ) | ||
| 298 | // { | ||
| 299 | // IdfExtensibleGroup eg = idfObject.pushExtensibleGroup(); | ||
| 300 | |||
| 301 | // eg.setDouble(GroundHeatExchanger_VerticalExtensibleFields::GFunctionLn_T_Ts_Value,gFunction.lnValue()); | ||
| 302 | // eg.setDouble(GroundHeatExchanger_VerticalExtensibleFields::GFunctionGValue,gFunction.gValue()); | ||
| 303 | // } | ||
| 304 | //} | ||
| 305 | //else { | ||
| 306 | // LOG(Error,modelObject.briefDescription() << ": At least one pair of GFunction data required"); | ||
| 307 | // return boost::none; | ||
| 308 | //} | ||
| 309 | |||
| 310 |
1/1✓ Branch 1 taken 1 time.
|
1 | return boost::optional<IdfObject>(idfObject); |
| 311 | 1 | } | |
| 312 | |||
| 313 | } // namespace energyplus | ||
| 314 | |||
| 315 | } // namespace openstudio | ||
| 316 |