Skip to content

Commit

Permalink
Merge pull request #7649 from NREL/plantCompUsrDefRefactor
Browse files Browse the repository at this point in the history
User Defined Plant Component Refactor
  • Loading branch information
Myoldmopar authored Dec 19, 2019
2 parents 24427ed + e4af92b commit 6315024
Show file tree
Hide file tree
Showing 8 changed files with 935 additions and 1,304 deletions.
2 changes: 1 addition & 1 deletion src/EnergyPlus/HeatBalanceSurfaceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ namespace HeatBalanceSurfaceManager {

using HeatBalanceAirManager::ManageAirHeatBalance;
using HeatBalFiniteDiffManager::SurfaceFD;
using OutputReportTabular::GatherComponentLoadsSurface; // for writing tabular compoonent loads output reports
using OutputReportTabular::GatherComponentLoadsSurface; // for writing tabular component loads output reports
using ThermalComfort::ManageThermalComfort;

int SurfNum;
Expand Down
2 changes: 2 additions & 0 deletions src/EnergyPlus/Plant/PlantManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
#include <EnergyPlus/SurfaceGroundHeatExchanger.hh>
#include <EnergyPlus/SwimmingPool.hh>
#include <EnergyPlus/SystemAvailabilityManager.hh>
#include <EnergyPlus/UserDefinedComponents.hh>
#include <EnergyPlus/UtilityRoutines.hh>
#include <EnergyPlus/WaterToWaterHeatPumpEIR.hh>
#include <EnergyPlus/WaterUse.hh>
Expand Down Expand Up @@ -1440,6 +1441,7 @@ namespace EnergyPlus {
this_comp.TypeOf_Num = TypeOf_PlantComponentUserDefined;
this_comp.GeneralEquipType = GenEquipTypes_PlantComponent;
this_comp.CurOpSchemeType = UnknownStatusOpSchemeType;
this_comp.compPtr = UserDefinedComponents::UserPlantComponentStruct::factory(CompNames(CompNum));
} else if (UtilityRoutines::SameString(this_comp_type, "Coil:UserDefined")) {
this_comp.TypeOf_Num = TypeOf_CoilUserDefined;
this_comp.GeneralEquipType = GenEquipTypes_PlantComponent;
Expand Down
11 changes: 1 addition & 10 deletions src/EnergyPlus/PlantLoopEquip.cc
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ namespace PlantLoopEquip {
using HWBaseboardRadiator::UpdateHWBaseboardPlantConnection;
using RefrigeratedCase::SimRefrigCondenser;
using SteamBaseboardRadiator::UpdateSteamBaseboardPlantConnection;
using UserDefinedComponents::SimUserDefinedPlantComponent;
using WaterCoils::UpdateWaterToAirCoilPlantConnection;

// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
Expand Down Expand Up @@ -934,15 +933,7 @@ namespace PlantLoopEquip {
} else if (GeneralEquipType == GenEquipTypes_PlantComponent) {

if (EquipTypeNum == TypeOf_PlantComponentUserDefined) {

SimUserDefinedPlantComponent(
LoopNum, LoopSideNum, sim_component.TypeOf, sim_component.Name, EquipNum, InitLoopEquip, CurLoad, MaxLoad, MinLoad, OptLoad);
if (InitLoopEquip) {
sim_component.MaxLoad = MaxLoad;
sim_component.MinLoad = MinLoad;
sim_component.OptLoad = OptLoad;
sim_component.CompNum = EquipNum;
}
sim_component.compPtr->simulate(sim_component_location, FirstHVACIteration, CurLoad, RunFlag);

} else if (EquipTypeNum == TypeOf_WaterSource) {
sim_component.compPtr->simulate(sim_component_location, FirstHVACIteration, CurLoad, RunFlag);
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/RuntimeLanguageProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ namespace RuntimeLanguageProcessor {
WriteTrace(StackNum, InstructionNum, ReturnValue, seriousErrorFound);

} else if (SELECT_CASE_var == KeywordWhile) {
// evaluate expresssion at while, skip to past endwhile if not true
// evaluate expression at while, skip to past endwhile if not true
ExpressionNum = ErlStack(StackNum).Instruction(InstructionNum).Argument1;
InstructionNum2 = ErlStack(StackNum).Instruction(InstructionNum).Argument2;
ReturnValue = EvaluateExpression(ExpressionNum, seriousErrorFound);
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/SingleDuct.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5452,7 +5452,7 @@ namespace SingleDuct {
NumATMixers = inputProcessor->getNumObjectsFound(cCurrentModuleObject);
SysATMixer.allocate(NumATMixers);

// Need air disribution units first
// Need air distribution units first
ZoneAirLoopEquipmentManager::GetZoneAirLoopEquipment();

for (ATMixerNum = 1; ATMixerNum <= NumATMixers; ++ATMixerNum) {
Expand Down
Loading

7 comments on commit 6315024

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

develop (Myoldmopar) - Win64-Windows-10-VisualStudio-16: OK (1926 of 1926 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-cppcheck: OK (0 of 0 tests passed, 0 test warnings)

Build Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-custom_check: OK (11 of 11 tests passed, 0 test warnings)

Build Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.4: OK (1946 of 1946 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-UnitTestsCoverage-Debug: OK (1254 of 1254 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-IntegrationCoverage-Debug: OK (674 of 675 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 674
  • Timeout: 1

Build Badge Test Badge Coverage Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

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

develop (Myoldmopar) - x86_64-MacOS-10.13-clang: OK (1926 of 1926 tests passed, 0 test warnings)

Build Badge Test Badge

Please sign in to comment.