Skip to content

Commit

Permalink
Merge develop, resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Myoldmopar committed Jul 6, 2023
2 parents 6a70b9f + 88f7d68 commit ad36c45
Show file tree
Hide file tree
Showing 364 changed files with 32,006 additions and 32,488 deletions.
2 changes: 1 addition & 1 deletion .decent_ci-Windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ compilers:
- name: Visual Studio
version: 16
architecture: Win64
cmake_extra_flags: -DBUILD_FORTRAN:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DLINK_WITH_PYTHON=ON -DPYTHON_EXECUTABLE:PATH=C:/Users/elee/AppData/Local/Programs/Python/Python311/python.exe -DPython_EXECUTABLE:PATH=C:/Users/elee/AppData/Local/Programs/Python/Python311/python.exe
cmake_extra_flags: -DBUILD_FORTRAN:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DLINK_WITH_PYTHON=ON -DPython_EXECUTABLE:PATH=C:/Users/elee/AppData/Local/Programs/Python/Python311/python.exe
skip_regression: true
109 changes: 109 additions & 0 deletions .github/workflows/epjson.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: epJSON dependency

on:
push

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_TYPE: Release

jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
# fail-fast: Default is true, switch to false to allow one platform to fail and still run others
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Setup
shell: bash
run: |
cmake -E make_directory ./build/
if [ "$RUNNER_OS" == "Windows" ]; then
echo "Setting CMAKE_GENERATOR options equivalent to ='-G \"Visual Studio 17 2022\" -A x64'"
echo CMAKE_GENERATOR='Visual Studio 17 2022' >> $GITHUB_ENV
echo CMAKE_GENERATOR_PLATFORM=x64 >> $GITHUB_ENV
choco install ninja
fi;
- name: Configure CMake
working-directory: ./build
run: |
cmake ../
- name: Test epjson
shell: python
run: |
from pathlib import Path
import subprocess
EP_ROOT = Path(".").resolve()
EP_BUILD_DIR = Path('./build').resolve()
EXPECTED_MSGS = ["Generating the epJSON schema!", "Generating the **embedded** epJSON schema"]
def build():
lines = subprocess.check_output(
[
"cmake",
"--build",
str(EP_BUILD_DIR),
"--config",
"Release",
"--target",
"embedded_epjson_source",
],
encoding="utf-8",
stderr=subprocess.STDOUT,
).splitlines()
return lines
IDD_IN = EP_ROOT / "idd/Energy+.idd.in"
assert IDD_IN.exists()
def ensure_target_built(lines, msg):
breakpoint
lines = [x.strip() for x in lines if "epJSON schema" in x]
errors = []
for expected_msg in EXPECTED_MSGS:
n = lines.count(expected_msg)
if n != 1:
errors.append(f"Expected 1 occurrence of '{expected_msg}', got {n}")
assert not errors, "\n -" + "\n -".join(errors)
# Build: first time: we get both
lines = build()
ensure_target_built(lines, "Failed on first build")
# Insert a fake IDD change, we should also get both
with open(IDD_IN, "r") as f:
lines = f.read().splitlines()
ori_lines = lines.copy()
for i, line in enumerate(lines):
if line.startswith(r"\group"):
lines.insert(i + 1, "")
lines.insert(i + 2, "FakeObject,")
lines.insert(i + 3, r" A1; \field Name")
break
with open(IDD_IN, "w") as f:
f.write("\n".join(lines) + "\n")
lines = build()
ensure_target_built(lines, "Failed after IDD change")
with open(IDD_IN, "w") as f:
f.write("\n".join(ori_lines) + "\n")
lines = build()
ensure_target_built(lines, "Failed after IDD change revert")
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ testfiles/*.htm
# this is autogenerated in the src dir
doc/title.tex

# ignore Energy+.schema.epJSON while it is auto-generated from IDD
Energy+.schema.epJSON.in

# ignore the doxygen and sphinx built API docs
doc/readthedocs/doxygen/_build
doc/readthedocs/sphinx/_build
Expand Down Expand Up @@ -88,3 +85,7 @@ CMakeSettings.json

# py2app puts things inside dist/ and build/, build/ is already ignored, just add dist/
dist

# if you generate sphinx docs, it builds a dummy version of the schema in the idd folder, just ignore it
/idd/Energy+.schema.epJSON
/idd/Energy+.schema.epJSON.in
23 changes: 5 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cmake_minimum_required(VERSION 3.17)

# Use ccache if available, has to be before "project()"
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
Expand All @@ -9,8 +11,6 @@ cmake_policy(SET CMP0048 NEW) # handling project_version_* variables

project(EnergyPlus)

cmake_minimum_required(VERSION 3.17)

if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER "3.0")
cmake_policy(SET CMP0054 NEW) # CMake 3.1 added this policy
endif()
Expand Down Expand Up @@ -283,9 +283,6 @@ target_include_directories(project_options INTERFACE ${PROJECT_SOURCE_DIR}/third
target_include_directories(project_options INTERFACE "${kiva_BINARY_DIR}/src/libkiva")
target_include_directories(project_options SYSTEM INTERFACE "${kiva_SOURCE_DIR}/vendor/boost-1.61.0/")

add_subdirectory(scripts/dev/generate_embeddable_epJSON_schema)
set_target_properties(generate_embeddable_epJSON_schema PROPERTIES FOLDER "Internal")

target_include_directories(project_options INTERFACE ${PROJECT_SOURCE_DIR}/third_party/cpgfunctionEP)
target_include_directories(project_options INTERFACE ${PROJECT_SOURCE_DIR}/third_party/cpgfunctionEP/include)

Expand All @@ -298,15 +295,6 @@ endif()
# E+ required libraries
add_subdirectory(idd)

execute_process(
COMMAND ${Python_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/dev/generate_epJSON_schema/generate_epJSON_schema.py" "${PROJECT_SOURCE_DIR}"
TIMEOUT 30
RESULT_VARIABLE generate_epJSON_schema_result)
if(${generate_epJSON_schema_result} MATCHES ".*timeout.*")
message(FATAL_ERROR "Generating epJSON Schema from IDD failed: ${generate_epJSON_schema_result}")
endif()
configure_file(idd/Energy+.idd.in "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Energy+.idd")
configure_file(idd/Energy+.schema.epJSON.in "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Energy+.schema.epJSON")
configure_file(idd/BasementGHT.idd "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/BasementGHT.idd")
configure_file(idd/SlabGHT.idd "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SlabGHT.idd")

Expand All @@ -322,7 +310,6 @@ configure_file("workflows/transition.py" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/work
# of course E+ itself
add_subdirectory(src/EnergyPlus)
set_target_properties(airflownetworklib PROPERTIES FOLDER "Internal")
set_target_properties(GenerateEmbeddedEpJSONSchema PROPERTIES FOLDER "Internal")
set_target_properties(energyplusparser PROPERTIES FOLDER "Internal")

if(BUILD_TESTING)
Expand Down Expand Up @@ -371,9 +358,9 @@ if(BUILD_FORTRAN)
PROJECT Transition
CMAKE_COMMAND_LINE ${TRANSITION_EXTRA_FLAGS}
NO_EXTERNAL_INSTALL)
file(COPY "idd/V23-1-0-Energy+.idd" DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
configure_file(idd/Energy+.idd.in "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/V23-2-0-Energy+.idd")
file(COPY "src/Transition/SupportFiles/Report Variables 23-1-0 to 23-2-0.csv" DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
file(COPY "${PREVIOUS_IDD}" DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
configure_file(idd/Energy+.idd.in "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/V${CMAKE_VERSION_MAJOR}-${CMAKE_VERSION_MINOR}-${CMAKE_VERSION_PATCH}-Energy+.idd")
file(COPY "src/Transition/SupportFiles/Report Variables ${PREV_RELEASE_MAJOR}-${PREV_RELEASE_MINOR}-${PREV_RELEASE_PATCH} to ${CMAKE_VERSION_MAJOR}-${CMAKE_VERSION_MINOR}-${CMAKE_VERSION_PATCH}.csv" DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
cmake_add_fortran_subdirectory(
src/Basement
PROJECT Basement
Expand Down
3 changes: 1 addition & 2 deletions cmake/Install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,7 @@ set(CPACK_RESOURCE_FILE_README "${PROJECT_BINARY_DIR}/release/readme.html")

install(FILES "${PROJECT_SOURCE_DIR}/bin/CurveFitTools/IceStorageCurveFitTool.xlsm" DESTINATION "PreProcess/HVACCurveFitTool/")
install(FILES "${PROJECT_SOURCE_DIR}/bin/CurveFitTools/CurveFitTool.xlsm" DESTINATION "PreProcess/HVACCurveFitTool/")
install(FILES "${PROJECT_SOURCE_DIR}/idd/V23-1-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater/")
install(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater/" RENAME "V23-2-0-Energy+.idd")
install(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater/" RENAME "V${CMAKE_VERSION_MAJOR}-${CMAKE_VERSION_MINOR}-${CMAKE_VERSION_PATCH}-Energy+.idd")

# Workflow stuff, takes about 40KB, so not worth it proposing to not install it
install(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/workflows/app_g_postprocess.py" DESTINATION "workflows/") # COMPONENT Workflows)
Expand Down
153 changes: 153 additions & 0 deletions design/FY2023/NFP-evapCoolerRHcontrol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@

Enhancement of Evaporative Cooler in EnergyPlus
================

**Yujie Xu, Tianzhen Hong**

**Lawrence Berkeley National Laboratory***

- Original Date: Apr 7, 2023
- Modified Date: Apr 11, 2023

## Justification for Feature Update

As global climate change continues, the frequency, duration and intensity of heatwaves could increase. As an affordable and energy efficient cooling option [1], evaporative cooling could become more prevalent in the future, especially in hot and dry climates. As a result, it is crucial to provide accurate and more user-friendly simulation support for prototyping new evaporative coolers and their applications. With this motivation, this EnergyPlus feature is proposed to provide an additional relative humidity-driven control option.

![zoneEvapCoolerDiagram](zoneEvapCoolerDiagram.png)
<p style="text-align: center;"> Figure 1. Conceptual diagram of a direct evaporative cooler [source](https://basc.pnnl.gov/resource-guides/evaporative-cooling-systems#edit-group-description) (left), an example of a zone-level direct evaporative cooler[source](https://www.nytimes.com/wirecutter/blog/do-swamp-coolers-work/) (right).</p>

The enhancement was motivated by discussions with the CBE research group at UC Berkeley: Hui Zhang, Roberto Rugani, and Maria Andre.

## Overview ##

The introduction of excessive moisture is one of the potential issues of direct evaporative coolers. A humidity control could become useful in preventing the evaporative cooler from raising indoor humidity to an uncomfortable level. Currently, the direct evaporative cooler can be controlled with the sensor node temperature using AvailabilityManagers (*AvailabilityManager:LowTemperatureTurnOff* or *AvailabilityManager:HighTemperatureTurnOn*). This feature proposes to add a relative humidity (RH) control to shut down the evaporative cooler when the indoor relative humidity is too high.

We plan to enhance the zone level evaporative cooler object, *ZoneHVAC:EvaporativeCoolerUnit*. This is a compound object that combines a fan and one
Each evaporative cooler in this object can be a direct or indirect. This feature will add some additional fields to this zone-level object, allowing user to specify a relative-humidity threshold above which the unit will be turned off.

## Approach

To enable a high-relative-humidity-cutoff control, a field will be added to the *ZoneHVAC:EvaporativeCoolerUnit* object. See Section IDD object change for details.

## Testing/Validation/Data Source(s)

This feature will be tested and demonstrated with a test file derived from StripMallZoneEvapCooler.idf. Manual check of the time-step EnergyPlus simulation results will be conducted to confirm the added feature is working correctly.

## IDD Object changes

A field (N4) will be added to the ZoneHVAC:EvaporativeCoolerUnit

ZoneHVAC:EvaporativeCoolerUnit,
\memo Zone evaporative cooler. Forced-convection cooling-only unit with supply fan,
\memo 100% outdoor air supply. Optional relief exhaust node
\min-fields 15
A1 , \field Name
\required-field
\reference ZoneEquipmentNames
A2 , \field Availability Schedule Name
\note Availability schedule name for this system. Schedule value > 0 means the system is available.
\note If this field is blank, the system is always available.
\type object-list
\object-list ScheduleNames
A3, \field Availability Manager List Name
\note Enter the name of an AvailabilityManagerAssignmentList object.
\type object-list
\object-list SystemAvailabilityManagerLists
A4 , \field Outdoor Air Inlet Node Name
\required-field
\type node
\note this is an outdoor air node
A5 , \field Cooler Outlet Node Name
\required-field
\type node
\note this is a zone inlet node
A6 , \field Zone Relief Air Node Name
\type node
\note this is a zone exhaust node, optional if flow is being balanced elsewhere
A7 , \field Supply Air Fan Object Type
\required-field
\type choice
\key Fan:SystemModel
\key Fan:ComponentModel
\key Fan:ConstantVolume
\key Fan:OnOff
\key Fan:VariableVolume
A8 , \field Supply Air Fan Name
\required-field
\type object-list
\object-list Fans
N1 , \field Design Supply Air Flow Rate
\required-field
\units m3/s
\minimum> 0
\autosizable
A9 , \field Fan Placement
\required-field
\type choice
\key BlowThrough
\key DrawThrough
A10, \field Cooler Unit Control Method
\required-field
\type choice
\key ZoneTemperatureDeadbandOnOffCycling
\key ZoneCoolingLoadOnOffCycling
\key ZoneCoolingLoadVariableSpeedFan
N2 , \field Throttling Range Temperature Difference
\note used for ZoneTemperatureDeadbandOnOffCycling hystersis range for thermostatic control
\type real
\units deltaC
\default 1.0
\minimum> 0.0
N3 , \field Cooling Load Control Threshold Heat Transfer Rate
\type real
\units W
\default 100.0
\note Sign convention is that positive values indicate a cooling load
\minimum> 0.0
A11, \field First Evaporative Cooler Object Type
\required-field
\type choice
\key EvaporativeCooler:Direct:CelDekPad
\key EvaporativeCooler:Direct:ResearchSpecial
\key EvaporativeCooler:Indirect:CelDekPad
\key EvaporativeCooler:Indirect:WetCoil
\key EvaporativeCooler:Indirect:ResearchSpecial
A12, \field First Evaporative Cooler Object Name
\required-field
\type object-list
\object-list EvapCoolerNames
A13, \field Second Evaporative Cooler Object Type
\note optional, used for direct/indirect configurations
\note second cooler must be immediately downstream of first cooler, if present
\type choice
\key EvaporativeCooler:Direct:CelDekPad
\key EvaporativeCooler:Direct:ResearchSpecial
\key EvaporativeCooler:Indirect:CelDekPad
\key EvaporativeCooler:Indirect:WetCoil
\key EvaporativeCooler:Indirect:ResearchSpecial
A14, \field Second Evaporative Cooler Name
\note optional, used for direct/indirect configurations
\type object-list
\object-list EvapCoolerNames
A15, \field Design Specification ZoneHVAC Sizing Object Name
\note Enter the name of a DesignSpecificationZoneHVACSizing object.
\type object-list
\object-list DesignSpecificationZoneHVACSizingName
N4; \field Shut Off Relative Humidity
\note Zone relative humidity above which the evap cooler is shut off.
\type real
\minimum 0.00
\maximum 100.00
\units percent

## Proposed additions to Meters:

N/A

## Proposed Report Variables:

N/A

## References

[1] https://www.energy.gov/energysaver/evaporative-coolers <br>
Binary file added design/FY2023/zoneEvapCoolerDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

5 comments on commit ad36c45

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

9966-wshp-cycling (Myoldmopar) - Win64-Windows-10-VisualStudio-16: OK (2664 of 2664 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

9966-wshp-cycling (Myoldmopar) - x86_64-Linux-Ubuntu-22.04-gcc-11.3: OK (3409 of 3478 tests passed, 7 test warnings)

Messages:\n

  • 7 tests had: Table small diffs.
  • 25 tests had: EIO diffs.
  • 19 tests had: ESO big diffs.
  • 14 tests had: MTR big diffs.
  • 69 tests had: Table big diffs.
  • 12 tests had: AUD diffs.
  • 15 tests had: ERR diffs.
  • 4 tests had: ESO small diffs.
  • 4 tests had: RDD diffs.
  • 1 test had: MTR small diffs.

Failures:\n

regression Test Summary

  • Passed: 723
  • Failed: 69

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

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

9966-wshp-cycling (Myoldmopar) - x86_64-MacOS-10.17-clang-13.0.0: OK (3369 of 3437 tests passed, 7 test warnings)

Messages:\n

  • 7 tests had: Table small diffs.
  • 24 tests had: EIO diffs.
  • 18 tests had: ESO big diffs.
  • 14 tests had: MTR big diffs.
  • 68 tests had: Table big diffs.
  • 12 tests had: AUD diffs.
  • 14 tests had: ERR diffs.
  • 4 tests had: ESO small diffs.
  • 4 tests had: RDD diffs.
  • 1 test had: MTR small diffs.

Failures:\n

regression Test Summary

  • Passed: 704
  • Failed: 68

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

9966-wshp-cycling (Myoldmopar) - x86_64-Linux-Ubuntu-22.04-gcc-11.3-UnitTestsCoverage-Debug: OK (1891 of 1891 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

9966-wshp-cycling (Myoldmopar) - x86_64-Linux-Ubuntu-22.04-gcc-11.3-IntegrationCoverage-Debug: OK (776 of 776 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.