Skip to content

Commit

Permalink
Merge pull request #8162 from NREL/move_input_files_from_gio
Browse files Browse the repository at this point in the history
Move input files from gio
  • Loading branch information
Myoldmopar authored Jul 25, 2020
2 parents 621041c + 5d519a9 commit 2b65de0
Show file tree
Hide file tree
Showing 331 changed files with 5,702 additions and 11,377 deletions.
8 changes: 4 additions & 4 deletions src/EnergyPlus/AirLoopHVACDOAS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -447,15 +447,15 @@ namespace AirLoopHVACDOAS {
}
} else if (SELECT_CASE_var == "FAN:COMPONENTMODEL") {
thisDOAS.m_FanTypeNum = SimAirServingZones::Fan_ComponentModel;
Fans::GetFanIndex(state, state.fans, CompName, thisDOAS.m_FanIndex, errorsFound);
Fans::GetFanIndex(state, CompName, thisDOAS.m_FanIndex, errorsFound, ObjexxFCL::Optional_string_const());
thisDOAS.FanName = CompName;
if (CompNum == 1) {
thisDOAS.FanBlowTroughFlag = true;
}
OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) =
Fans::GetFanInletNode(state, state.fans, SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag);
Fans::GetFanInletNode(state, SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag);
OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) =
Fans::GetFanOutletNode(state, state.fans, SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag);
Fans::GetFanOutletNode(state, SELECT_CASE_var, OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag);
thisDOAS.m_FanInletNodeNum = OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum);
thisDOAS.m_FanOutletNodeNum = OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum);
if (!(CompNum == 1 || CompNum == OutsideAirSys(thisDOAS.m_OASystemNum).NumComponents)) {
Expand Down Expand Up @@ -935,7 +935,7 @@ namespace AirLoopHVACDOAS {
}
bool errorsFound = false;
if (this->m_FanIndex > 0 && this->m_FanTypeNum == SimAirServingZones::Fan_ComponentModel) {
Fans::SetFanData(state, state.fans, this->m_FanIndex, errorsFound, Name, sizingMassFlow / DataEnvironment::StdRhoAir, 0);
Fans::SetFanData(state, this->m_FanIndex, errorsFound, Name, sizingMassFlow / DataEnvironment::StdRhoAir, 0);
Fans::Fan(this->m_FanIndex).MaxAirMassFlowRate = sizingMassFlow;
DataLoopNode::Node(this->m_FanInletNodeNum).MassFlowRateMaxAvail = sizingMassFlow;
DataLoopNode::Node(this->m_FanOutletNodeNum).MassFlowRateMaxAvail = sizingMassFlow;
Expand Down
62 changes: 31 additions & 31 deletions src/EnergyPlus/AirflowNetworkBalanceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@
#include <EnergyPlus/HVACFan.hh>
#include <EnergyPlus/HVACHXAssistedCoolingCoil.hh>
#include <EnergyPlus/HeatingCoils.hh>
#include <EnergyPlus/IOFiles.hh>
#include <EnergyPlus/InputProcessing/InputProcessor.hh>
#include <EnergyPlus/MixedAir.hh>
#include <EnergyPlus/NodeInputManager.hh>
#include <EnergyPlus/OutAirNodeManager.hh>
#include <EnergyPlus/OutputFiles.hh>
#include <EnergyPlus/OutputProcessor.hh>
#include <EnergyPlus/Psychrometrics.hh>
#include <EnergyPlus/RoomAirModelManager.hh>
Expand Down Expand Up @@ -500,7 +500,7 @@ namespace AirflowNetworkBalanceManager {
// This breaks the component model, need to fix
bool fanErrorFound = false;
int fanIndex;
GetFanIndex(state, state.fans, thisObjectName, fanIndex, fanErrorFound);
GetFanIndex(state, thisObjectName, fanIndex, fanErrorFound, ObjexxFCL::Optional_string_const());
if (fanErrorFound) {
ShowSevereError(RoutineName + ": " + CurrentModuleObject + " = " + thisObjectName + " is not found in Fan:ZoneExhaust objects.");
success = false;
Expand All @@ -510,13 +510,13 @@ namespace AirflowNetworkBalanceManager {
GetFanVolFlow(fanIndex, flowRate);
flowRate *= StdRhoAir;
bool nodeErrorsFound{false};
int inletNode = GetFanInletNode(state, state.fans, "Fan:ZoneExhaust", thisObjectName, nodeErrorsFound);
int outletNode = GetFanOutletNode(state, state.fans, "Fan:ZoneExhaust", thisObjectName, nodeErrorsFound);
int inletNode = GetFanInletNode(state, "Fan:ZoneExhaust", thisObjectName, nodeErrorsFound);
int outletNode = GetFanOutletNode(state, "Fan:ZoneExhaust", thisObjectName, nodeErrorsFound);
if (nodeErrorsFound) {
success = false;
}
int fanType_Num;
GetFanType(state, state.fans, thisObjectName, fanType_Num, fanErrorFound);
GetFanType(state, thisObjectName, fanType_Num, fanErrorFound);
if (fanType_Num != FanType_ZoneExhaust) {
ShowSevereError(RoutineName + CurrentModuleObject + " = " + thisObjectName + ". The specified " + "Name" +
" is not found as a valid Fan:ZoneExhaust object.");
Expand Down Expand Up @@ -1313,7 +1313,7 @@ namespace AirflowNetworkBalanceManager {

} else {

GetFanIndex(state, state.fans, fan_name, fanIndex, FanErrorFound);
GetFanIndex(state, fan_name, fanIndex, FanErrorFound, ObjexxFCL::Optional_string_const());

if (FanErrorFound) {
ShowSevereError("...occurs in " + CurrentModuleObject + " = " + DisSysCompCVFData(i).name);
Expand All @@ -1323,7 +1323,7 @@ namespace AirflowNetworkBalanceManager {
GetFanVolFlow(fanIndex, flowRate);
flowRate *= StdRhoAir;

GetFanType(state, state.fans, fan_name, fanType_Num, FanErrorFound);
GetFanType(state, fan_name, fanType_Num, FanErrorFound);
dataAirflowNetworkBalanceManager.SupplyFanType = fanType_Num;
}

Expand All @@ -1346,16 +1346,16 @@ namespace AirflowNetworkBalanceManager {
}
bool ErrorsFound{false};
if (fanType_Num == FanType_SimpleConstVolume) {
inletNode = GetFanInletNode(state, state.fans, "Fan:ConstantVolume", fan_name, ErrorsFound);
outletNode = GetFanOutletNode(state, state.fans, "Fan:ConstantVolume", fan_name, ErrorsFound);
inletNode = GetFanInletNode(state, "Fan:ConstantVolume", fan_name, ErrorsFound);
outletNode = GetFanOutletNode(state, "Fan:ConstantVolume", fan_name, ErrorsFound);
}
if (fanType_Num == FanType_SimpleOnOff && !DisSysCompCVFData(i).FanModelFlag) {
inletNode = GetFanInletNode(state, state.fans, "Fan:OnOff", fan_name, ErrorsFound);
outletNode = GetFanOutletNode(state, state.fans, "Fan:OnOff", fan_name, ErrorsFound);
inletNode = GetFanInletNode(state, "Fan:OnOff", fan_name, ErrorsFound);
outletNode = GetFanOutletNode(state, "Fan:OnOff", fan_name, ErrorsFound);
}
if (fanType_Num == FanType_SimpleVAV && !DisSysCompCVFData(i).FanModelFlag) {
inletNode = GetFanInletNode(state, state.fans, "Fan:VariableVolume", fan_name, ErrorsFound);
outletNode = GetFanOutletNode(state, state.fans, "Fan:VariableVolume", fan_name, ErrorsFound);
inletNode = GetFanInletNode(state, "Fan:VariableVolume", fan_name, ErrorsFound);
outletNode = GetFanOutletNode(state, "Fan:VariableVolume", fan_name, ErrorsFound);
VAVSystem = true;
}

Expand Down Expand Up @@ -1811,8 +1811,8 @@ namespace AirflowNetworkBalanceManager {
dataAirflowNetworkBalanceManager.NumAirflowNetwork = inputProcessor->getNumObjectsFound(CurrentModuleObject);
if (dataAirflowNetworkBalanceManager.NumAirflowNetwork == 0) {
SimulateAirflowNetwork = AirflowNetworkControlSimple;
print(state.outputFiles.eio, Format_110);
print(state.outputFiles.eio, Format_120, "NoMultizoneOrDistribution");
print(state.files.eio, Format_110);
print(state.files.eio, Format_120, "NoMultizoneOrDistribution");
return;
}
if (dataAirflowNetworkBalanceManager.NumAirflowNetwork > 1) {
Expand Down Expand Up @@ -1876,8 +1876,8 @@ namespace AirflowNetworkBalanceManager {
dataAirflowNetworkBalanceManager.LoopOnOffFlag = false;
}
}
print(state.outputFiles.eio, Format_110);
print(state.outputFiles.eio, Format_120, SimAirNetworkKey);
print(state.files.eio, Format_110);
print(state.files.eio, Format_120, SimAirNetworkKey);

// Check whether there are any objects from infiltration, ventilation, mixing and cross mixing
if (SimulateAirflowNetwork == AirflowNetworkControlSimple || SimulateAirflowNetwork == AirflowNetworkControlSimpleADS) {
Expand Down Expand Up @@ -2778,13 +2778,13 @@ namespace AirflowNetworkBalanceManager {
for (int i = 1; i <= AirflowNetworkNumOfSurfaces; ++i) {
if (MultizoneSurfaceData(i).NonRectangular) {
if (found) {
print(state.outputFiles.eio,
print(state.files.eio,
"! <AirflowNetwork Model:Equivalent Rectangle Surface>, Name, Equivalent Height {{m}}, Equivalent Width {{m}} "
"AirflowNetwork "
"Model:Equivalent Rectangle\n");
found = false;
}
print(state.outputFiles.eio,
print(state.files.eio,
"AirflowNetwork Model:Equivalent Rectangle Surface, {}, {:.2R},{:.2R}\n",
MultizoneSurfaceData(i).SurfName,
MultizoneSurfaceData(i).Height,
Expand Down Expand Up @@ -3058,8 +3058,8 @@ namespace AirflowNetworkBalanceManager {
if (ErrorsFound) ShowFatalError(RoutineName + "Errors found getting inputs. Previous error(s) cause program termination.");

// Write wind pressure coefficients in the EIO file
print(state.outputFiles.eio, "! <AirflowNetwork Model:Wind Direction>, Wind Direction #1 to n (degree)\n");
print(state.outputFiles.eio, "AirflowNetwork Model:Wind Direction, ");
print(state.files.eio, "! <AirflowNetwork Model:Wind Direction>, Wind Direction #1 to n (degree)\n");
print(state.files.eio, "AirflowNetwork Model:Wind Direction, ");

int numWinDirs = 11;
Real64 angleDelta = 30.0;
Expand All @@ -3069,36 +3069,36 @@ namespace AirflowNetworkBalanceManager {
}

for (int i = 0; i < numWinDirs; ++i) {
print(state.outputFiles.eio, "{:.1R},", i * angleDelta);
print(state.files.eio, "{:.1R},", i * angleDelta);
}
print(state.outputFiles.eio, "{:.1R}\n", numWinDirs * angleDelta);
print(state.files.eio, "{:.1R}\n", numWinDirs * angleDelta);

print(state.outputFiles.eio, "! <AirflowNetwork Model:Wind Pressure Coefficients>, Name, Wind Pressure Coefficients #1 to n (dimensionless)\n");
print(state.files.eio, "! <AirflowNetwork Model:Wind Pressure Coefficients>, Name, Wind Pressure Coefficients #1 to n (dimensionless)\n");

// The old version used to write info with single-sided natural ventilation specific labeling, this version no longer does that.
std::set<int> curves;
for (int i = 1; i <= dataAirflowNetworkBalanceManager.AirflowNetworkNumOfExtNode; ++i) {
curves.insert(MultizoneExternalNodeData(i).curve);
}
for (auto index : curves) {
print(state.outputFiles.eio, "AirflowNetwork Model:Wind Pressure Coefficients, {}, ", CurveManager::GetCurveName(index));
print(state.files.eio, "AirflowNetwork Model:Wind Pressure Coefficients, {}, ", CurveManager::GetCurveName(index));

for (j = 0; j < numWinDirs; ++j) {
print(state.outputFiles.eio, "{:.2R},", CurveManager::CurveValue(index, j * angleDelta));
print(state.files.eio, "{:.2R},", CurveManager::CurveValue(index, j * angleDelta));
}
print(state.outputFiles.eio, "{:.2R}\n", CurveManager::CurveValue(index, numWinDirs * angleDelta));
print(state.files.eio, "{:.2R}\n", CurveManager::CurveValue(index, numWinDirs * angleDelta));
}

if (dataAirflowNetworkBalanceManager.AirflowNetworkNumOfSingleSideZones > 0) {
for (int i = 1; i <= AirflowNetworkNumOfZones; ++i) {
if (MultizoneZoneData(i).SingleSidedCpType == "ADVANCED") {
print(state.outputFiles.eio,
print(state.files.eio,
"AirflowNetwork: Advanced Single-Sided Model: Difference in Opening Wind Pressure Coefficients (DeltaCP), ");
print(state.outputFiles.eio, "{}, ", MultizoneZoneData(i).ZoneName);
print(state.files.eio, "{}, ", MultizoneZoneData(i).ZoneName);
for (unsigned j = 1; j <= EPDeltaCP(i).WindDir.size() - 1; ++j) {
print(state.outputFiles.eio, "{:.2R},", EPDeltaCP(i).WindDir(j));
print(state.files.eio, "{:.2R},", EPDeltaCP(i).WindDir(j));
}
print(state.outputFiles.eio, "{:.2R}\n", EPDeltaCP(i).WindDir(EPDeltaCP(i).WindDir.size()));
print(state.files.eio, "{:.2R}\n", EPDeltaCP(i).WindDir(EPDeltaCP(i).WindDir.size()));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/AirflowNetworkBalanceManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
namespace EnergyPlus {

// Forward declarations
class OutputFiles;
class IOFiles;
struct EnergyPlusData;

namespace AirflowNetworkBalanceManager {
Expand Down
24 changes: 12 additions & 12 deletions src/EnergyPlus/BranchInputManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2392,7 +2392,7 @@ namespace BranchInputManager {
}
}

void TestBranchIntegrity(BranchInputManagerData &dataBranchInputManager, OutputFiles &outputFiles, bool &ErrFound)
void TestBranchIntegrity(BranchInputManagerData &dataBranchInputManager, IOFiles &ioFiles, bool &ErrFound)
{

// SUBROUTINE INFORMATION:
Expand Down Expand Up @@ -2457,18 +2457,18 @@ namespace BranchInputManager {

BranchNodes.allocate(dataBranchInputManager.NumOfBranches);

print(outputFiles.bnd, "{}\n", "! ===============================================================");
print(ioFiles.bnd, "{}\n", "! ===============================================================");
static constexpr auto Format_700("! <#Branch Lists>,<Number of Branch Lists>");
print(outputFiles.bnd, "{}\n", Format_700);
print(outputFiles.bnd, " #Branch Lists,{}\n", dataBranchInputManager.NumOfBranchLists);
print(ioFiles.bnd, "{}\n", Format_700);
print(ioFiles.bnd, " #Branch Lists,{}\n", dataBranchInputManager.NumOfBranchLists);
static constexpr auto Format_702("! <Branch List>,<Branch List Count>,<Branch List Name>,<Loop Name>,<Loop Type>,<Number of Branches>");
print(outputFiles.bnd, "{}\n", Format_702);
print(ioFiles.bnd, "{}\n", Format_702);
static constexpr auto Format_704(
"! <Branch>,<Branch Count>,<Branch Name>,<Loop Name>,<Loop Type>,<Branch Inlet Node Name>,<Branch Outlet Node Name>");
print(outputFiles.bnd, "{}\n", Format_704);
print(ioFiles.bnd, "{}\n", Format_704);

for (BCount = 1; BCount <= dataBranchInputManager.NumOfBranchLists; ++BCount) {
print(outputFiles.bnd,
print(ioFiles.bnd,
" Branch List,{},{},{},{},{}\n",
BCount,
dataBranchInputManager.BranchList(BCount).Name,
Expand Down Expand Up @@ -2502,7 +2502,7 @@ namespace BranchInputManager {
for (Count = 1; Count <= dataBranchInputManager.BranchList(BCount).NumOfBranchNames; ++Count) {
Found = FoundBranches(Count);
if (Found == 0) {
print(outputFiles.bnd,
print(ioFiles.bnd,
" Branch,{},{},(not found),**Unknown**,**Unknown**,**Unknown**,**Unknown**\n",
Count,
dataBranchInputManager.BranchList(BCount).BranchNames(Count));
Expand Down Expand Up @@ -2578,7 +2578,7 @@ namespace BranchInputManager {
BranchLoopName = dataBranchInputManager.Branch(Found).AssignedLoopName;
BranchLoopType = "**Unknown**";
}
print(outputFiles.bnd,
print(ioFiles.bnd,
" Branch,{},{},{},{},{},{}\n",
Count,
dataBranchInputManager.Branch(Found).Name,
Expand Down Expand Up @@ -2662,8 +2662,8 @@ namespace BranchInputManager {
}
if (BCount > 0) {
static constexpr auto Format_706("! <# Orphaned Branches>,<Number of Branches not on Branch Lists>");
print(outputFiles.bnd, "{}\n", Format_706);
print(outputFiles.bnd, " #Orphaned Branches,{}\n", BCount);
print(ioFiles.bnd, "{}\n", Format_706);
print(ioFiles.bnd, " #Orphaned Branches,{}\n", BCount);
ShowWarningError("There are orphaned Branches in input. See .bnd file for details.");

BCount = 0;
Expand Down Expand Up @@ -2701,7 +2701,7 @@ namespace BranchInputManager {
BranchLoopName = dataBranchInputManager.Branch(Count).AssignedLoopName;
BranchLoopType = "**Unknown**";
}
print(outputFiles.bnd,
print(ioFiles.bnd,
" Branch,{},{},{},{},{},{}\n",
BCount,
dataBranchInputManager.Branch(Count).Name,
Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/BranchInputManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
#include <EnergyPlus/DataGlobals.hh>
#include <EnergyPlus/DataLoopNode.hh>
#include <EnergyPlus/EnergyPlus.hh>
#include <EnergyPlus/OutputFiles.hh>
#include <EnergyPlus/IOFiles.hh>

namespace EnergyPlus {

Expand Down Expand Up @@ -335,7 +335,7 @@ namespace BranchInputManager {
Optional_string_const CompName = _ // when mustprint (ScanPlantLoop) use CompName in error message and scan
);

void TestBranchIntegrity(BranchInputManagerData &dataBranchInputManager, EnergyPlus::OutputFiles &outputFiles, bool &ErrFound); // ErrFound is a return value, true or false
void TestBranchIntegrity(BranchInputManagerData &dataBranchInputManager, EnergyPlus::IOFiles &ioFiles, bool &ErrFound); // ErrFound is a return value, true or false

} // namespace BranchInputManager

Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ SET( SRC
OutAirNodeManager.hh
OutdoorAirUnit.cc
OutdoorAirUnit.hh
OutputFiles.cc
OutputFiles.hh
IOFiles.cc
IOFiles.hh
OutputProcessor.cc
OutputProcessor.hh
OutputReportPredefined.cc
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/ChilledCeilingPanelSimple.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ namespace CoolingPanelSimple {
// Now, distribute the radiant energy of all systems to the appropriate surfaces, to people, and the air
DistributeCoolingPanelRadGains(state.dataChilledCeilingPanelSimple);
// Now "simulate" the system by recalculating the heat balances
HeatBalanceSurfaceManager::CalcHeatBalanceOutsideSurf(state.dataConvectionCoefficients, ZoneNum);
HeatBalanceSurfaceManager::CalcHeatBalanceOutsideSurf(state.dataConvectionCoefficients, state.files, ZoneNum);

HeatBalanceSurfaceManager::CalcHeatBalanceInsideSurf(state, ZoneNum);

Expand Down
Loading

7 comments on commit 2b65de0

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

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (2200 of 2200 tests passed, 0 test warnings)

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.

develop (Myoldmopar) - x86_64-MacOS-10.15-clang-11.0.0: OK (2180 of 2180 tests passed, 0 test warnings)

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.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-cppcheck: OK (0 of 0 tests passed, 0 test warnings)

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

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-custom_check: OK (13 of 13 tests passed, 0 test warnings)

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

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1469 of 1469 tests passed, 0 test warnings)

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.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (713 of 714 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 713
  • Timeout: 1

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.

develop (Myoldmopar) - Win64-Windows-10-VisualStudio-16: OK (2156 of 2156 tests passed, 0 test warnings)

Build Badge Test Badge

Please # to comment.