Skip to content

Commit

Permalink
One step back
Browse files Browse the repository at this point in the history
  • Loading branch information
amirroth committed Dec 20, 2024
1 parent 33b94a9 commit dfc8545
Show file tree
Hide file tree
Showing 45 changed files with 309 additions and 312 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ namespace AirflowNetwork {
// Members
std::string ZoneName; // Name of Associated EnergyPlus Thermal Zone
std::string VentControl; // Ventilation Control Mode: "TEMPERATURE", "ENTHALPIC", "CONSTANT", or "NOVENT"
std::string VentSchName; // Name of ventilation temperature control schedule
std::string VentAvailSchName; // Ventilation availability schedule
Real64 Height; // Nodal height
Real64 OpenFactor; // Limit Value on Multiplier for Modulating Venting Open Factor,
// Not applicable if Vent Control Mode = CONSTANT or NOVENT
Expand All @@ -261,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
Sched::Schedule *ventSched = nullptr; // Zone ventilation schedule number associated with ventilation schedule name
Sched::Schedule *ventTempControlSched = nullptr; // Ventilation temperature control schedule
int VentCtrNum; // Ventilation control mode number: 1 "Temperature", 2 "ENTHALPIC", 3 "CONSTANT", 4 "NOVENT"
std::string VentingSchName; // Name of ventilation temperature control schedule
Sched::Schedule *ventingSched = nullptr; // Ventilation schedule number
std::string VentTempControlSchName; // Name of ventilation temperature control schedule
Sched::Schedule *ventAvailSched = nullptr; // Ventilation availability schedule
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 Down Expand Up @@ -299,7 +299,6 @@ namespace AirflowNetwork {
Real64 Width; // Surface width
Real64 CHeight; // Surface central height in z direction
std::string VentControl; // Ventilation Control Mode: TEMPERATURE, ENTHALPIC, CONSTANT, ZONELEVEL or NOVENT
std::string VentSchName; // ! Name of ventilation temperature control schedule
Real64 ModulateFactor; // Limit Value on Multiplier for Modulating Venting Open Factor
Real64 LowValueTemp; // Lower Value on Inside/Outside Temperature Difference for
// Modulating the Venting Open Factor with temp control
Expand All @@ -309,10 +308,11 @@ namespace AirflowNetwork {
// Modulating the Venting Open Factor with Enthalpic control
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
Sched::Schedule *ventSched = nullptr; // Zone ventilation schedule number associated with ventilation schedule name
std::string VentTempControlSchName; // Name of ventilation temperature control schedule
Sched::Schedule *ventTempControlSched = nullptr; // Ventilation temperature control schedule
VentControlType VentSurfCtrNum; // Ventilation control mode number: 1 "Temperature", 2 "ENTHALPIC", 3 "CONSTANT", 4 "NOVENT"
Sched::Schedule *ventingSched = nullptr; // Ventilation schedule number
std::string VentAvailSchName; // Ventilation availability schedule
Sched::Schedule *ventAvailSched = nullptr; // Ventilation availability schedule
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
65 changes: 33 additions & 32 deletions src/EnergyPlus/AirflowNetwork/src/Solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2306,7 +2306,7 @@ namespace AirflowNetwork {
if (!lAlphaBlanks(2)) MultizoneZoneData(i).VentControl = Alphas(2); // Ventilation Control Mode: "Temperature", "Enthalpy",
// "ASHRAE55ADAPTIVE", "CEN15251AdaptiveComfort,
// "Constant", or "NoVent"
MultizoneZoneData(i).VentSchName = Alphas(3); // Name of ventilation temperature control schedule
MultizoneZoneData(i).VentTempControlSchName = Alphas(3); // Name of ventilation temperature control schedule
MultizoneZoneData(i).OpenFactor = Numbers(1); // Limit Value on Multiplier for Modulating Venting Open Factor,
// Not applicable if Vent Control Mode = CONSTANT or NOVENT
MultizoneZoneData(i).LowValueTemp = Numbers(2); // Lower Value on Inside/Outside Temperature Difference
Expand Down Expand Up @@ -2343,15 +2343,15 @@ namespace AirflowNetwork {

if (MultizoneZoneData(i).VentCtrNum < NumOfVentCtrTypes) {
if (NumAlphas >= 4 && (!lAlphaBlanks(4))) {
MultizoneZoneData(i).VentingSchName = Alphas(4);
if ((MultizoneZoneData(i).ventingSched = Sched::GetSchedule(m_state, MultizoneZoneData(i).VentingSchName)) == nullptr) {
MultizoneZoneData(i).VentAvailSchName = Alphas(4);
if ((MultizoneZoneData(i).ventAvailSched = Sched::GetSchedule(m_state, MultizoneZoneData(i).VentAvailSchName)) == nullptr) {
ShowSevereItemNotFound(m_state, eoh, cAlphaFields(4), Alphas(4));
ErrorsFound = true;
}
}
} else {
MultizoneZoneData(i).VentingSchName = std::string();
MultizoneZoneData(i).ventingSched = Sched::GetScheduleAlwaysOn(m_state);
MultizoneZoneData(i).VentAvailSchName = std::string();
MultizoneZoneData(i).ventAvailSched = Sched::GetScheduleAlwaysOn(m_state);
}
}
} else {
Expand Down Expand Up @@ -2389,18 +2389,18 @@ namespace AirflowNetwork {
// .or. &
// Util::SameString(MultizoneZoneData(i)%VentControl,'ASHRAE55Adaptive') .or. &
// Util::SameString(MultizoneZoneData(i)%VentControl,'CEN15251Adaptive')) then
if (MultizoneZoneData(i).VentSchName.empty()) {
if (MultizoneZoneData(i).VentTempControlSchName.empty()) {
ShowSevereEmptyField(m_state, eoh, cAlphaFields(3), cAlphaFields(2), Alphas(2));
ErrorsFound = true;
} else if ((MultizoneZoneData(i).ventSched = Sched::GetSchedule(m_state, MultizoneZoneData(i).VentSchName)) == nullptr) {
} else if ((MultizoneZoneData(i).ventTempControlSched = Sched::GetSchedule(m_state, MultizoneZoneData(i).VentTempControlSchName)) == nullptr) {
ShowSevereItemNotFound(m_state, eoh, cAlphaFields(3), Alphas(3));
ErrorsFound = true;
}
} else {
MultizoneZoneData(i).ventSched = Sched::GetScheduleAlwaysOff(m_state);
if (!MultizoneZoneData(i).VentSchName.empty()) {
MultizoneZoneData(i).ventTempControlSched = nullptr;
if (!MultizoneZoneData(i).VentTempControlSchName.empty()) {
ShowWarningNonEmptyField(m_state, eoh, cAlphaFields(3), cAlphaFields(2), Alphas(2));
MultizoneZoneData(i).VentSchName = std::string();
MultizoneZoneData(i).VentTempControlSchName = std::string();
}
}
if (MultizoneZoneData(i).OpenFactor > 1.0 || MultizoneZoneData(i).OpenFactor < 0.0) {
Expand Down Expand Up @@ -2677,7 +2677,7 @@ namespace AirflowNetwork {
// or "ADJACENTENTHALPY"
if (!lAlphaBlanks(4)) MultizoneSurfaceData(i).VentControl = Alphas(4);
// Name of ventilation temperature control schedule
if (!lAlphaBlanks(5)) MultizoneSurfaceData(i).VentSchName = Alphas(5);
if (!lAlphaBlanks(5)) MultizoneSurfaceData(i).VentTempControlSchName = Alphas(5);
{
// This SELECT_CASE_var will go on input refactor, no need to fix
auto const SELECT_CASE_var(Util::makeUPPER(MultizoneSurfaceData(i).VentControl));
Expand Down Expand Up @@ -2728,7 +2728,7 @@ namespace AirflowNetwork {
if (MultizoneSurfaceData(i).VentSurfCtrNum < 4 || MultizoneSurfaceData(i).VentSurfCtrNum == VentControlType::AdjTemp ||
MultizoneSurfaceData(i).VentSurfCtrNum == VentControlType::AdjEnth) {
if (!lAlphaBlanks(6)) {
MultizoneSurfaceData(i).VentingSchName = Alphas(6); // Name of ventilation availability schedule
MultizoneSurfaceData(i).VentAvailSchName = Alphas(6); // Name of ventilation availability schedule
}
}
if (!lAlphaBlanks(7)) {
Expand Down Expand Up @@ -3200,26 +3200,26 @@ namespace AirflowNetwork {
MultizoneSurfaceData(i).IndVentControl = true;
}

if (MultizoneSurfaceData(i).VentingSchName.empty()) {
MultizoneSurfaceData(i).ventingSched = Sched::GetScheduleAlwaysOn(m_state);
} else if ((MultizoneSurfaceData(i).ventingSched = Sched::GetSchedule(m_state, MultizoneSurfaceData(i).VentingSchName)) == nullptr) {
ShowSevereItemNotFound(m_state, eoh, "Venting Schedule", MultizoneSurfaceData(i).VentingSchName);
if (MultizoneSurfaceData(i).VentAvailSchName.empty()) {
MultizoneSurfaceData(i).ventAvailSched = Sched::GetScheduleAlwaysOn(m_state);
} else if ((MultizoneSurfaceData(i).ventAvailSched = Sched::GetSchedule(m_state, MultizoneSurfaceData(i).VentAvailSchName)) == nullptr) {
ShowSevereItemNotFound(m_state, eoh, "Venting Schedule", MultizoneSurfaceData(i).VentAvailSchName);
ErrorsFound = true;
} else if (m_state.dataSurface->Surface(MultizoneSurfaceData(i).SurfNum).IsAirBoundarySurf) {
ShowWarningNonEmptyField(m_state, eoh, "Venting Availbility Schedule");
ShowContinueError(m_state, "Venting is always available for air-boundary surfaces.");
MultizoneSurfaceData(i).ventingSched = Sched::GetScheduleAlwaysOn(m_state);
MultizoneSurfaceData(i).VentingSchName = "";
MultizoneSurfaceData(i).ventAvailSched = Sched::GetScheduleAlwaysOn(m_state);
MultizoneSurfaceData(i).VentAvailSchName = "";
}

switch (MultizoneSurfaceData(i).VentSurfCtrNum) {
case VentControlType::Temp:
case VentControlType::AdjTemp: {
if (MultizoneSurfaceData(i).VentSchName.empty()) {
if (MultizoneSurfaceData(i).VentTempControlSchName.empty()) {
ShowSevereEmptyField(m_state, eoh, "Ventilation Schedule", "Ventinlation Control", "Temperature");
ErrorsFound = true;
} else if ((MultizoneSurfaceData(i).ventSched = Sched::GetSchedule(m_state, MultizoneSurfaceData(i).VentSchName)) == nullptr) {
ShowSevereItemNotFound(m_state, eoh, "Ventilation Schedule", MultizoneSurfaceData(i).VentSchName);
} else if ((MultizoneSurfaceData(i).ventTempControlSched = Sched::GetSchedule(m_state, MultizoneSurfaceData(i).VentTempControlSchName)) == nullptr) {
ShowSevereItemNotFound(m_state, eoh, "Ventilation Schedule", MultizoneSurfaceData(i).VentTempControlSchName);
ErrorsFound = true;
}
if (MultizoneSurfaceData(i).LowValueTemp < 0.0) {
Expand All @@ -3245,13 +3245,14 @@ namespace AirflowNetwork {
}

} break;

case VentControlType::Enth:
case VentControlType::AdjEnth: {
if (MultizoneSurfaceData(i).VentSchName.empty()) {
if (MultizoneSurfaceData(i).VentTempControlSchName.empty()) {
ShowSevereEmptyField(m_state, eoh, "Ventilation Schedule", "Ventilation Control", "Enthalpy");
ErrorsFound = true;
} else if ((MultizoneSurfaceData(i).ventSched = Sched::GetSchedule(m_state, MultizoneSurfaceData(i).VentSchName)) == nullptr) {
ShowSevereItemNotFound(m_state, eoh, "Ventilation Schedule", MultizoneSurfaceData(i).VentSchName);
} else if ((MultizoneSurfaceData(i).ventTempControlSched = Sched::GetSchedule(m_state, MultizoneSurfaceData(i).VentTempControlSchName)) == nullptr) {
ShowSevereItemNotFound(m_state, eoh, "Ventilation Schedule", MultizoneSurfaceData(i).VentTempControlSchName);
ErrorsFound = true;
}
if (MultizoneSurfaceData(i).LowValueEnth < 0.0) {
Expand Down Expand Up @@ -3283,8 +3284,8 @@ namespace AirflowNetwork {
case VentControlType::CEN15251:
case VentControlType::NoVent:
case VentControlType::ZoneLevel: {
MultizoneSurfaceData(i).ventSched = Sched::GetScheduleAlwaysOff(m_state);
MultizoneSurfaceData(i).VentSchName = "";
MultizoneSurfaceData(i).ventTempControlSched = nullptr;
MultizoneSurfaceData(i).VentTempControlSchName = "";
} break;
default:
break;
Expand Down Expand Up @@ -9879,21 +9880,21 @@ namespace AirflowNetwork {
// Note in the following that individual venting control for a window/door takes
// precedence over zone-level control
if (MultizoneSurfaceData(i).IndVentControl) {
VentTemp = MultizoneSurfaceData(i).ventSched->getCurrentVal();
VentTemp = MultizoneSurfaceData(i).ventTempControlSched->getCurrentVal();
VentCtrlNum = MultizoneSurfaceData(i).VentSurfCtrNum;
if (MultizoneSurfaceData(i).ventingSched != nullptr) {
VentingSchVal = MultizoneSurfaceData(i).ventingSched->getCurrentVal();
if (MultizoneSurfaceData(i).ventAvailSched != nullptr) {
VentingSchVal = MultizoneSurfaceData(i).ventAvailSched->getCurrentVal();
if (VentingSchVal <= 0.0) {
VentingAllowed = false;
m_state.dataSurface->SurfWinVentingAvailabilityRep(SurfNum) = 0.0;
}
}
} else {
// Zone level only by Gu on Nov. 8, 2005
VentTemp = MultizoneZoneData(IZ).ventSched->getCurrentVal();
VentTemp = MultizoneZoneData(IZ).ventTempControlSched ? MultizoneZoneData(IZ).ventTempControlSched->getCurrentVal() : 0.0;
VentCtrlNum = MultizoneZoneData(IZ).VentCtrNum;
if (MultizoneZoneData(IZ).ventingSched != nullptr) {
VentingSchVal = MultizoneZoneData(IZ).ventingSched->getCurrentVal();
if (MultizoneZoneData(IZ).ventAvailSched != nullptr) {
VentingSchVal = MultizoneZoneData(IZ).ventAvailSched->getCurrentVal();
if (VentingSchVal <= 0.0) {
VentingAllowed = false;
m_state.dataSurface->SurfWinVentingAvailabilityRep(SurfNum) = 0.0;
Expand Down
6 changes: 3 additions & 3 deletions src/EnergyPlus/BaseboardElectric.cc
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ namespace BaseboardElectric {
thisBaseboard.EquipType = Util::makeUPPER(cCurrentModuleObject); // the type of baseboard-rename change
thisBaseboard.Schedule = s_ipsc->cAlphaArgs(2);
if (s_ipsc->lAlphaFieldBlanks(2)) {
thisBaseboard.sched = Sched::GetScheduleAlwaysOn(state);
} else if ((thisBaseboard.sched = Sched::GetSchedule(state, s_ipsc->cAlphaArgs(2))) == nullptr) {
thisBaseboard.availSched = Sched::GetScheduleAlwaysOn(state);
} else if ((thisBaseboard.availSched = Sched::GetSchedule(state, s_ipsc->cAlphaArgs(2))) == nullptr) {
ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(2), s_ipsc->cAlphaArgs(2));
ErrorsFound = true;
}
Expand Down Expand Up @@ -507,7 +507,7 @@ namespace BaseboardElectric {
// thermal loss that could be accounted for with this efficiency input.
Real64 Effic = baseboard.BaseboardEfficiency;

if (baseboard.sched->getCurrentVal() > 0.0 && LoadMet >= HVAC::SmallLoad) {
if (baseboard.availSched->getCurrentVal() > 0.0 && LoadMet >= HVAC::SmallLoad) {

// if the load exceeds the capacity than the capacity is set to the BB limit.
if (LoadMet > baseboard.NominalCapacity) {
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/BaseboardElectric.hh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace BaseboardElectric {
std::string EquipName;
std::string EquipType;
std::string Schedule;
Sched::Schedule *sched = nullptr;
Sched::Schedule *availSched = nullptr;
Real64 NominalCapacity = 0.0;
Real64 BaseboardEfficiency = 0.0;
Real64 AirInletTemp = 0.0;
Expand Down
6 changes: 3 additions & 3 deletions src/EnergyPlus/BaseboardRadiator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ namespace BaseboardRadiator {
thisBaseboard.EquipType = DataPlant::PlantEquipmentType::Baseboard_Conv_Water;
thisBaseboard.Schedule = s_ipsc->cAlphaArgs(2);
if (s_ipsc->lAlphaFieldBlanks(2)) {
thisBaseboard.sched = Sched::GetScheduleAlwaysOn(state);
} else if ((thisBaseboard.sched = Sched::GetSchedule(state, s_ipsc->cAlphaArgs(2))) == nullptr) {
thisBaseboard.availSched = Sched::GetScheduleAlwaysOn(state);
} else if ((thisBaseboard.availSched = Sched::GetSchedule(state, s_ipsc->cAlphaArgs(2))) == nullptr) {
ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(2), s_ipsc->cAlphaArgs(2));
ErrorsFound = true;
}
Expand Down Expand Up @@ -1024,7 +1024,7 @@ namespace BaseboardRadiator {
CapacitanceAir = CpAir * AirMassFlowRate;

if (QZnReq > SmallLoad && (!state.dataZoneEnergyDemand->CurDeadBandOrSetback(ZoneNum) || baseboard->baseboards(BaseboardNum).MySizeFlag) &&
(baseboard->baseboards(BaseboardNum).sched->getCurrentVal() > 0 || baseboard->baseboards(BaseboardNum).MySizeFlag) &&
(baseboard->baseboards(BaseboardNum).availSched->getCurrentVal() > 0 || baseboard->baseboards(BaseboardNum).MySizeFlag) &&
(WaterMassFlowRate > 0.0)) {
CapacitanceWater = CpWater * WaterMassFlowRate;
CapacitanceMax = max(CapacitanceAir, CapacitanceWater);
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/BaseboardRadiator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace BaseboardRadiator {
// Members
std::string EquipID;
std::string Schedule;
Sched::Schedule *sched = nullptr;
Sched::Schedule *availSched = nullptr;
DataPlant::PlantEquipmentType EquipType = DataPlant::PlantEquipmentType::Invalid;
int ZonePtr = 0;
int WaterInletNode = 0;
Expand Down
Loading

0 comments on commit dfc8545

Please sign in to comment.