diff --git a/.github/workflows/documentation-windows.yml b/.github/workflows/documentation-windows.yml new file mode 100644 index 00000000000..3eb83b576ad --- /dev/null +++ b/.github/workflows/documentation-windows.yml @@ -0,0 +1,117 @@ +name: Documentation Windows + +on: + push: + branches: [ master, develop ] + +env: + CMAKE_Fortran_COMPILER: "/c/msys64/mingw64/bin/x86_64-w64-mingw32-gfortran.exe" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BUILD_TYPE: Release + +jobs: + build: + runs-on: windows-2019 + + steps: + - name: Checkout EnergyPlus + uses: actions/checkout@v2 + + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Install System dependencies and LaTeX + shell: bash + run: | + set -x + echo "Downloading MiKTeX CLI installer" + # We download from a specific miror already # TODO: Should store this setup package somewhere ourselves + curl -L -O https://ctan.math.illinois.edu/systems/win32/miktex/setup/windows-x64/miktexsetup-4.1-x64.zip + unzip miktexsetup-4.1-x64.zip + + echo "Setting up the local package directory via download" + ./miktexsetup_standalone --verbose \ + --local-package-repository=C:/MiKTeX-Repo \ + --remote-package-repository="https://ctan.math.illinois.edu/systems/win32/miktex/tm/packages/" \ + --package-set=essential \ + download + + echo "Installing from the local package directory previously set up" + ./miktexsetup_standalone --verbose \ + --local-package-repository=C:/MiKTeX-Repo \ + --package-set=essential \ + --shared=yes \ + install + + echo "Adding MiKTeX bin folder to PATH and to GITHUB_PATH" + echo "C:/Program Files/MiKTeX/miktex/bin/x64/" >> $GITHUB_PATH + export PATH="/c/Program Files/MiKTeX/miktex/bin/x64/:$PATH" + + echo "Configuring MiKTeX to install missing packages on the fly" + initexmf --admin --verbose --set-config-value='[MPM]AutoInstall=1' + + echo "Configure default mirror for packages" + mpm --admin --set-repository="https://ctan.math.illinois.edu/systems/win32/miktex/tm/packages/" + # If later we pre-package into a zip/tar.gz all the packages we need, we can preinstall them via + # mpm --admin --set-repository=C:/MiKTeX-Repo + # mpm --verbose --admin --repository=C:\MiKTeX-Repo --require=@C:\MiKTeX-Repo\energyplus_packages.lst + # Avoid annoying warning: "xelatex: major issue: So far, you have not checked for updates as a MiKTeX user." + mpm --find-updates + mpm --admin --find-updates + + - name: Install required packages + shell: bash + working-directory: ./doc/ + run: | + mpm --verbose --admin --require=@energyplus_packages_windows.lst + +# For quick debugging this could be useful, but note that it does not exhibit the main memory size exceeded error +# - name: Build Test package - Pass Number 1 +# shell: bash +# working-directory: ./doc/test/ +# run: | +# xelatex dependencies.tex +# nwords=$(pdftotext -f 2 -l 2 dependencies.pdf - | wc -w) +# [ "$nwords" -lt "10" ] && echo "TOC isn't available for pass NO. 1" || echo "TOC IS available for pass NO. 1" + + - name: Create Build Directory + run: cmake -E make_directory ./doc/build/ + + - name: Configure CMake + working-directory: ./doc/build + shell: bash + run: | + set -x + cmake -G "Visual Studio 16 2019" -A x64 -DTEX_INTERACTION=batchmode -DDOCS_TESTING=ON ../ + + - name: Add problem matcher + run: echo "::add-matcher::.github/workflows/doc-problem-match.json" + + - name: Build Docs + working-directory: ${{runner.workspace}}/EnergyPlus/doc/build + run: | + cmake --build . -j 2 + + # I made the BuildDOcumentation.cmake throw a FATAL_ERROR already on pass 2 and 3 of xelatex, so this is redundant now + # but if you want to just build `--target zPDF_InputOutputReference` and test it here, I'm leaving it as an example +# - name: Test InputOutputReference +# shell: bash +# working-directory: ./doc/build/pdf/ +# run: | +# set -x +# pdfinfo InputOutputReference.pdf || true +# npages=$(pdfinfo InputOutputReference.pdf | /bin/grep "Pages:" | sed 's/[^0-9]*//') +# echo "Found $npages pages in the I/O Ref" +# nwords_in_toc=$(pdftotext -f 2 -l 2 InputOutputReference.pdf - | wc -l) +# set +x +# [ "$npages" -le "2800" ] && (echo "TOC is missing" && exit 1) || echo "Length of PDF appears ok" +# [ "$nwords_in_toc" -le "100" ] && (echo "TOC is empty" && exit 1) || echo "TOC appears ok" + + - name: Upload entire pdf folder + if: ${{ always() }} + uses: actions/upload-artifact@v2 + with: + name: InputOutputReference + path: ${{runner.workspace}}/EnergyPlus/doc/build/pdf/ diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index e790667fc46..c0a296c1fc7 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -16,7 +16,7 @@ jobs: python-version: 3.7 - name: Set up LaTeX - run: sudo apt update && sudo apt install -y texlive texlive-xetex texlive-science + run: sudo apt update && sudo apt install -y texlive texlive-xetex texlive-science poppler-utils - name: Create Build Environment run: cmake -E make_directory ${{runner.workspace}}/EnergyPlus/doc/build diff --git a/.github/workflows/linux_release.yml b/.github/workflows/linux_release.yml index 8e77820fe54..d531650c35c 100644 --- a/.github/workflows/linux_release.yml +++ b/.github/workflows/linux_release.yml @@ -24,6 +24,11 @@ jobs: with: python-version: 3.7 + - name: Setup QtIFW 4.x + uses: jmarrec/setup-qtifw@v1 + with: + qtifw-version: '4.x' + - name: Install Python dependencies run: | python -m pip install --upgrade pip @@ -37,14 +42,6 @@ jobs: sudo apt-get update sudo apt-get install texlive texlive-xetex texlive-science libxkbcommon-x11-0 xorg-dev libgl1-mesa-dev - - name: Install IFW - shell: bash - run: | - set -x - out_dir=${{ runner.workspace }}/Qt - aqt tool linux tools_ifw 4.1 qt.tools.ifw.41 --outputdir="$out_dir" - echo "$out_dir/Tools/QtInstallerFramework/4.1/bin" >> $GITHUB_PATH - - name: Create Build Directory run: cmake -E make_directory ./build/ diff --git a/.github/workflows/mac_release.yml b/.github/workflows/mac_release.yml index aa48d0fecf2..cadb5f48807 100644 --- a/.github/workflows/mac_release.yml +++ b/.github/workflows/mac_release.yml @@ -24,6 +24,11 @@ jobs: with: python-version: 3.7 + - name: Setup QtIFW 4.x + uses: jmarrec/setup-qtifw@v1 + with: + qtifw-version: '4.x' + - name: Install Python dependencies run: | python -m pip install --upgrade pip @@ -37,14 +42,6 @@ jobs: brew install --cask mactex echo "/Library/TeX/texbin" >> $GITHUB_PATH - - name: Install IFW - shell: bash - run: | - set -x - out_dir=${{ runner.workspace }}/Qt - aqt tool mac tools_ifw 4.1 qt.tools.ifw.41 --outputdir="$out_dir" - echo "$out_dir/Tools/QtInstallerFramework/4.1/bin" >> $GITHUB_PATH - - name: Create Build Directory run: cmake -E make_directory ./build/ diff --git a/.github/workflows/windows_release.yml b/.github/workflows/windows_release.yml index c24f65343de..b6263394299 100644 --- a/.github/workflows/windows_release.yml +++ b/.github/workflows/windows_release.yml @@ -38,6 +38,11 @@ jobs: python-version: 3.7 architecture: ${{ matrix.arch }} + - name: Setup QtIFW 4.x + uses: jmarrec/setup-qtifw@v1 + with: + qtifw-version: '4.x' + - name: Install Python dependencies run: | python -m pip install --upgrade pip @@ -57,13 +62,13 @@ jobs: ./miktexsetup_standalone --verbose \ --local-package-repository=C:/ProgramData/MiKTeX-Repo \ --remote-package-repository="https://ctan.math.illinois.edu/systems/win32/miktex/tm/packages/" \ - --package-set=basic \ + --package-set=essential \ download echo "Installing from the local package directory previously set up" ./miktexsetup_standalone --verbose \ --local-package-repository=C:/ProgramData/MiKTeX-Repo \ - --package-set=basic \ + --package-set=essential \ --shared \ install @@ -80,13 +85,11 @@ jobs: mpm --find-updates mpm --admin --find-updates - - name: Install IFW + - name: Install required packages shell: bash + working-directory: ./doc/ run: | - set -x - out_dir="C:/Qt" - aqt tool windows tools_ifw 4.1 qt.tools.ifw.41 --outputdir="$out_dir" - echo "$out_dir/Tools/QtInstallerFramework/4.1/bin" >> $GITHUB_PATH + mpm --verbose --admin --require=@energyplus_packages_windows.lst - name: Create Build Directory run: cmake -E make_directory ./build/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 859c71c73ee..072f2b7a84f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ cmake_policy(SET CMP0048 NEW) # handling project_version_* variables project(EnergyPlus) -cmake_minimum_required(VERSION 3.10) +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 @@ -154,7 +154,12 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) endif() # we are making *a Python 3.6 Interpreter* a required dependency, so find it here -find_package(PythonInterp 3.6 REQUIRED) +# If LINK_WITH_PYTHON, also request the Development (libs) at the same time, to ensure consistent version between interpreter and Development +if(LINK_WITH_PYTHON) + find_package(Python 3.6 COMPONENTS Interpreter Development REQUIRED) +else() + find_package(Python 3.6 COMPONENTS Interpreter REQUIRED) +endif() if(BUILD_TESTING) option(ENABLE_REGRESSION_TESTING "Enable Regression Tests" OFF) @@ -270,7 +275,7 @@ endif() add_subdirectory(idd) execute_process( - COMMAND ${PYTHON_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/dev/generate_epJSON_schema/generate_epJSON_schema.py" "${PROJECT_SOURCE_DIR}" + 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.*") diff --git a/cmake/Install.cmake b/cmake/Install.cmake index 8e7b8696042..6f2c22329e6 100644 --- a/cmake/Install.cmake +++ b/cmake/Install.cmake @@ -229,18 +229,18 @@ file(MAKE_DIRECTORY ${DOCS_OUT}) # the output variables listing install( - CODE "execute_process(COMMAND \"${PYTHON_EXECUTABLE}\" \"${PROJECT_SOURCE_DIR}/doc/tools/parse_output_variables.py\" \"${PROJECT_SOURCE_DIR}/src/EnergyPlus\" \"${DOCS_OUT}/SetupOutputVariables.csv\" \"${DOCS_OUT}/SetupOutputVariables.md\")" + CODE "execute_process(COMMAND \"${Python_EXECUTABLE}\" \"${PROJECT_SOURCE_DIR}/doc/tools/parse_output_variables.py\" \"${PROJECT_SOURCE_DIR}/src/EnergyPlus\" \"${DOCS_OUT}/SetupOutputVariables.csv\" \"${DOCS_OUT}/SetupOutputVariables.md\")" ) install(FILES "${PROJECT_BINARY_DIR}/autodocs/SetupOutputVariables.csv" DESTINATION "./") # the example file summary install( - CODE "execute_process(COMMAND \"${PYTHON_EXECUTABLE}\" \"${PROJECT_SOURCE_DIR}/doc/tools/example_file_summary.py\" \"${PROJECT_SOURCE_DIR}/testfiles\" \"${DOCS_OUT}/ExampleFiles.html\")" + CODE "execute_process(COMMAND \"${Python_EXECUTABLE}\" \"${PROJECT_SOURCE_DIR}/doc/tools/example_file_summary.py\" \"${PROJECT_SOURCE_DIR}/testfiles\" \"${DOCS_OUT}/ExampleFiles.html\")" COMPONENT ExampleFiles) install(FILES "${DOCS_OUT}/ExampleFiles.html" DESTINATION "./ExampleFiles/" COMPONENT ExampleFiles) # the example file objects link -install(CODE "execute_process(COMMAND \"${PYTHON_EXECUTABLE}\" \"${PROJECT_SOURCE_DIR}/doc/tools/example_file_objects.py\" +install(CODE "execute_process(COMMAND \"${Python_EXECUTABLE}\" \"${PROJECT_SOURCE_DIR}/doc/tools/example_file_objects.py\" \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Energy+.idd\" \"${PROJECT_SOURCE_DIR}/testfiles\" \"${DOCS_OUT}/ExampleFiles-ObjectsLink.html\")" COMPONENT ExampleFiles) install(FILES "${DOCS_OUT}/ExampleFiles-ObjectsLink.html" DESTINATION "./ExampleFiles/" COMPONENT ExampleFiles) @@ -252,7 +252,7 @@ if(BUILD_CHANGELOG) # Better to move this condition into the install CODE. if(NOT "$ENV{GITHUB_TOKEN}" STREQUAL "") install( - CODE "execute_process(COMMAND \"${PYTHON_EXECUTABLE}\" \"${PROJECT_SOURCE_DIR}/doc/tools/create_changelog.py\" \"${PROJECT_SOURCE_DIR}\" \"${DOCS_OUT}/changelog.md\" \"${DOCS_OUT}/changelog.html\" \"${GIT_EXECUTABLE}\" \"$ENV{GITHUB_TOKEN}\" \"${PREV_RELEASE_SHA}\" \"${CPACK_PACKAGE_VERSION}\")" + CODE "execute_process(COMMAND \"${Python_EXECUTABLE}\" \"${PROJECT_SOURCE_DIR}/doc/tools/create_changelog.py\" \"${PROJECT_SOURCE_DIR}\" \"${DOCS_OUT}/changelog.md\" \"${DOCS_OUT}/changelog.html\" \"${GIT_EXECUTABLE}\" \"$ENV{GITHUB_TOKEN}\" \"${PREV_RELEASE_SHA}\" \"${CPACK_PACKAGE_VERSION}\")" ) install(FILES "${DOCS_OUT}/changelog.html" DESTINATION "./" OPTIONAL) else() diff --git a/cmake/ProjectMacros.cmake b/cmake/ProjectMacros.cmake index 67306779b39..4ef0c88518f 100644 --- a/cmake/ProjectMacros.cmake +++ b/cmake/ProjectMacros.cmake @@ -160,7 +160,7 @@ function(ADD_SIMULATION_TEST) add_test( NAME "regression.${IDF_NAME}" COMMAND - ${CMAKE_COMMAND} -DBINARY_DIR=${PROJECT_BINARY_DIR} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DIDF_FILE=${ADD_SIM_TEST_IDF_FILE} + ${CMAKE_COMMAND} -DBINARY_DIR=${PROJECT_BINARY_DIR} -DPYTHON_EXECUTABLE=${Python_EXECUTABLE} -DIDF_FILE=${ADD_SIM_TEST_IDF_FILE} -DREGRESSION_SCRIPT_PATH=${REGRESSION_SCRIPT_PATH} -DREGRESSION_BASELINE_PATH=${REGRESSION_BASELINE_PATH} -DREGRESSION_BASELINE_SHA=${REGRESSION_BASELINE_SHA} -DCOMMIT_SHA=${COMMIT_SHA} -DDEVICE_ID=${DEVICE_ID} -P ${PROJECT_SOURCE_DIR}/cmake/RunRegression.cmake) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index d57e17d6605..625324e795d 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,12 +1,12 @@ project(EnergyPlusDocs LANGUAGES NONE) -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.12) set_property(GLOBAL PROPERTY USE_FOLDERS ON) -if(NOT EXISTS ${PYTHON_EXECUTABLE}) - # we are making *a Python 3.6 Interpreter* a required dependency, so find it here - find_package(PythonInterp 3.6 REQUIRED) +if(NOT EXISTS ${Python_EXECUTABLE}) + # If running docs standalone, Python isn't found yet. + find_package(Python 3.6 COMPONENTS Interpreter REQUIRED) endif() option(DOCS_TESTING "Test the docs for issues" OFF) diff --git a/doc/auxiliary-programs/src/weather-converter-program/definitions-file-custom-file-processing.tex b/doc/auxiliary-programs/src/weather-converter-program/definitions-file-custom-file-processing.tex index 63aa6f6bb06..e406330f9e1 100644 --- a/doc/auxiliary-programs/src/weather-converter-program/definitions-file-custom-file-processing.tex +++ b/doc/auxiliary-programs/src/weather-converter-program/definitions-file-custom-file-processing.tex @@ -309,13 +309,13 @@ \subsection{Custom Files - Auxiliary Data}\label{custom-files---auxiliary-data} \begin{longtable}[c]{p{1.5in}p{1.5in}p{1.5in}p{1.5in}} \caption{Auxiliary Data for Custom Files \label{table:auxiliary-data-for-custom-files}} \tabularnewline \toprule -Short Name & Long Name & Units & Useh by EnergyPlus \tabularnewline +Short Name & Long Name & Units & Used by EnergyPlus \tabularnewline \midrule \endfirsthead \caption[]{Auxiliary Data for Custom Files} \tabularnewline \toprule -Short Name & Long Name & Units & Useh by EnergyPlus \tabularnewline +Short Name & Long Name & Units & Used by EnergyPlus \tabularnewline \midrule \endhead diff --git a/doc/auxiliary-programs/src/weather-converter-program/energyplus-weather-file-epw-data-dictionary.tex b/doc/auxiliary-programs/src/weather-converter-program/energyplus-weather-file-epw-data-dictionary.tex index 49f395090cd..c60f2425e7b 100644 --- a/doc/auxiliary-programs/src/weather-converter-program/energyplus-weather-file-epw-data-dictionary.tex +++ b/doc/auxiliary-programs/src/weather-converter-program/energyplus-weather-file-epw-data-dictionary.tex @@ -113,7 +113,7 @@ \section{EnergyPlus Weather File (EPW) Data Dictionary}\label{energyplus-weather \note same as note on Heating Design Conditions \end{lstlisting} -The Design Conditions header record encapsulates matching (using WMO\# -- World Meteorological Organization Station Number) design conditions for a weather file location. Currently only those design conditions contained in the ASHRAE Handbook of Fundamentals 2009 are contained in the weather files. These conditions can be used as desired. In addition, Design Day definition files have been created of all World, Canada, and United States Design Conditions. These files are available in the DataSet folder of the EnergyPlus installation. +The Design Conditions header record encapsulates matching (using WMO\# -- World Meteorological Organization Station Number) design conditions for a weather file location. Currently only those design conditions contained in the ASHRAE Handbook of Fundamentals 2009 are contained in the weather files. These conditions can be used as desired. In addition, Design Day definition files have been created of all World, Canada, and United States Design Conditions. \begin{lstlisting} TYPICAL/EXTREME PERIODS, diff --git a/doc/cmake/BuildDocumentation.cmake b/doc/cmake/BuildDocumentation.cmake index 718e948626c..5f286a94a9c 100644 --- a/doc/cmake/BuildDocumentation.cmake +++ b/doc/cmake/BuildDocumentation.cmake @@ -10,8 +10,106 @@ if ("${TEX_INTERACTION}" STREQUAL "") else() set(THIS_TEX_INTERACTION "${TEX_INTERACTION}") endif() -execute_process( COMMAND ${XELATEX} -interaction=${THIS_TEX_INTERACTION} ${INNAME}.tex TIMEOUT 600 ) -execute_process( COMMAND ${XELATEX} -interaction=${THIS_TEX_INTERACTION} ${INNAME}.tex TIMEOUT 600 ) -execute_process( COMMAND ${XELATEX} -interaction=${THIS_TEX_INTERACTION} ${INNAME}.tex TIMEOUT 600 ) + +if(DOCS_TESTING) + + # TODO: You can change this to ON for active debugging if you find a problem + set(_DEBUG_DOCS OFF) + + if (XELATEX_MEM_FLAGS) + message("XELATEX_MEM_FLAGS=${XELATEX_MEM_FLAGS}") + endif() + + get_filename_component(XELATEX_BIN_DIR ${XELATEX} DIRECTORY) + find_program(PDFTOTEXT NAME pdftotext HINTS ${XELATEX_BIN_DIR}) + if(NOT PDFTOTEXT) + message(AUTHOR_WARNING "pdftotext should be in your path to test whether the Table of Contents worked. On Windows it should be installed via miktex already, on ubuntu it's apt install poppler-utils, on mac brew install poppler") + endif() + + function(test_toc PASS_NUM DEBUG_DOCS) + if(PDFTOTEXT) + execute_process( + COMMAND ${PDFTOTEXT} -f 2 -l 2 ${INNAME}.pdf - + OUTPUT_VARIABLE _TOC_PAGE1_CONTENT + ) + string(REPLACE "\n" ";" _TOC_PAGE_LIST "${_TOC_PAGE1_CONTENT}") + + # Clean it out + set(_CLEANED_TOC "") + set(_CLEANED_TOC_LIST "") + foreach(LINE IN LISTS _TOC_PAGE_LIST) + string(LENGTH "${LINE}" LINE_LEN) + if (${LINE_LEN} GREATER 5) + string(REPLACE " ." "" CLEANED_LINE "${LINE}") + list(APPEND _CLEANED_TOC_LIST "${CLEANED_LINE}") + set(_CLEANED_TOC "${_CLEANED_TOC}\n${CLEANED_LINE}") + endif() + endforeach() + + list(LENGTH _CLEANED_TOC_LIST _TOC_NUMENTRIES) + if(_TOC_NUMENTRIES LESS 3) + if (PASS_NUM LESS 2) + message("${INNAME} Pass ${PASS_NUM}: TOC is missing (as expected)") + else() + message(FATAL_ERROR "${INNAME} Pass ${PASS_NUM}: TOC is missing") + endif() + else() + message("${INNAME} Pass ${PASS_NUM}: TOC OK, Number of entries in TOC = ${_TOC_NUMENTRIES}") + if(DEBUG_DOCS) + message("TOC Content:\n${_CLEANED_TOC}\n\n") + endif() + endif() + endif() + + if(DEBUG_DOCS) + file( COPY "${INNAME}.pdf" DESTINATION "${ORIGINAL_CMAKE_BINARY_DIR}/pdf/${INNAME}_Pass${PASS_NUM}.pdf" ) + file( COPY "${INNAME}.toc" DESTINATION "${ORIGINAL_CMAKE_BINARY_DIR}/pdf/${INNAME}_Pass${PASS_NUM}.toc" ) + file( COPY "${INNAME}.log" DESTINATION "${ORIGINAL_CMAKE_BINARY_DIR}/pdf/${INNAME}_Pass${PASS_NUM}.log" ) + file( COPY "${INNAME}.aux" DESTINATION "${ORIGINAL_CMAKE_BINARY_DIR}/pdf/${INNAME}_Pass${PASS_NUM}.aux" ) + file( COPY "${INNAME}.out" DESTINATION "${ORIGINAL_CMAKE_BINARY_DIR}/pdf/${INNAME}_Pass${PASS_NUM}.out" ) + endif() + endfunction() + + message("================ RUNNING XELATEX THE FIRST TIME =====================") +endif() + +execute_process( + COMMAND ${XELATEX} -interaction=${THIS_TEX_INTERACTION} ${XELATEX_MEM_FLAGS} ${INNAME}.tex + TIMEOUT 600 + RESULT_VARIABLE ERRCODE +) + +if(DOCS_TESTING) + test_toc(1 ${_DEBUG_DOCS}) +endif() + +if(DOCS_TESTING) + message("================ RUNNING XELATEX THE SECOND TIME =====================") +endif() + +execute_process( + COMMAND ${XELATEX} -interaction=${THIS_TEX_INTERACTION} ${XELATEX_MEM_FLAGS} ${INNAME}.tex + TIMEOUT 600 + RESULT_VARIABLE ERRCODE +) + +if(DOCS_TESTING) + test_toc(2 ${_DEBUG_DOCS}) +endif() + +if(DOCS_TESTING) + message("================ RUNNING XELATEX THE THIRD TIME =====================") +endif() + +execute_process( + COMMAND ${XELATEX} -interaction=${THIS_TEX_INTERACTION} ${XELATEX_MEM_FLAGS} ${INNAME}.tex + TIMEOUT 600 + RESULT_VARIABLE ERRCODE +) + +if(DOCS_TESTING) + test_toc(3 ${_DEBUG_DOCS}) +endif() + file( COPY "${INNAME}.pdf" DESTINATION "${ORIGINAL_CMAKE_BINARY_DIR}/pdf/" ) file( RENAME "${ORIGINAL_CMAKE_BINARY_DIR}/pdf/${INNAME}.pdf" "${ORIGINAL_CMAKE_BINARY_DIR}/pdf/${OUTNAME}.pdf") diff --git a/doc/cmake/doc-targets.cmake b/doc/cmake/doc-targets.cmake index f4304e4dd26..2bc05668e68 100644 --- a/doc/cmake/doc-targets.cmake +++ b/doc/cmake/doc-targets.cmake @@ -1,7 +1,15 @@ # Add custom command, target, and dependencies for documentation file macro( CREATE_DOC_TARGET SOURCE_FILENAME OUTPUT_FILENAME ) + if (NOT UNIX) + # Avoid issue #8568 - main memory size exceeded for I/O ref on Windows with a recent MikTex (eg 4.1) + set(XELATEX_MEM_FLAGS "-extra-mem-top=2000000 -extra-mem-bot=4000000") + endif() add_custom_command( OUTPUT ${PROJECT_BINARY_DIR}/pdf/${OUTPUT_FILENAME}.pdf - COMMAND ${CMAKE_COMMAND} -DXELATEX=${XELATEX} -DINNAME=${SOURCE_FILENAME} -DOUTNAME=${OUTPUT_FILENAME} -DORIGINAL_CMAKE_SOURCE_DIR=${PROJECT_SOURCE_DIR} -DORIGINAL_CMAKE_BINARY_DIR=${PROJECT_BINARY_DIR} -DTEX_INTERACTION=${TEX_INTERACTION} -P ${PROJECT_SOURCE_DIR}/cmake/BuildDocumentation.cmake + COMMAND ${CMAKE_COMMAND} -DXELATEX=${XELATEX} -DINNAME=${SOURCE_FILENAME} -DOUTNAME=${OUTPUT_FILENAME} + -DORIGINAL_CMAKE_SOURCE_DIR=${PROJECT_SOURCE_DIR} -DORIGINAL_CMAKE_BINARY_DIR=${PROJECT_BINARY_DIR} + -DTEX_INTERACTION=${TEX_INTERACTION} -DDOCS_TESTING=${DOCS_TESTING} + -DXELATEX_MEM_FLAGS=${XELATEX_MEM_FLAGS} + -P ${PROJECT_SOURCE_DIR}/cmake/BuildDocumentation.cmake WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/${SOURCE_FILENAME} DEPENDS ${INCLUDED_TEX} ${INCLUDED_IMAGES} ) @@ -17,7 +25,7 @@ macro( CREATE_DOC_TARGET SOURCE_FILENAME OUTPUT_FILENAME ) if (DOCS_TESTING) add_custom_command(TARGET zPDF_${OUTPUT_FILENAME} POST_BUILD - COMMAND ${PYTHON_EXECUTABLE} "${PROJECT_SOURCE_DIR}/tools/parse_latex_log.py" "${PROJECT_SOURCE_DIR}/${SOURCE_FILENAME}/${SOURCE_FILENAME}.log" "${PROJECT_SOURCE_DIR}/${SOURCE_FILENAME}" "${PROJECT_BINARY_DIR}/${OUTPUT_FILENAME}_errors.json" + COMMAND ${Python_EXECUTABLE} "${PROJECT_SOURCE_DIR}/tools/parse_latex_log.py" "${PROJECT_SOURCE_DIR}/${SOURCE_FILENAME}/${SOURCE_FILENAME}.log" "${PROJECT_SOURCE_DIR}/${SOURCE_FILENAME}" "${PROJECT_BINARY_DIR}/${OUTPUT_FILENAME}_errors.json" ) endif() endmacro() diff --git a/doc/ems-application-guide/src/ems-actuators/air-movement.tex b/doc/ems-application-guide/src/ems-actuators/air-movement.tex index f16993870b4..f0c15573d7f 100644 --- a/doc/ems-application-guide/src/ems-actuators/air-movement.tex +++ b/doc/ems-application-guide/src/ems-actuators/air-movement.tex @@ -16,6 +16,11 @@ \subsection{Zone Cross Mixing}\label{zone-cross-mixing} An actuator called ``ZoneCrossMixing'' is available with a control type called ``Air Exchange Flow Rate'' (m\(^{3}\)/s). This provides override control over the interzonal mixing rate. This is the simple air movement model provided by the input object ZoneCrossMixing. The unique identifier is the name of the ZoneCrossMixing object. +\subsection{Zone Refrigeration Door Mixing}\label{zone-refrigeration-door-mixing} + +An actuator called ``ZoneRefDoorMixing'' is available with a control type called ``Air Exchange Flow Rate'' (m\(^{3}\)/s). This provides override control over the zone-to-zone mixing rate. This is the simple air movement model provided by the input object ZoneRefrigerationDoorMixing. The unique identifier is the name of the ZoneRefrigerationDoorMixing object. + + \subsection{Zone Thermal Chimney}\label{zone-thermal-chimney} An actuator called ``Zone Thermal Chimney'' is available with a control type called ``Air Exchange Flow Rate'' (m\(^{3}\)/s). This provides override control over the thermal chimney flow rate. This is the simple air movement model provided by the input object ZoneThermalChimney. The unique identifier is the name of the ZoneThermalChimney object. diff --git a/doc/ems-application-guide/src/ems-actuators/hvac-systems-001.tex b/doc/ems-application-guide/src/ems-actuators/hvac-systems-001.tex index 85e7a253b30..42ff305abf3 100644 --- a/doc/ems-application-guide/src/ems-actuators/hvac-systems-001.tex +++ b/doc/ems-application-guide/src/ems-actuators/hvac-systems-001.tex @@ -59,13 +59,13 @@ \subsection{Plant Supervisory Control}\label{plant-supervisory-control} \subsection{Outdoor Air System Node Conditions}\label{outdoor-air-system-node-conditions} -Actuators called ``Outdoor Air System Node'' are available with control types called ``Drybulb Temperature'' and ``Wetbulb Temperature.''~ The units are degrees Celsius. These actuators are available for all system nodes that are listed in either an OutdoorAir:Node or OutdoorAir:NodeList input object. You should probably set both the drybulb and wetbulb temperatures to ensure a full description of the moist air conditions. +Actuators called ``Outdoor Air System Node'' are available with control types called ``Drybulb Temperature'' and ``Wetbulb Temperature.''~ The units are degrees Celsius. These actuators are available for all system nodes that are listed in either an OutdoorAir:Node or OutdoorAir:NodeList input object. You should probably set both the drybulb and wetbulb temperatures to ensure a full description of the moist air conditions. In addition, there are also actuators for "Wind Speed" and "Wind Direction" with the units of meters/second and degrees, respectively. The air system and many component models require you to specify a node as an outdoor air node to obtain values for the outdoor conditions. For example, outdoor air nodes are used at the inlet to an outdoor air mixer or at the inlet of the heat rejection side of a component model. Typically this is the weather data value for outdoor conditions. But local variations in microclimate may shift the local outdoor air temperature to differ slightly from the weather data. (Currently the only local variation model for this effect in EnergyPlus varies the outdoor air conditions as a function of height.)~ If you want to experiment with other models for local variations in outdoor air conditions, this EMS actuator allows you to override the outdoor temperature at a particular system node with any model that can be implemented in an Erl program. For example (although better models for the changes in conditions may need be developed), this actuator could be used to examine the energy impacts of warmer outdoor air temperatures experienced by a rooftop packaged HVAC system sitting on a black roof or the cooler conditions experienced by a unit that is located on the shaded side of a building.~ Another example is to make use of a separate model, outside of EnergyPlus, for some unique type of component (such as a labyrinth or earth-tube) that preconditions outdoor air; the results of that model could be fed into the air system model in EnergyPlus using these actuators. \subsection{AirLoopHVAC Availability Status}\label{airloophvac-availability-status} -This actuator is available in all models with central, or primary, air systems that are entered with the object ``AirLoopHVAC.''~ Various availability managers use the air loop's availability status to override control of the central air system fan. The fan may be scheduled to be unavailable during certain times to shut down the system when it is not needed. However, there may be times when the air system should be started to protect from freezing, for example. This actuator can force an air system to start up or shut down. +This actuator is available in all models with central, or primary, air systems that are entered with the object ``AirLoopHVAC'' using the control type called ``Availability Status.''~ Various availability managers use the air loop's availability status to override control of the central air system fan. The fan may be scheduled to be unavailable during certain times to shut down the system when it is not needed. However, there may be times when the air system should be started to protect from freezing, for example. This actuator can force an air system to start up or shut down. The control is actuated by setting values for the availability status. The settings are numeric, but represent discrete states the status can take. The following settings are valid: @@ -94,7 +94,26 @@ \subsection{Fan}\label{fan} \subsection{DX Cooling Coils}\label{dx-cooling-coils} -Actuators are available for overriding the autosize rated airflow rate and total cooling capacity of the Coil:Cooling:DX object.~ Actuators called ``Coil:Cooling:DX:CurveFit:SingleSpeed'' are available with control types ``Autosized Rated Air Flow Rate'' (in m3/s) and ``Autosized Rated Total Cooling Capacity'' (in W).~ These are only useful from the calling point named AfterComponentInputReadIn. +Actuators are available for overriding the autosize rated airflow rate and total cooling capacity of the Coil:Cooling:DX object.~ Actuators called ``Coil:Cooling:DX:SingleSpeed'' are available with control types ``Autosized Rated Air Flow Rate'' (in m3/s), ``Autosized Rated Total Cooling Capacity'' (in W), and ``Autosized Rated Sensible Heat Ratio'' (in W/W).~ These are only useful from the calling point named AfterComponentInputReadIn. + +\subsection{DX Thermal Storage Coils}\label{dx-cooling-coils} + +There is an actuator that is available for overriding the operating mode of the DX thermal storage coil object.~ The actuator is called ``Coil:Cooling:DX:SingleSpeed:ThermalStorage'' and is available with the control type ``Operating Mode.'' The operating mode has the following states/values: + +\begin{itemize} +\item +0 = Off Mode +\item +1 = Cooling Only Mode +\item +2 = Cooling and Charge Mode +\item +3 = Cooling and Discharge Mode +\item +4 = Charge Only Mode +\item +5 = Discharge Only Mode +\end{itemize} \subsection{Unitary Equipment}\label{unitary-equipment} @@ -108,7 +127,7 @@ \subsection{Unitary Equipment}\label{unitary-equipment} \item An actuator called ``AirLoopHVAC:UnitaryHeatOnly'' is available with control type ``Autosized Supply Air Flow Rate.'' \item - Actuators called ``AirLoopHVAC:Unitary:Furnace:HeatCool'' and ``AirLoopHVAC:UnitaryHeatCool''are available with control types ``Autosized Supply Air Flow Rate,''~ ``Autosized Supply Air Flow Rate During Cooling Operation,'' ``Autosized Supply Air Flow Rate During Heating Operation,'' and ``Autosized Supply Air Flow Rate During No Heating or Cooling Operation.'' + Actuators called ``AirLoopHVAC:Unitary:Furnace:HeatCool,'' ``AirLoopHVAC:UnitaryHeatCool,'' and ``UnitarySystem'' are available with control types ``Autosized Supply Air Flow Rate,''~ ``Autosized Supply Air Flow Rate During Cooling Operation,'' ``Autosized Supply Air Flow Rate During Heating Operation,'' and ``Autosized Supply Air Flow Rate During No Heating or Cooling Operation.'' \item An actuator called ``AirLoopHVAC:UnitaryHeatPump:AirToAir'' is available with control type ``Autosized Supply Air Flow Rate.'' \item @@ -123,6 +142,10 @@ \subsection{Outdoor Air Controller}\label{outdoor-air-controller} An actuator called ``Outdoor Air Controller'' is available with the control type called ``Air Mass Flow Rate.'' ~This provides override control over the rate of outdoor air. The units are kg/s. The unique identifier is the name of the Controller:OutdoorAir input object. The actuated mass flow rate is not allowed to be greater than the current system mixed air flow rate. +\subsection{Plant Equipment Operation}\label{plant-equipment-operation} + +An actuator called ``Plant Equipment Operation'' is available with a control type called ``Distributed Load Rate.''~ The units are Watts. This allows the override of the assigned distributed load for plant equipment. + \subsection{Plant Load Profile}\label{plant-load-profile} Actuators called ``Plant Load Profile'' are available with the control types called ``Mass Flow Rate'' (in \si{\massFlowRate}) and ``Power'' (in W). The unique identifier is the name of the LoadProfile:Plant input object. These actuators provide override control over the loads placed on a plant system by a plant load profile. diff --git a/doc/ems-application-guide/src/ems-actuators/internal-gains-and-exterior-lights.tex b/doc/ems-application-guide/src/ems-actuators/internal-gains-and-exterior-lights.tex index bf20fd43f5f..ccb7484b45a 100644 --- a/doc/ems-application-guide/src/ems-actuators/internal-gains-and-exterior-lights.tex +++ b/doc/ems-application-guide/src/ems-actuators/internal-gains-and-exterior-lights.tex @@ -2,7 +2,7 @@ \section{Internal Gains and Exterior Lights}\label{internal-gains-and-exterior-l \subsection{People}\label{people} -An actuator called ``People'' is available with a control type called ``Number of People.''~ This allows you to dictate the number of people in a zone. The units are persons. The unique identifier is the name of the people input object. Because you cannot really control people, this is an example the EMS in EnergyPlus departing from the real world of building EMS. +An actuator called ``People'' is available with a control type called ``Number of People.''~ This allows you to dictate the number of people in a zone. The units are persons. The unique identifier is the name of the people input object. Because you cannot really control people, this is an example of the EMS in EnergyPlus departing from the real world of building EMS. \subsection{Lights}\label{lights} @@ -26,9 +26,7 @@ \subsection{Steam Equipment}\label{steam-equipment} \subsection{Other Equipment}\label{other-equipment} -An actuator called ``OtherEquipment'' is available with a control type called ``Power Level'' (in W). This allows you to set the power associated with each OtherEquipment input object. The unique identifier is the name of the OtherEquipment input object. - -Other equipment offers a way to adjust the zone air energy balance without consuming any energy resources. +An actuator called ``OtherEquipment'' is available with a control type called ``Power Level'' (in W). This allows you to set the power associated with each OtherEquipment input object. The unique identifier is the name of the OtherEquipment input object. Other equipment offers a way to adjust the zone air energy balance without consuming any energy resources. \subsection{Baseboard}\label{baseboard} diff --git a/doc/ems-application-guide/src/ems-actuators/refrigeration.tex b/doc/ems-application-guide/src/ems-actuators/refrigeration.tex index 7aa7a879f97..53126123c94 100644 --- a/doc/ems-application-guide/src/ems-actuators/refrigeration.tex +++ b/doc/ems-application-guide/src/ems-actuators/refrigeration.tex @@ -2,4 +2,4 @@ \section{Refrigeration}\label{refrigeration} \subsection{Condenser Operation}\label{condenser-operation} -An actuator called ``Refrigeration:System'' is available with a control type called ``Minimum Condensing Temperature.''~ This actuator is available in models that use the Refrigeration:System object.~ This actuator allows the user to override the usually constant value that is input into the field called Minimum Condensing Temperature in the Refrigeration:System object.~ This allows operating the condenser using custom control algorithms. +An actuator called ``Refrigeration:System'' is available with a control type called ``Minimum Condensing Temperature.''~ The units for this actuator are degrees Celsius.~ This actuator is available in models that use the Refrigeration:System object.~ This actuator allows the user to override the usually constant value that is input into the field called Minimum Condensing Temperature in the Refrigeration:System object.~ This allows operating the condenser using custom control algorithms. diff --git a/doc/ems-application-guide/src/ems-actuators/thermal-envelope.tex b/doc/ems-application-guide/src/ems-actuators/thermal-envelope.tex index a95a428ba3c..b51382391d6 100644 --- a/doc/ems-application-guide/src/ems-actuators/thermal-envelope.tex +++ b/doc/ems-application-guide/src/ems-actuators/thermal-envelope.tex @@ -2,7 +2,7 @@ \section{Thermal Envelope}\label{thermal-envelope} \subsection{Window Shading Control}\label{window-shading-control} -Actuators called ``Window Shading Control'' are available with actuated component control type called ``Control Status'' in [ShadeStatus] and ``Slat Angle'' in [degree]. This actuator is available in models that also have the WindowShadingControl input objects. The user-defined name for the WindowShadingControl is not used to identify unique window shading controls; rather, the window name is used to identify the actuator. This is because there could be multiple windows, all with shades, each of which is governed by a single WindowShadingControl input object. The EMS actuator can override the control actions for each window separately. +Actuators called ``Window Shading Control'' are available with actuated component control types called ``Control Status'' in [ShadeStatus] and ``Slat Angle'' in [degree]. This actuator is available in models that also have the WindowShadingControl input objects. The user-defined name for the WindowShadingControl is not used to identify unique window shading controls; rather, the window name is used to identify the actuator. This is because there could be multiple windows, all with shades, each of which is governed by a single WindowShadingControl input object. The EMS actuator can override the control actions for each window separately. The control is actuated by setting values for the control status. The settings are numeric but represent discrete states the control can take. The appropriate values depend on the type and position of the shading device. There are three basic types of shading devices:~ switchable glazings, shades, and blinds. (Shades are described with WindowMaterial:Shade input objects. Blinds are described with WindowMaterial:Blind input objects.)~ Shades and blinds can be situated in the exterior, between the glass, or in the interior. @@ -73,7 +73,7 @@ \subsection{Surface Construction State}\label{surface-construction-state} \subsection{Surface Boundary Conditions}\label{surface-boundary-conditions} -Three actuators, called ``Surface,''~ are available for controlling the temperature and wind speed used for ``Outdoors''~ boundary conditions during heat transfer calculations at the outside face of surfaces. Each heat transfer surface will make available actuators with the following three control types: +Several actuators, called ``Surface,''~ are available for controlling the temperature and wind speed used for ``Outdoors''~ boundary conditions during heat transfer calculations at the outside face of surfaces. Each heat transfer surface will make available actuators with the following five control types: \begin{itemize} \item @@ -88,6 +88,8 @@ \subsection{Surface Boundary Conditions}\label{surface-boundary-conditions} ``View Factor To Ground.''~ This is the view factor to ground of the outside face of the surface. This is the view factor used for ground diffuse solar and for radiant heat exchange. This is useful from the calling point named BeginZoneTimestepAfterInitHeatBalance and BeginZoneTimestepBeforeInitHeatBalance. \end{itemize} +All of the above control types, except ``View Factor to Ground,'' are also available as actuators called ``Zone.'' + Four actuators, called ``Other Side Boundary Conditions,'' are available for controlling the convection and radiation boundary conditions for surfaces that use ``OtherSideConditionsModel.''~ Each instance of a SurfaceProperty:OtherSideConditionsModel object will make available these actuators with the following four control types: \begin{itemize} @@ -102,3 +104,7 @@ \subsection{Surface Boundary Conditions}\label{surface-boundary-conditions} \end{itemize} When using these actuators, values should be set for all four types.~ This boundary condition has no solar, only convection and radiation. + +\subsection{Conduction Finite Difference}\label{conduction-finite-difference} + +Two actuators, called ``CondFD Surface Material Layer,'' are available with actuated component control types called ``Thermal Conductivity'' in [W/m-K] and ``Specific Heat'' in [J/kg-C]. These actuators are available in models that use the Conduction Finite Difference solution for conduction through surfaces. diff --git a/doc/ems-application-guide/src/user-defined-component-models/air-coil.tex b/doc/ems-application-guide/src/user-defined-component-models/air-coil.tex index 5b8dc347d11..4cfc2ec45bb 100644 --- a/doc/ems-application-guide/src/user-defined-component-models/air-coil.tex +++ b/doc/ems-application-guide/src/user-defined-component-models/air-coil.tex @@ -27,7 +27,7 @@ \subsection{Air Connections}\label{air-connections} \item An actuator called ``Air Connection \emph{N},'' with the control type ``Outlet Humidity Ratio,'' in {[}kgWater/kgDryAir{]}, needs to be used.~ This will set the humidity ratio of the air leaving the coil. \item - An actuator called ``Air Connection \emph{N},'' with the control type ``Outlet Mass Flow Rate,'' in {[}kg/s{]}, needs to be used.~ This will set the flow rate of air leaving the coil. + An actuator called ``Air Connection \emph{N},'' with the control type ``Mass Flow Rate,'' in {[}kg/s{]}, needs to be used.~ This will set the flow rate of air leaving the coil. \end{itemize} \subsection{Plant Connections}\label{plant-connections} diff --git a/doc/ems-application-guide/src/user-defined-component-models/plant-component.tex b/doc/ems-application-guide/src/user-defined-component-models/plant-component.tex index aa1a7e6d65e..f95ac27791b 100644 --- a/doc/ems-application-guide/src/user-defined-component-models/plant-component.tex +++ b/doc/ems-application-guide/src/user-defined-component-models/plant-component.tex @@ -6,7 +6,7 @@ \section{Plant Component}\label{plant-component} The user defined plant component can use up to four different plant loop connections, one optional air connection, a water supply tank, a water collection tank, and an ambient zone for skin losses. -\subsection{Plant Connections}\label{plant-connections-001} +\subsection{Plant Connections (User Defined)}\label{plant-connections-001} The user defined plant component can be connected to up to four different plant loops. @@ -79,6 +79,10 @@ \subsection{Plant Connections}\label{plant-connections-001} Separate program calling managers are available for each plant loop connection.~ The user defined plant component is called to simulate by the central plant routines (whereas the other user defined components are called by the central HVAC routines).~ The calls to simulate are made for each connection and you may want or need to perform different model calculations depending on which plant loop connection is being simulated at the time.~ There is an Erl program calling manager for initialization, setup, and sizing that needs to be used \emph{for each plant connection} and is only called during the early plant loop initialization phase.~ There is also an Erl program calling manager for the model calculations to perform for each plant connection. +\subsection{Plant Component (Temperature Source)}\label{plant-component-temperature-source} + +An actuator called ``PlantComponent:TemperatureSource'' with the control type ``Maximum Mass Flow Rate'' in {[}kg/s{]} is available for controlling the maximum flow rate from a temperature source plant component. + \subsection{Air Connection}\label{air-connection} An air connection is available that includes both an inlet and an outlet node.~ This can be used for air source or heat rejections. The following EMS internal variables are made available for the inlet node, if it is used, and should be useful inputs to your own custom models: @@ -119,7 +123,7 @@ \subsection{Ambient Zone}\label{ambient-zone-001} \item An actuator called ``Component Zone Internal Gain'' with the control type ``Sensible Heat Gain Rate,'' in {[}W{]}, is available.~ This can be used for purely convective sensible heat gains (or losses) to a zone. \item - An actuator called ``Component Zone Internal Gain'' with the control type ``Return Air Heat Gain Rate,'' in {[}W{]}, is available.~ This can be used for purely convective sensible heat gains (or losses) to the return air duct for a zone. + An actuator called ``Component Zone Internal Gain'' with the control type ``Return Air Heat Sensible Gain Rate,'' in {[}W{]}, is available.~ This can be used for purely convective sensible heat gains (or losses) to the return air duct for a zone. \item An actuator called ``Component Zone Internal Gain'' with the control type ``Thermal Radiation Heat Gain Rate,'' in {[}W{]}, is available.~ This can be used for thermal radiation gains (or losses) to a zone. \item diff --git a/doc/energyplus_packages_windows.lst b/doc/energyplus_packages_windows.lst new file mode 100644 index 00000000000..285aec504ff --- /dev/null +++ b/doc/energyplus_packages_windows.lst @@ -0,0 +1,49 @@ +xetex +amsfonts +amsmath +mathspec +etoolbox +iftex +fontspec +l3packages +l3backend +xkeyval +geometry +graphics +graphics-cfg +graphics-def +grffile +xcolor +colortbl +latex-tools +framed +booktabs +multirow +listings +enumitem +url +hyperref +ltxcmds +pdftexcmds +infwarerr +kvsetkeys +kvdefinekeys +pdfescape +hycolor +letltxmacro +auxhook +kvoptions +intcalc +etexcmds +bitset +bigintcalc +stringenc +rerunfilecheck +uniquecounter +siunitx +translations +refcount +gettitlestring +miktex-dvipdfmx +dvipdfmx +zapfding diff --git a/doc/engineering-reference/src/climate-sky-and-solar-shading-calculations/shading-module.tex b/doc/engineering-reference/src/climate-sky-and-solar-shading-calculations/shading-module.tex index 4a45de97c19..fb2fb9f5288 100644 --- a/doc/engineering-reference/src/climate-sky-and-solar-shading-calculations/shading-module.tex +++ b/doc/engineering-reference/src/climate-sky-and-solar-shading-calculations/shading-module.tex @@ -694,7 +694,7 @@ \subsubsection{Interior Solar Radiation Absorbed by Opaque Surfaces}\label{inter \begin{equation} \begin{array}{rl} QS(ZoneNum) \to & QS(ZoneNum) \\ - &+ \sum_{otherZones}\text{FractDifShortZtoZ(OtherZoneNum,ZoneNum)} \\ + &+ \sum_{otherZones}\text{ZoneFractDifShortZtoZ(OtherZoneNum,ZoneNum)} \\ &* [QD(OtherZoneNum) + ZoneIntGain(OtherZoneNum)\% QLTSW \\ &\quad + ZoneIntGain(OtherZoneNum)\% T\_QLTSW] \end{array} @@ -702,7 +702,7 @@ \subsubsection{Interior Solar Radiation Absorbed by Opaque Surfaces}\label{inter where -\emph{FractDifShortZtoZ(OtherZoneNum,ZoneNum)} = ``diffuse solar exchange factor'' = fraction of short-wave radiation in \emph{OtherZoneNum} that is transmitted to \emph{ZoneNum}. This factor is calculated in subroutine ComputeDifSolExcZonesWIZWindows taking into account multiple reflection between zones. For example, for two zones means that some of the radiation transmitted from Zone1 to Zone2 is reflected back to Zone1, and some of this is in turn reflected back to Zone2, etc. +\emph{ZoneFractDifShortZtoZ(OtherZoneNum,ZoneNum)} = ``diffuse solar exchange factor'' = fraction of short-wave radiation in \emph{OtherZoneNum} that is transmitted to \emph{ZoneNum}. This factor is calculated in subroutine ComputeDifSolExcZonesWIZWindows taking into account multiple reflection between zones. For example, for two zones means that some of the radiation transmitted from Zone1 to Zone2 is reflected back to Zone1, and some of this is in turn reflected back to Zone2, etc. \paragraph{Interior Beam Radiation}\label{interior-beam-radiation} diff --git a/doc/engineering-reference/src/daylighting-and-window-calculations/window-heat-balance-calculation.tex b/doc/engineering-reference/src/daylighting-and-window-calculations/window-heat-balance-calculation.tex index bc6cb270b88..b4af846ae61 100644 --- a/doc/engineering-reference/src/daylighting-and-window-calculations/window-heat-balance-calculation.tex +++ b/doc/engineering-reference/src/daylighting-and-window-calculations/window-heat-balance-calculation.tex @@ -430,7 +430,7 @@ \subsection{Window~ Frame and Divider Calculation}\label{window-frame-and-divide E\(_{o}\) & Exterior IR incident on window plane & W/m\(^{2}\) & outir \tabularnewline E\(_{i}\) & Interior IR incident on window plane & W/m\(^{2}\) & SurroundIRfromParentZone \tabularnewline $\varepsilon$\(_{1}\), $\varepsilon$\(_{2}\) & Outside, inside frame surface emissivity & - & FrameEmis \tabularnewline -$\theta$\(_{1}\), $\theta$\(_{2}\) & Frame outside, inside surface temperature & K & FrameTempSurfOut, FrameTempSurfIn \tabularnewline +$\theta$\(_{1}\), $\theta$\(_{2}\) & Frame outside, inside surface temperature & K & FrameTempSurfOut, FrameSurfTempIn \tabularnewline T\(_{o}\), T\(_{i}\) & Outdoor and indoor air temperatures & K & tout, tin \tabularnewline h\(_{o,c}\), h\(_{i,c}\) & Frame outside and inside air film convective conductance & W/m\(^{2}\)-K & HOutConv, HInConv \tabularnewline k & Effective inside-surface to outside-surface conductance of frame per unit area of frame projected onto window plane & W/m\(^{2}\)-K & FrameConductance, FrameCon \tabularnewline diff --git a/doc/engineering-reference/src/simulation-models-encyclopedic-reference-002/variable-refrigerant-flow-heat-pumps.tex b/doc/engineering-reference/src/simulation-models-encyclopedic-reference-002/variable-refrigerant-flow-heat-pumps.tex index 16a53f9ddaa..80f44509cc8 100644 --- a/doc/engineering-reference/src/simulation-models-encyclopedic-reference-002/variable-refrigerant-flow-heat-pumps.tex +++ b/doc/engineering-reference/src/simulation-models-encyclopedic-reference-002/variable-refrigerant-flow-heat-pumps.tex @@ -45,7 +45,7 @@ \subsubsection{Overview}\label{overview-028} \caption{Energyplus object connections for VRF-SysCurve model \protect \label{fig:energyplus-object-connections-for-vrf}} \end{figure} -The terminal unit is able to model supply air fan operation in two modes: cycling fan -- cycling coil (i.e., AUTO fan) and continuous fan -- cycling coil (i.e., fan ON). Fan:Simple:OnOff must be used to model AUTO fan, while Fan:Simple:OnOff or Fan:Simple:ConstVolume can be used to model fan ON. +The terminal unit is able to model supply air fan operation in two modes: cycling fan -- cycling coil (i.e., AUTO fan) and continuous fan -- cycling coil (i.e., fan ON). Fan:OnOff must be used to model AUTO fan, while Fan:OnOff or Fan:ConstantVolume can be used to model fan ON. Output variables reported by the VRF AC object include the heat pump's operating capacity (cooling or heating), electric consumption, operating COP, defrost electric consumption, part-load ratio (ratio of actual capacity to available capacity), runtime fraction (when cycling), cycling ratio (actual compressor cycling rate), crankcase heater power, and other report variables associated with an evaporative condenser. Report variables are also available to indicate the maximum available terminal unit cooling or heating capacity (i.e., when the condensers available capacity is insufficient to supply the capacity requested by all terminal units). Reporting of other variables of interest for the VRF AC (fan electric power, DX coil cooling rate, DX coil heating rate, terminal unit total cooling rate, etc.) is done by the individual system components (e.g., fan, DX cooling coil, DX heating coil, and zone terminal unit). For convenience, the total cooling and heating coil capacities (i.e., the coil loads) is also reported. diff --git a/doc/engineering-reference/src/surface-heat-balance-manager-processes/surface-heat-balance-with-moveable-insulation.tex b/doc/engineering-reference/src/surface-heat-balance-manager-processes/surface-heat-balance-with-moveable-insulation.tex index 45865a02d13..6f4e7961659 100644 --- a/doc/engineering-reference/src/surface-heat-balance-manager-processes/surface-heat-balance-with-moveable-insulation.tex +++ b/doc/engineering-reference/src/surface-heat-balance-manager-processes/surface-heat-balance-with-moveable-insulation.tex @@ -67,18 +67,18 @@ \subsection{Inside Heat Balance with Interior Moveable Insulation}\label{inside- \begin{lstlisting} F1 = HMovInsul / (HMovInsul + HConvIn_surf + IterDampConst); -TempSurfIn(SurfNum) = (CTFConstInPart(SurfNum) + QRadSWInAbs(SurfNum) + construct.CTFCross(0) * TH11 + +SurfTempIn(SurfNum) = (SurfCTFConstInPart(SurfNum) + QRadSWInAbs(SurfNum) + construct.CTFCross(0) * TH11 + F1 * (QRadThermInAbs(SurfNum) + HConvIn_surf * RefAirTemp(SurfNum) + NetLWRadToSurf(SurfNum) + QHTRadSysSurf(SurfNum) + QCoolingPanelSurf(SurfNum) + QHWBaseboardSurf(SurfNum) + QSteamBaseboardSurf(SurfNum) + QElecBaseboardSurf(SurfNum) + QAdditionalHeatSourceInside(SurfNum) + - IterDampConst * TempInsOld(SurfNum))) + IterDampConst * SurfTempInsOld(SurfNum))) / (construct.CTFInside(0) + HMovInsul - F1 * HMovInsul); -TempSurfInTmp(SurfNum) = (construct.CTFInside(0) * TempSurfIn(SurfNum) + - HMovInsul * TempSurfIn(SurfNum) - - QRadSWInAbs(SurfNum) - CTFConstInPart(SurfNum) - +SurfTempInTmp(SurfNum) = (construct.CTFInside(0) * SurfTempIn(SurfNum) + + HMovInsul * SurfTempIn(SurfNum) - + QRadSWInAbs(SurfNum) - SurfCTFConstInPart(SurfNum) - construct.CTFCross(0) * TH11) / (HMovInsul); \end{lstlisting} @@ -270,7 +270,7 @@ \subsubsection{Case5: Y\(_{0}\)~ small, simple conductance, with movable insulat \begin{lstlisting} // Outside heat balance case: Movable insulation, slow conduction, simple convection F2 = HMovInsul / (HMovInsul + HExtSurf(SurfNum) ); - TH(1, 1, SurfNum) = (-CTFConstOutPart(SurfNum) + QRadSWOutAbs(SurfNum) + construct.CTFCross(0) * TempSurfIn(SurfNum) + + TH(1, 1, SurfNum) = (-SurfCTFConstOutPart(SurfNum) + QRadSWOutAbs(SurfNum) + construct.CTFCross(0) * SurfTempIn(SurfNum) + F2 * (QRadSWOutMvIns(SurfNum) + (HExtSurf(SurfNum)) * TempExt) / (construct.CTFOutside(0) + HMovInsul - F2 * HMovInsul); \end{lstlisting} @@ -283,8 +283,8 @@ \subsubsection{Case6: Y\(_{0}\) not small, simple conductance, with movable insu // Outside heat balance case: Movable insulation, quick conduction, simple convection F1 = construct.CTFCross(0) / (construct.CTFInside(0) + HConvIn(SurfNum)); F2 = HMovInsul / (HMovInsul + HExtSurf(SurfNum) ); - TH(1, 1, SurfNum) = (-CTFConstOutPart(SurfNum) + QRadSWOutAbs(SurfNum) + QRadLWOutSrdSurfs(SurfNum) + - F1 * (CTFConstInPart(SurfNum) + QRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + + TH(1, 1, SurfNum) = (-SurfCTFConstOutPart(SurfNum) + QRadSWOutAbs(SurfNum) + QRadLWOutSrdSurfs(SurfNum) + + F1 * (SurfCTFConstInPart(SurfNum) + QRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + HConvIn(SurfNum) * MAT(ZoneNum) + NetLWRadToSurf(SurfNum)) + F2 * (QRadSWOutMvIns(SurfNum) + (HExtSurf(SurfNum)) * TempExt) / (construct.CTFOutside(0) + HMovInsul - F2 * HMovInsul - F1 * construct.CTFCross(0)); @@ -296,11 +296,11 @@ \subsubsection{Case7: Y\(_{0}\)~ small, detailed conductance, with movable insul \begin{lstlisting} // Outside heat balance case: Movable insulation, slow conduction, detailed convection - F2 = HMovInsul / (HMovInsul + HcExtSurf(SurfNum) + HAirExtSurf(SurfNum) + HSkyExtSurf(SurfNum) + HGrdExtSurf(SurfNum)); - TH(1, 1, SurfNum) = (-CTFConstOutPart(SurfNum) + QRadSWOutAbs(SurfNum) + QRadLWOutSrdSurfs(SurfNum) + construct.CTFCross(0) * TempSurfIn(SurfNum) + - F2 * (QRadSWOutMvIns(SurfNum) + (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * + F2 = HMovInsul / (HMovInsul + SurfHcExt(SurfNum) + SurfHAirExt(SurfNum) + SurfHSkyExt(SurfNum) + SurfHGrdExt(SurfNum)); + TH(1, 1, SurfNum) = (-SurfCTFConstOutPart(SurfNum) + QRadSWOutAbs(SurfNum) + QRadLWOutSrdSurfs(SurfNum) + construct.CTFCross(0) * SurfTempIn(SurfNum) + + F2 * (QRadSWOutMvIns(SurfNum) + (SurfHcExt(SurfNum) + SurfHAirExt(SurfNum)) * TempExt + QAdditionalHeatSourceOutside(SurfNum) + - HSkyExtSurf(SurfNum) * TSky + HGrdExtSurf(SurfNum) * TGround)) / + SurfHSkyExt(SurfNum) * TSky + SurfHGrdExt(SurfNum) * TGround)) / (construct.CTFOutside(0) + HMovInsul - F2 * HMovInsul); \end{lstlisting} @@ -311,13 +311,13 @@ \subsubsection{Case8: Y\(_{0}\) not small, detailed conductance, with movable in \begin{lstlisting} // Outside heat balance case: Movable insulation, quick conduction, detailed convection F1 = construct.CTFCross(0) / (construct.CTFInside(0) + HConvIn(SurfNum)); - F2 = HMovInsul / (HMovInsul + HcExtSurf(SurfNum) + HAirExtSurf(SurfNum) + HSkyExtSurf(SurfNum) + HGrdExtSurf(SurfNum)); - TH(1, 1, SurfNum) = (-CTFConstOutPart(SurfNum) + QRadSWOutAbs(SurfNum) + QRadLWOutSrdSurfs(SurfNum) + - F1 * (CTFConstInPart(SurfNum) + QRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + + F2 = HMovInsul / (HMovInsul + SurfHcExt(SurfNum) + SurfHAirExt(SurfNum) + SurfHSkyExt(SurfNum) + SurfHGrdExt(SurfNum)); + TH(1, 1, SurfNum) = (-SurfCTFConstOutPart(SurfNum) + QRadSWOutAbs(SurfNum) + QRadLWOutSrdSurfs(SurfNum) + + F1 * (SurfCTFConstInPart(SurfNum) + QRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + HConvIn(SurfNum) * MAT(ZoneNum) + NetLWRadToSurf(SurfNum)) + - F2 * (QRadSWOutMvIns(SurfNum) + (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * + F2 * (QRadSWOutMvIns(SurfNum) + (SurfHcExt(SurfNum) + SurfHAirExt(SurfNum)) * TempExt + QAdditionalHeatSourceOutside(SurfNum) + - HSkyExtSurf(SurfNum) * TSky + HGrdExtSurf(SurfNum) * TGround)) / + SurfHSkyExt(SurfNum) * TSky + SurfHGrdExt(SurfNum) * TGround)) / (construct.CTFOutside(0) + HMovInsul - F2 * HMovInsul - F1 * construct.CTFCross(0)); \end{lstlisting} @@ -343,8 +343,8 @@ \subsection{C++ Variable Descriptions}\label{c++-variable-descriptions} Construct(ConstrNum).CTFCross(0) & Cross or Y term of the CTF equation & Y0 & W/m K & Cross CTF term \tabularnewline Construct(ConstrNum).CTFInside(0) & Inside or Z terms of the CTF equation & Z0 & W/m K & Inside CTF term \tabularnewline Construct(ConstrNum).CTFOutside(0) & Outside or X terms of the CTF equation & X0 & W/m K & Outside CTF term \tabularnewline -CTFConstInPart(SurfNum) & Constant inside portion of the CTF calculation & KIP & W/m & Portion of inward conductive flux based on previous temperature and flux history terms \tabularnewline -CTFConstOutPart(SurfNum) & Constant Outside portion of the CTF calculation & KOP & W/m & Portion of outward conductive flux based on previous temperature and flux history terms \tabularnewline +SurfCTFConstInPart(SurfNum) & Constant inside portion of the CTF calculation & KIP & W/m & Portion of inward conductive flux based on previous temperature and flux history terms \tabularnewline +SurfCTFConstOutPart(SurfNum) & Constant Outside portion of the CTF calculation & KOP & W/m & Portion of outward conductive flux based on previous temperature and flux history terms \tabularnewline F1, F2, F3 & Intermediate calculation variables & F1, F2, F3 & ~ & Radiation interchange factor between surfaces \tabularnewline GroundTemp & Ground surface temperature & T & C & Temperature of ground at the surface exposed to the outside environment \tabularnewline HConvIn(SurfNum) & Inside convection coefficient & HI & W/m K & Inside convection coefficient \tabularnewline @@ -360,7 +360,7 @@ \subsection{C++ Variable Descriptions}\label{c++-variable-descriptions} QRadThermInAbs(SurfNum) & Thermal Radiation absorbed on inside surfaces & ~ & W/m & Longwave radiant flux from internal gains \tabularnewline SkyTemp & Sky temperature & T & C & Sky temp \tabularnewline TempExt & Exterior surface temperature or exterior air temperature & TM, T & C & Temperature of external surface of movable insulation or outside ambient air temperature \tabularnewline -TempSurfIn(SurfNum) & Temperature of inside surface for each heat transfer surface & TI & C & Temperature of inside of surface I at time t-1 \tabularnewline +SurfTempIn(SurfNum) & Temperature of inside surface for each heat transfer surface & TI & C & Temperature of inside of surface I at time t-1 \tabularnewline \bottomrule \end{longtable}} diff --git a/doc/getting-started/src/overall-scheme-methodology-for-running/a-methodology-for-using-energyplus.tex b/doc/getting-started/src/overall-scheme-methodology-for-running/a-methodology-for-using-energyplus.tex index 80101f99a56..3baf92a6e3d 100644 --- a/doc/getting-started/src/overall-scheme-methodology-for-running/a-methodology-for-using-energyplus.tex +++ b/doc/getting-started/src/overall-scheme-methodology-for-running/a-methodology-for-using-energyplus.tex @@ -21,7 +21,7 @@ \subsection{\emph{Step 1}: Plan Ahead}\label{step-1-plan-ahead} Obtain sufficient \emph{central plant} information to allow specification and scheduling of the boilers, chillers and other plant equipment. \end{itemize} -\subsection{*Step 2: ``*Zone" the Building}\label{step-2-zone-the-building} +\subsection{\emph{Step 2}: ``Zone" the Building}\label{step-2-zone-the-building} A building ``surface'' is the fundamental element in the building model. In the general sense, there are two types of ``surfaces'' in EnergyPlus. These are: @@ -31,16 +31,16 @@ \subsection{*Step 2: ``*Zone" the Building}\label{step-2-zone-the-building} The first rule of building modeling is, ``\emph{Always define a surface as a heat storage surface unless it must be defined as a heat transfer surface}''. Any surface, which is expected to separate spaces of significantly different temperatures, must be defined as a \emph{heat transfer surface.} Thus, exterior surfaces, such as outside walls, roofs and floors, are \emph{heat transfer surfaces}. Interior surfaces (partitions) are \emph{heat storage surfaces} if they separate spaces maintained at the same temperature and \emph{heat transfer surfaces} if they separate spaces maintained at different temperatures. A discussion of how to define heat transfer and heat storage surfaces will occur in later steps. In order to correctly ``zone'' the building it is necessary only to distinguish between the two. -A ``zone'' is a \emph{thermal,} not a \emph{geometric,} concept. A ``zone'' is an air volume at a uniform temperature plus all the heat transfer and heat storage surfaces bounding or inside of that air volume. EnergyPlus calculates the energy required to maintain each zone at a specified temperature for each hour of the day. Since EnergyPlus performs a zone heat balance, the first step in preparing a building description is to break the building into zones. The objective of this exercise is to define as \emph{few} zones as possible without significantly compromising the integrity of the simulation. - -Although defining building zones is somewhat of an art, a few general rules will keep the new simulation user out of trouble. Consider the following figure, which shows the floor plan of an Adult Education Center. - \begin{figure}[hbtp] % fig 12 \centering \includegraphics[width=0.9\textwidth, height=0.9\textheight, keepaspectratio=true]{media/image012.png} \caption{Adult Education Center \protect \label{fig:adult-education-center}} \end{figure} +A ``zone'' is a \emph{thermal}, not a \emph{geometric}, concept. A ``zone'' is an air volume at a uniform temperature plus all the heat transfer and heat storage surfaces bounding or inside of that air volume. EnergyPlus calculates the energy required to maintain each zone at a specified temperature for each hour of the day. Since EnergyPlus performs a zone heat balance, the first step in preparing a building description is to break the building into zones. The objective of this exercise is to define as \emph{few} zones as possible without significantly compromising the integrity of the simulation. + +Although defining building zones is somewhat of an art, a few general rules will keep the new simulation user out of trouble. Consider Figure~\ref{fig:adult-education-center} which shows the floor plan of an Adult Education Center. + The question is, ``How many \emph{thermal} zones should be used to model this building?''~ The inexperienced building modeler may be tempted to define each room in the building as a zone, but the thermal zone is defined as a volume of air at a uniform temperature. The general rule then is to \emph{use the number of fan systems (and radiant systems) not the number of rooms to determine the number of zones in the building.} The minimum number of zones in a general simulation model will usually be equal to the number of systems serving the building. The collection of heat transfer and heat storage surfaces defined within each zone will include all surfaces bounding or inside of the space conditioned by the system. \subsection{Zoning -- Concept 1 - Simple}\label{zoning-concept-1---simple} @@ -81,19 +81,19 @@ \subsection{Zoning -- Concept 2 - Detailed}\label{zoning-concept-2---detailed} \bottomrule \end{longtable} +Take note of Zone 1, Zone 2, Zone 4, and Zone 7 in Figure~\ref{fig:thermal-zones-in-the-education-center}. The two important zoning concepts can be demonstrated with the zoning to reinforce the idea of a thermal zone and encourage the use of simplified models. + \begin{figure}[hbtp] % fig 14 \centering \includegraphics[width=0.9\textwidth, height=0.9\textheight, keepaspectratio=true]{media/image014.png} \caption{Thermal Zones in the Education Center \protect \label{fig:thermal-zones-in-the-education-center}} \end{figure} -Take note of Zone 1, Zone 2, Zone 4, and Zone 7. The two important zoning concepts can be demonstrated with the zoning to reinforce the idea of a thermal zone and encourage the use of simplified models. - 1.~~ Notice that Zones 4 and 7 include two rooms that are not adjacent to one another but are served by the same system. Because the air temperature in the two spaces is maintained at the same uniform temperature, the two spaces, though separated spatially, may be defined as a single zone. For our purposes, we will define them as separate zones. 2.~~ Notice that Zone 1 and Zone 2 are served by the same fan system and could be defined as a single zone with 7650 cfm of conditioned air supplied to the space. The space was split into two zones because the designer expected higher solar loads on the South and West sides of the wing and wanted to examine the \emph{distribution} as well as the \emph{magnitude} of the load in the space. -\subsection{\emph{Step 3:} Prepare to Construct the Building Model}\label{step-3-prepare-to-construct-the-building-model} +\subsection{\emph{Step 3}: Prepare to Construct the Building Model}\label{step-3-prepare-to-construct-the-building-model} Working from blueprints or sketches and following the guidelines in Step 2, the building zones were determined. It is recommended that the engineer sketch the building with its zones. Surface dimensions should be included in the sketch. Additional geometric and surface information is required before an input file describing the building can be constructed. Specifically the building model must: @@ -114,7 +114,7 @@ \subsubsection{Step 3.1.~~~~~ Determine heat transfer and heat storage surfaces. The details of inputting surfaces are described in the Input/Output Reference document. The allowable surface types are shown in the following table: % table 3 -\begin{longtable}[c]{p{1.61in}p{4.38in}} +\begin{longtable}[c]{p{1.91in}p{4.08in}} \caption{Surface types and categorization \label{table:surface-types-and-categorization}} \tabularnewline \toprule Surface Type & Applicability \tabularnewline @@ -445,7 +445,7 @@ \subsubsection{Step 3.4.~~~~ Compile surface and subsurface information.}\label{ \textbf{Area:}~ The area of subsurfaces (windows), roofs, floors. -\subsection{Step 4: Compile Internal Space Gain Data}\label{step-4-compile-internal-space-gain-data} +\subsection{\emph{Step 4}: Compile Internal Space Gain Data}\label{step-4-compile-internal-space-gain-data} People, lights, equipment, outside air infiltration and ventilation all constitute ``internal gains'' for the thermal zone. These gains are described to EnergyPlus as a \emph{design or} \emph{peak} level with a \emph{schedule} that specifies a fraction of the peak for each hour. The peak level is calculated by the user. Table~\ref{table:internal-gain-data}. Internal Gain Data shows the internal loads for a single zone model of Ft. Monmouth and the schedule named to specify the hourly load. diff --git a/doc/input-output-reference/media/image013.png b/doc/input-output-reference/media/image013.png index e75a75566df..61a419eb62a 100644 Binary files a/doc/input-output-reference/media/image013.png and b/doc/input-output-reference/media/image013.png differ diff --git a/doc/input-output-reference/src/input-for-output.tex b/doc/input-output-reference/src/input-for-output.tex index b414dc24f49..40c6c94060a 100644 --- a/doc/input-output-reference/src/input-for-output.tex +++ b/doc/input-output-reference/src/input-for-output.tex @@ -273,11 +273,11 @@ \subsubsection{Inputs}\label{inputs-5-024} \paragraph{Field: Actuator Availability Dictionary Reporting}\label{field-actuator-availability-dictionary-reporting} -This field is used to control the level of output reporting related to the EMS actuators that are available for a particular model. When EnergyPlus runs with EMS, it sets up a wide array of possible actuators that the EMS could use. (To actually use them requires an \hyperref[energymanagementsystemactuator]{EnergyManagementSystem:Actuator} object). Actuator availability dictionary reporting is provided to show the user what actuators are available in a particular building model. Regardless of the level of reporting chosen here, the same set of actuators are actually available. There are three levels to choose from. The ``None'' choice means that no reporting of available actuators is done. The ``NotByUniqueNames'' level means that the output includes only the types of actuators and their control options but not the unique, user-defined names that identify a specific actuator in the model. The ``Verbose'' level means that the output includes all combinations of actuator types, control types, and the unique names of specific actuators. The verbose level provides all the information needed for input in an \hyperref[energymanagementsystemactuator]{EnergyManagementSystem:Actuator} input object. +This field is used to control the level of output reporting related to the EMS actuators that are available for a particular model. When EnergyPlus runs with EMS, it sets up a wide array of possible actuators that the EMS could use. (To actually use them requires an \hyperref[energymanagementsystemactuator]{EnergyManagementSystem:Actuator} object). Actuator availability dictionary reporting is provided to show the user what actuators are available in a particular building model. Regardless of the level of reporting chosen here, the same set of actuators are actually available. There are three levels to choose from. The ``None'' choice means that no reporting of available actuators is done. The ``NotByUniqueKeyNames'' level means that the output includes only the types of actuators and their control options but not the unique, user-defined names that identify a specific actuator in the model. The ``Verbose'' level means that the output includes all combinations of actuator types, control types, and the unique names of specific actuators. The verbose level provides all the information needed for input in an \hyperref[energymanagementsystemactuator]{EnergyManagementSystem:Actuator} input object. \paragraph{Field: Internal Variable Availability Dictionary Reporting}\label{field-internal-variable-availability-dictionary-reporting} -This field is used to control the level of output reporting related to the EMS internal variables that are available for a particular model. When EnergyPlus runs with EMS, it sets up a wide array of possible internal data sources that the EMS could use. (To actually use them requires an \hyperref[energymanagementsysteminternalvariable]{EnergyManagementSystem:InternalVariable} object). Internal variable availability dictionary reporting is provided to show the user what internal data are available. Regardless of the level of reporting chosen here, the same internal data are available. There are three levels to choose from. The ``None'' choice means that no reporting of available internal data is done. The ``NotByUniqueNames'' level means that the output includes only the types of internal data but not the unique names that identify a specific instances in the model. The ``Verbose'' level means that the output includes all combinations of internal variables and the unique names of specific instances. The verbose level provides all the information needed for an \hyperref[energymanagementsysteminternalvariable]{EnergyManagementSystem:InternalVariable} input object. +This field is used to control the level of output reporting related to the EMS internal variables that are available for a particular model. When EnergyPlus runs with EMS, it sets up a wide array of possible internal data sources that the EMS could use. (To actually use them requires an \hyperref[energymanagementsysteminternalvariable]{EnergyManagementSystem:InternalVariable} object). Internal variable availability dictionary reporting is provided to show the user what internal data are available. Regardless of the level of reporting chosen here, the same internal data are available. There are three levels to choose from. The ``None'' choice means that no reporting of available internal data is done. The ``NotByUniqueKeyNames'' level means that the output includes only the types of internal data but not the unique names that identify a specific instances in the model. The ``Verbose'' level means that the output includes all combinations of internal variables and the unique names of specific instances. The verbose level provides all the information needed for an \hyperref[energymanagementsysteminternalvariable]{EnergyManagementSystem:InternalVariable} input object. \paragraph{Field: EnergyPlus Runtime Language Debug Output Level}\label{field-energyplus-runtime-language-debug-output-level} diff --git a/doc/input-output-reference/src/overview/group-advanced-surface-concepts.tex b/doc/input-output-reference/src/overview/group-advanced-surface-concepts.tex index 8dab6103dd9..7ae57fbef71 100644 --- a/doc/input-output-reference/src/overview/group-advanced-surface-concepts.tex +++ b/doc/input-output-reference/src/overview/group-advanced-surface-concepts.tex @@ -1745,8 +1745,6 @@ \subsubsection{Inputs}\label{inputs-10} If the Convection type was ``Schedule'', then this field contains the name of a schedule describing the value to be used during the time intervals for the schedule. -The complete IDD definition for the ConvectionCoefficients object follows: - \paragraph{Field: Convection Coefficient 1 User Curve Name}\label{field-convection-coefficient-1-user-curve-name} \paragraph{Field: Convection Coefficient 2 User Curve Name}\label{field-convection-coefficient-2-user-curve-name} @@ -2232,7 +2230,7 @@ \subsection{SurfaceProperty:ExteriorNaturalVentedCavity}\label{surfacepropertyex This object is used to model a multi-skin exterior heat transfer surface. This is a special case where the outside face is a slightly detached layer forming a naturally ventilated cavity. The actual outer surface is referred to as the baffle. The modeling here assumes that the heat capacity in the outer baffle can be neglected since it is much lower than the underlying mass surface. This object is used with the \hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed} object where the Heat Transfer surfaces are referred to as the underlying surfaces. The constructions and materials for the \hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed} object should reflect the construction of just the underlying surface. The SurfaceProperty:ExteriorNaturalVentedCavity object is used to describe the decoupled layer, or baffle, and the characteristics of the cavity and openings for natural ventilation. This object is also used in conjunction with the OtherSideConditionsModel. -The area and orientation are obtained from \textbf{\hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed}} objects, which are referenced by name. This object can be used to model certain types of photovoltaic mounting configurations such as interlocking roof pavers. If the baffle covers only part of a surface, then that surface should be split into separate \textbf{\hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed}} objects where one matches the size of the baffle. A single baffle can be associated with as many \textbf{\hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed}} objects as desired (although if you need to use more than 10 surfaces, then the IDD will need to be extended). The base heat transfer surfaces need not be contiguous nor have the same orientation, but the program will issue warnings if surfaces have widely ranging tilts and azimuths. +The area and orientation are obtained from \textbf{\hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed}} objects, which are referenced by name. This object can be used to model certain types of photovoltaic mounting configurations such as interlocking roof pavers. If the baffle covers only part of a surface, then that surface should be split into separate \textbf{\hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed}} objects where one matches the size of the baffle. A single baffle can be associated with as many \textbf{\hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed}} objects as desired. The base heat transfer surfaces need not be contiguous nor have the same orientation, but the program will issue warnings if surfaces have widely ranging tilts and azimuths. Note that the model involves predicting the rates that ambient air moves in and out of the cavity. Accurate modeling of these air flows would be extremely challenging and so the models provided through this object are simplistic engineering models based on discharge coefficients that are sensitive to wind and buoyancy effects. The accuracy depends on the values for, and applicability of, the discharge coefficients and unfortunately little research is available to help characterize these. The models should be considered rudimentary and the user is encouraged to explore different values for the coefficients in attempts to bound the importance of natural ventilation for the cavities. See the Engineering Reference for more details. @@ -2294,7 +2292,7 @@ \subsubsection{Inputs}\label{inputs-13} \paragraph{Field(s): Surface \textless{}1 thru x\textgreater{} Name}\label{fields-surface-1-thru-x-name} -The remaining fields are used to name the \textbf{\hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed}} objects that are associated with the exterior naturally vented cavity. These are the underlying heat transfer surfaces and are defined elsewhere in the input file. These surfaces should all specify OtherSideConditionsModel as their exterior environment. The input object can currently accommodate up to ten surfaces, but it is extensible by modifying the Energy+.idd entry. +The remaining fields are used to name the \textbf{\hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed}} objects that are associated with the exterior naturally vented cavity. These are the underlying heat transfer surfaces and are defined elsewhere in the input file. These surfaces should all specify OtherSideConditionsModel as their exterior environment. This object is extensible, so additional fields of this type can be added to the end of this object. An example IDF entry is @@ -2553,7 +2551,7 @@ \subsubsection{Field: Surrounding Surface 1 Temperature Schedule Name}\label{fie This field is used to supply a schedule name of the of a surrounding surface temperature. -The last three fields are extensible to define multiple surrounding surface name, temperature and view factor sets. +The object is extensible so the last three fields can be repeated to define multiple surrounding surface name, temperature and view factor sets. An example IDF object follows. diff --git a/doc/input-output-reference/src/overview/group-air-distribution-equipment.tex b/doc/input-output-reference/src/overview/group-air-distribution-equipment.tex index 000fa504f61..aeab0d7b8e3 100644 --- a/doc/input-output-reference/src/overview/group-air-distribution-equipment.tex +++ b/doc/input-output-reference/src/overview/group-air-distribution-equipment.tex @@ -477,7 +477,7 @@ \subsubsection{Inputs}\label{inputs-3-000} 0.05, !- Zone Minimum Air Flow Fraction SPACE2-1 ATU In Node, !- Air Inlet Node Name SPACE2-1 In Node, !- Air Outlet Node Name - FAN:SIMPLE:VariableVol, !- Fan object + FAN:VariableVolume, !- Fan object SPACE2-1 Zone Fan, !- Fan name COIL:Water:SimpleHeating, Heating coil object SPACE2-1 Zone Coil, !- Heating coil name diff --git a/doc/input-output-reference/src/overview/group-air-distribution.tex b/doc/input-output-reference/src/overview/group-air-distribution.tex index 26b136c29cd..33dbcb7f3a8 100644 --- a/doc/input-output-reference/src/overview/group-air-distribution.tex +++ b/doc/input-output-reference/src/overview/group-air-distribution.tex @@ -692,7 +692,7 @@ \subsubsection{Inputs}\label{inputs-2-002} \paragraph{Field Set (Availability Manager Object Type, Name)}\label{field-set-availability-manager-object-type-name} -Managers are listed by pairs of data items:~ \emph{Availability Manager Object Type} and \emph{Availability Manager Name}. The managers are simulated down the list and calculate a control status for use by the \hyperref[airloophvac]{AirLoopHVAC} or \hyperref[plantloop]{PlantLoop}. The priority of each manager used for a specific loop is based on the rules described above. Availability managers are not currently used for condenser loops. The availability managers, along with the \hyperref[airloophvac]{AirLoopHVAC} and \hyperref[plantloop]{PlantLoop} object, report the control status calculated each simulation timestep. These output variables can be used to prioritize the managers according to the required control strategy. Six managers are accomodated in the list by default, however, this IDD specification is extensible. Additional pairs may be added by directly editing the IDD. +Managers are listed by pairs of data items:~ \emph{Availability Manager Object Type} and \emph{Availability Manager Name}. The managers are simulated down the list and calculate a control status for use by the \hyperref[airloophvac]{AirLoopHVAC} or \hyperref[plantloop]{PlantLoop}. The priority of each manager used for a specific loop is based on the rules described above. Availability managers are not currently used for condenser loops. The availability managers, along with the \hyperref[airloophvac]{AirLoopHVAC} and \hyperref[plantloop]{PlantLoop} object, report the control status calculated each simulation timestep. These output variables can be used to prioritize the managers according to the required control strategy. Six managers are accomodated in the list by default. This object is extensible, so additional pairs of the next two fields may be added. \paragraph{Field: Availability Manager \textless{}x\textgreater{} Object Type}\label{field-availability-manager-x-object-type} @@ -746,7 +746,7 @@ \subsubsection{Inputs}\label{inputs-3-001} \paragraph{Field: Availability Manager List Name}\label{field-availability-manager-list-name-1} -This field is the name of a \hyperref[availabilitymanagerassignmentlist]{AvailabilityManagerAssignmentList} object. An Availability Manager List is a list of Availability Managers giving both Availability Manager Object Type and Name. \textbf{Use of this input is optional.} This field may be omitted; it is not currently used by the program. +This field is the name of a \hyperref[availabilitymanagerassignmentlist]{AvailabilityManagerAssignmentList} object. An Availability Manager List is a list of Availability Managers giving both Availability Manager Object Type and Name. This field is not used by EnergyPlus, so it may be omitted or left blank. If the user does provide a name for this field, keep in mind that it will not affect the simulation and it must be a valid Availability Manager name. An IDF example, including the \hyperref[airloophvac]{AirLoopHVAC}, and the controller and equipment lists. diff --git a/doc/input-output-reference/src/overview/group-air-path.tex b/doc/input-output-reference/src/overview/group-air-path.tex index 250b77a5da2..5ee8b4ad509 100644 --- a/doc/input-output-reference/src/overview/group-air-path.tex +++ b/doc/input-output-reference/src/overview/group-air-path.tex @@ -120,7 +120,7 @@ \subsubsection{Inputs}\label{inputs-2-003} \paragraph{Field: Inlet \textless{}\#\textgreater{} Node Name}\label{field-inlet-node-name} -The name of a plenum inlet node. There is no limit to the number of inlet nodes, and there may be no duplicate inlet node names. (Note that some EnergyPlus editing tools may allow only 500 inlet node names, but this may be increased by extending the object in the Energy+.idd file.) +The name of a plenum inlet node. There is no limit to the number of inlet nodes, and there may be no duplicate inlet node names. This object is extensible, so additional fields of this type can be added to the end of this object. (Note that some EnergyPlus editing tools may allow only 500 inlet node names.) An IDF example of a zone return plenum component specification: @@ -192,7 +192,7 @@ \subsubsection{Inputs}\label{inputs-3-002} \paragraph{Field: Outlet \textless{}\#\textgreater{} Node Name}\label{field-outlet-node-name-1-000} -The name of a plenum outlet node. There is no limit to the number of outlet nodes, and there may be no duplicate outlet node names. (Note that some EnergyPlus editing tools may allow only 500 outlet node names, but this may be increased by extending the object in the Energy+.idd file.) +The name of a plenum outlet node. There is no limit to the number of outlet nodes, and there may be no duplicate outlet node names. This object is extensible, so additional fields of this type can be added to the end of this object. (Note that some EnergyPlus editing tools may allow only 500 outlet node names.) An IDF example of an AirLoopHVAC:SupplyPlenum component specification: @@ -235,7 +235,7 @@ \subsubsection{Inputs} \paragraph{Field: Outlet \textless{}\#\textgreater{} Node Name} -The name of a splitter outlet node. There is no limit to the number of outlet nodes, and there may be no duplicate outlet node names. (Note that some EnergyPlus editing tools may allow only 500 outlet node names, but this may be increased by extending the object in the Energy+.idd file.) +The name of a splitter outlet node. There is no limit to the number of outlet nodes, and there may be no duplicate outlet node names. This object is extensible, so additional fields of this type can be added to the end of this object. (Note that some EnergyPlus editing tools may allow only 500 outlet node names.) An example is shown below. @@ -265,7 +265,7 @@ \subsubsection{Inputs} \paragraph{Field: Inlet \textless{}\#\textgreater{} Node Name} -The name of a mixer inlet node. There is no limit to the number of inlet nodes, and there may be no duplicate inlet node names. (Note that some EnergyPlus editing tools may allow only 500 inlet node names, but this may be increased by extending the object in the Energy+.idd file.) +The name of a mixer inlet node. There is no limit to the number of inlet nodes, and there may be no duplicate inlet node names. This object is extensible, so additional fields of this type can be added to the end of this object. (Note that some EnergyPlus editing tools may allow only 500 inlet node names.) An input example is shown below. @@ -325,7 +325,7 @@ \subsubsection{Inputs} \paragraph{Field: AirLoopHVAC \textless{}\#\textgreater{} Name}\label{field-airloophvac-name} -The name of an AirLoopHVAC. There is no limit to the number of AirLoopHVACs, and there may be no duplicate AirLoopHVAC names. (Note that some EnergyPlus editing tools may allow only 20 AirLoopHVAC names, but this may be increased by extending the object in the Energy+.idd file.) +The name of an AirLoopHVAC. There is no limit to the number of AirLoopHVACs, and there may be no duplicate AirLoopHVAC names. This object is extensible, so additional fields of this type can be added to the end of this object. (Note that some EnergyPlus editing tools may allow only 20 AirLoopHVAC names.) An example of this statement in an IDF is: @@ -365,7 +365,7 @@ \subsubsection{Inputs}\label{inputs-5-002} \paragraph{Field: Inlet \textless{}\#\textgreater{} Node Name}\label{field-inlet-node-name-3} -The name of a mixer inlet node. There is no limit to the number of inlet nodes, and there may be no duplicate inlet node names. (Note that some EnergyPlus editing tools may allow only 50 inlet node names, but this may be increased by extending the object in the Energy+.idd file.) +The name of a mixer inlet node. There is no limit to the number of inlet nodes, and there may be no duplicate inlet node names. This object is extensible, so additional fields of this type can be added to the end of this object. (Note that some EnergyPlus editing tools may allow only 50 inlet node names.) An input example is shown below. @@ -397,7 +397,7 @@ \subsubsection{Inputs}\label{inputs-4-002} \paragraph{Field: Outlet \textless{}\#\textgreater{} Node Name}\label{field-outlet-node-name-2} -The name of a splitter outlet node. There is no limit to the number of outlet nodes, and there may be no duplicate outlet node names. (Note that some EnergyPlus editing tools may allow only 50 outlet node names, but this may be increased by extending the object in the Energy+.idd file.) +The name of a splitter outlet node. There is no limit to the number of outlet nodes, and there may be no duplicate outlet node names. This object is extensible, so additional fields of this type can be added to the end of this object. (Note that some EnergyPlus editing tools may allow only 50 outlet node names.) An input example is shown below. diff --git a/doc/input-output-reference/src/overview/group-airflow-network.tex b/doc/input-output-reference/src/overview/group-airflow-network.tex index 316d2452e3a..8f71974da1a 100644 --- a/doc/input-output-reference/src/overview/group-airflow-network.tex +++ b/doc/input-output-reference/src/overview/group-airflow-network.tex @@ -1671,20 +1671,22 @@ \subsubsection{Field: Connection Surface}\label{field-connection-surface} \subsection{AirflowNetwork:Distribution:DuctViewFactors}\label{airflownetworkdistributionductviewfactor} The AirflowNetwork:Distribution:DuctViewFactors object is used to represent the information needed for simplified surface-to-duct radiation heat transfer. View factors from each duct object to each referenced surface are provided by the user. EnergyPlus calculates the heat gain to the duct from the referenced surfaces. If the object is included, radiation is calculated for the referenced duct; radiation is neglected of the object is omitted. -\subsubsection{Field: Name of Linkage}\label{field-name-of-linkage} +\paragraph{Field: Name of Linkage}\label{field-name-of-linkage} Name of the linkage object in which the view factors are applied. -\subsubsection{Field: Surface Exposure Fraction}\label{field-surface-exposure-fraction} +\paragraph{Field: Surface Exposure Fraction}\label{field-surface-exposure-fraction} The fraction, range 0 to 1, of the duct surface that is exposed to the zone for a partially buried duct (dimensionless). -\subsubsection{Field: Surface Emittance}\label{field-surface-emittance} +\paragraph{Field: Surface Emittance}\label{field-surface-emittance} The air duct surface emittance factor in the range 0 to 1 based on the material properties (dimensionless). -\subsubsection{Field: Surface 1 Name}\label{field-suface-1-name} -This field specifies the name of the surface seen by the duct. Field is extensible to accommodate as many surfaces as required. +\paragraph{Field: Surface \textless{}\#\textgreater{} Name}\label{field-suface-1-name} +This field specifies the name of the surface seen by the duct. -\subsubsection{Field: View Factor 1}\label{field-surface-1-view-factor} -This field specifies the view factor from the duct to surface 1. Field is extensible to accommodate as many surfaces as required. +\paragraph{Field: View Factor \textless{}\#\textgreater{}}\label{field-surface-1-view-factor} +This field specifies the view factor from the duct to the surface. + +This object is extensible, so additional pairs of the last two fields can be added to the end of this object. An IDF example is provided below: diff --git a/doc/input-output-reference/src/overview/group-condenser-equipment.tex b/doc/input-output-reference/src/overview/group-condenser-equipment.tex index 494027be0c5..a9e2dbc7c0d 100644 --- a/doc/input-output-reference/src/overview/group-condenser-equipment.tex +++ b/doc/input-output-reference/src/overview/group-condenser-equipment.tex @@ -3384,11 +3384,13 @@ \subsubsection{Inputs} \paragraph{Field: g-function Ln(t/ts) Value \textless{}x\textgreater{}}\label{field-g-function-lntts-value-x} -This numeric field contains the natural log of time/steady state time: \emph{ln(t/t\(_{s}\))}. Field is extensible. +This numeric field contains the natural log of time/steady state time: \emph{ln(t/t\(_{s}\))}. \paragraph{Field: g-function `g' Value \textless{}x\textgreater{}}\label{field-g-function-g-value-x} -This numeric field contains the g-function value of the corresponding LNTTS. Field is extensible. +This numeric field contains the g-function value of the corresponding LNTTS. + +This object is extensible, so additional pairs of these last two fields can be added to the end of this object. An example object is shown below. diff --git a/doc/input-output-reference/src/overview/group-controllers.tex b/doc/input-output-reference/src/overview/group-controllers.tex index e2609654149..a3aba495e2f 100644 --- a/doc/input-output-reference/src/overview/group-controllers.tex +++ b/doc/input-output-reference/src/overview/group-controllers.tex @@ -447,7 +447,7 @@ \subsection{Controller:MechanicalVentilation}\label{controllermechanicalventilat Ventilation standards provide guidance on appropriate levels of outdoor ventilation air required for acceptable indoor air quality. The Ventilation Rate Procedure (VRP) of ASHRAE Standard 62.1-2007/2010 (\href{http://www.ashrae.org}{www.ashrae.org}) requires outdoor ventilation rates to be determined based on the floor area of each occupied zone plus the number of people in each zone and considers the zone air distribution effectiveness and system ventilation efficiency. The outdoor air ventilation rate can be reset dynamically as operating conditions change (e.g., variations in occupancy). The Controller:MechanicalVentilation object implements the VRP for calculating these outdoor air ventilation requirements and resetting them based on varying occupancy levels and zone diversification. This is particularly useful for large air distribution systems that serve a number of different zone types with varying occupancy levels. This object can also be used to model the Indoor Air Quality Procedure (IAQP) as defined in Standard 62.1 -The first five inputs for this object are the name, the availability schedule, the zone outdoor air method, the system outdoor air method, and the zone maximum outdoor air fraction. The next three input fields define the zone name (or zone list name), the design specification outdoor air object name, and the design specification zone air distribution object name to be applied to this zone (or zone list). The last three fields are extensible +The first five inputs for this object are the name, the availability schedule, the zone outdoor air method, the system outdoor air method, and the zone maximum outdoor air fraction. The next three input fields define the zone name (or zone list name), the design specification outdoor air object name, and the design specification zone air distribution object name to be applied to this zone (or zone list). The last three fields are extensible. \subsubsection{Inputs}\label{inputs-2-007} diff --git a/doc/input-output-reference/src/overview/group-demand-limiting-controls.tex b/doc/input-output-reference/src/overview/group-demand-limiting-controls.tex index 043d4c46e9a..26c6e349207 100644 --- a/doc/input-output-reference/src/overview/group-demand-limiting-controls.tex +++ b/doc/input-output-reference/src/overview/group-demand-limiting-controls.tex @@ -70,15 +70,15 @@ \subsubsection{Inputs} This field indicates what logic should be used to activate the individual DemandManagers in the list. \textbf{Sequential} treats the list of DemandManagers as a sequential priority list, i.e., the first DemandManager in the list is activated first, then the second, etc., until the demand falls below the limit. \textbf{All} activates all demand managers to achieve the maximum demand reduction. -\paragraph{Field: Demand Manager Type 1}\label{field-demand-manager-type-1} +\paragraph{Field: Demand Manager \textless{}\#\textgreater{} Type}\label{field-demand-manager-type-1} The key word defining the type of DemandManager. -\paragraph{Field: Demand Manager Name 1}\label{field-demand-manager-name-1} +\paragraph{Field: Demand Manager \textless{}\#\textgreater{} Name}\label{field-demand-manager-name-1} The name of a DemandManager object defined elsewhere in the input file. -DemandManagers are listed by pairs of data items: \emph{Demand Manager Type} and \emph{Demand Manager Name}. Ten managers are accommodated in the list by default. The IDD specification, however, is extensible and additional pairs may be added by directly editing the IDD. +DemandManagers are listed by pairs of data items: \emph{Demand Manager Type} and \emph{Demand Manager Name}. This object is extensible, so additional pairs of these last two fields can be added to the end of this object. An example IDF showing how this object is used is provided below: @@ -218,11 +218,9 @@ \subsubsection{Inputs}\label{inputs-1-009} If the \textbf{RotateOne} or \textbf{RotateMany} option is used for \emph{Selection Control}, this field sets the time interval {[}minutes{]} between rotations. -\paragraph{Field: Exterior Lights 1-10 Name}\label{field-exterior-lights-1-10-name} +\paragraph{Field: Exterior Lights \textless{}\#\textgreater{} Name}\label{field-exterior-lights-1-10-name} -The names of \hyperref[exteriorlights]{Exterior:Lights} objects defined elsewhere in the input file. These are the loads to be limited by this DemandManager. - -Ten objects are accommodated in the list by default. The IDD specification, however, is extensible and additional fields may be added by directly editing the IDD. +The names of \hyperref[exteriorlights]{Exterior:Lights} objects defined elsewhere in the input file. These are the loads to be limited by this DemandManager. This field is extensible, so additional fields of this type can be added to the end of this object. An example IDF showing how this object is used is provided below: @@ -282,11 +280,9 @@ \subsubsection{Inputs}\label{inputs-2-009} If the \textbf{RotateOne} or \textbf{RotateMany} option is used for \emph{Selection Control}, this field sets the time interval {[}minutes{]} between rotations. -\paragraph{Field: Lights 1-10 Name}\label{field-lights-1-10-name} - -The names of \hyperref[lights-000]{Lights} objects defined elsewhere in the input file. These are the loads to be limited by this DemandManager. +\paragraph{Field: Lights \textless{}\#\textgreater{} Name}\label{field-lights-1-10-name} -Ten objects are accommodated in the list by default. The IDD specification, however, is extensible and additional fields may be added by directly editing the IDD. +The names of \hyperref[lights-000]{Lights} objects defined elsewhere in the input file. These are the loads to be limited by this DemandManager. This field is extensible, so additional fields of this type can be added to the end of this object. If a global lights statement is used (Ref: \hyperref[lights-000]{Lights}), then only that name need be entered and the demand limiting will be applied to all the zones for that lighting. If only one of a set of zones from a global lights statement is desired, then the name to be entered is: \textless{}Zone Name\textgreater{} \textless{}Name of \hyperref[lights-000]{Lights} Global Object\textgreater{}. @@ -352,11 +348,9 @@ \subsubsection{Inputs}\label{inputs-3-008} If the \textbf{RotateOne} or \textbf{RotateMany} option is used for \emph{Selection Control}, this field sets the time interval {[}minutes{]} between rotations. -\paragraph{Field: Electric Equipment 1-10 Name}\label{field-electric-equipment-1-10-name} +\paragraph{Field: Electric Equipment \textless{}\#\textgreater{} Name}\label{field-electric-equipment-1-10-name} -The names of \hyperref[electricequipment]{ElectricEquipment} objects defined elsewhere in the input file. These are the loads to be limited by this DemandManager. - -Ten objects are accommodated in the list by default. The IDD specification, however, is extensible and additional fields may be added by directly editing the IDD. +The names of \hyperref[electricequipment]{ElectricEquipment} objects defined elsewhere in the input file. These are the loads to be limited by this DemandManager. This field is extensible, so additional fields of this type can be added to the end of this object. If a global Electric Equipment statement is used (Ref: \hyperref[electricequipment]{ElectricEquipment}), then only that name need be entered and the demand limiting will be applied to all the zones for that equipment. If only one of a set of zones from a global electric equipment statement is desired, then the name to be entered is: \textless{}Zone Name\textgreater{} \textless{}Name of \hyperref[electricequipment]{ElectricEquipment} Global Object\textgreater{}. @@ -422,11 +416,9 @@ \subsubsection{Inputs}\label{inputs-4-007} If the \textbf{RotateOne} or \textbf{RotateMany} option is used for \emph{Selection Control}, this field sets the time interval {[}minutes{]} between rotations. -\paragraph{Field: Thermostat 1-10 Name}\label{field-thermostat-1-10-name} - -The names of \hyperref[zonecontrolthermostat]{ZoneControl:Thermostat} objects defined elsewhere in the input file. These are the loads to be limited by this DemandManager. +\paragraph{Field: Thermostat \textless{}\#\textgreater{} Name}\label{field-thermostat-1-10-name} -Ten objects are accommodated in the list by default. The IDD specification, however, is extensible and additional fields may be added by directly editing the IDD. +The names of \hyperref[zonecontrolthermostat]{ZoneControl:Thermostat} objects defined elsewhere in the input file. These are the loads to be limited by this DemandManager. This field is extensible, so additional fields of this type can be added to the end of this object. If a global thermostat statement is used (Ref: \hyperref[zonecontrolthermostat]{ZoneControl:Thermostat}), then only that name need be entered and the demand limiting will be applied to all the zones for that thermostatic control. If only one of a set of zones from a global thermostat statement is desired, then the name to be entered is: \textless{}Zone Name\textgreater{} \textless{}Name of Thermostat Global Object\textgreater{}. @@ -495,9 +487,9 @@ \subsubsection{Field: Rotation Duration}\label{field-rotation-duration-4} If the \textbf{RotateOne} of \textbf{RotateMany} option is used for \emph{Selection Control}, this field sets the time interval {[}minues{]} between rotations. -\subsubsection{Field: Controller Outdoor Air 1-10 Name}\label{field-controller-outdoor-air-1-10-name} +\subsubsection{Field: Controller Outdoor Air \textless{}\#\textgreater{} Name}\label{field-controller-outdoor-air-x-name} -The names of \hyperref[controlleroutdoorair]{Controller:OutdoorAir} objects defined elsewhere in the input file. These are the ventilation rates to be limited by this demand manager. Then objects are accommodated in the list by default. The IDD specification, however, is extensible and additional fields may be added by directly editing the IDD. +The names of \hyperref[controlleroutdoorair]{Controller:OutdoorAir} objects defined elsewhere in the input file. These are the ventilation rates to be limited by this demand manager. Then objects are accommodated in the list by default. This field is extensible, so additional fields of this type can be added to the end of this object. An example IDF showing how this object is used is provided below: diff --git a/doc/input-output-reference/src/overview/group-electric-load-center-generator.tex b/doc/input-output-reference/src/overview/group-electric-load-center-generator.tex index d562b543600..4dab4d9f2b5 100644 --- a/doc/input-output-reference/src/overview/group-electric-load-center-generator.tex +++ b/doc/input-output-reference/src/overview/group-electric-load-center-generator.tex @@ -30,7 +30,7 @@ \subsection{ElectricLoadCenter:Transformer}\label{electricloadcentertransformer} Energy losses in transformers consist of the no load (core) loss and the load (winding) loss. The no load loss comes primarily from the switching of the magnetic fields in the core material. It is roughly constant and exists continuously in the core material as long as the transformer is energized. The load loss comes from the electrical resistance in the windings when there is a load on the transformer. The load loss is proportional to the load squared with a small temperature correction. The energy losses at a given load depend on the transformer's performance. This object provides the user two alternative ways to indicate the transformer's performance. First, the user can provide the no load loss and load loss at rated conditions. Second, the user can provide the nameplate efficiency and the corresponding reference conditions. The detailed algorithms to calculate the energy losses are described in the Engineering Reference. -The user needs to specify which loads are connected to the transformer. This is achieved in different manners depending on the transformer usage. For a distribution transformer, the user needs to provide a number of electric meters wired to that transformer. The input object can currently accommodate up to ten meters, but it is extensible by modifying the Energy+.idd entry. For a transformer used to output electricity from onsite generators to the grid, the user needs to indicate the transformer name in the served electric load center. +The user needs to specify which loads are connected to the transformer. This is achieved in different manners depending on the transformer usage. For a distribution transformer, the user needs to provide a number of electric meters wired to that transformer. The number of electric meters is extensible, so additional fields of this type can be added to the end of this object. For a transformer used to output electricity from onsite generators to the grid, the user needs to indicate the transformer name in the served electric load center. \subsubsection{Inputs}\label{inputs-014} @@ -102,9 +102,9 @@ \subsubsection{Inputs}\label{inputs-014} This field indicates whether the transformer losses are considered to calculate utility cost. This field applies to a PowerInFromGrid type of transformer. In some cases, the transformer losses are required but they are not part of the energy consumption for utility cost calculation. For example, the transformer is owned by the utility company but it locates in the building. In this case, it might be desired to model transformer energy losses for HVAC operation but the energy losses will not be accounted for utility cost. -\paragraph{Field: Electric Meter 1-10 Name}\label{field-electric-meter-1-10-name} +\paragraph{Field: Electric Meter \textless{}\#\textgreater{} Name}\label{field-electric-meter-1-10-name} -A transformer may serve different loads such as plug loads, some lighting loads, and some HVAC equipment loads. These fields apply to a PowerInFromGrid type of transformer. The user needs to specify which loads are connected to the transformer. For example the HVAC and Plant equipment might use a higher voltage than the building and only the building loads need power conditioning. This is achieved by providing a list of electric meters wired to the transformer. The input object can currently accommodate up to ten meters, but it is extensible by modifying the Energy+.idd entry. Any valid electric meter name can be used here to wire to the transformer loads. Many different meters are automatically generated by the program and will depend on the objects used throughout the input file. The typical process of determining the exact name to enter in this field involves doing an initial run of EnergyPlus and then examining the *.mdd file which will list the meters and their resulting names. A custom meter is also supported. The meter must have electricity as its resource type. +A transformer may serve different loads such as plug loads, some lighting loads, and some HVAC equipment loads. These fields apply to a PowerInFromGrid type of transformer. The user needs to specify which loads are connected to the transformer. For example the HVAC and Plant equipment might use a higher voltage than the building and only the building loads need power conditioning. This is achieved by providing a list of electric meters wired to the transformer. This field is extensible, so additional fields of this type can be added to the end of this object. Any valid electric meter name can be used here to wire to the transformer loads. Many different meters are automatically generated by the program and will depend on the objects used throughout the input file. The typical process of determining the exact name to enter in this field involves doing an initial run of EnergyPlus and then examining the *.mdd file which will list the meters and their resulting names. A custom meter is also supported. The meter must have electricity as its resource type. An example input of the ElectricLoadCenter:Transformer input is: @@ -524,7 +524,7 @@ \subsubsection{Outputs}\label{outputs-1-008} \subsection{ElectricLoadCenter:Generators}\label{electricloadcentergenerators} -The ElectricLoadCenter:Generators object is used to provide a list of the generators to include in the simulation. The list includes the names and types of all the generators along with separate availability schedules, the rated power output, and thermal-to-electrical power ratio for each. Sets of five input fields are repeated for each generator. If more than 30 generators are needed, EnergyPlus will auto-extend to suit the needs but other interfaces (such as the IDF Editor may not). The user can always modify the Energy+.idd file to accommodate the extra fields necessary, but it is likely the next release of EnergyPlus will overwrite any user modifications. +The ElectricLoadCenter:Generators object is used to provide a list of the generators to include in the simulation. The list includes the names and types of all the generators along with separate availability schedules, the rated power output, and thermal-to-electrical power ratio for each. Sets of five input fields are repeated for each generator. This object is extensible, so additional groups of the five inputs for this object can be added to the end of this object. \subsubsection{Inputs}\label{inputs-2-011} diff --git a/doc/input-output-reference/src/overview/group-energy-management-system-ems.tex b/doc/input-output-reference/src/overview/group-energy-management-system-ems.tex index 1a85807f85d..2abe6501c73 100644 --- a/doc/input-output-reference/src/overview/group-energy-management-system-ems.tex +++ b/doc/input-output-reference/src/overview/group-energy-management-system-ems.tex @@ -157,7 +157,7 @@ \subsubsection{Inputs}\label{inputs-2-012} \paragraph{Field: Program Name 2 .. N}\label{field-program-name-2-..-n} -The name of the \hyperref[energymanagementsystemprogram]{EnergyManagementSystem:Program} object that will be the second to run. Additional programs can be listed. The object is automatically extensible to accommodate as many programs as needed. +The name of the \hyperref[energymanagementsystemprogram]{EnergyManagementSystem:Program} object that will be the second to run. Additional programs can be listed. This object is extensible, so additional fields of this type can be added to the end of this object. IDF examples: diff --git a/doc/input-output-reference/src/overview/group-fans.tex b/doc/input-output-reference/src/overview/group-fans.tex index 8df8760a616..15f5db4d24c 100644 --- a/doc/input-output-reference/src/overview/group-fans.tex +++ b/doc/input-output-reference/src/overview/group-fans.tex @@ -124,7 +124,7 @@ \subsubsection{Inputs}\label{inputs-fansysmodel} \paragraph{Field Set: (Speed Flow Fraction, Speed Electric Power Fraction)}\label{fieldset-flow-power-fractions-fansysmodel} -This input object is extensible with a set of two fields for each speed that the fan can take. A field set is pair of values for the flow fraction and electric power fraction at each speed. The sets should be arranged in increasing order so that the flow fractions become larger in subsequent field sets. Typically the highest speed level will match the design maximum and have fractions of 1.0. +A field set is pair of values for the flow fraction and electric power fraction at each speed. The sets should be arranged in increasing order so that the flow fractions become larger in subsequent field sets. Typically the highest speed level will match the design maximum and have fractions of 1.0. This object is extensible, so additional sets of the following two fields can be added to the end of this object. \paragraph{Field: Speed <\#> Flow Fraction}\label{field-speed-flow-fraction-fansysmodel} This is the flow fraction for the fan speed. This value is multiplied by the Design Maximum Air Flow Rate to obtain the flow rate when operating at this speed. diff --git a/doc/input-output-reference/src/overview/group-heating-and-cooling-coils.tex b/doc/input-output-reference/src/overview/group-heating-and-cooling-coils.tex index 5e11c14e2db..53b92b946b3 100644 --- a/doc/input-output-reference/src/overview/group-heating-and-cooling-coils.tex +++ b/doc/input-output-reference/src/overview/group-heating-and-cooling-coils.tex @@ -1348,7 +1348,7 @@ \subsubsection{Outputs}\label{outputs-9-002} \subsection{Coil:Heating:Gas:MultiStage}\label{coilheatinggasmultistage} -The multi stage gas heating coil is a simple capacity model with a user inputted gas burner efficiencies at different stages. This coil will only have air nodes to connect it in the system. The coil can be used in the air loop simulation or in the zone equipment as a reheat coil. Depending on where it is used determines if this coil is temperature or capacity controlled. If used in the air loop simulation it will be controlled to a specified temperature scheduled from the Setpoint Manager. If it is used in zone equipment, it will be controlled from the zone thermostat by meeting the zone demand. For the time being, this coil model can only be called by the parent object \hyperref[airloophvacunitaryheatpumpairtoairmultispeed]{AirLoopHVAC:UnitaryHeatPump:AirToAir:MultiSpeed}. +The multi stage gas heating coil is a simple capacity model with a user inputted gas burner efficiencies at different stages. This coil will only have air nodes to connect it in the system. The coil can be used in the air loop simulation or in the zone equipment as a reheat coil. Depending on where it is used determines if this coil is temperature or capacity controlled. If used in the air loop simulation it will be controlled to a specified temperature scheduled from the Setpoint Manager. If it is used in zone equipment, it will be controlled from the zone thermostat by meeting the zone demand. For the time being, this coil model can only be called by the parent objects \hyperref[airloophvacunitarysystem]{AirLoopHVAC:UnitarySystem} or \hyperref[airloophvacunitaryheatpumpairtoairmultispeed]{AirLoopHVAC:UnitaryHeatPump:AirToAir:MultiSpeed}. \subsubsection{Inputs}\label{inputs-11-005} @@ -3691,9 +3691,9 @@ \subsubsection{Inputs}\label{inputs-19-001} This numeric field defines the volume air flow rate, in m\(^{3}\) per second, across the DX heating coil at rated conditions. The value entered here must be greater than 0. The rated air volume flow rate should be between 0.00004027 m\(^{3}\)/s and 0.00006041 m\(^{3}\)/s per watt of the gross rated heating capacity. The gross rated heating capacity and gross rated COP should be performance information for the unit with outdoor air dry-bulb temperature of 8.33 C, outdoor air wet-bulb temperature of 6.11 C, heating coil entering air dry-bulb temperature of 21.11 C, heating coil entering air wet-bulb temperature of 15.55 C, and the rated air volume flow rate defined here. -\paragraph{Field: Rated Evaporator Fan Power Per Volume Flow Rate}\label{field-rated-evaporator-fan-power-per-volume-flow-rate-1} +\paragraph{Field: Rated Supply Fan Power Per Volume Flow Rate}\label{field-rated-evaporator-fan-power-per-volume-flow-rate-1} -This field is the electric power for the evaporator (heating coil) fan per air volume flow rate through the coil at the rated conditions in W/(m\(^{3}\)/s). The default value is 773.3 W/(m\(^{3}\)/s) (365 W/1000 cfm) if this field is left blank. If a value is entered, it must be \textgreater{} = 0.0 and \textless{} = 1250 W/(m\(^{3}\)/s). This value is only used to calculate High Temperature Heating Standard (Net) Rating Capacity, Low Temperature Heating Standard (Net) Rating Capacity and Heating Seasonal Performance Factor (HSPF) which will be outputs in the EnergyPlus eio file (ref. EnergyPlus Engineering Reference, Single Speed DX Heating Coil, Standard Ratings). This value is not used for modeling the evaporator (heating coil) fan during simulations; instead, it is used for calculating the above standard ratings to assist the user in verifying their inputs for modeling this type of equipment. +This field is the electric power for the heating coil (condenser) fan per air volume flow rate through the coil at the rated conditions in W/(m\(^{3}\)/s). The default value is 773.3 W/(m\(^{3}\)/s) (365 W/1000 cfm) if this field is left blank. If a value is entered, it must be \textgreater{} = 0.0 and \textless{} = 1250 W/(m\(^{3}\)/s). This value is only used to calculate High Temperature Heating Standard (Net) Rating Capacity, Low Temperature Heating Standard (Net) Rating Capacity and Heating Seasonal Performance Factor (HSPF) which will be outputs in the EnergyPlus eio file (ref. EnergyPlus Engineering Reference, Single Speed DX Heating Coil, Standard Ratings). This value is not used for modeling the evaporator (heating coil) fan during simulations; instead, it is used for calculating the above standard ratings to assist the user in verifying their inputs for modeling this type of equipment. \paragraph{Field: Air Inlet Node Name}\label{field-air-inlet-node-name-13} @@ -3818,28 +3818,28 @@ \subsubsection{Inputs}\label{inputs-19-001} Coil:Heating:DX:SingleSpeed, Heat Pump DX Heating Coil 1, ! Name of heating coil - FanAndCoilAvailSched, ! Heating coil schedule - 35000, ! Gross Rated Heating Capacity - 2.75, ! Gross Rated Heating COP - 1.7, !rated air flow rate (m3/s) - , !rated evaporator fan power per volume flow rate (m3/s) - Heating Coil Air Inlet Node, !heating coil air side inlet node - SuppHeating Coil Air Inlet Node, !Heating coil air side outlet node - HPACHeatCapFT, ! heating cap modifier curve (temperature, C) - HPACHeatCapFFF, ! heating cap modifier curve (flow fraction) - HPACHeatEIRFT, ! energy input ratio modifier curve (temperature, C) - HPACHeatEIRFFF, ! energy input ratio modifier curve (flow fraction) - HPACCOOLPLFFPLR, ! part load fraction modifier curve (function of part load ratio) - , ! defrost EIR modifier curve (temp, C) not required for resistive defrost - -5.0, ! minimum OAT for compressor operation (C) - , ! outdoor dry-bulb temperature to turn on compressor (C) - 5.0, ! maximum outdoor dry-bulb temp for defrost operation (C) - 200.0, ! Crankcase heater capacity (W) - 10.0, ! Maximum outdoor temp for crankcase heater operation (C) - Resistive, ! Defrost strategy (resistive or reverse-cycle) - Timed, ! Defrost control (timed or on-demand) - 0.166667, ! Defrost time period fraction (used for timed defrost control only) - 20000;! Resistive defrost heater capacity (used for resistive defrost strategy only) + FanAndCoilAvailSched, ! Heating coil schedule + 35000, ! Gross Rated Heating Capacity + 2.75, ! Gross Rated Heating COP + 1.7, ! Rated air flow rate (m3/s) + , ! Rated supply fan power per volume flow rate (m3/s) + Heating Coil Air Inlet Node, ! Heating coil air side inlet node + SuppHeating Coil Air Inlet Node, ! Heating coil air side outlet node + HPACHeatCapFT, ! Heating cap modifier curve (temperature, C) + HPACHeatCapFFF, ! Heating cap modifier curve (flow fraction) + HPACHeatEIRFT, ! Energy input ratio modifier curve (temperature, C) + HPACHeatEIRFFF, ! Energy input ratio modifier curve (flow fraction) + HPACCOOLPLFFPLR, ! Part load fraction modifier curve (function of part load ratio) + , ! Defrost EIR modifier curve (temp, C) not required for resistive defrost + -5.0, ! Minimum OAT for compressor operation (C) + , ! Outdoor dry-bulb temperature to turn on compressor (C) + 5.0, ! Maximum outdoor dry-bulb temp for defrost operation (C) + 200.0, ! Crankcase heater capacity (W) + 10.0, ! Maximum outdoor temp for crankcase heater operation (C) + Resistive, ! Defrost strategy (resistive or reverse-cycle) + Timed, ! Defrost control (timed or on-demand) + 0.166667, ! Defrost time period fraction (used for timed defrost control only) + 20000; ! Resistive defrost heater capacity (used for resistive defrost strategy only) \end{lstlisting} \subsubsection{Outputs}\label{outputs-15-000} @@ -8324,7 +8324,7 @@ \subsubsection{Inputs}\label{inputs-35} \paragraph{Field: Operation Mode Control Schedule Name}\label{field-operation-mode-control-schedule-name} -This field is used (and required) if the operating model control method is set to ScheduledModes in the previous input field. The control schedule consists of a series of integer values that indicate what mode the TES coil should operate in for a given time period. The values for various operating modes have been programmed to be as follows: +This field is used (and required) if the operating mode control method is set to ScheduledModes in the previous input field. The control schedule consists of a series of integer values that indicate what mode the TES coil should operate in for a given time period. The values for various operating modes have been programmed to be as follows: \begin{enumerate} \def\labelenumi{\arabic{enumi}.} @@ -9196,7 +9196,7 @@ \subsubsection{Field: Zone Name for Condenser Placement}\label{field-zone-name-f NORTH ZONE; !- Zone Name for Condenser Placement \end{lstlisting} -\textbf{Heating Operating Mode}: When a heat pump operates in heating mode then energy is extracted from the secondary zone. Total energy extracted from a secondary zone may contain sensible and latent components. The secondary coil (evaporator) model checks for the coil inlet and outlet air condition to determine if dehumidification has occurred. The sensible and latent split of the energy extracted is done using a user specified rated sensible heat ratio (SHR) and SHR modifier curves for temperature and secondary air flow fraction. If the coil operation is dry, then the SHR is set to 1.0. In addition, the model assumes that condensed water is drained to the outside. If defrosting operation is on, then the defrosting melts the frost and the liquid water from the collecting pan is drained to the outside. Thus, defrosting energy is not included in the zone energy balance. The six optioal input fields required in the DX heating coils are the following. The last five input fields are extensible depending on the speed of the heating DX coil: +\textbf{Heating Operating Mode}: When a heat pump operates in heating mode then energy is extracted from the secondary zone. Total energy extracted from a secondary zone may contain sensible and latent components. The secondary coil (evaporator) model checks for the coil inlet and outlet air condition to determine if dehumidification has occurred. The sensible and latent split of the energy extracted is done using a user specified rated sensible heat ratio (SHR) and SHR modifier curves for temperature and secondary air flow fraction. If the coil operation is dry, then the SHR is set to 1.0. In addition, the model assumes that condensed water is drained to the outside. If defrosting operation is on, then the defrosting melts the frost and the liquid water from the collecting pan is drained to the outside. Thus, defrosting energy is not included in the zone energy balance. The six optioal input fields required in the DX heating coils are the following. This object is extensible by repeating the last five input fields depending on the speed of the heating DX coil: \subsubsection{Field: Zone Name for Evaporator Placement}\label{field-zone-name-for-evaporator-placement-2} diff --git a/doc/input-output-reference/src/overview/group-location-climate-weather-file-access.tex b/doc/input-output-reference/src/overview/group-location-climate-weather-file-access.tex index e977b8c836c..6bdeaf84e06 100644 --- a/doc/input-output-reference/src/overview/group-location-climate-weather-file-access.tex +++ b/doc/input-output-reference/src/overview/group-location-climate-weather-file-access.tex @@ -1265,7 +1265,7 @@ \subsection{Site:GroundDomain:Slab}\label{sitegrounddomainslab} This section documents the input object used to simulate ground coupled heat transfer with horizontal building surfaces within EnergyPlus. Horizontal ground surfaces within EnergyPlus interact with the Site:GroundDomain object by utilizing the \hyperref[surfacepropertyothersideconditionsmodel]{SurfaceProperty:OtherSideConditionsModel} object. By utilizing this object, multiple horizontal surfaces can be coupled to the same Site:GroundDomain object. Each horizontal surface may also have its unique ground domain, however, runtime will be adversely affected. -Generally, there are two scenarios which Site:GroundDomain is equipped to model: in-grade slabs, and on-grade slabs. +Generally, there are two scenarios which Site:GroundDomain is equipped to model: in-grade slabs and on-grade slabs. \begin{figure}[htbp] \centering diff --git a/doc/input-output-reference/src/overview/group-node-branch-management.tex b/doc/input-output-reference/src/overview/group-node-branch-management.tex index 03c98f7547b..5b0f49bd2d3 100644 --- a/doc/input-output-reference/src/overview/group-node-branch-management.tex +++ b/doc/input-output-reference/src/overview/group-node-branch-management.tex @@ -318,7 +318,7 @@ \subsubsection{Inputs}\label{inputs-2-023} \paragraph{Field Set (Branch Specifications)}\label{field-set-branch-specifications} -Following the two introductory items, there are groups of 4 repeated items: a type, a name, inlet and outlet node names. All of these items refer to one particular component on the branch. The first component defined by these items will be the first component on this branch, etc. through the end of the list.~ This object is extensible and can use as many field sets as needed. +Following the two introductory items, there are groups of 4 repeated items: a type, a name, inlet and outlet node names. All of these items refer to one particular component on the branch. The first component defined by these items will be the first component on this branch, etc. through the end of the list.~ This object is extensible and can use as many field sets as needed by repeating the last four fields. \paragraph{Field: Component \textless{}\#\textgreater{} Object Type}\label{field-component-object-type-000} @@ -356,7 +356,7 @@ \subsubsection{Inputs}\label{inputs-2-023} BRANCH, Air Loop Main Branch, !- Branch Name , !- Pressure Drop Curve Name - FAN:SIMPLE:ConstVolume, !- Comp1 Type + FAN:ConstantVolume, !- Comp1 Type Supply Fan 1, !- Comp1 Name Air Loop Inlet Node, !- Comp1 Inlet Node Name Cooling Coil Air Inlet Node, !- Comp1 Outlet Node Name @@ -963,9 +963,9 @@ \subsubsection{Inputs}\label{inputs-9-011} The number of pipe circuit objects which will be defined in the following fields. -\paragraph{Field: Pipe Circuit 1 \{\ldots{} to N; extensible\}}\label{field-pipe-circuit-1-to-n-extensible} +\paragraph{Field: Pipe Circuit \textless{}\#\textgreater{}}\label{field-pipe-circuit-1-to-n-extensible} -A \hyperref[pipingsystemundergroundpipecircuit]{PipingSystem:Underground:PipeCircuit} to be included in this domain.~ This indicates that the pipe circuit and all of the underlying pipe segments will be included during mesh development and heat transfer calculations within this domain.~ Any number of pipe circuits can be added, assuming all underlying pipe segments do not cause any conflicts for the mesh development engine (overlapping pipes, etc.). +A \hyperref[pipingsystemundergroundpipecircuit]{PipingSystem:Underground:PipeCircuit} to be included in this domain.~ This indicates that the pipe circuit and all of the underlying pipe segments will be included during mesh development and heat transfer calculations within this domain.~ This object is extensible, so any number of pipe circuits can be added, assuming all underlying pipe segments do not cause any conflicts for the mesh development engine (overlapping pipes, etc.). \subsection{PipingSystem:Underground:PipeCircuit}\label{pipingsystemundergroundpipecircuit} @@ -1029,9 +1029,9 @@ \subsubsection{Inputs}\label{inputs-10-010} ~The number of pipe segment objects which will be defined in the following fields. -\paragraph{Field: Pipe Segment 1 \{\ldots{} to N; extensible\}}\label{field-pipe-segment-1-to-n-extensible} +\paragraph{Field: Pipe Segment \textless{}\#\textgreater{}}\label{field-pipe-segment-1-to-n-extensible} -~A \hyperref[pipingsystemundergroundpipesegment]{PipingSystem:Underground:PipeSegment} to be included in this pipe circuit.~ The circuit is set up so that flow passes through the \emph{N} segments in the order they are entered here. +~A \hyperref[pipingsystemundergroundpipesegment]{PipingSystem:Underground:PipeSegment} to be included in this pipe circuit.~ The circuit is set up so that flow passes through the \emph{N} segments in the order they are entered here. This object is extensible, so additional fields of this type can be added to the end of this object. \subsection{PipingSystem:Underground:PipeSegment}\label{pipingsystemundergroundpipesegment} diff --git a/doc/input-output-reference/src/overview/group-plant-condenser-control.tex b/doc/input-output-reference/src/overview/group-plant-condenser-control.tex index a1670e83a2c..eb038a1124a 100644 --- a/doc/input-output-reference/src/overview/group-plant-condenser-control.tex +++ b/doc/input-output-reference/src/overview/group-plant-condenser-control.tex @@ -269,7 +269,7 @@ \subsubsection{Inputs}\label{inputs-10-012} \subsection{PlantEquipmentOperation:OutdoorDewpointDifference}\label{plantequipmentoperationoutdoordewpointdifference} -The Delta Temperature based control strategies help to control any condenser equipment based on the difference between a reference node temperature and any environmental temperature. For example a cooling tower can be controlled by a strategy, which looks at the difference between the tower inlet temperature and wet-bulb temperature. A difference range is specified for each equipment list. IDD excerpts are shown below: +The Delta Temperature based control strategies help to control any condenser equipment based on the difference between a reference node temperature and any environmental temperature. For example a cooling tower can be controlled by a strategy, which looks at the difference between the tower inlet temperature and wet-bulb temperature. A difference range is specified for each equipment list. \subsubsection{Inputs}\label{inputs-11-011} diff --git a/doc/input-output-reference/src/overview/group-radiative-convective-units.tex b/doc/input-output-reference/src/overview/group-radiative-convective-units.tex index 5cefee69d58..8457341ff1e 100644 --- a/doc/input-output-reference/src/overview/group-radiative-convective-units.tex +++ b/doc/input-output-reference/src/overview/group-radiative-convective-units.tex @@ -288,7 +288,7 @@ \subsubsection{Inputs}\label{inputs-1-035} This field is paired with the preceding surface name (previous field) to define the fraction of radiant heat transfer leaving the baseboard heater that is incident on a particular surface. Users should take into account the directionality of baseboard heaters and their location when defining the value for this input field. -\paragraph{Note on Fraction of Radiant Energy Incident on People and to Surfaces}\label{note-on-fraction-of-radiant-energy-incident-on-people-and-to-surfaces} +\textbf{\emph{Note on Fraction of Radiant Energy Incident on \hyperref[people]{People} and to Surfaces}} The radiant energy from the baseboard heater is defined by the total energy input to the baseboard heater from the steam loop times the fraction radiant field shown above. This radiant energy is distributed to surfaces and people using the surface and fraction pairs and the fraction to people input by the user. These fractions to people and surfaces must add up to 1.0. In other words, in an input file, the following relation should be maintained by the user input: @@ -493,7 +493,7 @@ \subsubsection{Inputs}\label{inputs-2-032} This field is paired with the preceding surface name (previous field) to define the fraction of radiant heat transfer leaving the baseboard heater that is incident on a particular surface. Users should take into account the directionality of baseboard heaters and their location when defining the value for this input field. -\paragraph{Note on Fraction of Radiant Energy Incident on People and to Surfaces}\label{note-on-fraction-of-radiant-energy-incident-on-people-and-to-surfaces-1} +\textbf{\emph{Note on Fraction of Radiant Energy Incident on \hyperref[people]{People} and to Surfaces}} The radiant energy from the baseboard heater is defined by the total energy input to the baseboard heater times the fraction radiant field shown above. This radiant energy is distributed to surfaces and people using the surface and fraction pairs and the fraction to people input by the user. These fractions to people and surfaces must add up to 1.0. In other words, in an input file, the following relation should be maintained by the user input: @@ -742,6 +742,8 @@ \subsubsection{Inputs}\label{inputs-3-028-1} 0.25; !- Fraction of Radiant Energy to Surface 3 \end{lstlisting} +\subsubsection{Outputs}\label{outputs-radiant-convective-cooling-panel} + \begin{itemize} \item HVAC, Average, Cooling Panel Total System Cooling Rate [W] @@ -1041,7 +1043,7 @@ \subsection{ZoneHVAC:LowTemperatureRadiant:VariableFlow}\label{zonehvaclowtemper This low temperature radiant system (hydronic) is a component of zone equipment that is intended to model any ``radiant system'' where water is used to supply/remove energy to/from a building surface (wall, ceiling, or floor). The component is controlled to meet any remaining zone load not met by other equipment in the zone that have higher priority. The control is accomplished by throttling the hot or chilled water flow to the unit. Note that this system will only control based on the radiant system controls defined by this input syntax and not via a zone thermostat such as is used for forced air systems. Note also that because this unit does not require a thermostat that in cases where no other systems are serving the zone in which this system resides that it will use the heating equipment priority to determine which system will run first.~ If the radiant system is serving a zone with forced air equipment, the radiant system will follow the priority order established by the zone thermostat but will still base its response on the controls defined by the user for the radiant system. -This model covers a wide range of low temperature radiant systems: heating and/or cooling, panel or embedded pipes, etc. It is not intended to simulate high temperature electric or gas radiant heaters. Those devices will be handled by a separate model and different input syntax. Low temperature radiant systems that use electric resistance heating should also be defined using separate input syntax (ref: \hyperref[zonehvaclowtemperatureradiantelectric]{ZoneHVAC:LowTemperatureRadiant:Electric}). +This model covers a wide range of low temperature radiant systems: heating and/or cooling, panel or embedded pipes, etc. It is not intended to simulate high temperature electric or gas radiant heaters. Those devices will be handled by a separate model and different input syntax. Low temperature radiant systems that use electric resistance heating should also be defined using separate input syntax (ref: \hyperref[zonehvaclowtemperatureradiantelectric]{ZoneHVAC:LowTemperatureRadiant:Electric}). The key characteristic of this variable flow low temperature radiant system is that the actual fluid flow rate being supplied to the radiant system changes as conditions within the zone change. While the fluid temperature is determined by the plant loops defined by other user input, this type of radiant system will control fluid flow in an attempt to meet the remaining zone heating or cooling load based on the controls outlined below. Low temperature radiant systems that vary the inlet temperature while keeping the fluid flow rate through the radiant system constant should also be defined using separate input syntax (ref: \hyperref[zonehvaclowtemperatureradiantconstantflow]{ZoneHVAC:LowTemperatureRadiant:ConstantFlow}). \subsubsection{Inputs}\label{inputs-5-022} @@ -1363,9 +1365,9 @@ \subsection{ZoneHVAC:LowTemperatureRadiant:ConstantFlow}\label{zonehvaclowtemper This low temperature radiant system (hydronic) is a component of zone equipment that is intended to model any ``radiant system'' where water is used to supply/remove energy to/from a building surface (wall, ceiling, or floor). The component is controlled via control schedules as described in the syntax below and does not require a zone thermostat. Note that because this unit does not require a thermostat that in cases where no other systems are serving the zone in which this system resides that it will use the heating equipment priority to determine which system will run first.~ If the radiant system is serving a zone with forced air equipment, the radiant system will follow the priority order established by the zone thermostat but will still base its response on the controls defined by the user for the radiant system. -The constant flow system differs from the hydronic system describe above in what it controls. The hydronic system varies the flow rate through the radiant system based on some control temperature. The constant flow system keeps flow rate constant via a local circulation pump and varies the water temperature that is sent to the radiant system. This is accomplished with a mixing valve that is controlled by a sensor. This model covers a wide range of low temperature radiant systems: heating and/or cooling, panel or embedded pipes, etc. It is not intended to simulate high temperature electric or gas radiant heaters. Those devices will be handled by a separate model and different input syntax. Low temperature radiant systems that use electric resistance heating should also be defined using separate input syntax (ref: \hyperref[zonehvaclowtemperatureradiantelectric]{ZoneHVAC:LowTemperatureRadiant:Electric}). Low temperature radiant systems that vary the flow rate through the radiant system should also be defined using separate input syntax (ref: \hyperref[zonehvaclowtemperatureradiantvariableflow]{ZoneHVAC:LowTemperatureRadiant:VariableFlow}) +The constant flow system differs from the variable flow system describe above in what it controls. The variable flow system varies the flow rate through the radiant system based on some control temperature. The constant flow system keeps flow rate through the radiant system constant. In order to meet the zone load, the constant flow system will varies the water temperature that is sent to the radiant system. This is accomplished with a mixing valve that is controlled by a sensor and a local recirculation pump. This model covers a wide range of low temperature radiant systems: heating and/or cooling, panel or embedded pipes, etc. It is not intended to simulate high temperature electric or gas radiant heaters. Those devices will be handled by a separate model and different input syntax. Low temperature radiant systems that use electric resistance heating should also be defined using separate input syntax (ref: \hyperref[zonehvaclowtemperatureradiantelectric]{ZoneHVAC:LowTemperatureRadiant:Electric}). Low temperature radiant systems that vary the flow rate through the radiant system should also be defined using separate input syntax (ref: \hyperref[zonehvaclowtemperatureradiantvariableflow]{ZoneHVAC:LowTemperatureRadiant:VariableFlow}). -One of the other differences between this model and the variable flow hydronic radiant system is that the constant flow radiant system has a built-in local secondary loop. It will recirculate flow coming out of the system and mix this with flow from the loop to arrive at the desired inlet temperature to the radiant system (note that this model has the temperature sensor AFTER the pump to insure proper inlet temperature to the radiant system). The local loop also contains a pump which is assumed to be upstream of the radiant system and after the mixing valve. So, the local loop can have some recirculation. The flow from the main loop may also bypass the radiant system if more than enough flow is available and the main loop is also a constant flow system. +One of the other differences between this model and the variable flow low temperature radiant system is that the constant flow system has a built-in local secondary loop. It will recirculate flow coming out of the system and mix this with flow from the loop to arrive at the desired inlet temperature to the radiant system (note that this model has the temperature sensor AFTER the pump to insure proper inlet temperature to the radiant system). The local loop also contains a pump which is assumed to be upstream of the radiant system and after the mixing valve. So, the local loop can have some recirculation. The flow from the main loop may also bypass the radiant system if more than enough flow is available and the main loop is also a constant flow system. \subsubsection{Inputs}\label{inputs-6-019} @@ -1902,7 +1904,7 @@ \subsubsection{Inputs}\label{inputs-8-017} \paragraph{Field Set: Surface Name, Flow Fraction to Surface}\label{field-set-surface-name-flow-fraction-to-surface} -The pairs of Surface Name, Flow Fraction to Surface are used in several objects. There can be up to 10 specified. The object is extensible so more can be added. +The pairs of Surface Name, Flow Fraction to Surface are used in several objects. There can be up to 10 specified. This object is extensible, so additional pairs of these fields can be added to the end of this object. \paragraph{Field: Surface \textless{}x\textgreater{} Name}\label{field-surface-x-name-2} diff --git a/doc/input-output-reference/src/overview/group-refrigeration.tex b/doc/input-output-reference/src/overview/group-refrigeration.tex index 15f39dbaf3b..6e6b39f72ec 100644 --- a/doc/input-output-reference/src/overview/group-refrigeration.tex +++ b/doc/input-output-reference/src/overview/group-refrigeration.tex @@ -945,7 +945,7 @@ \subsubsection{Inputs}\label{inputs-2-033} \paragraph{Field: Case or WalkIn or Air Chiller \textless{}x\textgreater{} Name}\label{field-case-or-walkin-or-air-chiller-x-name} -Identifies a particular refrigerated case or walk-in. The name will be validated against the~ Refrigeration Case, Refrigeration WalkIn, and Air Chiller names (ref: \hyperref[refrigerationcase]{Refrigeration:Case},~ \hyperref[refrigerationwalkin]{Refrigeration:WalkIn}, and \hyperref[refrigerationairchiller]{Refrigeration:AirChiller}) in the input file. Up to 20 are provided in the IDD; this object is extensible. +Identifies a particular refrigerated case or walk-in. The name will be validated against the~ Refrigeration Case, Refrigeration WalkIn, and Air Chiller names (ref: \hyperref[refrigerationcase]{Refrigeration:Case},~ \hyperref[refrigerationwalkin]{Refrigeration:WalkIn}, and \hyperref[refrigerationairchiller]{Refrigeration:AirChiller}) in the input file. This object is extensible, so additional fields of this type can be added to the end of this object. The following is an example input for a CaseAndWalkInList. @@ -1055,7 +1055,7 @@ \subsubsection{Field: Insulated Floor U-Value}\label{field-insulated-floor-u-val The floor themal transmittance (in W/m\(^{2}\)-K). This value has a default value of 0.3154. (This corresponds to R18 in Archaic American Insulation Units.~ To convert other R-values to thermal transmittance, divide 5.678 by the R-value.~ For example, R15 is 0.3785 W/m\(^{2}\)-K and R5 is 1.136 W/m\(^{2}\)-K.) -\textbf{\emph{THE REMAINING 12 FIELDS FOR THE WALK-IN COOLER MUST BE REPEATED FOR EACH ZONE WHICH IS IN CONTACT WITH A WALK-IN WALL, CEILING, OR DOOR. The IDD includes fields for 3 zones, but can be extended by repeating the last 12 values in the object.}} +\textbf{\emph{THE REMAINING 12 FIELDS FOR THE WALK-IN COOLER MUST BE REPEATED FOR EACH ZONE WHICH IS IN CONTACT WITH A WALK-IN WALL, CEILING, OR DOOR. This object is extensible, so additional fields of this type can be added to the end of this object by repeating the last 12 fields in the object.}} \subsubsection{Field: Zone \textless{}x\textgreater{} Name}\label{field-zone-x-name} @@ -2345,7 +2345,7 @@ \subsubsection{Outputs}\label{outputs-4-013} \subsection{Refrigeration:CompressorList}\label{refrigerationcompressorlist} -This object provides a list of all the compressors included within a single refrigeration system (Ref: \hyperref[refrigerationsystem]{Refrigeration:System}). Each list must contain at least one compressor. The order in which the individual compressors are listed here will be the order in which the compressors are dispatched to meet the system load.~ That is, at very low loads, only compressor \#1 will be operating.~ As the load increases, the first two compressors will be operating, and so on. This list is extensible. +This object provides a list of all the compressors included within a single refrigeration system (Ref: \hyperref[refrigerationsystem]{Refrigeration:System}). Each list must contain at least one compressor. The order in which the individual compressors are listed here will be the order in which the compressors are dispatched to meet the system load.~ That is, at very low loads, only compressor \#1 will be operating.~ As the load increases, the first two compressors will be operating, and so on. \subsubsection{Inputs}\label{inputs-6-020} @@ -2355,7 +2355,7 @@ \subsubsection{Inputs}\label{inputs-6-020} \paragraph{Field: Refrigeration Compressor \textless{}x\textgreater{} Name}\label{field-refrigeration-compressor-x-name} -Identifies a particular compressor that works in conjunction with the other compressors on this list to provides cooling to a single refrigeration system. The name will be validated against the compressor names (ref: \hyperref[refrigerationcompressor]{Refrigeration:Compressor}) in the input file. Up to 20 are available in the IDD; this object is extensible. +Identifies a particular compressor that works in conjunction with the other compressors on this list to provides cooling to a single refrigeration system. The name will be validated against the compressor names (ref: \hyperref[refrigerationcompressor]{Refrigeration:Compressor}) in the input file. This object is extensible, so additional fields of this type can be added to the end of this object. The following is an example input for a compressor list. @@ -3478,11 +3478,9 @@ \subsubsection{Inputs}\label{inputs-13-011} A unique user-assigned name for an instance of a refrigeration transfer load list. Any reference to this list by another object will use this name. In particular, the primary refrigeration system absorbing the heat from all the loads listed here will use this name to reference those loads. -\paragraph{Field: Cascade Condenser Name or Secondary System Name}\label{field-cascade-condenser-name-or-secondary-system-name} +\paragraph{Field: Cascade Condenser Name or Secondary System \textless{}x\textgreater{} Name}\label{field-cascade-condenser-name-or-secondary-system-name} -Identifies a cascade condenser or secondary loop that is cooled, along with the other transfer loads listed here, by a single system. The name will be validated against the \hyperref[refrigerationsecondarysystem]{Refrigeration:SecondarySystem} and \hyperref[refrigerationcondensercascade]{Refrigeration:Condenser:Cascade} names in the input file (the name will also be compared against all the other condenser names, but an error will be issued if it refers to any type of condenser other than a cascade condenser). - -The list is extensible; ten fields are provided in the IDD. +Identifies a cascade condenser or secondary loop that is cooled, along with the other transfer loads listed here, by a single system. The name will be validated against the \hyperref[refrigerationsecondarysystem]{Refrigeration:SecondarySystem} and \hyperref[refrigerationcondensercascade]{Refrigeration:Condenser:Cascade} names in the input file (the name will also be compared against all the other condenser names, but an error will be issued if it refers to any type of condenser other than a cascade condenser). This object is extensible, so additional fields of this type can be added to the end of this object. The following is an example input for a transfer load list. diff --git a/doc/input-output-reference/src/overview/group-room-air-models.tex b/doc/input-output-reference/src/overview/group-room-air-models.tex index 37be1a336d4..1db9af4809f 100644 --- a/doc/input-output-reference/src/overview/group-room-air-models.tex +++ b/doc/input-output-reference/src/overview/group-room-air-models.tex @@ -282,7 +282,7 @@ \subsubsection{Inputs}\label{inputs-4-028} \paragraph{Field Set Zeta and Temperature Difference}\label{field-set-zeta-and-temperature-difference} -The remaining fields contain pairs of values that define a lookup table for the temperature pattern in the vertical direction. The first value is Zeta and the second value is DeltaTai. This object is extensible, by duplicating the last two fields and revising the IDD -- note that you will have to replace ``inner'' semi-colons with commas. +The remaining fields contain pairs of values that define a lookup table for the temperature pattern in the vertical direction. The first value is Zeta and the second value is DeltaTai. \paragraph{Field: Pair \textless{}\#\textgreater{} Zeta non-dimensional Height}\label{field-pair-zeta-non-dimensional-height} @@ -292,7 +292,7 @@ \subsubsection{Inputs}\label{inputs-4-028} DeltaT\(_{ai}\) is the temperature difference between the air temperature at the associated Zeta (T\(_{ai}\)) and the mean air temperature and is given in degrees Celsius. -An example of this object corresponding to the figure above is: +This object is extensible, so additional pairs of these last two fields of this type can be added to the end of this object. An example of this object corresponding to the figure above is: \begin{lstlisting} RoomAir:TemperaturePattern:NondimensionalHeight, @@ -347,7 +347,7 @@ \subsubsection{Inputs}\label{inputs-5-025} \paragraph{Fields (6 and on): Pairs of Surface Names and Temperature Differences}\label{fields-6-and-on-pairs-of-surface-names-and-temperature-differences} -The remaining fields contain pairs that define a lookup table for the temperature pattern on a surface-by-surface basis. This object is extensible, by duplicating the last two fields and revising the IDD -- note that you will have to replace ``inner'' semi-colons with commas. +The remaining fields contain pairs that define a lookup table for the temperature pattern on a surface-by-surface basis. \paragraph{Field: Surface Name Pair \textless{}\#\textgreater{}}\label{field-surface-name-pair} @@ -357,7 +357,7 @@ \subsubsection{Inputs}\label{inputs-5-025} DeltaT\(_{ai}\) is the temperature difference between the air temperature adjacent to the associated surface (T\(_{ai}\)) and the mean air temperature and is given in degrees Celsius. -An example of this object, which might be used to elevate temperatures near west windows in the afternoon, is: +This object is extensible, so additional pairs of fields of these types can be added to the end of this object. An example of this object, which might be used to elevate temperatures near west windows in the afternoon, is: \begin{lstlisting} @@ -1194,13 +1194,13 @@ \subsection{RoomAir:Node:AirflowNetwork:AdjacentSurfaceList}\label{roomairnodeai This object is used to provide a list of connected adjacent surfaces with convective heat transfer between surfaces and this particular node. When a moisture mode is assigned to surfaces, convective moisture transfer will be calculated. It should be pointed out that a fraction of a surface exposed to this particular node is not allowed. -\subsubsection{Field: Name}\label{field-name-9-015} +\paragraph{Field: Name}\label{field-name-9-015} This is a unique character string associated with this instance of the Room\-Air\-:Node:\-Airflow\-Network:\-Adjacent\-Surface\-List object. -\subsubsection{Field: Surface x Name}\label{field-surface-x-name-000} +\paragraph{Field: Surface \textless{}\#\textgreater{} Name}\label{field-surface-x-name-000} -The field specifies a surface name based on the order from 1 to 21. The maximum number of surfaces can be extensible. +The field specifies a surface name. This object is extensible, so additional fields of this type can be added to the end of this object. \begin{lstlisting} @@ -1219,18 +1219,20 @@ \subsubsection{Inputs}\label{inputs-14-012} This is a unique character string associated with this instance of the Room\-Air:\-Node:\-Air\-flow\-Net\-work:\-Internal\-Gains object. -\paragraph{Field: Internal Gain Object x Type}\label{field-internal-gain-object-x-type} +\paragraph{Field: Internal Gain Object \textless{}\#\textgreater{} Type}\label{field-internal-gain-object-x-type} -The field specifies an internal gain object type based on the list in the Energy+. +The field specifies an internal gain object type based on the list in EnergyPlus. -\paragraph{Field: Internal Gain Object x Name}\label{field-internal-gain-object-x-name} +\paragraph{Field: Internal Gain Object \textless{}\#\textgreater{} Name}\label{field-internal-gain-object-x-name} -The field specifies an internal gain object name based on the list in the Energy+. +The field specifies an internal gain object name based on the list in EnergyPlus. -\paragraph{Field: Fraction of Gains to Node x}\label{field-fraction-of-gains-to-node-x} +\paragraph{Field: Fraction of Gains to Node \textless{}\#\textgreater{}}\label{field-fraction-of-gains-to-node-x} The field specifies a fraction of the particular internal gain object assigned to this node. +This object is extensible, so additional groups of these last three fields can be added to the end of this object. + \begin{lstlisting} RoomAir:Node:AirflowNetwork:InternalGains, CentralUpper_Gain, !- Name @@ -1245,8 +1247,6 @@ \subsubsection{Inputs}\label{inputs-14-012} 0.15; !- Fraction of Gains to Node 3 \end{lstlisting} -\{Field set: 3 fields (Internal Gain Object x Type, Internal Gain Object x Name, and Fraction of Gains to Node x). are extensible.\} - \subsection{RoomAir:Node:AirflowNetwork:HVACEquipment}\label{roomairnodeairflownetworkhvacequipment} This object is used to define a list of HVAC equipment objects in the same zone and associated fractions assigned to this particular node. @@ -1257,22 +1257,24 @@ \subsubsection{Inputs}\label{inputs-15-012} This is a unique character string associated with this instance of the Room\-Air:\-Node:\-Air\-flow\-Net\-work:\-HVAC\-Equipment object. -\paragraph{Field: ZoneHVAC or Air Terminal Equipment Object Type x}\label{field-zonehvac-or-air-terminal-equipment-object-type-x} +\paragraph{Field: ZoneHVAC or Air Terminal Equipment Object Type \textless{}\#\textgreater{}}\label{field-zonehvac-or-air-terminal-equipment-object-type-x} The field specifies an object type of ZoneHVAC equipment or terminal type based on the list in the Energy+.idd. -\paragraph{Field: ZoneHVAC or Air Terminal Equipment Object Name x}\label{field-zonehvac-or-air-terminal-equipment-object-name-x} +\paragraph{Field: ZoneHVAC or Air Terminal Equipment Object Name \textless{}\#\textgreater{}}\label{field-zonehvac-or-air-terminal-equipment-object-name-x} The field specifies the object name based on the object type defined in the previous field. -\paragraph{Field: Fraction of Output or Supply Air from HVAC Equipment x}\label{field-fraction-of-output-or-supply-air-from-hvac-equipment-x} +\paragraph{Field: Fraction of Output or Supply Air from HVAC Equipment \textless{}\#\textgreater{}}\label{field-fraction-of-output-or-supply-air-from-hvac-equipment-x} The field specifies a fraction of supply air from the particular equipment to this node. -\paragraph{Field: Fraction of Input or Return Air from HVAC Equipment x}\label{field-fraction-of-input-or-return-air-from-hvac-equipment-x} +\paragraph{Field: Fraction of Input or Return Air from HVAC Equipment \textless{}\#\textgreater{}}\label{field-fraction-of-input-or-return-air-from-hvac-equipment-x} The field specifies a fraction of return air from the particular equipment to this node. +This object is extensible, so additional groups fields of these last four fields can be added to the end of this object. + \begin{lstlisting} RoomAir:Node:AirflowNetwork:HVACEquipment, @@ -1283,8 +1285,6 @@ \subsubsection{Inputs}\label{inputs-15-012} 0.14; !- Fraction of Input or Return Air to HVAC Equipment 1 \end{lstlisting} -\{Field set: 4 fields (ZoneHVAC or Air Terminal Equipment Object Type x, ZoneHVAC or Air Terminal Equipment Object Name x, Fraction of Output or Supply Air from HVAC Equipment x, and Fraction of Input or Return Air from HVAC Equipment x) are extensible.\} - \subsubsection{Outputs}\label{outputs-1-023} Each room air model sets up outputs specific to that model. The effect of room air modeling is usually to adjust the adjacent air temperature along the inside surface of heat transfer surfaces. The output report ``Surface Int Adjacent Air Temperature {[}C{]}'' is provided for this and described under Surface Outputs. diff --git a/doc/input-output-reference/src/overview/group-schedules.tex b/doc/input-output-reference/src/overview/group-schedules.tex index 63fc619f41c..cea6bccc0a5 100644 --- a/doc/input-output-reference/src/overview/group-schedules.tex +++ b/doc/input-output-reference/src/overview/group-schedules.tex @@ -138,7 +138,7 @@ \subsubsection{Inputs}\label{inputs-2-036} \paragraph{Field-Set: Time and Value (extensible object)}\label{field-set-time-and-value-extensible-object} -To specify each interval, both an ``until'' time (which includes the designated time) and the value must be given. +To specify each interval, both an ``until'' time (which includes the designated time) and the value must be given. This object is extensible, so additional pairs of the following two fields can be added to the end of this object. \paragraph{Field: Time}\label{field-time} diff --git a/doc/input-output-reference/src/overview/group-simulation-parameters.tex b/doc/input-output-reference/src/overview/group-simulation-parameters.tex index 5ad8c6cb581..52dc18a3502 100644 --- a/doc/input-output-reference/src/overview/group-simulation-parameters.tex +++ b/doc/input-output-reference/src/overview/group-simulation-parameters.tex @@ -624,8 +624,7 @@ \subsubsection{Inputs}\label{inputs-10-019} This fields specifies during shading calculation, for all surfaces in a targeted Zone Group, whether or not (\textbf{Yes} or \textbf{No} ) the self-shading effect from all exterior surfaces in the target Zone Group to other zones is disabled. If Yes, self-shading will be disabled from all exterior surfaces in a given Shading Zone Group to all other zones in the model. If both Disable Self-Shading Within Shading Zone Groups and Disable Self-Shading From Shading Zone Groups to Other Zones = Yes, then all self-shading from exterior surfaces will be disabled. If only one of these fields = Yes, then at least one Shading Zone Group must be specified, or this field will be ignored. Shading from Shading:* surfaces, overhangs, fins, and reveals will not be disabled. \paragraph{Field: Shading Zone Group ZoneList Name}\label{field-shading-zone-group-zoneList-name} -The shading zones group specifies group of zones which are controlled by the Disable Self-Shading fields. -This field is extensible. +The shading zones group specifies group of zones which are controlled by the Disable Self-Shading fields. This object is extensible, so additional fields of this type can be added to the end of this object. Examples of this object in IDF: (note this object must be unique in an IDF) diff --git a/doc/input-output-reference/src/overview/group-solar-collectors.tex b/doc/input-output-reference/src/overview/group-solar-collectors.tex index cd18d0b8cc5..53b363ac260 100644 --- a/doc/input-output-reference/src/overview/group-solar-collectors.tex +++ b/doc/input-output-reference/src/overview/group-solar-collectors.tex @@ -656,7 +656,7 @@ \subsubsection{System Availability Manager List Example}\label{system-availabili Differential Thermostat Availability Manager, !- Name Collector Outlet Node, !- Hot Node Name Water Heater Source Outlet Node, !- Cold Node Name - 10.0, !- Temperature Difference On Limit (delta C) + .0, !- Temperature Difference On Limit (delta C) 2.0; !- Temperature Difference Off Limit (delta C) \end{lstlisting} @@ -666,7 +666,7 @@ \subsection{SolarCollector:UnglazedTranspired}\label{solarcollectorunglazedtrans This object is used to model unglazed transpired solar collectors (UTSC) used to condition outdoor air. These collectors are generally used to heat air drawn through perforated absorbers that are heated by the sun and also recover heat conducted out through the underlying wall. The SolarCollector:UnglazedTranspired object represents a single collector attached to one or more \hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed} objects and to one or more outdoor air systems. Therefore the transpired collector is part of both the thermal envelope and the HVAC system. An example file is provided called TranspiredCollectors.idf. -The area and orientation of the collector is obtained from \hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed} objects, which are referenced by name. Although the collector surface itself is slightly detached from the underlying building wall (or roof), no additional surface object is needed to represent the collector itself. When modeling transpired collectors, it is important to consider the size of the collector when developing the building model's \hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed} objects because the underlying surfaces must match the collector. For example, if the collector covers only part of the wall, then that wall should be split into separate surfaces where one matches the size of the collector. A single collector can be associated with as many \hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed} objects as desired (although if you need to use more than 10 surfaces, then the IDD will need to be extended). The collector can be arranged at any tilt angle by describing the surfaces appropriately. The surfaces need not be contiguous nor have the same orientation, but the program will issue warnings if surfaces have widely ranging tilts and azimuths. +The area and orientation of the collector is obtained from \hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed} objects, which are referenced by name. Although the collector surface itself is slightly detached from the underlying building wall (or roof), no additional surface object is needed to represent the collector itself. When modeling transpired collectors, it is important to consider the size of the collector when developing the building model's \hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed} objects because the underlying surfaces must match the collector. For example, if the collector covers only part of the wall, then that wall should be split into separate surfaces where one matches the size of the collector. A single collector can be associated with as many \hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed} objects as desired since this object is extensible. The collector can be arranged at any tilt angle by describing the surfaces appropriately. The surfaces need not be contiguous nor have the same orientation, but the program will issue warnings if surfaces have widely ranging tilts and azimuths. The collector conditions outdoor air and is connected to the outdoor air system using the usual method of specifying node names. Using the UTSC model requires specifying a relatively complete HVAC air system that includes an outdoor air path. This will typically require using a set of objects that, at a minimum, will include: \hyperref[airloophvaccontrollerlist]{AirLoopHVAC:ControllerList}, \hyperref[airloophvacoutdoorairsystemequipmentlist]{AirLoopHVAC:OutdoorAirSystem:EquipmentList}, \hyperref[airloophvacoutdoorairsystem]{AirLoopHVAC:OutdoorAirSystem}, \hyperref[outdoorairnodelist]{OutdoorAir:NodeList}, \hyperref[outdoorairmixer]{OutdoorAir:Mixer}, \hyperref[setpointmanagermixedair]{SetpointManager:MixedAir}, and \hyperref[controlleroutdoorair]{Controller:OutdoorAir}. A single UTSC can serve more than one outdoor air system but requires also using a separate object, called \hyperref[solarcollectorunglazedtranspiredmultisystem]{SolarCollector:UnglazedTranspired:Multisystem} to specify node connections. @@ -807,7 +807,7 @@ \subsubsection{Inputs}\label{inputs-6-026} \paragraph{Field: Surface \textless{}\#\textgreater{} Name}\label{field-surface-name-3-001} -The remaining fields are used to name the \hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed} objects that are associated with the UTSC. These are the underlying heat transfer surfaces and are defined elsewhere in the input file. These other surfaces should all specify OtherSideConditionsModel as their exterior environment. The input object can currently accommodate up to ten surfaces, but it is extensible. +The remaining fields are used to name the \hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed} objects that are associated with the UTSC. These are the underlying heat transfer surfaces and are defined elsewhere in the input file. These other surfaces should all specify OtherSideConditionsModel as their exterior environment. This object is extensible, so additional fields of this type can be added to the end of this object. An example of this object follows. @@ -950,7 +950,7 @@ \subsubsection{Outputs}\label{outputs-4-015} \subsection{SolarCollector:UnglazedTranspired:Multisystem}\label{solarcollectorunglazedtranspiredmultisystem} -This object is used to model unglazed transpired solar collectors (UTSC) that are connected to multiple outdoor air systems. This object supplements the \hyperref[solarcollectorunglazedtranspired]{SolarCollector:UnglazedTranspired} object and is only necessary if more than one air system is connected to a single transpired collector. After the name field, there are sets of four node names used to define the connections of each air system. Each set contains node names for inlet, outlet, control, and zone. If more than five air systems are needed, this object is extensible. +This object is used to model unglazed transpired solar collectors (UTSC) that are connected to multiple outdoor air systems. This object supplements the \hyperref[solarcollectorunglazedtranspired]{SolarCollector:UnglazedTranspired} object and is only necessary if more than one air system is connected to a single transpired collector. After the name field, there are sets of four node names used to define the connections of each air system. Each set contains node names for inlet, outlet, control, and zone. \subsubsection{Field: Solar Collector Name}\label{field-solar-collector-name} @@ -958,7 +958,7 @@ \subsubsection{Field: Solar Collector Name}\label{field-solar-collector-name} \subsubsection{Field Set: Inlet Node, Outlet Node, Mixed Air Node, Zone Node}\label{field-set-inlet-node-outlet-node-mixed-air-node-zone-node} -The following four fields form a repeating set of four fields. One set is used for each outdoor air system that is connected to the collector. +This object is extensible, so the following four fields can be repeated as needed. One set is used for each outdoor air system that is connected to the collector. \subsubsection{Field: Outdoor Air System \textless{}\#\textgreater{} Collector Inlet Node}\label{field-outdoor-air-system-collector-inlet-node} diff --git a/doc/input-output-reference/src/overview/group-surface-construction-elements.tex b/doc/input-output-reference/src/overview/group-surface-construction-elements.tex index c6ef7e1920d..5ff6c11fdf1 100644 --- a/doc/input-output-reference/src/overview/group-surface-construction-elements.tex +++ b/doc/input-output-reference/src/overview/group-surface-construction-elements.tex @@ -155,7 +155,7 @@ \subsubsection{Inputs}\label{inputs-1-043} \subsection{Material:InfraredTransparent}\label{materialinfraredtransparent} -A Infrared Transparent surface is similar to a resistance-only surface.~ The idd object for this type of surface is shown below.~ The surface will actually participate in the transfer of visible and solar radiation by doing a wavelength transformation and making all short wave length radiation that is incident on the surface into long wave length radiation and having it participate in the long wavelength radiant exchange.~ \textbf{Note the ConvectionCoefficient instructions that follow the Infrared Transparent construction object below}. +A Infrared Transparent surface is similar to a resistance-only surface.~ The surface will actually participate in the transfer of visible and solar radiation by doing a wavelength transformation and making all short wave length radiation that is incident on the surface into long wave length radiation and having it participate in the long wavelength radiant exchange.~ \textbf{Note the ConvectionCoefficient instructions that follow the Infrared Transparent construction object below}. \subsubsection{Inputs}\label{inputs-2-040} @@ -618,11 +618,11 @@ \subsection{MaterialProperty:PhaseChangeHysteresis}\label{materialpropertyphasec This object is used to describe an advanced level of physics belonging to phase change materials used in building envelopes. The base phase change input object describes a single process curve whereby a material moves from a crystallized to liquid state and back. This input object adds a hysteresis effect, allowing the melting/freezing process to follow different curves, representing an effect that is commonly seen in actual building envelope phase change material applications. -This object also allows users to enter characteristic properties of the processes instead of a detailed temperature/enthalpy curve, making it more amenable for studies in which the user does not have the detailed test data required to generate the temperature/enthalpy curve. +This object also allows users to enter characteristic properties of the processes instead of a detailed temperature/enthalpy curve, making it more amenable for studies in which the user does not have the detailed test data required to generate the temperature/enthalpy curve. For more information on the use of phase change materials (PCM) with hysteresis, see the Conduction Finite Difference Solution Algorithm section of the EnergyPlus Engineering Reference document. \subsubsection{Inputs}\label{materialpropertyphasechangehysteresis-inputs} -The \hyperref[materialpropertyphasechange]{MaterialProperty:PhaseChange}Hysteresis object includes the following inputs. For the characteristic curve properties, see the engineering reference. +The \hyperref[materialpropertyphasechangehysteresis]{MaterialProperty:PhaseChangeHysteresis} object includes the following inputs. For the characteristic curve properties, see the engineering reference. \paragraph{Field: Name}\label{materialpropertyphasechangehysteresis-name} @@ -647,15 +647,15 @@ \subsubsection{Inputs}\label{materialpropertyphasechangehysteresis-inputs} \paragraph{Field: High Temperature Difference of Melting Curve}\label{materialpropertyphasechangehysteresis-inputs-high-temperature-difference-of-melting-curve} -This is the width of the enthalpy/specific heat melting curve, on the high side of the peak melting temperature, in Kelvin (technically it is ``change in Kelvin''). +This is the width of the enthalpy/specific heat melting curve, on the high side of the peak melting temperature, in Celsius (technically it is ``change in Celsius''). \paragraph{Field: Peak Melting Temperature}\label{materialpropertyphasechangehysteresis-inputs-peak-melting-temperature} -This is the center (peak) of the melting curve, in Kelvin. +This is the center (peak) of the melting curve, in Celsius. \paragraph{Field: Low Temperature Difference of Melting Curve}\label{materialpropertyphasechangehysteresis-inputs-low-temperature-difference-of-melting-curve} -This is the width of the enthalpy/specific heat melting curve, on the low side of the peak melting temperature, in Kelvin (technically it is ``change in Kelvin''). +This is the width of the enthalpy/specific heat melting curve, on the low side of the peak melting temperature, in Celsius (technically it is ``change in Celsius''). \paragraph{Field: Solid State Thermal Conductivity}\label{materialpropertyphasechangehysteresis-inputs-solidk} @@ -671,19 +671,17 @@ \subsubsection{Inputs}\label{materialpropertyphasechangehysteresis-inputs} \paragraph{Field: High Temperature Difference of Freezing Curve}\label{materialpropertyphasechangehysteresis-inputs-high-temperature-difference-of-freezing-curve} -This is the width of the enthalpy/specific heat freezing curve, on the high side of the peak freezing temperature, in Kelvin (technically it is ``change in Kelvin''). +This is the width of the enthalpy/specific heat freezing curve, on the high side of the peak freezing temperature, in Celsius (technically it is ``change in Celsius''). \paragraph{Field: Peak Freezing Temperature}\label{materialpropertyphasechangehysteresis-inputs-peak-freezing-temperature} -This is the center (peak) of the freezing curve, in Kelvin. This will be higher than the peak melting temperature based on empirical data. +This is the center (peak) of the freezing curve, in Celsius. This will generally be lower than the peak melting temperature based on empirical data. Note, however, that EnergyPlus does allow users to specify a peak freezing temperature that is higher than the peak melting temperature. \paragraph{Field: Low Temperature Difference of Freezing Curve}\label{materialpropertyphasechangehysteresis-inputs-low-temperature-difference-of-freezing-curve} -This is the width of the enthalpy/specific heat freezing curve, on the low side of the peak freezing temperature, in Kelvin (technically it is ``change in Kelvin''). +This is the width of the enthalpy/specific heat freezing curve, on the low side of the peak freezing temperature, in Celsius (technically it is ``change in Celsius''). -Next is an IDF example showing how it is used in conjunction with the Material: - -Note, the following Heat Balance Algorithm is necessary (only specified once). Also, when using ConductionFiniteDifference, it is more efficient to set the zone timestep shorter than those used for the ConductionTransferFunction solution algorithm. It should be set to 12 timesteps per hour or greater, and can range up to 60. +An IDF example using hysteresis in conjunction with an actual Material definition is shown below. This example includes the specification of the Heat Balance Algorithm and Timestep to show appropriate values for these inputs when MaterialProperty:PhaseChangeHysteresis is used. Heat Balance Algorithm and Timestep are only specified once in a particular idf file. Note that when using ConductionFiniteDifference, it is more efficient to set the zone timestep shorter than those used for the ConductionTransferFunction solution algorithm. It should be set to 12 timesteps per hour or greater and can range up to 60. \begin{lstlisting} @@ -720,6 +718,58 @@ \subsubsection{Inputs}\label{materialpropertyphasechangehysteresis-inputs} \end{lstlisting} +\subsubsection{Outputs}\label{materialpropertyphasechangehysteresis-outputs} + +The \hyperref[materialpropertyphasechangehysteresis]{MaterialProperty:PhaseChangeHysteresis} object also includes the following outputs. The Conduction Finite Difference solution algorithm uses a finite difference solution technique where the surfaces are divided into a nodal arrangement. These outputs are specific to Conduction Finite Difference solution. + +The following output variables are applicable to all opaque heat transfer surfaces when using Solution Algorithms ConductionFiniteDifference. Note that the ``X'' in the list and descriptions below must be replaced by a number that indicates the node at which the variables are being reported. So, for example, to report the surface temperature for node 7, one would use ``CondFD Surface Temperature Node 7''. + +\begin{itemize} +\item + Zone,Average,CondFD Phase Change State \textless{}X\textgreater{} {[]} +\item + Zone,Average,CondFD Phase Change Previous State \textless{}X\textgreater{} {[]} +\item + Zone,Average,CondFD Phase Change Node Temperature \textless{}X\textgreater{} {[}C{]} +\item + Zone,Average,CondFD Phase Change Node Conductivity \textless{}X\textgreater{} {[}W/m-K{]} +\item + Zone,Average,CondFD Phase Change Node Specific Heat \textless{}X\textgreater{} {[}J/kg-K{]} +\end{itemize} + +\paragraph{CondFD Phase Change State {[]}}\label{condfd-phase-change-state} + +This outputs the current phase classification for the node. The values for this output relate to the following phase categories: + +\begin{itemize} +\item +-2 = liquid +\item +-1 = melting +\item +0 = transition +\item +1 = freezing +\item +2 = crystallized +\end{itemize} + +\paragraph{CondFD Phase Change Previous State {[]}}\label{condfd-phase-change-previous-state} + +This outputs the previous phase classification for the node. The values for this output are the same as for the output CondFD Phase Change State above. + +\paragraph{CondFD Phase Change Node Temperature \textless{}X\textgreater{} {[}C{]}}\label{condfd-phase-change-node-temperature-x-c} + +This will output temperatures for a node in the surfaces being simulated with ConductionFiniteDifference. The nodes are numbered from outside to inside of the surface. The full listing will appear in the RDD file. This output is specific to surfaces that use the Conduction Finite Difference solution technique and have a \hyperref[materialpropertyphasechangehysteresis]{MaterialProperty:PhaseChangeHysteresis} object in the input file. The units for this output field are degrees Celsius. + +\paragraph{CondFD Phase Change Node Conductivity \textless{}X\textgreater{} {[}W/m-K{]}}\label{condfd-phase-change-node-conductivity-x-w-m-k} + +This will output the conductivity for a node in the surfaces being simulated with ConductionFiniteDifference. The nodes are numbered from outside to inside of the surface. The full listing will appear in the RDD file. This output is specific to surfaces that use the Conduction Finite Difference solution technique and have a \hyperref[materialpropertyphasechangehysteresis]{MaterialProperty:PhaseChangeHysteresis} object in the input file. The units for this output field are W/m-K. + +\paragraph{CondFD Phase Change Node Specific Heat \textless{}X\textgreater{} {[}J/kg-K{]}}\label{condfd-phase-change-node-specific-heat-x-j-kg-k} + +This will output the specific heat for a node in the surfaces being simulated with ConductionFiniteDifference. The nodes are numbered from outside to inside of the surface. The full listing will appear in the RDD file. This output is specific to surfaces that use the Conduction Finite Difference solution technique and have a \hyperref[materialpropertyphasechangehysteresis]{MaterialProperty:PhaseChangeHysteresis} object in the input file. The units for this output field are J/kg-K. + \subsection{MaterialProperty:VariableThermalConductivity}\label{materialpropertyvariablethermalconductivity} This object is used to describe the temperature dependent material properties that are used in the CondFD (Conduction Finite Difference) solution algorithm. This conduction model is used when the appropriate CondFD materials are specified and the Solution Algorithm parameter is set to condFD. @@ -782,15 +832,21 @@ \subsubsection{Inputs}\label{inputs-6-027} \subsubsection{Outputs}\label{outputs-1-026} -The Conduction Finite Difference solution algorithm uses a finite difference solution technique, the surfaces are divided into a nodal arrangement. The only output specific to Conduction Finite Difference solution (that is not include in other surface outputs) is node temperatures. +The Conduction Finite Difference solution algorithm uses a finite difference solution technique where the surfaces are divided into a nodal arrangement. These outputs are specific to Conduction Finite Difference solution. -The following output variables are applicable to all opaque heat transfer surfaces when using Solution Algorithms ConductionFiniteDifference: +The following output variables are applicable to all opaque heat transfer surfaces when using Solution Algorithms ConductionFiniteDifference. Note that the ``X'' in the list and descriptions below must be replaced by a number that indicates the Node at which the variables are being reported. So, for example, to report the surface temperature for node 7, one would use ``CondFD Surface Temperature Node 7''. \begin{itemize} \item Zone,Sum,CondFD Inner Solver Loop Iteration Count {[]} \item - Zone,Average,CondFD Surface Temperature Node \textless{}1\textgreater{} {[}C{]} + Zone,Average,CondFD Surface Temperature Node \textless{}X\textgreater{} {[}C{]} +\item + Zone,Average,CondFD Surface Heat Flux Node \textless{}X\textgreater{} {[}W/m2{]} +\item + Zone,Average,CondFD Surface Heat Capacitance Outer Half Node \textless{}X\textgreater{} {[}W/m2-K{]} +\item + Zone,Average,CondFD Surface Heat Capacitance Inner Half Node \textless{}X\textgreater{} {[}W/m2-K{]} \end{itemize} \paragraph{CondFD Inner Solver Loop Iteration Count {[]}}\label{condfd-inner-solver-loop-iteration-count} @@ -799,7 +855,7 @@ \subsubsection{Outputs}\label{outputs-1-026} \paragraph{CondFD Surface Temperature Node \textless{}X\textgreater{} {[}C{]}}\label{condfd-surface-temperature-node-x-c} -This will output temperatures for a node in the surfaces being simulated with ConductionFiniteDifference. The key values for this output variable are the surface name. The nodes are numbered from outside to inside of the surface. The full listing will appear in the RDD file +This will output temperatures for a node in the surfaces being simulated with ConductionFiniteDifference. The key values for this output variable are the surface name. The nodes are numbered from outside to inside of the surface. The full listing will appear in the RDD file. \paragraph{CondFD Surface Heat Flux Node \textless{}X\textgreater{} {[}W/m2{]}}\label{condfd-surface-heat-flux-node-x-wm2} @@ -809,7 +865,7 @@ \subsubsection{Outputs}\label{outputs-1-026} \paragraph{CondFD Surface Heat Capacitance Inner Half Node \textless{}X\textgreater{} {[}W/m2-K{]}}\label{condfd-surface-heat-capacitance-inner-half-node-x-wm2-k} -These will output the half-node heat capacitance in surfaces being simulated with ConductionFiniteDifference. The key values for this output variable are the surface name. The nodes are numbered from outside to inside of the surface. The full listing will appear in the RDD file. For this output, the heat capacitance is defined as the product of specific heat, density, and node thickness. Zero is reported for R-layer half-nodes and for undefined half-nodes. There is no outer half-node for Node 1 which is the outside face of the surface, and there is no inner half-node for Node N which is the inside face of the surface. CondFD Surface Heat Capacitance is only available with Output:Diagnostics,DisplayAdvancedReportVariables. +These will output the half-node heat capacitance in surfaces being simulated with ConductionFiniteDifference. The key values for this output variable are the surface name. The nodes are numbered from outside to inside of the surface. The full listing will appear in the RDD file. For this output, the heat capacitance is defined as the product of specific heat, density, and node thickness. Zero is reported for R-layer half-nodes and for undefined half-nodes. There is no outer half-node for Node 1 which is the outside face of the surface, and there is no inner half-node for Node N which is the inside face of the surface. CondFD Surface Heat Capacitance is only available when the user includes a Output:Diagnostics, DisplayAdvancedReportVariables designation in the input file. \subsection{MaterialProperty:HeatAndMoistureTransfer:Settings}\label{materialpropertyheatandmoisturetransfersettings} @@ -1328,35 +1384,39 @@ \subsubsection{Inputs}\label{inputs-13-015} \begin{lstlisting} -MATERIAL:WINDOWGLASS, GLASS - CLEAR SHEET 1 / 8 IN, - SpectralAverage, ! Optical data type - 0.003, ! Thickness {m} 1/8" - 0.850, ! Solar transmittance at normal incidence - 0.075, ! Solar reflectance at normal incidence: front side - 0.075, ! Solar reflectance at normal incidence: back side - 0.901, ! Visible transmittance at normal incidence - 0.081, ! Visible reflectance at normal incidence: front side - 0.081, ! Visible reflectance at normal incidence: back side - 0.0, ! IR transmittance at normal incidence - 0.84, ! IR hemispherical emissivity: front side - 0.84, ! IR hemispherical emissivity: back side - 0.9; ! Conductivity {W/m-K} - - - WindowMaterial:Glazing ,SPECTRAL GLASS INNER PANE, ! Material name - Spectral, ! Optical data type {SpectralAverage or Spectral} - TestSpectralDataSet, ! Name of spectral data set - 0.0099, ! Thickness {m} - , ! Solar transmittance at normal incidence - , ! Solar reflectance at normal incidence: front side - , ! Solar reflectance at normal incidence: back side - , ! Visible transmittance at normal incidence - , ! Visible reflectance at normal incidence: front side - , ! Visible reflectance at normal incidence: back side - 0.0, ! IR transmittance at normal incidence - 0.84, ! IR emissivity: front side - 0.84, ! IR emissivity: back side - 0.798; ! Conductivity {W/m-K} + WindowMaterial:Glazing, + CLEAR 3MM, !- Name + SpectralAverage, !- Optical Data Type + , !- Window Glass Spectral Data Set Name + 0.003, !- Thickness {m} + 0.837, !- Solar Transmittance at Normal Incidence + 0.075, !- Front Side Solar Reflectance at Normal Incidence + 0.075, !- Back Side Solar Reflectance at Normal Incidence + 0.898, !- Visible Transmittance at Normal Incidence + 0.081, !- Front Side Visible Reflectance at Normal Incidence + 0.081, !- Back Side Visible Reflectance at Normal Incidence + 0.0, !- Infrared Transmittance at Normal Incidence + 0.84, !- Front Side Infrared Hemispherical Emissivity + 0.84, !- Back Side Infrared Hemispherical Emissivity + 0.9; !- Conductivity {W/m-K} + + + + WindowMaterial:Glazing, + SPECTRAL GLASS INNER PANE, ! Material name + Spectral, ! Optical data type {SpectralAverage or Spectral} + TestSpectralDataSet, ! Name of spectral data set + 0.0099, ! Thickness {m} + , ! Solar transmittance at normal incidence + , ! Solar reflectance at normal incidence: front side + , ! Solar reflectance at normal incidence: back side + , ! Visible transmittance at normal incidence + , ! Visible reflectance at normal incidence: front side + , ! Visible reflectance at normal incidence: back side + 0.0, ! IR transmittance at normal incidence + 0.84, ! IR emissivity: front side + 0.84, ! IR emissivity: back side + 0.798; ! Conductivity {W/m-K} \end{lstlisting} @@ -1364,28 +1424,28 @@ \subsubsection{Inputs}\label{inputs-13-015} \begin{lstlisting} - WindowMaterial:Glazing ,SPECTRAL AND ANGLE GLASS INNER PANE, ! Material name + WindowMaterial:Glazing, + SPECTRAL AND ANGLE GLASS INNER PANE, ! Material name SpectralAndAngle, ! Optical data type {SpectralAverage or Spectral} - , !- Name of spectral data set - - 0.0099, ! Thickness {m} - , !- Solar transmittance at normal incidence - , !- Solar reflectance at normal incidence: front side - , !- Solar reflectance at normal incidence: back side - , !- Visible transmittance at normal incidence - , !- Visible reflectance at normal incidence: front side - , !- Visible reflectance at normal incidence: back side - 0.0, !- IR transmittance at normal incidence - 0.84, !- IR emissivity: front side - 0.84, !- IR emissivity: back side - 0.798, !- Conductivity {W/m-K} - , !- Dirt Correction Factor for Solar and Visible Transmittance - , !- Solar Diffusing - , !- Young's modulus - , !- Poisson's ratio - TranmittanceDataSet, !- Window Glass Spectral and Incident Angle Transmittance Data Set Table Name - FrontReflectanceDataSet, !- Window Glass Spectral and Incident Angle Front Reflectance Data Set Table Name - BackReflectanceDataSet; !- Window Glass Spectral and Incident Angle Back Reflectance Data Set Table Name + , !- Name of spectral data set + 0.0099, ! Thickness {m} + , !- Solar transmittance at normal incidence + , !- Solar reflectance at normal incidence: front side + , !- Solar reflectance at normal incidence: back side + , !- Visible transmittance at normal incidence + , !- Visible reflectance at normal incidence: front side + , !- Visible reflectance at normal incidence: back side + 0.0, !- IR transmittance at normal incidence + 0.84, !- IR emissivity: front side + 0.84, !- IR emissivity: back side + 0.798, !- Conductivity {W/m-K} + , !- Dirt Correction Factor for Solar and Visible Transmittance + , !- Solar Diffusing + , !- Young's modulus + , !- Poisson's ratio + TranmittanceDataSet, !- Window Glass Spectral+Incident Angle Transmittance Data Set Table Name + FrontReflectanceDataSet, !- Window Glass Spectral+Incident Angle Front Reflectance Data Set Table Name + BackReflectanceDataSet; !- Window Glass Spectral+Incident Angle Back Reflectance Data Set Table Name \end{lstlisting} @@ -1545,7 +1605,9 @@ \subsubsection{Inputs}\label{inputs-15-015} A unique user assigned name for a particular thermochromic glass material. -\paragraph{Field Set (Optical Data Temperature, Window Material Glazing Name) is extensible.}\label{field-set-optical-data-temperature-window-material-glazing-name-is-extensible.} +\paragraph{Field Set (Optical Data Temperature, Window Material Glazing Name)}\label{field-set-optical-data-temperature-window-material-glazing-name-is-extensible.} + +This object is extensible, so additional sets of the next two fields can be added to the end of this object. \paragraph{Field:Optical Data Temperature \textless{}N\textgreater{}}\label{fieldoptical-data-temperature-n} @@ -1858,7 +1920,7 @@ \subsubsection{Inputs}\label{inputs-16-011} The following entries are used only if Gas Type = Custom. The A and B coefficients are those in the following expression that gives a property value as a function of temperature in degrees K: \begin{equation} -Property = Coefficien{t_A} + Coefficien{t_B}*Temperatur{e_K} +Property = Coefficien{t_A} + Coefficien{t_B}*Temperatur{e_K} + Coefficien{t_C}*Temperature_K^2 \end{equation} \paragraph{Field: Conductivity Coefficient A}\label{field-conductivity-coefficient-a} @@ -2251,7 +2313,7 @@ \subsubsection{Inputs}\label{inputs-22-005} \paragraph{Field: Shade to Glass Distance}\label{field-shade-to-glass-distance} -Distance from shade to adjacent glass (m). This is denoted by \emph{s} in Figure~\ref{fig:vertical-section-a-and-perspective-view-b-of} and Figure~\ref{fig:examples-of-air-flow-openings-for-an-interior}, below. If the shade is not flat, such as for pleated pull-down shades or folded drapery, the average shade-to-glass distance should be used. (The shade-to-glass distance is used in calculating the natural convective air flow between glass and shade produced by buoyancy effects.). Note used for between-glass shades. +Distance from shade to adjacent glass (m). This is denoted by \emph{s} in Figure~\ref{fig:vertical-section-a-and-perspective-view-b-of} and Figure~\ref{fig:examples-of-air-flow-openings-for-an-interior}, below. If the shade is not flat, such as for pleated pull-down shades or folded drapery, the average shade-to-glass distance should be used. (The shade-to-glass distance is used in calculating the natural convective air flow between glass and shade produced by buoyancy effects.). Not used for between-glass shades. In the following, \emph{H} is the glazing height and \emph{W} is the glazing width. @@ -3569,7 +3631,7 @@ \subsubsection{Inputs}\label{inputs-32-000} \paragraph{Field: Conductivity of Dry Soil}\label{field-conductivity-of-dry-soil} -This field is used to enter the thermal conductivity of the material layer. Units for this parameter are W/(m-K). Thermal conductivity must be greater than zero. Typical soils have values from .3 to .5. Minimum is .2 (specified in IDD). Default is .35 and maximum (in IDD) is 1.5. +This field is used to enter the thermal conductivity of the material layer. Units for this parameter are W/(m-K). Thermal conductivity must be greater than zero. Typical soils have values from .3 to .5. The minimum is .2, the default is .35, and the maximum is 1.5. \paragraph{Field: Density of Dry Soil}\label{field-density-of-dry-soil} diff --git a/doc/input-output-reference/src/overview/group-thermal-zone-description-geometry.tex b/doc/input-output-reference/src/overview/group-thermal-zone-description-geometry.tex index 97a26a02354..69e90ade637 100644 --- a/doc/input-output-reference/src/overview/group-thermal-zone-description-geometry.tex +++ b/doc/input-output-reference/src/overview/group-thermal-zone-description-geometry.tex @@ -358,9 +358,9 @@ \subsubsection{Inputs}\label{inputs-1-045} The name of the ZoneList object. Must be unique across ZoneLists. -\paragraph{Field: Zone 1 - Zone 20 Name}\label{field-zone-1---zone-20-name} +\paragraph{Field: Zone \textless{}\#\textgreater{} Name}\label{field-zone-1---zone-20-name} -Reference to a Zone object. This field is extensible; for greater than 20 zones, edit the IDD to add more \emph{Zone Name} fields. +Reference to a Zone object. This object is extensible, so additional fields of this type can be added to the end of this object. \begin{lstlisting} @@ -1604,7 +1604,7 @@ \subsection{Surface Vertices}\label{surface-vertices} \hyperref[shadingzonedetailed-000]{Shading:Zone:Detailed} \end{itemize} -use the same vertex input. The numeric parameters indicated below are taken from the \hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed} definition; the others may not be exactly the same but are identical in configuration. They are also ``extensible'' -- so, if you want more vertices for these surfaces, you may add to the IDD definition as indicated in the ``extensible'' comment or, as EnergyPlus is ``auto-extensible'' just add the number of vertices into your input file.. Note that \hyperref[fenestrationsurfacedetailed]{FenestrationSurface:Detailed} is not extensible and is limited to 4 (max) vertices. If you leave the Number of Surface Vertex groups blank or enter \textbf{autocalculate}, EnergyPlus looks at the number of groups entered and figures out how many coordinate groups are entered. +use the same vertex input. The numeric parameters indicated below are taken from the \hyperref[buildingsurfacedetailed]{BuildingSurface:Detailed} definition; the others may not be exactly the same but are identical in configuration. They are also ``extensible'' -- so, to define more vertices for these surfaces, simply add the required number of vertices (X, Y, and Z coordinates for each vertex) to the input file. Note that \hyperref[fenestrationsurfacedetailed]{FenestrationSurface:Detailed} is not extensible and is limited to 4 (max) vertices. If the Number of Surface Vertex groups is left blank or entered as \textbf{autocalculate}, EnergyPlus looks at the number of groups entered and figures out how many coordinate groups are entered. \begin{callout} \warning{Note that the resolution on the surface vertex input is 1 millimeter (.001 meter). Therefore, using vertices that are very close together (\textless{} 1 mm) may result in invalid dot product and fatal errors during shading calculations.} @@ -2522,7 +2522,7 @@ \subsection{Surface Output Variables/Reports}\label{surface-output-variablesrepo \subsection{Window Output Variables}\label{window-output-variables} -Output variables applicable only to exterior windows and glass doors: +Output variables applicable to exterior windows and glass doors: \begin{lstlisting} Zone,Average,Zone Windows Total Transmitted Solar Radiation Rate [W] @@ -2614,11 +2614,21 @@ \subsection{Window Output Variables}\label{window-output-variables} Zone,Average,Surface Window Inside Face Shade Net Infrared Heat Transfer Rate [W] \end{lstlisting} -Output variables applicable only to interior windows and glass doors: +Output variables applicable to interior windows and glass doors: \begin{lstlisting} -Zone,Average, Surface Window Transmitted Beam Solar Radiation Rate [W] +Zone,Average,Surface Window Transmitted Solar Radiation Rate [W] +Zone,Sum,Surface Window Transmitted Solar Radiation Energy [J] +Zone,Average,Surface Window Transmitted Beam Solar Radiation Rate [W] Zone,Sum,Surface Window Transmitted Beam Solar Radiation Energy [J] +Zone,Average,Surface Window Transmitted Beam to Beam Solar Radiation Rate [W] +Zone,Sum,Surface Window Transmitted Beam to Beam Solar Radiation Energy [J] +Zone,Average,Surface Window Transmitted Diffuse Solar Radiation Rate [W] +Zone,Sum,Surface Window Transmitted Diffuse Solar Radiation Energy [J] +Zone,Average,Surface Window Heat Gain Rate [W] +Zone,Sum,Surface Window Heat Gain Energy [J] +Zone,Average,Surface Window Heat Loss Rate [W] +Zone,Sum,Surface Window Heat Loss Energy [J] \end{lstlisting} If the user requests to display advanced report/output variables (e.g.~see \hyperref[outputdiagnostics]{Output:Diagnostics} keyword DisplayAdvancedReportVariables) the the following additional output variable is available for Equivalent Layer Window; @@ -4229,9 +4239,13 @@ \subsubsection{Inputs}\label{inputs-32-001} \emph{OnNightAndOnDayIfCoolingAndHighSolarOnWindow}: Shading is on at night. Shading is on during the day if the solar radiation incident on the window exceeds SetPoint (W/m\(^{2}\)) and if the zone cooling rate in the previous timestep is non-zero. Day and night shading is subject to schedule, if specified. (This Shading Control Type is the same as the previous one, except the shading is on at night rather than off.) -\emph{OnIfHighOutdoorAirTempAndHighSolarOnWindow:} Shading is on if the outside air temperature exceeds the Setpoint (C) and if if the solar radiation incident on the window exceeds SetPoint 2 (W/m\(^{2}\)). +\emph{OnIfHighOutdoorAirTempAndHighSolarOnWindow:} Shading is on if the outside air temperature exceeds the Setpoint (C) and if the solar radiation incident on the window exceeds SetPoint 2 (W/m\(^{2}\)). + +\emph{OnIfHighOutdoorAirTempAndHighHorizontalSolar:} Shading is on if the outside air temperature exceeds the Setpoint (C) and if the horizontal solar radiation exceeds SetPoint 2 (W/m\(^{2}\)). + +\emph{OnIfHighZoneAirTempAndHighSolarOnWindow:} Shading is on if the zone air temperature exceeds the Setpoint (C) and if the solar radiation incident on the window exceeds SetPoint 2 (W/m\(^{2}\)). -\emph{OnIfHighOutdoorAirTempAndHighHorizontalSolar:} Shading is on if the outside air temperature exceeds the Setpoint (C) and if if the horizontal solar radiation exceeds SetPoint 2 (W/m\(^{2}\)). +\emph{OnIfHighZoneAirTempAndHighHorizontalSolar:} Shading is on if the zone air temperature exceeds the Setpoint (C) and if the horizontal solar radiation exceeds SetPoint 2 (W/m\(^{2}\)). \paragraph{Field: Schedule Name}\label{field-schedule-name-007} @@ -4292,7 +4306,7 @@ \subsubsection{Inputs}\label{inputs-32-001} \paragraph{Field: Setpoint 2}\label{field-setpoint-2} -Used only as the second setpoint for the following two-setpoint control types: OnIfHighOutdoorAirTempAndHighSolarOnWindow, OnIfHighOutdoorAirTempAndHighHorizontalSolar, OnIfHighZoneAirTempAndHighSolarOnWindow, and OnIfHighZoneAirTempAndHighHorizontalSolar +Used only as the second setpoint for the following setpoint control types: OnIfHighOutdoorAirTempAndHighSolarOnWindow, OnIfHighOutdoorAirTempAndHighHorizontalSolar, OnIfHighZoneAirTempAndHighSolarOnWindow, and OnIfHighZoneAirTempAndHighHorizontalSolar \paragraph{Field: Daylighting Controls Object Name}\label{field-daylighting-controls-object-name} @@ -4308,7 +4322,7 @@ \subsubsection{Inputs}\label{inputs-32-001} \paragraph{Field: Fenestration Surface Name}\label{field-fenestration-surface1-name} -The name of a \hyperref[fenestrationsurfacedetailed]{FenestrationSurface:Detailed}, Window, or \hyperref[glazeddoor]{GlazedDoor} object controlled by this WindowShadingControl. This field can be repeated to apply the same shading control to more than one fenestration surface. When Multiple Surface Control Type is set to Sequential, the order of the Fenestration Surface Names is the order that the shades will be deployed. The object is extensible so that additional fields of fenestration surface names can be added to the object. All of the fenestration surfaces must be either in the zone specified in the Zone Name field or in an adjacent zone connected by an interior window. +The name of a \hyperref[fenestrationsurfacedetailed]{FenestrationSurface:Detailed}, Window, or \hyperref[glazeddoor]{GlazedDoor} object controlled by this WindowShadingControl. This field can be repeated to apply the same shading control to more than one fenestration surface. When Multiple Surface Control Type is set to Sequential, the order of the Fenestration Surface Names is the order that the shades will be deployed. The object is extensible so additional fields of fenestration surface names can be added to the object. All of the fenestration surfaces must be either in the zone specified in the Zone Name field or in an adjacent zone connected by an interior window. An IDF example: window with interior roll shade that is deployed when solar incident on the window exceeds 50 W/m\(^{2}\). diff --git a/doc/input-output-reference/src/overview/group-unitary-equipment.tex b/doc/input-output-reference/src/overview/group-unitary-equipment.tex index 400c66bd397..4d6868b909a 100644 --- a/doc/input-output-reference/src/overview/group-unitary-equipment.tex +++ b/doc/input-output-reference/src/overview/group-unitary-equipment.tex @@ -1024,7 +1024,7 @@ \subsubsection{Field: Unitary System Air Outlet Node Name}\label{field-unitary-s This alpha field contains the unitary system outlet node name. -\textbf{\emph{Field: Supply Air Fan Operating Mode Schedule Name}} +\subsubsection{Field: Supply Air Fan Operating Mode Schedule Name}\label{field-supply-air-fan-operating-mode-schedule-name-4} This alpha field specifies the name of the supply air fan operating mode schedule. The supply air fan operating mode may vary during the simulation based on time-of-day or with a change of season. Schedule values of 0 denote that the unitary system supply air fan and the heating or cooling coil cycle on and off together to meet the heating or cooling load (a.k.a. AUTO fan). Schedule values other than 0 denote that the supply fan runs continuously while the heating or cooling coil cycles to meet the load. diff --git a/doc/input-output-reference/src/overview/group-variable-refrigerant-flow-equipment.tex b/doc/input-output-reference/src/overview/group-variable-refrigerant-flow-equipment.tex index 169f2b97a5e..85ab9248b12 100644 --- a/doc/input-output-reference/src/overview/group-variable-refrigerant-flow-equipment.tex +++ b/doc/input-output-reference/src/overview/group-variable-refrigerant-flow-equipment.tex @@ -72,15 +72,15 @@ \subsubsection{Inputs}\label{inputs-051} \paragraph{Field: Gross Rated Cooling COP}\label{field-gross-rated-cooling-cop-001} -This numeric field defines the cooling coefficient of performance at rated conditions. The cooling coefficient of performance includes compressor power and condenser fan power. This COP value does not account for impacts due to the supply air fan. The nominal heat pump cooling COP must be greater than 0. If this field is left blank, a default coefficient of performance of 3.3 is assumed. +This numeric field defines the cooling coefficient of performance (COP) at rated conditions. The cooling COP includes compressor power and condenser fan power. This COP value does not account for impacts due to the supply air fan. The nominal heat pump cooling COP must be greater than 0. If this field is left blank, a default COP of 3.3 is assumed. -\paragraph{Field: Minimum Outdoor Temperature in Cooling Mode}\label{field-minimum-outdoor-temperature-in-cooling-mode-000} +\paragraph{Field: Minimum Condenser Inlet Node Temperature in Cooling Mode}\label{field-minimum-condenser-inlet-node-temperature-in-cooling-mode-000} -This numeric field defines the minimum source temperature allowed for cooling operation. For air-cooled equipment outdoor dry-bulb temperature is used. For water-cooled equipment inlet water temperature is used. Below this temperature, cooling is disabled. If this field is left blank, the default value is -6ºC. +This numeric field defines the minimum source inlet temperature allowed for cooling operation. For air-cooled equipment outdoor dry-bulb temperature is used. For water-cooled equipment inlet water temperature is used. Below this temperature, cooling is disabled. If this field is left blank, the default value is -6ºC. -\paragraph{Field: Maximum Outdoor Temperature in Cooling Mode}\label{field-maximum-outdoor-temperature-in-cooling-mode-000} +\paragraph{Field: Maximum Condenser Inlet Node Temperature in Cooling Mode}\label{field-maximum-condenser-inlet-node-temperature-in-cooling-mode-000} -This numeric field defines the maximum source temperature allowed for cooling operation. For air-cooled equipment outdoor dry-bulb temperature is used. For water-cooled equipment inlet water temperature is used. Above this temperature, cooling is disabled. If this field is left blank, the default value is 43ºC. +This numeric field defines the maximum source inlet temperature allowed for cooling operation. For air-cooled equipment outdoor dry-bulb temperature is used. For water-cooled equipment inlet water temperature is used. Above this temperature, cooling is disabled. If this field is left blank, the default value is 43ºC. \paragraph{Field: Cooling Capacity Ratio Modifier Function of Low Temperature Curve Name}\label{field-cooling-capacity-ratio-modifier-function-of-low-temperature-curve-name} @@ -132,15 +132,15 @@ \subsubsection{Inputs}\label{inputs-051} \paragraph{Field: Gross Rated Heating COP}\label{field-gross-rated-heating-cop-001} -This numeric field defines the heating coefficient of performance at rated conditions. The heating coefficient of performance includes compressor power and condenser fan power. This gross COP value does NOT account for~ the supply air fan. The nominal heat pump heating COP must be greater than 0. If this field is left blank, a coefficient of performance of 3.4 is assumed. +This numeric field defines the heating coefficient of performance (COP) at rated conditions. The heating COP includes compressor power and condenser fan power. This gross COP value does NOT account for impacts due to the supply air fan. The nominal heat pump heating COP must be greater than 0. If this field is left blank, a COP of 3.4 is assumed. -\paragraph{Field: Minimum Outdoor Temperature in Heating Mode}\label{field-minimum-outdoor-temperature-in-heating-mode-000} +\paragraph{Field: Minimum Condenser Inlet Node Temperature in Heating Mode}\label{field-minimum-condenser-inlet-node-temperature-in-heating-mode-000} -This numeric field defines the minimum outdoor temperature allowed for heating operation. Below this temperature, heating is disabled. If this field is left blank, the default value is -20ºC. +This numeric field defines the minimum source inlet temperature allowed for heating operation. For air-cooled equipment outdoor dry-bulb temperature is used. For water-cooled equipment inlet water temperature is used. Below this temperature, heating is disabled. If this field is left blank, the default value is -20ºC. -\paragraph{Field: Maximum Outdoor Temperature in Heating Mode}\label{field-maximum-outdoor-temperature-in-heating-mode-000} +\paragraph{Field: Maximum Condenser Inlet Node Temperature in Heating Mode}\label{field-maximum-condenser-inlet-node-temperature-in-heating-mode-000} -This numeric field defines the maximum outdoor temperature allowed for heating operation. Above this temperature, heating is disabled. If this field is left blank, the default value is 16ºC. +This numeric field defines the maximum source inlet temperature allowed for heating operation. For air-cooled equipment outdoor dry-bulb temperature is used. For water-cooled equipment inlet water temperature is used. Above this temperature, heating is disabled. If this field is left blank, the default value is 16ºC. This default temperature will likely disable water-cooled equipment and a more reasonable value should be entered. Check manufacturers specifications. \paragraph{Field: Heating Capacity Ratio Modifier Function of Low Temperature Curve Name}\label{field-heating-capacity-ratio-modifier-function-of-low-temperature-curve-name} @@ -348,13 +348,13 @@ \subsubsection{Inputs}\label{inputs-051} This alpha field determines the type of fuel that this variable refrigerant flow system uses.~ This field has seven choices: Electricity, NaturalGas, Propane, Diesel, Gasoline, FuelOilNo1, FuelOilNo2, OtherFuel1, and OtherFuel2. The default is Electricity. The use of alternate fuel types assumes an engine drives the variable speed compression system and also accounts for condenser air flow (i.e., a fan attached to the engine provides air flow through the outdoor condenser. -\paragraph{Field: Minimum Outdoor Temperature in Heat Recovery Mode}\label{field-minimum-outdoor-temperature-in-heat-recovery-mode-000} +\paragraph{Field: Minimum Condenser Inlet Node Temperature in Heat Recovery Mode}\label{field-minimum-condenser-inlet-node-temperature-in-heat-recovery-mode-000} -This numeric field defines the minimum outdoor dry-bulb temperature allowed for heat recovery operation. Below this temperature, heat recovery is disabled. This input must be greater than the larger of the minimum outdoor temperature in cooling or heating mode. If this field is left blank, the default value is the higher of the Minimum Outdoor Temperature in Cooling Mode or Minimum Outdoor Temperature in Heating Mode inputs. This system may still operate in cooling or heating only mode when outdoor temperatures are below the minimum outdoor temperature in heat recovery mode. This input is only used when Heat Pump Waste Heat Recovery is selected as Yes. +This numeric field defines the minimum source inlet temperature allowed for heat recovery operation. For air-cooled equipment outdoor dry-bulb temperature is used. For water-cooled equipment inlet water temperature is used. Below this temperature, heat recovery is disabled. This input must be greater than the larger of the minimum condenser inlet node temperature in cooling or heating mode. If this field is left blank, the default value is the higher of the Minimum Condenser Inlet Node Temperature in Cooling Mode or Minimum Condenser Inlet Node Temperature in Heating Mode inputs. This system may still operate in cooling or heating only mode when source inlet temperatures are below the minimum condenser inlet node temperature in heat recovery mode. This input is only used when Heat Pump Waste Heat Recovery is selected as Yes. -\paragraph{Field: Maximum Outdoor Temperature in Heat Recovery Mode}\label{field-maximum-outdoor-temperature-in-heat-recovery-mode-000} +\paragraph{Field: Maximum Condenser Inlet Node Temperature in Heat Recovery Mode}\label{field-maximum-condenser-inlet-node-temperature-in-heat-recovery-mode-000} -This numeric field defines the maximum outdoor dry-bulb temperature allowed for heat recovery operation. Above this temperature, heat recovery is disabled. This input must be less than the smaller of the maximum outdoor temperature in cooling or heating mode. If this field is left blank, the default value is the lower of the Maximum Outdoor Temperature in Cooling Mode or Maximum Outdoor Temperature in Heating Mode inputs.. This system may still operate in cooling or heating only mode when outdoor temperatures are above the maximum outdoor temperature in heat recovery mode. This input is only used when Heat Pump Waste Heat Recovery is selected as Yes. +This numeric field defines the maximum source inlet temperature allowed for heat recovery operation. For air-cooled equipment outdoor dry-bulb temperature is used. For water-cooled equipment inlet water temperature is used. Above this temperature, heat recovery is disabled. This input must be less than the smaller of the maximum condenser inlet node temperature in cooling or heating mode. If this field is left blank, the default value is the lower of the Maximum Condenser Inlet Node Temperature in Cooling Mode or Maximum Condenser Inlet Node Temperature in Heating Mode inputs.. This system may still operate in cooling or heating only mode when source inlet temperatures are above the maximum condenser inlet node temperature in heat recovery mode. This input is only used when Heat Pump Waste Heat Recovery is selected as Yes. \paragraph{Field: Heat Recovery Cooling Capacity Modifier Curve Name}\label{field-heat-recovery-cooling-capacity-modifier-curve-name} @@ -412,8 +412,8 @@ \subsubsection{Inputs}\label{inputs-051} VRFCondAvailSched, !- Availability Schedule Name autosize, !- Gross Rated Total Cooling Capacity {W} 3.16038, !- Gross Rated Cooling COP {W} - -5, !- Minimum Outdoor Temperature in Cooling Mode {C} - 43, !- Maximum Outdoor Temperature in Cooling Mode {C} + -5, !- Minimum Condenser Inlet Node Temperature in Cooling Mode {C} + 43, !- Maximum Condenser Inlet Node Temperature in Cooling Mode {C} VRFCoolCapFT, !- Cooling Capacity Ratio Modifier Function of Low Temperature Curve Name VRFCoolCapFTBoundary, !- Cooling Capacity Ratio Boundary Curve Name VRFCoolCapFTHi, !- Cooling Capacity Ratio Modifier Function of High Temperature Curve Name @@ -427,8 +427,8 @@ \subsubsection{Inputs}\label{inputs-051} autosize, !- Gross Rated Heating Capacity {W} , !- Rated Heating Capacity Sizing Ratio (W/W) 3.40909, !- Gross Rated Heating COP - -20, !- Minimum Outdoor Temperature in Heating Mode {C} - 15.5, !- Maximum Outdoor Temperature in Heating Mode {C} + -20, !- Minimum Condenser Inlet Node Temperature in Heating Mode {C} + 15.5, !- Maximum Condenser Inlet Node Temperature in Heating Mode {C} VRFHeatCapFT, !- Heating Capacity Ratio Modifier Function of Low Temperature Curve Name VRFHeatCapFTBoundary, !- Heating Capacity Ratio Boundary Curve Name VRFHeatCapFTHi, !- Heating Capacity Ratio Modifier Function of High Temperature Curve Name @@ -475,8 +475,8 @@ \subsubsection{Inputs}\label{inputs-051} , !- Basin Heater Set Point Temperature (C) , !- Basin Heater Operating Schedule Name , !- Fuel Type - , !- Minimum Outdoor Temperature in Heat Recovery Mode (C) - , !- Maximum Outdoor Temperature in Heat Recovery Mode (C) + , !- Minimum Condenser Inlet Node Temperature in Heat Recovery Mode (C) + , !- Maximum Condenser Inlet Node Temperature in Heat Recovery Mode (C) , !- Heat Recovery Cooling Capacity Modifier Function of Temperature Curve Name , !- Initial Heat Recovery Cooling Capacity Fraction , !- Heat Recovery Cooling Capacity Time Constant (hr) @@ -638,15 +638,15 @@ \subsubsection{Outputs}\label{outputs-039} \paragraph{\texorpdfstring{VRF Heat Pump Cooling COP{[]}}{VRF Heat Pump Cooling COP}}\label{vrf-heat-pump-cooling-cop} -This is the operating cooling coefficient of performance for the heat pump. This value is calculated using the ratio of VRF Heat Pump Total Cooling Rate and Variable Refrigerant Flow Heat Pump Cooling Electric Consumption Rate output variables. Crankcase heater (usually 0 in cooling mode), evaporative condenser water pump, and defrost (usually 0 in cooling mode) consumption rate output variables are included in this calculation. This value is specific to outdoor unit performance in cooling mode, is calculated for each HVAC system time step being simulated, and the results are averaged for the time step being reported. +This is the operating cooling coefficient of performance (COP) for the heat pump. This value is calculated using the ratio of VRF Heat Pump Total Cooling Rate and Variable Refrigerant Flow Heat Pump Cooling Electric Consumption Rate output variables. Crankcase heater (usually 0 in cooling mode), evaporative condenser water pump, and defrost (usually 0 in cooling mode) consumption rate output variables are included in this calculation. This value is specific to outdoor unit performance in cooling mode, is calculated for each HVAC system time step being simulated, and the results are averaged for the time step being reported. \paragraph{\texorpdfstring{VRF Heat Pump Heating COP{[]}}{VRF Heat Pump Heating COP}}\label{vrf-heat-pump-heating-cop} -This is the operating heating coefficient of performance for the heat pump. This value is calculated using the ratio of VRF Heat Pump Total Heating Rate and Variable Refrigerant Flow Heat Pump Heating Electric Consumption Rate output variables. Crankcase heater, evaporative condenser water pump (usually 0 in heating mode), and defrost consumption rate output variables are included in this calculation. This value is specific to outdoor unit performance in heating mode, is calculated for each HVAC system time step being simulated, and the results are averaged for the time step being reported. +This is the operating heating coefficient of performance (COP) for the heat pump. This value is calculated using the ratio of VRF Heat Pump Total Heating Rate and Variable Refrigerant Flow Heat Pump Heating Electric Consumption Rate output variables. Crankcase heater, evaporative condenser water pump (usually 0 in heating mode), and defrost consumption rate output variables are included in this calculation. This value is specific to outdoor unit performance in heating mode, is calculated for each HVAC system time step being simulated, and the results are averaged for the time step being reported. \paragraph{\texorpdfstring{VRF Heat Pump COP{[]}}{VRF Heat Pump COP}}\label{vrf-heat-pump-cop} -This is the operating coefficient of performance for the heat pump. This value is calculated using the ratio of the total terminal unit coil capacity (cooling plus heating and accounts for piping losses) and total system electric consumption rate (compressor, crankcase heater, evaporative condenser water pump, defrost, and terminal unit parasitic electric consumption rate). This output variable does not include pump power for a water-cooled system. This value is specific to overall system performance, is calculated for each HVAC system time step being simulated, and the results are averaged for the time step being reported. +This is the operating coefficient of performance (COP) for the heat pump. This value is calculated using the ratio of the total terminal unit coil capacity (cooling plus heating and accounts for piping losses) and total system electric consumption rate (compressor, crankcase heater, evaporative condenser water pump, defrost, and terminal unit parasitic electric consumption rate). This output variable does not include pump power for a water-cooled system. This value is specific to overall system performance, is calculated for each HVAC system time step being simulated, and the results are averaged for the time step being reported. \paragraph{VRF Heat Pump Defrost Electricity Rate {[}W{]}}\label{vrf-heat-pump-defrost-electric-power-w} @@ -1672,7 +1672,7 @@ \subsubsection{Inputs}\label{inputs-2-044} \paragraph{Field: Zone Terminal Unit Name \textless{}x\textgreater{}}\label{field-zone-terminal-unit-name-x} -This alpha field defines the name of the zone terminal unit used in a variable refrigerant air conditioner. The zone terminal unit must be connected to a zone using the \hyperref[zonehvacequipmentconnections]{ZoneHVAC:EquipmentConnections} object. The terminal unit air inlet node is the same name as a zone exhaust node. The terminal unit air outlet node is the same name as a zone inlet node. The IDD is supplied with 20 fields for this.~ The object is extensible and you can change the IDD by adding more fields or, if you are using text editor for your input file, just add to the list of names. +This alpha field defines the name of the zone terminal unit used in a variable refrigerant air conditioner. The zone terminal unit must be connected to a zone using the \hyperref[zonehvacequipmentconnections]{ZoneHVAC:EquipmentConnections} object. The terminal unit air inlet node is the same name as a zone exhaust node. The terminal unit air outlet node is the same name as a zone inlet node. This object is extensible, so additional fields of this type can be added to the end of this object. Following is an example input for a ZoneTerminalUnitList object. diff --git a/doc/input-output-reference/src/overview/group-water-heaters.tex b/doc/input-output-reference/src/overview/group-water-heaters.tex index 97a6890e85a..2f09b4be28c 100644 --- a/doc/input-output-reference/src/overview/group-water-heaters.tex +++ b/doc/input-output-reference/src/overview/group-water-heaters.tex @@ -879,7 +879,7 @@ \subsubsection{Inputs}\label{inputs-1-049} \paragraph{Field: Number Of Nodes}\label{field-number-of-nodes-000} -The number of stratified nodes in the tank. There must be at least one node. The maximum number of nodes is 12, although this limit can be increased by editing the IDD. +The number of stratified nodes in the tank. There must be at least one node. The maximum number of nodes is 12. \paragraph{Field: Additional Destratification Conductivity}\label{field-additional-destratification-conductivity-000} @@ -1057,8 +1057,6 @@ \subsection{WaterHeater:Sizing}\label{waterheatersizing} A source of design input data for use with this object can be found in the current ASHRAE Handbook HVAC Applications chapter on Service Water Heating. -The idd entry for this object follows. - \subsubsection{Inputs}\label{inputs-2-045} \paragraph{Field: WaterHeater Name}\label{field-waterheater-name} @@ -2604,7 +2602,7 @@ \subsubsection{Inputs}\label{inputs-23-003} \paragraph{Field: Number of Nodes}\label{field-number-of-nodes} -The number of stratified nodes in the tank. There must be at least one node. The maximum number of nodes is 10, although this limit can be increased by editing the IDD. +The number of stratified nodes in the tank. There must be at least one node. The maximum number of nodes is 10. \paragraph{Field: Additional Destratification Conductivity}\label{field-additional-destratification-conductivity} diff --git a/doc/input-output-reference/src/overview/group-zone-equipment.tex b/doc/input-output-reference/src/overview/group-zone-equipment.tex index a0eb00e021b..f236601b636 100644 --- a/doc/input-output-reference/src/overview/group-zone-equipment.tex +++ b/doc/input-output-reference/src/overview/group-zone-equipment.tex @@ -256,7 +256,7 @@ \subsubsection{Inputs}\label{inputs-2-048} \end{itemize} \paragraph{Field Set (Zone Equipment: Object Type, Name, Cooling Sequence, Heating or No-Load Sequence, Sequential Cooling Fraction Schedule, Sequential Heating Fraction Schedule)}\label{field-set-zone-equipment-object-type-name-cooling-sequence-heating-or-no-load-sequence} -This set is used together in order to sequence the equipment for heating and cooling. The \#1 sequence equipment will try to meet the entire demand with its capacity and then pass the results on to the \#2 and so on for both heating and cooling. This field set is extensible by duplicating the last four fields. +This set is used together in order to sequence the equipment for heating and cooling. The \#1 sequence equipment will try to meet the entire demand with its capacity and then pass the results on to the \#2 and so on for both heating and cooling. This object is extensible, so additional groups of the following four fields can be added to the end of this object. Equipment is simulated in the order specified by Zone Equipment Cooling Sequence and Zone Equipment Heating or No-Load Sequence, depending on the current thermostat request. For equipment of similar type, assign sequence 1 to the first system intended to serve that type of load, assign sequence 2 to the next system, and so on. For situations where one or more equipment types has limited capacity or limited control capability, order the sequence so that the most controllable piece of equipment runs last. For example, with a dedicated outdoor air system (DOAS), the air terminal for the DOAS should be assigned Heating Sequence = 1 and Cooling Sequence = 1. Any other equipment should be assigned sequence 2 or higher so that it will see the net load after the DOAS air is added to the zone. diff --git a/doc/input-output-reference/src/overview/group-zone-forced-air-units.tex b/doc/input-output-reference/src/overview/group-zone-forced-air-units.tex index b7050808255..2266d44f07f 100644 --- a/doc/input-output-reference/src/overview/group-zone-forced-air-units.tex +++ b/doc/input-output-reference/src/overview/group-zone-forced-air-units.tex @@ -2938,9 +2938,9 @@ \subsubsection{Inputs}\label{inputs-10-024} The name of the third air chiller that will be used to meet the zone cooling load. -\paragraph{Field: Air Chiller \#n ~Name (Extensible list, 20 provided in the IDD)}\label{field-air-chiller-n-name-extensible-list-20-provided-in-the-idd} +\paragraph{Field: Air Chiller \#n ~Name}\label{field-air-chiller-n-name} -The name of the nth air chiller that will be used to meet the zone cooling load. +The name of the nth air chiller that will be used to meet the zone cooling load. This object is extensible, so additional fields of this type can be added to the end of this object. The following is an example input for a refrigeration chiller set. @@ -4348,7 +4348,7 @@ \subsubsection{Inputs} This optional numeric field specifies the supply air mass flow rate ratio for Mode 0. Mass flow rate is not a controlled independent variable in Mode 0, it must be set to a particular value for all times that Mode 0 operates. Supply air mass flow rate ratio describes supply air mass flow rate as a fraction of the mass flow rate associated with the value in field: ''System Maximum Standard Density Supply Air Volume Flow Rate``. If this field is blank, the supply air mass flow rate ratio for Mode 0 will be 0.00. \paragraph{Field-Set: Mode Definition (extensible object)} -The definition of each operating mode is given as inputs to 25 fields. The first field specifies a unique name for the mode. The following eight fields specify the names of \hyperref[tablelookup]{Table:Lookup} objects that describe hybrid unit performance parameters. The remaining sixteen fields specify constraints on controlled independent variables, and constraints to describe the indoor and outdoor psychrometric conditions at which the mode is allowed. The definition of operating modes is extensible. To define multiple modes, repeat the following 25 fields with appropriate input values for each mode. The object does not require that modes be defined in a particular order. Up to 25 modes can be defined in this way. +The definition of each operating mode is given as inputs to 25 fields. The first field specifies a unique name for the mode. The following eight fields specify the names of \hyperref[tablelookup]{Table:Lookup} objects that describe hybrid unit performance parameters. The remaining sixteen fields specify constraints on controlled independent variables, and constraints to describe the indoor and outdoor psychrometric conditions at which the mode is allowed. The definition of operating modes is extensible. To define multiple modes, repeat the following 25 fields with appropriate input values for each mode. The object does not require that modes be defined in a particular order. This object is extensible, so additional groups of these 25 fields can be added to the end of this object. \paragraph{Field: Mode \# Name} This alpha input field specifies a unique user-assigned descriptive name for Mode \#. Each desired mode must have a mode name in order for that mode to be included in the simulation. diff --git a/doc/input-output-reference/src/overview/idd-conventions.tex b/doc/input-output-reference/src/overview/idd-conventions.tex index d0e710edb89..30db5999e02 100644 --- a/doc/input-output-reference/src/overview/idd-conventions.tex +++ b/doc/input-output-reference/src/overview/idd-conventions.tex @@ -3,7 +3,8 @@ \section{IDD Conventions}\label{idd-conventions} The following is a basic description of the structure of the IDD (it's actually taken directly from the IDD file). As noted within, \textbf{!} signifies a comment character as does the \textbf{\textbackslash{}}. \textbf{\textbackslash{}} has also been adopted as a convention for including more specific comments about each field in an object. These have been used with success in the IDFEditor and it is hoped the flexibility will provide other interface developers with useful information. \begin{lstlisting} -!IDD_Version **VERSION NUMBER** +!IDD_Version ${CMAKE_VERSION_MAJOR}.${CMAKE_VERSION_MINOR}.${CMAKE_VERSION_PATCH} +!IDD_BUILD ${CMAKE_VERSION_BUILD} ! ************************************************************************** ! This file is the Input Data Dictionary (IDD) for EnergyPlus. ! The IDD defines the syntax and data model for each type of input "Object." @@ -13,14 +14,14 @@ \section{IDD Conventions}\label{idd-conventions} ! ------------------ ! To define an object (a record with data), develop a key word that is unique ! Each data item to the object can be A (Alphanumeric string) or N (numeric) -! Number each A and N. This will show how the data items will be put into the +! Number each A and N. This will show how the data items will be put into the ! arrays that are passed to the Input Processor "Get" (GetObjectItem) routines. -! All alpha fields are limited to 100 characters. Numeric fields should be +! All alpha fields are limited to 100 characters. Numeric fields should be ! valid numerics (can include such as 1.0E+05) and are placed into double ! precision variables. ! ! NOTE: Even though a field may be optional, a comma representing that field -! must be included (unless it is the last field in the object). Since the +! must be included (unless it is the last field in the object). Since the ! entire input is "field-oriented" and not "keyword-oriented", the EnergyPlus ! Input Processor must have some representation (even if blank) for each ! field. @@ -28,7 +29,7 @@ \section{IDD Conventions}\label{idd-conventions} ! Object Documentation ! -------------------- ! In addition, the following special comments appear one per line and -! most are followed by a value. Comments may apply to a field or the object +! most are followed by a value. Comments may apply to a field or the object ! or a group of objects. ! ! Field-level comments: @@ -39,11 +40,14 @@ \section{IDD Conventions}\label{idd-conventions} ! \note Note describing the field and its valid values. If multiple lines, ! start each line with \note. Limit line length to 100 characters. ! -! \required-field To flag fields which may not be left blank +! \required-field To flag fields which must have a value. If the idf input is blank and +! there is a \default, then the default will be used. However, as of v8.6.0 +! the use of \required-field and \default on the same field is discouraged +! and instances with both have been changed. ! (this comment has no "value") ! ! \begin-extensible Marks the first field at which the object accepts an extensible -! field set. A fixed number of fields from this marker define the +! field set. A fixed number of fields from this marker define the ! extensible field set, see the object code \extensible for ! more information. ! @@ -66,7 +70,10 @@ \section{IDD Conventions}\label{idd-conventions} ! ! \maximum< Maximum that must be < than the following value ! -! \default Default for the field (if N/A then omit entire line) +! \default Default for the field (if N/A then omit entire line). If a default is +! added to an existing field, then \required-field should be removed if present. +! Defaults are filled in only if the field is within \min-fields, or the actual +! object is longer than this field. ! ! \deprecated This field is not really used and will be deleted from the object. ! The required information is gotten internally or @@ -74,14 +81,14 @@ \section{IDD Conventions}\label{idd-conventions} ! ! \autosizable Flag to indicate that this field can be used with the Auto ! Sizing routines to produce calculated results for the -! field. If a value follows this, then that will be used -! when the "Autosize" feature is flagged. To trigger +! field. If a value follows this, then that will be used +! when the "Autosize" feature is flagged. To trigger ! autosizing for a field, enter Autosize as the field's -! value. Only applicable to numeric fields. +! value. Only applicable to numeric fields. ! -! \autocalculatable Flag to indicate that this field can be automatically +! \autocalculatable Flag to indicate that this field can be automatically ! calculated. To trigger auto calculation for a field, enter -! Autocalculate as the field's value. Only applicable to +! Autocalculate as the field's value. Only applicable to ! numeric fields. ! ! \type Type of data for the field - @@ -155,26 +162,26 @@ \section{IDD Conventions}\label{idd-conventions} ! (this comment has no "value") ! ! \min-fields Minimum number of fields that should be included in the -! object. If appropriate, the Input Processor will fill +! object. If appropriate, the Input Processor will fill ! any missing fields with defaults (for numeric fields). ! It will also supply that number of fields to the "get" ! routines using blanks for alpha fields (note -- blanks ! may not be allowable for some alpha fields). ! ! \obsolete This object has been replaced though is kept (and is read) -! in the current version. Please refer to documentation as -! to the dispersal of the object. If this object is +! in the current version. Please refer to documentation as +! to the dispersal of the object. If this object is ! encountered in an IDF, the InputProcessor will post an ! appropriate message to the error file. -! usage: \obsolete New = >[New object name] +! usage: \obsolete New=>[New object name] ! -! \extensible:<\#> This object is dynamically extensible -- meaning, if you +! \extensible:<#> This object is dynamically extensible -- meaning, if you ! change the IDD appropriately (if the object has a simple list ! structure -- just add items to the list arguments (i.e. BRANCH ! LIST). These will be automatically redimensioned and used during -! the simulation. <\#> should be entered by the developer to signify +! the simulation. <#> should be entered by the developer to signify ! how many of the last fields are needed to be extended (and EnergyPlus -! will attempt to auto-extend the object). The first field of the first +! will attempt to auto-extend the object). The first field of the first ! instance of the extensible field set is marked with \begin-extensible. ! ! \begin-extensible See previous item, marks beginning of extensible fields in @@ -207,10 +214,10 @@ \section{IDD Conventions}\label{idd-conventions} ! Notes on comments ! ----------------- ! -! 1. If a particular comment is not applicable (such as units, or default) +! 1. If a particular comment is not applicable (such as units, or default) ! then simply omit the comment rather than indicating N/A. ! -! 2. Memos and notes should be brief (recommend 5 lines or less per block). +! 2. Memos and notes should be brief (recommend 5 lines or less per block). ! More extensive explanations are expected to be in the user documentation \end{lstlisting} diff --git a/doc/input-output-reference/src/overview/what-s-different-about-energyplus-input.tex b/doc/input-output-reference/src/overview/what-s-different-about-energyplus-input.tex index 8408ddfce5d..ec83f8d71b4 100644 --- a/doc/input-output-reference/src/overview/what-s-different-about-energyplus-input.tex +++ b/doc/input-output-reference/src/overview/what-s-different-about-energyplus-input.tex @@ -8,17 +8,17 @@ \section{What's different about EnergyPlus Input and Output?}\label{whats-differ \subsection{EnergyPlus Input Processing}\label{energyplus-input-processing} -1)~~~~EnergyPlus reads the data dictionary (Energy+.idd) and the input data file (in.idf) prior to doing anything else. Only after this is done does processing start. HOWEVER, the input processor only knows as much as the data dictionary has told it. It knows which fields should be alpha and which should be numeric. All of this information (including the IDD) is echoed to the audit file (audit.out) in case errors occur. Most of the errors show up (out of context) in the standard error file (eplusout.err) -- there might be enough information to decipher where the error is or you may have to look at the more inclusive audit file. Invalid numeric fields are detected during this processing and default numeric fields are filled. For more information on the IDD, its structure and implications, please see the IDD Conventions discussion below. +1)~~~~EnergyPlus is compiled with a specific the data dictionary (Energy+.idd) and the input data file (in.idf) is read prior to doing anything else. Only after this is done does processing start. HOWEVER, the input processor only knows as much as the data dictionary has told it. It knows which fields should be alpha and which should be numeric. All of this information (including the IDD) is echoed to the audit file (audit.out) in case errors occur. Most of the errors show up (out of context) in the standard error file (eplusout.err) -- there might be enough information to decipher where the error is or you may have to look at the more inclusive audit file. Invalid numeric fields are detected during this processing and default numeric fields are filled. For more information on the IDD, its structure and implications, please see the IDD Conventions discussion below. 2)~~~~The biggest difference between EnergyPlus and more traditional input processing is that EnergyPlus is modular in its actual filling in the details for the simulation. Because of the modular structure of EnergyPlus, each module is responsible for ``getting'' its own input. It receives this input from the input processor in the form of alpha and numeric fields. Each module typically gets all its input the first time it is called. The implication for the user is that error messages may show up in somewhat peculiar places. A further implication is that no order is needed in the input data file!~ Data that is not needed by a particular simulation is not processed. -3)~~~~The data dictionary has the capability to do ``automatic'' range checking on numeric fields as well as fill in numeric defaults. Both filling in defaults and ``automatic'' range checking are done when the data is read. Other checks may need a combination of fields and won't be done until the data is ``processed'' (after the simulation starts). +3)~~~~The data dictionary provides the capability to do ``automatic'' range checking on numeric fields as well as fill in numeric defaults. Both filling in defaults and ``automatic'' range checking are done when the data is read. Other checks may need a combination of fields and won't be done until the data is ``processed'' (after the simulation starts). 4)~~~~A couple of other differences that might not be true in other programs:~ Blanks are significant in alpha fields \textbf{SO} DesignDay is not the same as Design Day (1 space between Design and Day) nor Design~ Day (2 spaces between Design and Day). Alpha objects, however, \emph{are} case insensitive SO DesignDay is the same as `designday' or `\hyperref[sizingperioddesignday]{SizingPeriod:DesignDay}'. \subsection{General Input Rules}\label{general-input-rules} -Rules shown here are for the input data files. Rules about the Input Data Dictionary are shown in the Interface Developer's Guide (there is much similarity and overlap) but most users don't need to touch the IDD (Input Data Dictionary). +Rules shown here are for the input data files. Rules about the Input Data Dictionary are shown in the Interface Developer's Guide (there is much similarity and overlap) but most users can view the IDD (Input Data Dictionary) as an additional quick reference for EnergyPlus. The input data file is the primary file that EnergyPlus uses to create the building simulation. The only additional files are referenced by certain objects (such as the \hyperref[schedulefile]{Schedule:File} object). The input is order-independent; data can appear in any order and will be retrieved and sorted as necessary by the EnergyPlus simulation modules.~ In addition, EnergyPlus allocates everything dynamically, so there are no limitations as to number of zones, surfaces, etc. diff --git a/doc/input-output-reference/src/standard-output-reports/output-table-annual.tex b/doc/input-output-reference/src/standard-output-reports/output-table-annual.tex index 7fa72b0789e..a4bbb5c47a4 100644 --- a/doc/input-output-reference/src/standard-output-reports/output-table-annual.tex +++ b/doc/input-output-reference/src/standard-output-reports/output-table-annual.tex @@ -16,10 +16,6 @@ \subsection{Inputs}\label{inputs-062} Optional schedule name. If left blank, aggregation is performed for all hours simulated. If a schedule is specified, aggregation is performed for non-zero hours in the schedule. -\paragraph{Field Set: Variable and Aggregation Type}\label{field-set-variable-and-aggregation-type} - -The Variable Name field and the Aggregation Type field may be repeated for each column desired in the report. These two fields define each column of the report. The IDD object has been set up to allow up to 25 columns. This object is extensible, so the number of columns may be increased by editing the IDD file and adding the desired number of fields at the end of the object. - \paragraph{Field: Variable or Meter \textless{}\#\textgreater{} Name}\label{field-variable-or-meter-name} The remainder of this input object consists of pairs of fields that can be repeatedVariable Or Meter Name fields contain the name of a variable (see \hyperref[outputvariable]{Output:Variable} and eplusout.rdd), meter (see \hyperref[outputmeter-and-outputmetermeterfileonly]{Output:Meter} and eplusout.mdd), or schedule. This value is shown using the aggregation method specified. If the selected name is used for both a variable or a meter and a schedule name, the variable or meter will be used. @@ -70,7 +66,7 @@ \subsection{Inputs}\label{inputs-062} The Digits After Decimal field is a numeric value that indicates how many digits after the decimal point should be shown for that column. -An example of this object follows. +The VariableOrMeterName, AggregationType, and DigitsAfterDecimal fields may be repeated for each column desired in the annual report. These three fields define each column of the report. These fields are extensible, so additional groups of these fields can be added to the end of this object. An example of this object follows. \begin{lstlisting} diff --git a/doc/input-output-reference/src/standard-output-reports/output-table-monthly.tex b/doc/input-output-reference/src/standard-output-reports/output-table-monthly.tex index f215622518e..479fef4df9a 100644 --- a/doc/input-output-reference/src/standard-output-reports/output-table-monthly.tex +++ b/doc/input-output-reference/src/standard-output-reports/output-table-monthly.tex @@ -12,10 +12,6 @@ \subsection{Inputs}\label{inputs-063} The Digits After Decimal field is a numeric value that indicates how many digits after the decimal point should be shown on the table of values. -\paragraph{Field Set: Variable or Meter and Aggregation Type}\label{field-set-variable-or-meter-and-aggregation-type} - -The VariableOrMeterName field and the AggregationType field may be repeated for each column desired in the monthly report. These two fields define each column of the report. The IDD object has been set up to allow up to 25 columns. This object is extensible, so the number of columns may be increased by editing the IDD file and adding the desired number of fields at the end of the object. - \paragraph{Field: Variable or Meter \textless{}\#\textgreater{} Name}\label{field-variable-or-meter-name-000} The remainder of this input object consists of pairs of fields that can be repeatedVariable Or Meter Name fields contain the name of a variable (see \hyperref[outputvariable]{Output:Variable} and eplusout.rdd), meter (see \hyperref[outputmeter-and-outputmetermeterfileonly]{Output:Meter} and eplusout.mdd), or schedule. This value is shown on a monthly basis using the aggregation method specified. If the selected name is used for both a variable or a meter and a schedule name, the variable or meter will be used. @@ -56,7 +52,7 @@ \subsection{Inputs}\label{inputs-063} \textbf{MinimumDuringHoursShown} - Reports the minimum value and the time that the minimum value occurred but only during the hours reported with the previous ``hours-`` aggregation type. When the minimum option is used with a summed variable the value is divided by the length of the timestep in seconds. For example, the minimum for a variable in Joules is reported in Watts. Order of the variables in the report is important when using this aggregation type. -An example of this object follows. +The VariableOrMeterName and AggregationType fields may be repeated for each column desired in the monthly report. These two fields define each column of the report. These fields are extensible, so additional pairs of these fields can be added to the end of this object. An example of this object follows. \begin{lstlisting} diff --git a/doc/test/dependencies.tex b/doc/test/dependencies.tex index 3efc92f55f3..d7cd7847cbb 100644 --- a/doc/test/dependencies.tex +++ b/doc/test/dependencies.tex @@ -11,6 +11,7 @@ \usepackage{listings} \usepackage{enumitem} \usepackage[per-mode=symbol]{siunitx} +\PassOptionsToPackage{hyphens}{url}\usepackage[breaklinks=true]{hyperref} \title{Test Build with Dependencies} \author{Probably CI} @@ -18,6 +19,18 @@ \begin{document} +% Reference for making your own Title Page: +% http://tex.stackexchange.com/questions/10130/use-the-values-of-title-author-and-date-on-a-custom-title-page +\makeatletter +\begin{titlepage} + \begin{center} + {\scshape\LARGE EnergyPlus\texttrademark{} Test Documentation \par} + \vspace{1.5cm} + {\bfseries\huge \@title \par} + \vspace{1.5cm} + {\Large\itshape \@author \par} + \vspace{2.5cm} + This document is a test to make sure the build system can build the rest of the documentation. It should be built with XeTeX, which is the core dependency for building the E+ docs. @@ -28,5 +41,31 @@ In any case, when a developer attempts to build this on a machine, it will have a nice benefit of installing the missing packages (if the install is set up to do that). This is especially nice for CI package builds because miktex is acting weird while trying to build all the documents in multiple threads. I think the package update manager is getting confused occasionally with everything going on. + \vfill + + + + % Bottom of the page + {\large \today \par} + \vspace{1.5cm} + {\large Build: 7d8b8c6b02 \par} + \end{center} + {\small + } +\end{titlepage} +\makeatother + +{ +\setcounter{tocdepth}{2} +\tableofcontents +} + +\hypertarget{generated-toc}{} + +\chapter{A chapter}\label{chapter-1} + +\section{A section}\label{chapter-1-section-1} + +An example section \end{document} diff --git a/idd/Energy+.idd.in b/idd/Energy+.idd.in index 4ee879d9455..4413748ca9b 100644 --- a/idd/Energy+.idd.in +++ b/idd/Energy+.idd.in @@ -5,6 +5,14 @@ ! The IDD defines the syntax and data model for each type of input "Object." ! Lines in EnergyPlus input files (and IDD) are limited to 500 characters. ! +! +! Note on IDD Processing/Usage +! ---------------------------- +! The IDD is converted to the epJSON schema and compiled into the EnergyPlus exe. +! Any modification to this IDD will have no impact on EnergyPlus input processing +! without rebuilding the exe. Only the IDF Editor and possibly other third-party +! tools read the IDD directly. +! ! Object Description ! ------------------ ! To define an object (a record with data), develop a key word that is unique @@ -170,14 +178,17 @@ ! appropriate message to the error file. ! usage: \obsolete New=>[New object name] ! -! \extensible:<#> This object is dynamically extensible -- meaning, if you -! change the IDD appropriately (if the object has a simple list -! structure -- just add items to the list arguments (i.e. BRANCH -! LIST). These will be automatically redimensioned and used during -! the simulation. <#> should be entered by the developer to signify -! how many of the last fields are needed to be extended (and EnergyPlus -! will attempt to auto-extend the object). The first field of the first -! instance of the extensible field set is marked with \begin-extensible. +! \extensible:<#> This object is dynamically extensible -- meaning the input +! object may be extended beyond the number of fields shown in +! the IDD. <#> signifies the size of the extensible field set. +! The first field of the first instance of the extensible field +! set is marked with \begin-extensible. EnergyPlus will accept +! an extensible object of any length as long as the extended +! fields match the extensible field set size. Note that the +! classic windows IDF Editor limits objects to the number of +! fields specified in the IDD. Editing the IDD enables IDF +! Editor to read longer objects. In the epJSON schema, each +! extensible group is a named array. See Energy+.schema.epJSON ! ! \begin-extensible See previous item, marks beginning of extensible fields in ! an object. @@ -61998,17 +62009,19 @@ AirConditioner:VariableRefrigerantFlow, \note Enter the coefficient of performance at rated conditions or leave blank to use default. \note COP includes compressor and condenser fan electrical energy input \note COP does not include supply fan heat or supply fan electric power input - N3 , \field Minimum Outdoor Temperature in Cooling Mode + N3 , \field Minimum Condenser Inlet Node Temperature in Cooling Mode \type real \units C \default -6.0 - \note Enter the minimum outdoor temperature allowed for cooling operation. + \note For cooling mode operation, enter the minimum inlet outdoor air dry-bulb temperature + \note for air-cooled units or minimum inlet water temperature for water-cooled units. \note Cooling is disabled below this temperature. - N4 , \field Maximum Outdoor Temperature in Cooling Mode + N4 , \field Maximum Condenser Inlet Node Temperature in Cooling Mode \type real \units C \default 43.0 - \note Enter the maximum outdoor temperature allowed for cooling operation. + \note For cooling mode operation, enter the maximum inlet outdoor air dry-bulb temperature + \note for air-cooled units or maximum inlet water temperature for water-cooled units. \note Cooling is disabled above this temperature. A3 , \field Cooling Capacity Ratio Modifier Function of Low Temperature Curve Name \type object-list @@ -62102,16 +62115,20 @@ AirConditioner:VariableRefrigerantFlow, \note COP includes compressor and condenser fan electrical energy input \note COP does not include supply fan heat or supply fan electrical energy input \default 3.4 - N8 , \field Minimum Outdoor Temperature in Heating Mode + N8 , \field Minimum Condenser Inlet Node Temperature in Heating Mode \type real \units C \default -20.0 - \note Enter the minimum outdoor temperature allowed for heating operation. - N9 , \field Maximum Outdoor Temperature in Heating Mode + \note For heating mode operation, enter the minimum inlet outdoor air dry-bulb temperature + \note for air-cooled units or minimum inlet water temperature for water-cooled units. + \note Heating is disabled below this temperature. + N9 , \field Maximum Condenser Inlet Node Temperature in Heating Mode \type real \units C \default 16.0 - \note Enter the maximum outdoor temperature allowed for heating operation. + \note For heating mode operation, enter the maximum inlet outdoor air dry-bulb temperature + \note for air-cooled units or maximum inlet water temperature for water-cooled units. + \note Heating is disabled below this temperature. A13, \field Heating Capacity Ratio Modifier Function of Low Temperature Curve Name \type object-list \object-list BivariateFunctions @@ -62422,16 +62439,18 @@ AirConditioner:VariableRefrigerantFlow, \key OtherFuel1 \key OtherFuel2 \default Electricity - N29, \field Minimum Outdoor Temperature in Heat Recovery Mode + N29, \field Minimum Condenser Inlet Node Temperature in Heat Recovery Mode \type real \units C - \note The minimum outdoor temperature below which heat - \note recovery mode will not operate. - N30, \field Maximum Outdoor Temperature in Heat Recovery Mode + \note For heat recovery mode operation, enter the minimum inlet outdoor air dry-bulb temperature + \note for air-cooled units or minimum inlet water temperature for water-cooled units. + \note Heat recovery is disabled below this temperature. + N30, \field Maximum Condenser Inlet Node Temperature in Heat Recovery Mode \type real \units C - \note The maximum outdoor temperature above which heat - \note recovery mode will not operate. + \note For heat recovery mode operation, enter the maximum inlet outdoor air dry-bulb temperature + \note for air-cooled units or maximum inlet water temperature for water-cooled units. + \note Heat recovery is disabled above this temperature. A40, \field Heat Recovery Cooling Capacity Modifier Curve Name \type object-list \object-list BivariateFunctions @@ -64447,7 +64466,7 @@ AirLoopHVAC:OutdoorAirSystem, \type object-list \object-list AirLoopOAEquipmentLists A4; \field Availability Manager List Name - \note Enter the name of an AvailabilityManagerAssignmentList object. + \note This field is not used and may be omitted or left blank. \type object-list \object-list SystemAvailabilityManagerLists diff --git a/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Elements.hpp b/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Elements.hpp index ca07e688620..a9f509632b3 100644 --- a/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Elements.hpp +++ b/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Elements.hpp @@ -576,13 +576,13 @@ namespace AirflowNetwork { struct ReferenceConditions // Surface crack standard conditions { // Members - std::string name; // Name of standard conditions component - Real64 temperature; // Standard temperature for crack data - Real64 pressure; // Standard barometric pressure for crack data - Real64 humidityRatio; // Standard humidity ratio for crack data + std::string name; // Name of standard conditions component + Real64 temperature; // Standard temperature for crack data + Real64 pressure; // Standard barometric pressure for crack data + Real64 humidity_ratio; // Standard humidity ratio for crack data - ReferenceConditions(const std::string &name, Real64 temperature = 20.0, Real64 pressure = 101325.0, Real64 humidityRatio = 0.0) - : name(name), temperature(temperature), pressure(pressure), humidityRatio(humidityRatio) + ReferenceConditions(const std::string &name, Real64 temperature = 20.0, Real64 pressure = 101325.0, Real64 humidity_ratio = 0.0) + : name(name), temperature(temperature), pressure(pressure), humidity_ratio(humidity_ratio) { } @@ -595,32 +595,32 @@ namespace AirflowNetwork { struct SurfaceCrack : public AirflowElement // Surface crack component { // Members - // std::string ExternalNodeNames; // Name of external node.Not required for internal surface - Real64 FlowCoef; // Air Mass Flow Coefficient When Window or Door Is Closed [kg/s at 1Pa] - Real64 FlowExpo; // Air Mass Flow exponent When Window or Door Is Closed [dimensionless] - Real64 StandardT; // Standard temperature for crack data - Real64 StandardP; // Standard barometric pressure for crack data - Real64 StandardW; // Standard humidity ratio for crack data + Real64 coefficient; // Air Mass Flow Coefficient When Window or Door Is Closed [kg/s at 1Pa] + Real64 exponent; // Air Mass Flow exponent When Window or Door Is Closed [dimensionless] + Real64 reference_density; // Reference density for crack data + Real64 reference_viscosity; // Reference viscosity for crack data // Default Constructor - SurfaceCrack() : FlowCoef(0.0), FlowExpo(0.0), StandardT(0.0), StandardP(0.0), StandardW(0.0) + SurfaceCrack() + : coefficient(0.0), exponent(0.0), reference_density(AIRDENSITY_CONSTEXPR(101325.0, 20.0, 0.0)), + reference_viscosity(AIRDYNAMICVISCOSITY(20.0)) { } - int calculate(EnergyPlusData &state, - bool const LFLAG, // Initialization flag.If = 1, use laminar relationship - Real64 const PDROP, // Total pressure drop across a component (P1 - P2) [Pa] - int const i, // Linkage number - [[maybe_unused]] const Real64 multiplier, // Element multiplier - [[maybe_unused]] const Real64 control, // Element control signal - const AirProperties &propN, // Node 1 properties - const AirProperties &propM, // Node 2 properties - std::array &F, // Airflow through the component [kg/s] - std::array &DF // Partial derivative: DF/DP + int calculate([[maybe_unused]] EnergyPlusData &state, + bool const linear, // Initialization flag.If = 1, use laminar relationship + Real64 const PDROP, // Total pressure drop across a component (P1 - P2) [Pa] + [[maybe_unused]] int const i, // Linkage number + const Real64 multiplier, // Element multiplier + const Real64 control, // Element control signal + const AirProperties &propN, // Node 1 properties + const AirProperties &propM, // Node 2 properties + std::array &F, // Airflow through the component [kg/s] + std::array &DF // Partial derivative: DF/DP ); virtual int calculate(EnergyPlusData &state, - const Real64 PDROP, // Total pressure drop across a component (P1 - P2) [Pa] + const Real64 pdrop, // Total pressure drop across a component (P1 - P2) [Pa] const Real64 multiplier, // Element multiplier const Real64 control, // Element control signal const AirProperties &propN, // Node 1 properties @@ -786,9 +786,10 @@ namespace AirflowNetwork { std::array NodeNums; // Node numbers int LinkNum; // Linkage number AirflowElement *element; // Pointer to airflow element + Real64 control; // Control value // Default Constructor - AirflowNetworkLinkage() : NodeHeights{{0.0, 0.0}}, CompNum(0), NodeNums{{0, 0}}, LinkNum(0) + AirflowNetworkLinkage() : NodeHeights{{0.0, 0.0}}, CompNum(0), NodeNums{{0, 0}}, LinkNum(0), element(nullptr), control(1.0) { } diff --git a/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Properties.hpp b/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Properties.hpp index 803e792306b..d30b85a4be3 100644 --- a/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Properties.hpp +++ b/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Properties.hpp @@ -51,6 +51,7 @@ #ifndef AIRDENSITY #include "../../../Psychrometrics.hh" #define AIRDENSITY(state, P, T, W) Psychrometrics::PsyRhoAirFnPbTdbW(state, P, T, W) +#define AIRDENSITY_CONSTEXPR(P, T, W) Psychrometrics::PsyRhoAirFnPbTdbW(P, T, W) #define AIRCP(W) Psychrometrics::PsyCpAirFnW(W) #else // Need a fallback diff --git a/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Solver.hpp b/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Solver.hpp index 2fc11e3d71d..29576d3f72d 100644 --- a/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Solver.hpp +++ b/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Solver.hpp @@ -74,11 +74,12 @@ namespace AirflowNetwork { { Real64 temperature{20.0}; // Real64 pressure; //{0.0}; // gage pressure - Real64 humidityRatio{0.0}; + Real64 humidity_ratio{0.0}; Real64 density{0.0}; - Real64 sqrtDensity{0.0}; + Real64 sqrt_density{0.0}; Real64 viscosity{AIRDYNAMICVISCOSITY(20.0)}; + AirProperties(); explicit AirProperties(double const airDensity); }; @@ -174,15 +175,14 @@ namespace AirflowNetwork { // Functions - int GenericCrack(EnergyPlusData &state, - Real64 &coef, // Flow coefficient - Real64 const expn, // Flow exponent - bool const LFLAG, // Initialization flag.If = 1, use laminar relationship - Real64 const PDROP, // Total pressure drop across a component (P1 - P2) [Pa] - const AirProperties &propN, // Node 1 properties - const AirProperties &propM, // Node 2 properties - std::array &F, // Airflow through the component [kg/s] - std::array &DF // Partial derivative: DF/DP + void generic_crack(Real64 &coef, // Flow coefficient + Real64 const expn, // Flow exponent + bool const LFLAG, // Initialization flag.If = 1, use laminar relationship + Real64 const PDROP, // Total pressure drop across a component (P1 - P2) [Pa] + const AirProperties &propN, // Node 1 properties + const AirProperties &propM, // Node 2 properties + std::array &F, // Airflow through the component [kg/s] + std::array &DF // Partial derivative: DF/DP ); int GenericDuct(Real64 const Length, // Duct length diff --git a/src/EnergyPlus/AirflowNetwork/src/Elements.cpp b/src/EnergyPlus/AirflowNetwork/src/Elements.cpp index 3f87829d72b..0685766b50a 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Elements.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Elements.cpp @@ -389,16 +389,16 @@ namespace AirflowNetwork { return 1; } - int SurfaceCrack::calculate(EnergyPlusData &state, - bool const LFLAG, // Initialization flag.If = 1, use laminar relationship - Real64 const PDROP, // Total pressure drop across a component (P1 - P2) [Pa] - int const i, // Linkage number - [[maybe_unused]] const Real64 multiplier, // Element multiplier - [[maybe_unused]] const Real64 control, // Element control signal - const AirProperties &propN, // Node 1 properties - const AirProperties &propM, // Node 2 properties - std::array &F, // Airflow through the component [kg/s] - std::array &DF // Partial derivative: DF/DP + int SurfaceCrack::calculate([[maybe_unused]] EnergyPlusData &state, + bool const linear, // Initialization flag. If true, use linear relationship + Real64 const pdrop, // Total pressure drop across a component (P1 - P2) [Pa] + [[maybe_unused]] int const i, // Linkage number + const Real64 multiplier, // Element multiplier + const Real64 control, // Element control signal + const AirProperties &propN, // Node 1 properties + const AirProperties &propM, // Node 2 properties + std::array &F, // Airflow through the component [kg/s] + std::array &DF // Partial derivative: DF/DP ) { // SUBROUTINE INFORMATION: @@ -407,7 +407,7 @@ namespace AirflowNetwork { // MODIFIED Lixing Gu, 2/1/04 // Revised the subroutine to meet E+ needs // MODIFIED Lixing Gu, 6/8/05 - // RE-ENGINEERED na + // RE-ENGINEERED Jason DeGraw // PURPOSE OF THIS SUBROUTINE: // This subroutine solves airflow for a surface crack component @@ -418,98 +418,62 @@ namespace AirflowNetwork { // REFERENCES: // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 CDM; - Real64 FL; - Real64 FT; - Real64 RhozNorm; - Real64 VisczNorm; - Real64 expn; - Real64 Ctl; - Real64 coef; - Real64 Corr; - Real64 VisAve; - Real64 Tave; - Real64 RhoCor; + // Real64 rhoz_norm = AIRDENSITY(StandardP, StandardT, StandardW); + // Real64 viscz_norm = 1.71432e-5 + 4.828e-8 * StandardT; - // Formats - // static gio::Fmt Format_901("(A5,I3,6X,4E16.7)"); + Real64 VisAve{0.5 * (propN.viscosity + propM.viscosity)}; + Real64 Tave{0.5 * (propN.temperature + propM.temperature)}; - // Crack standard condition from given inputs - if (i > state.dataAFNSolver->NetworkNumOfLinks - state.dataAirflowNetwork->NumOfLinksIntraZone) { - Corr = 1.0; - } else { - Corr = state.dataAirflowNetwork->MultizoneSurfaceData(i).Factor; - } - // CompNum = state.dataAirflowNetwork->AirflowNetworkCompData(j).TypeNum; - RhozNorm = AIRDENSITY(state, StandardP, StandardT, StandardW); - VisczNorm = 1.71432e-5 + 4.828e-8 * StandardT; + Real64 sign{1.0}; + Real64 upwind_temperature{propN.temperature}; + Real64 upwind_density{propN.density}; + Real64 upwind_viscosity{propN.viscosity}; + Real64 upwind_sqrt_density{propN.sqrt_density}; + Real64 abs_pdrop = pdrop; - expn = FlowExpo; - VisAve = (propN.viscosity + propM.viscosity) / 2.0; - Tave = (propN.temperature + propM.temperature) / 2.0; - if (PDROP >= 0.0) { - coef = FlowCoef / propN.sqrtDensity * Corr; - } else { - coef = FlowCoef / propM.sqrtDensity * Corr; + if (pdrop < 0.0) { + sign = -1.0; + upwind_temperature = propM.temperature; + upwind_density = propM.density; + upwind_viscosity = propM.viscosity; + upwind_sqrt_density = propM.sqrt_density; + abs_pdrop = -pdrop; } - if (LFLAG) { - // Initialization by linear relation. - if (PDROP >= 0.0) { - RhoCor = TOKELVIN(propN.temperature) / TOKELVIN(Tave); - Ctl = std::pow(RhozNorm / propN.density / RhoCor, expn - 1.0) * std::pow(VisczNorm / VisAve, 2.0 * expn - 1.0); - DF[0] = coef * propN.density / propN.viscosity * Ctl; - } else { - RhoCor = TOKELVIN(propM.temperature) / TOKELVIN(Tave); - Ctl = std::pow(RhozNorm / propM.density / RhoCor, expn - 1.0) * std::pow(VisczNorm / VisAve, 2.0 * expn - 1.0); - DF[0] = coef * propM.density / propM.viscosity * Ctl; - } - F[0] = -DF[0] * PDROP; + Real64 coef = coefficient * control * multiplier / upwind_sqrt_density; + + // Laminar calculation + Real64 RhoCor{TOKELVIN(upwind_temperature) / TOKELVIN(Tave)}; + Real64 Ctl{std::pow(reference_density / upwind_density / RhoCor, exponent - 1.0) * + std::pow(reference_viscosity / VisAve, 2.0 * exponent - 1.0)}; + Real64 CDM{coef * upwind_density / upwind_viscosity * Ctl}; + Real64 FL{CDM * pdrop}; + Real64 abs_FT; + + if (linear) { + DF[0] = CDM; + F[0] = FL; } else { - // Standard calculation. - if (PDROP >= 0.0) { - // Flow in positive direction. - // Laminar flow. - RhoCor = TOKELVIN(propN.temperature) / TOKELVIN(Tave); - Ctl = std::pow(RhozNorm / propN.density / RhoCor, expn - 1.0) * std::pow(VisczNorm / VisAve, 2.0 * expn - 1.0); - CDM = coef * propN.density / propN.viscosity * Ctl; - FL = CDM * PDROP; - // Turbulent flow. - if (expn == 0.5) { - FT = coef * propN.sqrtDensity * std::sqrt(PDROP) * Ctl; - } else { - FT = coef * propN.sqrtDensity * std::pow(PDROP, expn) * Ctl; - } + // Turbulent flow. + if (exponent == 0.5) { + abs_FT = coef * upwind_sqrt_density * std::sqrt(abs_pdrop) * Ctl; } else { - // Flow in negative direction. - // Laminar flow. - RhoCor = TOKELVIN(propM.temperature) / TOKELVIN(Tave); - Ctl = std::pow(RhozNorm / propM.density / RhoCor, expn - 1.0) * std::pow(VisczNorm / VisAve, 2.0 * expn - 1.0); - CDM = coef * propM.density / propM.viscosity * Ctl; - FL = CDM * PDROP; - // Turbulent flow. - if (expn == 0.5) { - FT = -coef * propM.sqrtDensity * std::sqrt(-PDROP) * Ctl; - } else { - FT = -coef * propM.sqrtDensity * std::pow(-PDROP, expn) * Ctl; - } + abs_FT = coef * upwind_sqrt_density * std::pow(abs_pdrop, exponent) * Ctl; } - // Select laminar or turbulent flow. - // if (LIST >= 4) gio::write(Unit21, Format_901) << " scr: " << i << PDROP << FL << FT; - if (std::abs(FL) <= std::abs(FT)) { + // Select linear or turbulent flow. + if (std::abs(FL) <= abs_FT) { F[0] = FL; DF[0] = CDM; } else { - F[0] = FT; - DF[0] = FT * expn / PDROP; + F[0] = sign * abs_FT; + DF[0] = F[0] * exponent / pdrop; } } return 1; } int SurfaceCrack::calculate(EnergyPlusData &state, - Real64 const PDROP, // Total pressure drop across a component (P1 - P2) [Pa] + Real64 const pdrop, // Total pressure drop across a component (P1 - P2) [Pa] const Real64 multiplier, // Element multiplier const Real64 control, // Element control signal const AirProperties &propN, // Node 1 properties @@ -524,7 +488,7 @@ namespace AirflowNetwork { // MODIFIED Lixing Gu, 2/1/04 // Revised the subroutine to meet E+ needs // MODIFIED Lixing Gu, 6/8/05 - // RE-ENGINEERED na + // RE-ENGINEERED Jason DeGraw // PURPOSE OF THIS SUBROUTINE: // This subroutine solves airflow for a surface crack component @@ -535,79 +499,53 @@ namespace AirflowNetwork { // REFERENCES: // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 CDM; - Real64 FL; - Real64 FT; - Real64 RhozNorm; - Real64 VisczNorm; - Real64 expn; - Real64 Ctl; - Real64 coef; - // Real64 Corr; - Real64 VisAve; - Real64 Tave; - Real64 RhoCor; - - // Formats - // static gio::Fmt Format_901("(A5,I3,6X,4E16.7)"); - - // Crack standard condition from given inputs - // if (i > NetworkNumOfLinks - state.dataAirflowNetwork->NumOfLinksIntraZone) { - // Corr = 1.0; - //} else { - // Corr = state.dataAirflowNetwork->MultizoneSurfaceData(i).Factor; - //} - // CompNum = state.dataAirflowNetwork->AirflowNetworkCompData(j).TypeNum; - RhozNorm = AIRDENSITY(state, StandardP, StandardT, StandardW); - VisczNorm = 1.71432e-5 + 4.828e-8 * StandardT; - - expn = FlowExpo; - VisAve = (propN.viscosity + propM.viscosity) / 2.0; - Tave = (propN.temperature + propM.temperature) / 2.0; - if (PDROP >= 0.0) { - coef = multiplier * control * FlowCoef / propN.sqrtDensity; + // Real64 rhoz_norm = AIRDENSITY(StandardP, StandardT, StandardW); + // Real64 viscz_norm = 1.71432e-5 + 4.828e-8 * StandardT; + + Real64 VisAve{0.5 * (propN.viscosity + propM.viscosity)}; + Real64 Tave{0.5 * (propN.temperature + propM.temperature)}; + + Real64 sign{1.0}; + Real64 upwind_temperature{propN.temperature}; + Real64 upwind_density{propN.density}; + Real64 upwind_viscosity{propN.viscosity}; + Real64 upwind_sqrt_density{propN.sqrt_density}; + Real64 abs_pdrop = pdrop; + + if (pdrop < 0.0) { + sign = -1.0; + upwind_temperature = propM.temperature; + upwind_density = propM.density; + upwind_viscosity = propM.viscosity; + upwind_sqrt_density = propM.sqrt_density; + abs_pdrop = -pdrop; + } + + Real64 coef = coefficient * control * multiplier / upwind_sqrt_density; + + // Laminar calculation + Real64 RhoCor{TOKELVIN(upwind_temperature) / TOKELVIN(Tave)}; + Real64 Ctl{std::pow(reference_density / upwind_density / RhoCor, exponent - 1.0) * + std::pow(reference_viscosity / VisAve, 2.0 * exponent - 1.0)}; + Real64 CDM{coef * upwind_density / upwind_viscosity * Ctl}; + Real64 FL{CDM * pdrop}; + Real64 abs_FT; + + // Turbulent flow. + if (exponent == 0.5) { + abs_FT = coef * upwind_sqrt_density * std::sqrt(abs_pdrop) * Ctl; } else { - coef = multiplier * control * FlowCoef / propM.sqrtDensity; + abs_FT = coef * upwind_sqrt_density * std::pow(abs_pdrop, exponent) * Ctl; } - - // Standard calculation. - if (PDROP >= 0.0) { - // Flow in positive direction. - // Laminar flow. - RhoCor = TOKELVIN(propN.temperature) / TOKELVIN(Tave); - Ctl = std::pow(RhozNorm / propN.density / RhoCor, expn - 1.0) * std::pow(VisczNorm / VisAve, 2.0 * expn - 1.0); - CDM = coef * propN.density / propN.viscosity * Ctl; - FL = CDM * PDROP; - // Turbulent flow. - if (expn == 0.5) { - FT = coef * propN.sqrtDensity * std::sqrt(PDROP) * Ctl; - } else { - FT = coef * propN.sqrtDensity * std::pow(PDROP, expn) * Ctl; - } - } else { - // Flow in negative direction. - // Laminar flow. - RhoCor = TOKELVIN(propM.temperature) / TOKELVIN(Tave); - Ctl = std::pow(RhozNorm / propM.density / RhoCor, expn - 1.0) * std::pow(VisczNorm / VisAve, 2.0 * expn - 1.0); - CDM = coef * propM.density / propM.viscosity * Ctl; - FL = CDM * PDROP; - // Turbulent flow. - if (expn == 0.5) { - FT = -coef * propM.sqrtDensity * std::sqrt(-PDROP) * Ctl; - } else { - FT = -coef * propM.sqrtDensity * std::pow(-PDROP, expn) * Ctl; - } - } - // Select laminar or turbulent flow. - // if (LIST >= 4) gio::write(Unit21, Format_901) << " scr: " << i << PDROP << FL << FT; - if (std::abs(FL) <= std::abs(FT)) { + // Select linear or turbulent flow. + if (std::abs(FL) <= abs_FT) { F[0] = FL; DF[0] = CDM; } else { - F[0] = FT; - DF[0] = FT * expn / PDROP; + F[0] = sign * abs_FT; + DF[0] = F[0] * exponent / pdrop; } + return 1; } @@ -655,9 +593,9 @@ namespace AirflowNetwork { Real64 coef = FlowCoef; if (PDROP >= 0.0) { - coef /= propN.sqrtDensity; + coef /= propN.sqrt_density; } else { - coef /= propM.sqrtDensity; + coef /= propM.sqrt_density; } if (LFLAG) { @@ -679,9 +617,9 @@ namespace AirflowNetwork { FL = CDM * PDROP; // Flow in positive direction for turbulent flow. if (FlowExpo == 0.5) { - FT = coef * propN.sqrtDensity * std::sqrt(PDROP); + FT = coef * propN.sqrt_density * std::sqrt(PDROP); } else { - FT = coef * propN.sqrtDensity * std::pow(PDROP, FlowExpo); + FT = coef * propN.sqrt_density * std::pow(PDROP, FlowExpo); } } else { // Flow in negative direction for laminar flow @@ -689,9 +627,9 @@ namespace AirflowNetwork { FL = CDM * PDROP; // Flow in negative direction for turbulent flow if (FlowExpo == 0.5) { - FT = -coef * propM.sqrtDensity * std::sqrt(-PDROP); + FT = -coef * propM.sqrt_density * std::sqrt(-PDROP); } else { - FT = -coef * propM.sqrtDensity * std::pow(-PDROP, FlowExpo); + FT = -coef * propM.sqrt_density * std::pow(-PDROP, FlowExpo); } } // Select laminar or turbulent flow. @@ -749,9 +687,9 @@ namespace AirflowNetwork { Real64 coef = FlowCoef; if (PDROP >= 0.0) { - coef /= propN.sqrtDensity; + coef /= propN.sqrt_density; } else { - coef /= propM.sqrtDensity; + coef /= propM.sqrt_density; } // Standard calculation. @@ -762,9 +700,9 @@ namespace AirflowNetwork { FL = CDM * PDROP; // Flow in positive direction for turbulent flow. if (FlowExpo == 0.5) { - FT = coef * propN.sqrtDensity * std::sqrt(PDROP); + FT = coef * propN.sqrt_density * std::sqrt(PDROP); } else { - FT = coef * propN.sqrtDensity * std::pow(PDROP, FlowExpo); + FT = coef * propN.sqrt_density * std::pow(PDROP, FlowExpo); } } else { // Flow in negative direction for laminar flow @@ -772,9 +710,9 @@ namespace AirflowNetwork { FL = CDM * PDROP; // Flow in negative direction for turbulent flow if (FlowExpo == 0.5) { - FT = -coef * propM.sqrtDensity * std::sqrt(-PDROP); + FT = -coef * propM.sqrt_density * std::sqrt(-PDROP); } else { - FT = -coef * propM.sqrtDensity * std::pow(-PDROP, FlowExpo); + FT = -coef * propM.sqrt_density * std::pow(-PDROP, FlowExpo); } } // Select laminar or turbulent flow. @@ -964,7 +902,8 @@ namespace AirflowNetwork { auto &solver = state.dataAFNSolver->solver; if (solver.AFECTL(i) <= 0.0) { // Speed = 0; treat fan as resistance. - return GenericCrack(state, FlowCoef, FlowExpo, LFLAG, PDROP, propN, propM, F, DF); + generic_crack(FlowCoef, FlowExpo, LFLAG, PDROP, propN, propM, F, DF); + return 1; } // Pressure rise at reference fan speed. if (solver.AFECTL(i) >= TranRat) { @@ -1092,7 +1031,8 @@ namespace AirflowNetwork { if (control <= 0.0) { // Speed = 0; treat fan as resistance. - return GenericCrack(state, FlowCoef, FlowExpo, false, PDROP, propN, propM, F, DF); + generic_crack(FlowCoef, FlowExpo, false, PDROP, propN, propM, F, DF); + return 1; } // Pressure rise at reference fan speed. if (control >= TranRat) { @@ -1223,9 +1163,9 @@ namespace AirflowNetwork { } else { // Turbulent flow. if (PDROP >= 0.0) { - F[0] = C * TurFlow * propN.sqrtDensity * std::pow(PDROP, FlowExpo); + F[0] = C * TurFlow * propN.sqrt_density * std::pow(PDROP, FlowExpo); } else { - F[0] = -C * TurFlow * propM.sqrtDensity * std::pow(-PDROP, FlowExpo); + F[0] = -C * TurFlow * propM.sqrt_density * std::pow(-PDROP, FlowExpo); } DF[0] = F[0] * FlowExpo / PDROP; } @@ -1284,9 +1224,9 @@ namespace AirflowNetwork { } else { // Turbulent flow. if (PDROP >= 0.0) { - F[0] = C * TurFlow * propN.sqrtDensity * std::pow(PDROP, FlowExpo); + F[0] = C * TurFlow * propN.sqrt_density * std::pow(PDROP, FlowExpo); } else { - F[0] = -C * TurFlow * propM.sqrtDensity * std::pow(-PDROP, FlowExpo); + F[0] = -C * TurFlow * propM.sqrt_density * std::pow(-PDROP, FlowExpo); } DF[0] = F[0] * FlowExpo / PDROP; } @@ -1352,9 +1292,9 @@ namespace AirflowNetwork { FL = CDM * PDROP; // Turbulent flow. if (FlowExpo == 0.5) { - FT = FlowCoef * propN.sqrtDensity * std::sqrt(PDROP); + FT = FlowCoef * propN.sqrt_density * std::sqrt(PDROP); } else { - FT = FlowCoef * propN.sqrtDensity * std::pow(PDROP, FlowExpo); + FT = FlowCoef * propN.sqrt_density * std::pow(PDROP, FlowExpo); } } else { // Flow in negative direction. @@ -1363,9 +1303,9 @@ namespace AirflowNetwork { FL = CDM * PDROP; // Turbulent flow. if (FlowExpo == 0.5) { - FT = -FlowCoef * propM.sqrtDensity * std::sqrt(-PDROP); + FT = -FlowCoef * propM.sqrt_density * std::sqrt(-PDROP); } else { - FT = -FlowCoef * propM.sqrtDensity * std::pow(-PDROP, FlowExpo); + FT = -FlowCoef * propM.sqrt_density * std::pow(-PDROP, FlowExpo); } } // Select laminar or turbulent flow. @@ -1429,9 +1369,9 @@ namespace AirflowNetwork { FL = CDM * PDROP; // Turbulent flow. if (FlowExpo == 0.5) { - FT = FlowCoef * propN.sqrtDensity * std::sqrt(PDROP); + FT = FlowCoef * propN.sqrt_density * std::sqrt(PDROP); } else { - FT = FlowCoef * propN.sqrtDensity * std::pow(PDROP, FlowExpo); + FT = FlowCoef * propN.sqrt_density * std::pow(PDROP, FlowExpo); } } else { // Flow in negative direction. @@ -1440,9 +1380,9 @@ namespace AirflowNetwork { FL = CDM * PDROP; // Turbulent flow. if (FlowExpo == 0.5) { - FT = -FlowCoef * propM.sqrtDensity * std::sqrt(-PDROP); + FT = -FlowCoef * propM.sqrt_density * std::sqrt(-PDROP); } else { - FT = -FlowCoef * propM.sqrtDensity * std::pow(-PDROP, FlowExpo); + FT = -FlowCoef * propM.sqrt_density * std::pow(-PDROP, FlowExpo); } } // Select laminar or turbulent flow. @@ -1992,9 +1932,9 @@ namespace AirflowNetwork { } if (PDROP >= 0.0) { - coeff /= propN.sqrtDensity; + coeff /= propN.sqrt_density; } else { - coeff /= propM.sqrtDensity; + coeff /= propM.sqrt_density; } // Add window multiplier with window close @@ -2009,12 +1949,14 @@ namespace AirflowNetwork { GDRHO = 9.8 * DRHO; // if (LIST >= 4) gio::write(Unit21, Format_903) << " DOR:" << i << n << m << PDROP << std::abs(DRHO) << MinRhoDiff; if (OpenFactor == 0.0) { - return GenericCrack(state, coeff, FlowExpo, LFLAG, PDROP, propN, propM, F, DF); + generic_crack(coeff, FlowExpo, LFLAG, PDROP, propN, propM, F, DF); + return 1; } if (std::abs(DRHO) < MinRhoDiff || LFLAG) { DPMID = PDROP - 0.5 * Height * GDRHO; // Initialization or identical temps: treat as one-way flow. - NF = GenericCrack(state, coeff, FlowExpo, LFLAG, DPMID, propN, propM, F, DF); + NF = 1; + generic_crack(coeff, FlowExpo, LFLAG, DPMID, propN, propM, F, DF); // if (LIST >= 4) gio::write(Unit21, Format_900) << " Drs:" << DPMID << F[0] << DF[0]; } else { // Possible two-way flow: @@ -2032,36 +1974,36 @@ namespace AirflowNetwork { if (Y <= 0.0) { // One-way flow (negative). if (DRHO >= 0.0) { - F[0] = -propM.sqrtDensity * std::abs(FH - F0); - DF[0] = propM.sqrtDensity * std::abs(DFH - DF0); + F[0] = -propM.sqrt_density * std::abs(FH - F0); + DF[0] = propM.sqrt_density * std::abs(DFH - DF0); } else { - F[0] = propN.sqrtDensity * std::abs(FH - F0); - DF[0] = propN.sqrtDensity * std::abs(DFH - DF0); + F[0] = propN.sqrt_density * std::abs(FH - F0); + DF[0] = propN.sqrt_density * std::abs(DFH - DF0); } // if (LIST >= 4) gio::write(Unit21, Format_900) << " Dr1:" << C << F[0] << DF[0]; } else if (Y >= Height) { // One-way flow (positive). if (DRHO >= 0.0) { - F[0] = propN.sqrtDensity * std::abs(FH - F0); - DF[0] = propN.sqrtDensity * std::abs(DFH - DF0); + F[0] = propN.sqrt_density * std::abs(FH - F0); + DF[0] = propN.sqrt_density * std::abs(DFH - DF0); } else { - F[0] = -propM.sqrtDensity * std::abs(FH - F0); - DF[0] = propM.sqrtDensity * std::abs(DFH - DF0); + F[0] = -propM.sqrt_density * std::abs(FH - F0); + DF[0] = propM.sqrt_density * std::abs(DFH - DF0); } // if (LIST >= 4) gio::write(Unit21, Format_900) << " Dr2:" << C << F[0] << DF[0]; } else { // Two-way flow. NF = 2; if (DRHO >= 0.0) { - F[0] = -propM.sqrtDensity * FH; - DF[0] = propM.sqrtDensity * DFH; - F[1] = propN.sqrtDensity * F0; - DF[1] = propN.sqrtDensity * DF0; + F[0] = -propM.sqrt_density * FH; + DF[0] = propM.sqrt_density * DFH; + F[1] = propN.sqrt_density * F0; + DF[1] = propN.sqrt_density * DF0; } else { - F[0] = propN.sqrtDensity * FH; - DF[0] = propN.sqrtDensity * DFH; - F[1] = -propM.sqrtDensity * F0; - DF[1] = propM.sqrtDensity * DF0; + F[0] = propN.sqrt_density * FH; + DF[0] = propN.sqrt_density * DFH; + F[1] = -propM.sqrt_density * F0; + DF[1] = propM.sqrt_density * DF0; } // if (LIST >= 4) gio::write(Unit21, Format_900) << " Dr3:" << C << F[0] << DF[0]; // if (LIST >= 4) gio::write(Unit21, Format_900) << " Dr4:" << C << F[1] << DF[1]; @@ -2191,9 +2133,9 @@ namespace AirflowNetwork { FL = CDM * PDROP; // Turbulent flow. if (FlowExpo == 0.5) { - FT = FlowCoef * propN.sqrtDensity * std::sqrt(PDROP); + FT = FlowCoef * propN.sqrt_density * std::sqrt(PDROP); } else { - FT = FlowCoef * propN.sqrtDensity * std::pow(PDROP, FlowExpo); + FT = FlowCoef * propN.sqrt_density * std::pow(PDROP, FlowExpo); } } else { // Flow in negative direction. @@ -2202,9 +2144,9 @@ namespace AirflowNetwork { FL = CDM * PDROP; // Turbulent flow. if (FlowExpo == 0.5) { - FT = -FlowCoef * propM.sqrtDensity * std::sqrt(-PDROP); + FT = -FlowCoef * propM.sqrt_density * std::sqrt(-PDROP); } else { - FT = -FlowCoef * propM.sqrtDensity * std::pow(-PDROP, FlowExpo); + FT = -FlowCoef * propM.sqrt_density * std::pow(-PDROP, FlowExpo); } } // Select laminar or turbulent flow. @@ -2271,9 +2213,9 @@ namespace AirflowNetwork { FL = CDM * PDROP; // Turbulent flow. if (FlowExpo == 0.5) { - FT = FlowCoef * propN.sqrtDensity * std::sqrt(PDROP); + FT = FlowCoef * propN.sqrt_density * std::sqrt(PDROP); } else { - FT = FlowCoef * propN.sqrtDensity * std::pow(PDROP, FlowExpo); + FT = FlowCoef * propN.sqrt_density * std::pow(PDROP, FlowExpo); } } else { // Flow in negative direction. @@ -2282,9 +2224,9 @@ namespace AirflowNetwork { FL = CDM * PDROP; // Turbulent flow. if (FlowExpo == 0.5) { - FT = -FlowCoef * propM.sqrtDensity * std::sqrt(-PDROP); + FT = -FlowCoef * propM.sqrt_density * std::sqrt(-PDROP); } else { - FT = -FlowCoef * propM.sqrtDensity * std::pow(-PDROP, FlowExpo); + FT = -FlowCoef * propM.sqrt_density * std::pow(-PDROP, FlowExpo); } } // Select laminar or turbulent flow. @@ -3123,9 +3065,9 @@ namespace AirflowNetwork { VisAve = (propN.viscosity + propM.viscosity) / 2.0; Tave = (propN.temperature + propM.temperature) / 2.0; if (PDROP >= 0.0) { - coef = FlowCoef / propN.sqrtDensity * Corr; + coef = FlowCoef / propN.sqrt_density * Corr; } else { - coef = FlowCoef / propM.sqrtDensity * Corr; + coef = FlowCoef / propM.sqrt_density * Corr; } if (LFLAG) { @@ -3151,9 +3093,9 @@ namespace AirflowNetwork { FL = CDM * PDROP; // Turbulent flow. if (expn == 0.5) { - FT = coef * propN.sqrtDensity * std::sqrt(PDROP) * Ctl; + FT = coef * propN.sqrt_density * std::sqrt(PDROP) * Ctl; } else { - FT = coef * propN.sqrtDensity * std::pow(PDROP, expn) * Ctl; + FT = coef * propN.sqrt_density * std::pow(PDROP, expn) * Ctl; } } else { // Flow in negative direction. @@ -3164,9 +3106,9 @@ namespace AirflowNetwork { FL = CDM * PDROP; // Turbulent flow. if (expn == 0.5) { - FT = -coef * propM.sqrtDensity * std::sqrt(-PDROP) * Ctl; + FT = -coef * propM.sqrt_density * std::sqrt(-PDROP) * Ctl; } else { - FT = -coef * propM.sqrtDensity * std::pow(-PDROP, expn) * Ctl; + FT = -coef * propM.sqrt_density * std::pow(-PDROP, expn) * Ctl; } } // Select laminar or turbulent flow. @@ -3248,9 +3190,9 @@ namespace AirflowNetwork { VisAve = (propN.viscosity + propM.viscosity) / 2.0; Tave = (propN.temperature + propM.temperature) / 2.0; if (PDROP >= 0.0) { - coef = control * FlowCoef / propN.sqrtDensity; + coef = control * FlowCoef / propN.sqrt_density; } else { - coef = control * FlowCoef / propM.sqrtDensity; + coef = control * FlowCoef / propM.sqrt_density; } // Standard calculation. @@ -3263,9 +3205,9 @@ namespace AirflowNetwork { FL = CDM * PDROP; // Turbulent flow. if (expn == 0.5) { - FT = coef * propN.sqrtDensity * std::sqrt(PDROP) * Ctl; + FT = coef * propN.sqrt_density * std::sqrt(PDROP) * Ctl; } else { - FT = coef * propN.sqrtDensity * std::pow(PDROP, expn) * Ctl; + FT = coef * propN.sqrt_density * std::pow(PDROP, expn) * Ctl; } } else { // Flow in negative direction. @@ -3276,9 +3218,9 @@ namespace AirflowNetwork { FL = CDM * PDROP; // Turbulent flow. if (expn == 0.5) { - FT = -coef * propM.sqrtDensity * std::sqrt(-PDROP) * Ctl; + FT = -coef * propM.sqrt_density * std::sqrt(-PDROP) * Ctl; } else { - FT = -coef * propM.sqrtDensity * std::pow(-PDROP, expn) * Ctl; + FT = -coef * propM.sqrt_density * std::pow(-PDROP, expn) * Ctl; } } // Select laminar or turbulent flow. @@ -3362,7 +3304,8 @@ namespace AirflowNetwork { // Check which zone is higher if (Fact == 0.0) { - return GenericCrack(state, coef, expn, LFLAG, PDROP, propN, propM, F, DF); + generic_crack(coef, expn, LFLAG, PDROP, propN, propM, F, DF); + return 1; } fma12 = 0.0; @@ -3487,9 +3430,9 @@ namespace AirflowNetwork { VisAve = (propN.viscosity + propM.viscosity) / 2.0; Tave = (propN.temperature + propM.temperature) / 2.0; if (PDROP >= 0.0) { - coef = FlowCoef / propN.sqrtDensity * Corr; + coef = FlowCoef / propN.sqrt_density * Corr; } else { - coef = FlowCoef / propM.sqrtDensity * Corr; + coef = FlowCoef / propM.sqrt_density * Corr; } if (LFLAG) { @@ -3515,9 +3458,9 @@ namespace AirflowNetwork { FL = CDM * PDROP; // Turbulent flow. if (expn == 0.5) { - FT = coef * propN.sqrtDensity * std::sqrt(PDROP) * Ctl; + FT = coef * propN.sqrt_density * std::sqrt(PDROP) * Ctl; } else { - FT = coef * propN.sqrtDensity * std::pow(PDROP, expn) * Ctl; + FT = coef * propN.sqrt_density * std::pow(PDROP, expn) * Ctl; } } else { // Flow in negative direction. @@ -3528,9 +3471,9 @@ namespace AirflowNetwork { FL = CDM * PDROP; // Turbulent flow. if (expn == 0.5) { - FT = -coef * propM.sqrtDensity * std::sqrt(-PDROP) * Ctl; + FT = -coef * propM.sqrt_density * std::sqrt(-PDROP) * Ctl; } else { - FT = -coef * propM.sqrtDensity * std::pow(-PDROP, expn) * Ctl; + FT = -coef * propM.sqrt_density * std::pow(-PDROP, expn) * Ctl; } } // Select laminar or turbulent flow. @@ -3608,9 +3551,9 @@ namespace AirflowNetwork { VisAve = (propN.viscosity + propM.viscosity) / 2.0; Tave = (propN.temperature + propM.temperature) / 2.0; if (PDROP >= 0.0) { - coef = FlowCoef / propN.sqrtDensity * Corr; + coef = FlowCoef / propN.sqrt_density * Corr; } else { - coef = FlowCoef / propM.sqrtDensity * Corr; + coef = FlowCoef / propM.sqrt_density * Corr; } if (LFLAG) { @@ -3636,9 +3579,9 @@ namespace AirflowNetwork { FL = CDM * PDROP; // Turbulent flow. if (expn == 0.5) { - FT = coef * propN.sqrtDensity * std::sqrt(PDROP) * Ctl; + FT = coef * propN.sqrt_density * std::sqrt(PDROP) * Ctl; } else { - FT = coef * propN.sqrtDensity * std::pow(PDROP, expn) * Ctl; + FT = coef * propN.sqrt_density * std::pow(PDROP, expn) * Ctl; } } else { // Flow in negative direction. @@ -3649,9 +3592,9 @@ namespace AirflowNetwork { FL = CDM * PDROP; // Turbulent flow. if (expn == 0.5) { - FT = -coef * propM.sqrtDensity * std::sqrt(-PDROP) * Ctl; + FT = -coef * propM.sqrt_density * std::sqrt(-PDROP) * Ctl; } else { - FT = -coef * propM.sqrtDensity * std::pow(-PDROP, expn) * Ctl; + FT = -coef * propM.sqrt_density * std::pow(-PDROP, expn) * Ctl; } } // Select laminar or turbulent flow. diff --git a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp index 113a8edb59f..c7177fa783c 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp @@ -88,10 +88,16 @@ namespace AirflowNetwork { // Functions - AirProperties::AirProperties(double const airDensity) + AirProperties::AirProperties(double const density) + { + this->density = density; + this->sqrt_density = sqrt(density); + } + + AirProperties::AirProperties() + : temperature(20.0), humidity_ratio(0.0), density(AIRDENSITY_CONSTEXPR(101325.0, 20.0, 0.0)), + sqrt_density(std::sqrt(AIRDENSITY_CONSTEXPR(101325.0, 20.0, 0.0))), viscosity(AIRDYNAMICVISCOSITY(20.0)) { - this->density = airDensity; - this->sqrtDensity = sqrt(airDensity); } void Solver::allocate(EnergyPlusData &state) @@ -205,7 +211,7 @@ namespace AirflowNetwork { // WZ(i) = AirflowNetworkNodeSimu(i).WZ; PZ(i) = state.dataAirflowNetwork->AirflowNetworkNodeSimu(i).PZ; properties[i].temperature = state.dataAirflowNetwork->AirflowNetworkNodeSimu(i).TZ; - properties[i].humidityRatio = state.dataAirflowNetwork->AirflowNetworkNodeSimu(i).WZ; + properties[i].humidity_ratio = state.dataAirflowNetwork->AirflowNetworkNodeSimu(i).WZ; // properties[i].pressure = AirflowNetworkNodeSimu(i).PZ; } @@ -334,7 +340,7 @@ namespace AirflowNetwork { // WZ(i) = AirflowNetworkNodeSimu(i).WZ; PZ(i) = state.dataAirflowNetwork->AirflowNetworkNodeSimu(i).PZ; properties[i].temperature = state.dataAirflowNetwork->AirflowNetworkNodeSimu(i).TZ; - properties[i].humidityRatio = state.dataAirflowNetwork->AirflowNetworkNodeSimu(i).WZ; + properties[i].humidity_ratio = state.dataAirflowNetwork->AirflowNetworkNodeSimu(i).WZ; // properties[i].pressure = AirflowNetworkNodeSimu(i).PZ; } } @@ -470,15 +476,15 @@ namespace AirflowNetwork { } // Compute zone air properties. for (n = 1; n <= NetworkNumOfNodes; ++n) { - properties[n].density = AIRDENSITY(state, state.dataEnvrn->StdBaroPress + PZ(n), properties[n].temperature, properties[n].humidityRatio); + properties[n].density = AIRDENSITY(state, state.dataEnvrn->StdBaroPress + PZ(n), properties[n].temperature, properties[n].humidity_ratio); // RHOZ(n) = PsyRhoAirFnPbTdbW(StdBaroPress + PZ(n), TZ(n), WZ(n)); if (state.dataAirflowNetwork->AirflowNetworkNodeData(n).ExtNodeNum > 0) { properties[n].density = AIRDENSITY(state, state.dataEnvrn->StdBaroPress + PZ(n), state.dataEnvrn->OutDryBulbTemp, state.dataEnvrn->OutHumRat); properties[n].temperature = state.dataEnvrn->OutDryBulbTemp; - properties[n].humidityRatio = state.dataEnvrn->OutHumRat; + properties[n].humidity_ratio = state.dataEnvrn->OutHumRat; } - properties[n].sqrtDensity = std::sqrt(properties[n].density); + properties[n].sqrt_density = std::sqrt(properties[n].density); properties[n].viscosity = 1.71432e-5 + 4.828e-8 * properties[n].temperature; // if (LIST >= 2) ObjexxFCL::gio::write(outputFile, Format_903) << "D,V:" << n << properties[n].density << properties[n].viscosity; } @@ -886,7 +892,7 @@ namespace AirflowNetwork { DP = PZ(n) - PZ(m) + DpL(i, 1) + PW(i); } Real64 multiplier = 1.0; - Real64 control = 1.0; + Real64 control = state.dataAirflowNetwork->AirflowNetworkLinkageData(i).control; // if (LIST >= 4) ObjexxFCL::gio::write(outputFile, Format_901) << "PS:" << i << n << M << PS(i) << PW(i) << AirflowNetworkLinkSimu(i).DP; j = state.dataAirflowNetwork->AirflowNetworkLinkageData(i).CompNum; @@ -1012,18 +1018,16 @@ namespace AirflowNetwork { #endif } - int GenericCrack(EnergyPlusData &state, - Real64 &coef, // Flow coefficient - Real64 const expn, // Flow exponent - bool const LFLAG, // Initialization flag.If = 1, use laminar relationship - Real64 const PDROP, // Total pressure drop across a component (P1 - P2) [Pa] - const AirProperties &propN, // Node 1 properties - const AirProperties &propM, // Node 2 properties - std::array &F, // Airflow through the component [kg/s] - std::array &DF // Partial derivative: DF/DP + void generic_crack(Real64 &coefficient, // Flow coefficient + Real64 const exponent, // Flow exponent + bool const linear, // Initialization flag. If true, use linear relationship + Real64 const pdrop, // Total pressure drop across a component (P1 - P2) [Pa] + const AirProperties &propN, // Node 1 properties + const AirProperties &propM, // Node 2 properties + std::array &F, // Airflow through the component [kg/s] + std::array &DF // Partial derivative: DF/DP ) { - // SUBROUTINE INFORMATION: // AUTHOR George Walton // DATE WRITTEN Extracted from AIRNET @@ -1031,6 +1035,7 @@ namespace AirflowNetwork { // Revised the subroutine to meet E+ needs // MODIFIED Lixing Gu, 6/8/05 // RE-ENGINEERED This subroutine is revised from AFEPLR developed by George Walton, NIST + // Jason DeGraw // PURPOSE OF THIS SUBROUTINE: // This subroutine solves airflow for a power law component @@ -1041,98 +1046,59 @@ namespace AirflowNetwork { // REFERENCES: // na - // USE STATEMENTS: - // na - - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - - // SUBROUTINE PARAMETER DEFINITIONS: - // na + // FLOW: + // Calculate normal density and viscocity at reference conditions + constexpr Real64 reference_density = AIRDENSITY_CONSTEXPR(101325.0, 20.0, 0.0); + constexpr Real64 reference_viscosity = 1.71432e-5 + 4.828e-8 * 20.0; + + Real64 VisAve{0.5 * (propN.viscosity + propM.viscosity)}; + Real64 Tave{0.5 * (propN.temperature + propM.temperature)}; + + Real64 sign{1.0}; + Real64 upwind_temperature{propN.temperature}; + Real64 upwind_density{propN.density}; + Real64 upwind_viscosity{propN.viscosity}; + Real64 upwind_sqrt_density{propN.sqrt_density}; + Real64 abs_pdrop = pdrop; + + if (pdrop < 0.0) { + sign = -1.0; + upwind_temperature = propM.temperature; + upwind_density = propM.density; + upwind_viscosity = propM.viscosity; + upwind_sqrt_density = propM.sqrt_density; + abs_pdrop = -pdrop; + } - // INTERFACE BLOCK SPECIFICATIONS - // na + Real64 coef = coefficient / upwind_sqrt_density; - // DERIVED TYPE DEFINITIONS - // na + // Laminar calculation + Real64 RhoCor{TOKELVIN(upwind_temperature) / TOKELVIN(Tave)}; + Real64 Ctl{std::pow(reference_density / upwind_density / RhoCor, exponent - 1.0) * + std::pow(reference_viscosity / VisAve, 2.0 * exponent - 1.0)}; + Real64 CDM{coef * upwind_density / upwind_viscosity * Ctl}; + Real64 FL{CDM * pdrop}; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 CDM; - Real64 FL; - Real64 FT; - Real64 RhozNorm; - Real64 VisczNorm; - Real64 Ctl; - Real64 VisAve; - Real64 Tave; - Real64 RhoCor; - - // Calculate normal density and viscocity at Crack standard condition: T=20C, p=101325 Pa and 0 g/kg - RhozNorm = AIRDENSITY(state, 101325.0, 20.0, 0.0); - VisczNorm = 1.71432e-5 + 4.828e-8 * 20.0; - VisAve = (propN.viscosity + propM.viscosity) / 2.0; - Tave = (propN.temperature + propM.temperature) / 2.0; - if (PDROP >= 0.0) { - coef /= propN.sqrtDensity; + if (linear) { + DF[0] = CDM; + F[0] = FL; } else { - coef /= propM.sqrtDensity; - } - - if (LFLAG) { - // Initialization by linear relation. - if (PDROP >= 0.0) { - RhoCor = (propN.temperature + DataGlobalConstants::KelvinConv) / (Tave + DataGlobalConstants::KelvinConv); - Ctl = std::pow(RhozNorm / propN.density / RhoCor, expn - 1.0) * std::pow(VisczNorm / VisAve, 2.0 * expn - 1.0); - DF[0] = coef * propN.density / propN.viscosity * Ctl; + // Turbulent flow. + Real64 abs_FT; + if (exponent == 0.5) { + abs_FT = coef * upwind_sqrt_density * std::sqrt(abs_pdrop) * Ctl; } else { - RhoCor = (propM.temperature + DataGlobalConstants::KelvinConv) / (Tave + DataGlobalConstants::KelvinConv); - Ctl = std::pow(RhozNorm / propM.density / RhoCor, expn - 1.0) * std::pow(VisczNorm / VisAve, 2.0 * expn - 1.0); - DF[0] = coef * propM.density / propM.viscosity * Ctl; + abs_FT = coef * upwind_sqrt_density * std::pow(abs_pdrop, exponent) * Ctl; } - F[0] = -DF[0] * PDROP; - } else { - // Standard calculation. - if (PDROP >= 0.0) { - // Flow in positive direction. - // Laminar flow. - RhoCor = (propN.temperature + DataGlobalConstants::KelvinConv) / (Tave + DataGlobalConstants::KelvinConv); - Ctl = std::pow(RhozNorm / propN.density / RhoCor, expn - 1.0) * std::pow(VisczNorm / VisAve, 2.0 * expn - 1.0); - CDM = coef * propN.density / propN.viscosity * Ctl; - FL = CDM * PDROP; - // Turbulent flow. - if (expn == 0.5) { - FT = coef * propN.sqrtDensity * std::sqrt(PDROP) * Ctl; - } else { - FT = coef * propN.sqrtDensity * std::pow(PDROP, expn) * Ctl; - } - } else { - // Flow in negative direction. - // Laminar flow. - RhoCor = (propM.temperature + DataGlobalConstants::KelvinConv) / (Tave + DataGlobalConstants::KelvinConv); - Ctl = std::pow(RhozNorm / propM.density / RhoCor, 2.0 * expn - 1.0) * std::pow(VisczNorm / VisAve, 2.0 * expn - 1.0); - CDM = coef * propM.density / propM.viscosity * Ctl; - FL = CDM * PDROP; - // Turbulent flow. - if (expn == 0.5) { - FT = -coef * propM.sqrtDensity * std::sqrt(-PDROP) * Ctl; - } else { - FT = -coef * propM.sqrtDensity * std::pow(-PDROP, expn) * Ctl; - } - } - // Select laminar or turbulent flow. - // if (LIST >= 4) { - // static ObjexxFCL::gio::Fmt Format_901("(A5,6X,4E16.7)"); - // print(std::cout, " generic crack: {:5} {:16.7E} {16.7E}\n", PDROP, FL, FT); - // } - if (std::abs(FL) <= std::abs(FT)) { + // Select linear or nonlinear flow. + if (std::abs(FL) <= abs_FT) { F[0] = FL; DF[0] = CDM; } else { - F[0] = FT; - DF[0] = FT * expn / PDROP; + F[0] = sign * abs_FT; + DF[0] = F[0] * exponent / pdrop; } } - return 1; } int GenericDuct(Real64 const Length, // Duct length @@ -2065,9 +2031,9 @@ namespace AirflowNetwork { auto &solver = state.dataAFNSolver->solver; TempL1 = solver.properties[From].temperature; - Xhl1 = solver.properties[From].humidityRatio; + Xhl1 = solver.properties[From].humidity_ratio; TzFrom = solver.properties[From].temperature; - XhzFrom = solver.properties[From].humidityRatio; + XhzFrom = solver.properties[From].humidity_ratio; RhoL1 = solver.properties[From].density; if (ll == 0 || ll == 3) { PzFrom = solver.PZ(From); @@ -2085,9 +2051,9 @@ namespace AirflowNetwork { } TempL2 = solver.properties[To].temperature; - Xhl2 = solver.properties[To].humidityRatio; + Xhl2 = solver.properties[To].humidity_ratio; TzTo = solver.properties[To].temperature; - XhzTo = solver.properties[To].humidityRatio; + XhzTo = solver.properties[To].humidity_ratio; RhoL2 = solver.properties[To].density; if (ll < 3) { diff --git a/src/EnergyPlus/AirflowNetworkBalanceManager.cc b/src/EnergyPlus/AirflowNetworkBalanceManager.cc index 36b86c0ec50..b2cd1f04228 100644 --- a/src/EnergyPlus/AirflowNetworkBalanceManager.cc +++ b/src/EnergyPlus/AirflowNetworkBalanceManager.cc @@ -402,7 +402,7 @@ namespace AirflowNetworkBalanceManager { } Real64 refT = defaultReferenceConditions.temperature; Real64 refP = defaultReferenceConditions.pressure; - Real64 refW = defaultReferenceConditions.humidityRatio; + Real64 refW = defaultReferenceConditions.humidity_ratio; if (!conditionsAreDefaulted) { if (fields.find("reference_crack_conditions") != fields.end()) { // not required field, *should* have default value auto result = referenceConditions.find(fields.at("reference_crack_conditions")); @@ -415,7 +415,7 @@ namespace AirflowNetworkBalanceManager { } else { refT = result->second.temperature; refP = result->second.pressure; - refW = result->second.humidityRatio; + refW = result->second.humidity_ratio; state.dataInputProcessing->inputProcessor->markObjectAsUsed("AirflowNetwork:MultiZone:ReferenceCrackConditions", result->second.name); } @@ -423,11 +423,10 @@ namespace AirflowNetworkBalanceManager { } // globalSolverObject.cracks[thisObjectName] = SurfaceCrack(coeff, expnt, refT, refP, refW); state.dataAirflowNetwork->MultizoneSurfaceCrackData(i).name = thisObjectName; // Name of surface crack component - state.dataAirflowNetwork->MultizoneSurfaceCrackData(i).FlowCoef = coeff; // Air Mass Flow Coefficient - state.dataAirflowNetwork->MultizoneSurfaceCrackData(i).FlowExpo = expnt; // Air Mass Flow exponent - state.dataAirflowNetwork->MultizoneSurfaceCrackData(i).StandardT = refT; - state.dataAirflowNetwork->MultizoneSurfaceCrackData(i).StandardP = refP; - state.dataAirflowNetwork->MultizoneSurfaceCrackData(i).StandardW = refW; + state.dataAirflowNetwork->MultizoneSurfaceCrackData(i).coefficient = coeff; // Air Mass Flow Coefficient + state.dataAirflowNetwork->MultizoneSurfaceCrackData(i).exponent = expnt; // Air Mass Flow exponent + state.dataAirflowNetwork->MultizoneSurfaceCrackData(i).reference_density = AIRDENSITY(state, refP, refT, refW); + state.dataAirflowNetwork->MultizoneSurfaceCrackData(i).reference_viscosity = AIRDYNAMICVISCOSITY(refT); // This is the first element that is being added to the lookup table, so no check of naming overlaps solver.elements[thisObjectName] = &state.dataAirflowNetwork->MultizoneSurfaceCrackData(i); // Yet another workaround @@ -489,7 +488,7 @@ namespace AirflowNetworkBalanceManager { Real64 refT = defaultReferenceConditions.temperature; Real64 refP = defaultReferenceConditions.pressure; - Real64 refW = defaultReferenceConditions.humidityRatio; + Real64 refW = defaultReferenceConditions.humidity_ratio; if (!conditionsAreDefaulted) { if (fields.find("reference_crack_conditions") != fields.end()) { // not required field, *should* have default value auto result = referenceConditions.find(fields.at("reference_crack_conditions")); @@ -502,7 +501,7 @@ namespace AirflowNetworkBalanceManager { } else { refT = result->second.temperature; refP = result->second.pressure; - refW = result->second.humidityRatio; + refW = result->second.humidity_ratio; state.dataInputProcessing->inputProcessor->markObjectAsUsed("AirflowNetwork:MultiZone:ReferenceCrackConditions", result->second.name); } @@ -565,7 +564,7 @@ namespace AirflowNetworkBalanceManager { Real64 refT = defaultReferenceConditions.temperature; Real64 refP = defaultReferenceConditions.pressure; - Real64 refW = defaultReferenceConditions.humidityRatio; + Real64 refW = defaultReferenceConditions.humidity_ratio; if (!conditionsAreDefaulted) { if (fields.find("reference_crack_conditions") != fields.end()) { // not required field, *should* have default value auto result = referenceConditions.find(fields.at("reference_crack_conditions")); @@ -578,7 +577,7 @@ namespace AirflowNetworkBalanceManager { } else { refT = result->second.temperature; refP = result->second.pressure; - refW = result->second.humidityRatio; + refW = result->second.humidity_ratio; state.dataInputProcessing->inputProcessor->markObjectAsUsed("AirflowNetwork:MultiZone:ReferenceCrackConditions", result->second.name); } @@ -640,7 +639,7 @@ namespace AirflowNetworkBalanceManager { Real64 refT = defaultReferenceConditions.temperature; Real64 refP = defaultReferenceConditions.pressure; - Real64 refW = defaultReferenceConditions.humidityRatio; + Real64 refW = defaultReferenceConditions.humidity_ratio; if (!conditionsAreDefaulted) { if (fields.find("reference_crack_conditions") != fields.end()) { // not required field, *should* have default value auto result = referenceConditions.find(fields.at("reference_crack_conditions")); @@ -653,7 +652,7 @@ namespace AirflowNetworkBalanceManager { } else { refT = result->second.temperature; refP = result->second.pressure; - refW = result->second.humidityRatio; + refW = result->second.humidity_ratio; state.dataInputProcessing->inputProcessor->markObjectAsUsed("AirflowNetwork:MultiZone:ReferenceCrackConditions", result->second.name); } @@ -6663,7 +6662,12 @@ namespace AirflowNetworkBalanceManager { } for (i = 1; i <= state.dataAirflowNetwork->AirflowNetworkNumOfSurfaces; ++i) { - if (i > state.dataAirflowNetwork->AirflowNetworkNumOfSurfaces - state.dataAirflowNetwork->NumOfLinksIntraZone) continue; + if (i > state.dataAirflowNetwork->AirflowNetworkNumOfSurfaces - state.dataAirflowNetwork->NumOfLinksIntraZone) { + continue; + } + if (state.dataAirflowNetwork->AirflowNetworkLinkageData(i).element->type() == ComponentType::SCR) { + state.dataAirflowNetwork->AirflowNetworkLinkageData(i).control = state.dataAirflowNetwork->MultizoneSurfaceData(i).Factor; + } if (state.dataAirflowNetwork->MultizoneSurfaceData(i).OccupantVentilationControlNum == 0) state.dataAirflowNetwork->MultizoneSurfaceData(i).OpenFactor = 0.0; j = state.dataAirflowNetwork->MultizoneSurfaceData(i).SurfNum; diff --git a/src/EnergyPlus/CMakeLists.txt b/src/EnergyPlus/CMakeLists.txt index ee2866d2f60..43528b5fea4 100644 --- a/src/EnergyPlus/CMakeLists.txt +++ b/src/EnergyPlus/CMakeLists.txt @@ -719,7 +719,7 @@ if(LINK_WITH_PYTHON) # to match up bitwise if we aren't, then the identified interpreter can be # whatever bit it wants if(MSVC) - execute_process(COMMAND "${PYTHON_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/cmake/PythonGetBitSize.py" OUTPUT_VARIABLE PYTHON_BIT_SIZE) + execute_process(COMMAND "${Python_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/cmake/PythonGetBitSize.py" OUTPUT_VARIABLE PYTHON_BIT_SIZE) # PYTHON_BIT_SIZE will be either "32" or "64" # CMAKE_EXE_LINKER_FLAGS:STRING=/machine:x64 # CMAKE_EXE_LINKER_FLAGS:STRING=/machine:X86 @@ -740,10 +740,9 @@ if(LINK_WITH_PYTHON) endif() endif() - # now we need to get the Python libs and add the include path for further - # compiling - find_package(PythonLibs 3 REQUIRED) - include_directories("${PYTHON_INCLUDE_DIRS}") + # now we need to get the Python libs and add the include path for further compiling + # The Development (libs) was already found in the root level CMakeLists.txt + include_directories("${Python_INCLUDE_DIRS}") endif() add_library(energyplusparser STATIC ${INPUTPARSING_SRC}) @@ -800,7 +799,7 @@ if(UNIX AND NOT APPLE) endif() endif() if(LINK_WITH_PYTHON) - target_link_libraries(energypluslib PUBLIC ${PYTHON_LIBRARIES}) + target_link_libraries(energypluslib PUBLIC ${Python_LIBRARIES}) endif() # See https://en.cppreference.com/w/cpp/filesystem#Notes if ((CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1) OR @@ -880,8 +879,27 @@ install(TARGETS energyplus energyplusapi DESTINATION ./) if(LINK_WITH_PYTHON) # link the executable to the dll and bring it in - get_filename_component(RESOLVED_PYTHON_LIBRARY "${PYTHON_LIBRARIES}" REALPATH) + get_filename_component(RESOLVED_PYTHON_LIBRARY "${Python_LIBRARIES}" REALPATH) if(WIN32) + + # In case you have both release and debug Python libraries on your system, Python_LIBRARIES might be "optimized;C:/.../python38.lib;debug;C:/.../python38_d.lib" + # so it can't be used directly, we could use a generator expression to find the $ library used and that'd point directly + # to the DLL. But it won't work nicely for the install(code ...) command below... so we do a hack, get the optimized one always... + list(LENGTH Python_LIBRARIES _LEN) + if (_LEN GREATER 1) + set (_Python_DOING_RELEASE FALSE) + foreach(_currentArg ${Python_LIBRARIES}) + if ("x${_currentArg}" STREQUAL "xoptimized") + set(_Python_DOING_RELEASE TRUE) + elseif(_Python_DOING_RELEASE) + get_filename_component(RESOLVED_PYTHON_LIBRARY "${_currentArg}" REALPATH) + break() + endif() + endforeach() + # else() + # No-op, already done above + endif() + # Windows is being ugly and linking against the Python DLL but not running # unless it's close by Force it here. add_custom_command( @@ -912,7 +930,7 @@ if(LINK_WITH_PYTHON) TARGET energyplusapi POST_BUILD # TODO: I don't think we want to quote the generator expression # here - COMMAND ${PYTHON_EXECUTABLE} "${PROJECT_SOURCE_DIR}/cmake/PythonCopyStandardLib.py" "$" "python_standard_lib") + COMMAND ${Python_EXECUTABLE} "${PROJECT_SOURCE_DIR}/cmake/PythonCopyStandardLib.py" "$" "python_standard_lib") endif() if(BUILD_PACKAGE) @@ -981,7 +999,7 @@ if(BUILD_TESTING) configure_file("${PROJECT_SOURCE_DIR}/tst/EnergyPlus/api/TestFunctional.py" "${API_TEST_TARGET_DIR}/TestFunctional.py") add_test( NAME "API.TestFunctionalPython" - COMMAND "${PYTHON_EXECUTABLE}" "${API_TEST_TARGET_DIR}/TestFunctional.py" + COMMAND "${Python_EXECUTABLE}" "${API_TEST_TARGET_DIR}/TestFunctional.py" WORKING_DIRECTORY "${API_TEST_TARGET_DIR}") set(TEST_DIR "${PROJECT_BINARY_DIR}/tst/api/runtime_python") @@ -989,7 +1007,7 @@ if(BUILD_TESTING) configure_file("${PROJECT_SOURCE_DIR}/tst/EnergyPlus/api/TestRuntime.py" "${API_TEST_TARGET_DIR}/TestRuntime.py") add_test( NAME "API.TestRuntimePython" - COMMAND "${PYTHON_EXECUTABLE}" "${API_TEST_TARGET_DIR}/TestRuntime.py" -d "${TEST_DIR}" -w "${EPW_FILE}" -D "${IDF_FILE}" + COMMAND "${Python_EXECUTABLE}" "${API_TEST_TARGET_DIR}/TestRuntime.py" -d "${TEST_DIR}" -w "${EPW_FILE}" -D "${IDF_FILE}" WORKING_DIRECTORY "${API_TEST_TARGET_DIR}") set(TEST_DIR "${PROJECT_BINARY_DIR}/tst/api/exchange_python") @@ -997,14 +1015,14 @@ if(BUILD_TESTING) configure_file("${PROJECT_SOURCE_DIR}/tst/EnergyPlus/api/TestDataTransfer.py" "${API_TEST_TARGET_DIR}/TestDataTransfer.py") add_test( NAME "API.TestDataTransferPython" - COMMAND "${PYTHON_EXECUTABLE}" "${API_TEST_TARGET_DIR}/TestDataTransfer.py" -d "${TEST_DIR}" -w "${EPW_FILE}" -D "${IDF_FILE}" + COMMAND "${Python_EXECUTABLE}" "${API_TEST_TARGET_DIR}/TestDataTransfer.py" -d "${TEST_DIR}" -w "${EPW_FILE}" -D "${IDF_FILE}" WORKING_DIRECTORY "${API_TEST_TARGET_DIR}") # set(TEST_DIR "${PROJECT_BINARY_DIR}/tst/api/autosizing_python") # file(MAKE_DIRECTORY ${TEST_DIR}) configure_file( # "${PROJECT_SOURCE_DIR}/tst/EnergyPlus/api/TestAutosizing.py" # "${API_TEST_TARGET_DIR}/TestAutosizing.py" ) add_test(NAME - # "API.TestAutosizingPython" COMMAND "${PYTHON_EXECUTABLE}" + # "API.TestAutosizingPython" COMMAND "${Python_EXECUTABLE}" # "${API_TEST_TARGET_DIR}/TestAutosizing.py" -d "${TEST_DIR}" -w # "${EPW_FILE}" -D "${IDF_FILE}" WORKING_DIRECTORY "${API_TEST_TARGET_DIR}") @@ -1013,25 +1031,25 @@ if(BUILD_TESTING) configure_file("${PROJECT_SOURCE_DIR}/src/EnergyPlus/api/plugin_tester.py" "${API_TEST_TARGET_DIR}/plugin_tester.py") add_test( NAME "API.PluginTesterTester" - COMMAND "${PYTHON_EXECUTABLE}" "${API_TEST_TARGET_DIR}/plugin_tester.py" "${PROJECT_SOURCE_DIR}/testfiles/PythonPluginCustomTrendVariable.py" + COMMAND "${Python_EXECUTABLE}" "${API_TEST_TARGET_DIR}/plugin_tester.py" "${PROJECT_SOURCE_DIR}/testfiles/PythonPluginCustomTrendVariable.py" WORKING_DIRECTORY "${API_TEST_TARGET_DIR}") configure_file("${PROJECT_SOURCE_DIR}/tst/EnergyPlus/api/test_DataTransferTypes.py" "${API_TEST_TARGET_DIR}/test_DataTransferTypes.py" COPYONLY) add_test( NAME "API.test_DataTransferTypes" - COMMAND "${PYTHON_EXECUTABLE}" -m unittest "${API_TEST_TARGET_DIR}/test_DataTransferTypes.py" + COMMAND "${Python_EXECUTABLE}" -m unittest "${API_TEST_TARGET_DIR}/test_DataTransferTypes.py" WORKING_DIRECTORY "${API_TEST_TARGET_DIR}") configure_file("${PROJECT_SOURCE_DIR}/tst/EnergyPlus/api/test_SysExit.py" "${API_TEST_TARGET_DIR}/test_SysExit.py" COPYONLY) add_test( NAME "API.test_SysExit" - COMMAND "${PYTHON_EXECUTABLE}" -m unittest "${API_TEST_TARGET_DIR}/test_SysExit.py" + COMMAND "${Python_EXECUTABLE}" -m unittest "${API_TEST_TARGET_DIR}/test_SysExit.py" WORKING_DIRECTORY "${API_TEST_TARGET_DIR}") configure_file("${PROJECT_SOURCE_DIR}/tst/EnergyPlus/api/test_OutputFiles.py" "${API_TEST_TARGET_DIR}/test_OutputFiles.py" @ONLY) add_test( NAME "API.test_OutputFiles" - COMMAND "${PYTHON_EXECUTABLE}" -m unittest "${API_TEST_TARGET_DIR}/test_OutputFiles.py" + COMMAND "${Python_EXECUTABLE}" -m unittest "${API_TEST_TARGET_DIR}/test_OutputFiles.py" WORKING_DIRECTORY "${API_TEST_TARGET_DIR}") endif() diff --git a/src/EnergyPlus/CTElectricGenerator.cc b/src/EnergyPlus/CTElectricGenerator.cc index 035808f1fbf..eb9a84bd2a0 100644 --- a/src/EnergyPlus/CTElectricGenerator.cc +++ b/src/EnergyPlus/CTElectricGenerator.cc @@ -705,62 +705,7 @@ namespace CTElectricGenerator { // PURPOSE OF THIS SUBROUTINE: // This subroutine is for initializations of the CT generators. - auto constexpr RoutineName("InitICEngineGenerators"); - - bool errFlag; - - if (this->MyPlantScanFlag && allocated(state.dataPlnt->PlantLoop) && this->HeatRecActive) { - errFlag = false; - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - DataPlant::TypeOf_Generator_CTurbine, - this->HRLoopNum, - this->HRLoopSideNum, - this->HRBranchNum, - this->HRCompNum, - errFlag, - _, - _, - _, - _, - _); - if (errFlag) { - ShowFatalError(state, "InitCTGenerators: Program terminated due to previous condition(s)."); - } - - this->MyPlantScanFlag = false; - } - - if (this->MyFlag) { - this->setupOutputVars(state); - this->MyFlag = false; - } - - if (this->MySizeAndNodeInitFlag && (!this->MyPlantScanFlag) && this->HeatRecActive) { - int HeatRecInletNode = this->HeatRecInletNodeNum; - int HeatRecOutletNode = this->HeatRecOutletNodeNum; - - // size mass flow rate - Real64 rho = FluidProperties::GetDensityGlycol(state, - state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, - DataGlobalConstants::InitConvTemp, - state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, - RoutineName); - - this->DesignHeatRecMassFlowRate = rho * this->DesignHeatRecVolFlowRate; - - PlantUtilities::InitComponentNodes(state, - 0.0, - this->DesignHeatRecMassFlowRate, - HeatRecInletNode, - HeatRecOutletNode, - this->HRLoopNum, - this->HRLoopSideNum, - this->HRBranchNum, - this->HRCompNum); - - this->MySizeAndNodeInitFlag = false; - } // end one time inits + this->oneTimeInit(state); // Do one-time inits // Do the Begin Environment initializations if (state.dataGlobal->BeginEnvrnFlag && this->MyEnvrnFlag && this->HeatRecActive) { @@ -817,6 +762,67 @@ namespace CTElectricGenerator { } } + void CTGeneratorData::oneTimeInit(EnergyPlusData &state) + { + auto constexpr RoutineName("InitICEngineGenerators"); + bool errFlag; + + if (this->MyPlantScanFlag) { // this flag to be removed + if (allocated(state.dataPlnt->PlantLoop) && this->HeatRecActive) { + errFlag = false; + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + DataPlant::TypeOf_Generator_CTurbine, + this->HRLoopNum, + this->HRLoopSideNum, + this->HRBranchNum, + this->HRCompNum, + errFlag, + _, + _, + _, + _, + _); + if (errFlag) { + ShowFatalError(state, "InitCTGenerators: Program terminated due to previous condition(s)."); + } + } + + this->MyPlantScanFlag = false; + } + + if (this->MyFlag) { + this->setupOutputVars(state); + this->MyFlag = false; + } + + if (this->MySizeAndNodeInitFlag && (!this->MyPlantScanFlag) && this->HeatRecActive) { + int HeatRecInletNode = this->HeatRecInletNodeNum; + int HeatRecOutletNode = this->HeatRecOutletNodeNum; + + // size mass flow rate + Real64 rho = FluidProperties::GetDensityGlycol(state, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, + DataGlobalConstants::InitConvTemp, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, + RoutineName); + + this->DesignHeatRecMassFlowRate = rho * this->DesignHeatRecVolFlowRate; + + PlantUtilities::InitComponentNodes(state, + 0.0, + this->DesignHeatRecMassFlowRate, + HeatRecInletNode, + HeatRecOutletNode, + this->HRLoopNum, + this->HRLoopSideNum, + this->HRBranchNum, + this->HRCompNum); + + this->MySizeAndNodeInitFlag = false; + } + } + } // namespace CTElectricGenerator } // namespace EnergyPlus diff --git a/src/EnergyPlus/CTElectricGenerator.hh b/src/EnergyPlus/CTElectricGenerator.hh index fd48c19c520..33969812a5b 100644 --- a/src/EnergyPlus/CTElectricGenerator.hh +++ b/src/EnergyPlus/CTElectricGenerator.hh @@ -152,6 +152,8 @@ namespace CTElectricGenerator { void CalcCTGeneratorModel(EnergyPlusData &state, bool RunFlag, Real64 MyLoad, bool FirstHVACIteration); static PlantComponent *factory(EnergyPlusData &state, std::string const &objectName); + + void oneTimeInit(EnergyPlusData &state) override; }; void GetCTGeneratorInput(EnergyPlusData &state); diff --git a/src/EnergyPlus/ChilledCeilingPanelSimple.cc b/src/EnergyPlus/ChilledCeilingPanelSimple.cc index d1d19efced3..3b5380db9fe 100644 --- a/src/EnergyPlus/ChilledCeilingPanelSimple.cc +++ b/src/EnergyPlus/ChilledCeilingPanelSimple.cc @@ -1804,18 +1804,18 @@ Real64 SumHATsurf(EnergyPlusData &state, int const ZoneNum) // Zone number if (state.dataSurface->SurfWinFrameArea(SurfNum) > 0.0) { // Window frame contribution - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * - (1.0 + state.dataSurface->SurfWinProjCorrFrIn(SurfNum)) * state.dataSurface->SurfWinFrameTempSurfIn(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * + (1.0 + state.dataSurface->SurfWinProjCorrFrIn(SurfNum)) * state.dataSurface->SurfWinFrameTempIn(SurfNum); } if (state.dataSurface->SurfWinDividerArea(SurfNum) > 0.0 && !ANY_INTERIOR_SHADE_BLIND(state.dataSurface->SurfWinShadingFlag(SurfNum))) { // Window divider contribution (only from shade or blind for window with divider and interior shade or blind) - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * - (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum)) * state.dataSurface->SurfWinDividerTempSurfIn(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * + (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum)) * state.dataSurface->SurfWinDividerTempIn(SurfNum); } } - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * Area * state.dataHeatBalSurf->TempSurfInTmp(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * Area * state.dataHeatBalSurf->SurfTempInTmp(SurfNum); } return SumHATsurf; diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index d5844b0e76d..0ae479ec8ad 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -702,130 +702,146 @@ void ExhaustAbsorberSpecs::setupOutputVariables(EnergyPlusData &state) void ExhaustAbsorberSpecs::oneTimeInit(EnergyPlusData &state) { - bool errFlag = false; - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - DataPlant::TypeOf_Chiller_ExhFiredAbsorption, - this->CWLoopNum, - this->CWLoopSideNum, - this->CWBranchNum, - this->CWCompNum, - errFlag, - this->CHWLowLimitTemp, - _, - _, - this->ChillReturnNodeNum, - _); - if (errFlag) { - ShowFatalError(state, "InitExhaustAbsorber: Program terminated due to previous condition(s)."); - } + if (this->oneTimeFlag) { + this->setupOutputVariables(state); - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - DataPlant::TypeOf_Chiller_ExhFiredAbsorption, - this->HWLoopNum, - this->HWLoopSideNum, - this->HWBranchNum, - this->HWCompNum, - errFlag, - _, - _, - _, - this->HeatReturnNodeNum, - _); - if (errFlag) { - ShowFatalError(state, "InitExhaustAbsorber: Program terminated due to previous condition(s)."); - } + bool errFlag = false; + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + DataPlant::TypeOf_Chiller_ExhFiredAbsorption, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum, + errFlag, + this->CHWLowLimitTemp, + _, + _, + this->ChillReturnNodeNum, + _); + if (errFlag) { + ShowFatalError(state, "InitExhaustAbsorber: Program terminated due to previous condition(s)."); + } - if (this->isWaterCooled) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, - this->CDLoopNum, - this->CDLoopSideNum, - this->CDBranchNum, - this->CDCompNum, + this->HWLoopNum, + this->HWLoopSideNum, + this->HWBranchNum, + this->HWCompNum, errFlag, _, _, _, - this->CondReturnNodeNum, + this->HeatReturnNodeNum, _); if (errFlag) { ShowFatalError(state, "InitExhaustAbsorber: Program terminated due to previous condition(s)."); } - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true); - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->HWLoopNum, this->HWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true); - } - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->HWLoopNum, this->HWLoopSideNum, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true); - - // check if outlet node of chilled water side has a setpoint. - if ((state.dataLoopNodes->Node(this->ChillSupplyNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && - (state.dataLoopNodes->Node(this->ChillSupplyNodeNum).TempSetPointHi == DataLoopNode::SensedNodeFlagValue)) { - if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { - if (!this->ChillSetPointErrDone) { - ShowWarningError(state, "Missing temperature setpoint on cool side for chiller heater named " + this->Name); - ShowContinueError(state, " A temperature setpoint is needed at the outlet node of this chiller, use a SetpointManager"); - ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); - this->ChillSetPointErrDone = true; - } - } else { - // need call to EMS to check node - errFlag = false; // but not really fatal yet, but should be. - EMSManager::CheckIfNodeSetPointManagedByEMS(state, this->ChillSupplyNodeNum, EMSManager::SPControlType::iTemperatureSetPoint, errFlag); - state.dataLoopNodes->NodeSetpointCheck(this->ChillSupplyNodeNum).needsSetpointChecking = false; + if (this->isWaterCooled) { + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + DataPlant::TypeOf_Chiller_ExhFiredAbsorption, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum, + errFlag, + _, + _, + _, + this->CondReturnNodeNum, + _); if (errFlag) { + ShowFatalError(state, "InitExhaustAbsorber: Program terminated due to previous condition(s)."); + } + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->CWLoopNum, + this->CWLoopSideNum, + this->CDLoopNum, + this->CDLoopSideNum, + DataPlant::TypeOf_Chiller_ExhFiredAbsorption, + true); + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->HWLoopNum, + this->HWLoopSideNum, + this->CDLoopNum, + this->CDLoopSideNum, + DataPlant::TypeOf_Chiller_ExhFiredAbsorption, + true); + } + + PlantUtilities::InterConnectTwoPlantLoopSides( + state, this->CWLoopNum, this->CWLoopSideNum, this->HWLoopNum, this->HWLoopSideNum, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true); + + // check if outlet node of chilled water side has a setpoint. + if ((state.dataLoopNodes->Node(this->ChillSupplyNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && + (state.dataLoopNodes->Node(this->ChillSupplyNodeNum).TempSetPointHi == DataLoopNode::SensedNodeFlagValue)) { + if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { if (!this->ChillSetPointErrDone) { ShowWarningError(state, "Missing temperature setpoint on cool side for chiller heater named " + this->Name); - ShowContinueError(state, " A temperature setpoint is needed at the outlet node of this chiller evaporator "); - ShowContinueError(state, " use a Setpoint Manager to establish a setpoint at the chiller evaporator outlet node "); - ShowContinueError(state, " or use an EMS actuator to establish a setpoint at the outlet node "); + ShowContinueError(state, " A temperature setpoint is needed at the outlet node of this chiller, use a SetpointManager"); ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); this->ChillSetPointErrDone = true; } + } else { + // need call to EMS to check node + errFlag = false; // but not really fatal yet, but should be. + EMSManager::CheckIfNodeSetPointManagedByEMS( + state, this->ChillSupplyNodeNum, EMSManager::SPControlType::iTemperatureSetPoint, errFlag); + state.dataLoopNodes->NodeSetpointCheck(this->ChillSupplyNodeNum).needsSetpointChecking = false; + if (errFlag) { + if (!this->ChillSetPointErrDone) { + ShowWarningError(state, "Missing temperature setpoint on cool side for chiller heater named " + this->Name); + ShowContinueError(state, " A temperature setpoint is needed at the outlet node of this chiller evaporator "); + ShowContinueError(state, " use a Setpoint Manager to establish a setpoint at the chiller evaporator outlet node "); + ShowContinueError(state, " or use an EMS actuator to establish a setpoint at the outlet node "); + ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); + this->ChillSetPointErrDone = true; + } + } } + this->ChillSetPointSetToLoop = true; + state.dataLoopNodes->Node(this->ChillSupplyNodeNum).TempSetPoint = + state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + state.dataLoopNodes->Node(this->ChillSupplyNodeNum).TempSetPointHi = + state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } - this->ChillSetPointSetToLoop = true; - state.dataLoopNodes->Node(this->ChillSupplyNodeNum).TempSetPoint = - state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; - state.dataLoopNodes->Node(this->ChillSupplyNodeNum).TempSetPointHi = - state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; - } - // check if outlet node of hot water side has a setpoint. - if ((state.dataLoopNodes->Node(this->HeatSupplyNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && - (state.dataLoopNodes->Node(this->HeatSupplyNodeNum).TempSetPointLo == DataLoopNode::SensedNodeFlagValue)) { - if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { - if (!this->HeatSetPointErrDone) { - ShowWarningError(state, "Missing temperature setpoint on heat side for chiller heater named " + this->Name); - ShowContinueError(state, " A temperature setpoint is needed at the outlet node of this chiller, use a SetpointManager"); - ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); - this->HeatSetPointErrDone = true; - } - } else { - // need call to EMS to check node - errFlag = false; // but not really fatal yet, but should be. - EMSManager::CheckIfNodeSetPointManagedByEMS(state, this->HeatSupplyNodeNum, EMSManager::SPControlType::iTemperatureSetPoint, errFlag); - state.dataLoopNodes->NodeSetpointCheck(this->HeatSupplyNodeNum).needsSetpointChecking = false; - if (errFlag) { + // check if outlet node of hot water side has a setpoint. + if ((state.dataLoopNodes->Node(this->HeatSupplyNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && + (state.dataLoopNodes->Node(this->HeatSupplyNodeNum).TempSetPointLo == DataLoopNode::SensedNodeFlagValue)) { + if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { if (!this->HeatSetPointErrDone) { ShowWarningError(state, "Missing temperature setpoint on heat side for chiller heater named " + this->Name); - ShowContinueError(state, " A temperature setpoint is needed at the outlet node of this chiller heater "); - ShowContinueError(state, " use a Setpoint Manager to establish a setpoint at the heater side outlet node "); - ShowContinueError(state, " or use an EMS actuator to establish a setpoint at the outlet node "); - ShowContinueError(state, " The overall loop setpoint will be assumed for heater side. The simulation continues ... "); + ShowContinueError(state, " A temperature setpoint is needed at the outlet node of this chiller, use a SetpointManager"); + ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); this->HeatSetPointErrDone = true; } + } else { + // need call to EMS to check node + errFlag = false; // but not really fatal yet, but should be. + EMSManager::CheckIfNodeSetPointManagedByEMS(state, this->HeatSupplyNodeNum, EMSManager::SPControlType::iTemperatureSetPoint, errFlag); + state.dataLoopNodes->NodeSetpointCheck(this->HeatSupplyNodeNum).needsSetpointChecking = false; + if (errFlag) { + if (!this->HeatSetPointErrDone) { + ShowWarningError(state, "Missing temperature setpoint on heat side for chiller heater named " + this->Name); + ShowContinueError(state, " A temperature setpoint is needed at the outlet node of this chiller heater "); + ShowContinueError(state, " use a Setpoint Manager to establish a setpoint at the heater side outlet node "); + ShowContinueError(state, " or use an EMS actuator to establish a setpoint at the outlet node "); + ShowContinueError(state, " The overall loop setpoint will be assumed for heater side. The simulation continues ... "); + this->HeatSetPointErrDone = true; + } + } } + this->HeatSetPointSetToLoop = true; + state.dataLoopNodes->Node(this->HeatSupplyNodeNum).TempSetPoint = + state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; + state.dataLoopNodes->Node(this->HeatSupplyNodeNum).TempSetPointLo = + state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPointLo; } - this->HeatSetPointSetToLoop = true; - state.dataLoopNodes->Node(this->HeatSupplyNodeNum).TempSetPoint = - state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; - state.dataLoopNodes->Node(this->HeatSupplyNodeNum).TempSetPointLo = - state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPointLo; + this->oneTimeFlag = false; } } @@ -856,11 +872,7 @@ void ExhaustAbsorberSpecs::initialize(EnergyPlusData &state) Real64 rho; // local fluid density Real64 mdot; // lcoal fluid mass flow rate - if (this->oneTimeFlag) { - this->setupOutputVariables(state); - this->oneTimeInit(state); - this->oneTimeFlag = false; - } + this->oneTimeInit(state); CondInletNode = this->CondReturnNodeNum; CondOutletNode = this->CondSupplyNodeNum; diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc index 80d57950289..168236b3ffb 100644 --- a/src/EnergyPlus/CommandLineInterface.cc +++ b/src/EnergyPlus/CommandLineInterface.cc @@ -883,8 +883,8 @@ namespace CommandLineInterface { if (!ofs.good()) { ShowFatalError(state, "EnergyPlus: Could not open file \"" + RVIfile.string() + "\" for output (write)."); } else { - ofs << state.files.eso.filePath << '\n'; - ofs << state.files.csv.filePath << '\n'; + ofs << state.files.eso.filePath.string() << '\n'; + ofs << state.files.csv.filePath.string() << '\n'; } } @@ -894,8 +894,8 @@ namespace CommandLineInterface { if (!ofs.good()) { ShowFatalError(state, "EnergyPlus: Could not open file \"" + RVIfile.string() + "\" for output (write)."); } else { - ofs << state.files.mtr.filePath << '\n'; - ofs << state.files.mtr_csv.filePath << '\n'; + ofs << state.files.mtr.filePath.string() << '\n'; + ofs << state.files.mtr_csv.filePath.string() << '\n'; } } diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index a8364bce7c7..f9ae0a43ee3 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -258,7 +258,7 @@ void InitInteriorConvectionCoeffs(EnergyPlusData &state, for (SurfNum = Zone(ZoneNum).HTSurfaceFirst; SurfNum <= Zone(ZoneNum).HTSurfaceLast; ++SurfNum) { if (present(ZoneToResimulate)) { - if ((ZoneNum != ZoneToResimulate) && (state.dataSurface->AdjacentZoneToSurface(SurfNum) != ZoneToResimulate)) { + if ((ZoneNum != ZoneToResimulate) && (state.dataSurface->SurfAdjacentZone(SurfNum) != ZoneToResimulate)) { continue; // skip surfaces that are not associated with this zone } } @@ -282,8 +282,8 @@ void InitInteriorConvectionCoeffs(EnergyPlusData &state, if (SELECT_CASE_var1 == ASHRAESimple) { CalcASHRAESimpleIntConvCoeff(state, SurfNum, SurfaceTemperatures(SurfNum), state.dataHeatBalFanSys->MAT(ZoneNum)); // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems) - if (state.dataHeatBal->HConvIn(SurfNum) < state.dataHeatBal->LowHConvLimit) - state.dataHeatBal->HConvIn(SurfNum) = state.dataHeatBal->LowHConvLimit; + if (state.dataHeatBalSurf->SurfHConvInt(SurfNum) < state.dataHeatBal->LowHConvLimit) + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataHeatBal->LowHConvLimit; } else if (SELECT_CASE_var1 == ASHRAETARP) { if (!state.dataConstruction->Construct(Surface(SurfNum).Construction).TypeIsWindow) { @@ -293,8 +293,8 @@ void InitInteriorConvectionCoeffs(EnergyPlusData &state, } // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems) - if (state.dataHeatBal->HConvIn(SurfNum) < state.dataHeatBal->LowHConvLimit) - state.dataHeatBal->HConvIn(SurfNum) = state.dataHeatBal->LowHConvLimit; + if (state.dataHeatBalSurf->SurfHConvInt(SurfNum) < state.dataHeatBal->LowHConvLimit) + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataHeatBal->LowHConvLimit; } else if (SELECT_CASE_var1 == AdaptiveConvectionAlgorithm) { @@ -311,14 +311,14 @@ void InitInteriorConvectionCoeffs(EnergyPlusData &state, ShowFatalError(state, "Unhandled convection coefficient algorithm."); } } else { // Interior convection has been set by the user with "value" or "schedule" - state.dataHeatBal->HConvIn(SurfNum) = SetIntConvectionCoeff(state, SurfNum); + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = SetIntConvectionCoeff(state, SurfNum); // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems) - if (state.dataHeatBal->HConvIn(SurfNum) < state.dataHeatBal->LowHConvLimit) - state.dataHeatBal->HConvIn(SurfNum) = state.dataHeatBal->LowHConvLimit; + if (state.dataHeatBalSurf->SurfHConvInt(SurfNum) < state.dataHeatBal->LowHConvLimit) + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataHeatBal->LowHConvLimit; } if (state.dataSurface->SurfEMSOverrideIntConvCoef(SurfNum)) { - state.dataHeatBal->HConvIn(SurfNum) = state.dataSurface->SurfEMSValueForIntConvCoef(SurfNum); + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataSurface->SurfEMSValueForIntConvCoef(SurfNum); if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { Real64 hConst = state.dataSurface->SurfEMSValueForIntConvCoef(SurfNum); state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].in = KIVA_CONST_CONV(hConst); @@ -2556,11 +2556,12 @@ void CalcASHRAESimpleIntConvCoeff(EnergyPlusData &state, return CalcASHRAESimpleIntConvCoeff(Tsurf, Tamb, cosTilt); }; } else { - state.dataHeatBal->HConvIn(SurfNum) = CalcASHRAESimpleIntConvCoeff(SurfaceTemperature, ZoneMeanAirTemperature, Surface(SurfNum).CosTilt); + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = + CalcASHRAESimpleIntConvCoeff(SurfaceTemperature, ZoneMeanAirTemperature, Surface(SurfNum).CosTilt); } // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems) - state.dataHeatBal->HConvIn(SurfNum) = max(state.dataHeatBal->HConvIn(SurfNum), state.dataHeatBal->LowHConvLimit); + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = max(state.dataHeatBalSurf->SurfHConvInt(SurfNum), state.dataHeatBal->LowHConvLimit); } Real64 CalcASHRAETARPNatural(Real64 const Tsurf, Real64 const Tamb, Real64 const cosTilt) @@ -2627,13 +2628,13 @@ void CalcASHRAEDetailedIntConvCoeff(EnergyPlusData &state, return CalcASHRAETARPNatural(Tsurf, Tamb, cosTilt); }; } else { - state.dataHeatBal->HConvIn(SurfNum) = CalcASHRAETARPNatural( + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = CalcASHRAETARPNatural( SurfaceTemperature, ZoneMeanAirTemperature, -Surface(SurfNum).CosTilt); // negative CosTilt because CosTilt is relative to exterior } // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems) - if (state.dataHeatBal->HConvIn(SurfNum) < state.dataHeatBal->LowHConvLimit) - state.dataHeatBal->HConvIn(SurfNum) = state.dataHeatBal->LowHConvLimit; + if (state.dataHeatBalSurf->SurfHConvInt(SurfNum) < state.dataHeatBal->LowHConvLimit) + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataHeatBal->LowHConvLimit; } void CalcDetailedHcInForDVModel(EnergyPlusData &state, @@ -2885,7 +2886,7 @@ void CalcCeilingDiffuserIntConvCoeff(EnergyPlusData &state, state.dataConstruction->Construct(Surface(SurfNum).Construction).TypeIsWindow); }; } else { - state.dataHeatBal->HConvIn(SurfNum) = + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = CalcCeilingDiffuserIntConvCoeff(state, ACH, SurfaceTemperatures(SurfNum), @@ -2895,8 +2896,8 @@ void CalcCeilingDiffuserIntConvCoeff(EnergyPlusData &state, Surface(SurfNum).Height, state.dataConstruction->Construct(Surface(SurfNum).Construction).TypeIsWindow); // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems) - if (state.dataHeatBal->HConvIn(SurfNum) < state.dataHeatBal->LowHConvLimit) - state.dataHeatBal->HConvIn(SurfNum) = state.dataHeatBal->LowHConvLimit; + if (state.dataHeatBalSurf->SurfHConvInt(SurfNum) < state.dataHeatBal->LowHConvLimit) + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataHeatBal->LowHConvLimit; } } // SurfNum } @@ -2981,19 +2982,19 @@ void CalcCeilingDiffuserInletCorr(EnergyPlusData &state, // assume that reference air temp for user defined convection coefficient is the mean air temperature (=MAT) // Calculate the convection coefficient based on inlet (supply) air conditions if (Tilt < 45.0) { - state.dataHeatBal->HConvIn(SurfNum) = 0.49 * std::pow(ACH, 0.8); // Ceiling correlation + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = 0.49 * std::pow(ACH, 0.8); // Ceiling correlation } else if (Tilt > 135.0) { - state.dataHeatBal->HConvIn(SurfNum) = 0.13 * std::pow(ACH, 0.8); // Floor correlation + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = 0.13 * std::pow(ACH, 0.8); // Floor correlation } else { - state.dataHeatBal->HConvIn(SurfNum) = 0.19 * std::pow(ACH, 0.8); // Wall correlation + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = 0.19 * std::pow(ACH, 0.8); // Wall correlation } // set flag for reference air temperature state.dataSurface->SurfTAirRef(SurfNum) = ZoneSupplyAirTemp; } // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems) - if (state.dataHeatBal->HConvIn(SurfNum) < state.dataHeatBal->LowHConvLimit) - state.dataHeatBal->HConvIn(SurfNum) = state.dataHeatBal->LowHConvLimit; + if (state.dataHeatBalSurf->SurfHConvInt(SurfNum) < state.dataHeatBal->LowHConvLimit) + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataHeatBal->LowHConvLimit; } // SurfNum @@ -3130,12 +3131,12 @@ void CalcTrombeWallIntConvCoeff(EnergyPlusData &state, if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { ShowFatalError(state, "Trombe wall convection model not applicable for foundation surface =" + Surface(SurfNum).Name); } - state.dataHeatBal->HConvIn(SurfNum) = 2.0 * HConvNet; + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = 2.0 * HConvNet; } // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems) - if (state.dataHeatBal->HConvIn(SurfNum) < state.dataHeatBal->LowHConvLimit) - state.dataHeatBal->HConvIn(SurfNum) = state.dataHeatBal->LowHConvLimit; + if (state.dataHeatBalSurf->SurfHConvInt(SurfNum) < state.dataHeatBal->LowHConvLimit) + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataHeatBal->LowHConvLimit; } } @@ -3519,16 +3520,16 @@ void CalcISO15099WindowIntConvCoeff(EnergyPlusData &state, ShowFatalError(state, "ISO15099 convection model not applicable for foundation surface =" + Surface(SurfNum).Name); } - state.dataHeatBal->HConvIn(SurfNum) = + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = CalcISO15099WindowIntConvCoeff(state, SurfaceTemperature, AirTemperature, AirHumRat, Height, TiltDeg, sineTilt); // EMS override point (Violates Standard 15099? throw warning? scary. if (state.dataSurface->SurfEMSOverrideIntConvCoef(SurfNum)) - state.dataHeatBal->HConvIn(SurfNum) = state.dataSurface->SurfEMSValueForIntConvCoef(SurfNum); + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataSurface->SurfEMSValueForIntConvCoef(SurfNum); // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems) - if (state.dataHeatBal->HConvIn(SurfNum) < state.dataHeatBal->LowHConvLimit) - state.dataHeatBal->HConvIn(SurfNum) = state.dataHeatBal->LowHConvLimit; + if (state.dataHeatBalSurf->SurfHConvInt(SurfNum) < state.dataHeatBal->LowHConvLimit) + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataHeatBal->LowHConvLimit; } void SetupAdaptiveConvectionStaticMetaData(EnergyPlusData &state) @@ -4364,7 +4365,7 @@ void ManageInsideAdaptiveConvectionAlgo(EnergyPlusData &state, int const SurfNum // simple worker routine takes surface classification and fills in model to use (IntConvHcModelEq) for that surface MapIntConvClassificationToHcModels(state, SurfNum); - EvaluateIntHcModels(state, SurfNum, state.dataSurface->SurfIntConvHcModelEq(SurfNum), state.dataHeatBal->HConvIn(SurfNum)); + EvaluateIntHcModels(state, SurfNum, state.dataSurface->SurfIntConvHcModelEq(SurfNum), state.dataHeatBalSurf->SurfHConvInt(SurfNum)); // if ( std::isnan( HConvIn( SurfNum ) ) ) { // Use IEEE_IS_NAN when GFortran supports it //// throw Error // ShowSevereError(state, "Inside convection coefficient is out of bound = " + Surface( SurfNum ).Name ); @@ -4722,7 +4723,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_ISO15099Windows) { CalcISO15099WindowIntConvCoeff(state, SurfNum, Tsurface, Tzone); - tmpHc = state.dataHeatBal->HConvIn(SurfNum); + tmpHc = state.dataHeatBalSurf->SurfHConvInt(SurfNum); state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_GoldsteinNovoselacCeilingDiffuserWindow) { tmpHc = CalcGoldsteinNovoselacCeilingDiffuserWindow(state.dataSurface->SurfIntConvZonePerimLength(SurfNum), @@ -8550,12 +8551,12 @@ void CalcASTMC1340ConvCoeff(EnergyPlusData &state, Real64 Volume = state.dataHeatBal->Zone(ZoneNum).Volume; // Volume of the zone in m3 Real64 Vair = std::pow(Volume, OneThird) * CalcZoneSystemACH(state, ZoneNum) / 3600; - state.dataHeatBal->HConvIn(SurfNum) = + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = CalcASTMC1340ConvCoeff(state, SurfNum, SurfaceTemperature, ZoneMeanAirTemperature, Vair, Surface(SurfNum).Tilt); // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems) - if (state.dataHeatBal->HConvIn(SurfNum) < state.dataHeatBal->LowHConvLimit) - state.dataHeatBal->HConvIn(SurfNum) = state.dataHeatBal->LowHConvLimit; + if (state.dataHeatBalSurf->SurfHConvInt(SurfNum) < state.dataHeatBal->LowHConvLimit) + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataHeatBal->LowHConvLimit; } Real64 CalcASTMC1340ConvCoeff(EnergyPlusData &state, int const SurfNum, Real64 const Tsurf, Real64 const Tair, Real64 const Vair, Real64 const Tilt) diff --git a/src/EnergyPlus/CrossVentMgr.cc b/src/EnergyPlus/CrossVentMgr.cc index 11b9e4ee7ef..88dd00fe372 100644 --- a/src/EnergyPlus/CrossVentMgr.cc +++ b/src/EnergyPlus/CrossVentMgr.cc @@ -193,10 +193,10 @@ namespace CrossVentMgr { if (SurfNum == 0) continue; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); state.dataUCSDShared->HWall(Ctd) = state.dataRoomAirMod->CVHcIn(SurfNum); state.dataCrossVentMgr->HAT_R += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->TempSurfIn(SurfNum) * state.dataUCSDShared->HWall(Ctd); + state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWall(Ctd); state.dataCrossVentMgr->HA_R += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWall(Ctd); } // END WALL // WINDOW Hc, HA and HAT CALCULATION @@ -208,30 +208,30 @@ namespace CrossVentMgr { if (state.dataSurface->Surface(SurfNum).Tilt > 10.0 && state.dataSurface->Surface(SurfNum).Tilt < 170.0) { // Window Wall state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->CVHcIn(SurfNum); state.dataCrossVentMgr->HAT_R += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->TempSurfIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); + state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); state.dataCrossVentMgr->HA_R += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); } if (state.dataSurface->Surface(SurfNum).Tilt <= 10.0) { // Window Ceiling state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Ujet); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Ujet); Hjet = state.dataRoomAirMod->CVHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); Hrec = state.dataRoomAirMod->CVHcIn(SurfNum); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * Hjet + (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * Hrec; state.dataCrossVentMgr->HAT_R += state.dataSurface->Surface(SurfNum).Area * (1.0 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * - state.dataHeatBalSurf->TempSurfIn(SurfNum) * Hrec; + state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hrec; state.dataCrossVentMgr->HA_R += state.dataSurface->Surface(SurfNum).Area * (1.0 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * Hrec; state.dataCrossVentMgr->HAT_J += state.dataSurface->Surface(SurfNum).Area * state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * - state.dataHeatBalSurf->TempSurfIn(SurfNum) * Hjet; + state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hjet; state.dataCrossVentMgr->HA_J += state.dataSurface->Surface(SurfNum).Area * state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * Hjet; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * state.dataRoomAirMod->ZTJET(ZoneNum) + @@ -240,21 +240,21 @@ namespace CrossVentMgr { if (state.dataSurface->Surface(SurfNum).Tilt >= 170.0) { // Window Floor state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Ujet); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Ujet); Hjet = state.dataRoomAirMod->CVHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); Hrec = state.dataRoomAirMod->CVHcIn(SurfNum); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * Hjet + (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * Hrec; state.dataCrossVentMgr->HAT_R += state.dataSurface->Surface(SurfNum).Area * (1.0 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * - state.dataHeatBalSurf->TempSurfIn(SurfNum) * Hrec; + state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hrec; state.dataCrossVentMgr->HA_R += state.dataSurface->Surface(SurfNum).Area * (1.0 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * Hrec; state.dataCrossVentMgr->HAT_J += state.dataSurface->Surface(SurfNum).Area * state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * - state.dataHeatBalSurf->TempSurfIn(SurfNum) * Hjet; + state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hjet; state.dataCrossVentMgr->HA_J += state.dataSurface->Surface(SurfNum).Area * state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * Hjet; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * state.dataRoomAirMod->ZTJET(ZoneNum) + @@ -270,10 +270,10 @@ namespace CrossVentMgr { if (SurfNum == 0) continue; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->CVHcIn(SurfNum); state.dataCrossVentMgr->HAT_R += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->TempSurfIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); + state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); state.dataCrossVentMgr->HA_R += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HDoor(Ctd); } // END DOOR // INTERNAL Hc, HA and HAT CALCULATION @@ -284,10 +284,10 @@ namespace CrossVentMgr { if (SurfNum == 0) continue; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); state.dataUCSDShared->HInternal(Ctd) = state.dataRoomAirMod->CVHcIn(SurfNum); state.dataCrossVentMgr->HAT_R += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->TempSurfIn(SurfNum) * state.dataUCSDShared->HInternal(Ctd); + state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HInternal(Ctd); state.dataCrossVentMgr->HA_R += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HInternal(Ctd); } // END INTERNAL @@ -299,20 +299,20 @@ namespace CrossVentMgr { if (SurfNum == 0) continue; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Ujet); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Ujet); Hjet = state.dataRoomAirMod->CVHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); Hrec = state.dataRoomAirMod->CVHcIn(SurfNum); state.dataUCSDShared->HCeiling(Ctd) = state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * Hjet + (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * Hrec; state.dataCrossVentMgr->HAT_R += state.dataSurface->Surface(SurfNum).Area * (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * - state.dataHeatBalSurf->TempSurfIn(SurfNum) * Hrec; + state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hrec; state.dataCrossVentMgr->HA_R += state.dataSurface->Surface(SurfNum).Area * (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * Hrec; state.dataCrossVentMgr->HAT_J += state.dataSurface->Surface(SurfNum).Area * state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * - state.dataHeatBalSurf->TempSurfIn(SurfNum) * Hjet; + state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hjet; state.dataCrossVentMgr->HA_J += state.dataSurface->Surface(SurfNum).Area * state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * Hjet; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * state.dataRoomAirMod->ZTJET(ZoneNum) + @@ -327,20 +327,20 @@ namespace CrossVentMgr { if (SurfNum == 0) continue; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Ujet); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Ujet); Hjet = state.dataRoomAirMod->CVHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); Hrec = state.dataRoomAirMod->CVHcIn(SurfNum); state.dataUCSDShared->HFloor(Ctd) = state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * Hjet + (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * Hrec; state.dataCrossVentMgr->HAT_R += state.dataSurface->Surface(SurfNum).Area * (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * - state.dataHeatBalSurf->TempSurfIn(SurfNum) * Hrec; + state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hrec; state.dataCrossVentMgr->HA_R += state.dataSurface->Surface(SurfNum).Area * (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * Hrec; state.dataCrossVentMgr->HAT_J += state.dataSurface->Surface(SurfNum).Area * state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * - state.dataHeatBalSurf->TempSurfIn(SurfNum) * Hjet; + state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hjet; state.dataCrossVentMgr->HA_J += state.dataSurface->Surface(SurfNum).Area * state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * Hjet; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * state.dataRoomAirMod->ZTJET(ZoneNum) + diff --git a/src/EnergyPlus/DataBSDFWindow.hh b/src/EnergyPlus/DataBSDFWindow.hh index 38df44dca28..7e0b684a157 100644 --- a/src/EnergyPlus/DataBSDFWindow.hh +++ b/src/EnergyPlus/DataBSDFWindow.hh @@ -442,9 +442,9 @@ struct BSDFWindowData : BaseGlobalStruct int TotThermalModels = 0; // Number of thermal models // calculation - Array3D SUNCOSTS = Array3D(60, 24, 3); // Timestep values of solar direction cosines - Array2D BSDFTempMtrx; // Temporary matrix for holding axisymmetric input - EPVector ComplexWind; // Window geometry structure: set in CalcPerSolarBeam/SolarShading + Array2D> SUNCOSTS = Array2D>(60, 24); // Timestep values of solar direction cosines + Array2D BSDFTempMtrx; // Temporary matrix for holding axisymmetric input + EPVector ComplexWind; // Window geometry structure: set in CalcPerSolarBeam/SolarShading void clear_state() override { @@ -452,7 +452,7 @@ struct BSDFWindowData : BaseGlobalStruct this->FirstBSDF = 0; this->MaxBkSurf = 20; this->TotThermalModels = 0; - this->SUNCOSTS = Array3D(60, 24, 3); + this->SUNCOSTS = Array2D>(60, 24); this->BSDFTempMtrx.deallocate(); this->ComplexWind.deallocate(); } diff --git a/src/EnergyPlus/DataHeatBalSurface.hh b/src/EnergyPlus/DataHeatBalSurface.hh index bb8da7fa881..6cdd1bdaa7e 100644 --- a/src/EnergyPlus/DataHeatBalSurface.hh +++ b/src/EnergyPlus/DataHeatBalSurface.hh @@ -81,146 +81,117 @@ struct HeatBalSurfData : BaseGlobalStruct std::vector Zone_has_mixed_HT_models; // True if any surfaces in zone use CondFD, HAMT, or Kiva // Integer Variables for the Heat Balance Simulation - Array1D_int SUMH; // From Old Bldctf.inc + Array1D_int SurfCurrNumHist; // From Old Bldctf.inc // Surface heat balance limits and convergence parameters Real64 MaxSurfaceTempLimit = 200.0; // Highest inside surface temperature allowed in Celsius Real64 MaxSurfaceTempLimitBeforeFatal = 500.0; // 2.5 times MaxSurfaceTempLimit int MinIterations = 1; // Minimum number of iterations for surface heat balance + bool InterZoneWindow = false; // True if there is an interzone window + Real64 SumSurfaceHeatEmission = 0.0; // Heat emission from all surfaces // Variables Dimensioned to Max Number of Heat Transfer Surfaces (maxhts) - Array1D CTFConstInPart; // Constant Inside Portion of the CTF calculation - Array1D CTFConstOutPart; // Constant Outside Portion of the CTF calculation + Array1D SurfCTFConstInPart; // Constant Inside Portion of the CTF calculation + Array1D SurfCTFConstOutPart; // Constant Outside Portion of the CTF calculation // This group of arrays (soon to be vectors) added to facilitate vectorizable loops in CalcHeatBalanceInsideSurf2CTFOnly - Array1D CTFCross0; // Construct.CTFCross(0) - Array1D CTFInside0; // Construct.CTFInside(0) - Array1D CTFSourceIn0; // Construct.CTFSourceIn(0) - Array1D TH11Surf; // TH(1,1,SurfNum) - Array1D QsrcHistSurf1; // QsrcHist(SurfNum, 1) - - // todo: merge Is and IsNot and reduce the assignation at each time steps - Array1D_int IsAdiabatic; // 0 not adiabatic, 1 is adiabatic - Array1D_int IsNotAdiabatic; // 1 not adiabatic, 0 is adiabatic - Array1D_int IsSource; // 0 no internal source/sink, 1 has internal source/sing - Array1D_int IsNotSource; // 1 no internal source/sink, 0 has internal source/sing - Array1D_int IsPoolSurf; // 0 not pool, 1 is pool - Array1D_int IsNotPoolSurf; // 1 not pool, 0 is pool - Array1D TempTermSurf; // TempTerm for heatbalance equation - Array1D TempDivSurf; // Divisor for heatbalance equation + Array1D SurfCTFCross0; // Construct.CTFCross(0) + Array1D SurfCTFInside0; // Construct.CTFInside(0) + Array1D SurfCTFSourceIn0; // Construct.CTFSourceIn(0) + Array1D SurfTempOutHist; // TH(1,1,SurfNum) + Array1D SurfQSourceSinkHist; // QsrcHist(SurfNum, 1) + + Array1D_int SurfIsAdiabatic; // 0 not adiabatic, 1 is adiabatic + Array1D_int SurfIsSourceOrSink; // 0 no internal source/sink, 1 has internal source/sing + Array1D_int SurfIsOperatingPool; // 0 not pool, 1 is pool + Array1D SurfTempTerm; // TempTerm for heatbalance equation + Array1D SurfTempDiv; // Divisor for heatbalance equation // end group added to support CalcHeatBalanceInsideSurf2CTFOnly - Array1D TempSurfIn; // Temperature of the Inside Surface for each heat transfer surface - Array1D TempInsOld; // TempSurfIn from previous iteration for convergence check - Array1D TempSurfInTmp; // Inside Surface Temperature Of Each Heat Transfer Surface - Array1D HcExtSurf; // Outside Convection Coefficient - Array1D HAirExtSurf; // Outside Convection Coefficient to Air - Array1D HSkyExtSurf; // Outside Convection Coefficient to Sky - Array1D HGrdExtSurf; // Outside Convection Coefficient to Ground - Array1D TempSource; // Temperature at the source location for each heat transfer surface - Array1D TempUserLoc; // Temperature at the user specified location for each heat transfer surface - Array1D TempSurfInRep; // Temperature of the Inside Surface for each heat transfer surface - Array1D TempSurfInMovInsRep; // Temperature of interior movable insulation on the side facing the zone - - // todo: to SurfRep arrays - // (report) - Array1D QConvInReport; // Surface convection heat gain at inside face [J] - Array1D QdotConvInRep; // Surface convection heat transfer rate at inside face surface [W] - // (report) - Array1D QdotConvInRepPerArea; // Surface conv heat transfer rate per m2 at inside face surf - // (report){w/m2] + Array1D SurfTempIn; // Temperature of the Inside Surface for each heat transfer surface + Array1D SurfTempInsOld; // SurfTempIn from previous iteration for convergence check + Array1D SurfTempInTmp; // Inside Surface Temperature Of Each Heat Transfer Surface + Array1D SurfHcExt; // Outside Convection Coefficient + Array1D SurfHAirExt; // Outside Convection Coefficient to Air + Array1D SurfHSkyExt; // Outside Convection Coefficient to Sky + Array1D SurfHGrdExt; // Outside Convection Coefficient to Ground + Array1D SurfHConvInt; // INSIDE CONVECTION COEFFICIENT + Array1D SurfTempSource; // Temperature at the source location for each heat transfer surface + Array1D SurfTempUserLoc; // Temperature at the user specified location for each heat transfer surface + Array1D SurfTempInRep; // Temperature of the Inside Surface for each heat transfer surface + Array1D SurfTempInMovInsRep; // Temperature of interior movable insulation on the side facing the zone + + Array1D QConvInReport; // Surface convection heat gain at inside face [J] + Array1D QdotConvInRep; // Surface convection heat transfer rate at inside face surface [W] (report) + Array1D QdotConvInRepPerArea; // Surface conv heat transfer rate per m2 at inside face surf (report){w/m2] // these next three all are for net IR thermal radiation exchange with other surfaces in the model. Array1D QRadNetSurfInReport; // Surface thermal radiation heat gain at Inside face [J] Array1D QdotRadNetSurfInRep; // Surface thermal radiation heat transfer inside face surface [W] - Array1D QdotRadNetSurfInRepPerArea; // [W/m2]Surface thermal radiation heat transfer rate per m2 at - // Inside face surf + Array1D QdotRadNetSurfInRepPerArea; // [W/m2]Surface thermal radiation heat transfer rate per m2 at Inside face surf // these next three all are for solar radiation gains on inside face Array1D QRadSolarInReport; // Surface thermal radiation heat gain at Inside face [J] Array1D QdotRadSolarInRep; // Surface thermal radiation heat transfer inside face surface [W] - Array1D QdotRadSolarInRepPerArea; // [W/m2]Surface thermal radiation heat transfer rate per m2 at - // Inside face surf + Array1D QdotRadSolarInRepPerArea; // [W/m2]Surface thermal radiation heat transfer rate per m2 at Inside face surf // these next three all are for Lights visible radiation gains on inside face Array1D QRadLightsInReport; // Surface thermal radiation heat gain at Inside face [J] Array1D QdotRadLightsInRep; // Surface thermal radiation heat transfer inside face surface [W] - Array1D QdotRadLightsInRepPerArea; // [W/m2]Surface thermal radiation heat transfer rate per m2 at - // Inside face surf + Array1D QdotRadLightsInRepPerArea; // [W/m2]Surface thermal radiation heat transfer rate per m2 at Inside face surf // these next three all are for Internal Gains sources of radiation gains on inside face Array1D QRadIntGainsInReport; // Surface thermal radiation heat gain at Inside face [J] Array1D QdotRadIntGainsInRep; // Surface thermal radiation heat transfer inside face surface [W] - Array1D QdotRadIntGainsInRepPerArea; // [W/m2]Surface thermal radiation heat transfer rate per m2 at - // Inside face surf + Array1D QdotRadIntGainsInRepPerArea; // [W/m2]Surface thermal radiation heat transfer rate per m2 at Inside face surf // these next three all are for Radiative HVAC sources of radiation gains on inside face Array1D QRadHVACInReport; // Surface thermal radiation heat gain at Inside face [J] Array1D QdotRadHVACInRep; // Surface thermal radiation heat transfer inside face surface [W] - Array1D QdotRadHVACInRepPerArea; // [W/m2]Surface thermal radiation heat transfer rate per m2 at - // Inside face surf + Array1D QdotRadHVACInRepPerArea; // [W/m2]Surface thermal radiation heat transfer rate per m2 at Inside face surf Array1D QConvOutReport; // Surface convection heat gain at Outside face [J] Array1D QdotConvOutRep; // Surface convection heat transfer rate at Outside face surface [W] - Array1D QdotConvOutRepPerArea; // Surface conv heat transfer rate per m2 at Outside face surf - // (report){w/m2] + Array1D QdotConvOutRepPerArea; // Surface conv heat transfer rate per m2 at Outside face surf (report){w/m2] Array1D QRadOutReport; // Surface thermal radiation heat gain at Outside face [J] Array1D QdotRadOutRep; // Surface thermal radiation heat transfer outside face surface [W] - Array1D QdotRadOutRepPerArea; // [W/m2]Surface thermal radiation heat transfer rate per m2 at - // Outside face surf - Array1D QAirExtReport; // Surface Outside Face Thermal Radiation to Air Heat Transfer Rate [W] - Array1D QHeatEmiReport; // Surface Outside Face Heat Emission to Air Rate [W] - - Array1D SurfOpaqInsFaceCondGainRep; // Equals Opaq Surf Ins Face Cond - // when Opaq Surf Ins Face Cond >= 0 - Array1D SurfOpaqInsFaceCondLossRep; // Equals -Opaq Surf Ins Face Cond - // when Opaq Surf Ins Face Cond < 0 - Array1D SurfOpaqInsFaceConduction; // Opaque surface inside face heat conduction flow (W) - // from inside of opaque surfaces, for reporting (W) - Array1D SurfOpaqInsFaceConductionFlux; // Opaque surface inside face heat conduction flux (W/m2) - // from inside of opaque surfaces, for reporting (W/m2) - Array1D SurfOpaqInsFaceConductionEnergy; // Opaque surface inside face heat conduction flow (J) - // from inside of opaque surfaces, for reporting (J) - - Array1D SurfOpaqExtFaceCondGainRep; // Equals Opaq Surf Ext Face Cond - // when Opaq Surf Ext Face Cond >= 0 - Array1D SurfOpaqExtFaceCondLossRep; // Equals -Opaq Surf Ext Face Cond - // when Opaq Surf Ext Face Cond < 0 - Array1D SurfOpaqOutsideFaceConduction; // Opaque surface outside face heat conduction flow (W) - // from inside of opaque surfaces, for reporting (W) - Array1D SurfOpaqOutsideFaceConductionFlux; // Opaque surface outside face heat conduct flux (W/m2) - // from outside of opaque surfaces, for reporting (W/m2) - Array1D SurfOpaqOutsideFaceConductionEnergy; // Opaque surface outside face heat conduction flow (J) - // from inside of opaque surfaces, for reporting (J) - - Array1D SurfOpaqAvgFaceCondGainRep; // Equals Opaq Surf average Face Cond - // when Opaq Surf average Face Cond >= 0 - Array1D SurfOpaqAvgFaceCondLossRep; // Equals -Opaq Surf average Face Cond - // when Opaq Surf average Face Cond < 0 - Array1D SurfOpaqAvgFaceConduction; // Opaque surface average heat conduction flow (W) - // net conduction from outside environ toward inside zone - // from inside of opaque surfaces, for reporting (W) - Array1D SurfOpaqAvgFaceConductionFlux; // Opaque surface average face heat conduction flux (W/m2) - // net conduction from outside environ to inside zone - // from inside of opaque surfaces, for reporting (W/m2) - Array1D SurfOpaqAvgFaceConductionEnergy; // Opaque surface average heat conduction flow (J) - // net conduction from outside environ toward inside zone - // from inside of opaque surfaces, for reporting (J) - - Array1D SurfOpaqStorageGainRep; // Equals Opaque surface stored heat conduction flow - // when Opaque surface stored heat conduction flow >= 0 - Array1D SurfOpaqStorageCondLossRep; // Equals -Opaque surface stored heat conduction flow - // when Opaque surface stored heat conduction flow < 0 - Array1D SurfOpaqStorageConduction; // Opaque surface stored heat conduction flow (W) - // storage of heat inside surface, positive is increasing in surf - Array1D SurfOpaqStorageConductionFlux; // Opaque surface stored heat conduction flux (W/m2) - // storage of heat inside surface, positive is increasing in surf - Array1D SurfOpaqStorageConductionEnergy; // Opaque surface stored heat conduction flow (J) - // storage of heat inside surface, positive is increasing in surf - - Array1D SurfOpaqInsFaceBeamSolAbsorbed; // Opaque surface inside face absorbed beam solar, - // for reporting (W) - Array1D SurfTempOut; // Temperature of the Outside Surface for each heat transfer surface - // used for reporting purposes only. Ref: TH(x,1,1) + Array1D QdotRadOutRepPerArea; // [W/m2]Surface thermal radiation heat transfer rate per m2 at Outside face surf + Array1D QAirExtReport; // Surface Outside Face Thermal Radiation to Air Heat Transfer Rate [W] + Array1D QHeatEmiReport; // Surface Outside Face Heat Emission to Air Rate [W] + + Array1D SurfOpaqInsFaceCondGainRep; // Opaq Surf Ins Face Cond when Opaq Surf Ins Face Cond >= 0 + Array1D SurfOpaqInsFaceCondLossRep; // Opaq Surf Ins Face Cond when Opaq Surf Ins Face Cond < 0 + Array1D SurfOpaqInsFaceConduction; // Opaque surface inside face heat conduction flow (W) from inside of opaque surfaces, + // for reporting (W) + Array1D SurfOpaqInsFaceConductionFlux; // Opaque surface inside face heat conduction flux (W/m2) from inside of opaque surfaces, + // for reporting (W/m2) + Array1D SurfOpaqInsFaceConductionEnergy; // Opaque surface inside face heat conduction flow (J) from inside of opaque surfaces, + // for reporting (J) + + Array1D SurfOpaqExtFaceCondGainRep; // Opaq Surf Ext Face Cond when Opaq Surf Ext Face Cond >= 0 + Array1D SurfOpaqExtFaceCondLossRep; // Opaq Surf Ext Face Cond when Opaq Surf Ext Face Cond < 0 + Array1D SurfOpaqOutFaceCond; // Opaque surface outside face heat conduction flow (W) from inside of opaque surfaces, for reporting (W) + Array1D SurfOpaqOutFaceCondFlux; // Opaque surface outside face heat conduct flux (W/m2) from outside of opaque surfaces, + // for reporting (W/m2) + Array1D SurfOpaqOutFaceCondEnergy; // Opaque surface outside face heat conduction flow (J) from inside of opaque surfaces, + // for reporting (J) + + Array1D SurfOpaqAvgFaceCondGainRep; // Opaq Surf average Face Cond when Opaq Surf average Face Cond >= 0 + Array1D SurfOpaqAvgFaceCondLossRep; // Opaq Surf average Face Cond when Opaq Surf average Face Cond < 0 + Array1D SurfOpaqAvgFaceCond; // Opaque surface average heat conduction flow (W) net conduction from outside environ toward inside zone + // from inside of opaque surfaces, for reporting (W) + Array1D SurfOpaqAvgFaceCondFlux; // Opaque surface average face heat conduction flux (W/m2) net conduction from outside environ to inside + // zone from inside of opaque surfaces, for reporting (W/m2) + Array1D SurfOpaqAvgFaceCondEnergy; // Opaque surface average heat conduction flow (J) net conduction from outside environ toward inside + // zone from inside of opaque surfaces, for reporting (J) + + Array1D SurfOpaqStorageGainRep; // Opaque surface stored heat conduction flow when Opaque surface stored heat conduction flow >= 0 + Array1D SurfOpaqStorageCondLossRep; // Opaque surface stored heat conduction flow when Opaque surface stored heat conduction flow < 0 + Array1D SurfOpaqStorageCond; // Opaque surface stored heat conduction flow (W) storage of heat inside surface, + // positive is increasing in surf + Array1D SurfOpaqStorageCondFlux; // Opaque surface stored heat conduction flux (W/m2) storage of heat inside surface, + // positive is increasing in surf + Array1D SurfOpaqStorageCondEnergy; // Opaque surface stored heat conduction flow (J) storage of heat inside surface, + // positive is increasing in surf + + Array1D SurfOpaqInsFaceBeamSolAbsorbed; // Opaque surface inside face absorbed beam solar, for reporting (W) + Array1D SurfTempOut; // Temperature of the Outside Surface for each heat transfer surface used for reporting purposes only. Ref: TH(x,1,1) Array1D SurfQRadSWOutMvIns; // Short wave radiation absorbed on outside of movable insulation - // unusedREAL(r64), ALLOCATABLE, DIMENSION(:) :: QBV !Beam solar absorbed by interior shades in a zone, plus - // diffuse from beam not absorbed in zone, plus - // beam absorbed at inside surfaces Array1D SurfNetLWRadToSurf; // Net interior long wavelength radiation to a surface from other surfaces Array1D SurfOpaqQRadSWLightsInAbs; // Short wave from Lights radiation absorbed on inside of opaque surface @@ -237,10 +208,8 @@ struct HeatBalSurfData : BaseGlobalStruct // REAL(r64) variables from BLDCTF.inc and only used in the Heat Balance Array3D TH; // Temperature History (SurfNum,Hist Term,In/Out) where: - // Hist Term (1 = Current Time, 2-MaxCTFTerms = previous times), - // In/Out (1 = Outside, 2 = Inside) - Array3D QH; // Flux History (TH and QH are interpolated from THM and QHM for - // the next user requested time step) + // Hist Term (1 = Current Time, 2-MaxCTFTerms = previous times), In/Out (1 = Outside, 2 = Inside) + Array3D QH; // Flux History (TH and QH are interpolated from THM and QHM for the next user requested time step) Array3D THM; // Master Temperature History (on the time step for the construct) Array3D QHM; // Master Flux History (on the time step for the construct) Array2D TsrcHist; // Temperature history at the source location (SurfNum,Term) @@ -250,10 +219,8 @@ struct HeatBalSurfData : BaseGlobalStruct Array2D TuserHistM; // Master temperature history at the user specified location (SurfNum,Term) Array2D QsrcHistM; // Master heat source/sink history for the surface (SurfNum,Term) - Array2D FractDifShortZtoZ; // Fraction of diffuse short radiation in Zone 2 transmitted to Zone 1 - Array1D_bool RecDifShortFromZ; // True if Zone gets short radiation from another - bool InterZoneWindow = false; // True if there is an interzone window - Real64 SumSurfaceHeatEmission = 0.0; // Heat emission from all surfaces + Array2D ZoneFractDifShortZtoZ; // Fraction of diffuse short radiation in Zone 2 transmitted to Zone 1 + Array1D_bool EnclSolRecDifShortFromZ; // True if Zone gets short radiation from another // Surface Heat Balance Array1D SurfMovInsulExtPresent; // True when interior movable insulation is present @@ -272,36 +239,35 @@ struct HeatBalSurfData : BaseGlobalStruct void clear_state() override { this->Zone_has_mixed_HT_models.clear(); - this->SUMH.deallocate(); + this->SurfCurrNumHist.deallocate(); this->MaxSurfaceTempLimit = 200.0; this->MaxSurfaceTempLimitBeforeFatal = 500.0; this->MinIterations = 1; - this->CTFConstInPart.deallocate(); - this->CTFConstOutPart.deallocate(); - this->CTFCross0.deallocate(); - this->CTFInside0.deallocate(); - this->CTFSourceIn0.deallocate(); - this->TH11Surf.deallocate(); - this->QsrcHistSurf1.deallocate(); - this->IsAdiabatic.deallocate(); - this->IsNotAdiabatic.deallocate(); - this->IsSource.deallocate(); - this->IsNotSource.deallocate(); - this->IsPoolSurf.deallocate(); - this->IsNotPoolSurf.deallocate(); - this->TempTermSurf.deallocate(); - this->TempDivSurf.deallocate(); - this->TempSurfIn.deallocate(); - this->TempInsOld.deallocate(); - this->TempSurfInTmp.deallocate(); - this->HcExtSurf.deallocate(); - this->HAirExtSurf.deallocate(); - this->HSkyExtSurf.deallocate(); - this->HGrdExtSurf.deallocate(); - this->TempSource.deallocate(); - this->TempUserLoc.deallocate(); - this->TempSurfInRep.deallocate(); - this->TempSurfInMovInsRep.deallocate(); + this->SurfCTFConstInPart.deallocate(); + this->SurfCTFConstOutPart.deallocate(); + this->SurfCTFCross0.deallocate(); + this->SurfCTFInside0.deallocate(); + this->SurfCTFSourceIn0.deallocate(); + this->SurfTempOutHist.deallocate(); + this->SurfQSourceSinkHist.deallocate(); + this->SurfIsAdiabatic.deallocate(); + this->SurfIsSourceOrSink.deallocate(); + this->SurfIsOperatingPool.deallocate(); + this->SurfTempTerm.deallocate(); + this->SurfTempDiv.deallocate(); + this->SurfTempIn.deallocate(); + this->SurfTempInsOld.deallocate(); + this->SurfTempInTmp.deallocate(); + this->SurfHcExt.deallocate(); + this->SurfHAirExt.deallocate(); + this->SurfHSkyExt.deallocate(); + this->SurfHGrdExt.deallocate(); + this->SurfHConvInt.deallocate(); + + this->SurfTempSource.deallocate(); + this->SurfTempUserLoc.deallocate(); + this->SurfTempInRep.deallocate(); + this->SurfTempInMovInsRep.deallocate(); this->QConvInReport.deallocate(); this->QdotConvInRep.deallocate(); this->QdotConvInRepPerArea.deallocate(); @@ -333,19 +299,19 @@ struct HeatBalSurfData : BaseGlobalStruct this->SurfOpaqInsFaceConductionEnergy.deallocate(); this->SurfOpaqExtFaceCondGainRep.deallocate(); this->SurfOpaqExtFaceCondLossRep.deallocate(); - this->SurfOpaqOutsideFaceConduction.deallocate(); - this->SurfOpaqOutsideFaceConductionFlux.deallocate(); - this->SurfOpaqOutsideFaceConductionEnergy.deallocate(); + this->SurfOpaqOutFaceCond.deallocate(); + this->SurfOpaqOutFaceCondFlux.deallocate(); + this->SurfOpaqOutFaceCondEnergy.deallocate(); this->SurfOpaqAvgFaceCondGainRep.deallocate(); this->SurfOpaqAvgFaceCondLossRep.deallocate(); - this->SurfOpaqAvgFaceConduction.deallocate(); - this->SurfOpaqAvgFaceConductionFlux.deallocate(); - this->SurfOpaqAvgFaceConductionEnergy.deallocate(); + this->SurfOpaqAvgFaceCond.deallocate(); + this->SurfOpaqAvgFaceCondFlux.deallocate(); + this->SurfOpaqAvgFaceCondEnergy.deallocate(); this->SurfOpaqStorageGainRep.deallocate(); this->SurfOpaqStorageCondLossRep.deallocate(); - this->SurfOpaqStorageConduction.deallocate(); - this->SurfOpaqStorageConductionFlux.deallocate(); - this->SurfOpaqStorageConductionEnergy.deallocate(); + this->SurfOpaqStorageCond.deallocate(); + this->SurfOpaqStorageCondFlux.deallocate(); + this->SurfOpaqStorageCondEnergy.deallocate(); this->SurfOpaqInsFaceBeamSolAbsorbed.deallocate(); this->SurfTempOut.deallocate(); this->SurfQRadSWOutMvIns.deallocate(); @@ -366,8 +332,8 @@ struct HeatBalSurfData : BaseGlobalStruct this->QsrcHist.deallocate(); this->TsrcHistM.deallocate(); this->QsrcHistM.deallocate(); - this->FractDifShortZtoZ.deallocate(); - this->RecDifShortFromZ.deallocate(); + this->ZoneFractDifShortZtoZ.deallocate(); + this->EnclSolRecDifShortFromZ.deallocate(); this->InterZoneWindow = false; this->SumSurfaceHeatEmission = 0; this->SurfMovInsulExtPresent.deallocate(); diff --git a/src/EnergyPlus/DataHeatBalance.hh b/src/EnergyPlus/DataHeatBalance.hh index 8d77f2ab16f..598501c249d 100644 --- a/src/EnergyPlus/DataHeatBalance.hh +++ b/src/EnergyPlus/DataHeatBalance.hh @@ -2117,7 +2117,6 @@ struct HeatBalanceData : BaseGlobalStruct Array1D SurfQRadSWOutIncBmToBmReflObs; // Exterior beam solar incident from beam-to-beam reflection from obstructions (W/m2) Array1D SurfQRadSWOutIncBmToDiffReflObs; // Exterior diffuse solar incident from beam-to-diffuse reflection from obstructions (W/m2) Array1D SurfQRadSWOutIncSkyDiffReflObs; // Exterior diffuse solar incident from sky diffuse reflection from obstructions (W/m2) - Array1D SurfCosIncidenceAngle; // Cosine of beam solar incidence angle (for reporting) Array1D SurfSWInAbsTotalReport; // Report - Total interior/exterior shortwave absorbed on inside of surface (W) Array1D SurfBmIncInsSurfAmountRepEnergy; // energy of BmIncInsSurfAmountRep [J] Array1D SurfIntBmIncInsSurfAmountRepEnergy; // energy of IntBmIncInsSurfAmountRep [J] @@ -2137,30 +2136,13 @@ struct HeatBalanceData : BaseGlobalStruct Array2D SurfWinInitialDifSolwinAbs; // Initial diffuse solar absorbed in window glass layers from inside(W/m2) Array1D SurfOpaqSWOutAbsTotalReport; // Report - Total exterior shortwave/solar absorbed on outside of surface (W) Array1D SurfOpaqSWOutAbsEnergyReport; // Report - Total exterior shortwave/solar absorbed on outside of surface (j) + Array1D SurfTempEffBulkAir; // air temperature adjacent to the surface used for inside surface heat balances // Material Array1D NominalR; // Nominal R value of each material -- used in matching interzone surfaces Array1D NominalRforNominalUCalculation; // Nominal R values are summed to calculate NominalU values for constructions Array1D NominalU; // Nominal U value for each construction -- used in matching interzone surfaces - // todo - rename and reordering - Array1D SurfTempEffBulkAir; // air temperature adjacent to the surface used for inside surface heat balances - Array1D HConvIn; // INSIDE CONVECTION COEFFICIENT - Array1D SurfAnisoSkyMult; // Multiplier on exterior-surface sky view factor to account for - // anisotropy of sky radiance; = 1.0 for for isotropic sky - Array1D DifShdgRatioIsoSky; // Diffuse shading ratio (WithShdgIsoSky/WoShdgIsoSky) - Array3D DifShdgRatioIsoSkyHRTS; // Diffuse shading ratio (WithShdgIsoSky/WoShdgIsoSky) - Array1D curDifShdgRatioIsoSky; // Diffuse shading ratio (WithShdgIsoSky/WoShdgIsoSky) - Array1D DifShdgRatioHoriz; // Horizon shading ratio (WithShdgHoriz/WoShdgHoriz) - Array3D DifShdgRatioHorizHRTS; // Horizon shading ratio (WithShdgHoriz/WoShdgHoriz) - Array1D WithShdgIsoSky; // Diffuse solar irradiance from sky on surface, with shading - Array1D WoShdgIsoSky; // Diffuse solar from sky on surface, without shading - Array1D WithShdgHoriz; // Diffuse solar irradiance from horizon portion of sky on surface, with shading - Array1D WoShdgHoriz; // Diffuse solar irradiance from horizon portion of sky on surface, without shading - Array1D MultIsoSky; // Contribution to eff sky view factor from isotropic sky - Array1D MultCircumSolar; // Contribution to eff sky view factor from circumsolar brightening - Array1D MultHorizonZenith; // Contribution to eff sky view factor from horizon or zenith brightening - Array1D EnclSolQSWRad; // Zone short-wave flux density; used to calculate short-wave radiation absorbed on inside surfaces of zone or enclosure Array1D EnclSolQSWRadLights; // Like QS, but Lights short-wave only. @@ -2179,22 +2161,25 @@ struct HeatBalanceData : BaseGlobalStruct // from interior surfaces, and beam entering through interior windows // (considered diffuse) // Originally QD, now used only for EnclSolQSDifSol calc for daylighting + Array1D EnclSolVMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance) Array1D EnclRadQThermalRad; // TOTAL THERMAL RADIATION ADDED TO ZONE or Radiant Enclosure (group of zones) Array1D EnclRadThermAbsMult; // EnclRadThermAbsMult - MULTIPLIER TO COMPUTE 'ITABSF' Array1D ZoneSolAbsFirstCalc; // for error message Array1D EnclRadReCalc; // Enclosure solar or thermal radiation properties needs to be recalc due to window/shading status change - bool EnclRadAlwaysReCalc = false; // Enclosure solar or thermal radiation properties always needs to be recalc at any time step - // todo - the following in absorptance branch - Array2D SunlitFracHR; // Hourly fraction of heat transfer surface that is sunlit - Array2D CosIncAngHR; // Hourly cosine of beam radiation incidence angle on surface - Array3D SunlitFrac; // TimeStep fraction of heat transfer surface that is sunlit - Array3D SunlitFracWithoutReveal; // For a window with reveal, the sunlit fraction without shadowing by the reveal - Array3D CosIncAng; // TimeStep cosine of beam radiation incidence angle on surface - Array4D_int - BackSurfaces; // For a given hour and timestep, a list of up to 20 surfaces receiving beam solar radiation from a given exterior window - Array4D OverlapAreas; // For a given hour and timestep, the areas of the exterior window sending beam solar radiation to the surfaces - // listed in BackSurfaces + + bool EnclRadAlwaysReCalc = false; // Enclosure solar or thermal radiation properties always needs to be recalc at any time step + + Array1D SurfCosIncidenceAngle; // Cosine of beam solar incidence angle (for reporting) + Array2D SurfSunlitFracHR; // Hourly fraction of heat transfer surface that is sunlit + Array2D SurfCosIncAngHR; // Hourly cosine of beam radiation incidence angle on surface + Array3D SurfSunlitFrac; // TimeStep fraction of heat transfer surface that is sunlit + Array3D SurfSunlitFracWithoutReveal; // For a window with reveal, the sunlit fraction without shadowing by the reveal + Array3D SurfCosIncAng; // TimeStep cosine of beam radiation incidence angle on surface + Array4D_int SurfWinBackSurfaces; // For a given hour and timestep, a list of up to 20 surfaces receiving beam solar radiation from a given + // exterior window + Array4D SurfWinOverlapAreas; // For a given hour and timestep, the areas of the exterior window sending beam solar radiation to the + // surfaces listed in BackSurfaces Real64 zeroPointerVal = 0.0; int NumAirBoundaryMixing = 0; // Number of air boundary simple mixing objects needed std::vector AirBoundaryMixingZone1; // Air boundary simple mixing zone 1 @@ -2420,7 +2405,6 @@ struct HeatBalanceData : BaseGlobalStruct this->SurfQRadSWOutIncBmToBmReflObs.deallocate(); this->SurfQRadSWOutIncBmToDiffReflObs.deallocate(); this->SurfQRadSWOutIncSkyDiffReflObs.deallocate(); - this->SurfCosIncidenceAngle.deallocate(); this->SurfSWInAbsTotalReport.deallocate(); this->SurfBmIncInsSurfAmountRepEnergy.deallocate(); this->SurfIntBmIncInsSurfAmountRepEnergy.deallocate(); @@ -2439,25 +2423,10 @@ struct HeatBalanceData : BaseGlobalStruct this->SurfWinInitialDifSolwinAbs.deallocate(); this->SurfOpaqSWOutAbsTotalReport.deallocate(); this->SurfOpaqSWOutAbsEnergyReport.deallocate(); + this->SurfTempEffBulkAir.deallocate(); this->NominalR.deallocate(); this->NominalRforNominalUCalculation.deallocate(); this->NominalU.deallocate(); - this->SurfTempEffBulkAir.deallocate(); - this->HConvIn.deallocate(); - this->SurfAnisoSkyMult.deallocate(); - this->DifShdgRatioIsoSky.deallocate(); - this->DifShdgRatioIsoSkyHRTS.deallocate(); - this->curDifShdgRatioIsoSky.deallocate(); - this->DifShdgRatioHoriz.deallocate(); - this->DifShdgRatioHorizHRTS.deallocate(); - this->WithShdgIsoSky.deallocate(); - this->WoShdgIsoSky.deallocate(); - this->WithShdgHoriz.deallocate(); - this->WoShdgHoriz.deallocate(); - this->MultIsoSky.deallocate(); - this->MultCircumSolar.deallocate(); - this->MultHorizonZenith.deallocate(); - this->EnclSolQSWRad.deallocate(); this->EnclSolQSWRadLights.deallocate(); this->EnclSolDB.deallocate(); @@ -2471,13 +2440,14 @@ struct HeatBalanceData : BaseGlobalStruct this->EnclRadThermAbsMult.deallocate(); this->ZoneSolAbsFirstCalc.deallocate(); this->EnclRadReCalc.deallocate(); - this->SunlitFracHR.deallocate(); - this->CosIncAngHR.deallocate(); - this->SunlitFrac.deallocate(); - this->SunlitFracWithoutReveal.deallocate(); - this->CosIncAng.deallocate(); - this->BackSurfaces.deallocate(); - this->OverlapAreas.deallocate(); + this->SurfCosIncidenceAngle.deallocate(); + this->SurfSunlitFracHR.deallocate(); + this->SurfCosIncAngHR.deallocate(); + this->SurfSunlitFrac.deallocate(); + this->SurfSunlitFracWithoutReveal.deallocate(); + this->SurfCosIncAng.deallocate(); + this->SurfWinBackSurfaces.deallocate(); + this->SurfWinOverlapAreas.deallocate(); this->zeroPointerVal = 0.0; this->NumAirBoundaryMixing = 0; this->AirBoundaryMixingZone1.clear(); diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index 9ee37e3f3a7..66318b891f2 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -1201,13 +1201,11 @@ struct SurfacesData : BaseGlobalStruct bool AnyHeatBalanceOutsideSourceTerm = false; // True if any SurfaceProperty:HeatBalanceSourceTerm outside face used bool AnyMovableInsulation = false; // True if any movable insulation presents bool AnyMovableSlat = false; // True if there are any movable slats for window blinds presented - Array1D_int InsideGlassCondensationFlag; // 1 if innermost glass inside surface temp < zone air dew point; 0 otherwise - Array1D_int InsideFrameCondensationFlag; // 1 if frame inside surface temp < zone air dew point; 0 otherwise - Array1D_int InsideDividerCondensationFlag; // 1 if divider inside surface temp < zone air dew point; 0 otherwise - Array1D_int AdjacentZoneToSurface; // Array of adjacent zones to each surface - Array1D X0; // X-component of translation vector - Array1D Y0; // Y-component of translation vector - Array1D Z0; // Z-component of translation vector + + Array1D_int SurfAdjacentZone; // Array of adjacent zones to each surface + Array1D X0; // X-component of translation vector + Array1D Y0; // Y-component of translation vector + Array1D Z0; // Z-component of translation vector std::vector AllHTSurfaceList; // List of all heat transfer surfaces std::vector AllIZSurfaceList; // List of all interzone heat transfer surfaces @@ -1225,22 +1223,22 @@ struct SurfacesData : BaseGlobalStruct Array1D SurfHighTempErrCount; // Surface solar arrays - Array1D SurfAirSkyRadSplit; // Fractional split between the air and the sky for radiation from the surface - // Fraction of sky IR coming from sky itself; 1-SurfAirSkyRadSplit comes from the atmosphere. - Array2D SurfSunCosHourly; // Hourly values of SUNCOS (solar direction cosines) - // Autodesk: Init Zero-initialization added to avoid use uninitialized - Array1D SurfSunlitArea; // Sunlit area by surface number - Array1D SurfSunlitFrac; // Sunlit fraction by surface number - Array1D SurfSkySolarInc; // Incident diffuse solar from sky; if CalcSolRefl is true, includes reflection of sky diffuse - // and beam solar from exterior obstructions [W/m2] - Array1D SurfGndSolarInc; // Incident diffuse solar from ground; if CalcSolRefl is true, - // accounts for shadowing of ground by building and obstructions [W/m2] - Array1D SurfBmToBmReflFacObs; // Factor for incident solar from specular beam refl from obstructions (W/m2)/(W/m2) - Array1D SurfBmToDiffReflFacObs; // Factor for incident solar from diffuse beam refl from obstructions (W/m2)/(W/m2) - Array1D SurfBmToDiffReflFacGnd; // Factor for incident solar from diffuse beam refl from ground - Array1D SurfSkyDiffReflFacGnd; // sky diffuse reflection view factors from ground - Array1D SurfOpaqAI; // Time step value of factor for beam absorbed on inside of opaque surface - Array1D SurfOpaqAO; // Time step value of factor for beam absorbed on outside of opaque surface + Array1D SurfAirSkyRadSplit; // Fractional split between the air and the sky for radiation from the surface + // Fraction of sky IR coming from sky itself; 1-SurfAirSkyRadSplit comes from the atmosphere. + Array1D> SurfSunCosHourly; // Hourly values of SUNCOS (solar direction cosines) + // Autodesk: Init Zero-initialization added to avoid use uninitialized + Array1D SurfSunlitArea; // Sunlit area by surface number + Array1D SurfSunlitFrac; // Sunlit fraction by surface number + Array1D SurfSkySolarInc; // Incident diffuse solar from sky; if CalcSolRefl is true, includes reflection of sky diffuse + // and beam solar from exterior obstructions [W/m2] + Array1D SurfGndSolarInc; // Incident diffuse solar from ground; if CalcSolRefl is true, + // accounts for shadowing of ground by building and obstructions [W/m2] + Array1D SurfBmToBmReflFacObs; // Factor for incident solar from specular beam refl from obstructions (W/m2)/(W/m2) + Array1D SurfBmToDiffReflFacObs; // Factor for incident solar from diffuse beam refl from obstructions (W/m2)/(W/m2) + Array1D SurfBmToDiffReflFacGnd; // Factor for incident solar from diffuse beam refl from ground + Array1D SurfSkyDiffReflFacGnd; // sky diffuse reflection view factors from ground + Array1D SurfOpaqAI; // Time step value of factor for beam absorbed on inside of opaque surface + Array1D SurfOpaqAO; // Time step value of factor for beam absorbed on outside of opaque surface Array1D SurfPenumbraID; // Surface reflectance @@ -1325,6 +1323,10 @@ struct SurfacesData : BaseGlobalStruct Array1D SurfIntConvSurfHasActiveInIt; // Surface Window Heat Balance + Array1D_int SurfWinInsideGlassCondensationFlag; // 1 if innermost glass inside surface temp < zone air dew point; 0 otherwise + Array1D_int SurfWinInsideFrameCondensationFlag; // 1 if frame inside surface temp < zone air dew point; 0 otherwise + Array1D_int SurfWinInsideDividerCondensationFlag; // 1 if divider inside surface temp < zone air dew point; 0 otherwise + Array2D SurfWinA; // Time step value of factor for beam absorbed in window glass layers Array2D SurfWinADiffFront; // Time step value of factor for diffuse absorbed in window layers Array2D SurfWinACFOverlap; // Time step value of factor for beam absorbed in window glass layers which comes from other windows @@ -1456,8 +1458,8 @@ struct SurfacesData : BaseGlobalStruct Array1D SurfWinFrEdgeToCenterGlCondRatio; // Ratio of frame edge of glass conductance (without air films) to center of glass conductance // (without air films) Array1D SurfWinFrameEdgeArea; // Area of glass near frame (m2) - Array1D SurfWinFrameTempSurfIn; // Frame inside surface temperature (C) - Array1D SurfWinFrameTempSurfInOld; // Previous value of frame inside surface temperature (C) + Array1D SurfWinFrameTempIn; // Frame inside surface temperature (C) + Array1D SurfWinFrameTempInOld; // Previous value of frame inside surface temperature (C) Array1D SurfWinFrameTempSurfOut; // Frame outside surface temperature (C) Array1D SurfWinProjCorrFrOut; // Correction factor to absorbed radiation due to frame outside projection Array1D SurfWinProjCorrFrIn; // Correction factor to absorbed radiation due to frame inside projection @@ -1470,8 +1472,8 @@ struct SurfacesData : BaseGlobalStruct Array1D SurfWinDivEdgeToCenterGlCondRatio; // Ratio of divider edge of glass conductance (without air films) to center of glass // conductance (without air films) Array1D SurfWinDividerEdgeArea; // Area of glass near dividers (m2) - Array1D SurfWinDividerTempSurfIn; // Divider inside surface temperature (C) - Array1D SurfWinDividerTempSurfInOld; // Previous value of divider inside surface temperature (C) + Array1D SurfWinDividerTempIn; // Divider inside surface temperature (C) + Array1D SurfWinDividerTempInOld; // Previous value of divider inside surface temperature (C) Array1D SurfWinDividerTempSurfOut; // Divider outside surface temperature (C) Array1D SurfWinProjCorrDivOut; // Correction factor to absorbed radiation due to divider outside projection Array1D SurfWinProjCorrDivIn; // Correction factor to absorbed radiation due to divider inside projection @@ -1592,10 +1594,10 @@ struct SurfacesData : BaseGlobalStruct this->ShadingTransmittanceVaries = false; this->AnyMovableInsulation = false; this->AnyMovableSlat = false; - this->InsideGlassCondensationFlag.deallocate(); - this->InsideFrameCondensationFlag.deallocate(); - this->InsideDividerCondensationFlag.deallocate(); - this->AdjacentZoneToSurface.deallocate(); + this->SurfWinInsideGlassCondensationFlag.deallocate(); + this->SurfWinInsideFrameCondensationFlag.deallocate(); + this->SurfWinInsideDividerCondensationFlag.deallocate(); + this->SurfAdjacentZone.deallocate(); this->X0.deallocate(); this->Y0.deallocate(); this->Z0.deallocate(); @@ -1802,8 +1804,8 @@ struct SurfacesData : BaseGlobalStruct this->SurfWinFrameEmis.deallocate(); this->SurfWinFrEdgeToCenterGlCondRatio.deallocate(); this->SurfWinFrameEdgeArea.deallocate(); - this->SurfWinFrameTempSurfIn.deallocate(); - this->SurfWinFrameTempSurfInOld.deallocate(); + this->SurfWinFrameTempIn.deallocate(); + this->SurfWinFrameTempInOld.deallocate(); this->SurfWinFrameTempSurfOut.deallocate(); this->SurfWinProjCorrFrOut.deallocate(); this->SurfWinProjCorrFrIn.deallocate(); @@ -1815,8 +1817,8 @@ struct SurfacesData : BaseGlobalStruct this->SurfWinDividerEmis.deallocate(); this->SurfWinDivEdgeToCenterGlCondRatio.deallocate(); this->SurfWinDividerEdgeArea.deallocate(); - this->SurfWinDividerTempSurfIn.deallocate(); - this->SurfWinDividerTempSurfInOld.deallocate(); + this->SurfWinDividerTempIn.deallocate(); + this->SurfWinDividerTempInOld.deallocate(); this->SurfWinDividerTempSurfOut.deallocate(); this->SurfWinProjCorrDivOut.deallocate(); this->SurfWinProjCorrDivIn.deallocate(); diff --git a/src/EnergyPlus/DaylightingDevices.cc b/src/EnergyPlus/DaylightingDevices.cc index 7f77f36095d..c7c0d1953e1 100644 --- a/src/EnergyPlus/DaylightingDevices.cc +++ b/src/EnergyPlus/DaylightingDevices.cc @@ -68,6 +68,7 @@ #include #include #include +#include #include namespace EnergyPlus { @@ -1273,22 +1274,22 @@ namespace DaylightingDevices { if (!state.dataSysVars->DetailedSkyDiffuseAlgorithm || !state.dataSurface->ShadingTransmittanceVaries || state.dataHeatBal->SolarDistribution == MinimalShadowing) { - IsoSkyRad = state.dataHeatBal->MultIsoSky(DomeSurf) * state.dataHeatBal->DifShdgRatioIsoSky(DomeSurf); - HorizonRad = state.dataHeatBal->MultHorizonZenith(DomeSurf) * state.dataHeatBal->DifShdgRatioHoriz(DomeSurf); + IsoSkyRad = state.dataSolarShading->SurfMultIsoSky(DomeSurf) * state.dataSolarShading->SurfDifShdgRatioIsoSky(DomeSurf); + HorizonRad = state.dataSolarShading->SurfMultHorizonZenith(DomeSurf) * state.dataSolarShading->SurfDifShdgRatioHoriz(DomeSurf); } else { - IsoSkyRad = state.dataHeatBal->MultIsoSky(DomeSurf) * state.dataHeatBal->curDifShdgRatioIsoSky(DomeSurf); - HorizonRad = state.dataHeatBal->MultHorizonZenith(DomeSurf) * - state.dataHeatBal->DifShdgRatioHorizHRTS(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, DomeSurf); + IsoSkyRad = state.dataSolarShading->SurfMultIsoSky(DomeSurf) * state.dataSolarShading->SurfCurDifShdgRatioIsoSky(DomeSurf); + HorizonRad = state.dataSolarShading->SurfMultHorizonZenith(DomeSurf) * + state.dataSolarShading->SurfDifShdgRatioHorizHRTS(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, DomeSurf); } - CircumSolarRad = state.dataHeatBal->MultCircumSolar(DomeSurf) * - state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, DomeSurf); + CircumSolarRad = state.dataSolarShading->SurfMultCircumSolar(DomeSurf) * + state.dataHeatBal->SurfSunlitFrac(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, DomeSurf); AnisoSkyTDDMult = state.dataDaylightingDevicesData->TDDPipe(PipeNum).TransSolIso * IsoSkyRad + TransTDD(state, PipeNum, COSI, DataDaylightingDevices::iRadType::SolarBeam) * CircumSolarRad + state.dataDaylightingDevicesData->TDDPipe(PipeNum).TransSolHorizon * HorizonRad; - if (state.dataHeatBal->SurfAnisoSkyMult(DomeSurf) > 0.0) { - CalcTDDTransSolAniso = AnisoSkyTDDMult / state.dataHeatBal->SurfAnisoSkyMult(DomeSurf); + if (state.dataSolarShading->SurfAnisoSkyMult(DomeSurf) > 0.0) { + CalcTDDTransSolAniso = AnisoSkyTDDMult / state.dataSolarShading->SurfAnisoSkyMult(DomeSurf); } else { CalcTDDTransSolAniso = 0.0; } diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index cab6e8fbc68..c0ceb509400 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -90,6 +90,7 @@ #include #include #include +#include #include #include #include @@ -512,14 +513,14 @@ void CalcDayltgCoefficients(EnergyPlusData &state) state.dataDaylightingManager->GILSK = 0.0; state.dataDaylightingManager->GILSU = 0.0; for (IHR = 1; IHR <= 24; ++IHR) { - if (state.dataSurface->SurfSunCosHourly(IHR, 3) < DataEnvironment::SunIsUpValue) + if (state.dataSurface->SurfSunCosHourly(IHR)(3) < DataEnvironment::SunIsUpValue) continue; // Skip if sun is below horizon //Autodesk SurfSunCosHourly was uninitialized here - state.dataDaylightingManager->PHSUN = DataGlobalConstants::PiOvr2 - std::acos(state.dataSurface->SurfSunCosHourly(IHR, 3)); + state.dataDaylightingManager->PHSUN = DataGlobalConstants::PiOvr2 - std::acos(state.dataSurface->SurfSunCosHourly(IHR)(3)); state.dataDaylightingManager->PHSUNHR(IHR) = state.dataDaylightingManager->PHSUN; state.dataDaylightingManager->SPHSUNHR(IHR) = std::sin(state.dataDaylightingManager->PHSUN); state.dataDaylightingManager->CPHSUNHR(IHR) = std::cos(state.dataDaylightingManager->PHSUN); state.dataDaylightingManager->THSUNHR(IHR) = - std::atan2(state.dataSurface->SurfSunCosHourly(IHR, 2), state.dataSurface->SurfSunCosHourly(IHR, 1)); + std::atan2(state.dataSurface->SurfSunCosHourly(IHR)(2), state.dataSurface->SurfSunCosHourly(IHR)(1)); // Get exterior horizontal illuminance from sky and sun state.dataDaylightingManager->THSUN = state.dataDaylightingManager->THSUNHR(IHR); state.dataDaylightingManager->SPHSUN = state.dataDaylightingManager->SPHSUNHR(IHR); @@ -539,15 +540,15 @@ void CalcDayltgCoefficients(EnergyPlusData &state) state.dataDaylightingManager->THSUNHR(state.dataGlobal->HourOfDay) = 0.0; state.dataDaylightingManager->GILSK(state.dataGlobal->HourOfDay, {1, 4}) = 0.0; state.dataDaylightingManager->GILSU(state.dataGlobal->HourOfDay) = 0.0; - if (!(state.dataSurface->SurfSunCosHourly(state.dataGlobal->HourOfDay, 3) < DataEnvironment::SunIsUpValue)) { // Skip if sun is below horizon + if (!(state.dataSurface->SurfSunCosHourly(state.dataGlobal->HourOfDay)(3) < DataEnvironment::SunIsUpValue)) { // Skip if sun is below horizon state.dataDaylightingManager->PHSUN = - DataGlobalConstants::PiOvr2 - std::acos(state.dataSurface->SurfSunCosHourly(state.dataGlobal->HourOfDay, 3)); + DataGlobalConstants::PiOvr2 - std::acos(state.dataSurface->SurfSunCosHourly(state.dataGlobal->HourOfDay)(3)); state.dataDaylightingManager->PHSUNHR(state.dataGlobal->HourOfDay) = state.dataDaylightingManager->PHSUN; state.dataDaylightingManager->SPHSUNHR(state.dataGlobal->HourOfDay) = std::sin(state.dataDaylightingManager->PHSUN); state.dataDaylightingManager->CPHSUNHR(state.dataGlobal->HourOfDay) = std::cos(state.dataDaylightingManager->PHSUN); state.dataDaylightingManager->THSUNHR(state.dataGlobal->HourOfDay) = - std::atan2(state.dataSurface->SurfSunCosHourly(state.dataGlobal->HourOfDay, 2), - state.dataSurface->SurfSunCosHourly(state.dataGlobal->HourOfDay, 1)); + std::atan2(state.dataSurface->SurfSunCosHourly(state.dataGlobal->HourOfDay)(2), + state.dataSurface->SurfSunCosHourly(state.dataGlobal->HourOfDay)(1)); // Get exterior horizontal illuminance from sky and sun state.dataDaylightingManager->THSUN = state.dataDaylightingManager->THSUNHR(state.dataGlobal->HourOfDay); state.dataDaylightingManager->SPHSUN = state.dataDaylightingManager->SPHSUNHR(state.dataGlobal->HourOfDay); @@ -3231,7 +3232,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( // switch as need to serve both reference points and map points based on calledFrom using General::POLYF; - if (state.dataSurface->SurfSunCosHourly(iHour, 3) < DataEnvironment::SunIsUpValue) return; + if (state.dataSurface->SurfSunCosHourly(iHour)(3) < DataEnvironment::SunIsUpValue) return; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: static Vector3 const RREF(0.0); // Location of a reference point in absolute coordinate system //Autodesk Was used uninitialized: @@ -3412,10 +3413,10 @@ void FigureDayltgCoeffsAtPointsForSunPosition( if (!state.dataSysVars->DetailedSkyDiffuseAlgorithm || !state.dataSurface->ShadingTransmittanceVaries || state.dataHeatBal->SolarDistribution == MinimalShadowing) { SkyReflVisLum = ObsVisRefl * state.dataSurface->Surface(NearestHitSurfNumX).ViewFactorSky * - state.dataHeatBal->DifShdgRatioIsoSky(NearestHitSurfNumX) / DataGlobalConstants::Pi; + state.dataSolarShading->SurfDifShdgRatioIsoSky(NearestHitSurfNumX) / DataGlobalConstants::Pi; } else { SkyReflVisLum = ObsVisRefl * state.dataSurface->Surface(NearestHitSurfNumX).ViewFactorSky * - state.dataHeatBal->DifShdgRatioIsoSkyHRTS(1, iHour, NearestHitSurfNumX) / DataGlobalConstants::Pi; + state.dataSolarShading->SurfDifShdgRatioIsoSkyHRTS(1, iHour, NearestHitSurfNumX) / DataGlobalConstants::Pi; } assert(equal_dimensions(state.dataDaylightingManager->AVWLSK, state.dataDaylightingManager->EDIRSK)); auto l2(state.dataDaylightingManager->GILSK.index(iHour, 1)); @@ -3478,7 +3479,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( Real64 const TVISB_ObTrans(TVISB * ObTrans); Real64 const AVWLSU_add(TVISB_ObTrans * state.dataDaylightingManager->GILSU(iHour) * (state.dataEnvrn->GndReflectanceForDayltg / DataGlobalConstants::Pi)); - Vector3 const SUNCOS_iHour(state.dataSurface->SurfSunCosHourly(iHour, {1, 3})); + Vector3 const SUNCOS_iHour(state.dataSurface->SurfSunCosHourly(iHour)); assert(equal_dimensions(state.dataDaylightingManager->EDIRSK, state.dataDaylightingManager->AVWLSK)); auto l(state.dataDaylightingManager->EDIRSK.index(iHour, 1, 1)); for (ISky = 1; ISky <= 4; ++ISky, ++l) { // [ l ] == ( iHour, 1, ISky ) @@ -3729,7 +3730,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( // Vector to sun that is mirrored in obstruction SunVecMir = RAYCOS - 2.0 * dot(RAYCOS, ReflNorm) * ReflNorm; // Skip if reflecting surface is not sunlit - if (state.dataHeatBal->SunlitFrac(1, iHour, ReflSurfNumX) < 0.01) continue; + if (state.dataHeatBal->SurfSunlitFrac(iHour, 1, ReflSurfNumX) < 0.01) continue; // Skip if altitude angle of mirrored sun is negative since reflected sun cannot // reach reference point in this case if (SunVecMir(3) <= 0.0) continue; @@ -3945,7 +3946,7 @@ void FigureRefPointDayltgFactorsToAddIllums(EnergyPlusData &state, int JSH; // Shading index: J=1 is unshaded window, J=2 is shaded window Real64 VTR; // For switchable glazing, ratio of visible transmittance of fully-switched state to that of the unswitched state - if (state.dataSurface->SurfSunCosHourly(iHour, 3) < DataEnvironment::SunIsUpValue) return; + if (state.dataSurface->SurfSunCosHourly(iHour)(3) < DataEnvironment::SunIsUpValue) return; ++ISunPos; @@ -4084,7 +4085,7 @@ void FigureMapPointDayltgFactorsToAddIllums(EnergyPlusData &state, Real64 VTR; // For switchable glazing, ratio of visible transmittance of // fully-switched state to that of the unswitched state - if (state.dataSurface->SurfSunCosHourly(iHour, 3) < DataEnvironment::SunIsUpValue) return; + if (state.dataSurface->SurfSunCosHourly(iHour)(3) < DataEnvironment::SunIsUpValue) return; // Altitude of sun (degrees) state.dataDaylightingManager->PHSUN = state.dataDaylightingManager->PHSUNHR(iHour); @@ -7749,7 +7750,7 @@ void DayltgInterReflectedIllum(EnergyPlusData &state, DPH = (PHMAX - PHMIN) / double(NPHMAX); // Sky/ground element altitude integration - Vector3 const SUNCOS_IHR(state.dataSurface->SurfSunCosHourly(IHR, {1, 3})); + Vector3 const SUNCOS_IHR(state.dataSurface->SurfSunCosHourly(IHR)); for (IPH = 1; IPH <= NPHMAX; ++IPH) { PH = PHMIN + (double(IPH) - 0.5) * DPH; @@ -7911,10 +7912,10 @@ void DayltgInterReflectedIllum(EnergyPlusData &state, if (!state.dataSysVars->DetailedSkyDiffuseAlgorithm || !state.dataSurface->ShadingTransmittanceVaries || state.dataHeatBal->SolarDistribution == MinimalShadowing) { SkyReflVisLum = ObsVisRefl * state.dataSurface->Surface(NearestHitSurfNumX).ViewFactorSky * - state.dataHeatBal->DifShdgRatioIsoSky(NearestHitSurfNumX) / DataGlobalConstants::Pi; + state.dataSolarShading->SurfDifShdgRatioIsoSky(NearestHitSurfNumX) / DataGlobalConstants::Pi; } else { SkyReflVisLum = ObsVisRefl * state.dataSurface->Surface(NearestHitSurfNumX).ViewFactorSky * - state.dataHeatBal->DifShdgRatioIsoSkyHRTS(1, IHR, NearestHitSurfNumX) / DataGlobalConstants::Pi; + state.dataSolarShading->SurfDifShdgRatioIsoSkyHRTS(1, IHR, NearestHitSurfNumX) / DataGlobalConstants::Pi; } dReflObsSky = SkyReflVisLum * COSB * DA; for (ISky = 1; ISky <= 4; ++ISky) { @@ -8200,7 +8201,7 @@ void DayltgInterReflectedIllum(EnergyPlusData &state, FLCWSK(1, ISky) += ZSK(ISky) * TVISBR * state.dataSurface->SurfWinFractionUpgoing(IWin); if (ISky == 1) { - ZSU = state.dataDaylightingManager->GILSU(IHR) * state.dataHeatBal->SunlitFracHR(IHR, OutShelfSurf) * + ZSU = state.dataDaylightingManager->GILSU(IHR) * state.dataHeatBal->SurfSunlitFracHR(IHR, OutShelfSurf) * state.dataDaylightingDevicesData->Shelf(ShelfNum).OutReflectVis * state.dataDaylightingDevicesData->Shelf(ShelfNum).ViewFactor; FLCWSU(1) += ZSU * TVISBR * state.dataSurface->SurfWinFractionUpgoing(IWin); } @@ -8228,7 +8229,7 @@ void DayltgInterReflectedIllum(EnergyPlusData &state, // Beam reaching window directly (without specular reflection from exterior obstructions) - if (state.dataHeatBal->SunlitFracHR(IHR, IWin) > 0.0) { + if (state.dataHeatBal->SurfSunlitFracHR(IHR, IWin) > 0.0) { // Cos of angle of incidence COSBSun = state.dataDaylightingManager->SPHSUN * std::sin(state.dataSurface->SurfWinPhi(IWin)) + state.dataDaylightingManager->CPHSUN * std::cos(state.dataSurface->SurfWinPhi(IWin)) * @@ -8237,10 +8238,10 @@ void DayltgInterReflectedIllum(EnergyPlusData &state, if (COSBSun > 0.0) { // Multiply direct normal illuminance (normalized to 1.0 lux) // by incident angle factor and by fraction of window that is sunlit. - // Note that in the following SunlitFracHR accounts for possibly non-zero transmittance of + // Note that in the following SurfSunlitFracHR accounts for possibly non-zero transmittance of // shading surfaces. - ZSU1 = COSBSun * state.dataHeatBal->SunlitFracHR(IHR, IWin); + ZSU1 = COSBSun * state.dataHeatBal->SurfSunlitFracHR(IHR, IWin); // Contribution to window luminance and downgoing flux @@ -8282,8 +8283,7 @@ void DayltgInterReflectedIllum(EnergyPlusData &state, // TH 7/7/2010 moved from inside the loop: DO JB = 1,MaxSlatAngs if (BlindOn) - ProfileAngle( - state, IWin, state.dataSurface->SurfSunCosHourly(IHR, {1, 3}), state.dataHeatBal->Blind(BlNum).SlatOrientation, ProfAng); + ProfileAngle(state, IWin, state.dataSurface->SurfSunCosHourly(IHR), state.dataHeatBal->Blind(BlNum).SlatOrientation, ProfAng); for (JB = 1; JB <= MaxSlatAngs; ++JB) { if (!state.dataSurface->SurfWinMovableSlats(IWin) && JB > 1) break; @@ -8375,7 +8375,7 @@ void DayltgInterReflectedIllum(EnergyPlusData &state, } // End of loop over slat angles } // End of window with shade or blind } // COSBSun > 0 - } // SunlitFracHR > 0 + } // SurfSunlitFracHR > 0 // Beam reaching window after specular reflection from exterior obstruction @@ -8559,7 +8559,7 @@ void ComplexFenestrationLuminances(EnergyPlusData &state, 0.5 * state.dataDaylightingManager->GILSU(IHR) * state.dataEnvrn->GndReflectanceForDayltg / DataGlobalConstants::Pi * LambdaInc; } // Sun beam calculations - if ((SolBmIndex == iIncElem) && (state.dataHeatBal->SunlitFracHR(IHR, IWin) > 0.0)) { + if ((SolBmIndex == iIncElem) && (state.dataHeatBal->SurfSunlitFracHR(IHR, IWin) > 0.0)) { ElementLuminanceSunDisk(iIncElem) = 1.0; } } @@ -8595,7 +8595,7 @@ void ComplexFenestrationLuminances(EnergyPlusData &state, } else { NGnd = state.dataBSDFWindow->ComplexWind(IWin).DaylghtGeom(CurCplxFenState).IlluminanceMap(iRefPoint, MapNum).NGnd(WinEl); } - Vector3 const SUNCOS_IHR(state.dataSurface->SurfSunCosHourly(IHR, {1, 3})); + Vector3 const SUNCOS_IHR(state.dataSurface->SurfSunCosHourly(IHR)); for (iGndElem = 1; iGndElem <= NGnd; ++iGndElem) { // case for sky elements. Integration is done over upper ground hemisphere to determine how many obstructions // were hit in the process @@ -8750,7 +8750,7 @@ void DayltgInterReflectedIllumComplexFenestration(EnergyPlusData &state, } else { COSIncSun = 0.0; } - ElementLuminanceSunDisk *= state.dataHeatBal->SunlitFracHR(IHR, IWin) * COSIncSun; + ElementLuminanceSunDisk *= state.dataHeatBal->SurfSunlitFracHR(IHR, IWin) * COSIncSun; // FLSKTot = 0.0; FLSUTot = 0.0; @@ -9333,7 +9333,7 @@ void DayltgSurfaceLumFromSun(EnergyPlusData &state, } } // Cosine of angle of incidence of sun at HitPt if sun were to reach HitPt - Vector3 const SUNCOS_IHR(state.dataSurface->SurfSunCosHourly(IHR, {1, 3})); + Vector3 const SUNCOS_IHR(state.dataSurface->SurfSunCosHourly(IHR)); CosIncAngAtHitPt = dot(DayltgSurfaceLumFromSunReflNorm, SUNCOS_IHR); // Require that the sun be in front of this surface relative to window element if (CosIncAngAtHitPt <= 0.0) return; // Sun is in back of reflecting surface diff --git a/src/EnergyPlus/DisplacementVentMgr.cc b/src/EnergyPlus/DisplacementVentMgr.cc index ae468f823da..8e7465f3284 100644 --- a/src/EnergyPlus/DisplacementVentMgr.cc +++ b/src/EnergyPlus/DisplacementVentMgr.cc @@ -199,7 +199,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataDispVentMgr->HA_OC = 0.0; state.dataDispVentMgr->HAT_FLOOR = 0.0; state.dataDispVentMgr->HA_FLOOR = 0.0; - auto &TempSurfIn(state.dataHeatBalSurf->TempSurfIn); + auto &SurfTempIn(state.dataHeatBalSurf->SurfTempIn); // Is the air flow model for this zone set to UCSDDV Displacement Ventilation? if (state.dataRoomAirMod->IsZoneDV(ZoneNum)) { @@ -219,37 +219,37 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // The Wall surface is in the upper subzone if (ZInfSurf > LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HWall(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); - state.dataDispVentMgr->HAT_MX += state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HWall(Ctd); + state.dataDispVentMgr->HAT_MX += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HWall(Ctd); state.dataDispVentMgr->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWall(Ctd); } // The Wall surface is in the lower subzone if (ZSupSurf < LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HWall(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); - state.dataDispVentMgr->HAT_OC += state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HWall(Ctd); + state.dataDispVentMgr->HAT_OC += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HWall(Ctd); state.dataDispVentMgr->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWall(Ctd); } // The Wall surface is partially in upper and partially in lower subzone if (ZInfSurf <= LayH && ZSupSurf >= LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); HLU = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); HLD = state.dataRoomAirMod->DVHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); state.dataUCSDShared->HWall(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); state.dataDispVentMgr->HAT_MX += - state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * TempSurfIn(SurfNum) * HLU; + state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLU; state.dataDispVentMgr->HA_MX += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; state.dataDispVentMgr->HAT_OC += - state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * TempSurfIn(SurfNum) * HLD; + state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLD; state.dataDispVentMgr->HA_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } @@ -271,37 +271,37 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (ZInfSurf > LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataDispVentMgr->HAT_MX += - state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); + state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); state.dataDispVentMgr->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); } if (ZSupSurf < LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataDispVentMgr->HAT_OC += - state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); + state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); state.dataDispVentMgr->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); HLU = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); HLD = state.dataRoomAirMod->DVHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); state.dataUCSDShared->HWindow(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); state.dataDispVentMgr->HAT_MX += - state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * TempSurfIn(SurfNum) * HLU; + state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLU; state.dataDispVentMgr->HA_MX += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; state.dataDispVentMgr->HAT_OC += - state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * TempSurfIn(SurfNum) * HLD; + state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLD; state.dataDispVentMgr->HA_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } @@ -309,17 +309,17 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (state.dataSurface->Surface(SurfNum).Tilt <= 10.0) { // Window Ceiling state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); - state.dataDispVentMgr->HAT_MX += state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); + state.dataDispVentMgr->HAT_MX += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); state.dataDispVentMgr->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); } if (state.dataSurface->Surface(SurfNum).Tilt >= 170.0) { // Window Floor state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); - state.dataDispVentMgr->HAT_OC += state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); + state.dataDispVentMgr->HAT_OC += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); state.dataDispVentMgr->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); } @@ -341,37 +341,37 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (ZInfSurf > LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataDispVentMgr->HAT_MX += - state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); + state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); state.dataDispVentMgr->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HDoor(Ctd); } if (ZSupSurf < LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataDispVentMgr->HAT_OC += - state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); + state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); state.dataDispVentMgr->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HDoor(Ctd); } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); HLU = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); HLD = state.dataRoomAirMod->DVHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); state.dataUCSDShared->HDoor(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); state.dataDispVentMgr->HAT_MX += - state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * TempSurfIn(SurfNum) * HLU; + state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLU; state.dataDispVentMgr->HA_MX += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; state.dataDispVentMgr->HAT_OC += - state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * TempSurfIn(SurfNum) * HLD; + state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLD; state.dataDispVentMgr->HA_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } @@ -379,17 +379,17 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (state.dataSurface->Surface(SurfNum).Tilt <= 10.0) { // Door Ceiling state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); - state.dataDispVentMgr->HAT_MX += state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); + state.dataDispVentMgr->HAT_MX += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); state.dataDispVentMgr->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HDoor(Ctd); } if (state.dataSurface->Surface(SurfNum).Tilt >= 170.0) { // Door Floor state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); - state.dataDispVentMgr->HAT_OC += state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); + state.dataDispVentMgr->HAT_OC += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); state.dataDispVentMgr->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HDoor(Ctd); } @@ -411,28 +411,28 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (ZSupSurf < LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HInternal(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataDispVentMgr->HAT_OC += - state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HInternal(Ctd); + state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HInternal(Ctd); state.dataDispVentMgr->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HInternal(Ctd); } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); HLU = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); HLD = state.dataRoomAirMod->DVHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); state.dataUCSDShared->HInternal(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); state.dataDispVentMgr->HAT_MX += - state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * TempSurfIn(SurfNum) * HLU; + state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLU; state.dataDispVentMgr->HA_MX += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; state.dataDispVentMgr->HAT_OC += - state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * TempSurfIn(SurfNum) * HLD; + state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLD; state.dataDispVentMgr->HA_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } @@ -447,9 +447,9 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HCeiling(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); - state.dataDispVentMgr->HAT_MX += state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HCeiling(Ctd); + state.dataDispVentMgr->HAT_MX += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HCeiling(Ctd); state.dataDispVentMgr->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HCeiling(Ctd); state.dataRoomAirMod->DVHcIn(SurfNum) = state.dataUCSDShared->HCeiling(Ctd); } // END CEILING @@ -460,9 +460,9 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HFloor(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); - state.dataDispVentMgr->HAT_FLOOR += state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HFloor(Ctd); + state.dataDispVentMgr->HAT_FLOOR += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HFloor(Ctd); state.dataDispVentMgr->HA_FLOOR += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HFloor(Ctd); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); state.dataRoomAirMod->DVHcIn(SurfNum) = state.dataUCSDShared->HFloor(Ctd); @@ -593,7 +593,7 @@ void CalcUCSDDV(EnergyPlusData &state, int const ZoneNum) // Which Zonenum MIXFLAG = false; FlagApertures = 1; - state.dataRoomAirMod->DVHcIn = state.dataHeatBal->HConvIn; + state.dataRoomAirMod->DVHcIn = state.dataHeatBalSurf->SurfHConvInt; CeilingHeight = state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 2) - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); ZoneMult = Zone(ZoneNum).Multiplier * Zone(ZoneNum).ListMultiplier; diff --git a/src/EnergyPlus/EcoRoofManager.cc b/src/EnergyPlus/EcoRoofManager.cc index c1944b5a00e..8d2e04188de 100644 --- a/src/EnergyPlus/EcoRoofManager.cc +++ b/src/EnergyPlus/EcoRoofManager.cc @@ -64,6 +64,7 @@ #include #include #include +#include #include namespace EnergyPlus { @@ -237,13 +238,13 @@ namespace EcoRoofManager { RoughSurf, AbsThermSurf, state.dataHeatBalSurf->TH(1, 1, SurfNum), - state.dataHeatBalSurf->HcExtSurf(SurfNum), - state.dataHeatBalSurf->HSkyExtSurf(SurfNum), - state.dataHeatBalSurf->HGrdExtSurf(SurfNum), - state.dataHeatBalSurf->HAirExtSurf(SurfNum)); + state.dataHeatBalSurf->SurfHcExt(SurfNum), + state.dataHeatBalSurf->SurfHSkyExt(SurfNum), + state.dataHeatBalSurf->SurfHGrdExt(SurfNum), + state.dataHeatBalSurf->SurfHAirExt(SurfNum)); } - RS = state.dataEnvrn->BeamSolarRad + state.dataHeatBal->SurfAnisoSkyMult(SurfNum) * state.dataEnvrn->DifSolarRad; + RS = state.dataEnvrn->BeamSolarRad + state.dataSolarShading->SurfAnisoSkyMult(SurfNum) * state.dataEnvrn->DifSolarRad; Latm = 1.0 * Sigma * 1.0 * state.dataSurface->Surface(SurfNum).ViewFactorGround * pow_4(state.dataEnvrn->GroundTempKelvin) + 1.0 * Sigma * 1.0 * state.dataSurface->Surface(SurfNum).ViewFactorSky * pow_4(state.dataEnvrn->SkyTempKelvin); @@ -475,16 +476,16 @@ namespace EcoRoofManager { if (state.dataConstruction->Construct(ConstrNum).CTFCross(0) > 0.01) { state.dataEcoRoofMgr->QuickConductionSurf = true; F1temp = state.dataConstruction->Construct(ConstrNum).CTFCross(0) / - (state.dataConstruction->Construct(ConstrNum).CTFInside(0) + state.dataHeatBal->HConvIn(SurfNum)); - Qsoilpart1 = -state.dataHeatBalSurf->CTFConstOutPart(SurfNum) + - F1temp * (state.dataHeatBalSurf->CTFConstInPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(SurfNum) + + (state.dataConstruction->Construct(ConstrNum).CTFInside(0) + state.dataHeatBalSurf->SurfHConvInt(SurfNum)); + Qsoilpart1 = -state.dataHeatBalSurf->SurfCTFConstOutPart(SurfNum) + + F1temp * (state.dataHeatBalSurf->SurfCTFConstInPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(SurfNum) + state.dataHeatBal->SurfQRadThermInAbs(SurfNum) + state.dataConstruction->Construct(ConstrNum).CTFSourceIn(0) * state.dataHeatBalSurf->QsrcHist(SurfNum, 1) + - state.dataHeatBal->HConvIn(SurfNum) * state.dataHeatBalFanSys->MAT(ZoneNum) + + state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBalSurf->SurfNetLWRadToSurf(SurfNum)); } else { - Qsoilpart1 = -state.dataHeatBalSurf->CTFConstOutPart(SurfNum) + - state.dataConstruction->Construct(ConstrNum).CTFCross(0) * state.dataHeatBalSurf->TempSurfIn(SurfNum); + Qsoilpart1 = -state.dataHeatBalSurf->SurfCTFConstOutPart(SurfNum) + + state.dataConstruction->Construct(ConstrNum).CTFCross(0) * state.dataHeatBalSurf->SurfTempIn(SurfNum); F1temp = 0.0; } diff --git a/src/EnergyPlus/ElectricBaseboardRadiator.cc b/src/EnergyPlus/ElectricBaseboardRadiator.cc index 6d9ca7c1dbf..1152fa84834 100644 --- a/src/EnergyPlus/ElectricBaseboardRadiator.cc +++ b/src/EnergyPlus/ElectricBaseboardRadiator.cc @@ -1169,20 +1169,19 @@ namespace ElectricBaseboardRadiator { if (state.dataSurface->SurfWinFrameArea(SurfNum) > 0.0) { // Window frame contribution - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * - (1.0 + state.dataSurface->SurfWinProjCorrFrIn(SurfNum)) * state.dataSurface->SurfWinFrameTempSurfIn(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * + (1.0 + state.dataSurface->SurfWinProjCorrFrIn(SurfNum)) * state.dataSurface->SurfWinFrameTempIn(SurfNum); } if (state.dataSurface->SurfWinDividerArea(SurfNum) > 0.0 && !ANY_INTERIOR_SHADE_BLIND(state.dataSurface->SurfWinShadingFlag(SurfNum))) { // Window divider contribution (only from shade or blind for window with divider and interior shade or blind) - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * - (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum)) * - state.dataSurface->SurfWinDividerTempSurfIn(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * + (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum)) * state.dataSurface->SurfWinDividerTempIn(SurfNum); } } - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * Area * state.dataHeatBalSurf->TempSurfInTmp(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * Area * state.dataHeatBalSurf->SurfTempInTmp(SurfNum); } return SumHATsurf; diff --git a/src/EnergyPlus/EvaporativeFluidCoolers.cc b/src/EnergyPlus/EvaporativeFluidCoolers.cc index 8c49a0085e3..c48d8784f01 100644 --- a/src/EnergyPlus/EvaporativeFluidCoolers.cc +++ b/src/EnergyPlus/EvaporativeFluidCoolers.cc @@ -1141,64 +1141,7 @@ namespace EvaporativeFluidCoolers { std::string const RoutineName("InitEvapFluidCooler"); - bool ErrorsFound(false); // Flag if input data errors are found - if (this->MyOneTimeFlag) { - - this->setupOutputVars(state); - - this->FluidIndex = state.dataPlnt->PlantLoop(state.dataSize->CurLoopNum).FluidIndex; - std::string FluidName = FluidProperties::GetGlycolNameByIndex(state, this->FluidIndex); - - if (UtilityRoutines::SameString(this->PerformanceInputMethod, "STANDARDDESIGNCAPACITY")) { - this->PerformanceInputMethod_Num = PIM::StandardDesignCapacity; - if (FluidName != "WATER") { - ShowSevereError(state, - state.dataIPShortCut->cCurrentModuleObject + " = \"" + this->Name + - R"(". StandardDesignCapacity performance input method is only valid for fluid type = "Water".)"); - ShowContinueError(state, - "Currently, Fluid Type = " + FluidName + - " in CondenserLoop = " + state.dataPlnt->PlantLoop(state.dataSize->CurLoopNum).Name); - ErrorsFound = true; - } - } - - this->MyOneTimeFlag = false; - } - - if (this->OneTimeFlagForEachEvapFluidCooler) { - // Locate the tower on the plant loops for later usage - PlantUtilities::ScanPlantLoopsForObject( - state, this->Name, this->TypeOf_Num, this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum, ErrorsFound, _, _, _, _, _); - - if (ErrorsFound) { - ShowFatalError(state, "InitEvapFluidCooler: Program terminated due to previous condition(s)."); - } - - if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_TwoSpd) { - if (this->DesignWaterFlowRate > 0.0) { - if (this->HighSpeedAirFlowRate <= this->LowSpeedAirFlowRate) { - ShowSevereError(state, - "EvaporativeFluidCooler:TwoSpeed \"" + this->Name + - "\". Low speed air flow rate must be less than the high speed air flow rate."); - ErrorsFound = true; - } - if ((this->HighSpeedEvapFluidCoolerUA > 0.0) && (this->LowSpeedEvapFluidCoolerUA > 0.0) && - (this->HighSpeedEvapFluidCoolerUA <= this->LowSpeedEvapFluidCoolerUA)) { - ShowSevereError(state, - "EvaporativeFluidCooler:TwoSpeed \"" + this->Name + - "\". Evaporative fluid cooler UA at low fan speed must be less than the evaporative fluid cooler UA at " - "high fan speed."); - ErrorsFound = true; - } - } - } - - if (ErrorsFound) { - ShowFatalError(state, "InitEvapFluidCooler: Program terminated due to previous condition(s)."); - } - - this->OneTimeFlagForEachEvapFluidCooler = false; - } + this->oneTimeInit(state); // Begin environment initializations if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { @@ -2717,6 +2660,68 @@ namespace EvaporativeFluidCoolers { this->WaterAmountUsed = this->WaterUsage * ReportingConstant; } } + void EvapFluidCoolerSpecs::oneTimeInit(EnergyPlusData &state) + { + bool ErrorsFound(false); // Flag if input data errors are found + + if (this->MyOneTimeFlag) { + + this->setupOutputVars(state); + + this->FluidIndex = state.dataPlnt->PlantLoop(state.dataSize->CurLoopNum).FluidIndex; + std::string FluidName = FluidProperties::GetGlycolNameByIndex(state, this->FluidIndex); + + if (UtilityRoutines::SameString(this->PerformanceInputMethod, "STANDARDDESIGNCAPACITY")) { + this->PerformanceInputMethod_Num = PIM::StandardDesignCapacity; + if (FluidName != "WATER") { + ShowSevereError(state, + state.dataIPShortCut->cCurrentModuleObject + " = \"" + this->Name + + R"(". StandardDesignCapacity performance input method is only valid for fluid type = "Water".)"); + ShowContinueError(state, + "Currently, Fluid Type = " + FluidName + + " in CondenserLoop = " + state.dataPlnt->PlantLoop(state.dataSize->CurLoopNum).Name); + ErrorsFound = true; + } + } + + this->MyOneTimeFlag = false; + } + + if (this->OneTimeFlagForEachEvapFluidCooler) { + // Locate the tower on the plant loops for later usage + PlantUtilities::ScanPlantLoopsForObject( + state, this->Name, this->TypeOf_Num, this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum, ErrorsFound, _, _, _, _, _); + + if (ErrorsFound) { + ShowFatalError(state, "InitEvapFluidCooler: Program terminated due to previous condition(s)."); + } + + if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_TwoSpd) { + if (this->DesignWaterFlowRate > 0.0) { + if (this->HighSpeedAirFlowRate <= this->LowSpeedAirFlowRate) { + ShowSevereError(state, + "EvaporativeFluidCooler:TwoSpeed \"" + this->Name + + "\". Low speed air flow rate must be less than the high speed air flow rate."); + ErrorsFound = true; + } + if ((this->HighSpeedEvapFluidCoolerUA > 0.0) && (this->LowSpeedEvapFluidCoolerUA > 0.0) && + (this->HighSpeedEvapFluidCoolerUA <= this->LowSpeedEvapFluidCoolerUA)) { + ShowSevereError(state, + "EvaporativeFluidCooler:TwoSpeed \"" + this->Name + + "\". Evaporative fluid cooler UA at low fan speed must be less than the evaporative fluid cooler UA at " + "high fan speed."); + ErrorsFound = true; + } + } + } + + if (ErrorsFound) { + ShowFatalError(state, "InitEvapFluidCooler: Program terminated due to previous condition(s)."); + } + + this->OneTimeFlagForEachEvapFluidCooler = false; + } + } } // namespace EvaporativeFluidCoolers diff --git a/src/EnergyPlus/EvaporativeFluidCoolers.hh b/src/EnergyPlus/EvaporativeFluidCoolers.hh index 55ab571680e..40c374926d4 100644 --- a/src/EnergyPlus/EvaporativeFluidCoolers.hh +++ b/src/EnergyPlus/EvaporativeFluidCoolers.hh @@ -281,6 +281,8 @@ namespace EvaporativeFluidCoolers { void SimSimpleEvapFluidCooler(EnergyPlusData &state, Real64 waterMassFlowRate, Real64 AirFlowRate, Real64 UAdesign, Real64 &outletWaterTemp); void onInitLoopEquip(EnergyPlusData &state, const PlantLocation &calledFromLocation) override; + + void oneTimeInit(EnergyPlusData &state) override; }; // Object Data diff --git a/src/EnergyPlus/FluidCoolers.cc b/src/EnergyPlus/FluidCoolers.cc index 9c0d393e8b0..f8f4ef833b7 100644 --- a/src/EnergyPlus/FluidCoolers.cc +++ b/src/EnergyPlus/FluidCoolers.cc @@ -730,13 +730,29 @@ bool FluidCoolerspecs::validateTwoSpeedInputs(EnergyPlusData &state, void FluidCoolerspecs::oneTimeInit(EnergyPlusData &state) { - bool ErrorsFound = false; - // Locate the tower on the plant loops for later usage - PlantUtilities::ScanPlantLoopsForObject( - state, this->Name, this->FluidCoolerType_Num, this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum, ErrorsFound, _, _, _, _, _); + if (this->oneTimeInitFlag) { - if (ErrorsFound) { - ShowFatalError(state, "InitFluidCooler: Program terminated due to previous condition(s)."); + this->setupOutputVars(state); + bool ErrorsFound = false; + // Locate the tower on the plant loops for later usage + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + this->FluidCoolerType_Num, + this->LoopNum, + this->LoopSideNum, + this->BranchNum, + this->CompNum, + ErrorsFound, + _, + _, + _, + _, + _); + + if (ErrorsFound) { + ShowFatalError(state, "InitFluidCooler: Program terminated due to previous condition(s)."); + } + this->oneTimeInitFlag = false; } } @@ -781,11 +797,7 @@ void FluidCoolerspecs::initialize(EnergyPlusData &state) // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - if (this->oneTimeInitFlag) { - this->setupOutputVars(state); - this->oneTimeInit(state); - this->oneTimeInitFlag = false; - } + this->oneTimeInit(state); // Begin environment initializations if (this->beginEnvrnInit && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { diff --git a/src/EnergyPlus/FuelCellElectricGenerator.cc b/src/EnergyPlus/FuelCellElectricGenerator.cc index a875df83f0f..fc645bf1f3a 100644 --- a/src/EnergyPlus/FuelCellElectricGenerator.cc +++ b/src/EnergyPlus/FuelCellElectricGenerator.cc @@ -2993,7 +2993,7 @@ namespace FuelCellElectricGenerator { // REFERENCES: Annex 42 model documentation - static std::string const RoutineName("CalcFuelCellGenHeatRecovery"); + static constexpr std::string_view RoutineName("CalcFuelCellGenHeatRecovery"); { auto const SELECT_CASE_var(this->ExhaustHX.HXmodelMode); @@ -3295,32 +3295,9 @@ namespace FuelCellElectricGenerator { // METHODOLOGY EMPLOYED: // Uses the status flags to trigger initializations. - static std::string const RoutineName("InitFuelCellGenerators"); + static constexpr std::string_view RoutineName("InitFuelCellGenerators"); - if (this->MyPlantScanFlag_Init && allocated(state.dataPlnt->PlantLoop)) { - bool errFlag = false; - - PlantUtilities::ScanPlantLoopsForObject(state, - this->NameExhaustHX, - DataPlant::TypeOf_Generator_FCExhaust, - this->CWLoopNum, - this->CWLoopSideNum, - this->CWBranchNum, - this->CWCompNum, - errFlag, - _, - _, - _, - _, - _); - - // if there is a stack cooler option it might be connected to plant as well - - if (errFlag) { - ShowFatalError(state, "InitFuelCellGenerators: Program terminated due to previous condition(s)."); - } - this->MyPlantScanFlag_Init = false; - } + this->oneTimeInit(state); // Do the Begin Environment initializations if (state.dataGlobal->BeginEnvrnFlag && this->MyEnvrnFlag_Init && !this->MyPlantScanFlag_Init) { @@ -3654,6 +3631,34 @@ namespace FuelCellElectricGenerator { this->Report.SkinLossConvect = this->QconvZone; this->Report.SkinLossRadiat = this->QradZone; } + void FCDataStruct::oneTimeInit(EnergyPlusData &state) + { + + if (this->MyPlantScanFlag_Init && allocated(state.dataPlnt->PlantLoop)) { + bool errFlag = false; + + PlantUtilities::ScanPlantLoopsForObject(state, + this->NameExhaustHX, + DataPlant::TypeOf_Generator_FCExhaust, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum, + errFlag, + _, + _, + _, + _, + _); + + // if there is a stack cooler option it might be connected to plant as well + + if (errFlag) { + ShowFatalError(state, "InitFuelCellGenerators: Program terminated due to previous condition(s)."); + } + this->MyPlantScanFlag_Init = false; + } + } } // namespace FuelCellElectricGenerator diff --git a/src/EnergyPlus/FuelCellElectricGenerator.hh b/src/EnergyPlus/FuelCellElectricGenerator.hh index 735209c08b2..5a49a9ed6c3 100644 --- a/src/EnergyPlus/FuelCellElectricGenerator.hh +++ b/src/EnergyPlus/FuelCellElectricGenerator.hh @@ -622,6 +622,8 @@ namespace FuelCellElectricGenerator { bool FirstHVACIteration); void UpdateFuelCellGeneratorRecords(EnergyPlusData &state); + + void oneTimeInit(EnergyPlusData &state) override; }; void getFuelCellInput(EnergyPlusData &state); diff --git a/src/EnergyPlus/GroundHeatExchangers.cc b/src/EnergyPlus/GroundHeatExchangers.cc index 603e932b514..14bf8276770 100644 --- a/src/EnergyPlus/GroundHeatExchangers.cc +++ b/src/EnergyPlus/GroundHeatExchangers.cc @@ -3065,9 +3065,7 @@ void GLHEVert::initGLHESimVars(EnergyPlusData &state) // RE-ENGINEERED na // Using/Aliasing - using DataPlant::TypeOf_GrndHtExchgSystem; using PlantUtilities::RegulateCondenserCompFlowReqOp; - using PlantUtilities::ScanPlantLoopsForObject; using PlantUtilities::SetComponentFlowRate; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -3076,16 +3074,7 @@ void GLHEVert::initGLHESimVars(EnergyPlusData &state) DataGlobalConstants::SecInHour; // Init more variables - if (this->myFlag) { - // Locate the hx on the plant loops for later usage - bool errFlag = false; - ScanPlantLoopsForObject( - state, this->name, TypeOf_GrndHtExchgSystem, this->loopNum, this->loopSideNum, this->branchNum, this->compNum, errFlag, _, _, _, _, _); - if (errFlag) { - ShowFatalError(state, "initGLHESimVars: Program terminated due to previous condition(s)."); - } - this->myFlag = false; - } + this->oneTimeInit(state); if (this->myEnvrnFlag && state.dataGlobal->BeginEnvrnFlag) { this->initEnvironment(state, currTime); @@ -3150,6 +3139,26 @@ void GLHEVert::initEnvironment(EnergyPlusData &state, [[maybe_unused]] Real64 co //****************************************************************************** +void GLHEVert::oneTimeInit(EnergyPlusData &state) +{ + + using DataPlant::TypeOf_GrndHtExchgSystem; + using PlantUtilities::ScanPlantLoopsForObject; + + if (this->myOneTImeInitFlag) { + // Locate the hx on the plant loops for later usage + bool errFlag = false; + ScanPlantLoopsForObject( + state, this->name, TypeOf_GrndHtExchgSystem, this->loopNum, this->loopSideNum, this->branchNum, this->compNum, errFlag, _, _, _, _, _); + if (errFlag) { + ShowFatalError(state, "initGLHESimVars: Program terminated due to previous condition(s)."); + } + this->myOneTImeInitFlag = false; + } +} + +//****************************************************************************** + void GLHESlinky::initGLHESimVars(EnergyPlusData &state) { // SUBROUTINE INFORMATION: @@ -3159,9 +3168,7 @@ void GLHESlinky::initGLHESimVars(EnergyPlusData &state) // RE-ENGINEERED na // Using/Aliasing - using DataPlant::TypeOf_GrndHtExchgSlinky; using PlantUtilities::RegulateCondenserCompFlowReqOp; - using PlantUtilities::ScanPlantLoopsForObject; using PlantUtilities::SetComponentFlowRate; using namespace GroundTemperatureManager; @@ -3170,16 +3177,7 @@ void GLHESlinky::initGLHESimVars(EnergyPlusData &state) DataGlobalConstants::SecInHour; // Init more variables - if (this->myFlag) { - // Locate the hx on the plant loops for later usage - bool errFlag = false; - ScanPlantLoopsForObject( - state, this->name, TypeOf_GrndHtExchgSlinky, this->loopNum, this->loopSideNum, this->branchNum, this->compNum, errFlag, _, _, _, _, _); - if (errFlag) { - ShowFatalError(state, "initGLHESimVars: Program terminated due to previous condition(s)."); - } - this->myFlag = false; - } + this->oneTimeInit(state); if (this->myEnvrnFlag && state.dataGlobal->BeginEnvrnFlag) { this->initEnvironment(state, CurTime); @@ -3229,4 +3227,23 @@ void GLHESlinky::initEnvironment(EnergyPlusData &state, Real64 const &CurTime) //****************************************************************************** +void GLHESlinky::oneTimeInit(EnergyPlusData &state) +{ + using DataPlant::TypeOf_GrndHtExchgSlinky; + using PlantUtilities::ScanPlantLoopsForObject; + + if (this->myOneTImeInitFlag) { + // Locate the hx on the plant loops for later usage + bool errFlag = false; + ScanPlantLoopsForObject( + state, this->name, TypeOf_GrndHtExchgSlinky, this->loopNum, this->loopSideNum, this->branchNum, this->compNum, errFlag, _, _, _, _, _); + if (errFlag) { + ShowFatalError(state, "initGLHESimVars: Program terminated due to previous condition(s)."); + } + this->myOneTImeInitFlag = false; + } +} + +//****************************************************************************** + } // namespace EnergyPlus::GroundHeatExchangers diff --git a/src/EnergyPlus/GroundHeatExchangers.hh b/src/EnergyPlus/GroundHeatExchangers.hh index 2008423a2cc..e6cf5bd78a3 100644 --- a/src/EnergyPlus/GroundHeatExchangers.hh +++ b/src/EnergyPlus/GroundHeatExchangers.hh @@ -247,7 +247,7 @@ namespace GroundHeatExchangers { Real64 inletTemp; // [degC] Real64 aveFluidTemp; // [degC] Real64 QGLHE; // [W] heat transfer rate - bool myFlag; + bool myOneTImeInitFlag; bool myEnvrnFlag; bool gFunctionsExist; Real64 lastQnSubHr; @@ -269,7 +269,7 @@ namespace GroundHeatExchangers { GLHEBase() : available(false), on(false), loopNum(0), loopSideNum(0), branchNum(0), compNum(0), inletNodeNum(0), outletNodeNum(0), designFlow(0.0), designMassFlow(0.0), tempGround(0.0), prevHour(1), AGG(0), SubAGG(0), bhTemp(0.0), massFlowRate(0.0), outletTemp(0.0), inletTemp(0.0), - aveFluidTemp(0.0), QGLHE(0.0), myFlag(true), myEnvrnFlag(true), gFunctionsExist(false), lastQnSubHr(0.0), HXResistance(0.0), + aveFluidTemp(0.0), QGLHE(0.0), myOneTImeInitFlag(true), myEnvrnFlag(true), gFunctionsExist(false), lastQnSubHr(0.0), HXResistance(0.0), totalTubeLength(0.0), timeSS(0.0), timeSSFactor(0.0), firstTime(true), numErrorCalls(0), ToutNew(19.375), PrevN(1), updateCurSimTime(true), triggerDesignDayReset(false), needToSetupOutputVars(true) { @@ -391,6 +391,8 @@ namespace GroundHeatExchangers { void combineShortAndLongTimestepGFunctions(); void initEnvironment(EnergyPlusData &state, [[maybe_unused]] Real64 const &CurTime) override; + + void oneTimeInit(EnergyPlusData &state) override; }; struct GLHESlinky : GLHEBase // LCOV_EXCL_LINE @@ -454,6 +456,8 @@ namespace GroundHeatExchangers { void readCacheFileAndCompareWithThisGLHECache(EnergyPlusData &state) override; void initEnvironment(EnergyPlusData &state, Real64 const &CurTime) override; + + void oneTimeInit(EnergyPlusData &state) override; }; void GetGroundHeatExchangerInput(EnergyPlusData &state); diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index fa00af36579..3f7e8abd383 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -15531,6 +15531,9 @@ void VRFCondenserEquipment::VRFOU_PipeLossH( Pipe_h_comp_out = Pipe_h_IU_in; } } +void VRFCondenserEquipment::oneTimeInit([[maybe_unused]] EnergyPlusData &state) +{ +} void VRFTerminalUnitEquipment::CalcVRFSuppHeatingCoil(EnergyPlusData &state, int const VRFTUNum, // index of vrf terminal unit diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.hh b/src/EnergyPlus/HVACVariableRefrigerantFlow.hh index 4e6edb46d9a..4be36e8b8d2 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.hh +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.hh @@ -480,7 +480,7 @@ namespace HVACVariableRefrigerantFlow { Real64 P_evap_real, // Evaporative pressure at real conditions [Pa] Real64 T_comp_in_real, // Temperature of the refrigerant at the compressor inlet at real conditions [C] Real64 T_comp_in_rate, // Temperature of the refrigerant at the compressor inlet at rated conditions [C] - Real64 T_cond_out_rate // Temperature of the refrigerant at the condensor outlet at rated conditions [C] + Real64 T_cond_out_rate // Temperature of the refrigerant at the condenser outlet at rated conditions [C] ); void VRFOU_TeModification(EnergyPlusData &state, @@ -586,6 +586,8 @@ namespace HVACVariableRefrigerantFlow { Real64 &Pipe_DeltP, // ratio of compressor ON airflow to AVERAGE airflow over timestep Real64 &Pipe_h_comp_out // Piping Loss Algorithm Parameter: Enthalpy before piping loss (compressor outlet) [kJ/kg] ) const; + + void oneTimeInit(EnergyPlusData &state) override; }; struct TerminalUnitListData diff --git a/src/EnergyPlus/HWBaseboardRadiator.cc b/src/EnergyPlus/HWBaseboardRadiator.cc index 13717b590a7..d85bd9fbf0f 100644 --- a/src/EnergyPlus/HWBaseboardRadiator.cc +++ b/src/EnergyPlus/HWBaseboardRadiator.cc @@ -1840,20 +1840,19 @@ namespace HWBaseboardRadiator { if (state.dataSurface->SurfWinFrameArea(SurfNum) > 0.0) { // Window frame contribution - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * - (1.0 + state.dataSurface->SurfWinProjCorrFrIn(SurfNum)) * state.dataSurface->SurfWinFrameTempSurfIn(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * + (1.0 + state.dataSurface->SurfWinProjCorrFrIn(SurfNum)) * state.dataSurface->SurfWinFrameTempIn(SurfNum); } if (state.dataSurface->SurfWinDividerArea(SurfNum) > 0.0 && !ANY_INTERIOR_SHADE_BLIND(state.dataSurface->SurfWinShadingFlag(SurfNum))) { // Window divider contribution (only from shade or blind for window with divider and interior shade or blind) - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * - (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum)) * - state.dataSurface->SurfWinDividerTempSurfIn(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * + (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum)) * state.dataSurface->SurfWinDividerTempIn(SurfNum); } } - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * Area * state.dataHeatBalSurf->TempSurfInTmp(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * Area * state.dataHeatBalSurf->SurfTempInTmp(SurfNum); } return SumHATsurf; diff --git a/src/EnergyPlus/HeatBalFiniteDiffManager.cc b/src/EnergyPlus/HeatBalFiniteDiffManager.cc index 178e7ab78e1..ff15ae9393b 100644 --- a/src/EnergyPlus/HeatBalFiniteDiffManager.cc +++ b/src/EnergyPlus/HeatBalFiniteDiffManager.cc @@ -104,7 +104,7 @@ namespace HeatBalFiniteDiffManager { void ManageHeatBalFiniteDiff(EnergyPlusData &state, int const SurfNum, - Real64 &TempSurfInTmp, // INSIDE SURFACE TEMPERATURE OF EACH HEAT TRANSFER SURF. + Real64 &SurfTempInTmp, // INSIDE SURFACE TEMPERATURE OF EACH HEAT TRANSFER SURF. Real64 &TempSurfOutTmp // Outside Surface Temperature of each Heat Transfer Surface ) { @@ -127,7 +127,7 @@ namespace HeatBalFiniteDiffManager { state.dataHeatBalFiniteDiffMgr->GetHBFiniteDiffInputFlag = false; } // Solve the zone heat & moisture balance using a finite difference solution - CalcHeatBalFiniteDiff(state, SurfNum, TempSurfInTmp, TempSurfOutTmp); + CalcHeatBalFiniteDiff(state, SurfNum, SurfTempInTmp, TempSurfOutTmp); } void GetCondFDInput(EnergyPlusData &state) @@ -579,7 +579,7 @@ namespace HeatBalFiniteDiffManager { QHeatInFlux = 0.0; QHeatOutFlux = 0.0; state.dataHeatBalSurf->SurfOpaqInsFaceConductionFlux = 0.0; - state.dataHeatBalSurf->SurfOpaqOutsideFaceConductionFlux = 0.0; + state.dataHeatBalSurf->SurfOpaqOutFaceCondFlux = 0.0; // Setup Output Variables @@ -1023,7 +1023,7 @@ namespace HeatBalFiniteDiffManager { void CalcHeatBalFiniteDiff(EnergyPlusData &state, int const Surf, // Surface number - Real64 &TempSurfInTmp, // INSIDE SURFACE TEMPERATURE OF EACH HEAT TRANSFER SURF. + Real64 &SurfTempInTmp, // INSIDE SURFACE TEMPERATURE OF EACH HEAT TRANSFER SURF. Real64 &TempSurfOutTmp // Outside Surface Temperature of each Heat Transfer Surface ) { @@ -1056,7 +1056,7 @@ namespace HeatBalFiniteDiffManager { int const TotNodes(ConstructFD(ConstrNum).TotNodes); int const TotLayers(state.dataConstruction->Construct(ConstrNum).TotLayers); - TempSurfInTmp = 0.0; + SurfTempInTmp = 0.0; TempSurfOutTmp = 0.0; int const Delt(ConstructFD(ConstrNum).DeltaTime); // (seconds) @@ -1167,7 +1167,7 @@ namespace HeatBalFiniteDiffManager { } // Time Loop //PT solving time steps TempSurfOutTmp = TDT(1); - TempSurfInTmp = TDT(TotNodes + 1); + SurfTempInTmp = TDT(TotNodes + 1); state.dataMstBal->RhoVaporSurfIn(Surf) = 0.0; // For ground surfaces or when raining, outside face inner half-node heat capacity was unknown and set to -1 in ExteriorBCEqns @@ -1503,9 +1503,8 @@ namespace HeatBalFiniteDiffManager { Real64 const QNetSurfFromOutside(state.dataHeatBalSurf->SurfOpaqInsFaceConductionFlux(surface_ExtBoundCond)); // filled in InteriorBCEqns // QFluxOutsideToOutSurf(Surf) = QnetSurfFromOutside - state.dataHeatBalSurf->SurfOpaqOutsideFaceConductionFlux(Surf) = -QNetSurfFromOutside; - state.dataHeatBalSurf->SurfOpaqOutsideFaceConduction(Surf) = - surface.Area * state.dataHeatBalSurf->SurfOpaqOutsideFaceConductionFlux(Surf); + state.dataHeatBalSurf->SurfOpaqOutFaceCondFlux(Surf) = -QNetSurfFromOutside; + state.dataHeatBalSurf->SurfOpaqOutFaceCond(Surf) = surface.Area * state.dataHeatBalSurf->SurfOpaqOutFaceCondFlux(Surf); state.dataHeatBalFiniteDiffMgr->QHeatOutFlux(Surf) = QNetSurfFromOutside; } else if (surface_ExtBoundCond <= 0) { // regular outside conditions @@ -1661,9 +1660,8 @@ namespace HeatBalFiniteDiffManager { Real64 const QNetSurfFromOutside(QRadSWOutFD + (hgnd * (-TDT_i + Tgnd) + (hconvo + hrad) * Toa_TDT_i + hsky * (-TDT_i + Tsky))); // Same sign convention as CTFs - state.dataHeatBalSurf->SurfOpaqOutsideFaceConductionFlux(Surf) = -QNetSurfFromOutside; - state.dataHeatBalSurf->SurfOpaqOutsideFaceConduction(Surf) = - surface.Area * state.dataHeatBalSurf->SurfOpaqOutsideFaceConductionFlux(Surf); + state.dataHeatBalSurf->SurfOpaqOutFaceCondFlux(Surf) = -QNetSurfFromOutside; + state.dataHeatBalSurf->SurfOpaqOutFaceCond(Surf) = surface.Area * state.dataHeatBalSurf->SurfOpaqOutFaceCondFlux(Surf); // Report all outside BC heat fluxes state.dataHeatBalSurf->QdotRadOutRepPerArea(Surf) = -(hgnd * (TDT_i - Tgnd) + hrad * (-Toa_TDT_i) + hsky * (TDT_i - Tsky)); @@ -2126,13 +2124,13 @@ namespace HeatBalFiniteDiffManager { if (construct.SourceSinkPresent && (Lay == construct.SourceAfterLayer)) { state.dataHeatBalFanSys->TCondFDSourceNode(Surf) = TDT_i; // Transfer node temp to Radiant System - state.dataHeatBalSurf->TempSource(Surf) = TDT_i; // Transfer node temp to DataHeatBalSurface module + state.dataHeatBalSurf->SurfTempSource(Surf) = TDT_i; // Transfer node temp to DataHeatBalSurface module state.dataHeatBalFiniteDiffMgr->SurfaceFD(Surf).QSource = QSSFlux; state.dataHeatBalFiniteDiffMgr->SurfaceFD(Surf).SourceNodeNum = i; } if (construct.SourceSinkPresent && (Lay == construct.TempAfterLayer)) { - state.dataHeatBalSurf->TempUserLoc(Surf) = TDT_i; // Transfer node temp to DataHeatBalSurface module + state.dataHeatBalSurf->SurfTempUserLoc(Surf) = TDT_i; // Transfer node temp to DataHeatBalSurface module } } // End of R-layer and Regular check diff --git a/src/EnergyPlus/HeatBalFiniteDiffManager.hh b/src/EnergyPlus/HeatBalFiniteDiffManager.hh index 42ff913e1ba..0be9481223c 100644 --- a/src/EnergyPlus/HeatBalFiniteDiffManager.hh +++ b/src/EnergyPlus/HeatBalFiniteDiffManager.hh @@ -180,7 +180,7 @@ namespace HeatBalFiniteDiffManager { void ManageHeatBalFiniteDiff(EnergyPlusData &state, int SurfNum, - Real64 &TempSurfInTmp, // INSIDE SURFACE TEMPERATURE OF EACH HEAT TRANSFER SURF. + Real64 &SurfTempInTmp, // INSIDE SURFACE TEMPERATURE OF EACH HEAT TRANSFER SURF. Real64 &TempSurfOutTmp // Outside Surface Temperature of each Heat Transfer Surface ); @@ -194,7 +194,7 @@ namespace HeatBalFiniteDiffManager { void CalcHeatBalFiniteDiff(EnergyPlusData &state, int Surf, - Real64 &TempSurfInTmp, // INSIDE SURFACE TEMPERATURE OF EACH HEAT TRANSFER SURF. + Real64 &SurfTempInTmp, // INSIDE SURFACE TEMPERATURE OF EACH HEAT TRANSFER SURF. Real64 &TempSurfOutTmp // Outside Surface Temperature of each Heat Transfer Surface ); diff --git a/src/EnergyPlus/HeatBalanceHAMTManager.cc b/src/EnergyPlus/HeatBalanceHAMTManager.cc index 814831d4a62..98d350c489f 100644 --- a/src/EnergyPlus/HeatBalanceHAMTManager.cc +++ b/src/EnergyPlus/HeatBalanceHAMTManager.cc @@ -118,7 +118,7 @@ namespace HeatBalanceHAMTManager { using namespace DataHeatBalance; using namespace Psychrometrics; - void ManageHeatBalHAMT(EnergyPlusData &state, int const SurfNum, Real64 &TempSurfInTmp, Real64 &TempSurfOutTmp) + void ManageHeatBalHAMT(EnergyPlusData &state, int const SurfNum, Real64 &SurfTempInTmp, Real64 &TempSurfOutTmp) { // SUBROUTINE INFORMATION: @@ -140,7 +140,7 @@ namespace HeatBalanceHAMTManager { InitHeatBalHAMT(state); } - CalcHeatBalHAMT(state, SurfNum, TempSurfInTmp, TempSurfOutTmp); + CalcHeatBalHAMT(state, SurfNum, SurfTempInTmp, TempSurfOutTmp); } void GetHeatBalHAMTInput(EnergyPlusData &state) @@ -1053,7 +1053,7 @@ namespace HeatBalanceHAMTManager { } } - void CalcHeatBalHAMT(EnergyPlusData &state, int const sid, Real64 &TempSurfInTmp, Real64 &TempSurfOutTmp) + void CalcHeatBalHAMT(EnergyPlusData &state, int const sid, Real64 &SurfTempInTmp, Real64 &TempSurfOutTmp) { // SUBROUTINE INFORMATION: // AUTHOR Phillip Biddulph @@ -1075,7 +1075,7 @@ namespace HeatBalanceHAMTManager { static std::string const HAMTInt("HAMT-Int"); // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 TempSurfInP; + Real64 SurfTempInP; Real64 RhoIn; Real64 RhoOut; Real64 torsum; @@ -1523,12 +1523,12 @@ namespace HeatBalanceHAMTManager { // report back to CalcHeatBalanceInsideSurf TempSurfOutTmp = cells(Extcell(sid)).tempp1; - TempSurfInTmp = cells(Intcell(sid)).tempp1; + SurfTempInTmp = cells(Intcell(sid)).tempp1; - TempSurfInP = cells(Intcell(sid)).rhp1 * PsyPsatFnTemp(state, cells(Intcell(sid)).tempp1); + SurfTempInP = cells(Intcell(sid)).rhp1 * PsyPsatFnTemp(state, cells(Intcell(sid)).tempp1); state.dataMstBal->RhoVaporSurfIn(sid) = - TempSurfInP / (461.52 * (state.dataHeatBalFanSys->MAT(state.dataSurface->Surface(sid).Zone) + DataGlobalConstants::KelvinConv)); + SurfTempInP / (461.52 * (state.dataHeatBalFanSys->MAT(state.dataSurface->Surface(sid).Zone) + DataGlobalConstants::KelvinConv)); } void UpdateHeatBalHAMT(EnergyPlusData &state, int const sid) diff --git a/src/EnergyPlus/HeatBalanceHAMTManager.hh b/src/EnergyPlus/HeatBalanceHAMTManager.hh index 136b0998fba..0370d6342fc 100644 --- a/src/EnergyPlus/HeatBalanceHAMTManager.hh +++ b/src/EnergyPlus/HeatBalanceHAMTManager.hh @@ -119,13 +119,13 @@ namespace HeatBalanceHAMTManager { } }; - void ManageHeatBalHAMT(EnergyPlusData &state, int const SurfNum, Real64 &TempSurfInTmp, Real64 &TempSurfOutTmp); + void ManageHeatBalHAMT(EnergyPlusData &state, int const SurfNum, Real64 &SurfTempInTmp, Real64 &TempSurfOutTmp); void GetHeatBalHAMTInput(EnergyPlusData &state); void InitHeatBalHAMT(EnergyPlusData &state); - void CalcHeatBalHAMT(EnergyPlusData &state, int const sid, Real64 &TempSurfInTmp, Real64 &TempSurfOutTmp); + void CalcHeatBalHAMT(EnergyPlusData &state, int const sid, Real64 &SurfTempInTmp, Real64 &TempSurfOutTmp); void UpdateHeatBalHAMT(EnergyPlusData &state, int const sid); diff --git a/src/EnergyPlus/HeatBalanceKivaManager.cc b/src/EnergyPlus/HeatBalanceKivaManager.cc index d4afb7a632c..88691251cad 100644 --- a/src/EnergyPlus/HeatBalanceKivaManager.cc +++ b/src/EnergyPlus/HeatBalanceKivaManager.cc @@ -1234,7 +1234,7 @@ void KivaManager::calcKivaSurfaceResults(EnergyPlusData &state) std::string contextStr = "Surface=\"" + state.dataSurface->Surface(surfNum).Name + "\""; Kiva::setMessageCallback(kivaErrorCallback, &contextStr); surfaceMap[surfNum].calc_weighted_results(); - state.dataHeatBal->HConvIn(surfNum) = state.dataSurfaceGeometry->kivaManager.surfaceMap[surfNum].results.hconv; + state.dataHeatBalSurf->SurfHConvInt(surfNum) = state.dataSurfaceGeometry->kivaManager.surfaceMap[surfNum].results.hconv; } } Kiva::setMessageCallback(kivaErrorCallback, nullptr); diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 957f993d6da..8109a170768 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -5607,7 +5607,7 @@ namespace HeatBalanceManager { } for (SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { constexpr const char *ShdFracFmt2("{:10.8F},"); - print(state.files.shade, ShdFracFmt2, state.dataHeatBal->SunlitFrac(TS, iHour, SurfNum)); + print(state.files.shade, ShdFracFmt2, state.dataHeatBal->SurfSunlitFrac(iHour, TS, SurfNum)); } print(state.files.shade, "\n"); } @@ -5696,37 +5696,38 @@ namespace HeatBalanceManager { void AllocateZoneHeatBalArrays(EnergyPlusData &state) { // Allocate zone / encl hb arrays - state.dataHeatBal->EnclSolDB.allocate(state.dataGlobal->NumOfZones); - state.dataHeatBal->EnclSolDBSSG.allocate(state.dataGlobal->NumOfZones); - state.dataHeatBal->EnclSolDBIntWin.allocate(state.dataGlobal->NumOfZones); - state.dataHeatBal->EnclSolQSDifSol.allocate(state.dataGlobal->NumOfZones); - state.dataHeatBal->EnclSolQD.allocate(state.dataGlobal->NumOfZones); - state.dataHeatBal->EnclSolQDforDaylight.allocate(state.dataGlobal->NumOfZones); - state.dataHeatBal->EnclRadQThermalRad.allocate(state.dataGlobal->NumOfZones); + state.dataHeatBal->ZoneMRT.allocate(state.dataGlobal->NumOfZones); - state.dataHeatBal->EnclRadThermAbsMult.allocate(state.dataGlobal->NumOfZones); state.dataHeatBal->ZoneSolAbsFirstCalc.allocate(state.dataGlobal->NumOfZones); state.dataHeatBal->EnclRadReCalc.allocate(state.dataGlobal->NumOfZones); for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { - state.dataHeatBal->EnclSolDB(zoneNum) = 0.0; - state.dataHeatBal->EnclSolDBSSG(zoneNum) = 0.0; - state.dataHeatBal->EnclSolDBIntWin(zoneNum) = 0.0; - state.dataHeatBal->EnclSolQSDifSol(zoneNum) = 0.0; - state.dataHeatBal->EnclSolQD(zoneNum) = 0.0; - state.dataHeatBal->EnclSolQDforDaylight(zoneNum) = 0.0; - state.dataHeatBal->EnclRadQThermalRad(zoneNum) = 0.0; state.dataHeatBal->ZoneMRT(zoneNum) = 0.0; - state.dataHeatBal->EnclRadThermAbsMult(zoneNum) = 0.0; state.dataHeatBal->ZoneSolAbsFirstCalc(zoneNum) = true; state.dataHeatBal->EnclRadReCalc(zoneNum) = false; } + state.dataHeatBal->EnclSolQSDifSol.allocate(state.dataViewFactor->NumOfSolarEnclosures); + state.dataHeatBal->EnclSolQD.allocate(state.dataViewFactor->NumOfSolarEnclosures); + state.dataHeatBal->EnclSolQDforDaylight.allocate(state.dataViewFactor->NumOfSolarEnclosures); + state.dataHeatBal->EnclRadQThermalRad.allocate(state.dataViewFactor->NumOfSolarEnclosures); + state.dataHeatBal->EnclRadThermAbsMult.allocate(state.dataViewFactor->NumOfSolarEnclosures); + state.dataHeatBal->EnclSolDB.allocate(state.dataViewFactor->NumOfSolarEnclosures); + state.dataHeatBal->EnclSolDBSSG.allocate(state.dataViewFactor->NumOfSolarEnclosures); + state.dataHeatBal->EnclSolDBIntWin.allocate(state.dataViewFactor->NumOfSolarEnclosures); state.dataHeatBal->EnclSolQSWRad.allocate(state.dataViewFactor->NumOfSolarEnclosures); state.dataHeatBal->EnclSolQSWRadLights.allocate(state.dataViewFactor->NumOfSolarEnclosures); state.dataHeatBal->EnclSolVMULT.allocate(state.dataViewFactor->NumOfSolarEnclosures); for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclosureNum) { + state.dataHeatBal->EnclSolQSDifSol(enclosureNum) = 0.0; + state.dataHeatBal->EnclSolQD(enclosureNum) = 0.0; + state.dataHeatBal->EnclSolQDforDaylight(enclosureNum) = 0.0; + state.dataHeatBal->EnclRadQThermalRad(enclosureNum) = 0.0; + state.dataHeatBal->EnclRadThermAbsMult(enclosureNum) = 0.0; state.dataHeatBal->EnclSolQSWRad(enclosureNum) = 0.0; state.dataHeatBal->EnclSolQSWRadLights(enclosureNum) = 0.0; state.dataHeatBal->EnclSolVMULT(enclosureNum) = 0.0; + state.dataHeatBal->EnclSolDB(enclosureNum) = 0.0; + state.dataHeatBal->EnclSolDBSSG(enclosureNum) = 0.0; + state.dataHeatBal->EnclSolDBIntWin(enclosureNum) = 0.0; } } void AllocateHeatBalArrays(EnergyPlusData &state) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index bf8b0355921..af52878fcb3 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -435,7 +435,7 @@ void InitSurfaceHeatBalance(EnergyPlusData &state) if (state.dataEnvrn->SunIsUp && state.dataEnvrn->DifSolarRad > 0.0) { AnisoSkyViewFactors(state); } else { - state.dataHeatBal->SurfAnisoSkyMult = 0.0; + state.dataSolarShading->SurfAnisoSkyMult = 0.0; } // Set shading flag for exterior windows (except flags related to daylighting) and @@ -670,7 +670,7 @@ void InitSurfaceHeatBalance(EnergyPlusData &state) InitIntSolarDistribution(state); if (state.dataHeatBalSurfMgr->InitSurfaceHeatBalancefirstTime) DisplayString(state, "Initializing Interior Convection Coefficients"); - InitInteriorConvectionCoeffs(state, state.dataHeatBalSurf->TempSurfInTmp); + InitInteriorConvectionCoeffs(state, state.dataHeatBalSurf->SurfTempInTmp); if (state.dataGlobal->BeginSimFlag) { // Now's the time to report surfaces, if desired // if (firstTime) CALL DisplayString('Reporting Surfaces') @@ -744,16 +744,16 @@ void InitSurfaceHeatBalance(EnergyPlusData &state) } } - state.dataHeatBalSurf->CTFConstOutPart(SurfNum) = QOC; - state.dataHeatBalSurf->CTFConstInPart(SurfNum) = QIC; + state.dataHeatBalSurf->SurfCTFConstOutPart(SurfNum) = QOC; + state.dataHeatBalSurf->SurfCTFConstInPart(SurfNum) = QIC; if (construct.SourceSinkPresent) { state.dataHeatBalFanSys->CTFTsrcConstPart(SurfNum) = TSC; state.dataHeatBalFanSys->CTFTuserConstPart(SurfNum) = TUC; } } else { // Number of CTF Terms = 1-->Resistance only constructions have no history terms. - state.dataHeatBalSurf->CTFConstOutPart(SurfNum) = 0.0; - state.dataHeatBalSurf->CTFConstInPart(SurfNum) = 0.0; + state.dataHeatBalSurf->SurfCTFConstOutPart(SurfNum) = 0.0; + state.dataHeatBalSurf->SurfCTFConstInPart(SurfNum) = 0.0; if (construct.SourceSinkPresent) { state.dataHeatBalFanSys->CTFTsrcConstPart(SurfNum) = 0.0; state.dataHeatBalFanSys->CTFTuserConstPart(SurfNum) = 0.0; @@ -1326,36 +1326,33 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) auto &Surface(state.dataSurface->Surface); // Use the total number of surfaces to allocate variables to avoid a surface number limit - state.dataHeatBalSurf->CTFConstInPart.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->CTFConstOutPart.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->CTFCross0.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->CTFInside0.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->TH11Surf.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->CTFSourceIn0.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->QsrcHistSurf1.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->IsAdiabatic.dimension(state.dataSurface->TotSurfaces, 0); - state.dataHeatBalSurf->IsNotAdiabatic.dimension(state.dataSurface->TotSurfaces, 0); - state.dataHeatBalSurf->IsSource.dimension(state.dataSurface->TotSurfaces, 0); - state.dataHeatBalSurf->IsNotSource.dimension(state.dataSurface->TotSurfaces, 0); - state.dataHeatBalSurf->IsPoolSurf.dimension(state.dataSurface->TotSurfaces, 0); - state.dataHeatBalSurf->IsNotPoolSurf.dimension(state.dataSurface->TotSurfaces, 0); - state.dataHeatBalSurf->TempTermSurf.dimension(state.dataSurface->TotSurfaces, 0); - state.dataHeatBalSurf->TempDivSurf.dimension(state.dataSurface->TotSurfaces, 0); + state.dataHeatBalSurf->SurfCTFConstInPart.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfCTFConstOutPart.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfCTFCross0.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfCTFInside0.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfTempOutHist.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfCTFSourceIn0.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfQSourceSinkHist.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfIsAdiabatic.dimension(state.dataSurface->TotSurfaces, 0); + state.dataHeatBalSurf->SurfIsSourceOrSink.dimension(state.dataSurface->TotSurfaces, 0); + state.dataHeatBalSurf->SurfIsOperatingPool.dimension(state.dataSurface->TotSurfaces, 0); + state.dataHeatBalSurf->SurfTempTerm.dimension(state.dataSurface->TotSurfaces, 0); + state.dataHeatBalSurf->SurfTempDiv.dimension(state.dataSurface->TotSurfaces, 0); if (state.dataHeatBal->AnyInternalHeatSourceInInput) { state.dataHeatBalFanSys->CTFTsrcConstPart.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalFanSys->CTFTuserConstPart.dimension(state.dataSurface->TotSurfaces, 0.0); } state.dataHeatBal->SurfTempEffBulkAir.dimension(state.dataSurface->TotSurfaces, ZoneInitialTemp); - state.dataHeatBal->HConvIn.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->HcExtSurf.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->HAirExtSurf.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->HSkyExtSurf.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->HGrdExtSurf.dimension(state.dataSurface->TotSurfaces, 0.0); - - state.dataHeatBalSurf->TempSurfIn.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->TempInsOld.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->TempSurfInTmp.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfHConvInt.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfHcExt.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfHAirExt.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfHSkyExt.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfHGrdExt.dimension(state.dataSurface->TotSurfaces, 0.0); + + state.dataHeatBalSurf->SurfTempIn.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfTempInsOld.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfTempInTmp.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurfMgr->RefAirTemp.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->SurfQRadLWOutSrdSurfs.dimension(state.dataSurface->TotSurfaces, 0.0); @@ -1365,12 +1362,12 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) state.dataHeatBal->SurfQRadThermInAbs.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->SurfQAdditionalHeatSourceOutside.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->SurfQAdditionalHeatSourceInside.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->SUMH.dimension(state.dataSurface->TotSurfaces, 0); + state.dataHeatBalSurf->SurfCurrNumHist.dimension(state.dataSurface->TotSurfaces, 0); state.dataHeatBalSurf->TH.dimension(2, Construction::MaxCTFTerms, state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->SurfTempOut.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->TempSurfInRep.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->TempSurfInMovInsRep.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfTempInRep.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfTempInMovInsRep.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->QConvInReport.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->QdotConvInRepPerArea.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->QdotConvInRep.dimension(state.dataSurface->TotSurfaces, 0.0); @@ -1415,23 +1412,23 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) state.dataHeatBalSurf->SurfOpaqInsFaceCondLossRep.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->SurfOpaqInsFaceConductionEnergy.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->SurfOpaqOutsideFaceConduction.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->SurfOpaqOutsideFaceConductionFlux.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfOpaqOutFaceCond.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfOpaqOutFaceCondFlux.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->SurfOpaqExtFaceCondGainRep.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->SurfOpaqExtFaceCondLossRep.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->SurfOpaqOutsideFaceConductionEnergy.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfOpaqOutFaceCondEnergy.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->SurfOpaqAvgFaceCondGainRep.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->SurfOpaqAvgFaceCondLossRep.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->SurfOpaqAvgFaceConduction.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->SurfOpaqAvgFaceConductionFlux.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->SurfOpaqAvgFaceConductionEnergy.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfOpaqAvgFaceCond.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfOpaqAvgFaceCondFlux.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfOpaqAvgFaceCondEnergy.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->SurfOpaqStorageGainRep.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->SurfOpaqStorageCondLossRep.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->SurfOpaqStorageConduction.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->SurfOpaqStorageConductionFlux.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->SurfOpaqStorageConductionEnergy.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfOpaqStorageCond.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfOpaqStorageCondFlux.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfOpaqStorageCondEnergy.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->SurfOpaqInsFaceBeamSolAbsorbed.dimension(state.dataSurface->TotSurfaces, 0.0); @@ -1448,8 +1445,8 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) state.dataHeatBalSurf->THM.dimension(2, Construction::MaxCTFTerms, state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->QHM.dimension(2, Construction::MaxCTFTerms, state.dataSurface->TotSurfaces, 0.0); if (state.dataHeatBal->AnyInternalHeatSourceInInput) { - state.dataHeatBalSurf->TempSource.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalSurf->TempUserLoc.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfTempSource.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalSurf->SurfTempUserLoc.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->TsrcHist.dimension(state.dataSurface->TotSurfaces, Construction::MaxCTFTerms, 0.0); state.dataHeatBalSurf->TuserHist.dimension(state.dataSurface->TotSurfaces, Construction::MaxCTFTerms, 0.0); state.dataHeatBalSurf->QsrcHist.dimension(state.dataSurface->TotSurfaces, Construction::MaxCTFTerms, 0.0); @@ -1518,14 +1515,14 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Inside Face Temperature", OutputProcessor::Unit::C, - state.dataHeatBalSurf->TempSurfInRep(loop), + state.dataHeatBalSurf->SurfTempInRep(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable(state, "Surface Inside Face Interior Movable Insulation Temperature", OutputProcessor::Unit::C, - state.dataHeatBalSurf->TempSurfInMovInsRep(loop), + state.dataHeatBalSurf->SurfTempInMovInsRep(loop), "Zone", "State", Surface(loop).Name); @@ -1550,7 +1547,7 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Inside Face Convection Heat Transfer Coefficient", OutputProcessor::Unit::W_m2K, - state.dataHeatBal->HConvIn(loop), + state.dataHeatBalSurf->SurfHConvInt(loop), "Zone", "State", Surface(loop).Name); @@ -1741,7 +1738,7 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Outside Face Convection Heat Transfer Coefficient", OutputProcessor::Unit::W_m2K, - state.dataHeatBalSurf->HcExtSurf(loop), + state.dataHeatBalSurf->SurfHcExt(loop), "Zone", "State", Surface(loop).Name); @@ -1769,21 +1766,21 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Outside Face Thermal Radiation to Air Heat Transfer Coefficient", OutputProcessor::Unit::W_m2K, - state.dataHeatBalSurf->HAirExtSurf(loop), + state.dataHeatBalSurf->SurfHAirExt(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable(state, "Surface Outside Face Thermal Radiation to Sky Heat Transfer Coefficient", OutputProcessor::Unit::W_m2K, - state.dataHeatBalSurf->HSkyExtSurf(loop), + state.dataHeatBalSurf->SurfHSkyExt(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable(state, "Surface Outside Face Thermal Radiation to Ground Heat Transfer Coefficient", OutputProcessor::Unit::W_m2K, - state.dataHeatBalSurf->HGrdExtSurf(loop), + state.dataHeatBalSurf->SurfHGrdExt(loop), "Zone", "State", Surface(loop).Name); @@ -1869,7 +1866,7 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Outside Face Conduction Heat Transfer Rate", OutputProcessor::Unit::W, - state.dataHeatBalSurf->SurfOpaqOutsideFaceConduction(loop), + state.dataHeatBalSurf->SurfOpaqOutFaceCond(loop), "Zone", "State", Surface(loop).Name); @@ -1890,14 +1887,14 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Outside Face Conduction Heat Transfer Rate per Area", OutputProcessor::Unit::W_m2, - state.dataHeatBalSurf->SurfOpaqOutsideFaceConductionFlux(loop), + state.dataHeatBalSurf->SurfOpaqOutFaceCondFlux(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable(state, "Surface Outside Face Conduction Heat Transfer Energy", OutputProcessor::Unit::J, - state.dataHeatBalSurf->SurfOpaqOutsideFaceConductionEnergy(loop), + state.dataHeatBalSurf->SurfOpaqOutFaceCondEnergy(loop), "Zone", "Sum", Surface(loop).Name); @@ -1905,7 +1902,7 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Average Face Conduction Heat Transfer Rate", OutputProcessor::Unit::W, - state.dataHeatBalSurf->SurfOpaqAvgFaceConduction(loop), + state.dataHeatBalSurf->SurfOpaqAvgFaceCond(loop), "Zone", "State", Surface(loop).Name); @@ -1926,14 +1923,14 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Average Face Conduction Heat Transfer Rate per Area", OutputProcessor::Unit::W_m2, - state.dataHeatBalSurf->SurfOpaqAvgFaceConductionFlux(loop), + state.dataHeatBalSurf->SurfOpaqAvgFaceCondFlux(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable(state, "Surface Average Face Conduction Heat Transfer Energy", OutputProcessor::Unit::J, - state.dataHeatBalSurf->SurfOpaqAvgFaceConductionEnergy(loop), + state.dataHeatBalSurf->SurfOpaqAvgFaceCondEnergy(loop), "Zone", "Sum", Surface(loop).Name); @@ -1941,7 +1938,7 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Heat Storage Rate", OutputProcessor::Unit::W, - state.dataHeatBalSurf->SurfOpaqStorageConduction(loop), + state.dataHeatBalSurf->SurfOpaqStorageCond(loop), "Zone", "State", Surface(loop).Name); @@ -1962,14 +1959,14 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Heat Storage Rate per Area", OutputProcessor::Unit::W_m2, - state.dataHeatBalSurf->SurfOpaqStorageConductionFlux(loop), + state.dataHeatBalSurf->SurfOpaqStorageCondFlux(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable(state, "Surface Heat Storage Energy", OutputProcessor::Unit::J, - state.dataHeatBalSurf->SurfOpaqStorageConductionEnergy(loop), + state.dataHeatBalSurf->SurfOpaqStorageCondEnergy(loop), "Zone", "Sum", Surface(loop).Name); @@ -1990,14 +1987,14 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Internal Source Location Temperature", OutputProcessor::Unit::C, - state.dataHeatBalSurf->TempSource(loop), + state.dataHeatBalSurf->SurfTempSource(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable(state, "Surface Internal User Specified Location Temperature", OutputProcessor::Unit::C, - state.dataHeatBalSurf->TempUserLoc(loop), + state.dataHeatBalSurf->SurfTempUserLoc(loop), "Zone", "State", Surface(loop).Name); @@ -2166,17 +2163,17 @@ void InitThermalAndFluxHistories(EnergyPlusData &state) int const lastSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceLast; for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = SurfInitialTemp; - state.dataHeatBalSurf->SUMH(SurfNum) = 0; // module level array - state.dataHeatBalSurf->TempSurfIn(SurfNum) = SurfInitialTemp; // module level array - state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = SurfInitialTemp; // module level array - state.dataHeatBal->HConvIn(SurfNum) = SurfInitialConvCoeff; // module level array - state.dataHeatBalSurf->HcExtSurf(SurfNum) = 0.0; - state.dataHeatBalSurf->HAirExtSurf(SurfNum) = 0.0; - state.dataHeatBalSurf->HSkyExtSurf(SurfNum) = 0.0; - state.dataHeatBalSurf->HGrdExtSurf(SurfNum) = 0.0; + state.dataHeatBalSurf->SurfCurrNumHist(SurfNum) = 0; // module level array + state.dataHeatBalSurf->SurfTempIn(SurfNum) = SurfInitialTemp; // module level array + state.dataHeatBalSurf->SurfTempInTmp(SurfNum) = SurfInitialTemp; // module level array + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = SurfInitialConvCoeff; // module level array + state.dataHeatBalSurf->SurfHcExt(SurfNum) = 0.0; + state.dataHeatBalSurf->SurfHAirExt(SurfNum) = 0.0; + state.dataHeatBalSurf->SurfHSkyExt(SurfNum) = 0.0; + state.dataHeatBalSurf->SurfHGrdExt(SurfNum) = 0.0; state.dataHeatBalSurf->SurfTempOut(SurfNum) = 0.0; - state.dataHeatBalSurf->TempSurfInRep(SurfNum) = 0.0; - state.dataHeatBalSurf->TempSurfInMovInsRep(SurfNum) = 0.0; + state.dataHeatBalSurf->SurfTempInRep(SurfNum) = 0.0; + state.dataHeatBalSurf->SurfTempInMovInsRep(SurfNum) = 0.0; state.dataHeatBalSurf->QConvInReport(SurfNum) = 0.0; state.dataHeatBalSurf->QdotConvInRep(SurfNum) = 0.0; state.dataHeatBalSurf->QdotConvInRepPerArea(SurfNum) = 0.0; @@ -2219,11 +2216,11 @@ void InitThermalAndFluxHistories(EnergyPlusData &state) if (firstSurfWin >= 0) { for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) { // Initialize window frame and divider temperatures - state.dataSurface->SurfWinFrameTempSurfIn(SurfNum) = SurfInitialTemp; - state.dataSurface->SurfWinFrameTempSurfInOld(SurfNum) = SurfInitialTemp; + state.dataSurface->SurfWinFrameTempIn(SurfNum) = SurfInitialTemp; + state.dataSurface->SurfWinFrameTempInOld(SurfNum) = SurfInitialTemp; state.dataSurface->SurfWinFrameTempSurfOut(SurfNum) = SurfInitialTemp; - state.dataSurface->SurfWinDividerTempSurfIn(SurfNum) = SurfInitialTemp; - state.dataSurface->SurfWinDividerTempSurfInOld(SurfNum) = SurfInitialTemp; + state.dataSurface->SurfWinDividerTempIn(SurfNum) = SurfInitialTemp; + state.dataSurface->SurfWinDividerTempInOld(SurfNum) = SurfInitialTemp; state.dataSurface->SurfWinDividerTempSurfOut(SurfNum) = SurfInitialTemp; // Initialize previous-timestep shading indicators @@ -2640,9 +2637,9 @@ void InitSolarHeatGains(EnergyPlusData &state) } } if (resetSolar) { - for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { - state.dataHeatBal->EnclSolQD(zoneNum) = 0.0; - state.dataHeatBal->EnclSolQDforDaylight(zoneNum) = 0.0; + for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclosureNum) { + state.dataHeatBal->EnclSolQD(enclosureNum) = 0.0; + state.dataHeatBal->EnclSolQDforDaylight(enclosureNum) = 0.0; } // TTD domes are currently not considered in the window list of a zone @@ -2685,7 +2682,7 @@ void InitSolarHeatGains(EnergyPlusData &state) assert(equal_dimensions(state.dataSurface->SurfReflFacBmToBmSolObs, state.dataSurface->SurfReflFacBmToDiffSolObs)); // For linear indexing assert(equal_dimensions(state.dataSurface->SurfReflFacBmToBmSolObs, state.dataSurface->SurfReflFacBmToDiffSolGnd)); // For linear indexing for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - state.dataSurface->SurfSkySolarInc(SurfNum) = state.dataEnvrn->DifSolarRad * state.dataHeatBal->SurfAnisoSkyMult(SurfNum); + state.dataSurface->SurfSkySolarInc(SurfNum) = state.dataEnvrn->DifSolarRad * state.dataSolarShading->SurfAnisoSkyMult(SurfNum); state.dataSurface->SurfGndSolarInc(SurfNum) = state.dataEnvrn->GndSolarRad * Surface(SurfNum).ViewFactorGround; state.dataSurface->SurfWinSkyGndSolarInc(SurfNum) = state.dataSurface->SurfGndSolarInc(SurfNum); state.dataSurface->SurfWinBmGndSolarInc(SurfNum) = 0.0; @@ -2735,7 +2732,7 @@ void InitSolarHeatGains(EnergyPlusData &state) CalcInteriorSolarDistribution(state); } - for (int ZoneNum = 1; ZoneNum <= state.dataViewFactor->NumOfSolarEnclosures; ++ZoneNum) { + for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclosureNum) { // TH 3/24/2010 - QBV is not used! // unused QBV(ZoneNum) = (CBZone(ZoneNum) + EnclSolDB(ZoneNum))*BeamSolarRad @@ -2753,9 +2750,9 @@ void InitSolarHeatGains(EnergyPlusData &state) // EnclSolDB needs to subtract this part since it is already counted in EnclSolDB. // Use ZoneInitialDifSolReflW (Rob's previous work) as it better counts initial distribution of // diffuse solar rather than using weighted area*absorptance - state.dataHeatBal->EnclSolQDforDaylight(ZoneNum) = - (state.dataHeatBal->EnclSolDB(ZoneNum) - state.dataHeatBal->EnclSolDBIntWin(ZoneNum)) * state.dataEnvrn->BeamSolarRad + - state.dataHeatBal->EnclSolDBSSG(ZoneNum) + state.dataHeatBal->ZoneInitialDifSolReflW(ZoneNum); + state.dataHeatBal->EnclSolQDforDaylight(enclosureNum) = + (state.dataHeatBal->EnclSolDB(enclosureNum) - state.dataHeatBal->EnclSolDBIntWin(enclosureNum)) * state.dataEnvrn->BeamSolarRad + + state.dataHeatBal->EnclSolDBSSG(enclosureNum) + state.dataHeatBal->ZoneInitialDifSolReflW(enclosureNum); // to exclude diffuse solar now absorbed/transmitted in CalcWinTransDifSolInitialDistribution // EnclSolDB(ZoneNum) is Diffuse Solar from beam reflected from interior surfaces @@ -2764,25 +2761,25 @@ void InitSolarHeatGains(EnergyPlusData &state) // QD(ZoneNum) = EnclSolDB(ZoneNum)*BeamSolarRad & // +EnclSolDS(ZoneNum)*DifSolarRad & // +EnclSolDG(ZoneNum)*GndSolarRad - state.dataHeatBal->EnclSolQD(ZoneNum) = state.dataHeatBal->EnclSolDB(ZoneNum) * state.dataEnvrn->BeamSolarRad + - state.dataHeatBal->EnclSolDBSSG(ZoneNum) + state.dataHeatBal->ZoneInitialDifSolReflW(ZoneNum); + state.dataHeatBal->EnclSolQD(enclosureNum) = state.dataHeatBal->EnclSolDB(enclosureNum) * state.dataEnvrn->BeamSolarRad + + state.dataHeatBal->EnclSolDBSSG(enclosureNum) + + state.dataHeatBal->ZoneInitialDifSolReflW(enclosureNum); } // Flux of diffuse solar in each zone - state.dataHeatBal->EnclSolQSDifSol = 0.0; for (int enclNum = 1; enclNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclNum) { state.dataHeatBal->EnclSolQSDifSol(enclNum) = state.dataHeatBal->EnclSolQDforDaylight(enclNum); } if (state.dataHeatBalSurf->InterZoneWindow) { for (int enclNum = 1; enclNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclNum) { - if (state.dataHeatBalSurf->RecDifShortFromZ(enclNum)) { - Real64 EnclSolQSDifSol_sum(0.0); // Accumulator - auto lZone(state.dataHeatBalSurf->FractDifShortZtoZ.index(enclNum, 1)); // Tuned Linear indexing + if (state.dataHeatBalSurf->EnclSolRecDifShortFromZ(enclNum)) { + Real64 EnclSolQSDifSol_sum(0.0); // Accumulator + auto lZone(state.dataHeatBalSurf->ZoneFractDifShortZtoZ.index(enclNum, 1)); // Tuned Linear indexing for (int otherEnclNum = 1; otherEnclNum <= state.dataViewFactor->NumOfSolarEnclosures; ++otherEnclNum, ++lZone) { - if ((otherEnclNum != enclNum) && (state.dataHeatBalSurf->RecDifShortFromZ(otherEnclNum))) { - EnclSolQSDifSol_sum += state.dataHeatBalSurf->FractDifShortZtoZ[lZone] * + if ((otherEnclNum != enclNum) && (state.dataHeatBalSurf->EnclSolRecDifShortFromZ(otherEnclNum))) { + EnclSolQSDifSol_sum += state.dataHeatBalSurf->ZoneFractDifShortZtoZ[lZone] * state.dataHeatBal->EnclSolQDforDaylight(otherEnclNum); // [ lZone ] == ( enclNum, otherEnclNum ) } } @@ -2794,7 +2791,7 @@ void InitSolarHeatGains(EnergyPlusData &state) for (int enclNum = 1; enclNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclNum) { if (state.dataHeatBalSurf->InterZoneWindow) state.dataHeatBal->EnclSolQSDifSol(enclNum) *= - state.dataHeatBalSurf->FractDifShortZtoZ(enclNum, enclNum) * state.dataHeatBal->EnclSolVMULT(enclNum); + state.dataHeatBalSurf->ZoneFractDifShortZtoZ(enclNum, enclNum) * state.dataHeatBal->EnclSolVMULT(enclNum); else state.dataHeatBal->EnclSolQSDifSol(enclNum) *= state.dataHeatBal->EnclSolVMULT(enclNum); } @@ -2816,15 +2813,15 @@ void InitSolarHeatGains(EnergyPlusData &state) if (state.dataSurface->BuildingShadingCount || state.dataSurface->FixedShadingCount || state.dataSurface->AttachedShadingCount) { for (int SurfNum = state.dataSurface->ShadingSurfaceFirst; SurfNum <= state.dataSurface->ShadingSurfaceLast; SurfNum++) { // Cosine of incidence angle and solar incident on outside of surface, for reporting - Real64 CosInc = state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum); + Real64 CosInc = state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum); state.dataHeatBal->SurfCosIncidenceAngle(SurfNum) = CosInc; // Incident direct (unreflected) beam state.dataHeatBal->SurfQRadSWOutIncidentBeam(SurfNum) = - state.dataEnvrn->BeamSolarRad * state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum) * - CosInc; + state.dataEnvrn->BeamSolarRad * + state.dataHeatBal->SurfSunlitFrac(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum) * CosInc; // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently state.dataHeatBal->SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = - state.dataEnvrn->DifSolarRad * state.dataHeatBal->SurfAnisoSkyMult(SurfNum); + state.dataEnvrn->DifSolarRad * state.dataSolarShading->SurfAnisoSkyMult(SurfNum); // Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground state.dataHeatBal->SurfQRadSWOutIncidentGndDiffuse(SurfNum) = state.dataSurface->SurfGndSolarInc(SurfNum); // Incident diffuse solar from beam-to-diffuse reflection from ground @@ -2844,7 +2841,7 @@ void InitSolarHeatGains(EnergyPlusData &state) for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { for (int SurfNum : state.dataHeatBal->Zone(zoneNum).ZoneExtSolarSurfaceList) { // Regular surface - currCosInc(SurfNum) = state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum); + currCosInc(SurfNum) = state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum); currBeamSolar(SurfNum) = state.dataEnvrn->BeamSolarRad; currSkySolarInc(SurfNum) = state.dataSurface->SurfSkySolarInc(SurfNum); currGndSolarInc(SurfNum) = state.dataSurface->SurfGndSolarInc(SurfNum); @@ -2853,12 +2850,12 @@ void InitSolarHeatGains(EnergyPlusData &state) // Report variables for various incident solar quantities // Incident direct (unreflected) beam state.dataHeatBal->SurfQRadSWOutIncidentBeam(SurfNum) = - currBeamSolar(SurfNum) * state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum) * + currBeamSolar(SurfNum) * state.dataHeatBal->SurfSunlitFrac(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum) * currCosInc(SurfNum); // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently state.dataHeatBal->SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = - state.dataEnvrn->DifSolarRad * state.dataHeatBal->SurfAnisoSkyMult(SurfNum); + state.dataEnvrn->DifSolarRad * state.dataSolarShading->SurfAnisoSkyMult(SurfNum); // Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground state.dataHeatBal->SurfQRadSWOutIncidentGndDiffuse(SurfNum) = currGndSolarInc(SurfNum); // Incident diffuse solar from beam-to-diffuse reflection from ground @@ -2901,12 +2898,12 @@ void InitSolarHeatGains(EnergyPlusData &state) // Reconstruct the beam, sky, and ground radiation transmittance of just the TDD:DOME and TDD pipe // by dividing out diffuse solar transmittance of TDD:DIFFUSER - currCosInc(SurfNum) = state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum2); + currCosInc(SurfNum) = state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum2); currBeamSolar(SurfNum) = state.dataEnvrn->BeamSolarRad * TransTDD(state, PipeNum, currCosInc(SurfNum), DataDaylightingDevices::iRadType::SolarBeam) / state.dataConstruction->Construct(ConstrNum).TransDiff; - currSkySolarInc(SurfNum) = state.dataEnvrn->DifSolarRad * state.dataHeatBal->SurfAnisoSkyMult(SurfNum2) * + currSkySolarInc(SurfNum) = state.dataEnvrn->DifSolarRad * state.dataSolarShading->SurfAnisoSkyMult(SurfNum2) * TransTDD(state, PipeNum, currCosInc(SurfNum), DataDaylightingDevices::iRadType::SolarAniso) / state.dataConstruction->Construct(ConstrNum).TransDiff; @@ -2915,7 +2912,7 @@ void InitSolarHeatGains(EnergyPlusData &state) state.dataConstruction->Construct(ConstrNum).TransDiff; // Incident direct (unreflected) beam state.dataHeatBal->SurfQRadSWOutIncidentBeam(SurfNum) = - currBeamSolar(SurfNum) * state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum2) * + currBeamSolar(SurfNum) * state.dataHeatBal->SurfSunlitFrac(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum2) * currCosInc(SurfNum); // NOTE: sunlit and coninc array set to SurfNum2 // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently @@ -2928,14 +2925,14 @@ void InitSolarHeatGains(EnergyPlusData &state) for (int ShelfNum = 1; ShelfNum <= state.dataDaylightingDevicesData->NumOfShelf; ++ShelfNum) { int SurfNum = state.dataDaylightingDevicesData->Shelf(ShelfNum).Window; // Daylighting shelf object number int OutShelfSurf = state.dataDaylightingDevicesData->Shelf(ShelfNum).OutSurf; // Outside daylighting shelf present if > 0 - currCosInc(SurfNum) = state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum); + currCosInc(SurfNum) = state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum); currBeamSolar(SurfNum) = state.dataEnvrn->BeamSolarRad; - currSkySolarInc(SurfNum) = state.dataEnvrn->DifSolarRad * state.dataHeatBal->SurfAnisoSkyMult(SurfNum); + currSkySolarInc(SurfNum) = state.dataEnvrn->DifSolarRad * state.dataSolarShading->SurfAnisoSkyMult(SurfNum); // Shelf diffuse solar radiation Real64 ShelfSolarRad = (state.dataEnvrn->BeamSolarRad * - state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, OutShelfSurf) * - state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, OutShelfSurf) + - state.dataEnvrn->DifSolarRad * state.dataHeatBal->SurfAnisoSkyMult(OutShelfSurf)) * + state.dataHeatBal->SurfSunlitFrac(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, OutShelfSurf) * + state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, OutShelfSurf) + + state.dataEnvrn->DifSolarRad * state.dataSolarShading->SurfAnisoSkyMult(OutShelfSurf)) * state.dataDaylightingDevicesData->Shelf(ShelfNum).OutReflectSol; // Add all reflected solar from the outside shelf to the ground solar @@ -3252,9 +3249,10 @@ void InitSolarHeatGains(EnergyPlusData &state) Real64 BeamFaceInc; // Beam solar incident window plane this time step (W/m2) Real64 DifSolarFaceInc; // Diffuse solar incident on window plane this time step (W/m2) if (FrArea > 0.0 || DivArea > 0.0) { - FracSunLit = state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum); + FracSunLit = state.dataHeatBal->SurfSunlitFrac(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum); BeamFaceInc = state.dataEnvrn->BeamSolarRad * - state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum) * CosInc; + state.dataHeatBal->SurfSunlitFrac(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum) * + CosInc; DifSolarFaceInc = SkySolarInc + GndSolarInc; } if (FracSunLit > 0.0) { @@ -3558,19 +3556,20 @@ void InitIntSolarDistribution(EnergyPlusData &state) for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclosureNum) { - if (state.dataHeatBalSurf->RecDifShortFromZ(enclosureNum)) { + if (state.dataHeatBalSurf->EnclSolRecDifShortFromZ(enclosureNum)) { for (int OtherenclosureNum = 1; OtherenclosureNum <= state.dataViewFactor->NumOfSolarEnclosures; ++OtherenclosureNum) { - if ((OtherenclosureNum != enclosureNum) && (state.dataHeatBalSurf->RecDifShortFromZ(OtherenclosureNum))) { + if ((OtherenclosureNum != enclosureNum) && (state.dataHeatBalSurf->EnclSolRecDifShortFromZ(OtherenclosureNum))) { Real64 sumZoneQLTSW = 0.0; for (int zoneNum : state.dataViewFactor->ZoneSolarInfo(OtherenclosureNum).ZoneNums) { sumZoneQLTSW += state.dataHeatBal->ZoneIntGain(zoneNum).QLTSW; } - state.dataHeatBal->EnclSolQSWRad(enclosureNum) += state.dataHeatBalSurf->FractDifShortZtoZ(enclosureNum, OtherenclosureNum) * - (state.dataHeatBal->EnclSolQD(OtherenclosureNum) + sumZoneQLTSW); + state.dataHeatBal->EnclSolQSWRad(enclosureNum) += + state.dataHeatBalSurf->ZoneFractDifShortZtoZ(enclosureNum, OtherenclosureNum) * + (state.dataHeatBal->EnclSolQD(OtherenclosureNum) + sumZoneQLTSW); state.dataHeatBal->ZoneDifSolFrIntWinsRep(enclosureNum) += - state.dataHeatBalSurf->FractDifShortZtoZ(enclosureNum, OtherenclosureNum) * + state.dataHeatBalSurf->ZoneFractDifShortZtoZ(enclosureNum, OtherenclosureNum) * state.dataHeatBal->EnclSolQD(OtherenclosureNum); state.dataHeatBal->ZoneDifSolFrIntWinsRepEnergy(enclosureNum) = state.dataHeatBal->ZoneDifSolFrIntWinsRep(enclosureNum) * state.dataGlobal->TimeStepZoneSec; @@ -3605,10 +3604,10 @@ void InitIntSolarDistribution(EnergyPlusData &state) for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclosureNum) { if (state.dataHeatBalSurf->InterZoneWindow) { state.dataHeatBal->EnclSolQSWRad(enclosureNum) *= - state.dataHeatBalSurf->FractDifShortZtoZ(enclosureNum, enclosureNum) * state.dataHeatBal->EnclSolVMULT(enclosureNum); + state.dataHeatBalSurf->ZoneFractDifShortZtoZ(enclosureNum, enclosureNum) * state.dataHeatBal->EnclSolVMULT(enclosureNum); // CR 8695, VMULT not based on visible state.dataHeatBal->EnclSolQSWRadLights(enclosureNum) *= - state.dataHeatBalSurf->FractDifShortZtoZ(enclosureNum, enclosureNum) * state.dataHeatBal->EnclSolVMULT(enclosureNum); + state.dataHeatBalSurf->ZoneFractDifShortZtoZ(enclosureNum, enclosureNum) * state.dataHeatBal->EnclSolVMULT(enclosureNum); } else { state.dataHeatBal->EnclSolQSWRad(enclosureNum) *= state.dataHeatBal->EnclSolVMULT(enclosureNum); state.dataHeatBal->EnclSolQSWRadLights(enclosureNum) *= state.dataHeatBal->EnclSolVMULT(enclosureNum); @@ -4333,14 +4332,14 @@ void ComputeDifSolExcZonesWIZWindows(EnergyPlusData &state, int const NumberOfEn auto &Surface(state.dataSurface->Surface); - if (!allocated(state.dataHeatBalSurf->FractDifShortZtoZ)) { - state.dataHeatBalSurf->FractDifShortZtoZ.allocate(NumberOfEnclosures, NumberOfEnclosures); - state.dataHeatBalSurf->RecDifShortFromZ.allocate(NumberOfEnclosures); + if (!allocated(state.dataHeatBalSurf->ZoneFractDifShortZtoZ)) { + state.dataHeatBalSurf->ZoneFractDifShortZtoZ.allocate(NumberOfEnclosures, NumberOfEnclosures); + state.dataHeatBalSurf->EnclSolRecDifShortFromZ.allocate(NumberOfEnclosures); state.dataHeatBalSurfMgr->DiffuseArray.allocate(NumberOfEnclosures, NumberOfEnclosures); } - state.dataHeatBalSurf->RecDifShortFromZ = false; - state.dataHeatBalSurf->FractDifShortZtoZ.to_identity(); + state.dataHeatBalSurf->EnclSolRecDifShortFromZ = false; + state.dataHeatBalSurf->ZoneFractDifShortZtoZ.to_identity(); state.dataHeatBalSurfMgr->DiffuseArray.to_identity(); // IF (.not. ANY(Zone%HasInterZoneWindow)) RETURN ! this caused massive diffs @@ -4357,9 +4356,9 @@ void ComputeDifSolExcZonesWIZWindows(EnergyPlusData &state, int const NumberOfEn if (!state.dataHeatBal->Zone(surfZoneNum).HasInterZoneWindow) continue; int NZ = Surface(SurfNum).SolarEnclIndex; int MZ = Surface(Surface(SurfNum).ExtBoundCond).SolarEnclIndex; - state.dataHeatBalSurf->FractDifShortZtoZ(NZ, MZ) += + state.dataHeatBalSurf->ZoneFractDifShortZtoZ(NZ, MZ) += state.dataConstruction->Construct(Surface(SurfNum).Construction).TransDiff * state.dataHeatBal->EnclSolVMULT(NZ) * Surface(SurfNum).Area; - if (state.dataHeatBal->EnclSolVMULT(NZ) != 0.0) state.dataHeatBalSurf->RecDifShortFromZ(NZ) = true; + if (state.dataHeatBal->EnclSolVMULT(NZ) != 0.0) state.dataHeatBalSurf->EnclSolRecDifShortFromZ(NZ) = true; } // Compute fractions for multiple passes. @@ -4370,24 +4369,24 @@ void ComputeDifSolExcZonesWIZWindows(EnergyPlusData &state, int const NumberOfEn for (int MZ = 1; MZ <= NumberOfEnclosures; ++MZ, ++l, m += NumberOfEnclosures) { if (MZ == NZ) continue; state.dataHeatBalSurfMgr->DiffuseArray[l] = - state.dataHeatBalSurf->FractDifShortZtoZ[l] / - (1.0 - state.dataHeatBalSurf->FractDifShortZtoZ[l] * - state.dataHeatBalSurf->FractDifShortZtoZ[m]); // [ l ] == ( MZ, NZ ), [ m ] == ( NZ, MZ ) - D_d += state.dataHeatBalSurf->FractDifShortZtoZ[m] * state.dataHeatBalSurfMgr->DiffuseArray[l]; + state.dataHeatBalSurf->ZoneFractDifShortZtoZ[l] / + (1.0 - state.dataHeatBalSurf->ZoneFractDifShortZtoZ[l] * + state.dataHeatBalSurf->ZoneFractDifShortZtoZ[m]); // [ l ] == ( MZ, NZ ), [ m ] == ( NZ, MZ ) + D_d += state.dataHeatBalSurf->ZoneFractDifShortZtoZ[m] * state.dataHeatBalSurfMgr->DiffuseArray[l]; } state.dataHeatBalSurfMgr->DiffuseArray[d] += D_d; // [ d ] == ( NZ, NZ ) } - state.dataHeatBalSurf->FractDifShortZtoZ = state.dataHeatBalSurfMgr->DiffuseArray; + state.dataHeatBalSurf->ZoneFractDifShortZtoZ = state.dataHeatBalSurfMgr->DiffuseArray; // added for CR 7999 & 7869 - assert(state.dataHeatBalSurf->FractDifShortZtoZ.isize1() == NumberOfEnclosures); - assert(state.dataHeatBalSurf->FractDifShortZtoZ.isize2() == NumberOfEnclosures); + assert(state.dataHeatBalSurf->ZoneFractDifShortZtoZ.isize1() == NumberOfEnclosures); + assert(state.dataHeatBalSurf->ZoneFractDifShortZtoZ.isize2() == NumberOfEnclosures); l = 0u; for (int NZ = 1; NZ <= NumberOfEnclosures; ++NZ) { for (int MZ = 1; MZ <= NumberOfEnclosures; ++MZ, ++l) { if (MZ == NZ) continue; - if (state.dataHeatBalSurf->FractDifShortZtoZ[l] > 0.0) { // [ l ] == ( MZ, NZ ) - state.dataHeatBalSurf->RecDifShortFromZ(NZ) = true; + if (state.dataHeatBalSurf->ZoneFractDifShortZtoZ[l] > 0.0) { // [ l ] == ( MZ, NZ ) + state.dataHeatBalSurf->EnclSolRecDifShortFromZ(NZ) = true; break; } } @@ -4396,39 +4395,39 @@ void ComputeDifSolExcZonesWIZWindows(EnergyPlusData &state, int const NumberOfEn // Compute fractions for multiple zones. for (int IZ = 1; IZ <= NumberOfEnclosures; ++IZ) { - if (!state.dataHeatBalSurf->RecDifShortFromZ(IZ)) continue; + if (!state.dataHeatBalSurf->EnclSolRecDifShortFromZ(IZ)) continue; for (int JZ = 1; JZ <= NumberOfEnclosures; ++JZ) { - if (!state.dataHeatBalSurf->RecDifShortFromZ(JZ)) continue; + if (!state.dataHeatBalSurf->EnclSolRecDifShortFromZ(JZ)) continue; if (IZ == JZ) continue; if (state.dataHeatBalSurfMgr->DiffuseArray(IZ, JZ) == 0.0) continue; for (int KZ = 1; KZ <= NumberOfEnclosures; ++KZ) { - if (!state.dataHeatBalSurf->RecDifShortFromZ(KZ)) continue; + if (!state.dataHeatBalSurf->EnclSolRecDifShortFromZ(KZ)) continue; if (IZ == KZ) continue; if (JZ == KZ) continue; if (state.dataHeatBalSurfMgr->DiffuseArray(JZ, KZ) == 0.0) continue; - state.dataHeatBalSurf->FractDifShortZtoZ(IZ, KZ) += + state.dataHeatBalSurf->ZoneFractDifShortZtoZ(IZ, KZ) += state.dataHeatBalSurfMgr->DiffuseArray(JZ, KZ) * state.dataHeatBalSurfMgr->DiffuseArray(IZ, JZ); for (int LZ = 1; LZ <= NumberOfEnclosures; ++LZ) { - if (!state.dataHeatBalSurf->RecDifShortFromZ(LZ)) continue; + if (!state.dataHeatBalSurf->EnclSolRecDifShortFromZ(LZ)) continue; if (IZ == LZ) continue; if (JZ == LZ) continue; if (KZ == LZ) continue; if (state.dataHeatBalSurfMgr->DiffuseArray(KZ, LZ) == 0.0) continue; - state.dataHeatBalSurf->FractDifShortZtoZ(IZ, LZ) += state.dataHeatBalSurfMgr->DiffuseArray(KZ, LZ) * - state.dataHeatBalSurfMgr->DiffuseArray(JZ, KZ) * - state.dataHeatBalSurfMgr->DiffuseArray(IZ, JZ); + state.dataHeatBalSurf->ZoneFractDifShortZtoZ(IZ, LZ) += state.dataHeatBalSurfMgr->DiffuseArray(KZ, LZ) * + state.dataHeatBalSurfMgr->DiffuseArray(JZ, KZ) * + state.dataHeatBalSurfMgr->DiffuseArray(IZ, JZ); for (int MZ = 1; MZ <= NumberOfEnclosures; ++MZ) { - if (!state.dataHeatBalSurf->RecDifShortFromZ(MZ)) continue; + if (!state.dataHeatBalSurf->EnclSolRecDifShortFromZ(MZ)) continue; if (IZ == MZ) continue; if (JZ == MZ) continue; if (KZ == MZ) continue; if (LZ == MZ) continue; if (state.dataHeatBalSurfMgr->DiffuseArray(LZ, MZ) == 0.0) continue; - state.dataHeatBalSurf->FractDifShortZtoZ(IZ, MZ) += + state.dataHeatBalSurf->ZoneFractDifShortZtoZ(IZ, MZ) += state.dataHeatBalSurfMgr->DiffuseArray(LZ, MZ) * state.dataHeatBalSurfMgr->DiffuseArray(KZ, LZ) * state.dataHeatBalSurfMgr->DiffuseArray(JZ, KZ) * state.dataHeatBalSurfMgr->DiffuseArray(IZ, JZ); } // MZ Loop @@ -4894,8 +4893,8 @@ void UpdateThermalHistories(EnergyPlusData &state) // Set current inside flux: Real64 const QH_12 = state.dataHeatBalSurf->QH[l21] = - state.dataHeatBalSurf->TH[l11] * construct.CTFCross(0) - state.dataHeatBalSurf->TempSurfIn(SurfNum) * construct.CTFInside(0) + - state.dataHeatBalSurf->CTFConstInPart(SurfNum); // Heat source/sink term for radiant systems + state.dataHeatBalSurf->TH[l11] * construct.CTFCross(0) - state.dataHeatBalSurf->SurfTempIn(SurfNum) * construct.CTFInside(0) + + state.dataHeatBalSurf->SurfCTFConstInPart(SurfNum); // Heat source/sink term for radiant systems // Only HT opaq surfaces are evaluated, previous if (surface.Class == SurfaceClass::Floor || surface.Class == SurfaceClass::Wall || // surface.Class == SurfaceClass::IntMass || surface.Class == SurfaceClass::Roof || surface.Class == SurfaceClass::Door) checks are // reduncant. @@ -4920,12 +4919,12 @@ void UpdateThermalHistories(EnergyPlusData &state) // Update the temperature at the source/sink location (if one is present) if (construct.SourceSinkPresent) { - state.dataHeatBalSurf->TempSource(SurfNum) = state.dataHeatBalSurf->TsrcHist(SurfNum, 1) = + state.dataHeatBalSurf->SurfTempSource(SurfNum) = state.dataHeatBalSurf->TsrcHist(SurfNum, 1) = state.dataHeatBalSurf->TH[l11] * construct.CTFTSourceOut(0) + - state.dataHeatBalSurf->TempSurfIn(SurfNum) * construct.CTFTSourceIn(0) + + state.dataHeatBalSurf->SurfTempIn(SurfNum) * construct.CTFTSourceIn(0) + state.dataHeatBalSurf->QsrcHist(SurfNum, 1) * construct.CTFTSourceQ(0) + state.dataHeatBalFanSys->CTFTsrcConstPart(SurfNum); - state.dataHeatBalSurf->TempUserLoc(SurfNum) = state.dataHeatBalSurf->TuserHist(SurfNum, 1) = - state.dataHeatBalSurf->TH[l11] * construct.CTFTUserOut(0) + state.dataHeatBalSurf->TempSurfIn(SurfNum) * construct.CTFTUserIn(0) + + state.dataHeatBalSurf->SurfTempUserLoc(SurfNum) = state.dataHeatBalSurf->TuserHist(SurfNum, 1) = + state.dataHeatBalSurf->TH[l11] * construct.CTFTUserOut(0) + state.dataHeatBalSurf->SurfTempIn(SurfNum) * construct.CTFTUserIn(0) + state.dataHeatBalSurf->QsrcHist(SurfNum, 1) * construct.CTFTUserSource(0) + state.dataHeatBalFanSys->CTFTuserConstPart(SurfNum); } @@ -4934,18 +4933,16 @@ void UpdateThermalHistories(EnergyPlusData &state) // Set current outside flux: if (construct.SourceSinkPresent) { state.dataHeatBalSurf->QH[l11] = state.dataHeatBalSurf->TH[l11] * construct.CTFOutside(0) - - state.dataHeatBalSurf->TempSurfIn(SurfNum) * construct.CTFCross(0) + + state.dataHeatBalSurf->SurfTempIn(SurfNum) * construct.CTFCross(0) + state.dataHeatBalSurf->QsrcHist(SurfNum, 1) * construct.CTFSourceOut(0) + - state.dataHeatBalSurf->CTFConstOutPart(SurfNum); // Heat source/sink term for radiant systems + state.dataHeatBalSurf->SurfCTFConstOutPart(SurfNum); // Heat source/sink term for radiant systems } else { state.dataHeatBalSurf->QH[l11] = state.dataHeatBalSurf->TH[l11] * construct.CTFOutside(0) - - state.dataHeatBalSurf->TempSurfIn(SurfNum) * construct.CTFCross(0) + - state.dataHeatBalSurf->CTFConstOutPart(SurfNum); + state.dataHeatBalSurf->SurfTempIn(SurfNum) * construct.CTFCross(0) + + state.dataHeatBalSurf->SurfCTFConstOutPart(SurfNum); } - state.dataHeatBalSurf->SurfOpaqOutsideFaceConductionFlux(SurfNum) = - -state.dataHeatBalSurf->QH[l11]; // switch sign for balance at outside face - state.dataHeatBalSurf->SurfOpaqOutsideFaceConduction(SurfNum) = - surface.Area * state.dataHeatBalSurf->SurfOpaqOutsideFaceConductionFlux(SurfNum); + state.dataHeatBalSurf->SurfOpaqOutFaceCondFlux(SurfNum) = -state.dataHeatBalSurf->QH[l11]; // switch sign for balance at outside face + state.dataHeatBalSurf->SurfOpaqOutFaceCond(SurfNum) = surface.Area * state.dataHeatBalSurf->SurfOpaqOutFaceCondFlux(SurfNum); } } // ...end of loop over all (heat transfer) surfaces... @@ -4959,9 +4956,9 @@ void UpdateThermalHistories(EnergyPlusData &state) if ((Surface(SurfNum).HeatTransferAlgorithm != DataSurfaces::iHeatTransferModel::CTF) && (Surface(SurfNum).HeatTransferAlgorithm != DataSurfaces::iHeatTransferModel::EMPD)) continue; - if (state.dataHeatBalSurf->SUMH(SurfNum) == 0) { // First time step in a block for a surface, update arrays + if (state.dataHeatBalSurf->SurfCurrNumHist(SurfNum) == 0) { // First time step in a block for a surface, update arrays state.dataHeatBalSurfMgr->TempExt1(SurfNum) = state.dataHeatBalSurf->TH[l11]; - state.dataHeatBalSurfMgr->TempInt1(SurfNum) = state.dataHeatBalSurf->TempSurfIn(SurfNum); + state.dataHeatBalSurfMgr->TempInt1(SurfNum) = state.dataHeatBalSurf->SurfTempIn(SurfNum); state.dataHeatBalSurfMgr->QExt1(SurfNum) = state.dataHeatBalSurf->QH[l11]; state.dataHeatBalSurfMgr->QInt1(SurfNum) = state.dataHeatBalSurf->QH[l21]; if (state.dataHeatBal->AnyInternalHeatSourceInInput) { @@ -4990,12 +4987,12 @@ void UpdateThermalHistories(EnergyPlusData &state) int const ConstrNum(surface.Construction); auto const &construct(state.dataConstruction->Construct(ConstrNum)); - ++state.dataHeatBalSurf->SUMH(SurfNum); - state.dataHeatBalSurfMgr->SumTime(SurfNum) = double(state.dataHeatBalSurf->SUMH(SurfNum)) * state.dataGlobal->TimeStepZone; + ++state.dataHeatBalSurf->SurfCurrNumHist(SurfNum); + state.dataHeatBalSurfMgr->SumTime(SurfNum) = double(state.dataHeatBalSurf->SurfCurrNumHist(SurfNum)) * state.dataGlobal->TimeStepZone; - if (state.dataHeatBalSurf->SUMH(SurfNum) == construct.NumHistories) { + if (state.dataHeatBalSurf->SurfCurrNumHist(SurfNum) == construct.NumHistories) { - state.dataHeatBalSurf->SUMH(SurfNum) = 0; + state.dataHeatBalSurf->SurfCurrNumHist(SurfNum) = 0; if (construct.NumCTFTerms > 1) { int const numCTFTerms(construct.NumCTFTerms); @@ -5173,7 +5170,7 @@ void CalculateZoneMRT(EnergyPlusData &state, Optional_int_const ZoneToResimulate if (present(ZoneToResimulate) && (ZoneNum != ZoneToResimulate)) continue; SumAET = 0.0; for (SurfNum = state.dataHeatBal->Zone(ZoneNum).HTSurfaceFirst; SurfNum <= state.dataHeatBal->Zone(ZoneNum).HTSurfaceLast; ++SurfNum) { - SumAET += state.dataHeatBalSurfMgr->SurfaceAE(SurfNum) * state.dataHeatBalSurf->TempSurfIn(SurfNum); + SumAET += state.dataHeatBalSurfMgr->SurfaceAE(SurfNum) * state.dataHeatBalSurf->SurfTempIn(SurfNum); } if (state.dataHeatBalSurfMgr->ZoneAESum(ZoneNum) > 0.01) { state.dataHeatBal->ZoneMRT(ZoneNum) = SumAET / state.dataHeatBalSurfMgr->ZoneAESum(ZoneNum); @@ -5648,47 +5645,46 @@ void ReportSurfaceHeatBalance(EnergyPlusData &state) } // outside face conduction updates - state.dataHeatBalSurf->SurfOpaqOutsideFaceConductionEnergy(SurfNum) = - state.dataHeatBalSurf->SurfOpaqOutsideFaceConduction(SurfNum) * state.dataGlobal->TimeStepZoneSec; - state.dataHeatBal->ZoneOpaqSurfExtFaceCond(ZoneNum) += state.dataHeatBalSurf->SurfOpaqOutsideFaceConduction(SurfNum); + state.dataHeatBalSurf->SurfOpaqOutFaceCondEnergy(SurfNum) = + state.dataHeatBalSurf->SurfOpaqOutFaceCond(SurfNum) * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBal->ZoneOpaqSurfExtFaceCond(ZoneNum) += state.dataHeatBalSurf->SurfOpaqOutFaceCond(SurfNum); state.dataHeatBalSurf->SurfOpaqExtFaceCondGainRep(SurfNum) = 0.0; state.dataHeatBalSurf->SurfOpaqExtFaceCondLossRep(SurfNum) = 0.0; - if (state.dataHeatBalSurf->SurfOpaqOutsideFaceConduction(SurfNum) >= 0.0) { - state.dataHeatBalSurf->SurfOpaqExtFaceCondGainRep(SurfNum) = state.dataHeatBalSurf->SurfOpaqOutsideFaceConduction(SurfNum); + if (state.dataHeatBalSurf->SurfOpaqOutFaceCond(SurfNum) >= 0.0) { + state.dataHeatBalSurf->SurfOpaqExtFaceCondGainRep(SurfNum) = state.dataHeatBalSurf->SurfOpaqOutFaceCond(SurfNum); } else { - state.dataHeatBalSurf->SurfOpaqExtFaceCondLossRep(SurfNum) = -state.dataHeatBalSurf->SurfOpaqOutsideFaceConduction(SurfNum); + state.dataHeatBalSurf->SurfOpaqExtFaceCondLossRep(SurfNum) = -state.dataHeatBalSurf->SurfOpaqOutFaceCond(SurfNum); } // do average surface conduction updates - state.dataHeatBalSurf->SurfOpaqAvgFaceConduction(SurfNum) = - (state.dataHeatBalSurf->SurfOpaqInsFaceConduction(SurfNum) - state.dataHeatBalSurf->SurfOpaqOutsideFaceConduction(SurfNum)) / 2.0; - state.dataHeatBalSurf->SurfOpaqAvgFaceConductionFlux(SurfNum) = - (state.dataHeatBalSurf->SurfOpaqInsFaceConductionFlux(SurfNum) - state.dataHeatBalSurf->SurfOpaqOutsideFaceConductionFlux(SurfNum)) / - 2.0; - state.dataHeatBalSurf->SurfOpaqAvgFaceConductionEnergy(SurfNum) = - state.dataHeatBalSurf->SurfOpaqAvgFaceConduction(SurfNum) * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBalSurf->SurfOpaqAvgFaceCond(SurfNum) = + (state.dataHeatBalSurf->SurfOpaqInsFaceConduction(SurfNum) - state.dataHeatBalSurf->SurfOpaqOutFaceCond(SurfNum)) / 2.0; + state.dataHeatBalSurf->SurfOpaqAvgFaceCondFlux(SurfNum) = + (state.dataHeatBalSurf->SurfOpaqInsFaceConductionFlux(SurfNum) - state.dataHeatBalSurf->SurfOpaqOutFaceCondFlux(SurfNum)) / 2.0; + state.dataHeatBalSurf->SurfOpaqAvgFaceCondEnergy(SurfNum) = + state.dataHeatBalSurf->SurfOpaqAvgFaceCond(SurfNum) * state.dataGlobal->TimeStepZoneSec; state.dataHeatBalSurf->SurfOpaqAvgFaceCondGainRep(SurfNum) = 0.0; state.dataHeatBalSurf->SurfOpaqAvgFaceCondLossRep(SurfNum) = 0.0; - if (state.dataHeatBalSurf->SurfOpaqAvgFaceConduction(SurfNum) >= 0.0) { - state.dataHeatBalSurf->SurfOpaqAvgFaceCondGainRep(SurfNum) = state.dataHeatBalSurf->SurfOpaqAvgFaceConduction(SurfNum); + if (state.dataHeatBalSurf->SurfOpaqAvgFaceCond(SurfNum) >= 0.0) { + state.dataHeatBalSurf->SurfOpaqAvgFaceCondGainRep(SurfNum) = state.dataHeatBalSurf->SurfOpaqAvgFaceCond(SurfNum); } else { - state.dataHeatBalSurf->SurfOpaqAvgFaceCondLossRep(SurfNum) = -state.dataHeatBalSurf->SurfOpaqAvgFaceConduction(SurfNum); + state.dataHeatBalSurf->SurfOpaqAvgFaceCondLossRep(SurfNum) = -state.dataHeatBalSurf->SurfOpaqAvgFaceCond(SurfNum); } // do surface storage rate updates - state.dataHeatBalSurf->SurfOpaqStorageConductionFlux(SurfNum) = - -(state.dataHeatBalSurf->SurfOpaqInsFaceConductionFlux(SurfNum) + state.dataHeatBalSurf->SurfOpaqOutsideFaceConductionFlux(SurfNum)); - state.dataHeatBalSurf->SurfOpaqStorageConduction(SurfNum) = - -(state.dataHeatBalSurf->SurfOpaqInsFaceConduction(SurfNum) + state.dataHeatBalSurf->SurfOpaqOutsideFaceConduction(SurfNum)); - state.dataHeatBalSurf->SurfOpaqStorageConductionEnergy(SurfNum) = - state.dataHeatBalSurf->SurfOpaqStorageConduction(SurfNum) * state.dataGlobal->TimeStepZoneSec; + state.dataHeatBalSurf->SurfOpaqStorageCondFlux(SurfNum) = + -(state.dataHeatBalSurf->SurfOpaqInsFaceConductionFlux(SurfNum) + state.dataHeatBalSurf->SurfOpaqOutFaceCondFlux(SurfNum)); + state.dataHeatBalSurf->SurfOpaqStorageCond(SurfNum) = + -(state.dataHeatBalSurf->SurfOpaqInsFaceConduction(SurfNum) + state.dataHeatBalSurf->SurfOpaqOutFaceCond(SurfNum)); + state.dataHeatBalSurf->SurfOpaqStorageCondEnergy(SurfNum) = + state.dataHeatBalSurf->SurfOpaqStorageCond(SurfNum) * state.dataGlobal->TimeStepZoneSec; state.dataHeatBalSurf->SurfOpaqStorageGainRep(SurfNum) = 0.0; state.dataHeatBalSurf->SurfOpaqStorageCondLossRep(SurfNum) = 0.0; - if (state.dataHeatBalSurf->SurfOpaqStorageConduction(SurfNum) >= 0.0) { - state.dataHeatBalSurf->SurfOpaqStorageGainRep(SurfNum) = state.dataHeatBalSurf->SurfOpaqStorageConduction(SurfNum); + if (state.dataHeatBalSurf->SurfOpaqStorageCond(SurfNum) >= 0.0) { + state.dataHeatBalSurf->SurfOpaqStorageGainRep(SurfNum) = state.dataHeatBalSurf->SurfOpaqStorageCond(SurfNum); } else { - state.dataHeatBalSurf->SurfOpaqStorageCondLossRep(SurfNum) = -state.dataHeatBalSurf->SurfOpaqStorageConduction(SurfNum); + state.dataHeatBalSurf->SurfOpaqStorageCondLossRep(SurfNum) = -state.dataHeatBalSurf->SurfOpaqStorageCond(SurfNum); } } // opaque heat transfer surfaces. @@ -5716,10 +5712,10 @@ void ReportSurfaceHeatBalance(EnergyPlusData &state) void ReportIntMovInsInsideSurfTemp(EnergyPlusData &state) { - state.dataHeatBalSurf->TempSurfInMovInsRep = state.dataHeatBalSurf->TempSurfIn; + state.dataHeatBalSurf->SurfTempInMovInsRep = state.dataHeatBalSurf->SurfTempIn; for (int SurfNum : state.dataHeatBalSurf->SurfMovInsulIndexList) { if (state.dataHeatBalSurf->SurfMovInsulIntPresent(SurfNum)) { - state.dataHeatBalSurf->TempSurfInMovInsRep(SurfNum) = state.dataHeatBalSurf->TempSurfInTmp(SurfNum); + state.dataHeatBalSurf->SurfTempInMovInsRep(SurfNum) = state.dataHeatBalSurf->SurfTempInTmp(SurfNum); } } } @@ -5829,7 +5825,7 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, for (int SurfNum = state.dataHeatBal->Zone(zoneNum).HTSurfaceFirst; SurfNum <= state.dataHeatBal->Zone(zoneNum).HTSurfaceLast; ++SurfNum) { if (Surface(SurfNum).Class == SurfaceClass::Window) continue; if (present(ZoneToResimulate)) { - if ((zoneNum != ZoneToResimulate) && (state.dataSurface->AdjacentZoneToSurface(SurfNum) != ZoneToResimulate)) { + if ((zoneNum != ZoneToResimulate) && (state.dataSurface->SurfAdjacentZone(SurfNum) != ZoneToResimulate)) { continue; // skip surfaces that are not associated with this zone } } @@ -5843,10 +5839,10 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, Real64 HSky = 0.0; // "Convection" coefficient from sky to surface Real64 HGround = 0.0; // "Convection" coefficient from ground to surface Real64 HAir = 0.0; // "Convection" coefficient from air to surface (radiation) - state.dataHeatBalSurf->HcExtSurf(SurfNum) = 0.0; - state.dataHeatBalSurf->HAirExtSurf(SurfNum) = 0.0; - state.dataHeatBalSurf->HSkyExtSurf(SurfNum) = 0.0; - state.dataHeatBalSurf->HGrdExtSurf(SurfNum) = 0.0; + state.dataHeatBalSurf->SurfHcExt(SurfNum) = 0.0; + state.dataHeatBalSurf->SurfHAirExt(SurfNum) = 0.0; + state.dataHeatBalSurf->SurfHSkyExt(SurfNum) = 0.0; + state.dataHeatBalSurf->SurfHGrdExt(SurfNum) = 0.0; state.dataHeatBalSurf->SurfQRadLWOutSrdSurfs(SurfNum) = 0.0; // Calculate heat extract due to additional heat flux source term as the surface boundary condition @@ -6045,7 +6041,7 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, state.dataSurface->OSC(OPtr).ConstTemp = GetCurrentScheduleValue(state, state.dataSurface->OSC(OPtr).ConstTempScheduleIndex); } - state.dataHeatBalSurf->HcExtSurf(SurfNum) = state.dataSurface->OSC(OPtr).SurfFilmCoef; + state.dataHeatBalSurf->SurfHcExt(SurfNum) = state.dataSurface->OSC(OPtr).SurfFilmCoef; state.dataSurface->OSC(OPtr).OSCTempCalc = (state.dataSurface->OSC(OPtr).ZoneAirTempCoef * state.dataHeatBalFanSys->MAT(zoneNum) + @@ -6076,7 +6072,7 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, state.dataMstBal->TempOutsideAirFD(SurfNum) = TempExt; state.dataMstBal->RhoVaporAirOut(SurfNum) = PsyRhovFnTdbWPb(state.dataMstBal->TempOutsideAirFD(SurfNum), state.dataEnvrn->OutHumRat, state.dataEnvrn->OutBaroPress); - state.dataMstBal->HConvExtFD(SurfNum) = state.dataHeatBalSurf->HcExtSurf(SurfNum); + state.dataMstBal->HConvExtFD(SurfNum) = state.dataHeatBalSurf->SurfHcExt(SurfNum); state.dataMstBal->HMassConvExtFD(SurfNum) = state.dataMstBal->HConvExtFD(SurfNum) / ((PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, @@ -6088,9 +6084,9 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, RoutineNameOtherSideCoefCalcExt)) + state.dataMstBal->RhoVaporAirOut(SurfNum)) * PsyCpAirFnW(state.dataEnvrn->OutHumRat)); - state.dataMstBal->HSkyFD(SurfNum) = state.dataHeatBalSurf->HSkyExtSurf(SurfNum); - state.dataMstBal->HGrndFD(SurfNum) = state.dataHeatBalSurf->HGrdExtSurf(SurfNum); - state.dataMstBal->HAirFD(SurfNum) = state.dataHeatBalSurf->HAirExtSurf(SurfNum); + state.dataMstBal->HSkyFD(SurfNum) = state.dataHeatBalSurf->SurfHSkyExt(SurfNum); + state.dataMstBal->HGrndFD(SurfNum) = state.dataHeatBalSurf->SurfHGrdExt(SurfNum); + state.dataMstBal->HAirFD(SurfNum) = state.dataHeatBalSurf->SurfHAirExt(SurfNum); } // Call the outside surface temp calculation and pass the necessary terms @@ -6118,7 +6114,7 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, state.dataSurface->OSCM(OPtr).TRad = state.dataSurface->OSCM(OPtr).EMSOverrideTRadValue; if (state.dataSurface->OSCM(OPtr).EMSOverrideOnHrad) state.dataSurface->OSCM(OPtr).HRad = state.dataSurface->OSCM(OPtr).EMSOverrideHradValue; - state.dataHeatBalSurf->HcExtSurf(SurfNum) = state.dataSurface->OSCM(OPtr).HConv; + state.dataHeatBalSurf->SurfHcExt(SurfNum) = state.dataSurface->OSCM(OPtr).HConv; Real64 TempExt = state.dataSurface->OSCM(OPtr).TConv; @@ -6132,7 +6128,7 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, state.dataMstBal->TempOutsideAirFD(SurfNum) = TempExt; state.dataMstBal->RhoVaporAirOut(SurfNum) = PsyRhovFnTdbWPb(state.dataMstBal->TempOutsideAirFD(SurfNum), state.dataEnvrn->OutHumRat, state.dataEnvrn->OutBaroPress); - state.dataMstBal->HConvExtFD(SurfNum) = state.dataHeatBalSurf->HcExtSurf(SurfNum); + state.dataMstBal->HConvExtFD(SurfNum) = state.dataHeatBalSurf->SurfHcExt(SurfNum); state.dataMstBal->HMassConvExtFD(SurfNum) = state.dataMstBal->HConvExtFD(SurfNum) / ((PsyRhoAirFnPbTdbW( @@ -6198,17 +6194,17 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, RoughSurf, AbsThermSurf, state.dataHeatBalSurf->TH(1, 1, SurfNum), - state.dataHeatBalSurf->HcExtSurf(SurfNum), - state.dataHeatBalSurf->HSkyExtSurf(SurfNum), - state.dataHeatBalSurf->HGrdExtSurf(SurfNum), - state.dataHeatBalSurf->HAirExtSurf(SurfNum)); + state.dataHeatBalSurf->SurfHcExt(SurfNum), + state.dataHeatBalSurf->SurfHSkyExt(SurfNum), + state.dataHeatBalSurf->SurfHGrdExt(SurfNum), + state.dataHeatBalSurf->SurfHAirExt(SurfNum)); if (state.dataEnvrn->IsRain) { // Raining: since wind exposed, outside surface gets wet - if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) <= 0) { // Reset HcExtSurf because of wetness - state.dataHeatBalSurf->HcExtSurf(SurfNum) = 1000.0; + if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) <= 0) { // Reset SurfHcExt because of wetness + state.dataHeatBalSurf->SurfHcExt(SurfNum) = 1000.0; } else { // User set - state.dataHeatBalSurf->HcExtSurf(SurfNum) = SetExtConvectionCoeff(state, SurfNum); + state.dataHeatBalSurf->SurfHcExt(SurfNum) = SetExtConvectionCoeff(state, SurfNum); } TempExt = state.dataSurface->SurfOutWetBulbTemp(SurfNum); @@ -6219,7 +6215,7 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, state.dataMstBal->TempOutsideAirFD(SurfNum) = TempExt; state.dataMstBal->RhoVaporAirOut(SurfNum) = PsyRhovFnTdbRh(state, state.dataMstBal->TempOutsideAirFD(SurfNum), 1.0, HBSurfManRainHAMT); - state.dataMstBal->HConvExtFD(SurfNum) = state.dataHeatBalSurf->HcExtSurf(SurfNum); + state.dataMstBal->HConvExtFD(SurfNum) = state.dataHeatBalSurf->SurfHcExt(SurfNum); state.dataMstBal->HMassConvExtFD(SurfNum) = state.dataMstBal->HConvExtFD(SurfNum) / ((PsyRhoAirFnPbTdbW(state, @@ -6232,16 +6228,16 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, RoutineNameExtEnvWetSurf)) + state.dataMstBal->RhoVaporAirOut(SurfNum)) * PsyCpAirFnW(state.dataEnvrn->OutHumRat)); - state.dataMstBal->HSkyFD(SurfNum) = state.dataHeatBalSurf->HSkyExtSurf(SurfNum); - state.dataMstBal->HGrndFD(SurfNum) = state.dataHeatBalSurf->HGrdExtSurf(SurfNum); - state.dataMstBal->HAirFD(SurfNum) = state.dataHeatBalSurf->HAirExtSurf(SurfNum); + state.dataMstBal->HSkyFD(SurfNum) = state.dataHeatBalSurf->SurfHSkyExt(SurfNum); + state.dataMstBal->HGrndFD(SurfNum) = state.dataHeatBalSurf->SurfHGrdExt(SurfNum); + state.dataMstBal->HAirFD(SurfNum) = state.dataHeatBalSurf->SurfHAirExt(SurfNum); } // end HAMT if (Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::CondFD) { // Set variables used in the FD moisture balance state.dataMstBal->TempOutsideAirFD(SurfNum) = TempExt; state.dataMstBal->RhoVaporAirOut(SurfNum) = PsyRhovFnTdbRhLBnd0C(state.dataMstBal->TempOutsideAirFD(SurfNum), 1.0); - state.dataMstBal->HConvExtFD(SurfNum) = state.dataHeatBalSurf->HcExtSurf(SurfNum); + state.dataMstBal->HConvExtFD(SurfNum) = state.dataHeatBalSurf->SurfHcExt(SurfNum); state.dataMstBal->HMassConvExtFD(SurfNum) = state.dataMstBal->HConvExtFD(SurfNum) / ((PsyRhoAirFnPbTdbW(state, @@ -6254,9 +6250,9 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, RoutineNameExtEnvWetSurf)) + state.dataMstBal->RhoVaporAirOut(SurfNum)) * PsyCpAirFnW(state.dataEnvrn->OutHumRat)); - state.dataMstBal->HSkyFD(SurfNum) = state.dataHeatBalSurf->HSkyExtSurf(SurfNum); - state.dataMstBal->HGrndFD(SurfNum) = state.dataHeatBalSurf->HGrdExtSurf(SurfNum); - state.dataMstBal->HAirFD(SurfNum) = state.dataHeatBalSurf->HAirExtSurf(SurfNum); + state.dataMstBal->HSkyFD(SurfNum) = state.dataHeatBalSurf->SurfHSkyExt(SurfNum); + state.dataMstBal->HGrndFD(SurfNum) = state.dataHeatBalSurf->SurfHGrdExt(SurfNum); + state.dataMstBal->HAirFD(SurfNum) = state.dataHeatBalSurf->SurfHAirExt(SurfNum); } } else { // Surface is dry, use the normal correlation @@ -6269,7 +6265,7 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, state.dataMstBal->TempOutsideAirFD(SurfNum) = TempExt; state.dataMstBal->RhoVaporAirOut(SurfNum) = PsyRhovFnTdbWPb( state.dataMstBal->TempOutsideAirFD(SurfNum), state.dataEnvrn->OutHumRat, state.dataEnvrn->OutBaroPress); - state.dataMstBal->HConvExtFD(SurfNum) = state.dataHeatBalSurf->HcExtSurf(SurfNum); + state.dataMstBal->HConvExtFD(SurfNum) = state.dataHeatBalSurf->SurfHcExt(SurfNum); state.dataMstBal->HMassConvExtFD(SurfNum) = state.dataMstBal->HConvExtFD(SurfNum) / ((PsyRhoAirFnPbTdbW(state, @@ -6286,9 +6282,9 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, // Local temporary saturated vapor density for checking Real64 RhoVaporSat = PsyRhovFnTdbRh(state, state.dataMstBal->TempOutsideAirFD(SurfNum), 1.0, HBSurfManDrySurfCondFD); if (state.dataMstBal->RhoVaporAirOut(SurfNum) > RhoVaporSat) state.dataMstBal->RhoVaporAirOut(SurfNum) = RhoVaporSat; - state.dataMstBal->HSkyFD(SurfNum) = state.dataHeatBalSurf->HSkyExtSurf(SurfNum); - state.dataMstBal->HGrndFD(SurfNum) = state.dataHeatBalSurf->HGrdExtSurf(SurfNum); - state.dataMstBal->HAirFD(SurfNum) = state.dataHeatBalSurf->HAirExtSurf(SurfNum); + state.dataMstBal->HSkyFD(SurfNum) = state.dataHeatBalSurf->SurfHSkyExt(SurfNum); + state.dataMstBal->HGrndFD(SurfNum) = state.dataHeatBalSurf->SurfHGrdExt(SurfNum); + state.dataMstBal->HAirFD(SurfNum) = state.dataHeatBalSurf->SurfHAirExt(SurfNum); } } @@ -6301,10 +6297,10 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, RoughSurf, AbsThermSurf, state.dataHeatBalSurf->TH(1, 1, SurfNum), - state.dataHeatBalSurf->HcExtSurf(SurfNum), - state.dataHeatBalSurf->HSkyExtSurf(SurfNum), - state.dataHeatBalSurf->HGrdExtSurf(SurfNum), - state.dataHeatBalSurf->HAirExtSurf(SurfNum)); + state.dataHeatBalSurf->SurfHcExt(SurfNum), + state.dataHeatBalSurf->SurfHSkyExt(SurfNum), + state.dataHeatBalSurf->SurfHGrdExt(SurfNum), + state.dataHeatBalSurf->SurfHAirExt(SurfNum)); TempExt = state.dataSurface->SurfOutDryBulbTemp(SurfNum); @@ -6314,7 +6310,7 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, state.dataMstBal->TempOutsideAirFD(SurfNum) = TempExt; state.dataMstBal->RhoVaporAirOut(SurfNum) = PsyRhovFnTdbWPb( state.dataMstBal->TempOutsideAirFD(SurfNum), state.dataEnvrn->OutHumRat, state.dataEnvrn->OutBaroPress); - state.dataMstBal->HConvExtFD(SurfNum) = state.dataHeatBalSurf->HcExtSurf(SurfNum); + state.dataMstBal->HConvExtFD(SurfNum) = state.dataHeatBalSurf->SurfHcExt(SurfNum); state.dataMstBal->HMassConvExtFD(SurfNum) = state.dataMstBal->HConvExtFD(SurfNum) / ((PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, @@ -6326,9 +6322,9 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, RoutineNameNoWind)) + state.dataMstBal->RhoVaporAirOut(SurfNum)) * PsyCpAirFnW(state.dataEnvrn->OutHumRat)); - state.dataMstBal->HSkyFD(SurfNum) = state.dataHeatBalSurf->HSkyExtSurf(SurfNum); - state.dataMstBal->HGrndFD(SurfNum) = state.dataHeatBalSurf->HGrdExtSurf(SurfNum); - state.dataMstBal->HAirFD(SurfNum) = state.dataHeatBalSurf->HAirExtSurf(SurfNum); + state.dataMstBal->HSkyFD(SurfNum) = state.dataHeatBalSurf->SurfHSkyExt(SurfNum); + state.dataMstBal->HGrndFD(SurfNum) = state.dataHeatBalSurf->SurfHGrdExt(SurfNum); + state.dataMstBal->HAirFD(SurfNum) = state.dataHeatBalSurf->SurfHAirExt(SurfNum); } } // Calculate LWR from surrounding surfaces if defined for an exterior surface @@ -6368,25 +6364,25 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, RoughSurf, AbsThermSurf, state.dataHeatBalSurf->TH(1, 1, SurfNum), - state.dataHeatBalSurf->HcExtSurf(SurfNum), - state.dataHeatBalSurf->HSkyExtSurf(SurfNum), - state.dataHeatBalSurf->HGrdExtSurf(SurfNum), - state.dataHeatBalSurf->HAirExtSurf(SurfNum)); + state.dataHeatBalSurf->SurfHcExt(SurfNum), + state.dataHeatBalSurf->SurfHSkyExt(SurfNum), + state.dataHeatBalSurf->SurfHGrdExt(SurfNum), + state.dataHeatBalSurf->SurfHAirExt(SurfNum)); } else { // for interior or other zone surfaces if (Surface(SurfNum).ExtBoundCond == SurfNum) { // Regular partition/internal mass - state.dataHeatBalSurf->TH(1, 1, SurfNum) = state.dataHeatBalSurf->TempSurfIn(SurfNum); + state.dataHeatBalSurf->TH(1, 1, SurfNum) = state.dataHeatBalSurf->SurfTempIn(SurfNum); // No need to set any radiant system heat balance coefficients here--will be done during inside heat balance if (Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::CondFD || Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::HAMT) { // Set variables used in the FD moisture balance HAMT - state.dataMstBal->TempOutsideAirFD(SurfNum) = state.dataHeatBalSurf->TempSurfIn(SurfNum); + state.dataMstBal->TempOutsideAirFD(SurfNum) = state.dataHeatBalSurf->SurfTempIn(SurfNum); state.dataMstBal->RhoVaporAirOut(SurfNum) = state.dataMstBal->RhoVaporAirIn(SurfNum); - state.dataMstBal->HConvExtFD(SurfNum) = state.dataHeatBal->HConvIn(SurfNum); + state.dataMstBal->HConvExtFD(SurfNum) = state.dataHeatBalSurf->SurfHConvInt(SurfNum); state.dataMstBal->HMassConvExtFD(SurfNum) = state.dataMstBal->HConvExtFD(SurfNum) / ((PsyRhoAirFnPbTdbW( @@ -6413,7 +6409,7 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, // Set variables used in the FD moisture balance and HAMT state.dataMstBal->TempOutsideAirFD(SurfNum) = state.dataHeatBalSurf->TH(2, 1, Surface(SurfNum).ExtBoundCond); state.dataMstBal->RhoVaporAirOut(SurfNum) = state.dataMstBal->RhoVaporAirIn(Surface(SurfNum).ExtBoundCond); - state.dataMstBal->HConvExtFD(SurfNum) = state.dataHeatBal->HConvIn(Surface(SurfNum).ExtBoundCond); + state.dataMstBal->HConvExtFD(SurfNum) = state.dataHeatBalSurf->SurfHConvInt(Surface(SurfNum).ExtBoundCond); state.dataMstBal->HMassConvExtFD(SurfNum) = state.dataMstBal->HConvExtFD(SurfNum) / ((PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, @@ -6457,10 +6453,10 @@ Real64 GetQdotConvOutRepPerArea(EnergyPlusData &state, int const SurfNum) return -state.dataSurface->OSCM(OPtr).HConv * (state.dataHeatBalSurf->TH(1, 1, SurfNum) - state.dataSurface->OSCM(OPtr).TConv); } else { if (state.dataEnvrn->IsRain) { - return -state.dataHeatBalSurf->HcExtSurf(SurfNum) * + return -state.dataHeatBalSurf->SurfHcExt(SurfNum) * (state.dataHeatBalSurf->TH(1, 1, SurfNum) - state.dataSurface->SurfOutWetBulbTemp(SurfNum)); } else { - return -state.dataHeatBalSurf->HcExtSurf(SurfNum) * + return -state.dataHeatBalSurf->SurfHcExt(SurfNum) * (state.dataHeatBalSurf->TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum)); } } @@ -6500,7 +6496,7 @@ void CalcHeatBalanceInsideSurf(EnergyPlusData &state, } if (state.dataGlobal->BeginEnvrnFlag && state.dataHeatBalSurfMgr->calcHeatBalInsideSurEnvrnFlag) { - state.dataHeatBalSurf->TempInsOld = 23.0; + state.dataHeatBalSurf->SurfTempInsOld = 23.0; state.dataHeatBalSurfMgr->RefAirTemp = 23.0; state.dataHeatBal->SurfTempEffBulkAir = 23.0; state.dataHeatBalSurfMgr->calcHeatBalInsideSurfWarmupErrCount = 0; @@ -6617,7 +6613,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, static std::string const BlankString; Real64 TempSurfOutTmp; // Local Temporary Surface temperature for the outside surface face - Real64 TempSurfInSat; // Local temporary surface dew point temperature + Real64 SurfTempInSat; // Local temporary surface dew point temperature Real64 Wsurf; // Moisture ratio for HAMT Real64 RhoAirZone; // Zone moisture density for HAMT @@ -6724,17 +6720,17 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, bool Converged = false; // .TRUE. if inside heat balance has converged while (!Converged) { // Start of main inside heat balance DO loop... - state.dataHeatBalSurf->TempInsOld = state.dataHeatBalSurf->TempSurfIn; // Keep track of last iteration's temperature values + state.dataHeatBalSurf->SurfTempInsOld = state.dataHeatBalSurf->SurfTempIn; // Keep track of last iteration's temperature values if (state.dataHeatBal->AnyKiva) { for (auto &kivaSurf : state.dataSurfaceGeometry->kivaManager.surfaceMap) { - state.dataHeatBalSurf->TempSurfIn(kivaSurf.first) = + state.dataHeatBalSurf->SurfTempIn(kivaSurf.first) = kivaSurf.second.results.Tavg - DataGlobalConstants::KelvinConv; // TODO: Use average radiant temp? Trad? } } HeatBalanceIntRadExchange::CalcInteriorRadExchange(state, - state.dataHeatBalSurf->TempSurfIn, + state.dataHeatBalSurf->SurfTempIn, state.dataHeatBal->InsideSurfIterations, state.dataHeatBalSurf->SurfNetLWRadToSurf, ZoneToResimulate, @@ -6742,7 +6738,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, if (state.dataHeatBal->AnyKiva) { for (auto &kivaSurf : state.dataSurfaceGeometry->kivaManager.surfaceMap) { - state.dataHeatBalSurf->TempSurfIn(kivaSurf.first) = state.dataHeatBalSurf->TempInsOld(kivaSurf.first); + state.dataHeatBalSurf->SurfTempIn(kivaSurf.first) = state.dataHeatBalSurf->SurfTempInsOld(kivaSurf.first); } } @@ -6753,7 +6749,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, // The choice of 30 is not significant--just want to do this a couple of // times before the iteration limit is hit. if ((state.dataHeatBal->InsideSurfIterations > 0) && (mod(state.dataHeatBal->InsideSurfIterations, ItersReevalConvCoeff) == 0)) { - ConvectionCoefficients::InitInteriorConvectionCoeffs(state, state.dataHeatBalSurf->TempSurfIn, ZoneToResimulate); + ConvectionCoefficients::InitInteriorConvectionCoeffs(state, state.dataHeatBalSurf->SurfTempIn, ZoneToResimulate); } if (state.dataHeatBal->AnyEMPD || state.dataHeatBal->AnyHAMT) { @@ -6769,7 +6765,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, int ZoneNum = Surface(SurfNum).Zone; Real64 const MAT_zone(state.dataHeatBalFanSys->MAT(ZoneNum)); Real64 const ZoneAirHumRat_zone(max(state.dataHeatBalFanSys->ZoneAirHumRat(ZoneNum), 1.0e-5)); - Real64 const HConvIn_surf(state.dataMstBal->HConvInFD(SurfNum) = state.dataHeatBal->HConvIn(SurfNum)); + Real64 const HConvIn_surf(state.dataMstBal->HConvInFD(SurfNum) = state.dataHeatBalSurf->SurfHConvInt(SurfNum)); state.dataMstBal->RhoVaporAirIn(SurfNum) = min(Psychrometrics::PsyRhovFnTdbWPb_fast(MAT_zone, ZoneAirHumRat_zone, state.dataEnvrn->OutBaroPress), @@ -6802,7 +6798,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, int const ConstrNum = surface.Construction; auto const &construct(state.dataConstruction->Construct(ConstrNum)); Real64 const MAT_zone(state.dataHeatBalFanSys->MAT(ZoneNum)); - Real64 const HConvIn_surf(state.dataMstBal->HConvInFD(SurfNum) = state.dataHeatBal->HConvIn(SurfNum)); + Real64 const HConvIn_surf(state.dataMstBal->HConvInFD(SurfNum) = state.dataHeatBalSurf->SurfHConvInt(SurfNum)); if (surface.ExtBoundCond == SurfNum) { // CR6869 -- let Window HB take care of it IF (Surface(SurfNum)%ExtBoundCond == SurfNum) THEN @@ -6812,11 +6808,11 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, if (surface.HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::EMPD) { MoistureBalanceEMPDManager::CalcMoistureBalanceEMPD( - state, SurfNum, state.dataHeatBalSurf->TempSurfInTmp(SurfNum), MAT_zone, TempSurfInSat); + state, SurfNum, state.dataHeatBalSurf->SurfTempInTmp(SurfNum), MAT_zone, SurfTempInSat); } // Pre-calculate a few terms // - Real64 const TempTerm(state.dataHeatBalSurf->CTFConstInPart(SurfNum) + state.dataHeatBal->SurfQRadThermInAbs(SurfNum) + + Real64 const TempTerm(state.dataHeatBalSurf->SurfCTFConstInPart(SurfNum) + state.dataHeatBal->SurfQRadThermInAbs(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(SurfNum) + state.dataHeatBalSurf->SurfQAdditionalHeatSourceInside(SurfNum) + HConvIn_surf * state.dataHeatBalSurfMgr->RefAirTemp(SurfNum) + @@ -6831,9 +6827,9 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, (std::abs(state.dataHeatBalFanSys->QPoolSurfNumerator(SurfNum)) < PoolIsOperatingLimit) && (std::abs(state.dataHeatBalFanSys->PoolHeatTransCoefs(SurfNum)) < PoolIsOperatingLimit))) { if (construct.SourceSinkPresent) { - state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = + state.dataHeatBalSurf->SurfTempInTmp(SurfNum) = (TempTerm + construct.CTFSourceIn(0) * state.dataHeatBalSurf->QsrcHist(SurfNum, 1) + - IterDampConst * state.dataHeatBalSurf->TempInsOld(SurfNum)) * + IterDampConst * state.dataHeatBalSurf->SurfTempInsOld(SurfNum)) * TempDiv; // Constant portion of conduction eq (history terms) | LW radiation from internal sources | SW radiation // from internal sources | Convection from surface to zone air | Net radiant exchange with other zone // surfaces | Heat source/sink term for radiant systems | (if there is one present) | Radiant flux from a @@ -6842,8 +6838,8 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, // stability) | Conduction term (both partition sides same temp) | Conduction term (both partition sides // same temp) | Convection and damping term | Radiation from AFN ducts } else { - state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = - (TempTerm + IterDampConst * state.dataHeatBalSurf->TempInsOld(SurfNum)) * + state.dataHeatBalSurf->SurfTempInTmp(SurfNum) = + (TempTerm + IterDampConst * state.dataHeatBalSurf->SurfTempInsOld(SurfNum)) * TempDiv; // Constant portion of conduction eq (history terms) | LW radiation from internal sources | SW radiation // from internal sources | Convection from surface to zone air | Net radiant exchange with other zone // surfaces | Heat source/sink term for radiant systems | (if there is one present) | Radiant flux from a @@ -6853,29 +6849,29 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, // same temp) | Convection and damping term | Radiation from AFN ducts } } else { // this is a pool and it has been simulated this time step - state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = - (state.dataHeatBalSurf->CTFConstInPart(SurfNum) + state.dataHeatBalFanSys->QPoolSurfNumerator(SurfNum) + - IterDampConst * state.dataHeatBalSurf->TempInsOld(SurfNum)) / + state.dataHeatBalSurf->SurfTempInTmp(SurfNum) = + (state.dataHeatBalSurf->SurfCTFConstInPart(SurfNum) + state.dataHeatBalFanSys->QPoolSurfNumerator(SurfNum) + + IterDampConst * state.dataHeatBalSurf->SurfTempInsOld(SurfNum)) / (construct.CTFInside(0) - construct.CTFCross(0) + state.dataHeatBalFanSys->PoolHeatTransCoefs(SurfNum) + IterDampConst); // Constant part of conduction eq (history terms) | Pool modified terms (see // non-pool equation for details) | Iterative damping term (for stability) | // Conduction term (both partition sides same temp) | Pool and damping term } if (surface.HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::EMPD) { - state.dataHeatBalSurf->TempSurfInTmp(SurfNum) -= + state.dataHeatBalSurf->SurfTempInTmp(SurfNum) -= state.dataMstBalEMPD->HeatFluxLatent(SurfNum) * TempDiv; // Conduction term (both partition sides same temp) | // Conduction term (both partition sides same temp) | // Convection and damping term - if (TempSurfInSat > state.dataHeatBalSurf->TempSurfInTmp(SurfNum)) { - state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = TempSurfInSat; // Surface temp cannot be below dew point + if (SurfTempInSat > state.dataHeatBalSurf->SurfTempInTmp(SurfNum)) { + state.dataHeatBalSurf->SurfTempInTmp(SurfNum) = SurfTempInSat; // Surface temp cannot be below dew point } } // if any mixed heat transfer models in zone, apply limits to CTF result if (state.dataHeatBalSurf->Zone_has_mixed_HT_models[ZoneNum]) - state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = + state.dataHeatBalSurf->SurfTempInTmp(SurfNum) = max(MinSurfaceTempLimit, min(state.dataHeatBalSurf->MaxSurfaceTempLimit, - state.dataHeatBalSurf->TempSurfInTmp(SurfNum))); // Limit Check //Tuned Precomputed condition to eliminate loop + state.dataHeatBalSurf->SurfTempInTmp(SurfNum))); // Limit Check //Tuned Precomputed condition to eliminate loop if (construct.SourceSinkPresent) { // Set the appropriate parameters for the radiant system @@ -6900,17 +6896,17 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, if (surface.HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::HAMT) HeatBalanceHAMTManager::ManageHeatBalHAMT( - state, SurfNum, state.dataHeatBalSurf->TempSurfInTmp(SurfNum), TempSurfOutTmp); // HAMT + state, SurfNum, state.dataHeatBalSurf->SurfTempInTmp(SurfNum), TempSurfOutTmp); // HAMT if (surface.HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::CondFD) { HeatBalFiniteDiffManager::ManageHeatBalFiniteDiff( - state, SurfNum, state.dataHeatBalSurf->TempSurfInTmp(SurfNum), TempSurfOutTmp); + state, SurfNum, state.dataHeatBalSurf->SurfTempInTmp(SurfNum), TempSurfOutTmp); } TH11 = TempSurfOutTmp; } - state.dataHeatBalSurf->TempSurfIn(SurfNum) = state.dataHeatBalSurf->TempSurfInTmp(SurfNum); + state.dataHeatBalSurf->SurfTempIn(SurfNum) = state.dataHeatBalSurf->SurfTempInTmp(SurfNum); } else { // Standard surface or interzone surface bool movableInsulPresent = state.dataSurface->AnyMovableInsulation && state.dataHeatBalSurf->SurfMovInsulIntPresent(SurfNum); @@ -6921,11 +6917,11 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, if (surface.HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::EMPD) { MoistureBalanceEMPDManager::CalcMoistureBalanceEMPD( - state, SurfNum, state.dataHeatBalSurf->TempSurfInTmp(SurfNum), MAT_zone, TempSurfInSat); + state, SurfNum, state.dataHeatBalSurf->SurfTempInTmp(SurfNum), MAT_zone, SurfTempInSat); } // Pre-calculate a few terms Real64 const TempTerm( - state.dataHeatBalSurf->CTFConstInPart(SurfNum) + state.dataHeatBal->SurfQRadThermInAbs(SurfNum) + + state.dataHeatBalSurf->SurfCTFConstInPart(SurfNum) + state.dataHeatBal->SurfQRadThermInAbs(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(SurfNum) + state.dataHeatBalSurf->SurfQAdditionalHeatSourceInside(SurfNum) + HConvIn_surf * state.dataHeatBalSurfMgr->RefAirTemp(SurfNum) + state.dataHeatBalFanSys->QHTRadSysSurf(SurfNum) + state.dataHeatBalFanSys->QCoolingPanelSurf(SurfNum) + state.dataHeatBalFanSys->QHWBaseboardSurf(SurfNum) + @@ -6939,9 +6935,9 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, (std::abs(state.dataHeatBalFanSys->QPoolSurfNumerator(SurfNum)) < PoolIsOperatingLimit) && (std::abs(state.dataHeatBalFanSys->PoolHeatTransCoefs(SurfNum)) < PoolIsOperatingLimit))) { if (construct.SourceSinkPresent) { - state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = + state.dataHeatBalSurf->SurfTempInTmp(SurfNum) = (TempTerm + construct.CTFSourceIn(0) * state.dataHeatBalSurf->QsrcHist(SurfNum, 1) + - IterDampConst * state.dataHeatBalSurf->TempInsOld(SurfNum) + construct.CTFCross(0) * TH11) * + IterDampConst * state.dataHeatBalSurf->SurfTempInsOld(SurfNum) + construct.CTFCross(0) * TH11) * TempDiv; // Constant part of conduction eq (history terms) | LW radiation from internal sources | SW // radiation from internal sources | Convection from surface to zone air | Net radiant exchange // with other zone surfaces | Heat source/sink term for radiant systems | (if there is one @@ -6951,8 +6947,8 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, // outside surface | Coefficient for conduction (current time) | Convection and damping term | // Radiation from AFN ducts } else { - state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = - (TempTerm + IterDampConst * state.dataHeatBalSurf->TempInsOld(SurfNum) + construct.CTFCross(0) * TH11) * + state.dataHeatBalSurf->SurfTempInTmp(SurfNum) = + (TempTerm + IterDampConst * state.dataHeatBalSurf->SurfTempInsOld(SurfNum) + construct.CTFCross(0) * TH11) * TempDiv; // Constant part of conduction eq (history terms) | LW radiation from internal sources | SW // radiation from internal sources | Convection from surface to zone air | Net radiant exchange // with other zone surfaces | Heat source/sink term for radiant systems | (if there is one @@ -6963,9 +6959,9 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, // Radiation from AFN ducts } } else { // surface is a pool and the pool has been simulated this time step - state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = - (state.dataHeatBalSurf->CTFConstInPart(SurfNum) + state.dataHeatBalFanSys->QPoolSurfNumerator(SurfNum) + - IterDampConst * state.dataHeatBalSurf->TempInsOld(SurfNum) + construct.CTFCross(0) * TH11) / + state.dataHeatBalSurf->SurfTempInTmp(SurfNum) = + (state.dataHeatBalSurf->SurfCTFConstInPart(SurfNum) + state.dataHeatBalFanSys->QPoolSurfNumerator(SurfNum) + + IterDampConst * state.dataHeatBalSurf->SurfTempInsOld(SurfNum) + construct.CTFCross(0) * TH11) / (construct.CTFInside(0) + state.dataHeatBalFanSys->PoolHeatTransCoefs(SurfNum) + IterDampConst); // Constant part of conduction eq (history terms) | Pool modified terms // (see non-pool equation for details) | Iterative damping term (for @@ -6973,19 +6969,19 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, // Coefficient for conduction (current time) | Pool and damping term } if (surface.HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::EMPD) { - state.dataHeatBalSurf->TempSurfInTmp(SurfNum) -= + state.dataHeatBalSurf->SurfTempInTmp(SurfNum) -= state.dataMstBalEMPD->HeatFluxLatent(SurfNum) * TempDiv; // Coefficient for conduction (current time) | Convection and damping term - if (TempSurfInSat > state.dataHeatBalSurf->TempSurfInTmp(SurfNum)) { - state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = TempSurfInSat; // Surface temp cannot be below dew point + if (SurfTempInSat > state.dataHeatBalSurf->SurfTempInTmp(SurfNum)) { + state.dataHeatBalSurf->SurfTempInTmp(SurfNum) = SurfTempInSat; // Surface temp cannot be below dew point } } // if any mixed heat transfer models in zone, apply limits to CTF result if (state.dataHeatBalSurf->Zone_has_mixed_HT_models[ZoneNum]) - state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = max( + state.dataHeatBalSurf->SurfTempInTmp(SurfNum) = max( MinSurfaceTempLimit, min(state.dataHeatBalSurf->MaxSurfaceTempLimit, - state.dataHeatBalSurf->TempSurfInTmp(SurfNum))); // Limit Check //Tuned Precomputed condition to eliminate loop + state.dataHeatBalSurf->SurfTempInTmp(SurfNum))); // Limit Check //Tuned Precomputed condition to eliminate loop if (construct.SourceSinkPresent) { // Set the appropriate parameters for the radiant system @@ -7041,18 +7037,18 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, OtherSideZoneNum = Surface(OtherSideSurfNum).Zone; state.dataMstBal->TempOutsideAirFD(SurfNum) = state.dataHeatBalFanSys->MAT(OtherSideZoneNum); } - HeatBalanceHAMTManager::ManageHeatBalHAMT(state, SurfNum, state.dataHeatBalSurf->TempSurfInTmp(SurfNum), TempSurfOutTmp); + HeatBalanceHAMTManager::ManageHeatBalHAMT(state, SurfNum, state.dataHeatBalSurf->SurfTempInTmp(SurfNum), TempSurfOutTmp); } if (surface.HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::CondFD) HeatBalFiniteDiffManager::ManageHeatBalFiniteDiff( - state, SurfNum, state.dataHeatBalSurf->TempSurfInTmp(SurfNum), TempSurfOutTmp); + state, SurfNum, state.dataHeatBalSurf->SurfTempInTmp(SurfNum), TempSurfOutTmp); TH11 = TempSurfOutTmp; } else if (surface.HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::Kiva) { // Read Kiva results for each surface - state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = + state.dataHeatBalSurf->SurfTempInTmp(SurfNum) = state.dataSurfaceGeometry->kivaManager.surfaceMap[SurfNum].results.Tconv - DataGlobalConstants::KelvinConv; state.dataHeatBalSurf->SurfOpaqInsFaceConductionFlux(SurfNum) = state.dataSurfaceGeometry->kivaManager.surfaceMap[SurfNum].results.qtot; @@ -7062,7 +7058,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, TH11 = 0.0; } - state.dataHeatBalSurf->TempSurfIn(SurfNum) = state.dataHeatBalSurf->TempSurfInTmp(SurfNum); + state.dataHeatBalSurf->SurfTempIn(SurfNum) = state.dataHeatBalSurf->SurfTempInTmp(SurfNum); } else { // Movable insulation present Real64 HMovInsul = state.dataHeatBalSurf->SurfMovInsulHInt(SurfNum); @@ -7082,28 +7078,28 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, Real64 F1 = HMovInsul / (HMovInsul + HConvIn_surf + IterDampConst); - state.dataHeatBalSurf->TempSurfIn(SurfNum) = - (state.dataHeatBalSurf->CTFConstInPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(SurfNum) + + state.dataHeatBalSurf->SurfTempIn(SurfNum) = + (state.dataHeatBalSurf->SurfCTFConstInPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(SurfNum) + construct.CTFCross(0) * TH11 + F1 * (state.dataHeatBal->SurfQRadThermInAbs(SurfNum) + HConvIn_surf * state.dataHeatBalSurfMgr->RefAirTemp(SurfNum) + state.dataHeatBalSurf->SurfNetLWRadToSurf(SurfNum) + state.dataHeatBalFanSys->QHTRadSysSurf(SurfNum) + state.dataHeatBalFanSys->QCoolingPanelSurf(SurfNum) + state.dataHeatBalFanSys->QHWBaseboardSurf(SurfNum) + state.dataHeatBalFanSys->QSteamBaseboardSurf(SurfNum) + state.dataHeatBalFanSys->QElecBaseboardSurf(SurfNum) + state.dataHeatBalSurf->SurfQAdditionalHeatSourceInside(SurfNum) + - IterDampConst * state.dataHeatBalSurf->TempInsOld(SurfNum))) / + IterDampConst * state.dataHeatBalSurf->SurfTempInsOld(SurfNum))) / (construct.CTFInside(0) + HMovInsul - F1 * HMovInsul); // Convection from surface to zone air - state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = - (construct.CTFInside(0) * state.dataHeatBalSurf->TempSurfIn(SurfNum) + - HMovInsul * state.dataHeatBalSurf->TempSurfIn(SurfNum) - state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(SurfNum) - - state.dataHeatBalSurf->CTFConstInPart(SurfNum) - construct.CTFCross(0) * TH11) / + state.dataHeatBalSurf->SurfTempInTmp(SurfNum) = + (construct.CTFInside(0) * state.dataHeatBalSurf->SurfTempIn(SurfNum) + + HMovInsul * state.dataHeatBalSurf->SurfTempIn(SurfNum) - state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(SurfNum) - + state.dataHeatBalSurf->SurfCTFConstInPart(SurfNum) - construct.CTFCross(0) * TH11) / (HMovInsul); // if any mixed heat transfer models in zone, apply limits to CTF result if (state.dataHeatBalSurf->Zone_has_mixed_HT_models[ZoneNum]) - state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = + state.dataHeatBalSurf->SurfTempInTmp(SurfNum) = max(MinSurfaceTempLimit, min(state.dataHeatBalSurf->MaxSurfaceTempLimit, - state.dataHeatBalSurf->TempSurfInTmp(SurfNum))); // Limit Check //Tuned Precomputed condition to eliminate loop + state.dataHeatBalSurf->SurfTempInTmp(SurfNum))); // Limit Check //Tuned Precomputed condition to eliminate loop } } } @@ -7122,11 +7118,11 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, // Similar to opaque surface but outside surface temp of TDD:DOME is used, and no embedded sources/sinks. // Absorbed shortwave radiation is treated similar to a regular window, but only 1 glass layer is allowed. // = QRadSWwinAbs(SurfNum,1)/2.0 - Real64 const HConvIn_surf(state.dataMstBal->HConvInFD(SurfNum) = state.dataHeatBal->HConvIn(SurfNum)); - state.dataHeatBalSurf->TempSurfIn(SurfNum) = state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = + Real64 const HConvIn_surf(state.dataMstBal->HConvInFD(SurfNum) = state.dataHeatBalSurf->SurfHConvInt(SurfNum)); + state.dataHeatBalSurf->SurfTempIn(SurfNum) = state.dataHeatBalSurf->SurfTempInTmp(SurfNum) = (state.dataHeatBal->SurfQRadThermInAbs(SurfNum) + state.dataHeatBal->SurfWinQRadSWwinAbs(SurfNum, 1) / 2.0 + state.dataHeatBalSurf->SurfQAdditionalHeatSourceInside(SurfNum) + HConvIn_surf * state.dataHeatBalSurfMgr->RefAirTemp(SurfNum) + - state.dataHeatBalSurf->SurfNetLWRadToSurf(SurfNum) + IterDampConst * state.dataHeatBalSurf->TempInsOld(SurfNum) + + state.dataHeatBalSurf->SurfNetLWRadToSurf(SurfNum) + IterDampConst * state.dataHeatBalSurf->SurfTempInsOld(SurfNum) + Ueff * state.dataHeatBalSurf->TH(1, 1, domeNum)) / (Ueff + HConvIn_surf + IterDampConst); // LW radiation from internal sources | SW radiation from internal sources and // solar | Convection from surface to zone air | Net radiant exchange with @@ -7134,12 +7130,12 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, // conduction from the outside surface | Coefficient for conduction (current // time) | Convection and damping term - Real64 const Sigma_Temp_4(DataGlobalConstants::StefanBoltzmann * pow_4(state.dataHeatBalSurf->TempSurfIn(SurfNum))); + Real64 const Sigma_Temp_4(DataGlobalConstants::StefanBoltzmann * pow_4(state.dataHeatBalSurf->SurfTempIn(SurfNum))); // Calculate window heat gain for TDD:DIFFUSER since this calculation is usually done in WindowManager state.dataSurface->SurfWinHeatGain(SurfNum) = state.dataSurface->SurfWinTransSolar(SurfNum) + - HConvIn_surf * surface.Area * (state.dataHeatBalSurf->TempSurfIn(SurfNum) - state.dataHeatBalSurfMgr->RefAirTemp(SurfNum)) + + HConvIn_surf * surface.Area * (state.dataHeatBalSurf->SurfTempIn(SurfNum) - state.dataHeatBalSurfMgr->RefAirTemp(SurfNum)) + state.dataConstruction->Construct(surface.Construction).InsideAbsorpThermal * surface.Area * (Sigma_Temp_4 - (state.dataSurface->SurfWinIRfromParentZone(SurfNum) + state.dataHeatBalFanSys->QHTRadSysSurf(SurfNum) + @@ -7153,7 +7149,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, // fill out report vars for components of Window Heat Gain state.dataSurface->SurfWinGainConvGlazToZoneRep(SurfNum) = - HConvIn_surf * surface.Area * (state.dataHeatBalSurf->TempSurfIn(SurfNum) - state.dataHeatBalSurfMgr->RefAirTemp(SurfNum)); + HConvIn_surf * surface.Area * (state.dataHeatBalSurf->SurfTempIn(SurfNum) - state.dataHeatBalSurfMgr->RefAirTemp(SurfNum)); state.dataSurface->SurfWinGainIRGlazToZoneRep(SurfNum) = state.dataConstruction->Construct(surface.Construction).InsideAbsorpThermal * surface.Area * (Sigma_Temp_4 - (state.dataSurface->SurfWinIRfromParentZone(SurfNum) + state.dataHeatBalFanSys->QHTRadSysSurf(SurfNum) + @@ -7187,7 +7183,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, // Set Exterior Convection Coefficient... if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) > 0) { - state.dataHeatBalSurf->HcExtSurf(SurfNum) = ConvectionCoefficients::SetExtConvectionCoeff(state, SurfNum); + state.dataHeatBalSurf->SurfHcExt(SurfNum) = ConvectionCoefficients::SetExtConvectionCoeff(state, SurfNum); } else if (surface.ExtWind) { // Window is exposed to wind (and possibly rain) @@ -7199,13 +7195,13 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, RoughSurf, EmisOut, TH11, - state.dataHeatBalSurf->HcExtSurf(SurfNum), - state.dataHeatBalSurf->HSkyExtSurf(SurfNum), - state.dataHeatBalSurf->HGrdExtSurf(SurfNum), - state.dataHeatBalSurf->HAirExtSurf(SurfNum)); + state.dataHeatBalSurf->SurfHcExt(SurfNum), + state.dataHeatBalSurf->SurfHSkyExt(SurfNum), + state.dataHeatBalSurf->SurfHGrdExt(SurfNum), + state.dataHeatBalSurf->SurfHAirExt(SurfNum)); if (state.dataEnvrn->IsRain) { // Raining: since wind exposed, outside window surface gets wet - state.dataHeatBalSurf->HcExtSurf(SurfNum) = 1000.0; // Reset HcExtSurf because of wetness + state.dataHeatBalSurf->SurfHcExt(SurfNum) = 1000.0; // Reset SurfHcExt because of wetness } } else { // Not Wind exposed @@ -7217,28 +7213,28 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, RoughSurf, EmisOut, TH11, - state.dataHeatBalSurf->HcExtSurf(SurfNum), - state.dataHeatBalSurf->HSkyExtSurf(SurfNum), - state.dataHeatBalSurf->HGrdExtSurf(SurfNum), - state.dataHeatBalSurf->HAirExtSurf(SurfNum)); + state.dataHeatBalSurf->SurfHcExt(SurfNum), + state.dataHeatBalSurf->SurfHSkyExt(SurfNum), + state.dataHeatBalSurf->SurfHGrdExt(SurfNum), + state.dataHeatBalSurf->SurfHAirExt(SurfNum)); } } else { // Interior Surface if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) > 0) { - state.dataHeatBalSurf->HcExtSurf(SurfNum) = ConvectionCoefficients::SetExtConvectionCoeff(state, SurfNum); + state.dataHeatBalSurf->SurfHcExt(SurfNum) = ConvectionCoefficients::SetExtConvectionCoeff(state, SurfNum); } else { // Exterior Convection Coefficient for the Interior or Interzone Window is the Interior Convection Coeff of // same - state.dataHeatBalSurf->HcExtSurf(SurfNum) = state.dataHeatBal->HConvIn(surface.ExtBoundCond); + state.dataHeatBalSurf->SurfHcExt(SurfNum) = state.dataHeatBalSurf->SurfHConvInt(surface.ExtBoundCond); } } // Following call determines inside surface temperature of glazing, and of // frame and/or divider, if present CalcWindowHeatBalance( - state, SurfNum, state.dataHeatBalSurf->HcExtSurf(SurfNum), state.dataHeatBalSurf->TempSurfInTmp(SurfNum), TH11); + state, SurfNum, state.dataHeatBalSurf->SurfHcExt(SurfNum), state.dataHeatBalSurf->SurfTempInTmp(SurfNum), TH11); - state.dataHeatBalSurf->TempSurfIn(SurfNum) = state.dataHeatBalSurf->TempSurfInTmp(SurfNum); + state.dataHeatBalSurf->SurfTempIn(SurfNum) = state.dataHeatBalSurf->SurfTempInTmp(SurfNum); } } } // ...end of inside surface heat balance equation selection @@ -7248,7 +7244,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, auto &zone(state.dataHeatBal->Zone(ZoneNum)); Real64 &TH11(state.dataHeatBalSurf->TH(1, 1, SurfNum)); Real64 &TH12(state.dataHeatBalSurf->TH(2, 1, SurfNum)); - TH12 = state.dataHeatBalSurf->TempSurfInRep(SurfNum) = state.dataHeatBalSurf->TempSurfIn(SurfNum); + TH12 = state.dataHeatBalSurf->SurfTempInRep(SurfNum) = state.dataHeatBalSurf->SurfTempIn(SurfNum); state.dataHeatBalSurf->SurfTempOut(SurfNum) = TH11; // For reporting if (state.dataSurface->SurfWinOriginalClass(SurfNum) == SurfaceClass::TDD_Dome) continue; if (state.dataSurface->SurfWinOriginalClass(SurfNum) == SurfaceClass::TDD_Diffuser) { // Tubular daylighting device @@ -7260,9 +7256,9 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, // Set inside temp variables of TDD:DOME equal to inside temp of TDD:DIFFUSER int domeNum = state.dataDaylightingDevicesData->TDDPipe(state.dataSurface->SurfWinTDDPipeNum(SurfNum)).Dome; - state.dataHeatBalSurf->TH(2, 1, domeNum) = state.dataHeatBalSurf->TempSurfIn(domeNum) = - state.dataHeatBalSurf->TempSurfInTmp(domeNum) = state.dataHeatBalSurf->TempSurfInRep(domeNum) = - state.dataHeatBalSurf->TempSurfIn(SurfNum); + state.dataHeatBalSurf->TH(2, 1, domeNum) = state.dataHeatBalSurf->SurfTempIn(domeNum) = + state.dataHeatBalSurf->SurfTempInTmp(domeNum) = state.dataHeatBalSurf->SurfTempInRep(domeNum) = + state.dataHeatBalSurf->SurfTempIn(SurfNum); // Set outside temp reporting variable of TDD:DOME (since it gets skipped otherwise) // Reset outside temp variables of TDD:DIFFUSER equal to outside temp of TDD:DOME @@ -7297,7 +7293,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, // Convergence check - Loop through all relevant non-window surfaces to check for convergence... Real64 MaxDelTemp = 0.0; // Maximum change in surface temperature for any opaque surface from one iteration to the next for (int SurfNum : HTNonWindowSurfs) { - MaxDelTemp = max(std::abs(state.dataHeatBalSurf->TempSurfIn(SurfNum) - state.dataHeatBalSurf->TempInsOld(SurfNum)), MaxDelTemp); + MaxDelTemp = max(std::abs(state.dataHeatBalSurf->SurfTempIn(SurfNum) - state.dataHeatBalSurf->SurfTempInsOld(SurfNum)), MaxDelTemp); if (Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::CondFD) { // also check all internal nodes as well as surface faces MaxDelTemp = max(MaxDelTemp, state.dataHeatBalFiniteDiffMgr->SurfaceFD(SurfNum).MaxNodeDelTemp); @@ -7367,8 +7363,8 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, if (Surface(surfNum).Class == SurfaceClass::TDD_Dome) continue; // Skip TDD:DOME objects. Inside temp is handled by TDD:DIFFUSER. // Inside Face Convection - sign convention is positive means energy going into inside face from the air. - auto const HConvInTemp_fac(-state.dataHeatBal->HConvIn(surfNum) * - (state.dataHeatBalSurf->TempSurfIn(surfNum) - state.dataHeatBalSurfMgr->RefAirTemp(surfNum))); + auto const HConvInTemp_fac(-state.dataHeatBalSurf->SurfHConvInt(surfNum) * + (state.dataHeatBalSurf->SurfTempIn(surfNum) - state.dataHeatBalSurfMgr->RefAirTemp(surfNum))); state.dataHeatBalSurf->QdotConvInRep(surfNum) = Surface(surfNum).Area * HConvInTemp_fac; state.dataHeatBalSurf->QdotConvInRepPerArea(surfNum) = HConvInTemp_fac; state.dataHeatBalSurf->QConvInReport(surfNum) = state.dataHeatBalSurf->QdotConvInRep(surfNum) * state.dataGlobal->TimeStepZoneSec; @@ -7440,7 +7436,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, Psychrometrics::PsyRhFnTdbRhov(state, MAT_zone, state.dataMstBal->RhoVaporAirIn(SurfNum), rhoAirZone), state.dataEnvrn->OutBaroPress)); - Real64 const surfInTemp(state.dataHeatBalSurf->TempSurfInTmp(SurfNum)); + Real64 const surfInTemp(state.dataHeatBalSurf->SurfTempInTmp(SurfNum)); Wsurf = Psychrometrics::PsyWFnTdbRhPb(state, surfInTemp, @@ -7514,23 +7510,14 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, int const ConstrNum = Surface(surfNum).Construction; auto const &construct(state.dataConstruction->Construct(ConstrNum)); if (Surface(surfNum).ExtBoundCond == surfNum) { - state.dataHeatBalSurf->IsAdiabatic(surfNum) = 1; - state.dataHeatBalSurf->IsNotAdiabatic(surfNum) = 0; + state.dataHeatBalSurf->SurfIsAdiabatic(surfNum) = 1; } else { - state.dataHeatBalSurf->IsAdiabatic(surfNum) = 0; - state.dataHeatBalSurf->IsNotAdiabatic(surfNum) = 1; + state.dataHeatBalSurf->SurfIsAdiabatic(surfNum) = 0; } if (construct.SourceSinkPresent) { - state.dataHeatBalSurf->IsSource(surfNum) = 1; - state.dataHeatBalSurf->IsNotSource(surfNum) = 0; + state.dataHeatBalSurf->SurfIsSourceOrSink(surfNum) = 1; } else { - state.dataHeatBalSurf->QsrcHistSurf1(surfNum) = 0.0; - state.dataHeatBalSurf->IsSource(surfNum) = 0; - state.dataHeatBalSurf->IsNotSource(surfNum) = 1; - } - if (!state.dataSurface->SurfIsPool(surfNum)) { - state.dataHeatBalSurf->IsPoolSurf(surfNum) = 0; - state.dataHeatBalSurf->IsNotPoolSurf(surfNum) = 1; + state.dataHeatBalSurf->SurfIsSourceOrSink(surfNum) = 0; } } } @@ -7547,23 +7534,21 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, int const ConstrNum = Surface(surfNum).Construction; auto const &construct(state.dataConstruction->Construct(ConstrNum)); - state.dataHeatBalSurf->CTFCross0(surfNum) = construct.CTFCross(0); - state.dataHeatBalSurf->CTFInside0(surfNum) = construct.CTFInside(0); - state.dataHeatBalSurf->CTFSourceIn0(surfNum) = construct.CTFSourceIn(0); - state.dataHeatBalSurf->TH11Surf(surfNum) = state.dataHeatBalSurf->TH(1, 1, surfNum); + state.dataHeatBalSurf->SurfCTFCross0(surfNum) = construct.CTFCross(0); + state.dataHeatBalSurf->SurfCTFInside0(surfNum) = construct.CTFInside(0); + state.dataHeatBalSurf->SurfCTFSourceIn0(surfNum) = construct.CTFSourceIn(0); + state.dataHeatBalSurf->SurfTempOutHist(surfNum) = state.dataHeatBalSurf->TH(1, 1, surfNum); if (construct.SourceSinkPresent) { - state.dataHeatBalSurf->QsrcHistSurf1(surfNum) = state.dataHeatBalSurf->QsrcHist(surfNum, 1); + state.dataHeatBalSurf->SurfQSourceSinkHist(surfNum) = state.dataHeatBalSurf->QsrcHist(surfNum, 1); } // The special heat balance terms for pools are used only when the pool is operating, so IsPool can change if (state.dataSurface->SurfIsPool(surfNum)) { if ((std::abs(state.dataHeatBalFanSys->QPoolSurfNumerator(surfNum)) >= PoolIsOperatingLimit) || (std::abs(state.dataHeatBalFanSys->PoolHeatTransCoefs(surfNum)) >= PoolIsOperatingLimit)) { - state.dataHeatBalSurf->IsPoolSurf(surfNum) = 1; - state.dataHeatBalSurf->IsNotPoolSurf(surfNum) = 0; + state.dataHeatBalSurf->SurfIsOperatingPool(surfNum) = 1; } else { - state.dataHeatBalSurf->IsPoolSurf(surfNum) = 0; - state.dataHeatBalSurf->IsNotPoolSurf(surfNum) = 1; + state.dataHeatBalSurf->SurfIsOperatingPool(surfNum) = 0; } } auto const SELECT_CASE_var(state.dataSurface->SurfTAirRef(surfNum)); @@ -7652,18 +7637,18 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, for (int surfNum = firstNonWinSurf; surfNum <= lastNonWinSurf; ++surfNum) { // Pre-calculate a few terms before the iteration loop - state.dataHeatBalSurf->TempTermSurf(surfNum) = - state.dataHeatBalSurf->CTFConstInPart(surfNum) + state.dataHeatBal->SurfQRadThermInAbs(surfNum) + + state.dataHeatBalSurf->SurfTempTerm(surfNum) = + state.dataHeatBalSurf->SurfCTFConstInPart(surfNum) + state.dataHeatBal->SurfQRadThermInAbs(surfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(surfNum) + state.dataHeatBalSurf->SurfQAdditionalHeatSourceInside(surfNum) + - state.dataHeatBal->HConvIn(surfNum) * state.dataHeatBalSurfMgr->RefAirTemp(surfNum) + + state.dataHeatBalSurf->SurfHConvInt(surfNum) * state.dataHeatBalSurfMgr->RefAirTemp(surfNum) + state.dataHeatBalFanSys->QHTRadSysSurf(surfNum) + state.dataHeatBalFanSys->QCoolingPanelSurf(surfNum) + state.dataHeatBalFanSys->QHWBaseboardSurf(surfNum) + state.dataHeatBalFanSys->QSteamBaseboardSurf(surfNum) + state.dataHeatBalFanSys->QElecBaseboardSurf(surfNum) + (state.dataHeatBalFanSys->QRadSurfAFNDuct(surfNum) / timeStepZoneSeconds); - state.dataHeatBalSurf->TempDivSurf(surfNum) = - 1.0 / (state.dataHeatBalSurf->CTFInside0(surfNum) - - state.dataHeatBalSurf->IsAdiabatic(surfNum) * state.dataHeatBalSurf->CTFCross0(surfNum) + - state.dataHeatBalSurf->IsPoolSurf(surfNum) * state.dataHeatBalFanSys->PoolHeatTransCoefs(surfNum) + - state.dataHeatBalSurf->IsNotPoolSurf(surfNum) * state.dataHeatBal->HConvIn(surfNum) + iterDampConstant); + state.dataHeatBalSurf->SurfTempDiv(surfNum) = + 1.0 / (state.dataHeatBalSurf->SurfCTFInside0(surfNum) - + state.dataHeatBalSurf->SurfIsAdiabatic(surfNum) * state.dataHeatBalSurf->SurfCTFCross0(surfNum) + + state.dataHeatBalSurf->SurfIsOperatingPool(surfNum) * state.dataHeatBalFanSys->PoolHeatTransCoefs(surfNum) + + (!state.dataHeatBalSurf->SurfIsOperatingPool(surfNum)) * state.dataHeatBalSurf->SurfHConvInt(surfNum) + iterDampConstant); } } @@ -7671,10 +7656,10 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, bool Converged = false; // .TRUE. if inside heat balance has converged while (!Converged) { // Start of main inside heat balance iteration loop... - state.dataHeatBalSurf->TempInsOld = state.dataHeatBalSurf->TempSurfIn; // Keep track of last iteration's temperature values + state.dataHeatBalSurf->SurfTempInsOld = state.dataHeatBalSurf->SurfTempIn; // Keep track of last iteration's temperature values HeatBalanceIntRadExchange::CalcInteriorRadExchange(state, - state.dataHeatBalSurf->TempSurfIn, + state.dataHeatBalSurf->SurfTempIn, state.dataHeatBal->InsideSurfIterations, state.dataHeatBalSurf->SurfNetLWRadToSurf, ZoneToResimulate, @@ -7687,7 +7672,7 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, // The choice of 30 is not significant--just want to do this a couple of // times before the iteration limit is hit. if ((state.dataHeatBal->InsideSurfIterations > 0) && (mod(state.dataHeatBal->InsideSurfIterations, ItersReevalConvCoeff) == 0)) { - ConvectionCoefficients::InitInteriorConvectionCoeffs(state, state.dataHeatBalSurf->TempSurfIn, ZoneToResimulate); + ConvectionCoefficients::InitInteriorConvectionCoeffs(state, state.dataHeatBalSurf->SurfTempIn, ZoneToResimulate); // Since HConvIn has changed re-calculate a few terms - non-window surfaces for (int zoneNum = FirstZone; zoneNum <= LastZone; ++zoneNum) { int const firstSurf = state.dataHeatBal->Zone(zoneNum).OpaqOrIntMassSurfaceFirst; @@ -7696,19 +7681,20 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, Real64 const iterDampConstant = IterDampConst; // local for vectorization // this loop auto-vectorizes for (int surfNum = firstSurf; surfNum <= lastSurf; ++surfNum) { - state.dataHeatBalSurf->TempTermSurf(surfNum) = - state.dataHeatBalSurf->CTFConstInPart(surfNum) + state.dataHeatBal->SurfQRadThermInAbs(surfNum) + + state.dataHeatBalSurf->SurfTempTerm(surfNum) = + state.dataHeatBalSurf->SurfCTFConstInPart(surfNum) + state.dataHeatBal->SurfQRadThermInAbs(surfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(surfNum) + state.dataHeatBalSurf->SurfQAdditionalHeatSourceInside(surfNum) + - state.dataHeatBal->HConvIn(surfNum) * state.dataHeatBalSurfMgr->RefAirTemp(surfNum) + + state.dataHeatBalSurf->SurfHConvInt(surfNum) * state.dataHeatBalSurfMgr->RefAirTemp(surfNum) + state.dataHeatBalFanSys->QHTRadSysSurf(surfNum) + state.dataHeatBalFanSys->QCoolingPanelSurf(surfNum) + state.dataHeatBalFanSys->QHWBaseboardSurf(surfNum) + state.dataHeatBalFanSys->QSteamBaseboardSurf(surfNum) + state.dataHeatBalFanSys->QElecBaseboardSurf(surfNum) + (state.dataHeatBalFanSys->QRadSurfAFNDuct(surfNum) / timeStepZoneSeconds); - state.dataHeatBalSurf->TempDivSurf(surfNum) = - 1.0 / (state.dataHeatBalSurf->CTFInside0(surfNum) - - state.dataHeatBalSurf->IsAdiabatic(surfNum) * state.dataHeatBalSurf->CTFCross0(surfNum) + - state.dataHeatBalSurf->IsPoolSurf(surfNum) * state.dataHeatBalFanSys->PoolHeatTransCoefs(surfNum) + - state.dataHeatBalSurf->IsNotPoolSurf(surfNum) * state.dataHeatBal->HConvIn(surfNum) + iterDampConstant); + state.dataHeatBalSurf->SurfTempDiv(surfNum) = + 1.0 / + (state.dataHeatBalSurf->SurfCTFInside0(surfNum) - + state.dataHeatBalSurf->SurfIsAdiabatic(surfNum) * state.dataHeatBalSurf->SurfCTFCross0(surfNum) + + state.dataHeatBalSurf->SurfIsOperatingPool(surfNum) * state.dataHeatBalFanSys->PoolHeatTransCoefs(surfNum) + + (!state.dataHeatBalSurf->SurfIsOperatingPool(surfNum)) * state.dataHeatBalSurf->SurfHConvInt(surfNum) + iterDampConstant); } } } @@ -7736,50 +7722,50 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, // For adiabatic surface: // Adiabatic: TempDiv = (1.0 / (construct.CTFInside(0) - construct.CTFCross(0) + HConvIn_surf + IterDampConst)); - // Adiabatic: TempSurfInTmp(SurfNum) = (TempTerm + IterDampConst * TempInsOld(SurfNum)) * TempDiv; - // Ad+Source: TempSurfInTmp(SurfNum) = (TempTerm + construct.CTFSourceIn(0) * QsrcHist(SurfNum, 1) + IterDampConst * - // TempInsOld(SurfNum)) * TempDiv; Ad+Pool: TempDiv = (1.0 / (construct.CTFInside(0) - construct.CTFCross(0) + - // PoolHeatTransCoefs(SurfNum) + IterDampConst); Ad+Pool: TempSurfInTmp(SurfNum) = (CTFConstInPart(SurfNum) + - // QPoolSurfNumerator(SurfNum) + IterDampConst * TempInsOld(SurfNum)) * TempDiv; + // Adiabatic: SurfTempInTmp(SurfNum) = (TempTerm + IterDampConst * SurfTempInsOld(SurfNum)) * TempDiv; + // Ad+Source: SurfTempInTmp(SurfNum) = (TempTerm + construct.CTFSourceIn(0) * QsrcHist(SurfNum, 1) + IterDampConst * + // SurfTempInsOld(SurfNum)) * TempDiv; Ad+Pool: TempDiv = (1.0 / (construct.CTFInside(0) - construct.CTFCross(0) + + // PoolHeatTransCoefs(SurfNum) + IterDampConst); Ad+Pool: SurfTempInTmp(SurfNum) = (SurfCTFConstInPart(SurfNum) + + // QPoolSurfNumerator(SurfNum) + IterDampConst * SurfTempInsOld(SurfNum)) * TempDiv; // For standard or interzone surface: // Standard: TempDiv = (1.0 / (construct.CTFInside(0) + HConvIn_surf + IterDampConst)); - // Standard: TempSurfInTmp(SurfNum) = (TempTerm + IterDampConst * TempInsOld(SurfNum) + construct.CTFCross(0) * TH11) * - // TempDiv; Std+Source: TempSurfInTmp(SurfNum) = (TempTerm + construct.CTFSourceIn(0) * QsrcHist(SurfNum, 1) + IterDampConst * - // TempInsOld(SurfNum)) * TempDiv; Std+Pool: TempDiv = (1.0 / (construct.CTFInside(0) + PoolHeatTransCoefs(SurfNum) + - // IterDampConst); Std+Pool: TempSurfInTmp(SurfNum) = (CTFConstInPart(SurfNum) + QPoolSurfNumerator(SurfNum) + IterDampConst* - // TempInsOld(SurfNum) + construct.CTFCross(0) * TH11) * TempDiv; + // Standard: SurfTempInTmp(SurfNum) = (TempTerm + IterDampConst * SurfTempInsOld(SurfNum) + construct.CTFCross(0) * TH11) * + // TempDiv; Std+Source: SurfTempInTmp(SurfNum) = (TempTerm + construct.CTFSourceIn(0) * QsrcHist(SurfNum, 1) + IterDampConst * + // SurfTempInsOld(SurfNum)) * TempDiv; Std+Pool: TempDiv = (1.0 / (construct.CTFInside(0) + PoolHeatTransCoefs(SurfNum) + + // IterDampConst); Std+Pool: SurfTempInTmp(SurfNum) = (SurfCTFConstInPart(SurfNum) + QPoolSurfNumerator(SurfNum) + IterDampConst* + // SurfTempInsOld(SurfNum) + construct.CTFCross(0) * TH11) * TempDiv; // Composite with Adiabatic/Source/Pool flags: - // TempDiv = (1.0 / (construct.CTFInside(0) - IsAdiabatic*construct.CTFCross(0)+ - // IsPoolSurf*PoolHeatTransCoefs(SurfNum) + IsNotPoolSurf*HConvIn_surf + IterDampConst)); TempSurfInTmp(SurfNum) = - // (IsNotPoolSurf*TempTerm + IsSource*construct.CTFSourceIn(0) * QsrcHist(SurfNum, 1) + - // IsPoolSurf*CTFConstInPart(SurfNum) + IsPoolSurf*QPoolSurfNumerator(SurfNum) - // + IterDampConst * TempInsOld(SurfNum)+ IsNotAdiabatic*IsNotSource*construct.CTFCross(0) + // TempDiv = (1.0 / (construct.CTFInside(0) - SurfIsAdiabatic*construct.CTFCross(0)+ + // SurfIsOperatingPool*PoolHeatTransCoefs(SurfNum) + IsNotPoolSurf*HConvIn_surf + IterDampConst)); SurfTempInTmp(SurfNum) + // = (IsNotPoolSurf*TempTerm + IsSource*construct.CTFSourceIn(0) * QsrcHist(SurfNum, 1) + + // SurfIsOperatingPool*SurfCTFConstInPart(SurfNum) + SurfIsOperatingPool*QPoolSurfNumerator(SurfNum) + // + IterDampConst * SurfTempInsOld(SurfNum)+ IsNotAdiabatic*IsNotSource*construct.CTFCross(0) // * TH11) * TempDiv; // Calculate the current inside surface temperature - state.dataHeatBalSurf->TempSurfInTmp(surfNum) = - (state.dataHeatBalSurf->IsNotPoolSurf(surfNum) * - (state.dataHeatBalSurf->TempTermSurf(surfNum) + state.dataHeatBalSurf->SurfNetLWRadToSurf(surfNum)) + - state.dataHeatBalSurf->IsSource(surfNum) * state.dataHeatBalSurf->CTFSourceIn0(surfNum) * - state.dataHeatBalSurf->QsrcHistSurf1(surfNum) + - state.dataHeatBalSurf->IsPoolSurf(surfNum) * state.dataHeatBalSurf->CTFConstInPart(surfNum) + - state.dataHeatBalSurf->IsPoolSurf(surfNum) * state.dataHeatBalFanSys->QPoolSurfNumerator(surfNum) + - iterDampConstant * state.dataHeatBalSurf->TempInsOld(surfNum) + - state.dataHeatBalSurf->IsNotAdiabatic(surfNum) * state.dataHeatBalSurf->CTFCross0(surfNum) * - state.dataHeatBalSurf->TH11Surf(surfNum)) * - state.dataHeatBalSurf->TempDivSurf( - surfNum); // Constant part of conduction eq (history terms) | LW radiation from internal sources | SW - // radiation from internal sources | Convection from surface to zone air | Net radiant - // exchange with other zone surfaces | Heat source/sink term for radiant systems | (if there - // is one present) | Radiant flux from high temp radiant heater | Radiant flux from a hot - // water baseboard heater | Radiant flux from a steam baseboard heater | Radiant flux from - // an electric baseboard heater | Iterative damping term (for stability) | Current - // conduction from | the outside surface | Coefficient for conduction (current time) | - // Convection and damping term | Radiation from AFN ducts - - state.dataHeatBalSurf->TempSurfIn(surfNum) = state.dataHeatBalSurf->TempSurfInTmp(surfNum); + state.dataHeatBalSurf->SurfTempInTmp(surfNum) = + ((!state.dataHeatBalSurf->SurfIsOperatingPool(surfNum)) * + (state.dataHeatBalSurf->SurfTempTerm(surfNum) + state.dataHeatBalSurf->SurfNetLWRadToSurf(surfNum)) + + state.dataHeatBalSurf->SurfIsSourceOrSink(surfNum) * state.dataHeatBalSurf->SurfCTFSourceIn0(surfNum) * + state.dataHeatBalSurf->SurfQSourceSinkHist(surfNum) + + state.dataHeatBalSurf->SurfIsOperatingPool(surfNum) * state.dataHeatBalSurf->SurfCTFConstInPart(surfNum) + + state.dataHeatBalSurf->SurfIsOperatingPool(surfNum) * state.dataHeatBalFanSys->QPoolSurfNumerator(surfNum) + + iterDampConstant * state.dataHeatBalSurf->SurfTempInsOld(surfNum) + + (!state.dataHeatBalSurf->SurfIsAdiabatic(surfNum)) * state.dataHeatBalSurf->SurfCTFCross0(surfNum) * + state.dataHeatBalSurf->SurfTempOutHist(surfNum)) * + state.dataHeatBalSurf->SurfTempDiv(surfNum); + // Constant part of conduction eq (history terms) | LW radiation from internal sources | SW + // radiation from internal sources | Convection from surface to zone air | Net radiant + // exchange with other zone surfaces | Heat source/sink term for radiant systems | (if there + // is one present) | Radiant flux from high temp radiant heater | Radiant flux from a hot + // water baseboard heater | Radiant flux from a steam baseboard heater | Radiant flux from + // an electric baseboard heater | Iterative damping term (for stability) | Current + // conduction from | the outside surface | Coefficient for conduction (current time) | + // Convection and damping term | Radiation from AFN ducts + + state.dataHeatBalSurf->SurfTempIn(surfNum) = state.dataHeatBalSurf->SurfTempInTmp(surfNum); } // Loop over non-window surfaces (includes TubularDaylightingDomes) @@ -7787,24 +7773,24 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, bool movableInsulPresent = state.dataSurface->AnyMovableInsulation && state.dataHeatBalSurf->SurfMovInsulIntPresent(surfNum); if (movableInsulPresent) { // Movable insulation present, recalc surface temps Real64 HMovInsul = state.dataHeatBalSurf->SurfMovInsulHInt(surfNum); - Real64 F1 = HMovInsul / (HMovInsul + state.dataHeatBal->HConvIn(surfNum) + IterDampConst); - state.dataHeatBalSurf->TempSurfIn(surfNum) = - (state.dataHeatBalSurf->CTFConstInPart(surfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(surfNum) + - state.dataHeatBalSurf->CTFCross0(surfNum) * state.dataHeatBalSurf->TH11Surf(surfNum) + + Real64 F1 = HMovInsul / (HMovInsul + state.dataHeatBalSurf->SurfHConvInt(surfNum) + IterDampConst); + state.dataHeatBalSurf->SurfTempIn(surfNum) = + (state.dataHeatBalSurf->SurfCTFConstInPart(surfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(surfNum) + + state.dataHeatBalSurf->SurfCTFCross0(surfNum) * state.dataHeatBalSurf->SurfTempOutHist(surfNum) + F1 * (state.dataHeatBal->SurfQRadThermInAbs(surfNum) + - state.dataHeatBal->HConvIn(surfNum) * state.dataHeatBalSurfMgr->RefAirTemp(surfNum) + + state.dataHeatBalSurf->SurfHConvInt(surfNum) * state.dataHeatBalSurfMgr->RefAirTemp(surfNum) + state.dataHeatBalSurf->SurfNetLWRadToSurf(surfNum) + state.dataHeatBalFanSys->QHTRadSysSurf(surfNum) + state.dataHeatBalFanSys->QCoolingPanelSurf(surfNum) + state.dataHeatBalFanSys->QHWBaseboardSurf(surfNum) + state.dataHeatBalFanSys->QSteamBaseboardSurf(surfNum) + state.dataHeatBalFanSys->QElecBaseboardSurf(surfNum) + state.dataHeatBalSurf->SurfQAdditionalHeatSourceInside(surfNum) + - IterDampConst * state.dataHeatBalSurf->TempInsOld(surfNum))) / - (state.dataHeatBalSurf->CTFInside0(surfNum) + HMovInsul - F1 * HMovInsul); // Convection from surface to zone air - - state.dataHeatBalSurf->TempSurfInTmp(surfNum) = - (state.dataHeatBalSurf->CTFInside0(surfNum) * state.dataHeatBalSurf->TempSurfIn(surfNum) + - HMovInsul * state.dataHeatBalSurf->TempSurfIn(surfNum) - state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(surfNum) - - state.dataHeatBalSurf->CTFConstInPart(surfNum) - - state.dataHeatBalSurf->CTFCross0(surfNum) * state.dataHeatBalSurf->TH11Surf(surfNum)) / + IterDampConst * state.dataHeatBalSurf->SurfTempInsOld(surfNum))) / + (state.dataHeatBalSurf->SurfCTFInside0(surfNum) + HMovInsul - F1 * HMovInsul); // Convection from surface to zone air + + state.dataHeatBalSurf->SurfTempInTmp(surfNum) = + (state.dataHeatBalSurf->SurfCTFInside0(surfNum) * state.dataHeatBalSurf->SurfTempIn(surfNum) + + HMovInsul * state.dataHeatBalSurf->SurfTempIn(surfNum) - state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(surfNum) - + state.dataHeatBalSurf->SurfCTFConstInPart(surfNum) - + state.dataHeatBalSurf->SurfCTFCross0(surfNum) * state.dataHeatBalSurf->SurfTempOutHist(surfNum)) / (HMovInsul); } @@ -7812,11 +7798,11 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, if (state.dataConstruction->Construct(Surface(surfNum).Construction).SourceSinkPresent) { // Set the appropriate parameters for the radiant system // Radiant system does not need the damping coefficient terms (hopefully) - Real64 const RadSysDiv(1.0 / (state.dataHeatBalSurf->CTFInside0(surfNum) + state.dataHeatBal->HConvIn(surfNum))); + Real64 const RadSysDiv(1.0 / (state.dataHeatBalSurf->SurfCTFInside0(surfNum) + state.dataHeatBalSurf->SurfHConvInt(surfNum))); Real64 const TempTerm( - state.dataHeatBalSurf->CTFConstInPart(surfNum) + state.dataHeatBal->SurfQRadThermInAbs(surfNum) + + state.dataHeatBalSurf->SurfCTFConstInPart(surfNum) + state.dataHeatBal->SurfQRadThermInAbs(surfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(surfNum) + state.dataHeatBalSurf->SurfQAdditionalHeatSourceInside(surfNum) + - state.dataHeatBal->HConvIn(surfNum) * state.dataHeatBalSurfMgr->RefAirTemp(surfNum) + + state.dataHeatBalSurf->SurfHConvInt(surfNum) * state.dataHeatBalSurfMgr->RefAirTemp(surfNum) + state.dataHeatBalFanSys->QHTRadSysSurf(surfNum) + state.dataHeatBalFanSys->QCoolingPanelSurf(surfNum) + state.dataHeatBalFanSys->QHWBaseboardSurf(surfNum) + state.dataHeatBalFanSys->QSteamBaseboardSurf(surfNum) + state.dataHeatBalFanSys->QElecBaseboardSurf(surfNum) + state.dataHeatBalSurf->SurfNetLWRadToSurf(surfNum) + @@ -7829,13 +7815,13 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, // heater | Net radiant exchange with other zone surfaces | Cond term (both partition // sides same temp) | Convection and damping term state.dataHeatBalFanSys->RadSysTiHBToutCoef(surfNum) = - state.dataHeatBalSurf->CTFCross0(surfNum) * RadSysDiv; // Outside temp=inside temp for a partition | - // Cond term (both partition sides same temp) | - // Convection and damping term + state.dataHeatBalSurf->SurfCTFCross0(surfNum) * RadSysDiv; // Outside temp=inside temp for a partition | + // Cond term (both partition sides same temp) | + // Convection and damping term state.dataHeatBalFanSys->RadSysTiHBQsrcCoef(surfNum) = - state.dataHeatBalSurf->CTFSourceIn0(surfNum) * RadSysDiv; // QTF term for the source | Cond term (both - // partition sides same temp) | Convection and - // damping term + state.dataHeatBalSurf->SurfCTFSourceIn0(surfNum) * RadSysDiv; // QTF term for the source | Cond term (both + // partition sides same temp) | Convection and + // damping term if (Surface(surfNum).ExtBoundCond > 0) { // This is an interzone partition and we need to set outside params // The inside coefficients of one side are equal to the outside coefficients of the other side. But, @@ -7876,24 +7862,24 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, // Similar to opaque surface but outside surface temp of TDD:DOME is used, and no embedded sources/sinks. // Absorbed shortwave radiation is treated similar to a regular window, but only 1 glass layer is allowed. // = QRadSWwinAbs(surfNum,1)/2.0 - Real64 const HConvIn_surf(state.dataMstBal->HConvInFD(surfNum) = state.dataHeatBal->HConvIn(surfNum)); - state.dataHeatBalSurf->TempSurfIn(surfNum) = state.dataHeatBalSurf->TempSurfInTmp(surfNum) = + Real64 const HConvIn_surf(state.dataMstBal->HConvInFD(surfNum) = state.dataHeatBalSurf->SurfHConvInt(surfNum)); + state.dataHeatBalSurf->SurfTempIn(surfNum) = state.dataHeatBalSurf->SurfTempInTmp(surfNum) = (state.dataHeatBal->SurfQRadThermInAbs(surfNum) + state.dataHeatBal->SurfWinQRadSWwinAbs(surfNum, 1) / 2.0 + state.dataHeatBalSurf->SurfQAdditionalHeatSourceInside(surfNum) + HConvIn_surf * state.dataHeatBalSurfMgr->RefAirTemp(surfNum) + state.dataHeatBalSurf->SurfNetLWRadToSurf(surfNum) + - IterDampConst * state.dataHeatBalSurf->TempInsOld(surfNum) + Ueff * state.dataHeatBalSurf->TH(1, 1, domeNum)) / + IterDampConst * state.dataHeatBalSurf->SurfTempInsOld(surfNum) + Ueff * state.dataHeatBalSurf->TH(1, 1, domeNum)) / (Ueff + HConvIn_surf + IterDampConst); // LW radiation from internal sources | SW radiation from internal sources and // solar | Convection from surface to zone air | Net radiant exchange with // other zone surfaces | Iterative damping term (for stability) | Current // conduction from the outside surface | Coefficient for conduction (current // time) | Convection and damping term - Real64 const Sigma_Temp_4(DataGlobalConstants::StefanBoltzmann * pow_4(state.dataHeatBalSurf->TempSurfIn(surfNum))); + Real64 const Sigma_Temp_4(DataGlobalConstants::StefanBoltzmann * pow_4(state.dataHeatBalSurf->SurfTempIn(surfNum))); // Calculate window heat gain for TDD:DIFFUSER since this calculation is usually done in WindowManager state.dataSurface->SurfWinHeatGain(surfNum) = state.dataSurface->SurfWinTransSolar(surfNum) + - HConvIn_surf * surface.Area * (state.dataHeatBalSurf->TempSurfIn(surfNum) - state.dataHeatBalSurfMgr->RefAirTemp(surfNum)) + + HConvIn_surf * surface.Area * (state.dataHeatBalSurf->SurfTempIn(surfNum) - state.dataHeatBalSurfMgr->RefAirTemp(surfNum)) + state.dataConstruction->Construct(surface.Construction).InsideAbsorpThermal * surface.Area * (Sigma_Temp_4 - (state.dataSurface->SurfWinIRfromParentZone(surfNum) + state.dataHeatBalFanSys->QHTRadSysSurf(surfNum) + @@ -7907,7 +7893,7 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, // fill out report vars for components of Window Heat Gain state.dataSurface->SurfWinGainConvGlazToZoneRep(surfNum) = - HConvIn_surf * surface.Area * (state.dataHeatBalSurf->TempSurfIn(surfNum) - state.dataHeatBalSurfMgr->RefAirTemp(surfNum)); + HConvIn_surf * surface.Area * (state.dataHeatBalSurf->SurfTempIn(surfNum) - state.dataHeatBalSurfMgr->RefAirTemp(surfNum)); state.dataSurface->SurfWinGainIRGlazToZoneRep(surfNum) = state.dataConstruction->Construct(surface.Construction).InsideAbsorpThermal * surface.Area * (Sigma_Temp_4 - @@ -7945,7 +7931,7 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, // Set Exterior Convection Coefficient... if (state.dataSurface->SurfExtConvCoeffIndex(surfNum) > 0) { - state.dataHeatBalSurf->HcExtSurf(surfNum) = ConvectionCoefficients::SetExtConvectionCoeff(state, surfNum); + state.dataHeatBalSurf->SurfHcExt(surfNum) = ConvectionCoefficients::SetExtConvectionCoeff(state, surfNum); } else if (surface.ExtWind) { // Window is exposed to wind (and possibly rain) @@ -7957,13 +7943,13 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, RoughSurf, EmisOut, TH11, - state.dataHeatBalSurf->HcExtSurf(surfNum), - state.dataHeatBalSurf->HSkyExtSurf(surfNum), - state.dataHeatBalSurf->HGrdExtSurf(surfNum), - state.dataHeatBalSurf->HAirExtSurf(surfNum)); + state.dataHeatBalSurf->SurfHcExt(surfNum), + state.dataHeatBalSurf->SurfHSkyExt(surfNum), + state.dataHeatBalSurf->SurfHGrdExt(surfNum), + state.dataHeatBalSurf->SurfHAirExt(surfNum)); if (state.dataEnvrn->IsRain) { // Raining: since wind exposed, outside window surface gets wet - state.dataHeatBalSurf->HcExtSurf(surfNum) = 1000.0; // Reset HcExtSurf because of wetness + state.dataHeatBalSurf->SurfHcExt(surfNum) = 1000.0; // Reset SurfHcExt because of wetness } } else { // Not Wind exposed @@ -7975,28 +7961,28 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, RoughSurf, EmisOut, TH11, - state.dataHeatBalSurf->HcExtSurf(surfNum), - state.dataHeatBalSurf->HSkyExtSurf(surfNum), - state.dataHeatBalSurf->HGrdExtSurf(surfNum), - state.dataHeatBalSurf->HAirExtSurf(surfNum)); + state.dataHeatBalSurf->SurfHcExt(surfNum), + state.dataHeatBalSurf->SurfHSkyExt(surfNum), + state.dataHeatBalSurf->SurfHGrdExt(surfNum), + state.dataHeatBalSurf->SurfHAirExt(surfNum)); } } else { // Interior Surface if (state.dataSurface->SurfExtConvCoeffIndex(surfNum) > 0) { - state.dataHeatBalSurf->HcExtSurf(surfNum) = ConvectionCoefficients::SetExtConvectionCoeff(state, surfNum); + state.dataHeatBalSurf->SurfHcExt(surfNum) = ConvectionCoefficients::SetExtConvectionCoeff(state, surfNum); } else { // Exterior Convection Coefficient for the Interior or Interzone Window is the Interior Convection Coeff of // same - state.dataHeatBalSurf->HcExtSurf(surfNum) = state.dataHeatBal->HConvIn(surface.ExtBoundCond); + state.dataHeatBalSurf->SurfHcExt(surfNum) = state.dataHeatBalSurf->SurfHConvInt(surface.ExtBoundCond); } } // Following call determines inside surface temperature of glazing, and of // frame and/or divider, if present CalcWindowHeatBalance( - state, surfNum, state.dataHeatBalSurf->HcExtSurf(surfNum), state.dataHeatBalSurf->TempSurfInTmp(surfNum), TH11); + state, surfNum, state.dataHeatBalSurf->SurfHcExt(surfNum), state.dataHeatBalSurf->SurfTempInTmp(surfNum), TH11); - state.dataHeatBalSurf->TempSurfIn(surfNum) = state.dataHeatBalSurf->TempSurfInTmp(surfNum); + state.dataHeatBalSurf->SurfTempIn(surfNum) = state.dataHeatBalSurf->SurfTempInTmp(surfNum); } } } @@ -8007,7 +7993,7 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, auto &zone(state.dataHeatBal->Zone(zoneNum)); Real64 &TH11(state.dataHeatBalSurf->TH(1, 1, surfNum)); Real64 &TH12(state.dataHeatBalSurf->TH(2, 1, surfNum)); - TH12 = state.dataHeatBalSurf->TempSurfInRep(surfNum) = state.dataHeatBalSurf->TempSurfIn(surfNum); + TH12 = state.dataHeatBalSurf->SurfTempInRep(surfNum) = state.dataHeatBalSurf->SurfTempIn(surfNum); state.dataHeatBalSurf->SurfTempOut(surfNum) = TH11; // For reporting if (state.dataSurface->SurfWinOriginalClass(surfNum) == SurfaceClass::TDD_Diffuser) { // Tubular daylighting device // Tubular daylighting devices are treated as one big object with an effective R value. @@ -8018,9 +8004,9 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, // Set inside temp variables of TDD:DOME equal to inside temp of TDD:DIFFUSER int domeNum = state.dataDaylightingDevicesData->TDDPipe(state.dataSurface->SurfWinTDDPipeNum(surfNum)).Dome; - state.dataHeatBalSurf->TH(2, 1, domeNum) = state.dataHeatBalSurf->TempSurfIn(domeNum) = - state.dataHeatBalSurf->TempSurfInTmp(domeNum) = state.dataHeatBalSurf->TempSurfInRep(domeNum) = - state.dataHeatBalSurf->TempSurfIn(surfNum); + state.dataHeatBalSurf->TH(2, 1, domeNum) = state.dataHeatBalSurf->SurfTempIn(domeNum) = + state.dataHeatBalSurf->SurfTempInTmp(domeNum) = state.dataHeatBalSurf->SurfTempInRep(domeNum) = + state.dataHeatBalSurf->SurfTempIn(surfNum); // Set outside temp reporting variable of TDD:DOME (since it gets skipped otherwise) // Reset outside temp variables of TDD:DIFFUSER equal to outside temp of TDD:DOME @@ -8048,7 +8034,7 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, // [ SurfNum - 1 ] == ( 1, 1, SurfNum ) // [ l211 + surfExtBoundCond ] == ( 2, 1, surfExtBoundCond ) state.dataHeatBalSurf->SurfTempOut(SurfNum) = state.dataHeatBalSurf->TH[SurfNum - 1] = state.dataHeatBalSurf->TH[l211 + surfExtBoundCond]; - state.dataHeatBalSurf->TH11Surf(SurfNum) = state.dataHeatBalSurf->SurfTempOut(SurfNum); + state.dataHeatBalSurf->SurfTempOutHist(SurfNum) = state.dataHeatBalSurf->SurfTempOut(SurfNum); } ++state.dataHeatBal->InsideSurfIterations; @@ -8059,7 +8045,7 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, int const firstNonWinSurf = state.dataHeatBal->Zone(zoneNum).OpaqOrIntMassSurfaceFirst; int const lastNonWinSurf = state.dataHeatBal->Zone(zoneNum).OpaqOrIntMassSurfaceLast; for (int surfNum = firstNonWinSurf; surfNum <= lastNonWinSurf; ++surfNum) { - Real64 delta = state.dataHeatBalSurf->TempSurfIn(surfNum) - state.dataHeatBalSurf->TempInsOld(surfNum); + Real64 delta = state.dataHeatBalSurf->SurfTempIn(surfNum) - state.dataHeatBalSurf->SurfTempInsOld(surfNum); Real64 absDif = std::abs(delta); MaxDelTemp = std::max(absDif, MaxDelTemp); } @@ -8106,8 +8092,8 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, int const lastSurf = state.dataHeatBal->Zone(zoneNum).OpaqOrWinSurfaceLast; for (int surfNum = firstSurf; surfNum <= lastSurf; ++surfNum) { // Inside Face Convection - sign convention is positive means energy going into inside face from the air. - auto const HConvInTemp_fac(-state.dataHeatBal->HConvIn(surfNum) * - (state.dataHeatBalSurf->TempSurfIn(surfNum) - state.dataHeatBalSurfMgr->RefAirTemp(surfNum))); + auto const HConvInTemp_fac(-state.dataHeatBalSurf->SurfHConvInt(surfNum) * + (state.dataHeatBalSurf->SurfTempIn(surfNum) - state.dataHeatBalSurfMgr->RefAirTemp(surfNum))); state.dataHeatBalSurf->QdotConvInRep(surfNum) = Surface(surfNum).Area * HConvInTemp_fac; state.dataHeatBalSurf->QdotConvInRepPerArea(surfNum) = HConvInTemp_fac; state.dataHeatBalSurf->QConvInReport(surfNum) = state.dataHeatBalSurf->QdotConvInRep(surfNum) * state.dataGlobal->TimeStepZoneSec; @@ -8391,7 +8377,7 @@ void CalcOutsideSurfTemp(EnergyPlusData &state, auto const &construct(state.dataConstruction->Construct(ConstrNum)); if (construct.CTFCross(0) > 0.01) { QuickConductionSurf = true; - F1 = construct.CTFCross(0) / (construct.CTFInside(0) + state.dataHeatBal->HConvIn(SurfNum)); + F1 = construct.CTFCross(0) / (construct.CTFInside(0) + state.dataHeatBalSurf->SurfHConvInt(SurfNum)); } else { QuickConductionSurf = false; } @@ -8424,7 +8410,7 @@ void CalcOutsideSurfTemp(EnergyPlusData &state, int SurfNum2 = state.dataDaylightingDevicesData->TDDPipe(PipeNum).Diffuser; int ZoneNum2 = Surface(SurfNum2).Zone; Real64 Ueff = 1.0 / state.dataDaylightingDevicesData->TDDPipe(PipeNum).Reff; // 1 / effective R value between TDD:DOME and TDD:DIFFUSER - F1 = Ueff / (Ueff + state.dataHeatBal->HConvIn(SurfNum2)); + F1 = Ueff / (Ueff + state.dataHeatBalSurf->SurfHConvInt(SurfNum2)); // Similar to opaque surface but inside conditions of TDD:DIFFUSER are used, and no embedded sources/sinks. // Absorbed shortwave radiation is treated similar to a regular window, but only 1 glass layer is allowed. @@ -8434,14 +8420,14 @@ void CalcOutsideSurfTemp(EnergyPlusData &state, //+Construct(ConstrNum)%CTFSourceIn(0) & TDDs cannot be radiant systems // *QsrcHist(1,SurfNum) & TH11 = (state.dataHeatBal->SurfWinQRadSWwinAbs(SurfNum, 1) / 2.0 + state.dataHeatBalSurf->SurfQRadLWOutSrdSurfs(SurfNum) + - (state.dataHeatBalSurf->HcExtSurf(SurfNum) + state.dataHeatBalSurf->HAirExtSurf(SurfNum)) * TempExt + - state.dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(SurfNum) + state.dataHeatBalSurf->HSkyExtSurf(SurfNum) * TSky + - state.dataHeatBalSurf->HGrdExtSurf(SurfNum) * TGround + + (state.dataHeatBalSurf->SurfHcExt(SurfNum) + state.dataHeatBalSurf->SurfHAirExt(SurfNum)) * TempExt + + state.dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(SurfNum) + state.dataHeatBalSurf->SurfHSkyExt(SurfNum) * TSky + + state.dataHeatBalSurf->SurfHGrdExt(SurfNum) * TGround + F1 * (state.dataHeatBal->SurfWinQRadSWwinAbs(SurfNum2, 1) / 2.0 + state.dataHeatBal->SurfQRadThermInAbs(SurfNum2) + - state.dataHeatBal->HConvIn(SurfNum2) * state.dataHeatBalFanSys->MAT(ZoneNum2) + + state.dataHeatBalSurf->SurfHConvInt(SurfNum2) * state.dataHeatBalFanSys->MAT(ZoneNum2) + state.dataHeatBalSurf->SurfNetLWRadToSurf(SurfNum2))) / - (Ueff + state.dataHeatBalSurf->HcExtSurf(SurfNum) + state.dataHeatBalSurf->HAirExtSurf(SurfNum) + - state.dataHeatBalSurf->HSkyExtSurf(SurfNum) + state.dataHeatBalSurf->HGrdExtSurf(SurfNum) - + (Ueff + state.dataHeatBalSurf->SurfHcExt(SurfNum) + state.dataHeatBalSurf->SurfHAirExt(SurfNum) + + state.dataHeatBalSurf->SurfHSkyExt(SurfNum) + state.dataHeatBalSurf->SurfHGrdExt(SurfNum) - F1 * Ueff); // Instead of QRadSWOutAbs(SurfNum) | ODB used to approx ground surface temp | Use TDD:DIFFUSER surface | Use // TDD:DIFFUSER surface | Use TDD:DIFFUSER surface and zone | Use TDD:DIFFUSER surface @@ -8450,24 +8436,24 @@ void CalcOutsideSurfTemp(EnergyPlusData &state, // Add LWR from surrounding surfaces if (Surface(SurfNum).OSCMPtr == 0) { if (construct.SourceSinkPresent) { - TH11 = (-state.dataHeatBalSurf->CTFConstOutPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWOutAbs(SurfNum) + + TH11 = (-state.dataHeatBalSurf->SurfCTFConstOutPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWOutAbs(SurfNum) + state.dataHeatBalSurf->SurfQRadLWOutSrdSurfs(SurfNum) + - (state.dataHeatBalSurf->HcExtSurf(SurfNum) + state.dataHeatBalSurf->HAirExtSurf(SurfNum)) * TempExt + - state.dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(SurfNum) + state.dataHeatBalSurf->HSkyExtSurf(SurfNum) * TSky + - state.dataHeatBalSurf->HGrdExtSurf(SurfNum) * TGround + construct.CTFCross(0) * state.dataHeatBalSurf->TempSurfIn(SurfNum) + + (state.dataHeatBalSurf->SurfHcExt(SurfNum) + state.dataHeatBalSurf->SurfHAirExt(SurfNum)) * TempExt + + state.dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(SurfNum) + state.dataHeatBalSurf->SurfHSkyExt(SurfNum) * TSky + + state.dataHeatBalSurf->SurfHGrdExt(SurfNum) * TGround + construct.CTFCross(0) * state.dataHeatBalSurf->SurfTempIn(SurfNum) + construct.CTFSourceOut(0) * state.dataHeatBalSurf->QsrcHist(SurfNum, 1)) / - (construct.CTFOutside(0) + state.dataHeatBalSurf->HcExtSurf(SurfNum) + state.dataHeatBalSurf->HAirExtSurf(SurfNum) + - state.dataHeatBalSurf->HSkyExtSurf(SurfNum) + - state.dataHeatBalSurf->HGrdExtSurf(SurfNum)); // ODB used to approx ground surface temp + (construct.CTFOutside(0) + state.dataHeatBalSurf->SurfHcExt(SurfNum) + state.dataHeatBalSurf->SurfHAirExt(SurfNum) + + state.dataHeatBalSurf->SurfHSkyExt(SurfNum) + + state.dataHeatBalSurf->SurfHGrdExt(SurfNum)); // ODB used to approx ground surface temp } else { - TH11 = (-state.dataHeatBalSurf->CTFConstOutPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWOutAbs(SurfNum) + + TH11 = (-state.dataHeatBalSurf->SurfCTFConstOutPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWOutAbs(SurfNum) + state.dataHeatBalSurf->SurfQRadLWOutSrdSurfs(SurfNum) + - (state.dataHeatBalSurf->HcExtSurf(SurfNum) + state.dataHeatBalSurf->HAirExtSurf(SurfNum)) * TempExt + - state.dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(SurfNum) + state.dataHeatBalSurf->HSkyExtSurf(SurfNum) * TSky + - state.dataHeatBalSurf->HGrdExtSurf(SurfNum) * TGround + construct.CTFCross(0) * state.dataHeatBalSurf->TempSurfIn(SurfNum)) / - (construct.CTFOutside(0) + state.dataHeatBalSurf->HcExtSurf(SurfNum) + state.dataHeatBalSurf->HAirExtSurf(SurfNum) + - state.dataHeatBalSurf->HSkyExtSurf(SurfNum) + - state.dataHeatBalSurf->HGrdExtSurf(SurfNum)); // ODB used to approx ground surface temp + (state.dataHeatBalSurf->SurfHcExt(SurfNum) + state.dataHeatBalSurf->SurfHAirExt(SurfNum)) * TempExt + + state.dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(SurfNum) + state.dataHeatBalSurf->SurfHSkyExt(SurfNum) * TSky + + state.dataHeatBalSurf->SurfHGrdExt(SurfNum) * TGround + construct.CTFCross(0) * state.dataHeatBalSurf->SurfTempIn(SurfNum)) / + (construct.CTFOutside(0) + state.dataHeatBalSurf->SurfHcExt(SurfNum) + state.dataHeatBalSurf->SurfHAirExt(SurfNum) + + state.dataHeatBalSurf->SurfHSkyExt(SurfNum) + + state.dataHeatBalSurf->SurfHGrdExt(SurfNum)); // ODB used to approx ground surface temp } // Outside Heat Balance case: Other Side Conditions Model } else { //( Surface(SurfNum)%OSCMPtr > 0 ) THEN @@ -8479,16 +8465,16 @@ void CalcOutsideSurfTemp(EnergyPlusData &state, // patterned after "No movable insulation, slow conduction," but with new radiation terms and no sun, if (construct.SourceSinkPresent) { - TH11 = (-state.dataHeatBalSurf->CTFConstOutPart(SurfNum) + state.dataHeatBalSurf->HcExtSurf(SurfNum) * TempExt + + TH11 = (-state.dataHeatBalSurf->SurfCTFConstOutPart(SurfNum) + state.dataHeatBalSurf->SurfHcExt(SurfNum) * TempExt + state.dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(SurfNum) + HRad * RadTemp + - construct.CTFCross(0) * state.dataHeatBalSurf->TempSurfIn(SurfNum) + + construct.CTFCross(0) * state.dataHeatBalSurf->SurfTempIn(SurfNum) + construct.CTFSourceOut(0) * state.dataHeatBalSurf->QsrcHist(SurfNum, 1)) / - (construct.CTFOutside(0) + state.dataHeatBalSurf->HcExtSurf(SurfNum) + HRad); + (construct.CTFOutside(0) + state.dataHeatBalSurf->SurfHcExt(SurfNum) + HRad); } else { - TH11 = (-state.dataHeatBalSurf->CTFConstOutPart(SurfNum) + state.dataHeatBalSurf->HcExtSurf(SurfNum) * TempExt + + TH11 = (-state.dataHeatBalSurf->SurfCTFConstOutPart(SurfNum) + state.dataHeatBalSurf->SurfHcExt(SurfNum) * TempExt + state.dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(SurfNum) + HRad * RadTemp + - construct.CTFCross(0) * state.dataHeatBalSurf->TempSurfIn(SurfNum)) / - (construct.CTFOutside(0) + state.dataHeatBalSurf->HcExtSurf(SurfNum) + HRad); + construct.CTFCross(0) * state.dataHeatBalSurf->SurfTempIn(SurfNum)) / + (construct.CTFOutside(0) + state.dataHeatBalSurf->SurfHcExt(SurfNum) + HRad); } } // Outside heat balance case: No movable insulation, quick conduction @@ -8496,30 +8482,30 @@ void CalcOutsideSurfTemp(EnergyPlusData &state, if (Surface(SurfNum).OSCMPtr == 0) { if (construct.SourceSinkPresent) { TH11 = - (-state.dataHeatBalSurf->CTFConstOutPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWOutAbs(SurfNum) + + (-state.dataHeatBalSurf->SurfCTFConstOutPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWOutAbs(SurfNum) + state.dataHeatBalSurf->SurfQRadLWOutSrdSurfs(SurfNum) + - (state.dataHeatBalSurf->HcExtSurf(SurfNum) + state.dataHeatBalSurf->HAirExtSurf(SurfNum)) * TempExt + - state.dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(SurfNum) + state.dataHeatBalSurf->HSkyExtSurf(SurfNum) * TSky + - state.dataHeatBalSurf->HGrdExtSurf(SurfNum) * TGround + construct.CTFSourceOut(0) * state.dataHeatBalSurf->QsrcHist(SurfNum, 1) + - F1 * (state.dataHeatBalSurf->CTFConstInPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(SurfNum) + + (state.dataHeatBalSurf->SurfHcExt(SurfNum) + state.dataHeatBalSurf->SurfHAirExt(SurfNum)) * TempExt + + state.dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(SurfNum) + state.dataHeatBalSurf->SurfHSkyExt(SurfNum) * TSky + + state.dataHeatBalSurf->SurfHGrdExt(SurfNum) * TGround + construct.CTFSourceOut(0) * state.dataHeatBalSurf->QsrcHist(SurfNum, 1) + + F1 * (state.dataHeatBalSurf->SurfCTFConstInPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(SurfNum) + state.dataHeatBal->SurfQRadThermInAbs(SurfNum) + - state.dataHeatBal->HConvIn(SurfNum) * state.dataHeatBalFanSys->MAT(ZoneNum) + + state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBalSurf->SurfNetLWRadToSurf(SurfNum))) / - (construct.CTFOutside(0) + state.dataHeatBalSurf->HcExtSurf(SurfNum) + state.dataHeatBalSurf->HAirExtSurf(SurfNum) + - state.dataHeatBalSurf->HSkyExtSurf(SurfNum) + state.dataHeatBalSurf->HGrdExtSurf(SurfNum) - + (construct.CTFOutside(0) + state.dataHeatBalSurf->SurfHcExt(SurfNum) + state.dataHeatBalSurf->SurfHAirExt(SurfNum) + + state.dataHeatBalSurf->SurfHSkyExt(SurfNum) + state.dataHeatBalSurf->SurfHGrdExt(SurfNum) - F1 * construct.CTFCross(0)); // ODB used to approx ground surface temp | MAT use here is problem for room air models } else { - TH11 = (-state.dataHeatBalSurf->CTFConstOutPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWOutAbs(SurfNum) + + TH11 = (-state.dataHeatBalSurf->SurfCTFConstOutPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWOutAbs(SurfNum) + state.dataHeatBalSurf->SurfQRadLWOutSrdSurfs(SurfNum) + - (state.dataHeatBalSurf->HcExtSurf(SurfNum) + state.dataHeatBalSurf->HAirExtSurf(SurfNum)) * TempExt + - state.dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(SurfNum) + state.dataHeatBalSurf->HSkyExtSurf(SurfNum) * TSky + - state.dataHeatBalSurf->HGrdExtSurf(SurfNum) * TGround + - F1 * (state.dataHeatBalSurf->CTFConstInPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(SurfNum) + + (state.dataHeatBalSurf->SurfHcExt(SurfNum) + state.dataHeatBalSurf->SurfHAirExt(SurfNum)) * TempExt + + state.dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(SurfNum) + state.dataHeatBalSurf->SurfHSkyExt(SurfNum) * TSky + + state.dataHeatBalSurf->SurfHGrdExt(SurfNum) * TGround + + F1 * (state.dataHeatBalSurf->SurfCTFConstInPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(SurfNum) + state.dataHeatBal->SurfQRadThermInAbs(SurfNum) + - state.dataHeatBal->HConvIn(SurfNum) * state.dataHeatBalFanSys->MAT(ZoneNum) + + state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBalSurf->SurfNetLWRadToSurf(SurfNum))) / - (construct.CTFOutside(0) + state.dataHeatBalSurf->HcExtSurf(SurfNum) + state.dataHeatBalSurf->HAirExtSurf(SurfNum) + - state.dataHeatBalSurf->HSkyExtSurf(SurfNum) + state.dataHeatBalSurf->HGrdExtSurf(SurfNum) - + (construct.CTFOutside(0) + state.dataHeatBalSurf->SurfHcExt(SurfNum) + state.dataHeatBalSurf->SurfHAirExt(SurfNum) + + state.dataHeatBalSurf->SurfHSkyExt(SurfNum) + state.dataHeatBalSurf->SurfHGrdExt(SurfNum) - F1 * construct.CTFCross(0)); // ODB used to approx ground surface temp | MAT use here is problem for room air models } // Outside Heat Balance case: Other Side Conditions Model @@ -8530,63 +8516,64 @@ void CalcOutsideSurfTemp(EnergyPlusData &state, // patterned after "No movable insulation, quick conduction," but with new radiation terms and no sun, if (construct.SourceSinkPresent) { TH11 = - (-state.dataHeatBalSurf->CTFConstOutPart(SurfNum) + state.dataHeatBalSurf->HcExtSurf(SurfNum) * TempExt + + (-state.dataHeatBalSurf->SurfCTFConstOutPart(SurfNum) + state.dataHeatBalSurf->SurfHcExt(SurfNum) * TempExt + state.dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(SurfNum) + HRad * RadTemp + construct.CTFSourceOut(0) * state.dataHeatBalSurf->QsrcHist(SurfNum, 1) + - F1 * (state.dataHeatBalSurf->CTFConstInPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(SurfNum) + + F1 * (state.dataHeatBalSurf->SurfCTFConstInPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(SurfNum) + state.dataHeatBal->SurfQRadThermInAbs(SurfNum) + construct.CTFSourceIn(0) * state.dataHeatBalSurf->QsrcHist(SurfNum, 1) + - state.dataHeatBal->HConvIn(SurfNum) * state.dataHeatBalFanSys->MAT(ZoneNum) + + state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBalSurf->SurfNetLWRadToSurf(SurfNum))) / - (construct.CTFOutside(0) + state.dataHeatBalSurf->HcExtSurf(SurfNum) + HRad - + (construct.CTFOutside(0) + state.dataHeatBalSurf->SurfHcExt(SurfNum) + HRad - F1 * construct.CTFCross(0)); // MAT use here is problem for room air models } else { - TH11 = (-state.dataHeatBalSurf->CTFConstOutPart(SurfNum) + state.dataHeatBalSurf->HcExtSurf(SurfNum) * TempExt + + TH11 = (-state.dataHeatBalSurf->SurfCTFConstOutPart(SurfNum) + state.dataHeatBalSurf->SurfHcExt(SurfNum) * TempExt + state.dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(SurfNum) + HRad * RadTemp + - F1 * (state.dataHeatBalSurf->CTFConstInPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(SurfNum) + + F1 * (state.dataHeatBalSurf->SurfCTFConstInPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(SurfNum) + state.dataHeatBal->SurfQRadThermInAbs(SurfNum) + - state.dataHeatBal->HConvIn(SurfNum) * state.dataHeatBalFanSys->MAT(ZoneNum) + + state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBalSurf->SurfNetLWRadToSurf(SurfNum))) / - (construct.CTFOutside(0) + state.dataHeatBalSurf->HcExtSurf(SurfNum) + HRad - + (construct.CTFOutside(0) + state.dataHeatBalSurf->SurfHcExt(SurfNum) + HRad - F1 * construct.CTFCross(0)); // MAT use here is problem for room air models } } // Outside heat balance case: Movable insulation, slow conduction } else if ((MovInsulPresent) && (!QuickConductionSurf)) { - F2 = HMovInsul / (HMovInsul + state.dataHeatBalSurf->HcExtSurf(SurfNum) + state.dataHeatBalSurf->HAirExtSurf(SurfNum) + - state.dataHeatBalSurf->HSkyExtSurf(SurfNum) + state.dataHeatBalSurf->HGrdExtSurf(SurfNum)); + F2 = HMovInsul / (HMovInsul + state.dataHeatBalSurf->SurfHcExt(SurfNum) + state.dataHeatBalSurf->SurfHAirExt(SurfNum) + + state.dataHeatBalSurf->SurfHSkyExt(SurfNum) + state.dataHeatBalSurf->SurfHGrdExt(SurfNum)); - TH11 = (-state.dataHeatBalSurf->CTFConstOutPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWOutAbs(SurfNum) + - state.dataHeatBalSurf->SurfQRadLWOutSrdSurfs(SurfNum) + construct.CTFCross(0) * state.dataHeatBalSurf->TempSurfIn(SurfNum) + + TH11 = (-state.dataHeatBalSurf->SurfCTFConstOutPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWOutAbs(SurfNum) + + state.dataHeatBalSurf->SurfQRadLWOutSrdSurfs(SurfNum) + construct.CTFCross(0) * state.dataHeatBalSurf->SurfTempIn(SurfNum) + F2 * (state.dataHeatBalSurf->SurfQRadSWOutMvIns(SurfNum) + - (state.dataHeatBalSurf->HcExtSurf(SurfNum) + state.dataHeatBalSurf->HAirExtSurf(SurfNum)) * TempExt + - state.dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(SurfNum) + state.dataHeatBalSurf->HSkyExtSurf(SurfNum) * TSky + - state.dataHeatBalSurf->HGrdExtSurf(SurfNum) * TGround)) / + (state.dataHeatBalSurf->SurfHcExt(SurfNum) + state.dataHeatBalSurf->SurfHAirExt(SurfNum)) * TempExt + + state.dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(SurfNum) + state.dataHeatBalSurf->SurfHSkyExt(SurfNum) * TSky + + state.dataHeatBalSurf->SurfHGrdExt(SurfNum) * TGround)) / (construct.CTFOutside(0) + HMovInsul - F2 * HMovInsul); // ODB used to approx ground surface temp // Outside heat balance case: Movable insulation, quick conduction } else if ((MovInsulPresent) && (QuickConductionSurf)) { - F2 = HMovInsul / (HMovInsul + state.dataHeatBalSurf->HcExtSurf(SurfNum) + state.dataHeatBalSurf->HAirExtSurf(SurfNum) + - state.dataHeatBalSurf->HSkyExtSurf(SurfNum) + state.dataHeatBalSurf->HGrdExtSurf(SurfNum)); + F2 = HMovInsul / (HMovInsul + state.dataHeatBalSurf->SurfHcExt(SurfNum) + state.dataHeatBalSurf->SurfHAirExt(SurfNum) + + state.dataHeatBalSurf->SurfHSkyExt(SurfNum) + state.dataHeatBalSurf->SurfHGrdExt(SurfNum)); - TH11 = (-state.dataHeatBalSurf->CTFConstOutPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWOutAbs(SurfNum) + + TH11 = (-state.dataHeatBalSurf->SurfCTFConstOutPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWOutAbs(SurfNum) + state.dataHeatBalSurf->SurfQRadLWOutSrdSurfs(SurfNum) + - F1 * (state.dataHeatBalSurf->CTFConstInPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(SurfNum) + - state.dataHeatBal->SurfQRadThermInAbs(SurfNum) + state.dataHeatBal->HConvIn(SurfNum) * state.dataHeatBalFanSys->MAT(ZoneNum) + + F1 * (state.dataHeatBalSurf->SurfCTFConstInPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(SurfNum) + + state.dataHeatBal->SurfQRadThermInAbs(SurfNum) + + state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBalSurf->SurfNetLWRadToSurf(SurfNum)) + F2 * (state.dataHeatBalSurf->SurfQRadSWOutMvIns(SurfNum) + - (state.dataHeatBalSurf->HcExtSurf(SurfNum) + state.dataHeatBalSurf->HAirExtSurf(SurfNum)) * TempExt + - state.dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(SurfNum) + state.dataHeatBalSurf->HSkyExtSurf(SurfNum) * TSky + - state.dataHeatBalSurf->HGrdExtSurf(SurfNum) * TGround)) / + (state.dataHeatBalSurf->SurfHcExt(SurfNum) + state.dataHeatBalSurf->SurfHAirExt(SurfNum)) * TempExt + + state.dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(SurfNum) + state.dataHeatBalSurf->SurfHSkyExt(SurfNum) * TSky + + state.dataHeatBalSurf->SurfHGrdExt(SurfNum) * TGround)) / (construct.CTFOutside(0) + HMovInsul - F2 * HMovInsul - F1 * construct.CTFCross(0)); // ODB used to approx ground surface temp } // ...end of outside heat balance cases IF-THEN block // multiply out linearized radiation coeffs for reporting - Real64 const HExtSurf_fac(-(state.dataHeatBalSurf->HSkyExtSurf(SurfNum) * (TH11 - TSky) + - state.dataHeatBalSurf->HAirExtSurf(SurfNum) * (TH11 - TempExt) + - state.dataHeatBalSurf->HGrdExtSurf(SurfNum) * (TH11 - TGround))); + Real64 const HExtSurf_fac(-(state.dataHeatBalSurf->SurfHSkyExt(SurfNum) * (TH11 - TSky) + + state.dataHeatBalSurf->SurfHAirExt(SurfNum) * (TH11 - TempExt) + + state.dataHeatBalSurf->SurfHGrdExt(SurfNum) * (TH11 - TGround))); Real64 QRadLWOutSrdSurfsRep; QRadLWOutSrdSurfsRep = 0; // Report LWR from surrounding surfaces for current exterior surf temp @@ -8609,7 +8596,7 @@ void CalcOutsideSurfTemp(EnergyPlusData &state, state.dataHeatBalSurf->QRadOutReport(SurfNum) = state.dataHeatBalSurf->QdotRadOutRep(SurfNum) * state.dataGlobal->TimeStepZoneSec; // Calculate surface heat emission to the air, positive values indicates heat transfer from surface to the outside - state.dataHeatBalSurf->QAirExtReport(SurfNum) = Surface(SurfNum).Area * state.dataHeatBalSurf->HAirExtSurf(SurfNum) * + state.dataHeatBalSurf->QAirExtReport(SurfNum) = Surface(SurfNum).Area * state.dataHeatBalSurf->SurfHAirExt(SurfNum) * (state.dataHeatBalSurf->TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum)); // Set the radiant system heat balance coefficients if this surface is also a radiant system @@ -8629,15 +8616,15 @@ void CalcOutsideSurfTemp(EnergyPlusData &state, return; } else { - Real64 const RadSysDiv(1.0 / (construct.CTFOutside(0) + state.dataHeatBalSurf->HcExtSurf(SurfNum) + - state.dataHeatBalSurf->HAirExtSurf(SurfNum) + state.dataHeatBalSurf->HSkyExtSurf(SurfNum) + - state.dataHeatBalSurf->HGrdExtSurf(SurfNum))); + Real64 const RadSysDiv(1.0 / (construct.CTFOutside(0) + state.dataHeatBalSurf->SurfHcExt(SurfNum) + + state.dataHeatBalSurf->SurfHAirExt(SurfNum) + state.dataHeatBalSurf->SurfHSkyExt(SurfNum) + + state.dataHeatBalSurf->SurfHGrdExt(SurfNum))); state.dataHeatBalFanSys->RadSysToHBConstCoef(SurfNum) = - (-state.dataHeatBalSurf->CTFConstOutPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWOutAbs(SurfNum) + + (-state.dataHeatBalSurf->SurfCTFConstOutPart(SurfNum) + state.dataHeatBalSurf->SurfOpaqQRadSWOutAbs(SurfNum) + state.dataHeatBalSurf->SurfQRadLWOutSrdSurfs(SurfNum) + - (state.dataHeatBalSurf->HcExtSurf(SurfNum) + state.dataHeatBalSurf->HAirExtSurf(SurfNum)) * TempExt + - state.dataHeatBalSurf->HSkyExtSurf(SurfNum) * TSky + state.dataHeatBalSurf->HGrdExtSurf(SurfNum) * TGround) * + (state.dataHeatBalSurf->SurfHcExt(SurfNum) + state.dataHeatBalSurf->SurfHAirExt(SurfNum)) * TempExt + + state.dataHeatBalSurf->SurfHSkyExt(SurfNum) * TSky + state.dataHeatBalSurf->SurfHGrdExt(SurfNum) * TGround) * RadSysDiv; // ODB used to approx ground surface temp state.dataHeatBalFanSys->RadSysToHBTinCoef(SurfNum) = construct.CTFCross(0) * RadSysDiv; diff --git a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc index bd6b956902f..9144be9f5a3 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc @@ -612,7 +612,7 @@ void GshpPeCoolingSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad) Real64 CompressInletTemp; // Compressor inlet temperature Real64 MassRef; // mass flow rate of refrigerant Real64 SourceSideOutletEnth; // Enthalpy at Source Side pressure - Real64 LoadSideOutletEnth; // Enthalpy at Condensor Pressure + Real64 LoadSideOutletEnth; // Enthalpy at Condenser Pressure Real64 initialQSource; // Guess Source Side Heat rate Real64 initialQLoad; // Guess Load Side Heat rate Real64 qual; // quality @@ -994,5 +994,8 @@ void GshpPeCoolingSpecs::update(EnergyPlusData &state) this->LoadSideWaterInletTemp = state.dataLoopNodes->Node(this->LoadSideInletNodeNum).Temp; } } +void GshpPeCoolingSpecs::oneTimeInit([[maybe_unused]] EnergyPlusData &state) +{ +} } // namespace EnergyPlus::HeatPumpWaterToWaterCOOLING diff --git a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.hh b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.hh index aa1a7ed9fec..12940d68d4b 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.hh +++ b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.hh @@ -161,6 +161,8 @@ namespace HeatPumpWaterToWaterCOOLING { void calculate(EnergyPlusData &state, Real64 &MyLoad); void update(EnergyPlusData &state); + + void oneTimeInit(EnergyPlusData &state) override; }; void GetGshpInput(EnergyPlusData &state); diff --git a/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc b/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc index 8087dff1ce3..fcbb83dd733 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc @@ -948,5 +948,8 @@ void GshpPeHeatingSpecs::update(EnergyPlusData &state) this->QLoadEnergy = QLoad * ReportingConstant; } } +void GshpPeHeatingSpecs::oneTimeInit([[maybe_unused]] EnergyPlusData &state) +{ +} } // namespace EnergyPlus::HeatPumpWaterToWaterHEATING diff --git a/src/EnergyPlus/HeatPumpWaterToWaterHEATING.hh b/src/EnergyPlus/HeatPumpWaterToWaterHEATING.hh index 0d3031c2a24..c1f879e5ee7 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterHEATING.hh +++ b/src/EnergyPlus/HeatPumpWaterToWaterHEATING.hh @@ -159,6 +159,8 @@ namespace HeatPumpWaterToWaterHEATING { void calculate(EnergyPlusData &state, Real64 &MyLoad); void update(EnergyPlusData &state); + + void oneTimeInit(EnergyPlusData &state) override; }; void GetGshpInput(EnergyPlusData &state); diff --git a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc index cd62687ca39..4842d384db5 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc @@ -2078,5 +2078,8 @@ void GshpSpecs::UpdateGSHPRecords(EnergyPlusData &state) state.dataLoopNodes->Node(SourceSideOutletNode).Temp = this->reportSourceSideOutletTemp; state.dataLoopNodes->Node(LoadSideOutletNode).Temp = this->reportLoadSideOutletTemp; } +void GshpSpecs::oneTimeInit([[maybe_unused]] EnergyPlusData &state) +{ +} } // namespace EnergyPlus::HeatPumpWaterToWaterSimple diff --git a/src/EnergyPlus/HeatPumpWaterToWaterSimple.hh b/src/EnergyPlus/HeatPumpWaterToWaterSimple.hh index 828a5af818a..3c442e793c8 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterSimple.hh +++ b/src/EnergyPlus/HeatPumpWaterToWaterSimple.hh @@ -202,6 +202,8 @@ namespace HeatPumpWaterToWaterSimple { void UpdateGSHPRecords(EnergyPlusData &state); void onInitLoopEquip(EnergyPlusData &state, const PlantLocation &calledFromLocation) override; + + void oneTimeInit(EnergyPlusData &state) override; }; } // namespace HeatPumpWaterToWaterSimple diff --git a/src/EnergyPlus/HighTempRadiantSystem.cc b/src/EnergyPlus/HighTempRadiantSystem.cc index d74c435e20e..83776b68857 100644 --- a/src/EnergyPlus/HighTempRadiantSystem.cc +++ b/src/EnergyPlus/HighTempRadiantSystem.cc @@ -1469,20 +1469,19 @@ namespace HighTempRadiantSystem { if (state.dataSurface->SurfWinFrameArea(SurfNum) > 0.0) { // Window frame contribution - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * - (1.0 + state.dataSurface->SurfWinProjCorrFrIn(SurfNum)) * state.dataSurface->SurfWinFrameTempSurfIn(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * + (1.0 + state.dataSurface->SurfWinProjCorrFrIn(SurfNum)) * state.dataSurface->SurfWinFrameTempIn(SurfNum); } if (state.dataSurface->SurfWinDividerArea(SurfNum) > 0.0 && !ANY_INTERIOR_SHADE_BLIND(state.dataSurface->SurfWinShadingFlag(SurfNum))) { // Window divider contribution (only from shade or blind for window with divider and interior shade or blind) - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * - (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum)) * - state.dataSurface->SurfWinDividerTempSurfIn(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * + (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum)) * state.dataSurface->SurfWinDividerTempIn(SurfNum); } } - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * Area * state.dataHeatBalSurf->TempSurfInTmp(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * Area * state.dataHeatBalSurf->SurfTempInTmp(SurfNum); } return SumHATsurf; diff --git a/src/EnergyPlus/ICEngineElectricGenerator.cc b/src/EnergyPlus/ICEngineElectricGenerator.cc index cf169dd816f..d87f5ab137d 100644 --- a/src/EnergyPlus/ICEngineElectricGenerator.cc +++ b/src/EnergyPlus/ICEngineElectricGenerator.cc @@ -479,7 +479,6 @@ namespace ICEngineElectricGenerator { Real64 const ExhaustCP(1.047); // Exhaust Gas Specific Heat (J/kg-K) Real64 const KJtoJ(1000.0); // convert Kjoules to joules - static std::string const RoutineName("CalcICEngineGeneratorModel"); // Heat Recovery Fluid Mass FlowRate (kg/s) Real64 HeatRecMdot; @@ -694,7 +693,7 @@ namespace ICEngineElectricGenerator { // The chiller sets the flow on the loop first by the input design flow rate and then // performs a check to verify that - static std::string const RoutineName("CalcICEngineGeneratorModel"); + static constexpr std::string_view RoutineName("CalcICEngineGeneratorModel"); // Need to set the HeatRecRatio to 1.0 if it is not modified HRecRatio = 1.0; @@ -760,61 +759,7 @@ namespace ICEngineElectricGenerator { // METHODOLOGY EMPLOYED: // Uses the status flags to trigger initializations. - static std::string const RoutineName("InitICEngineGenerators"); - - bool errFlag; - - if (this->myFlag) { - this->setupOutputVars(state); - this->myFlag = false; - } - - if (this->MyPlantScanFlag && allocated(state.dataPlnt->PlantLoop) && this->HeatRecActive) { - errFlag = false; - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - DataPlant::TypeOf_Generator_ICEngine, - this->HRLoopNum, - this->HRLoopSideNum, - this->HRBranchNum, - this->HRCompNum, - errFlag, - _, - _, - _, - _, - _); - if (errFlag) { - ShowFatalError(state, "InitICEngineGenerators: Program terminated due to previous condition(s)."); - } - - this->MyPlantScanFlag = false; - } - - if (this->MySizeAndNodeInitFlag && (!this->MyPlantScanFlag) && this->HeatRecActive) { - - // size mass flow rate - Real64 rho = FluidProperties::GetDensityGlycol(state, - state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, - DataGlobalConstants::InitConvTemp, - state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, - RoutineName); - - this->DesignHeatRecMassFlowRate = rho * this->DesignHeatRecVolFlowRate; - this->HeatRecMdotDesign = this->DesignHeatRecMassFlowRate; - - PlantUtilities::InitComponentNodes(state, - 0.0, - this->DesignHeatRecMassFlowRate, - this->HeatRecInletNodeNum, - this->HeatRecOutletNodeNum, - this->HRLoopNum, - this->HRLoopSideNum, - this->HRBranchNum, - this->HRCompNum); - - this->MySizeAndNodeInitFlag = false; - } // end one time inits + this->oneTimeInit(state); // end one time inits // Do the Begin Environment initializations if (state.dataGlobal->BeginEnvrnFlag && this->MyEnvrnFlag && this->HeatRecActive) { @@ -878,6 +823,64 @@ namespace ICEngineElectricGenerator { state.dataLoopNodes->Node(HeatRecOutletNode).Temp = this->HeatRecOutletTemp; } } + void ICEngineGeneratorSpecs::oneTimeInit(EnergyPlusData &state) + { + static constexpr std::string_view RoutineName("InitICEngineGenerators"); + + bool errFlag; + + if (this->myFlag) { + this->setupOutputVars(state); + this->myFlag = false; + } + + if (this->MyPlantScanFlag && allocated(state.dataPlnt->PlantLoop) && this->HeatRecActive) { + errFlag = false; + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + DataPlant::TypeOf_Generator_ICEngine, + this->HRLoopNum, + this->HRLoopSideNum, + this->HRBranchNum, + this->HRCompNum, + errFlag, + _, + _, + _, + _, + _); + if (errFlag) { + ShowFatalError(state, "InitICEngineGenerators: Program terminated due to previous condition(s)."); + } + + this->MyPlantScanFlag = false; + } + + if (this->MySizeAndNodeInitFlag && (!this->MyPlantScanFlag) && this->HeatRecActive) { + + // size mass flow rate + Real64 rho = FluidProperties::GetDensityGlycol(state, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, + DataGlobalConstants::InitConvTemp, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, + RoutineName); + + this->DesignHeatRecMassFlowRate = rho * this->DesignHeatRecVolFlowRate; + this->HeatRecMdotDesign = this->DesignHeatRecMassFlowRate; + + PlantUtilities::InitComponentNodes(state, + 0.0, + this->DesignHeatRecMassFlowRate, + this->HeatRecInletNodeNum, + this->HeatRecOutletNodeNum, + this->HRLoopNum, + this->HRLoopSideNum, + this->HRBranchNum, + this->HRCompNum); + + this->MySizeAndNodeInitFlag = false; + } + } } // namespace ICEngineElectricGenerator diff --git a/src/EnergyPlus/ICEngineElectricGenerator.hh b/src/EnergyPlus/ICEngineElectricGenerator.hh index bf90e83070d..c0765e3acf5 100644 --- a/src/EnergyPlus/ICEngineElectricGenerator.hh +++ b/src/EnergyPlus/ICEngineElectricGenerator.hh @@ -173,6 +173,8 @@ namespace ICEngineElectricGenerator { Real64 &OptLoad) override; static PlantComponent *factory(EnergyPlusData &state, std::string const &objectName); + + void oneTimeInit(EnergyPlusData &state) override; }; void GetICEngineGeneratorInput(EnergyPlusData &state); diff --git a/src/EnergyPlus/IceThermalStorage.cc b/src/EnergyPlus/IceThermalStorage.cc index d8ff60c6c4b..99fb28c4f4e 100644 --- a/src/EnergyPlus/IceThermalStorage.cc +++ b/src/EnergyPlus/IceThermalStorage.cc @@ -188,7 +188,7 @@ namespace IceThermalStorage { this->MyEnvrnFlag = true; } - this->InitSimpleIceStorage(state); + this->oneTimeInit(state); //------------------------------------------------------------------------ // FIRST PROCESS (MyLoad = 0.0 as IN) @@ -282,7 +282,7 @@ namespace IceThermalStorage { this->MyEnvrnFlag = true; } - this->InitDetailedIceStorage(state); // Initialize detailed ice storage + this->oneTimeInit(state); // Initialize detailed ice storage this->SimDetailedIceStorage(state); // Simulate detailed ice storage @@ -1198,7 +1198,7 @@ namespace IceThermalStorage { "System"); } - void DetailedIceStorageData::InitDetailedIceStorage(EnergyPlusData &state) + void DetailedIceStorageData::oneTimeInit(EnergyPlusData &state) { // SUBROUTINE INFORMATION: @@ -1227,7 +1227,7 @@ namespace IceThermalStorage { errFlag); if (errFlag) { - ShowFatalError(state, "InitDetailedIceStorage: Program terminated due to previous condition(s)."); + ShowFatalError(state, "DetailedIceStorageData: oneTimeInit: Program terminated due to previous condition(s)."); } this->setupOutputVars(state); @@ -1292,7 +1292,7 @@ namespace IceThermalStorage { this->ParasiticElecEnergy = 0.0; } - void SimpleIceStorageData::InitSimpleIceStorage(EnergyPlusData &state) + void SimpleIceStorageData::oneTimeInit(EnergyPlusData &state) { bool errFlag; @@ -1314,7 +1314,7 @@ namespace IceThermalStorage { _, _); if (errFlag) { - ShowFatalError(state, "InitSimpleIceStorage: Program terminated due to previous condition(s)."); + ShowFatalError(state, "SimpleIceStorageData:oneTimeInit: Program terminated due to previous condition(s)."); } this->setupOutputVars(state); diff --git a/src/EnergyPlus/IceThermalStorage.hh b/src/EnergyPlus/IceThermalStorage.hh index 3ee7ce5f75f..06cacb10f86 100644 --- a/src/EnergyPlus/IceThermalStorage.hh +++ b/src/EnergyPlus/IceThermalStorage.hh @@ -151,7 +151,7 @@ namespace IceThermalStorage { void simulate(EnergyPlusData &state, const PlantLocation &calledFromLocation, bool FirstHVACIteration, Real64 &CurLoad, bool RunFlag) override; - void InitSimpleIceStorage(EnergyPlusData &state); + void oneTimeInit(EnergyPlusData &state) override; void CalcIceStorageDormant(EnergyPlusData &state); @@ -253,7 +253,7 @@ namespace IceThermalStorage { Real64 &CurLoad, bool RunFlag) override; - void InitDetailedIceStorage(EnergyPlusData &state); + void oneTimeInit(EnergyPlusData &state) override; void SimDetailedIceStorage(EnergyPlusData &state); diff --git a/src/EnergyPlus/LowTempRadiantSystem.cc b/src/EnergyPlus/LowTempRadiantSystem.cc index f5f6ac7a074..f244d6e4211 100644 --- a/src/EnergyPlus/LowTempRadiantSystem.cc +++ b/src/EnergyPlus/LowTempRadiantSystem.cc @@ -5735,9 +5735,9 @@ namespace LowTempRadiantSystem { case LowTempRadiantControlTypes::OWBControl: return state.dataHeatBal->Zone(this->ZonePtr).OutWetBulbTemp; case LowTempRadiantControlTypes::SurfFaceTempControl: - return state.dataHeatBalSurf->TempSurfIn(this->SurfacePtr(1)); // Grabs the inside face temperature of the first surface in the list + return state.dataHeatBalSurf->SurfTempIn(this->SurfacePtr(1)); // Grabs the inside face temperature of the first surface in the list case LowTempRadiantControlTypes::SurfIntTempControl: - return state.dataHeatBalSurf->TempUserLoc( + return state.dataHeatBalSurf->SurfTempUserLoc( this->SurfacePtr(1)); // Grabs the temperature inside the slab at the location specified by the user case LowTempRadiantControlTypes::RunningMeanODBControl: return this->todayRunningMeanOutdoorDryBulbTemperature; @@ -6111,20 +6111,19 @@ namespace LowTempRadiantSystem { if (state.dataSurface->SurfWinFrameArea(surfNum) > 0.0) { // Window frame contribution - sumHATsurf += state.dataHeatBal->HConvIn(surfNum) * state.dataSurface->SurfWinFrameArea(surfNum) * - (1.0 + state.dataSurface->SurfWinProjCorrFrIn(surfNum)) * state.dataSurface->SurfWinFrameTempSurfIn(surfNum); + sumHATsurf += state.dataHeatBalSurf->SurfHConvInt(surfNum) * state.dataSurface->SurfWinFrameArea(surfNum) * + (1.0 + state.dataSurface->SurfWinProjCorrFrIn(surfNum)) * state.dataSurface->SurfWinFrameTempIn(surfNum); } if (state.dataSurface->SurfWinDividerArea(surfNum) > 0.0 && !ANY_INTERIOR_SHADE_BLIND(state.dataSurface->SurfWinShadingFlag(surfNum))) { // Window divider contribution (only from shade or blind for window with divider and interior shade or blind) - sumHATsurf += state.dataHeatBal->HConvIn(surfNum) * state.dataSurface->SurfWinDividerArea(surfNum) * - (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(surfNum)) * - state.dataSurface->SurfWinDividerTempSurfIn(surfNum); + sumHATsurf += state.dataHeatBalSurf->SurfHConvInt(surfNum) * state.dataSurface->SurfWinDividerArea(surfNum) * + (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(surfNum)) * state.dataSurface->SurfWinDividerTempIn(surfNum); } } - sumHATsurf += state.dataHeatBal->HConvIn(surfNum) * Area * state.dataHeatBalSurf->TempSurfInTmp(surfNum); + sumHATsurf += state.dataHeatBalSurf->SurfHConvInt(surfNum) * Area * state.dataHeatBalSurf->SurfTempInTmp(surfNum); } return sumHATsurf; diff --git a/src/EnergyPlus/MicroCHPElectricGenerator.cc b/src/EnergyPlus/MicroCHPElectricGenerator.cc index a9165ffea6f..1f362aa0bb4 100644 --- a/src/EnergyPlus/MicroCHPElectricGenerator.cc +++ b/src/EnergyPlus/MicroCHPElectricGenerator.cc @@ -633,46 +633,7 @@ void MicroCHPDataStruct::InitMicroCHPNoNormalizeGenerators(EnergyPlusData &state // MODIFIED na // RE-ENGINEERED na - bool errFlag; - - if (this->myFlag) { - this->setupOutputVars(state); - this->myFlag = false; - } - - if (this->MyPlantScanFlag && allocated(state.dataPlnt->PlantLoop)) { - errFlag = false; - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - DataPlant::TypeOf_Generator_MicroCHP, - this->CWLoopNum, - this->CWLoopSideNum, - this->CWBranchNum, - this->CWCompNum, - errFlag, - _, - _, - _, - _, - _); - - if (errFlag) { - ShowFatalError(state, "InitMicroCHPNoNormalizeGenerators: Program terminated for previous conditions."); - } - - if (!this->A42Model.InternalFlowControl) { - // IF this is on the supply side and not internal flow control then reset flow priority to lower - if (this->CWLoopSideNum == DataPlant::SupplySide) { - state.dataPlnt->PlantLoop(this->CWLoopNum) - .LoopSide(this->CWLoopSideNum) - .Branch(this->CWBranchNum) - .Comp(this->CWCompNum) - .FlowPriority = DataPlant::LoopFlowStatus_TakesWhatGets; - } - } - - this->MyPlantScanFlag = false; - } + this->oneTimeInit(state); if (!state.dataGlobal->SysSizingCalc && this->MySizeFlag && !this->MyPlantScanFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { this->MySizeFlag = false; @@ -1433,4 +1394,50 @@ void MicroCHPDataStruct::UpdateMicroCHPGeneratorRecords(EnergyPlusData &state) / state.dataLoopNodes->Node(this->AirOutletNodeID).Temp = this->A42Model.Teng; } } +void MicroCHPDataStruct::oneTimeInit(EnergyPlusData &state) +{ + + bool errFlag; + + if (this->myFlag) { + this->setupOutputVars(state); + this->myFlag = false; + } + + if (this->MyPlantScanFlag) { + if (allocated(state.dataPlnt->PlantLoop)) { + errFlag = false; + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + DataPlant::TypeOf_Generator_MicroCHP, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum, + errFlag, + _, + _, + _, + _, + _); + + if (errFlag) { + ShowFatalError(state, "InitMicroCHPNoNormalizeGenerators: Program terminated for previous conditions."); + } + + if (!this->A42Model.InternalFlowControl) { + // IF this is on the supply side and not internal flow control then reset flow priority to lower + if (this->CWLoopSideNum == DataPlant::SupplySide) { + state.dataPlnt->PlantLoop(this->CWLoopNum) + .LoopSide(this->CWLoopSideNum) + .Branch(this->CWBranchNum) + .Comp(this->CWCompNum) + .FlowPriority = DataPlant::LoopFlowStatus_TakesWhatGets; + } + } + + this->MyPlantScanFlag = false; + } + } +} } // namespace EnergyPlus::MicroCHPElectricGenerator diff --git a/src/EnergyPlus/MicroCHPElectricGenerator.hh b/src/EnergyPlus/MicroCHPElectricGenerator.hh index 40ddac4a8f7..b12e92af6b7 100644 --- a/src/EnergyPlus/MicroCHPElectricGenerator.hh +++ b/src/EnergyPlus/MicroCHPElectricGenerator.hh @@ -228,6 +228,8 @@ namespace MicroCHPElectricGenerator { void UpdateMicroCHPGeneratorRecords(EnergyPlusData &state); static PlantComponent *factory(EnergyPlusData &state, std::string const &objectName); + + void oneTimeInit(EnergyPlusData &state) override; }; void GetMicroCHPGeneratorInput(EnergyPlusData &state); diff --git a/src/EnergyPlus/MicroturbineElectricGenerator.cc b/src/EnergyPlus/MicroturbineElectricGenerator.cc index 7a75b2ba4e9..dc0fa902f74 100644 --- a/src/EnergyPlus/MicroturbineElectricGenerator.cc +++ b/src/EnergyPlus/MicroturbineElectricGenerator.cc @@ -1050,61 +1050,7 @@ void MTGeneratorSpecs::InitMTGenerators(EnergyPlusData &state, // METHODOLOGY EMPLOYED: // Uses the status flags to trigger initializations. - std::string const RoutineName("InitMTGenerators"); - bool errFlag; - - if (this->myFlag) { - this->setupOutputVars(state); - this->myFlag = false; - } - - if (this->MyPlantScanFlag && allocated(state.dataPlnt->PlantLoop) && this->HeatRecActive) { - errFlag = false; - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - DataPlant::TypeOf_Generator_MicroTurbine, - this->HRLoopNum, - this->HRLoopSideNum, - this->HRBranchNum, - this->HRCompNum, - errFlag, - _, - _, - _, - _, - _); - if (errFlag) { - ShowFatalError(state, "InitMTGenerators: Program terminated due to previous condition(s)."); - } - - this->MyPlantScanFlag = false; - } - - if (this->MySizeAndNodeInitFlag && (!this->MyPlantScanFlag) && this->HeatRecActive) { - - // size mass flow rate - Real64 rho = FluidProperties::GetDensityGlycol(state, - state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, - DataGlobalConstants::InitConvTemp, - state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, - RoutineName); - - this->DesignHeatRecMassFlowRate = rho * this->RefHeatRecVolFlowRate; - this->HeatRecMaxMassFlowRate = rho * this->HeatRecMaxVolFlowRate; - - PlantUtilities::InitComponentNodes(state, - 0.0, - this->HeatRecMaxMassFlowRate, - this->HeatRecInletNodeNum, - this->HeatRecOutletNodeNum, - this->HRLoopNum, - this->HRLoopSideNum, - this->HRBranchNum, - this->HRCompNum); - - this->MySizeAndNodeInitFlag = false; - - } // end one time inits + this->oneTimeInit(state); // end one time inits if (!this->HeatRecActive) return; @@ -1948,5 +1894,63 @@ void MTGeneratorSpecs::UpdateMTGeneratorRecords(EnergyPlusData &state) this->AncillaryEnergy = this->AncillaryPowerRate * state.dataHVACGlobal->TimeStepSys * DataGlobalConstants::SecInHour; this->StandbyEnergy = this->StandbyPowerRate * state.dataHVACGlobal->TimeStepSys * DataGlobalConstants::SecInHour; } +void MTGeneratorSpecs::oneTimeInit(EnergyPlusData &state) +{ + + std::string const RoutineName("InitMTGenerators"); + bool errFlag; + + if (this->myFlag) { + this->setupOutputVars(state); + this->myFlag = false; + } + + if (this->MyPlantScanFlag && allocated(state.dataPlnt->PlantLoop) && this->HeatRecActive) { + errFlag = false; + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + DataPlant::TypeOf_Generator_MicroTurbine, + this->HRLoopNum, + this->HRLoopSideNum, + this->HRBranchNum, + this->HRCompNum, + errFlag, + _, + _, + _, + _, + _); + if (errFlag) { + ShowFatalError(state, "InitMTGenerators: Program terminated due to previous condition(s)."); + } + + this->MyPlantScanFlag = false; + } + + if (this->MySizeAndNodeInitFlag && (!this->MyPlantScanFlag) && this->HeatRecActive) { + + // size mass flow rate + Real64 rho = FluidProperties::GetDensityGlycol(state, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, + DataGlobalConstants::InitConvTemp, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, + RoutineName); + + this->DesignHeatRecMassFlowRate = rho * this->RefHeatRecVolFlowRate; + this->HeatRecMaxMassFlowRate = rho * this->HeatRecMaxVolFlowRate; + + PlantUtilities::InitComponentNodes(state, + 0.0, + this->HeatRecMaxMassFlowRate, + this->HeatRecInletNodeNum, + this->HeatRecOutletNodeNum, + this->HRLoopNum, + this->HRLoopSideNum, + this->HRBranchNum, + this->HRCompNum); + + this->MySizeAndNodeInitFlag = false; + } +} } // namespace EnergyPlus::MicroturbineElectricGenerator diff --git a/src/EnergyPlus/MicroturbineElectricGenerator.hh b/src/EnergyPlus/MicroturbineElectricGenerator.hh index 34552227443..9716ad3233d 100644 --- a/src/EnergyPlus/MicroturbineElectricGenerator.hh +++ b/src/EnergyPlus/MicroturbineElectricGenerator.hh @@ -221,6 +221,8 @@ namespace MicroturbineElectricGenerator { void setupOutputVars(EnergyPlusData &state); static PlantComponent *factory(EnergyPlusData &state, std::string const &objectName); + + void oneTimeInit(EnergyPlusData &state) override; }; void GetMTGeneratorInput(EnergyPlusData &state); diff --git a/src/EnergyPlus/MoistureBalanceEMPDManager.cc b/src/EnergyPlus/MoistureBalanceEMPDManager.cc index a82133b7963..d9fdc3796b6 100644 --- a/src/EnergyPlus/MoistureBalanceEMPDManager.cc +++ b/src/EnergyPlus/MoistureBalanceEMPDManager.cc @@ -415,7 +415,7 @@ void InitMoistureBalanceEMPD(EnergyPlusData &state) void CalcMoistureBalanceEMPD(EnergyPlusData &state, int const SurfNum, - Real64 const TempSurfIn, // INSIDE SURFACE TEMPERATURE at current time step + Real64 const SurfTempIn, // INSIDE SURFACE TEMPERATURE at current time step Real64 const TempZone, // Zone temperature at current time step. Real64 &TempSat // Saturated surface temperature. ) @@ -515,7 +515,7 @@ void CalcMoistureBalanceEMPD(EnergyPlusData &state, return; } - Taver = TempSurfIn; + Taver = SurfTempIn; // Calculate average vapor density [kg/m^3], and RH for use in material property calculations. RVaver = rv_surface_old; RHaver = RVaver * 461.52 * (Taver + DataGlobalConstants::KelvinConv) * std::exp(-23.7093 + 4111.0 / (Taver + 237.7)); diff --git a/src/EnergyPlus/MoistureBalanceEMPDManager.hh b/src/EnergyPlus/MoistureBalanceEMPDManager.hh index 9ee8edb5f56..53d2c6e8ade 100644 --- a/src/EnergyPlus/MoistureBalanceEMPDManager.hh +++ b/src/EnergyPlus/MoistureBalanceEMPDManager.hh @@ -96,7 +96,7 @@ namespace MoistureBalanceEMPDManager { void CalcMoistureBalanceEMPD(EnergyPlusData &state, int SurfNum, - Real64 TempSurfIn, // INSIDE SURFACE TEMPERATURE at current time step + Real64 SurfTempIn, // INSIDE SURFACE TEMPERATURE at current time step Real64 TempZone, // Zone temperature at current time step. Real64 &TempSat // Saturated surface temperature. ); diff --git a/src/EnergyPlus/MundtSimMgr.cc b/src/EnergyPlus/MundtSimMgr.cc index d9e8b2c4121..a27f09f97c4 100644 --- a/src/EnergyPlus/MundtSimMgr.cc +++ b/src/EnergyPlus/MundtSimMgr.cc @@ -443,9 +443,9 @@ namespace MundtSimMgr { // get surface data for (SurfNum = 1; SurfNum <= state.dataMundtSimMgr->ZoneData(ZoneNum).NumOfSurfs; ++SurfNum) { state.dataMundtSimMgr->MundtAirSurf(SurfNum, state.dataMundtSimMgr->MundtZoneNum).Temp = - state.dataHeatBalSurf->TempSurfIn(state.dataMundtSimMgr->ZoneData(ZoneNum).SurfFirst + SurfNum - 1); + state.dataHeatBalSurf->SurfTempIn(state.dataMundtSimMgr->ZoneData(ZoneNum).SurfFirst + SurfNum - 1); state.dataMundtSimMgr->MundtAirSurf(SurfNum, state.dataMundtSimMgr->MundtZoneNum).Hc = - state.dataHeatBal->HConvIn(state.dataMundtSimMgr->ZoneData(ZoneNum).SurfFirst + SurfNum - 1); + state.dataHeatBalSurf->SurfHConvInt(state.dataMundtSimMgr->ZoneData(ZoneNum).SurfFirst + SurfNum - 1); } } diff --git a/src/EnergyPlus/OutsideEnergySources.cc b/src/EnergyPlus/OutsideEnergySources.cc index 8d748a8938a..b14806627a9 100644 --- a/src/EnergyPlus/OutsideEnergySources.cc +++ b/src/EnergyPlus/OutsideEnergySources.cc @@ -289,62 +289,7 @@ void OutsideEnergySourceSpecs::initialize(EnergyPlusData &state, Real64 MyLoad) // The mass flow rate could be an inter-connected-loop side trigger. This is not really the type of // interconnect that that routine was written for, but it is the clearest example of using it. - if (this->OneTimeInitFlag) { - // Locate the unit on the plant loops for later usage - bool errFlag = false; - PlantUtilities::ScanPlantLoopsForObject( - state, this->Name, this->EnergyType, this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum, errFlag, _, _, _, _, _); - if (errFlag) { - ShowFatalError(state, "InitSimVars: Program terminated due to previous condition(s)."); - } - // set limits on outlet node temps to plant loop limits - state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).Branch(this->BranchNum).Comp(this->CompNum).MinOutletTemp = - state.dataPlnt->PlantLoop(this->LoopNum).MinTemp; - state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).Branch(this->BranchNum).Comp(this->CompNum).MaxOutletTemp = - state.dataPlnt->PlantLoop(this->LoopNum).MaxTemp; - // Register design flow rate for inlet node (helps to autosize comp setpoint op scheme flows - PlantUtilities::RegisterPlantCompDesignFlow(state, this->InletNodeNum, state.dataPlnt->PlantLoop(this->LoopNum).MaxVolFlowRate); - - this->OneTimeInitFlag = false; - - // this may need some help, if the objects change location later, due to a push_back, - // then the pointers to these output variables will be bad - // for (int EnergySourceNum = 1; EnergySourceNum <= NumDistrictUnits; ++EnergySourceNum) { - std::string hotOrChilled = "Hot "; - std::string reportVarPrefix = "District Heating "; - std::string heatingOrCooling = "Heating"; - std::string typeName = DataPlant::ccSimPlantEquipTypes(DataPlant::TypeOf_PurchHotWater); - if (this->EnergyType == DataPlant::TypeOf_PurchChilledWater) { - hotOrChilled = "Chilled "; - reportVarPrefix = "District Cooling "; - heatingOrCooling = "Cooling"; - typeName = DataPlant::ccSimPlantEquipTypes(DataPlant::TypeOf_PurchChilledWater); - } - - SetupOutputVariable(state, - reportVarPrefix + hotOrChilled + "Water Energy", - OutputProcessor::Unit::J, - this->EnergyTransfer, - "System", - "Sum", - this->Name, - _, - typeName, - heatingOrCooling, - _, - "Plant"); - SetupOutputVariable( - state, reportVarPrefix + hotOrChilled + "Water Rate", OutputProcessor::Unit::W, this->EnergyRate, "System", "Average", this->Name); - - SetupOutputVariable(state, reportVarPrefix + "Rate", OutputProcessor::Unit::W, this->EnergyRate, "System", "Average", this->Name); - SetupOutputVariable(state, reportVarPrefix + "Inlet Temperature", OutputProcessor::Unit::C, this->InletTemp, "System", "Average", this->Name); - SetupOutputVariable( - state, reportVarPrefix + "Outlet Temperature", OutputProcessor::Unit::C, this->OutletTemp, "System", "Average", this->Name); - SetupOutputVariable( - state, reportVarPrefix + "Mass Flow Rate", OutputProcessor::Unit::kg_s, this->MassFlowRate, "System", "Average", this->Name); - } - - //} + this->oneTimeInit(state); // begin environment inits if (state.dataGlobal->BeginEnvrnFlag && this->BeginEnvrnInitFlag) { @@ -512,5 +457,63 @@ void OutsideEnergySourceSpecs::calculate(EnergyPlusData &state, bool runFlag, Re this->EnergyRate = std::abs(MyLoad); this->EnergyTransfer = this->EnergyRate * state.dataHVACGlobal->TimeStepSys * DataGlobalConstants::SecInHour; } +void OutsideEnergySourceSpecs::oneTimeInit(EnergyPlusData &state) +{ + + if (this->OneTimeInitFlag) { + // Locate the unit on the plant loops for later usage + bool errFlag = false; + PlantUtilities::ScanPlantLoopsForObject( + state, this->Name, this->EnergyType, this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum, errFlag, _, _, _, _, _); + if (errFlag) { + ShowFatalError(state, "InitSimVars: Program terminated due to previous condition(s)."); + } + // set limits on outlet node temps to plant loop limits + state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).Branch(this->BranchNum).Comp(this->CompNum).MinOutletTemp = + state.dataPlnt->PlantLoop(this->LoopNum).MinTemp; + state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).Branch(this->BranchNum).Comp(this->CompNum).MaxOutletTemp = + state.dataPlnt->PlantLoop(this->LoopNum).MaxTemp; + // Register design flow rate for inlet node (helps to autosize comp setpoint op scheme flows + PlantUtilities::RegisterPlantCompDesignFlow(state, this->InletNodeNum, state.dataPlnt->PlantLoop(this->LoopNum).MaxVolFlowRate); + + this->OneTimeInitFlag = false; + + // this may need some help, if the objects change location later, due to a push_back, + // then the pointers to these output variables will be bad + // for (int EnergySourceNum = 1; EnergySourceNum <= NumDistrictUnits; ++EnergySourceNum) { + std::string hotOrChilled = "Hot "; + std::string reportVarPrefix = "District Heating "; + std::string heatingOrCooling = "Heating"; + std::string typeName = DataPlant::ccSimPlantEquipTypes(DataPlant::TypeOf_PurchHotWater); + if (this->EnergyType == DataPlant::TypeOf_PurchChilledWater) { + hotOrChilled = "Chilled "; + reportVarPrefix = "District Cooling "; + heatingOrCooling = "Cooling"; + typeName = DataPlant::ccSimPlantEquipTypes(DataPlant::TypeOf_PurchChilledWater); + } + + SetupOutputVariable(state, + reportVarPrefix + hotOrChilled + "Water Energy", + OutputProcessor::Unit::J, + this->EnergyTransfer, + "System", + "Sum", + this->Name, + _, + typeName, + heatingOrCooling, + _, + "Plant"); + SetupOutputVariable( + state, reportVarPrefix + hotOrChilled + "Water Rate", OutputProcessor::Unit::W, this->EnergyRate, "System", "Average", this->Name); + + SetupOutputVariable(state, reportVarPrefix + "Rate", OutputProcessor::Unit::W, this->EnergyRate, "System", "Average", this->Name); + SetupOutputVariable(state, reportVarPrefix + "Inlet Temperature", OutputProcessor::Unit::C, this->InletTemp, "System", "Average", this->Name); + SetupOutputVariable( + state, reportVarPrefix + "Outlet Temperature", OutputProcessor::Unit::C, this->OutletTemp, "System", "Average", this->Name); + SetupOutputVariable( + state, reportVarPrefix + "Mass Flow Rate", OutputProcessor::Unit::kg_s, this->MassFlowRate, "System", "Average", this->Name); + } +} } // namespace EnergyPlus::OutsideEnergySources diff --git a/src/EnergyPlus/OutsideEnergySources.hh b/src/EnergyPlus/OutsideEnergySources.hh index 54fe9a9e283..c09c305f14d 100644 --- a/src/EnergyPlus/OutsideEnergySources.hh +++ b/src/EnergyPlus/OutsideEnergySources.hh @@ -112,6 +112,8 @@ namespace OutsideEnergySources { void calculate(EnergyPlusData &state, bool runFlag, Real64 curLoad); void size(EnergyPlusData &state); + + void oneTimeInit(EnergyPlusData &state) override; }; void GetOutsideEnergySourcesInput(EnergyPlusData &state); diff --git a/src/EnergyPlus/PVWatts.cc b/src/EnergyPlus/PVWatts.cc index 60ebe387ecf..3e455ccbf12 100644 --- a/src/EnergyPlus/PVWatts.cc +++ b/src/EnergyPlus/PVWatts.cc @@ -395,7 +395,8 @@ namespace PVWatts { // Get the shading from the geometry, if applicable if (m_geometryType == GeometryType::SURFACE) { - m_shadedPercent = (1.0 - state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, m_surfaceNum)) * 100.0; + m_shadedPercent = + (1.0 - state.dataHeatBal->SurfSunlitFrac(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, m_surfaceNum)) * 100.0; ssc_data_set_number(m_pvwattsData, "shaded_percent", m_shadedPercent); } diff --git a/src/EnergyPlus/PackagedTerminalHeatPump.cc b/src/EnergyPlus/PackagedTerminalHeatPump.cc index 7bfc861feee..9a16e3fb1fb 100644 --- a/src/EnergyPlus/PackagedTerminalHeatPump.cc +++ b/src/EnergyPlus/PackagedTerminalHeatPump.cc @@ -5426,6 +5426,7 @@ void SizePTUnit(EnergyPlusData &state, int const PTUnitNum) // initialize OA flow for sizing other inputs (e.g., capacity) if (state.dataPTHP->PTUnit(PTUnitNum).CoolOutAirVolFlow == AutoSize) { + CheckZoneSizing(state, state.dataPTHP->PTUnit(PTUnitNum).UnitType, state.dataPTHP->PTUnit(PTUnitNum).Name); ZoneEqSizing(state.dataSize->CurZoneEqNum).OAVolFlow = state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).MinOA; } else { ZoneEqSizing(state.dataSize->CurZoneEqNum).OAVolFlow = state.dataPTHP->PTUnit(PTUnitNum).CoolOutAirVolFlow; diff --git a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc index 83ad1c0db90..c4a8bc37b97 100644 --- a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc +++ b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc @@ -490,36 +490,10 @@ namespace PhotovoltaicThermalCollectors { // PURPOSE OF THIS SUBROUTINE: // init for PVT - static std::string const RoutineName("InitPVTcollectors"); + static constexpr std::string_view RoutineName("InitPVTcollectors"); // Do the one time initializations - if (this->MyOneTimeFlag) { - this->setupReportVars(state); - this->MyOneTimeFlag = false; - } - - if (this->SetLoopIndexFlag) { - if (allocated(state.dataPlnt->PlantLoop) && (this->PlantInletNodeNum > 0)) { - bool errFlag = false; - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - this->TypeNum, - this->WLoopNum, - this->WLoopSideNum, - this->WLoopBranchNum, - this->WLoopCompNum, - errFlag, - _, - _, - _, - _, - _); - if (errFlag) { - ShowFatalError(state, "InitPVTcollectors: Program terminated for previous conditions."); - } - this->SetLoopIndexFlag = false; - } - } + this->oneTimeInit(state); // finish set up of PV, because PV get-input follows PVT's get input. if (!this->PVfound) { @@ -920,7 +894,7 @@ namespace PhotovoltaicThermalCollectors { // METHODOLOGY EMPLOYED: // Current model is "simple" fixed efficiency and simple night sky balance for cooling - static std::string const RoutineName("CalcPVTcollectors"); + static constexpr std::string_view RoutineName("CalcPVTcollectors"); int InletNode(0); @@ -1121,6 +1095,37 @@ namespace PhotovoltaicThermalCollectors { } } } + void PVTCollectorStruct::oneTimeInit(EnergyPlusData &state) + { + + if (this->MyOneTimeFlag) { + this->setupReportVars(state); + this->MyOneTimeFlag = false; + } + + if (this->SetLoopIndexFlag) { + if (allocated(state.dataPlnt->PlantLoop) && (this->PlantInletNodeNum > 0)) { + bool errFlag = false; + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + this->TypeNum, + this->WLoopNum, + this->WLoopSideNum, + this->WLoopBranchNum, + this->WLoopCompNum, + errFlag, + _, + _, + _, + _, + _); + if (errFlag) { + ShowFatalError(state, "InitPVTcollectors: Program terminated for previous conditions."); + } + this->SetLoopIndexFlag = false; + } + } + } void GetPVTThermalPowerProduction(EnergyPlusData &state, int const PVindex, Real64 &ThermalPower, Real64 &ThermalEnergy) { diff --git a/src/EnergyPlus/PhotovoltaicThermalCollectors.hh b/src/EnergyPlus/PhotovoltaicThermalCollectors.hh index 303d00b8588..c178a6f085f 100644 --- a/src/EnergyPlus/PhotovoltaicThermalCollectors.hh +++ b/src/EnergyPlus/PhotovoltaicThermalCollectors.hh @@ -183,6 +183,8 @@ namespace PhotovoltaicThermalCollectors { void calculate(EnergyPlusData &state); void update(EnergyPlusData &state); + + void oneTimeInit(EnergyPlusData &state) override; }; void GetPVTcollectorsInput(EnergyPlusData &state); diff --git a/src/EnergyPlus/Plant/PlantManager.cc b/src/EnergyPlus/Plant/PlantManager.cc index 6e23d869f7b..0db785e50ad 100644 --- a/src/EnergyPlus/Plant/PlantManager.cc +++ b/src/EnergyPlus/Plant/PlantManager.cc @@ -4270,4 +4270,7 @@ void CheckOngoingPlantWarnings(EnergyPlusData &state) } } +void EmptyPlantComponent::oneTimeInit([[maybe_unused]] EnergyPlusData &state) +{ +} } // namespace EnergyPlus::PlantManager diff --git a/src/EnergyPlus/Plant/PlantManager.hh b/src/EnergyPlus/Plant/PlantManager.hh index a5095b632f4..ca6c5814b7c 100644 --- a/src/EnergyPlus/Plant/PlantManager.hh +++ b/src/EnergyPlus/Plant/PlantManager.hh @@ -119,6 +119,8 @@ namespace PlantManager { { // this is empty on purpose } + + void oneTimeInit(EnergyPlusData &state) override; }; } // namespace PlantManager diff --git a/src/EnergyPlus/PlantCentralGSHP.cc b/src/EnergyPlus/PlantCentralGSHP.cc index 864bcdf6906..e9e042a5da7 100644 --- a/src/EnergyPlus/PlantCentralGSHP.cc +++ b/src/EnergyPlus/PlantCentralGSHP.cc @@ -2519,7 +2519,7 @@ void WrapperSpecs::CalcChillerHeaterModel(EnergyPlusData &state) } else { ShowWarningError(state, "ChillerHeaterPerformance:Electric:EIR \"" + this->ChillerHeater(ChillerHeaterNum).Name + "\":"); ShowContinueError(state, - format("Chiller condensor temperature for curve fit are not decided, defalt value= cond_leaving ({:.3R}).", + format("Chiller condenser temperature for curve fit are not decided, default value= cond_leaving ({:.3R}).", state.dataPlantCentralGSHP->ChillerCapFT)); CondTempforCurve = state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; } @@ -3527,5 +3527,8 @@ void WrapperSpecs::UpdateChillerHeaterRecords(EnergyPlusData &state) // Wrapper this->ChillerHeater(ChillerHeaterNum).Report.CondEnergy = this->ChillerHeater(ChillerHeaterNum).Report.QCond * SecInTimeStep; } } +void WrapperSpecs::oneTimeInit([[maybe_unused]] EnergyPlusData &state) +{ +} } // namespace EnergyPlus::PlantCentralGSHP diff --git a/src/EnergyPlus/PlantCentralGSHP.hh b/src/EnergyPlus/PlantCentralGSHP.hh index 5306af61486..bee9e8b7844 100644 --- a/src/EnergyPlus/PlantCentralGSHP.hh +++ b/src/EnergyPlus/PlantCentralGSHP.hh @@ -421,6 +421,8 @@ namespace PlantCentralGSHP { void UpdateChillerRecords(EnergyPlusData &state); void onInitLoopEquip([[maybe_unused]] EnergyPlusData &state, [[maybe_unused]] const PlantLocation &calledFromLocation) override; + + void oneTimeInit(EnergyPlusData &state) override; }; void GetWrapperInput(EnergyPlusData &state); diff --git a/src/EnergyPlus/PlantChillers.cc b/src/EnergyPlus/PlantChillers.cc index e480d0e111c..18b5221e70e 100644 --- a/src/EnergyPlus/PlantChillers.cc +++ b/src/EnergyPlus/PlantChillers.cc @@ -783,132 +783,10 @@ namespace PlantChillers { // Uses the status flags to trigger initializations. // SUBROUTINE PARAMETER DEFINITIONS: - static std::string const RoutineName("InitElectricChiller"); - - if (this->MyFlag) { - // Locate the chillers on the plant loops for later usage - bool errFlag = false; - this->setupOutputVariables(state); - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - this->plantTypeOfNum, - this->CWLoopNum, - this->CWLoopSideNum, - this->CWBranchNum, - this->CWCompNum, - errFlag, - this->TempLowLimitEvapOut, - _, - _, - this->EvapInletNodeNum, - _); - if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled) { - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - this->plantTypeOfNum, - this->CDLoopNum, - this->CDLoopSideNum, - this->CDBranchNum, - this->CDCompNum, - errFlag, - _, - _, - _, - this->CondInletNodeNum, - _); - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, this->plantTypeOfNum, true); - } - if (this->HeatRecActive) { - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - this->plantTypeOfNum, - this->HRLoopNum, - this->HRLoopSideNum, - this->HRBranchNum, - this->HRCompNum, - errFlag, - _, - _, - _, - this->HeatRecInletNodeNum, - _); - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, true); - } - - if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled && - this->HeatRecActive) { - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, false); - } - - if (errFlag) { - ShowFatalError(state, "InitElectricChiller: Program terminated due to previous condition(s)."); - } - - if (this->FlowMode == DataPlant::FlowMode::Constant) { - // reset flow priority - state.dataPlnt->PlantLoop(this->CWLoopNum) - .LoopSide(this->CWLoopSideNum) - .Branch(this->CWBranchNum) - .Comp(this->CWCompNum) - .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; - } - if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { - // reset flow priority - state.dataPlnt->PlantLoop(this->CWLoopNum) - .LoopSide(this->CWLoopSideNum) - .Branch(this->CWBranchNum) - .Comp(this->CWCompNum) - .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; + static std::string const RoutineName("InitElectricChiller"); - // check if setpoint on outlet node - if ((state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && - (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi == DataLoopNode::SensedNodeFlagValue)) { - if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { - if (!this->ModulatedFlowErrDone) { - ShowWarningError(state, "Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + this->Name); - ShowContinueError( - state, - " A temperature setpoint is needed at the outlet node of a chiller in variable flow mode, use a SetpointManager"); - ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); - this->ModulatedFlowErrDone = true; - } - } else { - // need call to EMS to check node - bool FatalError = false; // but not really fatal yet, but should be. - EMSManager::CheckIfNodeSetPointManagedByEMS( - state, this->EvapOutletNodeNum, EMSManager::SPControlType::iTemperatureSetPoint, FatalError); - state.dataLoopNodes->NodeSetpointCheck(this->EvapOutletNodeNum).needsSetpointChecking = false; - if (FatalError) { - if (!this->ModulatedFlowErrDone) { - ShowWarningError(state, "Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + this->Name); - ShowContinueError( - state, " A temperature setpoint is needed at the outlet node of a chiller evaporator in variable flow mode"); - ShowContinueError(state, " use a Setpoint Manager to establish a setpoint at the chiller evaporator outlet node "); - ShowContinueError(state, " or use an EMS actuator to establish a setpoint at the outlet node "); - ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); - this->ModulatedFlowErrDone = true; - } - } - } - this->ModulatedFlowSetToLoop = true; - { - auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint = - state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi = - state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; - } - } - } - } - this->MyFlag = false; - } + this->oneTimeInit(state); if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { @@ -2146,6 +2024,134 @@ namespace PlantChillers { } } } + void ElectricChillerSpecs::oneTimeInit(EnergyPlusData &state) + { + + if (this->MyFlag) { + // Locate the chillers on the plant loops for later usage + bool errFlag = false; + this->setupOutputVariables(state); + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + this->plantTypeOfNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum, + errFlag, + this->TempLowLimitEvapOut, + _, + _, + this->EvapInletNodeNum, + _); + if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled) { + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + this->plantTypeOfNum, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum, + errFlag, + _, + _, + _, + this->CondInletNodeNum, + _); + PlantUtilities::InterConnectTwoPlantLoopSides( + state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, this->plantTypeOfNum, true); + } + if (this->HeatRecActive) { + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + this->plantTypeOfNum, + this->HRLoopNum, + this->HRLoopSideNum, + this->HRBranchNum, + this->HRCompNum, + errFlag, + _, + _, + _, + this->HeatRecInletNodeNum, + _); + PlantUtilities::InterConnectTwoPlantLoopSides( + state, this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, true); + } + + if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled && + this->HeatRecActive) { + PlantUtilities::InterConnectTwoPlantLoopSides( + state, this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, false); + } + + if (errFlag) { + ShowFatalError(state, "InitElectricChiller: Program terminated due to previous condition(s)."); + } + + if (this->FlowMode == DataPlant::FlowMode::Constant) { + // reset flow priority + state.dataPlnt->PlantLoop(this->CWLoopNum) + .LoopSide(this->CWLoopSideNum) + .Branch(this->CWBranchNum) + .Comp(this->CWCompNum) + .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; + } + + if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { + // reset flow priority + state.dataPlnt->PlantLoop(this->CWLoopNum) + .LoopSide(this->CWLoopSideNum) + .Branch(this->CWBranchNum) + .Comp(this->CWCompNum) + .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; + + // check if setpoint on outlet node + if ((state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && + (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi == DataLoopNode::SensedNodeFlagValue)) { + if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { + if (!this->ModulatedFlowErrDone) { + ShowWarningError(state, "Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + this->Name); + ShowContinueError( + state, + " A temperature setpoint is needed at the outlet node of a chiller in variable flow mode, use a SetpointManager"); + ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); + this->ModulatedFlowErrDone = true; + } + } else { + // need call to EMS to check node + bool FatalError = false; // but not really fatal yet, but should be. + EMSManager::CheckIfNodeSetPointManagedByEMS( + state, this->EvapOutletNodeNum, EMSManager::SPControlType::iTemperatureSetPoint, FatalError); + state.dataLoopNodes->NodeSetpointCheck(this->EvapOutletNodeNum).needsSetpointChecking = false; + if (FatalError) { + if (!this->ModulatedFlowErrDone) { + ShowWarningError(state, "Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + this->Name); + ShowContinueError( + state, " A temperature setpoint is needed at the outlet node of a chiller evaporator in variable flow mode"); + ShowContinueError(state, " use a Setpoint Manager to establish a setpoint at the chiller evaporator outlet node "); + ShowContinueError(state, " or use an EMS actuator to establish a setpoint at the outlet node "); + ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); + this->ModulatedFlowErrDone = true; + } + } + } + this->ModulatedFlowSetToLoop = true; + { + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint = + state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi = + state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + } + } + } + } + this->MyFlag = false; + } + } EngineDrivenChillerSpecs *EngineDrivenChillerSpecs::factory(EnergyPlusData &state, std::string const &chillerName) { @@ -2848,125 +2854,10 @@ namespace PlantChillers { // Uses the status flags to trigger initializations. // SUBROUTINE PARAMETER DEFINITIONS: + static std::string const RoutineName("InitEngineDrivenChiller"); - if (this->MyFlag) { - // Locate the chillers on the plant loops for later usage - bool errFlag = false; - this->setupOutputVariables(state); - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - this->plantTypeOfNum, - this->CWLoopNum, - this->CWLoopSideNum, - this->CWBranchNum, - this->CWCompNum, - errFlag, - this->TempLowLimitEvapOut, - _, - _, - this->EvapInletNodeNum, - _); - if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled) { - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - this->plantTypeOfNum, - this->CDLoopNum, - this->CDLoopSideNum, - this->CDBranchNum, - this->CDCompNum, - errFlag, - _, - _, - _, - this->CondInletNodeNum, - _); - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, this->plantTypeOfNum, true); - } - if (this->HeatRecActive) { - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - this->plantTypeOfNum, - this->HRLoopNum, - this->HRLoopSideNum, - this->HRBranchNum, - this->HRCompNum, - errFlag, - _, - _, - _, - this->HeatRecInletNodeNum, - _); - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, true); - } - - if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled && - this->HeatRecActive) { - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, false); - } - if (errFlag) { - ShowFatalError(state, "InitEngineDrivenChiller: Program terminated due to previous condition(s)."); - } - - if (this->FlowMode == DataPlant::FlowMode::Constant) { - // reset flow priority - state.dataPlnt->PlantLoop(this->CWLoopNum) - .LoopSide(this->CWLoopSideNum) - .Branch(this->CWBranchNum) - .Comp(this->CWCompNum) - .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; - } - - if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { - // reset flow priority - state.dataPlnt->PlantLoop(this->CWLoopNum) - .LoopSide(this->CWLoopSideNum) - .Branch(this->CWBranchNum) - .Comp(this->CWCompNum) - .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; - // check if setpoint on outlet node - if ((state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && - (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi == DataLoopNode::SensedNodeFlagValue)) { - if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { - if (!this->ModulatedFlowErrDone) { - ShowWarningError(state, "Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + this->Name); - ShowContinueError( - state, - " A temperature setpoint is needed at the outlet node of a chiller in variable flow mode, use a SetpointManager"); - ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); - this->ModulatedFlowErrDone = true; - } - } else { - // need call to EMS to check node - bool FatalError = false; // but not really fatal yet, but should be. - EMSManager::CheckIfNodeSetPointManagedByEMS( - state, this->EvapOutletNodeNum, EMSManager::SPControlType::iTemperatureSetPoint, FatalError); - state.dataLoopNodes->NodeSetpointCheck(this->EvapOutletNodeNum).needsSetpointChecking = false; - if (FatalError) { - if (!this->ModulatedFlowErrDone) { - ShowWarningError(state, "Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + this->Name); - ShowContinueError( - state, " A temperature setpoint is needed at the outlet node of a chiller evaporator in variable flow mode"); - ShowContinueError(state, " use a Setpoint Manager to establish a setpoint at the chiller evaporator outlet node "); - ShowContinueError(state, " or use an EMS actuator to establish a setpoint at the outlet node "); - ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); - this->ModulatedFlowErrDone = true; - } - } - } - this->ModulatedFlowSetToLoop = true; - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint = - state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi = - state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; - } - } - - this->MyFlag = false; - } + this->oneTimeInit(state); // Initialize critical Demand Side Variables if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { @@ -4192,6 +4083,127 @@ namespace PlantChillers { state.dataLoopNodes->Node(this->HeatRecOutletNodeNum).Temp = this->HeatRecOutletTemp; } } + void EngineDrivenChillerSpecs::oneTimeInit(EnergyPlusData &state) + { + + if (this->MyFlag) { + // Locate the chillers on the plant loops for later usage + bool errFlag = false; + this->setupOutputVariables(state); + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + this->plantTypeOfNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum, + errFlag, + this->TempLowLimitEvapOut, + _, + _, + this->EvapInletNodeNum, + _); + if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled) { + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + this->plantTypeOfNum, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum, + errFlag, + _, + _, + _, + this->CondInletNodeNum, + _); + PlantUtilities::InterConnectTwoPlantLoopSides( + state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, this->plantTypeOfNum, true); + } + if (this->HeatRecActive) { + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + this->plantTypeOfNum, + this->HRLoopNum, + this->HRLoopSideNum, + this->HRBranchNum, + this->HRCompNum, + errFlag, + _, + _, + _, + this->HeatRecInletNodeNum, + _); + PlantUtilities::InterConnectTwoPlantLoopSides( + state, this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, true); + } + + if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled && + this->HeatRecActive) { + PlantUtilities::InterConnectTwoPlantLoopSides( + state, this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, false); + } + if (errFlag) { + ShowFatalError(state, "InitEngineDrivenChiller: Program terminated due to previous condition(s)."); + } + + if (this->FlowMode == DataPlant::FlowMode::Constant) { + // reset flow priority + state.dataPlnt->PlantLoop(this->CWLoopNum) + .LoopSide(this->CWLoopSideNum) + .Branch(this->CWBranchNum) + .Comp(this->CWCompNum) + .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; + } + + if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { + // reset flow priority + state.dataPlnt->PlantLoop(this->CWLoopNum) + .LoopSide(this->CWLoopSideNum) + .Branch(this->CWBranchNum) + .Comp(this->CWCompNum) + .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; + // check if setpoint on outlet node + if ((state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && + (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi == DataLoopNode::SensedNodeFlagValue)) { + if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { + if (!this->ModulatedFlowErrDone) { + ShowWarningError(state, "Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + this->Name); + ShowContinueError( + state, + " A temperature setpoint is needed at the outlet node of a chiller in variable flow mode, use a SetpointManager"); + ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); + this->ModulatedFlowErrDone = true; + } + } else { + // need call to EMS to check node + bool FatalError = false; // but not really fatal yet, but should be. + EMSManager::CheckIfNodeSetPointManagedByEMS( + state, this->EvapOutletNodeNum, EMSManager::SPControlType::iTemperatureSetPoint, FatalError); + state.dataLoopNodes->NodeSetpointCheck(this->EvapOutletNodeNum).needsSetpointChecking = false; + if (FatalError) { + if (!this->ModulatedFlowErrDone) { + ShowWarningError(state, "Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + this->Name); + ShowContinueError( + state, " A temperature setpoint is needed at the outlet node of a chiller evaporator in variable flow mode"); + ShowContinueError(state, " use a Setpoint Manager to establish a setpoint at the chiller evaporator outlet node "); + ShowContinueError(state, " or use an EMS actuator to establish a setpoint at the outlet node "); + ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); + this->ModulatedFlowErrDone = true; + } + } + } + this->ModulatedFlowSetToLoop = true; + state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint = + state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi = + state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + } + } + + this->MyFlag = false; + } + } GTChillerSpecs *GTChillerSpecs::factory(EnergyPlusData &state, std::string const &chillerName) { @@ -4825,126 +4837,10 @@ namespace PlantChillers { // Uses the status flags to trigger initializations. // SUBROUTINE PARAMETER DEFINITIONS: + static std::string const RoutineName("InitGTChiller"); - // Init more variables - if (this->MyFlag) { - // Locate the chillers on the plant loops for later usage - bool errFlag = false; - this->setupOutputVariables(state); - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - this->plantTypeOfNum, - this->CWLoopNum, - this->CWLoopSideNum, - this->CWBranchNum, - this->CWCompNum, - errFlag, - this->TempLowLimitEvapOut, - _, - _, - this->EvapInletNodeNum, - _); - if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled) { - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - this->plantTypeOfNum, - this->CDLoopNum, - this->CDLoopSideNum, - this->CDBranchNum, - this->CDCompNum, - errFlag, - _, - _, - _, - this->CondInletNodeNum, - _); - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, this->plantTypeOfNum, true); - } - if (this->HeatRecActive) { - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - this->plantTypeOfNum, - this->HRLoopNum, - this->HRLoopSideNum, - this->HRBranchNum, - this->HRCompNum, - errFlag, - _, - _, - _, - this->HeatRecInletNodeNum, - _); - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, true); - } - - if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled && - this->HeatRecActive) { - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, false); - } - if (errFlag) { - ShowFatalError(state, "InitGTChiller: Program terminated due to previous condition(s)."); - } - - if (this->FlowMode == DataPlant::FlowMode::Constant) { - // reset flow priority - state.dataPlnt->PlantLoop(this->CWLoopNum) - .LoopSide(this->CWLoopSideNum) - .Branch(this->CWBranchNum) - .Comp(this->CWCompNum) - .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; - } - - if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { - // reset flow priority - state.dataPlnt->PlantLoop(this->CWLoopNum) - .LoopSide(this->CWLoopSideNum) - .Branch(this->CWBranchNum) - .Comp(this->CWCompNum) - .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; - - // check if setpoint on outlet node - if ((state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && - (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi == DataLoopNode::SensedNodeFlagValue)) { - if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { - if (!this->ModulatedFlowErrDone) { - ShowWarningError(state, "Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + this->Name); - ShowContinueError( - state, - " A temperature setpoint is needed at the outlet node of a chiller in variable flow mode, use a SetpointManager"); - ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); - this->ModulatedFlowErrDone = true; - } - } else { - // need call to EMS to check node - bool FatalError = false; // but not really fatal yet, but should be. - EMSManager::CheckIfNodeSetPointManagedByEMS( - state, this->EvapOutletNodeNum, EMSManager::SPControlType::iTemperatureSetPoint, FatalError); - state.dataLoopNodes->NodeSetpointCheck(this->EvapOutletNodeNum).needsSetpointChecking = false; - if (FatalError) { - if (!this->ModulatedFlowErrDone) { - ShowWarningError(state, "Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + this->Name); - ShowContinueError( - state, " A temperature setpoint is needed at the outlet node of a chiller evaporator in variable flow mode"); - ShowContinueError(state, " use a Setpoint Manager to establish a setpoint at the chiller evaporator outlet node "); - ShowContinueError(state, " or use an EMS actuator to establish a setpoint at the outlet node "); - ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); - this->ModulatedFlowErrDone = true; - } - } - } - this->ModulatedFlowSetToLoop = true; - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint = - state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi = - state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; - } - } - this->MyFlag = false; - } + this->oneTimeInit(state); if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { @@ -6166,6 +6062,127 @@ namespace PlantChillers { } } } + void GTChillerSpecs::oneTimeInit(EnergyPlusData &state) + { + // Init more variables + if (this->MyFlag) { + // Locate the chillers on the plant loops for later usage + bool errFlag = false; + this->setupOutputVariables(state); + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + this->plantTypeOfNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum, + errFlag, + this->TempLowLimitEvapOut, + _, + _, + this->EvapInletNodeNum, + _); + if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled) { + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + this->plantTypeOfNum, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum, + errFlag, + _, + _, + _, + this->CondInletNodeNum, + _); + PlantUtilities::InterConnectTwoPlantLoopSides( + state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, this->plantTypeOfNum, true); + } + if (this->HeatRecActive) { + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + this->plantTypeOfNum, + this->HRLoopNum, + this->HRLoopSideNum, + this->HRBranchNum, + this->HRCompNum, + errFlag, + _, + _, + _, + this->HeatRecInletNodeNum, + _); + PlantUtilities::InterConnectTwoPlantLoopSides( + state, this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, true); + } + + if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled && + this->HeatRecActive) { + PlantUtilities::InterConnectTwoPlantLoopSides( + state, this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, false); + } + if (errFlag) { + ShowFatalError(state, "InitGTChiller: Program terminated due to previous condition(s)."); + } + + if (this->FlowMode == DataPlant::FlowMode::Constant) { + // reset flow priority + state.dataPlnt->PlantLoop(this->CWLoopNum) + .LoopSide(this->CWLoopSideNum) + .Branch(this->CWBranchNum) + .Comp(this->CWCompNum) + .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; + } + + if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { + // reset flow priority + state.dataPlnt->PlantLoop(this->CWLoopNum) + .LoopSide(this->CWLoopSideNum) + .Branch(this->CWBranchNum) + .Comp(this->CWCompNum) + .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; + + // check if setpoint on outlet node + if ((state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && + (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi == DataLoopNode::SensedNodeFlagValue)) { + if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { + if (!this->ModulatedFlowErrDone) { + ShowWarningError(state, "Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + this->Name); + ShowContinueError( + state, + " A temperature setpoint is needed at the outlet node of a chiller in variable flow mode, use a SetpointManager"); + ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); + this->ModulatedFlowErrDone = true; + } + } else { + // need call to EMS to check node + bool FatalError = false; // but not really fatal yet, but should be. + EMSManager::CheckIfNodeSetPointManagedByEMS( + state, this->EvapOutletNodeNum, EMSManager::SPControlType::iTemperatureSetPoint, FatalError); + state.dataLoopNodes->NodeSetpointCheck(this->EvapOutletNodeNum).needsSetpointChecking = false; + if (FatalError) { + if (!this->ModulatedFlowErrDone) { + ShowWarningError(state, "Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + this->Name); + ShowContinueError( + state, " A temperature setpoint is needed at the outlet node of a chiller evaporator in variable flow mode"); + ShowContinueError(state, " use a Setpoint Manager to establish a setpoint at the chiller evaporator outlet node "); + ShowContinueError(state, " or use an EMS actuator to establish a setpoint at the outlet node "); + ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); + this->ModulatedFlowErrDone = true; + } + } + } + this->ModulatedFlowSetToLoop = true; + state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint = + state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi = + state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + } + } + this->MyFlag = false; + } + } ConstCOPChillerSpecs *ConstCOPChillerSpecs::factory(EnergyPlusData &state, std::string const &chillerName) { @@ -6626,104 +6643,12 @@ namespace PlantChillers { // Based on InitElectricChiller from Fred Buhl // SUBROUTINE PARAMETER DEFINITIONS: - static std::string const RoutineName("InitConstCOPChiller"); - Real64 const TempDesCondIn(25.0); // Design condenser inlet temp. C - // Init more variables - if (this->MyFlag) { - // Locate the chillers on the plant loops for later usage - bool errFlag = false; - this->setupOutputVariables(state); - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - this->plantTypeOfNum, - this->CWLoopNum, - this->CWLoopSideNum, - this->CWBranchNum, - this->CWCompNum, - errFlag, - _, - _, - _, - this->EvapInletNodeNum, - _); - if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled) { - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - this->plantTypeOfNum, - this->CDLoopNum, - this->CDLoopSideNum, - this->CDBranchNum, - this->CDCompNum, - errFlag, - _, - _, - _, - this->CondInletNodeNum, - _); - PlantUtilities::InterConnectTwoPlantLoopSides( - state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, this->plantTypeOfNum, true); - } + static std::string const RoutineName("InitConstCOPChiller"); - if (errFlag) { - ShowFatalError(state, "CalcConstCOPChillerModel: Program terminated due to previous condition(s)."); - } - if (this->FlowMode == DataPlant::FlowMode::Constant) { - // reset flow priority - state.dataPlnt->PlantLoop(this->CWLoopNum) - .LoopSide(this->CWLoopSideNum) - .Branch(this->CWBranchNum) - .Comp(this->CWCompNum) - .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; - } + Real64 const TempDesCondIn(25.0); // Design condenser inlet temp. C - if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { - // reset flow priority - state.dataPlnt->PlantLoop(this->CWLoopNum) - .LoopSide(this->CWLoopSideNum) - .Branch(this->CWBranchNum) - .Comp(this->CWCompNum) - .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; - - // check if setpoint on outlet node - if ((state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && - (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi == DataLoopNode::SensedNodeFlagValue)) { - if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { - if (!this->ModulatedFlowErrDone) { - ShowWarningError(state, "Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + this->Name); - ShowContinueError( - state, - " A temperature setpoint is needed at the outlet node of a chiller in variable flow mode, use a SetpointManager"); - ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); - this->ModulatedFlowErrDone = true; - } - } else { - // need call to EMS to check node - bool FatalError = false; // but not really fatal yet, but should be. - EMSManager::CheckIfNodeSetPointManagedByEMS( - state, this->EvapOutletNodeNum, EMSManager::SPControlType::iTemperatureSetPoint, FatalError); - state.dataLoopNodes->NodeSetpointCheck(this->EvapOutletNodeNum).needsSetpointChecking = false; - if (FatalError) { - if (!this->ModulatedFlowErrDone) { - ShowWarningError(state, "Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + this->Name); - ShowContinueError( - state, " A temperature setpoint is needed at the outlet node of a chiller evaporator in variable flow mode"); - ShowContinueError(state, " use a Setpoint Manager to establish a setpoint at the chiller evaporator outlet node "); - ShowContinueError(state, " or use an EMS actuator to establish a setpoint at the outlet node "); - ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); - this->ModulatedFlowErrDone = true; - } - } - } - this->ModulatedFlowSetToLoop = true; - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint = - state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; - state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi = - state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; - } - } - this->MyFlag = false; - } + this->oneTimeInit(state); // Initialize critical Demand Side Variables at the beginning of each environment if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { @@ -7624,6 +7549,104 @@ namespace PlantChillers { state.dataLoopNodes->Node(this->CondOutletNodeNum).Temp = this->CondOutletTemp; } } + void ConstCOPChillerSpecs::oneTimeInit(EnergyPlusData &state) + { + // Init more variables + if (this->MyFlag) { + // Locate the chillers on the plant loops for later usage + bool errFlag = false; + this->setupOutputVariables(state); + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + this->plantTypeOfNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum, + errFlag, + _, + _, + _, + this->EvapInletNodeNum, + _); + if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled) { + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + this->plantTypeOfNum, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum, + errFlag, + _, + _, + _, + this->CondInletNodeNum, + _); + PlantUtilities::InterConnectTwoPlantLoopSides( + state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, this->plantTypeOfNum, true); + } + + if (errFlag) { + ShowFatalError(state, "CalcConstCOPChillerModel: Program terminated due to previous condition(s)."); + } + if (this->FlowMode == DataPlant::FlowMode::Constant) { + // reset flow priority + state.dataPlnt->PlantLoop(this->CWLoopNum) + .LoopSide(this->CWLoopSideNum) + .Branch(this->CWBranchNum) + .Comp(this->CWCompNum) + .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; + } + + if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { + // reset flow priority + state.dataPlnt->PlantLoop(this->CWLoopNum) + .LoopSide(this->CWLoopSideNum) + .Branch(this->CWBranchNum) + .Comp(this->CWCompNum) + .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; + + // check if setpoint on outlet node + if ((state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && + (state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi == DataLoopNode::SensedNodeFlagValue)) { + if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { + if (!this->ModulatedFlowErrDone) { + ShowWarningError(state, "Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + this->Name); + ShowContinueError( + state, + " A temperature setpoint is needed at the outlet node of a chiller in variable flow mode, use a SetpointManager"); + ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); + this->ModulatedFlowErrDone = true; + } + } else { + // need call to EMS to check node + bool FatalError = false; // but not really fatal yet, but should be. + EMSManager::CheckIfNodeSetPointManagedByEMS( + state, this->EvapOutletNodeNum, EMSManager::SPControlType::iTemperatureSetPoint, FatalError); + state.dataLoopNodes->NodeSetpointCheck(this->EvapOutletNodeNum).needsSetpointChecking = false; + if (FatalError) { + if (!this->ModulatedFlowErrDone) { + ShowWarningError(state, "Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + this->Name); + ShowContinueError( + state, " A temperature setpoint is needed at the outlet node of a chiller evaporator in variable flow mode"); + ShowContinueError(state, " use a Setpoint Manager to establish a setpoint at the chiller evaporator outlet node "); + ShowContinueError(state, " or use an EMS actuator to establish a setpoint at the outlet node "); + ShowContinueError(state, " The overall loop setpoint will be assumed for chiller. The simulation continues ... "); + this->ModulatedFlowErrDone = true; + } + } + } + this->ModulatedFlowSetToLoop = true; + state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPoint = + state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + state.dataLoopNodes->Node(this->EvapOutletNodeNum).TempSetPointHi = + state.dataLoopNodes->Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + } + } + this->MyFlag = false; + } + } } // namespace PlantChillers diff --git a/src/EnergyPlus/PlantChillers.hh b/src/EnergyPlus/PlantChillers.hh index cd5793bba87..f7322c6bc78 100644 --- a/src/EnergyPlus/PlantChillers.hh +++ b/src/EnergyPlus/PlantChillers.hh @@ -267,6 +267,8 @@ namespace PlantChillers { Real64 condInletTemp, // current condenser Inlet Temp Real64 &QHeatRec // amount of heat recovered ); + + void oneTimeInit(EnergyPlusData &state) override; }; struct EngineDrivenChillerSpecs : BaseChillerSpecs @@ -369,6 +371,8 @@ namespace PlantChillers { Real64 MyLoad, // current load bool RunFlag // TRUE if chiller operating ); + + void oneTimeInit(EnergyPlusData &state) override; }; struct GTChillerSpecs : BaseChillerSpecs @@ -463,6 +467,8 @@ namespace PlantChillers { Real64 MyLoad, // current load bool RunFlag // TRUE if chiller operating ); + + void oneTimeInit(EnergyPlusData &state) override; }; struct ConstCOPChillerSpecs : BaseChillerSpecs @@ -494,6 +500,8 @@ namespace PlantChillers { void calculate(EnergyPlusData &state, Real64 &MyLoad, bool RunFlag, DataBranchAirLoopPlant::ControlTypeEnum EquipFlowCtrl); void update(EnergyPlusData &state, Real64 MyLoad, bool RunFlag); + + void oneTimeInit(EnergyPlusData &state) override; }; } // namespace PlantChillers diff --git a/src/EnergyPlus/PlantComponent.hh b/src/EnergyPlus/PlantComponent.hh index 95bc2eb51e3..d0ddde60401 100644 --- a/src/EnergyPlus/PlantComponent.hh +++ b/src/EnergyPlus/PlantComponent.hh @@ -82,8 +82,7 @@ public: { } - // virtual void oneTimeInit(EnergyPlusData &state) = 0; - virtual void oneTimeInit([[maybe_unused]] EnergyPlusData &state){}; + virtual void oneTimeInit(EnergyPlusData &state) = 0; ~PlantComponent() = default; }; diff --git a/src/EnergyPlus/PlantComponentTemperatureSources.cc b/src/EnergyPlus/PlantComponentTemperatureSources.cc index 435a9b13fe7..54a0e8adf87 100644 --- a/src/EnergyPlus/PlantComponentTemperatureSources.cc +++ b/src/EnergyPlus/PlantComponentTemperatureSources.cc @@ -124,31 +124,10 @@ namespace PlantComponentTemperatureSources { // Uses the status flags to trigger initializations. // SUBROUTINE PARAMETER DEFINITIONS: + static std::string const RoutineName("InitWaterSource"); - if (this->MyFlag) { - // setup output variables once here - this->setupOutputVars(state); - // Locate the component on the plant loops for later usage - bool errFlag = false; - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - DataPlant::TypeOf_WaterSource, - this->Location.loopNum, - this->Location.loopSideNum, - this->Location.branchNum, - this->Location.compNum, - errFlag, - _, - _, - _, - this->InletNodeNum, - _); - if (errFlag) { - ShowFatalError(state, RoutineName + ": Program terminated due to previous condition(s)."); - } - this->MyFlag = false; - } + this->oneTimeInit(state); // Initialize critical Demand Side Variables at the beginning of each environment if (this->MyEnvironFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { @@ -449,6 +428,34 @@ namespace PlantComponentTemperatureSources { this->initialize(state, myLoad); this->autosize(state); } + void WaterSourceSpecs::oneTimeInit(EnergyPlusData &state) + { + static std::string const RoutineName("InitWaterSource"); + + if (this->MyFlag) { + // setup output variables once here + this->setupOutputVars(state); + // Locate the component on the plant loops for later usage + bool errFlag = false; + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + DataPlant::TypeOf_WaterSource, + this->Location.loopNum, + this->Location.loopSideNum, + this->Location.branchNum, + this->Location.compNum, + errFlag, + _, + _, + _, + this->InletNodeNum, + _); + if (errFlag) { + ShowFatalError(state, RoutineName + ": Program terminated due to previous condition(s)."); + } + this->MyFlag = false; + } + } void GetWaterSourceInput(EnergyPlusData &state) { diff --git a/src/EnergyPlus/PlantComponentTemperatureSources.hh b/src/EnergyPlus/PlantComponentTemperatureSources.hh index 2937756a8b4..68b9c98823c 100644 --- a/src/EnergyPlus/PlantComponentTemperatureSources.hh +++ b/src/EnergyPlus/PlantComponentTemperatureSources.hh @@ -137,6 +137,8 @@ namespace PlantComponentTemperatureSources { void onInitLoopEquip(EnergyPlusData &state, const PlantLocation &calledFromLocation) override; static PlantComponent *factory(EnergyPlusData &state, std::string const &objectName); + + void oneTimeInit(EnergyPlusData &state) override; }; void GetWaterSourceInput(EnergyPlusData &state); diff --git a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc index ab3acecc6b8..42295899a26 100644 --- a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc +++ b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc @@ -614,172 +614,8 @@ void HeatExchangerStruct::initialize(EnergyPlusData &state) // Initialize heat exchanger model static std::string const RoutineNameNoColon("InitFluidHeatExchanger"); - static std::string const RoutineName("InitFluidHeatExchanger: "); - if (this->MyOneTimeFlag) { - this->setupOutputVars(state); - this->MyFlag = true; - this->MyEnvrnFlag = true; - this->MyOneTimeFlag = false; - } - - if (this->MyFlag) { - // locate the main two connections to the plant loops - bool errFlag = false; - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - DataPlant::TypeOf_FluidToFluidPlantHtExchg, - this->DemandSideLoop.loopNum, - this->DemandSideLoop.loopSideNum, - this->DemandSideLoop.branchNum, - this->DemandSideLoop.compNum, - errFlag, - _, - _, - _, - this->DemandSideLoop.inletNodeNum, - _); - - if (this->DemandSideLoop.loopSideNum != DataPlant::DemandSide) { // throw error - ShowSevereError(state, - RoutineName + " Invalid connections for " + DataPlant::ccSimPlantEquipTypes(DataPlant::TypeOf_FluidToFluidPlantHtExchg) + - " name = \"" + this->Name + "\""); - ShowContinueError(state, "The \"Loop Demand Side\" connections are not on the Demand Side of a plant loop"); - errFlag = true; - } - - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - DataPlant::TypeOf_FluidToFluidPlantHtExchg, - this->SupplySideLoop.loopNum, - this->SupplySideLoop.loopSideNum, - this->SupplySideLoop.branchNum, - this->SupplySideLoop.compNum, - errFlag, - _, - _, - _, - this->SupplySideLoop.inletNodeNum, - _); - - if (this->SupplySideLoop.loopSideNum != DataPlant::SupplySide) { // throw error - ShowSevereError(state, - RoutineName + " Invalid connections for " + DataPlant::ccSimPlantEquipTypes(DataPlant::TypeOf_FluidToFluidPlantHtExchg) + - " name = \"" + this->Name + "\""); - ShowContinueError(state, "The \"Loop Supply Side\" connections are not on the Supply Side of a plant loop"); - errFlag = true; - } - - // make sure it is not the same loop on both sides. - if (this->SupplySideLoop.loopNum == this->DemandSideLoop.loopNum) { // user is being too tricky, don't allow - ShowSevereError(state, - RoutineName + " Invalid connections for " + DataPlant::ccSimPlantEquipTypes(DataPlant::TypeOf_FluidToFluidPlantHtExchg) + - " name = \"" + this->Name + "\""); - ShowContinueError(state, R"(The "Loop Supply Side" and "Loop Demand Side" need to be on different loops.)"); - errFlag = true; - } else { - - PlantUtilities::InterConnectTwoPlantLoopSides(state, - this->SupplySideLoop.loopNum, - this->SupplySideLoop.loopSideNum, - this->DemandSideLoop.loopNum, - this->DemandSideLoop.loopSideNum, - DataPlant::TypeOf_FluidToFluidPlantHtExchg, - true); - } - - // find remote component if control mode is of that type. - if (this->ControlMode == iCtrlType::CoolingSetPointOnOffWithComponentOverride) { - - PlantUtilities::ScanPlantLoopsForNodeNum(state, - RoutineName, - this->OtherCompSupplySideLoop.inletNodeNum, - this->OtherCompSupplySideLoop.loopNum, - this->OtherCompSupplySideLoop.loopSideNum, - this->OtherCompSupplySideLoop.branchNum, - this->OtherCompSupplySideLoop.compNum); - - PlantUtilities::ScanPlantLoopsForNodeNum(state, - RoutineName, - this->OtherCompDemandSideLoop.inletNodeNum, - this->OtherCompDemandSideLoop.loopNum, - this->OtherCompDemandSideLoop.loopSideNum, - this->OtherCompDemandSideLoop.branchNum, - this->OtherCompDemandSideLoop.compNum); - - // revise how loads served category for other controlled equipment - int LoopNum2 = this->OtherCompSupplySideLoop.loopNum; - int LoopSideNum = this->OtherCompSupplySideLoop.loopSideNum; - int BranchNum = this->OtherCompSupplySideLoop.branchNum; - int LoopCompNum = this->OtherCompSupplySideLoop.compNum; - - { - auto const SELECT_CASE_var( - state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).HowLoadServed); - - if (SELECT_CASE_var == DataPlant::HowMet_ByNominalCap) { - state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).HowLoadServed = - DataPlant::HowMet_ByNominalCapFreeCoolCntrl; - } else if (SELECT_CASE_var == DataPlant::HowMet_ByNominalCapLowOutLimit) { - state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).HowLoadServed = - DataPlant::HowMet_ByNominalCapLowOutLimitFreeCoolCntrl; - } - } - - { - auto const SELECT_CASE_var(this->ControlSignalTemp); - if (SELECT_CASE_var == iCtrlTemp::WetBulbTemperature) { - state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlMode = - DataPlant::iFreeCoolControlMode::WetBulb; - } else if (SELECT_CASE_var == iCtrlTemp::DryBulbTemperature) { - state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlMode = - DataPlant::iFreeCoolControlMode::DryBulb; - } else if (SELECT_CASE_var == iCtrlTemp::LoopTemperature) { - state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlMode = - DataPlant::iFreeCoolControlMode::Loop; - state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlNodeNum = - this->OtherCompDemandSideLoop.inletNodeNum; - } - } - } - if (this->ControlMode == iCtrlType::TrackComponentOnOff) { - if (this->OtherCompSupplySideLoop.inletNodeNum > 0) { - PlantUtilities::ScanPlantLoopsForObject(state, - this->ComponentUserName, - this->ComponentTypeOfNum, - this->OtherCompSupplySideLoop.loopNum, - this->OtherCompSupplySideLoop.loopSideNum, - this->OtherCompSupplySideLoop.branchNum, - this->OtherCompSupplySideLoop.compNum, - errFlag, - _, - _, - _, - this->OtherCompSupplySideLoop.inletNodeNum, - _); - } - if (this->OtherCompDemandSideLoop.inletNodeNum > 0) { - PlantUtilities::ScanPlantLoopsForObject(state, - this->ComponentUserName, - this->ComponentTypeOfNum, - this->OtherCompDemandSideLoop.loopNum, - this->OtherCompDemandSideLoop.loopSideNum, - this->OtherCompDemandSideLoop.branchNum, - this->OtherCompDemandSideLoop.compNum, - errFlag, - _, - _, - _, - this->OtherCompDemandSideLoop.inletNodeNum, - _); - } - } - - if (errFlag) { - ShowFatalError(state, RoutineName + "Program terminated due to previous condition(s)."); - } - this->MyFlag = false; - } // plant setup + this->oneTimeInit(state); // plant setup if (state.dataGlobal->BeginEnvrnFlag && this->MyEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { @@ -2397,5 +2233,181 @@ Real64 HeatExchangerStruct::demandSideFlowResidual(EnergyPlusData &state, return Residuum; } +void HeatExchangerStruct::oneTimeInit(EnergyPlusData &state) +{ + + static constexpr std::string_view RoutineName("InitFluidHeatExchanger: "); + + if (this->MyOneTimeFlag) { + this->setupOutputVars(state); + this->MyFlag = true; + this->MyEnvrnFlag = true; + this->MyOneTimeFlag = false; + } + + if (this->MyFlag) { + // locate the main two connections to the plant loops + bool errFlag = false; + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + DataPlant::TypeOf_FluidToFluidPlantHtExchg, + this->DemandSideLoop.loopNum, + this->DemandSideLoop.loopSideNum, + this->DemandSideLoop.branchNum, + this->DemandSideLoop.compNum, + errFlag, + _, + _, + _, + this->DemandSideLoop.inletNodeNum, + _); + + if (this->DemandSideLoop.loopSideNum != DataPlant::DemandSide) { // throw error + ShowSevereError(state, + format("{} Invalid connections for {} name = \"{}\"", + RoutineName, + DataPlant::ccSimPlantEquipTypes(DataPlant::TypeOf_FluidToFluidPlantHtExchg), + this->Name)); + ShowContinueError(state, "The \"Loop Demand Side\" connections are not on the Demand Side of a plant loop"); + errFlag = true; + } + + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + DataPlant::TypeOf_FluidToFluidPlantHtExchg, + this->SupplySideLoop.loopNum, + this->SupplySideLoop.loopSideNum, + this->SupplySideLoop.branchNum, + this->SupplySideLoop.compNum, + errFlag, + _, + _, + _, + this->SupplySideLoop.inletNodeNum, + _); + + if (this->SupplySideLoop.loopSideNum != DataPlant::SupplySide) { // throw error + ShowSevereError(state, + format("{} Invalid connections for {} name = \"{}\"", + RoutineName, + DataPlant::ccSimPlantEquipTypes(DataPlant::TypeOf_FluidToFluidPlantHtExchg), + this->Name)); + ShowContinueError(state, "The \"Loop Supply Side\" connections are not on the Supply Side of a plant loop"); + errFlag = true; + } + + // make sure it is not the same loop on both sides. + if (this->SupplySideLoop.loopNum == this->DemandSideLoop.loopNum) { // user is being too tricky, don't allow + ShowSevereError(state, + format("{} Invalid connections for {} name = \"{}\"", + RoutineName, + DataPlant::ccSimPlantEquipTypes(DataPlant::TypeOf_FluidToFluidPlantHtExchg), + this->Name)); + ShowContinueError(state, R"(The "Loop Supply Side" and "Loop Demand Side" need to be on different loops.)"); + errFlag = true; + } else { + + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->SupplySideLoop.loopNum, + this->SupplySideLoop.loopSideNum, + this->DemandSideLoop.loopNum, + this->DemandSideLoop.loopSideNum, + DataPlant::TypeOf_FluidToFluidPlantHtExchg, + true); + } + + // find remote component if control mode is of that type. + if (this->ControlMode == iCtrlType::CoolingSetPointOnOffWithComponentOverride) { + + PlantUtilities::ScanPlantLoopsForNodeNum(state, + RoutineName, + this->OtherCompSupplySideLoop.inletNodeNum, + this->OtherCompSupplySideLoop.loopNum, + this->OtherCompSupplySideLoop.loopSideNum, + this->OtherCompSupplySideLoop.branchNum, + this->OtherCompSupplySideLoop.compNum); + + PlantUtilities::ScanPlantLoopsForNodeNum(state, + RoutineName, + this->OtherCompDemandSideLoop.inletNodeNum, + this->OtherCompDemandSideLoop.loopNum, + this->OtherCompDemandSideLoop.loopSideNum, + this->OtherCompDemandSideLoop.branchNum, + this->OtherCompDemandSideLoop.compNum); + + // revise how loads served category for other controlled equipment + int LoopNum2 = this->OtherCompSupplySideLoop.loopNum; + int LoopSideNum = this->OtherCompSupplySideLoop.loopSideNum; + int BranchNum = this->OtherCompSupplySideLoop.branchNum; + int LoopCompNum = this->OtherCompSupplySideLoop.compNum; + + { + auto const SELECT_CASE_var( + state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).HowLoadServed); + + if (SELECT_CASE_var == DataPlant::HowMet_ByNominalCap) { + state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).HowLoadServed = + DataPlant::HowMet_ByNominalCapFreeCoolCntrl; + } else if (SELECT_CASE_var == DataPlant::HowMet_ByNominalCapLowOutLimit) { + state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).HowLoadServed = + DataPlant::HowMet_ByNominalCapLowOutLimitFreeCoolCntrl; + } + } + + { + auto const SELECT_CASE_var(this->ControlSignalTemp); + if (SELECT_CASE_var == iCtrlTemp::WetBulbTemperature) { + state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlMode = + DataPlant::iFreeCoolControlMode::WetBulb; + } else if (SELECT_CASE_var == iCtrlTemp::DryBulbTemperature) { + state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlMode = + DataPlant::iFreeCoolControlMode::DryBulb; + } else if (SELECT_CASE_var == iCtrlTemp::LoopTemperature) { + state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlMode = + DataPlant::iFreeCoolControlMode::Loop; + state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlNodeNum = + this->OtherCompDemandSideLoop.inletNodeNum; + } + } + } + if (this->ControlMode == iCtrlType::TrackComponentOnOff) { + if (this->OtherCompSupplySideLoop.inletNodeNum > 0) { + PlantUtilities::ScanPlantLoopsForObject(state, + this->ComponentUserName, + this->ComponentTypeOfNum, + this->OtherCompSupplySideLoop.loopNum, + this->OtherCompSupplySideLoop.loopSideNum, + this->OtherCompSupplySideLoop.branchNum, + this->OtherCompSupplySideLoop.compNum, + errFlag, + _, + _, + _, + this->OtherCompSupplySideLoop.inletNodeNum, + _); + } + if (this->OtherCompDemandSideLoop.inletNodeNum > 0) { + PlantUtilities::ScanPlantLoopsForObject(state, + this->ComponentUserName, + this->ComponentTypeOfNum, + this->OtherCompDemandSideLoop.loopNum, + this->OtherCompDemandSideLoop.loopSideNum, + this->OtherCompDemandSideLoop.branchNum, + this->OtherCompDemandSideLoop.compNum, + errFlag, + _, + _, + _, + this->OtherCompDemandSideLoop.inletNodeNum, + _); + } + } + + if (errFlag) { + ShowFatalError(state, format("{} Program terminated due to previous condition(s).", RoutineName)); + } + this->MyFlag = false; + } +} } // namespace EnergyPlus::PlantHeatExchangerFluidToFluid diff --git a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.hh b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.hh index 14e1ae23866..2cc27dbd3c7 100644 --- a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.hh +++ b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.hh @@ -218,6 +218,8 @@ namespace PlantHeatExchangerFluidToFluid { Real64 DmdSideMassFlowRate, Array1D const &Par // Par(1) = HX index number ); + + void oneTimeInit(EnergyPlusData &state) override; }; void GetFluidHeatExchangerInput(EnergyPlusData &state); diff --git a/src/EnergyPlus/PlantLoadProfile.cc b/src/EnergyPlus/PlantLoadProfile.cc index 178facbbc5d..99389159e4e 100644 --- a/src/EnergyPlus/PlantLoadProfile.cc +++ b/src/EnergyPlus/PlantLoadProfile.cc @@ -188,32 +188,9 @@ void PlantProfileData::InitPlantProfile(EnergyPlusData &state) // SUBROUTINE LOCAL VARIABLE DECLARATIONS: static std::string const RoutineName("InitPlantProfile"); Real64 FluidDensityInit; - bool errFlag; // Do the one time initializations - if (this->SetLoopIndexFlag) { - if (allocated(state.dataPlnt->PlantLoop)) { - errFlag = false; - ScanPlantLoopsForObject(state, - this->Name, - this->TypeNum, - this->WLoopNum, - this->WLoopSideNum, - this->WLoopBranchNum, - this->WLoopCompNum, - errFlag, - _, - _, - _, - _, - _); - if (errFlag) { - ShowFatalError(state, "InitPlantProfile: Program terminated for previous conditions."); - } - - this->SetLoopIndexFlag = false; - } - } + this->oneTimeInit(state); if (!state.dataGlobal->SysSizingCalc && this->InitSizing) { RegisterPlantCompDesignFlow(state, InletNode, this->PeakVolFlowRate); @@ -318,6 +295,34 @@ void PlantProfileData::ReportPlantProfile(EnergyPlusData &state) this->CoolingEnergy = std::abs(this->Energy); } } +void PlantProfileData::oneTimeInit(EnergyPlusData &state) +{ + bool errFlag; + + if (this->SetLoopIndexFlag) { + if (allocated(state.dataPlnt->PlantLoop)) { + errFlag = false; + ScanPlantLoopsForObject(state, + this->Name, + this->TypeNum, + this->WLoopNum, + this->WLoopSideNum, + this->WLoopBranchNum, + this->WLoopCompNum, + errFlag, + _, + _, + _, + _, + _); + if (errFlag) { + ShowFatalError(state, "InitPlantProfile: Program terminated for previous conditions."); + } + + this->SetLoopIndexFlag = false; + } + } +} // Functions void GetPlantProfileInput(EnergyPlusData &state) diff --git a/src/EnergyPlus/PlantLoadProfile.hh b/src/EnergyPlus/PlantLoadProfile.hh index 49ca890723b..f19f854e018 100644 --- a/src/EnergyPlus/PlantLoadProfile.hh +++ b/src/EnergyPlus/PlantLoadProfile.hh @@ -122,6 +122,8 @@ namespace PlantLoadProfile { void UpdatePlantProfile(EnergyPlusData &state) const; void ReportPlantProfile(EnergyPlusData &state); + + void oneTimeInit(EnergyPlusData &state) override; }; // This could be static inside the class diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index a58822a12bf..be059630667 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -356,165 +356,8 @@ void EIRPlantLoopHeatPump::onInitLoopEquip(EnergyPlusData &state, [[maybe_unused { // This function does all one-time and begin-environment initialization std::string static const routineName = std::string("EIRPlantLoopHeatPump :") + __FUNCTION__; - if (this->oneTimeInit) { - bool errFlag = false; - - // setup output variables - SetupOutputVariable( - state, "Heat Pump Load Side Heat Transfer Rate", OutputProcessor::Unit::W, this->loadSideHeatTransfer, "System", "Average", this->name); - SetupOutputVariable(state, - "Heat Pump Load Side Heat Transfer Energy", - OutputProcessor::Unit::J, - this->loadSideEnergy, - "System", - "Sum", - this->name, - _, - "ENERGYTRANSFER", - _, - _, - "Plant"); - SetupOutputVariable(state, - "Heat Pump Source Side Heat Transfer Rate", - OutputProcessor::Unit::W, - this->sourceSideHeatTransfer, - "System", - "Average", - this->name); - SetupOutputVariable( - state, "Heat Pump Source Side Heat Transfer Energy", OutputProcessor::Unit::J, this->sourceSideEnergy, "System", "Sum", this->name); - SetupOutputVariable( - state, "Heat Pump Load Side Inlet Temperature", OutputProcessor::Unit::C, this->loadSideInletTemp, "System", "Average", this->name); - SetupOutputVariable( - state, "Heat Pump Load Side Outlet Temperature", OutputProcessor::Unit::C, this->loadSideOutletTemp, "System", "Average", this->name); - SetupOutputVariable( - state, "Heat Pump Source Side Inlet Temperature", OutputProcessor::Unit::C, this->sourceSideInletTemp, "System", "Average", this->name); - SetupOutputVariable( - state, "Heat Pump Source Side Outlet Temperature", OutputProcessor::Unit::C, this->sourceSideOutletTemp, "System", "Average", this->name); - SetupOutputVariable(state, "Heat Pump Electricity Rate", OutputProcessor::Unit::W, this->powerUsage, "System", "Average", this->name); - if (this->plantTypeOfNum == DataPlant::TypeOf_HeatPumpEIRCooling) { // energy from HeatPump:PlantLoop:EIR:Cooling object - SetupOutputVariable(state, - "Heat Pump Electricity Energy", - OutputProcessor::Unit::J, - this->powerEnergy, - "System", - "Sum", - this->name, - _, - "Electricity", - "Cooling", - "Heat Pump", - "Plant"); - } else if (this->plantTypeOfNum == DataPlant::TypeOf_HeatPumpEIRHeating) { // energy from HeatPump:PlantLoop:EIR:Heating object - SetupOutputVariable(state, - "Heat Pump Electricity Energy", - OutputProcessor::Unit::J, - this->powerEnergy, - "System", - "Sum", - this->name, - _, - "Electricity", - "Heating", - "Heat Pump", - "Plant"); - } - SetupOutputVariable( - state, "Heat Pump Load Side Mass Flow Rate", OutputProcessor::Unit::kg_s, this->loadSideMassFlowRate, "System", "Average", this->name); - SetupOutputVariable(state, - "Heat Pump Source Side Mass Flow Rate", - OutputProcessor::Unit::kg_s, - this->sourceSideMassFlowRate, - "System", - "Average", - this->name); - - // find this component on the plant - bool thisErrFlag = false; - PlantUtilities::ScanPlantLoopsForObject(state, - this->name, - this->plantTypeOfNum, - this->loadSideLocation.loopNum, - this->loadSideLocation.loopSideNum, - this->loadSideLocation.branchNum, - this->loadSideLocation.compNum, - thisErrFlag, - _, - _, - _, - this->loadSideNodes.inlet, - _); - - if (thisErrFlag) { - ShowSevereError(state, - routineName + ": Plant topology problem for " + DataPlant::ccSimPlantEquipTypes(this->plantTypeOfNum) + " name = \"" + - this->name + "\""); - ShowContinueError(state, "Could not locate component's load side connections on a plant loop"); - errFlag = true; - } else if (this->loadSideLocation.loopSideNum != DataPlant::SupplySide) { // only check if !thisErrFlag - ShowSevereError(state, - routineName + ": Invalid connections for " + DataPlant::ccSimPlantEquipTypes(this->plantTypeOfNum) + " name = \"" + - this->name + "\""); - ShowContinueError(state, "The load side connections are not on the Supply Side of a plant loop"); - errFlag = true; - } - thisErrFlag = false; - if (this->waterSource) { - PlantUtilities::ScanPlantLoopsForObject(state, - this->name, - this->plantTypeOfNum, - this->sourceSideLocation.loopNum, - this->sourceSideLocation.loopSideNum, - this->sourceSideLocation.branchNum, - this->sourceSideLocation.compNum, - thisErrFlag, - _, - _, - _, - this->sourceSideNodes.inlet, - _); - - if (thisErrFlag) { - ShowSevereError(state, - routineName + ": Plant topology problem for " + DataPlant::ccSimPlantEquipTypes(this->plantTypeOfNum) + " name = \"" + - this->name + "\""); - ShowContinueError(state, "Could not locate component's source side connections on a plant loop"); - errFlag = true; - } else if (this->sourceSideLocation.loopSideNum != DataPlant::DemandSide) { // only check if !thisErrFlag - ShowSevereError(state, - routineName + ": Invalid connections for " + DataPlant::ccSimPlantEquipTypes(this->plantTypeOfNum) + " name = \"" + - this->name + "\""); - ShowContinueError(state, "The source side connections are not on the Demand Side of a plant loop"); - errFlag = true; - } - - // make sure it is not the same loop on both sides. - if (this->loadSideLocation.loopNum == this->sourceSideLocation.loopNum) { // user is being too tricky, don't allow - ShowSevereError(state, - routineName + ": Invalid connections for " + DataPlant::ccSimPlantEquipTypes(this->plantTypeOfNum) + " name = \"" + - this->name + "\""); - ShowContinueError(state, "The load and source sides need to be on different loops."); - errFlag = true; - } else { - - PlantUtilities::InterConnectTwoPlantLoopSides(state, - this->loadSideLocation.loopNum, - this->loadSideLocation.loopSideNum, - this->sourceSideLocation.loopNum, - this->sourceSideLocation.loopSideNum, - this->plantTypeOfNum, - true); - } - } else if (this->airSource) { - // nothing to do here ? - } - - if (errFlag) { - ShowFatalError(state, routineName + ": Program terminated due to previous condition(s)."); - } - this->oneTimeInit = false; - } // plant setup + this->oneTimeInit(state); // plant setup if (state.dataGlobal->BeginEnvrnFlag && this->envrnInit && state.dataPlnt->PlantFirstSizesOkayToFinalize) { Real64 rho = FluidProperties::GetDensityGlycol(state, @@ -1240,4 +1083,169 @@ void EIRPlantLoopHeatPump::checkConcurrentOperation(EnergyPlusData &state) } } } +void EIRPlantLoopHeatPump::oneTimeInit(EnergyPlusData &state) +{ + // This function does all the one-time initialization + std::string static const routineName = std::string("EIRPlantLoopHeatPump :") + __FUNCTION__; + + if (this->oneTimeInitFlag) { + bool errFlag = false; + + // setup output variables + SetupOutputVariable( + state, "Heat Pump Load Side Heat Transfer Rate", OutputProcessor::Unit::W, this->loadSideHeatTransfer, "System", "Average", this->name); + SetupOutputVariable(state, + "Heat Pump Load Side Heat Transfer Energy", + OutputProcessor::Unit::J, + this->loadSideEnergy, + "System", + "Sum", + this->name, + _, + "ENERGYTRANSFER", + _, + _, + "Plant"); + SetupOutputVariable(state, + "Heat Pump Source Side Heat Transfer Rate", + OutputProcessor::Unit::W, + this->sourceSideHeatTransfer, + "System", + "Average", + this->name); + SetupOutputVariable( + state, "Heat Pump Source Side Heat Transfer Energy", OutputProcessor::Unit::J, this->sourceSideEnergy, "System", "Sum", this->name); + SetupOutputVariable( + state, "Heat Pump Load Side Inlet Temperature", OutputProcessor::Unit::C, this->loadSideInletTemp, "System", "Average", this->name); + SetupOutputVariable( + state, "Heat Pump Load Side Outlet Temperature", OutputProcessor::Unit::C, this->loadSideOutletTemp, "System", "Average", this->name); + SetupOutputVariable( + state, "Heat Pump Source Side Inlet Temperature", OutputProcessor::Unit::C, this->sourceSideInletTemp, "System", "Average", this->name); + SetupOutputVariable( + state, "Heat Pump Source Side Outlet Temperature", OutputProcessor::Unit::C, this->sourceSideOutletTemp, "System", "Average", this->name); + SetupOutputVariable(state, "Heat Pump Electricity Rate", OutputProcessor::Unit::W, this->powerUsage, "System", "Average", this->name); + if (this->plantTypeOfNum == DataPlant::TypeOf_HeatPumpEIRCooling) { // energy from HeatPump:PlantLoop:EIR:Cooling object + SetupOutputVariable(state, + "Heat Pump Electricity Energy", + OutputProcessor::Unit::J, + this->powerEnergy, + "System", + "Sum", + this->name, + _, + "Electricity", + "Cooling", + "Heat Pump", + "Plant"); + } else if (this->plantTypeOfNum == DataPlant::TypeOf_HeatPumpEIRHeating) { // energy from HeatPump:PlantLoop:EIR:Heating object + SetupOutputVariable(state, + "Heat Pump Electricity Energy", + OutputProcessor::Unit::J, + this->powerEnergy, + "System", + "Sum", + this->name, + _, + "Electricity", + "Heating", + "Heat Pump", + "Plant"); + } + SetupOutputVariable( + state, "Heat Pump Load Side Mass Flow Rate", OutputProcessor::Unit::kg_s, this->loadSideMassFlowRate, "System", "Average", this->name); + SetupOutputVariable(state, + "Heat Pump Source Side Mass Flow Rate", + OutputProcessor::Unit::kg_s, + this->sourceSideMassFlowRate, + "System", + "Average", + this->name); + + // find this component on the plant + bool thisErrFlag = false; + PlantUtilities::ScanPlantLoopsForObject(state, + this->name, + this->plantTypeOfNum, + this->loadSideLocation.loopNum, + this->loadSideLocation.loopSideNum, + this->loadSideLocation.branchNum, + this->loadSideLocation.compNum, + thisErrFlag, + _, + _, + _, + this->loadSideNodes.inlet, + _); + + if (thisErrFlag) { + ShowSevereError(state, + routineName + ": Plant topology problem for " + DataPlant::ccSimPlantEquipTypes(this->plantTypeOfNum) + " name = \"" + + this->name + "\""); + ShowContinueError(state, "Could not locate component's load side connections on a plant loop"); + errFlag = true; + } else if (this->loadSideLocation.loopSideNum != DataPlant::SupplySide) { // only check if !thisErrFlag + ShowSevereError(state, + routineName + ": Invalid connections for " + DataPlant::ccSimPlantEquipTypes(this->plantTypeOfNum) + " name = \"" + + this->name + "\""); + ShowContinueError(state, "The load side connections are not on the Supply Side of a plant loop"); + errFlag = true; + } + + thisErrFlag = false; + if (this->waterSource) { + PlantUtilities::ScanPlantLoopsForObject(state, + this->name, + this->plantTypeOfNum, + this->sourceSideLocation.loopNum, + this->sourceSideLocation.loopSideNum, + this->sourceSideLocation.branchNum, + this->sourceSideLocation.compNum, + thisErrFlag, + _, + _, + _, + this->sourceSideNodes.inlet, + _); + + if (thisErrFlag) { + ShowSevereError(state, + routineName + ": Plant topology problem for " + DataPlant::ccSimPlantEquipTypes(this->plantTypeOfNum) + " name = \"" + + this->name + "\""); + ShowContinueError(state, "Could not locate component's source side connections on a plant loop"); + errFlag = true; + } else if (this->sourceSideLocation.loopSideNum != DataPlant::DemandSide) { // only check if !thisErrFlag + ShowSevereError(state, + routineName + ": Invalid connections for " + DataPlant::ccSimPlantEquipTypes(this->plantTypeOfNum) + " name = \"" + + this->name + "\""); + ShowContinueError(state, "The source side connections are not on the Demand Side of a plant loop"); + errFlag = true; + } + + // make sure it is not the same loop on both sides. + if (this->loadSideLocation.loopNum == this->sourceSideLocation.loopNum) { // user is being too tricky, don't allow + ShowSevereError(state, + routineName + ": Invalid connections for " + DataPlant::ccSimPlantEquipTypes(this->plantTypeOfNum) + " name = \"" + + this->name + "\""); + ShowContinueError(state, "The load and source sides need to be on different loops."); + errFlag = true; + } else { + + PlantUtilities::InterConnectTwoPlantLoopSides(state, + this->loadSideLocation.loopNum, + this->loadSideLocation.loopSideNum, + this->sourceSideLocation.loopNum, + this->sourceSideLocation.loopSideNum, + this->plantTypeOfNum, + true); + } + } else if (this->airSource) { + // nothing to do here ? + } + + if (errFlag) { + ShowFatalError(state, routineName + ": Program terminated due to previous condition(s)."); + } + this->oneTimeInitFlag = false; + } +} } // namespace EnergyPlus::EIRPlantLoopHeatPumps diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.hh b/src/EnergyPlus/PlantLoopHeatPumpEIR.hh index e2b74d4ffa2..3573b099329 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.hh +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.hh @@ -132,7 +132,7 @@ namespace EIRPlantLoopHeatPumps { int recurringConcurrentOperationWarningIndex = 0; // logic flags - bool oneTimeInit = true; + bool oneTimeInitFlag = true; bool envrnInit = true; // a couple worker functions to easily allow merging of cooling and heating operations @@ -188,6 +188,8 @@ namespace EIRPlantLoopHeatPumps { { return a - b; } + + void oneTimeInit(EnergyPlusData &state) override; }; } // namespace EIRPlantLoopHeatPumps diff --git a/src/EnergyPlus/PlantPipingSystemsManager.cc b/src/EnergyPlus/PlantPipingSystemsManager.cc index 0992cc2dd93..6a98d2e6a2e 100644 --- a/src/EnergyPlus/PlantPipingSystemsManager.cc +++ b/src/EnergyPlus/PlantPipingSystemsManager.cc @@ -2351,6 +2351,9 @@ namespace PlantPipingSystemsManager { this->CircuitInletCell = Point3DInteger(in.X_index, in.Y_index, in.Z_index); this->CircuitOutletCell = Point3DInteger(out.X_index, out.Y_index, out.Z_index); } + void Circuit::oneTimeInit([[maybe_unused]] EnergyPlusData &state) + { + } bool Domain::IsConverged_CurrentToPrevIteration() { diff --git a/src/EnergyPlus/PlantPipingSystemsManager.hh b/src/EnergyPlus/PlantPipingSystemsManager.hh index 0eeb25a28e1..d9a1084ab3c 100644 --- a/src/EnergyPlus/PlantPipingSystemsManager.hh +++ b/src/EnergyPlus/PlantPipingSystemsManager.hh @@ -706,6 +706,8 @@ namespace PlantPipingSystemsManager { } static Circuit *factory(EnergyPlusData &state, std::string circuit, bool &errorsFound); + + void oneTimeInit(EnergyPlusData &state) override; }; struct ZoneCoupledSurfaceData diff --git a/src/EnergyPlus/PlantUtilities.cc b/src/EnergyPlus/PlantUtilities.cc index 273a5d3c0b9..bafa8dffbbf 100644 --- a/src/EnergyPlus/PlantUtilities.cc +++ b/src/EnergyPlus/PlantUtilities.cc @@ -1768,10 +1768,10 @@ void ScanPlantLoopsForObject(EnergyPlusData &state, } void ScanPlantLoopsForNodeNum(EnergyPlusData &state, - std::string const &CallerName, // really used for error messages - int const NodeNum, // index in Node structure of node to be scanned - int &LoopNum, // return value for plant loop - int &LoopSideNum, // return value for plant loop side + std::string_view const &CallerName, // really used for error messages + int const NodeNum, // index in Node structure of node to be scanned + int &LoopNum, // return value for plant loop + int &LoopSideNum, // return value for plant loop side int &BranchNum, Optional_int CompNum) { @@ -1838,9 +1838,9 @@ void ScanPlantLoopsForNodeNum(EnergyPlusData &state, ShowSevereError(state, "ScanPlantLoopsForNodeNum: Plant Node was not found as inlet node (for component) on any plant loops"); ShowContinueError(state, "Node Name=\"" + state.dataLoopNodes->NodeID(NodeNum) + "\""); if (!state.dataGlobal->DoingSizing) { - ShowContinueError(state, "called by " + CallerName); + ShowContinueError(state, format("called by {}", CallerName)); } else { - ShowContinueError(state, "during sizing: called by " + CallerName); + ShowContinueError(state, format("during sizing: called by {}", CallerName)); } if (outFoundCount > 0) ShowContinueError(state, format("Node was found as outlet node (for component) {} time(s).", outFoundCount)); ShowContinueError(state, "Possible error in Branch inputs. For more information, look for other error messages related to this node name."); diff --git a/src/EnergyPlus/PlantUtilities.hh b/src/EnergyPlus/PlantUtilities.hh index b036dd28b93..d3174300d3b 100644 --- a/src/EnergyPlus/PlantUtilities.hh +++ b/src/EnergyPlus/PlantUtilities.hh @@ -201,10 +201,10 @@ namespace PlantUtilities { Optional_int_const SingleLoopSearch = _); void ScanPlantLoopsForNodeNum(EnergyPlusData &state, - std::string const &CallerName, // really used for error messages - int NodeNum, // index in Node structure of node to be scanned - int &LoopNum, // return value for plant loop - int &LoopSideNum, // return value for plant loop side + std::string_view const &CallerName, // really used for error messages + int NodeNum, // index in Node structure of node to be scanned + int &LoopNum, // return value for plant loop + int &LoopSideNum, // return value for plant loop side int &BranchNum, Optional_int CompNum = _); diff --git a/src/EnergyPlus/PlantValves.cc b/src/EnergyPlus/PlantValves.cc index bd10c7a7168..bca0962b656 100644 --- a/src/EnergyPlus/PlantValves.cc +++ b/src/EnergyPlus/PlantValves.cc @@ -502,6 +502,9 @@ namespace PlantValves { if (this->FlowDivFract < 0.0) this->FlowDivFract = 0.0; if (this->FlowDivFract > 1.0) this->FlowDivFract = 1.0; } + void TemperValveData::oneTimeInit([[maybe_unused]] EnergyPlusData &state) + { + } } // namespace PlantValves diff --git a/src/EnergyPlus/PlantValves.hh b/src/EnergyPlus/PlantValves.hh index af4939736fc..1443985993b 100644 --- a/src/EnergyPlus/PlantValves.hh +++ b/src/EnergyPlus/PlantValves.hh @@ -106,6 +106,8 @@ namespace PlantValves { void initialize(EnergyPlusData &state); void calculate(EnergyPlusData &state); + + void oneTimeInit(EnergyPlusData &state) override; }; void GetPlantValvesInput(EnergyPlusData &state); diff --git a/src/EnergyPlus/PondGroundHeatExchanger.cc b/src/EnergyPlus/PondGroundHeatExchanger.cc index 76df42247c9..37bb9178356 100644 --- a/src/EnergyPlus/PondGroundHeatExchanger.cc +++ b/src/EnergyPlus/PondGroundHeatExchanger.cc @@ -376,71 +376,10 @@ void PondGroundHeatExchangerData::InitPondGroundHeatExchanger(EnergyPlusData &st // Also set module variables to data structure for this pond. Set flow rate // from node data and hypothetical design flow. - Real64 const DesignVelocity(0.5); // Hypothetical design max pipe velocity [m/s] - Real64 const PondHeight(0.0); // for now - - static std::string const RoutineName("InitPondGroundHeatExchanger"); - // repeated warm up days tend to drive the initial pond temperature toward the drybulb temperature // For each environment start the pond midway between drybulb and ground temp. - if (this->setupOutputVarsFlag) { - this->setupOutputVars(state); - this->setupOutputVarsFlag = false; - } - - if (this->OneTimeFlag || state.dataGlobal->WarmupFlag) { - // initialize pond temps to mean of drybulb and ground temps. - this->BulkTemperature = this->PastBulkTemperature = - 0.5 * (DataEnvironment::OutDryBulbTempAt(state, PondHeight) + state.dataEnvrn->GroundTemp_Deep); - this->OneTimeFlag = false; - } - - // Init more variables - if (this->MyFlag) { - // Locate the hx on the plant loops for later usage - bool errFlag = false; - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - DataPlant::TypeOf_GrndHtExchgPond, - this->LoopNum, - this->LoopSideNum, - this->BranchNum, - this->CompNum, - errFlag, - _, - _, - _, - _, - _); - if (errFlag) { - ShowFatalError(state, "InitPondGroundHeatExchanger: Program terminated due to previous condition(s)."); - } - Real64 rho = FluidProperties::GetDensityGlycol(state, - state.dataPlnt->PlantLoop(this->LoopNum).FluidName, - DataPrecisionGlobals::constant_zero, - state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, - RoutineName); - Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - state.dataPlnt->PlantLoop(this->LoopNum).FluidName, - DataPrecisionGlobals::constant_zero, - state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, - RoutineName); - this->DesignMassFlowRate = DataGlobalConstants::Pi / 4.0 * pow_2(this->TubeInDiameter) * DesignVelocity * rho * this->NumCircuits; - this->DesignCapacity = this->DesignMassFlowRate * Cp * 10.0; // assume 10C delta T? - PlantUtilities::InitComponentNodes(state, - 0.0, - this->DesignMassFlowRate, - this->InletNodeNum, - this->OutletNodeNum, - this->LoopNum, - this->LoopSideNum, - this->BranchNum, - this->CompNum); - PlantUtilities::RegisterPlantCompDesignFlow(state, this->InletNodeNum, this->DesignMassFlowRate / rho); - - this->MyFlag = false; - } + this->oneTimeInit(state); if (FirstHVACIteration && !state.dataHVACGlobal->ShortenTimeStepSys && this->firstTimeThrough) { // update past temperature @@ -891,5 +830,70 @@ void PondGroundHeatExchangerData::UpdatePondGroundHeatExchanger(EnergyPlusData & // keep track of the bulk temperature this->BulkTemperature = this->PondTemp; } +void PondGroundHeatExchangerData::oneTimeInit(EnergyPlusData &state) +{ + Real64 const DesignVelocity(0.5); // Hypothetical design max pipe velocity [m/s] + Real64 const PondHeight(0.0); // for now + + static std::string const RoutineName("InitPondGroundHeatExchanger"); + + if (this->setupOutputVarsFlag) { + this->setupOutputVars(state); + this->setupOutputVarsFlag = false; + } + + if (this->OneTimeFlag || state.dataGlobal->WarmupFlag) { + // initialize pond temps to mean of drybulb and ground temps. + this->BulkTemperature = this->PastBulkTemperature = + 0.5 * (DataEnvironment::OutDryBulbTempAt(state, PondHeight) + state.dataEnvrn->GroundTemp_Deep); + this->OneTimeFlag = false; + } + + // Init more variables + if (this->MyFlag) { + // Locate the hx on the plant loops for later usage + bool errFlag = false; + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + DataPlant::TypeOf_GrndHtExchgPond, + this->LoopNum, + this->LoopSideNum, + this->BranchNum, + this->CompNum, + errFlag, + _, + _, + _, + _, + _); + if (errFlag) { + ShowFatalError(state, "InitPondGroundHeatExchanger: Program terminated due to previous condition(s)."); + } + Real64 rho = FluidProperties::GetDensityGlycol(state, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, + DataPrecisionGlobals::constant_zero, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, + RoutineName); + Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, + DataPrecisionGlobals::constant_zero, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, + RoutineName); + this->DesignMassFlowRate = DataGlobalConstants::Pi / 4.0 * pow_2(this->TubeInDiameter) * DesignVelocity * rho * this->NumCircuits; + this->DesignCapacity = this->DesignMassFlowRate * Cp * 10.0; // assume 10C delta T? + PlantUtilities::InitComponentNodes(state, + 0.0, + this->DesignMassFlowRate, + this->InletNodeNum, + this->OutletNodeNum, + this->LoopNum, + this->LoopSideNum, + this->BranchNum, + this->CompNum); + PlantUtilities::RegisterPlantCompDesignFlow(state, this->InletNodeNum, this->DesignMassFlowRate / rho); + + this->MyFlag = false; + } +} } // namespace EnergyPlus::PondGroundHeatExchanger diff --git a/src/EnergyPlus/PondGroundHeatExchanger.hh b/src/EnergyPlus/PondGroundHeatExchanger.hh index 337559a5fae..576bbb299ce 100644 --- a/src/EnergyPlus/PondGroundHeatExchanger.hh +++ b/src/EnergyPlus/PondGroundHeatExchanger.hh @@ -147,6 +147,8 @@ namespace PondGroundHeatExchanger { void UpdatePondGroundHeatExchanger(EnergyPlusData &state); void onInitLoopEquip([[maybe_unused]] EnergyPlusData &state, [[maybe_unused]] const PlantLocation &calledFromLocation) override; + + void oneTimeInit(EnergyPlusData &state) override; }; void GetPondGroundHeatExchanger(EnergyPlusData &state); diff --git a/src/EnergyPlus/Psychrometrics.hh b/src/EnergyPlus/Psychrometrics.hh index bd6831a5299..181a5fddc65 100644 --- a/src/EnergyPlus/Psychrometrics.hh +++ b/src/EnergyPlus/Psychrometrics.hh @@ -207,6 +207,33 @@ namespace Psychrometrics { return rhoair; } + constexpr Real64 PsyRhoAirFnPbTdbW(Real64 const pb, // barometric pressure (Pascals) + Real64 const tdb, // dry bulb temperature (Celsius) + Real64 const dw // humidity ratio (kgWater/kgDryAir) + ) + { + // FUNCTION INFORMATION: + // AUTHOR G. S. Wright + // DATE WRITTEN June 2, 1994 + // MODIFIED na + // RE-ENGINEERED na + + // PURPOSE OF THIS FUNCTION: + // This function provides density of air as a function of barometric + // pressure, dry bulb temperature, and humidity ratio. + + // METHODOLOGY EMPLOYED: + // ideal gas law + // universal gas const for air 287 J/(kg K) + // air/water molecular mass ratio 28.9645/18.01534 + + // REFERENCES: + // Wylan & Sontag, Fundamentals of Classical Thermodynamics. + // ASHRAE handbook 1985 Fundamentals, Ch. 6, eqn. (6),(26) + + return (pb / (287.0 * (tdb + DataGlobalConstants::KelvinConv) * (1.0 + 1.6077687 * std::max(dw, 1.0e-5)))); + } + inline Real64 PsyRhoAirFnPbTdbW_fast([[maybe_unused]] EnergyPlusData &state, Real64 const pb, // barometric pressure (Pascals) Real64 const tdb, // dry bulb temperature (Celsius) diff --git a/src/EnergyPlus/RefrigeratedCase.cc b/src/EnergyPlus/RefrigeratedCase.cc index a8d584848cb..67e0ec44d88 100644 --- a/src/EnergyPlus/RefrigeratedCase.cc +++ b/src/EnergyPlus/RefrigeratedCase.cc @@ -11038,6 +11038,9 @@ void RefrigCondenserData::UpdateCondenser(EnergyPlusData &state) // Set outlet node variables that are possibly changed state.dataLoopNodes->Node(this->OutletNode).Temp = this->OutletTemp; } +void RefrigCondenserData::oneTimeInit([[maybe_unused]] EnergyPlusData &state) +{ +} void RefrigRackData::UpdateCondenser(EnergyPlusData &state) { @@ -11057,6 +11060,9 @@ void RefrigRackData::UpdateCondenser(EnergyPlusData &state) // Set outlet node variables that are possibly changed state.dataLoopNodes->Node(this->OutletNode).Temp = this->OutletTemp; } +void RefrigRackData::oneTimeInit([[maybe_unused]] EnergyPlusData &state) +{ +} void SimulateDetailedRefrigerationSystems(EnergyPlusData &state) { diff --git a/src/EnergyPlus/RefrigeratedCase.hh b/src/EnergyPlus/RefrigeratedCase.hh index b66da477367..ffb11467f02 100644 --- a/src/EnergyPlus/RefrigeratedCase.hh +++ b/src/EnergyPlus/RefrigeratedCase.hh @@ -570,6 +570,8 @@ namespace RefrigeratedCase { bool FirstHVACIteration, Real64 &CurLoad, bool RunFlag) override; + + void oneTimeInit(EnergyPlusData &state) override; }; struct RefrigSystemData @@ -1070,6 +1072,8 @@ namespace RefrigeratedCase { bool FirstHVACIteration, Real64 &CurLoad, bool RunFlag) override; + + void oneTimeInit(EnergyPlusData &state) override; }; struct RefrigGasCoolerData diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index ced3e325824..01b3d747e0a 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -1062,26 +1062,25 @@ namespace RoomAirModelAirflowNetwork { // Add to the surface convection sums if (state.dataSurface->SurfWinFrameArea(SurfNum) > 0.0) { // Window frame contribution - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * - (1.0 + state.dataSurface->SurfWinProjCorrFrIn(SurfNum)) * state.dataSurface->SurfWinFrameTempSurfIn(SurfNum); - HA += state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * + (1.0 + state.dataSurface->SurfWinProjCorrFrIn(SurfNum)) * state.dataSurface->SurfWinFrameTempIn(SurfNum); + HA += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * (1.0 + state.dataSurface->SurfWinProjCorrFrIn(SurfNum)); } if (state.dataSurface->SurfWinDividerArea(SurfNum) > 0.0 && !ANY_INTERIOR_SHADE_BLIND(state.dataSurface->SurfWinShadingFlag(SurfNum))) { // Window divider contribution(only from shade or blind for window with divider and interior shade or blind) - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * - (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum)) * - state.dataSurface->SurfWinDividerTempSurfIn(SurfNum); - HA += state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * + (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum)) * state.dataSurface->SurfWinDividerTempIn(SurfNum); + HA += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum)); } } // End of check if window - HA = HA + state.dataHeatBal->HConvIn(SurfNum) * Area; - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * Area * state.dataHeatBalSurf->TempSurfInTmp(SurfNum); + HA = HA + state.dataHeatBalSurf->SurfHConvInt(SurfNum) * Area; + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * Area * state.dataHeatBalSurf->SurfTempInTmp(SurfNum); if (state.dataSurface->SurfTAirRef(SurfNum) == ZoneMeanAirTemp) { // The zone air is the reference temperature(which is to be solved for in CorrectZoneAirTemp). @@ -1196,8 +1195,8 @@ namespace RoomAirModelAirflowNetwork { state, state.dataHeatBalFanSys->MAT(state.dataSurface->Surface(SurfNum).Zone), RhoVaporAirIn(SurfNum), "RhoAirZone")); Wsurf = PsyWFnTdbRhPb(state, - state.dataHeatBalSurf->TempSurfInTmp(SurfNum), - PsyRhFnTdbRhov(state, state.dataHeatBalSurf->TempSurfInTmp(SurfNum), RhoVaporSurfIn(SurfNum), "Wsurf"), + state.dataHeatBalSurf->SurfTempInTmp(SurfNum), + PsyRhFnTdbRhov(state, state.dataHeatBalSurf->SurfTempInTmp(SurfNum), RhoVaporSurfIn(SurfNum), "Wsurf"), state.dataEnvrn->OutBaroPress); SumHmARa = SumHmARa + HMassConvInFD(SurfNum) * state.dataSurface->Surface(SurfNum).Area * RhoAirZone; @@ -1217,10 +1216,10 @@ namespace RoomAirModelAirflowNetwork { PsyRhoAirFnPbTdbW( state, state.dataEnvrn->OutBaroPress, - state.dataHeatBalSurf->TempSurfInTmp(SurfNum), + state.dataHeatBalSurf->SurfTempInTmp(SurfNum), PsyWFnTdbRhPb(state, - state.dataHeatBalSurf->TempSurfInTmp(SurfNum), - PsyRhFnTdbRhovLBnd0C(state, state.dataHeatBalSurf->TempSurfInTmp(SurfNum), RhoVaporAirIn(SurfNum)), + state.dataHeatBalSurf->SurfTempInTmp(SurfNum), + PsyRhFnTdbRhovLBnd0C(state, state.dataHeatBalSurf->SurfTempInTmp(SurfNum), RhoVaporAirIn(SurfNum)), state.dataEnvrn->OutBaroPress)); SumHmARaW = SumHmARaW + HMassConvInFD(SurfNum) * state.dataSurface->Surface(SurfNum).Area * RhoVaporSurfIn(SurfNum); } diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index 54686dd2d20..1310fe292dd 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -1147,14 +1147,14 @@ namespace RoomAirModelManager { state.dataRoomAirModelMgr->TypeNum = state.dataAirflowNetwork->AirflowNetworkCompData(state.dataRoomAirModelMgr->CompNum).TypeNum; if (state.dataAirflowNetwork->AirflowNetworkCompData(state.dataRoomAirModelMgr->CompNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::SCR) { - if (state.dataAirflowNetwork->MultizoneSurfaceCrackData(state.dataRoomAirModelMgr->TypeNum).FlowExpo != 0.50) { + if (state.dataAirflowNetwork->MultizoneSurfaceCrackData(state.dataRoomAirModelMgr->TypeNum).exponent != 0.50) { state.dataRoomAirMod->AirModel(ThisZone).AirModelType = DataRoomAirModel::RoomAirModel::Mixing; ShowWarningError(state, "Problem with " + cCurrentModuleObject + " = " + state.dataIPShortCut->cAlphaArgs(1)); ShowWarningError(state, "Roomair model will not be applied for Zone=" + state.dataIPShortCut->cAlphaArgs(1) + '.'); ShowContinueError( state, format("AirflowNetwrok:Multizone:Surface crack object must have an air flow coefficient = 0.5, value was={:.2R}", - state.dataAirflowNetwork->MultizoneSurfaceCrackData(state.dataRoomAirModelMgr->TypeNum).FlowExpo)); + state.dataAirflowNetwork->MultizoneSurfaceCrackData(state.dataRoomAirModelMgr->TypeNum).exponent)); } } } @@ -2226,7 +2226,7 @@ namespace RoomAirModelManager { ->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(state.dataRoomAirModelMgr->Loop2).SurfNum) .Width / 2; - AinCV = state.dataAirflowNetwork->MultizoneSurfaceCrackData(state.dataRoomAirModelMgr->TypeNumber).FlowCoef / + AinCV = state.dataAirflowNetwork->MultizoneSurfaceCrackData(state.dataRoomAirModelMgr->TypeNumber).coefficient / (BaseDischargeCoef * std::sqrt(2.0 / PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, diff --git a/src/EnergyPlus/SolarCollectors.cc b/src/EnergyPlus/SolarCollectors.cc index 130afcdd440..6170e26f851 100644 --- a/src/EnergyPlus/SolarCollectors.cc +++ b/src/EnergyPlus/SolarCollectors.cc @@ -867,34 +867,7 @@ namespace SolarCollectors { static std::string const RoutineName("InitSolarCollector"); Real64 const BigNumber(9999.9); // Component desired mass flow rate - // Do the one time initializations - if (this->MyOneTimeFlag) { - this->setupOutputVars(state); - this->MyOneTimeFlag = false; - } - - if (this->SetLoopIndexFlag) { - if (allocated(state.dataPlnt->PlantLoop)) { - bool errFlag = false; - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - this->TypeNum, - this->WLoopNum, - this->WLoopSideNum, - this->WLoopBranchNum, - this->WLoopCompNum, - errFlag, - _, - _, - _, - _, - _); - if (errFlag) { - ShowFatalError(state, "InitSolarCollector: Program terminated due to previous condition(s)."); - } - this->SetLoopIndexFlag = false; - } - } + this->oneTimeInit(state); // Do the one time initializations if (!state.dataGlobal->SysSizingCalc && this->InitSizing) { PlantUtilities::RegisterPlantCompDesignFlow(state, this->InletNode, this->VolFlowRateMax); @@ -2164,6 +2137,37 @@ namespace SolarCollectors { VentCavIndex = CavNum; } } + void CollectorData::oneTimeInit(EnergyPlusData &state) + { + + if (this->MyOneTimeFlag) { + this->setupOutputVars(state); + this->MyOneTimeFlag = false; + } + + if (this->SetLoopIndexFlag) { + if (allocated(state.dataPlnt->PlantLoop)) { + bool errFlag = false; + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + this->TypeNum, + this->WLoopNum, + this->WLoopSideNum, + this->WLoopBranchNum, + this->WLoopCompNum, + errFlag, + _, + _, + _, + _, + _); + if (errFlag) { + ShowFatalError(state, "InitSolarCollector: Program terminated due to previous condition(s)."); + } + this->SetLoopIndexFlag = false; + } + } + } } // namespace SolarCollectors diff --git a/src/EnergyPlus/SolarCollectors.hh b/src/EnergyPlus/SolarCollectors.hh index 7059688dc4f..632c26e37b7 100644 --- a/src/EnergyPlus/SolarCollectors.hh +++ b/src/EnergyPlus/SolarCollectors.hh @@ -288,6 +288,8 @@ namespace SolarCollectors { void update(EnergyPlusData &state); void report(EnergyPlusData &state); + + void oneTimeInit(EnergyPlusData &state) override; }; void GetSolarCollectorInput(EnergyPlusData &state); diff --git a/src/EnergyPlus/SolarReflectionManager.cc b/src/EnergyPlus/SolarReflectionManager.cc index 209a94d4b0d..22fc17b3e30 100644 --- a/src/EnergyPlus/SolarReflectionManager.cc +++ b/src/EnergyPlus/SolarReflectionManager.cc @@ -65,6 +65,7 @@ #include #include #include +#include namespace EnergyPlus { @@ -617,7 +618,7 @@ namespace SolarReflectionManager { ReflBmToDiffSolGnd = 0.0; // Unit vector to sun - state.dataSolarReflectionManager->SunVec = state.dataSurface->SurfSunCosHourly(iHour, {1, 3}); + state.dataSolarReflectionManager->SunVec = state.dataSurface->SurfSunCosHourly(iHour); // loop through each surface that can receive beam solar reflected as diffuse solar from other surfaces for (state.dataSolarReflectionManager->RecSurfNum = 1; @@ -666,7 +667,7 @@ namespace SolarReflectionManager { // Skip rays that hit non-sunlit surface. Assume first time step of the hour. state.dataSolarReflectionManager->SunLitFract = - state.dataHeatBal->SunlitFrac(1, iHour, state.dataSolarReflectionManager->HitPtSurfNum); + state.dataHeatBal->SurfSunlitFrac(iHour, 1, state.dataSolarReflectionManager->HitPtSurfNum); // If hit point's surface is not sunlit go to next ray // TH 3/25/2010. why limit to HeatTransSurf? shading surfaces should also apply @@ -912,10 +913,10 @@ namespace SolarReflectionManager { ReflBmToDiffSolObs = 0.0; ReflFacTimesCosIncSum = 0.0; - if (state.dataSurface->SurfSunCosHourly(iHour, 3) < DataEnvironment::SunIsUpValue) return; // Skip if sun is below horizon + if (state.dataSurface->SurfSunCosHourly(iHour)(3) < DataEnvironment::SunIsUpValue) return; // Skip if sun is below horizon // Unit vector to sun - state.dataSolarReflectionManager->SunVect = state.dataSurface->SurfSunCosHourly(iHour, {1, 3}); + state.dataSolarReflectionManager->SunVect = state.dataSurface->SurfSunCosHourly(iHour); for (int RecSurfNum = 1; RecSurfNum <= state.dataSolarReflectionManager->TotSolReflRecSurf; ++RecSurfNum) { int const SurfNum = @@ -933,7 +934,7 @@ namespace SolarReflectionManager { (state.dataSurface->SurfShadowGlazingFrac(ReflSurfNum) > 0.0 && state.dataSurface->Surface(ReflSurfNum).IsShadowing)) { // Skip if window and not sunlit if (state.dataSurface->Surface(ReflSurfNum).Class == SurfaceClass::Window && - state.dataHeatBal->SunlitFrac(1, iHour, ReflSurfNum) < 0.01) + state.dataHeatBal->SurfSunlitFrac(iHour, 1, ReflSurfNum) < 0.01) continue; // Check if sun is in front of this reflecting surface. state.dataSolarReflectionManager->ReflNorm = state.dataSurface->Surface(ReflSurfNum).OutNormVec; @@ -1187,13 +1188,13 @@ namespace SolarReflectionManager { state.dataHeatBal->SolarDistribution == MinimalShadowing) { state.dataSolarReflectionManager->SkyReflSolRadiance = state.dataSurface->Surface(state.dataSolarReflectionManager->HitPtSurfNumX).ViewFactorSky * - state.dataHeatBal->DifShdgRatioIsoSky(state.dataSolarReflectionManager->HitPtSurfNumX) * + state.dataSolarShading->SurfDifShdgRatioIsoSky(state.dataSolarReflectionManager->HitPtSurfNumX) * state.dataSolarReflectionManager->SolReflRecSurf(state.dataSolarReflectionManager->iRecSurfNum) .HitPtSolRefl(state.dataSolarReflectionManager->iRayNum, state.dataSolarReflectionManager->iRecPtNum); } else { state.dataSolarReflectionManager->SkyReflSolRadiance = state.dataSurface->Surface(state.dataSolarReflectionManager->HitPtSurfNumX).ViewFactorSky * - state.dataHeatBal->DifShdgRatioIsoSkyHRTS(1, 1, state.dataSolarReflectionManager->HitPtSurfNumX) * + state.dataSolarShading->SurfDifShdgRatioIsoSkyHRTS(1, 1, state.dataSolarReflectionManager->HitPtSurfNumX) * state.dataSolarReflectionManager->SolReflRecSurf(state.dataSolarReflectionManager->iRecSurfNum) .HitPtSolRefl(state.dataSolarReflectionManager->iRayNum, state.dataSolarReflectionManager->iRecPtNum); } diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index 7588121ab09..30e4642d99b 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -207,80 +207,74 @@ void InitSolarCalculations(EnergyPlusData &state) } if (state.dataGlobal->BeginEnvrnFlag) { - state.dataSolarShading->CTHETA = 0.0; - state.dataSolarShading->SAREA = 0.0; + state.dataSolarShading->SurfSunCosTheta = 0.0; + state.dataSolarShading->SurfSunlitArea = 0.0; state.dataSurface->SurfSunlitArea = 0.0; state.dataSurface->SurfSunlitFrac = 0.0; - state.dataHeatBal->SunlitFracHR = 0.0; - state.dataHeatBal->SunlitFrac = 0.0; - state.dataHeatBal->SunlitFracWithoutReveal = 0.0; - state.dataHeatBal->BackSurfaces = 0; - state.dataHeatBal->OverlapAreas = 0.0; - state.dataHeatBal->CosIncAngHR = 0.0; - state.dataHeatBal->CosIncAng = 0.0; - state.dataHeatBal->SurfAnisoSkyMult = 1.0; // For isotropic sky; recalculated in AnisoSkyViewFactors if anisotropic radiance + state.dataHeatBal->SurfSunlitFracHR = 0.0; + state.dataHeatBal->SurfSunlitFrac = 0.0; + state.dataHeatBal->SurfSunlitFracWithoutReveal = 0.0; + state.dataHeatBal->SurfWinBackSurfaces = 0; + state.dataHeatBal->SurfWinOverlapAreas = 0.0; + state.dataHeatBal->SurfCosIncAngHR = 0.0; + state.dataHeatBal->SurfCosIncAng = 0.0; + state.dataSolarShading->SurfAnisoSkyMult = 1.0; // For isotropic sky; recalculated in AnisoSkyViewFactors if anisotropic radiance // WithShdgIsoSky=0.0 // WoShdgIsoSky=0.0 // WithShdgHoriz=0.0 // WoShdgHoriz=0.0 // DifShdgRatioIsoSky=0.0 // DifShdgRatioHoriz=0.0 - state.dataHeatBal->MultIsoSky = 0.0; - state.dataHeatBal->MultCircumSolar = 0.0; - state.dataHeatBal->MultHorizonZenith = 0.0; - - state.dataSurface->InsideGlassCondensationFlag = 0; - state.dataSurface->InsideFrameCondensationFlag = 0; - state.dataSurface->InsideDividerCondensationFlag = 0; - state.dataHeatBal->ZoneTransSolar = 0.0; - state.dataHeatBal->ZoneBmSolFrExtWinsRep = 0.0; - state.dataHeatBal->ZoneBmSolFrIntWinsRep = 0.0; - state.dataHeatBal->ZoneInitialDifSolReflW = 0.0; - state.dataHeatBal->ZoneDifSolFrExtWinsRep = 0.0; - state.dataHeatBal->ZoneDifSolFrIntWinsRep = 0.0; - state.dataHeatBal->ZoneWinHeatGain = 0.0; - state.dataHeatBal->ZoneWinHeatGainRep = 0.0; - state.dataHeatBal->ZoneWinHeatLossRep = 0.0; - state.dataHeatBal->ZoneOpaqSurfInsFaceCond = 0.0; - state.dataHeatBal->ZoneOpaqSurfInsFaceCondGainRep = 0.0; - state.dataHeatBal->ZoneOpaqSurfInsFaceCondLossRep = 0.0; - - state.dataHeatBal->SurfQRadSWOutIncident = 0.0; - state.dataHeatBal->SurfQRadSWOutIncidentBeam = 0.0; - state.dataHeatBal->SurfBmIncInsSurfIntensRep = 0.0; - state.dataHeatBal->SurfBmIncInsSurfAmountRep = 0.0; - state.dataHeatBal->SurfIntBmIncInsSurfIntensRep = 0.0; - state.dataHeatBal->SurfIntBmIncInsSurfAmountRep = 0.0; - state.dataHeatBal->SurfQRadSWOutIncidentSkyDiffuse = 0.0; - state.dataHeatBal->SurfQRadSWOutIncidentGndDiffuse = 0.0; - state.dataHeatBal->SurfQRadSWOutIncBmToDiffReflGnd = 0.0; - state.dataHeatBal->SurfQRadSWOutIncSkyDiffReflGnd = 0.0; - state.dataHeatBal->SurfQRadSWOutIncBmToBmReflObs = 0.0; - state.dataHeatBal->SurfQRadSWOutIncBmToDiffReflObs = 0.0; - state.dataHeatBal->SurfQRadSWOutIncSkyDiffReflObs = 0.0; - state.dataHeatBal->SurfCosIncidenceAngle = 0.0; - state.dataHeatBal->SurfSWInAbsTotalReport = 0.0; - state.dataHeatBal->SurfBmIncInsSurfAmountRepEnergy = 0.0; - state.dataHeatBal->SurfIntBmIncInsSurfAmountRepEnergy = 0.0; - - state.dataHeatBal->SurfWinQRadSWwinAbsTot = 0.0; - state.dataHeatBal->SurfWinQRadSWwinAbsTotEnergy = 0.0; - state.dataHeatBal->SurfWinSWwinAbsTotalReport = 0.0; - state.dataHeatBal->SurfInitialDifSolInAbsReport = 0.0; - state.dataHeatBal->SurfWinInitialDifSolInTransReport = 0.0; - - state.dataSolarShading->WindowRevealStatus = 0; - state.dataHeatBal->ZoneTransSolarEnergy = 0.0; - state.dataHeatBal->ZoneBmSolFrExtWinsRepEnergy = 0.0; - state.dataHeatBal->ZoneBmSolFrIntWinsRepEnergy = 0.0; - state.dataHeatBal->ZoneDifSolFrExtWinsRepEnergy = 0.0; - state.dataHeatBal->ZoneDifSolFrIntWinsRepEnergy = 0.0; - state.dataHeatBal->ZoneWinHeatGainRepEnergy = 0.0; - state.dataHeatBal->ZoneWinHeatLossRepEnergy = 0.0; - state.dataHeatBal->ZnOpqSurfInsFaceCondGnRepEnrg = 0.0; - state.dataHeatBal->ZnOpqSurfInsFaceCondLsRepEnrg = 0.0; - - // Surface Win + state.dataSolarShading->SurfMultIsoSky = 0.0; + state.dataSolarShading->SurfMultCircumSolar = 0.0; + state.dataSolarShading->SurfMultHorizonZenith = 0.0; + state.dataSolarShading->SurfWinRevealStatus = 0; + + for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { + state.dataHeatBal->ZoneTransSolar(zoneNum) = 0.0; + state.dataHeatBal->ZoneBmSolFrExtWinsRep(zoneNum) = 0.0; + state.dataHeatBal->ZoneBmSolFrIntWinsRep(zoneNum) = 0.0; + state.dataHeatBal->ZoneInitialDifSolReflW(zoneNum) = 0.0; + state.dataHeatBal->ZoneDifSolFrExtWinsRep(zoneNum) = 0.0; + state.dataHeatBal->ZoneDifSolFrIntWinsRep(zoneNum) = 0.0; + state.dataHeatBal->ZoneWinHeatGain(zoneNum) = 0.0; + state.dataHeatBal->ZoneWinHeatGainRep(zoneNum) = 0.0; + state.dataHeatBal->ZoneWinHeatLossRep(zoneNum) = 0.0; + state.dataHeatBal->ZoneOpaqSurfInsFaceCond(zoneNum) = 0.0; + state.dataHeatBal->ZoneOpaqSurfInsFaceCondGainRep(zoneNum) = 0.0; + state.dataHeatBal->ZoneOpaqSurfInsFaceCondLossRep(zoneNum) = 0.0; + } + for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { + state.dataHeatBal->ZoneTransSolarEnergy(zoneNum) = 0.0; + state.dataHeatBal->ZoneBmSolFrExtWinsRepEnergy(zoneNum) = 0.0; + state.dataHeatBal->ZoneBmSolFrIntWinsRepEnergy(zoneNum) = 0.0; + state.dataHeatBal->ZoneDifSolFrExtWinsRepEnergy(zoneNum) = 0.0; + state.dataHeatBal->ZoneDifSolFrIntWinsRepEnergy(zoneNum) = 0.0; + state.dataHeatBal->ZoneWinHeatGainRepEnergy(zoneNum) = 0.0; + state.dataHeatBal->ZoneWinHeatLossRepEnergy(zoneNum) = 0.0; + state.dataHeatBal->ZnOpqSurfInsFaceCondGnRepEnrg(zoneNum) = 0.0; + state.dataHeatBal->ZnOpqSurfInsFaceCondLsRepEnrg(zoneNum) = 0.0; + } + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { + state.dataHeatBal->SurfQRadSWOutIncident(SurfNum) = 0.0; + state.dataHeatBal->SurfQRadSWOutIncidentBeam(SurfNum) = 0.0; + state.dataHeatBal->SurfBmIncInsSurfIntensRep(SurfNum) = 0.0; + state.dataHeatBal->SurfBmIncInsSurfAmountRep(SurfNum) = 0.0; + state.dataHeatBal->SurfIntBmIncInsSurfIntensRep(SurfNum) = 0.0; + state.dataHeatBal->SurfIntBmIncInsSurfAmountRep(SurfNum) = 0.0; + state.dataHeatBal->SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = 0.0; + state.dataHeatBal->SurfQRadSWOutIncidentGndDiffuse(SurfNum) = 0.0; + state.dataHeatBal->SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = 0.0; + state.dataHeatBal->SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = 0.0; + state.dataHeatBal->SurfQRadSWOutIncBmToBmReflObs(SurfNum) = 0.0; + state.dataHeatBal->SurfQRadSWOutIncBmToDiffReflObs(SurfNum) = 0.0; + state.dataHeatBal->SurfQRadSWOutIncSkyDiffReflObs(SurfNum) = 0.0; + state.dataHeatBal->SurfCosIncidenceAngle(SurfNum) = 0.0; + state.dataHeatBal->SurfSWInAbsTotalReport(SurfNum) = 0.0; + state.dataHeatBal->SurfBmIncInsSurfAmountRepEnergy(SurfNum) = 0.0; + state.dataHeatBal->SurfIntBmIncInsSurfAmountRepEnergy(SurfNum) = 0.0; + state.dataHeatBal->SurfInitialDifSolInAbsReport(SurfNum) = 0.0; + } for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { int const firstSurfWin = state.dataHeatBal->Zone(zoneNum).WindowSurfaceFirst; int const lastSurfWin = state.dataHeatBal->Zone(zoneNum).WindowSurfaceLast; @@ -301,7 +295,8 @@ void InitSolarCalculations(EnergyPlusData &state) state.dataSurface->SurfWinHeatTransfer(SurfNum) = 0.0; state.dataSurface->SurfWinHeatGainRep(SurfNum) = 0.0; state.dataSurface->SurfWinHeatLossRep(SurfNum) = 0.0; - + } + for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) { state.dataSurface->SurfWinGainConvGlazToZoneRep(SurfNum) = 0.0; state.dataSurface->SurfWinGainIRGlazToZoneRep(SurfNum) = 0.0; state.dataSurface->SurfWinLossSWZoneToOutWinRep(SurfNum) = 0.0; @@ -315,13 +310,23 @@ void InitSolarCalculations(EnergyPlusData &state) state.dataSurface->SurfWinSysSolTransmittance(SurfNum) = 0.0; state.dataSurface->SurfWinSysSolReflectance(SurfNum) = 0.0; state.dataSurface->SurfWinSysSolAbsorptance(SurfNum) = 0.0; - + } + for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) { state.dataSurface->SurfWinDifSolarEnergy(SurfNum) = 0.0; state.dataSurface->SurfWinHeatGainRepEnergy(SurfNum) = 0.0; state.dataSurface->SurfWinHeatLossRepEnergy(SurfNum) = 0.0; state.dataSurface->SurfWinGapConvHtFlowRepEnergy(SurfNum) = 0.0; state.dataSurface->SurfWinHeatTransferRepEnergy(SurfNum) = 0.0; state.dataSurface->SurfWinShadingAbsorbedSolarEnergy(SurfNum) = 0.0; + + state.dataHeatBal->SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; + state.dataHeatBal->SurfWinQRadSWwinAbsTotEnergy(SurfNum) = 0.0; + state.dataHeatBal->SurfWinSWwinAbsTotalReport(SurfNum) = 0.0; + state.dataHeatBal->SurfWinInitialDifSolInTransReport(SurfNum) = 0.0; + + state.dataSurface->SurfWinInsideGlassCondensationFlag(SurfNum) = 0; + state.dataSurface->SurfWinInsideFrameCondensationFlag(SurfNum) = 0; + state.dataSurface->SurfWinInsideDividerCondensationFlag(SurfNum) = 0; } } } @@ -746,44 +751,23 @@ void AllocateModuleArrays(EnergyPlusData &state) int SurfLoop; int I; int NumOfLayers; + int constexpr HoursInDay(24); - state.dataSurface->SurfSunCosHourly.dimension(24, 3, 0.0); - state.dataSurface->SurfSunlitArea.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->SurfSunlitFrac.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->SurfSkySolarInc.dimension(state.dataSurface->TotSurfaces, 0); - state.dataSurface->SurfGndSolarInc.dimension(state.dataSurface->TotSurfaces, 0); - state.dataSurface->SurfBmToBmReflFacObs.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->SurfBmToDiffReflFacObs.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->SurfBmToDiffReflFacGnd.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->SurfSkyDiffReflFacGnd.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->SurfOpaqAI.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->SurfOpaqAO.dimension(state.dataSurface->TotSurfaces, 0.0); - - // TODO - check allocation here - state.dataSolarShading->CTHETA.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSolarShading->SAREA.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSolarShading->SurfSunCosTheta.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSolarShading->SurfSunlitArea.dimension(state.dataSurface->TotSurfaces, 0.0); if (!state.dataWindowManager->inExtWindowModel->isExternalLibraryModel() || !state.dataWindowManager->winOpticalModel->isSimplifiedModel()) { - state.dataSolarShading->IntBeamAbsByShadFac.allocate(state.dataSurface->TotSurfaces); - state.dataSolarShading->ExtBeamAbsByShadFac.allocate(state.dataSurface->TotSurfaces); - state.dataSolarShading->WinTransBmSolar.allocate(state.dataSurface->TotSurfaces); - state.dataSolarShading->WinTransDifSolar.allocate(state.dataSurface->TotSurfaces); - state.dataSolarShading->WinTransDifSolarGnd.allocate(state.dataSurface->TotSurfaces); - state.dataSolarShading->WinTransDifSolarSky.allocate(state.dataSurface->TotSurfaces); - state.dataSolarShading->WinTransBmBmSolar.allocate(state.dataSurface->TotSurfaces); - state.dataSolarShading->WinTransBmDifSolar.allocate(state.dataSurface->TotSurfaces); - } - - state.dataHeatBal->SunlitFracHR.dimension(24, state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBal->SunlitFrac.dimension(state.dataGlobal->NumOfTimeStepInHour, 24, state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBal->SunlitFracWithoutReveal.dimension(state.dataGlobal->NumOfTimeStepInHour, 24, state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBal->BackSurfaces.dimension( - state.dataGlobal->NumOfTimeStepInHour, 24, state.dataBSDFWindow->MaxBkSurf, state.dataSurface->TotSurfaces, 0); - state.dataHeatBal->OverlapAreas.dimension( - state.dataGlobal->NumOfTimeStepInHour, 24, state.dataBSDFWindow->MaxBkSurf, state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBal->CosIncAngHR.dimension(24, state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBal->CosIncAng.dimension(state.dataGlobal->NumOfTimeStepInHour, 24, state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBal->SurfAnisoSkyMult.dimension(state.dataSurface->TotSurfaces, - 1.0); // For isotropic sky: recalculated in AnisoSkyViewFactors if anisotropic radiance + state.dataSolarShading->SurfWinIntBeamAbsByShadFac.allocate(state.dataSurface->TotSurfaces); + state.dataSolarShading->SurfWinExtBeamAbsByShadFac.allocate(state.dataSurface->TotSurfaces); + state.dataSolarShading->SurfWinTransBmSolar.allocate(state.dataSurface->TotSurfaces); + state.dataSolarShading->SurfWinTransDifSolar.allocate(state.dataSurface->TotSurfaces); + state.dataSolarShading->SurfWinTransDifSolarGnd.allocate(state.dataSurface->TotSurfaces); + state.dataSolarShading->SurfWinTransDifSolarSky.allocate(state.dataSurface->TotSurfaces); + state.dataSolarShading->SurfWinTransBmBmSolar.allocate(state.dataSurface->TotSurfaces); + state.dataSolarShading->SurfWinTransBmDifSolar.allocate(state.dataSurface->TotSurfaces); + } + state.dataSolarShading->SurfAnisoSkyMult.dimension(state.dataSurface->TotSurfaces, 1.0); + state.dataSolarShading->SurfIntAbsFac.dimension(state.dataSurface->TotSurfaces, 0.0); + // For isotropic sky: recalculated in AnisoSkyViewFactors if anisotropic radiance // ALLOCATE(WithShdgIsoSky(TotSurfaces)) // WithShdgIsoSky=0.0 // ALLOCATE(WoShdgIsoSky(TotSurfaces)) @@ -796,14 +780,47 @@ void AllocateModuleArrays(EnergyPlusData &state) // DifShdgRatioIsoSky=0.0 // ALLOCATE(DifShdgRatioHoriz(TotSurfaces)) // DifShdgRatioHoriz=0.0 - state.dataHeatBal->MultIsoSky.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBal->MultCircumSolar.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBal->MultHorizonZenith.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSolarShading->SurfMultIsoSky.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSolarShading->SurfMultCircumSolar.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSolarShading->SurfMultHorizonZenith.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSolarShading->SurfWinRevealStatus.dimension(24, state.dataGlobal->NumOfTimeStepInHour, state.dataSurface->TotSurfaces, 0); + + // Weiler-Atherton + state.dataSolarShading->MAXHCArrayBounds = 2 * (state.dataSurface->MaxVerticesPerSurface + 1); + state.dataSolarShading->MAXHCArrayIncrement = state.dataSurface->MaxVerticesPerSurface + 1; + state.dataSolarShading->XTEMP.dimension(2 * (state.dataSurface->MaxVerticesPerSurface + 1), 0.0); + state.dataSolarShading->YTEMP.dimension(2 * (state.dataSurface->MaxVerticesPerSurface + 1), 0.0); + state.dataSolarShading->XVC.dimension(state.dataSurface->MaxVerticesPerSurface + 1, 0.0); + state.dataSolarShading->XVS.dimension(state.dataSurface->MaxVerticesPerSurface + 1, 0.0); + state.dataSolarShading->YVC.dimension(state.dataSurface->MaxVerticesPerSurface + 1, 0.0); + state.dataSolarShading->YVS.dimension(state.dataSurface->MaxVerticesPerSurface + 1, 0.0); + state.dataSolarShading->ZVC.dimension(state.dataSurface->MaxVerticesPerSurface + 1, 0.0); + + // Sutherland-Hodgman + state.dataSolarShading->ATEMP.dimension(2 * (state.dataSurface->MaxVerticesPerSurface + 1), 0.0); + state.dataSolarShading->BTEMP.dimension(2 * (state.dataSurface->MaxVerticesPerSurface + 1), 0.0); + state.dataSolarShading->CTEMP.dimension(2 * (state.dataSurface->MaxVerticesPerSurface + 1), 0.0); + state.dataSolarShading->XTEMP1.dimension(2 * (state.dataSurface->MaxVerticesPerSurface + 1), 0.0); + state.dataSolarShading->YTEMP1.dimension(2 * (state.dataSurface->MaxVerticesPerSurface + 1), 0.0); + + state.dataSurface->SurfSunCosHourly.allocate(HoursInDay); + for (int hour = 1; hour <= HoursInDay; hour++) { + state.dataSurface->SurfSunCosHourly(hour) = 0.0; + } + state.dataSurface->SurfSunlitArea.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSurface->SurfSunlitFrac.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSurface->SurfSkySolarInc.dimension(state.dataSurface->TotSurfaces, 0); + state.dataSurface->SurfGndSolarInc.dimension(state.dataSurface->TotSurfaces, 0); + state.dataSurface->SurfBmToBmReflFacObs.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSurface->SurfBmToDiffReflFacObs.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSurface->SurfBmToDiffReflFacGnd.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSurface->SurfSkyDiffReflFacGnd.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSurface->SurfOpaqAI.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSurface->SurfOpaqAO.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataSurface->SurfWinTransSolar.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataSurface->SurfWinBmSolar.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataSurface->SurfWinBmBmSolar.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataSurface->SurfWinBmDifSolar.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->SurfWinDifSolar.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataSurface->SurfWinHeatGain.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataSurface->SurfWinHeatTransfer.dimension(state.dataSurface->TotSurfaces, 0.0); @@ -822,9 +839,20 @@ void AllocateModuleArrays(EnergyPlusData &state) state.dataSurface->SurfWinSysSolTransmittance.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataSurface->SurfWinSysSolReflectance.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataSurface->SurfWinSysSolAbsorptance.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->InsideGlassCondensationFlag.dimension(state.dataSurface->TotSurfaces, 0); - state.dataSurface->InsideFrameCondensationFlag.dimension(state.dataSurface->TotSurfaces, 0); - state.dataSurface->InsideDividerCondensationFlag.dimension(state.dataSurface->TotSurfaces, 0); + state.dataSurface->SurfWinInsideGlassCondensationFlag.dimension(state.dataSurface->TotSurfaces, 0); + state.dataSurface->SurfWinInsideFrameCondensationFlag.dimension(state.dataSurface->TotSurfaces, 0); + state.dataSurface->SurfWinInsideDividerCondensationFlag.dimension(state.dataSurface->TotSurfaces, 0); + + state.dataHeatBal->SurfSunlitFracHR.dimension(HoursInDay, state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBal->SurfSunlitFrac.dimension(HoursInDay, state.dataGlobal->NumOfTimeStepInHour, state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBal->SurfSunlitFracWithoutReveal.dimension(HoursInDay, state.dataGlobal->NumOfTimeStepInHour, state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBal->SurfWinBackSurfaces.dimension( + HoursInDay, state.dataGlobal->NumOfTimeStepInHour, state.dataBSDFWindow->MaxBkSurf, state.dataSurface->TotSurfaces, 0); + state.dataHeatBal->SurfWinOverlapAreas.dimension( + HoursInDay, state.dataGlobal->NumOfTimeStepInHour, state.dataBSDFWindow->MaxBkSurf, state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBal->SurfCosIncAngHR.dimension(HoursInDay, state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBal->SurfCosIncAng.dimension(HoursInDay, state.dataGlobal->NumOfTimeStepInHour, state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBal->ZoneTransSolar.dimension(state.dataGlobal->NumOfZones, 0.0); state.dataHeatBal->ZoneBmSolFrExtWinsRep.dimension(state.dataGlobal->NumOfZones, 0.0); state.dataHeatBal->ZoneBmSolFrIntWinsRep.dimension(state.dataGlobal->NumOfZones, 0.0); @@ -868,9 +896,7 @@ void AllocateModuleArrays(EnergyPlusData &state) state.dataHeatBal->SurfWinBSDFBeamThetaRep.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBal->SurfWinBSDFBeamPhiRep.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBal->SurfWinQRadSWwinAbsTot.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBal->SurfWinQRadSWwinAbsLayer.dimension(state.dataSurface->TotSurfaces, state.dataHeatBal->MaxSolidWinLayers, 0.0); - state.dataHeatBal->SurfWinFenLaySurfTempFront.dimension(state.dataSurface->TotSurfaces, state.dataHeatBal->MaxSolidWinLayers, 0.0); state.dataHeatBal->SurfWinFenLaySurfTempBack.dimension(state.dataSurface->TotSurfaces, state.dataHeatBal->MaxSolidWinLayers, 0.0); @@ -878,30 +904,10 @@ void AllocateModuleArrays(EnergyPlusData &state) state.dataHeatBal->SurfInitialDifSolInAbsReport.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBal->SurfWinInitialDifSolInTransReport.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBal->SurfSWInAbsTotalReport.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSolarShading->WindowRevealStatus.dimension(state.dataGlobal->NumOfTimeStepInHour, 24, state.dataSurface->TotSurfaces, 0); - - // Weiler-Atherton - state.dataSolarShading->MAXHCArrayBounds = 2 * (state.dataSurface->MaxVerticesPerSurface + 1); - state.dataSolarShading->MAXHCArrayIncrement = state.dataSurface->MaxVerticesPerSurface + 1; - state.dataSolarShading->XTEMP.dimension(2 * (state.dataSurface->MaxVerticesPerSurface + 1), 0.0); - state.dataSolarShading->YTEMP.dimension(2 * (state.dataSurface->MaxVerticesPerSurface + 1), 0.0); - state.dataSolarShading->XVC.dimension(state.dataSurface->MaxVerticesPerSurface + 1, 0.0); - state.dataSolarShading->XVS.dimension(state.dataSurface->MaxVerticesPerSurface + 1, 0.0); - state.dataSolarShading->YVC.dimension(state.dataSurface->MaxVerticesPerSurface + 1, 0.0); - state.dataSolarShading->YVS.dimension(state.dataSurface->MaxVerticesPerSurface + 1, 0.0); - state.dataSolarShading->ZVC.dimension(state.dataSurface->MaxVerticesPerSurface + 1, 0.0); - - // Sutherland-Hodgman - state.dataSolarShading->ATEMP.dimension(2 * (state.dataSurface->MaxVerticesPerSurface + 1), 0.0); - state.dataSolarShading->BTEMP.dimension(2 * (state.dataSurface->MaxVerticesPerSurface + 1), 0.0); - state.dataSolarShading->CTEMP.dimension(2 * (state.dataSurface->MaxVerticesPerSurface + 1), 0.0); - state.dataSolarShading->XTEMP1.dimension(2 * (state.dataSurface->MaxVerticesPerSurface + 1), 0.0); - state.dataSolarShading->YTEMP1.dimension(2 * (state.dataSurface->MaxVerticesPerSurface + 1), 0.0); // energy state.dataSurface->SurfWinTransSolarEnergy.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataSurface->SurfWinBmSolarEnergy.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->SurfWinBmBmSolarEnergy.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataSurface->SurfWinBmDifSolarEnergy.dimension(state.dataSurface->TotSurfaces, 0.0); @@ -1189,7 +1195,7 @@ void AllocateModuleArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Anisotropic Sky Multiplier", OutputProcessor::Unit::None, - state.dataHeatBal->SurfAnisoSkyMult(SurfLoop), + state.dataSolarShading->SurfAnisoSkyMult(SurfLoop), "Zone", "Average", state.dataSurface->Surface(SurfLoop).Name); @@ -1468,7 +1474,7 @@ void AllocateModuleArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Window Frame Inside Temperature", OutputProcessor::Unit::C, - state.dataSurface->SurfWinFrameTempSurfIn(SurfLoop), + state.dataSurface->SurfWinFrameTempIn(SurfLoop), "Zone", "Average", state.dataSurface->Surface(SurfLoop).Name); @@ -1499,7 +1505,7 @@ void AllocateModuleArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Window Divider Inside Temperature", OutputProcessor::Unit::C, - state.dataSurface->SurfWinDividerTempSurfIn(SurfLoop), + state.dataSurface->SurfWinDividerTempIn(SurfLoop), "Zone", "Average", state.dataSurface->Surface(SurfLoop).Name); @@ -1619,21 +1625,21 @@ void AllocateModuleArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Window Inside Face Glazing Condensation Status", OutputProcessor::Unit::None, - state.dataSurface->InsideGlassCondensationFlag(SurfLoop), + state.dataSurface->SurfWinInsideGlassCondensationFlag(SurfLoop), "Zone", "State", state.dataSurface->Surface(SurfLoop).Name); SetupOutputVariable(state, "Surface Window Inside Face Frame Condensation Status", OutputProcessor::Unit::None, - state.dataSurface->InsideFrameCondensationFlag(SurfLoop), + state.dataSurface->SurfWinInsideFrameCondensationFlag(SurfLoop), "Zone", "State", state.dataSurface->Surface(SurfLoop).Name); SetupOutputVariable(state, "Surface Window Inside Face Divider Condensation Status", OutputProcessor::Unit::None, - state.dataSurface->InsideDividerCondensationFlag(SurfLoop), + state.dataSurface->SurfWinInsideDividerCondensationFlag(SurfLoop), "Zone", "State", state.dataSurface->Surface(SurfLoop).Name); @@ -1936,7 +1942,7 @@ void AllocateModuleArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Window Frame Inside Temperature", OutputProcessor::Unit::C, - state.dataSurface->SurfWinFrameTempSurfIn(SurfLoop), + state.dataSurface->SurfWinFrameTempIn(SurfLoop), "Zone", "Average", state.dataSurface->Surface(SurfLoop).Name); @@ -1966,7 +1972,7 @@ void AllocateModuleArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Window Divider Inside Temperature", OutputProcessor::Unit::C, - state.dataSurface->SurfWinDividerTempSurfIn(SurfLoop), + state.dataSurface->SurfWinDividerTempIn(SurfLoop), "Zone", "Average", state.dataSurface->Surface(SurfLoop).Name); @@ -2082,21 +2088,21 @@ void AllocateModuleArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Window Inside Face Glazing Condensation Status", OutputProcessor::Unit::None, - state.dataSurface->InsideGlassCondensationFlag(SurfLoop), + state.dataSurface->SurfWinInsideGlassCondensationFlag(SurfLoop), "Zone", "State", state.dataSurface->Surface(SurfLoop).Name); SetupOutputVariable(state, "Surface Window Inside Face Frame Condensation Status", OutputProcessor::Unit::None, - state.dataSurface->InsideFrameCondensationFlag(SurfLoop), + state.dataSurface->SurfWinInsideFrameCondensationFlag(SurfLoop), "Zone", "State", state.dataSurface->Surface(SurfLoop).Name); SetupOutputVariable(state, "Surface Window Inside Face Divider Condensation Status", OutputProcessor::Unit::None, - state.dataSurface->InsideDividerCondensationFlag(SurfLoop), + state.dataSurface->SurfWinInsideDividerCondensationFlag(SurfLoop), "Zone", "State", state.dataSurface->Surface(SurfLoop).Name); @@ -2501,7 +2507,7 @@ void AnisoSkyViewFactors(EnergyPlusData &state) ZenithAng = std::acos(CosZenithAng); ZenithAngDeg = ZenithAng / DataGlobalConstants::DegToRadians; - state.dataHeatBal->SurfAnisoSkyMult = 0.0; + state.dataSolarShading->SurfAnisoSkyMult = 0.0; // Relative air mass AirMassH = (1.0 - 0.1 * state.dataEnvrn->Elevation / 1000.0); @@ -2553,7 +2559,7 @@ void AnisoSkyViewFactors(EnergyPlusData &state) IncAng = std::acos(CosIncAngBeamOnSurface); ViewFactorSkyGeom = state.dataSurface->Surface(SurfNum).ViewFactorSky; - state.dataHeatBal->MultIsoSky(SurfNum) = ViewFactorSkyGeom * (1.0 - F1); + state.dataSolarShading->SurfMultIsoSky(SurfNum) = ViewFactorSkyGeom * (1.0 - F1); // 0.0871557 below corresponds to a zenith angle of 85 deg CircumSolarFac = max(0.0, CosIncAngBeamOnSurface) / max(0.0871557, CosZenithAng); // For near-horizontal roofs, model has an inconsistency that gives sky diffuse @@ -2561,28 +2567,28 @@ void AnisoSkyViewFactors(EnergyPlusData &state) // above 85 deg. The following forces irradiance to be very close to DifSolarRad // in this case. if (CircumSolarFac > 0.0 && CosZenithAng < 0.0871557 && state.dataSurface->Surface(SurfNum).Tilt < 2.0) CircumSolarFac = 1.0; - state.dataHeatBal->MultCircumSolar(SurfNum) = F1 * CircumSolarFac; - state.dataHeatBal->MultHorizonZenith(SurfNum) = F2 * state.dataSurface->Surface(SurfNum).SinTilt; + state.dataSolarShading->SurfMultCircumSolar(SurfNum) = F1 * CircumSolarFac; + state.dataSolarShading->SurfMultHorizonZenith(SurfNum) = F2 * state.dataSurface->Surface(SurfNum).SinTilt; if (!state.dataSysVars->DetailedSkyDiffuseAlgorithm || !state.dataSurface->ShadingTransmittanceVaries || state.dataHeatBal->SolarDistribution == MinimalShadowing) { - state.dataHeatBal->SurfAnisoSkyMult(SurfNum) = - state.dataHeatBal->MultIsoSky(SurfNum) * state.dataHeatBal->DifShdgRatioIsoSky(SurfNum) + - state.dataHeatBal->MultCircumSolar(SurfNum) * - state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum) + - state.dataHeatBal->MultHorizonZenith(SurfNum) * state.dataHeatBal->DifShdgRatioHoriz(SurfNum); + state.dataSolarShading->SurfAnisoSkyMult(SurfNum) = + state.dataSolarShading->SurfMultIsoSky(SurfNum) * state.dataSolarShading->SurfDifShdgRatioIsoSky(SurfNum) + + state.dataSolarShading->SurfMultCircumSolar(SurfNum) * + state.dataHeatBal->SurfSunlitFrac(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum) + + state.dataSolarShading->SurfMultHorizonZenith(SurfNum) * state.dataSolarShading->SurfDifShdgRatioHoriz(SurfNum); } else { - state.dataHeatBal->SurfAnisoSkyMult(SurfNum) = - state.dataHeatBal->MultIsoSky(SurfNum) * - state.dataHeatBal->DifShdgRatioIsoSkyHRTS(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum) + - state.dataHeatBal->MultCircumSolar(SurfNum) * - state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum) + - state.dataHeatBal->MultHorizonZenith(SurfNum) * - state.dataHeatBal->DifShdgRatioHorizHRTS(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum); - state.dataHeatBal->curDifShdgRatioIsoSky(SurfNum) = - state.dataHeatBal->DifShdgRatioIsoSkyHRTS(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum); - } - state.dataHeatBal->SurfAnisoSkyMult(SurfNum) = max(0.0, state.dataHeatBal->SurfAnisoSkyMult(SurfNum)); // make sure not negative. + state.dataSolarShading->SurfAnisoSkyMult(SurfNum) = + state.dataSolarShading->SurfMultIsoSky(SurfNum) * + state.dataSolarShading->SurfDifShdgRatioIsoSkyHRTS(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum) + + state.dataSolarShading->SurfMultCircumSolar(SurfNum) * + state.dataHeatBal->SurfSunlitFrac(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum) + + state.dataSolarShading->SurfMultHorizonZenith(SurfNum) * + state.dataSolarShading->SurfDifShdgRatioHorizHRTS(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum); + state.dataSolarShading->SurfCurDifShdgRatioIsoSky(SurfNum) = + state.dataSolarShading->SurfDifShdgRatioIsoSkyHRTS(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum); + } + state.dataSolarShading->SurfAnisoSkyMult(SurfNum) = max(0.0, state.dataSolarShading->SurfAnisoSkyMult(SurfNum)); // make sure not negative. } } @@ -3128,11 +3134,6 @@ void ComputeIntSolarAbsorpFactors(EnergyPlusData &state) Real64 TestFractSum; Real64 HorizAreaSum; - if (!allocated(state.dataSolarShading->ISABSF)) { - state.dataSolarShading->ISABSF.allocate(state.dataSurface->TotSurfaces); - } - state.dataSolarShading->ISABSF = 0.0; - for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclosureNum) { auto &thisEnclosure(state.dataViewFactor->ZoneSolarInfo(enclosureNum)); @@ -3170,7 +3171,7 @@ void ComputeIntSolarAbsorpFactors(EnergyPlusData &state) // last minute V3.1 if (state.dataConstruction->Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface if (AreaSum > 0.0) - state.dataSolarShading->ISABSF(SurfNum) = + state.dataSolarShading->SurfIntAbsFac(SurfNum) = state.dataSurface->Surface(SurfNum).Area * state.dataConstruction->Construct(ConstrNum).InsideAbsorpSolar / AreaSum; } else { // Window (floor windows are assumed to have no shading device and no divider, // and assumed to be non-switchable) @@ -3184,11 +3185,12 @@ void ComputeIntSolarAbsorpFactors(EnergyPlusData &state) AbsDiffTotWin += state.dataConstruction->Construct(ConstrNum).AbsDiffBackEQL(Lay); } } - if (AreaSum > 0.0) state.dataSolarShading->ISABSF(SurfNum) = state.dataSurface->Surface(SurfNum).Area * AbsDiffTotWin / AreaSum; + if (AreaSum > 0.0) + state.dataSolarShading->SurfIntAbsFac(SurfNum) = state.dataSurface->Surface(SurfNum).Area * AbsDiffTotWin / AreaSum; } } // CR 8229 test ISABSF for problems - TestFractSum += state.dataSolarShading->ISABSF(SurfNum); + TestFractSum += state.dataSolarShading->SurfIntAbsFac(SurfNum); } if (TestFractSum <= 0.0) { @@ -3215,7 +3217,7 @@ void ComputeIntSolarAbsorpFactors(EnergyPlusData &state) int const ConstrNum = state.dataSurface->SurfActiveConstruction(SurfNum); if (state.dataConstruction->Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface if (AreaSum > 0.0) - state.dataSolarShading->ISABSF(SurfNum) = + state.dataSolarShading->SurfIntAbsFac(SurfNum) = state.dataSurface->Surface(SurfNum).Area * state.dataConstruction->Construct(ConstrNum).InsideAbsorpSolar / AreaSum; } else { // Window (floor windows are assumed to have no shading device and no divider, // and assumed to be non-switchable) @@ -3231,7 +3233,7 @@ void ComputeIntSolarAbsorpFactors(EnergyPlusData &state) } if (AreaSum > 0.0) - state.dataSolarShading->ISABSF(SurfNum) = state.dataSurface->Surface(SurfNum).Area * AbsDiffTotWin / AreaSum; + state.dataSolarShading->SurfIntAbsFac(SurfNum) = state.dataSurface->Surface(SurfNum).Area * AbsDiffTotWin / AreaSum; } } } @@ -4789,32 +4791,69 @@ void CalcPerSolarBeam(EnergyPlusData &state, // Initialize some values for the appropriate period if (!state.dataSysVars->DetailedSolarTimestepIntegration) { - state.dataHeatBal->SunlitFracHR = 0.0; - state.dataHeatBal->SunlitFrac = 0.0; - state.dataHeatBal->SunlitFracWithoutReveal = 0.0; - state.dataSolarShading->CTHETA = 0.0; - state.dataHeatBal->CosIncAngHR = 0.0; - state.dataHeatBal->CosIncAng = 0.0; - state.dataSurface->SurfOpaqAO = 0.0; - state.dataHeatBal->BackSurfaces = 0; - state.dataHeatBal->OverlapAreas = 0.0; + for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { + int firstSurf = state.dataHeatBal->Zone(zoneNum).OpaqOrIntMassSurfaceFirst; + int lastSurf = state.dataHeatBal->Zone(zoneNum).OpaqOrIntMassSurfaceLast; + for (int surfNum = firstSurf; surfNum <= lastSurf; ++surfNum) { + state.dataSurface->SurfOpaqAO(surfNum) = 0.0; + } + firstSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceFirst; + lastSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceLast; + for (int surfNum = firstSurf; surfNum <= lastSurf; ++surfNum) { + state.dataSolarShading->SurfSunCosTheta(surfNum) = 0.0; + } + for (int hour = 1; hour <= 24; ++hour) { + for (int surfNum = firstSurf; surfNum <= lastSurf; ++surfNum) { + state.dataHeatBal->SurfSunlitFracHR(hour, surfNum) = 0.0; + state.dataHeatBal->SurfCosIncAngHR(hour, surfNum) = 0.0; + } + } + for (int hour = 1; hour <= 24; ++hour) { + for (int timestep = 1; timestep <= state.dataGlobal->NumOfTimeStepInHour; ++timestep) { + for (int surfNum = firstSurf; surfNum <= lastSurf; ++surfNum) { + state.dataHeatBal->SurfSunlitFrac(hour, timestep, surfNum) = 0.0; + state.dataHeatBal->SurfCosIncAng(hour, timestep, surfNum) = 0.0; + state.dataHeatBal->SurfSunlitFracWithoutReveal(hour, timestep, surfNum) = 0.0; + } + } + } + for (int hour = 1; hour <= 24; ++hour) { + for (int timestep = 1; timestep <= state.dataGlobal->NumOfTimeStepInHour; ++timestep) { + for (int backSurfNum = 1; backSurfNum <= state.dataBSDFWindow->MaxBkSurf; ++backSurfNum) { + for (int surfNum = firstSurf; surfNum <= lastSurf; ++surfNum) { + state.dataHeatBal->SurfWinBackSurfaces(hour, timestep, backSurfNum, surfNum) = 0.0; + state.dataHeatBal->SurfWinOverlapAreas(hour, timestep, backSurfNum, surfNum) = 0.0; + } + } + } + } + } + for (auto &e : state.dataSurface->SurfaceWindow) { e.OutProjSLFracMult = 1.0; e.InOutProjSLFracMult = 1.0; } } else { - state.dataHeatBal->SunlitFracHR(state.dataGlobal->HourOfDay, {1, state.dataSurface->TotSurfaces}) = 0.0; - state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, {1, state.dataSurface->TotSurfaces}) = 0.0; - state.dataHeatBal->SunlitFracWithoutReveal(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, {1, state.dataSurface->TotSurfaces}) = - 0.0; - state.dataSolarShading->CTHETA({1, state.dataSurface->TotSurfaces}) = 0.0; - state.dataHeatBal->CosIncAngHR(state.dataGlobal->HourOfDay, {1, state.dataSurface->TotSurfaces}) = 0.0; - state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, {1, state.dataSurface->TotSurfaces}) = 0.0; - state.dataSurface->SurfOpaqAO({1, state.dataSurface->TotSurfaces}) = 0.0; - state.dataHeatBal->BackSurfaces( - state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, {1, state.dataBSDFWindow->MaxBkSurf}, {1, state.dataSurface->TotSurfaces}) = 0; - state.dataHeatBal->OverlapAreas( - state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, {1, state.dataBSDFWindow->MaxBkSurf}, {1, state.dataSurface->TotSurfaces}) = 0.0; + for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { + int const firstSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceFirst; + int const lastSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceLast; + for (int surfNum = firstSurf; surfNum <= lastSurf; ++surfNum) { + state.dataSolarShading->SurfSunCosTheta(surfNum) = 0.0; + state.dataSurface->SurfOpaqAO(surfNum) = 0.0; + state.dataHeatBal->SurfSunlitFrac(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, surfNum) = 0.0; + state.dataHeatBal->SurfSunlitFracWithoutReveal(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, surfNum) = 0.0; + state.dataHeatBal->SurfSunlitFracHR(state.dataGlobal->HourOfDay, surfNum) = 0.0; + state.dataHeatBal->SurfCosIncAngHR(state.dataGlobal->HourOfDay, surfNum) = 0.0; + state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, surfNum) = 0.0; + } + for (int backSurfNum = 1; backSurfNum <= state.dataBSDFWindow->MaxBkSurf; ++backSurfNum) { + for (int surfNum = firstSurf; surfNum <= lastSurf; ++surfNum) { + state.dataHeatBal->SurfWinBackSurfaces(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, backSurfNum, surfNum) = 0; + state.dataHeatBal->SurfWinOverlapAreas(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, backSurfNum, surfNum) = 0.0; + } + } + } + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { state.dataSurface->SurfaceWindow(SurfNum).OutProjSLFracMult(state.dataGlobal->HourOfDay) = 1.0; state.dataSurface->SurfaceWindow(SurfNum).InOutProjSLFracMult(state.dataGlobal->HourOfDay) = 1.0; @@ -4878,12 +4917,12 @@ void FigureSunCosines(EnergyPlusData &state, // Save hourly values for use in DaylightingManager if (!state.dataSysVars->DetailedSolarTimestepIntegration) { - if (iTimeStep == state.dataGlobal->NumOfTimeStepInHour) state.dataSurface->SurfSunCosHourly(iHour, {1, 3}) = state.dataSolarShading->SUNCOS; + if (iTimeStep == state.dataGlobal->NumOfTimeStepInHour) state.dataSurface->SurfSunCosHourly(iHour) = state.dataSolarShading->SUNCOS; } else { - state.dataSurface->SurfSunCosHourly(iHour, {1, 3}) = state.dataSolarShading->SUNCOS; + state.dataSurface->SurfSunCosHourly(iHour) = state.dataSolarShading->SUNCOS; } // Save timestep values for use in WindowComplexManager - state.dataBSDFWindow->SUNCOSTS(iTimeStep, iHour, {1, 3}) = state.dataSolarShading->SUNCOS; + state.dataBSDFWindow->SUNCOSTS(iTimeStep, iHour) = state.dataSolarShading->SUNCOS; } void FigureSolarBeamAtTimestep(EnergyPlusData &state, int const iHour, int const iTimeStep) @@ -4907,33 +4946,33 @@ void FigureSolarBeamAtTimestep(EnergyPlusData &state, int const iHour, int const Real64 FracIlluminated; // Fraction of surface area illuminated by a sky patch // Recover the sun direction from the array stored in previous loop - state.dataSolarShading->SUNCOS = state.dataBSDFWindow->SUNCOSTS(iTimeStep, iHour, {1, 3}); + state.dataSolarShading->SUNCOS = state.dataBSDFWindow->SUNCOSTS(iTimeStep, iHour); - state.dataSolarShading->CTHETA = 0.0; + state.dataSolarShading->SurfSunCosTheta = 0.0; if (state.dataSolarShading->SUNCOS(3) < DataEnvironment::SunIsUpValue) return; for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - state.dataSolarShading->CTHETA(SurfNum) = state.dataSolarShading->SUNCOS(1) * state.dataSurface->Surface(SurfNum).OutNormVec(1) + - state.dataSolarShading->SUNCOS(2) * state.dataSurface->Surface(SurfNum).OutNormVec(2) + - state.dataSolarShading->SUNCOS(3) * state.dataSurface->Surface(SurfNum).OutNormVec(3); + state.dataSolarShading->SurfSunCosTheta(SurfNum) = state.dataSolarShading->SUNCOS(1) * state.dataSurface->Surface(SurfNum).OutNormVec(1) + + state.dataSolarShading->SUNCOS(2) * state.dataSurface->Surface(SurfNum).OutNormVec(2) + + state.dataSolarShading->SUNCOS(3) * state.dataSurface->Surface(SurfNum).OutNormVec(3); if (!state.dataSysVars->DetailedSolarTimestepIntegration) { if (iTimeStep == state.dataGlobal->NumOfTimeStepInHour) - state.dataHeatBal->CosIncAngHR(iHour, SurfNum) = state.dataSolarShading->CTHETA(SurfNum); + state.dataHeatBal->SurfCosIncAngHR(iHour, SurfNum) = state.dataSolarShading->SurfSunCosTheta(SurfNum); } else { - state.dataHeatBal->CosIncAngHR(iHour, SurfNum) = state.dataSolarShading->CTHETA(SurfNum); + state.dataHeatBal->SurfCosIncAngHR(iHour, SurfNum) = state.dataSolarShading->SurfSunCosTheta(SurfNum); } - state.dataHeatBal->CosIncAng(iTimeStep, iHour, SurfNum) = state.dataSolarShading->CTHETA(SurfNum); + state.dataHeatBal->SurfCosIncAng(iHour, iTimeStep, SurfNum) = state.dataSolarShading->SurfSunCosTheta(SurfNum); } if ((state.dataSysVars->shadingMethod == ShadingMethod::Scheduled || state.dataSysVars->shadingMethod == ShadingMethod::Imported) && !state.dataGlobal->DoingSizing && state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) { for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { if (state.dataSurface->SurfSchedExternalShadingFrac(SurfNum)) { - state.dataHeatBal->SunlitFrac(iTimeStep, iHour, SurfNum) = + state.dataHeatBal->SurfSunlitFrac(iHour, iTimeStep, SurfNum) = LookUpScheduleValue(state, state.dataSurface->SurfExternalShadingSchInd(SurfNum), iHour, iTimeStep); } else { - state.dataHeatBal->SunlitFrac(iTimeStep, iHour, SurfNum) = 1.0; + state.dataHeatBal->SurfSunlitFrac(iHour, iTimeStep, SurfNum) = 1.0; } } } else { @@ -4943,26 +4982,29 @@ void FigureSolarBeamAtTimestep(EnergyPlusData &state, int const iHour, int const SurfArea = state.dataSurface->Surface(SurfNum).NetAreaShadowCalc; if (!state.dataSysVars->DetailedSolarTimestepIntegration) { if (iTimeStep == state.dataGlobal->NumOfTimeStepInHour) - state.dataHeatBal->SunlitFracHR(iHour, SurfNum) = state.dataSolarShading->SAREA(SurfNum) / SurfArea; + state.dataHeatBal->SurfSunlitFracHR(iHour, SurfNum) = state.dataSolarShading->SurfSunlitArea(SurfNum) / SurfArea; } else { - state.dataHeatBal->SunlitFracHR(iHour, SurfNum) = state.dataSolarShading->SAREA(SurfNum) / SurfArea; + state.dataHeatBal->SurfSunlitFracHR(iHour, SurfNum) = state.dataSolarShading->SurfSunlitArea(SurfNum) / SurfArea; } - state.dataHeatBal->SunlitFrac(iTimeStep, iHour, SurfNum) = state.dataSolarShading->SAREA(SurfNum) / SurfArea; - if (state.dataHeatBal->SunlitFrac(iTimeStep, iHour, SurfNum) < 1.e-5) state.dataHeatBal->SunlitFrac(iTimeStep, iHour, SurfNum) = 0.0; + state.dataHeatBal->SurfSunlitFrac(iHour, iTimeStep, SurfNum) = state.dataSolarShading->SurfSunlitArea(SurfNum) / SurfArea; + if (state.dataHeatBal->SurfSunlitFrac(iHour, iTimeStep, SurfNum) < 1.e-5) + state.dataHeatBal->SurfSunlitFrac(iHour, iTimeStep, SurfNum) = 0.0; } // Added check - if (state.dataHeatBal->SunlitFrac(iTimeStep, iHour, SurfNum) > 1.0) { - state.dataHeatBal->SunlitFrac(iTimeStep, iHour, SurfNum) = 1.0; + if (state.dataHeatBal->SurfSunlitFrac(iHour, iTimeStep, SurfNum) > 1.0) { + state.dataHeatBal->SurfSunlitFrac(iHour, iTimeStep, SurfNum) = 1.0; } } } // Note -- if not the below, values are set in SkyDifSolarShading routine (constant for simulation) if (state.dataSysVars->DetailedSkyDiffuseAlgorithm && state.dataSurface->ShadingTransmittanceVaries && state.dataHeatBal->SolarDistribution != MinimalShadowing) { - state.dataHeatBal->WithShdgIsoSky = 0.; - state.dataHeatBal->WoShdgIsoSky = 0.; - state.dataHeatBal->WithShdgHoriz = 0.; - state.dataHeatBal->WoShdgHoriz = 0.; + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { + state.dataSolarShading->SurfWithShdgIsoSky(SurfNum) = 0.; + state.dataSolarShading->SurfWoShdgIsoSky(SurfNum) = 0.; + state.dataSolarShading->SurfWithShdgHoriz(SurfNum) = 0.; + state.dataSolarShading->SurfWoShdgHoriz(SurfNum) = 0.; + } for (int IPhi = 0; IPhi < NPhi; ++IPhi) { // Loop over patch altitude values state.dataSolarShading->SUNCOS(3) = state.dataSolarShading->sin_Phi[IPhi]; @@ -4973,9 +5015,10 @@ void FigureSolarBeamAtTimestep(EnergyPlusData &state, int const iHour, int const for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { if (!state.dataSurface->Surface(SurfNum).IsShadowing && !state.dataSurface->Surface(SurfNum).HeatTransSurf) continue; - state.dataSolarShading->CTHETA(SurfNum) = state.dataSolarShading->SUNCOS(1) * state.dataSurface->Surface(SurfNum).OutNormVec(1) + - state.dataSolarShading->SUNCOS(2) * state.dataSurface->Surface(SurfNum).OutNormVec(2) + - state.dataSolarShading->SUNCOS(3) * state.dataSurface->Surface(SurfNum).OutNormVec(3); + state.dataSolarShading->SurfSunCosTheta(SurfNum) = + state.dataSolarShading->SUNCOS(1) * state.dataSurface->Surface(SurfNum).OutNormVec(1) + + state.dataSolarShading->SUNCOS(2) * state.dataSurface->Surface(SurfNum).OutNormVec(2) + + state.dataSolarShading->SUNCOS(3) * state.dataSurface->Surface(SurfNum).OutNormVec(3); } SHADOW(state, iHour, iTimeStep); // Determine sunlit areas and solar multipliers for all surfaces. @@ -4986,23 +5029,23 @@ void FigureSolarBeamAtTimestep(EnergyPlusData &state, int const iHour, int const (!state.dataSurface->Surface(SurfNum).HeatTransSurf || !state.dataSurface->Surface(SurfNum).ExtSolar)) continue; - if (state.dataSolarShading->CTHETA(SurfNum) < 0.0) continue; + if (state.dataSolarShading->SurfSunCosTheta(SurfNum) < 0.0) continue; - Fac1WoShdg = state.dataSolarShading->cos_Phi[IPhi] * DThetaDPhi * state.dataSolarShading->CTHETA(SurfNum); + Fac1WoShdg = state.dataSolarShading->cos_Phi[IPhi] * DThetaDPhi * state.dataSolarShading->SurfSunCosTheta(SurfNum); SurfArea = state.dataSurface->Surface(SurfNum).NetAreaShadowCalc; if (SurfArea > Eps) { - FracIlluminated = state.dataSolarShading->SAREA(SurfNum) / SurfArea; + FracIlluminated = state.dataSolarShading->SurfSunlitArea(SurfNum) / SurfArea; } else { - FracIlluminated = state.dataSolarShading->SAREA(SurfNum) / (SurfArea + Eps); + FracIlluminated = state.dataSolarShading->SurfSunlitArea(SurfNum) / (SurfArea + Eps); } Fac1WithShdg = Fac1WoShdg * FracIlluminated; - state.dataHeatBal->WithShdgIsoSky(SurfNum) += Fac1WithShdg; - state.dataHeatBal->WoShdgIsoSky(SurfNum) += Fac1WoShdg; + state.dataSolarShading->SurfWithShdgIsoSky(SurfNum) += Fac1WithShdg; + state.dataSolarShading->SurfWoShdgIsoSky(SurfNum) += Fac1WoShdg; // Horizon region if (IPhi == 0) { - state.dataHeatBal->WithShdgHoriz(SurfNum) += Fac1WithShdg; - state.dataHeatBal->WoShdgHoriz(SurfNum) += Fac1WoShdg; + state.dataSolarShading->SurfWithShdgHoriz(SurfNum) += Fac1WithShdg; + state.dataSolarShading->SurfWoShdgHoriz(SurfNum) += Fac1WoShdg; } } // End of surface loop } // End of Theta loop @@ -5014,19 +5057,19 @@ void FigureSolarBeamAtTimestep(EnergyPlusData &state, int const iHour, int const (!state.dataSurface->Surface(SurfNum).HeatTransSurf || !state.dataSurface->Surface(SurfNum).ExtSolar)) continue; - if (std::abs(state.dataHeatBal->WoShdgIsoSky(SurfNum)) > Eps) { - state.dataHeatBal->DifShdgRatioIsoSkyHRTS(iTimeStep, iHour, SurfNum) = - (state.dataHeatBal->WithShdgIsoSky(SurfNum)) / (state.dataHeatBal->WoShdgIsoSky(SurfNum)); + if (std::abs(state.dataSolarShading->SurfWoShdgIsoSky(SurfNum)) > Eps) { + state.dataSolarShading->SurfDifShdgRatioIsoSkyHRTS(iTimeStep, iHour, SurfNum) = + (state.dataSolarShading->SurfWithShdgIsoSky(SurfNum)) / (state.dataSolarShading->SurfWoShdgIsoSky(SurfNum)); } else { - state.dataHeatBal->DifShdgRatioIsoSkyHRTS(iTimeStep, iHour, SurfNum) = - (state.dataHeatBal->WithShdgIsoSky(SurfNum)) / (state.dataHeatBal->WoShdgIsoSky(SurfNum) + Eps); + state.dataSolarShading->SurfDifShdgRatioIsoSkyHRTS(iTimeStep, iHour, SurfNum) = + (state.dataSolarShading->SurfWithShdgIsoSky(SurfNum)) / (state.dataSolarShading->SurfWoShdgIsoSky(SurfNum) + Eps); } - if (std::abs(state.dataHeatBal->WoShdgHoriz(SurfNum)) > Eps) { - state.dataHeatBal->DifShdgRatioHorizHRTS(iTimeStep, iHour, SurfNum) = - (state.dataHeatBal->WithShdgHoriz(SurfNum)) / (state.dataHeatBal->WoShdgHoriz(SurfNum)); + if (std::abs(state.dataSolarShading->SurfWoShdgHoriz(SurfNum)) > Eps) { + state.dataSolarShading->SurfDifShdgRatioHorizHRTS(iTimeStep, iHour, SurfNum) = + (state.dataSolarShading->SurfWithShdgHoriz(SurfNum)) / (state.dataSolarShading->SurfWoShdgHoriz(SurfNum)); } else { - state.dataHeatBal->DifShdgRatioHorizHRTS(iTimeStep, iHour, SurfNum) = - (state.dataHeatBal->WithShdgHoriz(SurfNum)) / (state.dataHeatBal->WoShdgHoriz(SurfNum) + Eps); + state.dataSolarShading->SurfDifShdgRatioHorizHRTS(iTimeStep, iHour, SurfNum) = + (state.dataSolarShading->SurfWithShdgHoriz(SurfNum)) / (state.dataSolarShading->SurfWoShdgHoriz(SurfNum) + Eps); } } @@ -5053,7 +5096,7 @@ void FigureSolarBeamAtTimestep(EnergyPlusData &state, int const iHour, int const if (state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Window && state.dataSurface->Surface(SurfNum).ExtBoundCond == ExternalEnvironment && - state.dataHeatBal->SunlitFrac(iTimeStep, iHour, SurfNum) > 0.0 && state.dataSurface->Surface(SurfNum).FrameDivider > 0) + state.dataHeatBal->SurfSunlitFrac(iHour, iTimeStep, SurfNum) > 0.0 && state.dataSurface->Surface(SurfNum).FrameDivider > 0) CalcFrameDividerShadow(state, SurfNum, state.dataSurface->Surface(SurfNum).FrameDivider, iHour); } } @@ -5146,8 +5189,8 @@ void DetermineShadowingCombinations(EnergyPlusData &state) #ifndef EP_NO_OPENGL if (state.dataSolarShading->penumbra) { - bool skipSurface = state.dataSurface->Surface(GRSNR) - .MirroredSurf; // Penumbra doesn't need mirrored surfaces TODO: Don't bother creating them in the first place? + bool skipSurface = state.dataSurface->Surface(GRSNR).MirroredSurf; + // Penumbra doesn't need mirrored surfaces TODO: Don't bother creating them in the first place? // Skip interior surfaces if the other side has already been added to penumbra if (state.dataSurface->Surface(GRSNR).ExtBoundCond > 0) { @@ -5563,7 +5606,7 @@ void SHADOW(EnergyPlusData &state, } #endif - state.dataSolarShading->SAREA = 0.0; + state.dataSolarShading->SurfSunlitArea = 0.0; #ifndef EP_NO_OPENGL if (state.dataSolarShading->penumbra) { @@ -5578,7 +5621,7 @@ void SHADOW(EnergyPlusData &state, if (!state.dataShadowComb->ShadowComb(GRSNR).UseThisSurf) continue; - state.dataSolarShading->SAREA(GRSNR) = 0.0; + state.dataSolarShading->SurfSunlitArea(GRSNR) = 0.0; NGSS = state.dataShadowComb->ShadowComb(GRSNR).NumGenSurf; state.dataSolarShading->NGSSHC = 0; @@ -5591,33 +5634,35 @@ void SHADOW(EnergyPlusData &state, // Temporarily determine the old heat transfer surface number (HTS) HTS = GRSNR; - if (state.dataSolarShading->CTHETA(GRSNR) < DataEnvironment::SunIsUpValue) { //.001) THEN ! Receiving surface is not in the sun + if (state.dataSolarShading->SurfSunCosTheta(GRSNR) < DataEnvironment::SunIsUpValue) { //.001) THEN ! Receiving surface is not in the sun - state.dataSolarShading->SAREA(HTS) = 0.0; + state.dataSolarShading->SurfSunlitArea(HTS) = 0.0; SHDSBS(state, iHour, GRSNR, NBKS, NSBS, HTS, TS); } else if ((NGSS <= 0) && (NSBS <= 0)) { // Simple surface--no shaders or subsurfaces - state.dataSolarShading->SAREA(HTS) = state.dataSurface->Surface(GRSNR).NetAreaShadowCalc; + state.dataSolarShading->SurfSunlitArea(HTS) = state.dataSurface->Surface(GRSNR).NetAreaShadowCalc; } else { // Surface in sun and either shading surfaces or subsurfaces present (or both) #ifndef EP_NO_OPENGL auto id = state.dataSurface->SurfPenumbraID(HTS); if (state.dataSolarShading->penumbra && id >= 0) { - // SAREA(HTS) = buildingPSSF.at(id) / CTHETA(HTS); - state.dataSolarShading->SAREA(HTS) = state.dataSolarShading->penumbra->fetchPSSA(id) / state.dataSolarShading->CTHETA(HTS); - // SAREA(HTS) = penumbra->fetchPSSA(Surface(HTS).PenumbraID)/CTHETA(HTS); + // SurfSunlitArea(HTS) = buildingPSSF.at(id) / SurfSunCosTheta(HTS); + state.dataSolarShading->SurfSunlitArea(HTS) = + state.dataSolarShading->penumbra->fetchPSSA(id) / state.dataSolarShading->SurfSunCosTheta(HTS); + // SurfSunlitArea(HTS) = penumbra->fetchPSSA(Surface(HTS).PenumbraID)/SurfSunCosTheta(HTS); for (int SS = 1; SS <= NSBS; ++SS) { auto HTSS = state.dataShadowComb->ShadowComb(HTS).SubSurf(SS); id = state.dataSurface->SurfPenumbraID(HTSS); if (id >= 0) { - // SAREA(HTSS) = buildingPSSF.at(id) / CTHETA(HTSS); - state.dataSolarShading->SAREA(HTSS) = state.dataSolarShading->penumbra->fetchPSSA(id) / state.dataSolarShading->CTHETA(HTSS); - // SAREA(HTSS) = penumbra->fetchPSSA(Surface(HTSS).PenumbraID)/CTHETA(HTSS); - if (state.dataSolarShading->SAREA(HTSS) > 0.0) { + // SurfSunlitArea(HTSS) = buildingPSSF.at(id) / SurfSunCosTheta(HTSS); + state.dataSolarShading->SurfSunlitArea(HTSS) = + state.dataSolarShading->penumbra->fetchPSSA(id) / state.dataSolarShading->SurfSunCosTheta(HTSS); + // SurfSunlitArea(HTSS) = penumbra->fetchPSSA(Surface(HTSS).PenumbraID)/SurfSunCosTheta(HTSS); + if (state.dataSolarShading->SurfSunlitArea(HTSS) > 0.0) { if (iHour > 0 && TS > 0) - state.dataHeatBal->SunlitFracWithoutReveal(TS, iHour, HTSS) = - state.dataSolarShading->SAREA(HTSS) / state.dataSurface->Surface(HTSS).Area; + state.dataHeatBal->SurfSunlitFracWithoutReveal(iHour, TS, HTSS) = + state.dataSolarShading->SurfSunlitArea(HTSS) / state.dataSurface->Surface(HTSS).Area; } } } @@ -5677,11 +5722,11 @@ void SHADOW(EnergyPlusData &state, SHDSBS(state, iHour, GRSNR, NBKS, NSBS, HTS, TS); // Subtract subsurf areas from total - // Error checking: require that 0 <= SAREA <= AREA. + or - .01*AREA added for round-off errors + // Error checking: require that 0 <= SurfSunlitArea <= AREA. + or - .01*AREA added for round-off errors SurfArea = state.dataSurface->Surface(GRSNR).NetAreaShadowCalc; - state.dataSolarShading->SAREA(HTS) = max(0.0, state.dataSolarShading->SAREA(HTS)); + state.dataSolarShading->SurfSunlitArea(HTS) = max(0.0, state.dataSolarShading->SurfSunlitArea(HTS)); - state.dataSolarShading->SAREA(HTS) = min(state.dataSolarShading->SAREA(HTS), SurfArea); + state.dataSolarShading->SurfSunlitArea(HTS) = min(state.dataSolarShading->SurfSunlitArea(HTS), SurfArea); } // ...end of surface in sun/surface with shaders and/or subsurfaces IF-THEN block // NOTE: @@ -5737,7 +5782,7 @@ void SHDBKS(EnergyPlusData &state, state.dataSolarShading->SHDBKSOneTimeFlag = false; } - if ((NBKS <= 0) || (state.dataSolarShading->SAREA(HTS) <= 0.0) || + if ((NBKS <= 0) || (state.dataSolarShading->SurfSunlitArea(HTS) <= 0.0) || (state.dataSolarShading->OverlapStatus == state.dataSolarShading->TooManyVertices) || (state.dataSolarShading->OverlapStatus == state.dataSolarShading->TooManyFigures)) return; @@ -5748,7 +5793,7 @@ void SHDBKS(EnergyPlusData &state, BackSurfaceNumber = state.dataShadowComb->ShadowComb(CurSurf).BackSurf(I); - if (state.dataSolarShading->CTHETA(BackSurfaceNumber) > -DataEnvironment::SunIsUpValue) + if (state.dataSolarShading->SurfSunCosTheta(BackSurfaceNumber) > -DataEnvironment::SunIsUpValue) continue; //-0.001) CYCLE ! go to next back surface since inside of this surface // cannot be in sun if the outside can be @@ -5863,7 +5908,7 @@ void SHDGSS(EnergyPlusData &state, if (NGSS <= 0) { // IF NO S.S., receiving surface FULLY SUNLIT. - state.dataSolarShading->SAREA(HTS) = state.dataSolarShading->HCAREA(1); // Surface fully sunlit + state.dataSolarShading->SurfSunlitArea(HTS) = state.dataSolarShading->HCAREA(1); // Surface fully sunlit } else { @@ -5874,7 +5919,7 @@ void SHDGSS(EnergyPlusData &state, GSSNR = GenSurf(I); - if (state.dataSolarShading->CTHETA(GSSNR) > sunIsUp) continue; //.001) CYCLE ! NO SHADOW IF GSS IN SUNLIGHT. + if (state.dataSolarShading->SurfSunCosTheta(GSSNR) > sunIsUp) continue; //.001) CYCLE ! NO SHADOW IF GSS IN SUNLIGHT. auto const &surface(state.dataSurface->Surface(GSSNR)); bool const notHeatTransSurf(!surface.HeatTransSurf); @@ -6032,12 +6077,12 @@ void SHDGSS(EnergyPlusData &state, // Compute sunlit area of surface (excluding effects of subsurfs). if (ExitLoopStatus == state.dataSolarShading->FirstSurfWithinSecond) { // Surface fully shaded - state.dataSolarShading->SAREA(HTS) = 0.0; + state.dataSolarShading->SurfSunlitArea(HTS) = 0.0; state.dataSolarShading->LOCHCA = state.dataSolarShading->FGSSHC; } else if ((ExitLoopStatus == state.dataSolarShading->TooManyVertices) || (ExitLoopStatus == state.dataSolarShading->TooManyFigures)) { // Array limits exceeded, estimate - state.dataSolarShading->SAREA(HTS) = 0.25 * state.dataSolarShading->HCAREA(1); + state.dataSolarShading->SurfSunlitArea(HTS) = 0.25 * state.dataSolarShading->HCAREA(1); } else { @@ -6046,21 +6091,20 @@ void SHDGSS(EnergyPlusData &state, state.dataSolarShading->NGSSHC = state.dataSolarShading->LOCHCA - state.dataSolarShading->FGSSHC + 1; if (state.dataSolarShading->NGSSHC <= 0) { - state.dataSolarShading->SAREA(HTS) = state.dataSolarShading->HCAREA(1); // Surface fully sunlit + state.dataSolarShading->SurfSunlitArea(HTS) = state.dataSolarShading->HCAREA(1); // Surface fully sunlit } else { Real64 A(state.dataSolarShading->HCAREA(1)); // Area for (int i = state.dataSolarShading->FGSSHC, e = state.dataSolarShading->FGSSHC + state.dataSolarShading->NGSSHC - 1; i <= e; ++i) { A += state.dataSolarShading->HCAREA(i) * (1.0 - state.dataSolarShading->HCT(i)); } - state.dataSolarShading->SAREA(HTS) = A; - if (state.dataSolarShading->SAREA(HTS) <= 0.0) { // Surface fully shaded - state.dataSolarShading->SAREA(HTS) = 0.0; + state.dataSolarShading->SurfSunlitArea(HTS) = A; + if (state.dataSolarShading->SurfSunlitArea(HTS) <= 0.0) { // Surface fully shaded + state.dataSolarShading->SurfSunlitArea(HTS) = 0.0; state.dataSolarShading->LOCHCA = state.dataSolarShading->FGSSHC; } } } } - state.dataSolarShading->NGSSHC = state.dataSolarShading->LOCHCA - state.dataSolarShading->FGSSHC + 1; } @@ -6116,7 +6160,7 @@ void CalcInteriorSolarOverlaps(EnergyPlusData &state, assert(equal_dimensions(state.dataSolarShading->HCX, state.dataSolarShading->HCB)); assert(equal_dimensions(state.dataSolarShading->HCX, state.dataSolarShading->HCC)); - if (state.dataSolarShading->SAREA(HTSS) > 0.0) { + if (state.dataSolarShading->SurfSunlitArea(HTSS) > 0.0) { UseSimpleDistribution = false; @@ -6134,7 +6178,7 @@ void CalcInteriorSolarOverlaps(EnergyPlusData &state, // IF(Surface(HTSS)%Reveal > 0.0) NRVLHC = 1 // Changing the line to the following avoids incorrect calculation when window is not shaded // only by reveal (FCW 6/28/02). - if (state.dataSolarShading->WindowRevealStatus(TS, iHour, HTSS) == WindowShadedOnlyByReveal) state.dataSolarShading->NRVLHC = 1; + if (state.dataSolarShading->SurfWinRevealStatus(iHour, TS, HTSS) == WindowShadedOnlyByReveal) state.dataSolarShading->NRVLHC = 1; if (state.dataSolarShading->NRVLHC > 0) { for (int I = 1; I <= state.dataSolarShading->NRVLHC; ++I) { int const iS(state.dataSolarShading->FSBSHC - 1 + I); @@ -6169,7 +6213,7 @@ void CalcInteriorSolarOverlaps(EnergyPlusData &state, std::vector pbBackSurfaces; for (auto bkSurfNum : state.dataShadowComb->ShadowComb(GRSNR).BackSurf) { if (bkSurfNum == 0) continue; - if (state.dataSolarShading->CTHETA(bkSurfNum) < DataEnvironment::SunIsUpValue) { + if (state.dataSolarShading->SurfSunCosTheta(bkSurfNum) < DataEnvironment::SunIsUpValue) { pbBackSurfaces.push_back(state.dataSurface->SurfPenumbraID(bkSurfNum)); } } @@ -6181,9 +6225,9 @@ void CalcInteriorSolarOverlaps(EnergyPlusData &state, if (bkSurfNum == 0) continue; if (pssas[state.dataSurface->SurfPenumbraID(bkSurfNum)] > 0) { ++JBKS; - state.dataHeatBal->BackSurfaces(TS, iHour, JBKS, HTSS) = bkSurfNum; - Real64 OverlapArea = pssas[state.dataSurface->SurfPenumbraID(bkSurfNum)] / state.dataSolarShading->CTHETA(HTSS); - state.dataHeatBal->OverlapAreas(TS, iHour, JBKS, HTSS) = OverlapArea * state.dataSurface->SurfWinGlazedFrac(HTSS); + state.dataHeatBal->SurfWinBackSurfaces(iHour, TS, JBKS, HTSS) = bkSurfNum; + Real64 OverlapArea = pssas[state.dataSurface->SurfPenumbraID(bkSurfNum)] / state.dataSolarShading->SurfSunCosTheta(HTSS); + state.dataHeatBal->SurfWinOverlapAreas(iHour, TS, JBKS, HTSS) = OverlapArea * state.dataSurface->SurfWinGlazedFrac(HTSS); } } } @@ -6224,17 +6268,17 @@ void CalcInteriorSolarOverlaps(EnergyPlusData &state, if (OverlapArea > 0.001) { ++JBKS; if (JBKS <= state.dataBSDFWindow->MaxBkSurf) { - state.dataHeatBal->BackSurfaces(TS, iHour, JBKS, HTSS) = BackSurfNum; + state.dataHeatBal->SurfWinBackSurfaces(iHour, TS, JBKS, HTSS) = BackSurfNum; int baseSurfaceNum = state.dataSurface->Surface(BackSurfNum).BaseSurf; - state.dataHeatBal->OverlapAreas(TS, iHour, JBKS, HTSS) = OverlapArea * state.dataSurface->SurfWinGlazedFrac(HTSS); + state.dataHeatBal->SurfWinOverlapAreas(iHour, TS, JBKS, HTSS) = OverlapArea * state.dataSurface->SurfWinGlazedFrac(HTSS); // If this is a subsurface, subtract its overlap area from its base surface if (baseSurfaceNum != BackSurfNum) { for (int iBaseBKS = 1; iBaseBKS <= JBKS; ++iBaseBKS) { - if (baseSurfaceNum == state.dataHeatBal->BackSurfaces(TS, iHour, iBaseBKS, HTSS)) { - state.dataHeatBal->OverlapAreas(TS, iHour, iBaseBKS, HTSS) = + if (baseSurfaceNum == state.dataHeatBal->SurfWinBackSurfaces(iHour, TS, iBaseBKS, HTSS)) { + state.dataHeatBal->SurfWinOverlapAreas(iHour, TS, iBaseBKS, HTSS) = max(0.0, - state.dataHeatBal->OverlapAreas(TS, iHour, iBaseBKS, HTSS) - - state.dataHeatBal->OverlapAreas(TS, iHour, JBKS, HTSS)); + state.dataHeatBal->SurfWinOverlapAreas(iHour, TS, iBaseBKS, HTSS) - + state.dataHeatBal->SurfWinOverlapAreas(iHour, TS, JBKS, HTSS)); break; } } @@ -6287,17 +6331,14 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) ++state.dataTimingsData->NumIntSolarDist_Calls; #endif for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { - state.dataHeatBal->EnclSolDB(zoneNum) = 0.0; - state.dataHeatBal->EnclSolDBSSG(zoneNum) = 0.0; - state.dataHeatBal->EnclSolDBIntWin(zoneNum) = 0.0; int const firstSurfWin = state.dataHeatBal->Zone(zoneNum).WindowSurfaceFirst; int const lastSurfWin = state.dataHeatBal->Zone(zoneNum).WindowSurfaceLast; for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) { for (int lay = 1; lay <= CFSMAXNL + 1; ++lay) { state.dataSurface->SurfWinA(SurfNum, lay) = 0.0; } - state.dataSolarShading->IntBeamAbsByShadFac(SurfNum) = 0.0; - state.dataSolarShading->ExtBeamAbsByShadFac(SurfNum) = 0.0; + state.dataSolarShading->SurfWinIntBeamAbsByShadFac(SurfNum) = 0.0; + state.dataSolarShading->SurfWinExtBeamAbsByShadFac(SurfNum) = 0.0; } int const firstSurfOpaque = state.dataHeatBal->Zone(zoneNum).OpaqOrIntMassSurfaceFirst; int const lastSurfOpaque = state.dataHeatBal->Zone(zoneNum).OpaqOrIntMassSurfaceLast; @@ -6312,8 +6353,8 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) for (int lay = 1; lay <= CFSMAXNL + 1; ++lay) { state.dataSurface->SurfWinA(SurfDome, lay) = 0.0; } - state.dataSolarShading->IntBeamAbsByShadFac(SurfDome) = 0.0; - state.dataSolarShading->ExtBeamAbsByShadFac(SurfDome) = 0.0; + state.dataSolarShading->SurfWinIntBeamAbsByShadFac(SurfDome) = 0.0; + state.dataSolarShading->SurfWinExtBeamAbsByShadFac(SurfDome) = 0.0; } } @@ -6322,7 +6363,9 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) Real64 BTOTZone = 0.0; // Beam radiation from exterior windows absorbed in a zone or transmitted through Real64 BABSZone = 0.0; - + state.dataHeatBal->EnclSolDB(enclosureNum) = 0.0; + state.dataHeatBal->EnclSolDBSSG(enclosureNum) = 0.0; + state.dataHeatBal->EnclSolDBIntWin(enclosureNum) = 0.0; // Loop over exterior surfaces in this zone auto &thisEnclosure(state.dataViewFactor->ZoneSolarInfo(enclosureNum)); // delete values from previous timestep @@ -6339,8 +6382,8 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) if (!state.dataSurface->Surface(SurfNum).HeatTransSurf) continue; if (!state.dataSurface->Surface(SurfNum).ExtSolar) continue; int const ConstrNum = state.dataSurface->SurfActiveConstruction(SurfNum); - Real64 CosInc = state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum); - Real64 SunLitFract = state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum); + Real64 CosInc = state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum); + Real64 SunLitFract = state.dataHeatBal->SurfSunlitFrac(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum); state.dataSurface->SurfOpaqAO(SurfNum) = state.dataConstruction->Construct(ConstrNum).OutsideAbsorpSolar * CosInc * SunLitFract; } } @@ -6369,25 +6412,25 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) if (state.dataSurface->SurfWinOriginalClass(SurfNum) == SurfaceClass::TDD_Diffuser) { SurfNum2 = state.dataDaylightingDevicesData->TDDPipe(PipeNum).Dome; } - Real64 CosInc = state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum2); - Real64 SunLitFract = state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum2); + Real64 CosInc = state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum2); + Real64 SunLitFract = state.dataHeatBal->SurfSunlitFrac(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum2); //----------------------------------------- // BLOCK 1 // EXTERIOR BEAM AND DIFFUSE SOLAR RADIATION ABSORBED IN THE GLASS LAYERS OF (SurfWinA) - // EXTERIOR BEAM ABSORBED BY SHADING DEVICE (ExtBeamAbsByShadFac) + // EXTERIOR BEAM ABSORBED BY SHADING DEVICE (SurfWinExtBeamAbsByShadFac) //----------------------------------------- // Somewhat of a kludge if (state.dataSurface->Surface(SurfNum).Class == SurfaceClass::TDD_Dome || state.dataSurface->SurfWinOriginalClass(SurfNum) == SurfaceClass::TDD_Diffuser) - state.dataHeatBal->SunlitFracWithoutReveal(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum) = + state.dataHeatBal->SurfSunlitFracWithoutReveal(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum) = SunLitFract; // Frames/dividers not allow int FenSolAbsPtr = 0; if (state.dataSurface->SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { FenSolAbsPtr = WindowScheduledSolarAbs(state, SurfNum, ConstrNum); } bool SunlitFracWithoutReveal = - state.dataHeatBal->SunlitFracWithoutReveal(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum) > 0; + state.dataHeatBal->SurfSunlitFracWithoutReveal(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum) > 0; // Calculate interpolated blind properties Real64 FrontDiffDiffTrans; // Bare-blind front diffuse-diffuse solar transmittance @@ -6560,18 +6603,18 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) Real64 AbsShade = POLYF(CosInc, state.dataConstruction->Construct(ConstrNumSh) .AbsBeamShadeCoef); // Interior shade or blind beam solar absorptance - state.dataSolarShading->ExtBeamAbsByShadFac(SurfNum) = + state.dataSolarShading->SurfWinExtBeamAbsByShadFac(SurfNum) = (AbsShade * CosInc * SunLitFract * InOutProjSLFracMult + state.dataSurface->SurfWinOutsRevealDiffOntoGlazing(SurfNum) * state.dataConstruction->Construct(ConstrNumSh).AbsDiffShade) * state.dataSurface->SurfWinGlazedFrac(SurfNum); // In the above, GlazedFrac corrects for shadowing of divider onto interior shade } else if (ShadeFlag == WinShadingType::ExtShade) { // Exterior beam absorbed by EXTERIOR SHADE - state.dataSolarShading->ExtBeamAbsByShadFac(SurfNum) = + state.dataSolarShading->SurfWinExtBeamAbsByShadFac(SurfNum) = state.dataConstruction->Construct(ConstrNumSh).AbsDiffShade * CosInc * SunLitFract; } else if (ShadeFlag == WinShadingType::BGShade) { // Exterior beam absorbed by BETWEEN-GLASS SHADE Real64 AbsShade = POLYF(CosInc, state.dataConstruction->Construct(ConstrNumSh).AbsBeamShadeCoef); - state.dataSolarShading->ExtBeamAbsByShadFac(SurfNum) = + state.dataSolarShading->SurfWinExtBeamAbsByShadFac(SurfNum) = AbsShade * CosInc * SunLitFract + state.dataSurface->SurfWinOutsRevealDiffOntoGlazing(SurfNum) * state.dataConstruction->Construct(ConstrNumSh).AbsDiffShade; } @@ -6607,7 +6650,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) (AbsBlDiffFront + RhoBlDiffFront * RGlDiffBack * AbsBlDiffFront / (1.0 - RhoBlDiffFront * RGlDiffBack)); // Interior shade or blind diffuse solar absorptance - state.dataSolarShading->ExtBeamAbsByShadFac(SurfNum) = + state.dataSolarShading->SurfWinExtBeamAbsByShadFac(SurfNum) = (AbsShade * CosInc * SunLitFract * InOutProjSLFracMult + state.dataSurface->SurfWinOutsRevealDiffOntoGlazing(SurfNum) * AbsShadeDiff) * state.dataSurface->SurfWinGlazedFrac(SurfNum); @@ -6643,9 +6686,9 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) Real64 AbsShade = AbsBlFront + AbsBlBack * RGlFront * TBlBmBm + (AbsBlDiffBack * RGlDiffFront / (1.0 - RhoBlDiffBack * RGlDiffFront)) * (RGlFront * TBlBmBm * RhoBlBack + TBlBmDiff); - state.dataSolarShading->ExtBeamAbsByShadFac(SurfNum) = AbsShade * CosInc * SunLitFract * InOutProjSLFracMult; + state.dataSolarShading->SurfWinExtBeamAbsByShadFac(SurfNum) = AbsShade * CosInc * SunLitFract * InOutProjSLFracMult; if (state.dataEnvrn->Month == 7 && state.dataEnvrn->DayOfMonth == 21 && state.dataGlobal->HourOfDay == 8) { - double tst = state.dataSolarShading->ExtBeamAbsByShadFac(SurfNum); + double tst = state.dataSolarShading->SurfWinExtBeamAbsByShadFac(SurfNum); tst = 0; } } else if (ShadeFlag == WinShadingType::ExtScreen) { @@ -6683,7 +6726,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) Real64 AbsScreen = AbsScBeam * (1.0 + TScBmBm * RGlFront) + (AbsScDiffBack * TScBmBm * RGlFront * RGlDiffFront * RScBack / (1.0 - RScDifBack * RGlDiffFront)); // Exterior screen beam solar absorptance - state.dataSolarShading->ExtBeamAbsByShadFac(SurfNum) = AbsScreen * CosInc * SunLitFract * InOutProjSLFracMult; + state.dataSolarShading->SurfWinExtBeamAbsByShadFac(SurfNum) = AbsScreen * CosInc * SunLitFract * InOutProjSLFracMult; } else if (ShadeFlag == WinShadingType::BGBlind) { // Between-glass blind o // Isolated glass and blind properties at current incidence angle, profile angle and slat angle @@ -6777,7 +6820,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) AbsShade = t1t2 * (afshB * (1 + tfshBB * rf3) + afshd * (tfshBd * rfd3 + rfshB * (rbd2 + td2 * rbd1 * td2))); AbsShadeDiff = td1td2 * (afshd + tfshd * rfd3 * abshd + rfshd * (rfd2 + td2 * rbd2 * td2) * afshd); } // End of check if NGlass - state.dataSolarShading->ExtBeamAbsByShadFac(SurfNum) = + state.dataSolarShading->SurfWinExtBeamAbsByShadFac(SurfNum) = AbsShade * CosInc * SunLitFract * InOutProjSLFracMult + state.dataSurface->SurfWinOutsRevealDiffOntoGlazing(SurfNum) * AbsShadeDiff; } // End of check if blind is interior, exterior or between-glass @@ -6845,23 +6888,24 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) // call the ASHWAT fenestration model for optical properties // determine the beam radiation absorptance and tranmittance of the // the equivalent layer window model - WindowEquivalentLayer::CalcEQLOpticalProperty(state, SurfNum, SolarArrays::BEAM, state.dataSolarShading->AbsSolBeamEQL); + WindowEquivalentLayer::CalcEQLOpticalProperty(state, SurfNum, SolarArrays::BEAM, state.dataSolarShading->SurfWinAbsSolBeamEQL); auto &CFS = state.dataWindowEquivLayer->CFS; // recalcuate the diffuse absorptance and transmittance of the // the equivalent layer window model if there is shade control int EQLNum = state.dataConstruction->Construct(state.dataSurface->Surface(SurfNum).Construction) .EQLConsPtr; // equivalent layer fenestration index if (CFS(EQLNum).ISControlled) { - WindowEquivalentLayer::CalcEQLOpticalProperty(state, SurfNum, SolarArrays::DIFF, state.dataSolarShading->AbsSolDiffEQL); + WindowEquivalentLayer::CalcEQLOpticalProperty( + state, SurfNum, SolarArrays::DIFF, state.dataSolarShading->SurfWinAbsSolDiffEQL); } else { - state.dataSolarShading->AbsSolDiffEQL(_, {1, CFS(EQLNum).NL + 1}) = + state.dataSolarShading->SurfWinAbsSolDiffEQL(_, {1, CFS(EQLNum).NL + 1}) = state.dataWindowEquivalentLayer->CFSDiffAbsTrans(_, {1, CFS(EQLNum).NL + 1}, EQLNum); } - state.dataConstruction->Construct(ConstrNum).TransDiff = state.dataSolarShading->AbsSolDiffEQL(1, CFS(EQLNum).NL + 1); + state.dataConstruction->Construct(ConstrNum).TransDiff = state.dataSolarShading->SurfWinAbsSolDiffEQL(1, CFS(EQLNum).NL + 1); for (int Lay = 1; Lay <= CFS(EQLNum).NL + 1; ++Lay) { // Factor for front beam radiation absorbed for equivalent layer window model - Real64 AbWinEQL = state.dataSolarShading->AbsSolBeamEQL(1, Lay) * CosInc * SunLitFract * + Real64 AbWinEQL = state.dataSolarShading->SurfWinAbsSolBeamEQL(1, Lay) * CosInc * SunLitFract * state.dataSurface->SurfaceWindow(SurfNum).InOutProjSLFracMult(state.dataGlobal->HourOfDay); ; if (CFS(EQLNum).L(1).LTYPE != LayerType::GLAZE) { @@ -6871,13 +6915,14 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) // the first layer is a glazing, include the outside reveal reflection // and the inside reveal reflection until indoor shade layer is encountered. if (CFS(EQLNum).L(Lay).LTYPE == LayerType::GLAZE) { - state.dataSurface->SurfWinA(SurfNum, Lay) = - AbWinEQL + - state.dataSurface->SurfWinOutsRevealDiffOntoGlazing(SurfNum) * state.dataSolarShading->AbsSolBeamEQL(1, Lay) + - state.dataSurface->SurfWinInsRevealDiffOntoGlazing(SurfNum) * state.dataSolarShading->AbsSolDiffEQL(2, Lay); + state.dataSurface->SurfWinA(SurfNum, Lay) = AbWinEQL + + state.dataSurface->SurfWinOutsRevealDiffOntoGlazing(SurfNum) * + state.dataSolarShading->SurfWinAbsSolBeamEQL(1, Lay) + + state.dataSurface->SurfWinInsRevealDiffOntoGlazing(SurfNum) * + state.dataSolarShading->SurfWinAbsSolDiffEQL(2, Lay); } else { state.dataSurface->SurfWinA(SurfNum, Lay) = AbWinEQL + state.dataSurface->SurfWinOutsRevealDiffOntoGlazing(SurfNum) * - state.dataSolarShading->AbsSolBeamEQL(1, Lay); + state.dataSolarShading->SurfWinAbsSolBeamEQL(1, Lay); } } } @@ -7032,9 +7077,9 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) // get ASHWAT fenestration model beam-beam and beam-diffuse properties int EQLNum = state.dataConstruction->Construct(state.dataSurface->Surface(SurfNum).Construction) .EQLConsPtr; // equivalent layer fenestration index - Real64 TBmBmEQL = state.dataSolarShading->AbsSolBeamEQL(1, state.dataWindowEquivLayer->CFS(EQLNum).NL + 1); + Real64 TBmBmEQL = state.dataSolarShading->SurfWinAbsSolBeamEQL(1, state.dataWindowEquivLayer->CFS(EQLNum).NL + 1); // Beam-diffuse transmittance - Real64 TBmDiffEQL = max(0.0, state.dataSolarShading->AbsSolBeamEQL(2, state.dataWindowEquivLayer->CFS(EQLNum).NL + 1)); + Real64 TBmDiffEQL = max(0.0, state.dataSolarShading->SurfWinAbsSolBeamEQL(2, state.dataWindowEquivLayer->CFS(EQLNum).NL + 1)); // Beam-beam transmittance: difference between beam-total and beam-diffuse transmittance TBmBmEQL = max(0.0, (TBmBmEQL - TBmDiffEQL)); TBmBm = TBmBmEQL; @@ -7185,77 +7230,77 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) // BLOCK 4 - REPORT WINDOW TRANSMITTANCE //----------------------------------------------------------------- - // The following WinTransBmSolar and WinTransDifSolar will be combined later to give + // The following SurfWinTransBmSolar and SurfWinTransDifSolar will be combined later to give // WinTransSolar for reporting - state.dataSolarShading->WinTransBmSolar(SurfNum) = 0.0; - state.dataSolarShading->WinTransDifSolar(SurfNum) = 0.0; - state.dataSolarShading->WinTransDifSolarGnd(SurfNum) = 0.0; - state.dataSolarShading->WinTransDifSolarSky(SurfNum) = 0.0; - state.dataSolarShading->WinTransBmBmSolar(SurfNum) = + state.dataSolarShading->SurfWinTransBmSolar(SurfNum) = 0.0; + state.dataSolarShading->SurfWinTransDifSolar(SurfNum) = 0.0; + state.dataSolarShading->SurfWinTransDifSolarGnd(SurfNum) = 0.0; + state.dataSolarShading->SurfWinTransDifSolarSky(SurfNum) = 0.0; + state.dataSolarShading->SurfWinTransBmBmSolar(SurfNum) = 0.0; // Factor for exterior beam to beam solar transmitted through window, or window plus shade, into zone at current time (m2) - state.dataSolarShading->WinTransBmDifSolar(SurfNum) = + state.dataSolarShading->SurfWinTransBmDifSolar(SurfNum) = 0.0; // Factor for exterior beam to diffuse solar transmitted through window, or window plus shade, into zone at current time (m2) Real64 InOutProjSLFracMult = state.dataSurface->SurfaceWindow(SurfNum).InOutProjSLFracMult(state.dataGlobal->HourOfDay); if (state.dataSurface->SurfWinWindowModelType(SurfNum) != WindowEQLModel) { - state.dataSolarShading->WinTransDifSolar(SurfNum) = DiffTrans * state.dataSurface->Surface(SurfNum).Area; + state.dataSolarShading->SurfWinTransDifSolar(SurfNum) = DiffTrans * state.dataSurface->Surface(SurfNum).Area; if (ANY_BLIND(ShadeFlag)) { if (state.dataHeatBal->Blind(state.dataSurface->SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { - state.dataSolarShading->WinTransDifSolarGnd(SurfNum) = DiffTransGnd * state.dataSurface->Surface(SurfNum).Area; - state.dataSolarShading->WinTransDifSolarSky(SurfNum) = DiffTransSky * state.dataSurface->Surface(SurfNum).Area; + state.dataSolarShading->SurfWinTransDifSolarGnd(SurfNum) = DiffTransGnd * state.dataSurface->Surface(SurfNum).Area; + state.dataSolarShading->SurfWinTransDifSolarSky(SurfNum) = DiffTransSky * state.dataSurface->Surface(SurfNum).Area; } } } else { // In equivalent layer window model system diffuse transmittance is based on unit // diffuse radiation flux, and hence doesn't distinguish between sky and // ground reflected diffuse radiations - state.dataSolarShading->WinTransDifSolar(SurfNum) = DiffTrans * state.dataSurface->Surface(SurfNum).Area; - state.dataSolarShading->WinTransDifSolarGnd(SurfNum) = DiffTrans * state.dataSurface->Surface(SurfNum).Area; - state.dataSolarShading->WinTransDifSolarSky(SurfNum) = DiffTrans * state.dataSurface->Surface(SurfNum).Area; + state.dataSolarShading->SurfWinTransDifSolar(SurfNum) = DiffTrans * state.dataSurface->Surface(SurfNum).Area; + state.dataSolarShading->SurfWinTransDifSolarGnd(SurfNum) = DiffTrans * state.dataSurface->Surface(SurfNum).Area; + state.dataSolarShading->SurfWinTransDifSolarSky(SurfNum) = DiffTrans * state.dataSurface->Surface(SurfNum).Area; } if (!IS_SHADED_NO_GLARE_CTRL(ShadeFlag) || ShadeFlag == WinShadingType::SwitchableGlazing) { // Unshaded or switchable glazing // Note: with previous defs of TBmBm & TBmDif, these come out right for Complex Fenestration - // WinTransBmSolar uses the directional-hemispherical transmittance - state.dataSolarShading->WinTransBmSolar(SurfNum) = + // SurfWinTransBmSolar uses the directional-hemispherical transmittance + state.dataSolarShading->SurfWinTransBmSolar(SurfNum) = (TBmBm + TBmDif) * SunLitFract * CosInc * state.dataSurface->Surface(SurfNum).Area * InOutProjSLFracMult; - state.dataSolarShading->WinTransBmBmSolar(SurfNum) = + state.dataSolarShading->SurfWinTransBmBmSolar(SurfNum) = TBmBm * SunLitFract * CosInc * state.dataSurface->Surface(SurfNum).Area * InOutProjSLFracMult; // m2 - state.dataSolarShading->WinTransBmDifSolar(SurfNum) = + state.dataSolarShading->SurfWinTransBmDifSolar(SurfNum) = TBmDif * SunLitFract * CosInc * state.dataSurface->Surface(SurfNum).Area * InOutProjSLFracMult; // m2 } else { - state.dataSolarShading->WinTransBmSolar(SurfNum) = + state.dataSolarShading->SurfWinTransBmSolar(SurfNum) = TBmAllShBlSc * SunLitFract * CosInc * state.dataSurface->Surface(SurfNum).Area * InOutProjSLFracMult; - state.dataSolarShading->WinTransBmBmSolar(SurfNum) = + state.dataSolarShading->SurfWinTransBmBmSolar(SurfNum) = TBmBmShBlSc * SunLitFract * CosInc * state.dataSurface->Surface(SurfNum).Area * InOutProjSLFracMult; - state.dataSolarShading->WinTransBmDifSolar(SurfNum) = + state.dataSolarShading->SurfWinTransBmDifSolar(SurfNum) = TBmDifShBlSc * SunLitFract * CosInc * state.dataSurface->Surface(SurfNum).Area * InOutProjSLFracMult; } // Add diffuse transmitted by window from beam reflected from outside reveal if (state.dataSurface->SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { // Complex Fenestration if (FenSolAbsPtr == 0) { - state.dataSolarShading->WinTransBmSolar(SurfNum) = + state.dataSolarShading->SurfWinTransBmSolar(SurfNum) = (TBmBm + TBmDif) * SunLitFract * CosInc * state.dataSurface->Surface(SurfNum).Area * InOutProjSLFracMult; - state.dataSolarShading->WinTransBmBmSolar(SurfNum) = + state.dataSolarShading->SurfWinTransBmBmSolar(SurfNum) = TBmBm * SunLitFract * CosInc * state.dataSurface->Surface(SurfNum).Area * InOutProjSLFracMult; // m2 - state.dataSolarShading->WinTransBmDifSolar(SurfNum) = + state.dataSolarShading->SurfWinTransBmDifSolar(SurfNum) = TBmDif * SunLitFract * CosInc * state.dataSurface->Surface(SurfNum).Area * InOutProjSLFracMult; // m2 - state.dataSolarShading->WinTransBmSolar(SurfNum) += + state.dataSolarShading->SurfWinTransBmSolar(SurfNum) += state.dataSurface->SurfWinOutsRevealDiffOntoGlazing(SurfNum) * NomDiffTrans * state.dataSurface->Surface(SurfNum).Area; - state.dataSolarShading->WinTransBmDifSolar(SurfNum) += + state.dataSolarShading->SurfWinTransBmDifSolar(SurfNum) += state.dataSurface->SurfWinOutsRevealDiffOntoGlazing(SurfNum) * NomDiffTrans * state.dataSurface->Surface(SurfNum).Area; } else { - state.dataSolarShading->WinTransBmSolar(SurfNum) = 0.0; - state.dataSolarShading->WinTransBmDifSolar(SurfNum) = 0.0; + state.dataSolarShading->SurfWinTransBmSolar(SurfNum) = 0.0; + state.dataSolarShading->SurfWinTransBmDifSolar(SurfNum) = 0.0; } } else { // Regular window // this is also valid for equivalent layer window - state.dataSolarShading->WinTransBmSolar(SurfNum) += + state.dataSolarShading->SurfWinTransBmSolar(SurfNum) += state.dataSurface->SurfWinOutsRevealDiffOntoGlazing(SurfNum) * DiffTrans * state.dataSurface->Surface(SurfNum).Area; - state.dataSolarShading->WinTransBmDifSolar(SurfNum) += + state.dataSolarShading->SurfWinTransBmDifSolar(SurfNum) += state.dataSurface->SurfWinOutsRevealDiffOntoGlazing(SurfNum) * DiffTrans * state.dataSurface->Surface(SurfNum).Area; } @@ -7371,14 +7416,14 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) // Loop over back surfaces irradiated by beam from this exterior window for (int IBack = 1; IBack <= state.dataBSDFWindow->MaxBkSurf; ++IBack) { int BackSurfNum = - state.dataHeatBal->BackSurfaces(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, IBack, SurfNum); + state.dataHeatBal->SurfWinBackSurfaces(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, IBack, SurfNum); if (BackSurfNum == 0) break; // No more irradiated back surfaces for this exterior window int ConstrNumBack = state.dataSurface->SurfActiveConstruction(BackSurfNum); int NBackGlass = state.dataConstruction->Construct(ConstrNumBack).TotGlassLayers; // Irradiated (overlap) area for this back surface, projected onto window plane // (includes effect of shadowing on exterior window) Real64 AOverlap = - state.dataHeatBal->OverlapAreas(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, IBack, SurfNum); + state.dataHeatBal->SurfWinOverlapAreas(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, IBack, SurfNum); // Back surface area irradiated by beam solar from an exterior window, projected onto window plane Real64 BOverlap = TBm * AOverlap * CosInc; //[m2] // AOverlap multiplied by exterior window beam transmittance and cosine of incidence angle @@ -7401,7 +7446,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) WinShadingType ShadeFlagBack = state.dataSurface->SurfWinShadingFlag(BackSurfNum); Real64 SlatAngBack = state.dataSurface->SurfWinSlatAngThisTS(BackSurfNum); Real64 CosIncBack = - std::abs(state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, BackSurfNum)); + std::abs(state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, BackSurfNum)); if (state.dataSurface->SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { // Transmitting window is complex fen, change the incident angle to one for ray joining // transmitting and back window centers @@ -7435,7 +7480,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) // Interior beam absorbed by INTERIOR SHADE of back exterior window if (ShadeFlagBack == WinShadingType::IntShade) { - state.dataSolarShading->IntBeamAbsByShadFac(BackSurfNum) = + state.dataSolarShading->SurfWinIntBeamAbsByShadFac(BackSurfNum) = BOverlap * state.dataConstruction->Construct(ConstrNumBackSh).AbsDiffBackShade / (state.dataSurface->Surface(BackSurfNum).Area + state.dataSurface->SurfWinDividerArea(BackSurfNum)); BABSZone += BOverlap * state.dataConstruction->Construct(ConstrNumBackSh).AbsDiffBackShade; @@ -7450,7 +7495,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) Real64 AShBack = POLYF(CosIncBack, state.dataConstruction->Construct(ConstrNumBack).TransSolBeamCoef) * AbsSh / (1.0 - RGlFront * RhoSh); BABSZone += BOverlap * AShBack; - state.dataSolarShading->IntBeamAbsByShadFac(BackSurfNum) = + state.dataSolarShading->SurfWinIntBeamAbsByShadFac(BackSurfNum) = BOverlap * AShBack / (state.dataSurface->Surface(BackSurfNum).Area + state.dataSurface->SurfWinDividerArea(BackSurfNum)); } else if (ShadeFlagBack == @@ -7478,7 +7523,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) Real64 AbsSh = min(1.0, max(0.0, 1 - TrSh - RhoSh)); AShBack = t3k * (1 + RhoSh * rfd3k + TrSh * (rbd2k + td2k * rbd1k * td2k)) * AbsSh; } - state.dataSolarShading->IntBeamAbsByShadFac(BackSurfNum) = + state.dataSolarShading->SurfWinIntBeamAbsByShadFac(BackSurfNum) = BOverlap * AShBack / state.dataSurface->Surface(BackSurfNum).Area; BABSZone += BOverlap * AShBack; } @@ -7608,7 +7653,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) (AbsBlDiffFront * RGlDiffBack / (1 - RhoBlDiffFront * RGlDiffBack)) * (RGlBack * TBlBmBmBack * RhoBlFront + TBlBmDiffBack); // Blind solar back absorptance for interior solar - state.dataSolarShading->IntBeamAbsByShadFac(BackSurfNum) = + state.dataSolarShading->SurfWinIntBeamAbsByShadFac(BackSurfNum) = BOverlap * ABlBack / (state.dataSurface->Surface(BackSurfNum).Area + state.dataSurface->SurfWinDividerArea(BackSurfNum)); BABSZone += BOverlap * ABlBack; @@ -7678,7 +7723,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) TBlDifDif * RhoBlBmDifBk * RGlDifFr / (1.0 - RhoBlDifDifBk * RGlDifFr)); // Interior beam absorbed by EXTERIOR BLIND on exterior back window BABSZone += BOverlap * ABlBack; - state.dataSolarShading->IntBeamAbsByShadFac(BackSurfNum) = + state.dataSolarShading->SurfWinIntBeamAbsByShadFac(BackSurfNum) = BOverlap * ABlBack / (state.dataSurface->Surface(BackSurfNum).Area + state.dataSurface->SurfWinDividerArea(BackSurfNum)); @@ -7853,7 +7898,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) } BABSZone += BOverlap * ABlBack; - state.dataSolarShading->IntBeamAbsByShadFac(BackSurfNum) = + state.dataSolarShading->SurfWinIntBeamAbsByShadFac(BackSurfNum) = BOverlap * ABlBack / state.dataSurface->Surface(BackSurfNum).Area; } // End of check if between-glass blind is on back window @@ -7897,7 +7942,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) (AbsScBack + RScBack * RGlDiffFront * AbsScDiffBack / (1.0 - RScDiffBack * RGlDiffFront)); // Screen solar back absorptance for interior solar BABSZone += BOverlap * AScBack; - state.dataSolarShading->IntBeamAbsByShadFac(BackSurfNum) = + state.dataSolarShading->SurfWinIntBeamAbsByShadFac(BackSurfNum) = BOverlap * AScBack / (state.dataSurface->Surface(BackSurfNum).Area + state.dataSurface->SurfWinDividerArea(BackSurfNum)); @@ -8107,7 +8152,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) for (int IBack = 1; IBack <= state.dataBSDFWindow->MaxBkSurf; ++IBack) { int BackSurfNum = - state.dataHeatBal->BackSurfaces(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, IBack, SurfNum); + state.dataHeatBal->SurfWinBackSurfaces(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, IBack, SurfNum); if (BackSurfNum == 0) break; // No more irradiated back surfaces for this exterior window if (state.dataSurface->SurfWinWindowModelType(IBack) != WindowEQLModel) continue; // only EQL back window is allowed @@ -8117,7 +8162,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) // (includes effect of shadowing on exterior window) Real64 AOverlap = - state.dataHeatBal->OverlapAreas(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, IBack, SurfNum); + state.dataHeatBal->SurfWinOverlapAreas(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, IBack, SurfNum); Real64 BOverlap = TBm * AOverlap * CosInc; //[m2] if (state.dataConstruction->Construct(ConstrNumBack).TransDiff <= 0.0) { @@ -8144,26 +8189,26 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) // call the ASHWAT fenestration model for beam radiation here WindowEquivalentLayer::CalcEQLOpticalProperty( - state, BackSurfNum, SolarArrays::BEAM, state.dataSolarShading->AbsSolBeamBackEQL); + state, BackSurfNum, SolarArrays::BEAM, state.dataSolarShading->SurfWinAbsSolBeamBackEQL); auto &CFS = state.dataWindowEquivLayer->CFS; int EQLNum = state.dataConstruction->Construct(ConstrNumBack).EQLConsPtr; state.dataSolarShading->AbsBeamWinEQL({1, CFS(EQLNum).NL}) = - state.dataSolarShading->AbsSolBeamBackEQL(1, {1, CFS(EQLNum).NL}); + state.dataSolarShading->SurfWinAbsSolBeamBackEQL(1, {1, CFS(EQLNum).NL}); // get the interior beam transmitted through back exterior or interior EQL window - TransBeamWin = state.dataSolarShading->AbsSolBeamBackEQL(1, CFS(EQLNum).NL + 1); + TransBeamWin = state.dataSolarShading->SurfWinAbsSolBeamBackEQL(1, CFS(EQLNum).NL + 1); // Absorbed by the interior shade layer of back exterior window if (CFS(EQLNum).L(CFS(EQLNum).NL).LTYPE != LayerType::GLAZE) { - state.dataSolarShading->IntBeamAbsByShadFac(BackSurfNum) = - BOverlap * state.dataSolarShading->AbsSolBeamBackEQL(1, CFS(EQLNum).NL) / + state.dataSolarShading->SurfWinIntBeamAbsByShadFac(BackSurfNum) = + BOverlap * state.dataSolarShading->SurfWinAbsSolBeamBackEQL(1, CFS(EQLNum).NL) / (state.dataSurface->Surface(BackSurfNum).Area + state.dataSurface->SurfWinDividerArea(BackSurfNum)); - BABSZone += BOverlap * state.dataSolarShading->AbsSolBeamBackEQL(1, CFS(EQLNum).NL); + BABSZone += BOverlap * state.dataSolarShading->SurfWinAbsSolBeamBackEQL(1, CFS(EQLNum).NL); } // Absorbed by the exterior shade layer of back exterior window if (CFS(EQLNum).L(1).LTYPE != LayerType::GLAZE) { - state.dataSolarShading->IntBeamAbsByShadFac(BackSurfNum) = - BOverlap * state.dataSolarShading->AbsSolBeamBackEQL(1, 1) / + state.dataSolarShading->SurfWinIntBeamAbsByShadFac(BackSurfNum) = + BOverlap * state.dataSolarShading->SurfWinAbsSolBeamBackEQL(1, 1) / (state.dataSurface->Surface(BackSurfNum).Area + state.dataSurface->SurfWinDividerArea(BackSurfNum)); - BABSZone += BOverlap * state.dataSolarShading->AbsSolBeamBackEQL(1, 1); + BABSZone += BOverlap * state.dataSolarShading->SurfWinAbsSolBeamBackEQL(1, 1); } // determine the number of glass layers @@ -8177,10 +8222,10 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) for (int Lay = 2; Lay <= CFS(EQLNum).NL - 1; ++Lay) { if (CFS(EQLNum).L(CFS(EQLNum).NL).LTYPE != LayerType::GLAZE) { // if there is in between shade glass determine the shade absorptance - state.dataSolarShading->IntBeamAbsByShadFac(BackSurfNum) += - BOverlap * state.dataSolarShading->AbsSolBeamBackEQL(1, Lay) / + state.dataSolarShading->SurfWinIntBeamAbsByShadFac(BackSurfNum) += + BOverlap * state.dataSolarShading->SurfWinAbsSolBeamBackEQL(1, Lay) / state.dataSurface->Surface(BackSurfNum).Area; - BABSZone += BOverlap * state.dataSolarShading->AbsSolBeamBackEQL(1, Lay); + BABSZone += BOverlap * state.dataSolarShading->SurfWinAbsSolBeamBackEQL(1, Lay); } } } @@ -8223,7 +8268,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) for (int const FloorNum : thisEnclosure.SurfacePtr) { // In following, ISABSF is zero except for nominal floor surfaces - if (state.dataSolarShading->ISABSF(FloorNum) <= 0.0 || FloorNum == SurfNum) continue; // Keep only floor surfaces + if (state.dataSolarShading->SurfIntAbsFac(FloorNum) <= 0.0 || FloorNum == SurfNum) continue; // Keep only floor surfaces int const FlConstrNum = state.dataSurface->SurfActiveConstruction(FloorNum); Real64 BTOTWinZone = TBm * SunLitFract * state.dataSurface->Surface(SurfNum).Area * CosInc * InOutProjSLFracMult; //[m2] @@ -8232,7 +8277,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) if (state.dataConstruction->Construct(FlConstrNum).TransDiff <= 0.0) { // Opaque surface state.dataSurface->SurfOpaqAI(FloorNum) += - BTOTWinZone * state.dataSolarShading->ISABSF(FloorNum) / state.dataSurface->Surface(FloorNum).Area; //[-] + BTOTWinZone * state.dataSolarShading->SurfIntAbsFac(FloorNum) / state.dataSurface->Surface(FloorNum).Area; //[-] } else { // Window @@ -8252,13 +8297,13 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) // (see ComputeIntSolarAbsorpFactors). for (int Lay = 1; Lay <= state.dataConstruction->Construct(FlConstrNum).TotGlassLayers; ++Lay) { - state.dataSurface->SurfWinA(FloorNum, Lay) += state.dataConstruction->Construct(FlConstrNum).AbsDiffBack(Lay) / - AbsBeamTotWin * BTOTWinZone * state.dataSolarShading->ISABSF(FloorNum) / - state.dataSurface->Surface(FloorNum).Area; //[-] + state.dataSurface->SurfWinA(FloorNum, Lay) += + state.dataConstruction->Construct(FlConstrNum).AbsDiffBack(Lay) / AbsBeamTotWin * BTOTWinZone * + state.dataSolarShading->SurfIntAbsFac(FloorNum) / state.dataSurface->Surface(FloorNum).Area; //[-] } } - BABSZone += BTOTWinZone * state.dataSolarShading->ISABSF(FloorNum); //[m2] + BABSZone += BTOTWinZone * state.dataSolarShading->SurfIntAbsFac(FloorNum); //[m2] int AdjSurfNum = state.dataSurface->Surface(FloorNum).ExtBoundCond; if (state.dataConstruction->Construct(FlConstrNum).TransDiff > 0.0 && AdjSurfNum > 0) { @@ -8269,11 +8314,11 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) // Contribution (assumed diffuse) to adjacent zone of beam radiation passing // through this window - state.dataHeatBal->EnclSolDBIntWin(adjEnclosureNum) += BTOTWinZone * state.dataSolarShading->ISABSF(FloorNum) * + state.dataHeatBal->EnclSolDBIntWin(adjEnclosureNum) += BTOTWinZone * state.dataSolarShading->SurfIntAbsFac(FloorNum) * state.dataConstruction->Construct(FlConstrNum).TransDiff / AbsBeamTotWin; - BABSZone += BTOTWinZone * state.dataSolarShading->ISABSF(FloorNum) * + BABSZone += BTOTWinZone * state.dataSolarShading->SurfIntAbsFac(FloorNum) * state.dataConstruction->Construct(FlConstrNum).TransDiff / AbsBeamTotWin; } @@ -8317,7 +8362,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) state.dataHeatBal->SurfBmIncInsSurfAmountRep(SurfNum) / (state.dataSurface->Surface(SurfNum).Area + state.dataSurface->SurfWinDividerArea(SurfNum)); } else { // Simple interior solar distribution. All beam falls on floor. - if (state.dataSolarShading->ISABSF(SurfNum) > 0.0 && state.dataSurface->Surface(SurfNum).HeatTransSurf) { + if (state.dataSolarShading->SurfIntAbsFac(SurfNum) > 0.0 && state.dataSurface->Surface(SurfNum).HeatTransSurf) { if (thisEnclosure.FloorArea > 0.0) { // spread onto all floor surfaces, these may or may not be called "floor" state.dataHeatBal->SurfBmIncInsSurfIntensRep(SurfNum) = state.dataEnvrn->BeamSolarRad * BTOTZone / thisEnclosure.FloorArea; @@ -8337,9 +8382,9 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) if (state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Window || state.dataSurface->Surface(SurfNum).Class == SurfaceClass::TDD_Dome) { - state.dataSurface->SurfWinIntBeamAbsByShade(SurfNum) = state.dataSolarShading->IntBeamAbsByShadFac(SurfNum); + state.dataSurface->SurfWinIntBeamAbsByShade(SurfNum) = state.dataSolarShading->SurfWinIntBeamAbsByShadFac(SurfNum); state.dataSurface->SurfWinExtBeamAbsByShade(SurfNum) = - state.dataEnvrn->BeamSolarRad * state.dataSolarShading->ExtBeamAbsByShadFac(SurfNum); + state.dataEnvrn->BeamSolarRad * state.dataSolarShading->SurfWinExtBeamAbsByShadFac(SurfNum); if ((state.dataSurface->Surface(SurfNum).ExtBoundCond == ExternalEnvironment) || (state.dataSurface->Surface(SurfNum).ExtBoundCond == OtherSideCondModeledExt)) { @@ -8355,19 +8400,20 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) if (state.dataSurface->SurfWinOriginalClass(SurfNum) == SurfaceClass::TDD_Diffuser) { int PipeNum = state.dataSurface->SurfWinTDDPipeNum(SurfNum); int SurfNum2 = state.dataDaylightingDevicesData->TDDPipe(PipeNum).Dome; - Real64 CosInc = state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum2); + Real64 CosInc = state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum2); // Exterior diffuse solar incident on window (W/m2) - Real64 DifSolarInc = state.dataEnvrn->DifSolarRad * state.dataHeatBal->SurfAnisoSkyMult(SurfNum2) + + Real64 DifSolarInc = state.dataEnvrn->DifSolarRad * state.dataSolarShading->SurfAnisoSkyMult(SurfNum2) + state.dataEnvrn->GndSolarRad * state.dataSurface->Surface(SurfNum2).ViewFactorGround; // Exterior diffuse sky solar transmitted by TDD (W/m2) Real64 SkySolarTrans = state.dataEnvrn->DifSolarRad * TransTDD(state, PipeNum, CosInc, DataDaylightingDevices::iRadType::SolarAniso) * - state.dataHeatBal->SurfAnisoSkyMult(SurfNum2); + state.dataSolarShading->SurfAnisoSkyMult(SurfNum2); // Exterior diffuse ground solar transmitted by TDD (W/m2) Real64 GndSolarTrans = state.dataEnvrn->GndSolarRad * state.dataDaylightingDevicesData->TDDPipe(PipeNum).TransSolIso * state.dataSurface->Surface(SurfNum2).ViewFactorGround; - state.dataSurface->SurfWinBmSolar(SurfNum) = state.dataEnvrn->BeamSolarRad * state.dataSolarShading->WinTransBmSolar(SurfNum); + state.dataSurface->SurfWinBmSolar(SurfNum) = + state.dataEnvrn->BeamSolarRad * state.dataSolarShading->SurfWinTransBmSolar(SurfNum); state.dataSurface->SurfWinDifSolar(SurfNum) = SkySolarTrans * state.dataSurface->Surface(SurfNum).Area + GndSolarTrans * state.dataSurface->Surface(SurfNum).Area; state.dataSurface->SurfWinBmSolarEnergy(SurfNum) = @@ -8391,17 +8437,18 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) } else if (OutShelfSurf > 0) { // Outside daylighting shelf Real64 ShelfSolarRad = (state.dataEnvrn->BeamSolarRad * - state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, OutShelfSurf) * - state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, OutShelfSurf) + - state.dataEnvrn->DifSolarRad * state.dataHeatBal->SurfAnisoSkyMult(OutShelfSurf)) * + state.dataHeatBal->SurfSunlitFrac(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, OutShelfSurf) * + state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, OutShelfSurf) + + state.dataEnvrn->DifSolarRad * state.dataSolarShading->SurfAnisoSkyMult(OutShelfSurf)) * state.dataDaylightingDevicesData->Shelf(ShelfNum).OutReflectSol; - Real64 DifSolarInc = state.dataEnvrn->DifSolarRad * state.dataHeatBal->SurfAnisoSkyMult(SurfNum) + + Real64 DifSolarInc = state.dataEnvrn->DifSolarRad * state.dataSolarShading->SurfAnisoSkyMult(SurfNum) + state.dataEnvrn->GndSolarRad * state.dataSurface->Surface(SurfNum).ViewFactorGround + ShelfSolarRad * state.dataDaylightingDevicesData->Shelf(ShelfNum).ViewFactor; - state.dataSurface->SurfWinBmSolar(SurfNum) = state.dataEnvrn->BeamSolarRad * state.dataSolarShading->WinTransBmSolar(SurfNum); - state.dataSurface->SurfWinDifSolar(SurfNum) = DifSolarInc * state.dataSolarShading->WinTransDifSolar(SurfNum); + state.dataSurface->SurfWinBmSolar(SurfNum) = + state.dataEnvrn->BeamSolarRad * state.dataSolarShading->SurfWinTransBmSolar(SurfNum); + state.dataSurface->SurfWinDifSolar(SurfNum) = DifSolarInc * state.dataSolarShading->SurfWinTransDifSolar(SurfNum); state.dataSurface->SurfWinBmSolarEnergy(SurfNum) = state.dataSurface->SurfWinBmSolar(SurfNum) * state.dataGlobal->TimeStepZoneSec; state.dataSurface->SurfWinDifSolarEnergy(SurfNum) = @@ -8416,19 +8463,20 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) Real64 SkySolarInc = state.dataSurface->SurfSkySolarInc(SurfNum); Real64 GndSolarInc = state.dataSurface->SurfGndSolarInc(SurfNum); Real64 DifSolarInc = SkySolarInc + GndSolarInc; - state.dataSurface->SurfWinBmSolar(SurfNum) = state.dataEnvrn->BeamSolarRad * state.dataSolarShading->WinTransBmSolar(SurfNum); - // Note: for complex fenestration, WinTransDifSolar has previously been defined using the effective + state.dataSurface->SurfWinBmSolar(SurfNum) = + state.dataEnvrn->BeamSolarRad * state.dataSolarShading->SurfWinTransBmSolar(SurfNum); + // Note: for complex fenestration, SurfWinTransDifSolar has previously been defined using the effective // transmittance for sky and ground diffuse radiation (including beam radiation reflected from the ground) // so these calculations should be correct - state.dataSurface->SurfWinDifSolar(SurfNum) = DifSolarInc * state.dataSolarShading->WinTransDifSolar(SurfNum); + state.dataSurface->SurfWinDifSolar(SurfNum) = DifSolarInc * state.dataSolarShading->SurfWinTransDifSolar(SurfNum); state.dataSurface->SurfWinBmSolarEnergy(SurfNum) = state.dataSurface->SurfWinBmSolar(SurfNum) * state.dataGlobal->TimeStepZoneSec; state.dataSurface->SurfWinDifSolarEnergy(SurfNum) = state.dataSurface->SurfWinDifSolar(SurfNum) * state.dataGlobal->TimeStepZoneSec; if (ANY_BLIND(ShadeFlag)) { if (state.dataHeatBal->Blind(state.dataSurface->SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { - state.dataSurface->SurfWinDifSolar(SurfNum) = SkySolarInc * state.dataSolarShading->WinTransDifSolarSky(SurfNum) + - GndSolarInc * state.dataSolarShading->WinTransDifSolarGnd(SurfNum); + state.dataSurface->SurfWinDifSolar(SurfNum) = SkySolarInc * state.dataSolarShading->SurfWinTransDifSolarSky(SurfNum) + + GndSolarInc * state.dataSolarShading->SurfWinTransDifSolarGnd(SurfNum); state.dataSurface->SurfWinDifSolarEnergy(SurfNum) = state.dataSurface->SurfWinDifSolar(SurfNum) * state.dataGlobal->TimeStepZoneSec; } @@ -8441,10 +8489,11 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) } // added TH 12/9/2009, CR 7907 & 7809 - state.dataSurface->SurfWinBmBmSolar(SurfNum) = state.dataEnvrn->BeamSolarRad * state.dataSolarShading->WinTransBmBmSolar(SurfNum); + state.dataSurface->SurfWinBmBmSolar(SurfNum) = + state.dataEnvrn->BeamSolarRad * state.dataSolarShading->SurfWinTransBmBmSolar(SurfNum); state.dataSurface->SurfWinBmDifSolar(SurfNum) = - state.dataEnvrn->BeamSolarRad * state.dataSolarShading->WinTransBmDifSolar(SurfNum); + state.dataEnvrn->BeamSolarRad * state.dataSolarShading->SurfWinTransBmDifSolar(SurfNum); state.dataSurface->SurfWinBmBmSolarEnergy(SurfNum) = state.dataSurface->SurfWinBmBmSolar(SurfNum) * state.dataGlobal->TimeStepZoneSec; state.dataSurface->SurfWinBmDifSolarEnergy(SurfNum) = @@ -8504,8 +8553,8 @@ void CalcAbsorbedOnExteriorOpaqueSurfaces(EnergyPlusData &state) int PipeNum = state.dataSurface->SurfWinTDDPipeNum(SurfNum); SurfNum2 = state.dataDaylightingDevicesData->TDDPipe(PipeNum).Dome; } - Real64 CosInc = state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum2); - Real64 SunLitFract = state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum2); + Real64 CosInc = state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum2); + Real64 SunLitFract = state.dataHeatBal->SurfSunlitFrac(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum2); //------------------------------------------------------------------------- // EXTERIOR BEAM SOLAR RADIATION ABSORBED ON THE OUTSIDE OF OPAQUE SURFACES @@ -8536,16 +8585,21 @@ void CalcInteriorSolarDistributionWCESimple(EnergyPlusData &state) using ScheduleManager::GetCurrentScheduleValue; using namespace MultiLayerOptics; - // TODO - allocation - state.dataHeatBal->EnclSolDB = 0.0; - state.dataHeatBal->EnclSolDBIntWin = 0.0; - state.dataSurface->SurfOpaqAI = 0.0; - state.dataSurface->SurfOpaqAO = 0.0; + for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { + int const firstSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceFirst; + int const lastSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceLast; + for (int surfNum = firstSurf; surfNum <= lastSurf; ++surfNum) { + state.dataSurface->SurfOpaqAI(surfNum) = 0.0; + state.dataSurface->SurfOpaqAO(surfNum) = 0.0; + } + } for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclosureNum) { Real64 BABSZone = 0; Real64 BTOTZone = 0; + state.dataHeatBal->EnclSolDB(enclosureNum) = 0.0; + state.dataHeatBal->EnclSolDBIntWin(enclosureNum) = 0.0; state.dataHeatBal->ZoneTransSolar(enclosureNum) = 0; state.dataHeatBal->ZoneTransSolarEnergy(enclosureNum) = 0; state.dataHeatBal->ZoneBmSolFrExtWinsRep(enclosureNum) = 0; @@ -8564,8 +8618,8 @@ void CalcInteriorSolarDistributionWCESimple(EnergyPlusData &state) SurfNum2 = SurfNum; } auto &window = state.dataSurface->SurfaceWindow(SurfNum2); - Real64 CosInc = state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum2); // Note: surfnum 2 - Real64 SunLitFract = state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum2); + Real64 CosInc = state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum2); // Note: surfnum 2 + Real64 SunLitFract = state.dataHeatBal->SurfSunlitFrac(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum2); std::pair incomingAngle = getSunWCEAngles(state, SurfNum2, BSDFHemisphere::Incoming); Real64 Theta = incomingAngle.first; @@ -8579,7 +8633,7 @@ void CalcInteriorSolarDistributionWCESimple(EnergyPlusData &state) /////////////////////////////////////////////// // Solar absorbed in window layers /////////////////////////////////////////////// - if (state.dataHeatBal->SunlitFracWithoutReveal(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum2) > 0.0) { + if (state.dataHeatBal->SurfSunlitFracWithoutReveal(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum2) > 0.0) { auto numOfLayers = aLayer->getNumOfLayers(); if (state.dataSurface->SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { auto CurrentState = state.dataSurface->SurfaceWindow(SurfNum).ComplexFen.CurrentState; @@ -8645,11 +8699,11 @@ void CalcInteriorSolarDistributionWCESimple(EnergyPlusData &state) //////////////////////////////////////////////////////////////////// Real64 TBmBm = aLayer->getPropertySimple(PropertySimple::T, Side::Front, Scattering::DirectDirect, Theta, Phi); Real64 TBmDif = aLayer->getPropertySimple(PropertySimple::T, Side::Front, Scattering::DirectDiffuse, Theta, Phi); - Real64 WinTransBmBmSolar = + Real64 SurfWinTransBmBmSolar = TBmBm * SunLitFract * CosInc * state.dataSurface->Surface(SurfNum).Area * window.InOutProjSLFracMult(state.dataGlobal->HourOfDay); - Real64 WinTransBmDifSolar = + Real64 SurfWinTransBmDifSolar = TBmDif * SunLitFract * CosInc * state.dataSurface->Surface(SurfNum).Area * window.InOutProjSLFracMult(state.dataGlobal->HourOfDay); - BTOTZone += WinTransBmBmSolar + WinTransBmDifSolar; + BTOTZone += SurfWinTransBmBmSolar + SurfWinTransBmDifSolar; Real64 DifSolarRadiation = state.dataSurface->SurfSkySolarInc(SurfNum2) + state.dataSurface->SurfGndSolarInc(SurfNum2); state.dataSurface->SurfWinBmSolar(SurfNum) = @@ -8687,14 +8741,15 @@ void CalcInteriorSolarDistributionWCESimple(EnergyPlusData &state) if (state.dataHeatBal->SolarDistribution == FullInteriorExterior) { for (int IBack = 1; IBack <= NumOfBackSurf; ++IBack) { - int const BackSurfNum = state.dataHeatBal->BackSurfaces(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, IBack, SurfNum); + int const BackSurfNum = + state.dataHeatBal->SurfWinBackSurfaces(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, IBack, SurfNum); if (BackSurfNum == 0) break; // No more irradiated back surfaces for this exterior window int ConstrNumBack = state.dataSurface->Surface(BackSurfNum).Construction; // NBackGlass = Construct( ConstrNumBack ).TotGlassLayers; // Irradiated (overlap) area for this back surface, projected onto window plane // (includes effect of shadowing on exterior window) - Real64 AOverlap = state.dataHeatBal->OverlapAreas(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, IBack, SurfNum); + Real64 AOverlap = state.dataHeatBal->SurfWinOverlapAreas(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, IBack, SurfNum); Real64 BOverlap = TBm * AOverlap * CosInc; //[m2] if (state.dataConstruction->Construct(ConstrNumBack).TransDiff <= 0.0) { @@ -8709,7 +8764,7 @@ void CalcInteriorSolarDistributionWCESimple(EnergyPlusData &state) for (int const FloorNum : thisEnclosure.SurfacePtr) { // In following, ISABSF is zero except for nominal floor surfaces if (!state.dataSurface->Surface(FloorNum).HeatTransSurf) continue; - if (state.dataSolarShading->ISABSF(FloorNum) <= 0.0 || FloorNum == SurfNum) continue; // Keep only floor surfaces + if (state.dataSolarShading->SurfIntAbsFac(FloorNum) <= 0.0 || FloorNum == SurfNum) continue; // Keep only floor surfaces Real64 BTOTWinZone = TBm * SunLitFract * state.dataSurface->Surface(SurfNum).Area * CosInc * window.InOutProjSLFracMult(state.dataGlobal->HourOfDay); //[m2] @@ -8717,7 +8772,7 @@ void CalcInteriorSolarDistributionWCESimple(EnergyPlusData &state) if (state.dataConstruction->Construct(state.dataSurface->Surface(FloorNum).Construction).TransDiff <= 0.0) { // Opaque surface state.dataSurface->SurfOpaqAI(FloorNum) += - BTOTWinZone * state.dataSolarShading->ISABSF(FloorNum) / state.dataSurface->Surface(FloorNum).Area; //[-] + BTOTWinZone * state.dataSolarShading->SurfIntAbsFac(FloorNum) / state.dataSurface->Surface(FloorNum).Area; //[-] } } } @@ -8965,7 +9020,7 @@ void SHDRVL(EnergyPlusData &state, RevealStatusSet = false; if (!state.dataSolarShading->CalcSkyDifShading) { - state.dataSolarShading->WindowRevealStatus(TS, Hour, SBSNR) = None; + state.dataSolarShading->SurfWinRevealStatus(Hour, TS, SBSNR) = None; } R = state.dataSurface->Surface(SBSNR).Reveal; @@ -9102,17 +9157,18 @@ void SHDRVL(EnergyPlusData &state, A += state.dataSolarShading->HCAREA(state.dataSolarShading->FRVLHC - 1 + I) * (1.0 - state.dataSolarShading->HCT(state.dataSolarShading->FRVLHC - 1 + I)); } - state.dataSolarShading->SAREA(HTSS) = A; + state.dataSolarShading->SurfSunlitArea(HTSS) = A; } - if ((RevealStatus == EntireWindowShadedByReveal) || (state.dataSolarShading->SAREA(HTSS) < 0.0)) { - state.dataSolarShading->SAREA(HTSS) = 0.0; // Window entirely shaded by reveal. + if ((RevealStatus == EntireWindowShadedByReveal) || (state.dataSolarShading->SurfSunlitArea(HTSS) < 0.0)) { + state.dataSolarShading->SurfSunlitArea(HTSS) = 0.0; // Window entirely shaded by reveal. } else if (RevealStatus == WindowShadedOnlyByReveal) { - state.dataSolarShading->SAREA(HTSS) = state.dataSolarShading->HCAREA(state.dataSolarShading->FRVLHC); // Window shaded only by reveal. + state.dataSolarShading->SurfSunlitArea(HTSS) = + state.dataSolarShading->HCAREA(state.dataSolarShading->FRVLHC); // Window shaded only by reveal. } if (!state.dataSolarShading->CalcSkyDifShading) { - state.dataSolarShading->WindowRevealStatus(TS, Hour, SBSNR) = RevealStatus; + state.dataSolarShading->SurfWinRevealStatus(Hour, TS, SBSNR) = RevealStatus; } } @@ -9170,7 +9226,8 @@ void SHDSBS(EnergyPlusData &state, if (!state.dataSolarShading->penumbra) { if ((state.dataSolarShading->OverlapStatus != state.dataSolarShading->TooManyVertices) && - (state.dataSolarShading->OverlapStatus != state.dataSolarShading->TooManyFigures) && (state.dataSolarShading->SAREA(HTS) > 0.0)) { + (state.dataSolarShading->OverlapStatus != state.dataSolarShading->TooManyFigures) && + (state.dataSolarShading->SurfSunlitArea(HTS) > 0.0)) { // Re-order vertices to clockwise sequential; compute homogeneous coordinates. state.dataSolarShading->NVS = state.dataSurface->Surface(SBSNR).Sides; @@ -9195,16 +9252,17 @@ void SHDSBS(EnergyPlusData &state, if ((state.dataSolarShading->OverlapStatus == state.dataSolarShading->TooManyVertices) || (state.dataSolarShading->OverlapStatus == state.dataSolarShading->TooManyFigures) || - (state.dataSolarShading->SAREA(HTS) <= 0.0)) { // General receiving surface totally shaded. + (state.dataSolarShading->SurfSunlitArea(HTS) <= 0.0)) { // General receiving surface totally shaded. - state.dataSolarShading->SAREA(HTSS) = 0.0; + state.dataSolarShading->SurfSunlitArea(HTSS) = 0.0; - if (iHour > 0 && TS > 0) state.dataHeatBal->SunlitFracWithoutReveal(TS, iHour, HTSS) = 0.0; + if (iHour > 0 && TS > 0) state.dataHeatBal->SurfSunlitFracWithoutReveal(iHour, TS, HTSS) = 0.0; } else if ((state.dataSolarShading->NGSSHC <= 0) || (state.dataSolarShading->NSBSHC == 1)) { // No shadows. - state.dataSolarShading->SAREA(HTSS) = state.dataSolarShading->HCAREA(state.dataSolarShading->FSBSHC); - state.dataSolarShading->SAREA(HTS) -= state.dataSolarShading->SAREA(HTSS); // Revise sunlit area of general receiving surface. + state.dataSolarShading->SurfSunlitArea(HTSS) = state.dataSolarShading->HCAREA(state.dataSolarShading->FSBSHC); + state.dataSolarShading->SurfSunlitArea(HTS) -= + state.dataSolarShading->SurfSunlitArea(HTSS); // Revise sunlit area of general receiving surface. // TH. This is a bug. SunLitFracWithoutReveal should be a ratio of area // IF(IHour > 0 .AND. TS > 0) SunLitFracWithoutReveal(HTSS,IHour,TS) = & @@ -9212,14 +9270,14 @@ void SHDSBS(EnergyPlusData &state, // new code fixed part of CR 7596. TH 5/29/2009 if (iHour > 0 && TS > 0) - state.dataHeatBal->SunlitFracWithoutReveal(TS, iHour, HTSS) = - state.dataSolarShading->SAREA(HTSS) / state.dataSurface->Surface(HTSS).NetAreaShadowCalc; + state.dataHeatBal->SurfSunlitFracWithoutReveal(iHour, TS, HTSS) = + state.dataSolarShading->SurfSunlitArea(HTSS) / state.dataSurface->Surface(HTSS).NetAreaShadowCalc; SHDRVL(state, HTSS, SBSNR, iHour, TS); // Determine shadowing from reveal. if ((state.dataSolarShading->OverlapStatus == state.dataSolarShading->TooManyVertices) || (state.dataSolarShading->OverlapStatus == state.dataSolarShading->TooManyFigures)) - state.dataSolarShading->SAREA(HTSS) = 0.0; + state.dataSolarShading->SurfSunlitArea(HTSS) = 0.0; } else { // Compute area. @@ -9228,24 +9286,25 @@ void SHDSBS(EnergyPlusData &state, A += state.dataSolarShading->HCAREA(state.dataSolarShading->FSBSHC - 1 + J) * (1.0 - state.dataSolarShading->HCT(state.dataSolarShading->FSBSHC - 1 + J)); } - state.dataSolarShading->SAREA(HTSS) = A; - if (state.dataSolarShading->SAREA(HTSS) > 0.0) { + state.dataSolarShading->SurfSunlitArea(HTSS) = A; + if (state.dataSolarShading->SurfSunlitArea(HTSS) > 0.0) { - state.dataSolarShading->SAREA(HTS) -= state.dataSolarShading->SAREA(HTSS); // Revise sunlit area of general receiving surface. + state.dataSolarShading->SurfSunlitArea(HTS) -= + state.dataSolarShading->SurfSunlitArea(HTSS); // Revise sunlit area of general receiving surface. if (iHour > 0 && TS > 0) - state.dataHeatBal->SunlitFracWithoutReveal(TS, iHour, HTSS) = - state.dataSolarShading->SAREA(HTSS) / state.dataSurface->Surface(HTSS).Area; + state.dataHeatBal->SurfSunlitFracWithoutReveal(iHour, TS, HTSS) = + state.dataSolarShading->SurfSunlitArea(HTSS) / state.dataSurface->Surface(HTSS).Area; SHDRVL(state, HTSS, SBSNR, iHour, TS); // Determine shadowing from reveal. if ((state.dataSolarShading->OverlapStatus == state.dataSolarShading->TooManyVertices) || (state.dataSolarShading->OverlapStatus == state.dataSolarShading->TooManyFigures)) - state.dataSolarShading->SAREA(HTSS) = 0.0; + state.dataSolarShading->SurfSunlitArea(HTSS) = 0.0; } else { // General receiving surface totally shaded. - state.dataSolarShading->SAREA(HTSS) = 0.0; + state.dataSolarShading->SurfSunlitArea(HTSS) = 0.0; } } } @@ -9262,9 +9321,9 @@ void SHDSBS(EnergyPlusData &state, // Error checking. SurfArea = state.dataSurface->Surface(SBSNR).NetAreaShadowCalc; - state.dataSolarShading->SAREA(HTSS) = max(0.0, state.dataSolarShading->SAREA(HTSS)); + state.dataSolarShading->SurfSunlitArea(HTSS) = max(0.0, state.dataSolarShading->SurfSunlitArea(HTSS)); - state.dataSolarShading->SAREA(HTSS) = min(state.dataSolarShading->SAREA(HTSS), SurfArea); + state.dataSolarShading->SurfSunlitArea(HTSS) = min(state.dataSolarShading->SurfSunlitArea(HTSS), SurfArea); } // End of subsurface loop } @@ -9578,10 +9637,10 @@ void WindowShadingManager(EnergyPlusData &state) Real64 HorizSolar = 0.0; // Horizontal direct plus diffuse solar intensity if (state.dataEnvrn->SunIsUp) { Real64 SkySolarOnWindow = - state.dataHeatBal->SurfAnisoSkyMult(ISurf) * state.dataEnvrn->DifSolarRad; // Sky diffuse solar intensity on window (W/m2) + state.dataSolarShading->SurfAnisoSkyMult(ISurf) * state.dataEnvrn->DifSolarRad; // Sky diffuse solar intensity on window (W/m2) BeamSolarOnWindow = state.dataEnvrn->BeamSolarRad * - state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, ISurf) * - state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, ISurf); + state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, ISurf) * + state.dataHeatBal->SurfSunlitFrac(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, ISurf); SolarOnWindow = BeamSolarOnWindow + SkySolarOnWindow + state.dataEnvrn->GndSolarRad * state.dataSurface->Surface(ISurf).ViewFactorGround; HorizSolar = state.dataEnvrn->BeamSolarRad * state.dataEnvrn->SOLCOS(3) + state.dataEnvrn->DifSolarRad; @@ -10255,40 +10314,35 @@ void SkyDifSolarShading(EnergyPlusData &state) // INTEGER iHour,iTS // Initialize Surfaces Arrays - state.dataSolarShading->SAREA = 0.0; - state.dataHeatBal->WithShdgIsoSky.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBal->WoShdgIsoSky.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBal->WithShdgHoriz.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBal->WoShdgHoriz.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBal->DifShdgRatioIsoSky.allocate(state.dataSurface->TotSurfaces); - state.dataHeatBal->DifShdgRatioHoriz.allocate(state.dataSurface->TotSurfaces); + bool detailedShading = state.dataSysVars->DetailedSkyDiffuseAlgorithm && state.dataSurface->ShadingTransmittanceVaries && + state.dataHeatBal->SolarDistribution != MinimalShadowing; + state.dataSolarShading->SurfSunlitArea = 0.0; + state.dataSolarShading->SurfWithShdgIsoSky.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSolarShading->SurfWoShdgIsoSky.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSolarShading->SurfWithShdgHoriz.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSolarShading->SurfWoShdgHoriz.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSolarShading->SurfDifShdgRatioIsoSky.allocate(state.dataSurface->TotSurfaces); + state.dataSolarShading->SurfDifShdgRatioHoriz.allocate(state.dataSurface->TotSurfaces); // initialized as no shading - state.dataHeatBal->DifShdgRatioIsoSky = 1.0; - state.dataHeatBal->DifShdgRatioHoriz = 1.0; - if (state.dataSysVars->DetailedSkyDiffuseAlgorithm && state.dataSurface->ShadingTransmittanceVaries && - state.dataHeatBal->SolarDistribution != MinimalShadowing) { - state.dataHeatBal->curDifShdgRatioIsoSky.dimension(state.dataSurface->TotSurfaces, 1.0); - } - - // only for detailed. - if (state.dataSysVars->DetailedSkyDiffuseAlgorithm && state.dataSurface->ShadingTransmittanceVaries && - state.dataHeatBal->SolarDistribution != MinimalShadowing) { - state.dataHeatBal->DifShdgRatioIsoSkyHRTS.allocate(state.dataGlobal->NumOfTimeStepInHour, 24, state.dataSurface->TotSurfaces); - state.dataHeatBal->DifShdgRatioIsoSkyHRTS = 1.0; - state.dataHeatBal->DifShdgRatioHorizHRTS.allocate(state.dataGlobal->NumOfTimeStepInHour, 24, state.dataSurface->TotSurfaces); - state.dataHeatBal->DifShdgRatioHorizHRTS = 1.0; + state.dataSolarShading->SurfDifShdgRatioIsoSky = 1.0; + state.dataSolarShading->SurfDifShdgRatioHoriz = 1.0; + if (detailedShading) { + state.dataSolarShading->SurfCurDifShdgRatioIsoSky.dimension(state.dataSurface->TotSurfaces, 1.0); + state.dataSolarShading->SurfDifShdgRatioIsoSkyHRTS.allocate(state.dataGlobal->NumOfTimeStepInHour, 24, state.dataSurface->TotSurfaces); + state.dataSolarShading->SurfDifShdgRatioIsoSkyHRTS = 1.0; + state.dataSolarShading->SurfDifShdgRatioHorizHRTS.allocate(state.dataGlobal->NumOfTimeStepInHour, 24, state.dataSurface->TotSurfaces); + state.dataSolarShading->SurfDifShdgRatioHorizHRTS = 1.0; } for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { if (!state.dataSurface->Surface(SurfNum).ExtSolar) continue; // CurrentModuleObject='Surfaces' - if (state.dataSysVars->DetailedSkyDiffuseAlgorithm && state.dataSurface->ShadingTransmittanceVaries && - state.dataHeatBal->SolarDistribution != MinimalShadowing) { + if (detailedShading) { SetupOutputVariable(state, "Debug Surface Solar Shading Model DifShdgRatioIsoSky", OutputProcessor::Unit::None, - state.dataHeatBal->curDifShdgRatioIsoSky(SurfNum), + state.dataSolarShading->SurfCurDifShdgRatioIsoSky(SurfNum), "Zone", "Average", state.dataSurface->Surface(SurfNum).Name); @@ -10296,7 +10350,7 @@ void SkyDifSolarShading(EnergyPlusData &state) SetupOutputVariable(state, "Debug Surface Solar Shading Model DifShdgRatioIsoSky", OutputProcessor::Unit::None, - state.dataHeatBal->DifShdgRatioIsoSky(SurfNum), + state.dataSolarShading->SurfDifShdgRatioIsoSky(SurfNum), "Zone", "Average", state.dataSurface->Surface(SurfNum).Name); @@ -10304,21 +10358,21 @@ void SkyDifSolarShading(EnergyPlusData &state) SetupOutputVariable(state, "Debug Surface Solar Shading Model DifShdgRatioHoriz", OutputProcessor::Unit::None, - state.dataHeatBal->DifShdgRatioHoriz(SurfNum), + state.dataSolarShading->SurfDifShdgRatioHoriz(SurfNum), "Zone", "Average", state.dataSurface->Surface(SurfNum).Name); SetupOutputVariable(state, "Debug Surface Solar Shading Model WithShdgIsoSky", OutputProcessor::Unit::None, - state.dataHeatBal->WithShdgIsoSky(SurfNum), + state.dataSolarShading->SurfWithShdgIsoSky(SurfNum), "Zone", "Average", state.dataSurface->Surface(SurfNum).Name); SetupOutputVariable(state, "Debug Surface Solar Shading Model WoShdgIsoSky", OutputProcessor::Unit::None, - state.dataHeatBal->WoShdgIsoSky(SurfNum), + state.dataSolarShading->SurfWoShdgIsoSky(SurfNum), "Zone", "Average", state.dataSurface->Surface(SurfNum).Name); @@ -10337,9 +10391,10 @@ void SkyDifSolarShading(EnergyPlusData &state) if (!ShadowingSurf && !state.dataSurface->Surface(SurfNum).HeatTransSurf) continue; - state.dataSolarShading->CTHETA(SurfNum) = state.dataSolarShading->SUNCOS(1) * state.dataSurface->Surface(SurfNum).OutNormVec(1) + - state.dataSolarShading->SUNCOS(2) * state.dataSurface->Surface(SurfNum).OutNormVec(2) + - state.dataSolarShading->SUNCOS(3) * state.dataSurface->Surface(SurfNum).OutNormVec(3); + state.dataSolarShading->SurfSunCosTheta(SurfNum) = + state.dataSolarShading->SUNCOS(1) * state.dataSurface->Surface(SurfNum).OutNormVec(1) + + state.dataSolarShading->SUNCOS(2) * state.dataSurface->Surface(SurfNum).OutNormVec(2) + + state.dataSolarShading->SUNCOS(3) * state.dataSurface->Surface(SurfNum).OutNormVec(3); } SHADOW(state, 24, 0); @@ -10349,23 +10404,23 @@ void SkyDifSolarShading(EnergyPlusData &state) if (!ShadowingSurf && (!state.dataSurface->Surface(SurfNum).HeatTransSurf || !state.dataSurface->Surface(SurfNum).ExtSolar)) continue; - if (state.dataSolarShading->CTHETA(SurfNum) < 0.0) continue; + if (state.dataSolarShading->SurfSunCosTheta(SurfNum) < 0.0) continue; - Fac1WoShdg = state.dataSolarShading->cos_Phi[IPhi] * DThetaDPhi * state.dataSolarShading->CTHETA(SurfNum); + Fac1WoShdg = state.dataSolarShading->cos_Phi[IPhi] * DThetaDPhi * state.dataSolarShading->SurfSunCosTheta(SurfNum); SurfArea = state.dataSurface->Surface(SurfNum).NetAreaShadowCalc; if (SurfArea > Eps) { - FracIlluminated = state.dataSolarShading->SAREA(SurfNum) / SurfArea; + FracIlluminated = state.dataSolarShading->SurfSunlitArea(SurfNum) / SurfArea; } else { - FracIlluminated = state.dataSolarShading->SAREA(SurfNum) / (SurfArea + Eps); + FracIlluminated = state.dataSolarShading->SurfSunlitArea(SurfNum) / (SurfArea + Eps); } Fac1WithShdg = Fac1WoShdg * FracIlluminated; - state.dataHeatBal->WithShdgIsoSky(SurfNum) += Fac1WithShdg; - state.dataHeatBal->WoShdgIsoSky(SurfNum) += Fac1WoShdg; + state.dataSolarShading->SurfWithShdgIsoSky(SurfNum) += Fac1WithShdg; + state.dataSolarShading->SurfWoShdgIsoSky(SurfNum) += Fac1WoShdg; // Horizon region if (IPhi == 0) { - state.dataHeatBal->WithShdgHoriz(SurfNum) += Fac1WithShdg; - state.dataHeatBal->WoShdgHoriz(SurfNum) += Fac1WoShdg; + state.dataSolarShading->SurfWithShdgHoriz(SurfNum) += Fac1WithShdg; + state.dataSolarShading->SurfWoShdgHoriz(SurfNum) += Fac1WoShdg; } } // End of surface loop } // End of Theta loop @@ -10376,18 +10431,19 @@ void SkyDifSolarShading(EnergyPlusData &state) if (!ShadowingSurf && (!state.dataSurface->Surface(SurfNum).HeatTransSurf || !state.dataSurface->Surface(SurfNum).ExtSolar)) continue; - if (std::abs(state.dataHeatBal->WoShdgIsoSky(SurfNum)) > Eps) { - state.dataHeatBal->DifShdgRatioIsoSky(SurfNum) = - (state.dataHeatBal->WithShdgIsoSky(SurfNum)) / (state.dataHeatBal->WoShdgIsoSky(SurfNum)); + if (std::abs(state.dataSolarShading->SurfWoShdgIsoSky(SurfNum)) > Eps) { + state.dataSolarShading->SurfDifShdgRatioIsoSky(SurfNum) = + (state.dataSolarShading->SurfWithShdgIsoSky(SurfNum)) / (state.dataSolarShading->SurfWoShdgIsoSky(SurfNum)); } else { - state.dataHeatBal->DifShdgRatioIsoSky(SurfNum) = - (state.dataHeatBal->WithShdgIsoSky(SurfNum)) / (state.dataHeatBal->WoShdgIsoSky(SurfNum) + Eps); + state.dataSolarShading->SurfDifShdgRatioIsoSky(SurfNum) = + (state.dataSolarShading->SurfWithShdgIsoSky(SurfNum)) / (state.dataSolarShading->SurfWoShdgIsoSky(SurfNum) + Eps); } - if (std::abs(state.dataHeatBal->WoShdgHoriz(SurfNum)) > Eps) { - state.dataHeatBal->DifShdgRatioHoriz(SurfNum) = (state.dataHeatBal->WithShdgHoriz(SurfNum)) / (state.dataHeatBal->WoShdgHoriz(SurfNum)); + if (std::abs(state.dataSolarShading->SurfWoShdgHoriz(SurfNum)) > Eps) { + state.dataSolarShading->SurfDifShdgRatioHoriz(SurfNum) = + (state.dataSolarShading->SurfWithShdgHoriz(SurfNum)) / (state.dataSolarShading->SurfWoShdgHoriz(SurfNum)); } else { - state.dataHeatBal->DifShdgRatioHoriz(SurfNum) = - (state.dataHeatBal->WithShdgHoriz(SurfNum)) / (state.dataHeatBal->WoShdgHoriz(SurfNum) + Eps); + state.dataSolarShading->SurfDifShdgRatioHoriz(SurfNum) = + (state.dataSolarShading->SurfWithShdgHoriz(SurfNum)) / (state.dataSolarShading->SurfWoShdgHoriz(SurfNum) + Eps); } } @@ -10402,9 +10458,9 @@ void SkyDifSolarShading(EnergyPlusData &state) for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { if (!state.dataSysVars->DetailedSkyDiffuseAlgorithm || !state.dataSurface->ShadingTransmittanceVaries || state.dataHeatBal->SolarDistribution == MinimalShadowing) { - state.dataSurface->Surface(SurfNum).ViewFactorSkyIR *= state.dataHeatBal->DifShdgRatioIsoSky(SurfNum); + state.dataSurface->Surface(SurfNum).ViewFactorSkyIR *= state.dataSolarShading->SurfDifShdgRatioIsoSky(SurfNum); } else { - state.dataSurface->Surface(SurfNum).ViewFactorSkyIR *= state.dataHeatBal->DifShdgRatioIsoSkyHRTS(1, 1, SurfNum); + state.dataSurface->Surface(SurfNum).ViewFactorSkyIR *= state.dataSolarShading->SurfDifShdgRatioIsoSkyHRTS(1, 1, SurfNum); } state.dataSurface->Surface(SurfNum).ViewFactorGroundIR = 1.0 - state.dataSurface->Surface(SurfNum).ViewFactorSkyIR; @@ -10427,10 +10483,10 @@ void SkyDifSolarShading(EnergyPlusData &state) if (state.dataSysVars->DetailedSkyDiffuseAlgorithm && state.dataSurface->ShadingTransmittanceVaries && state.dataHeatBal->SolarDistribution != MinimalShadowing) { for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - state.dataHeatBal->DifShdgRatioIsoSkyHRTS({1, state.dataGlobal->NumOfTimeStepInHour}, {1, 24}, SurfNum) = - state.dataHeatBal->DifShdgRatioIsoSky(SurfNum); - state.dataHeatBal->DifShdgRatioHorizHRTS({1, state.dataGlobal->NumOfTimeStepInHour}, {1, 24}, SurfNum) = - state.dataHeatBal->DifShdgRatioHoriz(SurfNum); + state.dataSolarShading->SurfDifShdgRatioIsoSkyHRTS({1, state.dataGlobal->NumOfTimeStepInHour}, {1, 24}, SurfNum) = + state.dataSolarShading->SurfDifShdgRatioIsoSky(SurfNum); + state.dataSolarShading->SurfDifShdgRatioHorizHRTS({1, state.dataGlobal->NumOfTimeStepInHour}, {1, 24}, SurfNum) = + state.dataSolarShading->SurfDifShdgRatioHoriz(SurfNum); } } } @@ -10489,7 +10545,7 @@ void CalcWindowProfileAngles(EnergyPlusData &state) state.dataSurface->SurfWinProfileAngHor(SurfNum) = 0.0; state.dataSurface->SurfWinProfileAngVert(SurfNum) = 0.0; - if (state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum) <= 0.0) continue; + if (state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum) <= 0.0) continue; ElevWin = DataGlobalConstants::PiOvr2 - state.dataSurface->Surface(SurfNum).Tilt * DataGlobalConstants::DegToRadians; AzimWin = state.dataSurface->Surface(SurfNum).Azimuth * DataGlobalConstants::DegToRadians; @@ -10611,12 +10667,12 @@ void CalcFrameDividerShadow(EnergyPlusData &state, Real64 FracShFDin; // Fraction of glazing that illuminates frame and divider // inside projections with beam radiation - Array1D WinNorm(3); // Window outward normal unit vector + Vector3 WinNorm(3); // Window outward normal unit vector Real64 ThWin; // Azimuth angle of WinNorm - Array1D SunPrime(3); // Projection of sun vector onto plane (perpendicular to + Vector3 SunPrime(3); // Projection of sun vector onto plane (perpendicular to // window plane) determined by WinNorm and vector along // baseline of window - Array1D WinNormCrossBase(3); // Cross product of WinNorm and vector along window baseline + Vector3 WinNormCrossBase(3); // Cross product of WinNorm and vector along window baseline if (state.dataSurface->FrameDivider(FrDivNum).FrameProjectionOut == 0.0 && state.dataSurface->FrameDivider(FrDivNum).FrameProjectionIn == 0.0 && state.dataSurface->FrameDivider(FrDivNum).DividerProjectionOut == 0.0 && state.dataSurface->FrameDivider(FrDivNum).DividerProjectionIn == 0.0) @@ -10901,10 +10957,10 @@ void CalcBeamSolarOnWinRevealSurface(EnergyPlusData &state) ShadeFlag = state.dataSurface->SurfWinShadingFlag(SurfNum); if (BITF_TEST_ANY(BITF(ShadeFlag), BITF(WinShadingType::ExtShade) | BITF(WinShadingType::ExtBlind))) continue; - if (state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum) <= 0.0) continue; + if (state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum) <= 0.0) continue; tmp_SunlitFracWithoutReveal = - state.dataHeatBal->SunlitFracWithoutReveal(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum); + state.dataHeatBal->SurfSunlitFracWithoutReveal(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum); // Calculate cosine of angle of incidence of beam solar on reveal surfaces, // assumed to be perpendicular to window plane @@ -10928,7 +10984,7 @@ void CalcBeamSolarOnWinRevealSurface(EnergyPlusData &state) ConstrNum = state.dataSurface->SurfActiveConstruction(SurfNum); ConstrNumSh = state.dataSurface->SurfWinActiveShadedConstruction(SurfNum); - SolTransGlass = POLYF(state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum), + SolTransGlass = POLYF(state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum), state.dataConstruction->Construct(ConstrNum).TransSolBeamCoef); TanProfileAngVert = state.dataSurface->SurfWinTanProfileAngVert(SurfNum); TanProfileAngHor = state.dataSurface->SurfWinTanProfileAngHor(SurfNum); @@ -11157,8 +11213,9 @@ void CalcBeamSolarOnWinRevealSurface(EnergyPlusData &state) DiffReflGlass = state.dataConstruction->Construct(ConstrNum).ReflectSolDiffBack; if (ShadeFlag == WinShadingType::SwitchableGlazing) { - SolTransGlassSh = POLYF(state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum), - state.dataConstruction->Construct(ConstrNumSh).TransSolBeamCoef); + SolTransGlassSh = + POLYF(state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum), + state.dataConstruction->Construct(ConstrNumSh).TransSolBeamCoef); SolTransGlass = InterpSw(state.dataSurface->SurfWinSwitchingFactor(SurfNum), SolTransGlass, SolTransGlassSh); DiffReflGlassSh = state.dataConstruction->Construct(ConstrNumSh).ReflectSolDiffBack; DiffReflGlass = InterpSw(state.dataSurface->SurfWinSwitchingFactor(SurfNum), DiffReflGlass, DiffReflGlassSh); @@ -11263,9 +11320,11 @@ void ReportSurfaceShading(EnergyPlusData &state) int RepCol; // the column of the predefined report for (SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - state.dataSurface->SurfSunlitFrac(SurfNum) = state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum); - state.dataSurface->SurfSunlitArea(SurfNum) = state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum) * - state.dataSurface->Surface(SurfNum).Area; + state.dataSurface->SurfSunlitFrac(SurfNum) = + state.dataHeatBal->SurfSunlitFrac(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum); + state.dataSurface->SurfSunlitArea(SurfNum) = + state.dataHeatBal->SurfSunlitFrac(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum) * + state.dataSurface->Surface(SurfNum).Area; } // added for predefined reporting RepCol = 0; @@ -11604,12 +11663,12 @@ void CalcWinTransDifSolInitialDistribution(EnergyPlusData &state) Real64 DifSolarTransW; // temp var for diffuse solar transmitted through interior window surface [W] Real64 ShBlDifSolarAbsW; // temp var for diffuse solar absorbed by shade/blind [W] - Array2D AbsSolBeamEQL(2, CFSMAXNL + 1); // absorbed exterior beam radiation by layers fraction - Array2D AbsSolDiffEQL(2, CFSMAXNL + 1); // absorbed exterior diffuse radiation by layers fraction - Array2D AbsSolBeamBackEQL(2, CFSMAXNL + 1); // absorbed interior beam radiation by layers fraction from back - Array2D AbsSolDiffBackEQL(2, CFSMAXNL + 1); // absorbed exterior diffuse radiation by layers fraction from back - int EQLNum; // equivalent layer fenestration index - int Lay; // equivalent layer fenestration layer index + Array2D SurfWinAbsSolBeamEQL(2, CFSMAXNL + 1); // absorbed exterior beam radiation by layers fraction + Array2D SurfWinAbsSolDiffEQL(2, CFSMAXNL + 1); // absorbed exterior diffuse radiation by layers fraction + Array2D SurfWinAbsSolBeamBackEQL(2, CFSMAXNL + 1); // absorbed interior beam radiation by layers fraction from back + Array2D AbsSolDiffBackEQL(2, CFSMAXNL + 1); // absorbed exterior diffuse radiation by layers fraction from back + int EQLNum; // equivalent layer fenestration index + int Lay; // equivalent layer fenestration layer index // Init accumulators for absorbed diffuse solar for all surfaces for later heat balance calcs state.dataHeatBalSurf->SurfOpaqInitialDifSolInAbs = 0.0; diff --git a/src/EnergyPlus/SolarShading.hh b/src/EnergyPlus/SolarShading.hh index e16dcc0dc2d..8c5cbdce820 100644 --- a/src/EnergyPlus/SolarShading.hh +++ b/src/EnergyPlus/SolarShading.hh @@ -369,7 +369,22 @@ struct SolarShadingData : BaseGlobalStruct // 1=No overlap; 2=NS1 completely within NS2 // 3=NS2 completely within NS1; 4=Partial overlap - Array1D CTHETA; // Cosine of angle of incidence of sun's rays on surface NS + Array1D SurfSunCosTheta; // Cosine of angle of incidence of sun's rays on surface NS + Array1D SurfAnisoSkyMult; // Multiplier on exterior-surface sky view factor to account for + // anisotropy of sky radiance; = 1.0 for for isotropic sky + Array1D SurfDifShdgRatioIsoSky; // Diffuse shading ratio (WithShdgIsoSky/WoShdgIsoSky) + Array3D SurfDifShdgRatioIsoSkyHRTS; // Diffuse shading ratio (WithShdgIsoSky/WoShdgIsoSky) + Array1D SurfCurDifShdgRatioIsoSky; // Diffuse shading ratio (WithShdgIsoSky/WoShdgIsoSky) + Array1D SurfDifShdgRatioHoriz; // Horizon shading ratio (WithShdgHoriz/WoShdgHoriz) + Array3D SurfDifShdgRatioHorizHRTS; // Horizon shading ratio (WithShdgHoriz/WoShdgHoriz) + Array1D SurfWithShdgIsoSky; // Diffuse solar irradiance from sky on surface, with shading + Array1D SurfWoShdgIsoSky; // Diffuse solar from sky on surface, without shading + Array1D SurfWithShdgHoriz; // Diffuse solar irradiance from horizon portion of sky on surface, with shading + Array1D SurfWoShdgHoriz; // Diffuse solar irradiance from horizon portion of sky on surface, without shading + Array1D SurfMultIsoSky; // Contribution to eff sky view factor from isotropic sky + Array1D SurfMultCircumSolar; // Contribution to eff sky view factor from circumsolar brightening + Array1D SurfMultHorizonZenith; // Contribution to eff sky view factor from horizon or zenith brightening + int FBKSHC; // HC location of first back surface int FGSSHC; // HC location of first general shadowing surface int FINSHC; // HC location of first back surface overlap @@ -392,21 +407,21 @@ struct SolarShadingData : BaseGlobalStruct Array2D HCC; // 'C' homogeneous coordinates of sides Array2D HCX; // 'X' homogeneous coordinates of vertices of figure. Array2D HCY; // 'Y' homogeneous coordinates of vertices of figure. - Array3D_int WindowRevealStatus; - Array1D HCAREA; // Area of each HC figure. Sign Convention: Base Surface - // - Positive, Shadow - Negative, Overlap between two shadows - // - positive, etc., so that sum of HC areas=base sunlit area - Array1D HCT; // Transmittance of each HC figure - Array1D ISABSF; // For simple interior solar distribution (in which all beam - // radiation entering zone is assumed to strike the floor), - // fraction of beam radiation absorbed by each floor surface - Array1D SAREA; // Sunlit area of heat transfer surface HTS - // Excludes multiplier for windows - // Shadowing combinations data structure...See ShadowingCombinations type + Array3D_int SurfWinRevealStatus; + Array1D HCAREA; // Area of each HC figure. Sign Convention: Base Surface + // - Positive, Shadow - Negative, Overlap between two shadows + // - positive, etc., so that sum of HC areas=base sunlit area + Array1D HCT; // Transmittance of each HC figure + Array1D SurfIntAbsFac; // For simple interior solar distribution (in which all beam + // radiation entering zone is assumed to strike the floor), + // fraction of beam radiation absorbed by each floor surface + Array1D SurfSunlitArea; // Sunlit area of heat transfer surface HTS + // Excludes multiplier for windows + // Shadowing combinations data structure...See ShadowingCombinations type int NumTooManyFigures = 0; int NumTooManyVertices = 0; int NumBaseSubSurround = 0; - Array1D SUNCOS; // Direction cosines of solar position + Vector3 SUNCOS; // Direction cosines of solar position Real64 XShadowProjection; // X projection of a shadow (formerly called C) Real64 YShadowProjection; // Y projection of a shadow (formerly called S) Array1D XTEMP; // Temporary 'X' values for HC vertices of the overlap @@ -468,34 +483,34 @@ struct SolarShadingData : BaseGlobalStruct Array1D ZVert; Array1D AbsBeamWin; // Glass layer beam solar absorptance of a window Array1D AbsBeamWinEQL = Array1D(DataWindowEquivalentLayer::CFSMAXNL + 1); // layers beam solar absorptance of a window + Array1D SurfWinExtBeamAbsByShadFac; // Factor for exterior beam radiation absorbed by shade (1/m2) (absorbed radation = beam incident * + // ExtBeamAbsByShad + Array1D SurfWinIntBeamAbsByShadFac; // Like SurfWinExtBeamAbsByShadFac, but for interior beam radiation. Array1D - ExtBeamAbsByShadFac; // Factor for exterior beam radiation absorbed by shade (1/m2) (absorbed radation = beam incident * ExtBeamAbsByShad - Array1D IntBeamAbsByShadFac; // Like ExtBeamAbsByShadFac, but for interior beam radiation. - Array1D - WinTransBmSolar; // Factor for exterior beam solar transmitted through window, or window plus shade, into zone at current time (m2) + SurfWinTransBmSolar; // Factor for exterior beam solar transmitted through window, or window plus shade, into zone at current time (m2) Array1D - WinTransDifSolar; // Factor for exterior diffuse solar transmitted through window, or window plus shade, into zone at current time (m2) - Array1D WinTransDifSolarGnd; // Factor for exterior ground diffuse solar transmitted through window with horizontally-slatted blind into - // zone at current time (m2) - Array1D WinTransDifSolarSky; // Factor for exterior sky diffuse solar transmitted through window with horizontally-slatted blind into zone - // at current time (m2) - Array2D AbsSolBeamEQL = + SurfWinTransDifSolar; // Factor for exterior diffuse solar transmitted through window, or window plus shade, into zone at current time (m2) + Array1D SurfWinTransDifSolarGnd; // Factor for exterior ground diffuse solar transmitted through window with horizontally-slatted blind + // into zone at current time (m2) + Array1D SurfWinTransDifSolarSky; // Factor for exterior sky diffuse solar transmitted through window with horizontally-slatted blind into + // zone at current time (m2) + Array2D SurfWinAbsSolBeamEQL = Array2D(2, DataWindowEquivalentLayer::CFSMAXNL + 1); // absorbed exterior beam radiation by layers fraction - Array2D AbsSolDiffEQL = + Array2D SurfWinAbsSolDiffEQL = Array2D(2, DataWindowEquivalentLayer::CFSMAXNL + 1); // absorbed exterior diffuse radiation by layers fraction - Array2D AbsSolBeamBackEQL = + Array2D SurfWinAbsSolBeamBackEQL = Array2D(2, DataWindowEquivalentLayer::CFSMAXNL + 1); // absorbed interior beam radiation by layers fraction from back - Array1D - WinTransBmBmSolar; // Factor for exterior beam to beam solar transmitted through window, or window plus shade, into zone at current time (m2) - Array1D WinTransBmDifSolar; // Factor for exterior beam to diffuse solar transmitted through window, or window plus shade, into zone at - // current time (m2) - Real64 ThetaBig = 0.0; // Larger of ThetaBlock1 and ThetaBlock2 //Autodesk Used uninitialized in some runs - Real64 ThetaSmall = 0.0; // Smaller of ThetaBlock1 and ThetaBlock2 //Autodesk Used uninitialized in some runs - Real64 ThetaMin = 0.0; // Minimum allowed slat angle, resp. (rad) //Autodesk Used uninitialized in some runs - Real64 ThetaMax = 0.0; // Maximum allowed slat angle, resp. (rad) //Autodesk Used uninitialized in some runs - Array1D XVertex; // X,Y,Z coordinates of vertices of - Array1D YVertex; // back surfaces projected into system - Array1D ZVertex; // relative to receiving surface + Array1D SurfWinTransBmBmSolar; // Factor for exterior beam to beam solar transmitted through window, or window plus shade, into zone at + // current time (m2) + Array1D SurfWinTransBmDifSolar; // Factor for exterior beam to diffuse solar transmitted through window, or window plus shade, into zone + // at current time (m2) + Real64 ThetaBig = 0.0; // Larger of ThetaBlock1 and ThetaBlock2 //Autodesk Used uninitialized in some runs + Real64 ThetaSmall = 0.0; // Smaller of ThetaBlock1 and ThetaBlock2 //Autodesk Used uninitialized in some runs + Real64 ThetaMin = 0.0; // Minimum allowed slat angle, resp. (rad) //Autodesk Used uninitialized in some runs + Real64 ThetaMax = 0.0; // Maximum allowed slat angle, resp. (rad) //Autodesk Used uninitialized in some runs + Array1D XVertex; // X,Y,Z coordinates of vertices of + Array1D YVertex; // back surfaces projected into system + Array1D ZVertex; // relative to receiving surface std::vector sin_Phi; std::vector cos_Phi; std::vector sin_Theta; @@ -513,7 +528,20 @@ struct SolarShadingData : BaseGlobalStruct this->CurrentSurfaceBeingShadowed = 0; this->CurrentShadowingSurface = 0; this->OverlapStatus = 0; - this->CTHETA.deallocate(); + this->SurfSunCosTheta.deallocate(); + this->SurfAnisoSkyMult.deallocate(); + this->SurfDifShdgRatioIsoSky.deallocate(); + this->SurfDifShdgRatioIsoSkyHRTS.deallocate(); + this->SurfCurDifShdgRatioIsoSky.deallocate(); + this->SurfDifShdgRatioHoriz.deallocate(); + this->SurfDifShdgRatioHorizHRTS.deallocate(); + this->SurfWithShdgIsoSky.deallocate(); + this->SurfWoShdgIsoSky.deallocate(); + this->SurfWithShdgHoriz.deallocate(); + this->SurfWoShdgHoriz.deallocate(); + this->SurfMultIsoSky.deallocate(); + this->SurfMultCircumSolar.deallocate(); + this->SurfMultHorizonZenith.deallocate(); this->FBKSHC = 0; this->FGSSHC = 0; this->FINSHC = 0; @@ -538,11 +566,11 @@ struct SolarShadingData : BaseGlobalStruct this->HCC.deallocate(); this->HCX.deallocate(); this->HCY.deallocate(); - this->WindowRevealStatus.deallocate(); + this->SurfWinRevealStatus.deallocate(); this->HCAREA.deallocate(); this->HCT.deallocate(); - this->ISABSF.deallocate(); - this->SAREA.deallocate(); + this->SurfIntAbsFac.deallocate(); + this->SurfSunlitArea.deallocate(); this->NumTooManyFigures = 0; this->NumTooManyVertices = 0; this->NumBaseSubSurround = 0; @@ -564,7 +592,6 @@ struct SolarShadingData : BaseGlobalStruct this->TrackTooManyFigures.deallocate(); this->TrackTooManyVertices.deallocate(); this->TrackBaseSubSurround.deallocate(); - this->ISABSF.deallocate(); this->InitComplexOnce = true; this->ShadowOneTimeFlag = true; this->CHKSBSOneTimeFlag = true; @@ -593,17 +620,17 @@ struct SolarShadingData : BaseGlobalStruct this->ZVert.deallocate(); this->AbsBeamWin.deallocate(); this->AbsBeamWinEQL = Array1D(DataWindowEquivalentLayer::CFSMAXNL + 1); - this->ExtBeamAbsByShadFac.deallocate(); - this->IntBeamAbsByShadFac.deallocate(); - this->WinTransBmSolar.deallocate(); - this->WinTransDifSolar.deallocate(); - this->WinTransDifSolarGnd.deallocate(); - this->WinTransDifSolarSky.deallocate(); - this->AbsSolBeamEQL = Array2D(2, DataWindowEquivalentLayer::CFSMAXNL + 1); - this->AbsSolDiffEQL = Array2D(2, DataWindowEquivalentLayer::CFSMAXNL + 1); - this->AbsSolBeamBackEQL = Array2D(2, DataWindowEquivalentLayer::CFSMAXNL + 1); - this->WinTransBmBmSolar.deallocate(); - this->WinTransBmDifSolar.deallocate(); + this->SurfWinExtBeamAbsByShadFac.deallocate(); + this->SurfWinIntBeamAbsByShadFac.deallocate(); + this->SurfWinTransBmSolar.deallocate(); + this->SurfWinTransDifSolar.deallocate(); + this->SurfWinTransDifSolarGnd.deallocate(); + this->SurfWinTransDifSolarSky.deallocate(); + this->SurfWinAbsSolBeamEQL = Array2D(2, DataWindowEquivalentLayer::CFSMAXNL + 1); + this->SurfWinAbsSolDiffEQL = Array2D(2, DataWindowEquivalentLayer::CFSMAXNL + 1); + this->SurfWinAbsSolBeamBackEQL = Array2D(2, DataWindowEquivalentLayer::CFSMAXNL + 1); + this->SurfWinTransBmBmSolar.deallocate(); + this->SurfWinTransBmDifSolar.deallocate(); this->ThetaBig = 0.0; this->ThetaSmall = 0.0; this->ThetaMin = 0.0; diff --git a/src/EnergyPlus/SteamBaseboardRadiator.cc b/src/EnergyPlus/SteamBaseboardRadiator.cc index ca80a266672..555cc4efabe 100644 --- a/src/EnergyPlus/SteamBaseboardRadiator.cc +++ b/src/EnergyPlus/SteamBaseboardRadiator.cc @@ -1631,20 +1631,19 @@ namespace SteamBaseboardRadiator { if (state.dataSurface->SurfWinFrameArea(SurfNum) > 0.0) { // Window frame contribution - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * - (1.0 + state.dataSurface->SurfWinProjCorrFrIn(SurfNum)) * state.dataSurface->SurfWinFrameTempSurfIn(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * + (1.0 + state.dataSurface->SurfWinProjCorrFrIn(SurfNum)) * state.dataSurface->SurfWinFrameTempIn(SurfNum); } if (state.dataSurface->SurfWinDividerArea(SurfNum) > 0.0 && !ANY_INTERIOR_SHADE_BLIND(state.dataSurface->SurfWinShadingFlag(SurfNum))) { // Window divider contribution (only from shade or blind for window with divider and interior shade or blind) - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * - (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum)) * - state.dataSurface->SurfWinDividerTempSurfIn(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * + (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum)) * state.dataSurface->SurfWinDividerTempIn(SurfNum); } } - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * Area * state.dataHeatBalSurf->TempSurfInTmp(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * Area * state.dataHeatBalSurf->SurfTempInTmp(SurfNum); } return SumHATsurf; diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index c193ad81389..75ebae255b4 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -188,8 +188,8 @@ namespace SurfaceGeometry { state.dataSurface->SurfWinFrameEmis.dimension(NumSurfaces, 0); state.dataSurface->SurfWinFrEdgeToCenterGlCondRatio.dimension(NumSurfaces, 1.0); state.dataSurface->SurfWinFrameEdgeArea.dimension(NumSurfaces, 0); - state.dataSurface->SurfWinFrameTempSurfIn.dimension(NumSurfaces, 23.0); - state.dataSurface->SurfWinFrameTempSurfInOld.dimension(NumSurfaces, 23.0); + state.dataSurface->SurfWinFrameTempIn.dimension(NumSurfaces, 23.0); + state.dataSurface->SurfWinFrameTempInOld.dimension(NumSurfaces, 23.0); state.dataSurface->SurfWinFrameTempSurfOut.dimension(NumSurfaces, 23.0); state.dataSurface->SurfWinProjCorrFrOut.dimension(NumSurfaces, 0); state.dataSurface->SurfWinProjCorrFrIn.dimension(NumSurfaces, 0); @@ -201,8 +201,8 @@ namespace SurfaceGeometry { state.dataSurface->SurfWinDividerEmis.dimension(NumSurfaces, 0); state.dataSurface->SurfWinDivEdgeToCenterGlCondRatio.dimension(NumSurfaces, 1); state.dataSurface->SurfWinDividerEdgeArea.dimension(NumSurfaces, 0); - state.dataSurface->SurfWinDividerTempSurfIn.dimension(NumSurfaces, 23.0); - state.dataSurface->SurfWinDividerTempSurfInOld.dimension(NumSurfaces, 23.0); + state.dataSurface->SurfWinDividerTempIn.dimension(NumSurfaces, 23.0); + state.dataSurface->SurfWinDividerTempInOld.dimension(NumSurfaces, 23.0); state.dataSurface->SurfWinDividerTempSurfOut.dimension(NumSurfaces, 23.0); state.dataSurface->SurfWinProjCorrDivOut.dimension(NumSurfaces, 0); state.dataSurface->SurfWinProjCorrDivIn.dimension(NumSurfaces, 0); @@ -639,11 +639,11 @@ namespace SurfaceGeometry { ZoneCeilingHeightEntered.deallocate(); ZoneCeilingArea.deallocate(); - state.dataSurface->AdjacentZoneToSurface.dimension(state.dataSurface->TotSurfaces, 0); + state.dataSurface->SurfAdjacentZone.dimension(state.dataSurface->TotSurfaces, 0); // note -- adiabatic surfaces will show same zone as surface for (SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { if (state.dataSurface->Surface(SurfNum).ExtBoundCond <= 0) continue; - state.dataSurface->AdjacentZoneToSurface(SurfNum) = state.dataSurface->Surface(state.dataSurface->Surface(SurfNum).ExtBoundCond).Zone; + state.dataSurface->SurfAdjacentZone(SurfNum) = state.dataSurface->Surface(state.dataSurface->Surface(SurfNum).ExtBoundCond).Zone; } for (ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { diff --git a/src/EnergyPlus/SurfaceGroundHeatExchanger.cc b/src/EnergyPlus/SurfaceGroundHeatExchanger.cc index dff87e1d977..638344de090 100644 --- a/src/EnergyPlus/SurfaceGroundHeatExchanger.cc +++ b/src/EnergyPlus/SurfaceGroundHeatExchanger.cc @@ -461,67 +461,17 @@ namespace SurfaceGroundHeatExchanger { // Using/Aliasing using namespace DataEnvironment; - using DataPlant::TypeOf_GrndHtExchgSurface; - using FluidProperties::GetDensityGlycol; - using PlantUtilities::InitComponentNodes; - using PlantUtilities::RegisterPlantCompDesignFlow; using PlantUtilities::RegulateCondenserCompFlowReqOp; - using PlantUtilities::ScanPlantLoopsForObject; using PlantUtilities::SetComponentFlowRate; - // SUBROUTINE PARAMETER DEFINITIONS: - Real64 const DesignVelocity(0.5); // Hypothetical design max pipe velocity [m/s] - static std::string const RoutineName("InitSurfaceGroundHeatExchanger"); - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 DesignFlow; // Hypothetical design flow rate int Cons; // construction counter int LayerNum; // material layer number for bottom Real64 OutDryBulb; // Height Dependent dry bulb. - Real64 rho; // local fluid density - bool errFlag; - // Init more variables - if (this->MyFlag) { - // Locate the hx on the plant loops for later usage - errFlag = false; - ScanPlantLoopsForObject(state, - this->Name, - TypeOf_GrndHtExchgSurface, - this->LoopNum, - this->LoopSideNum, - this->BranchNum, - this->CompNum, - errFlag, - _, - _, - _, - _, - _); - - if (errFlag) { - ShowFatalError(state, "InitSurfaceGroundHeatExchanger: Program terminated due to previous condition(s)."); - } - rho = GetDensityGlycol(state, - state.dataPlnt->PlantLoop(this->LoopNum).FluidName, - DataPrecisionGlobals::constant_zero, - state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, - RoutineName); - this->DesignMassFlowRate = DataGlobalConstants::Pi / 4.0 * pow_2(this->TubeDiameter) * DesignVelocity * rho * this->TubeCircuits; - InitComponentNodes(state, - 0.0, - this->DesignMassFlowRate, - this->InletNodeNum, - this->OutletNodeNum, - this->LoopNum, - this->LoopSideNum, - this->BranchNum, - this->CompNum); - RegisterPlantCompDesignFlow(state, this->InletNodeNum, this->DesignMassFlowRate / rho); - - this->MyFlag = false; - } + this->oneTimeInit(state); // Init more variables // get QTF data - only once if (this->InitQTF) { @@ -1477,6 +1427,60 @@ namespace SurfaceGroundHeatExchanger { this->SurfEnergy = SurfaceArea * (state.dataSurfaceGroundHeatExchangers->TopSurfFlux + state.dataSurfaceGroundHeatExchangers->BtmSurfFlux) * TimeStepSys * DataGlobalConstants::SecInHour; } + void SurfaceGroundHeatExchangerData::oneTimeInit(EnergyPlusData &state) + { + using DataPlant::TypeOf_GrndHtExchgSurface; + using FluidProperties::GetDensityGlycol; + using PlantUtilities::InitComponentNodes; + using PlantUtilities::RegisterPlantCompDesignFlow; + using PlantUtilities::ScanPlantLoopsForObject; + + // SUBROUTINE PARAMETER DEFINITIONS: + Real64 const DesignVelocity(0.5); // Hypothetical design max pipe velocity [m/s] + Real64 rho; // local fluid density + bool errFlag; + static std::string const RoutineName("InitSurfaceGroundHeatExchanger"); + + if (this->MyFlag) { + // Locate the hx on the plant loops for later usage + errFlag = false; + ScanPlantLoopsForObject(state, + this->Name, + TypeOf_GrndHtExchgSurface, + this->LoopNum, + this->LoopSideNum, + this->BranchNum, + this->CompNum, + errFlag, + _, + _, + _, + _, + _); + + if (errFlag) { + ShowFatalError(state, "InitSurfaceGroundHeatExchanger: Program terminated due to previous condition(s)."); + } + rho = GetDensityGlycol(state, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, + DataPrecisionGlobals::constant_zero, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, + RoutineName); + this->DesignMassFlowRate = DataGlobalConstants::Pi / 4.0 * pow_2(this->TubeDiameter) * DesignVelocity * rho * this->TubeCircuits; + InitComponentNodes(state, + 0.0, + this->DesignMassFlowRate, + this->InletNodeNum, + this->OutletNodeNum, + this->LoopNum, + this->LoopSideNum, + this->BranchNum, + this->CompNum); + RegisterPlantCompDesignFlow(state, this->InletNodeNum, this->DesignMassFlowRate / rho); + + this->MyFlag = false; + } + } } // namespace SurfaceGroundHeatExchanger diff --git a/src/EnergyPlus/SurfaceGroundHeatExchanger.hh b/src/EnergyPlus/SurfaceGroundHeatExchanger.hh index f69d865d8fd..56b225a3724 100644 --- a/src/EnergyPlus/SurfaceGroundHeatExchanger.hh +++ b/src/EnergyPlus/SurfaceGroundHeatExchanger.hh @@ -259,6 +259,10 @@ namespace SurfaceGroundHeatExchanger { //============================================================================== void ReportSurfaceGroundHeatExchngr(EnergyPlusData &state); // Index for the surface under consideration + + //============================================================================== + + void oneTimeInit(EnergyPlusData &state) override; // Empty function for pure virtual oneTimeInitFlag function }; void GetSurfaceGroundHeatExchanger(EnergyPlusData &state); diff --git a/src/EnergyPlus/SwimmingPool.cc b/src/EnergyPlus/SwimmingPool.cc index 65f387c72a1..91da256c773 100644 --- a/src/EnergyPlus/SwimmingPool.cc +++ b/src/EnergyPlus/SwimmingPool.cc @@ -775,10 +775,10 @@ void SwimmingPoolData::calculate(EnergyPlusData &state) // for the inside surface temperature which is assumed to be the same as the pool // water temperature. // Standard Heat Balance Equation: - // TempSurfInTmp( SurfNum ) = ( CTFConstInPart( SurfNum ) + QRadThermInAbs( SurfNum ) + QRadSWInAbs( SurfNum ) + HConvIn( SurfNum + // SurfTempInTmp( SurfNum ) = ( SurfCTFConstInPart( SurfNum ) + QRadThermInAbs( SurfNum ) + QRadSWInAbs( SurfNum ) + HConvIn( SurfNum //) //* RefAirTemp( SurfNum ) + NetLWRadToSurf( SurfNum ) + Construct( ConstrNum ).CTFSourceIn( 0 ) * QsrcHist( 1, SurfNum ) + QHTRadSysSurf( - // SurfNum ) + QHWBaseboardSurf( SurfNum ) + QSteamBaseboardSurf( SurfNum ) + QElecBaseboardSurf( SurfNum ) + IterDampConst * TempInsOld( + // SurfNum ) + QHWBaseboardSurf( SurfNum ) + QSteamBaseboardSurf( SurfNum ) + QElecBaseboardSurf( SurfNum ) + IterDampConst * SurfTempInsOld( // SurfNum ) + Construct( ConstrNum ).CTFCross( 0 ) * TH11 ) / ( Construct( ConstrNum ).CTFInside( 0 ) + HConvIn( SurfNum ) + IterDampConst ); //// Constant part of conduction eq (history terms) | LW radiation from internal sources | SW radiation from internal sources | Convection // from surface to zone air | Net radiant exchange with other zone surfaces | Heat source/sink term for radiant systems | (if there is one @@ -936,6 +936,9 @@ void SwimmingPoolData::update(EnergyPlusData &state) Real64 WaterMassFlow = state.dataLoopNodes->Node(this->WaterInletNode).MassFlowRate; // water mass flow rate if (WaterMassFlow > 0.0) state.dataLoopNodes->Node(this->WaterOutletNode).Temp = this->PoolWaterTemp; } +void SwimmingPoolData::oneTimeInit([[maybe_unused]] EnergyPlusData &state) +{ +} void UpdatePoolSourceValAvg(EnergyPlusData &state, bool &SwimmingPoolOn) // .TRUE. if the swimming pool "runs" this zone time step { @@ -1037,20 +1040,20 @@ Real64 SumHATsurf(EnergyPlusData &state, int const ZoneNum) // Zone number if (state.dataSurface->SurfWinFrameArea(SurfNum) > 0.0) { // Window frame contribution - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * - (1.0 + state.dataSurface->SurfWinProjCorrFrIn(SurfNum)) * state.dataSurface->SurfWinFrameTempSurfIn(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * + (1.0 + state.dataSurface->SurfWinProjCorrFrIn(SurfNum)) * state.dataSurface->SurfWinFrameTempIn(SurfNum); } if (state.dataSurface->SurfWinDividerArea(SurfNum) > 0.0 && state.dataSurface->SurfWinShadingFlag(SurfNum) != DataSurfaces::WinShadingType::IntShade && state.dataSurface->SurfWinShadingFlag(SurfNum) != DataSurfaces::WinShadingType::IntBlind) { // Window divider contribution (only from shade or blind for window with divider and interior shade or blind) - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * - (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum)) * state.dataSurface->SurfWinDividerTempSurfIn(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * + (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum)) * state.dataSurface->SurfWinDividerTempIn(SurfNum); } } - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * Area * state.dataHeatBalSurf->TempSurfInTmp(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * Area * state.dataHeatBalSurf->SurfTempInTmp(SurfNum); } return SumHATsurf; diff --git a/src/EnergyPlus/SwimmingPool.hh b/src/EnergyPlus/SwimmingPool.hh index ef13a07adc8..e63d7a66799 100644 --- a/src/EnergyPlus/SwimmingPool.hh +++ b/src/EnergyPlus/SwimmingPool.hh @@ -185,6 +185,8 @@ namespace SwimmingPool { ); void update(EnergyPlusData &state); + + void oneTimeInit(EnergyPlusData &state) override; }; void GetSwimmingPool(EnergyPlusData &state); diff --git a/src/EnergyPlus/ThermalChimney.cc b/src/EnergyPlus/ThermalChimney.cc index e5b607bf46f..20b98f652e4 100644 --- a/src/EnergyPlus/ThermalChimney.cc +++ b/src/EnergyPlus/ThermalChimney.cc @@ -734,10 +734,10 @@ namespace ThermalChimney { for (SurfNum = state.dataHeatBal->Zone(ZoneNum).HTSurfaceFirst; SurfNum <= state.dataHeatBal->Zone(ZoneNum).HTSurfaceLast; ++SurfNum) { if (state.dataSurface->Surface(SurfNum).Width == majorW) { - if (state.dataHeatBalSurf->TempSurfIn(SurfNum) > TemporaryWallSurfTemp) { - TemporaryWallSurfTemp = state.dataHeatBalSurf->TempSurfIn(SurfNum); - ConvTransCoeffWallFluid = state.dataHeatBal->HConvIn(SurfNum); - SurfTempAbsorberWall = state.dataHeatBalSurf->TempSurfIn(SurfNum) + DataGlobalConstants::KelvinConv; + if (state.dataHeatBalSurf->SurfTempIn(SurfNum) > TemporaryWallSurfTemp) { + TemporaryWallSurfTemp = state.dataHeatBalSurf->SurfTempIn(SurfNum); + ConvTransCoeffWallFluid = state.dataHeatBalSurf->SurfHConvInt(SurfNum); + SurfTempAbsorberWall = state.dataHeatBalSurf->SurfTempIn(SurfNum) + DataGlobalConstants::KelvinConv; } } } @@ -746,8 +746,8 @@ namespace ThermalChimney { if (state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Window) { if (state.dataSurface->Surface(SurfNum).Width > TempmajorW) { TempmajorW = state.dataSurface->Surface(SurfNum).Width; - ConvTransCoeffGlassFluid = state.dataHeatBal->HConvIn(SurfNum); - SurfTempGlassCover = state.dataHeatBalSurf->TempSurfIn(SurfNum) + DataGlobalConstants::KelvinConv; + ConvTransCoeffGlassFluid = state.dataHeatBalSurf->SurfHConvInt(SurfNum); + SurfTempGlassCover = state.dataHeatBalSurf->SurfTempIn(SurfNum) + DataGlobalConstants::KelvinConv; } } } diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index 4cf616d8086..ef3fb612189 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -711,20 +711,20 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // The Wall surface is in the upper subzone if (ZInfSurf > LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HWall(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_MX += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->TempSurfIn(SurfNum) * state.dataUCSDShared->HWall(Ctd); + state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWall(Ctd); state.dataUFADManager->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWall(Ctd); } // The Wall surface is in the lower subzone if (ZSupSurf < LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HWall(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_OC += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->TempSurfIn(SurfNum) * state.dataUCSDShared->HWall(Ctd); + state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWall(Ctd); state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWall(Ctd); } @@ -741,19 +741,19 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // The Wall surface is partially in upper and partially in lower subzone if (ZInfSurf <= LayH && ZSupSurf >= LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); HLU = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); HLD = state.dataRoomAirMod->UFHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); state.dataUCSDShared->HWall(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); state.dataUFADManager->HAT_MX += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * - state.dataHeatBalSurf->TempSurfIn(SurfNum) * HLU; + state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; state.dataUFADManager->HA_MX += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; state.dataUFADManager->HAT_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * - state.dataHeatBalSurf->TempSurfIn(SurfNum) * HLD; + state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } @@ -775,49 +775,49 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (ZInfSurf > LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_MX += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->TempSurfIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); + state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); state.dataUFADManager->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); state.dataUFADManager->HAT_MXWin += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->TempSurfIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); + state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); state.dataUFADManager->HA_MXWin += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); } if (ZSupSurf < LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_OC += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->TempSurfIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); + state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); state.dataUFADManager->HAT_OCWin += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->TempSurfIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); + state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); state.dataUFADManager->HA_OCWin += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); HLU = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); HLD = state.dataRoomAirMod->UFHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); state.dataUCSDShared->HWindow(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); state.dataUFADManager->HAT_MX += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * - state.dataHeatBalSurf->TempSurfIn(SurfNum) * HLU; + state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; state.dataUFADManager->HA_MX += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; state.dataUFADManager->HAT_MXWin += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * - state.dataHeatBalSurf->TempSurfIn(SurfNum) * HLU; + state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; state.dataUFADManager->HA_MXWin += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; state.dataUFADManager->HAT_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * - state.dataHeatBalSurf->TempSurfIn(SurfNum) * HLD; + state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataUFADManager->HAT_OCWin += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * - state.dataHeatBalSurf->TempSurfIn(SurfNum) * HLD; + state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; state.dataUFADManager->HA_OCWin += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } @@ -825,19 +825,19 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (state.dataSurface->Surface(SurfNum).Tilt <= 10.0) { // Window Ceiling state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_MX += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->TempSurfIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); + state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); state.dataUFADManager->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); } if (state.dataSurface->Surface(SurfNum).Tilt >= 170.0) { // Window Floor state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_OC += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->TempSurfIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); + state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); } @@ -858,37 +858,37 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (ZInfSurf > LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_MX += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->TempSurfIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); + state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); state.dataUFADManager->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HDoor(Ctd); } if (ZSupSurf < LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_OC += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->TempSurfIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); + state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HDoor(Ctd); } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); HLU = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); HLD = state.dataRoomAirMod->UFHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); state.dataUCSDShared->HDoor(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); state.dataUFADManager->HAT_MX += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * - state.dataHeatBalSurf->TempSurfIn(SurfNum) * HLU; + state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; state.dataUFADManager->HA_MX += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; state.dataUFADManager->HAT_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * - state.dataHeatBalSurf->TempSurfIn(SurfNum) * HLD; + state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } @@ -911,28 +911,28 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (ZSupSurf < LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HInternal(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_OC += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->TempSurfIn(SurfNum) * state.dataUCSDShared->HInternal(Ctd); + state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HInternal(Ctd); state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HInternal(Ctd); } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); HLU = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); HLD = state.dataRoomAirMod->UFHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); state.dataUCSDShared->HInternal(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); state.dataUFADManager->HAT_MX += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * - state.dataHeatBalSurf->TempSurfIn(SurfNum) * HLU; + state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; state.dataUFADManager->HA_MX += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; state.dataUFADManager->HAT_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * - state.dataHeatBalSurf->TempSurfIn(SurfNum) * HLD; + state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } @@ -947,10 +947,10 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HCeiling(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_MX += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->TempSurfIn(SurfNum) * state.dataUCSDShared->HCeiling(Ctd); + state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HCeiling(Ctd); state.dataUFADManager->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HCeiling(Ctd); state.dataRoomAirMod->UFHcIn(SurfNum) = state.dataUCSDShared->HCeiling(Ctd); } // END CEILING @@ -961,10 +961,10 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HFloor(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_OC += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->TempSurfIn(SurfNum) * state.dataUCSDShared->HFloor(Ctd); + state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HFloor(Ctd); state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HFloor(Ctd); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); state.dataRoomAirMod->UFHcIn(SurfNum) = state.dataUCSDShared->HFloor(Ctd); @@ -1109,7 +1109,7 @@ void CalcUCSDUI(EnergyPlusData &state, int const ZoneNum) // index number for th } MIXFLAG = false; - state.dataRoomAirMod->UFHcIn = state.dataHeatBal->HConvIn; + state.dataRoomAirMod->UFHcIn = state.dataHeatBalSurf->SurfHConvInt; SumSysMCp = 0.0; SumSysMCpT = 0.0; TotSysFlow = 0.0; @@ -1620,7 +1620,7 @@ void CalcUCSDUE(EnergyPlusData &state, int const ZoneNum) // index number for th HeightFrac = 0.0; MIXFLAG = false; - state.dataRoomAirMod->UFHcIn = state.dataHeatBal->HConvIn; + state.dataRoomAirMod->UFHcIn = state.dataHeatBalSurf->SurfHConvInt; SumSysMCp = 0.0; SumSysMCpT = 0.0; TotSysFlow = 0.0; diff --git a/src/EnergyPlus/UserDefinedComponents.cc b/src/EnergyPlus/UserDefinedComponents.cc index ef1fc812f70..6c721af562c 100644 --- a/src/EnergyPlus/UserDefinedComponents.cc +++ b/src/EnergyPlus/UserDefinedComponents.cc @@ -2385,43 +2385,7 @@ namespace UserDefinedComponents { static std::string const RoutineName("InitPlantUserComponent"); - if (this->myOneTimeFlag) { - // locate the connections to the plant loops - for (int ConnectionNum = 1; ConnectionNum <= this->NumPlantConnections; ++ConnectionNum) { - bool errFlag = false; - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - DataPlant::TypeOf_PlantComponentUserDefined, - this->Loop(ConnectionNum).LoopNum, - this->Loop(ConnectionNum).LoopSideNum, - this->Loop(ConnectionNum).BranchNum, - this->Loop(ConnectionNum).CompNum, - errFlag, - _, - _, - _, - this->Loop(ConnectionNum).InletNodeNum); - if (errFlag) { - ShowFatalError(state, "InitPlantUserComponent: Program terminated due to previous condition(s)."); - } - - // set user input for flow priority - state.dataPlnt->PlantLoop(this->Loop(ConnectionNum).LoopNum) - .LoopSide(this->Loop(ConnectionNum).LoopSideNum) - .Branch(this->Loop(ConnectionNum).BranchNum) - .Comp(this->Loop(ConnectionNum).CompNum) - .FlowPriority = this->Loop(ConnectionNum).FlowPriority; - - // set user input for how loads served - state.dataPlnt->PlantLoop(this->Loop(ConnectionNum).LoopNum) - .LoopSide(this->Loop(ConnectionNum).LoopSideNum) - .Branch(this->Loop(ConnectionNum).BranchNum) - .Comp(this->Loop(ConnectionNum).CompNum) - .HowLoadServed = this->Loop(ConnectionNum).HowLoadServed; - } - - this->myOneTimeFlag = false; - } + this->oneTimeInit(state); if (LoopNum <= 0 || LoopNum > this->NumPlantConnections) return; @@ -2773,6 +2737,47 @@ namespace UserDefinedComponents { .MaxOutletTemp = this->Loop(LoopNum).HiOutTempLimit; } } + void UserPlantComponentStruct::oneTimeInit(EnergyPlusData &state) + { + + if (this->myOneTimeFlag) { + // locate the connections to the plant loops + for (int ConnectionNum = 1; ConnectionNum <= this->NumPlantConnections; ++ConnectionNum) { + bool errFlag = false; + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + DataPlant::TypeOf_PlantComponentUserDefined, + this->Loop(ConnectionNum).LoopNum, + this->Loop(ConnectionNum).LoopSideNum, + this->Loop(ConnectionNum).BranchNum, + this->Loop(ConnectionNum).CompNum, + errFlag, + _, + _, + _, + this->Loop(ConnectionNum).InletNodeNum); + if (errFlag) { + ShowFatalError(state, "InitPlantUserComponent: Program terminated due to previous condition(s)."); + } + + // set user input for flow priority + state.dataPlnt->PlantLoop(this->Loop(ConnectionNum).LoopNum) + .LoopSide(this->Loop(ConnectionNum).LoopSideNum) + .Branch(this->Loop(ConnectionNum).BranchNum) + .Comp(this->Loop(ConnectionNum).CompNum) + .FlowPriority = this->Loop(ConnectionNum).FlowPriority; + + // set user input for how loads served + state.dataPlnt->PlantLoop(this->Loop(ConnectionNum).LoopNum) + .LoopSide(this->Loop(ConnectionNum).LoopSideNum) + .Branch(this->Loop(ConnectionNum).BranchNum) + .Comp(this->Loop(ConnectionNum).CompNum) + .HowLoadServed = this->Loop(ConnectionNum).HowLoadServed; + } + + this->myOneTimeFlag = false; + } + } void UserCoilComponentStruct::report(EnergyPlusData &state) { diff --git a/src/EnergyPlus/UserDefinedComponents.hh b/src/EnergyPlus/UserDefinedComponents.hh index 30b2c57e625..8266c9e6790 100644 --- a/src/EnergyPlus/UserDefinedComponents.hh +++ b/src/EnergyPlus/UserDefinedComponents.hh @@ -201,6 +201,8 @@ namespace UserDefinedComponents { void initialize(EnergyPlusData &state, int LoopNum, Real64 MyLoad); void report(EnergyPlusData &state, int LoopNum); + + void oneTimeInit(EnergyPlusData &state) override; }; struct UserCoilComponentStruct diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 83e8ecdc36f..ebfbd5bd277 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -4933,20 +4933,19 @@ namespace VentilatedSlab { if (state.dataSurface->SurfWinFrameArea(SurfNum) > 0.0) { // Window frame contribution - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * - (1.0 + state.dataSurface->SurfWinProjCorrFrIn(SurfNum)) * state.dataSurface->SurfWinFrameTempSurfIn(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * + (1.0 + state.dataSurface->SurfWinProjCorrFrIn(SurfNum)) * state.dataSurface->SurfWinFrameTempIn(SurfNum); } if (state.dataSurface->SurfWinDividerArea(SurfNum) > 0.0 && !ANY_INTERIOR_SHADE_BLIND(state.dataSurface->SurfWinShadingFlag(SurfNum))) { // Window divider contribution (only from shade or blind for window with divider and interior shade or blind) - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * - (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum)) * - state.dataSurface->SurfWinDividerTempSurfIn(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * + (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum)) * state.dataSurface->SurfWinDividerTempIn(SurfNum); } } - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * Area * state.dataHeatBalSurf->TempSurfInTmp(SurfNum); + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * Area * state.dataHeatBalSurf->SurfTempInTmp(SurfNum); } return SumHATsurf; diff --git a/src/EnergyPlus/WaterThermalTanks.cc b/src/EnergyPlus/WaterThermalTanks.cc index caa6fc62e9b..4c3e8dd98db 100644 --- a/src/EnergyPlus/WaterThermalTanks.cc +++ b/src/EnergyPlus/WaterThermalTanks.cc @@ -282,10 +282,7 @@ void WaterThermalTankData::simulate( // set the caller loop num to mimic what was happening in plant loop equip this->callerLoopNum = calledFromLocation.loopNum; - if (this->myOneTimeInitFlag) { - this->setupOutputVars(state); - this->myOneTimeInitFlag = false; - } + this->oneTimeInit(state); if (this->MyOneTimeFlagWH) { this->MyOneTimeFlagWH = false; @@ -444,6 +441,9 @@ void HeatPumpWaterHeaterData::simulate( // reset caller loop num to 0 to mimic what plantloopequip was doing Tank.callerLoopNum = 0; } +void HeatPumpWaterHeaterData::oneTimeInit([[maybe_unused]] EnergyPlusData &state) +{ +} void SimulateWaterHeaterStandAlone(EnergyPlusData &state, int const WaterHeaterNum, bool const FirstHVACIteration) { @@ -12357,6 +12357,13 @@ Real64 WaterThermalTankData::getDeadBandTemp() return (this->SetPointTemp - this->DeadBandDeltaTemp); } } +void WaterThermalTankData::oneTimeInit(EnergyPlusData &state) +{ + if (this->myOneTimeInitFlag) { + this->setupOutputVars(state); + this->myOneTimeInitFlag = false; + } +} bool GetHeatPumpWaterHeaterNodeNumber(EnergyPlusData &state, int const NodeNumber) { diff --git a/src/EnergyPlus/WaterThermalTanks.hh b/src/EnergyPlus/WaterThermalTanks.hh index 5f24bccde6f..14588f8843a 100644 --- a/src/EnergyPlus/WaterThermalTanks.hh +++ b/src/EnergyPlus/WaterThermalTanks.hh @@ -398,6 +398,8 @@ namespace WaterThermalTanks { Real64 &MaxLoad, Real64 &MinLoad, Real64 &OptLoad) override; + + void oneTimeInit(EnergyPlusData &state) override; }; struct WaterThermalTankData : PlantComponent @@ -794,6 +796,8 @@ namespace WaterThermalTanks { Real64 &MaxLoad, Real64 &MinLoad, Real64 &OptLoad) override; + + void oneTimeInit(EnergyPlusData &state) override; }; struct WaterHeaterDesuperheaterData diff --git a/src/EnergyPlus/WaterUse.cc b/src/EnergyPlus/WaterUse.cc index 05547bac453..81de6602fd7 100644 --- a/src/EnergyPlus/WaterUse.cc +++ b/src/EnergyPlus/WaterUse.cc @@ -1112,31 +1112,7 @@ namespace WaterUse { // MODIFIED Brent Griffith 2010, demand side update // RE-ENGINEERED na - if (this->setupMyOutputVars) { - this->setupOutputVars(state); - this->setupMyOutputVars = false; - } - - if (this->plantScanFlag && allocated(state.dataPlnt->PlantLoop) && !this->StandAlone) { - bool errFlag = false; - PlantUtilities::ScanPlantLoopsForObject(state, - this->Name, - DataPlant::TypeOf_WaterUseConnection, - this->PlantLoopNum, - this->PlantLoopSide, - this->PlantLoopBranchNum, - this->PlantLoopCompNum, - errFlag, - _, - _, - _, - _, - _); - if (errFlag) { - ShowFatalError(state, "InitConnections: Program terminated due to previous condition(s)."); - } - this->plantScanFlag = false; - } + this->oneTimeInit(state); // Set the cold water temperature if (this->SupplyTankNum > 0) { @@ -1522,6 +1498,35 @@ namespace WaterUse { this->Energy = this->Power * state.dataHVACGlobal->TimeStepSys * DataGlobalConstants::SecInHour; this->RecoveryEnergy = this->RecoveryRate * state.dataHVACGlobal->TimeStepSys * DataGlobalConstants::SecInHour; } + void WaterConnectionsType::oneTimeInit(EnergyPlusData &state) + { + + if (this->setupMyOutputVars) { + this->setupOutputVars(state); + this->setupMyOutputVars = false; + } + + if (this->plantScanFlag && allocated(state.dataPlnt->PlantLoop) && !this->StandAlone) { + bool errFlag = false; + PlantUtilities::ScanPlantLoopsForObject(state, + this->Name, + DataPlant::TypeOf_WaterUseConnection, + this->PlantLoopNum, + this->PlantLoopSide, + this->PlantLoopBranchNum, + this->PlantLoopCompNum, + errFlag, + _, + _, + _, + _, + _); + if (errFlag) { + ShowFatalError(state, "InitConnections: Program terminated due to previous condition(s)."); + } + this->plantScanFlag = false; + } + } void CalcWaterUseZoneGains(EnergyPlusData &state) { diff --git a/src/EnergyPlus/WaterUse.hh b/src/EnergyPlus/WaterUse.hh index 6c93d1619c2..72281c17241 100644 --- a/src/EnergyPlus/WaterUse.hh +++ b/src/EnergyPlus/WaterUse.hh @@ -246,6 +246,8 @@ namespace WaterUse { void ReportWaterUse(EnergyPlusData &state); void setupOutputVars([[maybe_unused]] EnergyPlusData &state); + + void oneTimeInit(EnergyPlusData &state) override; }; void SimulateWaterUse(EnergyPlusData &state, bool FirstHVACIteration); diff --git a/src/EnergyPlus/WindowComplexManager.cc b/src/EnergyPlus/WindowComplexManager.cc index f295521a321..5c5a155d1ba 100644 --- a/src/EnergyPlus/WindowComplexManager.cc +++ b/src/EnergyPlus/WindowComplexManager.cc @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -599,10 +600,10 @@ namespace WindowComplexManager { std::size_t lHTI(0); // Linear index for ( Hour, TS, I ) for (int Hour = 1; Hour <= 24; ++Hour) { for (int TS = 1; TS <= state.dataGlobal->NumOfTimeStepInHour; ++TS, ++lHT) { // [ lHT ] == ( Hour, TS ) - SunDir = state.dataBSDFWindow->SUNCOSTS(TS, Hour, {1, 3}); + SunDir = state.dataBSDFWindow->SUNCOSTS(TS, Hour); Theta = 0.0; Phi = 0.0; - if (state.dataBSDFWindow->SUNCOSTS(TS, Hour, 3) > DataEnvironment::SunIsUpValue) { + if (state.dataBSDFWindow->SUNCOSTS(TS, Hour)(3) > DataEnvironment::SunIsUpValue) { IncRay = FindInBasis( state, SunDir, state.dataWindowComplexManager->Front_Incident, iSurf, iState, complexWindowGeom.Inc, Theta, Phi); complexWindowGeom.ThetaBm[lHT] = Theta; @@ -651,10 +652,10 @@ namespace WindowComplexManager { } else { // detailed timestep integration std::size_t const lHT( complexWindowGeom.ThetaBm.index(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep)); // [ lHT ] == ( HourOfDay, TimeStep ) - SunDir = state.dataBSDFWindow->SUNCOSTS(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, {1, 3}); + SunDir = state.dataBSDFWindow->SUNCOSTS(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay); Theta = 0.0; Phi = 0.0; - if (state.dataBSDFWindow->SUNCOSTS(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, 3) > DataEnvironment::SunIsUpValue) { + if (state.dataBSDFWindow->SUNCOSTS(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay)(3) > DataEnvironment::SunIsUpValue) { IncRay = FindInBasis(state, SunDir, state.dataWindowComplexManager->Front_Incident, iSurf, iState, complexWindowGeom.Inc, Theta, Phi); complexWindowGeom.ThetaBm[lHT] = Theta; complexWindowGeom.PhiBm[lHT] = Phi; @@ -852,7 +853,7 @@ namespace WindowComplexManager { } if (RegWindFnd) { Absorb.allocate(State.NLayers); - SunDir = state.dataBSDFWindow->SUNCOSTS(TS, Hour, {1, 3}); + SunDir = state.dataBSDFWindow->SUNCOSTS(TS, Hour); BkIncRay = FindInBasis(state, SunDir, state.dataWindowComplexManager->Back_Incident, @@ -958,35 +959,6 @@ namespace WindowComplexManager { } } - void DetermineMaxBackSurfaces(EnergyPlusData &state) - { - - // SUBROUTINE INFORMATION: - // AUTHOR Joe Klems - // DATE WRITTEN September 2011 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // Calculates the basis length for a Window6 Non-Symmetric or Axisymmetric basis - // from the input basis matrix - - int NumSurfInZone(0); // Number of zone surfaces - bool ComplexFenInZone(false); - - for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { - ComplexFenInZone = false; - for (int SurfNum = state.dataHeatBal->Zone(ZoneNum).HTSurfaceFirst; SurfNum <= state.dataHeatBal->Zone(ZoneNum).HTSurfaceLast; - ++SurfNum) { - if (state.dataSurface->SurfWinWindowModelType(SurfNum) == WindowBSDFModel) ComplexFenInZone = true; - } - if (ComplexFenInZone) { - NumSurfInZone = state.dataHeatBal->Zone(ZoneNum).HTSurfaceLast - state.dataHeatBal->Zone(ZoneNum).HTSurfaceFirst + 1; - if (state.dataBSDFWindow->MaxBkSurf < NumSurfInZone) state.dataBSDFWindow->MaxBkSurf = NumSurfInZone; - } - } - } - void ConstructBasis(EnergyPlusData &state, int const IConst, // Index for accessing Construct array BasisStruct &Basis) @@ -2914,8 +2886,8 @@ namespace WindowComplexManager { state.dataSurface->Surface(SurfNum).ViewFactorGroundIR * Ebout + OutSrdIR; } - hin = state.dataHeatBal->HConvIn(SurfNum); // Room-side surface convective film conductance - ibc(2) = 0; // convective coefficient on indoor side will be recalculated (like in Winkelmann routines) + hin = state.dataHeatBalSurf->SurfHConvInt(SurfNum); // Room-side surface convective film conductance + ibc(2) = 0; // convective coefficient on indoor side will be recalculated (like in Winkelmann routines) // hcout=HextConvCoeff ! Exterior convection coefficient is passed in from outer routine hout = HextConvCoeff; // Exterior convection coefficient is passed in from outer routine @@ -3323,7 +3295,7 @@ namespace WindowComplexManager { // Window heat balance solution has converged. state.dataSurface->SurfWinWindowCalcIterationsRep(SurfNum) = NumOfIterations; - state.dataHeatBal->HConvIn(SurfNum) = hcin; + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = hcin; // For interior shade, add convective gain from glass/shade gap air flow to zone convective gain; // For all cases, get total window heat gain for reporting. See CalcWinFrameAndDividerTemps for diff --git a/src/EnergyPlus/WindowComplexManager.hh b/src/EnergyPlus/WindowComplexManager.hh index 0701612278e..bd5bfcbfbc6 100644 --- a/src/EnergyPlus/WindowComplexManager.hh +++ b/src/EnergyPlus/WindowComplexManager.hh @@ -154,8 +154,6 @@ namespace WindowComplexManager { int &NBasis // Calculated Basis length ); - void DetermineMaxBackSurfaces(EnergyPlusData &state); - void ConstructBasis(EnergyPlusData &state, int const IConst, // Index for accessing Construct array BasisStruct &Basis); diff --git a/src/EnergyPlus/WindowEquivalentLayer.cc b/src/EnergyPlus/WindowEquivalentLayer.cc index 15b48ea9be5..84c1f9edf19 100644 --- a/src/EnergyPlus/WindowEquivalentLayer.cc +++ b/src/EnergyPlus/WindowEquivalentLayer.cc @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -725,7 +726,7 @@ void EQLWindowSurfaceHeatBalance(EnergyPlusData &state, ConvHeatFlowNatural = 0.0; EQLNum = state.dataConstruction->Construct(ConstrNum).EQLConsPtr; - HcIn = state.dataHeatBal->HConvIn(SurfNum); // windows inside surface convective film conductance + HcIn = state.dataHeatBalSurf->SurfHConvInt(SurfNum); // windows inside surface convective film conductance if (CalcCondition == DataBSDFWindow::Condition::Unassigned) { ZoneNum = state.dataSurface->Surface(SurfNum).Zone; @@ -8212,7 +8213,7 @@ void CalcEQLOpticalProperty(EnergyPlusData &state, ConstrNum = state.dataSurface->Surface(SurfNum).Construction; EQLNum = state.dataConstruction->Construct(state.dataSurface->Surface(SurfNum).Construction).EQLConsPtr; if (BeamDIffFlag != SolarArrays::DIFF) { - if (state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum) <= 0.0) return; + if (state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum) <= 0.0) return; for (Lay = 1; Lay <= CFS(EQLNum).NL; ++Lay) { if (IsVBLayer(CFS(EQLNum).L(Lay))) { @@ -8224,7 +8225,7 @@ void CalcEQLOpticalProperty(EnergyPlusData &state, } } // Incident angle - IncAng = std::acos(state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum)); + IncAng = std::acos(state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum)); CalcEQLWindowOpticalProperty(state, CFS(EQLNum), BeamDIffFlag, Abs1, IncAng, ProfAngVer, ProfAngHor); CFSAbs(1, {1, CFSMAXNL + 1}) = Abs1(1, {1, CFSMAXNL + 1}); CFSAbs(2, {1, CFSMAXNL + 1}) = Abs1(2, {1, CFSMAXNL + 1}); @@ -8239,7 +8240,7 @@ void CalcEQLOpticalProperty(EnergyPlusData &state, } } } - IncAng = std::acos(state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum)); + IncAng = std::acos(state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum)); CalcEQLWindowOpticalProperty(state, CFS(EQLNum), BeamDIffFlag, Abs1, IncAng, ProfAngVer, ProfAngHor); CFSAbs(_, {1, CFSMAXNL + 1}) = Abs1(_, {1, CFSMAXNL + 1}); state.dataWindowEquivalentLayer->CFSDiffAbsTrans(_, {1, CFSMAXNL + 1}, EQLNum) = Abs1(_, {1, CFSMAXNL + 1}); diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index 5372b26d3fd..3f1f34827bc 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -2317,7 +2317,7 @@ namespace WindowManager { state.dataWindowManager->thetas(i) = window.ThetaFace(i); } state.dataWindowManager->hcout = HextConvCoeff; - state.dataWindowManager->hcin = state.dataHeatBal->HConvIn(SurfNum); + state.dataWindowManager->hcin = state.dataHeatBalSurf->SurfHConvInt(SurfNum); state.dataWindowManager->tin = state.dataHeatBalFanSys->MAT(surface.Zone) + state.dataWindowManager->TKelvin; // Inside air temperature // This is code repeating and it is necessary to calculate report variables. Do not know @@ -2403,7 +2403,7 @@ namespace WindowManager { state.dataWindowManager->tilt = surface.Tilt; state.dataWindowManager->tiltr = state.dataWindowManager->tilt * DataGlobalConstants::DegToRadians; SurfNumAdj = surface.ExtBoundCond; - state.dataWindowManager->hcin = state.dataHeatBal->HConvIn(SurfNum); // Room-side surface convective film conductance + state.dataWindowManager->hcin = state.dataHeatBalSurf->SurfHConvInt(SurfNum); // Room-side surface convective film conductance // determine reference air temperature for this surface { @@ -2464,7 +2464,7 @@ namespace WindowManager { state.dataHeatBal->LowHConvLimit) { // may be redundent now, check is also in HeatBalanceConvectionCoeffs.cc // hcin = 3.076d0 !BG this is rather high value and abrupt change. changed to set to lower limit state.dataWindowManager->hcin = state.dataHeatBal->LowHConvLimit; - state.dataHeatBal->HConvIn(SurfNum) = state.dataWindowManager->hcin; // store for accurate reporting. + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataWindowManager->hcin; // store for accurate reporting. } } @@ -2866,17 +2866,17 @@ namespace WindowManager { InsideGlassTemp = state.dataWindowManager->thetas(2 * state.dataWindowManager->ngllayer) - state.dataWindowManager->TKelvin; RoomHumRat = state.dataHeatBalFanSys->ZoneAirHumRat(surface.Zone); RoomDewPoint = PsyTdpFnWPb(state, RoomHumRat, state.dataEnvrn->OutBaroPress); - state.dataSurface->InsideGlassCondensationFlag(SurfNum) = 0; - if (InsideGlassTemp < RoomDewPoint) state.dataSurface->InsideGlassCondensationFlag(SurfNum) = 1; + state.dataSurface->SurfWinInsideGlassCondensationFlag(SurfNum) = 0; + if (InsideGlassTemp < RoomDewPoint) state.dataSurface->SurfWinInsideGlassCondensationFlag(SurfNum) = 1; // If airflow window, is there condensation on either glass face of the airflow gap? if (state.dataSurface->SurfWinAirflowThisTS(SurfNum) > 0.0) { Tleft = state.dataWindowManager->thetas(2 * state.dataWindowManager->ngllayer - 2) - state.dataWindowManager->TKelvin; Tright = state.dataWindowManager->thetas(2 * state.dataWindowManager->ngllayer - 1) - state.dataWindowManager->TKelvin; if (state.dataSurface->SurfWinAirflowSource(SurfNum) == AirFlowWindow_Source_IndoorAir) { - if (Tleft < RoomDewPoint || Tright < RoomDewPoint) state.dataSurface->InsideGlassCondensationFlag(SurfNum) = 1; + if (Tleft < RoomDewPoint || Tright < RoomDewPoint) state.dataSurface->SurfWinInsideGlassCondensationFlag(SurfNum) = 1; } else if (state.dataSurface->SurfWinAirflowSource(SurfNum) == AirFlowWindow_Source_OutdoorAir) { if (Tleft < state.dataEnvrn->OutDewPointTemp || Tright < state.dataEnvrn->OutDewPointTemp) - state.dataSurface->InsideGlassCondensationFlag(SurfNum) = 1; + state.dataSurface->SurfWinInsideGlassCondensationFlag(SurfNum) = 1; } } @@ -2891,13 +2891,13 @@ namespace WindowManager { state.dataWindowManager->Outir, ConstrNum); if (state.dataSurface->SurfWinFrameArea(SurfNum) > 0.0) { - state.dataSurface->InsideFrameCondensationFlag(SurfNum) = 0; - if (state.dataSurface->SurfWinFrameTempSurfIn(SurfNum) < RoomDewPoint) state.dataSurface->InsideFrameCondensationFlag(SurfNum) = 1; + state.dataSurface->SurfWinInsideFrameCondensationFlag(SurfNum) = 0; + if (state.dataSurface->SurfWinFrameTempIn(SurfNum) < RoomDewPoint) state.dataSurface->SurfWinInsideFrameCondensationFlag(SurfNum) = 1; } if (state.dataSurface->SurfWinDividerArea(SurfNum) > 0.0) { - state.dataSurface->InsideDividerCondensationFlag(SurfNum) = 0; - if (state.dataSurface->SurfWinDividerTempSurfIn(SurfNum) < RoomDewPoint) - state.dataSurface->InsideDividerCondensationFlag(SurfNum) = 1; + state.dataSurface->SurfWinInsideDividerCondensationFlag(SurfNum) = 0; + if (state.dataSurface->SurfWinDividerTempIn(SurfNum) < RoomDewPoint) + state.dataSurface->SurfWinInsideDividerCondensationFlag(SurfNum) = 1; } } // update exterior environment surface heat loss reporting @@ -3332,7 +3332,7 @@ namespace WindowManager { SurfNum, state.dataWindowManager->thetas(InsideFaceIndex) - DataGlobalConstants::KelvinConv, state.dataWindowManager->tin - DataGlobalConstants::KelvinConv); - state.dataWindowManager->hcin = state.dataHeatBal->HConvIn(SurfNum); + state.dataWindowManager->hcin = state.dataHeatBalSurf->SurfHConvInt(SurfNum); } Aface = 0.0; @@ -6243,7 +6243,7 @@ namespace WindowManager { TInRadFr = TInRad * root_4((1.0 + 0.5 * ProjCorrFrIn) / (1.0 + ProjCorrFrIn)); FrameCon = state.dataSurface->SurfWinFrameConductance(SurfNum); HInRad = 0.5 * state.dataSurface->SurfWinFrameEmis(SurfNum) * state.dataWindowManager->sigma * - pow_3(TInRadFr + state.dataSurface->SurfWinFrameTempSurfIn(SurfNum) + state.dataWindowManager->TKelvin); + pow_3(TInRadFr + state.dataSurface->SurfWinFrameTempIn(SurfNum) + state.dataWindowManager->TKelvin); HInConvFr = HInConv; HOutRad = 0.5 * state.dataSurface->SurfWinFrameEmis(SurfNum) * state.dataWindowManager->sigma * pow_3(TOutRadFr + state.dataSurface->SurfWinFrameTempSurfOut(SurfNum) + state.dataWindowManager->TKelvin); @@ -6268,16 +6268,15 @@ namespace WindowManager { Bfac = FrameCon / (HOutRad + FrameCon + HOutConvFr); Dfac = (HInRad * TInRadFr + HInConvFr * tin + state.dataSurface->SurfWinFrameQRadInAbs(SurfNum)) / (HInRad + FrameCon + HInConvFr); Efac = FrameCon / (HInRad + FrameCon + HInConvFr); - state.dataSurface->SurfWinFrameTempSurfIn(SurfNum) = (Dfac + Efac * Afac) / (1.0 - Efac * Bfac) - state.dataWindowManager->TKelvin; + state.dataSurface->SurfWinFrameTempIn(SurfNum) = (Dfac + Efac * Afac) / (1.0 - Efac * Bfac) - state.dataWindowManager->TKelvin; state.dataSurface->SurfWinFrameTempSurfOut(SurfNum) = - Afac + Bfac * (state.dataSurface->SurfWinFrameTempSurfIn(SurfNum) + state.dataWindowManager->TKelvin) - - state.dataWindowManager->TKelvin; + Afac + Bfac * (state.dataSurface->SurfWinFrameTempIn(SurfNum) + state.dataWindowManager->TKelvin) - state.dataWindowManager->TKelvin; // Heat gain to zone from frame FrameHeatTransfer = state.dataSurface->SurfWinFrameArea(SurfNum) * FrameCon * - (state.dataSurface->SurfWinFrameTempSurfOut(SurfNum) - state.dataSurface->SurfWinFrameTempSurfIn(SurfNum)); + (state.dataSurface->SurfWinFrameTempSurfOut(SurfNum) - state.dataSurface->SurfWinFrameTempIn(SurfNum)); FrameHeatGain = state.dataSurface->SurfWinFrameArea(SurfNum) * (1.0 + state.dataSurface->SurfWinProjCorrFrIn(SurfNum)) * - (HInConvFr * (state.dataSurface->SurfWinFrameTempSurfIn(SurfNum) + state.dataWindowManager->TKelvin - tin)); + (HInConvFr * (state.dataSurface->SurfWinFrameTempIn(SurfNum) + state.dataWindowManager->TKelvin - tin)); if (FrameHeatGain > 0.0) { state.dataSurface->SurfWinFrameHeatGain(SurfNum) = FrameHeatGain; @@ -6313,7 +6312,7 @@ namespace WindowManager { TInRadDiv = TInRad * root_4((1.0 + state.dataSurface->SurfWinProjCorrDivIn(SurfNum)) / (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum))); HInRad = 0.5 * DivEmisIn * state.dataWindowManager->sigma * - pow_3(TInRadDiv + state.dataSurface->SurfWinDividerTempSurfIn(SurfNum) + state.dataWindowManager->TKelvin); + pow_3(TInRadDiv + state.dataSurface->SurfWinDividerTempIn(SurfNum) + state.dataWindowManager->TKelvin); HOutRad = 0.5 * DivEmisOut * state.dataWindowManager->sigma * pow_3(TOutRadDiv + state.dataSurface->SurfWinDividerTempSurfOut(SurfNum) + state.dataWindowManager->TKelvin); HOutConvDiv = HOutConv; @@ -6346,17 +6345,17 @@ namespace WindowManager { Bfac = DivCon / (HOutRad + DivCon + HOutConvDiv); Dfac = (HInRad * TInRadDiv + HInConvDiv * tin + state.dataSurface->SurfWinDividerQRadInAbs(SurfNum)) / (HInRad + DivCon + HInConvDiv); Efac = DivCon / (HInRad + DivCon + HInConvDiv); - state.dataSurface->SurfWinDividerTempSurfIn(SurfNum) = (Dfac + Efac * Afac) / (1 - Efac * Bfac) - state.dataWindowManager->TKelvin; + state.dataSurface->SurfWinDividerTempIn(SurfNum) = (Dfac + Efac * Afac) / (1 - Efac * Bfac) - state.dataWindowManager->TKelvin; state.dataSurface->SurfWinDividerTempSurfOut(SurfNum) = - Afac + Bfac * (state.dataSurface->SurfWinDividerTempSurfIn(SurfNum) + state.dataWindowManager->TKelvin) - + Afac + Bfac * (state.dataSurface->SurfWinDividerTempIn(SurfNum) + state.dataWindowManager->TKelvin) - state.dataWindowManager->TKelvin; // Contribution of divider to window heat gain ProjCorrWinHeatGain = 1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum); DividerHeatGain = state.dataSurface->SurfWinDividerArea(SurfNum) * (1.0 + state.dataSurface->SurfWinProjCorrDivIn(SurfNum)) * - (HInConvDiv * (state.dataSurface->SurfWinDividerTempSurfIn(SurfNum) + state.dataWindowManager->TKelvin - tin)); + (HInConvDiv * (state.dataSurface->SurfWinDividerTempIn(SurfNum) + state.dataWindowManager->TKelvin - tin)); DividerHeatTransfer = state.dataSurface->SurfWinDividerArea(SurfNum) * DivCon * - (state.dataSurface->SurfWinDividerTempSurfOut(SurfNum) - state.dataSurface->SurfWinDividerTempSurfIn(SurfNum)); + (state.dataSurface->SurfWinDividerTempSurfOut(SurfNum) - state.dataSurface->SurfWinDividerTempIn(SurfNum)); if (DividerHeatGain > 0.0) { state.dataSurface->SurfWinDividerHeatGain(SurfNum) = DividerHeatGain; diff --git a/src/EnergyPlus/WindowManagerExteriorData.cc b/src/EnergyPlus/WindowManagerExteriorData.cc index 31b5e6fb6ed..18a5d11abd9 100644 --- a/src/EnergyPlus/WindowManagerExteriorData.cc +++ b/src/EnergyPlus/WindowManagerExteriorData.cc @@ -103,7 +103,7 @@ namespace WindowManager { std::pair getSunWCEAngles(EnergyPlusData &state, const int t_SurfNum, const BSDFHemisphere t_Direction) { return getWCECoordinates( - state, t_SurfNum, state.dataBSDFWindow->SUNCOSTS(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, {1, 3}), t_Direction); + state, t_SurfNum, state.dataBSDFWindow->SUNCOSTS(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay), t_Direction); } /////////////////////////////////////////////////////////////////////////////// diff --git a/src/EnergyPlus/WindowManagerExteriorThermal.cc b/src/EnergyPlus/WindowManagerExteriorThermal.cc index f681e9c31a4..7bf86eb5c3b 100644 --- a/src/EnergyPlus/WindowManagerExteriorThermal.cc +++ b/src/EnergyPlus/WindowManagerExteriorThermal.cc @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -162,7 +163,7 @@ namespace WindowManager { } } - state.dataHeatBal->HConvIn(SurfNum) = aSystem->getHc(Environment::Indoor); + state.dataHeatBalSurf->SurfHConvInt(SurfNum) = aSystem->getHc(Environment::Indoor); if (ANY_INTERIOR_SHADE_BLIND(state.dataSurface->SurfWinShadingFlag(SurfNum)) || aFactory.isInteriorShade()) { // It is not clear why EnergyPlus keeps this interior calculations separately for interior shade. This does create different // solution from heat transfer from tarcog itself. Need to confirm with LBNL team about this approach. Note that heat flow @@ -194,8 +195,8 @@ namespace WindowManager { ShadeArea * (glassEmiss * TauShIR / ShGlReflFacIR) * (state.dataWindowManager->sigma * pow(state.dataWindowManager->thetas(state.dataWindowManager->nglface), 4) - rmir); auto tind = surface.getInsideAirTemperature(state, SurfNum) + DataGlobalConstants::KelvinConv; - auto ConvHeatGainFrZoneSideOfShade = - ShadeArea * state.dataHeatBal->HConvIn(SurfNum) * (state.dataWindowManager->thetas(state.dataWindowManager->nglfacep) - tind); + auto ConvHeatGainFrZoneSideOfShade = ShadeArea * state.dataHeatBalSurf->SurfHConvInt(SurfNum) * + (state.dataWindowManager->thetas(state.dataWindowManager->nglfacep) - tind); state.dataSurface->SurfWinHeatGain(SurfNum) = state.dataSurface->SurfWinTransSolar(SurfNum) + ConvHeatGainFrZoneSideOfShade + NetIRHeatGainGlass + NetIRHeatGainShade; state.dataSurface->SurfWinHeatTransfer(SurfNum) = state.dataSurface->SurfWinHeatGain(SurfNum); @@ -619,7 +620,7 @@ namespace WindowManager { // PURPOSE OF THIS SUBROUTINE: // Creates indoor environment object from surface properties in EnergyPlus auto tin = m_Surface.getInsideAirTemperature(state, m_SurfNum) + DataGlobalConstants::KelvinConv; - auto hcin = state.dataHeatBal->HConvIn(m_SurfNum); + auto hcin = state.dataHeatBalSurf->SurfHConvInt(m_SurfNum); auto IR = m_Surface.getInsideIR(state, m_SurfNum); diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index aac9b486854..1defad85871 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -6751,24 +6751,24 @@ void CalcZoneSums(EnergyPlusData &state, // Add to the surface convection sums if (state.dataSurface->SurfWinFrameArea(SurfNum) > 0.0) { // Window frame contribution - Real64 const HA_surf(state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * + Real64 const HA_surf(state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * (1.0 + state.dataSurface->SurfWinProjCorrFrIn(SurfNum))); - SumHATsurf += HA_surf * state.dataSurface->SurfWinFrameTempSurfIn(SurfNum); + SumHATsurf += HA_surf * state.dataSurface->SurfWinFrameTempIn(SurfNum); HA += HA_surf; } if (state.dataSurface->SurfWinDividerArea(SurfNum) > 0.0 && !ANY_INTERIOR_SHADE_BLIND(shading_flag)) { // Window divider contribution (only from shade or blind for window with divider and interior shade or blind) - Real64 const HA_surf(state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * + Real64 const HA_surf(state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum))); - SumHATsurf += HA_surf * state.dataSurface->SurfWinDividerTempSurfIn(SurfNum); + SumHATsurf += HA_surf * state.dataSurface->SurfWinDividerTempIn(SurfNum); HA += HA_surf; } } // End of check if window - HA += state.dataHeatBal->HConvIn(SurfNum) * Area; - SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * Area * state.dataHeatBalSurf->TempSurfInTmp(SurfNum); + HA += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * Area; + SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * Area * state.dataHeatBalSurf->SurfTempInTmp(SurfNum); // determine reference air temperature for this surface { @@ -7093,21 +7093,21 @@ void CalcZoneComponentLoadSums(EnergyPlusData &state, if (state.dataSurface->SurfWinFrameArea(SurfNum) > 0.0) { // Window frame contribution - SumHADTsurfs += state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * + SumHADTsurfs += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinFrameArea(SurfNum) * (1.0 + state.dataSurface->SurfWinProjCorrFrIn(SurfNum)) * - (state.dataSurface->SurfWinFrameTempSurfIn(SurfNum) - RefAirTemp); + (state.dataSurface->SurfWinFrameTempIn(SurfNum) - RefAirTemp); } if (state.dataSurface->SurfWinDividerArea(SurfNum) > 0.0 && !ANY_INTERIOR_SHADE_BLIND(state.dataSurface->SurfWinShadingFlag(SurfNum))) { // Window divider contribution (only from shade or blind for window with divider and interior shade or blind) - SumHADTsurfs += state.dataHeatBal->HConvIn(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * + SumHADTsurfs += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * state.dataSurface->SurfWinDividerArea(SurfNum) * (1.0 + 2.0 * state.dataSurface->SurfWinProjCorrDivIn(SurfNum)) * - (state.dataSurface->SurfWinDividerTempSurfIn(SurfNum) - RefAirTemp); + (state.dataSurface->SurfWinDividerTempIn(SurfNum) - RefAirTemp); } } // End of check if window - SumHADTsurfs += state.dataHeatBal->HConvIn(SurfNum) * Area * (state.dataHeatBalSurf->TempSurfInTmp(SurfNum) - RefAirTemp); + SumHADTsurfs += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * Area * (state.dataHeatBalSurf->SurfTempInTmp(SurfNum) - RefAirTemp); // Accumulate Zone Phase Change Material Melting/Freezing Enthalpy output variables if (state.dataSurface->Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::CondFD) { diff --git a/testfiles/1ZoneUncontrolledWithHysteresisPCM.idf b/testfiles/1ZoneUncontrolledWithHysteresisPCM.idf index d746a3d34b1..cc14411a5e6 100644 --- a/testfiles/1ZoneUncontrolledWithHysteresisPCM.idf +++ b/testfiles/1ZoneUncontrolledWithHysteresisPCM.idf @@ -239,13 +239,13 @@ 2200, !- Liquid State Density {kg/m3} 2000, !- Liquid State Specific Heat {J/kg-K} 1, !- High Temperature Difference of Melting Curve {deltaC} - 20, !- Peak Melting Temperature {C} + 23, !- Peak Melting Temperature {C} 1, !- Low Temperature Difference of Melting Curve {deltaC} 1.8, !- Solid State Thermal Conductivity {W/m-K} 2300, !- Solid State Density {kg/m3} 2000, !- Solid State Specific Heat {J/kg-K} 1, !- High Temperature Difference of Freezing Curve {deltaC} - 23, !- Peak Freezing Temperature {C} + 20, !- Peak Freezing Temperature {C} 1; !- Low Temperature Difference of Freezing Curve {deltaC} Construction, diff --git a/tst/EnergyPlus/unit/AirflowNetworkSolver.unit.cc b/tst/EnergyPlus/unit/AirflowNetworkSolver.unit.cc index b82743fa225..b14993951d6 100644 --- a/tst/EnergyPlus/unit/AirflowNetworkSolver.unit.cc +++ b/tst/EnergyPlus/unit/AirflowNetworkSolver.unit.cc @@ -169,3 +169,93 @@ TEST_F(EnergyPlusFixture, AirflowNetwork_SolverTest_Coil) state->dataAirflowNetwork->DisSysCompCoilData.deallocate(); state->dataAirflowNetwork->AirflowNetworkCompData.deallocate(); } + +TEST_F(EnergyPlusFixture, AirflowNetwork_SolverTest_Crack) +{ + + int NF; + std::array F = {0.0, 0.0}; + std::array DF = {0.0, 0.0}; + + AirflowNetwork::SurfaceCrack crack; + crack.coefficient = 0.001; + crack.exponent = 0.65; + + AirflowNetwork::AirProperties state0, state1; + Real64 sqrt_density = state0.sqrt_density; // = state1.sqrtDensity + Real64 viscosity = state0.viscosity; // = state1.viscosity + + Real64 dp{10.0}; + + // Linear + NF = crack.calculate(*state, true, dp, 0, 1.0, 1.0, state0, state1, F, DF); + EXPECT_EQ(0.01 * sqrt_density / viscosity, F[0]); + EXPECT_EQ(0.0, F[1]); + EXPECT_EQ(0.001 * sqrt_density / viscosity, DF[0]); + EXPECT_EQ(0.0, DF[1]); + EXPECT_EQ(1, NF); + + NF = crack.calculate(*state, true, -dp, 0, 1.0, 1.0, state0, state1, F, DF); + EXPECT_EQ(-0.01 * sqrt_density / viscosity, F[0]); + EXPECT_EQ(0.0, F[1]); + EXPECT_EQ(0.001 * sqrt_density / viscosity, DF[0]); + EXPECT_EQ(0.0, DF[1]); + EXPECT_EQ(1, NF); + + // Turbulent tests + NF = crack.calculate(*state, false, dp, 0, 1.0, 1.0, state0, state1, F, DF); + EXPECT_EQ(0.001 * std::pow(10.0, 0.65), F[0]); + EXPECT_EQ(0.0, F[1]); + EXPECT_DOUBLE_EQ(0.000065 * std::pow(10.0, 0.65), DF[0]); + EXPECT_EQ(0.0, DF[1]); + EXPECT_EQ(1, NF); + + NF = crack.calculate(*state, false, -dp, 0, 1.0, 1.0, state0, state1, F, DF); + EXPECT_EQ(-0.001 * std::pow(10.0, 0.65), F[0]); + EXPECT_EQ(0.0, F[1]); + EXPECT_DOUBLE_EQ(0.000065 * std::pow(10.0, 0.65), DF[0]); + EXPECT_EQ(0.0, DF[1]); + EXPECT_EQ(1, NF); +} + +TEST_F(EnergyPlusFixture, AirflowNetwork_SolverTest_GenericCrack) +{ + + std::array F = {0.0, 0.0}; + std::array DF = {0.0, 0.0}; + + Real64 coef{0.001}; + Real64 expo{0.65}; + + AirflowNetwork::AirProperties state0, state1; + Real64 sqrt_density = state0.sqrt_density; // = state1.sqrtDensity + Real64 viscosity = state0.viscosity; // = state1.viscosity + + Real64 dp{10.0}; + + // Linear + AirflowNetwork::generic_crack(coef, expo, true, dp, state0, state1, F, DF); + EXPECT_EQ(0.01 * sqrt_density / viscosity, F[0]); + EXPECT_EQ(0.0, F[1]); + EXPECT_EQ(0.001 * sqrt_density / viscosity, DF[0]); + EXPECT_EQ(0.0, DF[1]); + + AirflowNetwork::generic_crack(coef, expo, true, -dp, state0, state1, F, DF); + EXPECT_EQ(-0.01 * sqrt_density / viscosity, F[0]); + EXPECT_EQ(0.0, F[1]); + EXPECT_EQ(0.001 * sqrt_density / viscosity, DF[0]); + EXPECT_EQ(0.0, DF[1]); + + // Turbulent tests + AirflowNetwork::generic_crack(coef, expo, false, dp, state0, state1, F, DF); + EXPECT_EQ(0.001 * std::pow(10.0, 0.65), F[0]); + EXPECT_EQ(0.0, F[1]); + EXPECT_DOUBLE_EQ(0.000065 * std::pow(10.0, 0.65), DF[0]); + EXPECT_EQ(0.0, DF[1]); + + AirflowNetwork::generic_crack(coef, expo, false, -dp, state0, state1, F, DF); + EXPECT_EQ(-0.001 * std::pow(10.0, 0.65), F[0]); + EXPECT_EQ(0.0, F[1]); + EXPECT_DOUBLE_EQ(0.000065 * std::pow(10.0, 0.65), DF[0]); + EXPECT_EQ(0.0, DF[1]); +} diff --git a/tst/EnergyPlus/unit/CMakeLists.txt b/tst/EnergyPlus/unit/CMakeLists.txt index c51db85434d..060dfcbc5e5 100644 --- a/tst/EnergyPlus/unit/CMakeLists.txt +++ b/tst/EnergyPlus/unit/CMakeLists.txt @@ -250,11 +250,11 @@ set(test_dependencies energyplusapi) if(LINK_WITH_PYTHON) add_definitions("-DLINK_WITH_PYTHON") find_package(PythonLibs 3 REQUIRED) - include_directories(${PYTHON_INCLUDE_DIRS}) + include_directories(${Python_INCLUDE_DIRS}) if(CMAKE_HOST_UNIX) list(APPEND test_src api/datatransfer.unit.cc) list(APPEND test_src PluginManager.unit.cc) - list(APPEND test_dependencies ${PYTHON_LIBRARIES}) + list(APPEND test_dependencies ${Python_LIBRARIES}) endif() endif() diff --git a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc index 9cd3b0608a8..fbfca19ea0c 100644 --- a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc +++ b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc @@ -1431,11 +1431,11 @@ TEST_F(ConvectionCoefficientsFixture, ConvectionCoefficientsTest_HConvInDependen state->dataSurface->Surface.allocate(1); state->dataSurface->Surface(1).CosTilt = 0; - state->dataHeatBal->HConvIn.allocate(1); + state->dataHeatBalSurf->SurfHConvInt.allocate(1); CalcASHRAESimpleIntConvCoeff(*state, 1, 20.0, 30.0); - ConvectionCoefficient = state->dataHeatBal->HConvIn(1); + ConvectionCoefficient = state->dataHeatBalSurf->SurfHConvInt(1); EXPECT_EQ(ConvectionCoefficient, ExpectedCoefficient); } @@ -1583,14 +1583,14 @@ TEST_F(EnergyPlusFixture, AdaptiveModelSelections_Implicit) ASSERT_TRUE(process_idf(idf_objects)); - state->dataHeatBalSurf->TempSurfInTmp.allocate(6); - state->dataHeatBalSurf->TempSurfInTmp(1) = 15.0; - state->dataHeatBalSurf->TempSurfInTmp(2) = 20.0; - state->dataHeatBalSurf->TempSurfInTmp(3) = 25.0; - state->dataHeatBalSurf->TempSurfInTmp(4) = 25.0; - state->dataHeatBalSurf->TempSurfInTmp(5) = 25.0; - state->dataHeatBalSurf->TempSurfInTmp(6) = 25.0; - ConvectionCoefficients::InitInteriorConvectionCoeffs(*state, state->dataHeatBalSurf->TempSurfInTmp); + state->dataHeatBalSurf->SurfTempInTmp.allocate(6); + state->dataHeatBalSurf->SurfTempInTmp(1) = 15.0; + state->dataHeatBalSurf->SurfTempInTmp(2) = 20.0; + state->dataHeatBalSurf->SurfTempInTmp(3) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(4) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(5) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(6) = 25.0; + ConvectionCoefficients::InitInteriorConvectionCoeffs(*state, state->dataHeatBalSurf->SurfTempInTmp); int algorithm_identifier; @@ -1698,7 +1698,7 @@ TEST_F(EnergyPlusFixture, AdaptiveModelSelections_Implicit) algorithm_identifier = state->dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatUnstableHorizEqNum; ASSERT_EQ(algorithm_identifier, HcExt_NaturalWaltonUnstableHorizontalOrTilt); - state->dataHeatBalSurf->TempSurfInTmp.deallocate(); + state->dataHeatBalSurf->SurfTempInTmp.deallocate(); } TEST_F(EnergyPlusFixture, AdaptiveModelSelections_ExplicitSelection) @@ -1822,14 +1822,14 @@ TEST_F(EnergyPlusFixture, AdaptiveModelSelections_ExplicitSelection) ASSERT_TRUE(process_idf(idf_objects)); - state->dataHeatBalSurf->TempSurfInTmp.allocate(6); - state->dataHeatBalSurf->TempSurfInTmp(1) = 15.0; - state->dataHeatBalSurf->TempSurfInTmp(2) = 20.0; - state->dataHeatBalSurf->TempSurfInTmp(3) = 25.0; - state->dataHeatBalSurf->TempSurfInTmp(4) = 25.0; - state->dataHeatBalSurf->TempSurfInTmp(5) = 25.0; - state->dataHeatBalSurf->TempSurfInTmp(6) = 25.0; - ConvectionCoefficients::InitInteriorConvectionCoeffs(*state, state->dataHeatBalSurf->TempSurfInTmp); + state->dataHeatBalSurf->SurfTempInTmp.allocate(6); + state->dataHeatBalSurf->SurfTempInTmp(1) = 15.0; + state->dataHeatBalSurf->SurfTempInTmp(2) = 20.0; + state->dataHeatBalSurf->SurfTempInTmp(3) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(4) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(5) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(6) = 25.0; + ConvectionCoefficients::InitInteriorConvectionCoeffs(*state, state->dataHeatBalSurf->SurfTempInTmp); ConvectionCoefficients::GetUserConvectionCoefficients(*state); int algorithm_identifier; @@ -1938,7 +1938,7 @@ TEST_F(EnergyPlusFixture, AdaptiveModelSelections_ExplicitSelection) algorithm_identifier = state->dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatUnstableHorizEqNum; ASSERT_EQ(algorithm_identifier, HcExt_NaturalWaltonUnstableHorizontalOrTilt); - state->dataHeatBalSurf->TempSurfInTmp.deallocate(); + state->dataHeatBalSurf->SurfTempInTmp.deallocate(); } TEST_F(ConvectionCoefficientsFixture, TestASTMC1340) diff --git a/tst/EnergyPlus/unit/DaylightingManager.unit.cc b/tst/EnergyPlus/unit/DaylightingManager.unit.cc index b691140bf67..4940f21b9ab 100644 --- a/tst/EnergyPlus/unit/DaylightingManager.unit.cc +++ b/tst/EnergyPlus/unit/DaylightingManager.unit.cc @@ -838,6 +838,7 @@ TEST_F(EnergyPlusFixture, DaylightingManager_GetDaylParamInGeoTrans_Test) EXPECT_FALSE(foundErrors); // expect no errors HeatBalanceIntRadExchange::InitSolarViewFactors(*state); + int const HoursInDay(24); state->dataGlobal->NumOfTimeStepInHour = 1; // must initialize this to get schedules initialized state->dataGlobal->MinutesPerTimeStep = 60; // must initialize this to get schedules initialized ScheduleManager::ProcessScheduleInput(*state); @@ -884,7 +885,10 @@ TEST_F(EnergyPlusFixture, DaylightingManager_GetDaylParamInGeoTrans_Test) state->dataGlobal->WeightNow = 1.0; state->dataGlobal->WeightPreviousHour = 0.0; - state->dataSurface->SurfSunCosHourly.dimension(24, 3, 0.0); + state->dataSurface->SurfSunCosHourly.allocate(HoursInDay); + for (int hour = 1; hour <= HoursInDay; hour++) { + state->dataSurface->SurfSunCosHourly(hour) = 0.0; + } CalcDayltgCoefficients(*state); int zoneNum = 1; // test that tmp arrays are allocated to correct dimension @@ -2112,6 +2116,7 @@ TEST_F(EnergyPlusFixture, DaylightingManager_OutputFormats) EXPECT_FALSE(foundErrors); // expect no errors HeatBalanceIntRadExchange::InitSolarViewFactors(*state); + int const HoursInDay(24); state->dataGlobal->NumOfTimeStepInHour = 1; // must initialize this to get schedules initialized state->dataGlobal->MinutesPerTimeStep = 60; // must initialize this to get schedules initialized ScheduleManager::ProcessScheduleInput(*state); @@ -2162,7 +2167,10 @@ TEST_F(EnergyPlusFixture, DaylightingManager_OutputFormats) state->dataGlobal->BeginSimFlag = true; state->dataGlobal->WeightNow = 1.0; state->dataGlobal->WeightPreviousHour = 0.0; - state->dataSurface->SurfSunCosHourly.dimension(24, 3, 0.0); + state->dataSurface->SurfSunCosHourly.allocate(HoursInDay); + for (int hour = 1; hour <= HoursInDay; hour++) { + state->dataSurface->SurfSunCosHourly(hour) = 0.0; + } CalcDayltgCoefficients(*state); int zoneNum = 1; // test that tmp arrays are allocated to correct dimension @@ -2855,8 +2863,11 @@ TEST_F(EnergyPlusFixture, DaylightingManager_TDD_NoDaylightingControls) state->dataSurfaceGeometry->SinZoneRelNorth(2) = std::sin(-state->dataHeatBal->Zone(2).RelNorth * DataGlobalConstants::DegToRadians); state->dataSurfaceGeometry->CosBldgRelNorth = 1.0; state->dataSurfaceGeometry->SinBldgRelNorth = 0.0; - state->dataSurface->SurfSunCosHourly.dimension(24, 3, 0.0); - + int const HoursInDay(24); + state->dataSurface->SurfSunCosHourly.allocate(HoursInDay); + for (int hour = 1; hour <= HoursInDay; hour++) { + state->dataSurface->SurfSunCosHourly(hour) = 0.0; + } SurfaceGeometry::GetSurfaceData(*state, foundErrors); // setup zone geometry and get zone data EXPECT_FALSE(foundErrors); // expect no errors diff --git a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc index 5ec84a1cc5e..a07327da1b1 100644 --- a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc +++ b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc @@ -79,7 +79,7 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataRoomAirMod->IsZoneDV(1) = true; state->dataSurface->Surface.allocate(TotSurfaces); state->dataHeatBal->SurfTempEffBulkAir.allocate(TotSurfaces); - state->dataHeatBalSurf->TempSurfIn.allocate(TotSurfaces); + state->dataHeatBalSurf->SurfTempIn.allocate(TotSurfaces); state->dataRoomAirMod->DVHcIn.allocate(TotSurfaces); state->dataRoomAirMod->ZTMX.allocate(state->dataGlobal->NumOfZones); state->dataRoomAirMod->ZTOC.allocate(state->dataGlobal->NumOfZones); @@ -226,9 +226,9 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataRoomAirMod->ZTMX(1) = 20.0; state->dataRoomAirMod->ZTOC(1) = 21.0; - state->dataHeatBalSurf->TempSurfIn(1) = 23.0; - state->dataHeatBalSurf->TempSurfIn(2) = 23.0; - state->dataHeatBalSurf->TempSurfIn(3) = 23.0; + state->dataHeatBalSurf->SurfTempIn(1) = 23.0; + state->dataHeatBalSurf->SurfTempIn(2) = 23.0; + state->dataHeatBalSurf->SurfTempIn(3) = 23.0; HcUCSDDV(*state, 1, 0.5); @@ -243,7 +243,7 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataRoomAirMod->IsZoneDV.deallocate(); state->dataSurface->Surface.deallocate(); state->dataHeatBal->SurfTempEffBulkAir.deallocate(); - state->dataHeatBalSurf->TempSurfIn.deallocate(); + state->dataHeatBalSurf->SurfTempIn.deallocate(); state->dataRoomAirMod->DVHcIn.deallocate(); state->dataRoomAirMod->ZTMX.deallocate(); state->dataRoomAirMod->ZTOC.deallocate(); diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index bb42e4cf0e8..e879d9175df 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -608,8 +608,38 @@ TEST_F(AirLoopFixture, VRF_SysModel_inAirloop) SimVRF(*state, curTUNum, FirstHVACIteration, OnOffAirFlowRatio, SysOutputProvided, LatOutputProvided, QZnReq); EXPECT_LT(SysOutputProvided, 0.0); + // TU outlet is at set point = 20 EXPECT_NEAR(state->dataLoopNodes->Node(thisTU.VRFTUOutletNodeNum).Temp, thisTU.coilTempSetPoint, 0.01); - EXPECT_NEAR(state->dataLoopNodes->Node(thisTU.VRFTUOutletNodeNum).Temp, 20.0, 0.01); // TU outlet is at set point = 20 + EXPECT_NEAR(state->dataLoopNodes->Node(thisTU.VRFTUOutletNodeNum).Temp, 20.0, 0.01); + + // outdoor unit operation is within min/max operating limits + EXPECT_TRUE(state->dataHVACVarRefFlow->CoolingLoad(state->dataHVACVarRefFlow->NumVRFCond)); + EXPECT_FALSE(state->dataHVACVarRefFlow->HeatingLoad(state->dataHVACVarRefFlow->NumVRFCond)); + EXPECT_LE(state->dataHVACVarRefFlow->VRF(curSysNum).MinOATCooling, + state->dataLoopNodes->Node(state->dataHVACVarRefFlow->VRF(curSysNum).CondenserNodeNum).Temp); + EXPECT_GE(state->dataHVACVarRefFlow->VRF(curSysNum).MaxOATCooling, + state->dataLoopNodes->Node(state->dataHVACVarRefFlow->VRF(curSysNum).CondenserNodeNum).Temp); + + // save and adjust operating limit to disable outdoor unit. Output should be 0. + Real64 saveMaxOATCooling = state->dataHVACVarRefFlow->VRF(curSysNum).MaxOATCooling; + state->dataHVACVarRefFlow->VRF(curSysNum).MaxOATCooling = + -1.0 + state->dataLoopNodes->Node(state->dataHVACVarRefFlow->VRF(curSysNum).CondenserNodeNum).Temp; + InitVRF(*state, curTUNum, curZoneNum, FirstHVACIteration, OnOffAirFlowRatio, QZnReq); + SimVRF(*state, curTUNum, FirstHVACIteration, OnOffAirFlowRatio, SysOutputProvided, LatOutputProvided, QZnReq); + EXPECT_NEAR(SysOutputProvided, 0.0, 0.00000001); + // reset max operating limit + state->dataHVACVarRefFlow->VRF(curSysNum).MaxOATCooling = saveMaxOATCooling; + + Real64 saveMinOATCooling = state->dataHVACVarRefFlow->VRF(curSysNum).MinOATCooling; + state->dataHVACVarRefFlow->VRF(curSysNum).MinOATCooling = + 1.0 + state->dataLoopNodes->Node(state->dataHVACVarRefFlow->VRF(curSysNum).CondenserNodeNum).Temp; + InitVRF(*state, curTUNum, curZoneNum, FirstHVACIteration, OnOffAirFlowRatio, QZnReq); + SimVRF(*state, curTUNum, FirstHVACIteration, OnOffAirFlowRatio, SysOutputProvided, LatOutputProvided, QZnReq); + EXPECT_NEAR(SysOutputProvided, 0.0, 0.00000001); + EXPECT_FALSE(state->dataHVACVarRefFlow->CoolingLoad(state->dataHVACVarRefFlow->NumVRFCond)); + EXPECT_FALSE(state->dataHVACVarRefFlow->HeatingLoad(state->dataHVACVarRefFlow->NumVRFCond)); + // reset min operating limit + state->dataHVACVarRefFlow->VRF(curSysNum).MinOATCooling = saveMinOATCooling; tuInletNode.Temp = 18.0; tuInletNode.HumRat = 0.007; @@ -637,6 +667,35 @@ TEST_F(AirLoopFixture, VRF_SysModel_inAirloop) EXPECT_NEAR(state->dataLoopNodes->Node(thisTU.VRFTUOutletNodeNum).Temp, thisTU.coilTempSetPoint, 0.01); // TU outlet is at SP target EXPECT_NEAR(state->dataLoopNodes->Node(thisTU.VRFTUOutletNodeNum).Temp, 20.0, 0.01); + // outdoor unit operation is within min/max operating limits + EXPECT_TRUE(state->dataHVACVarRefFlow->HeatingLoad(state->dataHVACVarRefFlow->NumVRFCond)); + EXPECT_FALSE(state->dataHVACVarRefFlow->CoolingLoad(state->dataHVACVarRefFlow->NumVRFCond)); + EXPECT_LE(state->dataHVACVarRefFlow->VRF(curSysNum).MinOATHeating, + state->dataLoopNodes->Node(state->dataHVACVarRefFlow->VRF(curSysNum).CondenserNodeNum).Temp); + EXPECT_GE(state->dataHVACVarRefFlow->VRF(curSysNum).MaxOATHeating, + state->dataLoopNodes->Node(state->dataHVACVarRefFlow->VRF(curSysNum).CondenserNodeNum).Temp); + + // save and adjust operating limit to disable outdoor unit. Output should be 0. + Real64 saveMaxOATHeating = state->dataHVACVarRefFlow->VRF(curSysNum).MaxOATHeating; + state->dataHVACVarRefFlow->VRF(curSysNum).MaxOATHeating = + -1.0 + state->dataLoopNodes->Node(state->dataHVACVarRefFlow->VRF(curSysNum).CondenserNodeNum).Temp; + InitVRF(*state, curTUNum, curZoneNum, FirstHVACIteration, OnOffAirFlowRatio, QZnReq); + SimVRF(*state, curTUNum, FirstHVACIteration, OnOffAirFlowRatio, SysOutputProvided, LatOutputProvided, QZnReq); + EXPECT_NEAR(SysOutputProvided, 0.0, 0.00000001); + // reset max operating limit + state->dataHVACVarRefFlow->VRF(curSysNum).MaxOATHeating = saveMaxOATHeating; + + Real64 saveMinOATHeating = state->dataHVACVarRefFlow->VRF(curSysNum).MinOATHeating; + state->dataHVACVarRefFlow->VRF(curSysNum).MinOATHeating = + 1.0 + state->dataLoopNodes->Node(state->dataHVACVarRefFlow->VRF(curSysNum).CondenserNodeNum).Temp; + InitVRF(*state, curTUNum, curZoneNum, FirstHVACIteration, OnOffAirFlowRatio, QZnReq); + SimVRF(*state, curTUNum, FirstHVACIteration, OnOffAirFlowRatio, SysOutputProvided, LatOutputProvided, QZnReq); + EXPECT_NEAR(SysOutputProvided, 0.0, 0.00000001); + EXPECT_FALSE(state->dataHVACVarRefFlow->CoolingLoad(state->dataHVACVarRefFlow->NumVRFCond)); + EXPECT_FALSE(state->dataHVACVarRefFlow->HeatingLoad(state->dataHVACVarRefFlow->NumVRFCond)); + // reset min operating limit + state->dataHVACVarRefFlow->VRF(curSysNum).MinOATHeating = saveMinOATHeating; + // switch to load based control state->dataLoopNodes->Node(curZoneNum).Temp = 20.0; // set zone temp in heating mode thisTU.isSetPointControlled = false; @@ -2421,7 +2480,7 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_VRFOU_Compressor) Real64 const P_evap_real = 509784; // Evaporative pressure at real conditions [Pa] Real64 const T_comp_in_real = 0.65; // Temperature of the refrigerant at the compressor inlet at real conditions [C] Real64 const T_comp_in_rate = -5.35; // Temperature of the refrigerant at the compressor inlet at rated conditions [C] - Real64 const T_cond_out_rate = 31.38; // Temperature of the refrigerant at the condensor outlet at rated conditions [C] + Real64 const T_cond_out_rate = 31.38; // Temperature of the refrigerant at the condenser outlet at rated conditions [C] Real64 C_cap_operation; // Run diff --git a/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc index 3442883758c..58df7071424 100644 --- a/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc @@ -1237,13 +1237,13 @@ TEST_F(EnergyPlusFixture, HeatBalanceManager_TestZonePropertyLocalEnv) state->dataHeatBal->SurfTempEffBulkAir.allocate(6); - state->dataHeatBal->HConvIn.allocate(6); - state->dataHeatBal->HConvIn(1) = 0.5; - state->dataHeatBal->HConvIn(2) = 0.5; - state->dataHeatBal->HConvIn(3) = 0.5; - state->dataHeatBal->HConvIn(4) = 0.5; - state->dataHeatBal->HConvIn(5) = 0.5; - state->dataHeatBal->HConvIn(6) = 0.5; + state->dataHeatBalSurf->SurfHConvInt.allocate(6); + state->dataHeatBalSurf->SurfHConvInt(1) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(2) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(3) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(4) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(5) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(6) = 0.5; state->dataGlobal->KickOffSimulation = true; state->dataHeatBalFanSys->ZoneLatentGain.allocate(1); diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index 209229288d8..86ba42fdf4b 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -110,21 +110,21 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_CalcOutsideSurfTemp) state->dataMaterial->Material.allocate(1); state->dataMaterial->Material(1).Name = "TestMaterial"; - state->dataHeatBalSurf->HcExtSurf.allocate(SurfNum); - state->dataHeatBalSurf->HcExtSurf(SurfNum) = 1.0; - state->dataHeatBalSurf->HAirExtSurf.allocate(SurfNum); - state->dataHeatBalSurf->HAirExtSurf(SurfNum) = 1.0; - state->dataHeatBalSurf->HSkyExtSurf.allocate(SurfNum); - state->dataHeatBalSurf->HSkyExtSurf(SurfNum) = 1.0; - state->dataHeatBalSurf->HGrdExtSurf.allocate(SurfNum); - state->dataHeatBalSurf->HGrdExtSurf(SurfNum) = 1.0; - - state->dataHeatBalSurf->CTFConstOutPart.allocate(SurfNum); - state->dataHeatBalSurf->CTFConstOutPart(SurfNum) = 1.0; + state->dataHeatBalSurf->SurfHcExt.allocate(SurfNum); + state->dataHeatBalSurf->SurfHcExt(SurfNum) = 1.0; + state->dataHeatBalSurf->SurfHAirExt.allocate(SurfNum); + state->dataHeatBalSurf->SurfHAirExt(SurfNum) = 1.0; + state->dataHeatBalSurf->SurfHSkyExt.allocate(SurfNum); + state->dataHeatBalSurf->SurfHSkyExt(SurfNum) = 1.0; + state->dataHeatBalSurf->SurfHGrdExt.allocate(SurfNum); + state->dataHeatBalSurf->SurfHGrdExt(SurfNum) = 1.0; + + state->dataHeatBalSurf->SurfCTFConstOutPart.allocate(SurfNum); + state->dataHeatBalSurf->SurfCTFConstOutPart(SurfNum) = 1.0; state->dataHeatBalSurf->SurfOpaqQRadSWOutAbs.allocate(SurfNum); state->dataHeatBalSurf->SurfOpaqQRadSWOutAbs(SurfNum) = 1.0; - state->dataHeatBalSurf->TempSurfIn.allocate(SurfNum); - state->dataHeatBalSurf->TempSurfIn(SurfNum) = 1.0; + state->dataHeatBalSurf->SurfTempIn.allocate(SurfNum); + state->dataHeatBalSurf->SurfTempIn(SurfNum) = 1.0; state->dataHeatBalSurf->SurfQRadSWOutMvIns.allocate(SurfNum); state->dataHeatBalSurf->SurfQRadSWOutMvIns(SurfNum) = 1.0; state->dataHeatBalSurf->SurfQRadLWOutSrdSurfs.allocate(SurfNum); @@ -332,15 +332,15 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_UpdateFinalThermalHistories) state->dataConstruction->Construct(1).CTFTUserIn(0) = 0.25; state->dataConstruction->Construct(1).CTFTUserSource(0) = 0.25; - state->dataHeatBalSurf->SUMH(1) = 0; + state->dataHeatBalSurf->SurfCurrNumHist(1) = 0; state->dataHeatBalSurf->TH(1, 1, 1) = 20.0; - state->dataHeatBalSurf->TempSurfIn(1) = 10.0; + state->dataHeatBalSurf->SurfTempIn(1) = 10.0; state->dataHeatBalFanSys->CTFTuserConstPart(1) = 0.0; UpdateThermalHistories(*state); // First check to see if it is calculating the user location temperature properly - EXPECT_EQ(12.5, state->dataHeatBalSurf->TempUserLoc(1)); + EXPECT_EQ(12.5, state->dataHeatBalSurf->SurfTempUserLoc(1)); EXPECT_EQ(0.0, state->dataHeatBalSurf->TuserHist(1, 3)); UpdateThermalHistories(*state); @@ -741,13 +741,13 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI state->dataLoopNodes->Node.allocate(4); - state->dataHeatBalSurf->TempSurfInTmp.allocate(6); - state->dataHeatBalSurf->TempSurfInTmp(1) = 15.0; - state->dataHeatBalSurf->TempSurfInTmp(2) = 20.0; - state->dataHeatBalSurf->TempSurfInTmp(3) = 25.0; - state->dataHeatBalSurf->TempSurfInTmp(4) = 25.0; - state->dataHeatBalSurf->TempSurfInTmp(5) = 25.0; - state->dataHeatBalSurf->TempSurfInTmp(6) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp.allocate(6); + state->dataHeatBalSurf->SurfTempInTmp(1) = 15.0; + state->dataHeatBalSurf->SurfTempInTmp(2) = 20.0; + state->dataHeatBalSurf->SurfTempInTmp(3) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(4) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(5) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(6) = 25.0; state->dataLoopNodes->Node(1).Temp = 20.0; state->dataLoopNodes->Node(2).Temp = 20.0; @@ -765,13 +765,13 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI state->dataHeatBalSurf->TH(1, 1, 4) = 20; state->dataHeatBalSurf->TH(1, 1, 5) = 20; state->dataHeatBalSurf->TH(1, 1, 6) = 20; - state->dataHeatBal->HConvIn.allocate(6); - state->dataHeatBal->HConvIn(1) = 0.5; - state->dataHeatBal->HConvIn(2) = 0.5; - state->dataHeatBal->HConvIn(3) = 0.5; - state->dataHeatBal->HConvIn(4) = 0.5; - state->dataHeatBal->HConvIn(5) = 0.5; - state->dataHeatBal->HConvIn(6) = 0.5; + state->dataHeatBalSurf->SurfHConvInt.allocate(6); + state->dataHeatBalSurf->SurfHConvInt(1) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(2) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(3) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(4) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(5) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(6) = 0.5; state->dataMstBal->HConvInFD.allocate(6); state->dataMstBal->RhoVaporAirIn.allocate(6); state->dataMstBal->HMassConvInFD.allocate(6); @@ -810,9 +810,9 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI state->dataHeatBalFanSys->ZoneAirHumRat.deallocate(); state->dataLoopNodes->Node.deallocate(); state->dataGlobal->KickOffSimulation = false; - state->dataHeatBalSurf->TempSurfInTmp.deallocate(); + state->dataHeatBalSurf->SurfTempInTmp.deallocate(); state->dataHeatBalSurf->TH.deallocate(); - state->dataHeatBal->HConvIn.deallocate(); + state->dataHeatBalSurf->SurfHConvInt.deallocate(); state->dataMstBal->HConvInFD.deallocate(); state->dataMstBal->RhoVaporAirIn.deallocate(); state->dataMstBal->HMassConvInFD.deallocate(); @@ -1277,13 +1277,13 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertyLocalEnv) state->dataLoopNodes->Node.allocate(4); - state->dataHeatBalSurf->TempSurfInTmp.allocate(6); - state->dataHeatBalSurf->TempSurfInTmp(1) = 15.0; - state->dataHeatBalSurf->TempSurfInTmp(2) = 20.0; - state->dataHeatBalSurf->TempSurfInTmp(3) = 25.0; - state->dataHeatBalSurf->TempSurfInTmp(4) = 25.0; - state->dataHeatBalSurf->TempSurfInTmp(5) = 25.0; - state->dataHeatBalSurf->TempSurfInTmp(6) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp.allocate(6); + state->dataHeatBalSurf->SurfTempInTmp(1) = 15.0; + state->dataHeatBalSurf->SurfTempInTmp(2) = 20.0; + state->dataHeatBalSurf->SurfTempInTmp(3) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(4) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(5) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(6) = 25.0; state->dataLoopNodes->Node(1).Temp = 20.0; state->dataLoopNodes->Node(2).Temp = 20.0; @@ -1301,13 +1301,13 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertyLocalEnv) state->dataHeatBalSurf->TH(1, 1, 4) = 20; state->dataHeatBalSurf->TH(1, 1, 5) = 20; state->dataHeatBalSurf->TH(1, 1, 6) = 20; - state->dataHeatBal->HConvIn.allocate(6); - state->dataHeatBal->HConvIn(1) = 0.5; - state->dataHeatBal->HConvIn(2) = 0.5; - state->dataHeatBal->HConvIn(3) = 0.5; - state->dataHeatBal->HConvIn(4) = 0.5; - state->dataHeatBal->HConvIn(5) = 0.5; - state->dataHeatBal->HConvIn(6) = 0.5; + state->dataHeatBalSurf->SurfHConvInt.allocate(6); + state->dataHeatBalSurf->SurfHConvInt(1) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(2) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(3) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(4) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(5) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(6) = 0.5; state->dataMstBal->HConvInFD.allocate(6); state->dataMstBal->RhoVaporAirIn.allocate(6); state->dataMstBal->HMassConvInFD.allocate(6); @@ -1361,8 +1361,8 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertyLocalEnv) CalcHeatBalanceOutsideSurf(*state); Real64 HExt_Expect_Surf1 = ConvectionCoefficients::CalcASHRAESimpExtConvectCoeff(5, 1.5); Real64 HExt_Expect_Surf2 = ConvectionCoefficients::CalcASHRAESimpExtConvectCoeff(5, 0.0); - EXPECT_EQ(HExt_Expect_Surf1, state->dataHeatBalSurf->HcExtSurf(1)); - EXPECT_EQ(HExt_Expect_Surf2, state->dataHeatBalSurf->HcExtSurf(2)); + EXPECT_EQ(HExt_Expect_Surf1, state->dataHeatBalSurf->SurfHcExt(1)); + EXPECT_EQ(HExt_Expect_Surf2, state->dataHeatBalSurf->SurfHcExt(2)); } TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) @@ -1853,13 +1853,13 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) state->dataLoopNodes->Node.allocate(4); - state->dataHeatBalSurf->TempSurfInTmp.allocate(6); - state->dataHeatBalSurf->TempSurfInTmp(1) = 15.0; - state->dataHeatBalSurf->TempSurfInTmp(2) = 20.0; - state->dataHeatBalSurf->TempSurfInTmp(3) = 25.0; - state->dataHeatBalSurf->TempSurfInTmp(4) = 25.0; - state->dataHeatBalSurf->TempSurfInTmp(5) = 25.0; - state->dataHeatBalSurf->TempSurfInTmp(6) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp.allocate(6); + state->dataHeatBalSurf->SurfTempInTmp(1) = 15.0; + state->dataHeatBalSurf->SurfTempInTmp(2) = 20.0; + state->dataHeatBalSurf->SurfTempInTmp(3) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(4) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(5) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(6) = 25.0; state->dataLoopNodes->Node(1).Temp = 20.0; state->dataLoopNodes->Node(2).Temp = 20.0; @@ -1871,13 +1871,13 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) state->dataLoopNodes->Node(4).MassFlowRate = 0.1; state->dataHeatBalSurf->TH.allocate(2, 2, 6); - state->dataHeatBal->HConvIn.allocate(6); - state->dataHeatBal->HConvIn(1) = 0.5; - state->dataHeatBal->HConvIn(2) = 0.5; - state->dataHeatBal->HConvIn(3) = 0.5; - state->dataHeatBal->HConvIn(4) = 0.5; - state->dataHeatBal->HConvIn(5) = 0.5; - state->dataHeatBal->HConvIn(6) = 0.5; + state->dataHeatBalSurf->SurfHConvInt.allocate(6); + state->dataHeatBalSurf->SurfHConvInt(1) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(2) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(3) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(4) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(5) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(6) = 0.5; state->dataMstBal->HConvInFD.allocate(6); state->dataMstBal->RhoVaporAirIn.allocate(6); state->dataMstBal->HMassConvInFD.allocate(6); @@ -1928,10 +1928,10 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) // Test if sky and grd view factor and temperature correctly overwritten EXPECT_DOUBLE_EQ((DataGlobalConstants::StefanBoltzmann * 0.9 * 0.3 * (pow_4(20.0 + DataGlobalConstants::KelvinConv) - pow_4(15.0 + DataGlobalConstants::KelvinConv)) / (20.0 - 15.0)), - state->dataHeatBalSurf->HSkyExtSurf(1)); + state->dataHeatBalSurf->SurfHSkyExt(1)); EXPECT_DOUBLE_EQ((DataGlobalConstants::StefanBoltzmann * 0.9 * 0.1 * (pow_4(20.0 + DataGlobalConstants::KelvinConv) - pow_4(22.0 + DataGlobalConstants::KelvinConv)) / (20.0 - 22.0)), - state->dataHeatBalSurf->HGrdExtSurf(1)); + state->dataHeatBalSurf->SurfHGrdExt(1)); // Test if LWR from surrounding surfaces correctly calculated EXPECT_DOUBLE_EQ(DataGlobalConstants::StefanBoltzmann * 0.9 * 0.6 * @@ -2421,13 +2421,13 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceA state->dataLoopNodes->Node.allocate(4); - state->dataHeatBalSurf->TempSurfInTmp.allocate(6); - state->dataHeatBalSurf->TempSurfInTmp(1) = 15.0; - state->dataHeatBalSurf->TempSurfInTmp(2) = 20.0; - state->dataHeatBalSurf->TempSurfInTmp(3) = 25.0; - state->dataHeatBalSurf->TempSurfInTmp(4) = 25.0; - state->dataHeatBalSurf->TempSurfInTmp(5) = 25.0; - state->dataHeatBalSurf->TempSurfInTmp(6) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp.allocate(6); + state->dataHeatBalSurf->SurfTempInTmp(1) = 15.0; + state->dataHeatBalSurf->SurfTempInTmp(2) = 20.0; + state->dataHeatBalSurf->SurfTempInTmp(3) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(4) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(5) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(6) = 25.0; state->dataLoopNodes->Node(1).Temp = 20.0; state->dataLoopNodes->Node(2).Temp = 20.0; @@ -2445,13 +2445,13 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceA state->dataHeatBalSurf->TH(1, 1, 4) = 20; state->dataHeatBalSurf->TH(1, 1, 5) = 20; state->dataHeatBalSurf->TH(1, 1, 6) = 20; - state->dataHeatBal->HConvIn.allocate(6); - state->dataHeatBal->HConvIn(1) = 0.5; - state->dataHeatBal->HConvIn(2) = 0.5; - state->dataHeatBal->HConvIn(3) = 0.5; - state->dataHeatBal->HConvIn(4) = 0.5; - state->dataHeatBal->HConvIn(5) = 0.5; - state->dataHeatBal->HConvIn(6) = 0.5; + state->dataHeatBalSurf->SurfHConvInt.allocate(6); + state->dataHeatBalSurf->SurfHConvInt(1) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(2) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(3) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(4) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(5) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(6) = 0.5; state->dataMstBal->HConvInFD.allocate(6); state->dataMstBal->RhoVaporAirIn.allocate(6); state->dataMstBal->HMassConvInFD.allocate(6); @@ -2493,10 +2493,10 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceA state->dataHeatBalFanSys->ZoneAirHumRat.deallocate(); state->dataLoopNodes->Node.deallocate(); state->dataGlobal->KickOffSimulation = false; - state->dataHeatBalSurf->TempSurfInTmp.deallocate(); + state->dataHeatBalSurf->SurfTempInTmp.deallocate(); state->dataHeatBal->SurfTempEffBulkAir.deallocate(); state->dataHeatBalSurf->TH.deallocate(); - state->dataHeatBal->HConvIn.deallocate(); + state->dataHeatBalSurf->SurfHConvInt.deallocate(); state->dataMstBal->HConvInFD.deallocate(); state->dataMstBal->RhoVaporAirIn.deallocate(); state->dataMstBal->HMassConvInFD.deallocate(); @@ -2514,31 +2514,31 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestReportIntMovInsInsideSur state->dataSurface->TotSurfaces = 2; state->dataSurface->Surface.allocate(state->dataSurface->TotSurfaces); - state->dataHeatBalSurf->TempSurfIn.allocate(state->dataSurface->TotSurfaces); - state->dataHeatBalSurf->TempSurfInTmp.allocate(state->dataSurface->TotSurfaces); - state->dataHeatBalSurf->TempSurfInMovInsRep.allocate(state->dataSurface->TotSurfaces); + state->dataHeatBalSurf->SurfTempIn.allocate(state->dataSurface->TotSurfaces); + state->dataHeatBalSurf->SurfTempInTmp.allocate(state->dataSurface->TotSurfaces); + state->dataHeatBalSurf->SurfTempInMovInsRep.allocate(state->dataSurface->TotSurfaces); state->dataHeatBalSurf->SurfMovInsulIntPresent.allocate(state->dataSurface->TotSurfaces); state->dataSurface->AnyMovableInsulation = true; state->dataHeatBalSurf->SurfMovInsulIndexList.push_back(1); state->dataHeatBalSurf->SurfMovInsulIndexList.push_back(2); // Test 1 Data: Surface does NOT have movable insulation state->dataHeatBalSurf->SurfMovInsulIntPresent(1) = false; // No movable insulation - state->dataHeatBalSurf->TempSurfIn(1) = 23.0; - state->dataHeatBalSurf->TempSurfInTmp(1) = 12.3; - state->dataHeatBalSurf->TempSurfInMovInsRep(1) = 1.23; - ExpectedResult1 = 23.0; // TempSurfInMovInsRep should be set to TempSurfIn + state->dataHeatBalSurf->SurfTempIn(1) = 23.0; + state->dataHeatBalSurf->SurfTempInTmp(1) = 12.3; + state->dataHeatBalSurf->SurfTempInMovInsRep(1) = 1.23; + ExpectedResult1 = 23.0; // SurfTempInMovInsRep should be set to SurfTempIn // Test 2 Data: Surface has movable insulation state->dataHeatBalSurf->SurfMovInsulIntPresent(2) = true; - state->dataHeatBalSurf->TempSurfIn(2) = 123.0; - state->dataHeatBalSurf->TempSurfInTmp(2) = 12.3; - state->dataHeatBalSurf->TempSurfInMovInsRep(2) = 1.23; - ExpectedResult2 = 12.3; // TempSurfInMovInsRep should be set to TempSurfIn + state->dataHeatBalSurf->SurfTempIn(2) = 123.0; + state->dataHeatBalSurf->SurfTempInTmp(2) = 12.3; + state->dataHeatBalSurf->SurfTempInMovInsRep(2) = 1.23; + ExpectedResult2 = 12.3; // SurfTempInMovInsRep should be set to SurfTempIn // Now call the subroutine which will run all of the test cases at once and then make the comparisons HeatBalanceSurfaceManager::ReportIntMovInsInsideSurfTemp(*state); - EXPECT_NEAR(state->dataHeatBalSurf->TempSurfInMovInsRep(1), ExpectedResult1, 0.00001); - EXPECT_NEAR(state->dataHeatBalSurf->TempSurfInMovInsRep(2), ExpectedResult2, 0.00001); + EXPECT_NEAR(state->dataHeatBalSurf->SurfTempInMovInsRep(1), ExpectedResult1, 0.00001); + EXPECT_NEAR(state->dataHeatBalSurf->SurfTempInMovInsRep(2), ExpectedResult2, 0.00001); } TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_OutsideSurfHeatBalanceWhenRainFlag) @@ -2546,11 +2546,11 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_OutsideSurfHeatBalanceWhenRa state->dataSurface->Surface.allocate(1); state->dataSurface->SurfOutWetBulbTemp.allocate(1); state->dataSurface->SurfOutDryBulbTemp.allocate(1); - state->dataHeatBalSurf->HcExtSurf.allocate(1); + state->dataHeatBalSurf->SurfHcExt.allocate(1); state->dataHeatBalSurf->TH.allocate(1, 1, 1); state->dataSurface->Surface(1).Area = 58.197; - state->dataHeatBalSurf->HcExtSurf(1) = 1000; + state->dataHeatBalSurf->SurfHcExt(1) = 1000; state->dataHeatBalSurf->TH(1, 1, 1) = 6.71793958923051; state->dataSurface->SurfOutWetBulbTemp(1) = 6.66143784594778; state->dataSurface->SurfOutDryBulbTemp(1) = 7.2; @@ -2563,7 +2563,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_OutsideSurfHeatBalanceWhenRa // Otherwise, GetQdotConvOutRep uses Outdoor Air Dry Bulb Temp. state->dataEnvrn->IsRain = false; - state->dataHeatBalSurf->HcExtSurf(1) = 5.65361106051348; + state->dataHeatBalSurf->SurfHcExt(1) = 5.65361106051348; Real64 ExpectedQconvPerArea2 = -5.65361106051348 * (6.71793958923051 - 7.2); EXPECT_NEAR(ExpectedQconvPerArea2, GetQdotConvOutRepPerArea(*state, 1), 0.01); @@ -2602,26 +2602,26 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestInterzoneRadFactorCalc) ComputeDifSolExcZonesWIZWindows(*state, state->dataGlobal->NumOfZones); - EXPECT_EQ(1, state->dataHeatBalSurf->FractDifShortZtoZ(1, 1)); - EXPECT_EQ(1, state->dataHeatBalSurf->FractDifShortZtoZ(2, 2)); - EXPECT_FALSE(state->dataHeatBalSurf->RecDifShortFromZ(1)); - EXPECT_FALSE(state->dataHeatBalSurf->RecDifShortFromZ(2)); + EXPECT_EQ(1, state->dataHeatBalSurf->ZoneFractDifShortZtoZ(1, 1)); + EXPECT_EQ(1, state->dataHeatBalSurf->ZoneFractDifShortZtoZ(2, 2)); + EXPECT_FALSE(state->dataHeatBalSurf->EnclSolRecDifShortFromZ(1)); + EXPECT_FALSE(state->dataHeatBalSurf->EnclSolRecDifShortFromZ(2)); state->dataHeatBal->Zone(1).HasInterZoneWindow = true; state->dataHeatBal->Zone(2).HasInterZoneWindow = true; ComputeDifSolExcZonesWIZWindows(*state, state->dataGlobal->NumOfZones); - EXPECT_TRUE(state->dataHeatBalSurf->RecDifShortFromZ(1)); - EXPECT_TRUE(state->dataHeatBalSurf->RecDifShortFromZ(2)); + EXPECT_TRUE(state->dataHeatBalSurf->EnclSolRecDifShortFromZ(1)); + EXPECT_TRUE(state->dataHeatBalSurf->EnclSolRecDifShortFromZ(2)); state->dataGlobal->KickOffSimulation = true; ComputeDifSolExcZonesWIZWindows(*state, state->dataGlobal->NumOfZones); - EXPECT_EQ(1, state->dataHeatBalSurf->FractDifShortZtoZ(1, 1)); - EXPECT_EQ(1, state->dataHeatBalSurf->FractDifShortZtoZ(2, 2)); - EXPECT_FALSE(state->dataHeatBalSurf->RecDifShortFromZ(1)); - EXPECT_FALSE(state->dataHeatBalSurf->RecDifShortFromZ(2)); + EXPECT_EQ(1, state->dataHeatBalSurf->ZoneFractDifShortZtoZ(1, 1)); + EXPECT_EQ(1, state->dataHeatBalSurf->ZoneFractDifShortZtoZ(2, 2)); + EXPECT_FALSE(state->dataHeatBalSurf->EnclSolRecDifShortFromZ(1)); + EXPECT_FALSE(state->dataHeatBalSurf->EnclSolRecDifShortFromZ(2)); } TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestResilienceMetricReport) @@ -3082,10 +3082,10 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestInitHBInterzoneWindow) state->dataHeatBalFanSys->MAT.allocate(1); // Zone temperature C state->dataHeatBalFanSys->ZoneAirHumRat.allocate(1); - state->dataHeatBalSurf->TempSurfInTmp.allocate(6); + state->dataHeatBalSurf->SurfTempInTmp.allocate(6); state->dataHeatBalSurf->TH.allocate(2, 2, 6); - state->dataHeatBal->HConvIn.allocate(6); + state->dataHeatBalSurf->SurfHConvInt.allocate(6); state->dataMstBal->HConvInFD.allocate(6); state->dataMstBal->RhoVaporAirIn.allocate(6); state->dataMstBal->HMassConvInFD.allocate(6); @@ -3107,14 +3107,14 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestInitHBInterzoneWindow) InitSurfaceHeatBalance(*state); EXPECT_FALSE(state->dataHeatBalSurf->InterZoneWindow); - EXPECT_FALSE(allocated(state->dataHeatBalSurf->FractDifShortZtoZ)); + EXPECT_FALSE(allocated(state->dataHeatBalSurf->ZoneFractDifShortZtoZ)); state->dataGlobal->BeginSimFlag = false; state->dataHeatBalSurf->InterZoneWindow = true; InitSurfaceHeatBalance(*state); - EXPECT_TRUE(allocated(state->dataHeatBalSurf->FractDifShortZtoZ)); - EXPECT_EQ(1, state->dataHeatBalSurf->FractDifShortZtoZ(1, 1)); + EXPECT_TRUE(allocated(state->dataHeatBalSurf->ZoneFractDifShortZtoZ)); + EXPECT_EQ(1, state->dataHeatBalSurf->ZoneFractDifShortZtoZ(1, 1)); // bypass internal solar distribution at night state->dataHeatBalSurf->InterZoneWindow = false; diff --git a/tst/EnergyPlus/unit/HybridModel.unit.cc b/tst/EnergyPlus/unit/HybridModel.unit.cc index 748abe11189..053e494cd97 100644 --- a/tst/EnergyPlus/unit/HybridModel.unit.cc +++ b/tst/EnergyPlus/unit/HybridModel.unit.cc @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -164,7 +165,7 @@ TEST_F(EnergyPlusFixture, HybridModel_CorrectZoneAirTempTest) state->dataHeatBalFanSys->MCPTC(1) = 0.0; state->dataSurface->SurfaceWindow.allocate(1); state->dataSurface->Surface.allocate(2); - state->dataHeatBal->HConvIn.allocate(1); + state->dataHeatBalSurf->SurfHConvInt.allocate(1); state->dataHeatBal->SNLoadHeatRate.allocate(1); state->dataHeatBal->SNLoadCoolRate.allocate(1); state->dataHeatBal->SNLoadHeatEnergy.allocate(1); @@ -584,7 +585,7 @@ TEST_F(EnergyPlusFixture, HybridModel_CorrectZoneAirTempTest) state->dataHeatBalFanSys->MCPTC.deallocate(); state->dataSurface->SurfaceWindow.deallocate(); state->dataSurface->Surface.deallocate(); - state->dataHeatBal->HConvIn.deallocate(); + state->dataHeatBalSurf->SurfHConvInt.deallocate(); state->dataZoneTempPredictorCorrector->ZoneAirRelHum.deallocate(); state->dataRoomAirMod->IsZoneDV.deallocate(); state->dataRoomAirMod->IsZoneCV.deallocate(); @@ -671,7 +672,7 @@ TEST_F(EnergyPlusFixture, HybridModel_CorrectZoneContaminantsTest) state->dataHeatBalFanSys->MCPTC(1) = 0.0; state->dataSurface->SurfaceWindow.allocate(1); state->dataSurface->Surface.allocate(2); - state->dataHeatBal->HConvIn.allocate(1); + state->dataHeatBalSurf->SurfHConvInt.allocate(1); state->dataZoneTempPredictorCorrector->ZoneAirRelHum.allocate(1); state->dataRoomAirMod->IsZoneDV.dimension(1, false); state->dataRoomAirMod->IsZoneCV.dimension(1, false); @@ -912,7 +913,7 @@ TEST_F(EnergyPlusFixture, HybridModel_CorrectZoneContaminantsTest) state->dataHeatBalFanSys->MCPTC.deallocate(); state->dataSurface->SurfaceWindow.deallocate(); state->dataSurface->Surface.deallocate(); - state->dataHeatBal->HConvIn.deallocate(); + state->dataHeatBalSurf->SurfHConvInt.deallocate(); state->dataZoneTempPredictorCorrector->ZoneAirRelHum.deallocate(); state->dataRoomAirMod->IsZoneDV.deallocate(); state->dataRoomAirMod->IsZoneCV.deallocate(); diff --git a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc index 4114037901b..f66c15b0c1c 100644 --- a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc +++ b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc @@ -2931,8 +2931,8 @@ TEST_F(LowTempRadiantSystemTest, setRadiantSystemControlTemperatureTest) state->dataHeatBalFanSys->MAT.allocate(1); state->dataHeatBal->ZoneMRT.allocate(1); state->dataHeatBal->Zone.allocate(1); - state->dataHeatBalSurf->TempSurfIn.allocate(1); - state->dataHeatBalSurf->TempUserLoc.allocate(1); + state->dataHeatBalSurf->SurfTempIn.allocate(1); + state->dataHeatBalSurf->SurfTempUserLoc.allocate(1); state->dataLowTempRadSys->HydrRadSys.allocate(1); state->dataLowTempRadSys->CFloRadSys.allocate(1); state->dataLowTempRadSys->ElecRadSys.allocate(1); @@ -2942,8 +2942,8 @@ TEST_F(LowTempRadiantSystemTest, setRadiantSystemControlTemperatureTest) state->dataHeatBal->ZoneMRT(1) = 12.345; state->dataHeatBal->Zone(1).OutDryBulbTemp = 34.567; state->dataHeatBal->Zone(1).OutWetBulbTemp = 1.234; - state->dataHeatBalSurf->TempSurfIn(1) = 5.678; - state->dataHeatBalSurf->TempUserLoc(1) = 7.890; + state->dataHeatBalSurf->SurfTempIn(1) = 5.678; + state->dataHeatBalSurf->SurfTempUserLoc(1) = 7.890; state->dataLowTempRadSys->HydrRadSys(1).ZonePtr = 1; state->dataLowTempRadSys->HydrRadSys(1).SurfacePtr.allocate(1); state->dataLowTempRadSys->HydrRadSys(1).SurfacePtr(1) = 1; @@ -3056,19 +3056,19 @@ TEST_F(LowTempRadiantSystemTest, setRadiantSystemControlTemperatureTest) // Test 6: Surface Inside Face Temperature Control state->dataLowTempRadSys->HydrRadSys(1).ControlType = LowTempRadiantControlTypes::SurfFaceTempControl; - expectedResult = state->dataHeatBalSurf->TempSurfIn(1); + expectedResult = state->dataHeatBalSurf->SurfTempIn(1); actualResult = 0.0; // reset actualResult = state->dataLowTempRadSys->HydrRadSys(1).setRadiantSystemControlTemperature(*state, state->dataLowTempRadSys->HydrRadSys(1).ControlType); EXPECT_NEAR(expectedResult, actualResult, acceptibleError); state->dataLowTempRadSys->CFloRadSys(1).ControlType = LowTempRadiantControlTypes::SurfFaceTempControl; - expectedResult = state->dataHeatBalSurf->TempSurfIn(1); + expectedResult = state->dataHeatBalSurf->SurfTempIn(1); actualResult = 0.0; // reset actualResult = state->dataLowTempRadSys->CFloRadSys(1).setRadiantSystemControlTemperature(*state, state->dataLowTempRadSys->CFloRadSys(1).ControlType); EXPECT_NEAR(expectedResult, actualResult, acceptibleError); state->dataLowTempRadSys->ElecRadSys(1).ControlType = LowTempRadiantControlTypes::SurfFaceTempControl; - expectedResult = state->dataHeatBalSurf->TempSurfIn(1); + expectedResult = state->dataHeatBalSurf->SurfTempIn(1); actualResult = 0.0; // reset actualResult = state->dataLowTempRadSys->ElecRadSys(1).setRadiantSystemControlTemperature(*state, state->dataLowTempRadSys->ElecRadSys(1).ControlType); @@ -3076,19 +3076,19 @@ TEST_F(LowTempRadiantSystemTest, setRadiantSystemControlTemperatureTest) // Test 7: Surface Inside (within the slab) Temperature Control state->dataLowTempRadSys->HydrRadSys(1).ControlType = LowTempRadiantControlTypes::SurfIntTempControl; - expectedResult = state->dataHeatBalSurf->TempUserLoc(1); + expectedResult = state->dataHeatBalSurf->SurfTempUserLoc(1); actualResult = 0.0; // reset actualResult = state->dataLowTempRadSys->HydrRadSys(1).setRadiantSystemControlTemperature(*state, state->dataLowTempRadSys->HydrRadSys(1).ControlType); EXPECT_NEAR(expectedResult, actualResult, acceptibleError); state->dataLowTempRadSys->CFloRadSys(1).ControlType = LowTempRadiantControlTypes::SurfIntTempControl; - expectedResult = state->dataHeatBalSurf->TempUserLoc(1); + expectedResult = state->dataHeatBalSurf->SurfTempUserLoc(1); actualResult = 0.0; // reset actualResult = state->dataLowTempRadSys->CFloRadSys(1).setRadiantSystemControlTemperature(*state, state->dataLowTempRadSys->CFloRadSys(1).ControlType); EXPECT_NEAR(expectedResult, actualResult, acceptibleError); state->dataLowTempRadSys->ElecRadSys(1).ControlType = LowTempRadiantControlTypes::SurfIntTempControl; - expectedResult = state->dataHeatBalSurf->TempUserLoc(1); + expectedResult = state->dataHeatBalSurf->SurfTempUserLoc(1); actualResult = 0.0; // reset actualResult = state->dataLowTempRadSys->ElecRadSys(1).setRadiantSystemControlTemperature(*state, state->dataLowTempRadSys->ElecRadSys(1).ControlType); diff --git a/tst/EnergyPlus/unit/MoistureBalanceEMPD.unit.cc b/tst/EnergyPlus/unit/MoistureBalanceEMPD.unit.cc index ed94743bf0b..840c1dd79f2 100644 --- a/tst/EnergyPlus/unit/MoistureBalanceEMPD.unit.cc +++ b/tst/EnergyPlus/unit/MoistureBalanceEMPD.unit.cc @@ -360,11 +360,11 @@ TEST_F(EnergyPlusFixture, CheckEMPDCalc_Slope) auto const &material(state->dataMaterial->Material(1)); Real64 Tsat(0.0); - state->dataHeatBalSurf->TempSurfIn.allocate(surfNum); - state->dataHeatBalSurf->TempSurfIn(surfNum) = 20.0; + state->dataHeatBalSurf->SurfTempIn.allocate(surfNum); + state->dataHeatBalSurf->SurfTempIn(surfNum) = 20.0; // Calculate average vapor density [kg/m^3] - Real64 Taver = state->dataHeatBalSurf->TempSurfIn(surfNum); + Real64 Taver = state->dataHeatBalSurf->SurfTempIn(surfNum); // Calculate RH for use in material property calculations. Real64 RV_Deep_Old = state->dataMstBalEMPD->RVdeepOld(surfNum); Real64 RVaver = state->dataMstBalEMPD->RVSurfLayerOld(surfNum); diff --git a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc index ea15a74cd9b..18d9305a4c0 100644 --- a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc @@ -439,16 +439,35 @@ TEST_F(EnergyPlusFixture, PackagedTerminalHP_VSCoils_Sizing) ASSERT_TRUE(process_idf(idf_objects)); - // Test for #7053: - // Fake that there is at least one UnitarySystemPerformance:Multispeed object - UnitarySystems::DesignSpecMSHP fakeDesignSpecMSHP; - state->dataUnitarySystems->designSpecMSHP.push_back(fakeDesignSpecMSHP); - bool ErrorsFound(false); GetZoneData(*state, ErrorsFound); GetZoneEquipmentData(*state); GetPTUnit(*state); + // Test for #8812: + // Verify zone sizing check if airflow is Autosized to prevent hard crash + state->dataSize->CurZoneEqNum = 1; + state->dataSize->ZoneSizingRunDone = false; + state->dataPTHP->PTUnit(1).HVACSizingIndex = 0; + state->dataPTHP->PTUnit(1).CoolOutAirVolFlow = AutoSize; + EXPECT_THROW(SizePTUnit(*state, 1), std::runtime_error); + std::string const error_string = delimited_string({ + " ** Severe ** For autosizing of ZoneHVAC:WaterToAirHeatPump ZONE WSHP, a zone sizing run must be done.", + " ** ~~~ ** No \"Sizing:Zone\" objects were entered.", + " ** ~~~ ** The \"SimulationControl\" object did not have the field \"Do Zone Sizing Calculation\" set to Yes.", + " ** Fatal ** Program terminates due to previously shown condition(s).", + " ...Summary of Errors that led to program termination:", + " ..... Reference severe error count=1", + " ..... Last severe error=For autosizing of ZoneHVAC:WaterToAirHeatPump ZONE WSHP, a zone sizing run must be done.", + }); + + EXPECT_TRUE(compare_err_stream(error_string, true)); + + // Test for #7053: + // Fake that there is at least one UnitarySystemPerformance:Multispeed object + UnitarySystems::DesignSpecMSHP fakeDesignSpecMSHP; + state->dataUnitarySystems->designSpecMSHP.push_back(fakeDesignSpecMSHP); + state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); diff --git a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc index d49a3efeba8..13dd4ff29d8 100644 --- a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc +++ b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc @@ -112,8 +112,8 @@ class RoomAirflowNetworkTest : public EnergyPlusFixture state->dataLoopNodes->Node.allocate(state->dataLoopNodes->NumOfNodes); state->dataSurface->Surface.allocate(NumOfSurfaces); state->dataSurface->SurfTAirRef.allocate(NumOfSurfaces); - state->dataHeatBal->HConvIn.allocate(NumOfSurfaces); - state->dataHeatBalSurf->TempSurfInTmp.allocate(NumOfSurfaces); + state->dataHeatBalSurf->SurfHConvInt.allocate(NumOfSurfaces); + state->dataHeatBalSurf->SurfTempInTmp.allocate(NumOfSurfaces); state->dataMstBalEMPD->RVSurface.allocate(NumOfSurfaces); state->dataMstBalEMPD->RVSurfaceOld.allocate(NumOfSurfaces); state->dataMstBalEMPD->RVDeepLayer.allocate(NumOfSurfaces); @@ -286,22 +286,22 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) state->dataLoopNodes->Node(1).MassFlowRate = 0.01; state->dataHeatBalFanSys->MAT(1) = 20.0; - state->dataHeatBal->HConvIn(1) = 1.0; - state->dataHeatBal->HConvIn(2) = 1.0; - state->dataHeatBalSurf->TempSurfInTmp(1) = 25.0; - state->dataHeatBalSurf->TempSurfInTmp(2) = 30.0; + state->dataHeatBalSurf->SurfHConvInt(1) = 1.0; + state->dataHeatBalSurf->SurfHConvInt(2) = 1.0; + state->dataHeatBalSurf->SurfTempInTmp(1) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(2) = 30.0; state->dataMstBal->RhoVaporAirIn(1) = PsyRhovFnTdbWPb(state->dataHeatBalFanSys->MAT(ZoneNum), state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum), state->dataEnvrn->OutBaroPress); state->dataMstBal->RhoVaporAirIn(2) = PsyRhovFnTdbWPb(state->dataHeatBalFanSys->MAT(ZoneNum), state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum), state->dataEnvrn->OutBaroPress); state->dataMstBal->HMassConvInFD(1) = - state->dataHeatBal->HConvIn(1) / + state->dataHeatBalSurf->SurfHConvInt(1) / ((PsyRhoAirFnPbTdbW( *state, state->dataEnvrn->OutBaroPress, state->dataHeatBalFanSys->MAT(ZoneNum), state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum)) + state->dataMstBal->RhoVaporAirIn(1)) * PsyCpAirFnW(state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum))); state->dataMstBal->HMassConvInFD(2) = - state->dataHeatBal->HConvIn(2) / + state->dataHeatBalSurf->SurfHConvInt(2) / ((PsyRhoAirFnPbTdbW( *state, state->dataEnvrn->OutBaroPress, state->dataHeatBalFanSys->MAT(ZoneNum), state->dataHeatBalFanSys->ZoneAirHumRat(ZoneNum)) + state->dataMstBal->RhoVaporAirIn(2)) * diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index fcd145a8995..ec333672de8 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -88,26 +88,29 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_CalcPerSolarBeamTest) Real64 AvgEqOfTime(0.0); // Average value of Equation of Time for period Real64 AvgSinSolarDeclin(1.0); // Average value of Sine of Solar Declination for period Real64 AvgCosSolarDeclin(0.0); // Average value of Cosine of Solar Declination for period - int NumTimeSteps(6); + int const NumTimeSteps(6); + int const HoursInDay(24); state->dataGlobal->TimeStep = 1; state->dataSurface->TotSurfaces = 3; state->dataBSDFWindow->MaxBkSurf = 3; state->dataSurface->SurfaceWindow.allocate(state->dataSurface->TotSurfaces); - state->dataHeatBal->SunlitFracHR.allocate(24, state->dataSurface->TotSurfaces); - state->dataHeatBal->SunlitFrac.allocate(NumTimeSteps, 24, state->dataSurface->TotSurfaces); - state->dataHeatBal->SunlitFracWithoutReveal.allocate(NumTimeSteps, 24, state->dataSurface->TotSurfaces); - state->dataSolarShading->CTHETA.allocate(state->dataSurface->TotSurfaces); - state->dataHeatBal->CosIncAngHR.allocate(24, state->dataSurface->TotSurfaces); - state->dataHeatBal->CosIncAng.allocate(NumTimeSteps, 24, state->dataSurface->TotSurfaces); + state->dataHeatBal->SurfSunlitFracHR.allocate(HoursInDay, state->dataSurface->TotSurfaces); + state->dataHeatBal->SurfSunlitFrac.allocate(HoursInDay, NumTimeSteps, state->dataSurface->TotSurfaces); + state->dataHeatBal->SurfSunlitFracWithoutReveal.allocate(HoursInDay, NumTimeSteps, state->dataSurface->TotSurfaces); + state->dataSolarShading->SurfSunCosTheta.allocate(state->dataSurface->TotSurfaces); + state->dataHeatBal->SurfCosIncAngHR.allocate(HoursInDay, state->dataSurface->TotSurfaces); + state->dataHeatBal->SurfCosIncAng.allocate(HoursInDay, NumTimeSteps, state->dataSurface->TotSurfaces); state->dataSurface->SurfOpaqAO.allocate(state->dataSurface->TotSurfaces); - state->dataHeatBal->BackSurfaces.allocate(NumTimeSteps, 24, state->dataBSDFWindow->MaxBkSurf, state->dataSurface->TotSurfaces); - state->dataHeatBal->OverlapAreas.allocate(NumTimeSteps, 24, state->dataBSDFWindow->MaxBkSurf, state->dataSurface->TotSurfaces); - state->dataSurface->SurfSunCosHourly.dimension(24, 3, 0.0); - + state->dataHeatBal->SurfWinBackSurfaces.allocate(HoursInDay, NumTimeSteps, state->dataBSDFWindow->MaxBkSurf, state->dataSurface->TotSurfaces); + state->dataHeatBal->SurfWinOverlapAreas.allocate(HoursInDay, NumTimeSteps, state->dataBSDFWindow->MaxBkSurf, state->dataSurface->TotSurfaces); + state->dataSurface->SurfSunCosHourly.allocate(HoursInDay); + for (int hour = 1; hour <= HoursInDay; hour++) { + state->dataSurface->SurfSunCosHourly(hour) = 0.0; + } // Test non-integrated option first, CalcPerSolarBeam should set OutProjSLFracMult and InOutProjSLFracMult to 1.0 for all hours for (int SurfNum = 1; SurfNum <= state->dataSurface->TotSurfaces; ++SurfNum) { - for (int Hour = 1; Hour <= 24; ++Hour) { + for (int Hour = 1; Hour <= HoursInDay; ++Hour) { state->dataSurface->SurfaceWindow(SurfNum).OutProjSLFracMult(Hour) = 999.0; state->dataSurface->SurfaceWindow(SurfNum).InOutProjSLFracMult(Hour) = 888.0; } @@ -117,7 +120,7 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_CalcPerSolarBeamTest) CalcPerSolarBeam(*state, AvgEqOfTime, AvgSinSolarDeclin, AvgCosSolarDeclin); for (int SurfNum = 1; SurfNum <= state->dataSurface->TotSurfaces; ++SurfNum) { - for (int Hour = 1; Hour <= 24; ++Hour) { + for (int Hour = 1; Hour <= HoursInDay; ++Hour) { EXPECT_EQ(1.0, state->dataSurface->SurfaceWindow(SurfNum).OutProjSLFracMult(Hour)); EXPECT_EQ(1.0, state->dataSurface->SurfaceWindow(SurfNum).InOutProjSLFracMult(Hour)); } @@ -126,7 +129,7 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_CalcPerSolarBeamTest) // Test integrated option, CalcPerSolarBeam should set OutProjSLFracMult and InOutProjSLFracMult to 1.0 only for the specified hour // Re-initialize to new values for (int SurfNum = 1; SurfNum <= state->dataSurface->TotSurfaces; ++SurfNum) { - for (int Hour = 1; Hour <= 24; ++Hour) { + for (int Hour = 1; Hour <= HoursInDay; ++Hour) { state->dataSurface->SurfaceWindow(SurfNum).OutProjSLFracMult(Hour) = 555.0; state->dataSurface->SurfaceWindow(SurfNum).InOutProjSLFracMult(Hour) = 444.0; } @@ -137,7 +140,7 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_CalcPerSolarBeamTest) CalcPerSolarBeam(*state, AvgEqOfTime, AvgSinSolarDeclin, AvgCosSolarDeclin); for (int SurfNum = 1; SurfNum <= state->dataSurface->TotSurfaces; ++SurfNum) { - for (int Hour = 1; Hour <= 24; ++Hour) { + for (int Hour = 1; Hour <= HoursInDay; ++Hour) { if (Hour == state->dataGlobal->HourOfDay) { EXPECT_EQ(1.0, state->dataSurface->SurfaceWindow(SurfNum).OutProjSLFracMult(Hour)); EXPECT_EQ(1.0, state->dataSurface->SurfaceWindow(SurfNum).InOutProjSLFracMult(Hour)); @@ -150,15 +153,15 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_CalcPerSolarBeamTest) // Clean up state->dataSurface->SurfaceWindow.deallocate(); - state->dataHeatBal->SunlitFracHR.deallocate(); - state->dataHeatBal->SunlitFrac.deallocate(); - state->dataHeatBal->SunlitFracWithoutReveal.deallocate(); - state->dataSolarShading->CTHETA.deallocate(); - state->dataHeatBal->CosIncAngHR.deallocate(); - state->dataHeatBal->CosIncAng.deallocate(); + state->dataHeatBal->SurfSunlitFracHR.deallocate(); + state->dataHeatBal->SurfSunlitFrac.deallocate(); + state->dataHeatBal->SurfSunlitFracWithoutReveal.deallocate(); + state->dataSolarShading->SurfSunCosTheta.deallocate(); + state->dataHeatBal->SurfCosIncAngHR.deallocate(); + state->dataHeatBal->SurfCosIncAng.deallocate(); state->dataSurface->SurfOpaqAO.deallocate(); - state->dataHeatBal->BackSurfaces.deallocate(); - state->dataHeatBal->OverlapAreas.deallocate(); + state->dataHeatBal->SurfWinBackSurfaces.deallocate(); + state->dataHeatBal->SurfWinOverlapAreas.deallocate(); } TEST_F(EnergyPlusFixture, SolarShadingTest_SurfaceScheduledSolarInc) @@ -670,8 +673,8 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_FigureSolarBeamAtTimestep) FigureSolarBeamAtTimestep(*state, state->dataGlobal->HourOfDay, state->dataGlobal->TimeStep); int windowSurfNum = UtilityRoutines::FindItemInList("ZN001:WALL-SOUTH:WIN001", state->dataSurface->Surface); - EXPECT_NEAR(0.6504, state->dataHeatBal->DifShdgRatioIsoSkyHRTS(4, 9, windowSurfNum), 0.0001); - EXPECT_NEAR(0.9152, state->dataHeatBal->DifShdgRatioHorizHRTS(4, 9, windowSurfNum), 0.0001); + EXPECT_NEAR(0.6504, state->dataSolarShading->SurfDifShdgRatioIsoSkyHRTS(4, 9, windowSurfNum), 0.0001); + EXPECT_NEAR(0.9152, state->dataSolarShading->SurfDifShdgRatioHorizHRTS(4, 9, windowSurfNum), 0.0001); } TEST_F(EnergyPlusFixture, SolarShadingTest_ExternalShadingIO) @@ -1063,9 +1066,9 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_ExternalShadingIO) state->dataSolarShading->CalcSkyDifShading = false; ScheduleManager::UpdateScheduleValues(*state); - state->dataBSDFWindow->SUNCOSTS(4, 9, 1) = 0.1; - state->dataBSDFWindow->SUNCOSTS(4, 9, 2) = 0.1; - state->dataBSDFWindow->SUNCOSTS(4, 9, 3) = 0.1; + state->dataBSDFWindow->SUNCOSTS(4, 9)(1) = 0.1; + state->dataBSDFWindow->SUNCOSTS(4, 9)(2) = 0.1; + state->dataBSDFWindow->SUNCOSTS(4, 9)(3) = 0.1; FigureSolarBeamAtTimestep(*state, state->dataGlobal->HourOfDay, state->dataGlobal->TimeStep); EXPECT_TRUE(state->dataSysVars->shadingMethod == DataSystemVariables::ShadingMethod::Scheduled); @@ -1076,11 +1079,11 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_ExternalShadingIO) EXPECT_FALSE(state->dataSolarShading->SUNCOS(3) < DataEnvironment::SunIsUpValue); int surfNum = UtilityRoutines::FindItemInList("ZN001:WALL-SOUTH", state->dataSurface->Surface); - EXPECT_DOUBLE_EQ(1, state->dataHeatBal->SunlitFrac(4, 9, surfNum)); + EXPECT_DOUBLE_EQ(1, state->dataHeatBal->SurfSunlitFrac(9, 4, surfNum)); surfNum = UtilityRoutines::FindItemInList("ZN001:WALL-SOUTH:WIN001", state->dataSurface->Surface); - EXPECT_DOUBLE_EQ(1, state->dataHeatBal->SunlitFrac(4, 9, surfNum)); + EXPECT_DOUBLE_EQ(1, state->dataHeatBal->SurfSunlitFrac(9, 4, surfNum)); surfNum = UtilityRoutines::FindItemInList("ZN001:ROOF", state->dataSurface->Surface); - EXPECT_DOUBLE_EQ(0.5432, state->dataHeatBal->SunlitFrac(4, 9, surfNum)); + EXPECT_DOUBLE_EQ(0.5432, state->dataHeatBal->SurfSunlitFrac(9, 4, surfNum)); } TEST_F(EnergyPlusFixture, SolarShadingTest_DisableGroupSelfShading) @@ -1845,8 +1848,8 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_PolygonClippingDirect) FigureSolarBeamAtTimestep(*state, state->dataGlobal->HourOfDay, state->dataGlobal->TimeStep); int surfNum = UtilityRoutines::FindItemInList("ZN001:WALL-SOUTH:WIN001", state->dataSurface->Surface); - EXPECT_NEAR(0.6504, state->dataHeatBal->DifShdgRatioIsoSkyHRTS(4, 9, surfNum), 0.0001); - EXPECT_NEAR(0.9152, state->dataHeatBal->DifShdgRatioHorizHRTS(4, 9, surfNum), 0.0001); + EXPECT_NEAR(0.6504, state->dataSolarShading->SurfDifShdgRatioIsoSkyHRTS(4, 9, surfNum), 0.0001); + EXPECT_NEAR(0.9152, state->dataSolarShading->SurfDifShdgRatioHorizHRTS(4, 9, surfNum), 0.0001); state->dataSysVars->SlaterBarsky = false; } diff --git a/tst/EnergyPlus/unit/ThermalChimney.unit.cc b/tst/EnergyPlus/unit/ThermalChimney.unit.cc index 99d47cc69d0..1bc509ca75c 100644 --- a/tst/EnergyPlus/unit/ThermalChimney.unit.cc +++ b/tst/EnergyPlus/unit/ThermalChimney.unit.cc @@ -1115,18 +1115,18 @@ TEST_F(EnergyPlusFixture, ThermalChimney_EMSAirflow_Test) state->dataHeatBal->Zone(2).HasWindow = true; state->dataHeatBal->Zone(4).HasWindow = true; - state->dataHeatBalSurf->TempSurfIn.allocate(state->dataSurface->TotSurfaces); - state->dataHeatBal->HConvIn.allocate(state->dataSurface->TotSurfaces); - state->dataHeatBal->HConvIn = 0.1; - state->dataHeatBalSurf->TempSurfIn = 25.00; + state->dataHeatBalSurf->SurfTempIn.allocate(state->dataSurface->TotSurfaces); + state->dataHeatBalSurf->SurfHConvInt.allocate(state->dataSurface->TotSurfaces); + state->dataHeatBalSurf->SurfHConvInt = 0.1; + state->dataHeatBalSurf->SurfTempIn = 25.00; int surfNum = UtilityRoutines::FindItemInList("ZN002:WALL001", state->dataSurface->Surface); - state->dataHeatBalSurf->TempSurfIn(surfNum) = 25.92; + state->dataHeatBalSurf->SurfTempIn(surfNum) = 25.92; surfNum = UtilityRoutines::FindItemInList("ZN002:WALL001:WIN001", state->dataSurface->Surface); - state->dataHeatBalSurf->TempSurfIn(surfNum) = 25.92; + state->dataHeatBalSurf->SurfTempIn(surfNum) = 25.92; surfNum = UtilityRoutines::FindItemInList("ZN002:WALL004", state->dataSurface->Surface); - state->dataHeatBalSurf->TempSurfIn(surfNum) = 26.99; + state->dataHeatBalSurf->SurfTempIn(surfNum) = 26.99; surfNum = UtilityRoutines::FindItemInList("ZN004:WALL001:WIN001", state->dataSurface->Surface); - state->dataHeatBalSurf->TempSurfIn(surfNum) = 22.99; + state->dataHeatBalSurf->SurfTempIn(surfNum) = 22.99; state->dataHeatBalFanSys->MAT.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneAirHumRat.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->MAT = 23.0; diff --git a/tst/EnergyPlus/unit/WindowManager.unit.cc b/tst/EnergyPlus/unit/WindowManager.unit.cc index 8d21320cfb7..4ffc8854a53 100644 --- a/tst/EnergyPlus/unit/WindowManager.unit.cc +++ b/tst/EnergyPlus/unit/WindowManager.unit.cc @@ -239,9 +239,9 @@ TEST_F(EnergyPlusFixture, WindowFrameTest) Real64 v_ws = 5.5; // Overrides for testing - state->dataHeatBal->CosIncAng.dimension(1, 1, 3, 1.0); - state->dataHeatBal->SunlitFrac.dimension(1, 1, 3, 1.0); - state->dataHeatBal->SunlitFracWithoutReveal.dimension(1, 1, 3, 1.0); + state->dataHeatBal->SurfCosIncAng.dimension(1, 1, 3, 1.0); + state->dataHeatBal->SurfSunlitFrac.dimension(1, 1, 3, 1.0); + state->dataHeatBal->SurfSunlitFracWithoutReveal.dimension(1, 1, 3, 1.0); state->dataSurface->SurfOutDryBulbTemp(winNum) = T_out; state->dataHeatBal->SurfTempEffBulkAir(winNum) = T_in; @@ -291,7 +291,7 @@ TEST_F(EnergyPlusFixture, WindowFrameTest) winNum, outSurfTemp, T_out); // This subroutine sets the global HConvIn( 1 ) variable. We will use it to set the exterior natural convection. - h_exterior = h_exterior_f + state->dataHeatBal->HConvIn(winNum); // add natural convection + h_exterior = h_exterior_f + state->dataHeatBalSurf->SurfHConvInt(winNum); // add natural convection // revert tilt for interior natural convection calculations state->dataSurface->Surface(1).Tilt = tiltSave; @@ -503,7 +503,7 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataLoopNodes->Node.allocate(4); state->dataHeatBal->SurfTempEffBulkAir.allocate(3); - state->dataHeatBalSurf->TempSurfInTmp.allocate(3); + state->dataHeatBalSurf->SurfTempInTmp.allocate(3); int surfNum1 = UtilityRoutines::FindItemInList("WALL", state->dataSurface->Surface); int surfNum2 = UtilityRoutines::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); @@ -518,9 +518,9 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataSurface->Surface(surfNum1).SolarEnclIndex = 1; state->dataSurface->Surface(surfNum2).SolarEnclIndex = 1; state->dataSurface->Surface(surfNum3).SolarEnclIndex = 1; - state->dataHeatBalSurf->TempSurfInTmp(surfNum1) = 15.0; - state->dataHeatBalSurf->TempSurfInTmp(surfNum2) = 20.0; - state->dataHeatBalSurf->TempSurfInTmp(surfNum3) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(surfNum1) = 15.0; + state->dataHeatBalSurf->SurfTempInTmp(surfNum2) = 20.0; + state->dataHeatBalSurf->SurfTempInTmp(surfNum3) = 25.0; state->dataHeatBal->SurfTempEffBulkAir(surfNum1) = 10.0; state->dataHeatBal->SurfTempEffBulkAir(surfNum2) = 10.0; state->dataHeatBal->SurfTempEffBulkAir(surfNum3) = 10.0; @@ -534,10 +534,10 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataLoopNodes->Node(3).MassFlowRate = 0.1; state->dataLoopNodes->Node(4).MassFlowRate = 0.1; - state->dataHeatBal->HConvIn.allocate(3); - state->dataHeatBal->HConvIn(surfNum1) = 0.5; - state->dataHeatBal->HConvIn(surfNum2) = 0.5; - state->dataHeatBal->HConvIn(surfNum3) = 0.5; + state->dataHeatBalSurf->SurfHConvInt.allocate(3); + state->dataHeatBalSurf->SurfHConvInt(surfNum1) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(surfNum2) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(surfNum3) = 0.5; state->dataHeatBal->Zone(1).IsControlled = true; state->dataHeatBalFanSys->ZoneAirHumRat.allocate(1); state->dataHeatBalFanSys->ZoneAirHumRat(1) = 0.011; @@ -568,10 +568,10 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataSurface->SurfWinSysSolTransmittance.allocate(3); state->dataSurface->SurfWinSysSolAbsorptance.allocate(3); state->dataSurface->SurfWinSysSolReflectance.allocate(3); - state->dataSurface->InsideGlassCondensationFlag.allocate(3); + state->dataSurface->SurfWinInsideGlassCondensationFlag.allocate(3); state->dataSurface->SurfWinGainFrameDividerToZoneRep.allocate(3); - state->dataSurface->InsideFrameCondensationFlag.allocate(3); - state->dataSurface->InsideDividerCondensationFlag.allocate(3); + state->dataSurface->SurfWinInsideFrameCondensationFlag.allocate(3); + state->dataSurface->SurfWinInsideDividerCondensationFlag.allocate(3); state->dataSurface->SurfTAirRef(surfNum1) = DataSurfaces::ZoneMeanAirTemp; state->dataSurface->SurfTAirRef(surfNum2) = DataSurfaces::ZoneSupplyAirTemp; @@ -602,19 +602,19 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) Real64 outSurfTemp; // Calculate temperature based on supply flow rate - WindowManager::CalcWindowHeatBalance(*state, surfNum2, state->dataHeatBal->HConvIn(surfNum2), inSurfTemp, outSurfTemp); + WindowManager::CalcWindowHeatBalance(*state, surfNum2, state->dataHeatBalSurf->SurfHConvInt(surfNum2), inSurfTemp, outSurfTemp); EXPECT_NEAR(20.0, state->dataHeatBal->SurfTempEffBulkAir(surfNum2), 0.0001); // Calculate temperature based on zone temperature with supply flow rate = 0 state->dataLoopNodes->Node(1).MassFlowRate = 0.0; state->dataLoopNodes->Node(2).MassFlowRate = 0.0; - WindowManager::CalcWindowHeatBalance(*state, surfNum2, state->dataHeatBal->HConvIn(surfNum2), inSurfTemp, outSurfTemp); + WindowManager::CalcWindowHeatBalance(*state, surfNum2, state->dataHeatBalSurf->SurfHConvInt(surfNum2), inSurfTemp, outSurfTemp); EXPECT_NEAR(25.0, state->dataHeatBal->SurfTempEffBulkAir(surfNum2), 0.0001); // Adjacent surface state->dataLoopNodes->Node(1).MassFlowRate = 0.1; state->dataLoopNodes->Node(2).MassFlowRate = 0.1; state->dataSurface->Surface(1).ExtBoundCond = 2; - WindowManager::CalcWindowHeatBalance(*state, surfNum2, state->dataHeatBal->HConvIn(surfNum2), inSurfTemp, outSurfTemp); + WindowManager::CalcWindowHeatBalance(*state, surfNum2, state->dataHeatBalSurf->SurfHConvInt(surfNum2), inSurfTemp, outSurfTemp); EXPECT_NEAR(20.0, state->dataHeatBal->SurfTempEffBulkAir(surfNum2), 0.0001); state->dataLoopNodes->Node(1).MassFlowRate = 0.0; @@ -622,7 +622,7 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataSurface->Surface(1).ExtBoundCond = 2; state->dataSurface->Surface(2).ExtBoundCond = 1; state->dataSurface->SurfTAirRef(1) = DataSurfaces::ZoneSupplyAirTemp; - WindowManager::CalcWindowHeatBalance(*state, surfNum2, state->dataHeatBal->HConvIn(surfNum2), inSurfTemp, outSurfTemp); + WindowManager::CalcWindowHeatBalance(*state, surfNum2, state->dataHeatBalSurf->SurfHConvInt(surfNum2), inSurfTemp, outSurfTemp); EXPECT_NEAR(25.0, state->dataHeatBal->SurfTempEffBulkAir(surfNum2), 0.0001); } @@ -2732,7 +2732,7 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) state->dataLoopNodes->Node.allocate(4); state->dataHeatBal->SurfTempEffBulkAir.allocate(3); - state->dataHeatBalSurf->TempSurfInTmp.allocate(3); + state->dataHeatBalSurf->SurfTempInTmp.allocate(3); int surfNum1 = UtilityRoutines::FindItemInList("WALL", state->dataSurface->Surface); int surfNum2 = UtilityRoutines::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); @@ -2747,9 +2747,9 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) state->dataSurface->Surface(surfNum1).SolarEnclIndex = 1; state->dataSurface->Surface(surfNum2).SolarEnclIndex = 1; state->dataSurface->Surface(surfNum3).SolarEnclIndex = 1; - state->dataHeatBalSurf->TempSurfInTmp(surfNum1) = 15.0; - state->dataHeatBalSurf->TempSurfInTmp(surfNum2) = 20.0; - state->dataHeatBalSurf->TempSurfInTmp(surfNum3) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(surfNum1) = 15.0; + state->dataHeatBalSurf->SurfTempInTmp(surfNum2) = 20.0; + state->dataHeatBalSurf->SurfTempInTmp(surfNum3) = 25.0; state->dataHeatBal->SurfTempEffBulkAir(surfNum1) = 10.0; state->dataHeatBal->SurfTempEffBulkAir(surfNum2) = 10.0; state->dataHeatBal->SurfTempEffBulkAir(surfNum3) = 10.0; @@ -2763,10 +2763,10 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) state->dataLoopNodes->Node(3).MassFlowRate = 0.1; state->dataLoopNodes->Node(4).MassFlowRate = 0.1; - state->dataHeatBal->HConvIn.allocate(3); - state->dataHeatBal->HConvIn(surfNum1) = 0.5; - state->dataHeatBal->HConvIn(surfNum2) = 0.5; - state->dataHeatBal->HConvIn(surfNum3) = 0.5; + state->dataHeatBalSurf->SurfHConvInt.allocate(3); + state->dataHeatBalSurf->SurfHConvInt(surfNum1) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(surfNum2) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(surfNum3) = 0.5; state->dataHeatBal->Zone(1).IsControlled = true; state->dataHeatBalFanSys->ZoneAirHumRat.allocate(1); state->dataHeatBalFanSys->ZoneAirHumRat(1) = 0.011; @@ -2797,10 +2797,10 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) state->dataSurface->SurfWinSysSolTransmittance.allocate(3); state->dataSurface->SurfWinSysSolAbsorptance.allocate(3); state->dataSurface->SurfWinSysSolReflectance.allocate(3); - state->dataSurface->InsideGlassCondensationFlag.allocate(3); + state->dataSurface->SurfWinInsideGlassCondensationFlag.allocate(3); state->dataSurface->SurfWinGainFrameDividerToZoneRep.allocate(3); - state->dataSurface->InsideFrameCondensationFlag.allocate(3); - state->dataSurface->InsideDividerCondensationFlag.allocate(3); + state->dataSurface->SurfWinInsideFrameCondensationFlag.allocate(3); + state->dataSurface->SurfWinInsideDividerCondensationFlag.allocate(3); state->dataSurface->SurfTAirRef(surfNum1) = DataSurfaces::ZoneMeanAirTemp; state->dataSurface->SurfTAirRef(surfNum2) = DataSurfaces::ZoneSupplyAirTemp; state->dataSurface->SurfTAirRef(surfNum3) = DataSurfaces::AdjacentAirTemp; @@ -2831,7 +2831,7 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) state->dataScheduleMgr->Schedule(1).CurrentValue = 25.0; // Srd Srfs Temp // Calculate temperature based on supply flow rate - WindowManager::CalcWindowHeatBalance(*state, surfNum2, state->dataHeatBal->HConvIn(surfNum2), inSurfTemp, outSurfTemp); + WindowManager::CalcWindowHeatBalance(*state, surfNum2, state->dataHeatBalSurf->SurfHConvInt(surfNum2), inSurfTemp, outSurfTemp); // Test if LWR from surrounding surfaces correctly calculated EXPECT_DOUBLE_EQ(DataGlobalConstants::StefanBoltzmann * 0.84 * 0.6 * (pow_4(25.0 + DataGlobalConstants::KelvinConv) - pow_4(state->dataWindowManager->thetas(1))), diff --git a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc index ab0d577f5ad..fe9e44f3b87 100644 --- a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc +++ b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc @@ -1071,10 +1071,10 @@ TEST_F(EnergyPlusFixture, ZoneTempPredictorCorrector_CalcZoneSums_SurfConvection state->dataHeatBal->Zone(1).HTSurfaceFirst = 1; state->dataHeatBal->Zone(1).HTSurfaceLast = 3; state->dataSurface->Surface.allocate(3); - state->dataHeatBal->HConvIn.allocate(3); + state->dataHeatBalSurf->SurfHConvInt.allocate(3); state->dataLoopNodes->Node.allocate(4); state->dataHeatBal->SurfTempEffBulkAir.allocate(3); - state->dataHeatBalSurf->TempSurfInTmp.allocate(3); + state->dataHeatBalSurf->SurfTempInTmp.allocate(3); state->dataSurface->SurfTAirRef.allocate(3); state->dataSurface->SurfTAirRef(1) = ZoneMeanAirTemp; @@ -1087,9 +1087,9 @@ TEST_F(EnergyPlusFixture, ZoneTempPredictorCorrector_CalcZoneSums_SurfConvection state->dataSurface->Surface(1).Area = 10.0; state->dataSurface->Surface(2).Area = 10.0; state->dataSurface->Surface(3).Area = 10.0; - state->dataHeatBalSurf->TempSurfInTmp(1) = 15.0; - state->dataHeatBalSurf->TempSurfInTmp(2) = 20.0; - state->dataHeatBalSurf->TempSurfInTmp(3) = 25.0; + state->dataHeatBalSurf->SurfTempInTmp(1) = 15.0; + state->dataHeatBalSurf->SurfTempInTmp(2) = 20.0; + state->dataHeatBalSurf->SurfTempInTmp(3) = 25.0; state->dataHeatBal->SurfTempEffBulkAir(1) = 10.0; state->dataHeatBal->SurfTempEffBulkAir(2) = 10.0; state->dataHeatBal->SurfTempEffBulkAir(3) = 10.0; @@ -1103,9 +1103,9 @@ TEST_F(EnergyPlusFixture, ZoneTempPredictorCorrector_CalcZoneSums_SurfConvection state->dataLoopNodes->Node(3).MassFlowRate = 0.1; state->dataLoopNodes->Node(4).MassFlowRate = 0.1; - state->dataHeatBal->HConvIn(1) = 0.5; - state->dataHeatBal->HConvIn(2) = 0.5; - state->dataHeatBal->HConvIn(3) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(1) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(2) = 0.5; + state->dataHeatBalSurf->SurfHConvInt(3) = 0.5; state->dataZonePlenum->NumZoneReturnPlenums = 0; state->dataZonePlenum->NumZoneSupplyPlenums = 0;