Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Move input files from gio #8162

Merged
merged 22 commits into from
Jul 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a7f7c63
Rename "OutputFile" to "InputOutputFile"
lefticus Jun 22, 2020
117078b
Move EnergyPlusIni file from gio
lefticus Jun 22, 2020
a464040
Move WeatherFile away from gio
lefticus Jun 24, 2020
24fd803
Merge branch 'develop' of github.com:NREL/EnergyPlus into move_input_…
lefticus Jun 25, 2020
7a230b5
Better `is_open()` capability
lefticus Jun 29, 2020
8480567
Merge remote-tracking branch 'origin/develop' into move_input_files_f…
lefticus Jun 29, 2020
8b66c4a
Small weather file conversion cleanups
lefticus Jun 29, 2020
ecae8b5
Fix mistaken "clear()" call during refactor
lefticus Jun 30, 2020
98e38ad
Move DElight input files from gio
lefticus Jun 30, 2020
cafc063
Move from gio::inquire to fileExists where possible
lefticus Jun 30, 2020
4756682
Move Window5Data files from gio
lefticus Jul 1, 2020
360dc3c
move stat file from gio
lefticus Jul 2, 2020
97c9bc4
move json output files from gio::open
lefticus Jul 3, 2020
7a86977
Move json output file names from global state
lefticus Jul 3, 2020
cbe25e9
Move err_stream from gio
lefticus Jul 4, 2020
b782ff7
Delete unused objexx routines
lefticus Jul 4, 2020
650368f
Merge branch 'develop' of github.com:NREL/EnergyPlus into move_input_…
lefticus Jul 9, 2020
976dd25
Merge branch 'develop' of github.com:NREL/EnergyPlus into move_input_…
lefticus Jul 16, 2020
76149ba
Reduce calls to IOFiles::getSingleton()
lefticus Jul 17, 2020
c23c047
Fix backspace / readline functionality on Windows
lefticus Jul 18, 2020
c66aaee
Merge develop; resolve conflict, everything seems OK but CI will verify
Myoldmopar Jul 24, 2020
5d519a9
Merge develop; resolve conflicts
Myoldmopar Jul 24, 2020
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
  •  
  •  
  •  
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
Copy link
Member

Choose a reason for hiding this comment

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

Indent fixes here would be good if anything else needs changing, otherwise it is fine.

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