Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow placing all solar thermal collectors on a PlantEquipmentList #3762

Merged
merged 2 commits into from
Nov 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions openstudiocore/resources/energyplus/ProposedEnergy+.idd
Original file line number Diff line number Diff line change
Expand Up @@ -40252,10 +40252,10 @@ SolarCollector:FlatPlate:Water,
A1 , \field Name
\required-field
\type alpha
\reference-class-name validPlantEquipmentTypes ! remove?
\reference validPlantEquipmentNames ! remove?
\reference-class-name validBranchEquipmentTypes
\reference validBranchEquipmentNames
\reference-class-name validPlantEquipmentTypes ! Need to be able to place it on PlantEquipmentList
\reference validPlantEquipmentNames ! Need to be able to place it on PlantEquipmentList
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No change really here, they were already there, just trying to be consistent

A2 , \field SolarCollectorPerformance Name
\required-field
\type object-list
Expand Down Expand Up @@ -40284,6 +40284,8 @@ SolarCollector:FlatPlate:PhotovoltaicThermal,
\reference validOASysEquipmentNames
\reference-class-name validBranchEquipmentTypes
\reference validBranchEquipmentNames
\reference-class-name validPlantEquipmentTypes ! Need to be able to place it on PlantEquipmentList
\reference validPlantEquipmentNames ! Need to be able to place it on PlantEquipmentList
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fix 1/2

A2 , \field Surface Name
\required-field
\type object-list
Expand Down Expand Up @@ -40351,6 +40353,8 @@ SolarCollector:IntegralCollectorStorage,
\type alpha
\reference-class-name validBranchEquipmentTypes
\reference validBranchEquipmentNames
\reference-class-name validPlantEquipmentTypes ! Need to be able to place it on PlantEquipmentList
\reference validPlantEquipmentNames ! Need to be able to place it on PlantEquipmentList
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fix 2/2

A2 , \field IntegralCollectorStorageParameters Name
\required-field
\type object-list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@
#include "../../model/PlantLoop.hpp"
#include "../../model/Node.hpp"


#include "../../model/HeatExchangerFluidToFluid.hpp"
#include "../../model/WaterHeaterMixed.hpp"
#include "../../model/WaterHeaterStratified.hpp"


#include "../../model/BoilerHotWater.hpp"
#include "../../model/ChillerElectricEIR.hpp"
#include "../../model/SolarCollectorFlatPlateWater.hpp"
#include "../../model/SolarCollectorFlatPlatePhotovoltaicThermal.hpp"
#include "../../model/SolarCollectorIntegralCollectorStorage.hpp"

#include <utilities/idd/PlantLoop_FieldEnums.hxx>
#include <utilities/idd/PlantEquipmentOperationSchemes_FieldEnums.hxx>
Expand Down Expand Up @@ -408,3 +409,67 @@ TEST_F(EnergyPlusFixture, ForwardTranslator_PlantEquipmentOperationSchemes_Water
idf_eg = idf_peq_list.extensibleGroups()[2];
ASSERT_EQ(wh_s.name().get(), idf_eg.getString(PlantEquipmentListExtensibleFields::EquipmentName).get());
}

