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.15k stars 392 forks source link

Fix chiller chilling when it is off #10793

Open mjwitte opened 1 month ago

mjwitte commented 1 month ago

Pull request overview

Pull Request Author

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

Reviewer

This will not be exhaustively relevant to every PR.

mjwitte commented 1 month ago

@rraustad @EnergyArchmage This condition occurs when the chiller has a load, but the chiller shuts down here due to zero condenser water flow and leaves calculate with https://github.com/NREL/EnergyPlus/blob/ec7398adcfbd2ba6bc71e72b57e3febb6cd99708/src/EnergyPlus/ChillerElectricEIR.cc#L1957-L1972

This has been set before this exit: https://github.com/NREL/EnergyPlus/blob/ec7398adcfbd2ba6bc71e72b57e3febb6cd99708/src/EnergyPlus/ChillerElectricEIR.cc#L1939 (which seems wrong, wouldn't you want to intialize outlet=inlet before that actual calcs happen?)

After this, update thinks the chiller is on, because there is a load and the evap mass flow rate is >0 so it skips the chiller of block: https://github.com/NREL/EnergyPlus/blob/ec7398adcfbd2ba6bc71e72b57e3febb6cd99708/src/EnergyPlus/ChillerElectricEIR.cc#L2585-L2594

~And those line setting condense mass flow rates to zero seem wrong, because the chiller could have flow forced through the condenser even when it's off.~ this is ok, it's for aircooled condenser.

mjwitte commented 1 month ago

Oh, never mind the condenser flow rate comment, those lines are for aircooled condenser.

github-actions[bot] commented 1 month ago

:warning: Regressions detected on macos-14 for commit ce1be3e1b48d59f30d2f7be30a1889ab5d815ad1

Regression Summary - ERR: 1
rraustad commented 1 month ago

Line 1939 does seem wrong as something to do before a potential return at line 1970. Also, as an observation, if the return at 1970 happens I would think the calc routine would want to inform other later functions that the chiller RunFlag = false,

mjwitte commented 1 month ago

Line 1939 does seem wrong as something to do before a potential return at line 1970. Also, as an observation, if the return at 1970 happens I would think the calc routine would want to inform other later functions that the chiller RunFlag = false,

Given the arguments here

void ElectricEIRChillerSpecs::simulate(
    EnergyPlusData &state, const PlantLocation &calledFromLocation, bool FirstHVACIteration, Real64 &CurLoad, bool RunFlag)

ElectricEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, bool const RunFlag)

Perhaps MyLoad should be set to zero before returning?

rraustad commented 1 month ago

Perhaps MyLoad should be set to zero before returning?

Probably, because that return value for &CurLoad will be used by the calling routine (I think) to update the remaining load.

rraustad commented 1 month ago

If the calling routine does use &CurLoad then I would think that MyLoad should represent exactly what load the chiller met. I don't think I have ever considered that before.

EnergyArchmage commented 1 month ago

Yes, that is the idea. So it can update remaining load for dispatch to other machines if any.

github-actions[bot] commented 1 month ago

:warning: Regressions detected on macos-14 for commit 41d5e1876cb1c3f655d955516fa1e1d46192d31a

Regression Summary - EIO: 1 - ERR: 1 - ESO Big Diffs: 1 - Table Big Diffs: 1
github-actions[bot] commented 1 month ago

:warning: Regressions detected on macos-14 for commit c9e51bde7071fa454f17a3b30d889cacd4d1206a

Regression Summary - EIO: 1 - ERR: 1 - ESO Big Diffs: 1 - Table Big Diffs: 1
mjwitte commented 4 weeks ago

