Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into Glo…
Browse files Browse the repository at this point in the history
…balHVACManager
  • Loading branch information
dareumnam committed Mar 17, 2021
2 parents 6b764f5 + 1adc6b7 commit e36bb06
Show file tree
Hide file tree
Showing 13 changed files with 149 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,17 @@ \subsubsection{Zone Return Air Node 1}\label{zone-return-air-node1}
{\dot m_{R,1}} = ReturnFlowSchedule*{\dot m_{R}}
\end{equation}

The zone air mass flow conservation calculation limits the zone the return node air flow rate with air loop design supply to protect from large number the solution may throw as follows:
In the zone air mass flow conservation calculation, the calculated zone total return flow rate is modified using return node flow schedule value when the zone air flow balancing is enforced and assigned to return node 1.

\begin{equation}
{\dot m_{R,1}} = MIN\left( {{\dot m_{R,1}},\,{{\dot m}_{DesSupply,i}}} \right)
{\dot m_{R,1}} = ReturnFlowSchedule*{\dot m_{R}}
\end{equation}


The zone air mass flow conservation calculation also limits the zone return node air flow rate with air loop design supply to protect from large number the solution may throw as follows:

\begin{equation}
{\dot m_{R,1}} = MIN\left( {{\dot m_{R,1}},\,{{\dot m}_{DesSupply,i}}} \right)
\end{equation}

\subsubsection{Allocation to Multiple Return Nodes}\label{allocation-to-multiple-return-nodes}

