Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,5 @@ release/node_modules/*
# virtual environments
venv/
.venv/

.ccache/
83 changes: 40 additions & 43 deletions src/EnergyPlus/AirLoopHVACDOAS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
// POSSIBILITY OF SUCH DAMAGE.

// C++ Headers
#include <format>
#include <string>

// EnergyPlus Headers
Expand Down Expand Up @@ -751,7 +752,7 @@ namespace AirLoopHVACDOAS {
errorsFound = true;
}
if (OutletNodeErrFlag) {
ShowSevereError(state, EnergyPlus::format("Outlet node number is not found in {} = {}", CurrentModuleObject, CompName));
ShowSevereError(state, std::format("Outlet node number is not found in {} = {}", CurrentModuleObject, CompName));
errorsFound = true;
}
// Check node connection to ensure that the outlet node of the previous component is the inlet node of the current component
Expand All @@ -772,17 +773,16 @@ namespace AirLoopHVACDOAS {
} else {
ShowSevereError(
state,
EnergyPlus::format(
"getAirLoopMixer: Node Connection Error in AirLoopHVAC:DedicatedOutdoorAirSystem = {}. Inlet node "
"of {} as current component is not same as the outlet node of "
"{} as previous component",
thisDOAS.Name,
thisOutsideAirSys.ComponentName(CompNum),
thisOutsideAirSys.ComponentName(CompNum - 1)));
std::format("getAirLoopMixer: Node Connection Error in AirLoopHVAC:DedicatedOutdoorAirSystem = {}. Inlet node "
"of {} as current component is not same as the outlet node of "
"{} as previous component",
thisDOAS.Name,
thisOutsideAirSys.ComponentName(CompNum),
thisOutsideAirSys.ComponentName(CompNum - 1)));
ShowContinueError(state,
EnergyPlus::format("The inlet node name = {}, and the outlet node name = {}.",
state.dataLoopNodes->NodeID(thisOutsideAirSys.InletNodeNum(CompNum)),
state.dataLoopNodes->NodeID(thisOutsideAirSys.OutletNodeNum(CompNum - 1))));
std::format("The inlet node name = {}, and the outlet node name = {}.",
state.dataLoopNodes->NodeID(thisOutsideAirSys.InletNodeNum(CompNum)),
state.dataLoopNodes->NodeID(thisOutsideAirSys.OutletNodeNum(CompNum - 1))));
errorsFound = true;
}
}
Expand Down Expand Up @@ -821,8 +821,7 @@ namespace AirLoopHVACDOAS {
cFieldName = "AirLoopHVAC:Splitter Name";
ShowSevereError(
state,
EnergyPlus::format(
R"({}, "{}" {} not found: {})", cCurrentModuleObject, thisDOAS.Name, cFieldName, thisDOAS.AirLoopSplitterName));
std::format(R"({}, "{}" {} not found: {})", cCurrentModuleObject, thisDOAS.Name, cFieldName, thisDOAS.AirLoopSplitterName));
errorsFound = true;
}

Expand All @@ -840,7 +839,7 @@ namespace AirLoopHVACDOAS {
if (thisDOAS.NumOfAirLoops < 1) {
cFieldName = "Number of AirLoopHVAC";
ShowSevereError(state,
fmt::format(R"({}, "{}" {} = {})", cCurrentModuleObject, thisDOAS.Name, cFieldName, thisDOAS.NumOfAirLoops));
std::format(R"({}, "{}" {} = {})", cCurrentModuleObject, thisDOAS.Name, cFieldName, thisDOAS.NumOfAirLoops));
ShowContinueError(state, " The minimum value should be 1.");
errorsFound = true;
}
Expand All @@ -859,8 +858,8 @@ namespace AirLoopHVACDOAS {
thisDOAS.m_AirLoopNum.push_back(LoopNum);
} else {
cFieldName = "AirLoopHVAC Name";
ShowSevereError(
state, EnergyPlus::format(R"({}, "{}" {} not found: {})", cCurrentModuleObject, thisDOAS.Name, cFieldName, name));
ShowSevereError(state,
std::format(R"({}, "{}" {} not found: {})", cCurrentModuleObject, thisDOAS.Name, cFieldName, name));
errorsFound = true;
}
}
Expand All @@ -871,23 +870,22 @@ namespace AirLoopHVACDOAS {

if (!OutAirNodeManager::CheckOutAirNodeNumber(state, thisDOAS.m_InletNodeNum)) {
ShowSevereError(state,
EnergyPlus::format("Inlet node ({}) is not one of OutdoorAir:Node in {} = {}",
state.dataLoopNodes->NodeID(thisDOAS.m_InletNodeNum),
CurrentModuleObject,
thisDOAS.Name));
std::format("Inlet node ({}) is not one of OutdoorAir:Node in {} = {}",
state.dataLoopNodes->NodeID(thisDOAS.m_InletNodeNum),
CurrentModuleObject,
thisDOAS.Name));
errorsFound = true;
}

// Ensure the outlet node is the splitter inlet node, otherwise issue a severe error
if (thisDOAS.m_OutletNodeNum != thisDOAS.m_CompPointerAirLoopSplitter->InletNodeNum) {
ShowSevereError(state,
EnergyPlus::format("The outlet node is not the inlet node of AirLoopHVAC:Splitter in {} = {}",
CurrentModuleObject,
thisDOAS.Name));
ShowSevereError(
state,
std::format("The outlet node is not the inlet node of AirLoopHVAC:Splitter in {} = {}", CurrentModuleObject, thisDOAS.Name));
ShowContinueError(state,
EnergyPlus::format("The outlet node name is {}, and the inlet node name of AirLoopHVAC:Splitter is {}",
state.dataLoopNodes->NodeID(thisDOAS.m_OutletNodeNum),
state.dataLoopNodes->NodeID(thisDOAS.m_CompPointerAirLoopSplitter->InletNodeNum)));
std::format("The outlet node name is {}, and the inlet node name of AirLoopHVAC:Splitter is {}",
state.dataLoopNodes->NodeID(thisDOAS.m_OutletNodeNum),
state.dataLoopNodes->NodeID(thisDOAS.m_CompPointerAirLoopSplitter->InletNodeNum)));
errorsFound = true;
}
}
Expand All @@ -897,8 +895,8 @@ namespace AirLoopHVACDOAS {
if (Util::SameString(state.dataAirLoop->OutsideAirSys(OASysNum).ControllerListName, "")) {
if (state.dataAirLoop->OutsideAirSys(OASysNum).AirLoopDOASNum == -1) {
ShowSevereError(state,
EnergyPlus::format(R"(AirLoopHVAC:OutdoorAirSystem = "{}" invalid Controller List Name = " not found.)",
state.dataAirLoop->OutsideAirSys(OASysNum).Name));
std::format(R"(AirLoopHVAC:OutdoorAirSystem = "{}" invalid Controller List Name = " not found.)",
state.dataAirLoop->OutsideAirSys(OASysNum).Name));
errorsFound = true;
}
}
Expand Down Expand Up @@ -1034,13 +1032,13 @@ namespace AirLoopHVACDOAS {
Real64 supplyFanVolFlow = state.dataFans->fans(this->m_FanIndex)->maxAirFlowRate;
if (supplyFanVolFlow != DataSizing::AutoSize) {
if (std::abs((supplyFanVolFlow - sizingVolumeFlow) / sizingVolumeFlow) > 0.01) {
ShowWarningError(state, EnergyPlus::format("AirLoopHVAC:DedicatedOutdoorAirSystem = {}.", this->Name));
ShowWarningError(state, std::format("AirLoopHVAC:DedicatedOutdoorAirSystem = {}.", this->Name));
ShowContinueError(state,
std::format("The supply fan = {} has a volumetric air flow rate = {} m3/s.",
state.dataFans->fans(this->m_FanIndex)->Name,
supplyFanVolFlow));
ShowContinueError(state,
EnergyPlus::format("The supply fan = {} has a volumetric air flow rate = {} m3/s.",
state.dataFans->fans(this->m_FanIndex)->Name,
supplyFanVolFlow));
ShowContinueError(
state, EnergyPlus::format("The AirLoopHVAC:DedicatedOutdoorAirSystem Design Volume Flow Rate = {} m3/s.", sizingVolumeFlow));
std::format("The AirLoopHVAC:DedicatedOutdoorAirSystem Design Volume Flow Rate = {} m3/s.", sizingVolumeFlow));
ShowContinueError(state, "Consider autosizing the supply fan Maximum Air Flow Rate.");
}
} else {
Expand All @@ -1060,14 +1058,13 @@ namespace AirLoopHVACDOAS {
Real64 exhaustFanVolFlow = state.dataFans->fans(this->m_exhaustFanIndex)->maxAirFlowRate;
if (exhaustFanVolFlow != DataSizing::AutoSize) {
if (std::abs((exhaustFanVolFlow - sizingVolumeFlow) / sizingVolumeFlow) > 0.01) {
ShowWarningError(state, EnergyPlus::format("AirLoopHVAC:DedicatedOutdoorAirSystem = {}.", this->Name));
ShowWarningError(state, std::format("AirLoopHVAC:DedicatedOutdoorAirSystem = {}.", this->Name));
ShowContinueError(state,
EnergyPlus::format("The exhaust fan = {} has a volumetric air flow rate = {} m3/s.",
state.dataFans->fans(this->m_exhaustFanIndex)->Name,
exhaustFanVolFlow));
std::format("The exhaust fan = {} has a volumetric air flow rate = {} m3/s.",
state.dataFans->fans(this->m_exhaustFanIndex)->Name,
exhaustFanVolFlow));
ShowContinueError(
state,
EnergyPlus::format("The AirLoopHVAC:DedicatedOutdoorAirSystem Design Volume Flow Rate = {} m3/s.", sizingVolumeFlow));
state, std::format("The AirLoopHVAC:DedicatedOutdoorAirSystem Design Volume Flow Rate = {} m3/s.", sizingVolumeFlow));
ShowContinueError(state, "Consider autosizing the exhaust fan Maximum Air Flow Rate.");
}
} else {
Expand Down Expand Up @@ -1159,15 +1156,15 @@ namespace AirLoopHVACDOAS {
if (maxDiff > 1.0e-6) {
if (loop.ConveCount == 0) {
++loop.ConveCount;
ShowWarningError(state, EnergyPlus::format("Convergence limit is above 1.0e-6 for unit={}", loop.Name));
ShowWarningError(state, std::format("Convergence limit is above 1.0e-6 for unit={}", loop.Name));
ShowContinueErrorTimeStamp(
state,
EnergyPlus::format("The max difference of node temperatures between AirLoopDOAS outlet and OA mixer inlet ={:.6R}", maxDiff));
} else {
++loop.ConveCount;
ShowRecurringWarningErrorAtEnd(
state,
EnergyPlus::format(R"("{}": The max difference of node temperatures exceeding 1.0e-6 continues...)", loop.Name),
std::format(R"("{}": The max difference of node temperatures exceeding 1.0e-6 continues...)", loop.Name),
loop.ConveIndex,
maxDiff,
maxDiff);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ namespace AirflowNetwork {
Real64 viscosity;

AirState();
explicit AirState(double const airDensity);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Just making the definition and declaration names the same.

explicit AirState(double density);
};

} // namespace AirflowNetwork
Expand Down
2 changes: 2 additions & 0 deletions src/EnergyPlus/AirflowNetwork/src/Elements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

// Local Headers
#include "AirflowNetwork/Elements.hpp"
#include "AirflowNetwork/Properties.hpp"
#include "AirflowNetwork/Solver.hpp"

// EnergyPlus Headers
#include "../../Data/EnergyPlusData.hh"
#include "../../DataAirLoop.hh"
#include "../../DataEnvironment.hh"
Expand Down
5 changes: 4 additions & 1 deletion src/EnergyPlus/AirflowNetwork/src/Properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

// Local Headers
#include "AirflowNetwork/Properties.hpp"
#include <EnergyPlus/Data/EnergyPlusData.hh>

// EnergyPlus Headers
#include <EnergyPlus/General.hh>
#include <EnergyPlus/UtilityRoutines.hh>

namespace EnergyPlus {

Expand Down
Loading
Loading