With the same fix applied to all chiller types, annual regression results:

  "diffs": {
    "big_math": [ 37 files ]
      "5ZoneCoolBeam", eso
      "5ZoneDetailedIceStorageSimpleCtrl", eso and mtr
      "5ZoneDetailedIceStorage", eso and mtr
      "5ZoneDetailedIceStorage2", eso and mtr
      "5ZoneDetailedIceStorageCubicLinear", eso and mtr
      "5ZoneIceStorage", eso and mtr
      "ASHRAE901_OfficeLarge_STD2019_Denver_Chiller205", eso
      "ASHRAE901_OfficeLarge_STD2019_Denver_Chiller205_Detailed", eso
      "ASHRAE901_OfficeLarge_STD2019_Denver_ChillerEIR", eso
      "CompSetPtControl", eso and mtr
      "FourPipeBeamLargeOffice", eso
      "FreeCoolingChiller_wWaterSideEconomizer", eso
      "IceStorage-Series-ChillerUpstream", eso
      "IceStorage-Series-ChillerDownstream", eso
      "RadLoTempHydrCtrlOpt", eso
      "RadLoTempHydrHeatCool", eso and mtr
      "RadLoTempHydrCtrlOpt2", eso
      "RadLoTempHydrHeatCoolDry", eso and mtr
      "RadLoTempHydrISOPipeHT", eso
      "SeriesActiveBranch", eso and mtr
      "RadLoTempHydrHeatCoolDryCondFD", eso
      "RadLoTempCFloHeatCoolCondFD", eso
      "TermReheatPri-SecLoop", eso
      "WaterSideEconomizer_NonIntegrated", eso and mtr
      "WaterCooledChillerWithVSCondenserControl", eso
      "RadLoTempHydrCtrlOpt3" eso and mtr
    ],
    "small_math": [ 61 files ]
    "big_table": [ 18 files ]
      "5ZoneDetailedIceStorageSimpleCtrl", 0.8% cooling electricity
      "5ZoneDetailedIceStorage", 0.8% cooling electricity
      "5ZoneDetailedIceStorage2", 0.8% cooling electricity
      "5ZoneDetailedIceStorageCubicLinear", 0.8% cooling electricity
      "5ZoneIceStorage", 0.8% cooling electricity, 1% pumps
      "ASHRAE901_OfficeLarge_STD2019_Denver", no big diffs in ABUPS, some <1% diffs in resilience and OA limits
      "ASHRAE901_OfficeLarge_STD2019_Denver_Chiller205", 1% heat rejection water
      "ASHRAE901_OfficeLarge_STD2019_Denver_Chiller205_Detailed", 1.1% heat rejection elec, 0.6% heat rejection water
      "ASHRAE901_OfficeLarge_STD2019_Denver_ChillerEIR", no big diffs in ABUPS, some 1-2% diffs in resilience and OA limits
      "CompSetPtControl", 2% cooling electricity, pumps, and heat rejection
      "ASHRAE901_Hospital_STD2019_Denver", no big diffs in ABUPS, some 1-2% diffs in resilience and OA limits
      "EMSPlantLoopOverrideControl", no big diffs in ABUPS, some 1-2% diffs in resilience and OA limits
      "FourPipeBeamLargeOffice", no big diffs in ABUPS, <1% diff in cooling electricity at peak demand
      "PythonPluginPlantLoopOverrideControl", no big diffs in ABUPS, some <1% diffs in Monthly Roof Irrigation(?)
      "RadLoTempHydrHeatCool", 3% district cooling, 0.1% cooling electricity
      "RadLoTempHydrHeatCoolDry", 3% district cooling, 0.1% cooling electricity
      "SeriesActiveBranch", no big diffs in ABUPS, some big diffs in peak electricity time bins
      "WaterSideEconomizer_NonIntegrated", 3% natural gas, 6% fans, 10% pumps, 
                       7% Setpoint Not Met During Occupied Cooling (increase from 144 to 512, hmmmmmm)
    ],
    "small_table": [ 16 files ]
    "textual": [ 30 files, some eio, some err, some both ]
      "5ZoneCoolBeam",
      "5ZoneDetailedIceStorageSimpleCtrl",
      "5ZoneDetailedIceStorage",
      "5ZoneDetailedIceStorage2",
      "5ZoneDetailedIceStorageCubicLinear",
      "5ZoneIceStorage",
      "ASHRAE901_OfficeLarge_STD2019_Denver",
      "ASHRAE901_OfficeLarge_STD2019_Denver_Chiller205",
      "ASHRAE901_OfficeLarge_STD2019_Denver_Chiller205_Detailed",
      "ASHRAE901_OfficeLarge_STD2019_Denver_ChillerEIR",
      "CompSetPtControl",
      "ASHRAE901_Hospital_STD2019_Denver",
      "FourPipeBeamLargeOffice",
      "IceStorage-Series-ChillerDownstream",
      "HospitalLowEnergy",
      "PlantApplicationsGuide_Example1",
      "RadLoTempHydrHeatCool",
      "RadLoTempHydrHeatCoolDry",
      "SeriesActiveBranch",
      "RadLoTempHydrHeatCoolDryCondFD",
      "WaterSideEconomizer_NonIntegrated",
      "WaterCooledChillerWithVSCondenserControl",
      "RadLoTempHydrCtrlOpt3"
    ]
github-actions[bot] commented 4 weeks ago

:warning: Regressions detected on macos-14 for commit 31375e70b99c278c2103bcc6dd64feeb4454b0a1

Regression Summary - EIO: 16 - ESO Big Diffs: 12 - MTR Small Diffs: 14 - Table Small Diffs: 7 - Table Big Diffs: 9 - ERR: 8 - Table String Diffs: 4 - ESO Small Diffs: 11 - MTR Big Diffs: 3
mjwitte commented 4 weeks ago

@rraustad I'm doubting this approach now due to these results:

"WaterSideEconomizer_NonIntegrated", 3% natural gas, 6% fans, 10% pumps, 7% Setpoint Not Met During Occupied Cooling (increase from 144 to 512, hmmmmmm)

Maybe this needs to check for (gasp) flowlock before setting MyLoad=0.0? Or skip that on FirstHVACIteration?

rraustad commented 4 weeks ago

Well, it looked good when I reviewed this. MyLoad is disconnected from water flow rate so, for now, I think no need to look at flowlock and this is just a way to tell the plant that this component did not meet a load or what was actually met (and probably should not exceed original MyLoad?). Since this does look like the correct approach I think verifying a components operation in 1 of these files. Was this component meeting a load that it shouldn't have, or is now passing that load to another component, or is off now and the plant load increases on the next iteration? Too hard to think this through without some hard data.

