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

Correction of Defect in Transition Program and Recent Bug Fix #8997

Merged
merged 7 commits into from
Sep 3, 2021

Conversation

RKStrand
Copy link
Contributor

@RKStrand RKStrand commented Aug 23, 2021

Pull request overview

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.

  • 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

Correction to a problem in the transition that caused input files to be truncated inappropriately.  Also, included another minor fix from a different defect resolution that got merged into develop already.
@RKStrand RKStrand added the Defect Includes code to repair a defect in EnergyPlus label Aug 23, 2021
@RKStrand RKStrand self-assigned this Aug 23, 2021
@@ -397,7 +397,9 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile
CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits)
nodiff=.false.
OutArgs(1:3)=InArgs(1:3)
CurArgs = CurArgs - 1
IF (CurArgs == 4) THEN
CurArgs = 3
Copy link
Contributor

Choose a reason for hiding this comment

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

That looks good! I tested again on both a 4-line case and a 3-line case, it works fine on both cases.

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.

Small changes, looks good on paper. When CI comes back green, will merge.

@mjwitte
Copy link
Contributor

mjwitte commented Aug 23, 2021

So, I realized that the transition changes to VCompareGlobalRoutines.f90 in the Space branch broke any transition prior to v9.6 when writing surface objects with grouped veritces (x,y,z on the same idf line) which is just about always. I added a fix to this branch to set the field numbers based on whether the transition version is <9.6. @jcyuan2020 @Myoldmopar I've tested locally, but a few random older transitions should be tested as well as the v9.6 transition to be sure this is all good.

ReportTemperatureInputError(
state, cCurrentModuleObject, 1, state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTemp, true, ErrorsFound);
state, cCurrentModuleObject, 3, state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTemp, true, ErrorsFound);
state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesTemp = state.dataIPShortCut->rNumericArgs(3);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is also been tested to working using a defect file that contains a -20C supply temperature in a Sizing:Zone object.

In a quick summary it is working as expected and fixed the problem well---and actually in this defect file case, even though the Sizing:Zone has an input value of -20C for supply temperature, it should not cause a warning in the defect file as the defect file as the object actually specifies a "temperature difference" method---and this should also add to the point when it is a bug before. After the fix the problem is fixed; and no warning for the defect file on this zone (because it uses the temperature difference method):
image

A little bit complication about this test file is that with the difference method, the user specified a 11.11C temperature difference in Sizing:Zone and the zone thermostat is set to 2C---this means that the supply is around -9.11. I original thought that this is the reason why the warning is flagged.--but actually it should not be. According to the code's original intention, it should only flag the below zero supply temperature with SupplyAirTemperature method. Therefore from this point it is also a bug.

I think the new fix nice fixed this and it is now clear that the warning is given only when a below-zero supply air temperature is inputted together with the "SupplyAirTemperature" method. If a user selects the "temperature difference", then even though a negative supply air temperature is inferred from the inputs, it would not (and also probably should not) give a warning.

@jcyuan2020
Copy link
Contributor

@mjwitte I will try a few cases on the space-related new transition changes next.

@jcyuan2020
Copy link
Contributor

jcyuan2020 commented Aug 23, 2021

For the space-related transitions, I tried a few more cases with 9.4 version and it is confirmed working. Without the fix, it will have a long list of warnings complaining the geometry fields in the transition audit file when going to the point from 9.5->9.6---for example, like this:

