Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Address VS DX cooling coil outlet air condition calculation problem when PLR is zero #8607

Merged
merged 7 commits into from
Mar 16, 2021

Conversation

Nigusse
Copy link
Contributor

@Nigusse Nigusse commented Mar 10, 2021

Pull request overview

Pull Request Author

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

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • If any diffs are expected, author must demonstrate they are justified using plots and descriptions
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions
  • If any defect files are updated to a more recent version, upload new versions here or on DevSupport
  • If IDD requires transition, transition source, rules, ExpandObjects, and IDFs must be updated, and add IDDChange label
  • If structural output changes, add to output rules file and add OutputChange label
  • If adding/removing any LaTeX docs or figures, update that document's CMakeLists file dependencies

Reviewer

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally
  • Check any new function arguments for performance impacts
  • Verify IDF naming conventions and styles, memos and notes and defaults
  • If new idf included, locally check the err file and other outputs

@Nigusse Nigusse added the Defect Includes code to repair a defect in EnergyPlus label Mar 10, 2021
@Nigusse Nigusse changed the title Address VS DX cooling coil outlet air condition calculation problem when PLR is zero or low Address VS DX cooling coil outlet air condition calculation problem when PLR is zero Mar 10, 2021
if ((PartLoadRatio > 0.0 && CyclingScheme == ContFanCycCoil) || (CyclingScheme == CycFanCycCoil)) {
// calculate coil outlet state variables
state.dataVariableSpeedCoils->LoadSideOutletEnth = state.dataVariableSpeedCoils->LoadSideInletEnth - state.dataVariableSpeedCoils->QLoadTotal / state.dataVariableSpeedCoils->LoadSideMassFlowRate;
state.dataVariableSpeedCoils->LoadSideOutletDBTemp = state.dataVariableSpeedCoils->LoadSideInletDBTemp - state.dataVariableSpeedCoils->QSensible / (state.dataVariableSpeedCoils->LoadSideMassFlowRate * CpAir);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Avoids calculating the VS DX cooling coil when the compressor PLR is zero and the fan operating mode is ContFanCycCoil. Otherwise, allowing it sometimes may result in very cold coil outlet air condition that leads to psychometric error message.

@@ -2702,6 +2702,9 @@ TEST_F(ZoneUnitarySysTest, UnitarySystemModel_MultispeedPerformance)
bool const ZoneEquipment = true;
Real64 sensOut = 0.0;
Real64 latOut = 0.0;

// this setup is a continuous fan cycling coil op mode
thisSys->m_FanOpMode = DataHVACGlobals::ContFanCycCoil;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this to correct a failing unit test.

state.dataVariableSpeedCoils->LoadSideOutletHumRat = PsyWFnTdbH(state, state.dataVariableSpeedCoils->LoadSideOutletDBTemp, state.dataVariableSpeedCoils->LoadSideOutletEnth, RoutineName);
if (state.dataVariableSpeedCoils->LoadSideOutletHumRat > MaxHumRat) {
state.dataVariableSpeedCoils->LoadSideOutletHumRat = MaxHumRat;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is part of the same change.

EXPECT_NEAR(state->dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp, 5.79484, 0.00001);
EXPECT_NEAR(state->dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat, 0.00810, 0.00001);
EXPECT_NEAR(state->dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirEnthalpy, 26170.26, 0.01);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New unit test.

// check coil outlet and inlet air conditions match
EXPECT_EQ(state->dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirDBTemp, state->dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirDBTemp);
EXPECT_EQ(state->dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirHumRat, state->dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirHumRat);
EXPECT_EQ(state->dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletAirEnthalpy, state->dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletAirEnthalpy);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This shows the coil outlet node air condition matches that of the inlet air condition when the PLR is zero.

@Nigusse Nigusse added this to the EnergyPlus 9.5.0 milestone Mar 11, 2021
@Nigusse
Copy link
Contributor Author

Nigusse commented Mar 11, 2021

This is branch is ready for review.

@mjwitte
Copy link
Contributor

mjwitte commented Mar 12, 2021

@Nigusse Is there a defect file for this? Any before/after results to look at?

@Nigusse
Copy link
Contributor Author

Nigusse commented Mar 15, 2021

@mjwitte defect file is attached. This is the same defect file we used for issue #8497.
RAT_VAVSys_wZnMxYes_AddInf_woDiningExhFan.idf.txt

I just run the defect file before and after the fix. The fix has eliminated the error message from CalcVarSpeedCoilCooling() function, where this fix was done but there is also the same error message coming from calls made in other unknowm function. But the recurring error message has reduced.

Before the fix:

   ** Warning ** Enthalpy out of range (PsyTsatFnHPb)
   **   ~~~   **  Routine=Unknown, Environment=JANUARY RUN, at Simulation time=01/01 05:40 - 06:00
   **   ~~~   **  Enthalpy=-45222.26861 Pressure= 99500.00
   **   ~~~   **  Initial Resultant Temperature= -59.98
   ** Warning ** Calculated Humidity Ratio invalid (PsyWFnTdbH)
   **   ~~~   **  Routine=CalcVarSpeedCoilCooling, Environment=JANUARY RUN, at Simulation time=01/02 00:40 - 01:00
   **   ~~~   **  Dry-Bulb= -55.00 Enthalpy= -55543.063
   **   ~~~   ** Calculated Humidity Ratio= -1.1253E-004 ... Humidity Ratio set to .00001
   ************* The following recurring error messages occurred.
   *************
   *************  ** Warning ** Enthalpy out of range (PsyTsatFnHPb)
   *************  **   ~~~   **   This error occurred 14 total times;
   *************  **   ~~~   **   during Warmup 0 times;
   *************  **   ~~~   **   during Sizing 0 times.
   *************  **   ~~~   **   Max=-42623.546441 J/kg  Min=-50704.132749 J/kg
   *************
   *************  ** Warning ** Calculated Humidity Ratio invalid (PsyWFnTdbH)
   *************  **   ~~~   **   This error occurred 43 total times;
   *************  **   ~~~   **   during Warmup 0 times;
   *************  **   ~~~   **   during Sizing 0 times.
   *************  **   ~~~   **   Max=-1.031273E-004 []  Min=-2.962171E-003 []

After the fix:

   ** Warning ** Calculated Humidity Ratio invalid (PsyWFnTdbH)
   **   ~~~   **  Routine=Unknown, Environment=JANUARY RUN, at Simulation time=01/07 05:40 - 06:00
   **   ~~~   **  Dry-Bulb= -59.98 Enthalpy= -66350.122
   **   ~~~   ** Calculated Humidity Ratio= -2.5404E-003 ... Humidity Ratio set to .00001
   ************* The following recurring error messages occurred.
   *************
   *************  ** Warning ** Enthalpy out of range (PsyTsatFnHPb)
   *************  **   ~~~   **   This error occurred 14 total times;
   *************  **   ~~~   **   during Warmup 0 times;
   *************  **   ~~~   **   during Sizing 0 times.
   *************  **   ~~~   **   Max=-42623.546441 J/kg  Min=-50704.132749 J/kg
   *************
   *************  ** Warning ** Calculated Humidity Ratio invalid (PsyWFnTdbH)
   *************  **   ~~~   **   This error occurred 8 total times;
   *************  **   ~~~   **   during Warmup 0 times;
   *************  **   ~~~   **   during Sizing 0 times.
   *************  **   ~~~   **   Max=-6.352259E-004 []  Min=-2.962171E-003 []

@mjwitte
Copy link
Contributor

mjwitte commented Mar 15, 2021

@Nigusse Thanks. Is there a significant impact on energy use or leaving node conditions?

@Nigusse
Copy link
Contributor Author

Nigusse commented Mar 15, 2021

@mjwitte Let me run annual simulation and get back to you.

@Nigusse
Copy link
Contributor Author

Nigusse commented Mar 15, 2021

@mjwitte Annual energy consumption are identical. Based on the code changes energy use and DX coil outlet condition difference is not expected.

@Nigusse
Copy link
Contributor Author

Nigusse commented Mar 15, 2021

@mjwitte I will merge in develop and push the branch.

@Nigusse
Copy link
Contributor Author

Nigusse commented Mar 15, 2021

See below the zone mean air temperature and supply air temperature before and after the fix. They are identical.

ZoneAir_SAT

@mjwitte
Copy link
Contributor

mjwitte commented Mar 15, 2021

@Nigusse Oh, ok, that's good. But I'm confused, why is there no change in coil outlet condition? Was this calculation being overwritten later when the coil figures out it was off? I guess it would help if I open the full source file.

@Nigusse
Copy link
Contributor Author

Nigusse commented Mar 15, 2021

@mjwitte Yes, that is correct.

@Nigusse
Copy link
Contributor Author

Nigusse commented Mar 15, 2021

The benefit of this fix are avoid execcuting a code section that is not necessary when the PLR is zero and a continuous fan with VS cooling coil, thereby reduces the burden of computation and eliminates the PSych warning messages.

@Nigusse
Copy link
Contributor Author

Nigusse commented Mar 15, 2021

Building failed due to new unit test that needs updating to match some new dataLoopNodes globals. This is corrected now, built and ran the unit test suite locally, and all passed. I will push updated branch shortly.

@mjwitte
Copy link
Contributor

mjwitte commented Mar 15, 2021

@Nigusse This looks good except the "unknown" psych errors are bothersome. These are happening here in calTotcapSSHR_VSWSHP. Let's add the RoutineName argument to these Psych calls so the culprit for these warnings is identified. I'm not suggesting you figure out how to avoid these here. You can if you want, but I'm ok with just adding the function name here.

@Nigusse
Copy link
Contributor Author

Nigusse commented Mar 15, 2021

@mjwitte For now I will add the RoutineName only.

@mjwitte
Copy link
Contributor

mjwitte commented Mar 15, 2021

That works for me.

Copy link
Contributor

@mjwitte mjwitte left a comment

Choose a reason for hiding this comment

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

@Nigusse Looks like the Psych function arguments got added in #8577 instead of this branch, but that's not important. This one is good to go in.

@mjwitte mjwitte merged commit cb7f35f into develop Mar 16, 2021
@mjwitte mjwitte deleted the 176972354_Issue8543 branch March 16, 2021 02:44
@Nigusse
Copy link
Contributor Author

Nigusse commented Mar 16, 2021

@mjwitte I was suspicious because the line# where you commented was different but ended convincing myself that it was the correct one. I was switching between between branches working on the two issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Includes code to repair a defect in EnergyPlus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VS DX cooling coil outlet air condition calculation problem when PLR is zero for CV system
7 participants