/*
* #3761: assert than all solar collectors can properly end up on a PlantEquipmentList
*/
TEST_F(EnergyPlusFixture, ForwardTranslator_PlantEquipmentOperationSchemes_SolarCollectors) {

boost::optional<WorkspaceObject> _wo;

Model m;

PlantLoop use_loop(m);
use_loop.setName("Use Loop");

SolarCollectorFlatPlateWater collector_flatplate_water(m);
SolarCollectorFlatPlatePhotovoltaicThermal collector_flatplate_pvt(m);
SolarCollectorIntegralCollectorStorage collector_integralcollectorstorage(m);

use_loop.addSupplyBranchForComponent(collector_flatplate_water);
use_loop.addSupplyBranchForComponent(collector_flatplate_pvt);
use_loop.addSupplyBranchForComponent(collector_integralcollectorstorage);

ForwardTranslator forwardTranslator;
Workspace w = forwardTranslator.translateModel(m);


// Get the Use Loop, and find its plant operation scheme
_wo = w.getObjectByTypeAndName(IddObjectType::PlantLoop, use_loop.name().get());
ASSERT_TRUE(_wo.is_initialized());
WorkspaceObject idf_use_loop = _wo.get();
WorkspaceObject idf_plant_op = idf_use_loop.getTarget(PlantLoopFields::PlantEquipmentOperationSchemeName).get();

// Should have created a Heating Load one only
ASSERT_EQ(1u, idf_plant_op.extensibleGroups().size());
WorkspaceExtensibleGroup w_eg = idf_plant_op.extensibleGroups()[0].cast<WorkspaceExtensibleGroup>();
ASSERT_EQ("PlantEquipmentOperation:HeatingLoad", w_eg.getString(PlantEquipmentOperationSchemesExtensibleFields::ControlSchemeObjectType).get());

// Get the Operation Scheme
_wo = w_eg.getTarget(PlantEquipmentOperationSchemesExtensibleFields::ControlSchemeName);
ASSERT_TRUE(_wo.is_initialized());
WorkspaceObject idf_op_scheme = _wo.get();

// Get the Plant Equipment List of this HeatingLoad scheme
// There should only be one Load Range
ASSERT_EQ(1u, idf_op_scheme.extensibleGroups().size());
// Load range 1
w_eg = idf_op_scheme.extensibleGroups()[0].cast<WorkspaceExtensibleGroup>();
_wo = w_eg.getTarget(PlantEquipmentOperation_HeatingLoadExtensibleFields::RangeEquipmentListName);
ASSERT_TRUE(_wo.is_initialized());
WorkspaceObject idf_peq_list = _wo.get();

// Should have the three solar collectors on it, with the name properly filled out
ASSERT_EQ(3u, idf_peq_list.extensibleGroups().size());
IdfExtensibleGroup idf_eg(idf_peq_list.extensibleGroups()[0]);
EXPECT_EQ("SolarCollector:FlatPlate:Water", idf_eg.getString(PlantEquipmentListExtensibleFields::EquipmentObjectType).get());
EXPECT_EQ(collector_flatplate_water.name().get(), idf_eg.getString(PlantEquipmentListExtensibleFields::EquipmentName).get());

idf_eg = idf_peq_list.extensibleGroups()[1];
EXPECT_EQ("SolarCollector:FlatPlate:PhotovoltaicThermal", idf_eg.getString(PlantEquipmentListExtensibleFields::EquipmentObjectType).get());
EXPECT_EQ(collector_flatplate_pvt.name().get(), idf_eg.getString(PlantEquipmentListExtensibleFields::EquipmentName).get());

idf_eg = idf_peq_list.extensibleGroups()[2];
EXPECT_EQ("SolarCollector:IntegralCollectorStorage", idf_eg.getString(PlantEquipmentListExtensibleFields::EquipmentObjectType).get());
EXPECT_EQ(collector_integralcollectorstorage.name().get(), idf_eg.getString(PlantEquipmentListExtensibleFields::EquipmentName).get());
Copy link
Collaborator Author

@jmarrec jmarrec Nov 14, 2019

Choose a reason for hiding this comment

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

Before fix:

PlantEquipmentList,
  Plant Loop 1 Heating Equipment List,    !- Name
  SolarCollector:FlatPlate:Water,         !- Equipment Object Type 1
  Solar Collector Flat Plate Water 1,     !- Equipment Name 1
  SolarCollector:FlatPlate:PhotovoltaicThermal, !- Equipment Object Type 2
  ,                                       !- Equipment Name 2
  SolarCollector:IntegralCollectorStorage, !- Equipment Object Type 3
  ;                                       !- Equipment Name 3

After fix :

PlantEquipmentList,
  Plant Loop 1 Heating Equipment List,    !- Name
  SolarCollector:FlatPlate:Water,         !- Equipment Object Type 1
  Solar Collector Flat Plate Water 1,     !- Equipment Name 1
  SolarCollector:FlatPlate:PhotovoltaicThermal, !- Equipment Object Type 2
  Solar Collector Flat Plate Photovoltaic Thermal 1, !- Equipment Name 2
  SolarCollector:IntegralCollectorStorage, !- Equipment Object Type 3
  Solar Collector Integral Collector Storage 1; !- Equipment Name 3

}