Conversion 9.5 => 9.6
 Starting new Transition.audit
 Will create new full IDFs
 Will create new IDF lines with units where applicable
 Will create new IDF lines leaving blank incoming fields as blank (no default fill)
 Processing IDF -- C:\EnergyPlus\_Code_Review\PR_8995_Transition_Fixes\Upgrade_Test_develop\5ZoneAirCooled.idf
   ** Warning ** Invalid Number in Numeric Field#4 (Vertex 1 Y-coordinate), value=BuildingSurface:Detailed, in BuildingSurface:Detailed=WALL-1PF
   ** Warning ** Invalid Number in Numeric Field#5 (Vertex 1 Z-coordinate), value=WALL-1PR, in BuildingSurface:Detailed=WALL-1PF
   ** Warning ** Invalid Number in Numeric Field#6 (Vertex 2 X-coordinate), value=WALL, in BuildingSurface:Detailed=WALL-1PF
   ** Warning ** Invalid Number in Numeric Field#7 (Vertex 2 Y-coordinate), value=WALL-1, in BuildingSurface:Detailed=WALL-1PF
   ** Warning ** Invalid Number in Numeric Field#8 (Vertex 2 Z-coordinate), value=PLENUM-1, in BuildingSurface:Detailed=WALL-1PF
   ** Warning ** Invalid Number in Numeric Field#9 (Vertex 3 X-coordinate), value=Outdoors, in BuildingSurface:Detailed=WALL-1PF
   ** Severe  ** Error detected in Object=BuildingSurface:Detailed, name=WALL-1PF
   **   ~~~   ** Field [Vertex 3 Y-coordinate] is required but was blank
   ** Warning ** Invalid Number in Numeric Field#11 (Vertex 3 Z-coordinate), value=SunExposed, in BuildingSurface:Detailed=WALL-1PF
   ** Warning ** Invalid Number in Numeric Field#12 (Vertex 4 X-coordinate), value=WindExposed, in BuildingSurface:Detailed=WALL-1PF
   ** Warning ** Invalid Number in Numeric Field#4 (Vertex 1 Y-coordinate), value=BuildingSurface:Detailed, in BuildingSurface:Detailed=WALL-1PL
   ** Warning ** Invalid Number in Numeric Field#5 (Vertex 1 Z-coordinate), value=TOP-1, in BuildingSurface:Detailed=WALL-1PL
   ** Warning ** Invalid Number in Numeric Field#6 (Vertex 2 X-coordinate), value=ROOF, in BuildingSurface:Detailed=WALL-1PL
   ** Warning ** Invalid Number in Numeric Field#7 (Vertex 2 Y-coordinate), value=ROOF-1, in BuildingSurface:Detailed=WALL-1PL
   ** Warning ** Invalid Number in Numeric Field#8 (Vertex 2 Z-coordinate), value=PLENUM-1, in BuildingSurface:Detailed=WALL-1PL
   ** Warning ** Invalid Number in Numeric Field#9 (Vertex 3 X-coordinate), value=Outdoors, in BuildingSurface:Detailed=WALL-1PL
   ** Severe  ** Error detected in Object=BuildingSurface:Detailed, name=WALL-1PL
   **   ~~~   ** Field [Vertex 3 Y-coordinate] is required but was blank
   ** Warning ** Invalid Number in Numeric Field#11 (Vertex 3 Z-coordinate), value=SunExposed, in BuildingSurface:Detailed=WALL-1PL
   ** Warning ** Invalid Number in Numeric Field#12 (Vertex 4 X-coordinate), value=WindExposed, in BuildingSurface:Detailed=WALL-1PL
...

Now with the fix, the transition results and audit reports will just come out clean:

Conversion 9.5 => 9.6
 Starting new Transition.audit
 Will create new full IDFs
 Will create new IDF lines with units where applicable
 Will create new IDF lines leaving blank incoming fields as blank (no default fill)
 Processing IDF -- C:\Users\jinch\Dropbox\Wk_GARD\EnergyPlus_Compile\_Code_Review\PR_8995_Transition_Fixes\Upgrade_Tests_MJW_8995\5ZoneAirCooled.idf
 Processing rvi -- C:\Users\jinch\Dropbox\Wk_GARD\EnergyPlus_Compile\_Code_Review\PR_8995_Transition_Fixes\Upgrade_Tests_MJW_8995\5ZoneAirCooled.rvi

@mjwitte mjwitte added this to the EnergyPlus 9.6 Release milestone Aug 27, 2021
@Myoldmopar
Copy link
Member

I haven't looked at the diffs, but generally this seems fine. Anything else needed here outside of a bit more testing?

@mjwitte
Copy link
Contributor

