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

Refactor internal source inputs #8442

Merged
merged 12 commits into from
Feb 18, 2021
Merged

Refactor internal source inputs #8442

merged 12 commits into from
Feb 18, 2021

Conversation

jasondegraw
Copy link
Member

@jasondegraw jasondegraw commented Dec 30, 2020

Pull request overview

This PR implements the first part of the addition of a moisture source to the HAMT feature. That new feature adds a moisture internal source object, and this refactoring sets it up so that the inputs for the thermal problem and the moisture problem are more similar. Previously , internal heat sources were specified using the Construction:InternalSource object. After this PR is merged, the same input is done with a regular Construction and a new ConstructionProperty:InternalHeatSource object:

Construction:InternalSource,
Slab Floor with Radiant, !- Name
4,                       !- Source Present After Layer Number
4,                       !- Temperature Calculation Requested After Layer Number
2,                       !- Dimensions for the CTF Calculation
0.3048,                  !- Tube Spacing {m}",
0.0,                     !- Two-Dimensional Position of Interior Temperature Calculation Request
CONCRETE - DRIED SAND AND GRAVEL 4 IN,  !- Outside Layer
INS - EXPANDED EXT POLYSTYRENE R12 2 IN,  !- Layer 2
GYP1,                    !- Layer 3
GYP2,                    !- Layer 4
FINISH FLOORING - TILE 1 / 16 IN;  !- Layer 5

becomes

ConstructionProperty:InternalHeatSource,
Slab Floor with Radiant, !- Name
4,                       !- Source Present After Layer Number
4,                       !- Temperature Calculation Requested After Layer Number
2,                       !- Dimensions for the CTF Calculation
0.3048,                  !- Tube Spacing {m}",
0.0;                     !- Two-Dimensional Position of Interior Temperature Calculation Request

Construction,
Slab Floor with Radiant, !- Name
CONCRETE - DRIED SAND AND GRAVEL 4 IN,  !- Outside Layer
INS - EXPANDED EXT POLYSTYRENE R12 2 IN,  !- Layer 2
GYP1,                    !- Layer 3
GYP2,                    !- Layer 4
FINISH FLOORING - TILE 1 / 16 IN;  !- Layer 5

A later PR will add a ConstructionProperty:InternalMoistureSource object. This will need transition and documentation, I need to reinstall MikTeX before I can get the docs updated. Barring any errors in changes to the test files, there should only be diffs about the IDD changes.

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

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

@jasondegraw jasondegraw added Refactoring Includes code changes that don't change the functionality of the program, just perform refactoring IDDChange Code changes impact the IDD file (cannot be merged after IO freeze) labels Dec 30, 2020
@Myoldmopar Myoldmopar mentioned this pull request Jan 3, 2021
12 tasks
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.

This all seems really great. The only CI issue I see so far is unused object warnings, which are probably just because the objects aren't marked as being used. Do you have additional work to do on this branch or is it ready for testing?

ShowContinueError(state, "The temperature calculation after layer parameter has been set to one less than the number of layers.");
thisConstruct.TempAfterLayer = thisConstruct.TotLayers - 1;
}
std::string construction_name{UtilityRoutines::MakeUPPERCase(fields.at("construction_name"))};
Copy link
Member

Choose a reason for hiding this comment

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

I think you need an inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); to avoid the ERR diffs popping up on this branch.

@jasondegraw
Copy link
Member Author

@Myoldmopar I'll fix that markObjectAsUsed issue you found and modify the docs, that'll just leave transition. I'll take a shot at this on Friday.

@mjwitte
Copy link
Contributor

mjwitte commented Feb 5, 2021

@jasondegraw This has no milestone. Is it intended for 9.5?

@jasondegraw
Copy link
Member Author

@mjwitte I'd like it to be for 9.5, but would need some help on the transition work. Any chance you could help me with that? If not we can put it down for E+ future.

@mjwitte mjwitte added this to the EnergyPlus 9.5.0 IOFreeze milestone Feb 12, 2021
@mjwitte
Copy link
Contributor

mjwitte commented Feb 12, 2021

@jasondegraw Sure I can do the transition code. Go ahead and get this up to date and ready for review.

@jasondegraw
Copy link
Member Author

@mjwitte I think I've got the documentation all fixed up and hopefully the unused object errors too.

@Myoldmopar
Copy link
Member

CI is looking good here, is it just the transition rules remaining?

@jasondegraw
Copy link
Member Author

@Myoldmopar Yes, after I fixed that last unit test failure (newly merged in test that was using the old object), as far as I know the only thing left is transition.

@mjwitte
Copy link
Contributor

mjwitte commented Feb 17, 2021

Transition added and develop merged in. @Myoldmopar Tag! Be sure to test the transition on a few files.

@Myoldmopar Myoldmopar self-assigned this Feb 17, 2021
used for control is the surface listed above in the field for Surface
Name. If the user enters a group of surfaces for that input, the
\emph{first} surface in the radiant group is the surface for control
purposes.
Copy link
Member

Choose a reason for hiding this comment

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

There was a minor conflict because this got modified in the #8530 PR. I think I got it resolved properly.

NwNumArgs = CurArgs - 5
OutArgs(1) = InArgs(1)
OutArgs(2:NwNumArgs) = InArgs(7:CurArgs)
CALL WriteOutIDFLines(DifLfn,'Construction',NwNumArgs,OutArgs,NwFldNames,NwFldUnits)
Copy link
Member

Choose a reason for hiding this comment

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

I was about to comment on how you also wrote out the object accidentally but I see you leveraged the written variable above to avoid it. Looks good.

@Myoldmopar
Copy link
Member

Pulled in develop locally to resolve conflicts, no major issues, built OK and unit tests run fine. Code looks good. CI looks good. I ran transition and the output diff looks good and the transitioned file runs fine (warning in VentilatedSlab.idf, but probably not related to this). I will push up my changes and merge this thing. Thanks @jasondegraw and @mjwitte

@Myoldmopar Myoldmopar merged commit e06c1ff into develop Feb 18, 2021
@Myoldmopar Myoldmopar deleted the remodify-source-input branch February 18, 2021 17:29
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) Refactoring Includes code changes that don't change the functionality of the program, just perform refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants