Skip to content

Commit

Permalink
schedulemanager
Browse files Browse the repository at this point in the history
  • Loading branch information
brianlball committed Oct 22, 2020
1 parent add5f30 commit f3c5360
Show file tree
Hide file tree
Showing 49 changed files with 811 additions and 811 deletions.
16 changes: 8 additions & 8 deletions src/EnergyPlus/OutputReportTabular.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3981,7 +3981,7 @@ namespace OutputReportTabular {
curScheduleIndex = OutputTableBinned(iInObj).scheduleIndex;
// if a schedule was used, check if it was non-zero value
if (curScheduleIndex != 0) {
if (GetCurrentScheduleValue(curScheduleIndex) != 0.0) {
if (GetCurrentScheduleValue(state, curScheduleIndex) != 0.0) {
gatherThisTime = true;
} else {
gatherThisTime = false;
Expand Down Expand Up @@ -4633,7 +4633,7 @@ namespace OutputReportTabular {
curMeterNumber = meterNumTotalsBEPS(iResource);
if (curMeterNumber > 0) {
curMeterValue =
GetCurrentMeterValue(curMeterNumber) * GetCurrentScheduleValue(ffSchedIndex(iResource)) * SourceFactors(iResource);
GetCurrentMeterValue(curMeterNumber) * GetCurrentScheduleValue(state, ffSchedIndex(iResource)) * SourceFactors(iResource);
gatherTotalsBySourceBEPS(iResource) += curMeterValue;
}
} else {
Expand All @@ -4649,7 +4649,7 @@ namespace OutputReportTabular {
curMeterNumber = meterNumEndUseBEPS(iResource, jEndUse);
if (curMeterNumber > 0) {
curMeterValue =
GetCurrentMeterValue(curMeterNumber) * GetCurrentScheduleValue(ffSchedIndex(iResource)) * SourceFactors(iResource);
GetCurrentMeterValue(curMeterNumber) * GetCurrentScheduleValue(state, ffSchedIndex(iResource)) * SourceFactors(iResource);
gatherEndUseBySourceBEPS(iResource, jEndUse) += curMeterValue;
}
} else {
Expand Down Expand Up @@ -7638,10 +7638,10 @@ namespace OutputReportTabular {
waterConversionFactor = 1.0;
areaConversionFactor = 1.0;
} else if (SELECT_CASE_var == unitsStyleInchPound) {
largeConversionFactor = getSpecificUnitDivider("J", "kBtu"); // 1054351.84 J to kBtu
largeConversionFactor = getSpecificUnitDivider(state, "J", "kBtu"); // 1054351.84 J to kBtu
kConversionFactor = 1.0;
waterConversionFactor = getSpecificUnitDivider("m3", "gal"); // 0.003785413 m3 to gal
areaConversionFactor = getSpecificUnitDivider("m2", "ft2"); // 0.092893973 m2 to ft2
waterConversionFactor = getSpecificUnitDivider(state, "m3", "gal"); // 0.003785413 m3 to gal
areaConversionFactor = getSpecificUnitDivider(state, "m2", "ft2"); // 0.092893973 m2 to ft2
} else {
largeConversionFactor = 1000000000.0;
kConversionFactor = 1000.0;
Expand Down Expand Up @@ -9226,8 +9226,8 @@ namespace OutputReportTabular {
largeConversionFactor = 3600000.0;
areaConversionFactor = 1.0;
} else if (SELECT_CASE_var == unitsStyleInchPound) {
largeConversionFactor = getSpecificUnitDivider("J", "kBtu"); // 1054351.84 J to kBtu
areaConversionFactor = getSpecificUnitDivider("m2", "ft2"); // 0.092893973 m2 to ft2
largeConversionFactor = getSpecificUnitDivider(state, "J", "kBtu"); // 1054351.84 J to kBtu
areaConversionFactor = getSpecificUnitDivider(state, "m2", "ft2"); // 0.092893973 m2 to ft2
} else {
largeConversionFactor = 1000000.0; // to MJ
areaConversionFactor = 1.0;
Expand Down
352 changes: 176 additions & 176 deletions src/EnergyPlus/PollutionModule.cc

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/EnergyPlus/PollutionModule.hh
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ namespace PollutionModule {

void clear_state();

void CalculatePollution();
void CalculatePollution(EnergyPlusData &state);

// Get Input Section of the Module
//******************************************************************************
Expand All @@ -453,7 +453,7 @@ namespace PollutionModule {
// End of Get Input subroutines for the Pollution Module
//******************************************************************************

void CalcPollution();
void CalcPollution(EnergyPlusData &state);

void ReadEnergyMeters();

Expand Down
12 changes: 6 additions & 6 deletions src/EnergyPlus/PoweredInductionUnits.cc
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ namespace PoweredInductionUnits {
// Do the start of HVAC time step initializations
if (FirstHVACIteration) {
// check for upstream zero flow. If nonzero and schedule ON, set primary flow to max
if (GetCurrentScheduleValue(PIU(PIUNum).SchedPtr) > 0.0 && Node(PriNode).MassFlowRate > 0.0) {
if (GetCurrentScheduleValue(state, PIU(PIUNum).SchedPtr) > 0.0 && Node(PriNode).MassFlowRate > 0.0) {
if (PIU(PIUNum).UnitType == "AirTerminal:SingleDuct:SeriesPIU:Reheat") {
Node(PriNode).MassFlowRate = PIU(PIUNum).MaxPriAirMassFlow;
Node(SecNode).MassFlowRate = max(0.0, PIU(PIUNum).MaxTotAirMassFlow - PIU(PIUNum).MaxPriAirMassFlow);
Expand All @@ -953,7 +953,7 @@ namespace PoweredInductionUnits {
Node(SecNode).MassFlowRate = 0.0;
}
// reset the max and min avail flows
if (GetCurrentScheduleValue(PIU(PIUNum).SchedPtr) > 0.0 && Node(PriNode).MassFlowRateMaxAvail > 0.0) {
if (GetCurrentScheduleValue(state, PIU(PIUNum).SchedPtr) > 0.0 && Node(PriNode).MassFlowRateMaxAvail > 0.0) {
if (PIU(PIUNum).UnitType == "AirTerminal:SingleDuct:SeriesPIU:Reheat") {
Node(PriNode).MassFlowRateMaxAvail = PIU(PIUNum).MaxPriAirMassFlow;
Node(PriNode).MassFlowRateMinAvail = PIU(PIUNum).MinPriAirMassFlow;
Expand Down Expand Up @@ -1610,8 +1610,8 @@ namespace PoweredInductionUnits {
MinSteamFlow = Node(ControlNode).MassFlowRateMinAvail;
}
}
if (GetCurrentScheduleValue(PIU(PIUNum).SchedPtr) <= 0.0) UnitOn = false;
if ((GetCurrentScheduleValue(PIU(PIUNum).FanAvailSchedPtr) <= 0.0 || PIUTurnFansOff) && !PIUTurnFansOn) UnitOn = false;
if (GetCurrentScheduleValue(state, PIU(PIUNum).SchedPtr) <= 0.0) UnitOn = false;
if ((GetCurrentScheduleValue(state, PIU(PIUNum).FanAvailSchedPtr) <= 0.0 || PIUTurnFansOff) && !PIUTurnFansOn) UnitOn = false;
if (PriAirMassFlow <= SmallMassFlow || PriAirMassFlowMax <= SmallMassFlow) PriOn = false;
// Set the mass flow rates
if (UnitOn) {
Expand Down Expand Up @@ -1887,7 +1887,7 @@ namespace PoweredInductionUnits {
MinWaterFlow = Node(ControlNode).MassFlowRateMinAvail;
}
}
if (GetCurrentScheduleValue(PIU(PIUNum).SchedPtr) <= 0.0) UnitOn = false;
if (GetCurrentScheduleValue(state, PIU(PIUNum).SchedPtr) <= 0.0) UnitOn = false;
if (PriAirMassFlow <= SmallMassFlow || PriAirMassFlowMax <= SmallMassFlow) PriOn = false;
// Set the mass flow rates
if (UnitOn) {
Expand Down Expand Up @@ -2005,7 +2005,7 @@ namespace PoweredInductionUnits {
if (!HCoilOn) {
// call the reheat coil with the NO FLOW condition
mdot = 0.0;
SetComponentFlowRate(mdot,
SetComponentFlowRate(state, mdot,
PIU(PIUNum).HotControlNode,
PIU(PIUNum).HotCoilOutNodeNum,
PIU(PIUNum).HWLoopNum,
Expand Down
26 changes: 13 additions & 13 deletions src/EnergyPlus/Pumps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,8 @@ namespace Pumps {
"\", At least one scheduled VFD schedule input was invalid.");
ShowContinueError(state, "Verify that all of the pressure and rpm schedules referenced in the input fields actually exist.");
ErrorsFound = true;
} else if (!CheckScheduleValueMinMax(PumpEquip(PumpNum).VFD.ManualRPMSchedIndex, ">", 0.0) ||
!CheckScheduleValueMinMax(PumpEquip(PumpNum).VFD.ManualRPMSchedIndex, ">", 0.0)) {
} else if (!CheckScheduleValueMinMax(state, PumpEquip(PumpNum).VFD.ManualRPMSchedIndex, ">", 0.0) ||
!CheckScheduleValueMinMax(state, PumpEquip(PumpNum).VFD.ManualRPMSchedIndex, ">", 0.0)) {
ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + PumpEquip(PumpNum).Name +
"\", A pump rpm schedule had zero value. Ensure all entries in the schedule are greater than zero.");
ErrorsFound = true;
Expand All @@ -516,8 +516,8 @@ namespace Pumps {
"\", At least one scheduled VFD schedule input was invalid.");
ShowContinueError(state, "Verify that all of the pressure and rpm schedules referenced in the input fields actually exist.");
ErrorsFound = true;
} else if (!CheckScheduleValueMinMax(PumpEquip(PumpNum).VFD.MinRPMSchedIndex, ">", 0.0) ||
!CheckScheduleValueMinMax(PumpEquip(PumpNum).VFD.MaxRPMSchedIndex, ">", 0.0)) {
} else if (!CheckScheduleValueMinMax(state, PumpEquip(PumpNum).VFD.MinRPMSchedIndex, ">", 0.0) ||
!CheckScheduleValueMinMax(state, PumpEquip(PumpNum).VFD.MaxRPMSchedIndex, ">", 0.0)) {
ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + PumpEquip(PumpNum).Name +
"\", A pump rpm schedule had zero value. Ensure all entries in the schedule are greater than zero.");
ErrorsFound = true;
Expand Down Expand Up @@ -1581,7 +1581,7 @@ namespace Pumps {

// Retrive the pump speed fraction from the pump schedule
if (PumpEquip(PumpNum).PumpScheduleIndex != 0) {
PumpSchedFraction = GetCurrentScheduleValue(PumpEquip(PumpNum).PumpScheduleIndex);
PumpSchedFraction = GetCurrentScheduleValue(state, PumpEquip(PumpNum).PumpScheduleIndex);
PumpSchedFraction = BoundValueToWithinTwoValues(PumpSchedFraction, 0.0, 1.0);
} else {
PumpSchedFraction = 1.0;
Expand Down Expand Up @@ -1624,7 +1624,7 @@ namespace Pumps {
if (SELECT_CASE_var1 == VFDManual) {

// Evaluate the schedule if it exists and put the fraction into a local variable
PumpSchedRPM = GetCurrentScheduleValue(PumpEquip(PumpNum).VFD.ManualRPMSchedIndex);
PumpSchedRPM = GetCurrentScheduleValue(state, PumpEquip(PumpNum).VFD.ManualRPMSchedIndex);
// Convert the RPM to rot/sec for calculation routine
PumpEquip(PumpNum).RotSpeed = PumpSchedRPM / 60.0;
// Resolve the new mass flow rate based on current pressure characteristics
Expand Down Expand Up @@ -1820,7 +1820,7 @@ namespace Pumps {
PumpMassFlowRate = min(PumpEquip(PumpNum).MassFlowRateMax, PumpMassFlowRate);
PumpMassFlowRate = max(PumpEquip(PumpNum).MassFlowRateMin, PumpMassFlowRate);

SetComponentFlowRate(PumpMassFlowRate,
SetComponentFlowRate(state, PumpMassFlowRate,
InletNode,
OutletNode,
PumpEquip(PumpNum).LoopNum,
Expand All @@ -1831,8 +1831,8 @@ namespace Pumps {
// Get RPM value for reporting as output
// RPM is calculated using pump affinity laws for rotation speed
if (PlantLoop(PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs && PumpEquip(PumpNum).HasVFD) {
RotSpeed_Min = GetCurrentScheduleValue(PumpEquip(PumpNum).VFD.MinRPMSchedIndex);
RotSpeed_Max = GetCurrentScheduleValue(PumpEquip(PumpNum).VFD.MaxRPMSchedIndex);
RotSpeed_Min = GetCurrentScheduleValue(state, PumpEquip(PumpNum).VFD.MinRPMSchedIndex);
RotSpeed_Max = GetCurrentScheduleValue(state, PumpEquip(PumpNum).VFD.MaxRPMSchedIndex);
if (PumpEquip(PumpNum).PumpMassFlowRateMaxRPM < MassFlowTolerance || PumpEquip(PumpNum).PumpMassFlowRateMinRPM < MassFlowTolerance) {
PumpEquip(PumpNum).VFD.PumpActualRPM = 0.0;
} else {
Expand Down Expand Up @@ -2404,10 +2404,10 @@ namespace Pumps {
static Real64 MinPress(0.0); // Minimum pressure
static Real64 MaxPress(0.0); // Maximum pressure

RotSpeed_Min = GetCurrentScheduleValue(PumpEquip(PumpNum).VFD.MinRPMSchedIndex);
RotSpeed_Max = GetCurrentScheduleValue(PumpEquip(PumpNum).VFD.MaxRPMSchedIndex);
MinPress = GetCurrentScheduleValue(PumpEquip(PumpNum).VFD.LowerPsetSchedIndex);
MaxPress = GetCurrentScheduleValue(PumpEquip(PumpNum).VFD.UpperPsetSchedIndex);
RotSpeed_Min = GetCurrentScheduleValue(state, PumpEquip(PumpNum).VFD.MinRPMSchedIndex);
RotSpeed_Max = GetCurrentScheduleValue(state, PumpEquip(PumpNum).VFD.MaxRPMSchedIndex);
MinPress = GetCurrentScheduleValue(state, PumpEquip(PumpNum).VFD.LowerPsetSchedIndex);
MaxPress = GetCurrentScheduleValue(state, PumpEquip(PumpNum).VFD.UpperPsetSchedIndex);

// Calculate maximum and minimum mass flow rate associated with maximun and minimum RPM
if (PumpEquip(PumpNum).LoopNum > 0) {
Expand Down
Loading

5 comments on commit f3c5360

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

global_utility_routines (brianlball) - Win64-Windows-10-VisualStudio-16: Build Failed

Failures:\n

API Test Summary

  • Failed: 1
  • notrun: 3

integration Test Summary

  • Passed: 2
  • Failed: 717

Build Badge Test 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.

global_utility_routines (brianlball) - x86_64-MacOS-10.15-clang-11.0.0: Build Failed

Failures:\n

API Test Summary

  • Failed: 6
  • notrun: 3

integration Test Summary

  • Passed: 2
  • Failed: 717

regression Test Summary

  • Passed: 715
  • Failed: 2

Build Badge Test 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.

global_utility_routines (brianlball) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: Build Failed

Failures:\n

API Test Summary

  • Failed: 6
  • notrun: 3

integration Test Summary

  • Passed: 2
  • Failed: 720

regression Test Summary

  • Passed: 735
  • Failed: 2

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

global_utility_routines (brianlball) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: Build Failed

Failures:\n

API Test Summary

  • Failed: 6
  • notrun: 3

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.

global_utility_routines (brianlball) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: Build Failed

Failures:\n

integration Test Summary

  • Passed: 2
  • Failed: 720

Build Badge Test Badge Coverage Badge

Please sign in to comment.