mjwitte commented 3 weeks ago

For WaterSideEconomizer_NonIntegrated-Chiller, here are some hours where the chiller is showing evap outlet temp < evap inlet temp when the chiller is off. Develop is on the left, this branch on the right. image

This file has 652 hours like that with develop, zero hours with this branch, so maybe this is fixing a real problem. WaterSideEconomizer_NonIntegrated-Develop.zip WaterSideEconomizer_NonIntegrated.zip

rraustad commented 3 weeks ago

I do think this is fixing something. Note the integrated economizer inlet now tracks the correct water temp. Why this temp changed from 10 C to 16 C is a bit of a mystery but without that free cooling the plant temps have risen. What are the plant outlet node temps wrt set point? maybe a plant outlet temp vs plant mass flow rate plot. And if the plant return water temp is > 12 C, why isn't the chiller on? is there a bypass pipe that has flow? There was no mass flow rate at the chiller before so it seems it should be off, but why? Availability Manager?

mjwitte commented 3 weeks ago

So, the waterside economizer HX hardly ever runs, and I haven't figured out why the chiller is off when there's a high loop demand. There's no plant availability manager, and a simple plant operating scheme with the chiller always available. There is flow through the HX on the chilled water side, but no flow on the other side of the HX. Not sure why the HX has flow if it's not contributing.

Hmmm, this is a water cooled Chiller:EngineDriven. Looking at 02/23 10:00-15:00, in both branches, the CENTRAL CHILLER:Chiller Evaporator Mass Flow Rate kg/s is zero, but there is flow on the Central Chiller Inlet/Outlet Nodes(!). The chiller is LeavingSetpointModulated, maybe that's not working right? image

rraustad commented 3 weeks ago

@EnergyArchmage has found a few places in code where the WWHX is not passing information correctly (i.e., SafeCopyPlantNode is needed in a few places). I can't recall exactly what the details are so maybe he could comment on what you are seeing.

mjwitte commented 1 week ago

@rraustad Oh, silly me. This is why the chiller is not operating:

  Pump:VariableSpeed,
    Cond Circ Pump,          !- Name

    INTERMITTENT,            !- Pump Control Type
    CoolingPumpAvailSched;   !- Pump Flow Rate Schedule Name
  Schedule:Compact,
    CoolingPumpAvailSched,   !- Name
    Fraction,                !- Schedule Type Limits Name
    Through: 3/31,           !- Field 1
    For: AllDays,            !- Field 2
    Until: 24:00,0.0,        !- Field 3
    Through: 9/30,           !- Field 5
    For: AllDays,            !- Field 6
    Until: 24:00,1.0,        !- Field 7
    Through: 12/31,          !- Field 9
    For: AllDays,            !- Field 10
    Until: 24:00,0.0;        !- Field 11

The condenser pump is scheduled off, but everything else is always available. So the chiller tries to run, but then when it sees zero condenser flow it's "off" (but not really) - exactly the case that this is fixing.

Changing the file so that the condenser pump is always available eliminates the diffs between develop and this branch and eliminates the unmet hours. So, this file needs some review, because the HX is only running for 8 hrs of the year in Chicago. But that can be a separate issue.

Some unit tests would be nice here.

rraustad commented 1 week ago

This just makes me wonder why a pump would ever be schedule off.

github-actions[bot] commented 1 week ago

:warning: Regressions detected on macos-14 for commit b0c280dafed2712e5a47f1839a3d952b4fcebca8

Regression Summary - EIO: 16 - ESO Big Diffs: 12 - MTR Small Diffs: 14 - Table Small Diffs: 8 - Table Big Diffs: 8 - ERR: 8 - Table String Diffs: 4 - ESO Small Diffs: 11 - MTR Big Diffs: 3
github-actions[bot] commented 1 week ago

:warning: Regressions detected on macos-14 for commit f16a88e05569fc7680cda20777b34e51adbddabe

Regression Summary - EIO: 16 - ESO Big Diffs: 14 - MTR Small Diffs: 15 - Table Small Diffs: 8 - Table Big Diffs: 8 - ERR: 8 - Table String Diffs: 4 - ESO Small Diffs: 10 - MTR Big Diffs: 3
github-actions[bot] commented 1 week ago

:warning: Regressions detected on macos-14 for commit 0d579ddaeaa68db1959db8f7a9656b28f921fa5f

Regression Summary - EIO: 16 - ESO Big Diffs: 14 - MTR Small Diffs: 15 - Table Small Diffs: 8 - Table Big Diffs: 8 - ERR: 8 - Table String Diffs: 4 - ESO Small Diffs: 10 - MTR Big Diffs: 3
github-actions[bot] commented 3 days ago

:warning: Regressions detected on macos-14 for commit 934573a4dcfc98182e7531e013971cd585ad6c7a

Regression Summary - EIO: 16 - ESO Big Diffs: 14 - MTR Small Diffs: 15 - Table Small Diffs: 8 - Table Big Diffs: 8 - ERR: 8 - Table String Diffs: 4 - ESO Small Diffs: 10 - MTR Big Diffs: 3