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

Vertical blind warning not reported from material get input function #10743

Merged
merged 4 commits into from
Oct 15, 2024

Conversation

rraustad
Copy link
Contributor

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

@rraustad rraustad added the Defect Includes code to repair a defect in EnergyPlus label Sep 16, 2024
if ((s_ipsc->rNumericArgs(16) < 0.0) ||
((s_ipsc->rNumericArgs(16) > 0.0) && (s_ipsc->rNumericArgs(16) < (s_ipsc->rNumericArgs(11) / 2)))) {
(mat->LayerType == TARCOGParams::TARCOGLayerType::VENETBLIND_VERT)) {
if ((s_ipsc->rNumericArgs(16) > 0.0) && (s_ipsc->rNumericArgs(16) < (s_ipsc->rNumericArgs(11) / 2))) {
Copy link
Contributor Author

@rraustad rraustad Sep 16, 2024

Choose a reason for hiding this comment

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

[src/EnergyPlus/Material.cc:2670]:(style),[duplicateExpression],Same expression on both sides of '||'.

These other checks are caught by InputProcessor and are never executed. For example if I make slat thickness < 0 this input processor warning is reported.

** Severe  ** <root>[WindowMaterial:ComplexShade][Shade_14_Layer][slat_thickness] - "-0.001000" - Expected number greater than 0.000000
**  Fatal  ** Errors occurred on processing input file. Preceding condition(s) cause termination.

WindowMaterial:ComplexShade,

 N11 , \field Slat Width
     \units m
     \type real
     \minimum> 0
     \default 0.016
 N12 , \field Slat Spacing
     \note Distance between adjacent slat faces
     \units m
     \type real
     \minimum> 0
     \default 0.012
 N13 , \field Slat Thickness
     \note Distance between top and bottom surfaces of slat
     \note Slat is assumed to be rectangular in cross section and flat
     \type real
     \units m
     \minimum> 0
     \default 0.0006
 N14 , \field Slat Angle
     \type real
     \units deg
     \default 90
     \minimum -90
     \maximum 90
 N15 , \field Slat Conductivity
     \type real
     \units W/m-K
     \minimum> 0
     \default 160.0
 N16 ; \field Slat Curve
     \note this value represents curvature radius of the slat.
     \note if the slat is flat use zero.
     \note if this value is not zero, then it must be > SlatWidth/2.
     \type real
     \units m
     \minimum 0.0
     \default 0

Copy link
Member

Choose a reason for hiding this comment

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

Yes! There is so much duplicated between the IDD/input processor range checks and then inaccessible checks in the get input routines. I love it.

if (Util::makeUPPER(itObj.key()) == s_ipsc->cAlphaArgs(3)) break;
}

if (itObj == instances.end()) {
if (itObj == instances2.end()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[src/EnergyPlus/Material.cc:2499]:(style),[shadowVariable],Local variable 'instances' shadows outer variable
[src/EnergyPlus/Material.cc:2526]:(style),[shadowVariable],Local variable 'instances' shadows outer variable

@@ -84,7 +84,7 @@ constexpr std::array<Material::Gas, 10> gases = {

constexpr std::array<std::string_view, (int)EcoRoofCalcMethod::Num> ecoRoofCalcMethodNamesUC = {"SIMPLE", "ADVANCED"};

int GetMaterialNum(EnergyPlusData &state, std::string const &matName)
int GetMaterialNum(EnergyPlusData const &state, std::string const &matName)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[src/EnergyPlus/Material.cc:87]:(style),[constParameter],Parameter 'state' can be declared as reference to const

@rraustad
Copy link
Contributor Author

Defect file with this branch:

** Severe  ** GetMaterialData: WindowMaterial:ComplexShade = SHADE_14_LAYER
**   ~~~   ** Slat Curve must be = 0 or greater than SlatWidth/2, entered value = 2.00E-003
**  Fatal  ** Error in complex fenestration material input.

@rraustad rraustad added this to the EnergyPlus 25.1 milestone Oct 14, 2024
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.

These changes look fine. But I am a little confused. The title is

Vertical blind warning not reported from material get input function

But I don't really see how your changes here enabled a warning to be emitted. Was it the instances variable shadowing?

if ((s_ipsc->rNumericArgs(16) < 0.0) ||
((s_ipsc->rNumericArgs(16) > 0.0) && (s_ipsc->rNumericArgs(16) < (s_ipsc->rNumericArgs(11) / 2)))) {
(mat->LayerType == TARCOGParams::TARCOGLayerType::VENETBLIND_VERT)) {
if ((s_ipsc->rNumericArgs(16) > 0.0) && (s_ipsc->rNumericArgs(16) < (s_ipsc->rNumericArgs(11) / 2))) {
Copy link
Member

Choose a reason for hiding this comment

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

Yes! There is so much duplicated between the IDD/input processor range checks and then inaccessible checks in the get input routines. I love it.

@rraustad
Copy link
Contributor Author

For the warning, a copy paste error caused the vertical blind to be skipped.

image

and now it's corrected here:

image

For the shadow variable there is the same variable outside this scope up at 177. I wasn't sure if I could reuse that one so I just renamed it.

image

@Myoldmopar
Copy link
Member

Ahh I see. Thanks! Windows build failure is certainly unrelated, right? But do I get fresh results just to be sure? Ugh, probably. OK, I'll merge develop in and get fresh results.

@Myoldmopar
Copy link
Member

There we go, all clean. Thanks @rraustad, merging.

@Myoldmopar Myoldmopar merged commit ec7398a into develop Oct 15, 2024
10 checks passed
@Myoldmopar Myoldmopar deleted the 10742-vertical-blind-warning branch October 15, 2024 19:50
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
Development

Successfully merging this pull request may close these issues.

Vertical blinds do not report a warning when slat curvature is < slat width / 2
6 participants