Skip to content

Commit

Permalink
Merge pull request NREL#4296 from NREL/issue-4288-demand-side-vrf
Browse files Browse the repository at this point in the history
Issue 4288 demand side vrf
  • Loading branch information
tijcolem authored Apr 21, 2021
2 parents a133e52 + 960967e commit 0d5f949
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ namespace energyplus {
LOG(Info, "Will not translate fan for VRF named '" << modelObject.name().get() << "' since it is on an AirLoopHVACOutdoorAirSystem.");
return;
}
if (modelObject.airLoopHVAC() && modelObject.airLoopHVAC()->supplyFan()) {
if (modelObject.airLoopHVAC() && modelObject.airLoopHVAC()->supplyFan() && modelObject.airLoopHVAC()->supplyComponent(modelObject.handle())) {
LOG(Info, "Will not translate fan for VRF named '" << modelObject.name().get()
<< "' since it is on an AirLoopHVAC main branch that already has a supply Fan assigned.");
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@

#include "../../model/ThermalZone.hpp"
#include "../../model/Node.hpp"
#include "../../model/Node_Impl.hpp"
#include "../../model/AirLoopHVAC.hpp"
#include "../../model/AirLoopHVACOutdoorAirSystem.hpp"
#include "../../model/ControllerOutdoorAir.hpp"
#include "../../model/AirTerminalSingleDuctConstantVolumeNoReheat.hpp"
#include "../../model/AirTerminalSingleDuctInletSideMixer.hpp"
#include "../../model/Schedule.hpp"
#include "../../model/ScheduleConstant.hpp"
#include "../../model/SetpointManagerScheduled.hpp"
Expand Down Expand Up @@ -689,3 +691,39 @@ TEST_F(EnergyPlusFixture, ForwardTranslatorZoneHVACTerminalUnitVariableRefrigera
}
}
}

TEST_F(EnergyPlusFixture, ForwardTranslatorZoneHVACTerminalUnitVariableRefrigerantFlow_AirLoopHVAC_DemandSide) {

Model m;

AirLoopHVAC a(m);
Node supplyOutletNode = a.supplyOutletNode();

FanSystemModel loopFan(m);
supplyOutletNode = a.supplyOutletNode();
EXPECT_TRUE(loopFan.addToNode(supplyOutletNode));

ThermalZone z(m);
AirTerminalSingleDuctInletSideMixer atu(m);
EXPECT_TRUE(a.addBranchForZone(z, atu));

FanOnOff vrfFan(m);
CoilCoolingDXVariableRefrigerantFlow cc(m);
CoilHeatingDXVariableRefrigerantFlow hc(m);
ZoneHVACTerminalUnitVariableRefrigerantFlow vrf(m, cc, hc, vrfFan);
Node atuOutletNode = atu.outletModelObject()->cast<model::Node>();
EXPECT_TRUE(vrf.addToNode(atuOutletNode));

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

// When the VRF is on the demand side,
// then its fan should be translated into the resulting idf
// As previous tests show, if the VRF is a supply component then the fan
// should not be translated
std::vector<WorkspaceObject> idf_onoff_fans = w.getObjectsByType(IddObjectType::Fan_OnOff);
EXPECT_EQ(1u, idf_onoff_fans.size());

std::vector<WorkspaceObject> idf_system_fans = w.getObjectsByType(IddObjectType::Fan_SystemModel);
EXPECT_EQ(1u, idf_system_fans.size());
}

0 comments on commit 0d5f949

Please sign in to comment.