Skip to content

Commit

Permalink
Merge pull request #10843 from NREL/10826_Slab
Browse files Browse the repository at this point in the history
Fix #10826 - Possible Error in Slab
  • Loading branch information
Myoldmopar authored Jan 10, 2025
2 parents e3c2d2a + ecc7435 commit 595a3ef
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 295 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.17)
cmake_minimum_required(VERSION 3.19)

# Use ccache if available, has to be before "project()"
find_program(CCACHE_PROGRAM NAMES ccache sccache)
Expand Down
27 changes: 23 additions & 4 deletions cmake/RunSimulation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ if(BUILD_FORTRAN)
find_program(PARAMETRIC_EXE ParametricPreprocessor 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)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${IDF_PATH}" "${OUTPUT_DIR_PATH}")
execute_process(COMMAND "${PARAMETRIC_EXE}" "${IDF_FILE}" WORKING_DIRECTORY "${OUTPUT_DIR_PATH}")
execute_process(COMMAND "${PARAMETRIC_EXE}" "${IDF_FILE}" WORKING_DIRECTORY "${OUTPUT_DIR_PATH}" COMMAND_ERROR_IS_FATAL ANY)

# this handles the LBuildingAppGRotPar parametric file
if(EXISTS "${OUTPUT_DIR_PATH}/${IDF_NAME}-G000.idf")
Expand Down Expand Up @@ -100,29 +100,48 @@ if(BUILD_FORTRAN)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${IDF_PATH}" "${OUTPUT_DIR_PATH}/in.idf")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${EPW_PATH}" "${OUTPUT_DIR_PATH}/in.epw")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${PRODUCT_PATH}/Energy+.idd" "${OUTPUT_DIR_PATH}")
execute_process(COMMAND "${EXPANDOBJECTS_EXE}" WORKING_DIRECTORY "${OUTPUT_DIR_PATH}")
# 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)

if("${SLAB_RESULT}" GREATER -1)
if(NOT EXISTS "${OUTPUT_DIR_PATH}/GHTIn.idf")
string(REGEX MATCH "GroundHeatTransfer:Control.*Run Slab Preprocessor" GROUND_HT_CONTROL "${IDF_CONTENT}")
if (GROUND_HT_CONTROL)
message(FATAL_ERROR "Did not find ${OUTPUT_DIR_PATH}/GHTIn.idf, are you sure the GroundHeatTransfer:Control has Run Slab Preprocessor = Yes?\nGROUND_HT_CONTROL=${GROUND_HT_CONTROL}")
else()
message(FATAL_ERROR "Did not find ${OUTPUT_DIR_PATH}/GHTIn.idf, are you sure the GroundHeatTransfer:Control has Run Slab Preprocessor = Yes?")
endif()
endif()
# Copy files needed for Slab
file(COPY "${SOURCE_DIR}/idd/SlabGHT.idd" DESTINATION "${OUTPUT_DIR_PATH}")
# Find and run slab
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}")
# This creates SLABINP.TXT, SLABSplit Surface Temps.TXT, and SLABSurfaceTemps.TXT
execute_process(COMMAND "${SLAB_EXE}" WORKING_DIRECTORY "${OUTPUT_DIR_PATH}" COMMAND_ERROR_IS_FATAL ANY)
# 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}")
endif()

if("${BASEMENT_RESULT}" GREATER -1)
if(NOT EXISTS "${OUTPUT_DIR_PATH}/BasementGHTIn.idf")
string(REGEX MATCH "GroundHeatTransfer:Control.*Run Slab Preprocessor" GROUND_HT_CONTROL "${IDF_CONTENT}")
if (GROUND_HT_CONTROL)
message(FATAL_ERROR "Did not find ${OUTPUT_DIR_PATH}/BasementGHTIn.idf, are you sure the GroundHeatTransfer:Control has Run Basement Preprocessor = Yes?\nGROUND_HT_CONTROL=${GROUND_HT_CONTROL}")
else()
message(FATAL_ERROR "Did not find ${OUTPUT_DIR_PATH}/BasementGHTIn.idf, are you sure the GroundHeatTransfer:Control has Run Basement Preprocessor = Yes?")
endif()
endif()

