Skip to content

Conversation

@yzhou601
Copy link
Contributor

@yzhou601 yzhou601 commented Apr 2, 2019

Pull request overview

EnergyPlus would be modified to add more enumarations in Coil:WaterHeating:Desuperheater object's heating source object type and tank object type fields.

Work Checklist

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)
  • At least one of the following appropriate labels must be added to this PR to be consumed into the changelog:
    • Defect: This pull request repairs a github defect issue. The github issue should be referenced in the PR description
    • Refactoring: This pull request includes code changes that don't change the functionality of the program, just perform refactoring
    • NewFeature: This pull request includes code to add a new feature to EnergyPlus
    • Performance: This pull request includes code changes that are directed at improving the runtime performance of EnergyPlus
    • DoNoPublish: This pull request includes changes that shouldn't be included in the changelog

Review Checklist

This will not be exhaustively relevant to every PR.

  • Functional code review (it has to work!)
  • CI status: all green or justified
  • Performance: CI Linux results include performance check
  • Unit Test(s)
  • C++ checks:
    • Argument types
    • If any virtual classes, ensure virtual destructor included, other things
  • IDD changes:
    • Verify naming conventions and styles, memos and notes and defaults
    • Open windows IDF Editor with modified IDD to check for errors
  • If new idf included, locally check the err file and other outputs
  • Required documentation updates?

@yzhou601 yzhou601 changed the title Gshp desuperheater Add More Coil and Tank Choices for Desuperheater Apr 3, 2019
@nmerket
Copy link

nmerket commented Apr 5, 2019

@Myoldmopar I'm having a hard time making heads or tails of the failing CI results here. Are they legitimate or is there something else going on? Maybe we should pull in develop?

@yzhou601
Copy link
Contributor Author

@nmerket @shorowit
One test added, welcome to comment!

@yzhou601
Copy link
Contributor Author

Multispeed coil capability added in #7271 Pull Request

@yzhou601
Copy link
Contributor Author

yzhou601 commented Jul 19, 2019

@mjwitte @rraustad @nmerket The multispeed coil already has reclaimed heat calculation within DXcoils.cc, so I simply added the connection in WaterThermalTanks.cc. One thing looks a little bit confusing is that the Coil:Cooling:DX:TwoSpeed used COIL_DX_MULTISPEED as reclaim source label. So I made them sharing the same label in WaterThermalTanks.cc. They didn't have anything unique in these functions so it worked out well.

The multispeed desuperheater energy and available reclaimed heat were plotted below, the desuperheater coil only heats when cooling coil is working . The desuperheater setpoint is 60C never achieved in these plotted points so the source mass flow rate and desuperheater energy should be of the same shape as available reclaimed heat. Since this is a DX cooling coil, the impact of reclaiming heat is neglected (no reclaimed heat data return back to coil calculation).

image

image

I surprisingly found when I tried to use a model with Kiva to install desuperheater, the initial model (without desuperheater) crashed with runperiod starting from 05/01, but worked well with runperiod starting from 01/01. It failed even in latest develop branch with an error shown below. I think this might be a bug in kiva? If you want the model starting 05/01, click here to GoogleDrive
image

@rraustad
Copy link
Contributor

For desuperheaters, I think COIL_DX_MULTISPEED is specific to Coil:Cooling:DX:TwoSpeed so this is (sort of) OK as far as I can tell. If anyone ever adds Coil:Cooling:DX:MultiSpeed as a source for desuperheaters, and does not catch/correct this subtlety (if it needs correction to work properly), then this may be a problem.

@rraustad
Copy link
Contributor

rraustad commented Jul 19, 2019

In your test file, what is the reclaim efficiency for the desuperheater? It looks to be about 10% in your plot. I ask because I thought 30% was the typical choice. And you are plotting Cooling Coil Electric Energy, not Cooling Coil Total Cooling Energy (and 10% is higher than it would be when comparing to Cooling Energy).

Coil:WaterHeating:Desuperheater,
  0.3,             !- Rated Heat Reclaim Recovery Efficiency

@rraustad
Copy link
Contributor

Oh, you are comparing to Electric + Cooling Energy. So why does this look like about 10%? Is reclaim efficiency = 0.1?

@yzhou601
Copy link
Contributor Author

yzhou601 commented Jul 19, 2019

Oh, you are comparing to Electric + Cooling Energy. So why does this look like about 10%? Is reclaim efficiency = 0.1?

Hi, @rraustad , I set the reclaim efficiency as 0.25 in my test file. I am quite sure it might be caused by this line 9095.
In the test file, the ratio reclaimed divided by total available is about 0.105469 all the time when desuperheater is available.

image

There seems to be an internal iteration happens within water thermal tank simulation (which makes the subtraction happens more than once per time step, I estimated it happens four times in this model, see below the calculation for this assumed issue:)

