Skip to content

Commit

Permalink
Merge branch 'develop' into fix_nocache_psychrometrics
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchute committed Nov 19, 2020
2 parents abff040 + 36b8851 commit 9924a3f
Show file tree
Hide file tree
Showing 173 changed files with 3,705 additions and 4,477 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ \subsubsection{Interior Solar Radiation Absorbed by Opaque Surfaces}\label{inter

\begin{equation}
\begin{array}{l}
QD(ZoneNum) = DBZone(ZoneNum)*BeamSolarRad \\
QD(ZoneNum) = EnclSolDB(ZoneNum)*BeamSolarRad \\
\quad \quad \quad + InitialDifSolDistReflectedW(ZoneNum)
\end{array}
\end{equation}
Expand All @@ -632,14 +632,14 @@ \subsubsection{Interior Solar Radiation Absorbed by Opaque Surfaces}\label{inter

\emph{BeamSolarRad} is the outside beam normal solar irradiance {[}W/m\(^{2}\){]}

\emph{DBZone(ZoneNum)} is the diffuse solar radiation originating from beam solar that passes through the exterior windows in the zone and reflects diffusely from inside zone surfaces plus beam solar entering the zone as diffuse radiation from windows with shading devices or diffusing glass (all divided by BeamSolarRad)~~ {[}m\(^{2}\){]}
\emph{EnclSolDB(ZoneNum)} is the diffuse solar radiation originating from beam solar that passes through the exterior windows in the zone and reflects diffusely from inside zone surfaces plus beam solar entering the zone as diffuse radiation from windows with shading devices or diffusing glass (all divided by BeamSolarRad)~~ {[}m\(^{2}\){]}

\emph{InitialDifSolDistReflectedW(ZoneNum)} is the diffuse solar radiation originating from sky and sun related diffuse solar transmitted through the zone's exterior or interior windows into the zone, and reflected diffusely from inside zone surfaces.

\emph{DBZone(ZoneNum)} is calculated as:
\emph{EnclSolDB(ZoneNum)} is calculated as:

\begin{equation}
DBZone(ZoneNum) = BTOTZone - BABSZone{\rm{ [}}{{\rm{m}}^{\rm{2}}}]
EnclSolDB(ZoneNum) = BTOTZone - BABSZone{\rm{ [}}{{\rm{m}}^{\rm{2}}}]
\end{equation}

where
Expand Down
3 changes: 1 addition & 2 deletions src/EnergyPlus/AirLoopHVACDOAS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ namespace AirLoopHVACDOAS {
void AirLoopDOAS::getAirLoopDOASInput(EnergyPlusData &state)
{

using DataAirSystems::PrimaryAirSystem;
using ScheduleManager::GetScheduleIndex;

bool errorsFound(false);
Expand Down Expand Up @@ -755,7 +754,7 @@ namespace AirLoopHVACDOAS {
int num = 0;
for (auto AirLoopHAVCName : AirLoopArray) {
std::string name = AirLoopHAVCName.at("airloophvac_name");
int LoopNum = UtilityRoutines::FindItemInList(name, PrimaryAirSystem);
int LoopNum = UtilityRoutines::FindItemInList(name, state.dataAirSystemsData->PrimaryAirSystems);
num += 1;
if (LoopNum > 0 && num <= thisDOAS.NumOfAirLoops) {
thisDOAS.AirLoopName.push_back(name);
Expand Down
2 changes: 0 additions & 2 deletions src/EnergyPlus/AirflowNetwork/src/Solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ namespace AirflowNetwork {

int const NrInt(20); // Number of intervals for a large opening

static std::string const BlankString;

// Common block AFEDAT
Array1D<Real64> AFECTL;
Array1D<Real64> AFLOW2;
Expand Down
110 changes: 53 additions & 57 deletions src/EnergyPlus/AirflowNetworkBalanceManager.cc

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/EnergyPlus/Autosizing/Base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void BaseSizer::initializeWithinEP(EnergyPlusData &state,
this->sysSizingInputData = DataSizing::SysSizInput;
this->finalSysSizing = DataSizing::FinalSysSizing;
this->plantSizData = DataSizing::PlantSizData;
this->primaryAirSystem = DataAirSystems::PrimaryAirSystem;
this->primaryAirSystem = state.dataAirSystemsData->PrimaryAirSystems;
this->airLoopControlInfo = state.dataAirLoop->AirLoopControlInfo;
this->airloopDOAS = state.dataAirLoopHVACDOAS->airloopDOAS;
if (EnergyPlus::BaseSizer::isValidCoilType(this->compType)) { // coil reports fail if compType is not one of DataHVACGlobals::cAllCoilTypes
Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/BoilerSteam.cc
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ namespace BoilerSteam {
void BoilerSpecs::calculate(EnergyPlusData &state,
Real64 &MyLoad, // W - hot water demand to be met by boiler
bool const RunFlag, // TRUE if boiler operating
int const EquipFlowCtrl // Flow control mode for the equipment
DataBranchAirLoopPlant::ControlTypeEnum const EquipFlowCtrl // Flow control mode for the equipment
)
{
// SUBROUTINE INFORMATION:
Expand Down Expand Up @@ -596,7 +596,7 @@ namespace BoilerSteam {
// if the component control is SERIESACTIVE we set the component flow to inlet flow so that flow resolver
// will not shut down the branch
if (MyLoad <= 0.0 || !RunFlag) {
if (EquipFlowCtrl == DataBranchAirLoopPlant::ControlType_SeriesActive)
if (EquipFlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive)
this->BoilerMassFlowRate = DataLoopNode::Node(this->BoilerInletNodeNum).MassFlowRate;
return;
}
Expand Down
3 changes: 2 additions & 1 deletion src/EnergyPlus/BoilerSteam.hh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@

// EnergyPlus Headers
#include <EnergyPlus/Data/BaseData.hh>
#include <EnergyPlus/DataBranchAirLoopPlant.hh>
#include <EnergyPlus/DataGlobals.hh>
#include <EnergyPlus/EnergyPlus.hh>
#include <EnergyPlus/PlantComponent.hh>
Expand Down Expand Up @@ -132,7 +133,7 @@ namespace BoilerSteam {
void calculate(EnergyPlusData &state,
Real64 &MyLoad, // W - hot water demand to be met by boiler
bool RunFlag, // TRUE if boiler operating
int EquipFlowCtrl // Flow control mode for the equipment
DataBranchAirLoopPlant::ControlTypeEnum EquipFlowCtrl // Flow control mode for the equipment
);

void update(Real64 MyLoad, // boiler operating load
Expand Down
20 changes: 8 additions & 12 deletions src/EnergyPlus/Boilers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@
#include <EnergyPlus/PlantUtilities.hh>
#include <EnergyPlus/UtilityRoutines.hh>

namespace EnergyPlus {

namespace Boilers {
namespace EnergyPlus::Boilers {

// Module containing the routines dealing with the Boilers

Expand Down Expand Up @@ -164,7 +162,7 @@ namespace Boilers {
// standard EnergyPlus input retrieval using input Processor

// Locals
static std::string const RoutineName("GetBoilerInput: ");
constexpr auto RoutineName("GetBoilerInput: ");

// LOCAL VARIABLES
bool ErrorsFound(false); // Flag to show errors were found during GetInput
Expand Down Expand Up @@ -355,7 +353,7 @@ namespace Boilers {
}

if (ErrorsFound) {
ShowFatalError(state, RoutineName + "Errors found in processing " + DataIPShortCuts::cCurrentModuleObject + " input.");
ShowFatalError(state, format("{}{}", RoutineName, "Errors found in processing " + DataIPShortCuts::cCurrentModuleObject + " input."));
}
}

Expand Down Expand Up @@ -424,7 +422,7 @@ namespace Boilers {
// Uses the status flags to trigger initializations.

// SUBROUTINE PARAMETER DEFINITIONS:
static std::string const RoutineName("InitBoiler");
constexpr auto RoutineName("InitBoiler");

// Init more variables
if (this->MyFlag) {
Expand Down Expand Up @@ -549,7 +547,7 @@ namespace Boilers {
// the hot water flow rate and the hot water loop design delta T.

// SUBROUTINE PARAMETER DEFINITIONS:
static std::string const RoutineName("SizeBoiler");
constexpr auto RoutineName("SizeBoiler");

// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
bool ErrorsFound(false); // If errors detected in input
Expand Down Expand Up @@ -694,7 +692,7 @@ namespace Boilers {
void BoilerSpecs::CalcBoilerModel(EnergyPlusData &state,
Real64 const MyLoad, // W - hot water demand to be met by boiler
bool const RunFlag, // TRUE if boiler operating
int const EquipFlowCtrl // Flow control mode for the equipment
DataBranchAirLoopPlant::ControlTypeEnum const EquipFlowCtrl // Flow control mode for the equipment
)
{
// SUBROUTINE INFORMATION:
Expand All @@ -716,7 +714,7 @@ namespace Boilers {
// load performance

// SUBROUTINE PARAMETER DEFINITIONS:
static std::string const RoutineName("CalcBoilerModel");
constexpr auto RoutineName("CalcBoilerModel");

// clean up some operating conditions, may not be necessary
this->BoilerLoad = 0.0;
Expand All @@ -742,7 +740,7 @@ namespace Boilers {
// if the component control is SERIESACTIVE we set the component flow to inlet flow so that flow resolver
// will not shut down the branch
if (MyLoad <= 0.0 || !RunFlag) {
if (EquipFlowCtrl == DataBranchAirLoopPlant::ControlType_SeriesActive)
if (EquipFlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive)
this->BoilerMassFlowRate = DataLoopNode::Node(BoilerInletNode).MassFlowRate;
return;
}
Expand Down Expand Up @@ -951,6 +949,4 @@ namespace Boilers {
this->ParasiticElecConsumption = this->ParasiticElecPower * ReportingConstant;
}

} // namespace Boilers

} // namespace EnergyPlus
3 changes: 2 additions & 1 deletion src/EnergyPlus/Boilers.hh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#include <ObjexxFCL/Array1D.hh>

// EnergyPlus Headers
#include <EnergyPlus/DataBranchAirLoopPlant.hh>
#include <EnergyPlus/Data/BaseData.hh>
#include <EnergyPlus/Plant/DataPlant.hh>
#include <EnergyPlus/DataGlobals.hh>
Expand Down Expand Up @@ -168,7 +169,7 @@ namespace Boilers {
void CalcBoilerModel(EnergyPlusData &state,
Real64 MyLoad, // W - hot water demand to be met by boiler
bool RunFlag, // TRUE if boiler operating
int EquipFlowCtrl // Flow control mode for the equipment
DataBranchAirLoopPlant::ControlTypeEnum EquipFlowCtrl // Flow control mode for the equipment
);

void UpdateBoilerRecords(Real64 MyLoad, // boiler operating load
Expand Down
16 changes: 8 additions & 8 deletions src/EnergyPlus/BranchInputManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ namespace BranchInputManager {
void GetBranchData(EnergyPlusData &state,
std::string const &LoopName, // Loop Name of this Branch
std::string const &BranchName, // Requested Branch Name
int &PressCurveType, // Index of a pressure curve object
DataBranchAirLoopPlant::PressureCurveType &PressCurveType, // Index of a pressure curve object
int &PressCurveIndex, // Index of a pressure curve object
int &NumComps, // Number of Components on Branch
Array1D_string &CompType, // Component Type for each item on Branch
Expand Down Expand Up @@ -428,7 +428,7 @@ namespace BranchInputManager {
void GetInternalBranchData(EnergyPlusData &state,
std::string const &LoopName, // Loop Name for Branch
std::string const &BranchName, // Requested Branch Name
int &PressCurveType, // Index of pressure curve object
DataBranchAirLoopPlant::PressureCurveType &PressCurveType, // Index of pressure curve object
int &PressCurveIndex, // Index of pressure curve object
int &NumComps, // Number of Components on Branch
Array1D<ComponentData> &BComponents, // Component data returned
Expand Down Expand Up @@ -618,7 +618,7 @@ namespace BranchInputManager {
int Count; // Loop Counter
int Loop; // Loop Counter
int NumComps; // Number of Components on this Branch
int PressCurveType;
DataBranchAirLoopPlant::PressureCurveType PressCurveType;
int PressCurveIndex;
bool errFlag; // Error flag from RegisterNodeConnection
int NumParams;
Expand Down Expand Up @@ -761,7 +761,7 @@ namespace BranchInputManager {
int Count; // Loop Counter
int Loop; // Loop Counter
int NumComps; // Number of Components on this Branch
int PressCurveType;
DataBranchAirLoopPlant::PressureCurveType PressCurveType;
int PressCurveIndex;
bool errFlag; // Error flag from RegisterNodeConnection
int NumParams;
Expand Down Expand Up @@ -1090,7 +1090,7 @@ namespace BranchInputManager {
using General::RoundSigDigits;

// Locals
int PressureCurveType;
PressureCurveType pressureCurveType;
int PressureCurveIndex;
bool ErrFound; // Flag for error detection
int Comp; // Loop Counter
Expand All @@ -1102,16 +1102,16 @@ namespace BranchInputManager {
std::string CurrentModuleObject = "Branch";

state.dataBranchInputManager->Branch(BCount).Name = Alphas(1);
GetPressureCurveTypeAndIndex(state, Alphas(2), PressureCurveType, PressureCurveIndex);
if (PressureCurveType == PressureCurve_Error) {
GetPressureCurveTypeAndIndex(state, Alphas(2), pressureCurveType, PressureCurveIndex);
if (pressureCurveType == DataBranchAirLoopPlant::PressureCurveType::Error) {
ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\", invalid data.");
ShowContinueError(state, "..Invalid " + cAlphaFields(2) + "=\"" + Alphas(2) + "\".");
ShowContinueError(state, "This curve could not be found in the input deck. Ensure that this curve has been entered");
ShowContinueError(state, " as either a Curve:Functional:PressureDrop or one of Curve:{Linear,Quadratic,Cubic,Exponent}");
ShowContinueError(state, "This error could be caused by a misspelled curve name");
ErrFound = true;
}
state.dataBranchInputManager->Branch(BCount).PressureCurveType = PressureCurveType;
state.dataBranchInputManager->Branch(BCount).PressureCurveType = pressureCurveType;
state.dataBranchInputManager->Branch(BCount).PressureCurveIndex = PressureCurveIndex;
state.dataBranchInputManager->Branch(BCount).NumOfComponents = (NumAlphas - 2) / 4;
if (state.dataBranchInputManager->Branch(BCount).NumOfComponents * 4 != (NumAlphas - 2)) ++state.dataBranchInputManager->Branch(BCount).NumOfComponents;
Expand Down
9 changes: 5 additions & 4 deletions src/EnergyPlus/BranchInputManager.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/DataBranchAirLoopPlant.hh>
#include <EnergyPlus/DataGlobals.hh>
#include <EnergyPlus/DataLoopNode.hh>
#include <EnergyPlus/EnergyPlus.hh>
Expand Down Expand Up @@ -129,14 +130,14 @@ namespace BranchInputManager {
// Members
std::string Name; // Name for this Branch
std::string AssignedLoopName; // Loop Name for this branch
int PressureCurveType; // Integer index of pressure curve type
DataBranchAirLoopPlant::PressureCurveType PressureCurveType; // Integer index of pressure curve type
int PressureCurveIndex; // Integer index of pressure curve
int FluidType; // Fluid type (see DataLoopNode)
int NumOfComponents; // Number of Components on this Branch
Array1D<ComponentData> Component; // Component definitions for each component

// Default Constructor
BranchData() : PressureCurveType(0), PressureCurveIndex(0), FluidType(DataLoopNode::NodeType_Unknown), NumOfComponents(0)
BranchData() : PressureCurveType(DataBranchAirLoopPlant::PressureCurveType::Unassigned), PressureCurveIndex(0), FluidType(DataLoopNode::NodeType_Unknown), NumOfComponents(0)
{
}

Expand Down Expand Up @@ -195,7 +196,7 @@ namespace BranchInputManager {
void GetBranchData(EnergyPlusData &state,
std::string const &LoopName, // Loop Name of this Branch
std::string const &BranchName, // Requested Branch Name
int &PressCurveType, // Index of a pressure curve object
DataBranchAirLoopPlant::PressureCurveType &PressCurveType, // Index of a pressure curve object
int &PressCurveIndex, // Index of a pressure curve object
int &NumComps, // Number of Components on Branch
Array1D_string &CompType, // Component Type for each item on Branch
Expand All @@ -219,7 +220,7 @@ namespace BranchInputManager {
void GetInternalBranchData(EnergyPlusData &state,
std::string const &LoopName, // Loop Name for Branch
std::string const &BranchName, // Requested Branch Name
int &PressCurveType, // Index of pressure curve object
DataBranchAirLoopPlant::PressureCurveType &PressCurveType, // Index of pressure curve object
int &PressCurveIndex, // Index of pressure curve object
int &NumComps, // Number of Components on Branch
Array1D<ComponentData> &BComponents, // Component data returned
Expand Down
Loading

4 comments on commit 9924a3f

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

fix_nocache_psychrometrics (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: Tests Failed (1535 of 3034 tests passed, 673 test warnings)

Messages:\n

  • 689 tests had: EIO diffs.
  • 669 tests had: ESO small diffs.
  • 616 tests had: Table small diffs.
  • 529 tests had: MTR small diffs.
  • 63 tests had: ERR diffs.
  • 15 tests had: ESO big diffs.
  • 360 tests had: ZSZ small diffs.
  • 22 tests had: Table big diffs.
  • 8 tests had: EDD diffs.
  • 299 tests had: SSZ small diffs.
  • 3 tests had: JSON big diffs.
  • 1 test had: MTR big diffs.
  • 2 tests had: SSZ big diffs.

Failures:\n

regression Test Summary

  • Passed: 708
  • Failed: 29

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.

fix_nocache_psychrometrics (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: Build Failed

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

fix_nocache_psychrometrics (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: Build Failed

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

fix_nocache_psychrometrics (mitchute) - Win64-Windows-10-VisualStudio-16: Build Failed

Build Badge Test Badge

Please sign in to comment.