Skip to content

Separate design and control variables#8530

Merged
Myoldmopar merged 119 commits intodevelopfrom
Separate-Design-and-Control-Variables
Feb 18, 2021
Merged

Separate design and control variables#8530
Myoldmopar merged 119 commits intodevelopfrom
Separate-Design-and-Control-Variables

Conversation

@jmythms
Copy link
Contributor

@jmythms jmythms commented Feb 12, 2021

Pull request overview

  • Split design and control variables for VarFlow and CFlow LowTempRadiant, and hot water and steam baseboard objects.
  • Design document link
  • 33 test files + Unit tests were transitioned for the regression tests. The big table diffs are from differences in the number of IDF input fields.

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

Copy link
Collaborator

@dareumnam dareumnam left a comment

Choose a reason for hiding this comment

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

Built and tested a few testfiles locally, runs well.

SB45, !- Surface 3 Name
0.1; !- Fraction of Radiant Energy to Surface 3
SPACE4-1 Baseboard, !- Name
SPACE4-1 Baseboard Design, !- Design_Object_Name
Copy link
Collaborator

@dareumnam dareumnam Feb 16, 2021

Choose a reason for hiding this comment

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

SPACE4-1 Baseboard Design is the same as SPACE2-1 Baseboard Design, I think we can use one design object for both baseboards. I think this is one of the main points of this new feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dareumnam Thanks so much for the review! Will take off the redundant design objects.

SB45, !- Surface 3 Name
0.1; !- Fraction of Radiant Energy to Surface 3
SPACE4-1 Baseboard, !- Name
SPACE4-1 Baseboard Design, !- Design_Object_Name
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here, and idfs below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Requested changes were made, thank you! In some IDFs, the design objects were different and were not merged together.

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.

@jmythms this is looking really good! I made just a few comments that should be addressed before we merge, but they are pretty minor. Let me know if you have any questions about them. Once they are addressed I'll mark it approved, do a little more testing, and then it can merge.

POutArgs(14:15) = InArgs(23:24)
POutArgs(16:19) = InArgs(28:31)
POutArgs(20) = InArgs(34)
CALL WriteOutIDFLines(DifLfn,'ZONEHVAC:LOWTEMPERATURERADIANT:VARIABLEFLOW:DESIGN',20,POutArgs,FldNames,FldUnits)
Copy link
Member

Choose a reason for hiding this comment

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

@jmythms After transitioning, the new object name looks a bit funny in all caps. I'd change this string, and the similar ones in each block, to just being PascalCase:ObjectName:Style.

POutArgs(3:4) = InArgs(7:8)
POutArgs(5:7) = InArgs(11:13)
CALL WriteOutIDFLines(DifLfn,'ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:STEAM:DESIGN',7,POutArgs,FldNames,FldUnits)
nodiff=.false.
Copy link
Member

Choose a reason for hiding this comment

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

But after transitioning a baseboard file, I was able to run the file successfully with a clean error file. I did not test every permutation of object, but I'll continue testing a couple more.

\type real
\minimum 0.0
\default 1.0
\note Enter the fraction of auto - sized heating design capacity.Required field when capacity the
Copy link
Member

Choose a reason for hiding this comment

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

I see you just copied this note from the previous object, but if you can fix up the spacing it would be nice. Change it to be just autosized, and then a space after the period. Then go through the other notes briefly and see if you spot any other weird spacing or punctuation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's weird that this file/these lines do not show up as outdated.

extern Array1D<HWBaseboardParams> HWBaseboard;
extern Array1D<HWBaseboardDesignData> HWBaseboardDesignObject;
extern Array1D<HWBaseboardNumericFieldData> HWBaseboardNumericFields;
extern Array1D<HWBaseboardDesignNumericFieldData> HWBaseboardDesignNumericFields;
Copy link
Member

Choose a reason for hiding this comment

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

We should follow this up quickly with a PR that moves this to the deglobalized state, but not for today obviously.


