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

Add Supplemental Heating Coil to VRF Air Terminal Unit #7252

Merged
merged 27 commits into from
Jun 5, 2019

Conversation

Nigusse
Copy link
Contributor

@Nigusse Nigusse commented Apr 3, 2019

Pull request overview

This is a new feature. Modified the VRF terminal units model to support supplemental heating coils. Electric, Fuel, Hot water and Steam coils can be used as supplemental heating coil. The supplemental heating coils are supported in system curve and Fluid_Control VRF systems. Diffs are not expected based on this change. Transition rule has been avoid by making the new input fields optional.

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:
    • 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

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
  • 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?
  • If output changes, including tabular output structure, add to output rules file for interfaces

@nrel-bot
Copy link

@Nigusse it has been 7 days since this pull request was last updated.

@nrel-bot
Copy link

@Nigusse it has been 7 days since this pull request was last updated.

@nrel-bot
Copy link

@Nigusse it has been 7 days since this pull request was last updated.

@Myoldmopar
Copy link
Member

@Nigusse the warning there on the custom_check build is because this PR doesn't have a NewFeature, etc., label on it. At some point when you add that label and then push new commits up, it will turn green. No rush to rebuild it just for that though.

@Nigusse Nigusse added the NewFeature Includes code to add a new feature to EnergyPlus label Apr 29, 2019
@Nigusse
Copy link
Contributor Author

Nigusse commented Apr 29, 2019

This branch is ready for review. @Myoldmopar I have addressed your NFP review comments regarding applicability of the model to all VRF system types, and transition requirements on Pull Request Overview section.

@@ -3944,6 +3950,174 @@ namespace HVACVariableRefrigerantFlow {
}
}