Expand All @@ -75,11 +80,18 @@ \subsubsection{Allocation to Multiple Return Nodes}\label{allocation-to-multiple
{\dot m_{R,i}} = {\dot m_{R,i}}
\end{equation}

The zone air mass flow conservation calculation limits the zone the return node air flow rate with air loop design supply to protect from large number the solution may throw as follows:
In the zone air mass flow conservation calculation, the calculated zone total return flow rate is distributed to the zone return nodes proportional to the return nodes current mass flow rates as follows:

\begin{equation}
{\dot m_{R,i,}} = {\dot m_{R,i}} * \left(\frac{ReturnFlowSchedule*{\dot m_{R}}} {\sum\nolimits_{i} {{{\dot m}_{R,i}}}} \right)
\end{equation}

The zone air mass flow conservation calculation also limits the zone return node air flow rate with air loop design supply to protect from large number the solution may throw as follows:

\begin{equation}
{\dot m_{R,1}} = MIN\left( {{\dot m_{R,1}},\,{{\dot m}_{DesSupply, AirLoop}}} \right)
\end{equation}


\subsubsection{Overall Return Air Balance}\label{overall-return-air-balance}

Expand Down Expand Up @@ -178,7 +190,7 @@ \subsection{Zone Mixing Flow Rate Calculations}\label{zone-mixing-flow-rate-calc
\end{equation}

Zone air mass flow balance can be enforced using four options: \textit{AdjustMixingOnly}, \textit{AdjustReturnOnly}, \textit{AdjustMixingThenReturn}, or \textit{AdjustReturnThenMixing}. These options involve either adjusting zone mixing objects flows, adjusting the zone total return air flows, or a
combination of both. The zone air mass flow balance equation formulation is described next for each of the four options.
combination of both. The zone air mass flow balance equation formulation for each of the four options is described next.

\textbf{AdjustMixingOnly:} adjusts the zone mixing object flows only to enforce zone air mass flow balance and the adjusted zone mixing mass flow rates are used to determine the zone total return air mass flow rate. Infiltration air flow can also adjusted if required depending on user preference as specified in Section \textit{Infiltration Flow rates Adjustments}.

Expand Down Expand Up @@ -206,7 +218,7 @@ \subsection{Zone Mixing Flow Rate Calculations}\label{zone-mixing-flow-rate-calc
{\dot m_{XR}} = \sum\nolimits_j {{{\dot m}_{XR,j}}}
\end{equation}

If ZoneAirMassFlowConservation is active, then determine the total zone return air flow rate:
If ZoneAirMassFlowConservation is active, then determine the zone total return air flow rate:
\begin{equation}
{\dot m_{R}} = MAX\left( {0.0,\,{{\dot m}_S} - {{\dot m}_{EX,tot}} + [{{\dot m}_{XR}} - {{\dot m}_{XS}}]} \right)
\end{equation}
Expand All @@ -218,7 +230,7 @@ \subsection{Zone Mixing Flow Rate Calculations}\label{zone-mixing-flow-rate-calc

\textbf{AdjustMixingThenReturn:} first adjusts the zone mixing air mass flow rates, then adjusts the zone total return air mass flow rate to enforce zone air mass flow balance. Infiltration air flow can also adjusted if required depending on user preference as specified in section \textit{Infiltration Flow rates Adjustments}. For adjusting the mixing mass flow rates the set of equations for \textit{AdjustMixingOnly} method described above are used and for adjusting the zone total return air mass flow rate the equation for \textit{AdjustReturnOnly} method is used.

\textbf{AdjustReturnThenMixing:} first adjusts the zone total return air mass flow rate, then adjusts the zone mixing mass flow rates to enforce zone air mass flow balance. Infiltration air flow can also adjusted if required depending on user preference as specified in section \textit{Infiltration Flow rates Adjustments}. For adjusting the zone total return air mass flow rates the equations for \textit{AdjustReturnOnly} method described above is used and for adjusting the zone mixing mass flow rates the set of equations for \textit{AdjustMixingOnly} method are used.
\textbf{AdjustReturnThenMixing:} first adjusts the zone total return air mass flow rate, then adjusts the zone mixing mass flow rates to enforce zone air mass flow balance. Infiltration air flow can also adjusted if required depending on user preference as specified in section \textit{Infiltration Flow rates Adjustments}. For adjusting the zone total return air mass flow rate the equation for \textit{AdjustReturnOnly} method described above is used and for adjusting the zone mixing mass flow rates the set of equations defined for \textit{AdjustMixingOnly} method are used.

\subsection{Infiltration Flow Rate Adjustments}\label{infiltration-flow-rate-adjustments}

Expand Down
21 changes: 10 additions & 11 deletions src/EnergyPlus/DataHeatBalance.hh
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,14 @@ namespace DataHeatBalance {
constexpr int MixingSourceZonesOnly(1);
constexpr int AllZones(2);

// Parameter for zone air flow mass balancing method
constexpr int AdjustMixingOnly(1);
constexpr int AdjustReturnOnly(2);
constexpr int AdjustMixingThenReturn(3);
constexpr int AdjustReturnThenMixing(4);
constexpr int NoAdjustReturnAndMixing(0);

enum class AdjustmentType {
// zone air flow balancing method
AdjustMixingOnly,
AdjustReturnOnly,
AdjustMixingThenReturn,
AdjustReturnThenMixing,
NoAdjustReturnAndMixing
};
constexpr int NumZoneIntGainDeviceTypes(54);

extern Array1D_string const ZoneIntGainDeviceTypes;
Expand Down Expand Up @@ -1050,17 +1051,15 @@ namespace DataHeatBalance {
{
// Members
bool EnforceZoneMassBalance; // flag to enforce zone air mass conservation
int ZoneFlowAdjustment; // specifies how zone air flow balance is determined (AdjustMixingOnly, AdjustReturnOnly, AdjustMixingThenReturn,
// AdjustReturnThenMixing, None)
AdjustmentType ZoneFlowAdjustment; // determines how zone air flow is adjusted (AdjustMixingOnly, AdjustReturnOnly, AdjustMixingThenReturn, AdjustReturnThenMixing, None) int InfiltrationTreatment; // determines how infiltration is treated for zone mass balance
int InfiltrationTreatment; // determines how infiltration is treated for zone mass balance
int InfiltrationZoneType; // specifies which types of zones allow infiltration to be changed
bool AdjustZoneMixingFlow; // used to adjust zone mixing air flows to enforce air flow balance
bool AdjustZoneInfiltrationFlow; // used to adjust zone infiltration air flows to enforce air flow balance
// Note, unique global object

// Default Constructor
ZoneAirMassFlowConservation()
: EnforceZoneMassBalance(false), ZoneFlowAdjustment(0), InfiltrationTreatment(0), InfiltrationZoneType(0), AdjustZoneMixingFlow(false), AdjustZoneInfiltrationFlow(false)
ZoneAirMassFlowConservation() : EnforceZoneMassBalance(false), ZoneFlowAdjustment(AdjustmentType::NoAdjustReturnAndMixing), InfiltrationTreatment(0), InfiltrationZoneType(0), AdjustZoneMixingFlow(false), AdjustZoneInfiltrationFlow(false)
{
}
};
Expand Down
3 changes: 2 additions & 1 deletion src/EnergyPlus/DataZoneEquipment.hh
Original file line number Diff line number Diff line change
Expand Up @@ -291,14 +291,15 @@ namespace DataZoneEquipment {
bool ZoneHasAirLoopWithOASys; // true if zone is served by one or more airloops with an outdoor air system
int ZoneAirDistributionIndex; // index to DesignSpecification:ZoneAirDistribution object
int ZoneDesignSpecOAIndex; // index to DesignSpecification:OutdoorAir object
Real64 AirLoopDesSupply; // air lood design supply air flow rate [kg/s]

// Default Constructor
EquipConfiguration()
: ZoneName("Uncontrolled Zone"), ActualZoneNum(0), EquipListIndex(0), ZoneNode(0), NumInletNodes(0), NumExhaustNodes(0),
NumReturnNodes(0), NumReturnFlowBasisNodes(0), ReturnFlowSchedPtrNum(0), FlowError(false), ZonalSystemOnly(false), IsControlled(false),
ZoneExh(0.0), ZoneExhBalanced(0.0), PlenumMassFlow(0.0), ExcessZoneExh(0.0), TotAvailAirLoopOA(0.0), TotInletAirMassFlowRate(0.0),
TotExhaustAirMassFlowRate(0.0), InFloorActiveElement(false), InWallActiveElement(false), InCeilingActiveElement(false),
ZoneHasAirFlowWindowReturn(false), ZoneHasAirLoopWithOASys(false), ZoneAirDistributionIndex(0), ZoneDesignSpecOAIndex(0)
ZoneHasAirFlowWindowReturn(false), ZoneHasAirLoopWithOASys(false), ZoneAirDistributionIndex(0), ZoneDesignSpecOAIndex(0), AirLoopDesSupply(0.0)
{
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/Fans.cc
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ namespace EnergyPlus::Fans {

if (NumAlphas > 8 && !lAlphaFieldBlanks(9)) {

if (state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment != DataHeatBalance::NoAdjustReturnAndMixing) {
if (state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment != DataHeatBalance::AdjustmentType::NoAdjustReturnAndMixing) {
// do not include adjusted for "balanced" exhaust flow in the zone total return calculation
ShowWarningError(state,
RoutineName + cCurrentModuleObject + ": invalid " + cAlphaFieldNames(9) + " = " + cAlphaArgs(9) +
Expand Down
1 change: 0 additions & 1 deletion src/EnergyPlus/HeatBalFiniteDiffManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ namespace HeatBalFiniteDiffManager {
using HeatBalanceMovableInsulation::EvalOutsideMovableInsulation;

// MODULE PARAMETER DEFINITIONS:
constexpr Real64 Lambda(2500000.0);
constexpr Real64 smalldiff(1.e-8); // Used in places where "equality" tests should not be used.

constexpr int CrankNicholsonSecondOrder(1); // original CondFD scheme. semi implicit, second order in time
Expand Down
6 changes: 3 additions & 3 deletions src/EnergyPlus/HeatBalanceAirManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ namespace EnergyPlus::HeatBalanceAirManager {
// PURPOSE OF THIS SUBROUTINE :
// This subroutine sets the zone mass conservation flag to true.

if (state.dataHeatBal->ZoneAirMassFlow.EnforceZoneMassBalance && state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment != DataHeatBalance::NoAdjustReturnAndMixing) {
if (state.dataHeatBal->ZoneAirMassFlow.EnforceZoneMassBalance && state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment != DataHeatBalance::AdjustmentType::NoAdjustReturnAndMixing) {
for (int Loop = 1; Loop <= state.dataHeatBal->TotMixing; ++Loop) {
state.dataHeatBalFanSys->ZoneMassBalanceFlag(state.dataHeatBal->Mixing(Loop).ZonePtr) = true;
state.dataHeatBalFanSys->ZoneMassBalanceFlag(state.dataHeatBal->Mixing(Loop).FromZone) = true;
Expand Down Expand Up @@ -3762,7 +3762,7 @@ namespace EnergyPlus::HeatBalanceAirManager {
if (state.dataHeatBal->ZoneAirMassFlow.EnforceZoneMassBalance) {
// Check for infiltration in zone which are only a mixing source zone
for (ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) {
if ((state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment != DataHeatBalance::NoAdjustReturnAndMixing && state.dataHeatBal->MassConservation(ZoneNum).IsOnlySourceZone) &&
if ((state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment != DataHeatBalance::AdjustmentType::NoAdjustReturnAndMixing && state.dataHeatBal->MassConservation(ZoneNum).IsOnlySourceZone) &&
(state.dataHeatBal->ZoneAirMassFlow.InfiltrationTreatment != DataHeatBalance::NoInfiltrationFlow)) {
if (state.dataHeatBal->MassConservation(ZoneNum).InfiltrationPtr == 0) {
ShowSevereError(state, RoutineName + ": Infiltration object is not defined for zone = " + state.dataHeatBal->Zone(ZoneNum).Name);
Expand Down Expand Up @@ -3790,7 +3790,7 @@ namespace EnergyPlus::HeatBalanceAirManager {
"System",
"Average",
state.dataHeatBal->Zone(ZoneNum).Name);
if ((state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment != DataHeatBalance::NoAdjustReturnAndMixing) &&
if ((state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment != DataHeatBalance::AdjustmentType::NoAdjustReturnAndMixing) &&
((state.dataHeatBal->MassConservation(ZoneNum).NumSourceZonesMixingObject + state.dataHeatBal->MassConservation(ZoneNum).NumReceivingZonesMixingObject) > 0)) {
SetupOutputVariable(state, "Zone Air Mass Balance Mixing Receiving Mass Flow Rate",
OutputProcessor::Unit::kg_s,
Expand Down
14 changes: 7 additions & 7 deletions src/EnergyPlus/HeatBalanceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1222,31 +1222,31 @@ namespace HeatBalanceManager {
{
auto const SELECT_CASE_var(AlphaName(1));
if (SELECT_CASE_var == "ADJUSTMIXINGONLY") {
state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment = AdjustMixingOnly;
state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment = AdjustmentType::AdjustMixingOnly;
state.dataHeatBal->ZoneAirMassFlow.EnforceZoneMassBalance = true;
AlphaName(1) = "AdjustMixingOnly";
} else if (SELECT_CASE_var == "ADJUSTRETURNONLY") {
state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment = AdjustReturnOnly;
state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment = AdjustmentType::AdjustReturnOnly;
state.dataHeatBal->ZoneAirMassFlow.EnforceZoneMassBalance = true;
AlphaName(1) = "AdjustReturnOnly";
} else if (SELECT_CASE_var == "ADJUSTMIXINGTHENRETURN") {
state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment = AdjustMixingThenReturn;
state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment = AdjustmentType::AdjustMixingThenReturn;
state.dataHeatBal->ZoneAirMassFlow.EnforceZoneMassBalance = true;
AlphaName(1) = "AdjustMixingThenReturn";
} else if (SELECT_CASE_var == "ADJUSTRETURNTHENMIXING") {
state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment = AdjustReturnThenMixing;
state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment = AdjustmentType::AdjustReturnThenMixing;
state.dataHeatBal->ZoneAirMassFlow.EnforceZoneMassBalance = true;
AlphaName(1) = "AdjustReturnThenMixing";
} else if (SELECT_CASE_var == "NONE") {
state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment = NoAdjustReturnAndMixing;
state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment = AdjustmentType::NoAdjustReturnAndMixing;
AlphaName(1) = "None";
} else {
state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment = NoAdjustReturnAndMixing;
state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment = AdjustmentType::NoAdjustReturnAndMixing;
AlphaName(1) = "None";
ShowWarningError(state, CurrentModuleObject + ": Invalid input of " + cAlphaFieldNames(1) + ". The default choice is assigned = None");
}
}
if (state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment != DataHeatBalance::NoAdjustReturnAndMixing) state.dataHeatBal->ZoneAirMassFlow.AdjustZoneMixingFlow = true;
if (state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment != DataHeatBalance::AdjustmentType::NoAdjustReturnAndMixing) state.dataHeatBal->ZoneAirMassFlow.AdjustZoneMixingFlow = true;
}
if (NumAlpha > 1) {
{
Expand Down
11 changes: 11 additions & 0 deletions src/EnergyPlus/SimAirServingZones.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2100,6 +2100,17 @@ namespace EnergyPlus::SimAirServingZones {
state.dataAirLoop->AirLoopFlow(AirLoopNum).SysToZoneDesFlowRatio = 1.0;
}
}

for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) {
if (!state.dataZoneEquip->ZoneEquipConfig(ZoneNum).IsControlled) continue;
// sets design supply air flow rate in the ZoneEquipConfig struct for use with zone air mass balance
for (int returnNum = 1; returnNum <= state.dataZoneEquip->ZoneEquipConfig(ZoneNum).NumReturnNodes; ++returnNum) {
int airLoop = state.dataZoneEquip->ZoneEquipConfig(ZoneNum).ReturnNodeAirLoopNum(returnNum);
if (airLoop > 0) {
state.dataZoneEquip->ZoneEquipConfig(ZoneNum).AirLoopDesSupply = state.dataAirLoop->AirLoopFlow(airLoop).DesSupply;
}
}
}
}

// Do the Begin Environment initializations
Expand Down
Loading

1 comment on commit e36bb06

@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.

GlobalHVACManager (dareumnam) - x86_64-MacOS-10.15-clang-11.0.0: Tests Failed (0 of 0 tests passed, 0 test warnings)

Build Badge Test Badge

Please sign in to comment.