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 #10826 - Possible Error in Slab #10843

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open

Fix #10826 - Possible Error in Slab #10843

wants to merge 6 commits into from

Conversation

jmarrec
Copy link
Contributor

@jmarrec jmarrec commented Dec 2, 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

@jmarrec jmarrec added DoNotPublish Includes changes that shouldn't be reported in the changelog AuxiliaryTool Related to an auxiliary tool, not EnergyPlus itself (readvars, preprocessor, ep-launch, etc.) Developer Issue Related to cmake, packaging, installers, or developer tooling (CI, etc) labels Dec 2, 2024
@jmarrec jmarrec self-assigned this Dec 2, 2024
@@ -109,7 +109,7 @@ if(BUILD_FORTRAN)
find_program(SLAB_EXE Slab PATHS "${PRODUCT_PATH}" NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH)
message("Executing Slab from ${SLAB_EXE}")
execute_process(COMMAND "${SLAB_EXE}" WORKING_DIRECTORY "${OUTPUT_DIR_PATH}")
execute_process(COMMAND "${SLAB_EXE}" WORKING_DIRECTORY "${OUTPUT_DIR_PATH}" COMMAND_ERROR_IS_FATAL ANY)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Catch errors if any. This needs cmake 3.19

@@ -118,11 +118,12 @@ if(BUILD_FORTRAN)
if("${BASEMENT_RESULT}" GREATER -1)
# Copy files needed for Basement
file(COPY "${SOURCE_DIR}/idd/BasementGHT.idd" DESTINATION "${OUTPUT_DIR_PATH}")
file(COPY "${OUTPUT_DIR_PATH}/in.idf" DESTINATION "${OUTPUT_DIR_PATH}/BasementGHTIn.idf")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Attempt to get the basement program working (it still isn't)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm getting errors such as

IP: IDF line~5384 Did not find “Output:Variable” in list of Objects;
 Output:PreprocessorMessage,GroundTempCalc - Basement,Severe,
IP: The IDF file has no records.;
 Output:PreprocessorMessage,GroundTempCalc - Basement,Severe,
IP: Other miscellaneous errors found in input;
   **   ~~~   ** Possible Invalid Numerics or other problems
 Output:PreprocessorMessage,GroundTempCalc - Basement,Fatal,```

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh ok.

GroundHeatTransfer:Control,
gtp_control, !- Name
no, !- Run Basement Preprocessor
yes; !- Run Slab Preprocessor

…ays not to

Issue an author warning, but maybe we should throw and fix the IDFs?
@jmarrec jmarrec added the Defect Includes code to repair a defect in EnergyPlus label Dec 2, 2024
Comment on lines +103 to +104
# This creates GHTIn.idf, and BasementGHTIn.idf IIF the GroundHeatTransfer:Control says to run it!
execute_process(COMMAND "${EXPANDOBJECTS_EXE}" WORKING_DIRECTORY "${OUTPUT_DIR_PATH}" COMMAND_ERROR_IS_FATAL ANY)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, I found why this wasn't creating that BasementGHTIn.idf... cf #10826 (comment)

Comment on lines 129 to 138
if(NOT EXISTS "${OUTPUT_DIR_PATH}/BasementGHTIn.idf")
message(AUTHOR_WARNING "Did not find ${OUTPUT_DIR_PATH}/BasementGHTIn.idf, are you sure the GroundHeatTransfer:Control has Run Basement Preprocessor = Yes?")
string(REGEX MATCH "GroundHeatTransfer:Control.*Run Slab Preprocessor" GROUND_HT_CONTROL "${IDF_CONTENT}")
if (GROUND_HT_CONTROL)
message(AUTHOR_WARNING "GROUND_HT_CONTROL=${GROUND_HT_CONTROL}")
endif()
else()

# Copy files needed for Basement
file(COPY "${SOURCE_DIR}/idd/BasementGHT.idd" DESTINATION "${OUTPUT_DIR_PATH}")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If ExpandObjects didn't create that BasementGHTIn.idf, it's because the GroundHeaterTransfer:Control says not to. Not sure if that shouldn't be a FATAL_ERROR instead and we fix the idf. Asked for input from other devs.

In the meantime, issue an AUTHOR_WARNING, and don't call basement on it.

# Then copy slab results into the expanded file
file(READ "${OUTPUT_DIR_PATH}/SLABSurfaceTemps.TXT" SLAB_CONTENTS)
file(APPEND "${OUTPUT_DIR_PATH}/expanded.idf" "${SLAB_CONTENTS}")
if(NOT EXISTS "${OUTPUT_DIR_PATH}/GHTin.idf")
Copy link
Contributor Author

@jmarrec jmarrec Dec 3, 2024

Choose a reason for hiding this comment

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

Couldn' understand why decent CI Linux was not finding it, while It was working on mac...

I'm always saying "beware that macOS/Windows have case-insensitive filesystem while Linux is case-sensitive", and I still made that mistake.

…ifcation)

These definitely do NOT have a basement anyways
…asement objects but GroundHT:Control says "No" to run preprocessor

This is so we catch unintented developer mistakes in the future (though I doubt Slab/Basement files will be added often)
@jmarrec jmarrec marked this pull request as ready for review December 3, 2024 10:37
@jmarrec jmarrec changed the title #10826 - Possible Error in Slab Fix #10826 - Possible Error in Slab Dec 3, 2024
Copy link

github-actions bot commented Dec 3, 2024

⚠️ Regressions detected on macos-14 for commit e76ee4e

Regression Summary
  • IDF: 3

@Myoldmopar Myoldmopar self-assigned this Dec 4, 2024
@jmarrec jmarrec requested a review from Myoldmopar December 9, 2024 07:43
@jmarrec
Copy link
Contributor Author

jmarrec commented Dec 9, 2024

Regressions are just of the IDF type, because I removed some unused basement objects

@nrel-bot-2
Copy link

@jmarrec it has been 12 days since this pull request was last updated.

@nrel-bot-2
Copy link

@jmarrec it has been 7 days since this pull request was last updated.

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 Developer Issue Related to cmake, packaging, installers, or developer tooling (CI, etc) DoNotPublish Includes changes that shouldn't be reported in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants