Skip to content

Commit

Permalink
FluidProperties through HVACUnitaryBypassVAV
Browse files Browse the repository at this point in the history
  • Loading branch information
rraustad committed Aug 19, 2024
1 parent 2fda843 commit 842b109
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 76 deletions.
92 changes: 35 additions & 57 deletions src/EnergyPlus/FluidProperties.cc

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/EnergyPlus/FluidProperties.hh
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ namespace FluidProperties {
int UpperBound // Valid values upper bound (set by calling program)
);

bool CheckFluidPropertyName(EnergyPlusData &state,
bool CheckFluidPropertyName(EnergyPlusData const &state,
std::string const &NameToCheck); // Name from input(?) to be checked against valid FluidPropertyNames

void ReportOrphanFluids(EnergyPlusData &state);
Expand Down
8 changes: 1 addition & 7 deletions src/EnergyPlus/Furnaces.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2768,8 +2768,6 @@ namespace Furnaces {
// Get fan data
FanName = Alphas(7);

errFlag = false;

thisFurnace.fanType = static_cast<HVAC::FanType>(getEnumValue(HVAC::fanTypeNamesUC, Alphas(6)));

if (thisFurnace.fanType == HVAC::FanType::OnOff || thisFurnace.fanType == HVAC::FanType::Constant) {
Expand Down Expand Up @@ -4739,11 +4737,7 @@ namespace Furnaces {

if (!state.dataGlobal->DoingSizing && state.dataFurnaces->MySecondOneTimeFlag(FurnaceNum)) {
// sizing all done. check fan air flow rates
errFlag = false;
thisFurnace.ActualFanVolFlowRate = state.dataFans->fans(thisFurnace.FanIndex)->maxAirFlowRate;
if (errFlag) {
ShowContinueError(state, format("...occurs in {} ={}", HVAC::unitarySysTypeNames[(int)thisFurnace.type], thisFurnace.Name));
}
if (thisFurnace.ActualFanVolFlowRate != DataSizing::AutoSize) {
if (thisFurnace.DesignFanVolFlowRate > thisFurnace.ActualFanVolFlowRate) {
ShowWarningError(state,
Expand Down Expand Up @@ -5001,11 +4995,11 @@ namespace Furnaces {
thisFurnace.CoolingSpeedRatio = thisFurnace.MaxCoolAirVolFlow / thisFurnace.ActualFanVolFlowRate;
thisFurnace.NoHeatCoolSpeedRatio = thisFurnace.MaxNoCoolHeatAirVolFlow / thisFurnace.ActualFanVolFlowRate;
}
std::string FanName; // used in warning messages
if (dynamic_cast<Fans::FanComponent *>(state.dataFans->fans(thisFurnace.FanIndex))->powerRatioAtSpeedRatioCurveNum > 0) {
if (thisFurnace.ActualFanVolFlowRate == thisFurnace.MaxHeatAirVolFlow &&
thisFurnace.ActualFanVolFlowRate == thisFurnace.MaxCoolAirVolFlow &&
thisFurnace.ActualFanVolFlowRate == thisFurnace.MaxNoCoolHeatAirVolFlow) {
std::string FanName = state.dataFans->fans(thisFurnace.FanIndex)->Name;
ShowWarningError(state, format("{} \"{}\"", HVAC::unitarySysTypeNames[(int)thisFurnace.type], thisFurnace.Name));
ShowContinueError(state,
format("...For fan type and name = {} \"{}\"", HVAC::fanTypeNames[(int)thisFurnace.fanType], FanName));
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/HVACInterfaceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void UpdateHVACInterface(EnergyPlusData &state,
Real64 totDemandSideMaxAvail = 0.0;
for (int demIn = 1; demIn <= state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).NumSupplyNodes; ++demIn) {
int demInNode = state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).ZoneEquipSupplyNodeNum(demIn);
auto &node = state.dataLoopNodes->Node(demInNode);
auto const &node = state.dataLoopNodes->Node(demInNode);
totDemandSideMassFlow += node.MassFlowRate;
totDemandSideMinAvail += node.MassFlowRateMinAvail;
totDemandSideMaxAvail += node.MassFlowRateMaxAvail;
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/HVACManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2051,7 +2051,7 @@ void ResolveLockoutFlags(EnergyPlusData &state, bool &SimAir) // TRUE means air
}
}

void ResetHVACControl(EnergyPlusData &state)
void ResetHVACControl(EnergyPlusData const &state)
{

// SUBROUTINE INFORMATION:
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/HVACManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ namespace HVACManager {

void ResolveLockoutFlags(EnergyPlusData &state, bool &SimAir); // TRUE means air loops must be (re)simulated

void ResetHVACControl(EnergyPlusData &state);
void ResetHVACControl(EnergyPlusData const &state);

void ResetNodeData(EnergyPlusData &state);

Expand Down
5 changes: 1 addition & 4 deletions src/EnergyPlus/HVACStandAloneERV.cc
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,13 @@ void GetStandAloneERV(EnergyPlusData &state)
ShowContinueError(state, format("... occurs in {} \"{}\"", CurrentModuleObject, standAloneERV.Name));
ErrorsFound = true;
}

standAloneERV.DesignHXVolFlowRate = HXSupAirFlowRate;

standAloneERV.SupplyAirFanName = Alphas(4);
GlobalNames::IntraObjUniquenessCheck(
state, Alphas(4), CurrentModuleObject, cAlphaFields(4), state.dataHVACStandAloneERV->SupplyAirFanUniqueNames, ErrorsFound);

errFlag = false;

if ((standAloneERV.SupplyAirFanIndex = Fans::GetFanIndex(state, standAloneERV.SupplyAirFanName)) == 0) {
ShowSevereItemNotFound(state, eoh, cAlphaFields(4), standAloneERV.SupplyAirFanName);
ErrorsFound = true;
Expand All @@ -297,7 +296,6 @@ void GetStandAloneERV(EnergyPlusData &state)
standAloneERV.ExhaustAirFanName = Alphas(5);
GlobalNames::IntraObjUniquenessCheck(
state, Alphas(5), CurrentModuleObject, cAlphaFields(5), state.dataHVACStandAloneERV->ExhaustAirFanUniqueNames, ErrorsFound);
errFlag = false;

if ((standAloneERV.ExhaustAirFanIndex = Fans::GetFanIndex(state, standAloneERV.ExhaustAirFanName)) == 0) {
ShowSevereItemNotFound(state, eoh, cAlphaFields(5), standAloneERV.ExhaustAirFanName);
Expand Down Expand Up @@ -1695,7 +1693,6 @@ int getEqIndex(EnergyPlusData &state, std::string_view CompName)
for (int StandAloneERVNum = 1; StandAloneERVNum <= state.dataHVACStandAloneERV->NumStandAloneERVs; StandAloneERVNum++) {
if (Util::SameString(CompName, state.dataHVACStandAloneERV->StandAloneERV(StandAloneERVNum).Name)) {
return StandAloneERVNum;
break;
}
}
return 0;
Expand Down
7 changes: 3 additions & 4 deletions src/EnergyPlus/HVACUnitaryBypassVAV.cc
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ namespace HVACUnitaryBypassVAV {
bool ErrorsFound(false); // Set to true if errors in input, fatal at end of routine
bool DXErrorsFound(false); // Set to true if errors in get coil input
Array1D_int OANodeNums(4); // Node numbers of OA mixer (OA, EA, RA, MA)
std::string HXDXCoolCoilName; // Name of DX cooling coil used with Heat Exchanger Assisted Cooling Coil
bool DXCoilErrFlag; // used in warning messages

Array1D_string Alphas(20, "");
Expand Down Expand Up @@ -754,7 +753,7 @@ namespace HVACUnitaryBypassVAV {
ShowContinueError(state, format("...occurs in {} \"{}\"", thisCBVAV.UnitType, thisCBVAV.Name));
ErrorsFound = true;
} else {
auto &newCoil = state.dataCoilCooingDX->coilCoolingDXs[thisCBVAV.DXCoolCoilIndexNum];
auto const &newCoil = state.dataCoilCooingDX->coilCoolingDXs[thisCBVAV.DXCoolCoilIndexNum];
thisCBVAV.DXCoilInletNode = newCoil.evapInletNodeIndex;
thisCBVAV.DXCoilOutletNode = newCoil.evapOutletNodeIndex;
thisCBVAV.CondenserNodeNum = newCoil.condInletNodeIndex;
Expand Down Expand Up @@ -2444,7 +2443,7 @@ namespace HVACUnitaryBypassVAV {
}
// now find the speed ratio for the found speednum
auto f = [&state, CBVAVNum, SpeedNum, DesOutTemp](Real64 const SpeedRatio) {
auto &thisCBVAV = state.dataHVACUnitaryBypassVAV->CBVAV(CBVAVNum);
auto const &thisCBVAV = state.dataHVACUnitaryBypassVAV->CBVAV(CBVAVNum);
// FUNCTION LOCAL VARIABLE DECLARATIONS:
Real64 OutletAirTemp; // outlet air temperature [C]
Real64 QZnReqCycling = 0.001;
Expand Down Expand Up @@ -3429,7 +3428,7 @@ namespace HVACUnitaryBypassVAV {

// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
Real64 ZoneLoad = 0.0; // Total load in controlled zone [W]
int lastDayOfSim(0); // used during warmup to reset changeOverTimer since need to do same thing next warmup day
int lastDayOfSim(0); // used during warmup to reset changeOverTimer since need to do same thing next warmup day

auto &cBVAV = state.dataHVACUnitaryBypassVAV->CBVAV(CBVAVNum);

Expand Down

1 comment on commit 842b109

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

CppCheck-FluidProperties (rraustad) - x86_64-MacOS-10.18-clang-15.0.0: Tests Failed (1629 of 3665 tests passed, 0 test warnings)

Build Badge Test Badge

Please sign in to comment.