# Copy files needed for Basement
file(COPY "${SOURCE_DIR}/idd/BasementGHT.idd" DESTINATION "${OUTPUT_DIR_PATH}")
# Find and run basement
find_program(BASEMENT_EXE Basement 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 Basement from ${BASEMENT_EXE}")
execute_process(COMMAND "${BASEMENT_EXE}" WORKING_DIRECTORY "${OUTPUT_DIR_PATH}")
execute_process(COMMAND "${BASEMENT_EXE}" WORKING_DIRECTORY "${OUTPUT_DIR_PATH}" COMMAND_ERROR_IS_FATAL ANY)
# Then copy basement results into the expanded file
file(READ "${OUTPUT_DIR_PATH}/EPObjects.TXT" BASEMENT_CONTENTS)
file(APPEND "${OUTPUT_DIR_PATH}/expanded.idf" "${BASEMENT_CONTENTS}")
Expand Down
96 changes: 0 additions & 96 deletions testfiles/SingleFamilyHouse_HP_Slab.idf
Original file line number Diff line number Diff line change
Expand Up @@ -2694,102 +2694,6 @@
15, !- CLEARANCE: Distance from edge of slab to domain edge {m}
15; !- ZCLEARANCE: Distance from bottom of slab to domain bottom {m}

!- =========== ALL OBJECTS IN CLASS: GROUNDHEATTRANSFER:BASEMENT:SIMPARAMETERS ===========

GroundHeatTransfer:Basement:SimParameters,
0.1, !- F: Multiplier for the ADI solution
15; !- IYRS: Maximum number of yearly iterations:

!- =========== ALL OBJECTS IN CLASS: GROUNDHEATTRANSFER:BASEMENT:MATLPROPS ===========

GroundHeatTransfer:Basement:MatlProps,
6, !- NMAT: Number of materials in this domain
2243, !- Density for Foundation Wall {kg/m3}
2243, !- density for Floor Slab {kg/m3}
311, !- density for Ceiling {kg/m3}
1500, !- density for Soil {kg/m3}
2000, !- density for Gravel {kg/m3}
449, !- density for Wood {kg/m3}
880, !- Specific heat for foundation wall {J/kg-K}
880, !- Specific heat for floor slab {J/kg-K}
1530, !- Specific heat for ceiling {J/kg-K}
840, !- Specific heat for soil {J/kg-K}
720, !- Specific heat for gravel {J/kg-K}
1530, !- Specific heat for wood {J/kg-K}
1.4, !- Thermal conductivity for foundation wall {W/m-K}
1.4, !- Thermal conductivity for floor slab {W/m-K}
0.09, !- Thermal conductivity for ceiling {W/m-K}
1.1, !- thermal conductivity for soil {W/m-K}
1.9, !- thermal conductivity for gravel {W/m-K}
0.12; !- thermal conductivity for wood {W/m-K}

!- =========== ALL OBJECTS IN CLASS: GROUNDHEATTRANSFER:BASEMENT:INSULATION ===========

GroundHeatTransfer:Basement:Insulation,
1.76099742894375e-05, !- REXT: R Value of any exterior insulation {m2-K/W}
True; !- INSFULL: Flag: Is the wall fully insulated?

!- =========== ALL OBJECTS IN CLASS: GROUNDHEATTRANSFER:BASEMENT:SURFACEPROPS ===========

GroundHeatTransfer:Basement:SurfaceProps,
0.16, !- ALBEDO: Surface albedo for No snow conditions
0.4, !- ALBEDO: Surface albedo for snow conditions
0.94, !- EPSLN: Surface emissivity No Snow
0.86, !- EPSLN: Surface emissivity with Snow
6, !- VEGHT: Surface roughness No snow conditions {cm}
0.25, !- VEGHT: Surface roughness Snow conditions {cm}
False; !- PET: Flag, Potential evapotranspiration on?

!- =========== ALL OBJECTS IN CLASS: GROUNDHEATTRANSFER:BASEMENT:BLDGDATA ===========

GroundHeatTransfer:Basement:BldgData,
0.200000006162114, !- DWALL: Wall thickness {m}
0.243828108701145, !- DSLAB: Floor slab thickness {m}
0.3, !- DGRAVXY: Width of gravel pit beside basement wall {m}
0.2, !- DGRAVZN: Gravel depth extending above the floor slab {m}
0.1; !- DGRAVZP: Gravel depth below the floor slab {m}

!- =========== ALL OBJECTS IN CLASS: GROUNDHEATTRANSFER:BASEMENT:INTERIOR ===========

GroundHeatTransfer:Basement:Interior,
True, !- COND: Flag: Is the basement conditioned?
0.92, !- HIN: Downward convection only heat transfer coefficient {W/m2-K}
4.04, !- HIN: Upward convection only heat transfer coefficient {W/m2-K}
3.08, !- HIN: Horizontal convection only heat transfer coefficient {W/m2-K}
6.13, !- HIN: Downward combined (convection and radiation) heat transfer coefficient {W/m2-K}
9.26, !- HIN: Upward combined (convection and radiation) heat transfer coefficient {W/m2-K}
8.29; !- HIN: Horizontal combined (convection and radiation) heat transfer coefficient {W/m2-K}

!- =========== ALL OBJECTS IN CLASS: GROUNDHEATTRANSFER:BASEMENT:COMBLDG ===========

GroundHeatTransfer:Basement:ComBldg,
21, !- January average temperature {C}
21, !- February average temperature {C}
21, !- March average temperature {C}
21, !- April average temperature {C}
24, !- May average temperature {C}
24, !- June average temperature {C}
24, !- July average temperature {C}
24, !- August average temperature {C}
24, !- September average temperature {C}
24, !- October average temperature {C}
21, !- November average temperature {C}
21, !- December average temperature {C}
21; !- Daily variation sine wave amplitude {deltaC}

!- =========== ALL OBJECTS IN CLASS: GROUNDHEATTRANSFER:BASEMENT:EQUIVSLAB ===========

GroundHeatTransfer:Basement:EquivSlab,
2.59994805991784, !- APRatio: The area to perimeter ratio for this slab {m}
True; !- EquivSizing: Flag

!- =========== ALL OBJECTS IN CLASS: GROUNDHEATTRANSFER:BASEMENT:EQUIVAUTOGRID ===========

GroundHeatTransfer:Basement:EquivAutoGrid,
15, !- CLEARANCE: Distance from outside of wall to edge of 3-D ground domain {m}
0.1, !- SlabDepth: Thickness of the floor slab {m}
1.21914054350572; !- BaseDepth: Depth of the basement wall below grade {m}

!- =========== ALL OBJECTS IN CLASS: PEOPLE ===========

People,
Expand Down
96 changes: 0 additions & 96 deletions testfiles/SingleFamilyHouse_HP_Slab_Dehumidification.idf
Original file line number Diff line number Diff line change
Expand Up @@ -2694,102 +2694,6 @@
15, !- CLEARANCE: Distance from edge of slab to domain edge {m}
15; !- ZCLEARANCE: Distance from bottom of slab to domain bottom {m}

!- =========== ALL OBJECTS IN CLASS: GROUNDHEATTRANSFER:BASEMENT:SIMPARAMETERS ===========

GroundHeatTransfer:Basement:SimParameters,
0.1, !- F: Multiplier for the ADI solution
15; !- IYRS: Maximum number of yearly iterations:

!- =========== ALL OBJECTS IN CLASS: GROUNDHEATTRANSFER:BASEMENT:MATLPROPS ===========

GroundHeatTransfer:Basement:MatlProps,
6, !- NMAT: Number of materials in this domain
2243, !- Density for Foundation Wall {kg/m3}
2243, !- density for Floor Slab {kg/m3}
311, !- density for Ceiling {kg/m3}
1500, !- density for Soil {kg/m3}
2000, !- density for Gravel {kg/m3}
449, !- density for Wood {kg/m3}
880, !- Specific heat for foundation wall {J/kg-K}
880, !- Specific heat for floor slab {J/kg-K}
1530, !- Specific heat for ceiling {J/kg-K}
840, !- Specific heat for soil {J/kg-K}
720, !- Specific heat for gravel {J/kg-K}
1530, !- Specific heat for wood {J/kg-K}
1.4, !- Thermal conductivity for foundation wall {W/m-K}
1.4, !- Thermal conductivity for floor slab {W/m-K}
0.09, !- Thermal conductivity for ceiling {W/m-K}
1.1, !- thermal conductivity for soil {W/m-K}
1.9, !- thermal conductivity for gravel {W/m-K}
0.12; !- thermal conductivity for wood {W/m-K}

!- =========== ALL OBJECTS IN CLASS: GROUNDHEATTRANSFER:BASEMENT:INSULATION ===========

GroundHeatTransfer:Basement:Insulation,
1.76099742894375e-05, !- REXT: R Value of any exterior insulation {m2-K/W}
True; !- INSFULL: Flag: Is the wall fully insulated?

!- =========== ALL OBJECTS IN CLASS: GROUNDHEATTRANSFER:BASEMENT:SURFACEPROPS ===========

GroundHeatTransfer:Basement:SurfaceProps,
0.16, !- ALBEDO: Surface albedo for No snow conditions
0.4, !- ALBEDO: Surface albedo for snow conditions
0.94, !- EPSLN: Surface emissivity No Snow
0.86, !- EPSLN: Surface emissivity with Snow
6, !- VEGHT: Surface roughness No snow conditions {cm}
0.25, !- VEGHT: Surface roughness Snow conditions {cm}
False; !- PET: Flag, Potential evapotranspiration on?

!- =========== ALL OBJECTS IN CLASS: GROUNDHEATTRANSFER:BASEMENT:BLDGDATA ===========

GroundHeatTransfer:Basement:BldgData,
0.200000006162114, !- DWALL: Wall thickness {m}
0.243828108701145, !- DSLAB: Floor slab thickness {m}
0.3, !- DGRAVXY: Width of gravel pit beside basement wall {m}
0.2, !- DGRAVZN: Gravel depth extending above the floor slab {m}
0.1; !- DGRAVZP: Gravel depth below the floor slab {m}

!- =========== ALL OBJECTS IN CLASS: GROUNDHEATTRANSFER:BASEMENT:INTERIOR ===========

GroundHeatTransfer:Basement:Interior,
True, !- COND: Flag: Is the basement conditioned?
0.92, !- HIN: Downward convection only heat transfer coefficient {W/m2-K}
4.04, !- HIN: Upward convection only heat transfer coefficient {W/m2-K}
3.08, !- HIN: Horizontal convection only heat transfer coefficient {W/m2-K}
6.13, !- HIN: Downward combined (convection and radiation) heat transfer coefficient {W/m2-K}
9.26, !- HIN: Upward combined (convection and radiation) heat transfer coefficient {W/m2-K}
8.29; !- HIN: Horizontal combined (convection and radiation) heat transfer coefficient {W/m2-K}

!- =========== ALL OBJECTS IN CLASS: GROUNDHEATTRANSFER:BASEMENT:COMBLDG ===========

GroundHeatTransfer:Basement:ComBldg,
21, !- January average temperature {C}
21, !- February average temperature {C}
21, !- March average temperature {C}
21, !- April average temperature {C}
24, !- May average temperature {C}
24, !- June average temperature {C}
24, !- July average temperature {C}
24, !- August average temperature {C}
24, !- September average temperature {C}
24, !- October average temperature {C}
21, !- November average temperature {C}
21, !- December average temperature {C}
21; !- Daily variation sine wave amplitude {deltaC}

!- =========== ALL OBJECTS IN CLASS: GROUNDHEATTRANSFER:BASEMENT:EQUIVSLAB ===========

GroundHeatTransfer:Basement:EquivSlab,
2.59994805991784, !- APRatio: The area to perimeter ratio for this slab {m}
True; !- EquivSizing: Flag

!- =========== ALL OBJECTS IN CLASS: GROUNDHEATTRANSFER:BASEMENT:EQUIVAUTOGRID ===========

GroundHeatTransfer:Basement:EquivAutoGrid,
15, !- CLEARANCE: Distance from outside of wall to edge of 3-D ground domain {m}
0.1, !- SlabDepth: Thickness of the floor slab {m}
1.21914054350572; !- BaseDepth: Depth of the basement wall below grade {m}

!- =========== ALL OBJECTS IN CLASS: PEOPLE ===========

People,
Expand Down
Loading

0 comments on commit 595a3ef

Please sign in to comment.