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

Fix #10624 - Fix Transition from 23.2.0 to 24.2.0 when a HeatExchanger:AirToAir:SensibleAndLatent has blank effectiveness fields #10639

Merged
merged 2 commits into from
Aug 5, 2024

Conversation

jmarrec
Copy link
Contributor

@jmarrec jmarrec commented Aug 5, 2024

Pull request overview

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

…that when retrieving HX effectivenesses

This will effectively set the values to 0.0 if blank, since that's what the IDD default is for these fields.
@jmarrec jmarrec added Defect Includes code to repair a defect in EnergyPlus NotIDDChange Code does not impact IDD (can be merged after IO freeze) AuxiliaryTool Related to an auxiliary tool, not EnergyPlus itself (readvars, preprocessor, ep-launch, etc.) labels Aug 5, 2024
@jmarrec jmarrec self-assigned this Aug 5, 2024
@jmarrec
Copy link
Contributor Author

jmarrec commented Aug 5, 2024

Comparing

Original V2320 Develop Transition This PR Transition

FillHXBlanks_V2320.idf

Notice the useless Table:IndependentVariable and Table:IndependentVariableList in develop but not this PR

image

NoBlanksDifferentEffectiveness_V2320.idf

image

WithHXBlanks_V2320.idf

develop segfaults

image

WithHXBlanks_Different_Effectiveness_V2320.idf

develop segfaults

image

Comment on lines +4817 to +4837
FUNCTION GetFieldOrIDDDefault(InArgString, FldDefaultString) RESULT (ResultString)

! PURPOSE OF THIS SUBROUTINE:
! If InArgString is Blank, replace with FldDefaultString

IMPLICIT NONE ! Enforce explicit typing of all variables in this routine


! FUNCTION ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: InArgString ! Input String
CHARACTER(len=*), INTENT(IN) :: FldDefaultString ! Default String
CHARACTER(len=LEN(InArgString)) :: ResultString ! Result String

ResultString=InArgString
IF (ResultString == Blank) THEN
ResultString = FldDefaultString
ENDIF

RETURN

END FUNCTION GetFieldOrIDDDefault
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New helper

Comment on lines +432 to +447
! Sensible Effectiveness at 75% Heating Air Flow
HxEffectAt75Airflow(1) = GetFieldOrIDDDefault(InArgs(6), FldDefaults(6))
! Latent Effectiveness at 75% Heating Air Flow
HxEffectAt75Airflow(2) = GetFieldOrIDDDefault(InArgs(7), FldDefaults(7))
! Sensible Effectiveness at 75% Cooling Air Flow
HxEffectAt75Airflow(3) = GetFieldOrIDDDefault(InArgs(10), FldDefaults(10))
! Latent Effectiveness at 75% Cooling Air Flow
HxEffectAt75Airflow(4) = GetFieldOrIDDDefault(InArgs(11), FldDefaults(11))
! Sensible Effectiveness at 100% Heating Air Flow
HxEffectAt100Airflow(1) = GetFieldOrIDDDefault(InArgs(4), FldDefaults(4))
! Latent Effectiveness at 100% Heating Air Flow
HxEffectAt100Airflow(2) = GetFieldOrIDDDefault(InArgs(5), FldDefaults(5))
! Sensible Effectiveness at 100% Cooling Air Flow
HxEffectAt100Airflow(3) = GetFieldOrIDDDefault(InArgs(8), FldDefaults(8))
! Latent Effectiveness at 100% Cooling Air Flow
HxEffectAt100Airflow(4) = GetFieldOrIDDDefault(InArgs(9), FldDefaults(9))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use it.

@@ -138,7 +138,7 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile
CHARACTER(20), DIMENSION(4) :: HxEffectAt75Airflow
CHARACTER(20), DIMENSION(4) :: HxEffectAt100Airflow
CHARACTER(MaxNameLength + 2), DIMENSION(4) :: HxTableName
LOGICAL :: tableAdded
LOGICAL :: tableAdded = .false.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Avoid writting Table:IndependentVariable(List) when not needed

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 seems cool, I've never paid attention to the FldDefaults before, but it looks look a great use of it. And it's just one of the args passed to GetObjectDefInIDD, so it should be safe. This is good stuff.

I'll do a quick test but this should merge soon. @mjwitte am I missing anything here?

! PURPOSE OF THIS SUBROUTINE:
! If InArgString is Blank, replace with FldDefaultString

IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
Copy link
Member

Choose a reason for hiding this comment

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

Implicit None is already declared at the top of the module, so probably not necessary, but totally fine.

HxEffectAt100Airflow(3) = TRIM(InArgs(8)) ! Sensible Effectiveness at 100% Cooling Air Flow
HxEffectAt100Airflow(4) = TRIM(InArgs(9)) ! Latent Effectiveness at 100% Cooling Air Flow
! Sensible Effectiveness at 75% Heating Air Flow
HxEffectAt75Airflow(1) = GetFieldOrIDDDefault(InArgs(6), FldDefaults(6))
Copy link
Member

Choose a reason for hiding this comment

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

So FldDefaults will always be populated with meaningful or blank values? I've never used that array so just confirming.

@mjwitte
Copy link
Contributor

mjwitte commented Aug 5, 2024

@jmarrec @Myoldmopar This works. Nothing to add.

@Myoldmopar
Copy link
Member

Awesome, merging this. Thanks @jmarrec

@Myoldmopar Myoldmopar merged commit eb6665f into develop Aug 5, 2024
19 checks passed
@Myoldmopar Myoldmopar deleted the 10624_Transition_HX_crash branch August 5, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AuxiliaryTool Related to an auxiliary tool, not EnergyPlus itself (readvars, preprocessor, ep-launch, etc.) Defect Includes code to repair a defect in EnergyPlus NotIDDChange Code does not impact IDD (can be merged after IO freeze)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transition to v24.1 crashes in the HX transition if there are blank effectiveness fields
8 participants