// supplemental heating coil
if (!lAlphaFieldBlanks(17) && !lAlphaFieldBlanks(18)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The protection is good here but what if a users forgets to enter one or the other input? Would we want to warn if one or the other were blank but not both?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will look into it if it is better to provide a separate warning.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if only one of the two is blank, then I will provide warning message.

if (VRFTU(VRFTUNum).SuppHeatingCoilPresent) {
CompType = VRFTU(VRFTUNum).SuppHeatCoilType;
CompName = VRFTU(VRFTUNum).SuppHeatCoilName;
SizingMethod = DataHVACGlobals::HeatingCapacitySizing;
Copy link
Contributor

Choose a reason for hiding this comment

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

Not saying this is wrong since it uses only 1 sizing method (which I like), but there are 2 heating capacity sizing methods. One for water coils (WaterHeatingCapacitySizing) and the other for all other coil types (HeatingCapacitySizing).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rraustad I missed the two heating coil capacity sizing method flavors. Addressed. I will run my test files if it makes a difference.

}

// run supplemental heating coil
Real64 SuppPLR = this->SuppHeatPartLoadRatio;
Copy link
Contributor

Choose a reason for hiding this comment

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

Unless SuppPLR is used somewhere else you could have put this inside the IF block and only executed this line if a supplemental coil was present.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rraustad You are right. Done.

} else {
// Algorithm Type: VRF model based on system curve
CalcVRF(VRFTUNum, FirstHVACIteration, PartLoadRatio, ActualOutput, OnOffAirFlowRatio);
VRFTU(VRFTUNum).CalcVRF(VRFTUNum, FirstHVACIteration, PartLoadRatio, ActualOutput, OnOffAirFlowRatio, SuppHeatCoilLoad);
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks weird. CalcVRF is a function and this makes it look like a member variable. @Myoldmopar is this standard syntax?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rraustad This is how you call if it is member function. This is not full OO but it is a step in that direction.

Copy link
Member

Choose a reason for hiding this comment

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

Right, CalcVRF is a member variable...that just happens to be a function. So everyone's right. This is good.

@@ -10185,7 +10688,25 @@ namespace HVACVariableRefrigerantFlow {

// Otherwise the coil needs to turn on. Get full load result
PartLoadRatio = 1.0;
this->CalcVRF_FluidTCtrl(VRFTUNum, FirstHVACIteration, PartLoadRatio, FullOutput, OnOffAirFlowRatio);
this->CalcVRF_FluidTCtrl(VRFTUNum, FirstHVACIteration, PartLoadRatio, FullOutput, OnOffAirFlowRatio, SuppHeatCoilLoad);
Copy link
Contributor

Choose a reason for hiding this comment

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

This call looks correct, using this->Calc. Compare to 8265 above.

Copy link
Member

Choose a reason for hiding this comment

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

The reason he couldn't use this-> above is because he wasn't in a member function there, so there's no this-> reference. this-> is only available when you are already in the context of a single instance.

@NREL NREL deleted a comment from rraustad May 1, 2019
@Nigusse
Copy link
Contributor Author

Nigusse commented May 1, 2019

Local testing showed that supplemental heating coil capacity sizing impacts the the main DX heating coil capacity of the VRF Terminal Unit. But it should not. I will push in revised code.

@Myoldmopar
Copy link
Member

OK, yeah, hiccup! All is well now. Carry on...

@Nigusse
Copy link
Contributor Author

Nigusse commented May 17, 2019

Merged in develop and resolved conflict. I expect CI machine to run green.

@mjwitte mjwitte added the IDDChange Code changes impact the IDD file (cannot be merged after IO freeze) label Jun 3, 2019
@mjwitte mjwitte changed the title NFP - Add Supplemental Heating Coil to VRF Air Terminal Unit Add Supplemental Heating Coil to VRF Air Terminal Unit Jun 3, 2019
Copy link
Member

@Myoldmopar Myoldmopar left a comment

Choose a reason for hiding this comment

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

I looked the whole thing over, and there is a lot to take in. I didn't see any red flags, and it seems @rraustad has looked it over at least once as well. From a code perspective I'm OK with things.

@@ -2,7 +2,7 @@ \section{Group -- Variable Refrigerant Flow Equipment}\label{group-variable-refr

This group of EnergyPlus input objects describes the configurations of Variable Refrigerant Flow (VRF, or Variable Refrigerant Volume) air-conditioning systems.

A VRF system is an air-conditioning system that varies the refrigerant flow rate using variable speed compressor(s) in the outdoor unit, and the electronic expansion valves (EEVs) located in each indoor unit. The system meets the space cooling or heating load requirements by maintaining the zone air temperature at the setpoint. The ability to control the refrigerant mass flow rate according to the cooling and/or heating load enables the use of as many as 60 or more indoor units with differing capacities in conjunction with one single outdoor unit. This unlocks the possibility of having individualized comfort control, simultaneous heating and cooling in different zones, and heat recovery from one zone to another. It may also lead to more efficient operations during part-load conditions.
A VRF system is an air-conditioning system that varies the refrigerant flow rate using variable speed compressor(s) in the outdoor unit, and the electronic expansion valves (EEVs) located in each indoor unit. The system meets the space cooling or heating load requirements by maintaining the zone air temperature at the setpoint. The ability to control the refrigerant mass flow rate according to the cooling and/or heating load enables the use of as many as 20 or more indoor units with differing capacities in conjunction with one single outdoor unit. This unlocks the possibility of having individualized comfort control, simultaneous heating and cooling in different zones, and heat recovery from one zone to another. It may also lead to more efficient operations during part-load conditions.
Copy link
Member

Choose a reason for hiding this comment

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

Seems like kind of an arbitrary number change, but OK.

@@ -16388,7 +16389,12 @@ namespace DXCoils {
EIR = DXCoil(DXCoilNum).RatedEIR(Mode) * EIRTempModFac * EIRFlowModFac;

// Calculate PLRHeating: modified PartLoadRatio due to defrost ( reverse-cycle defrost only )
PLRHeating = min(1.0, (PartLoadRatio + LoadDueToDefrost / TotCap));
if (TotCap > 0.0) {
Copy link
Member

Choose a reason for hiding this comment

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

Good divide by zero catch.

@@ -4923,6 +5134,9 @@ namespace HVACVariableRefrigerantFlow {
MyOneTimeFlag = false;
MyVRFCondFlag = true;

MySuppCoilPlantScanFlag.allocate(NumVRFTU);
MySuppCoilPlantScanFlag = true;
Copy link
Member

Choose a reason for hiding this comment

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

Seems like you'd want to just add a boolean, defaulted to true, to the VRFTU structure, so that you don't have a separate array to manage. If there are any other changes to make here, I'd like to see that streamlined, or maybe you have a specific reason you needed to do it this way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I did not have any specific reason. I am happy to change it along with your next comment about the nested IF structure. Let me know.

if ((VRFTU(VRFTUNum).SuppHeatCoilType_Num == DataHVACGlobals::Coil_HeatingWater) ||
(VRFTU(VRFTUNum).SuppHeatCoilType_Num == DataHVACGlobals::Coil_HeatingSteam)) {

if (VRFTU(VRFTUNum).SuppHeatCoilType_Num == DataHVACGlobals::Coil_HeatingWater) {
Copy link
Member

Choose a reason for hiding this comment

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

This nested IF structure is kinda hard to read, and it looks like all but the last line or two are in each of the nested sections. I'd suggest just eliminating the first if (Water Or Steam) block as shown here:

if water or steam
  if water
    water-stuff
  else if steam
    steam-stuff
  end
  a couple common lines
end

to

if water
  water-stuff
  a couple common lines
else if steam
  steam-stuff
  a couple common lines
end

I realize this code isn't called frequently, so the performance impact of the nested structure will be minimal, and it's not a functional change, so if no other changes are needed, I'll not worry about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Myoldmopar I am making these changes.

bool const FirstHVACIteration, // flag for 1st HVAC iteration in the time step
Real64 &PartLoadRatio, // unit part load ratio
Real64 &OnOffAirFlowRatio // ratio of compressor ON airflow to AVERAGE airflow over timestep
void VRFTerminalUnitEquipment::ControlVRF(int const VRFTUNum, // Index to VRF terminal unit
Copy link
Member

Choose a reason for hiding this comment

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

👍 👍 👍

} else {
// Algorithm Type: VRF model based on system curve
CalcVRF(VRFTUNum, FirstHVACIteration, PartLoadRatio, ActualOutput, OnOffAirFlowRatio);
VRFTU(VRFTUNum).CalcVRF(VRFTUNum, FirstHVACIteration, PartLoadRatio, ActualOutput, OnOffAirFlowRatio, SuppHeatCoilLoad);
Copy link
Member

Choose a reason for hiding this comment

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

Right, CalcVRF is a member variable...that just happens to be a function. So everyone's right. This is good.

@@ -10185,7 +10688,25 @@ namespace HVACVariableRefrigerantFlow {

// Otherwise the coil needs to turn on. Get full load result
PartLoadRatio = 1.0;
this->CalcVRF_FluidTCtrl(VRFTUNum, FirstHVACIteration, PartLoadRatio, FullOutput, OnOffAirFlowRatio);
this->CalcVRF_FluidTCtrl(VRFTUNum, FirstHVACIteration, PartLoadRatio, FullOutput, OnOffAirFlowRatio, SuppHeatCoilLoad);
Copy link
Member

Choose a reason for hiding this comment

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

The reason he couldn't use this-> above is because he wasn't in a member function there, so there's no this-> reference. this-> is only available when you are already in the context of a single instance.

@Myoldmopar
Copy link
Member

CI is happy, and code is generally fine. I ran it locally and I see in the curve-fit VRF file that the supplemental heating coil is coming on for terminal unit 1, but not for the other terminal units. Is that intentional?

@Nigusse
Copy link
Contributor Author

Nigusse commented Jun 4, 2019

@Myoldmopar I have also seen those instances. When the heating load is relatively small, the DX heating coil provided all heating requirement. Otherwise, all supplemental heating coils types have been tested individually and they work fine.

@Nigusse
Copy link
Contributor Author

Nigusse commented Jun 4, 2019

@Myoldmopar I just checked my previous run result for example file VRF_5Zone_wSuppHeater.idf, only supplemental heaters of terminal units 2 and 4 were off whereas supplemental heaters of terminal units 1, 3, and 5 do run. Supplemental heaters 2 and 4 were off because, DX heating coil was able to provide the entire heating requirement. For the later two terminal units the DX heating coil run time fraction were less than 1.0.

@Nigusse
Copy link
Contributor Author

Nigusse commented Jun 4, 2019

Addressed your review comments. @Myoldmopar Thanks.

@@ -34671,7 +34671,6 @@ ZoneHVAC:WaterToAirHeatPump,
\object-list HeatingCoilName
\note Needs to match in the supplemental heating coil object
N11, \field Maximum Supply Air Temperature from Supplemental Heater
\required-field
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this object being touched here? If you want to make this not required, then it should be \default autosize

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted it to be an optional field, no other reason. OK. will add " \required-field" and default to autosize. @mjwitte Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mjwitte never mind, I thought this was the VF terminal unit. It must be accidental change. will fix both.

N11, \field Maximum Supply Air Temperature from Supplemental Heater
\type real
\units C
\autosizable
Copy link
Contributor

Choose a reason for hiding this comment

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

This should have \default autosize and that should be mentioned in the I/O Ref (same for the other one).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the IO reference of the WSHP and VRF terminal units.

@Myoldmopar
Copy link
Member

@Nigusse thanks for addressing my comments.

You've got a couple IDD comments from @mjwitte to address.

Also custom_check noted that your new example file is not UTF8 encoded. I have convert it if you need help doing it, but if you open that IDF in Notepad++ or something similar, you should be able to change the encoding and save it as UTF-8. Something similar should be available in Visual Studio (File -> Advanced Save Settings?)

Once those are taken care of, I think this will be OK to go in.

@Myoldmopar
Copy link
Member

@Nigusse thanks for addressing the IDD comments. @mjwitte please verify they are in good shape.

I took the new test file, opened in a text editor, changed encoding to UTF-8, and now custom_check passes locally. I pushed that change along with pulling from develop. If everyone is happy with the next set of results this can be merged.

@Myoldmopar
Copy link
Member

No wait, this branch has two integration failures. Rebuilding locally and I'll run them to see what's up with it. I have a suspicion.

@Myoldmopar
Copy link
Member

Indeed, it was the missing run period names that were causing the two new test files to fail. (They are now required inputs.) I fixed them, and honestly I may just merge this in. Custom-check has now approved the UTF8 change, and I am getting passing test files.

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.

9 participants