Iterations AvailCapacity Ratio reclaimed)
1 1.000000 0.250000
2 0.750000 0.187500
3 0.562500 0.140625
4 0.421875 0.105469

I also ran an existing desuperheater model (Coil:Cooling:DX:SingleSpeed) with E+ 9.1.0, it also gave a very similar result:

image

So I would think it's an old bug need to be fixed. I am not sure if it should be done in this PR?

If you want to check these two models:
SingleSpeedCoolingCoil
MultiSpeedCoolingCoil

And I ran with Tampa 722110 weather.

@yzhou601
Copy link
Contributor Author

For desuperheaters, I think COIL_DX_MULTISPEED is specific to Coil:Cooling:DX:TwoSpeed so this is (sort of) OK as far as I can tell. If anyone ever adds Coil:Cooling:DX:MultiSpeed as a source for desuperheaters, and does not catch/correct this subtlety (if it needs correction to work properly), then this may be a problem.

I would also think this might be fine with either TwoSpeed or MultiSpeed or together. I searched within the scope of water thermal tanks functions, I am pretty sure they followed exactly the same workflow and called the same functions in all those ifs. And awkwardly the two speed coil has taken up the name of multi-speed, so I simply combined them. 😝

@rraustad
Copy link
Contributor

@yzhou601, this is not on you (but we like to know what is wrong). You have done more than expected. Just identify what is wrong and make a new issue. We can fix it there.

@rraustad
Copy link
Contributor

The reclaim efficiency of 25% is applied to the available coil heat rejection (including impact of PLR) so seeing heat reclaim of 0.1 is OK if PLR = 0.4. So desuperheater heat reclaim divided by coil PLR will always = 25%.

@yzhou601
Copy link
Contributor Author

Thanks @rraustad!
@rraustad @nmerket @mjwitte @Myoldmopar Tell me if there's anything else needs to change in this PR.

@yzhou601 yzhou601 requested a review from rraustad July 25, 2019 14:56
@yzhou601 yzhou601 added this to the EnergyPlus 9.2.0 milestone Jul 30, 2019
Copy link
Contributor

@rraustad rraustad left a comment

Choose a reason for hiding this comment

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

The work here appears complete. No further comments on this PR.

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.

Almost there.
I've retested this and the water side source energy balance with desuperheater vs no-desuperheat is very close now.

Just a couple of other minor comments.

@mjwitte
Copy link
Contributor

mjwitte commented Aug 2, 2019

@Myoldmopar Have your comments been resolved? OK to merge?



3. Reclaimed heat calculation: The calculation of reclaimed heat is coded in WaterThermalTank namespace, the same approach as other available systems for mixed water heater tank.

Copy link
Member

Choose a reason for hiding this comment

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

👍

@Myoldmopar Myoldmopar merged commit b1f114a into NREL:develop Aug 3, 2019
@yzhou601 yzhou601 deleted the GSHP_desuperheater branch August 5, 2019 16:06
@yzhou601
Copy link
Contributor Author

Hi, @rraustad @mjwitte , some updates of this PR.

Thanks to @rraustad 's array approach, the results run locally with gshp cooling coil + desuperheater + stratified tank now track energy as intended:

image

Array is allocated by the number of water heating desuperheater objects, so that it could directly use the desuperheater index as pointer. The use of "DesuperheaterReclaimedHeat" now changed to "WaterHeatingDesuperheaterReclaimedHeat" to be more specific.

@rraustad @mjwitte Something weird here, I ran the same test file here with released E+ 9.2.0, the coil source side energy is no longer balanced as shown in the table. I revisited the codes where I made those changes, they are, however, kept untouched. The energy balance between coil source side and desuperheater reclaimed heat was verified when tested on July 17 and retested by @mjwitte on July 31, I didn't know if there's any change made later at its top broke things here.
The 9.2.0 released version results, if looking on the tank side, the reclaimed heat, though changed, is still reasonable compared with previous results. But the (coil cooling energy + coil electric energy - reclaimed heat) is not equal to coil source energy.
Appreciate it very much if you can help take a look at this. Please let me know if you have any clue.

test file
epw: Tampa 722110

@mjwitte
Copy link
Contributor

mjwitte commented Nov 18, 2019

@yzhou601 Looking at my test files from then and re-rerunning those now, I get similar results (then and now). I'd suggest building a version with the commit where you added the desuperheater array approach - and reconfirm that it balances. Then use git bisect between that commit and the final v9.2.0 commit to find when the results changed to be imbalanced.

@yzhou601 yzhou601 restored the GSHP_desuperheater branch November 18, 2019 21:02
@yzhou601
Copy link
Contributor Author

