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

Schedule API #10848

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 7 additions & 8 deletions src/EnergyPlus/AirLoopHVACDOAS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ namespace AirLoopHVACDOAS {

void AirLoopDOAS::getAirLoopDOASInput(EnergyPlusData &state)
{

constexpr std::string_view routineName = "AirLoopDOAS::getAirLoopDOASInput";
std::string const cCurrentModuleObject = "AirLoopHVAC:DedicatedOutdoorAirSystem";

auto const instances = state.dataInputProcessing->inputProcessor->epJSON.find(cCurrentModuleObject);
Expand All @@ -457,6 +457,8 @@ namespace AirLoopHVACDOAS {
++AirLoopDOASNum;
AirLoopDOAS thisDOAS;

ErrorObjectHeader eoh{routineName, cCurrentModuleObject, thisObjectName};

thisDOAS.Name = Util::makeUPPER(thisObjectName);
// get OA and avail num
thisDOAS.OASystemName = Util::makeUPPER(fields.at("airloophvac_outdoorairsystem_name").get<std::string>());
Expand Down Expand Up @@ -758,12 +760,9 @@ namespace AirLoopHVACDOAS {
}

thisDOAS.AvailManagerSchedName = Util::makeUPPER(fields.at("availability_schedule_name").get<std::string>());
thisDOAS.m_AvailManagerSchedPtr = ScheduleManager::GetScheduleIndex(state, thisDOAS.AvailManagerSchedName);
if (thisDOAS.m_AvailManagerSchedPtr == 0) {
cFieldName = "Availability Schedule Name";
ShowSevereError(
state,
format("{}, \"{}\" {} not found: {}", cCurrentModuleObject, thisDOAS.Name, cFieldName, thisDOAS.AvailManagerSchedName));

if ((thisDOAS.m_AvailManagerSched = Sched::GetSchedule(state, thisDOAS.AvailManagerSchedName)) == nullptr) {
ShowSevereItemNotFound(state, eoh, "Availability Schedule Name", thisDOAS.AvailManagerSchedName);
errorsFound = true;
}

Expand Down Expand Up @@ -948,7 +947,7 @@ namespace AirLoopHVACDOAS {
this->SumMassFlowRate += state.dataLoopNodes->Node(NodeNum).MassFlowRate;
}

SchAvailValue = ScheduleManager::GetCurrentScheduleValue(state, this->m_AvailManagerSchedPtr);
SchAvailValue = this->m_AvailManagerSched->getCurrentVal();
if (SchAvailValue < 1.0) {
this->SumMassFlowRate = 0.0;
}
Expand Down
6 changes: 5 additions & 1 deletion src/EnergyPlus/AirLoopHVACDOAS.hh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ namespace AirLoopHVACDOAS {

int m_AirLoopDOASNum = 0;
int m_OASystemNum = 0;
int m_AvailManagerSchedPtr = 0;
Sched::Schedule *m_AvailManagerSched = nullptr;
int m_AirLoopMixerIndex = -1;
int m_AirLoopSplitterIndex = -1;
int NumOfAirLoops = 0;
Expand Down Expand Up @@ -184,6 +184,10 @@ struct AirLoopHVACDOASData : BaseGlobalStruct
std::vector<AirLoopHVACDOAS::AirLoopMixer> airloopMixer;
std::vector<AirLoopHVACDOAS::AirLoopSplitter> airloopSplitter;

void init_constant_state([[maybe_unused]] EnergyPlusData &state) override
{
}

void init_state([[maybe_unused]] EnergyPlusData &state) override
{
}
Expand Down
3 changes: 2 additions & 1 deletion src/EnergyPlus/AirTerminalUnit.hh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
// EnergyPlus Headers
#include <EnergyPlus/Data/BaseData.hh>
#include <EnergyPlus/EnergyPlus.hh>
#include <EnergyPlus/ScheduleManager.hh>

namespace EnergyPlus {

Expand Down Expand Up @@ -108,7 +109,7 @@ protected: // Data
std::string name; // name of unit
std::string unitType; // type of unit = e.g. AirTerminal:SingleDuct:ConstantVolume:FourPipeBeam
int aDUNum = 0; // index of this unit in the corresponding air distribution unit structure
int airAvailSchedNum = 0; // index to schedule for pimary air availability
Sched::Schedule *airAvailSched = nullptr; // schedule for pimary air availability
bool airAvailable = false; // true if primary air is available
Real64 vDotDesignPrimAir = 0.0; // Design primary air volume flow rate m3/s (autosizable)
bool vDotDesignPrimAirWasAutosized = false; // true if user input for design air flow was autsized on input
Expand Down
27 changes: 14 additions & 13 deletions src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Elements.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "AirflowNetwork/Properties.hpp"
#include <EnergyPlus/DataHVACGlobals.hh>
#include <EnergyPlus/EPVector.hh>
#include <EnergyPlus/ScheduleManager.hh>

namespace EnergyPlus {

Expand Down Expand Up @@ -260,10 +261,10 @@ namespace AirflowNetwork {
Real64 UpValueEnth; // Upper Value on Inside/Outside Temperature Difference for
// Modulating the Venting Open Factor with Enthalpic control
int ZoneNum; // Zone number associated with ZoneName
int VentSchNum; // Zone ventilation schedule number associated with ventilation schedule name
Sched::Schedule *ventSched = nullptr; // Zone ventilation schedule number associated with ventilation schedule name
int VentCtrNum; // Ventilation control mode number: 1 "Temperature", 2 "ENTHALPIC", 3 "CONSTANT", 4 "NOVENT"
std::string VentingSchName; // Name of ventilation temperature control schedule
int VentingSchNum; // Ventilation schedule number
Sched::Schedule *ventingSched = nullptr; // Ventilation schedule number
std::string SingleSidedCpType; // Type of calculation method for single sided wind pressure coefficients
Real64 BuildWidth; // The width of the building along the facade that contains this zone.
int ASH55PeopleInd; // Index of people object with ASH55 comfort calcs for ventilation control
Expand All @@ -275,7 +276,7 @@ namespace AirflowNetwork {
// Default Constructor
MultizoneZoneProp()
: VentControl("NoVent"), Height(0.0), OpenFactor(1.0), LowValueTemp(0.0), UpValueTemp(100.0), LowValueEnth(0.0), UpValueEnth(300000.0),
ZoneNum(0), VentSchNum(0), VentCtrNum(VentControlType::None), VentingSchNum(0), SingleSidedCpType("STANDARD"), BuildWidth(10.0),
ZoneNum(0), VentCtrNum(VentControlType::None), SingleSidedCpType("STANDARD"), BuildWidth(10.0),
ASH55PeopleInd(0), CEN15251PeopleInd(0), OccupantVentilationControlNum(0), RAFNNodeNum(0)
{
}
Expand Down Expand Up @@ -309,9 +310,9 @@ namespace AirflowNetwork {
Real64 UpValueEnth; // Upper Value on Inside/Outside Temperature Difference for
// Modulating the Venting Open Factor with Enthalpic control
std::string VentingSchName; // Name of ventilation temperature control schedule
int VentSchNum; // Zone ventilation schedule number associated with ventilation schedule name
Sched::Schedule *ventSched = nullptr; // Zone ventilation schedule number associated with ventilation schedule name
VentControlType VentSurfCtrNum; // Ventilation control mode number: 1 "Temperature", 2 "ENTHALPIC", 3 "CONSTANT", 4 "NOVENT"
int VentingSchNum; // Ventilation schedule number
Sched::Schedule *ventingSched = nullptr; // Ventilation schedule number
int ZonePtr; // Pointer to inside face zone
bool IndVentControl; // Individual surface venting control
int ExtLargeOpeningErrCount; // Exterior large opening error count during HVAC system operation
Expand Down Expand Up @@ -340,7 +341,7 @@ namespace AirflowNetwork {
MultizoneSurfaceProp()
: Factor(0.0), SurfNum(0), NodeNums{{0, 0}}, OpenFactor(0.0), OpenFactorLast(0.0), EMSOpenFactorActuated(false), EMSOpenFactor(0.0),
Height(0.0), Width(0.0), CHeight(0.0), VentControl("ZONELEVEL"), ModulateFactor(0.0), LowValueTemp(0.0), UpValueTemp(100.0),
LowValueEnth(0.0), UpValueEnth(300000.0), VentSchNum(0), VentSurfCtrNum(VentControlType::None), VentingSchNum(0), ZonePtr(0),
LowValueEnth(0.0), UpValueEnth(300000.0), VentSurfCtrNum(VentControlType::None), ZonePtr(0),
IndVentControl(false), ExtLargeOpeningErrCount(0), ExtLargeOpeningErrIndex(0), OpenFactorErrCount(0), OpenFactorErrIndex(0),
Multiplier(1.0), HybridVentClose(false), HybridCtrlGlobal(false), HybridCtrlMaster(false), WindModifier(1.0),
OccupantVentilationControlNum(0), OpeningStatus(OpenStatus::FreeOperation), PrevOpeningstatus(OpenStatus::FreeOperation),
Expand Down Expand Up @@ -753,7 +754,7 @@ namespace AirflowNetwork {
{
// Members
Real64 FlowRate; // mass flow rate
int SchedPtr; // Schedule pointer
Sched::Schedule *sched = nullptr; // Schedule pointer
Real64 FlowCoef; // Air Mass Flow Coefficient [kg/s at 1Pa]
Real64 FlowExpo; // Air Mass Flow exponent [dimensionless]
Real64 StandardT; // Standard temperature for crack data
Expand All @@ -766,7 +767,7 @@ namespace AirflowNetwork {

// Default Constructor
ZoneExhaustFan()
: FlowRate(0.0), SchedPtr(0), FlowCoef(0.0), FlowExpo(0.0), StandardT(0.0), StandardP(0.0), StandardW(0.0), InletNode(0), OutletNode(0),
: FlowRate(0.0), FlowCoef(0.0), FlowExpo(0.0), StandardT(0.0), StandardP(0.0), StandardW(0.0), InletNode(0), OutletNode(0),
EPlusZoneNum(0), PressCtrlNum(0)
{
}
Expand Down Expand Up @@ -1397,16 +1398,16 @@ namespace AirflowNetwork {
std::string ControlObjectType; // The control type to be used for pressure control
std::string ControlObjectName; // Corresponding control type name
int ControlTypeSet; // Control type set to be used for pressure control
int AvailSchedPtr; // Availability schedule pointer
int PresSetpointSchedPtr; // Pressure setpoint schedule pointer
Sched::Schedule *availSched = nullptr; // Availability schedule pointer
Sched::Schedule *presSetpointSched = nullptr; // Pressure setpoint schedule pointer
int AirLoopNum; // Air loop number
int OANodeNum; // outdoor air node number
bool bypass; // Can not perform pressure control as true
Real64 PresCtrlMassRate;

// Default Constructor
PressureControllerProp()
: ZoneNum(0), AFNNodeNum(0), ControlTypeSet(0), AvailSchedPtr(0), PresSetpointSchedPtr(0), AirLoopNum(0), OANodeNum(0), bypass(false),
: ZoneNum(0), AFNNodeNum(0), ControlTypeSet(0), AirLoopNum(0), OANodeNum(0), bypass(false),
PresCtrlMassRate(0.0)
{
}
Expand All @@ -1415,7 +1416,7 @@ namespace AirflowNetwork {
struct OutdoorAirFan : public AirflowElement // OA fan component
{
// Members
int SchedPtr; // Schedule pointer
Sched::Schedule *sched = nullptr; // Schedule pointer
Real64 FlowCoef; // Air Mass Flow Coefficient [kg/s at 1Pa]
Real64 FlowExpo; // Air Mass Flow exponent [dimensionless]
Real64 StandardT; // Standard temperature for crack data [C]
Expand All @@ -1428,7 +1429,7 @@ namespace AirflowNetwork {

// Default Constructor
OutdoorAirFan()
: SchedPtr(0), FlowCoef(0.0), FlowExpo(0.0), StandardT(0.0), StandardP(0.0), StandardW(0.0), InletNode(0), OutletNode(0), OAMixerNum(0),
: FlowCoef(0.0), FlowExpo(0.0), StandardT(0.0), StandardP(0.0), StandardW(0.0), InletNode(0), OutletNode(0), OAMixerNum(0),
PressCtrlNum(0)
{
}
Expand Down
12 changes: 8 additions & 4 deletions src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ namespace AirflowNetwork {
std::string ComfortHighTempCurveName; // Thermal Comfort High Temperature Curve Name
int ComfortLowTempCurveNum; // Thermal Comfort Low Temperature Curve number
int ComfortHighTempCurveNum; // Thermal Comfort high Temperature Curve number
int OpeningProbSchNum; // Opening probability schedule pointer
int ClosingProbSchNum; // Closing probability schedule pointer
Sched::Schedule *openingProbSched = nullptr; // Opening probability schedule pointer
Sched::Schedule *closingProbSched = nullptr; // Closing probability schedule pointer
Real64 ComfortBouPoint; // Thermal Comfort Temperature Boundary Point
bool OccupancyCheck; // Occupancy check
std::string OpeningProbSchName; // Opening probability schedule name
Expand All @@ -147,8 +147,8 @@ namespace AirflowNetwork {

// Default Constructor
OccupantVentilationControlProp()
: MinOpeningTime(0.0), MinClosingTime(0.0), ComfortLowTempCurveNum(0), ComfortHighTempCurveNum(0), OpeningProbSchNum(0),
ClosingProbSchNum(0), ComfortBouPoint(10.0), OccupancyCheck(false), MaxPPD(10.0), MinTimeControlOnly(false)
: MinOpeningTime(0.0), MinClosingTime(0.0), ComfortLowTempCurveNum(0), ComfortHighTempCurveNum(0),
ComfortBouPoint(10.0), OccupancyCheck(false), MaxPPD(10.0), MinTimeControlOnly(false)
{
}

Expand Down Expand Up @@ -539,6 +539,10 @@ namespace AirflowNetwork {
Array1D<AirflowNetwork::ReliefFlow> DisSysCompReliefAirData;
Array1D<AirflowNetwork::AirflowNetworkLinkageViewFactorProp> AirflowNetworkLinkageViewFactorData;

void init_constant_state([[maybe_unused]] EnergyPlusData &state) override
{
}

void init_state([[maybe_unused]] EnergyPlusData &state) override
{
}
Expand Down
Loading
Loading