-
Notifications
You must be signed in to change notification settings - Fork 401
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
Fix VRFFluidCtrl cooling cycling issue by moving cycling ratio calc in compressor spd calc #10353
Conversation
…nto vrfFluidCtrlFixCoolingCycling
} else { | ||
PLF = 1.0; | ||
} | ||
if (coolingCoil.TotalCoolingEnergyRate > 0.0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this keeps the coil RTF up-to-date with the condenser side
@@ -14429,12 +14440,19 @@ void VRFCondenserEquipment::VRFOU_CalcCompC(EnergyPlusData &state, | |||
goto Label13; | |||
} | |||
|
|||
if (CapDiff > (Tolerance * Cap_Eva0)) NumIteCcap = 999; | |||
if (CapDiff > (Tolerance * Cap_Eva0)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cycling ratio calculation is moved to here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic does not seem right to me. At line 14439 this same conditional is used. It says if the capacity difference is greater than some tolerance keep iterating. So when we get to line 14447, it's either due to max iterations or the capacity difference is less than tolerance. I guess if capacity difference is less than tolerance then we converged on the capacity that requires the compressor to run the entire time step. But if (NumIteCcap >= 30)
then what does that mean? I'm not sure it means the compressor is cycling. I think it might mean the compressor is cycling if Cap_Eva1 - Cap_Eva0
is positive but you don't know that since CapDiff = std::abs(Cap_Eva1 - Cap_Eva0);
I would think that should be accounted for here. I'm not sure though since this is a very detailed model.
if (CapDiff > (Tolerance * Cap_Eva0) && (Cap_Eva1 - Cap_Eva0) >= 0.0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. If Cap_Eva1 - Cap_Eva0 < 0 then it should not cycle.
@yujiex For the defect file attached to #10105 these code changes don't alter the relative behavior between the two defect files (i.e. the stated speed at load range 1 has no impact on results other than the reported speed value, see #10105 (comment)). The results in both the 900 and 1320 file both change the same way. But this PR does expose the fact that the initial check of load vs min-capacity has a significantly different value for EnergyPlus/src/EnergyPlus/HVACVariableRefrigerantFlow.cc Lines 11531 to 11543 in 769463d
And here's the second block: EnergyPlus/src/EnergyPlus/HVACVariableRefrigerantFlow.cc Lines 11838 to 11842 in 769463d
So my question would be why the first one is using
|
My understanding is the CompEvaporatingCAPSpdMin check in the first block before entering the compressor speed calculation might be a rougher guess and the second place considers the piping loss and is more accurate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more comments. I would like @rraustad to review also.
@@ -283,6 +283,27 @@ void SimulateVRF(EnergyPlusData &state, | |||
if (state.dataHVACVarRefFlow->VRF(VRFCondenser).CondenserType == DataHeatBalance::RefrigCondenserType::Water) | |||
UpdateVRFCondenser(state, VRFCondenser); | |||
} | |||
// yujie: update coil and IU evaporating temperature, also keep coil RTF updated with the condenser side cycling ratio, for the FluidTCtrl model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current practice is to leave names out of comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll remove the name
|
||
Ncomp = this->RatedCompPower * CurveValue(state, this->OUCoolingPWRFT(CounterCompSpdTemp), T_discharge, T_suction); | ||
Ncomp = this->RatedCompPower * CurveValue(state, this->OUCoolingPWRFT(CounterCompSpdTemp), T_discharge, T_suction) * CyclingRatio; | ||
OUCondHeatRelease = Cap_Eva1 * CyclingRatio; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is correct. Earlier OUCondHeatRelease = TU_load + Pipe_Q + Ncomp;
Possibly OUCondHeatRelease *= CyclingRatio;
would be correct here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or would it be Ncomp + Cap_Eva1 * CyclingRatio? similar to the load > maximum capacity case
if (CounterCompSpdTemp > NumOfCompSpdInput) {
// Required load is beyond the maximum system capacity
CompEvaporatingCAPSpd(NumOfCompSpdInput) =
this->CoffEvapCap * this->RatedEvapCapacity * CurveValue(state, this->OUCoolingCAPFT(NumOfCompSpdInput), T_discharge, T_suction);
OUCondHeatRelease = Ncomp + CompEvaporatingCAPSpd(NumOfCompSpdInput);
CompSpdActual = this->CompressorSpeed(NumOfCompSpdInput);
Ncomp = CompEvaporatingPWRSpd(NumOfCompSpdInput);
}
Ncomp is updated inside VRFOU_CalcCompC
, so maybe that part needs to use the updated Ncomp
?, When it is cycling, CyclingRatio = (TU_load + Pipe_Q) * C_cap_operation / Cap_Eva1
, then Ncomp + Cap_Eva1 * CyclingRatio
would evaluates to Ncomp + (TU_load + Pipe_Q) * C_cap_operation
, with the updated Ncomp
and the TU_load + Pipe_Q
considering the difference between the rated and real condition (C_cap_operation
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds ok. This function is very hard to follow, so I'll trust you on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be a nice test to plot some of the available report variables through a transition from CyclingRatio = 1 at some time step to CyclingRatio < 1 at future time steps to see if these report variables have a smooth transition from compressor on to compressor cycling. Whichever reports capture the equations being questioned here. Not sure why a component model is not reporting refrigerant pressures which could help in diagnostics. We should add refrigerant temperature/pressure reporting at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea. I will produce some plot showing how CyclingRatio transition from 1 to < 1 and the other way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add VRF Heat Pump Outdoor Unit Evaporator Heat Extract Rate so we can see what is happening at the evaporator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dareumnam and @rraustad. I created the following plots. There is not an output variable for refrigerant flow. I will add some custom outputs later. The Outdoor Unit Evaporator Heat Extract Rate is 0 during cooling mode, in both periods, 04/06 and 04/09.
The following are a few plots for the 04/09 period. The fact that heat pump electricity is higher when cycling ratio < 1 than when cycling ratio = 1, seems to originate from the compressor power, which also has this behavior. I will dig deeper into this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at the following two points, at 4/6 12:20 and 4/6/ 14:20. The former has heat pump cycling ratio = 0.949, the latter has cycling ratio of 1.0. The former has higher compressor power (which leads to higher heat pump electricity rate) than the latter.
This is because its evaporating temperature is lower. The condensing temperature is pretty similar, lower evaporating temperature will lead to higher curve value (see the following compressor curve at this speed).
As the compressor electricity rate is computed as the following, the compressor power (before multiplying cycling ratio is higher) at the 12:20 due to lower evaporating temperature.
Ncomp = this->RatedCompPower * CurveValue(state, this->OUCoolingPWRFT(CounterCompSpdTemp), T_discharge, T_suction);
The evaporating temperature is lowered during cycling as there was a low-load modification mechanism in the fluid control VRF, where they enlarge the compressor evaporating capacity by changing the evaporating temperature (see the red shaded part), so that the equipment can cycle less.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the refrigerant mass flow rates the same at both points? (4/6 12:20 and 4/6/ 14:20)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @dareumnam, there is not a refrigerant flow rate output variable. I used some debug prints to output this variable (m_ref_IU_evap_i
and m_ref_IU_evap
in cooling mode). The refrigerant flow at 12:20 is 0.01058698505294939, and the refrigerant flow at 14:20 is 0.012904189061317716.
testfiles/speed_1320.idf
Outdated
@@ -0,0 +1,7429 @@ | |||
!- --------------------------------------------------------------------------------------------------------- | |||
!- The Residential Prototype Building Models were developed by Pacific Northwest National Laboratory (PNNL), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The defect files got added by mistake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let me remove it
…EL/EnergyPlus into vrfFluidCtrlFixCoolingCycling
Regarding the original issue. The speed_900.idf has 8 speed levels, the lowest speed level curve is curve set 1. The speed_1920.idf has 7 speed levels, the lowest speed level curve is curve set 2. speed_1920.idf is derived from speed_900.idf by removing the lowest speed level curve set (there are two curves for each speed level). The following are the "Evaporative Capacity Multiplier Function of Temperature Curve Name" and "Compressor Power Multiplier Function of Temperature Curve Name" of Curve 1 and 2 at 35F are most relevant. The following is the develop branch output. We can see that both of them have cycling ratio=1. However, with different lowest-speed curves, they still deliver the same total cooling rate. This is unreasonable. The following is the feature branch output. We can see in both cases the VRF system is cycling. Since curve set 1 can supply lower cooling capacity for the same evaporating, condensing temperature combination, it should cycle less, which is indeed the case here. Compressor power for the speed_900 output is slightly larger than the speed_1920 one as it runs for longer period and that the power curve is higher. Annual energy difference is shown in the following table The following attaches the input idfs and output tables |
@Myoldmopar and @dareumnam would you mind taking another look at this PR? Thanks. |
So, in the original issue, the min-compressor-speed capacity was different at two points in the code flow. To fix this, you moved the cycling ratio calculation inside the compressor speed calculation. After the fix, the output from this branch shows a different cycling ratio, which seems reasonable. Could you please explain a bit more about whether the energy use or VRF cooling electricity rate are as expected? I would like to be convinced that the Heat Pump Electricity Rate shown above is correct. |
@dareumnam Looking at the tables in this comment. Compressor power become much more similar after the fix. This is anticipated, as according to the power multiplier curve plots in the same comment, the curve 1 value is around 0.07 and the curve 2 value is around 0.1 (a 0.7 to 1 relationship). The curve value need to multiply the rated compressor power and cycling ratio to get the compressor power. The cycling ratio of the two example files are about 0.55 to 0.81 (see first row of the second table below the curve plots in that same comment), which is a 1 to 0.68 relationship. Since the power curve values are 0.7 to 1 (between the two examples) and the cycling ratios are 1 to 0.68, the final compressor power should be pretty similar. This leads to very similar heat pump cooling electricity rate after the fix. This is reasonable as the cooling electricity rate is the sum of compressor power and fan power. Fan power here is the same. Compressor power is very similar as is explained above, heat pump cooling electricity rate should also be similar. |
Thanks for the detailed explanation which makes sense to me. I built this branch locally, and everything looks clean. The diffs are expected and well-explained. I appreciate your hard work on the VRF models, @yujiex. I believe this is ready to be merged. @Myoldmopar |
Thanks @dareumnam |
|
|
|
src/EnergyPlus/Material.cc
Outdated
@@ -211,7 +211,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if | |||
state.dataMaterial->TotMaterials += 1 + TotFfactorConstructs + TotCfactorConstructs; | |||
} | |||
|
|||
// yujie: This looks kind of silly, but we need it to keep the Materials array in IDF order. | |||
// This looks kind of silly, but we need it to keep the Materials array in IDF order. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This caused a conflict. I'll fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually maybe it wasn't this...?
Alright, resolved the conflict and built/tested. Everything is all happy. This will merge assuming CI stays clean. |
|
Alright, merging here. Thanks @yujiex , and @dareumnam. |
Thanks @Myoldmopar |
Pull request overview
The following shows the relevant code flow chart. We observed a problem of non-matching minimum-speed compressor capacity at two places
For the same timestep, in the cycling ratio calculation, the demand is larger than minimum speed capacity, and the compressor is considered not cycling. However in the compressor speed calculation later on, the demand is smaller than the minimum speed capacity, and the compressor is considered cycling
The difference in the minimum-speed-capacity is caused by the difference in the evaporating temperature.
To fix this, we propose to move the cycling calculation inside the compressor speed calculation as is shown in the following diagram.
Effect of the fix
The following shows the output before the fix
The following shows the output after the fix.
After the fix, runtime fractions are different now, where the lower-capacity one runs longer. For the same cooling rate, the heat pump cooling electricity rate and COP are more similar. The evaporating temperature output also reflected the following Te adjustment when the compressor is at the lowest speed (minimum loading index)
Regression diffs
The regression diffs happen in the following files with VRF FluidTCtrl models
The four files all have table diffs in electricity rate. The following is in the table diff in VariableRefrigerantFlow_FluidTCtrl_5Zone. These are anticipated as the cycling ratio calculation is modified and the cooling electricity rate should change. As a result, the total electricity rate should also change.
Meter difference happens in the following two files. The differences are in Cooling:Electricity, Electricity:HVAC, and Electricity:Facility. The diffs are expected as cycling ratio can affect the cooling electricity rate, which leads to changes in these "Electricity:*" variables.
The following is from the output of the "VariableRefrigerantFlow_FluidTCtrl_5Zone.idf".
NOTE: ENHANCEMENTS MUST FOLLOW A SUBMISSION PROCESS INCLUDING A FEATURE PROPOSAL AND DESIGN DOCUMENT PRIOR TO SUBMITTING CODE
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.