yzhou601 commented Nov 19, 2019

@mjwitte Thanks very much for revisiting these tests, Mike. I followed your suggestion, and just recalled some detail that caused this confusion.

When I was testing and summarizing that table in previous comment, I found in WaterToAirHeatPump.cc, Qsource is initially calculated by these lines. It's adjusted by QSource_fullload (defined previously as sum of Winput and QLoadTotal) applying PartLoadRatio while Winput(Later is taken for reporting Cooling coil electric energy) is taking RuntimeFrac. So it's the difference between PartLoadRatio and RuntimeFrac that caused:
Cooling Coil Total Cooling Energy + Cooling Coil Electric Energy != Cooling Coil Source Side Heat Transfer Energy

So that means this issue is not just for desuperheater coupled with gshp, but all gshp systems with this coil type( not sure if other coil follows the same way). To separate this impact, I did a build with RTF forced to be equal to PLR, that's why the previous table showed perfect energy balance. And I rebuilt the current master branch and tracked a few hours, the energy was balanced excluding the RTF and PLR difference.

So, do you think this is a defect of calculating Qsource (should it directly sum those adjusted Winput and QLoadTotal again instead of applying PLR)?

Once I talked with @rraustad for this issue, but didn't have any conclusion at that point for Qsource since we only focused on things related to desuperheater.

@rraustad
Copy link
Contributor

rraustad commented Nov 19, 2019

That makes perfect sense. The thermal energy is typically proportional to PLR while electrical energy is proportional to RTF, or at least that's how E+ has always handled thermal vs electrical for air systems since the compressor energy does not impact the air stream in cooling mode. For water coils E+ currently uses:

QSource_fullload = QLoadTotal + Winput; (total energy available for thermal transfer)
QSource = QSource_fullload * PartLoadRatio; (actual thermal energy)
SetupOutputVariable("Cooling Coil Source Side Heat Transfer Rate", OutputProcessor::Unit::W,
                                    SimpleWatertoAirHP(HPNum).QSource,  "System", "Average",
                                    SimpleWatertoAirHP(HPNum).Name);

But this source side energy transfer is missing the additional electrical energy due to startup losses. Since RTF = PLR / PLF, then the actual thermal energy should include the additional electrical energy required for startup.

    These lines seem correct but where do the startup electrical losses go?
    QLoadTotal *= PartLoadRatio;
    QSensible *= PartLoadRatio;
    Winput *= RuntimeFrac; (includes startup losses)

     so this line:
    QSource = QSource_fullload * PartLoadRatio;
     should be changed (if I am thinking through this clearly) to:
    QSource = QLoadTotal + Winput;

and then Cooling Coil Electric Energy + Cooling Coil Total Cooling Energy will equal Cooling Coil Source Side Heat Transfer Energy.

At least that is the idea to correct these differences. I think this same mentality should apply to air systems in heating mode.

@yzhou601
Copy link
Contributor Author

That makes perfect sense. The thermal energy is typically proportional to PLR while electrical energy is proportional to RTF, or at least that's how E+ has always handled thermal vs electrical for air systems since the compressor energy does not impact the air stream in cooling mode. For water coils E+ currently uses:

QSource_fullload = QLoadTotal + Winput; (total energy available for thermal transfer)
QSource = QSource_fullload * PartLoadRatio; (actual thermal energy)
SetupOutputVariable("Cooling Coil Source Side Heat Transfer Rate", OutputProcessor::Unit::W,
                                    SimpleWatertoAirHP(HPNum).QSource,  "System", "Average",
                                    SimpleWatertoAirHP(HPNum).Name);

But this source side energy transfer is missing the additional electrical energy due to startup losses. Since RTF = PLR / PLF, then the actual thermal energy should include the additional electrical energy required for startup (or QSource *= PLF, where PLF is calculated in the parent and not available here).

    These lines seem correct but where do the startup electrical losses go?
    QLoadTotal *= PartLoadRatio;
    QSensible *= PartLoadRatio;
    Winput *= RuntimeFrac; (includes startup losses)

     so this line:
    QSource = QSource_fullload * PartLoadRatio;
     should be changed (if I am thinking through this clearly) to:
    QSource = QLoadTotal + Winput;

and then Cooling Coil Electric Energy + Cooling Coil Total Cooling Energy will equal Cooling Coil Source Side Heat Transfer Energy.

At least that is the idea to correct these differences. I think this same mentality should apply to air systems in heating mode.

Thanks Richard, if it's fair enough I can open up a new PR to correct this along with the remaining reclaimed heat issue #7407 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

IDDChange Code changes impact the IDD file (cannot be merged after IO freeze) NewFeature Includes code to add a new feature to EnergyPlus

Projects

None yet

Development

Successfully merging this pull request may close these issues.