Skip to content

Commit

Permalink
Merge branch 'develop' into chillerElecEIRrefactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchute committed Jan 16, 2020
2 parents adf7ba0 + ce98bde commit 2ff63bd
Show file tree
Hide file tree
Showing 47 changed files with 1,034 additions and 1,598 deletions.
Binary file modified bin/IDFEditor/IDFEditor.exe
Binary file not shown.
4 changes: 2 additions & 2 deletions idd/Energy+.idd.in
Original file line number Diff line number Diff line change
Expand Up @@ -70731,7 +70731,7 @@ ChillerHeater:Absorption:DoubleEffect,

HeatPump:PlantLoop:EIR:Cooling,
\memo An EIR formulated water to water heat pump model, cooling operation.
\min-fields 15
\min-fields 14
A1, \field Name
\type alpha
\reference PLHPCoolingNames
Expand Down Expand Up @@ -70829,7 +70829,7 @@ HeatPump:PlantLoop:EIR:Cooling,

HeatPump:PlantLoop:EIR:Heating,
\memo An EIR formulated water to water heat pump model, heating operation
\min-fields 15
\min-fields 14
A1, \field Name
\type alpha
\reference PLHPHeatingNames
Expand Down
117 changes: 32 additions & 85 deletions src/EnergyPlus/AirflowNetworkBalanceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Array2D.hh>
#include <ObjexxFCL/Fmath.hh>
#include <ObjexxFCL/gio.hh>
#include <ObjexxFCL/string.functions.hh>

// EnergyPlus Headers
Expand Down Expand Up @@ -103,6 +102,7 @@
#include <EnergyPlus/UtilityRoutines.hh>
#include <EnergyPlus/ZoneDehumidifier.hh>