mjwitte commented Aug 31, 2021

@Myoldmopar Nothing more that I know of.

@mjwitte
Copy link
Contributor

mjwitte commented Aug 31, 2021

I wouldn't expect any diffs here, so this may need a fresh regression to be sure.

@Myoldmopar
Copy link
Member

Pulled develop in, we'll see how it does

@rraustad
Copy link
Contributor

rraustad commented Sep 1, 2021

@mjwitte this PR is independent of #9019 and can be merged as is? with no other changes expected? Once reviewed and tested that is.

@mjwitte
Copy link
Contributor

mjwitte commented Sep 1, 2021

@rraustad Yes, this is separate from #9019.

@rraustad rraustad mentioned this pull request Sep 1, 2021
20 tasks
@Myoldmopar
Copy link
Member

Obviously CI looks much happier now. I will try to run a test this evening or in the morning and get this in.

@@ -799,31 +808,32 @@ SUBROUTINE CheckSpecialObjects(DifUnit,ObjectName,CurArgs,OutArgs,FieldNames,Fie
CALL WriteOutIDFLinesAsSingleLine(DifUnit,ObjectName,CurArgs,OutArgs,FieldNames,FieldUnits)

CASE('BUILDINGSURFACE:DETAILED')
NVertFieldNum = 10 + SurfaceSpaceFieldShift
IF (MakeUPPERCase(OutArgs(11)) == 'AUTOCALCULATE') THEN
Copy link
Contributor

Choose a reason for hiding this comment

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

What about this line? "11" has been replaced with NVertFieldNum and line 812 has OutArgs(11). For input files > V9.2 and < V9.6, this would be OutArgs(10), right? So OutArgs(NVertFieldNum) here as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, this does convert a V9.4 file to V9.5 so maybe this is OK.

image

Copy link
Contributor

Choose a reason for hiding this comment

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

@rraustad Good catch. I can fix shortly, or feel free to push a fix yourself.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, it's when the number of vertices field is AutoCalculate when there is a problem. So this does need to change.

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Try that same file with Number of Vertices = autocalculate.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure, I was just updating an UnmetHours file and saw that. I actually think it was an ill formed input file. I guess I should also open the transitioned file in IDFEditor for this test as well. Can't hurt to check everything we can think of.

Copy link
Contributor

Choose a reason for hiding this comment

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

Transition worked but opening transitioned file in IDF Editor shows an error.

image

Here is the transitioned OA Sys object. This is V9.4 -> V9.5.

AirLoopHVAC:OutdoorAirSystem,
Outside Air System, !- Name
Outside Air System Controllers, !- Controller List Name
Outside Air System Equipment, !- Outdoor Air Equipment List Name
Evap Cooler Availability List; !- Availability Manager List Name

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, was using V9.6 IDF Editor.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, the above issue is resolved using V9.5 IDF Editor and the transition above for V9.5 AirLoopHVAC:OutdoorAirSystem is correct.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can't think of anything else to test so am committing this change.

@mjwitte
Copy link
Contributor

mjwitte commented Sep 3, 2021

@rraustad Anything left to do here?

@rraustad
Copy link
Contributor

rraustad commented Sep 3, 2021

Well, I still see the ConvectionAdaptiveSmallOffice issue on this branch. I guess we could assume that is not related and get this merged.

@mjwitte
Copy link
Contributor

mjwitte commented Sep 3, 2021

Hmm, the changes in this branch only show transition now. @RKStrand Looks like those changes already merged with #9026 ? Please confirm.
those changes --> other Energyplus changes

@RKStrand
Copy link
Contributor Author

RKStrand commented Sep 3, 2021

@mjwitte Yes, the changes to EnergyPlus were already merged with #9026. This PR is only the correction of the transition program.

@mjwitte mjwitte merged commit 1d31b0b into develop Sep 3, 2021
@mjwitte mjwitte deleted the 8995CleanUpTransitionAirLoopHVACOutdoorAirSystem branch September 3, 2021 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Includes code to repair a defect in EnergyPlus
Projects
None yet
10 participants