NREL / EnergyPlus

EnergyPlus™ is a whole building energy simulation program that engineers, architects, and researchers use to model both energy consumption and water use in buildings.
https://energyplus.net
Other
1.07k stars 381 forks source link

Several OA components read incorrect component outlet node index #7686

Closed rraustad closed 4 years ago

rraustad commented 4 years ago

Issue overview

While updating HVAC models for the OA system a code mistake was discovered where the component outlet node is set equal to the OA Sys component inlet node.

The issue occurs in function AirLoopDOAS::getAirLoopDOASInput

Notice for the balanced HX there are: OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) =

but for each component thereafter is: OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) =

Also, the flag errorsFound used to set InletNodeErrFlag and OutletNodeErrFlag is not reset after the inlet node check and both warnings will be reported even when the outlet node is correct.

if (InletNodeErrFlag) {
    ShowSevereError("Inlet node number is not found in " + CurrentModuleObject + " = " + CompName);
}
if (OutletNodeErrFlag) {
    ShowSevereError("Outlet node number is not found in " + CurrentModuleObject + " = " + CompName);
}

                } else if (SELECT_CASE_var == "HEATEXCHANGER:DESICCANT:BALANCEDFLOW") {
                    OutsideAirSys(thisDOAS.m_OASystemNum).HeatExchangerFlag = true;
                    OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = HeatRecovery::GetSupplyInletNode(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound);
                    if (errorsFound) InletNodeErrFlag = true;
                    OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) =
                        HeatRecovery::GetSupplyOutletNode(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound);
                    if (errorsFound) OutletNodeErrFlag = true;
                    // Desiccant Dehumidifier
                } else if (SELECT_CASE_var == "DEHUMIDIFIER:DESICCANT:NOFANS") {
                    OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) =
                        DesiccantDehumidifiers::GetProcAirInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound);
                    if (errorsFound) InletNodeErrFlag = true;
                    OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = DesiccantDehumidifiers::GetProcAirOutletNodeNum(
                        OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound);
                    if (errorsFound) OutletNodeErrFlag = true;
                } else if (SELECT_CASE_var == "DEHUMIDIFIER:DESICCANT:SYSTEM") {
                    OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) =
                        DesiccantDehumidifiers::GetProcAirInletNodeNum(OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound);
                    if (errorsFound) InletNodeErrFlag = true;
                    OutsideAirSys(thisDOAS.m_OASystemNum).InletNodeNum(CompNum) = DesiccantDehumidifiers::GetProcAirOutletNodeNum(
                        OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), errorsFound);
                    if (errorsFound) OutletNodeErrFlag = true;
                    // Humidifiers: Humidifier:Steam:Electric and Humidifier:Steam:Gas
                } else if (SELECT_CASE_var == "HUMIDIFIER:STEAM:ELECTRIC") {

and similar to end of function.

Details

Some additional details for this issue (if relevant):

Checklist

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

lgu1234 commented 4 years ago

@rraustad If you don't take this issue, I will take it. Thanks.

rraustad commented 4 years ago

OK, go ahead.

lgu1234 commented 4 years ago

Closed via #7774