// Default Constructor
SteamBaseboardDesignData()
: HeatingCapMethod(0), DesignScaledHeatingCapacity(0.0), Offset(0.0), FracRadiant(0.0), FracDistribPerson(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.

I know this is how most default constructors are written in EnergyPlus, so I don't want you to change anything for now, but I wanted to point out that I think we should move to initializing right at the declaration. In other words, instead of having to write this initializer list, just set heating method to 0 right where it is declared: int HeatingCapMethod = 0. The compiler is quite smart, and at even just level 1 optimization, gcc will end up with the same assembly code either way. And not that it matters, but in debug builds, the code is much more efficient if you are able to initialize the way I am suggesting. If someone wants to correct me here, I'm open to discussion, this is just what I'm seeing on CompilerExplorer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for this.


Field 6, previous Field 12 - Fraction Radiant

Field 7, previous Field 13 - Fraction of Radiant Energy Incident on People
Copy link
Member

Choose a reason for hiding this comment

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

Very detailed, would it make it more readable to make each of these

  • into
  • a
  • markdown
  • list?

set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})
Copy link
Member

Choose a reason for hiding this comment

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

Hmmm, something went awry here @jmythms . Looks like you accidentally pointed a build folder to the testfiles folder at some point and CMake created these files. The files that need to be plucked back off this branch include:

  • testfiles/CMakeFiles/CMakeDirectoryInformation.cmake
  • testfiles/CMakeFiles/progress.marks
  • testfiles/CTestTestfile.cmake
  • testfiles/Makefile
  • testfiles/cmake_install.cmake

@@ -47,103 +52,121 @@ \subsubsection{Inputs}\label{inputs-038}

This field is the name of the hot water outlet node for the baseboard heater.

\paragraph{Field: Rated AverageWaterTemperature}\label{field-rated-averagewatertemperature}
\paragraph{Field: Rated Average Water Temperature}\label{field-rated-averagewatertemperature}
Copy link
Member

Choose a reason for hiding this comment

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

Nice cleanup

0.1, !- fraction of radiant energy from heater distributed to surface 5
WR-1, !- surface 6 Name
0.1; !- fraction of radiant energy from heater distributed to surface 6
ZoneHVAC:Baseboard:RadiantConvective:Water:Design,
Copy link
Member

Choose a reason for hiding this comment

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

👍

@jmythms
Copy link
Contributor Author

jmythms commented Feb 17, 2021

@jmythms this is looking really good! I made just a few comments that should be addressed before we merge, but they are pretty minor. Let me know if you have any questions about them. Once they are addressed I'll mark it approved, do a little more testing, and then it can merge.

@Myoldmopar Thank you very much! I will let you know as soon as it is done.

@@ -40712,25 +40712,72 @@ ZoneHVAC:TerminalUnit:VariableRefrigerantFlow,

\group Zone HVAC Radiative/Convective Units

ZoneHVAC:Baseboard:RadiantConvective:Water:Design,
\min-fields 7
Copy link
Contributor Author

@jmythms jmythms Feb 18, 2021

Choose a reason for hiding this comment

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

I was not sure of the assignment for min-fields.

My logic for the current assignment was the (alpha+num) fields - just one field in the ConstantFlow and VariableFlow that I thought was optional.

END IF
IF (InArgs(34) == Blank) THEN
CurVarIterator = 19
END IF
Copy link
Contributor Author

@jmythms jmythms Feb 18, 2021

Choose a reason for hiding this comment

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

Added logic for removing the last line in the Design objects, if it is blank.

Copy link
Member

Choose a reason for hiding this comment

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

next time:

CurVarIterator = 19
IF (InArgs(34) /= Blank) THEN
  CurVarIterator = 20
  POutArgs(CurVarIterator) = InArgs(34)
END IF

@jmythms
Copy link
Contributor Author

jmythms commented Feb 18, 2021

@Myoldmopar Could you take one more look, when you get the time, please?

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.

Thanks for the final cleanups! This will merge soon. Great work @jmythms

END IF
IF (InArgs(34) == Blank) THEN
CurVarIterator = 19
END IF
Copy link
Member

Choose a reason for hiding this comment

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

next time:

CurVarIterator = 19
IF (InArgs(34) /= Blank) THEN
  CurVarIterator = 20
  POutArgs(CurVarIterator) = InArgs(34)
END IF

@Myoldmopar
Copy link
Member

Alright, this one is dropping in first since it needs no other changes. Thanks @jmythms

@Myoldmopar Myoldmopar merged commit 6a40bc3 into develop Feb 18, 2021
@Myoldmopar Myoldmopar deleted the Separate-Design-and-Control-Variables branch February 18, 2021 14:52
@jmythms
Copy link
Contributor Author

jmythms commented Feb 18, 2021

Alright, this one is dropping in first since it needs no other changes. Thanks @jmythms

Thank you so much!

@Myoldmopar Myoldmopar mentioned this pull request Feb 18, 2021
17 tasks
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.

8 participants