namespace EnergyPlus {

namespace AirflowNetworkBalanceManager {
Expand Down Expand Up @@ -403,7 +403,7 @@ namespace AirflowNetworkBalanceManager {
int AFNSupplyFanType = 0;

if (AirflowNetworkGetInputFlag) {
GetAirflowNetworkInput();
GetAirflowNetworkInput(OutputFiles::getSingleton());
AirflowNetworkGetInputFlag = false;
return;
}
Expand Down Expand Up @@ -1550,7 +1550,7 @@ namespace AirflowNetworkBalanceManager {
return success;
}

void GetAirflowNetworkInput()
void GetAirflowNetworkInput(OutputFiles &outputFiles)
{

// SUBROUTINE INFORMATION:
Expand Down Expand Up @@ -1588,7 +1588,6 @@ namespace AirflowNetworkBalanceManager {
// na

// SUBROUTINE PARAMETER DEFINITIONS:
static ObjexxFCL::gio::Fmt fmtA("(A)");
static std::string const RoutineName("GetAirflowNetworkInput: "); // include trailing blank space

// INTERFACE BLOCK SPECIFICATIONS:
Expand Down Expand Up @@ -1643,10 +1642,10 @@ namespace AirflowNetworkBalanceManager {
Real64 baseratio;

// Formats
static ObjexxFCL::gio::Fmt Format_110(
"('! <AirflowNetwork Model:Control>, No Multizone or Distribution/Multizone with Distribution/','Multizone "
"without Distribution/Multizone with Distribution only during Fan Operation')");
static ObjexxFCL::gio::Fmt Format_120("('AirflowNetwork Model:Control,',A)");
static constexpr auto Format_110(
"! <AirflowNetwork Model:Control>, No Multizone or Distribution/Multizone with Distribution/Multizone "
"without Distribution/Multizone with Distribution only during Fan Operation\n");
static constexpr auto Format_120("AirflowNetwork Model:Control,{}\n");

// Set the maximum numbers of input fields
inputProcessor->getObjectDefMaxArgs("AirflowNetwork:SimulationControl", TotalArgs, NumAlphas, NumNumbers);
Expand Down Expand Up @@ -1894,8 +1893,8 @@ namespace AirflowNetworkBalanceManager {
NumAirflowNetwork = inputProcessor->getNumObjectsFound(CurrentModuleObject);
if (NumAirflowNetwork == 0) {
SimulateAirflowNetwork = AirflowNetworkControlSimple;
ObjexxFCL::gio::write(OutputFileInits, Format_110);
ObjexxFCL::gio::write(OutputFileInits, Format_120) << "NoMultizoneOrDistribution";
print(outputFiles.eio, Format_110);
print(outputFiles.eio, Format_120, "NoMultizoneOrDistribution");
return;
}
if (NumAirflowNetwork > 1) {
Expand Down Expand Up @@ -1959,9 +1958,8 @@ namespace AirflowNetworkBalanceManager {
LoopOnOffFlag = false;
}
}

ObjexxFCL::gio::write(OutputFileInits, Format_110);
ObjexxFCL::gio::write(OutputFileInits, Format_120) << SimAirNetworkKey;
print(outputFiles.eio, Format_110);
print(outputFiles.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 @@ -2844,15 +2842,16 @@ namespace AirflowNetworkBalanceManager {
for (i = 1; i <= AirflowNetworkNumOfSurfaces; ++i) {
if (MultizoneSurfaceData(i).NonRectangular) {
if (found) {
ObjexxFCL::gio::write(OutputFileInits, fmtA)
<< "! <AirflowNetwork Model:Equivalent Rectangle Surface>, Name, Equivalent Height {m}, "
"Equivalent Width {m} AirflowNetwork Model:Equivalent Rectangle";
print(outputFiles.eio,
"! <AirflowNetwork Model:Equivalent Rectangle Surface>, Name, Equivalent Height {{m}}, Equivalent Width {{m}} AirflowNetwork "
"Model:Equivalent Rectangle\n");
found = false;
}
StringOut = "AirflowNetwork Model:Equivalent Rectangle Surface, " + MultizoneSurfaceData(i).SurfName;
StringOut =
StringOut + ", " + RoundSigDigits(MultizoneSurfaceData(i).Height, 2) + "," + RoundSigDigits(MultizoneSurfaceData(i).Width, 2);
ObjexxFCL::gio::write(OutputFileInits, fmtA) << StringOut;
print(outputFiles.eio,
"AirflowNetwork Model:Equivalent Rectangle Surface, {}, {:.2R},{:.2R}\n",
MultizoneSurfaceData(i).SurfName,
MultizoneSurfaceData(i).Height,
MultizoneSurfaceData(i).Width);
}
}

Expand Down Expand Up @@ -3131,12 +3130,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
ObjexxFCL::gio::write(OutputFileInits, fmtA) << "! <AirflowNetwork Model:Wind Direction>, Wind Direction #1 to n (degree)";
{
IOFlags flags;
flags.ADVANCE("No");
ObjexxFCL::gio::write(OutputFileInits, fmtA, flags) << "AirflowNetwork Model:Wind Direction, ";
}
print(outputFiles.eio, "! <AirflowNetwork Model:Wind Direction>, Wind Direction #1 to n (degree)\n");
print(outputFiles.eio, "AirflowNetwork Model:Wind Direction, ");

int numWinDirs = 11;
Real64 angleDelta = 30.0;
Expand All @@ -3146,75 +3141,35 @@ namespace AirflowNetworkBalanceManager {
}

for (i = 0; i < numWinDirs; ++i) {
StringOut = RoundSigDigits(i * angleDelta, 1);
{
IOFlags flags;
flags.ADVANCE("No");
ObjexxFCL::gio::write(OutputFileInits, fmtA, flags) << StringOut + ',';
}
print(outputFiles.eio, "{:.1R},", i * angleDelta);
}
StringOut = RoundSigDigits(numWinDirs * angleDelta, 1);
ObjexxFCL::gio::write(OutputFileInits, fmtA) << StringOut;
print(outputFiles.eio, "{:.1R}\n", numWinDirs * angleDelta);

{
IOFlags flags;
flags.ADVANCE("No");
ObjexxFCL::gio::write(OutputFileInits, fmtA, flags) << "! <AirflowNetwork Model:Wind Pressure Coefficients>, Name, ";
}
ObjexxFCL::gio::write(OutputFileInits, fmtA) << "Wind Pressure Coefficients #1 to n (dimensionless)";
print(outputFiles.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 <= AirflowNetworkNumOfExtNode; ++i) {
curves.insert(MultizoneExternalNodeData(i).curve);
}
for (auto index : curves) {
{
IOFlags flags;
flags.ADVANCE("No");
ObjexxFCL::gio::write(OutputFileInits, fmtA, flags) << "AirflowNetwork Model:Wind Pressure Coefficients, ";
}
{
IOFlags flags;
flags.ADVANCE("No");
ObjexxFCL::gio::write(OutputFileInits, fmtA, flags) << CurveManager::GetCurveName(index) + ", ";
}
print(outputFiles.eio, "AirflowNetwork Model:Wind Pressure Coefficients, {}, ", CurveManager::GetCurveName(index));

for (j = 0; j < numWinDirs; ++j) {
StringOut = RoundSigDigits(CurveManager::CurveValue(index, j * angleDelta), 2);
{
IOFlags flags;
flags.ADVANCE("No");
ObjexxFCL::gio::write(OutputFileInits, fmtA, flags) << StringOut + ',';
}
print(outputFiles.eio, "{:.2R},", CurveManager::CurveValue(index, j * angleDelta));
}
StringOut = RoundSigDigits(CurveManager::CurveValue(index, numWinDirs * angleDelta), 2);
ObjexxFCL::gio::write(OutputFileInits, fmtA) << StringOut;
print(outputFiles.eio, "{:.2R}\n", CurveManager::CurveValue(index, numWinDirs * angleDelta));
}

if (AirflowNetworkNumOfSingleSideZones > 0) {
for (i = 1; i <= AirflowNetworkNumOfZones; ++i) {
if (MultizoneZoneData(i).SingleSidedCpType == "ADVANCED") {
{
IOFlags flags;
flags.ADVANCE("No");
ObjexxFCL::gio::write(OutputFileInits, fmtA, flags)
<< "AirflowNetwork: Advanced Single-Sided Model: Difference in Opening Wind Pressure Coefficients (DeltaCP), ";
}
{
IOFlags flags;
flags.ADVANCE("No");
ObjexxFCL::gio::write(OutputFileInits, fmtA, flags) << MultizoneZoneData(i).ZoneName + ", ";
}
print(outputFiles.eio, "AirflowNetwork: Advanced Single-Sided Model: Difference in Opening Wind Pressure Coefficients (DeltaCP), ");
print(outputFiles.eio, "{}, ", MultizoneZoneData(i).ZoneName);
for (unsigned j = 1; j <= EPDeltaCP(i).WindDir.size() - 1; ++j) {
StringOut = RoundSigDigits(EPDeltaCP(i).WindDir(j), 2);
{
IOFlags flags;
flags.ADVANCE("No");
ObjexxFCL::gio::write(OutputFileInits, fmtA, flags) << StringOut + ',';
}
print(outputFiles.eio, "{:.2R},", EPDeltaCP(i).WindDir(j));
}
StringOut = RoundSigDigits(EPDeltaCP(i).WindDir(EPDeltaCP(i).WindDir.size()), 2);
ObjexxFCL::gio::write(OutputFileInits, fmtA) << StringOut;
print(outputFiles.eio, "{:.2R}\n", EPDeltaCP(i).WindDir(EPDeltaCP(i).WindDir.size()));
}
}
}
Expand Down Expand Up @@ -5157,14 +5112,6 @@ namespace AirflowNetworkBalanceManager {
int n;
int SurfNum;

// Formats
static ObjexxFCL::gio::Fmt Format_900("(1X,i2)");
static ObjexxFCL::gio::Fmt Format_901("(1X,2I4,4F9.4)");
static ObjexxFCL::gio::Fmt Format_902("(1X,2I4,4F9.4)");
static ObjexxFCL::gio::Fmt Format_903("(9X,4F9.4)");
static ObjexxFCL::gio::Fmt Format_904("(1X,2I4,1F9.4)");
static ObjexxFCL::gio::Fmt Format_910("(1X,I4,2(I4,F9.4),I4,2F4.1)");

AirflowNetworkNodeSimu.allocate(AirflowNetworkNumOfNodes); // Node simulation variable in air distribution system
AirflowNetworkLinkSimu.allocate(AirflowNetworkNumOfLinks); // Link simulation variable in air distribution system
AirflowNetworkLinkReport.allocate(AirflowNetworkNumOfLinks); // Report link simulation variable in air distribution system
Expand Down
3 changes: 2 additions & 1 deletion src/EnergyPlus/AirflowNetworkBalanceManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include <ObjexxFCL/Optional.hh>

// EnergyPlus Headers
#include "OutputFiles.hh"
#include <EnergyPlus/EnergyPlus.hh>

namespace EnergyPlus {
Expand Down Expand Up @@ -169,7 +170,7 @@ namespace AirflowNetworkBalanceManager {
Optional_bool ResimulateAirZone = _ // True when solution technique on third iteration
);

void GetAirflowNetworkInput();
void GetAirflowNetworkInput(EnergyPlus::OutputFiles &outputFiles);

void InitAirflowNetwork();

Expand Down
6 changes: 3 additions & 3 deletions src/EnergyPlus/DXCoils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13525,7 +13525,7 @@ namespace DXCoils {

// Formats
static constexpr auto Header(
"! <VAV DX Cooling Coil Standard Rating Information>, DX Coil Type, DX Coil Name, Fan Type, Fan Name, Standard Net Cooling Capacity {W}, Standard Net Cooling Capacity {Btu/h}, IEER {Btu/W-h}, COP 100% Capacity {W/W}, COP 75% Capacity {W/W}, COP 50% Capacity {W/W}, COP 25% Capacity {W/W}, EER 100% Capacity {Btu/W-h}, EER 75% Capacity {Btu/W-h}, EER 50% Capacity {Btu/W-h}, EER 25% Capacity {Btu/W-h}, Supply Air Flow 100% {kg/s}, Supply Air Flow 75% {kg/s},Supply Air Flow 50% {kg/s},Supply Air Flow 25% {kg/s}\n");
"! <VAV DX Cooling Coil Standard Rating Information>, DX Coil Type, DX Coil Name, Fan Type, Fan Name, Standard Net Cooling Capacity {{W}}, Standard Net Cooling Capacity {{Btu/h}}, IEER {{Btu/W-h}}, COP 100% Capacity {{W/W}}, COP 75% Capacity {{W/W}}, COP 50% Capacity {{W/W}}, COP 25% Capacity {{W/W}}, EER 100% Capacity {{Btu/W-h}}, EER 75% Capacity {{Btu/W-h}}, EER 50% Capacity {{Btu/W-h}}, EER 25% Capacity {{Btu/W-h}}, Supply Air Flow 100% {{kg/s}}, Supply Air Flow 75% {{kg/s}},Supply Air Flow 50% {{kg/s}},Supply Air Flow 25% {{kg/s}}\n");

static constexpr auto Format_891{
" VAV DX Cooling Coil Standard Rating Information, {},{},{},{},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.4R},{:.4R},{:.4R},{:.4R},\n"};
Expand Down Expand Up @@ -13843,11 +13843,11 @@ namespace DXCoils {
} else if (countStaticInputs == 0) {
addFootNoteSubTable(pdstVAVDXCoolCoil,
"Indoor-coil-only unit ratings per ANSI/AHRI Standard 340/360-2007 with Addenda 1 and 2, with "
"supply fan specific power at 365 {W/1000cfm} (773.3 {W/(m3/s)})");
"supply fan specific power at 365 {{W/1000cfm}} (773.3 {{W/(m3/s)}})");
} else { // both
addFootNoteSubTable(pdstVAVDXCoolCoil,
"Packaged VAV unit ratings per ANSI/AHRI Standard 340/360-2007 with Addenda 1 and 2, "
"indoor-coil-only units with supply fan specific power at 365 {W/1000cfm} (773.3 {W/(m3/s)})");
"indoor-coil-only units with supply fan specific power at 365 {{W/1000cfm}} (773.3 {{W/(m3/s)}})");
}
}

Expand Down
1 change: 1 addition & 0 deletions src/EnergyPlus/EnergyPlusPgm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@
#include <direct.h>
#include <stdlib.h>
#else // Mac or Linux
#include <fmt-6.1.2/include/fmt/format.h>
#include <unistd.h>
#endif

Expand Down
Loading

0 comments on commit 2ff63bd

Please sign in to comment.