diff --git a/.decent_ci-Linux.yaml b/.decent_ci-Linux.yaml
index f31d71f635d..209f3482261 100644
--- a/.decent_ci-Linux.yaml
+++ b/.decent_ci-Linux.yaml
@@ -1,12 +1,12 @@
compilers:
- name: "gcc"
- version: "11.3"
+ version: "11.4"
cmake_extra_flags: -DLINK_WITH_PYTHON:BOOL=ON -DBUILD_FORTRAN:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=ON -DREGRESSION_BASELINE_PATH:PATH=$REGRESSION_BASELINE -DREGRESSION_SCRIPT_PATH:PATH=$REGRESSION_DIR -DREGRESSION_BASELINE_SHA:STRING=$REGRESSION_BASELINE_SHA -DCOMMIT_SHA:STRING=$COMMIT_SHA -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DBUILD_PERFORMANCE_TESTS:BOOL=ON -DVALGRIND_ANALYZE_PERFORMANCE_TESTS:BOOL=ON -DENABLE_PCH:BOOL=OFF
collect_performance_results: true
s3_upload_bucket: energyplus
- name: "gcc"
- version: "11.3"
+ version: "11.4"
build_type: Debug
cmake_extra_flags: -DLINK_WITH_PYTHON:BOOL=ON -DBUILD_FORTRAN:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=OFF -DCOMMIT_SHA:STRING=$COMMIT_SHA -DENABLE_COVERAGE:BOOL=ON -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DENABLE_PCH:BOOL=OFF
coverage_enabled: true
@@ -20,7 +20,7 @@ compilers:
skip_packaging: true
- name: "gcc"
- version: "11.3"
+ version: "11.4"
build_type: Debug
cmake_extra_flags: -DLINK_WITH_PYTHON:BOOL=ON -DBUILD_FORTRAN:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=OFF -DCOMMIT_SHA:STRING=$COMMIT_SHA -DENABLE_COVERAGE:BOOL=ON -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DENABLE_PCH:BOOL=OFF
coverage_enabled: true
diff --git a/.decent_ci-Windows.yaml b/.decent_ci-Windows.yaml
index 27d78e74af4..7d1119df164 100644
--- a/.decent_ci-Windows.yaml
+++ b/.decent_ci-Windows.yaml
@@ -2,5 +2,5 @@ compilers:
- name: Visual Studio
version: 16
architecture: Win64
- cmake_extra_flags: -DBUILD_FORTRAN:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DLINK_WITH_PYTHON=ON -DPYTHON_EXECUTABLE:PATH=C:/Users/elee/AppData/Local/Programs/Python/Python311/python.exe -DPython_EXECUTABLE:PATH=C:/Users/elee/AppData/Local/Programs/Python/Python311/python.exe
+ cmake_extra_flags: -DBUILD_FORTRAN:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DLINK_WITH_PYTHON=ON -DPython_EXECUTABLE:PATH=C:/Users/elee/AppData/Local/Programs/Python/Python311/python.exe
skip_regression: true
diff --git a/.github/workflows/epjson.yml b/.github/workflows/epjson.yml
new file mode 100644
index 00000000000..156ebdb0b72
--- /dev/null
+++ b/.github/workflows/epjson.yml
@@ -0,0 +1,109 @@
+name: epJSON dependency
+
+on:
+ push
+
+env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ BUILD_TYPE: Release
+
+jobs:
+ release:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ # fail-fast: Default is true, switch to false to allow one platform to fail and still run others
+ fail-fast: false
+ matrix:
+ os: [ubuntu-latest, windows-latest, macos-latest]
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Set up Python 3.8
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.8'
+
+ - name: Setup
+ shell: bash
+ run: |
+ cmake -E make_directory ./build/
+ if [ "$RUNNER_OS" == "Windows" ]; then
+ echo "Setting CMAKE_GENERATOR options equivalent to ='-G \"Visual Studio 17 2022\" -A x64'"
+ echo CMAKE_GENERATOR='Visual Studio 17 2022' >> $GITHUB_ENV
+ echo CMAKE_GENERATOR_PLATFORM=x64 >> $GITHUB_ENV
+ choco install ninja
+ fi;
+
+ - name: Configure CMake
+ working-directory: ./build
+ run: |
+ cmake ../
+
+ - name: Test epjson
+ shell: python
+ run: |
+ from pathlib import Path
+ import subprocess
+
+ EP_ROOT = Path(".").resolve()
+ EP_BUILD_DIR = Path('./build').resolve()
+ EXPECTED_MSGS = ["Generating the epJSON schema!", "Generating the **embedded** epJSON schema"]
+
+ def build():
+ lines = subprocess.check_output(
+ [
+ "cmake",
+ "--build",
+ str(EP_BUILD_DIR),
+ "--config",
+ "Release",
+ "--target",
+ "embedded_epjson_source",
+ ],
+ encoding="utf-8",
+ stderr=subprocess.STDOUT,
+ ).splitlines()
+ return lines
+
+
+ IDD_IN = EP_ROOT / "idd/Energy+.idd.in"
+ assert IDD_IN.exists()
+
+
+ def ensure_target_built(lines, msg):
+ breakpoint
+ lines = [x.strip() for x in lines if "epJSON schema" in x]
+ errors = []
+ for expected_msg in EXPECTED_MSGS:
+ n = lines.count(expected_msg)
+ if n != 1:
+ errors.append(f"Expected 1 occurrence of '{expected_msg}', got {n}")
+ assert not errors, "\n -" + "\n -".join(errors)
+
+ # Build: first time: we get both
+ lines = build()
+ ensure_target_built(lines, "Failed on first build")
+
+ # Insert a fake IDD change, we should also get both
+ with open(IDD_IN, "r") as f:
+ lines = f.read().splitlines()
+ ori_lines = lines.copy()
+
+ for i, line in enumerate(lines):
+ if line.startswith(r"\group"):
+ lines.insert(i + 1, "")
+ lines.insert(i + 2, "FakeObject,")
+ lines.insert(i + 3, r" A1; \field Name")
+ break
+ with open(IDD_IN, "w") as f:
+ f.write("\n".join(lines) + "\n")
+
+ lines = build()
+ ensure_target_built(lines, "Failed after IDD change")
+
+ with open(IDD_IN, "w") as f:
+ f.write("\n".join(ori_lines) + "\n")
+
+ lines = build()
+ ensure_target_built(lines, "Failed after IDD change revert")
diff --git a/.gitignore b/.gitignore
index ea7db58fe1f..d4ebd59d419 100644
--- a/.gitignore
+++ b/.gitignore
@@ -48,9 +48,6 @@ testfiles/*.htm
# this is autogenerated in the src dir
doc/title.tex
-# ignore Energy+.schema.epJSON while it is auto-generated from IDD
-Energy+.schema.epJSON.in
-
# ignore the doxygen and sphinx built API docs
doc/readthedocs/doxygen/_build
doc/readthedocs/sphinx/_build
@@ -88,3 +85,7 @@ CMakeSettings.json
# py2app puts things inside dist/ and build/, build/ is already ignored, just add dist/
dist
+
+# if you generate sphinx docs, it builds a dummy version of the schema in the idd folder, just ignore it
+/idd/Energy+.schema.epJSON
+/idd/Energy+.schema.epJSON.in
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bf8c2f217a6..a815eaad8e6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,3 +1,5 @@
+cmake_minimum_required(VERSION 3.17)
+
# Use ccache if available, has to be before "project()"
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
@@ -9,8 +11,6 @@ cmake_policy(SET CMP0048 NEW) # handling project_version_* variables
project(EnergyPlus)
-cmake_minimum_required(VERSION 3.17)
-
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER "3.0")
cmake_policy(SET CMP0054 NEW) # CMake 3.1 added this policy
endif()
@@ -283,9 +283,6 @@ target_include_directories(project_options INTERFACE ${PROJECT_SOURCE_DIR}/third
target_include_directories(project_options INTERFACE "${kiva_BINARY_DIR}/src/libkiva")
target_include_directories(project_options SYSTEM INTERFACE "${kiva_SOURCE_DIR}/vendor/boost-1.61.0/")
-add_subdirectory(scripts/dev/generate_embeddable_epJSON_schema)
-set_target_properties(generate_embeddable_epJSON_schema PROPERTIES FOLDER "Internal")
-
target_include_directories(project_options INTERFACE ${PROJECT_SOURCE_DIR}/third_party/cpgfunctionEP)
target_include_directories(project_options INTERFACE ${PROJECT_SOURCE_DIR}/third_party/cpgfunctionEP/include)
@@ -298,15 +295,6 @@ endif()
# E+ required libraries
add_subdirectory(idd)
-execute_process(
- COMMAND ${Python_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/dev/generate_epJSON_schema/generate_epJSON_schema.py" "${PROJECT_SOURCE_DIR}"
- TIMEOUT 30
- RESULT_VARIABLE generate_epJSON_schema_result)
-if(${generate_epJSON_schema_result} MATCHES ".*timeout.*")
- message(FATAL_ERROR "Generating epJSON Schema from IDD failed: ${generate_epJSON_schema_result}")
-endif()
-configure_file(idd/Energy+.idd.in "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Energy+.idd")
-configure_file(idd/Energy+.schema.epJSON.in "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Energy+.schema.epJSON")
configure_file(idd/BasementGHT.idd "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/BasementGHT.idd")
configure_file(idd/SlabGHT.idd "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SlabGHT.idd")
@@ -322,7 +310,6 @@ configure_file("workflows/transition.py" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/work
# of course E+ itself
add_subdirectory(src/EnergyPlus)
set_target_properties(airflownetworklib PROPERTIES FOLDER "Internal")
-set_target_properties(GenerateEmbeddedEpJSONSchema PROPERTIES FOLDER "Internal")
set_target_properties(energyplusparser PROPERTIES FOLDER "Internal")
if(BUILD_TESTING)
@@ -371,9 +358,9 @@ if(BUILD_FORTRAN)
PROJECT Transition
CMAKE_COMMAND_LINE ${TRANSITION_EXTRA_FLAGS}
NO_EXTERNAL_INSTALL)
- file(COPY "idd/V23-1-0-Energy+.idd" DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
- configure_file(idd/Energy+.idd.in "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/V23-2-0-Energy+.idd")
- file(COPY "src/Transition/SupportFiles/Report Variables 23-1-0 to 23-2-0.csv" DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
+ file(COPY "${PREVIOUS_IDD}" DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
+ configure_file(idd/Energy+.idd.in "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/V${CMAKE_VERSION_MAJOR}-${CMAKE_VERSION_MINOR}-${CMAKE_VERSION_PATCH}-Energy+.idd")
+ file(COPY "src/Transition/SupportFiles/Report Variables ${PREV_RELEASE_MAJOR}-${PREV_RELEASE_MINOR}-${PREV_RELEASE_PATCH} to ${CMAKE_VERSION_MAJOR}-${CMAKE_VERSION_MINOR}-${CMAKE_VERSION_PATCH}.csv" DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
cmake_add_fortran_subdirectory(
src/Basement
PROJECT Basement
diff --git a/README.md b/README.md
index 09098cc4182..5cb72a85de4 100644
--- a/README.md
+++ b/README.md
@@ -23,7 +23,7 @@ Every commit and every release of EnergyPlus undergoes rigorous testing.
The testing consists of building EnergyPlus, of course, then there are unit tests, integration tests, API tests, and regression tests.
Since 2014, most of the testing has been performed by our bots ([Tik-Tok](https://github.com/nrel-bot), [Gort](https://github.com/nrel-bot-2), and [Marvin](https://github.com/nrel-bot-3)), using a fork of the [Decent CI](https://github.com/lefticus/decent_ci) continuous integration system.
We are now adapting our efforts to use the Github Actions system to handle more of our testing processes.
-In the meantime, while Decent CI is still handling the regression and bulkier testing, results from Decent CI are still available on the testing [dashboard](http://nrel.github.io/EnergyPlusBuildResults/).
+In the meantime, while Decent CI is still handling the regression and bulkier testing, results from Decent CI are still available on the testing [dashboard](https://myoldmopar.github.io/EnergyPlusBuildResults/).
## Releases
diff --git a/cmake/Install.cmake b/cmake/Install.cmake
index e114c6aa632..d5dce571f49 100644
--- a/cmake/Install.cmake
+++ b/cmake/Install.cmake
@@ -374,8 +374,7 @@ set(CPACK_RESOURCE_FILE_README "${PROJECT_BINARY_DIR}/release/readme.html")
install(FILES "${PROJECT_SOURCE_DIR}/bin/CurveFitTools/IceStorageCurveFitTool.xlsm" DESTINATION "PreProcess/HVACCurveFitTool/")
install(FILES "${PROJECT_SOURCE_DIR}/bin/CurveFitTools/CurveFitTool.xlsm" DESTINATION "PreProcess/HVACCurveFitTool/")
-install(FILES "${PROJECT_SOURCE_DIR}/idd/V23-1-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater/")
-install(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater/" RENAME "V23-2-0-Energy+.idd")
+install(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater/" RENAME "V${CMAKE_VERSION_MAJOR}-${CMAKE_VERSION_MINOR}-${CMAKE_VERSION_PATCH}-Energy+.idd")
# Workflow stuff, takes about 40KB, so not worth it proposing to not install it
install(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/workflows/app_g_postprocess.py" DESTINATION "workflows/") # COMPONENT Workflows)
diff --git a/datasets/CodeCompliantEquipment.idf b/datasets/CodeCompliantEquipment.idf
index 9209c8b3633..e76b3e979ed 100644
--- a/datasets/CodeCompliantEquipment.idf
+++ b/datasets/CodeCompliantEquipment.idf
@@ -103,11 +103,11 @@ Curve:Cubic,
0.0, !- Minimum Value of x
1.0; !- Maximum Value of x
-!- Set of performance curves for ASHRAE901_AppJ_air_B_gt528kW_2.96COP_4.1IPLV.SI
-!- (Also applicable for ASHRAE901_AppJ_air_B_gt150ton_10.1EER_14.0IPLV.IP)
+!- Set of performance curves for ASHRAE901_AppJ_air_B_gte528kW_2.96COP_4.1IPLV.SI
+!- (Also applicable for ASHRAE901_AppJ_air_B_gte150ton_10.1EER_14.0IPLV.IP)
Curve:Biquadratic,
- ASHRAE901_AppJ_air_B_gt528kW_2.96COP_4.1IPLV.SI_cap-f-t, !- Name
+ ASHRAE901_AppJ_air_B_gte528kW_2.96COP_4.1IPLV.SI_cap-f-t, !- Name
0.794185315225093, !- Coefficient1 Constant
0.060198988329897, !- Coefficient2 x
-0.00201553365333625, !- Coefficient3 x**2
@@ -120,7 +120,7 @@ Curve:Biquadratic,
52; !- Maximum Value of y
Curve:Biquadratic,
- ASHRAE901_AppJ_air_B_gt528kW_2.96COP_4.1IPLV.SI_eir-f-t, !- Name
+ ASHRAE901_AppJ_air_B_gte528kW_2.96COP_4.1IPLV.SI_eir-f-t, !- Name
0.807832111491946, !- Coefficient1 Constant
-0.0294518276175435, !- Coefficient2 x
0.00143133716733664, !- Coefficient3 x**2
@@ -133,7 +133,7 @@ Curve:Biquadratic,
52; !- Maximum Value of y
Curve:Cubic,
- ASHRAE901_AppJ_air_B_gt528kW_2.96COP_4.1IPLV.SI_eir-f-plr, !- Name
+ ASHRAE901_AppJ_air_B_gte528kW_2.96COP_4.1IPLV.SI_eir-f-plr, !- Name
0.118080543023348, !- Coefficient1 Constant
0.10747666191967, !- Coefficient2 x
1.57083798659907, !- Coefficient3 x**2
@@ -178,11 +178,11 @@ Curve:Quadratic,
0.0, !- Minimum Value of x
1.0; !- Maximum Value of x
-!- Set of performance curves for ASHRAE901_AppJ_wtr_D_pdsp_gt264lt528kW_4.88COP_6.28IPLV.SI
-!- (Also applicable for ASHRAE901_AppJ_wtr_D_pdsp_gt75lt150ton_0.72kWpton_0.56IPLV.IP)
+!- Set of performance curves for ASHRAE901_AppJ_wtr_D_pdsp_gte264lt528kW_4.88COP_6.28IPLV.SI
+!- (Also applicable for ASHRAE901_AppJ_wtr_D_pdsp_gte75lt150ton_0.72kWpton_0.56IPLV.IP)
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_D_pdsp_gt264lt528kW_4.88COP_6.28IPLV.SI_cap-f-t, !- Name
+ ASHRAE901_AppJ_wtr_D_pdsp_gte264lt528kW_4.88COP_6.28IPLV.SI_cap-f-t, !- Name
0.861840198586768, !- Coefficient1 Constant
0.0578371828490339, !- Coefficient2 x
-0.00216958540389355, !- Coefficient3 x**2
@@ -195,7 +195,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_D_pdsp_gt264lt528kW_4.88COP_6.28IPLV.SI_eir-f-t, !- Name
+ ASHRAE901_AppJ_wtr_D_pdsp_gte264lt528kW_4.88COP_6.28IPLV.SI_eir-f-t, !- Name
0.740919724129239, !- Coefficient1 Constant
-0.0301443336651491, !- Coefficient2 x
0.0014786319749185, !- Coefficient3 x**2
@@ -208,18 +208,18 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Quadratic,
- ASHRAE901_AppJ_wtr_D_pdsp_gt264lt528kW_4.88COP_6.28IPLV.SI_eir-f-plr, !- Name
+ ASHRAE901_AppJ_wtr_D_pdsp_gte264lt528kW_4.88COP_6.28IPLV.SI_eir-f-plr, !- Name
0.208981833155775, !- Coefficient1 Constant
0.224001372656158, !- Coefficient2 x
0.561479374288065, !- Coefficient3 x**2
0.0, !- Minimum Value of x
1.0; !- Maximum Value of x
-!- Set of performance curves for ASHRAE901_AppJ_wtr_E_pdsp_gt528lt1055kW_5.33COP_6.54IPLV.SI
-!- (Also applicable for ASHRAE901_AppJ_wtr_E_pdsp_gt150lt300ton_0.66kWpton_0.538IPLV.IP)
+!- Set of performance curves for ASHRAE901_AppJ_wtr_E_pdsp_gte528lt1055kW_5.33COP_6.54IPLV.SI
+!- (Also applicable for ASHRAE901_AppJ_wtr_E_pdsp_gte150lt300ton_0.66kWpton_0.538IPLV.IP)
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_E_pdsp_gt528lt1055kW_5.33COP_6.54IPLV.SI_cap-f-t, !- Name
+ ASHRAE901_AppJ_wtr_E_pdsp_gte528lt1055kW_5.33COP_6.54IPLV.SI_cap-f-t, !- Name
0.800065687328999, !- Coefficient1 Constant
0.0353774308143739, !- Coefficient2 x
-0.0014824153146761, !- Coefficient3 x**2
@@ -232,7 +232,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_E_pdsp_gt528lt1055kW_5.33COP_6.54IPLV.SI_eir-f-t, !- Name
+ ASHRAE901_AppJ_wtr_E_pdsp_gte528lt1055kW_5.33COP_6.54IPLV.SI_eir-f-t, !- Name
0.62083394489479, !- Coefficient1 Constant
-0.0236422051855316, !- Coefficient2 x
0.00129976495343239, !- Coefficient3 x**2
@@ -245,7 +245,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Quadratic,
- ASHRAE901_AppJ_wtr_E_pdsp_gt528lt1055kW_5.33COP_6.54IPLV.SI_eir-f-plr, !- Name
+ ASHRAE901_AppJ_wtr_E_pdsp_gte528lt1055kW_5.33COP_6.54IPLV.SI_eir-f-plr, !- Name
0.246643709273782, !- Coefficient1 Constant
0.184575915610184, !- Coefficient2 x
0.566463161216033, !- Coefficient3 x**2
@@ -289,11 +289,11 @@ Curve:Quadratic,
0.0, !- Minimum Value of x
1.0; !- Maximum Value of x
-!- Set of performance curves for ASHRAE901_AppJ_wtr_G_pdsp_gt2110kW_6.28COP_7.05IPLV.SI
-!- (Also applicable for ASHRAE901_AppJ_wtr_G_pdsp_gt600ton_0.56kWpton_0.499IPLV.IP)
+!- Set of performance curves for ASHRAE901_AppJ_wtr_G_pdsp_gte2110kW_6.28COP_7.05IPLV.SI
+!- (Also applicable for ASHRAE901_AppJ_wtr_G_pdsp_gte600ton_0.56kWpton_0.499IPLV.IP)
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_G_pdsp_gt2110kW_6.28COP_7.05IPLV.SI_cap-f-t, !- Name
+ ASHRAE901_AppJ_wtr_G_pdsp_gte2110kW_6.28COP_7.05IPLV.SI_cap-f-t, !- Name
0.83080383460836, !- Coefficient1 Constant
0.0163100863412201, !- Coefficient2 x
-0.000949079445226831, !- Coefficient3 x**2
@@ -306,7 +306,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_G_pdsp_gt2110kW_6.28COP_7.05IPLV.SI_eir-f-t, !- Name
+ ASHRAE901_AppJ_wtr_G_pdsp_gte2110kW_6.28COP_7.05IPLV.SI_eir-f-t, !- Name
0.544966803829136, !- Coefficient1 Constant
-0.0304909793495366, !- Coefficient2 x
0.00139455174655485, !- Coefficient3 x**2
@@ -319,7 +319,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Quadratic,
- ASHRAE901_AppJ_wtr_G_pdsp_gt2110kW_6.28COP_7.05IPLV.SI_eir-f-plr, !- Name
+ ASHRAE901_AppJ_wtr_G_pdsp_gte2110kW_6.28COP_7.05IPLV.SI_eir-f-plr, !- Name
0.264370704367519, !- Coefficient1 Constant
0.263302396212442, !- Coefficient2 x
0.471689663820038, !- Coefficient3 x**2
@@ -363,11 +363,11 @@ Curve:Quadratic,
0.0, !- Minimum Value of x
1.0; !- Maximum Value of x
-!- Set of performance curves for ASHRAE901_AppJ_wtr_H_cent_gt528kWlt1055kW_5.77COP_6.41IPLV.SI
-!- (Also applicable for ASHRAE901_AppJ_wtr_H_cent_gt150tonlt300ton_0.61kWpton_0.549IPLV.IP)
+!- Set of performance curves for ASHRAE901_AppJ_wtr_H_cent_gte528kWlt1055kW_5.77COP_6.41IPLV.SI
+!- (Also applicable for ASHRAE901_AppJ_wtr_H_cent_gte150tonlt300ton_0.61kWpton_0.549IPLV.IP)
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_H_cent_gt528kWlt1055kW_5.77COP_6.41IPLV.SI_cap-f-t, !- Name
+ ASHRAE901_AppJ_wtr_H_cent_gte528kWlt1055kW_5.77COP_6.41IPLV.SI_cap-f-t, !- Name
0.837420357605505, !- Coefficient1 Constant
0.0385281390706064, !- Coefficient2 x
-0.00216689147954852, !- Coefficient3 x**2
@@ -380,7 +380,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_H_cent_gt528kWlt1055kW_5.77COP_6.41IPLV.SI_eir-f-t, !- Name
+ ASHRAE901_AppJ_wtr_H_cent_gte528kWlt1055kW_5.77COP_6.41IPLV.SI_eir-f-t, !- Name
0.447242911793089, !- Coefficient1 Constant
-0.0337851600873886, !- Coefficient2 x
0.000724056063895174, !- Coefficient3 x**2
@@ -393,7 +393,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Quadratic,
- ASHRAE901_AppJ_wtr_H_cent_gt528kWlt1055kW_5.77COP_6.41IPLV.SI_eir-f-plr, !- Name
+ ASHRAE901_AppJ_wtr_H_cent_gte528kWlt1055kW_5.77COP_6.41IPLV.SI_eir-f-plr, !- Name
0.304205902179811, !- Coefficient1 Constant
0.0738657242488116, !- Coefficient2 x
0.621457085571376, !- Coefficient3 x**2
@@ -437,11 +437,11 @@ Curve:Quadratic,
0.0, !- Minimum Value of x
1.0; !- Maximum Value of x
-!- Set of performance curves for ASHRAE901_AppJ_wtr_J_cent_gt1407lt2110kW_6.28COP_7.05IPLV.SI
-!- (Also applicable for ASHRAE901_AppJ_wtr_J_cent_gt400lt600ton_0.56kWpton_0.499IPLV.IP)
+!- Set of performance curves for ASHRAE901_AppJ_wtr_J_cent_gte1407lt2110kW_6.28COP_7.05IPLV.SI
+!- (Also applicable for ASHRAE901_AppJ_wtr_J_cent_gte400lt600ton_0.56kWpton_0.499IPLV.IP)
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_J_cent_gt1407lt2110kW_6.28COP_7.05IPLV.SI_cap-f-t, !- Name
+ ASHRAE901_AppJ_wtr_J_cent_gte1407lt2110kW_6.28COP_7.05IPLV.SI_cap-f-t, !- Name
0.896805796938432, !- Coefficient1 Constant
0.056738655451968, !- Coefficient2 x
-0.0025441924944187, !- Coefficient3 x**2
@@ -454,7 +454,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_J_cent_gt1407lt2110kW_6.28COP_7.05IPLV.SI_eir-f-t, !- Name
+ ASHRAE901_AppJ_wtr_J_cent_gte1407lt2110kW_6.28COP_7.05IPLV.SI_eir-f-t, !- Name
0.489242239617685, !- Coefficient1 Constant
-0.0288507328624182, !- Coefficient2 x
0.000973201667096245, !- Coefficient3 x**2
@@ -467,7 +467,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Quadratic,
- ASHRAE901_AppJ_wtr_J_cent_gt1407lt2110kW_6.28COP_7.05IPLV.SI_eir-f-plr, !- Name
+ ASHRAE901_AppJ_wtr_J_cent_gte1407lt2110kW_6.28COP_7.05IPLV.SI_eir-f-plr, !- Name
0.290890645605933, !- Coefficient1 Constant
0.0593657257659549, !- Coefficient2 x
0.649421343028111, !- Coefficient3 x**2
@@ -475,11 +475,11 @@ Curve:Quadratic,
1.0; !- Maximum Value of x
-!- Set of performance curves for ASHRAE901_AppJ_wtr_J_cent_gt2110kW_6.28COP_7.05IPLV.SI
-!- (Also applicable for ASHRAE901_AppJ_wtr_J_cent_gt600ton_0.56kWpton_0.499IPLV.IP)
+!- Set of performance curves for ASHRAE901_AppJ_wtr_J_cent_gte2110kW_6.28COP_7.05IPLV.SI
+!- (Also applicable for ASHRAE901_AppJ_wtr_J_cent_gte600ton_0.56kWpton_0.499IPLV.IP)
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_J_cent_gt2110kW_6.28COP_7.05IPLV.SI_cap-f-t, !- Name
+ ASHRAE901_AppJ_wtr_J_cent_gte2110kW_6.28COP_7.05IPLV.SI_cap-f-t, !- Name
0.896805796938432, !- Coefficient1 Constant
0.056738655451968, !- Coefficient2 x
-0.0025441924944187, !- Coefficient3 x**2
@@ -492,7 +492,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_J_cent_gt2110kW_6.28COP_7.05IPLV.SI_eir-f-t, !- Name
+ ASHRAE901_AppJ_wtr_J_cent_gte2110kW_6.28COP_7.05IPLV.SI_eir-f-t, !- Name
0.489242239617685, !- Coefficient1 Constant
-0.0288507328624182, !- Coefficient2 x
0.000973201667096245, !- Coefficient3 x**2
@@ -505,7 +505,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Quadratic,
- ASHRAE901_AppJ_wtr_J_cent_gt2110kW_6.28COP_7.05IPLV.SI_eir-f-plr, !- Name
+ ASHRAE901_AppJ_wtr_J_cent_gte2110kW_6.28COP_7.05IPLV.SI_eir-f-plr, !- Name
0.290890645605933, !- Coefficient1 Constant
0.0593657257659549, !- Coefficient2 x
0.649421343028111, !- Coefficient3 x**2
@@ -550,11 +550,11 @@ Curve:Cubic,
0.0, !- Minimum Value of x
1.0; !- Maximum Value of x
-!- Set of performance curves for ASHRAE901_AppJ_air_L_gt528kW_2.84COP_4.72IPLV.SI
-!- (Also applicable for ASHRAE901_AppJ_air_L_gt150ton_9.7EER_16.11IPLV.IP)
+!- Set of performance curves for ASHRAE901_AppJ_air_L_gte528kW_2.84COP_4.72IPLV.SI
+!- (Also applicable for ASHRAE901_AppJ_air_L_gte150ton_9.7EER_16.11IPLV.IP)
Curve:Biquadratic,
- ASHRAE901_AppJ_air_L_gt528kW_2.84COP_4.72IPLV.SI_cap-f-t, !- Name
+ ASHRAE901_AppJ_air_L_gte528kW_2.84COP_4.72IPLV.SI_cap-f-t, !- Name
0.879844416630538, !- Coefficient1 Constant
0.0604150176709789, !- Coefficient2 x
-0.00199418747324271, !- Coefficient3 x**2
@@ -567,7 +567,7 @@ Curve:Biquadratic,
52; !- Maximum Value of y
Curve:Biquadratic,
- ASHRAE901_AppJ_air_L_gt528kW_2.84COP_4.72IPLV.SI_eir-f-t, !- Name
+ ASHRAE901_AppJ_air_L_gte528kW_2.84COP_4.72IPLV.SI_eir-f-t, !- Name
0.711588903409163, !- Coefficient1 Constant
-0.0295197355608497, !- Coefficient2 x
0.00139048310597048, !- Coefficient3 x**2
@@ -580,7 +580,7 @@ Curve:Biquadratic,
52; !- Maximum Value of y
Curve:Cubic,
- ASHRAE901_AppJ_air_L_gt528kW_2.84COP_4.72IPLV.SI_eir-f-plr, !- Name
+ ASHRAE901_AppJ_air_L_gte528kW_2.84COP_4.72IPLV.SI_eir-f-plr, !- Name
0.0957110065782636, !- Coefficient1 Constant
0.00990268145861235, !- Coefficient2 x
1.54339631880243, !- Coefficient3 x**2
@@ -625,11 +625,11 @@ Curve:Quadratic,
0.0, !- Minimum Value of x
1.0; !- Maximum Value of x
-!- Set of performance curves for ASHRAE901_AppJ_wtr_N_pdsp_gt264lt528kW_4.69COP_7.19IPLV.SI
+!- Set of performance curves for ASHRAE901_AppJ_wtr_N_pdsp_gte264lt528kW_4.69COP_7.19IPLV.SI
!- (Also applicable for ASHRAE901_AppJ_wtr_N_pdsp_gt75lt150ton_0.75kWpton_0.489IPLV.IP)
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_N_pdsp_gt264lt528kW_4.69COP_7.19IPLV.SI_cap-f-t, !- Name
+ ASHRAE901_AppJ_wtr_N_pdsp_gte264lt528kW_4.69COP_7.19IPLV.SI_cap-f-t, !- Name
0.85070990377567, !- Coefficient1 Constant
0.0560374938498493, !- Coefficient2 x
-0.00207749440742218, !- Coefficient3 x**2
@@ -642,7 +642,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_N_pdsp_gt264lt528kW_4.69COP_7.19IPLV.SI_eir-f-t, !- Name
+ ASHRAE901_AppJ_wtr_N_pdsp_gte264lt528kW_4.69COP_7.19IPLV.SI_eir-f-t, !- Name
0.797371334177358, !- Coefficient1 Constant
-0.0313612846011331, !- Coefficient2 x
0.00151439202063022, !- Coefficient3 x**2
@@ -655,18 +655,18 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Quadratic,
- ASHRAE901_AppJ_wtr_N_pdsp_gt264lt528kW_4.69COP_7.19IPLV.SI_eir-f-plr, !- Name
+ ASHRAE901_AppJ_wtr_N_pdsp_gte264lt528kW_4.69COP_7.19IPLV.SI_eir-f-plr, !- Name
0.183810628690404, !- Coefficient1 Constant
-0.0444166329081994, !- Coefficient2 x
0.855659760517794, !- Coefficient3 x**2
0.0, !- Minimum Value of x
1.0; !- Maximum Value of x
-!- Set of performance curves for ASHRAE901_AppJ_wtr_O_pdsp_gt528lt1055kW_5.17COP_8.03IPLV.SI
-!- (Also applicable for ASHRAE901_AppJ_wtr_O_pdsp_gt150lt300ton_0.68kWpton_0.438IPLV.IP)
+!- Set of performance curves for ASHRAE901_AppJ_wtr_O_pdsp_gte528lt1055kW_5.17COP_8.03IPLV.SI
+!- (Also applicable for ASHRAE901_AppJ_wtr_O_pdsp_gte150lt300ton_0.68kWpton_0.438IPLV.IP)
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_O_pdsp_gt528lt1055kW_5.17COP_8.03IPLV.SI_cap-f-t, !- Name
+ ASHRAE901_AppJ_wtr_O_pdsp_gte528lt1055kW_5.17COP_8.03IPLV.SI_cap-f-t, !- Name
0.822518898446997, !- Coefficient1 Constant
0.0389684690240185, !- Coefficient2 x
-0.00158759086252118, !- Coefficient3 x**2
@@ -679,7 +679,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_O_pdsp_gt528lt1055kW_5.17COP_8.03IPLV.SI_eir-f-t, !- Name
+ ASHRAE901_AppJ_wtr_O_pdsp_gte528lt1055kW_5.17COP_8.03IPLV.SI_eir-f-t, !- Name
0.617870578273555, !- Coefficient1 Constant
-0.0201098781586568, !- Coefficient2 x
0.00117488673146018, !- Coefficient3 x**2
@@ -692,18 +692,18 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Quadratic,
- ASHRAE901_AppJ_wtr_O_pdsp_gt528lt1055kW_5.17COP_8.03IPLV.SI_eir-f-plr, !- Name
+ ASHRAE901_AppJ_wtr_O_pdsp_gte528lt1055kW_5.17COP_8.03IPLV.SI_eir-f-plr, !- Name
0.0909358559361297, !- Coefficient1 Constant
0.207812402682297, !- Coefficient2 x
0.696735129081572, !- Coefficient3 x**2
0.0, !- Minimum Value of x
1.0; !- Maximum Value of x
-!- Set of performance curves for ASHRAE901_AppJ_wtr_P_pdsp_gt1055lt2110kW_5.63COP_8.6IPLV.SI
-!- (Also applicable for ASHRAE901_AppJ_wtr_P_pdsp_gt300lt600ton_0.625kWpton_0.409IPLV.IP)
+!- Set of performance curves for ASHRAE901_AppJ_wtr_P_pdsp_gte1055lt2110kW_5.63COP_8.6IPLV.SI
+!- (Also applicable for ASHRAE901_AppJ_wtr_P_pdsp_gte300lt600ton_0.625kWpton_0.409IPLV.IP)
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_P_pdsp_gt1055lt2110kW_5.63COP_8.6IPLV.SI_cap-f-t, !- Name
+ ASHRAE901_AppJ_wtr_P_pdsp_gte1055lt2110kW_5.63COP_8.6IPLV.SI_cap-f-t, !- Name
0.877217920252064, !- Coefficient1 Constant
0.0283928066538352, !- Coefficient2 x
-0.0012574771826124, !- Coefficient3 x**2
@@ -716,7 +716,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_P_pdsp_gt1055lt2110kW_5.63COP_8.6IPLV.SI_eir-f-t, !- Name
+ ASHRAE901_AppJ_wtr_P_pdsp_gte1055lt2110kW_5.63COP_8.6IPLV.SI_eir-f-t, !- Name
0.656762759748161, !- Coefficient1 Constant
-0.0278910068323571, !- Coefficient2 x
0.00134311095585416, !- Coefficient3 x**2
@@ -729,18 +729,18 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Quadratic,
- ASHRAE901_AppJ_wtr_P_pdsp_gt1055lt2110kW_5.63COP_8.6IPLV.SI_eir-f-plr, !- Name
+ ASHRAE901_AppJ_wtr_P_pdsp_gte1055lt2110kW_5.63COP_8.6IPLV.SI_eir-f-plr, !- Name
0.103664727441931, !- Coefficient1 Constant
0.148024452126455, !- Coefficient2 x
0.744887320031613, !- Coefficient3 x**2
0.0, !- Minimum Value of x
1.0; !- Maximum Value of x
-!- Set of performance curves for ASHRAE901_AppJ_wtr_Q_pdsp_gt2110kW_6.01COP_9.28IPLV.SI
-!- (Also applicable for ASHRAE901_AppJ_wtr_Q_pdsp_gt600ton_0.585kWpton_0.379IPLV.IP)
+!- Set of performance curves for ASHRAE901_AppJ_wtr_Q_pdsp_gte2110kW_6.01COP_9.28IPLV.SI
+!- (Also applicable for ASHRAE901_AppJ_wtr_Q_pdsp_gte600ton_0.585kWpton_0.379IPLV.IP)
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_Q_pdsp_gt2110kW_6.01COP_9.28IPLV.SI_cap-f-t, !- Name
+ ASHRAE901_AppJ_wtr_Q_pdsp_gte2110kW_6.01COP_9.28IPLV.SI_cap-f-t, !- Name
0.83182802133229, !- Coefficient1 Constant
0.0156565611166638, !- Coefficient2 x
-0.000927599295797936, !- Coefficient3 x**2
@@ -753,7 +753,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_Q_pdsp_gt2110kW_6.01COP_9.28IPLV.SI_eir-f-t, !- Name
+ ASHRAE901_AppJ_wtr_Q_pdsp_gte2110kW_6.01COP_9.28IPLV.SI_eir-f-t, !- Name
0.5536942221919, !- Coefficient1 Constant
-0.0303467036038219, !- Coefficient2 x
0.00141191503427415, !- Coefficient3 x**2
@@ -766,7 +766,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Quadratic,
- ASHRAE901_AppJ_wtr_Q_pdsp_gt2110kW_6.01COP_9.28IPLV.SI_eir-f-plr, !- Name
+ ASHRAE901_AppJ_wtr_Q_pdsp_gte2110kW_6.01COP_9.28IPLV.SI_eir-f-plr, !- Name
0.0617061022735642, !- Coefficient1 Constant
0.261711120841577, !- Coefficient2 x
0.677017397684858, !- Coefficient3 x**2
@@ -810,11 +810,11 @@ Curve:Quadratic,
0.0, !- Minimum Value of x
1.0; !- Maximum Value of x
-!- Set of performance curves for ASHRAE901_AppJ_wtr_S_cent_gt528lt1055kW_5.54COP_8.81IPLV.SI
-!- (Also applicable for ASHRAE901_AppJ_wtr_S_cent_gt150lt300ton_0.635kWpton_0.399IPLV.IP)
+!- Set of performance curves for ASHRAE901_AppJ_wtr_S_cent_gte528lt1055kW_5.54COP_8.81IPLV.SI
+!- (Also applicable for ASHRAE901_AppJ_wtr_S_cent_gte150lt300ton_0.635kWpton_0.399IPLV.IP)
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_S_cent_gt528lt1055kW_5.54COP_8.81IPLV.SI_cap-f-t, !- Name
+ ASHRAE901_AppJ_wtr_S_cent_gte528lt1055kW_5.54COP_8.81IPLV.SI_cap-f-t, !- Name
0.971699116458859, !- Coefficient1 Constant
0.0361920290240177, !- Coefficient2 x
-0.00185774607737747, !- Coefficient3 x**2
@@ -827,7 +827,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_S_cent_gt528lt1055kW_5.54COP_8.81IPLV.SI_eir-f-t, !- Name
+ ASHRAE901_AppJ_wtr_S_cent_gte528lt1055kW_5.54COP_8.81IPLV.SI_eir-f-t, !- Name
0.526475031540476, !- Coefficient1 Constant
-0.0308431669279707, !- Coefficient2 x
0.000734914166904871, !- Coefficient3 x**2
@@ -840,18 +840,18 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Quadratic,
- ASHRAE901_AppJ_wtr_S_cent_gt528lt1055kW_5.54COP_8.81IPLV.SI_eir-f-plr, !- Name
+ ASHRAE901_AppJ_wtr_S_cent_gte528lt1055kW_5.54COP_8.81IPLV.SI_eir-f-plr, !- Name
0.0649786389666422, !- Coefficient1 Constant
0.151829213809826, !- Coefficient2 x
0.779131231823531, !- Coefficient3 x**2
0.0, !- Minimum Value of x
1.0; !- Maximum Value of x
-!- Set of performance curves for ASHRAE901_AppJ_wtr_T_cent_gt1055lt1407kW_5.91COP_9.04IPLV.SI
+!- Set of performance curves for ASHRAE901_AppJ_wtr_T_cent_gte1055lt1407kW_5.91COP_9.04IPLV.SI
!- (Also applicable for ASHRAE901_AppJ_wtr_T_cent_gt300lt400ton_0.595kWpton_0.389IPLV.IP)
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_T_cent_gt1055lt1407kW_5.91COP_9.04IPLV.SI_cap-f-t, !- Name
+ ASHRAE901_AppJ_wtr_T_cent_gte1055lt1407kW_5.91COP_9.04IPLV.SI_cap-f-t, !- Name
1.02333694450971, !- Coefficient1 Constant
0.0333781947173553, !- Coefficient2 x
-0.00174216726822566, !- Coefficient3 x**2
@@ -864,7 +864,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_T_cent_gt1055lt1407kW_5.91COP_9.04IPLV.SI_eir-f-t, !- Name
+ ASHRAE901_AppJ_wtr_T_cent_gte1055lt1407kW_5.91COP_9.04IPLV.SI_eir-f-t, !- Name
0.547809585784552, !- Coefficient1 Constant
-0.0294703091959571, !- Coefficient2 x
0.000841857227067557, !- Coefficient3 x**2
@@ -877,18 +877,18 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Quadratic,
- ASHRAE901_AppJ_wtr_T_cent_gt1055lt1407kW_5.91COP_9.04IPLV.SI_eir-f-plr, !- Name
+ ASHRAE901_AppJ_wtr_T_cent_gte1055lt1407kW_5.91COP_9.04IPLV.SI_eir-f-plr, !- Name
0.0828121003830807, !- Coefficient1 Constant
0.152816343206313, !- Coefficient2 x
0.764822154710605, !- Coefficient3 x**2
0.0, !- Minimum Value of x
1.0; !- Maximum Value of x
-!- Set of performance curves for ASHRAE901_AppJ_wtr_U_cent_gt1407lt2110kW_6.01COP_9.28IPLV.SI
-!- (Also applicable for ASHRAE901_AppJ_wtr_U_cent_gt400lt600ton_0.585kWpton_0.379IPLV.IP)
+!- Set of performance curves for ASHRAE901_AppJ_wtr_U_cent_gte1407lt2110kW_6.01COP_9.28IPLV.SI
+!- (Also applicable for ASHRAE901_AppJ_wtr_U_cent_gte400lt600ton_0.585kWpton_0.379IPLV.IP)
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_U_cent_gt1407lt2110kW_6.01COP_9.28IPLV.SI_cap-f-t, !- Name
+ ASHRAE901_AppJ_wtr_U_cent_gte1407lt2110kW_6.01COP_9.28IPLV.SI_cap-f-t, !- Name
0.953579582863989, !- Coefficient1 Constant
0.0530095768947128, !- Coefficient2 x
-0.00238693256378436, !- Coefficient3 x**2
@@ -901,7 +901,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_U_cent_gt1407lt2110kW_6.01COP_9.28IPLV.SI_eir-f-t, !- Name
+ ASHRAE901_AppJ_wtr_U_cent_gte1407lt2110kW_6.01COP_9.28IPLV.SI_eir-f-t, !- Name
0.569569226633626, !- Coefficient1 Constant
-0.0246997814063844, !- Coefficient2 x
0.000727341321689694, !- Coefficient3 x**2
@@ -914,18 +914,18 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Quadratic,
- ASHRAE901_AppJ_wtr_U_cent_gt1407lt2110kW_6.01COP_9.28IPLV.SI_eir-f-plr, !- Name
+ ASHRAE901_AppJ_wtr_U_cent_gte1407lt2110kW_6.01COP_9.28IPLV.SI_eir-f-plr, !- Name
0.0585829703893892, !- Coefficient1 Constant
0.205485686772911, !- Coefficient2 x
0.736344937637699, !- Coefficient3 x**2
0.0, !- Minimum Value of x
1.0; !- Maximum Value of x
-!- Set of performance curves for ASHRAE901_AppJ_wtr_U_cent_gt2110kW_6.01COP_9.28IPLV.SI
-!- (Also applicable for ASHRAE901_AppJ_wtr_U_cent_gt600ton_0.585kWpton_0.379IPLV.IP)
+!- Set of performance curves for ASHRAE901_AppJ_wtr_U_cent_gte2110kW_6.01COP_9.28IPLV.SI
+!- (Also applicable for ASHRAE901_AppJ_wtr_U_cent_gte600ton_0.585kWpton_0.379IPLV.IP)
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_U_cent_gt2110kW_6.01COP_9.28IPLV.SI_cap-f-t, !- Name
+ ASHRAE901_AppJ_wtr_U_cent_gte2110kW_6.01COP_9.28IPLV.SI_cap-f-t, !- Name
0.953579582863989, !- Coefficient1 Constant
0.0530095768947128, !- Coefficient2 x
-0.00238693256378436, !- Coefficient3 x**2
@@ -938,7 +938,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_U_cent_gt2110kW_6.01COP_9.28IPLV.SI_eir-f-t, !- Name
+ ASHRAE901_AppJ_wtr_U_cent_gte2110kW_6.01COP_9.28IPLV.SI_eir-f-t, !- Name
0.569569226633626, !- Coefficient1 Constant
-0.0246997814063844, !- Coefficient2 x
0.000727341321689694, !- Coefficient3 x**2
@@ -951,7 +951,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Quadratic,
- ASHRAE901_AppJ_wtr_U_cent_gt2110kW_6.01COP_9.28IPLV.SI_eir-f-plr, !- Name
+ ASHRAE901_AppJ_wtr_U_cent_gte2110kW_6.01COP_9.28IPLV.SI_eir-f-plr, !- Name
0.0585829703893892, !- Coefficient1 Constant
0.205485686772911, !- Coefficient2 x
0.736344937637699, !- Coefficient3 x**2
@@ -995,11 +995,11 @@ Curve:Quadratic,
0.0, !- Minimum Value of x
1.0; !- Maximum Value of x
-!- Set of performance curves for ASHRAE901_AppJ_wtr_X_pdsp_gt528lt1055kW_4.9COP_5.63IPLV.SI
-!- (Also applicable for ASHRAE901_AppJ_wtr_X_pdsp_gt150lt300ton_0.7178kWpton_0.625IPLV.IP)
+!- Set of performance curves for ASHRAE901_AppJ_wtr_X_pdsp_gte528lt1055kW_4.9COP_5.63IPLV.SI
+!- (Also applicable for ASHRAE901_AppJ_wtr_X_pdsp_gte150lt300ton_0.7178kWpton_0.625IPLV.IP)
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_X_pdsp_gt528lt1055kW_4.9COP_5.63IPLV.SI_cap-f-t, !- Name
+ ASHRAE901_AppJ_wtr_X_pdsp_gte528lt1055kW_4.9COP_5.63IPLV.SI_cap-f-t, !- Name
0.850132807800842, !- Coefficient1 Constant
0.0502343295352255, !- Coefficient2 x
-0.00195120457939483, !- Coefficient3 x**2
@@ -1012,7 +1012,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_X_pdsp_gt528lt1055kW_4.9COP_5.63IPLV.SI_eir-f-t, !- Name
+ ASHRAE901_AppJ_wtr_X_pdsp_gte528lt1055kW_4.9COP_5.63IPLV.SI_eir-f-t, !- Name
0.627193472420831, !- Coefficient1 Constant
-0.0156455505981998, !- Coefficient2 x
0.00106744617521574, !- Coefficient3 x**2
@@ -1025,18 +1025,18 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Quadratic,
- ASHRAE901_AppJ_wtr_X_pdsp_gt528lt1055kW_4.9COP_5.63IPLV.SI_eir-f-plr, !- Name
+ ASHRAE901_AppJ_wtr_X_pdsp_gte528lt1055kW_4.9COP_5.63IPLV.SI_eir-f-plr, !- Name
0.250800802489875, !- Coefficient1 Constant
0.345915394600576, !- Coefficient2 x
0.399137769109547, !- Coefficient3 x**2
0.0, !- Minimum Value of x
1.0; !- Maximum Value of x
-!- Set of performance curves for ASHRAE901_AppJ_wtr_Y_pdsp_gt1055kW_5.5COP_6.16IPLV.SI
-!- (Also applicable for ASHRAE901_AppJ_wtr_Y_pdsp_gt300ton_0.6395kWpton_0.571IPLV.IP)
+!- Set of performance curves for ASHRAE901_AppJ_wtr_Y_pdsp_gte1055kW_5.5COP_6.16IPLV.SI
+!- (Also applicable for ASHRAE901_AppJ_wtr_Y_pdsp_gte300ton_0.6395kWpton_0.571IPLV.IP)
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_Y_pdsp_gt1055kW_5.5COP_6.16IPLV.SI_cap-f-t, !- Name
+ ASHRAE901_AppJ_wtr_Y_pdsp_gte1055kW_5.5COP_6.16IPLV.SI_cap-f-t, !- Name
0.873130400739749, !- Coefficient1 Constant
0.0335989914501505, !- Coefficient2 x
-0.00139120004985455, !- Coefficient3 x**2
@@ -1049,7 +1049,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_Y_pdsp_gt1055kW_5.5COP_6.16IPLV.SI_eir-f-t, !- Name
+ ASHRAE901_AppJ_wtr_Y_pdsp_gte1055kW_5.5COP_6.16IPLV.SI_eir-f-t, !- Name
0.664853649239487, !- Coefficient1 Constant
-0.0290160572428209, !- Coefficient2 x
0.00133902470193009, !- Coefficient3 x**2
@@ -1062,7 +1062,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Quadratic,
- ASHRAE901_AppJ_wtr_Y_pdsp_gt1055kW_5.5COP_6.16IPLV.SI_eir-f-plr, !- Name
+ ASHRAE901_AppJ_wtr_Y_pdsp_gte1055kW_5.5COP_6.16IPLV.SI_eir-f-plr, !- Name
0.320097331849236, !- Coefficient1 Constant
0.0743563119447526, !- Coefficient2 x
0.602937685106011, !- Coefficient3 x**2
@@ -1106,11 +1106,11 @@ Curve:Quadratic,
0.0, !- Minimum Value of x
1.0; !- Maximum Value of x
-!- Set of performance curves for ASHRAE901_AppJ_wtr_AA_cent_gt528lt1055kW_5.55COP_5.91IPLV.SI
-!- (Also applicable for ASHRAE901_AppJ_wtr_AA_cent_gt150lt300ton_0.6337kWpton_0.595IPLV.IP)
+!- Set of performance curves for ASHRAE901_AppJ_wtr_AA_cent_gte528lt1055kW_5.55COP_5.91IPLV.SI
+!- (Also applicable for ASHRAE901_AppJ_wtr_AA_cent_gte150lt300ton_0.6337kWpton_0.595IPLV.IP)
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_AA_cent_gt528lt1055kW_5.55COP_5.91IPLV.SI_cap-f-t, !- Name
+ ASHRAE901_AppJ_wtr_AA_cent_gte528lt1055kW_5.55COP_5.91IPLV.SI_cap-f-t, !- Name
0.909632522228273, !- Coefficient1 Constant
0.0354598311790981, !- Coefficient2 x
-0.0018813582248979, !- Coefficient3 x**2
@@ -1123,7 +1123,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_AA_cent_gt528lt1055kW_5.55COP_5.91IPLV.SI_eir-f-t, !- Name
+ ASHRAE901_AppJ_wtr_AA_cent_gte528lt1055kW_5.55COP_5.91IPLV.SI_eir-f-t, !- Name
0.464330147187021, !- Coefficient1 Constant
-0.0338344301001628, !- Coefficient2 x
0.000730584200983082, !- Coefficient3 x**2
@@ -1136,18 +1136,18 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Quadratic,
- ASHRAE901_AppJ_wtr_AA_cent_gt528lt1055kW_5.55COP_5.91IPLV.SI_eir-f-plr, !- Name
+ ASHRAE901_AppJ_wtr_AA_cent_gte528lt1055kW_5.55COP_5.91IPLV.SI_eir-f-plr, !- Name
0.339493762471831, !- Coefficient1 Constant
0.0490895433870147, !- Coefficient2 x
0.611582147741153, !- Coefficient3 x**2
0.0, !- Minimum Value of x
1.0; !- Maximum Value of x
-!- Set of performance curves for ASHRAE901_AppJ_wtr_AB_cent_gt1055kW_6.1COP_6.41IPLV.SI
-!- (Also applicable for ASHRAE901_AppJ_wtr_AB_cent_gt300ton_0.5766kWpton_0.549IPLV.IP)
+!- Set of performance curves for ASHRAE901_AppJ_wtr_AB_cent_gte1055kW_6.1COP_6.41IPLV.SI
+!- (Also applicable for ASHRAE901_AppJ_wtr_AB_cent_gte300ton_0.5766kWpton_0.549IPLV.IP)
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_AB_cent_gt1055kW_6.1COP_6.41IPLV.SI_cap-f-t, !- Name
+ ASHRAE901_AppJ_wtr_AB_cent_gte1055kW_6.1COP_6.41IPLV.SI_cap-f-t, !- Name
0.988289399105446, !- Coefficient1 Constant
0.031127718217927, !- Coefficient2 x
-0.00154986412921254, !- Coefficient3 x**2
@@ -1160,7 +1160,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Biquadratic,
- ASHRAE901_AppJ_wtr_AB_cent_gt1055kW_6.1COP_6.41IPLV.SI_eir-f-t, !- Name
+ ASHRAE901_AppJ_wtr_AB_cent_gte1055kW_6.1COP_6.41IPLV.SI_eir-f-t, !- Name
0.563967192309392, !- Coefficient1 Constant
-0.034330681975216, !- Coefficient2 x
0.00101506219660673, !- Coefficient3 x**2
@@ -1173,7 +1173,7 @@ Curve:Biquadratic,
40; !- Maximum Value of y
Curve:Quadratic,
- ASHRAE901_AppJ_wtr_AB_cent_gt1055kW_6.1COP_6.41IPLV.SI_eir-f-plr, !- Name
+ ASHRAE901_AppJ_wtr_AB_cent_gte1055kW_6.1COP_6.41IPLV.SI_eir-f-plr, !- Name
0.309752375539755, !- Coefficient1 Constant
0.153649268551135, !- Coefficient2 x
0.536462254009109, !- Coefficient3 x**2
diff --git a/datasets/ResidentialACsAndHPsPerfCurves.idf b/datasets/ResidentialACsAndHPsPerfCurves.idf
index 8685977b81e..003ea636b99 100644
--- a/datasets/ResidentialACsAndHPsPerfCurves.idf
+++ b/datasets/ResidentialACsAndHPsPerfCurves.idf
@@ -154,10 +154,10 @@
! , !- Speed 1 Rated COP {W/W}
! , !- Speed 1 Rated Air Flow Rate {m3/s}
! , !- Rated Evaporator Fan Power Per Volume Flow Rate {W/(m3/s)}
-! ACHighStageCoolingCAPFTemp, !- Speed 1 Total Cooling Capacity Function of Temperature Curve Name
-! ACHighStageCoolingCAPFFF, !- Speed 1 Total Cooling Capacity Function of Flow Fraction Curve Name
-! ACHighStageCoolingEIRFTemp, !- Speed 1 Energy Input Ratio Function of Temperature Curve Name
-! ACHighStageCoolingEIRFFF, !- Speed 1 Energy Input Ratio Function of Flow Fraction Curve Name
+! ACLowStageCoolingCAPFTemp, !- Speed 1 Total Cooling Capacity Function of Temperature Curve Name
+! ACLowStageCoolingCAPFFF, !- Speed 1 Total Cooling Capacity Function of Flow Fraction Curve Name
+! ACLowStageCoolingEIRFTemp, !- Speed 1 Energy Input Ratio Function of Temperature Curve Name
+! ACLowStageCoolingEIRFFF, !- Speed 1 Energy Input Ratio Function of Flow Fraction Curve Name
! AC2StageCoolingPLFFPLR, !- Speed 1 Part Load Fraction Correlation Curve Name
! , !- Speed 1 Nominal Time for Condensate Removal to Begin {s}
! , !- Speed 1 Ratio of Initial Moisture Evaporation Rate and Steady State Latent Capacity {dimensionless}
@@ -173,10 +173,10 @@
! , !- Speed 2 Rated COP {W/W}
! , !- Speed 2 Rated Air Flow Rate {m3/s}
! , !- Rated Evaporator Fan Power Per Volume Flow Rate {W/(m3/s)}
-! ACLowStageCoolingCAPFTemp, !- Speed 2 Total Cooling Capacity Function of Temperature Curve Name
-! ACLowStageCoolingCAPFFF, !- Speed 2 Total Cooling Capacity Function of Flow Fraction Curve Name
-! ACLowStageCoolingEIRFTemp, !- Speed 2 Energy Input Ratio Function of Temperature Curve Name
-! ACLowStageCoolingEIRFFF, !- Speed 2 Energy Input Ratio Function of Flow Fraction Curve Name
+! ACHighStageCoolingCAPFTemp, !- Speed 2 Total Cooling Capacity Function of Temperature Curve Name
+! ACHighStageCoolingCAPFFF, !- Speed 2 Total Cooling Capacity Function of Flow Fraction Curve Name
+! ACHighStageCoolingEIRFTemp, !- Speed 2 Energy Input Ratio Function of Temperature Curve Name
+! ACHighStageCoolingEIRFFF, !- Speed 2 Energy Input Ratio Function of Flow Fraction Curve Name
! AC2StageCoolingPLFFPLR, !- Speed 2 Part Load Fraction Correlation Curve Name
! , !- Speed 2 Nominal Time for Condensate Removal to Begin {s}
! , !- Speed 2 Ratio of Initial Moisture Evaporation Rate and steady state Latent Capacity {dimensionless}
@@ -570,10 +570,10 @@
! , !- Speed 1 Rated COP {W/W}
! , !- Speed 1 Rated Air Flow Rate {m3/s}
! , !- Rated Evaporator Fan Power Per Volume Flow Rate {W/(m3/s)}
-! HPHighStageCoolingCAPFTemp, !- Speed 1 Total Cooling Capacity Function of Temperature Curve Name
-! HPHighStageCoolingCAPFFF, !- Speed 1 Total Cooling Capacity Function of Flow Fraction Curve Name
-! HPHighStageCoolingEIRFTemp, !- Speed 1 Energy Input Ratio Function of Temperature Curve Name
-! HPHighStageCoolingEIRFFF, !- Speed 1 Energy Input Ratio Function of Flow Fraction Curve Name
+! HPLowStageCoolingCAPFTemp, !- Speed 1 Total Cooling Capacity Function of Temperature Curve Name
+! HPLowStageCoolingCAPFFF, !- Speed 1 Total Cooling Capacity Function of Flow Fraction Curve Name
+! HPLowStageCoolingEIRFTemp, !- Speed 1 Energy Input Ratio Function of Temperature Curve Name
+! HPLowStageCoolingEIRFFF, !- Speed 1 Energy Input Ratio Function of Flow Fraction Curve Name
! HP2StageCoolingPLFFPLR, !- Speed 1 Part Load Fraction Correlation Curve Name
! , !- Speed 1 Nominal Time for Condensate Removal to Begin {s}
! , !- Speed 1 Ratio of Initial Moisture Evaporation Rate and Steady State Latent Capacity {dimensionless}
@@ -589,10 +589,10 @@
! , !- Speed 2 Rated COP {W/W}
! , !- Speed 2 Rated Air Flow Rate {m3/s}
! , !- Rated Evaporator Fan Power Per Volume Flow Rate {W/(m3/s)}
-! HPLowStageCoolingCAPFTemp, !- Speed 2 Total Cooling Capacity Function of Temperature Curve Name
-! HPLowStageCoolingCAPFFF, !- Speed 2 Total Cooling Capacity Function of Flow Fraction Curve Name
-! HPLowStageCoolingEIRFTemp, !- Speed 2 Energy Input Ratio Function of Temperature Curve Name
-! HPLowStageCoolingEIRFFF, !- Speed 2 Energy Input Ratio Function of Flow Fraction Curve Name
+! HPHighStageCoolingCAPFTemp, !- Speed 2 Total Cooling Capacity Function of Temperature Curve Name
+! HPHighStageCoolingCAPFFF, !- Speed 2 Total Cooling Capacity Function of Flow Fraction Curve Name
+! HPHighStageCoolingEIRFTemp, !- Speed 2 Energy Input Ratio Function of Temperature Curve Name
+! HPHighStageCoolingEIRFFF, !- Speed 2 Energy Input Ratio Function of Flow Fraction Curve Name
! HP2StageCoolingPLFFPLR, !- Speed 2 Part Load Fraction Correlation Curve Name
! , !- Speed 2 Nominal Time for Condensate Removal to Begin {s}
! , !- Speed 2 Ratio of Initial Moisture Evaporation Rate and steady state Latent Capacity {dimensionless}
@@ -762,10 +762,10 @@
! , !- Speed 1 Rated COP {W/W}
! , !- Speed 1 Rated Air Flow Rate {m3/s}
! , !- Speed 1 Rated Supply Air Fan Power Per Volume Flow Rate {W/(m3/s)}
-! HPHighStageHeatingCAPFTemp, !- Speed 1 Total Heating Capacity Function of Temperature Curve Name
-! HPHighStageHeatingCAPFFF, !- Speed 1 Total Heating Capacity Function of Flow Fraction Curve Name
-! HPHighStageHeatingEIRFTemp, !- Speed 1 Energy Input Ratio Function of Temperature Curve Name
-! HPHighStageHeatingEIRFFF, !- Speed 1 Energy Input Ratio Function of Flow Fraction Curve Name
+! HPLowStageHeatingCAPFTemp, !- Speed 1 Total Heating Capacity Function of Temperature Curve Name
+! HPLowStageHeatingCAPFFF, !- Speed 1 Total Heating Capacity Function of Flow Fraction Curve Name
+! HPLowStageHeatingEIRFTemp, !- Speed 1 Energy Input Ratio Function of Temperature Curve Name
+! HPLowStageHeatingEIRFFF, !- Speed 1 Energy Input Ratio Function of Flow Fraction Curve Name
! HP2StageHeatingPLFFPLR, !- Speed 1 Part Load Fraction Correlation Curve Name
! , !- Speed 1 Rated Waste Heat Fraction of Power Input {dimensionless}
! , !- Speed 1 Waste Heat Function of Temperature Curve Name
@@ -773,10 +773,10 @@
! , !- Speed 2 Rated COP {W/W}
! , !- Speed 2 Rated Air Flow Rate {m3/s}
! , !- Speed 2 Rated Supply Air Fan Power Per Volume Flow Rate {W/(m3/s)}
-! HPLowStageHeatingCAPFTemp, !- Speed 2 Total Heating Capacity Function of Temperature Curve Name
-! HPLowStageHeatingCAPFFF, !- Speed 2 Total Heating Capacity Function of Flow Fraction Curve Name
-! HPLowStageHeatingEIRFTemp, !- Speed 2 Energy Input Ratio Function of Temperature Curve Name
-! HPLowStageHeatingEIRFFF, !- Speed 2 Energy Input Ratio Function of Flow Fraction Curve Name
+! HPHighStageHeatingCAPFTemp, !- Speed 2 Total Heating Capacity Function of Temperature Curve Name
+! HPHighStageHeatingCAPFFF, !- Speed 2 Total Heating Capacity Function of Flow Fraction Curve Name
+! HPHighStageHeatingEIRFTemp, !- Speed 2 Energy Input Ratio Function of Temperature Curve Name
+! HPHighStageHeatingEIRFFF, !- Speed 2 Energy Input Ratio Function of Flow Fraction Curve Name
! HP2StageHeatingPLFFPLR, !- Speed 2 Part Load Fraction Correlation Curve Name
! , !- Speed 2 Rated Waste Heat Fraction of Power Input {dimensionless}
! ; !- Speed 2 Waste Heat Function of Temperature Curve Name
diff --git a/design/FY2023/NFP-evapCoolerRHcontrol.md b/design/FY2023/NFP-evapCoolerRHcontrol.md
new file mode 100644
index 00000000000..d2010d6d0c6
--- /dev/null
+++ b/design/FY2023/NFP-evapCoolerRHcontrol.md
@@ -0,0 +1,153 @@
+
+Enhancement of Evaporative Cooler in EnergyPlus
+================
+
+**Yujie Xu, Tianzhen Hong**
+
+**Lawrence Berkeley National Laboratory***
+
+ - Original Date: Apr 7, 2023
+ - Modified Date: Apr 11, 2023
+
+## Justification for Feature Update
+
+As global climate change continues, the frequency, duration and intensity of heatwaves could increase. As an affordable and energy efficient cooling option [1], evaporative cooling could become more prevalent in the future, especially in hot and dry climates. As a result, it is crucial to provide accurate and more user-friendly simulation support for prototyping new evaporative coolers and their applications. With this motivation, this EnergyPlus feature is proposed to provide an additional relative humidity-driven control option.
+
+![zoneEvapCoolerDiagram](zoneEvapCoolerDiagram.png)
+
Figure 1. Conceptual diagram of a direct evaporative cooler [source](https://basc.pnnl.gov/resource-guides/evaporative-cooling-systems#edit-group-description) (left), an example of a zone-level direct evaporative cooler[source](https://www.nytimes.com/wirecutter/blog/do-swamp-coolers-work/) (right).
+
+The enhancement was motivated by discussions with the CBE research group at UC Berkeley: Hui Zhang, Roberto Rugani, and Maria Andre.
+
+## Overview ##
+
+The introduction of excessive moisture is one of the potential issues of direct evaporative coolers. A humidity control could become useful in preventing the evaporative cooler from raising indoor humidity to an uncomfortable level. Currently, the direct evaporative cooler can be controlled with the sensor node temperature using AvailabilityManagers (*AvailabilityManager:LowTemperatureTurnOff* or *AvailabilityManager:HighTemperatureTurnOn*). This feature proposes to add a relative humidity (RH) control to shut down the evaporative cooler when the indoor relative humidity is too high.
+
+We plan to enhance the zone level evaporative cooler object, *ZoneHVAC:EvaporativeCoolerUnit*. This is a compound object that combines a fan and one
+Each evaporative cooler in this object can be a direct or indirect. This feature will add some additional fields to this zone-level object, allowing user to specify a relative-humidity threshold above which the unit will be turned off.
+
+## Approach
+
+To enable a high-relative-humidity-cutoff control, a field will be added to the *ZoneHVAC:EvaporativeCoolerUnit* object. See Section IDD object change for details.
+
+## Testing/Validation/Data Source(s)
+
+This feature will be tested and demonstrated with a test file derived from StripMallZoneEvapCooler.idf. Manual check of the time-step EnergyPlus simulation results will be conducted to confirm the added feature is working correctly.
+
+## IDD Object changes
+
+A field (N4) will be added to the ZoneHVAC:EvaporativeCoolerUnit
+
+ ZoneHVAC:EvaporativeCoolerUnit,
+ \memo Zone evaporative cooler. Forced-convection cooling-only unit with supply fan,
+ \memo 100% outdoor air supply. Optional relief exhaust node
+ \min-fields 15
+ A1 , \field Name
+ \required-field
+ \reference ZoneEquipmentNames
+ A2 , \field Availability Schedule Name
+ \note Availability schedule name for this system. Schedule value > 0 means the system is available.
+ \note If this field is blank, the system is always available.
+ \type object-list
+ \object-list ScheduleNames
+ A3, \field Availability Manager List Name
+ \note Enter the name of an AvailabilityManagerAssignmentList object.
+ \type object-list
+ \object-list SystemAvailabilityManagerLists
+ A4 , \field Outdoor Air Inlet Node Name
+ \required-field
+ \type node
+ \note this is an outdoor air node
+ A5 , \field Cooler Outlet Node Name
+ \required-field
+ \type node
+ \note this is a zone inlet node
+ A6 , \field Zone Relief Air Node Name
+ \type node
+ \note this is a zone exhaust node, optional if flow is being balanced elsewhere
+ A7 , \field Supply Air Fan Object Type
+ \required-field
+ \type choice
+ \key Fan:SystemModel
+ \key Fan:ComponentModel
+ \key Fan:ConstantVolume
+ \key Fan:OnOff
+ \key Fan:VariableVolume
+ A8 , \field Supply Air Fan Name
+ \required-field
+ \type object-list
+ \object-list Fans
+ N1 , \field Design Supply Air Flow Rate
+ \required-field
+ \units m3/s
+ \minimum> 0
+ \autosizable
+ A9 , \field Fan Placement
+ \required-field
+ \type choice
+ \key BlowThrough
+ \key DrawThrough
+ A10, \field Cooler Unit Control Method
+ \required-field
+ \type choice
+ \key ZoneTemperatureDeadbandOnOffCycling
+ \key ZoneCoolingLoadOnOffCycling
+ \key ZoneCoolingLoadVariableSpeedFan
+ N2 , \field Throttling Range Temperature Difference
+ \note used for ZoneTemperatureDeadbandOnOffCycling hystersis range for thermostatic control
+ \type real
+ \units deltaC
+ \default 1.0
+ \minimum> 0.0
+ N3 , \field Cooling Load Control Threshold Heat Transfer Rate
+ \type real
+ \units W
+ \default 100.0
+ \note Sign convention is that positive values indicate a cooling load
+ \minimum> 0.0
+ A11, \field First Evaporative Cooler Object Type
+ \required-field
+ \type choice
+ \key EvaporativeCooler:Direct:CelDekPad
+ \key EvaporativeCooler:Direct:ResearchSpecial
+ \key EvaporativeCooler:Indirect:CelDekPad
+ \key EvaporativeCooler:Indirect:WetCoil
+ \key EvaporativeCooler:Indirect:ResearchSpecial
+ A12, \field First Evaporative Cooler Object Name
+ \required-field
+ \type object-list
+ \object-list EvapCoolerNames
+ A13, \field Second Evaporative Cooler Object Type
+ \note optional, used for direct/indirect configurations
+ \note second cooler must be immediately downstream of first cooler, if present
+ \type choice
+ \key EvaporativeCooler:Direct:CelDekPad
+ \key EvaporativeCooler:Direct:ResearchSpecial
+ \key EvaporativeCooler:Indirect:CelDekPad
+ \key EvaporativeCooler:Indirect:WetCoil
+ \key EvaporativeCooler:Indirect:ResearchSpecial
+ A14, \field Second Evaporative Cooler Name
+ \note optional, used for direct/indirect configurations
+ \type object-list
+ \object-list EvapCoolerNames
+ A15, \field Design Specification ZoneHVAC Sizing Object Name
+ \note Enter the name of a DesignSpecificationZoneHVACSizing object.
+ \type object-list
+ \object-list DesignSpecificationZoneHVACSizingName
+ N4; \field Shut Off Relative Humidity
+ \note Zone relative humidity above which the evap cooler is shut off.
+ \type real
+ \minimum 0.00
+ \maximum 100.00
+ \units percent
+
+## Proposed additions to Meters:
+
+N/A
+
+## Proposed Report Variables:
+
+N/A
+
+## References
+
+[1] https://www.energy.gov/energysaver/evaporative-coolers
diff --git a/design/FY2023/zoneEvapCoolerDiagram.png b/design/FY2023/zoneEvapCoolerDiagram.png
new file mode 100644
index 00000000000..7bdf367fba3
Binary files /dev/null and b/design/FY2023/zoneEvapCoolerDiagram.png differ
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 c33e71e85b3..7aeb04899d8 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
@@ -406,39 +406,93 @@ \subsubsection{Overlapping Shadows}\label{overlapping-shadows}
\caption{Complex Overlapping Condition \protect \label{fig:complex-overlapping-condition}}
\end{figure}
-If two shadows overlap the receiving surface, they may also overlap each other as in Figure~\ref{fig:multiple-shadow-overlaps}. The vertices of this overlap can be computed.~ The areas of all overlaps can be computed.~ The total sunlit area can be expressed as the sum of all polygon areas given a proper sign on each of the areas.
+If two shadows overlap the receiving surface, they may also overlap each other as in Figure~\ref{fig:multiple-shadow-overlaps}. The vertices of this overlap can be computed, and the areas of all overlaps can be computed. For opaque shadows, the total sunlit area can be expressed as the sum of all polygon areas using the sign convention shown in Table \ref{table:surface-area-characteristic-convention}:
-The following convention was adopted:
+\begin{equation}
+SunlitArea = {\sum\limits_{i = 1}^n {A_i}}
+\end{equation}
-% table 24
-\begin{longtable}[c]{@{}ll@{}}
-\caption{Surface / Area Characteristic / Convention \label{table:surface-area-characteristic-convention}} \tabularnewline
+Each shadow's area is subtracted from the receiving surface and so on through multiple overlaps where the sign of the overlap area is the product of the signs of the overlapping areas. For the shadows in Figure~\ref{fig:multiple-shadow-overlaps}, start with the receiving surface area A, subtract shadow area B, then subtract shadow area C. Because shadows B and C overlap, the overlap area D has been subtracted twice, so add back area D to get the final sunlit area on the receiving surface.
+
+
+\begin{longtable}[c]{>{\raggedright}p{2.9in}p{1.5in}p{1.59in}}
+\caption{Overlapping Shadow Surface Area Convention \label{table:surface-area-characteristic-convention}} \tabularnewline
\toprule
-Surface Characteristic & Area Convention \tabularnewline
+Surface Characteristic & Area Convention & Sunlit Area \tabularnewline
\midrule
\endfirsthead
-\caption[]{Surface / Area Characteristic / Convention} \tabularnewline
+\caption[]{Overlapping Shadow Surface Area Convention} \tabularnewline
\toprule
-Surface Characteristic & Area Convention \tabularnewline
+Surface Characteristic & Area Convention & Sunlit Area \tabularnewline
\midrule
\endhead
-receiving surface & positive (A) \tabularnewline
-overlap between shadow and receiving & negative (B \& C) \tabularnewline
-overlap between two shadows & positive (D) \tabularnewline
+receiving surface & positive A & A \tabularnewline
+overlap between shadow and receiving & negative B & A-B \tabularnewline
+overlap between shadow and receiving & negative C & A-B-C \tabularnewline
+overlap between two shadows & positive D & A-B-C+D \tabularnewline
\bottomrule
\end{longtable}
-and so on through multiple overlaps where the sign of the overlap area is the product of the signs of the overlapping areas.
-
\begin{figure}[hbtp] % fig 47
\centering
\includegraphics[width=0.9\textwidth, height=0.9\textheight, keepaspectratio=true]{media/image642.png}
\caption{Multiple Shadow Overlaps \protect \label{fig:multiple-shadow-overlaps}}
\end{figure}
-Partially transparent shadowing surfaces can also be modeled by giving a transparency ($\tau$) to every shadowing polygon. Let $\tau$ of the receiving polygon be one. Then the $\tau$ of every overlap of polygons i and j is the product of $\tau$\(_{i}\)and $\tau$\(_{j}\). The shaded area is then computed by summing A\(_{i}\)*(1 - $\tau$\(_{i}\)) for all overlap polygons.
+Partially transparent shadowing surfaces can also be modeled by giving a transparency ($\tau$) to every shadowing polygon. The sunlit area is computed by:
+
+\begin{equation}
+SunlitArea = A_1 + {\sum\limits_{i = 2}^n {A_i}*(1-\tau_i)}
+\end{equation}
+
+The actual $\tau$ of overlapping polygons i and j is the product of $\tau_i$ and $\tau_j$. For example, if a wall is fully shaded by two partially transparent shades, one with a transmittance of 0.8 and one with a transmittance of 0.5, the resulting sunlit fraction would be $0.8 * 0.5 = 0.4$. Because each shadow is first applied with its own transmittance, the ``transmittance'' for the overlap correction ($\tau_k$) in the sunlit area summation is derived from the individual surface transmittance values:
+
+\begin{equation}
+\tau_k = (\tau_{i} + \tau_{j}) - (\tau_{i} * \tau_{j})
+\end{equation}
+
+where $\tau_k$ is the correction ``transmittance'' for the shadow overlap area (D in Figure~\ref{fig:multiple-shadow-overlaps}).
+
+For example, using the overlapping shadows in Figure~\ref{fig:multiple-shadow-overlaps}, the sunlit area can be calculated two ways as shown in Table~\ref{table:sunlit-area-calculation-overlapping-shadows}. Method 1 avoids any overlaps by calculating adjusted areas. Method 2 uses the EnergyPlus summation approach and shows the transmittance correction calculation for the overlap area to arrive at the same result. Stepping through Method 2: start with the full surface area A, subtract the shaded area $B*(1-\tau_b)$, subtract the shaded area $C*(1-\tau_c)$. At this point, the overlapping area D has been subtracted twice, once using $\tau_b$ and once using $\tau_c$. To correct for this, area D is added back in with the adjusted ``transmittance'' using the equation shown above for $\tau_k$. Once the sunlit area is known for each surface, the sunlit fraction is calculated, which is $13.56/20=0.678$ for this example.
+
+\begin{longtable}[c]{>{\raggedright}p{1.2in}p{1.5in}p{2.0in}p{2.0in}}
+\caption{Sunlit Area Calculations with Overlapping Partially Transmitting Shadows\label{table:sunlit-area-calculation-overlapping-shadows}} \tabularnewline
+\toprule
+Region & Area & Transmittance & Sunlit Area \tabularnewline
+\midrule
+\endfirsthead
+
+\caption[]{Sunlit Area Calculations with Overlapping Partially Transmitting Shadows} \tabularnewline
+\toprule
+Region & Area & Transmittance & Sunlit Area \tabularnewline
+\midrule
+\endhead
+
+Assumptions: \tabularnewline
+A & 20 & 1.0 \tabularnewline
+B & 10 & 0.8 \tabularnewline
+C & 8 & 0.4 \tabularnewline
+D & 3 & \tabularnewline
+\midrule
+Method 1 & Adjusted Areas:\tabularnewline
+$A-B-C+D$ & $20-10-8+3 = 5$ & $1.0$ & $5*1.0 = 5.00$ \tabularnewline
+$B-D$ & $10-3=7$ & $0.8$ & $7*0.8 = 5.60$ \tabularnewline
+$C-D$ & $8-3=5$ & $0.4$ & $5*0.4 = 2.00$ \tabularnewline
+$D$ & $3$ & $0.8 * 0.4 = 0.32$ & $3*0.32 = 0.96$ \tabularnewline
+Total & $20$ & & $13.56$ \tabularnewline
+\midrule
+Method 2 & Full Areas:\tabularnewline
+$A$ & $20$ & n/a & $20.00$ \tabularnewline
+$B$ & $-10$ & $0.8$ & $-10*(1-0.8) = -2.00$ \tabularnewline
+$C$ & $-8$ & $0.4$ & $-8*(1-0.4) = -4.80$ \tabularnewline
+$D$ & $3$ & $(0.8+0.4)-(0.8 * 0.4) = 0.88$ & $+3*(1-0.88) = 0.36$ \tabularnewline
+Total & & & $13.56$ \tabularnewline
+\bottomrule
+\end{longtable}
+
+
It is easy to determine the sunlit area of a window once all the shadow and overlap vertices on the wall have been computed. Consider wall 2 of Figure~\ref{fig:overall-shadowing-scheme-depiction}. First, the wall is considered a simple rectangle and the window on it is ignored. The shadow overlapping is performed and the sunlit portion of the gross wall area is computed. Then the window rectangle is overlapped with the shadow to determine its sunlit area. The sunlit area of the window is subtracted from the gross wall sunlit area to determine the net wall sunlit area. During this calculation it is not necessary to recompute the shadows, because they were precisely determined on the wall.
diff --git a/doc/engineering-reference/src/simulation-models-encyclopedic-reference-003/indoor-swimming-pool.tex b/doc/engineering-reference/src/simulation-models-encyclopedic-reference-003/indoor-swimming-pool.tex
index b1471d85893..078b25a70ed 100644
--- a/doc/engineering-reference/src/simulation-models-encyclopedic-reference-003/indoor-swimming-pool.tex
+++ b/doc/engineering-reference/src/simulation-models-encyclopedic-reference-003/indoor-swimming-pool.tex
@@ -25,14 +25,14 @@ \section{Indoor Swimming Pool }\label{indoor-swimming-pool}
\item
The pool is controlled to a particular temperature defined by user input.
\item
- Evaporation of water from the pool is added to the zone moisture balance and affects the zone humidity ratio.
+ Water that evaporates from the pool is added to the zone moisture balance and affects the zone humidity ratio.
\item
The pool depth is small in comparison to its surface area. Thus, heat transfer through the pool walls is neglected. This is in keeping with the standard assumption of one-dimensional heat transfer through surfaces in EnergyPlus.
\end{itemize}
\subsection{Energy Balance of Indoor Swimming Pool}\label{energy-balance-of-indoor-swimming-pool}
-Heat losses from indoor swimming pools occur by a variety of mechanisms. Sensible heat transfer by convection, latent heat loss associated with evaporation, and net radiative heat exchange with the surrounding occur at the pool surface. Conductive heat losses take place through the bottom of the pool. Other heat gains/losses are associated with the pool water heating system, the replacement of evaporated water with makeup water The energy balance of the indoor swimming pool estimates the heat gains/losses occurring due to:
+Heat losses from indoor swimming pools occur by a variety of mechanisms. Sensible heat transfer by convection, latent heat loss associated with evaporation, and net radiative sensible heat exchange with the surrounding occur at the pool surface. Conductive heat losses take place through the bottom of the pool. Other heat gains/losses are associated with the pool water heating system and the replacement of evaporated water with makeup water. The energy balance of the indoor swimming pool estimates the heat gains/losses occurring due to:
\begin{itemize}
\tightlist
@@ -76,11 +76,19 @@ \subsection{Convection from the pool water surface}\label{convection-from-the-po
\(T_a\) is the air temperature over pool (\(^{\circ}\)C).
-When a cover is present, the cover and the cover convection factor reduce the heat transfer coefficient proportionally. For example, if the pool is half covered and the pool cover reduces convection by 50\%, the convective heat transfer coefficient is reduced by 25\% from the value calculated using the above equation.
+When a cover is present, the cover fraction and the cover convection factor reduce the heat transfer coefficient proportionally. For example, if the pool is half covered and the pool cover reduces convection by 50\%, the convective heat transfer coefficient is reduced by 25\% from the value calculated using the above equation.
\subsection{Evaporation from the pool water surface}\label{evaporation-from-the-pool-water-surface}
-There are 5 main variables used to calculate the evaporation rate (\(Q_{evap}\)). Note that the units of the equation below are IP units, but this equation is used with conversion factors internally in the EnergyPlus code.
+The latent heat transfer based on the evaporation of water from the pool (\(Q_{evap}\)) is calculated using the following equation:
+
+\begin{equation}
+Q_{evap} = \dot{m}_{evap} \cdot H_{fg}(W,MAT)
+\end{equation}
+
+where \(\dot{m}_{evap}\) is the evaporation rate of the pool water and \(H_{fg}(W,MAT)\) is the heat of vaporation of water as a function of the zone humidity ratio (W) and mean air temperature (MAT).
+
+The equation used to calculate the evaporation rate (\(dot{m}_{evap}\)) is based on four variables:
\begin{itemize}
\tightlist
@@ -96,13 +104,15 @@ \subsection{Evaporation from the pool water surface}\label{evaporation-from-the-
Pool water agitation and Activity Factor
\end{itemize}
+The equation for the evaporation rate is:
+
\begin{equation}
\dot{m}_{evap} = 0.1 \cdot A \cdot AF \cdot (P_w - P_{dp})
\end{equation}
where:
-\(\dot{m}_{evap}\) is the evaporation rate of pool water (lb/h)
+\(\dot{m}_{evap}\) is the evaporation rate of the pool water (lb/h)
\(A\) is the surface area of pool water (ft\(^2\))
@@ -112,7 +122,9 @@ \subsection{Evaporation from the pool water surface}\label{evaporation-from-the-
\(P_{dp}\) is the partial vapor pressure at room air dew point (in. Hg).
+Note that the units of the equation above are IP units. In the EnergyPlus code, this equation uses conversion factors to maintain SI units internally.
+The following table provides some reference activity factors that can aide the user in determining what value(s) should be entered for this parameter in the input file.
\begin{longtable}[c]{@{}ll@{}}
\caption{Typical Activity Factor (AF) \label{table:typical-activity-factor-af}} \tabularnewline
@@ -140,20 +152,22 @@ \subsection{Evaporation from the pool water surface}\label{evaporation-from-the-
\bottomrule
\end{longtable}
-When a cover is present, the cover and the cover evaporation factor reduce the amount of evaporation proportionally. For example, if the pool is half covered and the pool cover reduces convection by 50\%, the convective heat transfer coefficient is reduced by 25\% from the value calculated using the above equation. The value is converted to a latent gain (loss) through multiplication of the evaporation rate by the heat of vaporization of water.
+When a cover is present, the cover fraction and the cover evaporation factor reduce the amount of evaporation proportionally. For example, if the pool is half covered and the pool cover reduces convection by 50\%, the convective heat transfer coefficient is reduced by 25\% from the value calculated using the above equation. The value is converted to a latent gain (loss) through multiplication of the evaporation rate by the heat of vaporization of water.
The user should be aware of two key assumptions built into the equations for calculating the evaporation from the pool. First, when the activity factor is zero, no evaporation will take place. Thus, activity factor is not the same thing as occupancy and should not be zero when there are no people in the pool as that will completely eliminate evaporation. Second, when the cover evaporation factor is zero, the cover will not reduce evaporation at all. A cover factor of 1.0 means that the cover will completely block evaporation.
\subsection{Radiation exchange with the pool water surface}\label{radiation-exchange-with-the-pool-water-surface}
-This uses the EnergyPlus internal short- and long-wavelength radiation balances already in place. When a cover is present, it acts to reduce the amount of radiation that arrives at the pool water surface in comparison to the no cover case. Any reduction in either type of radiation is accounted for by adding a convective gain/loss to the zone air. So, in effect, the cover absorbs some radiation and then convects it to the zone air.
+The radiation exchange between the pool water surface and other surfaces and sources uses the existing EnergyPlus internal short- and long-wavelength radiation balances that are already in place within the program. When a cover is present, it acts to reduce the amount of radiation that arrives at the pool water surface in comparison to the no cover case. Any reduction in either type of radiation is accounted for by adding a convective gain/loss to the zone air. So, in effect, the cover absorbs some radiation and then convects it to the zone air.
\subsection{Conduction through the bottom of the pool}\label{conduction-through-the-bottom-of-the-pool}
-The model ignores 2-d effects of pool walls and assume that pool depth is much less than the pool area. Conduction is calculated using the Conduction Transfer Function (CTF) equation with the outside temperature determined by the outside heat balance and the inside surface temperature calculated using the pool water heat balance that is lumped together with the inside surface heat balance.
+The model ignores 2-dimensional effects of pool walls and assume that pool depth is much less than the pool area. Conduction is calculated using the Conduction Transfer Function (CTF) equation with the outside temperature determined by the outside heat balance and the inside surface temperature calculated using the pool water heat balance that is lumped together with the inside surface heat balance.
\subsection{Makeup pool water supply}\label{makeup-pool-water-supply}
+The energy impact of the makeup water (\(Q_{fw}\)) that is added to the pool to replace any water which evaporates is taken into account using the following equation:
+
\begin{equation}
Q_{fw} = \dot{m}_{fw} \cdot cw \cdot (T_p - T_{fw})
\end{equation}
@@ -170,23 +184,25 @@ \subsection{Makeup pool water supply}\label{makeup-pool-water-supply}
\subsection{Heat Gain from People}\label{heat-gain-from-people}
-The input for the swimming pool requires that the user enter the maximum number of people in the pool, a schedule modifying the maximum number of people for different pool occupancies, and a heat gain per person schedule for differing activities. These three parameters allow for the calculation of a total heat gain from people during a given time. It is assumed that all of the heat gain from people is via convection to the pool water.
+The input for the swimming pool requires that the user enter the maximum number of people in the pool, a schedule modifying the maximum number of people for different pool occupancies, and a heat gain per person schedule for differing activities. These three parameters allow for the calculation of a total heat gain from people during a given time. It is assumed that all of the heat gain from people is added to the pool water via convection.
\subsection{Heat from auxiliary pool heater}\label{heat-from-auxiliary-pool-heater}
+The energy impact of the pool heater (\(Q_{hw}\)) on the pool water temperature is taken into account using the following equation:
+
\begin{equation}
-Q_{fw} = \dot{m}_{hw} \cdot c_w \cdot (T_p - T_{hw})
+Q_{hw} = \dot{m}_{hw} \cdot c_w \cdot (T_p - T_{hw})
\end{equation}
where:
-\(m_{hw}\) = Mass flow rate (kg/s)
+\(m_{hw}\) is the mass flow rate (kg/s)
-\(c_w\) = Specific heat of water (J/kg-\(^{\circ}\)C)
+\(c_w\) is the specific heat of water (J/kg-\(^{\circ}\)C)
-\(T_p\) = Pool water temperature (\(^{\circ}\)C)
+\(T_p\) is the pool water temperature (\(^{\circ}\)C)
-\(T_{hw}\) = Heated water supply temperature (\(^{\circ}\)C).
+\(T_{hw}\) is the heated water supply temperature (\(^{\circ}\)C).
\subsection{Pool Heating to Control the Pool Water Temperature}\label{pool-heating-to-control-the-pool-water-temperature}
@@ -200,7 +216,7 @@ \subsection{Pool Heating to Control the Pool Water Temperature}\label{pool-heati
\(m_w\) is the mass of pool water (kg)
-\(cp\) is the specific heat of water (J/kg-\(^{\circ}\)C)
+\(c_p\) is the specific heat of water (J/kg-\(^{\circ}\)C)
\(\Delta t\) is the time step length (s)
@@ -208,10 +224,11 @@ \subsection{Pool Heating to Control the Pool Water Temperature}\label{pool-heati
\(T_{old}\) is the temperature of water at the last time step (\(^{\circ}\)C)
-\(m_p\) is the needed mass flow rate of water from the plant (kg/s)
+\(dot{m}_p\) is the needed mass flow rate of water from the plant (kg/s)
\(T_{in}\) is the inlet water temperature from the plant (\(^{\circ}\)C).
+
This equation is rearranged to solve for the needed mass flow rate of water from the plant since all of the other terms are known or given based on user input. This establishes a flow request to the plant and is capped at the maximum value defined in input by the user.
\subsection{Pool/Surface Heat Balance Equation Summary}\label{poolsurface-heat-balance-equation-summary}
@@ -242,31 +259,32 @@ \subsection{Pool/Surface Heat Balance Equation Summary}\label{poolsurface-heat-b
\(Q_{evap}\) is the net heat loss due to evaporation of pool water to the zone air.
+
Details on each of these terms was either provided in previous parts of this section or in the standard EnergyPlus heat balance discussion elsewhere in the Engineering Reference.
\subsection{Other additional information}\label{other-additional-information}
-The following subsections are some useful information that those wishing to model a swimming pool in EnergyPlus might find helpful. Further information can be found on-line or in reputable sources such as the ASHRAE Handbooks.
+The following subsections contain some useful information that those wishing to model a swimming pool in EnergyPlus might find helpful. Further information can be found on-line or in reputable sources such as the ASHRAE Handbooks.
-\subsection{Swimming Pool Flow Rate}\label{swimming-pool-flow-rate}
+\subsubsection{Swimming Pool Flow Rate}\label{swimming-pool-flow-rate}
The flow rate of the circulating pump is designed to turn over (circulate) the entire volume of water in the pool in 6 to 8 hours, or 3 or 4 times in 24 hours. About 1 or 2 percent of the pumped circulation rate should be provided as continuous makeup water demand to overcome losses from evaporation, bleed-off, and spillage. To fill the pool initially, a separate quick-fill line should be provided to do the job in 8 to 16 hours; however, filling is usually done at off-peak hours. Thus, the demand flow rate need not be considered in the system demand calculations, unless it out-weighs the demand of all other demands even during the off-peak hours.
-\subsection{Comfort and Health}\label{comfort-and-health}
+\subsubsection{Comfort and Health}\label{comfort-and-health}
-Indoor pools are normally maintained between 50 and 60\% RH for two reasons:
+Zones with indoor swimming pools are normally maintained between 50 and 60\% RH for two reasons:
\begin{itemize}
\tightlist
\item
- Swimmers leaving the water feel chilly at lower relative humidity due to evaporation off the body
+ Swimmers leaving the water may feel thermally cool at lower relative humidity due to incrased evaporation off of the body at lower relative humidity levels.
\item
- It is considerably more expensive (and unnecessary) to maintain 40\% RH instead of 50\% RH
+ It is considerably more expensive (and unnecessary) to maintain 40\% RH instead of 50\% RH.
\end{itemize}
-\subsection{Air Delivery Rates (Indoor Pool)}\label{air-delivery-rates-indoor-pool}
+\subsubsection{Air Delivery Rates (Indoor Pool)}\label{air-delivery-rates-indoor-pool}
-Most codes require a minimum of 6 ACH, except where mechanical cooling is used. This rate may prove inadequate for some occupancy and use. Where mechanical dehumidification is provided, air delivery rates should be established to maintain appropriate conditions of temperature and humidity. The following rates are typically desired:
+Most codes require a minimum of 6 ACH for air circulation, except where mechanical cooling is used. This rate may prove inadequate for some occupancy and use. Where mechanical dehumidification is provided, air delivery rates should be established to maintain appropriate conditions of temperature and humidity. The following rates are typically desired:
\begin{itemize}
\tightlist
@@ -278,7 +296,9 @@ \subsection{Air Delivery Rates (Indoor Pool)}\label{air-delivery-rates-indoor-po
Therapeutic pools, 4 \textasciitilde{} 6 ACH
\end{itemize}
+\subsubsection{Indoor Pool Recommended Air and Water Temperatures}\label{indoor-pool-recommended-air-and-water-temperatures}
+The following table provides a starting point for determining the appropriate zone air and pool water temperatures one might expect in a zone that contains an indoor swimming pool. As with any building parameter, users should determine these based on best practices and their own experience and set the appropriate parameters in their input files accordingly.
\begin{longtable}[c]{@{}lll@{}}
\caption{Typical Swimming Pool Design Conditions \label{table:typical-swimming-pool-design-conditions}} \tabularnewline
diff --git a/doc/engineering-reference/src/surface-heat-balance-manager-processes/outside-surface-heat-balance.tex b/doc/engineering-reference/src/surface-heat-balance-manager-processes/outside-surface-heat-balance.tex
index a2a8eb15dc4..64ce106792c 100644
--- a/doc/engineering-reference/src/surface-heat-balance-manager-processes/outside-surface-heat-balance.tex
+++ b/doc/engineering-reference/src/surface-heat-balance-manager-processes/outside-surface-heat-balance.tex
@@ -31,7 +31,7 @@ \subsection{External Shortwave Radiation}\label{external-shortwave-radiation}
\subsection{External Longwave Radiation}\label{external-longwave-radiation}
-\({q''_{LWR}}\) is a standard radiation exchange formulation between the surface, the sky, and the ground. The radiation heat flux is calculated from the surface absorptivity, surface temperature, sky and ground temperatures, and sky and ground view factors.
+\({q''_{LWR}}\) is a standard radiation exchange formulation between the surface, the sky, the ground, and the surrounding surfaces. The radiation heat flux is calculated from the surface absorptivity, surface temperature, sky, ground and surrounding surfaces temperatures, and sky, ground and surrounding surfaces view factors.
The longwave radiation heat exchange between surfaces is dependent on surface temperatures, spatial relationships between surfaces and surroundings, and material properties of the surfaces. The relevant material properties of the surface, emissivity e and absorptivity a, are complex functions of temperature, angle, and wavelength for each participating surface. However, it is generally agreed that reasonable assumptions for building loads calculations are (Chapman 1984; Lienhard 1981):
@@ -43,7 +43,11 @@ \subsection{External Longwave Radiation}\label{external-longwave-radiation}
\item
energy flux leaving a surface is evenly distributed across the surface,
\item
- the medium within the enclosure is non-participating.
+ the medium within the enclosure is non-participating,
+\item
+ the long-wave emissivity of the surrounding surfaces is assumed to be the same as that of the exterior surface viewing them,
+\item
+ the sum of view factors from an exterior surface to the ground, the sky and the surrounding surfaces must be equal to 1.
\end{itemize}
These assumptions are frequently used in all but the most critical engineering applications.
@@ -68,24 +72,26 @@ \subsection{External Longwave Radiation}\label{external-longwave-radiation}
$T_{air}$ & Outside air temperature & $K$ & --- \tabularnewline
$T_{gnd}$ & Environmental ground surface temperature & $K$ & --- \tabularnewline
$T_{sky}$ & Sky Effective temperature & $K$ & --- \tabularnewline
+$T_{srd}$ & Surrounding surfaces average temperature & $K$ & --- \tabularnewline
$F_{gnd}$ & view factor of wall surface to ground surface & --- & 0--1 \tabularnewline
$F_{sky}$ & View factor of wall surface to sky & --- & 0--1 \tabularnewline
$F_{air}$ & View factor of wall surface to air & --- & 0--1 \tabularnewline
+$F_{srd}$ & View factor of wall surface to surrounding surfaces & --- & 0--1 \tabularnewline
$\varepsilon$ & Surface long-wave emissivity & --- & 0--1 \tabularnewline
$\sigma$ & Stefan-Boltzmann constant & $W/m^2.K^4$ & $5.67 \times 10^{-8}$ \tabularnewline
\bottomrule
\end{longtable}
-Consider an enclosure consisting of building exterior surface, surrounding ground surface, and sky.~ Using the assumptions above, we can determine the longwave radiative heat flux at the building exterior surface (Walton 1983; McClellan and Pedersen 1997).~ The total longwave radiative heat flux is the sum of components due to radiation exchange with the ground, sky, and air.
+Consider an enclosure consisting of building exterior surface, surrounding ground surface, and sky.~ Using the assumptions above, we can determine the longwave radiative heat flux at the building exterior surface (Walton 1983; McClellan and Pedersen 1997).~ The total longwave radiative heat flux is the sum of components due to radiation exchange with the ground, sky, air, and surrounding surfaces.
\begin{equation}
-{q''_{LWR}} = {q''_{gnd}} + {q''_{sky}} + {q''_{air}}
+{q''_{LWR}} = {q''_{gnd}} + {q''_{sky}} + {q''_{air}} + {q''_{srd}}
\end{equation}
Applying the Stefan-Boltzmann Law to each component yields:
\begin{equation}
-{q''_{LWR}} = \varepsilon \sigma {F_{gnd}}(T_{gnd}^4 - T_{surf}^4) + \varepsilon \sigma {F_{sky}}(T_{sky}^4 - T_{surf}^4) + \varepsilon \sigma {F_{air}}(T_{air}^4 - T_{surf}^4)
+{q''_{LWR}} = \varepsilon \sigma {F_{gnd}}(T_{gnd}^4 - T_{surf}^4) + \varepsilon \sigma {F_{sky}}(T_{sky}^4 - T_{surf}^4) + \varepsilon \sigma {F_{air}}(T_{air}^4 - T_{surf}^4) + \varepsilon \sigma {F_{srd}}(T_{srd}^4 - T_{surf}^4)
\end{equation}
where
@@ -100,6 +106,8 @@ \subsection{External Longwave Radiation}\label{external-longwave-radiation}
F\(_{air}\) = view factor of wall surface to air temperature
+F\(_{srd}\) = view factor of wall surface to surrounding surfaces
+
T\(_{surf}\) = outside surface temperature
T\(_{gnd}\) = ground surface temperature
@@ -108,10 +116,12 @@ \subsection{External Longwave Radiation}\label{external-longwave-radiation}
T\(_{air}\) = air temperature
+T\(_{srd}\) = average temperature of the surrounding surfaces
+
Linearized radiative heat transfer coefficients are introduced to render the above equation more compatible with the heat balance formulation,
\begin{equation}
-{q''_{LWR}} = {h_{r,gnd}}({T_{gnd}} - {T_{surf}}) + {h_{r,sky}}({T_{sky}} - {T_{surf}}) + {h_{r,air}}({T_{air}} - {T_{surf}})
+{q''_{LWR}} = {h_{r,gnd}}({T_{gnd}} - {T_{surf}}) + {h_{r,sky}}({T_{sky}} - {T_{surf}}) + {h_{r,air}}({T_{air}} - {T_{surf}}) + {h_{r,srd}}({T_{srd}} - {T_{surf}})
\end{equation}
where
@@ -128,6 +138,10 @@ \subsection{External Longwave Radiation}\label{external-longwave-radiation}
{h_{r,air}} = \frac{{\varepsilon \sigma {F_{air}}(T_{surf}^4 - T_{air}^4)}}{{{T_{surf}} - {T_{air}}}}
\end{equation}
+\begin{equation}
+{h_{r,srd}} = \frac{{\varepsilon \sigma {F_{srd}}(T_{surf}^4 - T_{srd}^4)}}{{{T_{surf}} - {T_{srd}}}}
+\end{equation}
+
The longwave view factors to ground and sky are calculated with the following expressions (Walton 1983):
\begin{equation}
@@ -177,7 +191,7 @@ \subsubsection{External Longwave Radiation With Multiple Ground Surfaces}\label{
{q''_{gnd}} = \varepsilon \sigma \sum\limits_{j = 1}^{{N_{gnd}}} {F_{gnd,j}} \left(T_{gnd,j}^4 - T_{surf}^4 \right)
\end{equation}
-The above equation can be recast using average temperature of multiple ground surfaces viewed by an exterior surface as follows:
+The above equation assumes that the building exterior surface and the ground surfaces it views have the same long-wave emissivity and can be recast using average temperature of multiple ground surfaces viewed by an exterior surface as follows:
\begin{equation}
{q''_{gnd}} = \varepsilon \sigma {F_{gnd,sum}} (T_{gnd,avg}^4 - T_{surf}^4)
@@ -216,6 +230,53 @@ \subsubsection{External Longwave Radiation With Multiple Ground Surfaces}\label{
h\(_{r,gnd,avg}\) = linearized average radiative heat transfer coefficient between an exterior surface and multiple ground surfaces
+\subsubsection{External Longwave Radiation With Multiple Surrounding Surfaces}\label{external-longwave-radiation-with-multiple-surrounding-surfaces}
+
+Long-wave radiation exchange of an exterior surface with multiple surrounding surfaces is given by:
+
+\begin{equation}
+{q''_{srd}} = \varepsilon \sigma \sum\limits_{j = 1}^{{N_{srd}}} {F_{srd,j}} \left(T_{srd,j}^4 - T_{surf}^4 \right)
+\end{equation}
+
+The above equation assumes that the building exterior surface and the surrounding surfaces it views have the same long-wave emissivity and can be recast using average temperature of multiple surrounding surfaces viewed by an exterior surface as follows:
+
+\begin{equation}
+{q''_{srd}} = \varepsilon \sigma {F_{srd,sum}} (T_{srd,avg}^4 - T_{surf}^4)
+\end{equation}
+
+\begin{equation}
+{F_{srd,sum}} = \sum\limits_{j = 1}^{{N_{srd}}} {F_{srd,j}}
+\end{equation}
+
+\begin{equation}
+{T_{srd,avg}} = ((\sum\limits_{j = 1}^{{N_{srd}}} {F_{srd,j}} {T_{srd,j}^4}) / {F_{srd,sum}})^{1/4}
+\end{equation}
+
+\begin{equation}
+{h_{r,srd,avg}} = \frac{{\varepsilon \sigma {F_{srd, sum}}(T_{surf}^4 - T_{srd,avg}^4)}}{{{T_{surf}} - {T_{srd,avg}}}}
+\end{equation}
+
+where
+
+$\varepsilon$ = long-wave emittance of an exterior surface
+
+$\sigma$ = Stefan-Boltzmann constant
+
+F\(_{srd,j}\) = view factor of an exterior surface to surrounding surface j
+
+T\(_{srd,j}\) = temperature of surrounding surface j
+
+T\(_{surf}\) = outside temperature of an exterior surface
+
+N\(_{srd}\) = number surrounding surfaces viewed by an exterior surface
+
+T\(_{srd,avg}\) = view factor weighted average surface temperature of multiple surrounding surfaces seen by an exterior surface
+
+F\(_{srd,sum}\) = sum of the view factors of an exterior surfaces to multiple surrounding surfaces
+
+h\(_{r,srd,avg}\) = linearized average radiative heat transfer coefficient between an exterior surface and multiple surrounding surfaces
+
+
\subsection{References}\label{references-034}
ASHRAE. 1993. 1993 ASHRAE Handbook -- Fundamentals. Atlanta: American Society of Heating, Refrigerating, and Air-Conditioning Engineers, Inc.
diff --git a/doc/input-output-reference/src/overview/group-internal-gains-people-lights-other.tex b/doc/input-output-reference/src/overview/group-internal-gains-people-lights-other.tex
index 89c95b180a5..53a5cfa9fe3 100644
--- a/doc/input-output-reference/src/overview/group-internal-gains-people-lights-other.tex
+++ b/doc/input-output-reference/src/overview/group-internal-gains-people-lights-other.tex
@@ -3212,7 +3212,7 @@ \subsection{SwimmingPool:Indoor}\label{swimmingpoolindoor}
\item The pool cannot utilize movable insulation or have a heat source or sink associated with it (something used to model low temperature radiant systems).
\end{itemize}
-The following information is useful for defining and modeling an indoor pool in EnergyPlus. For more information on the algorithm used for this model or details on some of the input parameters, please reference the indoor pool section of the EnergyPlus Engineering Reference document.
+The following information is useful for defining and modeling an indoor pool in EnergyPlus. For more information on the algorithm used for this model or details on some of the input parameters, please reference the Indoor Swimming Pool section of the EnergyPlus Engineering Reference document.
\subsubsection{Inputs}\label{inputs-7-012}
@@ -3230,11 +3230,11 @@ \subsubsection{Inputs}\label{inputs-7-012}
\paragraph{Field: Activity Factor Schedule Name}\label{field-activity-factor-schedule-name}
-This field references a schedule that contains values for pool activity. This parameter can be varied using the schedule named here, and it has an impact on the amount of evaporation that will take place from the pool to the surrounding zone air. For example values of the activity factor and what impact it will have on the evaporation of water from the pool, please refer to the Indoor Swimming Pool section of the EnergyPlus Engineering Reference document. If left blank, the activity factor will be assumed to be unity. Note that the activity factor should not be set equal to an occupancy schedule since an activity factor of zero means that no evaporation will take place from the pool.
+This field references a schedule that contains values for pool activity. This parameter can be varied using the schedule named here, and it has an impact on the amount of evaporation that will take place from the pool to the surrounding zone air. For example values of the activity factor and what impact it will have on the evaporation of water from the pool, please refer to the Indoor Swimming Pool section of the EnergyPlus Engineering Reference document. If left blank, the activity factor will be assumed to be unity. Note that the activity factor schedule should not be set equal to an occupancy schedule since an activity factor of zero means that no evaporation will take place from the pool.
\paragraph{Field: Make-up Water Supply Schedule Name}\label{field-make-up-water-supply-schedule-name}
-The scheduled named by this field establishes a cold water temperature {[}C{]} for the water that replaces the water which is lost from the pool due to evaporation. If blank, water temperatures are calculated by the \hyperref[sitewatermainstemperature]{Site:WaterMainsTemperature} object. This field (even if blank) overrides the Cold Water Supply Temperature Schedule in all of the listed \hyperref[wateruseequipment]{WaterUse:Equipment} objects.
+The schedule named by this field establishes a cold water temperature {[}C{]} for the water that replaces the water which is lost from the pool due to evaporation. If blank, water temperatures are calculated by the \hyperref[sitewatermainstemperature]{Site:WaterMainsTemperature} object. This field (even if blank) overrides the Cold Water Supply Temperature Schedule in all of the listed \hyperref[wateruseequipment]{WaterUse:Equipment} objects.
\paragraph{Field: Cover Schedule Name}\label{field-cover-schedule-name}
@@ -3258,19 +3258,19 @@ \subsubsection{Inputs}\label{inputs-7-012}
\paragraph{Field: Pool Water Inlet Node}\label{field-pool-water-inlet-node}
-This input is the name of the node on the demand side of a plant loop that leads into the pool. From the standpoint of an EnergyPlus input file, the pool sits on a plant demand loop, and the pump and heater reside on the plant supply loop. The pool heater and pump must be defined by other existing EnergyPlus input.
+This input is the name of the node on the demand side of a plant loop that leads into the pool. From the standpoint of an EnergyPlus input file, the pool is placed on a plant demand loop, and the pump and heater reside on the plant supply loop. The pool heater and pump must be defined by other existing EnergyPlus input.
\paragraph{Field: Pool Water Outlet Node}\label{field-pool-water-outlet-node}
-This input is the name of the node on the demand side of a plant loop that leads out of the pool. From the standpoint of an EnergyPlus input file, the pool sits on a plant demand loop, and the pump and heater reside on the plant supply loop. The pool heater and pump must be defined by other existing EnergyPlus input.
+This input is the name of the node on the demand side of a plant loop that leads out of the pool. From the standpoint of an EnergyPlus input file, the pool is placed on a plant demand loop, and the pump and heater reside on the plant supply loop. The pool heater and pump must be defined by other existing EnergyPlus input.
\paragraph{Field: Pool Water Maximum Flow Rate}\label{field-pool-water-maximum-flow-rate}
-This input is the maximum water volumetric flow rate in m3/s going between the pool and the water heating equipment. This along with the pool setpoint temperature and the heating plant equipment outlet temperature will establish the maximum heat addition to the pool. This flow rate to the pool will be varied in an attempt to reach the desired pool water setpoint temperature (see Setpoint Temperature Schedule below).
+This input is the maximum water volumetric flow rate in m\(^{3}\)/s going between the pool and the water heating equipment. This along with the pool setpoint temperature and the heating plant equipment outlet temperature will establish the maximum heat addition to the pool. This flow rate to the pool will be varied in an attempt to reach the desired pool water setpoint temperature (see Setpoint Temperature Schedule below).
\paragraph{Field: Pool Miscellaneous Equipment Power}\label{field-pool-miscellaneous-equipment-power}
-This input defines the power consumption rate of miscellaneous equipment such as the filtering and chlorination technology associated with the pool. The units for this input are in power consumption per flow rate of water through the pool from the heater or W/(m3/s). This field will be multiplied by the flow rate of water through the pool to determine the power consumption of this equipment. Any heat generated by this equipment is assumed to have no effect on the pool water itself.
+This input defines the power consumption rate of miscellaneous equipment such as the filtering and chlorination technology associated with the pool. The units for this input are in power consumption per flow rate of water through the pool from the heater or W/(m\(^{3}\)/s). This field will be multiplied by the flow rate of water through the pool to determine the power consumption of this equipment. Any heat generated by this equipment is assumed to have no effect on the pool water itself.
\paragraph{Field: Setpoint Temperature Schedule}\label{field-setpoint-temperature-schedule}
@@ -3363,11 +3363,11 @@ \subsubsection{Outputs}\label{outputs-4-007}
HVAC, Average, Indoor Pool Current Cover LW Radiation Factor {[]}
\end{itemize}
-\paragraph{Indoor Pool Makeup Water Rate {[}m3/s{]}}\label{indoor-pool-makeup-water-rate-m3s}
+\paragraph{Indoor Pool Makeup Water Rate {[}m\(^{3}\)/s{]}}\label{indoor-pool-makeup-water-rate-m3s}
The water consumption rate for the makeup water of indoor swimming pool.
-\paragraph{Indoor Pool Makeup Water Volume {[}m3{]}}\label{indoor-pool-makeup-water-volume-m3}
+\paragraph{Indoor Pool Makeup Water Volume {[}m\(^{3}\){]}}\label{indoor-pool-makeup-water-volume-m3}
The water consumption for the makeup water of indoor swimming pool.
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 9dd0fac5a84..0b160aac485 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
@@ -2826,12 +2826,14 @@ \subsection{Surface Output Variables/Reports}\label{surface-output-variablesrepo
Zone,Average,Surface Outside Face Thermal Radiation to Air Heat Transfer Coefficient [W/m2-K]
Zone,Average,Surface Outside Face Thermal Radiation to Sky Heat Transfer Coefficient [W/m2-K]
Zone,Average,Surface Outside Face Thermal Radiation to Ground Heat Transfer Coefficient [W/m2-K]
+Zone,Average,Surface Outside Face Thermal Radiation to Surrounding Surfaces Heat Transfer Coefficient [W/m2-K]
+Zone,Average,Surface Outside Face Surrounding Surfaces Average Temperature [C]
Zone,Average,Surface Inside Face Exterior Windows Incident Beam Solar Radiation Rate [W]
Zone,Sum,Surface Inside Face Exterior Windows Incident Beam Solar Radiation Energy [J]
Zone,Average,Surface Inside Face Exterior Windows Incident Beam Solar Radiation Rate per Area[W/m2]
Zone,Average,Surface Inside Face Interior Windows Incident Beam Solar Radiation Rate [W]
Zone,Average,Surface Inside Face Interior Windows Incident Beam Solar Radiation Rate per Area[W/m2]
-Zone, Sum,Surface Inside Face Interior Windows Incident Beam Solar Radiation Energy [J]
+Zone,Sum,Surface Inside Face Interior Windows Incident Beam Solar Radiation Energy [J]
Zone,Average,Surface Inside Face Initial Transmitted Diffuse Absorbed Solar Radiation Rate [W]
Zone,Average,Surface Inside Face Initial Transmitted Diffuse Transmitted Out Window Solar Radiation Rate [W]
Zone,Average,Surface Inside Face Absorbed Shortwave Radiation Rate [W]
@@ -3242,6 +3244,14 @@ \subsubsection{Surface Outside Face Heat Emission to Air Rate {[}W{]}}\label{sur
This is total heat transfer rate between the outside face and the air mass surrounding the surface by convection and thermal radiation.
+\subsubsection{Surface Outside Face Thermal Radiation to Surrounding Surfaces Heat Transfer Coefficient {[}W/m2-K{]}}\label{surface-outside-face-thermal-radiation-to-surrounding-surfaces-heat-transfer-coefficient-wm2-k}
+
+This is the coefficient that describes thermal radiation heat transfer between the outside face of an exterior surface and the surrounding surfaces it views. It is the value of ``Hr'' in the classic linearized model for thermal radiation exchange Q = Hr * A * (T\_surf -- T\_srdsurfs) when applied to the surrounding surfaces. Where T\_surf = Surface Outside Face Temperature, and T\_srdsurf = Average temperature of the surrounding surfaces viewed by an exterior surface.
+
+\subsubsection{Surface Outside Face Surrounding Surfaces Average Temperature {[}C{]}}\label{surface-outside-face-surrounding-surfaces-average-temperature-C}
+
+This is the average surface temperature of the surrounding surfaces viewed by an exterior surface, in degrees Celsius. The surrounding surfaces average temperature is a view factor weighed surface temperature of multiple surrounding surfaces seen by an exterior surface. If an exterior surface views a single surrounding surface then the average temperature is the same as the user specified surrounding surface temperature.
+
\subsubsection{Surface Outside Face Solar Radiation Heat Gain Rate {[}W{]}}\label{surface-outside-face-solar-radiation-heat-gain-rate-w}
\subsubsection{Surface Outside Face Solar Radiation Heat Gain Rate per Area {[}W/m2{]}}\label{surface-outside-face-solar-radiation-heat-gain-rate-per-area-wm2}
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 8c8ead67c18..a4ae6d7a9c4 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
@@ -647,7 +647,7 @@ \subsubsection{Outputs}\label{outputs-039}
\paragraph{\texorpdfstring{VRF Heat Pump COP{[]}}{VRF Heat Pump COP}}\label{vrf-heat-pump-cop}
-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.
+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, terminal unit fan power, 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}
@@ -927,11 +927,11 @@ \subsubsection{Inputs}\label{inputs-1-048}
\paragraph{Field: Loading Index i Evaporative Capacity Multiplier Function of Temperature Curve Name}\label{field-loading-index-i-evaporative-capacity-multiplier-function-of-temperature-curve-name}
-This alpha field defines the name of a BiQuadratic curve for the VRF operational mode corresponding to the i-th loading index. It parameterizes the variation of VRF evaporating capacity as a function of operating conditions, i.e., evaporating and condensing temperatures. The output of this curve is a dimensionless multiplier to be applied on the rated evaporative capacity to calculate the actual capacity.
+This alpha field defines the name of a BiQuadratic curve for the VRF operational mode corresponding to the i-th loading index. It parameterizes the variation of VRF evaporating capacity as a function of operating conditions, i.e., condensing (variable x) and evaporating temperatures (variable y). The output of this curve is a dimensionless multiplier to be applied on the rated evaporative capacity to calculate the actual capacity.
\paragraph{Field: Loading Index i Compressor Power Multiplier Function of Temperature Curve Name}\label{field-loading-index-i-compressor-power-multiplier-function-of-temperature-curve-name}
-This alpha field defines the name of a BiQuadratic curve for the VRF operational mode corresponding to the i-th loading index. It parameterizes the variation of compressor power as a function of operating conditions, i.e., evaporating and condensing temperatures. The output of this curve is a dimensionless multiplier to be applied on the rated compressor power to calculate the actual compressor power.
+This alpha field defines the name of a BiQuadratic curve for the VRF operational mode corresponding to the i-th loading index. It parameterizes the variation of compressor power as a function of operating conditions, i.e., condensing (variable x) and evaporating temperatures (variable y). The output of this curve is a dimensionless multiplier to be applied on the rated compressor power to calculate the actual compressor power.
\begin{lstlisting}
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 b3c92999e46..48a6a7b9458 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
@@ -1547,6 +1547,12 @@ \subsubsection{Inputs}\label{inputs-4-040}
This optional input field is the name of a \hyperref[designspecificationzonehvacsizing]{DesignSpecification:ZoneHVAC:Sizing} object. The name must correspond to unique name of a \hyperref[designspecificationzonehvacsizing]{DesignSpecification:ZoneHVAC:Sizing} object defined elsewhere. A Design Sepcification Zone HVAC Sizing object defines scalable sizing methods for sizing input field \emph{Design Supply Air Flow Rate} in Evaportaive Cooler zone HVAC object. The scaled design supply air flow rates in turn is used to size capacity of the unit.
+\paragraph{Field: Shut Off Relative Humidity}\label{shut-off-relative-humidity}
+
+This is an optional field. When the relative humidity of the zone is above this
+threshold, the evaporative cooler is shut off. This intends to prevent direct
+evaporative coolers from adding too much moisture into the zone.
+
An example input object follows.
\begin{lstlisting}
diff --git a/doc/readthedocs/sphinx/conf.py b/doc/readthedocs/sphinx/conf.py
index 7b604122df9..8e6709a3613 100644
--- a/doc/readthedocs/sphinx/conf.py
+++ b/doc/readthedocs/sphinx/conf.py
@@ -134,7 +134,7 @@
# # OK, now we need to make sure the epJSON schema is generated so we can process it
# Since this will primarily just be run by readthedocs, I'm just going to re-run the schema generator
try:
- check_call(['python3', 'scripts/dev/generate_epJSON_schema/generate_epJSON_schema.py', '.'], cwd=repo_root)
+ check_call(['python3', 'scripts/dev/generate_epJSON_schema/generate_epJSON_schema.py', 'idd'], cwd=repo_root)
except CalledProcessError as e:
raise Exception(f"Schema Generation failed! Exception string: {str(e)}") from None
except FileNotFoundError as e:
@@ -142,7 +142,7 @@
f"python3 binary not found, what? Looked for it at: `python3'; error = {str(e)}"
) from None
-generated_schema_file = repo_root / 'idd' / 'Energy+.schema.epJSON.in' # I know this will have CMake placeholders
+generated_schema_file = repo_root / 'idd' / 'Energy+.schema.epJSON' # I know this will have CMake placeholders
if not generated_schema_file.exists():
raise Exception("Generated schema file did not exist, aborting.")
print("* Generated schema existence confirmed")
diff --git a/idd/CMakeLists.txt b/idd/CMakeLists.txt
index 26314e961c6..6567a978c56 100644
--- a/idd/CMakeLists.txt
+++ b/idd/CMakeLists.txt
@@ -1,21 +1,65 @@
-#install(FILES "V7-2-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
-#install(FILES "V8-0-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
-#install(FILES "V8-1-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
-#install(FILES "V8-2-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
-#install(FILES "V8-3-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
-#install(FILES "V8-4-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
-#install(FILES "V8-5-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
-#install(FILES "V8-6-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
-#install(FILES "V8-7-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
-#install(FILES "V8-8-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
-#install(FILES "V8-9-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
-install(FILES "V9-0-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
-install(FILES "V9-1-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
-install(FILES "V9-2-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
-install(FILES "V9-3-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
-install(FILES "V9-4-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
-install(FILES "V9-5-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
-install(FILES "V9-6-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
-install(FILES "V22-1-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
-install(FILES "V22-2-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
-install(FILES "V23-1-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+configure_file("Energy+.idd.in" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Energy+.idd")
+
+
+add_custom_command(
+ OUTPUT "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Energy+.schema.epJSON"
+ COMMAND ${Python_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/schema/generate_epJSON_schema.py" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
+ MAIN_DEPENDENCY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Energy+.idd"
+ DEPENDS
+ schema/generate_epJSON_schema.py
+ schema/idd_parser.py
+ schema/modify_schema.py
+ VERBATIM
+)
+
+add_executable(generate_embeddable_epJSON_schema embedded/generate_embeddable_epJSON_schema.cpp)
+target_link_libraries(generate_embeddable_epJSON_schema PRIVATE project_options project_fp_options project_warnings fmt::fmt)
+set_target_properties(generate_embeddable_epJSON_schema PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/scripts")
+# See https://en.cppreference.com/w/cpp/filesystem#Notes
+if ((CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1) OR
+ ( ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)))
+ target_link_libraries(generate_embeddable_epJSON_schema PRIVATE stdc++fs)
+endif()
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/embedded/EmbeddedEpJSONSchema.cc"
+ COMMAND
+ generate_embeddable_epJSON_schema "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Energy+.schema.epJSON" "${CMAKE_CURRENT_BINARY_DIR}/embedded/EmbeddedEpJSONSchema.cc"
+ DEPENDS
+ generate_embeddable_epJSON_schema
+ "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Energy+.schema.epJSON" # File-level dependency
+ VERBATIM)
+
+add_library(embedded_epjson_source STATIC
+ embedded/EmbeddedEpJSONSchema.hh
+ "${CMAKE_CURRENT_BINARY_DIR}/embedded/EmbeddedEpJSONSchema.cc"
+)
+target_include_directories(embedded_epjson_source PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
+target_link_libraries(embedded_epjson_source PRIVATE project_options project_fp_options project_warnings)
+
+#install(FILES "versions/V7-2-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+#install(FILES "versions/V8-0-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+#install(FILES "versions/V8-1-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+#install(FILES "versions/V8-2-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+#install(FILES "versions/V8-3-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+#install(FILES "versions/V8-4-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+#install(FILES "versions/V8-5-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+#install(FILES "versions/V8-6-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+#install(FILES "versions/V8-7-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+#install(FILES "versions/V8-8-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+#install(FILES "versions/V8-9-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+install(FILES "versions/V9-0-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+install(FILES "versions/V9-1-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+install(FILES "versions/V9-2-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+install(FILES "versions/V9-3-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+install(FILES "versions/V9-4-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+install(FILES "versions/V9-5-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+install(FILES "versions/V9-6-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+install(FILES "versions/V22-1-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+install(FILES "versions/V22-2-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater")
+
+# For fortran...
+set(PREVIOUS_IDD "${CMAKE_CURRENT_SOURCE_DIR}/versions/V${PREV_RELEASE_MAJOR}-${PREV_RELEASE_MINOR}-${PREV_RELEASE_PATCH}-Energy+.idd")
+set(PREVIOUS_IDD ${PREVIOUS_IDD} PARENT_SCOPE)
+
+install(FILES "${PREVIOUS_IDD}" DESTINATION "PreProcess/IDFVersionUpdater")
diff --git a/idd/Energy+.idd.in b/idd/Energy+.idd.in
index 6fe15f15a03..5d91c7adb7e 100644
--- a/idd/Energy+.idd.in
+++ b/idd/Energy+.idd.in
@@ -8947,7 +8947,6 @@ ConstructionProperty:InternalHeatSource,
\note uniform spacing between tubes or resistance wires in direction
\note perpendicular to main intended direction of heat transfer
N5; \field Two-Dimensional Temperature Calculation Position
- \required-field
\minimum 0.0
\maximum 1.0
\default 0.0
@@ -37014,10 +37013,16 @@ ZoneHVAC:EvaporativeCoolerUnit,
\note optional, used for direct/indirect configurations
\type object-list
\object-list EvapCoolerNames
- A15; \field Design Specification ZoneHVAC Sizing Object Name
+ A15, \field Design Specification ZoneHVAC Sizing Object Name
\note Enter the name of a DesignSpecificationZoneHVACSizing object.
\type object-list
\object-list DesignSpecificationZoneHVACSizingName
+ N4; \field Shut Off Relative Humidity
+ \note Zone relative humidity above which the evap cooler is shut off.
+ \type real
+ \minimum 0.00
+ \maximum 100.00
+ \units percent
ZoneHVAC:HybridUnitaryHVAC,
\memo Hybrid Unitary HVAC. A black box model for multi-mode packaged forced air equipment. Independent variables include outdoor air conditions and indoor air conditions. Controlled inputs include operating mode, supply air flow rate, and outdoor air faction. Emperical lookup tables are required to map supply air temperature supply air humidity, electricity use, fuel uses, water use, fan electricity use, and external static pressure as a function of each indpednent varaible and each controlled input. In each timestep the model will choose one or more combinations of settings for mode, supply air flow rate, outdoor air faction, and part runtime fraction so as to satisfy zone requests for sensible cooling, heating, ventilation, and/or dehumidification with the least resource consumption. Equipment in this class may consume electricity, water, and up to two additional fuel types.
diff --git a/src/EnergyPlus/InputProcessing/EmbeddedEpJSONSchema.hh b/idd/embedded/EmbeddedEpJSONSchema.hh
similarity index 93%
rename from src/EnergyPlus/InputProcessing/EmbeddedEpJSONSchema.hh
rename to idd/embedded/EmbeddedEpJSONSchema.hh
index 12490404dcc..f818c886b1c 100644
--- a/src/EnergyPlus/InputProcessing/EmbeddedEpJSONSchema.hh
+++ b/idd/embedded/EmbeddedEpJSONSchema.hh
@@ -51,17 +51,18 @@
#include
#include
#include
+#include
#include
namespace EnergyPlus {
namespace EmbeddedEpJSONSchema {
- const gsl::span embeddedEpJSONSchema();
+const gsl::span embeddedEpJSONSchema();
- const std::string_view embeddedEpJSONSchemaView();
-} // namespace EmbeddedEpJSONSchema
+const std::string_view embeddedEpJSONSchemaView();
+} // namespace EmbeddedEpJSONSchema
-} // namespace EnergyPlus
+} // namespace EnergyPlus
-#endif // InputProcessing_EmbeddedEpJSONSchema_HH
+#endif // InputProcessing_EmbeddedEpJSONSchema_HH
diff --git a/src/EnergyPlus/InputProcessing/EmbeddedEpJSONSchema.in.cc b/idd/embedded/generate_embeddable_epJSON_schema.cpp
similarity index 64%
rename from src/EnergyPlus/InputProcessing/EmbeddedEpJSONSchema.in.cc
rename to idd/embedded/generate_embeddable_epJSON_schema.cpp
index 71d24ce0c57..71210799d88 100644
--- a/src/EnergyPlus/InputProcessing/EmbeddedEpJSONSchema.in.cc
+++ b/idd/embedded/generate_embeddable_epJSON_schema.cpp
@@ -1,3 +1,26 @@
+#include // std::uint8_t
+#include // std::ifstream
+#include // std::vector
+#ifndef __cppcheck__
+# if __has_include()
+# include
+namespace fs = std::filesystem;
+# elif __has_include()
+# include
+namespace fs = std::experimental::filesystem;
+# else
+// cppcheck-suppress preprocessorErrorDirective
+# error "no filesystem support"
+# endif
+#endif
+
+#include // fmt::print
+#include // fmt::output_file, fmt::file
+#include // json
+
+using json = nlohmann::json;
+
+static constexpr auto header = R"cpp(
// EnergyPlus, Copyright (c) 1996-2023, The Board of Trustees of the University of Illinois,
// The Regents of the University of California, through Lawrence Berkeley National Laboratory
// (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
@@ -45,7 +68,7 @@
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-#include
+#include
#include
@@ -54,7 +77,9 @@ namespace EnergyPlus {
namespace EmbeddedEpJSONSchema {
// clang-format off
- ${embedded_epJSON_schema}
+)cpp";
+
+static constexpr auto footer = R"cpp(
// clang-format on
const gsl::span embeddedEpJSONSchema()
@@ -71,3 +96,44 @@ namespace EmbeddedEpJSONSchema {
} // namespace EmbeddedEpJSONSchema
} // namespace EnergyPlus
+)cpp";
+
+int main(int argc, char const* argv[]) {
+ if (argc != 3) {
+ fmt::print(stderr, "usage: ./generate_embeddable_schema path/to/Energy+.schema.epJSON path/to/EmbeddedEpJSONSchema.cc\n");
+ return 1;
+ }
+
+ fmt::print(stderr, "Generating the **embedded** epJSON schema\n");
+
+ std::ifstream schema_stream(argv[1], std::ifstream::in);
+ if (!schema_stream.is_open()) {
+ fmt::print("schema file path {} not found\n", argv[1]);
+ return 1;
+ }
+ auto const input_json = json::parse(schema_stream);
+ std::vector const v_cbor = json::to_cbor(input_json);
+
+ const fs::path outFilePath(argv[2]);
+ const auto outFileDir = outFilePath.parent_path();
+ if (!fs::is_directory(outFileDir)) {
+ fmt::print(stderr, "Output Directory does not exist: {}\n", outFileDir.generic_string());
+ fs::create_directory(outFileDir);
+ }
+
+ auto outfile = fmt::output_file(argv[2], fmt::file::WRONLY | fmt::file::CREATE | fmt::file::TRUNC);
+ outfile.print("{}", header);
+
+ outfile.print(" static constexpr std::array< std::uint8_t, {} > embeddedSchema = {{{{\n", v_cbor.size());
+
+ for (size_t i = 0; i < v_cbor.size(); ++i) {
+ outfile.print("{:#04x},", v_cbor[i]); // Format the std::uint8_t as hex
+ if (i % 40 == 0 && i != 0) {
+ outfile.print("\n");
+ }
+ }
+ outfile.print("}}}};\n");
+ outfile.print("{}", footer);
+
+ return 0;
+}
diff --git a/scripts/dev/generate_epJSON_schema/generate_epJSON_schema.py b/idd/schema/generate_epJSON_schema.py
similarity index 81%
rename from scripts/dev/generate_epJSON_schema/generate_epJSON_schema.py
rename to idd/schema/generate_epJSON_schema.py
index 1721449719f..487113fd84d 100644
--- a/scripts/dev/generate_epJSON_schema/generate_epJSON_schema.py
+++ b/idd/schema/generate_epJSON_schema.py
@@ -59,14 +59,27 @@
import sys
from os import path
-
+print("Generating the epJSON schema!", file=sys.stderr)
source_dir_path = sys.argv[1]
data = idd_parser.Data()
-with open(path.join(source_dir_path, 'idd', 'Energy+.idd.in'), 'r') as f:
- data.file = f.read()
+idd_path = path.join(source_dir_path, 'Energy+.idd')
+if path.exists(idd_path):
+ with open(idd_path, 'r') as f:
+ data.file = f.read()
+else:
+ # this script is also used in the sphinx documentation, which doesn't do a CMake configuration run
+ # so the runtime/Products/Energy+.idd file is not generated. The script is just executed on the raw
+ # Energy+.idd.in file in the idd folder. So try to find the .in file if we couldn't find the
+ # generated idd file.
+ idd_in_path = path.join(source_dir_path, 'Energy+.idd.in')
+ if path.exists(idd_in_path):
+ with open(idd_in_path, 'r') as f:
+ data.file = f.read()
+ else:
+ print(f"Could not find E+ IDD, looked for both: {idd_path} and {idd_in_path}. Aborting")
+ sys.exit(1)
idd_parser.parse_idd(data)
-modify_schema.change_version(data.schema)
modify_schema.change_schedule_compact(data.schema)
modify_schema.change_utility_cost(data.schema)
modify_schema.change_special_cased_enums(data.schema)
@@ -75,5 +88,5 @@
modify_schema.change_89_release_issues(data.schema)
modify_schema.add_explicit_extensible_bounds(data.schema)
-with open(path.join(source_dir_path, 'idd', 'Energy+.schema.epJSON.in'), 'w') as f2:
+with open(path.join(source_dir_path, 'Energy+.schema.epJSON'), 'w') as f2:
f2.write(json.dumps(data.schema, indent=4))
diff --git a/scripts/dev/generate_epJSON_schema/idd_parser.py b/idd/schema/idd_parser.py
similarity index 100%
rename from scripts/dev/generate_epJSON_schema/idd_parser.py
rename to idd/schema/idd_parser.py
diff --git a/scripts/dev/generate_epJSON_schema/modify_schema.py b/idd/schema/modify_schema.py
similarity index 97%
rename from scripts/dev/generate_epJSON_schema/modify_schema.py
rename to idd/schema/modify_schema.py
index e0eecf749a8..530a61850b6 100644
--- a/scripts/dev/generate_epJSON_schema/modify_schema.py
+++ b/idd/schema/modify_schema.py
@@ -199,14 +199,6 @@ def get_schema_object(schema, object_key):
raise KeyError(R'The patternProperties value is not a valid choice (".*", "^.*\S.*$")')
-def change_version(schema):
- schema["epJSON_schema_version"] = "${CMAKE_VERSION_MAJOR}.${CMAKE_VERSION_MINOR}.${CMAKE_VERSION_PATCH}"
- schema["epJSON_schema_build"] = "${CMAKE_VERSION_BUILD}"
- loc = get_schema_object(schema, 'Version')['properties']['version_identifier']
- loc['default'] = "${CMAKE_VERSION_MAJOR}.${CMAKE_VERSION_MINOR}"
- loc['type'] = "string"
-
-
def change_schedule_compact(schema):
loc = get_schema_object(schema, 'Schedule:Compact')['properties']['extensions']['items']['properties']['field']
loc.pop('type')
diff --git a/idd/V1-0-0-Energy+.idd b/idd/versions/V1-0-0-Energy+.idd
similarity index 100%
rename from idd/V1-0-0-Energy+.idd
rename to idd/versions/V1-0-0-Energy+.idd
diff --git a/idd/V1-0-1-Energy+.idd b/idd/versions/V1-0-1-Energy+.idd
similarity index 100%
rename from idd/V1-0-1-Energy+.idd
rename to idd/versions/V1-0-1-Energy+.idd
diff --git a/idd/V1-0-2-Energy+.idd b/idd/versions/V1-0-2-Energy+.idd
similarity index 100%
rename from idd/V1-0-2-Energy+.idd
rename to idd/versions/V1-0-2-Energy+.idd
diff --git a/idd/V1-0-3-Energy+.idd b/idd/versions/V1-0-3-Energy+.idd
similarity index 100%
rename from idd/V1-0-3-Energy+.idd
rename to idd/versions/V1-0-3-Energy+.idd
diff --git a/idd/V1-1-0-Energy+.idd b/idd/versions/V1-1-0-Energy+.idd
similarity index 100%
rename from idd/V1-1-0-Energy+.idd
rename to idd/versions/V1-1-0-Energy+.idd
diff --git a/idd/V1-1-1-Energy+.idd b/idd/versions/V1-1-1-Energy+.idd
similarity index 100%
rename from idd/V1-1-1-Energy+.idd
rename to idd/versions/V1-1-1-Energy+.idd
diff --git a/idd/V1-2-0-Energy+.idd b/idd/versions/V1-2-0-Energy+.idd
similarity index 100%
rename from idd/V1-2-0-Energy+.idd
rename to idd/versions/V1-2-0-Energy+.idd
diff --git a/idd/V1-2-1-Energy+.idd b/idd/versions/V1-2-1-Energy+.idd
similarity index 100%
rename from idd/V1-2-1-Energy+.idd
rename to idd/versions/V1-2-1-Energy+.idd
diff --git a/idd/V1-2-2-Energy+.idd b/idd/versions/V1-2-2-Energy+.idd
similarity index 100%
rename from idd/V1-2-2-Energy+.idd
rename to idd/versions/V1-2-2-Energy+.idd
diff --git a/idd/V1-2-3-Energy+.idd b/idd/versions/V1-2-3-Energy+.idd
similarity index 100%
rename from idd/V1-2-3-Energy+.idd
rename to idd/versions/V1-2-3-Energy+.idd
diff --git a/idd/V1-3-0-Energy+.idd b/idd/versions/V1-3-0-Energy+.idd
similarity index 100%
rename from idd/V1-3-0-Energy+.idd
rename to idd/versions/V1-3-0-Energy+.idd
diff --git a/idd/V1-4-0-Energy+.idd b/idd/versions/V1-4-0-Energy+.idd
similarity index 100%
rename from idd/V1-4-0-Energy+.idd
rename to idd/versions/V1-4-0-Energy+.idd
diff --git a/idd/V2-0-0-Energy+.idd b/idd/versions/V2-0-0-Energy+.idd
similarity index 100%
rename from idd/V2-0-0-Energy+.idd
rename to idd/versions/V2-0-0-Energy+.idd
diff --git a/idd/V2-1-0-Energy+.idd b/idd/versions/V2-1-0-Energy+.idd
similarity index 100%
rename from idd/V2-1-0-Energy+.idd
rename to idd/versions/V2-1-0-Energy+.idd
diff --git a/idd/V2-2-0-Energy+.idd b/idd/versions/V2-2-0-Energy+.idd
similarity index 100%
rename from idd/V2-2-0-Energy+.idd
rename to idd/versions/V2-2-0-Energy+.idd
diff --git a/idd/V22-1-0-Energy+.idd b/idd/versions/V22-1-0-Energy+.idd
similarity index 100%
rename from idd/V22-1-0-Energy+.idd
rename to idd/versions/V22-1-0-Energy+.idd
diff --git a/idd/V22-2-0-Energy+.idd b/idd/versions/V22-2-0-Energy+.idd
similarity index 100%
rename from idd/V22-2-0-Energy+.idd
rename to idd/versions/V22-2-0-Energy+.idd
diff --git a/idd/V23-1-0-Energy+.idd b/idd/versions/V23-1-0-Energy+.idd
similarity index 100%
rename from idd/V23-1-0-Energy+.idd
rename to idd/versions/V23-1-0-Energy+.idd
diff --git a/idd/V3-0-0-Energy+.idd b/idd/versions/V3-0-0-Energy+.idd
similarity index 100%
rename from idd/V3-0-0-Energy+.idd
rename to idd/versions/V3-0-0-Energy+.idd
diff --git a/idd/V3-1-0-Energy+.idd b/idd/versions/V3-1-0-Energy+.idd
similarity index 100%
rename from idd/V3-1-0-Energy+.idd
rename to idd/versions/V3-1-0-Energy+.idd
diff --git a/idd/V4-0-0-Energy+.idd b/idd/versions/V4-0-0-Energy+.idd
similarity index 100%
rename from idd/V4-0-0-Energy+.idd
rename to idd/versions/V4-0-0-Energy+.idd
diff --git a/idd/V5-0-0-Energy+.idd b/idd/versions/V5-0-0-Energy+.idd
similarity index 100%
rename from idd/V5-0-0-Energy+.idd
rename to idd/versions/V5-0-0-Energy+.idd
diff --git a/idd/V6-0-0-Energy+.idd b/idd/versions/V6-0-0-Energy+.idd
similarity index 100%
rename from idd/V6-0-0-Energy+.idd
rename to idd/versions/V6-0-0-Energy+.idd
diff --git a/idd/V7-0-0-Energy+.idd b/idd/versions/V7-0-0-Energy+.idd
similarity index 100%
rename from idd/V7-0-0-Energy+.idd
rename to idd/versions/V7-0-0-Energy+.idd
diff --git a/idd/V7-1-0-Energy+.idd b/idd/versions/V7-1-0-Energy+.idd
similarity index 100%
rename from idd/V7-1-0-Energy+.idd
rename to idd/versions/V7-1-0-Energy+.idd
diff --git a/idd/V7-2-0-Energy+.idd b/idd/versions/V7-2-0-Energy+.idd
similarity index 100%
rename from idd/V7-2-0-Energy+.idd
rename to idd/versions/V7-2-0-Energy+.idd
diff --git a/idd/V8-0-0-Energy+.idd b/idd/versions/V8-0-0-Energy+.idd
similarity index 100%
rename from idd/V8-0-0-Energy+.idd
rename to idd/versions/V8-0-0-Energy+.idd
diff --git a/idd/V8-1-0-Energy+.idd b/idd/versions/V8-1-0-Energy+.idd
similarity index 100%
rename from idd/V8-1-0-Energy+.idd
rename to idd/versions/V8-1-0-Energy+.idd
diff --git a/idd/V8-2-0-Energy+.idd b/idd/versions/V8-2-0-Energy+.idd
similarity index 100%
rename from idd/V8-2-0-Energy+.idd
rename to idd/versions/V8-2-0-Energy+.idd
diff --git a/idd/V8-3-0-Energy+.idd b/idd/versions/V8-3-0-Energy+.idd
similarity index 100%
rename from idd/V8-3-0-Energy+.idd
rename to idd/versions/V8-3-0-Energy+.idd
diff --git a/idd/V8-4-0-Energy+.idd b/idd/versions/V8-4-0-Energy+.idd
similarity index 100%
rename from idd/V8-4-0-Energy+.idd
rename to idd/versions/V8-4-0-Energy+.idd
diff --git a/idd/V8-5-0-Energy+.idd b/idd/versions/V8-5-0-Energy+.idd
similarity index 100%
rename from idd/V8-5-0-Energy+.idd
rename to idd/versions/V8-5-0-Energy+.idd
diff --git a/idd/V8-6-0-Energy+.idd b/idd/versions/V8-6-0-Energy+.idd
similarity index 100%
rename from idd/V8-6-0-Energy+.idd
rename to idd/versions/V8-6-0-Energy+.idd
diff --git a/idd/V8-7-0-Energy+.idd b/idd/versions/V8-7-0-Energy+.idd
similarity index 100%
rename from idd/V8-7-0-Energy+.idd
rename to idd/versions/V8-7-0-Energy+.idd
diff --git a/idd/V8-8-0-Energy+.idd b/idd/versions/V8-8-0-Energy+.idd
similarity index 100%
rename from idd/V8-8-0-Energy+.idd
rename to idd/versions/V8-8-0-Energy+.idd
diff --git a/idd/V8-9-0-Energy+.idd b/idd/versions/V8-9-0-Energy+.idd
similarity index 100%
rename from idd/V8-9-0-Energy+.idd
rename to idd/versions/V8-9-0-Energy+.idd
diff --git a/idd/V9-0-0-Energy+.idd b/idd/versions/V9-0-0-Energy+.idd
similarity index 100%
rename from idd/V9-0-0-Energy+.idd
rename to idd/versions/V9-0-0-Energy+.idd
diff --git a/idd/V9-1-0-Energy+.idd b/idd/versions/V9-1-0-Energy+.idd
similarity index 100%
rename from idd/V9-1-0-Energy+.idd
rename to idd/versions/V9-1-0-Energy+.idd
diff --git a/idd/V9-2-0-Energy+.idd b/idd/versions/V9-2-0-Energy+.idd
similarity index 100%
rename from idd/V9-2-0-Energy+.idd
rename to idd/versions/V9-2-0-Energy+.idd
diff --git a/idd/V9-3-0-Energy+.idd b/idd/versions/V9-3-0-Energy+.idd
similarity index 100%
rename from idd/V9-3-0-Energy+.idd
rename to idd/versions/V9-3-0-Energy+.idd
diff --git a/idd/V9-4-0-Energy+.idd b/idd/versions/V9-4-0-Energy+.idd
similarity index 100%
rename from idd/V9-4-0-Energy+.idd
rename to idd/versions/V9-4-0-Energy+.idd
diff --git a/idd/V9-5-0-Energy+.idd b/idd/versions/V9-5-0-Energy+.idd
similarity index 100%
rename from idd/V9-5-0-Energy+.idd
rename to idd/versions/V9-5-0-Energy+.idd
diff --git a/idd/V9-6-0-Energy+.idd b/idd/versions/V9-6-0-Energy+.idd
similarity index 100%
rename from idd/V9-6-0-Energy+.idd
rename to idd/versions/V9-6-0-Energy+.idd
diff --git a/scripts/dev/check_for_enum_scope_usage.py b/scripts/dev/check_for_enum_scope_usage.py
index 5ef0f1c72ba..5dfaa7018a4 100755
--- a/scripts/dev/check_for_enum_scope_usage.py
+++ b/scripts/dev/check_for_enum_scope_usage.py
@@ -198,7 +198,7 @@ def run(self):
apparent_enums_in_zero_source_files.append(e.describe())
unique_files_in_usages: Set[str] = set()
# exceptions listed by :
- exceptions = ["DataGlobalConstants.hh:eFuel", "DataGlobalConstants.hh:ePollutant"]
+ exceptions = ["DataGlobalConstants.hh:ePollutant"]
if f"{e.file_path.name}:{e.enum_name}" not in exceptions:
for u in e.usages:
unique_files_in_usages.add(u.file_path.name)
diff --git a/scripts/dev/check_non_utf8.py b/scripts/dev/check_non_utf8.py
index 0e4b3475b14..fc7825d3f70 100755
--- a/scripts/dev/check_non_utf8.py
+++ b/scripts/dev/check_non_utf8.py
@@ -59,10 +59,9 @@
import io # For Python 2 compat
import sys
-# note I am skipping docs for right now; I want to do those files
DIRS_TO_SKIP = [
'.git', 'build', 'builds', 'cmake-build-debug',
- 'cmake-build-release', 'design', 'doc', 'release', 'third_party'
+ 'cmake-build-release', 'design', 'release',
]
# these CC files purposefully have bad characters
diff --git a/scripts/dev/generate_embeddable_epJSON_schema/CMakeLists.txt b/scripts/dev/generate_embeddable_epJSON_schema/CMakeLists.txt
deleted file mode 100644
index 835670774b4..00000000000
--- a/scripts/dev/generate_embeddable_epJSON_schema/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-set(generate_embeddable_epJSON_schema_src generate_embeddable_epJSON_schema.cpp)
-
-add_executable(generate_embeddable_epJSON_schema ${generate_embeddable_epJSON_schema_src})
-target_link_libraries(generate_embeddable_epJSON_schema PRIVATE project_options project_fp_options project_warnings)
-set_target_properties(generate_embeddable_epJSON_schema PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/scripts")
diff --git a/scripts/dev/generate_embeddable_epJSON_schema/generate_embeddable_epJSON_schema.cpp b/scripts/dev/generate_embeddable_epJSON_schema/generate_embeddable_epJSON_schema.cpp
deleted file mode 100644
index d94517c88e8..00000000000
--- a/scripts/dev/generate_embeddable_epJSON_schema/generate_embeddable_epJSON_schema.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-#include
-#include
-#include
-#include
-
-using json = nlohmann::json;
-
-int main(int argc, char const* argv[])
-{
- if ( argc != 2 ) {
- std::cout << "usage: ./generate_embeddable_schema path/to/Energy+.schema.epJSON";
- return 1;
- }
- std::ifstream schema_stream(argv[ 1 ], std::ifstream::in);
- if ( !schema_stream.is_open() ) {
- std::cout << "schema file path " << argv[ 1 ] << " not found" << std::endl;
- return 1;
- }
- auto const input_json = json::parse(schema_stream);
- auto const v_cbor = json::to_cbor(input_json);
-
- printf(" static constexpr std::array< std::uint8_t, %zu > embeddedSchema = {{\n", v_cbor.size());
-
- for ( size_t i = 0; i < v_cbor.size(); ++i )
- {
- printf("0x%.2X,", v_cbor[ i ]);
- if ( i % 40 == 0 && i != 0 ) {
- printf("\n");
- }
- }
- printf("}};\n");
- return 0;
-}
diff --git a/scripts/dev/generate_embeddable_epJSON_schema/generate_embedded_epJSON_schema.cmake b/scripts/dev/generate_embeddable_epJSON_schema/generate_embedded_epJSON_schema.cmake
deleted file mode 100644
index 8d68ad992fd..00000000000
--- a/scripts/dev/generate_embeddable_epJSON_schema/generate_embedded_epJSON_schema.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-execute_process( COMMAND "${EnergyPlus_embeddable_epJSON_schema}" "${EnergyPlus_RUNTIME_OUTPUT_DIRECTORY}/Energy+.schema.epJSON" TIMEOUT 90 RESULT_VARIABLE generate_embedded_epJSON_schema OUTPUT_VARIABLE embedded_epJSON_schema)
-if( ${generate_embedded_epJSON_schema} MATCHES ".*timeout.*" )
- message(FATAL_ERROR "Generating embedded epJSON Schema from epJSON Schema failed: ${generate_embedded_epJSON_schema}")
-endif()
-configure_file( "${EnergyPlus_SOURCE_DIR}/InputProcessing/EmbeddedEpJSONSchema.in.cc" "${EnergyPlus_CURRENT_BINARY_DIR}/EmbeddedEpJSONSchema.cc" )
diff --git a/src/ConvertInputFormat/main.cpp b/src/ConvertInputFormat/main.cpp
index 6b4610ba024..004633da347 100644
--- a/src/ConvertInputFormat/main.cpp
+++ b/src/ConvertInputFormat/main.cpp
@@ -53,9 +53,9 @@
#include "EnergyPlus/DataStringGlobals.hh"
#include "EnergyPlus/FileSystem.hh"
-#include "EnergyPlus/InputProcessing/EmbeddedEpJSONSchema.hh"
#include "EnergyPlus/InputProcessing/IdfParser.hh"
#include "EnergyPlus/InputProcessing/InputValidation.hh"
+#include
#include
#include
diff --git a/src/EnergyPlus/AirLoopHVACDOAS.cc b/src/EnergyPlus/AirLoopHVACDOAS.cc
index 661706d7248..f4d53ba3fbb 100644
--- a/src/EnergyPlus/AirLoopHVACDOAS.cc
+++ b/src/EnergyPlus/AirLoopHVACDOAS.cc
@@ -225,8 +225,8 @@ namespace AirLoopHVACDOAS {
++AirLoopMixerNum;
AirLoopMixer thisMixer;
- thisMixer.name = UtilityRoutines::MakeUPPERCase(thisObjectName);
- thisMixer.OutletNodeName = UtilityRoutines::MakeUPPERCase(fields.at("outlet_node_name").get());
+ thisMixer.name = UtilityRoutines::makeUPPER(thisObjectName);
+ thisMixer.OutletNodeName = UtilityRoutines::makeUPPER(fields.at("outlet_node_name").get());
thisMixer.m_AirLoopMixer_Num = AirLoopMixerNum - 1;
thisMixer.OutletNodeNum = NodeInputManager::GetOnlySingleNode(state,
thisMixer.OutletNodeName,
@@ -245,7 +245,7 @@ namespace AirLoopHVACDOAS {
int num = 0;
for (auto const &NodeDOASName : NodeArray) {
num += 1;
- std::string name = UtilityRoutines::MakeUPPERCase(NodeDOASName.at("inlet_node_name").get());
+ std::string name = UtilityRoutines::makeUPPER(NodeDOASName.at("inlet_node_name").get());
int NodeNum = UtilityRoutines::FindItemInList(name, state.dataLoopNodes->NodeID);
if (NodeNum > 0 && num <= thisMixer.numOfInletNodes) {
thisMixer.InletNodeName.push_back(name);
@@ -380,8 +380,8 @@ namespace AirLoopHVACDOAS {
++AirLoopSplitterNum;
AirLoopSplitter thisSplitter;
- thisSplitter.name = UtilityRoutines::MakeUPPERCase(thisObjectName);
- thisSplitter.InletNodeName = UtilityRoutines::MakeUPPERCase(fields.at("inlet_node_name").get());
+ thisSplitter.name = UtilityRoutines::makeUPPER(thisObjectName);
+ thisSplitter.InletNodeName = UtilityRoutines::makeUPPER(fields.at("inlet_node_name").get());
thisSplitter.m_AirLoopSplitter_Num = AirLoopSplitterNum - 1;
auto NodeNames = fields.find("nodes");
@@ -391,7 +391,7 @@ namespace AirLoopHVACDOAS {
int num = 0;
for (auto const &NodeDOASName : NodeArray) {
num += 1;
- std::string name = UtilityRoutines::MakeUPPERCase(NodeDOASName.at("outlet_node_name").get());
+ std::string name = UtilityRoutines::makeUPPER(NodeDOASName.at("outlet_node_name").get());
int NodeNum = UtilityRoutines::FindItemInList(name, state.dataLoopNodes->NodeID);
if (NodeNum > 0 && num <= thisSplitter.numOfOutletNodes) {
thisSplitter.OutletNodeName.push_back(name);
@@ -431,9 +431,9 @@ namespace AirLoopHVACDOAS {
++AirLoopDOASNum;
AirLoopDOAS thisDOAS;
- thisDOAS.Name = UtilityRoutines::MakeUPPERCase(thisObjectName);
+ thisDOAS.Name = UtilityRoutines::makeUPPER(thisObjectName);
// get OA and avail num
- thisDOAS.OASystemName = UtilityRoutines::MakeUPPERCase(fields.at("airloophvac_outdoorairsystem_name").get());
+ thisDOAS.OASystemName = UtilityRoutines::makeUPPER(fields.at("airloophvac_outdoorairsystem_name").get());
thisDOAS.m_OASystemNum = UtilityRoutines::FindItemInList(thisDOAS.OASystemName, state.dataAirLoop->OutsideAirSys);
if (thisDOAS.m_OASystemNum == 0) {
cFieldName = "AirLoopHVAC:OutdoorAirSystem Name";
@@ -466,8 +466,8 @@ namespace AirLoopHVACDOAS {
bool InletNodeErrFlag = false;
bool OutletNodeErrFlag = false;
- const std::string typeNameUC = UtilityRoutines::MakeUPPERCase(thisOutsideAirSys.ComponentType(CompNum));
- ValidEquipListType foundType = static_cast(getEnumerationValue(validEquipNamesUC, typeNameUC));
+ const std::string typeNameUC = UtilityRoutines::makeUPPER(thisOutsideAirSys.ComponentType(CompNum));
+ ValidEquipListType foundType = static_cast(getEnumValue(validEquipNamesUC, typeNameUC));
switch (foundType) {
case ValidEquipListType::OutdoorAirMixer:
@@ -713,7 +713,7 @@ namespace AirLoopHVACDOAS {
thisDOAS.m_HeatExchangerFlag = true;
}
- thisDOAS.AvailManagerSchedName = UtilityRoutines::MakeUPPERCase(fields.at("availability_schedule_name").get());
+ thisDOAS.AvailManagerSchedName = UtilityRoutines::makeUPPER(fields.at("availability_schedule_name").get());
thisDOAS.m_AvailManagerSchedPtr = ScheduleManager::GetScheduleIndex(state, thisDOAS.AvailManagerSchedName);
if (thisDOAS.m_AvailManagerSchedPtr == 0) {
cFieldName = "Availability Schedule Name";
@@ -723,7 +723,7 @@ namespace AirLoopHVACDOAS {
errorsFound = true;
}
- thisDOAS.AirLoopMixerName = UtilityRoutines::MakeUPPERCase(fields.at("airloophvac_mixer_name").get()); //
+ thisDOAS.AirLoopMixerName = UtilityRoutines::makeUPPER(fields.at("airloophvac_mixer_name").get()); //
thisDOAS.m_AirLoopMixerIndex = getAirLoopMixerIndex(state, thisDOAS.AirLoopMixerName);
if (thisDOAS.m_AirLoopMixerIndex < 0) {
cFieldName = "AirLoopHVAC:Mixer Name";
@@ -733,7 +733,7 @@ namespace AirLoopHVACDOAS {
}
AirLoopMixer thisAirLoopMixer;
thisDOAS.m_CompPointerAirLoopMixer = thisAirLoopMixer.factory(state, thisDOAS.m_AirLoopMixerIndex, thisDOAS.AirLoopMixerName);
- thisDOAS.AirLoopSplitterName = UtilityRoutines::MakeUPPERCase(fields.at("airloophvac_splitter_name").get()); //
+ thisDOAS.AirLoopSplitterName = UtilityRoutines::makeUPPER(fields.at("airloophvac_splitter_name").get()); //
thisDOAS.m_AirLoopSplitterIndex = getAirLoopSplitterIndex(state, thisDOAS.AirLoopSplitterName);
if (thisDOAS.m_AirLoopSplitterIndex < 0) {
cFieldName = "AirLoopHVAC:Splitter Name";
@@ -766,7 +766,7 @@ namespace AirLoopHVACDOAS {
auto const &AirLoopArray = AirLoopNames.value();
int num = 0;
for (auto const &AirLoopHVACName : AirLoopArray) {
- std::string name = UtilityRoutines::MakeUPPERCase(AirLoopHVACName.at("airloophvac_name").get());
+ std::string name = UtilityRoutines::makeUPPER(AirLoopHVACName.at("airloophvac_name").get());
int LoopNum = UtilityRoutines::FindItemInList(name, state.dataAirSystemsData->PrimaryAirSystems);
num += 1;
if (LoopNum > 0 && num <= thisDOAS.NumOfAirLoops) {
diff --git a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp
index 838065ed442..c383d81e934 100644
--- a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp
+++ b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp
@@ -343,7 +343,7 @@ namespace AirflowNetwork {
auto &instancesValue = instances.value();
for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
auto const &fields = instance.value();
- auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key());
+ auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key());
Real64 temperature(20.0);
if (fields.find("reference_temperature") != fields.end()) { // required field, has default value
temperature = fields.at("reference_temperature").get();
@@ -403,7 +403,7 @@ namespace AirflowNetwork {
auto &instancesValue = instances.value();
for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
auto const &fields = instance.value();
- auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key());
+ auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key());
m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround
Real64 coeff{fields.at("air_mass_flow_coefficient_at_reference_conditions")}; // Required field
@@ -417,7 +417,7 @@ namespace AirflowNetwork {
if (!conditionsAreDefaulted) {
if (fields.find("reference_crack_conditions") != fields.end()) { // not required field, *should* have default value
auto refCrackCondName = fields.at("reference_crack_conditions").get();
- auto result = referenceConditions.find(UtilityRoutines::MakeUPPERCase(refCrackCondName));
+ auto result = referenceConditions.find(UtilityRoutines::makeUPPER(refCrackCondName));
if (result == referenceConditions.end()) {
ShowSevereError(m_state,
format("{}: {}: {}. Cannot find reference crack conditions object \"{}\".",
@@ -461,7 +461,7 @@ namespace AirflowNetwork {
auto &instancesValue = instances.value();
for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
auto const &fields = instance.value();
- auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key());
+ auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key());
m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround
Real64 coeff{fields.at("air_mass_flow_coefficient_when_the_zone_exhaust_fan_is_off_at_reference_conditions")}; // Required field
@@ -506,7 +506,7 @@ namespace AirflowNetwork {
if (!conditionsAreDefaulted) {
if (fields.find("reference_crack_conditions") != fields.end()) { // not required field, *should* have default value
auto refCrackCondName = fields.at("reference_crack_conditions").get();
- auto result = referenceConditions.find(UtilityRoutines::MakeUPPERCase(refCrackCondName));
+ auto result = referenceConditions.find(UtilityRoutines::makeUPPER(refCrackCondName));
if (result == referenceConditions.end()) {
ShowSevereError(m_state,
format("{}: {}: {}. Cannot find reference crack conditions object \"{}\".",
@@ -562,10 +562,10 @@ namespace AirflowNetwork {
auto &instancesValue = instances.value();
for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
auto const &fields = instance.value();
- auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key());
+ auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key());
m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround
- std::string mixer_name = UtilityRoutines::MakeUPPERCase(fields.at("outdoor_air_mixer_name").get());
+ std::string mixer_name = UtilityRoutines::makeUPPER(fields.at("outdoor_air_mixer_name").get());
Real64 coeff{fields.at("air_mass_flow_coefficient_when_no_outdoor_air_flow_at_reference_conditions")};
Real64 expnt{0.65};
if (fields.find("air_mass_flow_exponent_when_no_outdoor_air_flow") != fields.end()) {
@@ -589,7 +589,7 @@ namespace AirflowNetwork {
if (!conditionsAreDefaulted) {
if (fields.find("reference_crack_conditions") != fields.end()) { // not required field, *should* have default value
auto refCrackCondName = fields.at("reference_crack_conditions").get();
- auto result = referenceConditions.find(UtilityRoutines::MakeUPPERCase(refCrackCondName));
+ auto result = referenceConditions.find(UtilityRoutines::makeUPPER(refCrackCondName));
if (result == referenceConditions.end()) {
ShowSevereError(m_state,
format("{}: {}: {}. Cannot find reference crack conditions object \"{}\".",
@@ -643,10 +643,10 @@ namespace AirflowNetwork {
auto &instancesValue = instances.value();
for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
auto const &fields = instance.value();
- auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key());
+ auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key());
m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround
- std::string mixer_name = UtilityRoutines::MakeUPPERCase(fields.at("outdoor_air_mixer_name").get());
+ std::string mixer_name = UtilityRoutines::makeUPPER(fields.at("outdoor_air_mixer_name").get());
Real64 coeff{fields.at("air_mass_flow_coefficient_when_no_outdoor_air_flow_at_reference_conditions")};
Real64 expnt{0.65};
if (fields.find("air_mass_flow_exponent_when_no_outdoor_air_flow") != fields.end()) {
@@ -667,7 +667,7 @@ namespace AirflowNetwork {
if (!conditionsAreDefaulted) {
if (fields.find("reference_crack_conditions") != fields.end()) { // not required field, *should* have default value
auto refCrackCondName = fields.at("reference_crack_conditions").get();
- auto result = referenceConditions.find(UtilityRoutines::MakeUPPERCase(refCrackCondName));
+ auto result = referenceConditions.find(UtilityRoutines::makeUPPER(refCrackCondName));
if (result == referenceConditions.end()) {
ShowSevereError(m_state,
format("{}: {}: {}. Cannot find reference crack conditions object \"{}\".",
@@ -720,7 +720,7 @@ namespace AirflowNetwork {
auto &instancesValue = instances.value();
for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
auto const &fields = instance.value();
- auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key());
+ auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key());
m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround
Real64 coeff{fields.at("air_mass_flow_coefficient_when_opening_is_closed")};
@@ -1003,7 +1003,7 @@ namespace AirflowNetwork {
auto &instancesValue = instances.value();
for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
auto const &fields = instance.value();
- auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key());
+ auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key());
m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround
Real64 coeff{fields.at("air_mass_flow_coefficient_when_opening_is_closed")};
@@ -1046,7 +1046,7 @@ namespace AirflowNetwork {
auto &instancesValue = instances.value();
for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
auto const &fields = instance.value();
- auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key());
+ auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key());
m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround
Real64 coeff{fields.at("air_mass_flow_coefficient_when_opening_is_closed")};
@@ -1092,7 +1092,7 @@ namespace AirflowNetwork {
auto &instancesValue = instances.value();
for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
auto const &fields = instance.value();
- auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key());
+ auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key());
m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround
Real64 ela{fields.at("effective_leakage_area")};
@@ -1144,7 +1144,7 @@ namespace AirflowNetwork {
instancesValue = instances.value();
for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
auto const &fields = instance.value();
- auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key());
+ auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key());
m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround
Real64 flow_rate{fields.at("air_flow_value")};
@@ -1193,7 +1193,7 @@ namespace AirflowNetwork {
auto &instancesValue = instances.value();
for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
auto const &fields = instance.value();
- auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key());
+ auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key());
m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround
Real64 coeff{fields.at("air_mass_flow_coefficient")};
@@ -1231,7 +1231,7 @@ namespace AirflowNetwork {
auto &instancesValue = instances.value();
for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
auto const &fields = instance.value();
- auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key());
+ auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key());
m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround
Real64 elr{fields.at("effective_leakage_ratio")};
@@ -1273,7 +1273,7 @@ namespace AirflowNetwork {
auto &instancesValue = instances.value();
for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
auto const &fields = instance.value();
- auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key());
+ auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key());
m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround
Real64 L{fields.at("duct_length")};
@@ -1358,10 +1358,10 @@ namespace AirflowNetwork {
auto &instancesValue = instances.value();
for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
auto const &fields = instance.value();
- auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key());
+ auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key());
m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround
- std::string fan_name = UtilityRoutines::MakeUPPERCase(fields.at("fan_name").get());
+ std::string fan_name = UtilityRoutines::makeUPPER(fields.at("fan_name").get());
std::string fan_type = fields.at("supply_fan_object_type").get();
int fanIndex;
@@ -1370,7 +1370,7 @@ namespace AirflowNetwork {
int inletNode;
int outletNode;
- if (UtilityRoutines::SameString(UtilityRoutines::MakeUPPERCase(fan_type), "FAN:SYSTEMMODEL")) {
+ if (UtilityRoutines::SameString(UtilityRoutines::makeUPPER(fan_type), "FAN:SYSTEMMODEL")) {
m_state.dataHVACFan->fanObjs.emplace_back(new HVACFan::FanSystem(m_state, fan_name));
fanIndex = HVACFan::getFanObjectVectorIndex(m_state, fan_name);
if (fanIndex < 0) {
@@ -1477,7 +1477,7 @@ namespace AirflowNetwork {
auto &instancesValue = instances.value();
for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
auto const &fields = instance.value();
- // auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key());
+ // auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key());
m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround
std::string coil_name = fields.at("coil_name").get();
@@ -1485,10 +1485,10 @@ namespace AirflowNetwork {
Real64 L{fields.at("air_path_length")};
Real64 D{fields.at("air_path_hydraulic_diameter")};
- DisSysCompCoilData(i).name = UtilityRoutines::MakeUPPERCase(coil_name); // Name of associated EPlus coil component
- DisSysCompCoilData(i).EPlusType = coil_type; // coil type
- DisSysCompCoilData(i).L = L; // Air path length
- DisSysCompCoilData(i).hydraulicDiameter = D; // Air path hydraulic diameter
+ DisSysCompCoilData(i).name = UtilityRoutines::makeUPPER(coil_name); // Name of associated EPlus coil component
+ DisSysCompCoilData(i).EPlusType = coil_type; // coil type
+ DisSysCompCoilData(i).L = L; // Air path length
+ DisSysCompCoilData(i).hydraulicDiameter = D; // Air path hydraulic diameter
// Add the element to the lookup table, check for name overlaps
if (elements.find(DisSysCompCoilData(i).name) == elements.end()) {
@@ -1517,7 +1517,7 @@ namespace AirflowNetwork {
auto &instancesValue = instances.value();
for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
auto const &fields = instance.value();
- // auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key());
+ // auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key());
m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround
std::string hx_name = fields.at("heatexchanger_name").get();
@@ -1525,10 +1525,10 @@ namespace AirflowNetwork {
Real64 L{fields.at("air_path_length")};
Real64 D{fields.at("air_path_hydraulic_diameter")};
- DisSysCompHXData(i).name = UtilityRoutines::MakeUPPERCase(hx_name); // Name of associated EPlus heat exchange component
- DisSysCompHXData(i).EPlusType = hx_type; // coil type
- DisSysCompHXData(i).L = L; // Air path length
- DisSysCompHXData(i).hydraulicDiameter = D; // Air path hydraulic diameter
+ DisSysCompHXData(i).name = UtilityRoutines::makeUPPER(hx_name); // Name of associated EPlus heat exchange component
+ DisSysCompHXData(i).EPlusType = hx_type; // coil type
+ DisSysCompHXData(i).L = L; // Air path length
+ DisSysCompHXData(i).hydraulicDiameter = D; // Air path hydraulic diameter
DisSysCompHXData(i).CoilParentExists = HVACHXAssistedCoolingCoil::VerifyHeatExchangerParent(m_state, hx_type, hx_name);
// Add the element to the lookup table, check for name overlaps
@@ -1557,7 +1557,7 @@ namespace AirflowNetwork {
auto &instancesValue = instances.value();
for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
auto const &fields = instance.value();
- // auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key());
+ // auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key());
m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround
std::string tu_name = fields.at("terminal_unit_name").get();
@@ -1565,10 +1565,10 @@ namespace AirflowNetwork {
Real64 L{fields.at("air_path_length")};
Real64 D{fields.at("air_path_hydraulic_diameter")};
- DisSysCompTermUnitData(i).name = UtilityRoutines::MakeUPPERCase(tu_name); // Name of associated EPlus coil component
- DisSysCompTermUnitData(i).EPlusType = tu_type; // Terminal unit type
- DisSysCompTermUnitData(i).L = L; // Air path length
- DisSysCompTermUnitData(i).hydraulicDiameter = D; // Air path hydraulic diameter
+ DisSysCompTermUnitData(i).name = UtilityRoutines::makeUPPER(tu_name); // Name of associated EPlus coil component
+ DisSysCompTermUnitData(i).EPlusType = tu_type; // Terminal unit type
+ DisSysCompTermUnitData(i).L = L; // Air path length
+ DisSysCompTermUnitData(i).hydraulicDiameter = D; // Air path hydraulic diameter
// Add the element to the lookup table, check for name overlaps
if (elements.find(DisSysCompTermUnitData(i).name) == elements.end()) {
@@ -1597,7 +1597,7 @@ namespace AirflowNetwork {
auto &instancesValue = instances.value();
for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
auto const &fields = instance.value();
- auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key());
+ auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key());
m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround
Real64 dp{fields.at("pressure_difference_across_the_component")};
@@ -1643,7 +1643,7 @@ namespace AirflowNetwork {
using MixedAir::GetOAMixerNumber;
using NodeInputManager::GetOnlySingleNode;
using OutAirNodeManager::SetOutAirNodes;
- using RoomAirModelManager::GetRAFNNodeNum;
+ using RoomAir::GetRAFNNodeNum;
// SUBROUTINE PARAMETER DEFINITIONS:
static constexpr std::string_view RoutineName("AirflowNetwork::Solver::get_input: "); // include trailing blank space
@@ -1986,7 +1986,7 @@ namespace AirflowNetwork {
// Find a flag for possible combination of vent and distribution system
// This SELECT_CASE_var will go on input refactor, no need to fix
{
- auto const SELECT_CASE_var(UtilityRoutines::MakeUPPERCase(Alphas(2)));
+ auto const SELECT_CASE_var(UtilityRoutines::makeUPPER(Alphas(2)));
if (SELECT_CASE_var == "NOMULTIZONEORDISTRIBUTION") {
simulation_control.type = ControlType::NoMultizoneOrDistribution;
SimAirNetworkKey = "NoMultizoneOrDistribution";
@@ -2264,11 +2264,11 @@ namespace AirflowNetwork {
cNumericFields);
simulation_control.ductSizing.name = Alphas(1);
- if (UtilityRoutines::SameString(Alphas(2), UtilityRoutines::MakeUPPERCase("MaximumVelocity"))) {
+ if (UtilityRoutines::SameString(Alphas(2), UtilityRoutines::makeUPPER("MaximumVelocity"))) {
simulation_control.ductSizing.method = DuctSizingMethod::MaxVelocity;
- } else if (UtilityRoutines::SameString(Alphas(2), UtilityRoutines::MakeUPPERCase("PressureLoss"))) {
+ } else if (UtilityRoutines::SameString(Alphas(2), UtilityRoutines::makeUPPER("PressureLoss"))) {
simulation_control.ductSizing.method = DuctSizingMethod::PressureLoss;
- } else if (UtilityRoutines::SameString(Alphas(2), UtilityRoutines::MakeUPPERCase("PressureLossWithMaximumVelocity"))) {
+ } else if (UtilityRoutines::SameString(Alphas(2), UtilityRoutines::makeUPPER("PressureLossWithMaximumVelocity"))) {
simulation_control.ductSizing.method = DuctSizingMethod::VelocityAndLoss;
} else {
ShowSevereError(m_state, format("{} {} object, {} = {} is invalid.", RoutineName, CurrentModuleObject, cAlphaFields(2), Alphas(2)));
@@ -2452,7 +2452,7 @@ namespace AirflowNetwork {
{
// These SELECT_CASE_vars will go on input refactor, no need to fix
- auto const SELECT_CASE_var(UtilityRoutines::MakeUPPERCase(MultizoneZoneData(i).VentControl));
+ auto const SELECT_CASE_var(UtilityRoutines::makeUPPER(MultizoneZoneData(i).VentControl));
if (SELECT_CASE_var == "TEMPERATURE") { // checks on Temperature control
if (MultizoneZoneData(i).LowValueTemp < 0.0) {
// Code will never be executed, validation will catch invalid input
@@ -2720,7 +2720,7 @@ namespace AirflowNetwork {
if (!lAlphaBlanks(5)) MultizoneSurfaceData(i).VentSchName = Alphas(5);
{
// This SELECT_CASE_var will go on input refactor, no need to fix
- auto const SELECT_CASE_var(UtilityRoutines::MakeUPPERCase(MultizoneSurfaceData(i).VentControl));
+ auto const SELECT_CASE_var(UtilityRoutines::makeUPPER(MultizoneSurfaceData(i).VentControl));
if (SELECT_CASE_var == "TEMPERATURE") {
MultizoneSurfaceData(i).VentSurfCtrNum = VentControlType::Temp;
MultizoneSurfaceData(i).IndVentControl = true;
@@ -4116,7 +4116,7 @@ namespace AirflowNetwork {
{
// This SELECT_CASE_var will go on input refactor, no need to fix
- auto const SELECT_CASE_var(UtilityRoutines::MakeUPPERCase(Alphas(3)));
+ auto const SELECT_CASE_var(UtilityRoutines::makeUPPER(Alphas(3)));
if (SELECT_CASE_var == "AIRFLOWNETWORK:MULTIZONE:COMPONENT:ZONEEXHAUSTFAN") {
PressureControllerData(i).ControlTypeSet = PressureCtrlExhaust;
} else if (SELECT_CASE_var == "AIRFLOWNETWORK:DISTRIBUTION:COMPONENT:RELIEFAIRFLOW") {
@@ -4802,7 +4802,7 @@ namespace AirflowNetwork {
n = AirflowNetworkNodeData(i).EPlusZoneNum;
AirflowNetworkNodeData(i).NumOfLinks = 0;
if (n > 0 && AirflowNetworkNodeData(i).RAFNNodeNum > 0) {
- m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(n).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirflowNetworkNodeID = i;
+ m_state.dataRoomAir->AFNZoneInfo(n).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AFNNodeID = i;
for (j = 1; j <= AirflowNetworkNumOfSurfaces; ++j) {
if (AirflowNetworkLinkageData(j).NodeNums[0] == i) {
AirflowNetworkNodeData(i).NumOfLinks = AirflowNetworkNodeData(i).NumOfLinks + 1;
@@ -4813,21 +4813,21 @@ namespace AirflowNetwork {
}
}
if (AirflowNetworkNodeData(i).RAFNNodeNum > 0) {
- for (j = 1; j <= m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(n).NumOfAirNodes; ++j) {
- if (m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(n).Node(j).AirflowNetworkNodeID == i) {
- m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(n).Node(j).NumOfAirflowLinks = AirflowNetworkNodeData(i).NumOfLinks;
- m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(n).Node(j).Link.allocate(AirflowNetworkNodeData(i).NumOfLinks);
+ for (j = 1; j <= m_state.dataRoomAir->AFNZoneInfo(n).NumOfAirNodes; ++j) {
+ if (m_state.dataRoomAir->AFNZoneInfo(n).Node(j).AFNNodeID == i) {
+ m_state.dataRoomAir->AFNZoneInfo(n).Node(j).NumOfAirflowLinks = AirflowNetworkNodeData(i).NumOfLinks;
+ m_state.dataRoomAir->AFNZoneInfo(n).Node(j).Link.allocate(AirflowNetworkNodeData(i).NumOfLinks);
k = 1;
for (int m = 1; m <= AirflowNetworkNumOfSurfaces; ++m) {
if (AirflowNetworkLinkageData(m).NodeNums[0] == i) {
- m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(n).Node(j).Link(k).AirflowNetworkLinkSimuID = m;
- m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(n).Node(j).Link(k).AirflowNetworkLinkageDataID = m;
+ m_state.dataRoomAir->AFNZoneInfo(n).Node(j).Link(k).AFNSimuID = m;
+ m_state.dataRoomAir->AFNZoneInfo(n).Node(j).Link(k).AFNDataID = m;
k = k + 1;
if (k > AirflowNetworkNodeData(i).NumOfLinks) break;
}
if (AirflowNetworkLinkageData(m).NodeNums[1] == i) {
- m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(n).Node(j).Link(k).AirflowNetworkLinkSimuID = m;
- m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(n).Node(j).Link(k).AirflowNetworkLinkageDataID = m;
+ m_state.dataRoomAir->AFNZoneInfo(n).Node(j).Link(k).AFNSimuID = m;
+ m_state.dataRoomAir->AFNZoneInfo(n).Node(j).Link(k).AFNDataID = m;
k = k + 1;
if (k > AirflowNetworkNodeData(i).NumOfLinks) break;
}
@@ -5386,8 +5386,8 @@ namespace AirflowNetwork {
}
if (AirflowNetworkNodeData(i).RAFNNodeNum > 0) {
ZoneNum = AirflowNetworkNodeData(i).EPlusZoneNum;
- m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp = 23.0;
- m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).HumRat = 0.0;
+ m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp = 23.0;
+ m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).HumRat = 0.0;
}
}
@@ -5469,13 +5469,11 @@ namespace AirflowNetwork {
if (AirflowNetworkNodeData(i).RAFNNodeNum > 0) {
ZoneNum = AirflowNetworkNodeData(i).EPlusZoneNum;
- if (m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum)
- .Node(AirflowNetworkNodeData(i).RAFNNodeNum)
- .AirflowNetworkNodeID == i) {
+ if (m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AFNNodeID == i) {
AirflowNetworkNodeSimu(i).TZ =
- m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp;
+ m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp;
AirflowNetworkNodeSimu(i).WZ =
- m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).HumRat;
+ m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).HumRat;
}
}
}
@@ -7736,9 +7734,8 @@ namespace AirflowNetwork {
if (AirflowNetworkNodeData(i).RAFNNodeNum > 0 && MA((i - 1) * AirflowNetworkNumOfNodes + i) < 0.9e10) {
MA((i - 1) * AirflowNetworkNumOfNodes + i) = 1.0e10;
ZoneNum = AirflowNetworkNodeData(i).EPlusZoneNum;
- if (m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirflowNetworkNodeID ==
- i) {
- MV(i) = m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp * 1.0e10;
+ if (m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AFNNodeID == i) {
+ MV(i) = m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp * 1.0e10;
}
}
}
@@ -8030,9 +8027,8 @@ namespace AirflowNetwork {
if (AirflowNetworkNodeData(i).RAFNNodeNum > 0 && MA((i - 1) * AirflowNetworkNumOfNodes + i) < 0.9e10) {
MA((i - 1) * AirflowNetworkNumOfNodes + i) = 1.0e10;
ZoneNum = AirflowNetworkNodeData(i).EPlusZoneNum;
- if (m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirflowNetworkNodeID ==
- i) {
- MV(i) = m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).HumRat * 1.0e10;
+ if (m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AFNNodeID == i) {
+ MV(i) = m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).HumRat * 1.0e10;
}
}
}
@@ -10513,7 +10509,7 @@ namespace AirflowNetwork {
MultiSpeedHPIndicator = 0;
for (int i = 1; i <= DisSysNumOfCoils; ++i) {
{
- auto const SELECT_CASE_var(UtilityRoutines::MakeUPPERCase(DisSysCompCoilData(i).EPlusType));
+ auto const SELECT_CASE_var(UtilityRoutines::makeUPPER(DisSysCompCoilData(i).EPlusType));
if (SELECT_CASE_var == "COIL:COOLING:DX") {
ValidateComponent(m_state, "Coil:Cooling:DX", DisSysCompCoilData(i).name, IsNotOK, format(RoutineName) + CurrentModuleObject);
@@ -10690,7 +10686,7 @@ namespace AirflowNetwork {
CurrentModuleObject = "AirflowNetwork:Distribution:Component:HeatExchanger";
for (int i = 1; i <= DisSysNumOfHXs; ++i) {
{
- auto const SELECT_CASE_var(UtilityRoutines::MakeUPPERCase(DisSysCompHXData(i).EPlusType));
+ auto const SELECT_CASE_var(UtilityRoutines::makeUPPER(DisSysCompHXData(i).EPlusType));
if (SELECT_CASE_var == "HEATEXCHANGER:AIRTOAIR:FLATPLATE") {
ValidateComponent(
@@ -11214,7 +11210,7 @@ namespace AirflowNetwork {
for (int j = 1; j <= m_state.dataGlobal->NumOfZones; ++j) {
if (!m_state.dataZoneEquip->ZoneEquipConfig(j).IsControlled) continue;
for (int EquipTypeNum = 1; EquipTypeNum <= m_state.dataZoneEquip->ZoneEquipList(j).NumOfEquipTypes; ++EquipTypeNum) {
- if (m_state.dataZoneEquip->ZoneEquipList(j).EquipTypeEnum(EquipTypeNum) == DataZoneEquipment::ZoneEquip::ZoneExhaustFan) {
+ if (m_state.dataZoneEquip->ZoneEquipList(j).EquipType(EquipTypeNum) == DataZoneEquipment::ZoneEquipType::ExhaustFan) {
bool found = false;
for (int k = 1; k <= m_state.dataZoneEquip->ZoneEquipConfig(j).NumExhaustNodes; ++k) {
for (int i = 1; i <= AirflowNetworkNumOfExhFan; ++i) {
@@ -11789,10 +11785,9 @@ namespace AirflowNetwork {
return AirLoopNum;
}
if (m_state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(NumOfComp).NumSubComps == 0) {
- DataLoopNode::ConnectionObjectType TypeOfComp =
- static_cast(EnergyPlus::getEnumerationValue(
- BranchNodeConnections::ConnectionObjectTypeNamesUC,
- m_state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(NumOfComp).TypeOf));
+ DataLoopNode::ConnectionObjectType TypeOfComp = static_cast(EnergyPlus::getEnumValue(
+ BranchNodeConnections::ConnectionObjectTypeNamesUC,
+ m_state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(NumOfComp).TypeOf));
std::string const &NameOfComp =
m_state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(NumOfComp).Name;
if (IsParentObject(m_state, TypeOfComp, NameOfComp)) {
@@ -12090,7 +12085,7 @@ namespace AirflowNetwork {
if (!m_state.dataZoneEquip->ZoneEquipConfig(ZoneNum).IsControlled) continue;
NumOfCtrlZones++;
for (int EquipTypeNum = 1; EquipTypeNum <= m_state.dataZoneEquip->ZoneEquipList(ZoneNum).NumOfEquipTypes; ++EquipTypeNum) {
- if (m_state.dataZoneEquip->ZoneEquipList(ZoneNum).EquipTypeEnum(EquipTypeNum) == DataZoneEquipment::ZoneEquip::AirDistUnit) {
+ if (m_state.dataZoneEquip->ZoneEquipList(ZoneNum).EquipType(EquipTypeNum) == DataZoneEquipment::ZoneEquipType::AirDistributionUnit) {
int AirDistUnitNum = m_state.dataZoneEquip->ZoneEquipList(ZoneNum).EquipIndex(EquipTypeNum);
MdotBranch = m_state.dataDefineEquipment->AirDistUnit(AirDistUnitNum).MassFlowRateTU;
break;
diff --git a/src/EnergyPlus/BaseboardElectric.cc b/src/EnergyPlus/BaseboardElectric.cc
index e43017444e9..af04ae276e2 100644
--- a/src/EnergyPlus/BaseboardElectric.cc
+++ b/src/EnergyPlus/BaseboardElectric.cc
@@ -215,8 +215,8 @@ namespace BaseboardElectric {
++BaseboardNum;
auto &thisBaseboard = baseboard->baseboards(BaseboardNum);
- thisBaseboard.EquipName = state.dataIPShortCut->cAlphaArgs(1); // name of this baseboard
- thisBaseboard.EquipType = UtilityRoutines::MakeUPPERCase(cCurrentModuleObject); // the type of baseboard-rename change
+ thisBaseboard.EquipName = state.dataIPShortCut->cAlphaArgs(1); // name of this baseboard
+ thisBaseboard.EquipType = UtilityRoutines::makeUPPER(cCurrentModuleObject); // the type of baseboard-rename change
thisBaseboard.Schedule = state.dataIPShortCut->cAlphaArgs(2);
if (state.dataIPShortCut->lAlphaFieldBlanks(2)) {
thisBaseboard.SchedPtr = ScheduleManager::ScheduleAlwaysOn;
@@ -330,7 +330,7 @@ namespace BaseboardElectric {
}
thisBaseboard.ZonePtr = DataZoneEquipment::GetZoneEquipControlledZoneNum(
- state, DataZoneEquipment::ZoneEquip::BBElectricConvective, thisBaseboard.EquipName);
+ state, DataZoneEquipment::ZoneEquipType::BaseboardConvectiveElectric, thisBaseboard.EquipName);
}
if (ErrorsFound) {
@@ -446,13 +446,13 @@ namespace BaseboardElectric {
auto &ZoneEqSizing = state.dataSize->ZoneEqSizing(state.dataSize->CurZoneEqNum);
auto &baseboard = state.dataBaseboardElectric->baseboards(BaseboardNum);
- std::string CompType = baseboard.EquipType;
- std::string CompName = baseboard.EquipName;
+ std::string_view const CompType = baseboard.EquipType;
+ std::string_view const CompName = baseboard.EquipName;
state.dataSize->DataFracOfAutosizedHeatingCapacity = 1.0;
state.dataSize->DataZoneNumber = baseboard.ZonePtr;
int SizingMethod = DataHVACGlobals::HeatingCapacitySizing;
int FieldNum = 1;
- std::string SizingString = baseboard.FieldNames(FieldNum) + " [W]";
+ std::string const SizingString = format("{} [W]", baseboard.FieldNames(FieldNum));
int CapSizingMethod = baseboard.HeatingCapMethod;
ZoneEqSizing.SizingMethod(SizingMethod) = CapSizingMethod;
if (CapSizingMethod == DataSizing::HeatingDesignCapacity || CapSizingMethod == DataSizing::CapacityPerFloorArea ||
diff --git a/src/EnergyPlus/BaseboardRadiator.cc b/src/EnergyPlus/BaseboardRadiator.cc
index 460f372ae73..1590070af5f 100644
--- a/src/EnergyPlus/BaseboardRadiator.cc
+++ b/src/EnergyPlus/BaseboardRadiator.cc
@@ -225,13 +225,11 @@ namespace BaseboardRadiator {
using namespace DataSizing;
// SUBROUTINE PARAMETER DEFINITIONS:
- static constexpr std::string_view RoutineName("GetBaseboardInput: "); // include trailing blank space
- int constexpr iHeatCAPMAlphaNum(5); // get input index to water baseboard Radiator system heating capacity sizing method
- int constexpr iHeatDesignCapacityNumericNum(1); // get input index to water baseboard Radiator system electric heating capacity
- int constexpr iHeatCapacityPerFloorAreaNumericNum(
- 2); // get input index to water baseboard Radiator system electric heating capacity per floor area sizing
- int constexpr iHeatFracOfAutosizedCapacityNumericNum(
- 3); // get input index to water baseboard Radiator system electric heating capacity sizing as fraction of autosized heating capacity
+ static constexpr std::string_view RoutineName = "GetBaseboardInput: "; // include trailing blank space
+ int constexpr iHeatCAPMAlphaNum = 5; // get input index to water baseboard Radiator system heating capacity sizing method
+ int constexpr iHeatDesignCapacityNumericNum = 1; // get input index to water baseboard Radiator system electric heating capacity
+ int constexpr iHeatCapacityPerFloorAreaNumericNum = 2; // index to baseboard Radiator system electric heating capacity per floor area sizing
+ int constexpr iHeatFracOfAutosizedCapacityNumericNum = 3; // index to baseboard heating capacity fraction of autosized heating capacity
auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject;
@@ -418,8 +416,8 @@ namespace BaseboardRadiator {
thisBaseboard.Offset = 0.001;
}
- thisBaseboard.ZonePtr =
- DataZoneEquipment::GetZoneEquipControlledZoneNum(state, DataZoneEquipment::ZoneEquip::BBWaterConvective, thisBaseboard.EquipID);
+ thisBaseboard.ZonePtr = DataZoneEquipment::GetZoneEquipControlledZoneNum(
+ state, DataZoneEquipment::ZoneEquipType::BaseboardConvectiveWater, thisBaseboard.EquipID);
}
if (ErrorsFound) {
@@ -526,7 +524,7 @@ namespace BaseboardRadiator {
// PURPOSE OF THIS SUBROUTINE:
// This subroutine initializes the Baseboard units during simulation.
- static constexpr std::string_view RoutineName("BaseboardRadiator:InitBaseboard");
+ static constexpr std::string_view RoutineName = "BaseboardRadiator:InitBaseboard";
if (this->SetLoopIndexFlag && allocated(state.dataPlnt->PlantLoop)) {
bool errFlag = false;
@@ -603,9 +601,9 @@ namespace BaseboardRadiator {
// calculated by numerically inverting the baseboard calculation routine.
// SUBROUTINE PARAMETER DEFINITIONS:
- Real64 constexpr Acc(0.0001); // Accuracy of result
- int constexpr MaxIte(500); // Maximum number of iterations
- static std::string const RoutineName(cCMO_BBRadiator_Water + ":SizeBaseboard");
+ Real64 constexpr Acc = 0.0001; // Accuracy of result
+ int constexpr MaxIte = 500; // Maximum number of iterations
+ static std::string const RoutineName = cCMO_BBRadiator_Water + ":SizeBaseboard";
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
Real64 DesCoilLoad(0.0);
@@ -643,13 +641,13 @@ namespace BaseboardRadiator {
}
} else {
CheckZoneSizing(state, cCMO_BBRadiator_Water, this->EquipID);
- std::string CompType = cCMO_BBRadiator_Water;
- std::string CompName = this->EquipID;
+ std::string_view const CompType = cCMO_BBRadiator_Water;
+ std::string_view const CompName = this->EquipID;
state.dataSize->DataFracOfAutosizedHeatingCapacity = 1.0;
state.dataSize->DataZoneNumber = this->ZonePtr;
int SizingMethod = DataHVACGlobals::HeatingCapacitySizing;
int FieldNum = 1;
- std::string SizingString = this->FieldNames(FieldNum) + " [W]";
+ std::string const SizingString = format("{} [W]", this->FieldNames(FieldNum));
int CapSizingMethod = this->HeatingCapMethod;
zoneEqSizing.SizingMethod(SizingMethod) = CapSizingMethod;
if (CapSizingMethod == DataSizing::HeatingDesignCapacity || CapSizingMethod == DataSizing::CapacityPerFloorArea ||
@@ -765,13 +763,13 @@ namespace BaseboardRadiator {
RoutineName);
state.dataLoopNodes->Node(this->WaterInletNode).MassFlowRate = rho * this->WaterVolFlowRateMax;
- std::string CompType = cCMO_BBRadiator_Water;
- std::string CompName = this->EquipID;
+ std::string_view const CompType = cCMO_BBRadiator_Water;
+ std::string_view const CompName = this->EquipID;
state.dataSize->DataFracOfAutosizedHeatingCapacity = 1.0;
state.dataSize->DataZoneNumber = this->ZonePtr;
int SizingMethod = DataHVACGlobals::HeatingCapacitySizing;
int FieldNum = 1;
- std::string SizingString = this->FieldNames(FieldNum) + " [W]";
+ std::string const SizingString = format("{} [W]", this->FieldNames(FieldNum));
int CapSizingMethod = this->HeatingCapMethod;
zoneEqSizing.SizingMethod(SizingMethod) = CapSizingMethod;
if (CapSizingMethod == DataSizing::HeatingDesignCapacity || CapSizingMethod == DataSizing::CapacityPerFloorArea ||
diff --git a/src/EnergyPlus/BoilerSteam.cc b/src/EnergyPlus/BoilerSteam.cc
index d80e16087aa..11053f560e1 100644
--- a/src/EnergyPlus/BoilerSteam.cc
+++ b/src/EnergyPlus/BoilerSteam.cc
@@ -196,8 +196,7 @@ namespace BoilerSteam {
thisBoiler.Name = state.dataIPShortCut->cAlphaArgs(1);
// Validate fuel type input
- thisBoiler.FuelType =
- static_cast(getEnumerationValue(Constant::eResourceNamesUC, state.dataIPShortCut->cAlphaArgs(2)));
+ thisBoiler.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs(2)));
// INPUTS from the IDF file
thisBoiler.BoilerMaxOperPress = state.dataIPShortCut->rNumericArgs(1);
@@ -408,7 +407,7 @@ namespace BoilerSteam {
void BoilerSpecs::setupOutputVars(EnergyPlusData &state)
{
- std::string_view sFuelType = Constant::eResourceNames[static_cast(this->FuelType)];
+ std::string_view sFuelType = Constant::eFuelNames[static_cast(this->FuelType)];
SetupOutputVariable(state,
"Boiler Heating Rate",
OutputProcessor::Unit::W,
diff --git a/src/EnergyPlus/BoilerSteam.hh b/src/EnergyPlus/BoilerSteam.hh
index 610e512ff65..830377a81f8 100644
--- a/src/EnergyPlus/BoilerSteam.hh
+++ b/src/EnergyPlus/BoilerSteam.hh
@@ -72,29 +72,29 @@ namespace BoilerSteam {
struct BoilerSpecs : PlantComponent
{
// Members
- std::string Name; // user identifier
- Constant::eResource FuelType = Constant::eResource::Invalid; // resource type
- bool Available = false; // TRUE if machine available in current time step
- bool ON = false; // TRUE: simulate the machine at it's operating part load ratio
- bool MissingSetPointErrDone = false; // Missing outlet node setpoint message flag
- bool UseLoopSetPoint = false; // Flag to use setpoint from loop
- Real64 DesMassFlowRate = 0.0; // kg/s - Boiler water design mass flow rate
- Real64 MassFlowRate = 0.0; // kg/s - Boiler water mass flow rate
- Real64 NomCap = 0.0; // W - design nominal capacity of Boiler
- bool NomCapWasAutoSized = false; // true if Nominal capacity was autosize on input
- Real64 NomEffic = 0.0; // boiler efficiency at design conditions
- Real64 MinPartLoadRat = 0.0; // Minimum allowed operating part load ratio
- Real64 MaxPartLoadRat = 0.0; // Maximum allowed operating part load ratio
- Real64 OptPartLoadRat = 0.0; // Optimal operating part load ratio
- Real64 OperPartLoadRat = 0.0; // Actual operating part load ratio
- Real64 TempUpLimitBoilerOut = 0.0; // C - Boiler outlet maximum temperature limit
- Real64 BoilerMaxOperPress = 0.0; // Max Boiler Pressure
- Real64 BoilerPressCheck = 0.0; // Boiler Operating Pressure at Saturation Temperature
- Real64 SizFac = 0.0; // sizing factor
- int BoilerInletNodeNum = 0; // Node number at the boiler inlet
- int BoilerOutletNodeNum = 0; // Node number at the boiler outlet
- std::array FullLoadCoef = {0.0}; // Coefficients of the fuel consumption/part load ratio curve
- int TypeNum = 0; // Plant loop type identifier
+ std::string Name; // user identifier
+ Constant::eFuel FuelType = Constant::eFuel::Invalid; // resource type
+ bool Available = false; // TRUE if machine available in current time step
+ bool ON = false; // TRUE: simulate the machine at it's operating part load ratio
+ bool MissingSetPointErrDone = false; // Missing outlet node setpoint message flag
+ bool UseLoopSetPoint = false; // Flag to use setpoint from loop
+ Real64 DesMassFlowRate = 0.0; // kg/s - Boiler water design mass flow rate
+ Real64 MassFlowRate = 0.0; // kg/s - Boiler water mass flow rate
+ Real64 NomCap = 0.0; // W - design nominal capacity of Boiler
+ bool NomCapWasAutoSized = false; // true if Nominal capacity was autosize on input
+ Real64 NomEffic = 0.0; // boiler efficiency at design conditions
+ Real64 MinPartLoadRat = 0.0; // Minimum allowed operating part load ratio
+ Real64 MaxPartLoadRat = 0.0; // Maximum allowed operating part load ratio
+ Real64 OptPartLoadRat = 0.0; // Optimal operating part load ratio
+ Real64 OperPartLoadRat = 0.0; // Actual operating part load ratio
+ Real64 TempUpLimitBoilerOut = 0.0; // C - Boiler outlet maximum temperature limit
+ Real64 BoilerMaxOperPress = 0.0; // Max Boiler Pressure
+ Real64 BoilerPressCheck = 0.0; // Boiler Operating Pressure at Saturation Temperature
+ Real64 SizFac = 0.0; // sizing factor
+ int BoilerInletNodeNum = 0; // Node number at the boiler inlet
+ int BoilerOutletNodeNum = 0; // Node number at the boiler outlet
+ std::array FullLoadCoef = {0.0}; // Coefficients of the fuel consumption/part load ratio curve
+ int TypeNum = 0; // Plant loop type identifier
PlantLocation plantLoc;
int PressErrIndex = 0; // index pointer for recurring errors
int FluidIndex = 0; // Steam index
diff --git a/src/EnergyPlus/Boilers.cc b/src/EnergyPlus/Boilers.cc
index a0afa8f7819..3d37f682608 100644
--- a/src/EnergyPlus/Boilers.cc
+++ b/src/EnergyPlus/Boilers.cc
@@ -206,7 +206,7 @@ void GetBoilerInput(EnergyPlusData &state)
thisBoiler.Type = DataPlant::PlantEquipmentType::Boiler_Simple;
// Validate fuel type input
- thisBoiler.FuelType = static_cast(getEnumerationValue(Constant::eResourceNamesUC, state.dataIPShortCut->cAlphaArgs(2)));
+ thisBoiler.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs(2)));
thisBoiler.NomCap = state.dataIPShortCut->rNumericArgs(1);
if (state.dataIPShortCut->rNumericArgs(1) == 0.0) {
@@ -358,7 +358,7 @@ void GetBoilerInput(EnergyPlusData &state)
void BoilerSpecs::SetupOutputVars(EnergyPlusData &state)
{
- std::string_view const sFuelType = Constant::eResourceNames[static_cast(this->FuelType)];
+ std::string_view const sFuelType = Constant::eFuelNames[static_cast(this->FuelType)];
SetupOutputVariable(state,
"Boiler Heating Rate",
OutputProcessor::Unit::W,
diff --git a/src/EnergyPlus/Boilers.hh b/src/EnergyPlus/Boilers.hh
index 894e9f30517..07e4835a094 100644
--- a/src/EnergyPlus/Boilers.hh
+++ b/src/EnergyPlus/Boilers.hh
@@ -84,7 +84,7 @@ namespace Boilers {
{
// Members
std::string Name; // user identifier
- Constant::eResource FuelType = Constant::eResource::Invalid; // resource type assignment
+ Constant::eFuel FuelType = Constant::eFuel::Invalid; // resource type assignment
DataPlant::PlantEquipmentType Type = DataPlant::PlantEquipmentType::Invalid; // plant loop type identifier
PlantLocation plantLoc{};
bool Available = false; // TRUE if machine available in current time step
diff --git a/src/EnergyPlus/BranchNodeConnections.cc b/src/EnergyPlus/BranchNodeConnections.cc
index ac6567bb98d..6ab32aab23e 100644
--- a/src/EnergyPlus/BranchNodeConnections.cc
+++ b/src/EnergyPlus/BranchNodeConnections.cc
@@ -1790,15 +1790,15 @@ void SetUpCompSets(EnergyPlusData &state,
// inlet/outlet nodes have been input. This routine assumes that identical
// "CompSets" cannot be used in multiple places and issues a warning if they are.
- std::string ParentTypeUC = UtilityRoutines::MakeUPPERCase(ParentType);
- std::string CompTypeUC = UtilityRoutines::MakeUPPERCase(CompType);
+ std::string ParentTypeUC = UtilityRoutines::makeUPPER(ParentType);
+ std::string CompTypeUC = UtilityRoutines::makeUPPER(CompType);
// TODO: Refactor this away by passing in enums
DataLoopNode::ConnectionObjectType ParentTypeEnum =
- static_cast(getEnumerationValue(ConnectionObjectTypeNamesUC, ParentTypeUC));
+ static_cast(getEnumValue(ConnectionObjectTypeNamesUC, ParentTypeUC));
assert(ParentTypeEnum != DataLoopNode::ConnectionObjectType::Invalid);
DataLoopNode::ConnectionObjectType ComponentTypeEnum =
- static_cast(getEnumerationValue(ConnectionObjectTypeNamesUC, CompTypeUC));
+ static_cast(getEnumValue(ConnectionObjectTypeNamesUC, CompTypeUC));
assert(ComponentTypeEnum != DataLoopNode::ConnectionObjectType::Invalid);
int Found = 0;
@@ -1957,9 +1957,9 @@ void SetUpCompSets(EnergyPlusData &state,
state.dataBranchNodeConnections->CompSets(state.dataBranchNodeConnections->NumCompSets).ComponentObjectType = ComponentTypeEnum;
state.dataBranchNodeConnections->CompSets(state.dataBranchNodeConnections->NumCompSets).CName = CompName;
state.dataBranchNodeConnections->CompSets(state.dataBranchNodeConnections->NumCompSets).InletNodeName =
- UtilityRoutines::MakeUPPERCase(InletNode); // TODO: Fix this....
+ UtilityRoutines::makeUPPER(InletNode); // TODO: Fix this....
state.dataBranchNodeConnections->CompSets(state.dataBranchNodeConnections->NumCompSets).OutletNodeName =
- UtilityRoutines::MakeUPPERCase(OutletNode); // TODO: Fix this....
+ UtilityRoutines::makeUPPER(OutletNode); // TODO: Fix this....
if (!Description.empty()) {
state.dataBranchNodeConnections->CompSets(state.dataBranchNodeConnections->NumCompSets).Description = Description;
} else {
@@ -2092,10 +2092,10 @@ void TestCompSet(EnergyPlusData &state,
// c) If not found, call SetUpCompSets (with parent type and name UNDEFINED)
// to add a new item in the CompSets array
- std::string CompTypeUC = UtilityRoutines::MakeUPPERCase(CompType);
+ std::string CompTypeUC = UtilityRoutines::makeUPPER(CompType);
// TODO: Refactor this away by passing in enums
DataLoopNode::ConnectionObjectType ComponentTypeEnum =
- static_cast(getEnumerationValue(ConnectionObjectTypeNamesUC, CompTypeUC));
+ static_cast(getEnumValue(ConnectionObjectTypeNamesUC, CompTypeUC));
assert(ComponentTypeEnum != DataLoopNode::ConnectionObjectType::Invalid);
// See if Already there
diff --git a/src/EnergyPlus/CMakeLists.txt b/src/EnergyPlus/CMakeLists.txt
index ad8eea0c1bd..37f61443507 100644
--- a/src/EnergyPlus/CMakeLists.txt
+++ b/src/EnergyPlus/CMakeLists.txt
@@ -14,7 +14,6 @@ set(PYTHON_API_VERSION_MINOR 2)
set(BUILD_PLATFORM_STRING "${SYSTEM_NICKNAME}_${TARGET_ARCH}")
configure_file(DataStringGlobals.in.cc "${CMAKE_CURRENT_BINARY_DIR}/DataStringGlobals.cc")
configure_file(ConfiguredFunctions.in.cc "${CMAKE_CURRENT_BINARY_DIR}/ConfiguredFunctions.cc")
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/EmbeddedEpJSONSchema.cc" "Will be filled in later by GenerateEmbeddedEpJSONSchema")
if(LINK_WITH_PYTHON)
add_compile_definitions(LINK_WITH_PYTHON)
@@ -216,7 +215,6 @@ set(SRC
DataSystemVariables.cc
DataSystemVariables.hh
DataTimings.hh
- DataUCSDSharedData.hh
DataVectorTypes.hh
DataViewFactorInformation.hh
DataWater.hh
@@ -388,8 +386,6 @@ set(SRC
InputProcessing/CsvParser.cc
InputProcessing/CsvParser.hh
InputProcessing/DataStorage.hh
- InputProcessing/EmbeddedEpJSONSchema.hh
- "${CMAKE_CURRENT_BINARY_DIR}/EmbeddedEpJSONSchema.cc"
IOFiles.cc
IOFiles.hh
InputProcessing/IdfParser.cc
@@ -690,8 +686,6 @@ set(INPUTPARSING_SRC
DataStringGlobals.hh
FileSystem.cc
FileSystem.hh
- InputProcessing/EmbeddedEpJSONSchema.hh
- "${CMAKE_CURRENT_BINARY_DIR}/EmbeddedEpJSONSchema.cc"
InputProcessing/IdfParser.cc
InputProcessing/IdfParser.hh
InputProcessing/InputValidation.cc
@@ -700,19 +694,6 @@ set(INPUTPARSING_SRC
create_src_groups("${INPUTPARSING_SRC}")
-add_custom_target(
- GenerateEmbeddedEpJSONSchema
- COMMAND
- ${CMAKE_COMMAND}
- -D "EnergyPlus_SOURCE_DIR:PATH=${CMAKE_CURRENT_SOURCE_DIR}"
- -D "EnergyPlus_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
- -D "EnergyPlus_BINARY_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}"
- -D "EnergyPlus_CURRENT_BINARY_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}"
- -D "EnergyPlus_embeddable_epJSON_schema:PATH=$"
- -P "${PROJECT_SOURCE_DIR}/scripts/dev/generate_embeddable_epJSON_schema/generate_embedded_epJSON_schema.cmake"
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS generate_embeddable_epJSON_schema)
-
add_subdirectory(AirflowNetwork)
if(LINK_WITH_PYTHON)
@@ -747,8 +728,7 @@ if(LINK_WITH_PYTHON)
endif()
add_library(energyplusparser STATIC ${INPUTPARSING_SRC})
-add_dependencies(energyplusparser GenerateEmbeddedEpJSONSchema)
-target_link_libraries(energyplusparser PUBLIC ModernJSON re2 fmt::fmt ${CMAKE_DL_LIBS})
+target_link_libraries(energyplusparser PUBLIC embedded_epjson_source ModernJSON re2 fmt::fmt ${CMAKE_DL_LIBS})
target_link_libraries(energyplusparser PRIVATE project_options project_fp_options project_warnings)
if(WIN32)
target_link_libraries(energyplusparser PUBLIC Shlwapi)
@@ -765,7 +745,8 @@ add_library(energypluslib STATIC ${SRC})
target_link_libraries(
energypluslib
- PUBLIC fmt::fmt
+ PUBLIC embedded_epjson_source
+ fmt::fmt
ModernJSON
objexx
sqlite
@@ -787,7 +768,6 @@ target_link_libraries(energypluslib PRIVATE project_options project_fp_options p
if(OPENGL_FOUND)
target_link_libraries(energypluslib PUBLIC penumbra)
endif()
-add_dependencies(energypluslib GenerateEmbeddedEpJSONSchema)
if(BUILD_GROUND_PLOT)
set_source_files_properties(HeatBalanceKivaManager.cc PROPERTIES COMPILE_DEFINITIONS GROUND_PLOT)
target_link_libraries(energypluslib PUBLIC groundplot)
diff --git a/src/EnergyPlus/CTElectricGenerator.cc b/src/EnergyPlus/CTElectricGenerator.cc
index 10e8a630645..c07b1a2000d 100644
--- a/src/EnergyPlus/CTElectricGenerator.cc
+++ b/src/EnergyPlus/CTElectricGenerator.cc
@@ -316,8 +316,8 @@ namespace CTElectricGenerator {
// Validate fuel type input
state.dataCTElectricGenerator->CTGenerator(genNum).FuelType =
- static_cast(getEnumerationValue(Constant::eResourceNamesUC, AlphArray(11)));
- if (state.dataCTElectricGenerator->CTGenerator(genNum).FuelType == Constant::eResource::Invalid) {
+ static_cast(getEnumValue(Constant::eFuelNamesUC, AlphArray(11)));
+ if (state.dataCTElectricGenerator->CTGenerator(genNum).FuelType == Constant::eFuel::Invalid) {
ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(11), AlphArray(11)));
ShowContinueError(state, format("Entered in {}={}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1)));
ErrorsFound = true;
@@ -358,7 +358,7 @@ namespace CTElectricGenerator {
void CTGeneratorData::setupOutputVars(EnergyPlusData &state)
{
- std::string_view const sFuelType = Constant::eResourceNames[static_cast(this->FuelType)];
+ std::string_view const sFuelType = Constant::eFuelNames[static_cast(this->FuelType)];
SetupOutputVariable(state,
"Generator Produced AC Electricity Rate",
OutputProcessor::Unit::W,
diff --git a/src/EnergyPlus/CTElectricGenerator.hh b/src/EnergyPlus/CTElectricGenerator.hh
index 277bf514e58..8d259dfd3f0 100644
--- a/src/EnergyPlus/CTElectricGenerator.hh
+++ b/src/EnergyPlus/CTElectricGenerator.hh
@@ -74,7 +74,7 @@ namespace CTElectricGenerator {
std::string Name; // user identifier
std::string TypeOf = "Generator:CombustionTurbine"; // Type of Generator
GeneratorType CompType_Num = GeneratorType::CombTurbine;
- Constant::eResource FuelType; // Type of Fuel - DIESEL, GASOLINE, GAS
+ Constant::eFuel FuelType; // Type of Fuel - DIESEL, GASOLINE, GAS
Real64 RatedPowerOutput = 0.0; // W - design nominal capacity of Generator
int ElectricCircuitNode = 0; // Electric Circuit Node
Real64 MinPartLoadRat = 0.0; // (CT MIN) min allowed operating frac full load
diff --git a/src/EnergyPlus/ChilledCeilingPanelSimple.cc b/src/EnergyPlus/ChilledCeilingPanelSimple.cc
index bda31786665..ef41a5cdc6b 100644
--- a/src/EnergyPlus/ChilledCeilingPanelSimple.cc
+++ b/src/EnergyPlus/ChilledCeilingPanelSimple.cc
@@ -132,7 +132,7 @@ void SimCoolingPanel(
if (CompIndex == 0) {
CoolingPanelNum = UtilityRoutines::FindItemInList(EquipName,
state.dataChilledCeilingPanelSimple->CoolingPanel,
- &CoolingPanelParams::EquipID,
+ &CoolingPanelParams::Name,
(int)state.dataChilledCeilingPanelSimple->CoolingPanel.size());
if (CoolingPanelNum == 0) {
ShowFatalError(state, format("SimCoolingPanelSimple: Unit not found={}", EquipName));
@@ -148,12 +148,12 @@ void SimCoolingPanel(
EquipName));
}
if (state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).CheckEquipName) {
- if (EquipName != state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipID) {
+ if (EquipName != state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).Name) {
ShowFatalError(state,
format("SimCoolingPanelSimple: Invalid CompIndex passed={}, Unit name={}, stored Unit Name for that index={}",
CoolingPanelNum,
EquipName,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipID));
+ state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).Name));
}
state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).CheckEquipName = false;
}
@@ -161,7 +161,7 @@ void SimCoolingPanel(
if (CompIndex > 0) {
- auto &ThisCP(state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum));
+ auto &thisCP(state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum));
InitCoolingPanel(state, CoolingPanelNum, ControlledZoneNum, FirstHVACIteration);
@@ -170,21 +170,21 @@ void SimCoolingPanel(
// On the first HVAC iteration the system values are given to the controller, but after that
// the demand limits are in place and there needs to be feedback to the Zone Equipment
if (FirstHVACIteration) {
- MaxWaterFlow = ThisCP.WaterMassFlowRateMax;
+ MaxWaterFlow = thisCP.WaterMassFlowRateMax;
MinWaterFlow = 0.0;
} else {
- MaxWaterFlow = state.dataLoopNodes->Node(ThisCP.WaterInletNode).MassFlowRateMaxAvail;
- MinWaterFlow = state.dataLoopNodes->Node(ThisCP.WaterInletNode).MassFlowRateMinAvail;
+ MaxWaterFlow = state.dataLoopNodes->Node(thisCP.WaterInletNode).MassFlowRateMaxAvail;
+ MinWaterFlow = state.dataLoopNodes->Node(thisCP.WaterInletNode).MassFlowRateMinAvail;
}
- switch (ThisCP.EquipType) {
+ switch (thisCP.EquipType) {
case DataPlant::PlantEquipmentType::CoolingPanel_Simple: { // 'ZoneHVAC:CoolingPanel:RadiantConvective:Water'
- ThisCP.CalcCoolingPanel(state, CoolingPanelNum);
+ thisCP.CalcCoolingPanel(state, CoolingPanelNum);
} break;
default: {
- ShowSevereError(state,
- format("SimCoolingPanelSimple: Errors in CoolingPanel={}",
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipID));
+ ShowSevereError(
+ state,
+ format("SimCoolingPanelSimple: Errors in CoolingPanel={}", state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).Name));
ShowContinueError(
state,
format("Invalid or unimplemented equipment type={}", state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipType));
@@ -192,7 +192,7 @@ void SimCoolingPanel(
} break;
}
- PowerMet = ThisCP.TotPower;
+ PowerMet = thisCP.TotPower;
UpdateCoolingPanel(state, CoolingPanelNum);
@@ -239,10 +239,9 @@ void GetCoolingPanelInput(EnergyPlusData &state)
static constexpr std::string_view VariableOff("VariableOff");
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
- Real64 AllFracsSummed; // Sum of the fractions radiant
- int NumAlphas; // Number of Alphas for each GetobjectItem call
- int NumNumbers; // Number of Numbers for each GetobjectItem call
- int SurfNum; // Surface number Do loop counter
+ int NumAlphas; // Number of Alphas for each GetobjectItem call
+ int NumNumbers; // Number of Numbers for each GetobjectItem call
+ int SurfNum; // Surface number Do loop counter
int IOStat;
bool ErrorsFound(false); // If errors detected in input
int NumCoolingPanels = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCMO_CoolingPanel_Simple);
@@ -273,7 +272,7 @@ void GetCoolingPanelInput(EnergyPlusData &state)
if (CoolingPanelNum > 1) {
for (int CoolPanelNumI = 2; CoolPanelNumI <= NumCoolingPanels; ++CoolPanelNumI) {
- if (state.dataIPShortCut->cAlphaArgs(1) == state.dataChilledCeilingPanelSimple->CoolingPanel(CoolPanelNumI).EquipID) {
+ if (state.dataIPShortCut->cAlphaArgs(1) == state.dataChilledCeilingPanelSimple->CoolingPanel(CoolPanelNumI).Name) {
ErrorsFound = true;
ShowSevereError(state,
format("{} is used as a name for more than one simple COOLING PANEL.", state.dataIPShortCut->cAlphaArgs(1)));
@@ -282,17 +281,17 @@ void GetCoolingPanelInput(EnergyPlusData &state)
}
}
- auto &ThisCP(state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum));
- ThisCP.EquipID = state.dataIPShortCut->cAlphaArgs(1); // Name of this simple cooling panel
- ThisCP.EquipType = DataPlant::PlantEquipmentType::CoolingPanel_Simple; //'ZoneHVAC:CoolingPanel:RadiantConvective:Water'
+ auto &thisCP(state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum));
+ thisCP.Name = state.dataIPShortCut->cAlphaArgs(1); // Name of this simple cooling panel
+ thisCP.EquipType = DataPlant::PlantEquipmentType::CoolingPanel_Simple; //'ZoneHVAC:CoolingPanel:RadiantConvective:Water'
// Get schedule
- ThisCP.Schedule = state.dataIPShortCut->cAlphaArgs(2);
+ thisCP.Schedule = state.dataIPShortCut->cAlphaArgs(2);
if (state.dataIPShortCut->lAlphaFieldBlanks(2)) {
- ThisCP.SchedPtr = ScheduleManager::ScheduleAlwaysOn;
+ thisCP.SchedPtr = ScheduleManager::ScheduleAlwaysOn;
} else {
- ThisCP.SchedPtr = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(2));
- if (ThisCP.SchedPtr == 0) {
+ thisCP.SchedPtr = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(2));
+ if (thisCP.SchedPtr == 0) {
ShowSevereError(state,
format("{}{}=\"{}\", {}=\"{}\" not found.",
RoutineName,
@@ -305,7 +304,7 @@ void GetCoolingPanelInput(EnergyPlusData &state)
}
// Get inlet node number
- ThisCP.WaterInletNode = NodeInputManager::GetOnlySingleNode(state,
+ thisCP.WaterInletNode = NodeInputManager::GetOnlySingleNode(state,
state.dataIPShortCut->cAlphaArgs(3),
ErrorsFound,
DataLoopNode::ConnectionObjectType::ZoneHVACCoolingPanelRadiantConvectiveWater,
@@ -316,7 +315,7 @@ void GetCoolingPanelInput(EnergyPlusData &state)
DataLoopNode::ObjectIsNotParent);
// Get outlet node number
- ThisCP.WaterOutletNode = NodeInputManager::GetOnlySingleNode(state,
+ thisCP.WaterOutletNode = NodeInputManager::GetOnlySingleNode(state,
state.dataIPShortCut->cAlphaArgs(4),
ErrorsFound,
DataLoopNode::ConnectionObjectType::ZoneHVACCoolingPanelRadiantConvectiveWater,
@@ -332,8 +331,8 @@ void GetCoolingPanelInput(EnergyPlusData &state)
state.dataIPShortCut->cAlphaArgs(4),
"Chilled Water Nodes");
- ThisCP.RatedWaterTemp = state.dataIPShortCut->rNumericArgs(1);
- if (ThisCP.RatedWaterTemp > MaxWaterTempAvg + 0.001) {
+ thisCP.RatedWaterTemp = state.dataIPShortCut->rNumericArgs(1);
+ if (thisCP.RatedWaterTemp > MaxWaterTempAvg + 0.001) {
ShowWarningError(state,
format("{}{}=\"{}\", {} was higher than the allowable maximum.",
RoutineName,
@@ -341,8 +340,8 @@ void GetCoolingPanelInput(EnergyPlusData &state)
state.dataIPShortCut->cAlphaArgs(1),
state.dataIPShortCut->cNumericFieldNames(1)));
ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MaxWaterTempAvg));
- ThisCP.RatedWaterTemp = MaxWaterTempAvg;
- } else if (ThisCP.RatedWaterTemp < MinWaterTempAvg - 0.001) {
+ thisCP.RatedWaterTemp = MaxWaterTempAvg;
+ } else if (thisCP.RatedWaterTemp < MinWaterTempAvg - 0.001) {
ShowWarningError(state,
format("{}{}=\"{}\", {} was lower than the allowable minimum.",
RoutineName,
@@ -350,11 +349,11 @@ void GetCoolingPanelInput(EnergyPlusData &state)
state.dataIPShortCut->cAlphaArgs(1),
state.dataIPShortCut->cNumericFieldNames(1)));
ShowContinueError(state, format("...reset to minimum value=[{:.2R}].", MinWaterTempAvg));
- ThisCP.RatedWaterTemp = MinWaterTempAvg;
+ thisCP.RatedWaterTemp = MinWaterTempAvg;
}
- ThisCP.RatedZoneAirTemp = state.dataIPShortCut->rNumericArgs(2);
- if (ThisCP.RatedZoneAirTemp > MaxWaterTempAvg + 0.001) {
+ thisCP.RatedZoneAirTemp = state.dataIPShortCut->rNumericArgs(2);
+ if (thisCP.RatedZoneAirTemp > MaxWaterTempAvg + 0.001) {
ShowWarningError(state,
format("{}{}=\"{}\", {} was higher than the allowable maximum.",
RoutineName,
@@ -362,8 +361,8 @@ void GetCoolingPanelInput(EnergyPlusData &state)
state.dataIPShortCut->cAlphaArgs(1),
state.dataIPShortCut->cNumericFieldNames(2)));
ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MaxWaterTempAvg));
- ThisCP.RatedZoneAirTemp = MaxWaterTempAvg;
- } else if (ThisCP.RatedZoneAirTemp < MinWaterTempAvg - 0.001) {
+ thisCP.RatedZoneAirTemp = MaxWaterTempAvg;
+ } else if (thisCP.RatedZoneAirTemp < MinWaterTempAvg - 0.001) {
ShowWarningError(state,
format("{}{}=\"{}\", {} was lower than the allowable minimum.",
RoutineName,
@@ -371,11 +370,11 @@ void GetCoolingPanelInput(EnergyPlusData &state)
state.dataIPShortCut->cAlphaArgs(1),
state.dataIPShortCut->cNumericFieldNames(2)));
ShowContinueError(state, format("...reset to minimum value=[{:.2R}].", MinWaterTempAvg));
- ThisCP.RatedZoneAirTemp = MinWaterTempAvg;
+ thisCP.RatedZoneAirTemp = MinWaterTempAvg;
}
- ThisCP.RatedWaterFlowRate = state.dataIPShortCut->rNumericArgs(3);
- if (ThisCP.RatedWaterFlowRate < 0.00001 || ThisCP.RatedWaterFlowRate > 10.0) {
+ thisCP.RatedWaterFlowRate = state.dataIPShortCut->rNumericArgs(3);
+ if (thisCP.RatedWaterFlowRate < 0.00001 || thisCP.RatedWaterFlowRate > 10.0) {
ShowWarningError(state,
format("{}{}=\"{}\", {} is an invalid Standard Water mass flow rate.",
RoutineName,
@@ -383,22 +382,22 @@ void GetCoolingPanelInput(EnergyPlusData &state)
state.dataIPShortCut->cAlphaArgs(1),
state.dataIPShortCut->cNumericFieldNames(2)));
ShowContinueError(state, format("...reset to a default value=[{:.1R}].", WaterMassFlowDefault));
- ThisCP.RatedWaterFlowRate = WaterMassFlowDefault;
+ thisCP.RatedWaterFlowRate = WaterMassFlowDefault;
}
if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "CoolingDesignCapacity")) {
- ThisCP.CoolingCapMethod = DataSizing::CoolingDesignCapacity;
+ thisCP.CoolingCapMethod = DataSizing::CoolingDesignCapacity;
if (!state.dataIPShortCut->lNumericFieldBlanks(4)) {
- ThisCP.ScaledCoolingCapacity = state.dataIPShortCut->rNumericArgs(4);
- if (ThisCP.ScaledCoolingCapacity < 0.0 && ThisCP.ScaledCoolingCapacity != DataSizing::AutoSize) {
- ShowSevereError(state, format("{} = {}", cCMO_CoolingPanel_Simple, ThisCP.EquipID));
+ thisCP.ScaledCoolingCapacity = state.dataIPShortCut->rNumericArgs(4);
+ if (thisCP.ScaledCoolingCapacity < 0.0 && thisCP.ScaledCoolingCapacity != DataSizing::AutoSize) {
+ ShowSevereError(state, format("{} = {}", cCMO_CoolingPanel_Simple, thisCP.Name));
ShowContinueError(
state, format("Illegal {} = {:.7T}", state.dataIPShortCut->cNumericFieldNames(4), state.dataIPShortCut->rNumericArgs(4)));
ErrorsFound = true;
}
} else {
if ((!state.dataIPShortCut->lAlphaFieldBlanks(6)) || (!state.dataIPShortCut->lAlphaFieldBlanks(7))) {
- ShowSevereError(state, format("{} = {}", cCMO_CoolingPanel_Simple, ThisCP.EquipID));
+ ShowSevereError(state, format("{} = {}", cCMO_CoolingPanel_Simple, thisCP.Name));
ShowContinueError(state,
format("Input for {} = {}", state.dataIPShortCut->cAlphaFieldNames(5), state.dataIPShortCut->cAlphaArgs(5)));
ShowContinueError(state, format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(4)));
@@ -406,53 +405,53 @@ void GetCoolingPanelInput(EnergyPlusData &state)
}
}
} else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "CapacityPerFloorArea")) {
- ThisCP.CoolingCapMethod = DataSizing::CapacityPerFloorArea;
+ thisCP.CoolingCapMethod = DataSizing::CapacityPerFloorArea;
if (!state.dataIPShortCut->lNumericFieldBlanks(5)) {
- ThisCP.ScaledCoolingCapacity = state.dataIPShortCut->rNumericArgs(5);
- if (ThisCP.ScaledCoolingCapacity < 0.0) {
- ShowSevereError(state, format("{} = {}", cCMO_CoolingPanel_Simple, ThisCP.EquipID));
+ thisCP.ScaledCoolingCapacity = state.dataIPShortCut->rNumericArgs(5);
+ if (thisCP.ScaledCoolingCapacity < 0.0) {
+ ShowSevereError(state, format("{} = {}", cCMO_CoolingPanel_Simple, thisCP.Name));
ShowContinueError(state,
format("Input for {} = {}", state.dataIPShortCut->cAlphaFieldNames(5), state.dataIPShortCut->cAlphaArgs(5)));
ShowContinueError(
state, format("Illegal {} = {:.7T}", state.dataIPShortCut->cNumericFieldNames(5), state.dataIPShortCut->rNumericArgs(5)));
ErrorsFound = true;
- } else if (ThisCP.ScaledCoolingCapacity == DataSizing::AutoSize) {
- ShowSevereError(state, format("{} = {}", cCMO_CoolingPanel_Simple, ThisCP.EquipID));
+ } else if (thisCP.ScaledCoolingCapacity == DataSizing::AutoSize) {
+ ShowSevereError(state, format("{} = {}", cCMO_CoolingPanel_Simple, thisCP.Name));
ShowContinueError(state,
format("Input for {} = {}", state.dataIPShortCut->cAlphaFieldNames(5), state.dataIPShortCut->cAlphaArgs(5)));
ShowContinueError(state, format("Illegal {} = Autosize", state.dataIPShortCut->cNumericFieldNames(5)));
ErrorsFound = true;
}
} else {
- ShowSevereError(state, format("{} = {}", cCMO_CoolingPanel_Simple, ThisCP.EquipID));
+ ShowSevereError(state, format("{} = {}", cCMO_CoolingPanel_Simple, thisCP.Name));
ShowContinueError(state, format("Input for {} = {}", state.dataIPShortCut->cAlphaFieldNames(5), state.dataIPShortCut->cAlphaArgs(5)));
ShowContinueError(state, format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(5)));
ErrorsFound = true;
}
} else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(5), "FractionOfAutosizedCoolingCapacity")) {
- ThisCP.CoolingCapMethod = DataSizing::FractionOfAutosizedCoolingCapacity;
+ thisCP.CoolingCapMethod = DataSizing::FractionOfAutosizedCoolingCapacity;
if (!state.dataIPShortCut->lNumericFieldBlanks(6)) {
- ThisCP.ScaledCoolingCapacity = state.dataIPShortCut->rNumericArgs(6);
- if (ThisCP.ScaledCoolingCapacity < 0.0) {
- ShowSevereError(state, format("{} = {}", cCMO_CoolingPanel_Simple, ThisCP.EquipID));
+ thisCP.ScaledCoolingCapacity = state.dataIPShortCut->rNumericArgs(6);
+ if (thisCP.ScaledCoolingCapacity < 0.0) {
+ ShowSevereError(state, format("{} = {}", cCMO_CoolingPanel_Simple, thisCP.Name));
ShowContinueError(
state, format("Illegal {} = {:.7T}", state.dataIPShortCut->cNumericFieldNames(6), state.dataIPShortCut->rNumericArgs(6)));
ErrorsFound = true;
}
} else {
- ShowSevereError(state, format("{} = {}", cCMO_CoolingPanel_Simple, ThisCP.EquipID));
+ ShowSevereError(state, format("{} = {}", cCMO_CoolingPanel_Simple, thisCP.Name));
ShowContinueError(state, format("Input for {} = {}", state.dataIPShortCut->cAlphaFieldNames(5), state.dataIPShortCut->cAlphaArgs(5)));
ShowContinueError(state, format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(6)));
ErrorsFound = true;
}
} else {
- ShowSevereError(state, format("{} = {}", cCMO_CoolingPanel_Simple, ThisCP.EquipID));
+ ShowSevereError(state, format("{} = {}", cCMO_CoolingPanel_Simple, thisCP.Name));
ShowContinueError(state, format("Illegal {} = {}", state.dataIPShortCut->cAlphaFieldNames(5), state.dataIPShortCut->cAlphaArgs(5)));
ErrorsFound = true;
}
- ThisCP.WaterVolFlowRateMax = state.dataIPShortCut->rNumericArgs(7);
- if ((ThisCP.WaterVolFlowRateMax <= MinWaterFlowRate) && ThisCP.WaterVolFlowRateMax != DataSizing::AutoSize) {
+ thisCP.WaterVolFlowRateMax = state.dataIPShortCut->rNumericArgs(7);
+ if ((thisCP.WaterVolFlowRateMax <= MinWaterFlowRate) && thisCP.WaterVolFlowRateMax != DataSizing::AutoSize) {
ShowWarningError(state,
format("{}{}=\"{}\", {} was less than the allowable minimum.",
RoutineName,
@@ -460,8 +459,8 @@ void GetCoolingPanelInput(EnergyPlusData &state)
state.dataIPShortCut->cAlphaArgs(1),
state.dataIPShortCut->cNumericFieldNames(7)));
ShowContinueError(state, format("...reset to minimum value=[{:.2R}].", MinWaterFlowRate));
- ThisCP.WaterVolFlowRateMax = MinWaterFlowRate;
- } else if (ThisCP.WaterVolFlowRateMax > MaxWaterFlowRate) {
+ thisCP.WaterVolFlowRateMax = MinWaterFlowRate;
+ } else if (thisCP.WaterVolFlowRateMax > MaxWaterFlowRate) {
ShowWarningError(state,
format("{}{}=\"{}\", {} was higher than the allowable maximum.",
RoutineName,
@@ -469,60 +468,60 @@ void GetCoolingPanelInput(EnergyPlusData &state)
state.dataIPShortCut->cAlphaArgs(1),
state.dataIPShortCut->cNumericFieldNames(7)));
ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MaxWaterFlowRate));
- ThisCP.WaterVolFlowRateMax = MaxWaterFlowRate;
+ thisCP.WaterVolFlowRateMax = MaxWaterFlowRate;
}
// Process the temperature control type
if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), MeanAirTemperature)) {
- ThisCP.controlType = ClgPanelCtrlType::MAT;
+ thisCP.controlType = ClgPanelCtrlType::MAT;
} else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), MeanRadiantTemperature)) {
- ThisCP.controlType = ClgPanelCtrlType::MRT;
+ thisCP.controlType = ClgPanelCtrlType::MRT;
} else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), OperativeTemperature)) {
- ThisCP.controlType = ClgPanelCtrlType::Operative;
+ thisCP.controlType = ClgPanelCtrlType::Operative;
} else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), OutsideAirDryBulbTemperature)) {
- ThisCP.controlType = ClgPanelCtrlType::ODB;
+ thisCP.controlType = ClgPanelCtrlType::ODB;
} else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), OutsideAirWetBulbTemperature)) {
- ThisCP.controlType = ClgPanelCtrlType::OWB;
+ thisCP.controlType = ClgPanelCtrlType::OWB;
} else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), ZoneTotalLoad)) {
- ThisCP.controlType = ClgPanelCtrlType::ZoneTotalLoad;
+ thisCP.controlType = ClgPanelCtrlType::ZoneTotalLoad;
} else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), ZoneConvectiveLoad)) {
- ThisCP.controlType = ClgPanelCtrlType::ZoneConvectiveLoad;
+ thisCP.controlType = ClgPanelCtrlType::ZoneConvectiveLoad;
} else {
ShowWarningError(state, format("Invalid {} ={}", state.dataIPShortCut->cAlphaFieldNames(6), state.dataIPShortCut->cAlphaArgs(6)));
ShowContinueError(state, format("Occurs in {} = {}", RoutineName, state.dataIPShortCut->cAlphaArgs(1)));
ShowContinueError(state, "Control reset to MAT control for this Simple Cooling Panel.");
- ThisCP.controlType = ClgPanelCtrlType::MAT;
+ thisCP.controlType = ClgPanelCtrlType::MAT;
}
- ThisCP.ColdThrottlRange = state.dataIPShortCut->rNumericArgs(8);
- if (ThisCP.ColdThrottlRange < MinThrottlingRange) {
+ thisCP.ColdThrottlRange = state.dataIPShortCut->rNumericArgs(8);
+ if (thisCP.ColdThrottlRange < MinThrottlingRange) {
ShowWarningError(state, format("{}Cooling throttling range too small, reset to 0.5", cCMO_CoolingPanel_Simple));
- ShowContinueError(state, format("Occurs in Cooling Panel={}", ThisCP.EquipID));
- ThisCP.ColdThrottlRange = MinThrottlingRange;
+ ShowContinueError(state, format("Occurs in Cooling Panel={}", thisCP.Name));
+ thisCP.ColdThrottlRange = MinThrottlingRange;
}
- ThisCP.ColdSetptSched = state.dataIPShortCut->cAlphaArgs(7);
- ThisCP.ColdSetptSchedPtr = ScheduleManager::GetScheduleIndex(state, ThisCP.ColdSetptSched);
- if ((ThisCP.ColdSetptSchedPtr == 0) && (!state.dataIPShortCut->lAlphaFieldBlanks(7))) {
- ShowSevereError(state, format("{} not found: {}", state.dataIPShortCut->cAlphaFieldNames(7), ThisCP.ColdSetptSched));
+ thisCP.ColdSetptSched = state.dataIPShortCut->cAlphaArgs(7);
+ thisCP.ColdSetptSchedPtr = ScheduleManager::GetScheduleIndex(state, thisCP.ColdSetptSched);
+ if ((thisCP.ColdSetptSchedPtr == 0) && (!state.dataIPShortCut->lAlphaFieldBlanks(7))) {
+ ShowSevereError(state, format("{} not found: {}", state.dataIPShortCut->cAlphaFieldNames(7), thisCP.ColdSetptSched));
ShowContinueError(state, format("Occurs in {} = {}", RoutineName, state.dataIPShortCut->cAlphaArgs(1)));
ErrorsFound = true;
}
if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(8), Off)) {
- ThisCP.CondCtrlType = CondCtrl::NONE;
+ thisCP.CondCtrlType = CondCtrl::NONE;
} else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(8), SimpleOff)) {
- ThisCP.CondCtrlType = CondCtrl::SIMPLEOFF;
+ thisCP.CondCtrlType = CondCtrl::SIMPLEOFF;
} else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(8), VariableOff)) {
- ThisCP.CondCtrlType = CondCtrl::VARIEDOFF;
+ thisCP.CondCtrlType = CondCtrl::VARIEDOFF;
} else {
- ThisCP.CondCtrlType = CondCtrl::SIMPLEOFF;
+ thisCP.CondCtrlType = CondCtrl::SIMPLEOFF;
}
- ThisCP.CondDewPtDeltaT = state.dataIPShortCut->rNumericArgs(9);
+ thisCP.CondDewPtDeltaT = state.dataIPShortCut->rNumericArgs(9);
- ThisCP.FracRadiant = state.dataIPShortCut->rNumericArgs(10);
- if (ThisCP.FracRadiant < MinFraction) {
+ thisCP.FracRadiant = state.dataIPShortCut->rNumericArgs(10);
+ if (thisCP.FracRadiant < MinFraction) {
ShowWarningError(state,
format("{}{}=\"{}\", {} was lower than the allowable minimum.",
RoutineName,
@@ -530,9 +529,9 @@ void GetCoolingPanelInput(EnergyPlusData &state)
state.dataIPShortCut->cAlphaArgs(1),
state.dataIPShortCut->cNumericFieldNames(10)));
ShowContinueError(state, format("...reset to minimum value=[{:.2R}].", MinFraction));
- ThisCP.FracRadiant = MinFraction;
+ thisCP.FracRadiant = MinFraction;
}
- if (ThisCP.FracRadiant > MaxFraction) {
+ if (thisCP.FracRadiant > MaxFraction) {
ShowWarningError(state,
format("{}{}=\"{}\", {} was higher than the allowable maximum.",
RoutineName,
@@ -540,25 +539,24 @@ void GetCoolingPanelInput(EnergyPlusData &state)
state.dataIPShortCut->cAlphaArgs(1),
state.dataIPShortCut->cNumericFieldNames(10)));
ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MaxFraction));
- ThisCP.FracRadiant = MaxFraction;
+ thisCP.FracRadiant = MaxFraction;
}
// Remaining fraction is added to the zone as convective heat transfer
- AllFracsSummed = ThisCP.FracRadiant;
- if (AllFracsSummed > MaxFraction) {
+ if (thisCP.FracRadiant > MaxFraction) {
ShowWarningError(state,
format("{}{}=\"{}\", Fraction Radiant was higher than the allowable maximum.",
RoutineName,
cCMO_CoolingPanel_Simple,
state.dataIPShortCut->cAlphaArgs(1)));
- ThisCP.FracRadiant = MaxFraction;
- ThisCP.FracConvect = 0.0;
+ thisCP.FracRadiant = MaxFraction;
+ thisCP.FracConvect = 0.0;
} else {
- ThisCP.FracConvect = 1.0 - AllFracsSummed;
+ thisCP.FracConvect = 1.0 - thisCP.FracRadiant;
}
- ThisCP.FracDistribPerson = state.dataIPShortCut->rNumericArgs(11);
- if (ThisCP.FracDistribPerson < MinFraction) {
+ thisCP.FracDistribPerson = state.dataIPShortCut->rNumericArgs(11);
+ if (thisCP.FracDistribPerson < MinFraction) {
ShowWarningError(state,
format("{}{}=\"{}\", {} was lower than the allowable minimum.",
RoutineName,
@@ -566,9 +564,9 @@ void GetCoolingPanelInput(EnergyPlusData &state)
state.dataIPShortCut->cAlphaArgs(1),
state.dataIPShortCut->cNumericFieldNames(11)));
ShowContinueError(state, format("...reset to minimum value=[{:.3R}].", MinFraction));
- ThisCP.FracDistribPerson = MinFraction;
+ thisCP.FracDistribPerson = MinFraction;
}
- if (ThisCP.FracDistribPerson > MaxFraction) {
+ if (thisCP.FracDistribPerson > MaxFraction) {
ShowWarningError(state,
format("{}{}=\"{}\", {} was higher than the allowable maximum.",
RoutineName,
@@ -576,11 +574,11 @@ void GetCoolingPanelInput(EnergyPlusData &state)
state.dataIPShortCut->cAlphaArgs(1),
state.dataIPShortCut->cNumericFieldNames(11)));
ShowContinueError(state, format("...reset to maximum value=[{:.3R}].", MaxFraction));
- ThisCP.FracDistribPerson = MaxFraction;
+ thisCP.FracDistribPerson = MaxFraction;
}
- ThisCP.TotSurfToDistrib = NumNumbers - 11;
- if ((ThisCP.TotSurfToDistrib < MinDistribSurfaces) && (ThisCP.FracRadiant > MinFraction)) {
+ thisCP.TotSurfToDistrib = NumNumbers - 11;
+ if ((thisCP.TotSurfToDistrib < MinDistribSurfaces) && (thisCP.FracRadiant > MinFraction)) {
ShowSevereError(state,
format("{}{}=\"{}\", the number of surface/radiant fraction groups entered was less than the allowable minimum.",
RoutineName,
@@ -588,39 +586,38 @@ void GetCoolingPanelInput(EnergyPlusData &state)
state.dataIPShortCut->cAlphaArgs(1)));
ShowContinueError(state, format("...the minimum that must be entered=[{}].", MinDistribSurfaces));
ErrorsFound = true;
- ThisCP.TotSurfToDistrib = 0; // error
+ thisCP.TotSurfToDistrib = 0; // error
}
- ThisCP.SurfaceName.allocate(ThisCP.TotSurfToDistrib);
- ThisCP.SurfaceName = "";
- ThisCP.SurfacePtr.allocate(ThisCP.TotSurfToDistrib);
- ThisCP.SurfacePtr = 0;
- ThisCP.FracDistribToSurf.allocate(ThisCP.TotSurfToDistrib);
- ThisCP.FracDistribToSurf = 0.0;
+ thisCP.SurfaceName.allocate(thisCP.TotSurfToDistrib);
+ thisCP.SurfaceName = "";
+ thisCP.SurfacePtr.allocate(thisCP.TotSurfToDistrib);
+ thisCP.SurfacePtr = 0;
+ thisCP.FracDistribToSurf.allocate(thisCP.TotSurfToDistrib);
+ thisCP.FracDistribToSurf = 0.0;
// search zone equipment list structure for zone index
for (int ctrlZone = 1; ctrlZone <= state.dataGlobal->NumOfZones; ++ctrlZone) {
for (int zoneEquipTypeNum = 1; zoneEquipTypeNum <= state.dataZoneEquip->ZoneEquipList(ctrlZone).NumOfEquipTypes; ++zoneEquipTypeNum) {
- if (state.dataZoneEquip->ZoneEquipList(ctrlZone).EquipTypeEnum(zoneEquipTypeNum) == DataZoneEquipment::ZoneEquip::CoolingPanel &&
- state.dataZoneEquip->ZoneEquipList(ctrlZone).EquipName(zoneEquipTypeNum) == ThisCP.EquipID) {
- ThisCP.ZonePtr = ctrlZone;
+ if (state.dataZoneEquip->ZoneEquipList(ctrlZone).EquipType(zoneEquipTypeNum) == DataZoneEquipment::ZoneEquipType::CoolingPanel &&
+ state.dataZoneEquip->ZoneEquipList(ctrlZone).EquipName(zoneEquipTypeNum) == thisCP.Name) {
+ thisCP.ZonePtr = ctrlZone;
}
}
}
- if (ThisCP.ZonePtr <= 0) {
- ShowSevereError(state,
- format("{}{}=\"{}\" is not on any ZoneHVAC:EquipmentList.", RoutineName, cCMO_CoolingPanel_Simple, ThisCP.EquipID));
+ if (thisCP.ZonePtr <= 0) {
+ ShowSevereError(state, format("{}{}=\"{}\" is not on any ZoneHVAC:EquipmentList.", RoutineName, cCMO_CoolingPanel_Simple, thisCP.Name));
ErrorsFound = true;
continue;
}
- AllFracsSummed = ThisCP.FracDistribPerson;
- for (SurfNum = 1; SurfNum <= ThisCP.TotSurfToDistrib; ++SurfNum) {
- ThisCP.SurfaceName(SurfNum) = state.dataIPShortCut->cAlphaArgs(SurfNum + 8);
- ThisCP.SurfacePtr(SurfNum) = HeatBalanceIntRadExchange::GetRadiantSystemSurface(
- state, cCMO_CoolingPanel_Simple, ThisCP.EquipID, ThisCP.ZonePtr, ThisCP.SurfaceName(SurfNum), ErrorsFound);
- ThisCP.FracDistribToSurf(SurfNum) = state.dataIPShortCut->rNumericArgs(SurfNum + 11);
- if (ThisCP.FracDistribToSurf(SurfNum) > MaxFraction) {
+ Real64 AllFracsSummed = thisCP.FracDistribPerson;
+ for (SurfNum = 1; SurfNum <= thisCP.TotSurfToDistrib; ++SurfNum) {
+ thisCP.SurfaceName(SurfNum) = state.dataIPShortCut->cAlphaArgs(SurfNum + 8);
+ thisCP.SurfacePtr(SurfNum) = HeatBalanceIntRadExchange::GetRadiantSystemSurface(
+ state, cCMO_CoolingPanel_Simple, thisCP.Name, thisCP.ZonePtr, thisCP.SurfaceName(SurfNum), ErrorsFound);
+ thisCP.FracDistribToSurf(SurfNum) = state.dataIPShortCut->rNumericArgs(SurfNum + 11);
+ if (thisCP.FracDistribToSurf(SurfNum) > MaxFraction) {
ShowWarningError(state,
format("{}{}=\"{}\", {}was greater than the allowable maximum.",
RoutineName,
@@ -628,9 +625,9 @@ void GetCoolingPanelInput(EnergyPlusData &state)
state.dataIPShortCut->cAlphaArgs(1),
state.dataIPShortCut->cNumericFieldNames(SurfNum + 8)));
ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MaxFraction));
- ThisCP.TotSurfToDistrib = MaxFraction;
+ thisCP.TotSurfToDistrib = MaxFraction;
}
- if (ThisCP.FracDistribToSurf(SurfNum) < MinFraction) {
+ if (thisCP.FracDistribToSurf(SurfNum) < MinFraction) {
ShowWarningError(state,
format("{}{}=\"{}\", {}was less than the allowable minimum.",
RoutineName,
@@ -638,13 +635,13 @@ void GetCoolingPanelInput(EnergyPlusData &state)
state.dataIPShortCut->cAlphaArgs(1),
state.dataIPShortCut->cNumericFieldNames(SurfNum + 8)));
ShowContinueError(state, format("...reset to maximum value=[{:.2R}].", MinFraction));
- ThisCP.TotSurfToDistrib = MinFraction;
+ thisCP.TotSurfToDistrib = MinFraction;
}
- if (ThisCP.SurfacePtr(SurfNum) != 0) {
- state.dataSurface->SurfIntConvSurfGetsRadiantHeat(ThisCP.SurfacePtr(SurfNum)) = true;
+ if (thisCP.SurfacePtr(SurfNum) != 0) {
+ state.dataSurface->surfIntConv(thisCP.SurfacePtr(SurfNum)).getsRadiantHeat = true;
}
- AllFracsSummed += ThisCP.FracDistribToSurf(SurfNum);
+ AllFracsSummed += thisCP.FracDistribToSurf(SurfNum);
} // Surfaces
if (AllFracsSummed > (MaxFraction + 0.01)) {
@@ -656,15 +653,15 @@ void GetCoolingPanelInput(EnergyPlusData &state)
ErrorsFound = true;
}
if ((AllFracsSummed < (MaxFraction - 0.01)) &&
- (ThisCP.FracRadiant > MinFraction)) { // User didn't distribute all of the | radiation warn that some will be lost
+ (thisCP.FracRadiant > MinFraction)) { // User didn't distribute all of the | radiation warn that some will be lost
ShowSevereError(state,
format("{}{}=\"{}\", Summed radiant fractions for people + surface groups < 1.0",
RoutineName,
cCMO_CoolingPanel_Simple,
state.dataIPShortCut->cAlphaArgs(1)));
ShowContinueError(state, "This would result in some of the radiant energy delivered by the high temp radiant heater being lost.");
- ShowContinueError(state, format("The sum of all radiation fractions to surfaces = {:.5T}", (AllFracsSummed - ThisCP.FracDistribPerson)));
- ShowContinueError(state, format("The radiant fraction to people = {:.5T}", ThisCP.FracDistribPerson));
+ ShowContinueError(state, format("The sum of all radiation fractions to surfaces = {:.5T}", (AllFracsSummed - thisCP.FracDistribPerson)));
+ ShowContinueError(state, format("The radiant fraction to people = {:.5T}", thisCP.FracDistribPerson));
ShowContinueError(state, format("So, all radiant fractions including surfaces and people = {:.5T}", AllFracsSummed));
ShowContinueError(state,
format("This means that the fraction of radiant energy that would be lost from the high temperature radiant heater "
@@ -685,42 +682,43 @@ void GetCoolingPanelInput(EnergyPlusData &state)
// Setup Report variables for the Coils
for (int CoolingPanelNum = 1; CoolingPanelNum <= NumCoolingPanels; ++CoolingPanelNum) {
// CurrentModuleObject='ZoneHVAC:CoolingPanel:RadiantConvective:Water'
+ auto &thisCP = state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum);
SetupOutputVariable(state,
"Cooling Panel Total Cooling Rate",
OutputProcessor::Unit::W,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).Power,
+ thisCP.Power,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipID);
+ thisCP.Name);
SetupOutputVariable(state,
"Cooling Panel Total System Cooling Rate",
OutputProcessor::Unit::W,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).TotPower,
+ thisCP.TotPower,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipID);
+ thisCP.Name);
SetupOutputVariable(state,
"Cooling Panel Convective Cooling Rate",
OutputProcessor::Unit::W,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).ConvPower,
+ thisCP.ConvPower,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipID);
+ thisCP.Name);
SetupOutputVariable(state,
"Cooling Panel Radiant Cooling Rate",
OutputProcessor::Unit::W,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).RadPower,
+ thisCP.RadPower,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipID);
+ thisCP.Name);
SetupOutputVariable(state,
"Cooling Panel Total Cooling Energy",
OutputProcessor::Unit::J,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).Energy,
+ thisCP.Energy,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Summed,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipID,
+ thisCP.Name,
{},
"ENERGYTRANSFER",
"COOLINGPANEL",
@@ -729,10 +727,10 @@ void GetCoolingPanelInput(EnergyPlusData &state)
SetupOutputVariable(state,
"Cooling Panel Total System Cooling Energy",
OutputProcessor::Unit::J,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).TotEnergy,
+ thisCP.TotEnergy,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Summed,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipID,
+ thisCP.Name,
{},
"ENERGYTRANSFER",
"COOLINGPANEL",
@@ -741,39 +739,39 @@ void GetCoolingPanelInput(EnergyPlusData &state)
SetupOutputVariable(state,
"Cooling Panel Convective Cooling Energy",
OutputProcessor::Unit::J,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).ConvEnergy,
+ thisCP.ConvEnergy,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Summed,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipID);
+ thisCP.Name);
SetupOutputVariable(state,
"Cooling Panel Radiant Cooling Energy",
OutputProcessor::Unit::J,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).RadEnergy,
+ thisCP.RadEnergy,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Summed,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipID);
+ thisCP.Name);
SetupOutputVariable(state,
"Cooling Panel Water Mass Flow Rate",
OutputProcessor::Unit::kg_s,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).WaterMassFlowRate,
+ thisCP.WaterMassFlowRate,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipID);
+ thisCP.Name);
SetupOutputVariable(state,
"Cooling Panel Water Inlet Temperature",
OutputProcessor::Unit::C,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).WaterInletTemp,
+ thisCP.WaterInletTemp,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipID);
+ thisCP.Name);
SetupOutputVariable(state,
"Cooling Panel Water Outlet Temperature",
OutputProcessor::Unit::C,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).WaterOutletTemp,
+ thisCP.WaterOutletTemp,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
- state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum).EquipID);
+ thisCP.Name);
}
}
@@ -800,72 +798,72 @@ void InitCoolingPanel(EnergyPlusData &state, int const CoolingPanelNum, int cons
Real64 rho; // local fluid density
Real64 Cp; // local fluid specific heat
- auto &ThisCP(state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum));
- auto &ThisInNode(state.dataLoopNodes->Node(ThisCP.WaterInletNode));
+ auto &thisCP = state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum);
+ auto &ThisInNode = state.dataLoopNodes->Node(thisCP.WaterInletNode);
- if (ThisCP.ZonePtr <= 0) ThisCP.ZonePtr = ControlledZoneNum;
+ if (thisCP.ZonePtr <= 0) thisCP.ZonePtr = ControlledZoneNum;
// Need to check all units to see if they are on ZoneHVAC:EquipmentList or issue warning
- if (!ThisCP.ZoneEquipmentListChecked && state.dataZoneEquip->ZoneEquipInputsFilled) {
- ThisCP.ZoneEquipmentListChecked = true;
- if (!DataZoneEquipment::CheckZoneEquipmentList(state, cCMO_CoolingPanel_Simple, ThisCP.EquipID)) {
+ if (!thisCP.ZoneEquipmentListChecked && state.dataZoneEquip->ZoneEquipInputsFilled) {
+ thisCP.ZoneEquipmentListChecked = true;
+ if (!DataZoneEquipment::CheckZoneEquipmentList(state, cCMO_CoolingPanel_Simple, thisCP.Name)) {
ShowSevereError(state,
format("InitCoolingPanel: Unit=[{},{}] is not on any ZoneHVAC:EquipmentList. It will not be simulated.",
cCMO_CoolingPanel_Simple,
- ThisCP.EquipID));
+ thisCP.Name));
}
}
- if (ThisCP.SetLoopIndexFlag) {
+ if (thisCP.SetLoopIndexFlag) {
if (allocated(state.dataPlnt->PlantLoop)) {
bool errFlag = false;
- PlantUtilities::ScanPlantLoopsForObject(state, ThisCP.EquipID, ThisCP.EquipType, ThisCP.plantLoc, errFlag, _, _, _, _, _);
+ PlantUtilities::ScanPlantLoopsForObject(state, thisCP.Name, thisCP.EquipType, thisCP.plantLoc, errFlag, _, _, _, _, _);
if (errFlag) {
ShowFatalError(state, "InitCoolingPanel: Program terminated for previous conditions.");
}
- ThisCP.SetLoopIndexFlag = false;
+ thisCP.SetLoopIndexFlag = false;
}
}
if (!state.dataGlobal->SysSizingCalc) {
- if (ThisCP.MySizeFlagCoolPanel && !ThisCP.SetLoopIndexFlag) {
+ if (thisCP.MySizeFlagCoolPanel && !thisCP.SetLoopIndexFlag) {
// for each cooling panel do the sizing once.
SizeCoolingPanel(state, CoolingPanelNum);
- ThisCP.MySizeFlagCoolPanel = false;
+ thisCP.MySizeFlagCoolPanel = false;
// set design mass flow rates
- if (ThisCP.WaterInletNode > 0) {
+ if (thisCP.WaterInletNode > 0) {
rho = FluidProperties::GetDensityGlycol(state,
- state.dataPlnt->PlantLoop(ThisCP.plantLoc.loopNum).FluidName,
+ state.dataPlnt->PlantLoop(thisCP.plantLoc.loopNum).FluidName,
Constant::CWInitConvTemp,
- state.dataPlnt->PlantLoop(ThisCP.plantLoc.loopNum).FluidIndex,
+ state.dataPlnt->PlantLoop(thisCP.plantLoc.loopNum).FluidIndex,
RoutineName);
- ThisCP.WaterMassFlowRateMax = rho * ThisCP.WaterVolFlowRateMax;
- PlantUtilities::InitComponentNodes(state, 0.0, ThisCP.WaterMassFlowRateMax, ThisCP.WaterInletNode, ThisCP.WaterOutletNode);
+ thisCP.WaterMassFlowRateMax = rho * thisCP.WaterVolFlowRateMax;
+ PlantUtilities::InitComponentNodes(state, 0.0, thisCP.WaterMassFlowRateMax, thisCP.WaterInletNode, thisCP.WaterOutletNode);
}
}
}
// Do the Begin Environment initializations
- if (state.dataGlobal->BeginEnvrnFlag && ThisCP.MyEnvrnFlag) {
+ if (state.dataGlobal->BeginEnvrnFlag && thisCP.MyEnvrnFlag) {
// Initialize
rho = FluidProperties::GetDensityGlycol(state,
- state.dataPlnt->PlantLoop(ThisCP.plantLoc.loopNum).FluidName,
+ state.dataPlnt->PlantLoop(thisCP.plantLoc.loopNum).FluidName,
Constant::InitConvTemp,
- state.dataPlnt->PlantLoop(ThisCP.plantLoc.loopNum).FluidIndex,
+ state.dataPlnt->PlantLoop(thisCP.plantLoc.loopNum).FluidIndex,
RoutineName);
- ThisCP.WaterMassFlowRateMax = rho * ThisCP.WaterVolFlowRateMax;
+ thisCP.WaterMassFlowRateMax = rho * thisCP.WaterVolFlowRateMax;
- PlantUtilities::InitComponentNodes(state, 0.0, ThisCP.WaterMassFlowRateMax, ThisCP.WaterInletNode, ThisCP.WaterOutletNode);
+ PlantUtilities::InitComponentNodes(state, 0.0, thisCP.WaterMassFlowRateMax, thisCP.WaterInletNode, thisCP.WaterOutletNode);
ThisInNode.Temp = 7.0;
Cp = FluidProperties::GetSpecificHeatGlycol(state,
- state.dataPlnt->PlantLoop(ThisCP.plantLoc.loopNum).FluidName,
+ state.dataPlnt->PlantLoop(thisCP.plantLoc.loopNum).FluidName,
ThisInNode.Temp,
- state.dataPlnt->PlantLoop(ThisCP.plantLoc.loopNum).FluidIndex,
+ state.dataPlnt->PlantLoop(thisCP.plantLoc.loopNum).FluidIndex,
RoutineName);
ThisInNode.Enthalpy = Cp * ThisInNode.Temp;
@@ -873,41 +871,41 @@ void InitCoolingPanel(EnergyPlusData &state, int const CoolingPanelNum, int cons
ThisInNode.Press = 0.0;
ThisInNode.HumRat = 0.0;
- ThisCP.ZeroSourceSumHATsurf = 0.0;
- ThisCP.CoolingPanelSource = 0.0;
- ThisCP.CoolingPanelSrcAvg = 0.0;
- ThisCP.LastCoolingPanelSrc = 0.0;
- ThisCP.LastSysTimeElapsed = 0.0;
- ThisCP.LastTimeStepSys = 0.0;
+ thisCP.ZeroSourceSumHATsurf = 0.0;
+ thisCP.CoolingPanelSource = 0.0;
+ thisCP.CoolingPanelSrcAvg = 0.0;
+ thisCP.LastCoolingPanelSrc = 0.0;
+ thisCP.LastSysTimeElapsed = 0.0;
+ thisCP.LastTimeStepSys = 0.0;
- ThisCP.MyEnvrnFlag = false;
+ thisCP.MyEnvrnFlag = false;
}
if (!state.dataGlobal->BeginEnvrnFlag) {
- ThisCP.MyEnvrnFlag = true;
+ thisCP.MyEnvrnFlag = true;
}
if (state.dataGlobal->BeginTimeStepFlag && FirstHVACIteration) {
- int ZoneNum = ThisCP.ZonePtr;
+ int ZoneNum = thisCP.ZonePtr;
state.dataHeatBal->Zone(ZoneNum).ZeroSourceSumHATsurf = state.dataHeatBal->Zone(ZoneNum).sumHATsurf(state);
- ThisCP.CoolingPanelSrcAvg = 0.0;
- ThisCP.LastCoolingPanelSrc = 0.0;
- ThisCP.LastSysTimeElapsed = 0.0;
- ThisCP.LastTimeStepSys = 0.0;
+ thisCP.CoolingPanelSrcAvg = 0.0;
+ thisCP.LastCoolingPanelSrc = 0.0;
+ thisCP.LastSysTimeElapsed = 0.0;
+ thisCP.LastTimeStepSys = 0.0;
}
// Do the every time step initializations
- ThisCP.WaterMassFlowRate = ThisInNode.MassFlowRate;
- ThisCP.WaterInletTemp = ThisInNode.Temp;
- ThisCP.WaterInletEnthalpy = ThisInNode.Enthalpy;
- ThisCP.TotPower = 0.0;
- ThisCP.Power = 0.0;
- ThisCP.ConvPower = 0.0;
- ThisCP.RadPower = 0.0;
- ThisCP.TotEnergy = 0.0;
- ThisCP.Energy = 0.0;
- ThisCP.ConvEnergy = 0.0;
- ThisCP.RadEnergy = 0.0;
+ thisCP.WaterMassFlowRate = ThisInNode.MassFlowRate;
+ thisCP.WaterInletTemp = ThisInNode.Temp;
+ thisCP.WaterInletEnthalpy = ThisInNode.Enthalpy;
+ thisCP.TotPower = 0.0;
+ thisCP.Power = 0.0;
+ thisCP.ConvPower = 0.0;
+ thisCP.RadPower = 0.0;
+ thisCP.TotEnergy = 0.0;
+ thisCP.Energy = 0.0;
+ thisCP.ConvEnergy = 0.0;
+ thisCP.RadEnergy = 0.0;
}
void SizeCoolingPanel(EnergyPlusData &state, int const CoolingPanelNum)
@@ -926,8 +924,6 @@ void SizeCoolingPanel(EnergyPlusData &state, int const CoolingPanelNum)
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
bool ErrorsFound(false); // If errors detected in input
- std::string CompName; // component name
- std::string CompType; // component type
bool IsAutoSize(false); // Indicator to autosize
Real64 DesCoilLoad; // design autosized or user specified capacity
Real64 TempSize; // autosized value of coil input field
@@ -939,13 +935,13 @@ void SizeCoolingPanel(EnergyPlusData &state, int const CoolingPanelNum)
DesCoilLoad = 0.0;
state.dataSize->DataScalableCapSizingON = false;
- auto &ThisCP(state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum));
+ auto &thisCP(state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum));
- CompType = "ZoneHVAC:CoolingPanel:RadiantConvective:Water";
- CompName = ThisCP.EquipID;
+ std::string_view const CompType = "ZoneHVAC:CoolingPanel:RadiantConvective:Water";
+ std::string_view const CompName = thisCP.Name;
IsAutoSize = false;
- if (ThisCP.ScaledCoolingCapacity == DataSizing::AutoSize) {
+ if (thisCP.ScaledCoolingCapacity == DataSizing::AutoSize) {
IsAutoSize = true;
}
@@ -955,25 +951,25 @@ void SizeCoolingPanel(EnergyPlusData &state, int const CoolingPanelNum)
int SizingMethod = DataHVACGlobals::CoolingCapacitySizing;
bool PrintFlag = true; // TRUE when sizing information is reported in the eio file
bool errorsFound = false;
- int CapSizingMethod = ThisCP.CoolingCapMethod;
+ int CapSizingMethod = thisCP.CoolingCapMethod;
zoneEqSizing.SizingMethod(SizingMethod) = CapSizingMethod;
if (!IsAutoSize && !state.dataSize->ZoneSizingRunDone) { // simulation continue
- if (CapSizingMethod == DataSizing::CoolingDesignCapacity && ThisCP.ScaledCoolingCapacity > 0.0) {
- TempSize = ThisCP.ScaledCoolingCapacity;
+ if (CapSizingMethod == DataSizing::CoolingDesignCapacity && thisCP.ScaledCoolingCapacity > 0.0) {
+ TempSize = thisCP.ScaledCoolingCapacity;
CoolingCapacitySizer sizerCoolingCapacity;
sizerCoolingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName);
DesCoilLoad = sizerCoolingCapacity.size(state, TempSize, errorsFound);
} else if (CapSizingMethod == DataSizing::CapacityPerFloorArea) {
state.dataSize->DataScalableCapSizingON = true;
- TempSize = ThisCP.ScaledCoolingCapacity * state.dataHeatBal->Zone(ThisCP.ZonePtr).FloorArea;
+ TempSize = thisCP.ScaledCoolingCapacity * state.dataHeatBal->Zone(thisCP.ZonePtr).FloorArea;
CoolingCapacitySizer sizerCoolingCapacity;
sizerCoolingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName);
DesCoilLoad = sizerCoolingCapacity.size(state, TempSize, errorsFound);
state.dataSize->DataScalableCapSizingON = false;
} else if (CapSizingMethod == DataSizing::FractionOfAutosizedCoolingCapacity) {
- if (ThisCP.WaterVolFlowRateMax == DataSizing::AutoSize) {
- ShowSevereError(state, format("{}: auto-sizing cannot be done for {} = {}\".", RoutineName, CompType, ThisCP.EquipID));
+ if (thisCP.WaterVolFlowRateMax == DataSizing::AutoSize) {
+ ShowSevereError(state, format("{}: auto-sizing cannot be done for {} = {}\".", RoutineName, CompType, thisCP.Name));
ShowContinueError(state,
"The \"SimulationControl\" object must have the field \"Do Zone Sizing Calculation\" set to Yes when the "
"Cooling Design Capacity Method = \"FractionOfAutosizedCoolingCapacity\".");
@@ -990,24 +986,24 @@ void SizeCoolingPanel(EnergyPlusData &state, int const CoolingPanelNum)
state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).NonAirSysDesCoolLoad;
state.dataSize->DataFractionUsedForSizing = 1.0;
}
- TempSize = ThisCP.ScaledCoolingCapacity;
+ TempSize = thisCP.ScaledCoolingCapacity;
} else if (CapSizingMethod == DataSizing::CapacityPerFloorArea) {
if (state.dataSize->ZoneSizingRunDone) {
CheckZoneSizing(state, CompType, CompName);
zoneEqSizing.CoolingCapacity = true;
zoneEqSizing.DesCoolingLoad = state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).NonAirSysDesCoolLoad;
}
- TempSize = ThisCP.ScaledCoolingCapacity * state.dataHeatBal->Zone(ThisCP.ZonePtr).FloorArea;
+ TempSize = thisCP.ScaledCoolingCapacity * state.dataHeatBal->Zone(thisCP.ZonePtr).FloorArea;
state.dataSize->DataScalableCapSizingON = true;
} else if (CapSizingMethod == DataSizing::FractionOfAutosizedCoolingCapacity) {
CheckZoneSizing(state, CompType, CompName);
zoneEqSizing.CoolingCapacity = true;
zoneEqSizing.DesCoolingLoad = state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).NonAirSysDesCoolLoad;
- TempSize = zoneEqSizing.DesCoolingLoad * ThisCP.ScaledCoolingCapacity;
+ TempSize = zoneEqSizing.DesCoolingLoad * thisCP.ScaledCoolingCapacity;
state.dataSize->DataScalableCapSizingON = true;
} else {
- TempSize = ThisCP.ScaledCoolingCapacity;
+ TempSize = thisCP.ScaledCoolingCapacity;
}
CoolingCapacitySizer sizerCoolingCapacity;
sizerCoolingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName);
@@ -1020,34 +1016,34 @@ void SizeCoolingPanel(EnergyPlusData &state, int const CoolingPanelNum)
}
}
// finally cooling capacity is saved in this variable
- ThisCP.ScaledCoolingCapacity = DesCoilLoad;
+ thisCP.ScaledCoolingCapacity = DesCoilLoad;
}
IsAutoSize = false;
- if (ThisCP.WaterVolFlowRateMax == DataSizing::AutoSize) {
+ if (thisCP.WaterVolFlowRateMax == DataSizing::AutoSize) {
IsAutoSize = true;
}
if (state.dataSize->CurZoneEqNum > 0) {
if (!IsAutoSize && !state.dataSize->ZoneSizingRunDone) { // simulation continue
- if (ThisCP.WaterVolFlowRateMax > 0.0) {
+ if (thisCP.WaterVolFlowRateMax > 0.0) {
BaseSizer::reportSizerOutput(
- state, CompType, ThisCP.EquipID, "User-Specified Maximum Cold Water Flow [m3/s]", ThisCP.WaterVolFlowRateMax);
+ state, CompType, thisCP.Name, "User-Specified Maximum Cold Water Flow [m3/s]", thisCP.WaterVolFlowRateMax);
}
} else { // Autosize or hard-size with sizing run
- if (ThisCP.WaterInletNode > 0 && ThisCP.WaterOutletNode > 0) {
+ if (thisCP.WaterInletNode > 0 && thisCP.WaterOutletNode > 0) {
int PltSizCoolNum =
- PlantUtilities::MyPlantSizingIndex(state, CompType, ThisCP.EquipID, ThisCP.WaterInletNode, ThisCP.WaterOutletNode, ErrorsFound);
+ PlantUtilities::MyPlantSizingIndex(state, CompType, thisCP.Name, thisCP.WaterInletNode, thisCP.WaterOutletNode, ErrorsFound);
if (PltSizCoolNum > 0) {
if (DesCoilLoad >= DataHVACGlobals::SmallLoad) {
rho = FluidProperties::GetDensityGlycol(state,
- state.dataPlnt->PlantLoop(ThisCP.plantLoc.loopNum).FluidName,
+ state.dataPlnt->PlantLoop(thisCP.plantLoc.loopNum).FluidName,
5.,
- state.dataPlnt->PlantLoop(ThisCP.plantLoc.loopNum).FluidIndex,
+ state.dataPlnt->PlantLoop(thisCP.plantLoc.loopNum).FluidIndex,
RoutineName);
Cp = FluidProperties::GetSpecificHeatGlycol(state,
- state.dataPlnt->PlantLoop(ThisCP.plantLoc.loopNum).FluidName,
+ state.dataPlnt->PlantLoop(thisCP.plantLoc.loopNum).FluidName,
5.0,
- state.dataPlnt->PlantLoop(ThisCP.plantLoc.loopNum).FluidIndex,
+ state.dataPlnt->PlantLoop(thisCP.plantLoc.loopNum).FluidIndex,
RoutineName);
WaterVolFlowMaxCoolDes = DesCoilLoad / (state.dataSize->PlantSizData(PltSizCoolNum).DeltaT * Cp * rho);
} else {
@@ -1055,19 +1051,19 @@ void SizeCoolingPanel(EnergyPlusData &state, int const CoolingPanelNum)
}
} else {
ShowSevereError(state, "Autosizing of water flow requires a cooling loop Sizing:Plant object");
- ShowContinueError(state, format("Occurs in ZoneHVAC:CoolingPanel:RadiantConvective:Water Object={}", ThisCP.EquipID));
+ ShowContinueError(state, format("Occurs in ZoneHVAC:CoolingPanel:RadiantConvective:Water Object={}", thisCP.Name));
}
}
if (IsAutoSize) {
- ThisCP.WaterVolFlowRateMax = WaterVolFlowMaxCoolDes;
- BaseSizer::reportSizerOutput(state, CompType, ThisCP.EquipID, "Design Size Maximum Cold Water Flow [m3/s]", WaterVolFlowMaxCoolDes);
+ thisCP.WaterVolFlowRateMax = WaterVolFlowMaxCoolDes;
+ BaseSizer::reportSizerOutput(state, CompType, thisCP.Name, "Design Size Maximum Cold Water Flow [m3/s]", WaterVolFlowMaxCoolDes);
} else { // hard-size with sizing data
- if (ThisCP.WaterVolFlowRateMax > 0.0 && WaterVolFlowMaxCoolDes > 0.0) {
- WaterVolFlowMaxCoolUser = ThisCP.WaterVolFlowRateMax;
+ if (thisCP.WaterVolFlowRateMax > 0.0 && WaterVolFlowMaxCoolDes > 0.0) {
+ WaterVolFlowMaxCoolUser = thisCP.WaterVolFlowRateMax;
BaseSizer::reportSizerOutput(state,
CompType,
- ThisCP.EquipID,
+ thisCP.Name,
"Design Size Maximum Cold Water Flow [m3/s]",
WaterVolFlowMaxCoolDes,
"User-Specified Maximum Cold Water Flow [m3/s]",
@@ -1078,7 +1074,7 @@ void SizeCoolingPanel(EnergyPlusData &state, int const CoolingPanelNum)
ShowMessage(state,
format("SizeCoolingPanel: Potential issue with equipment sizing for "
"ZoneHVAC:CoolingPanel:RadiantConvective:Water = \"{}\".",
- ThisCP.EquipID));
+ thisCP.Name));
ShowContinueError(state, format("User-Specified Maximum Cool Water Flow of {:.5R} [m3/s]", WaterVolFlowMaxCoolUser));
ShowContinueError(state,
format("differs from Design Size Maximum Cool Water Flow of {:.5R} [m3/s]", WaterVolFlowMaxCoolDes));
@@ -1091,9 +1087,9 @@ void SizeCoolingPanel(EnergyPlusData &state, int const CoolingPanelNum)
}
}
- PlantUtilities::RegisterPlantCompDesignFlow(state, ThisCP.WaterInletNode, ThisCP.WaterVolFlowRateMax);
+ PlantUtilities::RegisterPlantCompDesignFlow(state, thisCP.WaterInletNode, thisCP.WaterVolFlowRateMax);
- if (!ThisCP.SizeCoolingPanelUA(state)) {
+ if (!thisCP.SizeCoolingPanelUA(state)) {
ShowFatalError(state, "SizeCoolingPanelUA: Program terminated for previous conditions.");
}
}
@@ -1122,7 +1118,7 @@ bool CoolingPanelParams::SizeCoolingPanelUA(EnergyPlusData &state)
ShowSevereError(state,
format("SizeCoolingPanelUA: Unit=[{},{}] has a rated water temperature that is higher than the rated zone temperature.",
cCMO_CoolingPanel_Simple,
- this->EquipID));
+ this->Name));
ShowContinueError(state,
"Such a situation would not lead to cooling and thus the rated water or zone temperature or both should be adjusted.");
this->UA = 1.0;
@@ -1141,7 +1137,7 @@ bool CoolingPanelParams::SizeCoolingPanelUA(EnergyPlusData &state)
ShowSevereError(state,
format("SizeCoolingPanelUA: Unit=[{},{}] has a cooling capacity that is greater than the maximum possible value.",
cCMO_CoolingPanel_Simple,
- this->EquipID));
+ this->Name));
ShowContinueError(state, "The result of this is that a UA value is impossible to calculate.");
ShowContinueError(state, "Check the rated input for temperatures, flow, and capacity for this unit.");
ShowContinueError(state, "The ratio of the capacity to the rated theoretical maximum must be less than unity.");
@@ -1159,8 +1155,8 @@ bool CoolingPanelParams::SizeCoolingPanelUA(EnergyPlusData &state)
this->UA = -MDotXCp * log(1.0 - RatCapToTheoMax);
if (this->UA <= 0.0) {
- ShowSevereError(
- state, format("SizeCoolingPanelUA: Unit=[{},{}] has a zero or negative calculated UA value.", cCMO_CoolingPanel_Simple, this->EquipID));
+ ShowSevereError(state,
+ format("SizeCoolingPanelUA: Unit=[{},{}] has a zero or negative calculated UA value.", cCMO_CoolingPanel_Simple, this->Name));
ShowContinueError(state,
"This is not allowed. Please check the rated input parameters for this device to ensure that the values are correct.");
return false;
@@ -1261,7 +1257,7 @@ void CoolingPanelParams::CalcCoolingPanel(EnergyPlusData &state, int const Cooli
ShowWarningMessage(state,
format("{} [{}] inlet water temperature below dew-point temperature--potential for condensation exists",
cCMO_CoolingPanel_Simple,
- this->EquipID));
+ this->Name));
ShowContinueError(state, "Flow to the simple cooling panel will be shut-off to avoid condensation");
ShowContinueError(state, format("Water inlet temperature = {:.2R}", waterInletTemp));
ShowContinueError(state, format("Zone dew-point temperature + safety delta T= {:.2R}", DewPointTemp + this->CondDewPtDeltaT));
@@ -1270,7 +1266,7 @@ void CoolingPanelParams::CalcCoolingPanel(EnergyPlusData &state, int const Cooli
format("Note that a {:.4R} C safety was chosen in the input for the shut-off criteria", this->CondDewPtDeltaT));
}
ShowRecurringWarningErrorAtEnd(state,
- cCMO_CoolingPanel_Simple + " [" + this->EquipID + "] condensation shut-off occurrence continues.",
+ cCMO_CoolingPanel_Simple + " [" + this->Name + "] condensation shut-off occurrence continues.",
this->CondErrIndex,
DewPointTemp,
DewPointTemp,
@@ -1492,33 +1488,33 @@ void UpdateCoolingPanel(EnergyPlusData &state, int const CoolingPanelNum)
// Using/Aliasing
Real64 SysTimeElapsed = state.dataHVACGlobal->SysTimeElapsed;
Real64 TimeStepSys = state.dataHVACGlobal->TimeStepSys;
- auto &ThisCP(state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum));
+ auto &thisCP(state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum));
// First, update the running average if necessary...
- if (ThisCP.LastSysTimeElapsed == SysTimeElapsed) {
- ThisCP.CoolingPanelSrcAvg -= ThisCP.LastCoolingPanelSrc * ThisCP.LastTimeStepSys / state.dataGlobal->TimeStepZone;
+ if (thisCP.LastSysTimeElapsed == SysTimeElapsed) {
+ thisCP.CoolingPanelSrcAvg -= thisCP.LastCoolingPanelSrc * thisCP.LastTimeStepSys / state.dataGlobal->TimeStepZone;
}
// Update the running average and the "last" values with the current values of the appropriate variables
- ThisCP.CoolingPanelSrcAvg += ThisCP.CoolingPanelSource * TimeStepSys / state.dataGlobal->TimeStepZone;
+ thisCP.CoolingPanelSrcAvg += thisCP.CoolingPanelSource * TimeStepSys / state.dataGlobal->TimeStepZone;
- ThisCP.LastCoolingPanelSrc = ThisCP.CoolingPanelSource;
- ThisCP.LastSysTimeElapsed = SysTimeElapsed;
- ThisCP.LastTimeStepSys = TimeStepSys;
+ thisCP.LastCoolingPanelSrc = thisCP.CoolingPanelSource;
+ thisCP.LastSysTimeElapsed = SysTimeElapsed;
+ thisCP.LastTimeStepSys = TimeStepSys;
- int WaterInletNode = ThisCP.WaterInletNode;
- int WaterOutletNode = ThisCP.WaterOutletNode;
+ int WaterInletNode = thisCP.WaterInletNode;
+ int WaterOutletNode = thisCP.WaterOutletNode;
auto &ThisInNode(state.dataLoopNodes->Node(WaterInletNode));
auto &ThisOutNode(state.dataLoopNodes->Node(WaterOutletNode));
// Set the outlet water nodes for the panel
PlantUtilities::SafeCopyPlantNode(state, WaterInletNode, WaterOutletNode);
- ThisOutNode.Temp = ThisCP.WaterOutletTemp;
- ThisOutNode.Enthalpy = ThisCP.WaterOutletEnthalpy;
- ThisInNode.MassFlowRate = ThisCP.WaterMassFlowRate;
- ThisOutNode.MassFlowRate = ThisCP.WaterMassFlowRate;
- ThisInNode.MassFlowRateMax = ThisCP.WaterMassFlowRateMax;
- ThisOutNode.MassFlowRateMax = ThisCP.WaterMassFlowRateMax;
+ ThisOutNode.Temp = thisCP.WaterOutletTemp;
+ ThisOutNode.Enthalpy = thisCP.WaterOutletEnthalpy;
+ ThisInNode.MassFlowRate = thisCP.WaterMassFlowRate;
+ ThisOutNode.MassFlowRate = thisCP.WaterMassFlowRate;
+ ThisInNode.MassFlowRateMax = thisCP.WaterMassFlowRateMax;
+ ThisOutNode.MassFlowRateMax = thisCP.WaterMassFlowRateMax;
}
void UpdateCoolingPanelSourceValAvg(EnergyPlusData &state,
@@ -1595,17 +1591,17 @@ void DistributeCoolingPanelRadGains(EnergyPlusData &state)
for (int CoolingPanelNum = 1; CoolingPanelNum <= (int)state.dataChilledCeilingPanelSimple->CoolingPanel.size(); ++CoolingPanelNum) {
- auto &ThisCP(state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum));
+ auto &thisCP(state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum));
- int ZoneNum = ThisCP.ZonePtr;
+ int ZoneNum = thisCP.ZonePtr;
if (ZoneNum <= 0) continue;
- state.dataHeatBalFanSys->ZoneQCoolingPanelToPerson(ZoneNum) += ThisCP.CoolingPanelSource * ThisCP.FracDistribPerson;
+ state.dataHeatBalFanSys->ZoneQCoolingPanelToPerson(ZoneNum) += thisCP.CoolingPanelSource * thisCP.FracDistribPerson;
- for (int RadSurfNum = 1; RadSurfNum <= ThisCP.TotSurfToDistrib; ++RadSurfNum) {
- int SurfNum = ThisCP.SurfacePtr(RadSurfNum);
+ for (int RadSurfNum = 1; RadSurfNum <= thisCP.TotSurfToDistrib; ++RadSurfNum) {
+ int SurfNum = thisCP.SurfacePtr(RadSurfNum);
auto &ThisSurf(state.dataSurface->Surface(SurfNum));
if (ThisSurf.Area > SmallestArea) {
- Real64 ThisSurfIntensity = (ThisCP.CoolingPanelSource * ThisCP.FracDistribToSurf(RadSurfNum) / ThisSurf.Area);
+ Real64 ThisSurfIntensity = (thisCP.CoolingPanelSource * thisCP.FracDistribToSurf(RadSurfNum) / ThisSurf.Area);
state.dataHeatBalFanSys->SurfQCoolingPanel(SurfNum) += ThisSurfIntensity;
state.dataHeatBalSurf->AnyRadiantSystems = true;
// CR 8074, trap for excessive intensity (throws off surface balance )
@@ -1613,7 +1609,7 @@ void DistributeCoolingPanelRadGains(EnergyPlusData &state)
ShowSevereError(state, "DistributeCoolingPanelRadGains: excessive thermal radiation heat flux intensity detected");
ShowContinueError(state, format("Surface = {}", ThisSurf.Name));
ShowContinueError(state, format("Surface area = {:.3R} [m2]", ThisSurf.Area));
- ShowContinueError(state, format("Occurs in {} = {}", cCMO_CoolingPanel_Simple, ThisCP.EquipID));
+ ShowContinueError(state, format("Occurs in {} = {}", cCMO_CoolingPanel_Simple, thisCP.Name));
ShowContinueError(state, format("Radiation intensity = {:.2R} [W/m2]", ThisSurfIntensity));
ShowContinueError(state, format("Assign a larger surface area or more surfaces in {}", cCMO_CoolingPanel_Simple));
ShowFatalError(state, "DistributeCoolingPanelRadGains: excessive thermal radiation heat flux intensity detected");
@@ -1622,7 +1618,7 @@ void DistributeCoolingPanelRadGains(EnergyPlusData &state)
ShowSevereError(state, "DistributeCoolingPanelRadGains: surface not large enough to receive thermal radiation heat flux");
ShowContinueError(state, format("Surface = {}", ThisSurf.Name));
ShowContinueError(state, format("Surface area = {:.3R} [m2]", ThisSurf.Area));
- ShowContinueError(state, format("Occurs in {} = {}", cCMO_CoolingPanel_Simple, ThisCP.EquipID));
+ ShowContinueError(state, format("Occurs in {} = {}", cCMO_CoolingPanel_Simple, thisCP.Name));
ShowContinueError(state, format("Assign a larger surface area or more surfaces in {}", cCMO_CoolingPanel_Simple));
ShowFatalError(state, "DistributeCoolingPanelRadGains: surface not large enough to receive thermal radiation heat flux");
}
diff --git a/src/EnergyPlus/ChilledCeilingPanelSimple.hh b/src/EnergyPlus/ChilledCeilingPanelSimple.hh
index 14a9ca198a3..0f67e23c5e3 100644
--- a/src/EnergyPlus/ChilledCeilingPanelSimple.hh
+++ b/src/EnergyPlus/ChilledCeilingPanelSimple.hh
@@ -92,7 +92,7 @@ namespace CoolingPanelSimple {
struct CoolingPanelParams
{
// Members
- std::string EquipID;
+ std::string Name;
DataPlant::PlantEquipmentType EquipType = DataPlant::PlantEquipmentType::Invalid;
std::string Schedule;
Array1D_string SurfaceName;
diff --git a/src/EnergyPlus/ChillerAbsorption.cc b/src/EnergyPlus/ChillerAbsorption.cc
index b9c31f7efe1..c918dcf9bbe 100644
--- a/src/EnergyPlus/ChillerAbsorption.cc
+++ b/src/EnergyPlus/ChillerAbsorption.cc
@@ -449,7 +449,7 @@ void GetBLASTAbsorberInput(EnergyPlusData &state)
thisChiller.PumpPowerCoef[2] = state.dataIPShortCut->rNumericArgs(14);
thisChiller.TempLowLimitEvapOut = state.dataIPShortCut->rNumericArgs(15);
- thisChiller.FlowMode = static_cast(getEnumerationValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(8)));
+ thisChiller.FlowMode = static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(8)));
if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) {
ShowSevereError(state,
format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
diff --git a/src/EnergyPlus/ChillerElectricASHRAE205.cc b/src/EnergyPlus/ChillerElectricASHRAE205.cc
index 998a6f43ebd..fc85aff6e07 100644
--- a/src/EnergyPlus/ChillerElectricASHRAE205.cc
+++ b/src/EnergyPlus/ChillerElectricASHRAE205.cc
@@ -146,7 +146,7 @@ void getChillerASHRAE205Input(EnergyPlusData &state)
++ChillerNum;
auto &thisChiller = state.dataChillerElectricASHRAE205->Electric205Chiller(ChillerNum);
- thisChiller.Name = UtilityRoutines::MakeUPPERCase(thisObjectName);
+ thisChiller.Name = UtilityRoutines::makeUPPER(thisObjectName);
ip->markObjectAsUsed(state.dataIPShortCut->cCurrentModuleObject, thisObjectName);
std::string const rep_file_name = ip->getAlphaFieldValue(fields, objectSchemaProps, "representation_file_name");
@@ -169,7 +169,7 @@ void getChillerASHRAE205Input(EnergyPlusData &state)
ErrorsFound = true;
}
thisChiller.InterpolationType =
- InterpMethods[UtilityRoutines::MakeUPPERCase(ip->getAlphaFieldValue(fields, objectSchemaProps, "performance_interpolation_method"))];
+ InterpMethods[UtilityRoutines::makeUPPER(ip->getAlphaFieldValue(fields, objectSchemaProps, "performance_interpolation_method"))];
const auto &compressorSequence = thisChiller.Representation->performance.performance_map_cooling.grid_variables.compressor_sequence_number;
// minmax_element is sound but perhaps overkill; as sequence numbers are required by A205 to be in ascending order
@@ -260,7 +260,7 @@ void getChillerASHRAE205Input(EnergyPlusData &state)
"Condenser Water Nodes");
thisChiller.FlowMode = static_cast(
- getEnumerationValue(DataPlant::FlowModeNamesUC, ip->getAlphaFieldValue(fields, objectSchemaProps, "chiller_flow_mode")));
+ getEnumValue(DataPlant::FlowModeNamesUC, ip->getAlphaFieldValue(fields, objectSchemaProps, "chiller_flow_mode")));
if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) {
ShowSevereError(state, format("{}{}=\"{}\"", std::string{RoutineName}, state.dataIPShortCut->cCurrentModuleObject, thisObjectName));
@@ -294,8 +294,8 @@ void getChillerASHRAE205Input(EnergyPlusData &state)
}
}
- thisChiller.AmbientTempType = static_cast(getEnumerationValue(
- AmbientTempNamesUC, UtilityRoutines::MakeUPPERCase(ip->getAlphaFieldValue(fields, objectSchemaProps, "ambient_temperature_indicator"))));
+ thisChiller.AmbientTempType = static_cast(getEnumValue(
+ AmbientTempNamesUC, UtilityRoutines::makeUPPER(ip->getAlphaFieldValue(fields, objectSchemaProps, "ambient_temperature_indicator"))));
switch (thisChiller.AmbientTempType) {
case AmbientTempIndicator::Schedule: {
std::string const ambient_temp_schedule = ip->getAlphaFieldValue(fields, objectSchemaProps, "ambient_temperature_schedule");
diff --git a/src/EnergyPlus/ChillerElectricEIR.cc b/src/EnergyPlus/ChillerElectricEIR.cc
index 382f7955f34..8184169039f 100644
--- a/src/EnergyPlus/ChillerElectricEIR.cc
+++ b/src/EnergyPlus/ChillerElectricEIR.cc
@@ -444,8 +444,7 @@ void GetElectricEIRChillerInput(EnergyPlusData &state)
"Condenser (unknown?) Nodes");
}
- thisChiller.FlowMode =
- static_cast(getEnumerationValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(10)));
+ thisChiller.FlowMode = static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(10)));
if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) {
ShowSevereError(state,
format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
diff --git a/src/EnergyPlus/ChillerGasAbsorption.cc b/src/EnergyPlus/ChillerGasAbsorption.cc
index 95abd276805..b20bebe4b59 100644
--- a/src/EnergyPlus/ChillerGasAbsorption.cc
+++ b/src/EnergyPlus/ChillerGasAbsorption.cc
@@ -514,9 +514,8 @@ void GetGasAbsorberInput(EnergyPlusData &state)
thisChiller.SizFac = state.dataIPShortCut->rNumericArgs(17);
// Validate fuel type input
- thisChiller.FuelType =
- static_cast(getEnumerationValue(Constant::eResourceNamesUC, state.dataIPShortCut->cAlphaArgs(17)));
- if (thisChiller.FuelType == Constant::eResource::Invalid) {
+ thisChiller.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs(17)));
+ if (thisChiller.FuelType == Constant::eFuel::Invalid) {
ShowSevereError(state, format("{}=\"{}\", invalid value", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
ShowContinueError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(17), state.dataIPShortCut->cAlphaArgs(17)));
ShowContinueError(
@@ -532,7 +531,7 @@ void GetGasAbsorberInput(EnergyPlusData &state)
void GasAbsorberSpecs::setupOutputVariables(EnergyPlusData &state)
{
- std::string_view const sFuelType = Constant::eResourceNames[static_cast(this->FuelType)];
+ std::string_view const sFuelType = Constant::eFuelNames[static_cast(this->FuelType)];
SetupOutputVariable(state,
"Chiller Heater Evaporator Cooling Rate",
diff --git a/src/EnergyPlus/ChillerGasAbsorption.hh b/src/EnergyPlus/ChillerGasAbsorption.hh
index 8b4f5ef8ff6..d7c40f1b12c 100644
--- a/src/EnergyPlus/ChillerGasAbsorption.hh
+++ b/src/EnergyPlus/ChillerGasAbsorption.hh
@@ -78,7 +78,7 @@ namespace ChillerGasAbsorption {
bool InHeatingMode = false;
// Part of Type that directly corresponds with IDD definition
std::string Name; // user identifier
- Constant::eResource FuelType; // Type of Fuel - DIESEL, GASOLINE, GAS
+ Constant::eFuel FuelType; // Type of Fuel - DIESEL, GASOLINE, GAS
Real64 NomCoolingCap = 0.0; // W - design nominal capacity of Absorber
bool NomCoolingCapWasAutoSized = false; // true if nominal capacity was autosize on input
Real64 NomHeatCoolRatio = 0.0; // ratio of heating to cooling capacity
diff --git a/src/EnergyPlus/ChillerIndirectAbsorption.cc b/src/EnergyPlus/ChillerIndirectAbsorption.cc
index b33640d19a7..88c6d514a97 100644
--- a/src/EnergyPlus/ChillerIndirectAbsorption.cc
+++ b/src/EnergyPlus/ChillerIndirectAbsorption.cc
@@ -441,8 +441,7 @@ void GetIndirectAbsorberInput(EnergyPlusData &state)
}
{
- thisChiller.FlowMode =
- static_cast(getEnumerationValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(6)));
+ thisChiller.FlowMode = static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(6)));
if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) {
ShowSevereError(state,
format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc
index fcb54330e65..f609f5540a6 100644
--- a/src/EnergyPlus/ChillerReformulatedEIR.cc
+++ b/src/EnergyPlus/ChillerReformulatedEIR.cc
@@ -399,8 +399,7 @@ void GetElecReformEIRChillerInput(EnergyPlusData &state)
"Condenser Water Nodes");
{
- thisChiller.FlowMode =
- static_cast(getEnumerationValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(10)));
+ thisChiller.FlowMode = static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(10)));
if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) {
ShowSevereError(state,
format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
diff --git a/src/EnergyPlus/Coils/CoilCoolingDX.cc b/src/EnergyPlus/Coils/CoilCoolingDX.cc
index 381df049e34..e1c1f06d275 100644
--- a/src/EnergyPlus/Coils/CoilCoolingDX.cc
+++ b/src/EnergyPlus/Coils/CoilCoolingDX.cc
@@ -84,7 +84,7 @@ int CoilCoolingDX::factory(EnergyPlus::EnergyPlusData &state, std::string const
int handle = -1;
for (auto const &thisCoil : state.dataCoilCooingDX->coilCoolingDXs) {
handle++;
- if (EnergyPlus::UtilityRoutines::MakeUPPERCase(coilName) == EnergyPlus::UtilityRoutines::MakeUPPERCase(thisCoil.name)) {
+ if (EnergyPlus::UtilityRoutines::makeUPPER(coilName) == EnergyPlus::UtilityRoutines::makeUPPER(thisCoil.name)) {
return handle;
}
}
@@ -308,8 +308,8 @@ void CoilCoolingDX::oneTimeInit(EnergyPlus::EnergyPlusData &state)
{},
"System");
- if (this->performance.compressorFuelType != Constant::eResource::Electricity) {
- std::string_view const sFuelType = Constant::eResourceNames[static_cast(this->performance.compressorFuelType)];
+ if (this->performance.compressorFuelType != Constant::eFuel::Electricity) {
+ std::string_view const sFuelType = Constant::eFuelNames[static_cast(this->performance.compressorFuelType)];
SetupOutputVariable(state,
format("Cooling Coil {} Rate", sFuelType),
OutputProcessor::Unit::W,
diff --git a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc
index b73c4770591..3a6018ce2e7 100644
--- a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc
+++ b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc
@@ -106,9 +106,9 @@ void CoilCoolingDXCurveFitPerformance::instantiateFromInputSpec(EnergyPlus::Ener
this->alternateMode.oneTimeInit(state); // oneTimeInit does not need to be delayed in this use case
}
// Validate fuel type input
- this->compressorFuelType = static_cast(
- getEnumerationValue(Constant::eResourceNamesUC, UtilityRoutines::MakeUPPERCase(input_data.compressor_fuel_type)));
- if (this->compressorFuelType == Constant::eResource::Invalid) {
+ this->compressorFuelType =
+ static_cast(getEnumValue(Constant::eFuelNamesUC, UtilityRoutines::makeUPPER(input_data.compressor_fuel_type)));
+ if (this->compressorFuelType == Constant::eFuel::Invalid) {
ShowSevereError(state, std::string{routineName} + this->object_name + "=\"" + this->name + "\", invalid");
ShowContinueError(state, "...Compressor Fuel Type=\"" + input_data.compressor_fuel_type + "\".");
errorsFound = true;
@@ -372,7 +372,7 @@ void CoilCoolingDXCurveFitPerformance::simulate(EnergyPlus::EnergyPlusData &stat
this->basinHeaterPower *= (1.0 - this->RTF);
this->electricityConsumption = this->powerUse * reportingConstant;
- if (this->compressorFuelType != Constant::eResource::Electricity) {
+ if (this->compressorFuelType != Constant::eFuel::Electricity) {
this->compressorFuelRate = this->powerUse;
this->compressorFuelConsumption = this->electricityConsumption;
diff --git a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.hh b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.hh
index 67567c02794..aa4d7ac29c7 100644
--- a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.hh
+++ b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.hh
@@ -122,7 +122,7 @@ struct CoilCoolingDXCurveFitPerformance
Real64 minOutdoorDrybulb = 0.0;
Real64 maxOutdoorDrybulbForBasin = 0.0;
bool mySizeFlag = true;
- Constant::eResource compressorFuelType = Constant::eResource::Invalid;
+ Constant::eFuel compressorFuelType = Constant::eFuel::Invalid;
std::string compressorFuelTypeForOutput;
Real64 compressorFuelRate = 0.0;
Real64 compressorFuelConsumption = 0.0;
diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc
index 7fa756384b3..dd0901368bc 100644
--- a/src/EnergyPlus/CondenserLoopTowers.cc
+++ b/src/EnergyPlus/CondenserLoopTowers.cc
@@ -333,7 +333,7 @@ namespace CondenserLoopTowers {
}
tower.TowerFreeConvNomCapSizingFactor = NumArray(12);
if (NumAlphas >= 4) {
- tower.PerformanceInputMethod_Num = static_cast(getEnumerationValue(PIMNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(4))));
+ tower.PerformanceInputMethod_Num = static_cast(getEnumValue(PIMNamesUC, UtilityRoutines::makeUPPER(AlphArray(4))));
if (tower.PerformanceInputMethod_Num == PIM::Invalid) {
ShowSevereError(state, format("{}={}", cCurrentModuleObject, AlphArray(1)));
ShowContinueError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(4), AlphArray(4)));
@@ -404,7 +404,7 @@ namespace CondenserLoopTowers {
}
// begin water use and systems get input
- tower.EvapLossMode = static_cast(getEnumerationValue(EvapLossNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(6))));
+ tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, UtilityRoutines::makeUPPER(AlphArray(6))));
tower.UserEvapLossFactor = NumArray(19); // N11 , \field Evaporation Loss Factor
tower.DriftLossFraction = NumArray(20) / 100.0; // N12, \field Drift Loss Percent
@@ -412,7 +412,7 @@ namespace CondenserLoopTowers {
tower.SizFac = NumArray(25); // N17 \field Sizing Factor
if (tower.SizFac <= 0.0) tower.SizFac = 1.0;
- tower.BlowdownMode = static_cast(getEnumerationValue(BlowDownNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(7))));
+ tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, UtilityRoutines::makeUPPER(AlphArray(7))));
tower.SchedIDBlowdown = ScheduleManager::GetScheduleIndex(state, AlphArray(8));
if ((tower.SchedIDBlowdown == 0) && (tower.BlowdownMode == Blowdown::Schedule)) {
ShowSevereError(state, format("Invalid, {} = \"{}\"", state.dataIPShortCut->cAlphaFieldNames(8), AlphArray(8)));
@@ -457,8 +457,7 @@ namespace CondenserLoopTowers {
if (state.dataIPShortCut->lAlphaFieldBlanks(11) || AlphArray(11).empty()) {
tower.CapacityControl = CapacityCtrl::FanCycling; // FanCycling
} else {
- tower.CapacityControl =
- static_cast(getEnumerationValue(CapacityCtrlNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(11))));
+ tower.CapacityControl = static_cast(getEnumValue(CapacityCtrlNamesUC, UtilityRoutines::makeUPPER(AlphArray(11))));
if (tower.CapacityControl == CapacityCtrl::Invalid) {
tower.CapacityControl = CapacityCtrl::FanCycling;
ShowWarningError(state,
@@ -487,7 +486,7 @@ namespace CondenserLoopTowers {
// cell control for single speed tower
if (!state.dataIPShortCut->lAlphaFieldBlanks(12)) {
- tower.cellCtrl = static_cast(getEnumerationValue(CellCtrlNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(12))));
+ tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, UtilityRoutines::makeUPPER(AlphArray(12))));
}
// High speed air flow rate must be greater than free convection air flow rate.
@@ -646,7 +645,7 @@ namespace CondenserLoopTowers {
BranchNodeConnections::TestCompSet(state, cCurrentModuleObject, AlphArray(1), AlphArray(2), AlphArray(3), "Chilled Water Nodes");
if (NumAlphas >= 4) {
- tower.PerformanceInputMethod_Num = static_cast(getEnumerationValue(PIMNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(4))));
+ tower.PerformanceInputMethod_Num = static_cast(getEnumValue(PIMNamesUC, UtilityRoutines::makeUPPER(AlphArray(4))));
} else {
// Since Performance Input Method has been omitted then assume it to be UA and DESIGN WATER FLOW RATE
tower.PerformanceInputMethod_Num = PIM::UFactor;
@@ -766,7 +765,7 @@ namespace CondenserLoopTowers {
}
// begin water use and systems get input
- tower.EvapLossMode = static_cast(getEnumerationValue(EvapLossNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(6))));
+ tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, UtilityRoutines::makeUPPER(AlphArray(6))));
tower.UserEvapLossFactor = NumArray(27); // N23 , \field Evaporation Loss Factor
tower.DriftLossFraction = NumArray(28) / 100.0; // N24, \field Drift Loss Percent
@@ -774,7 +773,7 @@ namespace CondenserLoopTowers {
tower.SizFac = NumArray(33); // N21 \field Sizing Factor
if (tower.SizFac <= 0.0) tower.SizFac = 1.0;
- tower.BlowdownMode = static_cast(getEnumerationValue(BlowDownNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(7))));
+ tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, UtilityRoutines::makeUPPER(AlphArray(7))));
tower.SchedIDBlowdown = ScheduleManager::GetScheduleIndex(state, AlphArray(8));
if ((tower.SchedIDBlowdown == 0) && (tower.BlowdownMode == Blowdown::Schedule)) {
ShowSevereError(state, format("Invalid, {} = \"{}\"", state.dataIPShortCut->cAlphaFieldNames(8), AlphArray(8)));
@@ -801,7 +800,7 @@ namespace CondenserLoopTowers {
// cell control for two speed tower
if (!state.dataIPShortCut->lAlphaFieldBlanks(11)) {
- tower.cellCtrl = static_cast(getEnumerationValue(CellCtrlNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(11))));
+ tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, UtilityRoutines::makeUPPER(AlphArray(11))));
}
if (state.dataIPShortCut->lAlphaFieldBlanks(9)) {
@@ -1435,7 +1434,7 @@ namespace CondenserLoopTowers {
}
// begin water use and systems get input
- tower.EvapLossMode = static_cast(getEnumerationValue(EvapLossNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(8))));
+ tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, UtilityRoutines::makeUPPER(AlphArray(8))));
tower.UserEvapLossFactor = NumArray(11); // N11 , \field Evaporation Loss Factor
tower.DriftLossFraction = NumArray(12) / 100.0; // N12, \field Drift Loss Percent
@@ -1443,7 +1442,7 @@ namespace CondenserLoopTowers {
tower.SizFac = NumArray(17); // N14 \field Sizing Factor
if (tower.SizFac <= 0.0) tower.SizFac = 1.0;
- tower.BlowdownMode = static_cast(getEnumerationValue(BlowDownNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(9))));
+ tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, UtilityRoutines::makeUPPER(AlphArray(9))));
tower.SchedIDBlowdown = ScheduleManager::GetScheduleIndex(state, AlphArray(10));
if ((tower.SchedIDBlowdown == 0) && (tower.BlowdownMode == Blowdown::Schedule)) {
ShowSevereError(state, format("Invalid, {} = \"{}\"", state.dataIPShortCut->cAlphaFieldNames(10), AlphArray(10)));
@@ -1470,7 +1469,7 @@ namespace CondenserLoopTowers {
// cell control for variable speed tower
if (!state.dataIPShortCut->lAlphaFieldBlanks(13)) {
- tower.cellCtrl = static_cast(getEnumerationValue(CellCtrlNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(13))));
+ tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, UtilityRoutines::makeUPPER(AlphArray(13))));
}
if (state.dataIPShortCut->lAlphaFieldBlanks(11)) {
@@ -1695,7 +1694,7 @@ namespace CondenserLoopTowers {
}
// begin water use and systems get input
- tower.EvapLossMode = static_cast(getEnumerationValue(EvapLossNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(10))));
+ tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, UtilityRoutines::makeUPPER(AlphArray(10))));
tower.UserEvapLossFactor = NumArray(23); // N23 , \field Evaporation Loss Factor
tower.DriftLossFraction = NumArray(24) / 100.0; // N24, \field Drift Loss Percent
@@ -1703,7 +1702,7 @@ namespace CondenserLoopTowers {
tower.SizFac = NumArray(29); // N29 \field Sizing Factor
if (tower.SizFac <= 0.0) tower.SizFac = 1.0;
- tower.BlowdownMode = static_cast(getEnumerationValue(BlowDownNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(11))));
+ tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, UtilityRoutines::makeUPPER(AlphArray(11))));
tower.SchedIDBlowdown = ScheduleManager::GetScheduleIndex(state, AlphArray(12));
if ((tower.SchedIDBlowdown == 0) && (tower.BlowdownMode == Blowdown::Schedule)) {
ShowSevereError(state, format("Invalid, {} = \"{}\"", state.dataIPShortCut->cAlphaFieldNames(12), AlphArray(12)));
@@ -1730,7 +1729,7 @@ namespace CondenserLoopTowers {
tower.TowerMassFlowRateMultiplier = tower.MaxFracFlowRate;
// cell control for variable speed Merkel tower
if (!state.dataIPShortCut->lAlphaFieldBlanks(15)) {
- tower.cellCtrl = static_cast(getEnumerationValue(CellCtrlNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(15))));
+ tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, UtilityRoutines::makeUPPER(AlphArray(15))));
}
if (state.dataIPShortCut->lAlphaFieldBlanks(13)) {
diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc
index fb8a67ec01b..17c79b01c3f 100644
--- a/src/EnergyPlus/ConvectionCoefficients.cc
+++ b/src/EnergyPlus/ConvectionCoefficients.cc
@@ -86,7 +86,7 @@
#include
#include
-namespace EnergyPlus::ConvectionCoefficients {
+namespace EnergyPlus::Convect {
// Module containing the routines dealing with the convection coefficients
@@ -112,9 +112,8 @@ using namespace DataVectorTypes;
// Coefficients that modify the convection coeff based on surface roughness
std::array const RoughnessMultiplier{2.17, 1.67, 1.52, 1.13, 1.11, 1.0};
-constexpr std::array(ConvectionConstants::RefTemp::Num)> RefTempNamesUC{
- "MEANAIRTEMPERATURE", "ADJACENTAIRTEMPERATURE", "SUPPLYAIRTEMPERATURE"};
-constexpr std::array(ConvectionConstants::RefWind::Num)> RefWindNamesUC{
+constexpr std::array RefTempNamesUC{"MEANAIRTEMPERATURE", "ADJACENTAIRTEMPERATURE", "SUPPLYAIRTEMPERATURE"};
+constexpr std::array RefWindNamesUC{
"WEATHERFILE", "HEIGHTADJUST", "PARALLELCOMPONENT", "PARALLELCOMPONENTHEIGHTADJUST"};
enum class ConvSurfDeltaT
@@ -140,37 +139,9 @@ enum class InConvFlowRegime
Num
};
-enum class SurfacesType
-{
- Invalid = -1,
- AllExteriorSurfaces,
- AllExteriorWindows,
- AllExteriorWalls,
- AllExteriorRoofs,
- AllExteriorFloors,
- AllInteriorSurfaces,
- AllInteriorWindows,
- AllInteriorWalls,
- AllInteriorRoofs,
- AllInteriorCeilings,
- AllInteriorFloors,
- Num
-};
-
-constexpr std::array(SurfacesType::Num)> SurfacesTypeNamesUC{"ALLEXTERIORSURFACES",
- "ALLEXTERIORWINDOWS",
- "ALLEXTERIORWALLS",
- "ALLEXTERIORROOFS",
- "ALLEXTERIORFLOORS",
- "ALLINTERIORSURFACES",
- "ALLINTERIORWINDOWS",
- "ALLINTERIORWALLS",
- "ALLINTERIORROOFS",
- "ALLINTERIORCEILINGS",
- "ALLINTERIORFLOORS"};
-void InitInteriorConvectionCoeffs(EnergyPlusData &state,
- const Array1D &SurfaceTemperatures, // Temperature of surfaces for evaluation of HcIn
- ObjexxFCL::Optional_int_const ZoneToResimulate // if passed in, then only calculate surfaces that have this zone
+void InitIntConvCoeff(EnergyPlusData &state,
+ const Array1D &SurfaceTemperatures, // Temperature of surfaces for evaluation of HcIn
+ ObjexxFCL::Optional_int_const ZoneToResimulate // if passed in, then only calculate surfaces that have this zone
)
{
@@ -208,45 +179,45 @@ void InitInteriorConvectionCoeffs(EnergyPlusData &state,
auto const &Zone = state.dataHeatBal->Zone;
auto const &Surface = state.dataSurface->Surface;
- if (state.dataConvectionCoefficient->GetUserSuppliedConvectionCoeffs) {
- GetUserConvectionCoefficients(state);
- state.dataConvectionCoefficient->GetUserSuppliedConvectionCoeffs = false;
+ if (state.dataConvect->GetUserSuppliedConvectionCoeffs) {
+ GetUserConvCoeffs(state);
+ state.dataConvect->GetUserSuppliedConvectionCoeffs = false;
}
- if (state.dataConvectionCoefficient->NodeCheck) { // done once when conditions are ready...
+ if (state.dataConvect->NodeCheck) { // done once when conditions are ready...
if (!state.dataGlobal->SysSizingCalc && !state.dataGlobal->ZoneSizingCalc && state.dataZoneEquip->ZoneEquipInputsFilled &&
allocated(state.dataLoopNodes->Node)) {
- state.dataConvectionCoefficient->NodeCheck = false;
+ state.dataConvect->NodeCheck = false;
for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) {
- if (Zone(ZoneNum).InsideConvectionAlgo != ConvectionConstants::HcInt_CeilingDiffuser) continue;
- if (Zone(ZoneNum).SystemZoneNodeNumber != 0) continue;
- ShowSevereError(state,
- format("InitInteriorConvectionCoeffs: Inside Convection=CeilingDiffuser, but no system inlet node defined, Zone={}",
- Zone(ZoneNum).Name));
- ShowContinueError(
- state, format("Defaulting inside convection to TARP. Check ZoneHVAC:EquipmentConnections for Zone={}", Zone(ZoneNum).Name));
- state.dataHeatBal->Zone(ZoneNum).InsideConvectionAlgo = ConvectionConstants::HcInt_ASHRAETARP;
+ auto &zone = state.dataHeatBal->Zone(ZoneNum);
+ if (zone.IntConvAlgo != HcInt::CeilingDiffuser) continue;
+ if (zone.SystemZoneNodeNumber != 0) continue;
+ ShowSevereError(
+ state,
+ format("InitInteriorConvectionCoeffs: Inside Convection=CeilingDiffuser, but no system inlet node defined, Zone={}", zone.Name));
+ ShowContinueError(state, format("Defaulting inside convection to TARP. Check ZoneHVAC:EquipmentConnections for Zone={}", zone.Name));
+ zone.IntConvAlgo = HcInt::ASHRAETARP;
}
// insert one-time setup for adaptive inside face
}
}
- if (state.dataConvectionCoefficient->ActiveSurfaceCheck && !state.dataGlobal->SysSizingCalc && !state.dataGlobal->ZoneSizingCalc &&
+ if (state.dataConvect->ActiveSurfaceCheck && !state.dataGlobal->SysSizingCalc && !state.dataGlobal->ZoneSizingCalc &&
state.dataZoneEquip->ZoneEquipSimulatedOnce) {
- SetupAdaptiveConvectionRadiantSurfaceData(state);
- state.dataConvectionCoefficient->ActiveSurfaceCheck = false;
+ SetupAdaptiveConvRadiantSurfaceData(state);
+ state.dataConvect->ActiveSurfaceCheck = false;
}
- if (state.dataGlobal->BeginEnvrnFlag && state.dataConvectionCoefficient->MyEnvirnFlag) {
+ if (state.dataGlobal->BeginEnvrnFlag && state.dataConvect->MyEnvirnFlag) {
bool anyAdaptiveConvectionAlgorithm = false;
for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) {
- if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) == ConvectionConstants::HcInt_AdaptiveConvectionAlgorithm) {
+ if (state.dataSurface->surfIntConv(SurfNum).model == HcInt::AdaptiveConvectionAlgorithm) {
anyAdaptiveConvectionAlgorithm = true;
break;
}
}
for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) {
- if (state.dataHeatBal->Zone(ZoneNum).InsideConvectionAlgo == ConvectionConstants::HcInt_AdaptiveConvectionAlgorithm) {
+ if (state.dataHeatBal->Zone(ZoneNum).IntConvAlgo == HcInt::AdaptiveConvectionAlgorithm) {
anyAdaptiveConvectionAlgorithm = true;
break;
}
@@ -287,25 +258,27 @@ void InitInteriorConvectionCoeffs(EnergyPlusData &state,
}
}
}
- state.dataConvectionCoefficient->MyEnvirnFlag = false;
+ state.dataConvect->MyEnvirnFlag = false;
}
- if (!state.dataGlobal->BeginEnvrnFlag) state.dataConvectionCoefficient->MyEnvirnFlag = true;
+ if (!state.dataGlobal->BeginEnvrnFlag) state.dataConvect->MyEnvirnFlag = true;
for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) {
- switch (Zone(ZoneNum).InsideConvectionAlgo) {
- case ConvectionConstants::HcInt_CeilingDiffuser:
+ switch (Zone(ZoneNum).IntConvAlgo) {
+ case HcInt::CeilingDiffuser:
CalcCeilingDiffuserIntConvCoeff(state, ZoneNum, SurfaceTemperatures);
break;
- case ConvectionConstants::HcInt_TrombeWall:
+ case HcInt::TrombeWall:
CalcTrombeWallIntConvCoeff(state, ZoneNum, SurfaceTemperatures);
break;
default:;
// nothing
}
}
+
for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) {
- for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
+ auto const &zone = state.dataHeatBal->Zone(ZoneNum);
+ for (int spaceNum : zone.spaceIndexes) {
auto const &thisSpace = state.dataHeatBal->space(spaceNum);
for (int SurfNum = thisSpace.HTSurfaceFirst; SurfNum <= thisSpace.HTSurfaceLast; ++SurfNum) {
@@ -314,69 +287,66 @@ void InitInteriorConvectionCoeffs(EnergyPlusData &state,
continue; // skip surfaces that are not associated with this zone
}
}
- auto const &surface(Surface(SurfNum));
+ auto const &surface = Surface(SurfNum);
if (state.dataSurface->UseRepresentativeSurfaceCalculations) {
int repSurfNum = surface.RepresentativeCalcSurfNum;
if (SurfNum != repSurfNum) continue;
}
- int algoNum;
- bool standardAlgo;
- if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) <= -1) { // Set by user using one of the standard algorithms...
- algoNum = std::abs(state.dataSurface->SurfIntConvCoeffIndex(SurfNum));
- standardAlgo = true;
- } else if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) ==
- ConvectionConstants::HcInt_SetByZone) { // Not set by user, uses Zone Setting
- algoNum = Zone(ZoneNum).InsideConvectionAlgo;
- standardAlgo = true;
- } else {
- algoNum = Zone(ZoneNum).InsideConvectionAlgo;
- standardAlgo = false;
+ HcInt intConvAlgo = state.dataSurface->surfIntConv(SurfNum).model;
+ if (intConvAlgo == HcInt::SetByZone) {
+ intConvAlgo = zone.IntConvAlgo;
}
- if (standardAlgo) {
- switch (algoNum) {
- case ConvectionConstants::HcInt_ASHRAESimple: {
- CalcASHRAESimpleIntConvCoeff(
- state, SurfNum, SurfaceTemperatures(SurfNum), state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT);
- // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems)
- if (state.dataHeatBalSurf->SurfHConvInt(SurfNum) < state.dataHeatBal->LowHConvLimit)
- state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataHeatBal->LowHConvLimit;
- } break;
- case ConvectionConstants::HcInt_ASHRAETARP: {
- if (!state.dataConstruction->Construct(Surface(SurfNum).Construction).TypeIsWindow) {
- CalcASHRAEDetailedIntConvCoeff(
- state, SurfNum, SurfaceTemperatures(SurfNum), state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT);
- } else {
- CalcISO15099WindowIntConvCoeff(
- state, SurfNum, SurfaceTemperatures(SurfNum), state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT);
- }
+ switch (intConvAlgo) {
+ case HcInt::Value:
+ case HcInt::Schedule:
+ case HcInt::UserCurve: {
+ state.dataHeatBalSurf->SurfHConvInt(SurfNum) = SetIntConvCoeff(state, SurfNum);
+ // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems)
+ if (state.dataHeatBalSurf->SurfHConvInt(SurfNum) < state.dataHeatBal->LowHConvLimit)
+ state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataHeatBal->LowHConvLimit;
+ } break;
+
+ case HcInt::ASHRAESimple: {
+ CalcASHRAESimpleIntConvCoeff(
+ state, SurfNum, SurfaceTemperatures(SurfNum), state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT);
+ // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems)
+ if (state.dataHeatBalSurf->SurfHConvInt(SurfNum) < state.dataHeatBal->LowHConvLimit)
+ state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataHeatBal->LowHConvLimit;
+ } break;
- // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems)
- if (state.dataHeatBalSurf->SurfHConvInt(SurfNum) < state.dataHeatBal->LowHConvLimit)
- state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataHeatBal->LowHConvLimit;
- } break;
- case ConvectionConstants::HcInt_AdaptiveConvectionAlgorithm: {
- ManageInsideAdaptiveConvectionAlgo(state, SurfNum);
- } break;
- case ConvectionConstants::HcInt_CeilingDiffuser:
- case ConvectionConstants::HcInt_TrombeWall: {
- // Already done above and can't be at individual surface
- } break;
- case ConvectionConstants::HcInt_ASTMC1340: {
- CalcASTMC1340ConvCoeff(
+ case HcInt::ASHRAETARP: {
+ if (!state.dataConstruction->Construct(Surface(SurfNum).Construction).TypeIsWindow) {
+ CalcASHRAEDetailedIntConvCoeff(
+ state, SurfNum, SurfaceTemperatures(SurfNum), state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT);
+ } else {
+ CalcISO15099WindowIntConvCoeff(
state, SurfNum, SurfaceTemperatures(SurfNum), state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT);
- } break;
- default: {
- ShowFatalError(state, "Unhandled convection coefficient algorithm.");
- } break;
}
- } else { // Interior convection has been set by the user with "value" or "schedule"
- 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.dataHeatBalSurf->SurfHConvInt(SurfNum) < state.dataHeatBal->LowHConvLimit)
state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataHeatBal->LowHConvLimit;
+ } break;
+
+ case HcInt::AdaptiveConvectionAlgorithm: {
+ ManageIntAdaptiveConvAlgo(state, SurfNum);
+ } break;
+
+ case HcInt::CeilingDiffuser:
+ case HcInt::TrombeWall: {
+ // Already done above and can't be at individual surface
+ } break;
+
+ case HcInt::ASTMC1340: {
+ CalcASTMC1340ConvCoeff(
+ state, SurfNum, SurfaceTemperatures(SurfNum), state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT);
+ } break;
+
+ default: {
+ ShowFatalError(state, "Unhandled convection coefficient algorithm."); // assert?
+ } break;
}
if (state.dataSurface->SurfEMSOverrideIntConvCoef(SurfNum)) {
@@ -386,9 +356,10 @@ void InitInteriorConvectionCoeffs(EnergyPlusData &state,
state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].in = KIVA_CONST_CONV(hConst);
}
}
- }
- }
- }
+
+ } // for (surface)
+ } // for (space)
+ } // for (zone)
for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) {
for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
@@ -408,16 +379,17 @@ void InitInteriorConvectionCoeffs(EnergyPlusData &state,
}
}
-void InitExteriorConvectionCoeff(EnergyPlusData &state,
- int const SurfNum, // Surface number (in Surface derived type)
- Real64 const HMovInsul, // Equivalent convection coefficient of movable insulation
- Material::SurfaceRoughness const Roughness, // Roughness index (1-6), see DataHeatBalance parameters
- Real64 const AbsExt, // Exterior thermal absorptance
- Real64 const TempExt, // Exterior surface temperature (C)
- Real64 &HExt, // Convection coefficient to exterior air
- Real64 &HSky, // "Convection" coefficient to sky temperature
- Real64 &HGround, // "Convection" coefficient to ground temperature
- Real64 &HAir // Radiation to Air Component
+void InitExtConvCoeff(EnergyPlusData &state,
+ int const SurfNum, // Surface number (in Surface derived type)
+ Real64 const HMovInsul, // Equivalent convection coefficient of movable insulation
+ Material::SurfaceRoughness const Roughness, // Roughness index (1-6), see DataHeatBalance parameters
+ Real64 const AbsExt, // Exterior thermal absorptance
+ Real64 const TempExt, // Exterior surface temperature (C)
+ Real64 &HExt, // Convection coefficient to exterior air
+ Real64 &HSky, // "Convection" coefficient to sky temperature
+ Real64 &HGround, // "Convection" coefficient to ground temperature
+ Real64 &HAir, // Radiation to Air Component
+ Real64 &HSrdSurf // Radiation to surrounding surfaces
)
{
@@ -450,18 +422,18 @@ void InitExteriorConvectionCoeff(EnergyPlusData &state,
Real64 Hf; // Forced part of exterior convection
Real64 rCalcPerimeter; // approximation for Perimeter
- auto const &Zone(state.dataHeatBal->Zone);
auto const &surface = state.dataSurface->Surface(SurfNum);
- if (state.dataConvectionCoefficient->GetUserSuppliedConvectionCoeffs) {
- GetUserConvectionCoefficients(state);
- state.dataConvectionCoefficient->GetUserSuppliedConvectionCoeffs = false;
+ if (state.dataConvect->GetUserSuppliedConvectionCoeffs) {
+ GetUserConvCoeffs(state);
+ state.dataConvect->GetUserSuppliedConvectionCoeffs = false;
}
Real64 TAir = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + Constant::KelvinConv;
Real64 TSurf = TempExt + Constant::KelvinConv;
Real64 TSky = state.dataEnvrn->SkyTempKelvin;
Real64 TGround = TAir;
+ HSrdSurf = 0.0;
if (surface.SurfHasSurroundingSurfProperty) {
int SrdSurfsNum = surface.SurfSurroundingSurfacesNum;
@@ -469,6 +441,7 @@ void InitExteriorConvectionCoeff(EnergyPlusData &state,
TSky = ScheduleManager::GetCurrentScheduleValue(state, state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).SkyTempSchNum) +
Constant::KelvinConv;
}
+ HSrdSurf = SurroundingSurfacesRadCoeffAverage(state, SurfNum, TSurf, AbsExt);
}
if (surface.UseSurfPropertyGndSurfTemp) {
int gndSurfsNum = surface.SurfPropertyGndSurfIndex;
@@ -488,183 +461,175 @@ void InitExteriorConvectionCoeff(EnergyPlusData &state,
}
// Check if exterior is to be set by user
-
- int algoNum;
- bool standardAlgo;
- if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) <= -1) { // Set by user using one of the standard algorithms...
- algoNum = std::abs(state.dataSurface->SurfExtConvCoeffIndex(SurfNum));
- standardAlgo = true;
- } else if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) == 0) { // Not set by user, uses Zone Setting
- algoNum = Zone(surface.Zone).OutsideConvectionAlgo;
- standardAlgo = true;
- } else {
- algoNum = Zone(surface.Zone).OutsideConvectionAlgo;
- standardAlgo = false;
+ HcExt extConvAlgo = state.dataSurface->surfExtConv(SurfNum).model;
+ if (extConvAlgo == HcExt::SetByZone) {
+ extConvAlgo = state.dataHeatBal->Zone(surface.Zone).ExtConvAlgo;
}
- if (standardAlgo) {
+ switch (extConvAlgo) {
+ case HcExt::Value:
+ case HcExt::Schedule:
+ case HcExt::UserCurve: {
+ HExt = SetExtConvCoeff(state, SurfNum);
+ } break;
- switch (algoNum) {
- case ConvectionConstants::HcExt_ASHRAESimple:
- if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
- state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = [](double, double, double, double windSpeed) -> double {
- return windSpeed;
+ case HcExt::ASHRAESimple: {
+ if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
+ state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = [](double, double, double, double windSpeed) -> double {
+ return windSpeed;
+ };
+ state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].out = [=](double, double, double hfTerm, double, double) -> double {
+ return CalcASHRAESimpExtConvCoeff(Roughness, hfTerm);
+ };
+ } else {
+ HExt = CalcASHRAESimpExtConvCoeff(Roughness, SurfWindSpeed); // includes radiation to sky, ground, and air
+ }
+ } break;
+
+ case HcExt::ASHRAETARP:
+ case HcExt::BLASTHcOutside:
+ case HcExt::TarpHcOutside: {
+ // Convection is split into forced and natural components. The total
+ // convective heat transfer coefficient is the sum of these components.
+ // Coefficients for subsurfaces are handled in a special way. The values for perimeter and gross area
+ // are actually referencing the base surface because a subsurface does not initiate a completely new
+ // thermal boundary layer (although it may add some additional complexity that cannot be accounted for
+ // here). The values for height (Z) and roughness do, however, come from the subsurface.
+ // BLAST algorithm has been replaced by this one since it was identical except for the standard wind
+ // speed measurement height which was only different because of unit conversions: 10 m vs. 30 ft (= 9.14 m).
+ // ASHRAE/BLAST REFERENCES:
+ // ?
+ // TARP REFERENCES:
+ // Walton, G. N. 1983. Thermal Analysis Research Program Reference Manual.
+ // National Bureau of Standards. NBSSIR 83-2655.
+
+ // due to outlying calculations when perimeter is very small compared to area, use Perimeter
+ // approximation calculation
+
+ if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
+ if (surface.Class == SurfaceClass::Wall) {
+ auto const &fnd = state.dataSurfaceGeometry->kivaManager.surfaceMap[SurfNum].get_instance(0).first->foundation;
+ const double length = fnd.netPerimeter;
+ const double height = fnd.wall.heightAboveGrade;
+ const double area = length * height;
+ const double perim = 2.0 * (length + height);
+ state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, double windSpeed) -> double {
+ // Average windward and leeward since all walls use same algorithm
+ double windwardHf = CalcSparrowWindward(Roughness, perim, area, windSpeed);
+ double leewardHf = CalcSparrowLeeward(Roughness, perim, area, windSpeed);
+ return (windwardHf + leewardHf) / 2.0;
};
- state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].out = [=](double, double, double hfTerm, double, double) -> double {
- return CalcASHRAESimpExtConvectCoeff(Roughness, hfTerm);
+ } else { // Slab (used for exterior grade convection)
+ // Assume very large area for grade (relative to perimeter).
+ constexpr double area = 9999999.;
+ constexpr double perim = 1.;
+ state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, double windSpeed) -> double {
+ return CalcSparrowWindward(Roughness, perim, area, windSpeed);
};
- } else {
- HExt = CalcASHRAESimpExtConvectCoeff(Roughness, SurfWindSpeed); // includes radiation to sky, ground, and air
}
- break;
- case ConvectionConstants::HcExt_ASHRAETARP:
- case ConvectionConstants::HcExt_BLASTHcOutside:
- case ConvectionConstants::HcExt_TarpHcOutside:
- // Convection is split into forced and natural components. The total
- // convective heat transfer coefficient is the sum of these components.
- // Coefficients for subsurfaces are handled in a special way. The values for perimeter and gross area
- // are actually referencing the base surface because a subsurface does not initiate a completely new
- // thermal boundary layer (although it may add some additional complexity that cannot be accounted for
- // here). The values for height (Z) and roughness do, however, come from the subsurface.
- // BLAST algorithm has been replaced by this one since it was identical except for the standard wind
- // speed measurement height which was only different because of unit conversions: 10 m vs. 30 ft (= 9.14 m).
- // ASHRAE/BLAST REFERENCES:
- // ?
- // TARP REFERENCES:
- // Walton, G. N. 1983. Thermal Analysis Research Program Reference Manual.
- // National Bureau of Standards. NBSSIR 83-2655.
-
- // due to outlying calculations when perimeter is very small compared to area, use Perimeter
- // approximation calculation
-
- if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
- if (surface.Class == SurfaceClass::Wall) {
- auto const &fnd = state.dataSurfaceGeometry->kivaManager.surfaceMap[SurfNum].get_instance(0).first->foundation;
- const double length = fnd.netPerimeter;
- const double height = fnd.wall.heightAboveGrade;
- const double area = length * height;
- const double perim = 2.0 * (length + height);
- state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, double windSpeed) -> double {
- // Average windward and leeward since all walls use same algorithm
- double windwardHf = CalcSparrowWindward(Roughness, perim, area, windSpeed);
- double leewardHf = CalcSparrowLeeward(Roughness, perim, area, windSpeed);
- return (windwardHf + leewardHf) / 2.0;
- };
- } else { // Slab (used for exterior grade convection)
- // Assume very large area for grade (relative to perimeter).
- constexpr double area = 9999999.;
- constexpr double perim = 1.;
- state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, double windSpeed) -> double {
- return CalcSparrowWindward(Roughness, perim, area, windSpeed);
- };
- }
- state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].out =
- [=](double Tsurf, double Tamb, double hfTerm, double, double cosTilt) -> double {
- Real64 Ts = Tsurf;
- if (HMovInsul > 0.0) Ts = (HMovInsul * Tsurf + hfTerm * Tamb) / (HMovInsul + hfTerm);
- return CalcASHRAETARPNatural(Ts, Tamb, cosTilt) + hfTerm;
- };
+ state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].out =
+ [=](double Tsurf, double Tamb, double hfTerm, double, double cosTilt) -> double {
+ Real64 Ts = Tsurf;
+ if (HMovInsul > 0.0) Ts = (HMovInsul * Tsurf + hfTerm * Tamb) / (HMovInsul + hfTerm);
+ return CalcASHRAETARPNatural(Ts, Tamb, cosTilt) + hfTerm;
+ };
+ } else {
+ if (state.dataSurface->Surface(BaseSurf).GrossArea != 0.0 && state.dataSurface->Surface(BaseSurf).Height != 0.0) {
+ rCalcPerimeter = 2.0 * (state.dataSurface->Surface(BaseSurf).GrossArea / state.dataSurface->Surface(BaseSurf).Height +
+ state.dataSurface->Surface(BaseSurf).Height);
+ Hf = CalcHfExteriorSparrow(SurfWindSpeed,
+ state.dataSurface->Surface(BaseSurf).GrossArea,
+ rCalcPerimeter,
+ surface.CosTilt,
+ surface.Azimuth,
+ Roughness,
+ SurfWindDir);
} else {
- if (state.dataSurface->Surface(BaseSurf).GrossArea != 0.0 && state.dataSurface->Surface(BaseSurf).Height != 0.0) {
- rCalcPerimeter = 2.0 * (state.dataSurface->Surface(BaseSurf).GrossArea / state.dataSurface->Surface(BaseSurf).Height +
- state.dataSurface->Surface(BaseSurf).Height);
- Hf = CalcHfExteriorSparrow(SurfWindSpeed,
- state.dataSurface->Surface(BaseSurf).GrossArea,
- rCalcPerimeter,
- surface.CosTilt,
- surface.Azimuth,
- Roughness,
- SurfWindDir);
- } else {
- Hf = 0.0;
- }
-
- if (HMovInsul > 0.0) TSurf = (HMovInsul * TSurf + Hf * TAir) / (HMovInsul + Hf);
- Hn = CalcASHRAETARPNatural(TSurf, TAir, surface.CosTilt);
- HExt = Hn + Hf;
+ Hf = 0.0;
}
- break;
- case ConvectionConstants::HcExt_MoWiTTHcOutside:
- if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
+ if (HMovInsul > 0.0) TSurf = (HMovInsul * TSurf + Hf * TAir) / (HMovInsul + Hf);
+ Hn = CalcASHRAETARPNatural(TSurf, TAir, surface.CosTilt);
+ HExt = Hn + Hf;
+ }
+ } break;
- if (surface.Class == SurfaceClass::Wall) {
- state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, double windSpeed) -> double {
- // Average windward and leeward since all walls use same algorithm
- double windwardHf = CalcMoWITTForcedWindward(windSpeed);
- double leewardHf = CalcMoWITTForcedLeeward(windSpeed);
- return (windwardHf + leewardHf) / 2.0;
- };
- } else {
- state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, double windSpeed) -> double {
- return CalcMoWITTForcedWindward(windSpeed);
- };
- }
- state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].out =
- [=](double Tsurf, double Tamb, double hfTerm, double, double) -> double {
- Real64 Hn = CalcMoWITTNatural(Tsurf - Tamb);
- return std::sqrt(pow_2(Hn) + pow_2(hfTerm));
+ case HcExt::MoWiTTHcOutside: {
+ if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
+ if (surface.Class == SurfaceClass::Wall) {
+ state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, double windSpeed) -> double {
+ // Average windward and leeward since all walls use same algorithm
+ double windwardHf = CalcMoWITTForcedWindward(windSpeed);
+ double leewardHf = CalcMoWITTForcedLeeward(windSpeed);
+ return (windwardHf + leewardHf) / 2.0;
};
} else {
- // NOTE: Movable insulation is not taken into account here
- if (Windward(surface.CosTilt, surface.Azimuth, SurfWindDir)) {
- HExt = CalcMoWITTWindward(TAir - TSurf, SurfWindSpeed);
- } else { // leeward
- HExt = CalcMoWITTLeeward(TAir - TSurf, SurfWindSpeed);
- }
+ state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, double windSpeed) -> double {
+ return CalcMoWITTForcedWindward(windSpeed);
+ };
}
- break;
- case ConvectionConstants::HcExt_DOE2HcOutside:
- if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
- if (surface.Class == SurfaceClass::Wall) {
- state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, double windSpeed) -> double {
- // Average windward and leeward since all walls use same algorithm
- double windwardHf = CalcMoWITTForcedWindward(windSpeed);
- double leewardHf = CalcMoWITTForcedLeeward(windSpeed);
- return (windwardHf + leewardHf) / 2.0;
- };
- } else {
- state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, double windSpeed) -> double {
- return CalcMoWITTForcedWindward(windSpeed);
- };
- }
- state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].out =
- [=](double Tsurf, double Tamb, double hfTerm, double, double cosTilt) -> double {
- Real64 Hf = CalcDOE2Forced(Tsurf, Tamb, cosTilt, hfTerm, Roughness);
-
- Real64 Ts = Tsurf;
- if (HMovInsul > 0.0) {
- Ts = (HMovInsul * TSurf + Hf * Tamb) / (HMovInsul + Hf);
- }
+ state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].out =
+ [=](double Tsurf, double Tamb, double hfTerm, double, double) -> double {
+ Real64 Hn = CalcMoWITTNatural(Tsurf - Tamb);
+ return std::sqrt(pow_2(Hn) + pow_2(hfTerm));
+ };
+ } else {
+ // NOTE: Movable insulation is not taken into account here
+ if (Windward(surface.CosTilt, surface.Azimuth, SurfWindDir)) {
+ HExt = CalcMoWITTWindward(TAir - TSurf, SurfWindSpeed);
+ } else { // leeward
+ HExt = CalcMoWITTLeeward(TAir - TSurf, SurfWindSpeed);
+ }
+ }
+ } break;
- Real64 Hn = CalcASHRAETARPNatural(Ts, Tamb, cosTilt);
- return Hn + Hf;
+ case HcExt::DOE2HcOutside: {
+ if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
+ if (surface.Class == SurfaceClass::Wall) {
+ state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, double windSpeed) -> double {
+ // Average windward and leeward since all walls use same algorithm
+ double windwardHf = CalcMoWITTForcedWindward(windSpeed);
+ double leewardHf = CalcMoWITTForcedLeeward(windSpeed);
+ return (windwardHf + leewardHf) / 2.0;
};
} else {
- if (Windward(surface.CosTilt, surface.Azimuth, SurfWindDir)) {
- Hf = CalcDOE2Windward(TSurf, TAir, surface.CosTilt, SurfWindSpeed, Roughness);
- } else { // leeward
- Hf = CalcDOE2Leeward(TSurf, TAir, surface.CosTilt, SurfWindSpeed, Roughness);
- }
+ state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, double windSpeed) -> double {
+ return CalcMoWITTForcedWindward(windSpeed);
+ };
+ }
+ state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].out =
+ [=](double Tsurf, double Tamb, double hfTerm, double, double cosTilt) -> double {
+ Real64 Hf = CalcDOE2Forced(Tsurf, Tamb, cosTilt, hfTerm, Roughness);
+ Real64 Ts = Tsurf;
if (HMovInsul > 0.0) {
- TSurf = (HMovInsul * TSurf + Hf * TAir) / (HMovInsul + Hf);
+ Ts = (HMovInsul * TSurf + Hf * Tamb) / (HMovInsul + Hf);
}
- Hn = CalcASHRAETARPNatural(TSurf, TAir, surface.CosTilt);
- // Better if there was iteration for movable insulation?
-
- HExt = Hn + Hf;
+ Real64 Hn = CalcASHRAETARPNatural(Ts, Tamb, cosTilt);
+ return Hn + Hf;
+ };
+ } else {
+ if (Windward(surface.CosTilt, surface.Azimuth, SurfWindDir)) {
+ Hf = CalcDOE2Windward(TSurf, TAir, surface.CosTilt, SurfWindSpeed, Roughness);
+ } else { // leeward
+ Hf = CalcDOE2Leeward(TSurf, TAir, surface.CosTilt, SurfWindSpeed, Roughness);
}
- break;
- case ConvectionConstants::HcExt_AdaptiveConvectionAlgorithm:
- ManageOutsideAdaptiveConvectionAlgo(state, SurfNum, HExt);
- break;
- default:
- ShowFatalError(state, format("InitExtConvection Coefficients: invalid parameter -- outside convection type, Surface={}", surface.Name));
+ if (HMovInsul > 0.0) {
+ TSurf = (HMovInsul * TSurf + Hf * TAir) / (HMovInsul + Hf);
+ }
+
+ Hn = CalcASHRAETARPNatural(TSurf, TAir, surface.CosTilt);
+ // Better if there was iteration for movable insulation?
+ HExt = Hn + Hf;
}
+ } break;
- } else { // Exterior convection scheme for this surface has been set by user
+ case HcExt::AdaptiveConvectionAlgorithm: {
+ HExt = ManageExtAdaptiveConvAlgo(state, SurfNum);
+ } break;
- HExt = SetExtConvectionCoeff(state, SurfNum);
+ default: {
+ ShowFatalError(state, format("InitExtConvection Coefficients: invalid parameter -- outside convection type, Surface={}", surface.Name));
+ } break;
}
if (state.dataSurface->SurfEMSOverrideExtConvCoef(SurfNum)) {
@@ -678,7 +643,7 @@ void InitExteriorConvectionCoeff(EnergyPlusData &state,
HExt = HExt * state.dataHeatBalSurf->SurfWinCoeffAdjRatio(SurfNum);
- if (TSurf == TSky || algoNum == ConvectionConstants::HcExt_ASHRAESimple) {
+ if (TSurf == TSky || extConvAlgo == HcExt::ASHRAESimple) {
HSky = 0.0;
} else {
// Compute sky radiation coefficient
@@ -686,7 +651,7 @@ void InitExteriorConvectionCoeff(EnergyPlusData &state,
(pow_4(TSurf) - pow_4(TSky)) / (TSurf - TSky);
}
- if (TSurf == TAir || algoNum == ConvectionConstants::HcExt_ASHRAESimple) {
+ if (TSurf == TAir || extConvAlgo == HcExt::ASHRAESimple) {
HGround = 0.0;
HAir = 0.0;
} else {
@@ -724,8 +689,6 @@ bool Windward(Real64 const CosTilt, // Cosine of the surface tilt angle
// FUNCTION INFORMATION:
// AUTHOR Linda K. Lawrie
// DATE WRITTEN September 2003
- // MODIFIED na
- // RE-ENGINEERED na
// PURPOSE OF THIS FUNCTION:
// This function determines if a surface is "windward" or "leeward" (that is,
@@ -741,94 +704,21 @@ bool Windward(Real64 const CosTilt, // Cosine of the surface tilt angle
// United States Army Construction Engineering Research Laboratory,
// Champaign, IL.
- // Return value
- bool AgainstWind; // True for windward, false for leeward.
-
- // FUNCTION LOCAL VARIABLE DECLARATIONS:
- Real64 Diff; // Difference between the wind direction and the surface azimuth
-
- AgainstWind = true;
- if (std::abs(CosTilt) < 0.98) { // Surface is not horizontal
- Diff = std::abs(WindDirection - Azimuth);
- if ((Diff - 180.0) > 0.001) Diff -= 360.0;
- if ((std::abs(Diff) - 90.0) > 0.001) AgainstWind = false; // Surface is leeward
- }
+ // Surface is horizontal
+ if (std::abs(CosTilt) >= 0.98) return true;
- return AgainstWind;
+ Real64 Diff = std::abs(WindDirection - Azimuth); // Difference between the wind direction and the surface azimuth
+ if ((Diff - 180.0) > 0.001) Diff -= 360.0;
+ return ((std::abs(Diff) - 90.0) <= 0.001);
}
-int SetInsideAdaptiveConvectionAlgo(EnergyPlusData &state,
- const std::unordered_map &HcInt_ConvectionTypesMap,
- bool &ErrorsFound,
- const std::string &equationName,
- const std::string &curveName,
- const std::string &sourceFieldName,
- const std::string &curveFieldName,
- const std::string_view RoutineName,
- const std::string_view CurrentModuleObject)
-{
-
- int InsideAdaptiveConvectionAlgoParam = 0;
-
- if (HcInt_ConvectionTypesMap.find(equationName) != HcInt_ConvectionTypesMap.end()) {
- int HcInt = HcInt_ConvectionTypesMap.at(equationName);
- InsideAdaptiveConvectionAlgoParam = HcInt;
- if (HcInt == ConvectionConstants::HcInt_UserCurve) {
- InsideAdaptiveConvectionAlgoParam = UtilityRoutines::FindItemInList(curveName, state.dataConvectionCoefficient->HcInsideUserCurve);
- if (InsideAdaptiveConvectionAlgoParam == 0) {
- ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, equationName));
- ShowContinueError(state, format("Invalid Name choice Entered, for {}={}", curveFieldName, curveName));
- ErrorsFound = true;
- }
- }
- } else {
- ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, equationName));
- ShowContinueError(state, format("Invalid Key choice Entered, for {}={}", sourceFieldName, equationName));
- ErrorsFound = true;
- }
- return InsideAdaptiveConvectionAlgoParam;
-}
-
-int SetOutsideAdaptiveConvectionAlgo(EnergyPlusData &state,
- const std::unordered_map &HcExt_ConvectionTypesMap,
- bool &ErrorsFound,
- const std::string &equationName,
- const std::string &curveName,
- const std::string &sourceFieldName,
- const std::string &curveFieldName,
- const std::string_view RoutineName,
- const std::string_view CurrentModuleObject)
-{
-
- int OutsideAdaptiveConvectionAlgoParam = 0;
-
- if (HcExt_ConvectionTypesMap.find(equationName) != HcExt_ConvectionTypesMap.end()) {
- int HcInt = HcExt_ConvectionTypesMap.at(equationName);
- OutsideAdaptiveConvectionAlgoParam = HcInt;
- if (HcInt == ConvectionConstants::HcExt_UserCurve) {
- OutsideAdaptiveConvectionAlgoParam = UtilityRoutines::FindItemInList(curveName, state.dataConvectionCoefficient->HcOutsideUserCurve);
- if (OutsideAdaptiveConvectionAlgoParam == 0) {
- ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, equationName));
- ShowContinueError(state, format("Invalid Name choice Entered, for {}={}", curveFieldName, curveName));
- ErrorsFound = true;
- }
- }
- } else {
- ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, equationName));
- ShowContinueError(state, format("Invalid Key choice Entered, for {}={}", sourceFieldName, equationName));
- ErrorsFound = true;
- }
- return OutsideAdaptiveConvectionAlgoParam;
-}
-
-void GetUserConvectionCoefficients(EnergyPlusData &state)
+void GetUserConvCoeffs(EnergyPlusData &state)
{
// SUBROUTINE INFORMATION:
// AUTHOR Linda K. Lawrie
// DATE WRITTEN February 2003
// MODIFIED November 2004; add more "user supplied convection coefficients"
- // RE-ENGINEERED na
// PURPOSE OF THIS SUBROUTINE:
// This subroutine gets the input for the object "Convection Coefficients" which
@@ -838,344 +728,200 @@ void GetUserConvectionCoefficients(EnergyPlusData &state)
// SUBROUTINE PARAMETER DEFINITIONS:
static constexpr std::string_view RoutineName("GetUserConvectionCoefficients");
- const std::unordered_set ValidSurfaceTypes = {"ALLEXTERIORSURFACES",
- "ALLEXTERIORWINDOWS",
- "ALLEXTERIORWALLS",
- "ALLEXTERIORROOFS",
- "ALLEXTERIORFLOORS",
- "ALLINTERIORSURFACES",
- "ALLINTERIORWINDOWS",
- "ALLINTERIORWALLS",
- "ALLINTERIORROOFS",
- "ALLINTERIORCEILINGS",
- "ALLINTERIORFLOORS"};
-
- const std::unordered_map HcInt_ConvectionTypesMap = {
- {"VALUE", ConvectionConstants::HcInt_Value},
- {"SCHEDULE", ConvectionConstants::HcInt_Schedule},
- {"SIMPLE", ConvectionConstants::HcInt_ASHRAESimple},
- {"TARP", ConvectionConstants::HcInt_ASHRAETARP},
- {"ADAPTIVECONVECTIONALGORITHM", ConvectionConstants::HcInt_AdaptiveConvectionAlgorithm},
- {"ASTMC1340", ConvectionConstants::HcInt_ASTMC1340},
- {"USERCURVE", ConvectionConstants::HcInt_UserCurve},
- {"ASHRAEVERTICALWALL", ConvectionConstants::HcInt_ASHRAEVerticalWall},
- {"WALTONUNSTABLEHORIZONTALORTILT", ConvectionConstants::HcInt_WaltonUnstableHorizontalOrTilt},
- {"WALTONSTABLEHORIZONTALORTILT", ConvectionConstants::HcInt_WaltonStableHorizontalOrTilt},
- {"FISHERPEDERSENCEILINGDIFFUSERWALLS", ConvectionConstants::HcInt_FisherPedersenCeilDiffuserWalls},
- {"FISHERPEDERSENCEILINGDIFFUSERCEILING", ConvectionConstants::HcInt_FisherPedersenCeilDiffuserCeiling},
- {"FISHERPEDERSENCEILINGDIFFUSERFLOOR", ConvectionConstants::HcInt_FisherPedersenCeilDiffuserFloor},
- {"ALAMDARIHAMMONDSTABLEHORIZONTAL", ConvectionConstants::HcInt_AlamdariHammondStableHorizontal},
- {"ALAMDARIHAMMONDUNSTABLEHORIZONTAL", ConvectionConstants::HcInt_AlamdariHammondUnstableHorizontal},
- {"ALAMDARIHAMMONDVERTICALWALL", ConvectionConstants::HcInt_AlamdariHammondVerticalWall},
- {"KHALIFAEQ3WALLAWAYFROMHEAT", ConvectionConstants::HcInt_KhalifaEq3WallAwayFromHeat},
- {"KHALIFAEQ4CEILINGAWAYFROMHEAT", ConvectionConstants::HcInt_KhalifaEq4CeilingAwayFromHeat},
- {"KHALIFAEQ5WALLNEARHEAT", ConvectionConstants::HcInt_KhalifaEq5WallNearHeat},
- {"KHALIFAEQ6NONHEATEDWALLS", ConvectionConstants::HcInt_KhalifaEq6NonHeatedWalls},
- {"KHALIFAEQ7CEILING", ConvectionConstants::HcInt_KhalifaEq7Ceiling},
- {"AWBIHATTONHEATEDFLOOR", ConvectionConstants::HcInt_AwbiHattonHeatedFloor},
- {"AWBIHATTONHEATEDWALL", ConvectionConstants::HcInt_AwbiHattonHeatedWall},
- {"BEAUSOLEILMORRISONMIXEDASSISTEDWALL", ConvectionConstants::HcInt_BeausoleilMorrisonMixedAssistingWall},
- {"BEAUSOLEILMORRISONMIXEDOPPOSINGWALL", ConvectionConstants::HcInt_BeausoleilMorrisonMixedOppossingWall},
- {"BEAUSOLEILMORRISONMIXEDSTABLEFLOOR", ConvectionConstants::HcInt_BeausoleilMorrisonMixedStableFloor},
- {"BEAUSOLEILMORRISONMIXEDUNSTABLEFLOOR", ConvectionConstants::HcInt_BeausoleilMorrisonMixedUnstableFloor},
- {"BEAUSOLEILMORRISONMIXEDSTABLECEILING", ConvectionConstants::HcInt_BeausoleilMorrisonMixedStableCeiling},
- {"BEAUSOLEILMORRISONMIXEDUNSTABLECEILING", ConvectionConstants::HcInt_BeausoleilMorrisonMixedUnstableCeiling},
- {"FOHANNOPOLIDORIVERTICALWALL", ConvectionConstants::HcInt_FohannoPolidoriVerticalWall},
- {"KARADAGCHILLEDCEILING", ConvectionConstants::HcInt_KaradagChilledCeiling},
- {"ISO15099WINDOWS", ConvectionConstants::HcInt_ISO15099Windows},
- {"GOLDSTEINNOVOSELACCEILINGDIFFUSERWINDOW", ConvectionConstants::HcInt_GoldsteinNovoselacCeilingDiffuserWindow},
- {"GOLDSTEINNOVOSELACCEILINGDIFFUSERWALLS", ConvectionConstants::HcInt_GoldsteinNovoselacCeilingDiffuserWalls},
- {"GOLDSTEINNOVOSELACCEILINGDIFFUSERFLOOR", ConvectionConstants::HcInt_GoldsteinNovoselacCeilingDiffuserFloor},
- };
-
- std::unordered_map HcExt_ConvectionTypesMap = {
- {"VALUE", ConvectionConstants::HcExt_Value},
- {"SCHEDULE", ConvectionConstants::HcExt_Schedule},
- {"TARP", ConvectionConstants::HcExt_TarpHcOutside},
- {"SIMPLE", ConvectionConstants::HcExt_ASHRAESimple},
- {"MOWITT", ConvectionConstants::HcExt_MoWiTTHcOutside},
- {"DOE-2", ConvectionConstants::HcExt_DOE2HcOutside},
- {"ADAPTIVECONVECTIONALGORITHM", ConvectionConstants::HcExt_AdaptiveConvectionAlgorithm},
- {"USERCURVE", ConvectionConstants::HcExt_UserCurve},
- {"ASHRAEVERTICALWALL", ConvectionConstants::HcExt_NaturalASHRAEVerticalWall},
- {"WALTONUNSTABLEHORIZONTALORTILT", ConvectionConstants::HcExt_NaturalWaltonUnstableHorizontalOrTilt},
- {"WALTONSTABLEHORIZONTALORTILT", ConvectionConstants::HcExt_NaturalWaltonStableHorizontalOrTilt},
- {"NUSSELTJURGES", ConvectionConstants::HcExt_NusseltJurges},
- {"MCADAMS", ConvectionConstants::HcExt_McAdams},
- {"MITCHELL", ConvectionConstants::HcExt_Mitchell},
- {"CLEARROOF", ConvectionConstants::HcExt_ClearRoof},
- {"EMMELVERTICAL", ConvectionConstants::HcExt_EmmelVertical},
- {"EMMELROOF", ConvectionConstants::HcExt_EmmelRoof},
- {"ALAMDARIHAMMONDVERTICALWALL", ConvectionConstants::HcExt_AlamdariHammondVerticalWall},
- {"FOHANNOPOLIDORIVERTICALWALL", ConvectionConstants::HcExt_FohannoPolidoriVerticalWall},
- {"ISO15099WINDOWS", ConvectionConstants::HcExt_ISO15099Windows},
- {"ALAMDARIHAMMONDSTABLEHORIZONTAL", ConvectionConstants::HcExt_AlamdariHammondStableHorizontal},
- {"ALAMDARIHAMMONDUNSTABLEHORIZONTAL", ConvectionConstants::HcExt_AlamdariHammondUnstableHorizontal},
- {"SIMPLECOMBINED", ConvectionConstants::HcExt_ASHRAESimpleCombined},
- {"TARPWINDWARD", ConvectionConstants::HcExt_SparrowWindward},
- {"TARPLEEWARD", ConvectionConstants::HcExt_SparrowLeeward},
- {"MOWITTWINDWARD", ConvectionConstants::HcExt_MoWiTTWindward},
- {"MOWITTLEEWARD", ConvectionConstants::HcExt_MoWiTTLeeward},
- {"DOE2WINDWARD", ConvectionConstants::HcExt_DOE2Windward},
- {"DOE2LEEWARD", ConvectionConstants::HcExt_DOE2Leeward},
- {"BLOCKENWINDWARD", ConvectionConstants::HcExt_BlockenWindward},
- };
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
Array1D_string Alphas(9);
Array1D Numbers(2);
int NumAlphas;
int NumNumbers;
- int Count;
int Status;
bool ErrorsFound(false);
- int ExtValue;
- int IntValue;
- int Ptr;
- int Pass;
- int FieldNo;
- int NumField;
std::string CurrentModuleObject;
- int PotentialAssignedValue;
- auto &Zone(state.dataHeatBal->Zone);
- auto &Surface(state.dataSurface->Surface);
+ auto &Zone = state.dataHeatBal->Zone;
+ auto &Surface = state.dataSurface->Surface;
+
+ auto &ipsc = state.dataIPShortCut;
// first get user-defined H models so they can be processed for later objects
CurrentModuleObject = "SurfaceConvectionAlgorithm:Inside:UserCurve";
- int TotInsideHcUserCurves = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject);
- state.dataConvectionCoefficient->HcInsideUserCurve.allocate(TotInsideHcUserCurves);
- for (int Loop = 1; Loop <= TotInsideHcUserCurves; ++Loop) {
+ int TotHcIntUserCurves = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject);
+ state.dataConvect->hcIntUserCurve.allocate(TotHcIntUserCurves);
+ for (int Loop = 1; Loop <= TotHcIntUserCurves; ++Loop) {
state.dataInputProcessing->inputProcessor->getObjectItem(state,
CurrentModuleObject,
Loop,
- state.dataIPShortCut->cAlphaArgs,
+ ipsc->cAlphaArgs,
NumAlphas,
- state.dataIPShortCut->rNumericArgs,
+ ipsc->rNumericArgs,
NumNumbers,
Status,
- state.dataIPShortCut->lNumericFieldBlanks,
- state.dataIPShortCut->lAlphaFieldBlanks,
- state.dataIPShortCut->cAlphaFieldNames,
- state.dataIPShortCut->cNumericFieldNames);
- state.dataConvectionCoefficient->HcInsideUserCurve(Loop).Name = state.dataIPShortCut->cAlphaArgs(1);
-
- state.dataConvectionCoefficient->HcInsideUserCurve(Loop).ReferenceTempType = static_cast(
- getEnumerationValue(RefTempNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(2))));
- if (state.dataConvectionCoefficient->HcInsideUserCurve(Loop).ReferenceTempType == ConvectionConstants::RefTemp::Invalid) {
- ShowSevereError(state,
- format("GetUserSuppliedConvectionCoefficients: {}: Invalid Key choice Entered, for {}={}",
- CurrentModuleObject,
- state.dataIPShortCut->cAlphaFieldNames(2),
- state.dataIPShortCut->cAlphaArgs(2)));
+ ipsc->lNumericFieldBlanks,
+ ipsc->lAlphaFieldBlanks,
+ ipsc->cAlphaFieldNames,
+ ipsc->cNumericFieldNames);
+ auto &intConvUserCurve = state.dataConvect->hcIntUserCurve(Loop);
+ intConvUserCurve.Name = ipsc->cAlphaArgs(1);
+
+ ErrorObjectHeader eoh{RoutineName, CurrentModuleObject, intConvUserCurve.Name};
+ intConvUserCurve.refTempType = static_cast(getEnumValue(RefTempNamesUC, ipsc->cAlphaArgs(2)));
+ if (intConvUserCurve.refTempType == RefTemp::Invalid) {
+ ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2));
ErrorsFound = true;
}
- if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) {
- state.dataConvectionCoefficient->HcInsideUserCurve(Loop).HcFnTempDiffCurveNum =
- Curve::GetCurveIndex(state, state.dataIPShortCut->cAlphaArgs(3));
- if (state.dataConvectionCoefficient->HcInsideUserCurve(Loop).HcFnTempDiffCurveNum == 0) {
- ShowSevereError(state,
- format("GetUserSuppliedConvectionCoefficients: {}: Invalid Name Entered, for {}={}",
- CurrentModuleObject,
- state.dataIPShortCut->cAlphaFieldNames(3),
- state.dataIPShortCut->cAlphaArgs(3)));
+ if (!ipsc->lAlphaFieldBlanks(3)) {
+ intConvUserCurve.hcFnTempDiffCurveNum = Curve::GetCurveIndex(state, ipsc->cAlphaArgs(3));
+ if (intConvUserCurve.hcFnTempDiffCurveNum == 0) {
+ ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3));
ErrorsFound = true;
} else { // check type
- ErrorsFound |= Curve::CheckCurveDims(state,
- state.dataConvectionCoefficient->HcInsideUserCurve(Loop).HcFnTempDiffCurveNum, // Curve index
- {1}, // Valid dimensions
- RoutineName, // Routine name
- CurrentModuleObject, // Object Type
- state.dataConvectionCoefficient->HcInsideUserCurve(Loop).Name, // Object Name
- state.dataIPShortCut->cAlphaFieldNames(3)); // Field Name
+ auto const *curve = state.dataCurveManager->PerfCurve(intConvUserCurve.hcFnTempDiffCurveNum);
+ if (curve->numDims != 1) {
+ ErrorsFound = true;
+ Curve::ShowErrorCurveDims(state, eoh, ipsc->cAlphaFieldNames(3), curve->Name, "1", curve->numDims);
+ }
}
} else {
- state.dataConvectionCoefficient->HcInsideUserCurve(Loop).HcFnTempDiffCurveNum = 0;
+ intConvUserCurve.hcFnTempDiffCurveNum = 0;
}
- if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) {
- state.dataConvectionCoefficient->HcInsideUserCurve(Loop).HcFnTempDiffDivHeightCurveNum =
- Curve::GetCurveIndex(state, state.dataIPShortCut->cAlphaArgs(4));
- if (state.dataConvectionCoefficient->HcInsideUserCurve(Loop).HcFnTempDiffDivHeightCurveNum == 0) {
- ShowSevereError(state,
- format("GetUserSuppliedConvectionCoefficients: {}: Invalid Name Entered, for {}={}",
- CurrentModuleObject,
- state.dataIPShortCut->cAlphaFieldNames(4),
- state.dataIPShortCut->cAlphaArgs(4)));
+ if (!ipsc->lAlphaFieldBlanks(4)) {
+ intConvUserCurve.hcFnTempDiffDivHeightCurveNum = Curve::GetCurveIndex(state, ipsc->cAlphaArgs(4));
+ if (intConvUserCurve.hcFnTempDiffDivHeightCurveNum == 0) {
+ ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(4), ipsc->cAlphaArgs(4));
ErrorsFound = true;
} else { // check type
- ErrorsFound |=
- Curve::CheckCurveDims(state,
- state.dataConvectionCoefficient->HcInsideUserCurve(Loop).HcFnTempDiffDivHeightCurveNum, // Curve index
- {1}, // Valid dimensions
- RoutineName, // Routine name
- CurrentModuleObject, // Object Type
- state.dataConvectionCoefficient->HcInsideUserCurve(Loop).Name, // Object Name
- state.dataIPShortCut->cAlphaFieldNames(4)); // Field Name
+ auto const *curve = state.dataCurveManager->PerfCurve(intConvUserCurve.hcFnTempDiffDivHeightCurveNum);
+ if (curve->numDims != 1) {
+ ErrorsFound = true;
+ Curve::ShowErrorCurveDims(state, eoh, ipsc->cAlphaFieldNames(4), curve->Name, "1", curve->numDims);
+ }
}
} else {
- state.dataConvectionCoefficient->HcInsideUserCurve(Loop).HcFnTempDiffDivHeightCurveNum = 0;
+ intConvUserCurve.hcFnTempDiffDivHeightCurveNum = 0;
}
- if (!state.dataIPShortCut->lAlphaFieldBlanks(5)) {
- state.dataConvectionCoefficient->HcInsideUserCurve(Loop).HcFnACHCurveNum =
- Curve::GetCurveIndex(state, state.dataIPShortCut->cAlphaArgs(5));
- if (state.dataConvectionCoefficient->HcInsideUserCurve(Loop).HcFnACHCurveNum == 0) {
- ShowSevereError(state,
- format("GetUserSuppliedConvectionCoefficients: {}: Invalid Name Entered, for {}={}",
- CurrentModuleObject,
- state.dataIPShortCut->cAlphaFieldNames(5),
- state.dataIPShortCut->cAlphaArgs(5)));
+ if (!ipsc->lAlphaFieldBlanks(5)) {
+ intConvUserCurve.hcFnACHCurveNum = Curve::GetCurveIndex(state, ipsc->cAlphaArgs(5));
+ if (intConvUserCurve.hcFnACHCurveNum == 0) {
+ ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(5), ipsc->cAlphaArgs(5));
ErrorsFound = true;
} else { // check type
- ErrorsFound |= Curve::CheckCurveDims(state,
- state.dataConvectionCoefficient->HcInsideUserCurve(Loop).HcFnACHCurveNum, // Curve index
- {1}, // Valid dimensions
- RoutineName, // Routine name
- CurrentModuleObject, // Object Type
- state.dataConvectionCoefficient->HcInsideUserCurve(Loop).Name, // Object Name
- state.dataIPShortCut->cAlphaFieldNames(5)); // Field Name
+ auto const *curve = state.dataCurveManager->PerfCurve(intConvUserCurve.hcFnACHCurveNum);
+ if (curve->numDims != 1) {
+ ErrorsFound = true;
+ Curve::ShowErrorCurveDims(state, eoh, ipsc->cAlphaFieldNames(5), curve->Name, "1", curve->numDims);
+ }
}
} else {
- state.dataConvectionCoefficient->HcInsideUserCurve(Loop).HcFnACHCurveNum = 0;
+ intConvUserCurve.hcFnACHCurveNum = 0;
}
- if (!state.dataIPShortCut->lAlphaFieldBlanks(6)) {
- state.dataConvectionCoefficient->HcInsideUserCurve(Loop).HcFnACHDivPerimLengthCurveNum =
- Curve::GetCurveIndex(state, state.dataIPShortCut->cAlphaArgs(6));
- if (state.dataConvectionCoefficient->HcInsideUserCurve(Loop).HcFnACHDivPerimLengthCurveNum == 0) {
- ShowSevereError(state,
- format("GetUserSuppliedConvectionCoefficients: {}: Invalid Name Entered, for {}={}",
- CurrentModuleObject,
- state.dataIPShortCut->cAlphaFieldNames(6),
- state.dataIPShortCut->cAlphaArgs(6)));
+ if (!ipsc->lAlphaFieldBlanks(6)) {
+ intConvUserCurve.hcFnACHDivPerimLengthCurveNum = Curve::GetCurveIndex(state, ipsc->cAlphaArgs(6));
+ if (intConvUserCurve.hcFnACHDivPerimLengthCurveNum == 0) {
+ ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(6), ipsc->cAlphaArgs(6));
ErrorsFound = true;
} else { // check type
- ErrorsFound |=
- Curve::CheckCurveDims(state,
- state.dataConvectionCoefficient->HcInsideUserCurve(Loop).HcFnACHDivPerimLengthCurveNum, // Curve index
- {1}, // Valid dimensions
- RoutineName, // Routine name
- CurrentModuleObject, // Object Type
- state.dataConvectionCoefficient->HcInsideUserCurve(Loop).Name, // Object Name
- state.dataIPShortCut->cAlphaFieldNames(6)); // Field Name
+ auto const *curve = state.dataCurveManager->PerfCurve(intConvUserCurve.hcFnACHDivPerimLengthCurveNum);
+ if (curve->numDims != 1) {
+ ErrorsFound = true;
+ Curve::ShowErrorCurveDims(state, eoh, ipsc->cAlphaFieldNames(6), curve->Name, "1", curve->numDims);
+ }
}
} else {
- state.dataConvectionCoefficient->HcInsideUserCurve(Loop).HcFnACHDivPerimLengthCurveNum = 0;
+ intConvUserCurve.hcFnACHDivPerimLengthCurveNum = 0;
}
} // end of 'SurfaceConvectionAlgorithm:Inside:UserCurve'
CurrentModuleObject = "SurfaceConvectionAlgorithm:Outside:UserCurve";
int TotOutsideHcUserCurves = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject);
- state.dataConvectionCoefficient->HcOutsideUserCurve.allocate(TotOutsideHcUserCurves);
+ state.dataConvect->hcExtUserCurve.allocate(TotOutsideHcUserCurves);
for (int Loop = 1; Loop <= TotOutsideHcUserCurves; ++Loop) {
state.dataInputProcessing->inputProcessor->getObjectItem(state,
CurrentModuleObject,
Loop,
- state.dataIPShortCut->cAlphaArgs,
+ ipsc->cAlphaArgs,
NumAlphas,
- state.dataIPShortCut->rNumericArgs,
+ ipsc->rNumericArgs,
NumNumbers,
Status,
- state.dataIPShortCut->lNumericFieldBlanks,
- state.dataIPShortCut->lAlphaFieldBlanks,
- state.dataIPShortCut->cAlphaFieldNames,
- state.dataIPShortCut->cNumericFieldNames);
- state.dataConvectionCoefficient->HcOutsideUserCurve(Loop).Name = state.dataIPShortCut->cAlphaArgs(1);
-
- state.dataConvectionCoefficient->HcOutsideUserCurve(Loop).WindSpeedType = static_cast(
- getEnumerationValue(RefWindNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(2))));
- if (state.dataConvectionCoefficient->HcOutsideUserCurve(Loop).WindSpeedType == ConvectionConstants::RefWind::Invalid) {
- ShowSevereError(state,
- format("GetUserSuppliedConvectionCoefficients: {}: Invalid Key choice Entered, for {}={}",
- CurrentModuleObject,
- state.dataIPShortCut->cAlphaFieldNames(2),
- state.dataIPShortCut->cAlphaArgs(2)));
+ ipsc->lNumericFieldBlanks,
+ ipsc->lAlphaFieldBlanks,
+ ipsc->cAlphaFieldNames,
+ ipsc->cNumericFieldNames);
+
+ auto &extConvUserCurve = state.dataConvect->hcExtUserCurve(Loop);
+
+ extConvUserCurve.Name = ipsc->cAlphaArgs(1);
+
+ ErrorObjectHeader eoh{RoutineName, CurrentModuleObject, extConvUserCurve.Name};
+ extConvUserCurve.windSpeedType = static_cast(getEnumValue(RefWindNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(2))));
+ if (extConvUserCurve.windSpeedType == RefWind::Invalid) {
+ ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2));
ErrorsFound = true;
}
// A3 , \field Hf Function of Wind Speed Curve Name
- if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) {
- state.dataConvectionCoefficient->HcOutsideUserCurve(Loop).HfFnWindSpeedCurveNum =
- Curve::GetCurveIndex(state, state.dataIPShortCut->cAlphaArgs(3));
- if (state.dataConvectionCoefficient->HcOutsideUserCurve(Loop).HfFnWindSpeedCurveNum == 0) {
- ShowSevereError(state,
- format("GetUserSuppliedConvectionCoefficients: {}: Invalid Name Entered, for {}={}",
- CurrentModuleObject,
- state.dataIPShortCut->cAlphaFieldNames(3),
- state.dataIPShortCut->cAlphaArgs(3)));
+ if (!ipsc->lAlphaFieldBlanks(3)) {
+ extConvUserCurve.hfFnWindSpeedCurveNum = Curve::GetCurveIndex(state, ipsc->cAlphaArgs(3));
+ if (extConvUserCurve.hfFnWindSpeedCurveNum == 0) {
+ ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3));
ErrorsFound = true;
} else { // check type
- ErrorsFound |= Curve::CheckCurveDims(state,
- state.dataConvectionCoefficient->HcOutsideUserCurve(Loop).HfFnWindSpeedCurveNum, // Curve index
- {1}, // Valid dimensions
- RoutineName, // Routine name
- CurrentModuleObject, // Object Type
- state.dataConvectionCoefficient->HcOutsideUserCurve(Loop).Name, // Object Name
- state.dataIPShortCut->cAlphaFieldNames(3)); // Field Name
+ auto const *curve = state.dataCurveManager->PerfCurve(extConvUserCurve.hfFnWindSpeedCurveNum);
+ if (curve->numDims != 1) {
+ ErrorsFound = true;
+ Curve::ShowErrorCurveDims(state, eoh, ipsc->cAlphaFieldNames(3), curve->Name, "1", curve->numDims);
+ }
}
} else {
- state.dataConvectionCoefficient->HcOutsideUserCurve(Loop).HfFnWindSpeedCurveNum = 0;
+ extConvUserCurve.hfFnWindSpeedCurveNum = 0;
}
// A4 , \field Hn Function of Temperature Difference Curve Name
- if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) {
- state.dataConvectionCoefficient->HcOutsideUserCurve(Loop).HnFnTempDiffCurveNum =
- Curve::GetCurveIndex(state, state.dataIPShortCut->cAlphaArgs(4));
- if (state.dataConvectionCoefficient->HcOutsideUserCurve(Loop).HnFnTempDiffCurveNum == 0) {
- ShowSevereError(state,
- format("GetUserSuppliedConvectionCoefficients: {}: Invalid Name Entered, for {}={}",
- CurrentModuleObject,
- state.dataIPShortCut->cAlphaFieldNames(4),
- state.dataIPShortCut->cAlphaArgs(4)));
+ if (!ipsc->lAlphaFieldBlanks(4)) {
+ extConvUserCurve.hnFnTempDiffCurveNum = Curve::GetCurveIndex(state, ipsc->cAlphaArgs(4));
+ if (extConvUserCurve.hnFnTempDiffCurveNum == 0) {
+ ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(4), ipsc->cAlphaArgs(4));
ErrorsFound = true;
} else { // check type
- ErrorsFound |= Curve::CheckCurveDims(state,
- state.dataConvectionCoefficient->HcOutsideUserCurve(Loop).HnFnTempDiffCurveNum, // Curve index
- {1}, // Valid dimensions
- RoutineName, // Routine name
- CurrentModuleObject, // Object Type
- state.dataConvectionCoefficient->HcOutsideUserCurve(Loop).Name, // Object Name
- state.dataIPShortCut->cAlphaFieldNames(4)); // Field Name
+ auto const *curve = state.dataCurveManager->PerfCurve(extConvUserCurve.hnFnTempDiffCurveNum);
+ if (curve->numDims != 1) {
+ ErrorsFound = true;
+ Curve::ShowErrorCurveDims(state, eoh, ipsc->cAlphaFieldNames(4), curve->Name, "1", curve->numDims);
+ }
}
} else {
- state.dataConvectionCoefficient->HcOutsideUserCurve(Loop).HnFnTempDiffCurveNum = 0;
+ extConvUserCurve.hnFnTempDiffCurveNum = 0;
}
// A5 , \field Hn Function of Temperature Difference Divided by Height Curve Name
- if (!state.dataIPShortCut->lAlphaFieldBlanks(5)) {
- state.dataConvectionCoefficient->HcOutsideUserCurve(Loop).HnFnTempDiffDivHeightCurveNum =
- Curve::GetCurveIndex(state, state.dataIPShortCut->cAlphaArgs(5));
- if (state.dataConvectionCoefficient->HcOutsideUserCurve(Loop).HnFnTempDiffDivHeightCurveNum == 0) {
- ShowSevereError(state,
- format("GetUserSuppliedConvectionCoefficients: {}: Invalid Name Entered, for {}={}",
- CurrentModuleObject,
- state.dataIPShortCut->cAlphaFieldNames(5),
- state.dataIPShortCut->cAlphaArgs(5)));
+ if (!ipsc->lAlphaFieldBlanks(5)) {
+ extConvUserCurve.hnFnTempDiffDivHeightCurveNum = Curve::GetCurveIndex(state, ipsc->cAlphaArgs(5));
+ if (extConvUserCurve.hnFnTempDiffDivHeightCurveNum == 0) {
+ ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(5), ipsc->cAlphaArgs(5));
ErrorsFound = true;
} else { // check type
- ErrorsFound |=
- Curve::CheckCurveDims(state,
- state.dataConvectionCoefficient->HcOutsideUserCurve(Loop).HnFnTempDiffDivHeightCurveNum, // Curve index
- {1}, // Valid dimensions
- RoutineName, // Routine name
- CurrentModuleObject, // Object Type
- state.dataConvectionCoefficient->HcOutsideUserCurve(Loop).Name, // Object Name
- state.dataIPShortCut->cAlphaFieldNames(5)); // Field Name
+ auto const *curve = state.dataCurveManager->PerfCurve(extConvUserCurve.hnFnTempDiffDivHeightCurveNum);
+ if (curve->numDims != 1) {
+ ErrorsFound = true;
+ Curve::ShowErrorCurveDims(state, eoh, ipsc->cAlphaFieldNames(5), curve->Name, "1", curve->numDims);
+ }
}
} else {
- state.dataConvectionCoefficient->HcOutsideUserCurve(Loop).HnFnTempDiffDivHeightCurveNum = 0;
+ extConvUserCurve.hnFnTempDiffDivHeightCurveNum = 0;
}
} // 'SurfaceConvectionAlgorithm:Outside:UserCurve'
// now get user directed overrides at the surface level.
- state.dataSurface->TotIntConvCoeff = 0;
- state.dataSurface->TotExtConvCoeff = 0;
+ state.dataSurface->TotUserIntConvModels = 0;
+ state.dataSurface->TotUserExtConvModels = 0;
CurrentModuleObject = "SurfaceProperty:ConvectionCoefficients:MultipleSurface";
- Count = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject);
+ int Count = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject);
for (int Loop = 1; Loop <= Count; ++Loop) {
state.dataInputProcessing->inputProcessor->getObjectItem(state,
CurrentModuleObject,
@@ -1185,33 +931,30 @@ void GetUserConvectionCoefficients(EnergyPlusData &state)
Numbers,
NumNumbers,
Status,
- state.dataIPShortCut->lNumericFieldBlanks,
- state.dataIPShortCut->lAlphaFieldBlanks,
- state.dataIPShortCut->cAlphaFieldNames,
- state.dataIPShortCut->cNumericFieldNames);
+ ipsc->lNumericFieldBlanks,
+ ipsc->lAlphaFieldBlanks,
+ ipsc->cAlphaFieldNames,
+ ipsc->cNumericFieldNames);
if (Alphas(2) == "INSIDE") {
- ++state.dataSurface->TotIntConvCoeff;
+ ++state.dataSurface->TotUserIntConvModels;
+ } else if (Alphas(2) == "OUTSIDE") {
+ ++state.dataSurface->TotUserExtConvModels;
}
+
if (Alphas(6) == "INSIDE") {
- ++state.dataSurface->TotIntConvCoeff;
- }
- if (Alphas(2) == "OUTSIDE") {
- ++state.dataSurface->TotExtConvCoeff;
+ ++state.dataSurface->TotUserIntConvModels;
+ } else if (Alphas(6) == "OUTSIDE") {
+ ++state.dataSurface->TotUserExtConvModels;
}
- if (Alphas(6) == "OUTSIDE") {
- ++state.dataSurface->TotExtConvCoeff;
- }
- if (NumAlphas >= 2 && state.dataIPShortCut->lAlphaFieldBlanks(2)) {
- ShowWarningError(
- state,
- format("GetUserConvectionCoefficients: {}, for {}={}", CurrentModuleObject, state.dataIPShortCut->cAlphaFieldNames(1), Alphas(1)));
- ShowContinueError(state, format("{} is blank and rest of fields will not be processed.", state.dataIPShortCut->cAlphaFieldNames(2)));
+ if (NumAlphas >= 2 && ipsc->lAlphaFieldBlanks(2)) {
+ ShowWarningError(state,
+ format("GetUserConvectionCoefficients: {}, for {}={}", CurrentModuleObject, ipsc->cAlphaFieldNames(1), Alphas(1)));
+ ShowContinueError(state, format("{} is blank and rest of fields will not be processed.", ipsc->cAlphaFieldNames(2)));
}
- if (NumAlphas >= 6 && state.dataIPShortCut->lAlphaFieldBlanks(6)) {
- ShowWarningError(
- state,
- format("GetUserConvectionCoefficients: {}, for {}={}", CurrentModuleObject, state.dataIPShortCut->cAlphaFieldNames(1), Alphas(1)));
- ShowContinueError(state, format("{} is blank and rest of fields will not be processed.", state.dataIPShortCut->cAlphaFieldNames(6)));
+ if (NumAlphas >= 6 && ipsc->lAlphaFieldBlanks(6)) {
+ ShowWarningError(state,
+ format("GetUserConvectionCoefficients: {}, for {}={}", CurrentModuleObject, ipsc->cAlphaFieldNames(1), Alphas(1)));
+ ShowContinueError(state, format("{} is blank and rest of fields will not be processed.", ipsc->cAlphaFieldNames(6)));
}
}
CurrentModuleObject = "SurfaceProperty:ConvectionCoefficients";
@@ -1225,41 +968,38 @@ void GetUserConvectionCoefficients(EnergyPlusData &state)
Numbers,
NumNumbers,
Status,
- state.dataIPShortCut->lNumericFieldBlanks,
- state.dataIPShortCut->lAlphaFieldBlanks,
- state.dataIPShortCut->cAlphaFieldNames,
- state.dataIPShortCut->cNumericFieldNames);
+ ipsc->lNumericFieldBlanks,
+ ipsc->lAlphaFieldBlanks,
+ ipsc->cAlphaFieldNames,
+ ipsc->cNumericFieldNames);
if (Alphas(2) == "INSIDE") {
- ++state.dataSurface->TotIntConvCoeff;
+ ++state.dataSurface->TotUserIntConvModels;
+ } else if (Alphas(2) == "OUTSIDE") {
+ ++state.dataSurface->TotUserExtConvModels;
}
+
if (Alphas(6) == "INSIDE") {
- ++state.dataSurface->TotIntConvCoeff;
- }
- if (Alphas(2) == "OUTSIDE") {
- ++state.dataSurface->TotExtConvCoeff;
+ ++state.dataSurface->TotUserIntConvModels;
+ } else if (Alphas(6) == "OUTSIDE") {
+ ++state.dataSurface->TotUserExtConvModels;
}
- if (Alphas(6) == "OUTSIDE") {
- ++state.dataSurface->TotExtConvCoeff;
- }
- if (NumAlphas >= 2 && state.dataIPShortCut->lAlphaFieldBlanks(2)) {
- ShowWarningError(
- state,
- format("GetUserConvectionCoefficients: {}, for {}={}", CurrentModuleObject, state.dataIPShortCut->cAlphaFieldNames(1), Alphas(1)));
- ShowContinueError(state, format("{} is blank and rest of fields will not be processed.", state.dataIPShortCut->cAlphaFieldNames(2)));
+ if (NumAlphas >= 2 && ipsc->lAlphaFieldBlanks(2)) {
+ ShowWarningError(state,
+ format("GetUserConvectionCoefficients: {}, for {}={}", CurrentModuleObject, ipsc->cAlphaFieldNames(1), Alphas(1)));
+ ShowContinueError(state, format("{} is blank and rest of fields will not be processed.", ipsc->cAlphaFieldNames(2)));
}
- if (NumAlphas >= 6 && state.dataIPShortCut->lAlphaFieldBlanks(6)) {
- ShowWarningError(
- state,
- format("GetUserConvectionCoefficients: {}, for {}={}", CurrentModuleObject, state.dataIPShortCut->cAlphaFieldNames(1), Alphas(1)));
- ShowContinueError(state, format("{} is blank and rest of fields will not be processed.", state.dataIPShortCut->cAlphaFieldNames(6)));
+ if (NumAlphas >= 6 && ipsc->lAlphaFieldBlanks(6)) {
+ ShowWarningError(state,
+ format("GetUserConvectionCoefficients: {}, for {}={}", CurrentModuleObject, ipsc->cAlphaFieldNames(1), Alphas(1)));
+ ShowContinueError(state, format("{} is blank and rest of fields will not be processed.", ipsc->cAlphaFieldNames(6)));
}
}
- state.dataSurface->UserIntConvectionCoeffs.allocate(state.dataSurface->TotIntConvCoeff);
- state.dataSurface->UserExtConvectionCoeffs.allocate(state.dataSurface->TotExtConvCoeff);
+ state.dataSurface->userIntConvModels.allocate(state.dataSurface->TotUserIntConvModels);
+ state.dataSurface->userExtConvModels.allocate(state.dataSurface->TotUserExtConvModels);
- state.dataSurface->TotIntConvCoeff = 0;
- state.dataSurface->TotExtConvCoeff = 0;
+ state.dataSurface->TotUserIntConvModels = 0;
+ state.dataSurface->TotUserExtConvModels = 0;
// Now, get for real and check for consistency
CurrentModuleObject = "SurfaceProperty:ConvectionCoefficients";
@@ -1273,261 +1013,272 @@ void GetUserConvectionCoefficients(EnergyPlusData &state)
Numbers,
NumNumbers,
Status,
- state.dataIPShortCut->lNumericFieldBlanks,
- state.dataIPShortCut->lAlphaFieldBlanks,
- state.dataIPShortCut->cAlphaFieldNames,
- state.dataIPShortCut->cNumericFieldNames);
- int Found = UtilityRoutines::FindItemInList(Alphas(1), Surface);
- if (Found == 0) {
- ShowSevereError(state,
- format("GetUserConvectionCoefficients: {}, illegal value for {}={}",
- CurrentModuleObject,
- state.dataIPShortCut->cAlphaFieldNames(1),
- Alphas(1)));
+ ipsc->lNumericFieldBlanks,
+ ipsc->lAlphaFieldBlanks,
+ ipsc->cAlphaFieldNames,
+ ipsc->cNumericFieldNames);
+
+ ErrorObjectHeader eoh{RoutineName, CurrentModuleObject, ""};
+ int surfNum = UtilityRoutines::FindItemInList(Alphas(1), Surface);
+ if (surfNum == 0) {
+ ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), Alphas(1));
ErrorsFound = true;
continue;
}
- Ptr = 2;
- FieldNo = 2;
- NumField = 1;
- for (Pass = 1; Pass <= 2; ++Pass) {
-
- {
- if (Alphas(Ptr) == "OUTSIDE") {
- if (Surface(Found).OSCPtr > 0) {
- ShowSevereError(
- state,
- format("GetUserSuppliedConvectionCoefficients: {}, OUTSIDE {} cannot be specified for OtherSideCoefficient Surface={}",
- CurrentModuleObject,
- CurrentModuleObject,
- Alphas(1)));
- ErrorsFound = true;
- }
- ExtValue = 0;
- PotentialAssignedValue = 0;
- std::string equationName = Alphas(Ptr + 1);
- if (HcExt_ConvectionTypesMap.find(equationName) != HcExt_ConvectionTypesMap.end()) {
- ExtValue = HcExt_ConvectionTypesMap.at(equationName);
-
- if ((ExtValue == ConvectionConstants::HcExt_ASHRAESimpleCombined) || (ExtValue == ConvectionConstants::HcExt_TarpHcOutside) ||
- (ExtValue == ConvectionConstants::HcExt_MoWiTTHcOutside) || (ExtValue == ConvectionConstants::HcExt_DOE2HcOutside) ||
- (ExtValue == ConvectionConstants::HcExt_AdaptiveConvectionAlgorithm)) {
- PotentialAssignedValue = -ExtValue;
- } else if (ExtValue == ConvectionConstants::HcExt_Value) {
- ++state.dataSurface->TotExtConvCoeff;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).SurfaceName = Alphas(1);
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).WhichSurface = Found;
- if (Numbers(NumField) < state.dataHeatBal->LowHConvLimit || Numbers(NumField) > state.dataHeatBal->HighHConvLimit) {
- ShowSevereError(state, format("{}{}=\"{}, out of range value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state,
- format("{}={}, {}=[{:.5R}].",
- state.dataIPShortCut->cAlphaFieldNames(Ptr),
- Alphas(Ptr),
- state.dataIPShortCut->cNumericFieldNames(NumField),
- Numbers(NumField)));
- ShowContinueError(state,
- format("Out-of-range from low/high limits=[>={:.9R}, <={:.1R}].",
- state.dataHeatBal->LowHConvLimit,
- state.dataHeatBal->HighHConvLimit));
- ShowContinueError(state, "Limits are set (or default) in HeatBalanceAlgorithm object.");
- ErrorsFound = true;
- }
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).OverrideType =
- ConvectionConstants::ConvCoefOverrideType::Value;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).OverrideValue = Numbers(NumField);
- if (!state.dataIPShortCut->lAlphaFieldBlanks(Ptr + 2)) {
- ShowWarningError(state, format("{}{}=\"{}, duplicate value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state,
- format("Since VALUE is used for \"{}\", {}={} is ignored.",
- state.dataIPShortCut->cAlphaFieldNames(FieldNo + 2),
- state.dataIPShortCut->cAlphaFieldNames(Ptr + 2),
- Alphas(Ptr + 2)));
- }
- PotentialAssignedValue = state.dataSurface->TotExtConvCoeff;
- } else if (ExtValue == ConvectionConstants::HcExt_Schedule) { // Schedule
- ++state.dataSurface->TotExtConvCoeff;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).SurfaceName = Alphas(1);
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).WhichSurface = Found;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).OverrideType =
- ConvectionConstants::ConvCoefOverrideType::Schedule;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).ScheduleIndex =
- ScheduleManager::GetScheduleIndex(state, Alphas(Ptr + 2));
- if (state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).ScheduleIndex == 0) {
- ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state,
- format(" Invalid {} entered={}", state.dataIPShortCut->cAlphaFieldNames(Ptr + 2), Alphas(Ptr + 2)));
- ErrorsFound = true;
- } else {
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).ScheduleName = Alphas(Ptr + 2);
- }
- PotentialAssignedValue = state.dataSurface->TotExtConvCoeff;
- } else if (ExtValue == ConvectionConstants::HcExt_UserCurve) { // User curve
- ++state.dataSurface->TotExtConvCoeff;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).SurfaceName = Alphas(1);
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).WhichSurface = Found;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).OverrideType =
- ConvectionConstants::ConvCoefOverrideType::UserCurve;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).UserCurveIndex =
- UtilityRoutines::FindItemInList(Alphas(Ptr + 3), state.dataConvectionCoefficient->HcOutsideUserCurve);
- if (state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).UserCurveIndex == 0) {
- ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state,
- format(" Invalid {} entered={}", state.dataIPShortCut->cAlphaFieldNames(Ptr + 3), Alphas(Ptr + 3)));
- ErrorsFound = true;
- }
- PotentialAssignedValue = state.dataSurface->TotExtConvCoeff;
- } else if (ExtValue > ConvectionConstants::HcExt_UserCurve) {
- // specificmodel
- ++state.dataSurface->TotExtConvCoeff;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).SurfaceName = Alphas(1);
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).WhichSurface = Found;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).OverrideType =
- ConvectionConstants::ConvCoefOverrideType::SpecifiedModel;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).HcModelEq = ExtValue;
- PotentialAssignedValue = state.dataSurface->TotExtConvCoeff;
+ for (int Pass = 1, Ptr = 2, FieldNo = 2, NumField = 1; Pass <= 2; ++Pass, Ptr += 4, FieldNo += 4, ++NumField) {
- } else {
- ShowSevereError(state, format("{}{}=\"{}, check input", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state, format("Check Input Entered :{}", Alphas(Ptr + 1)));
- ErrorsFound = true;
- }
- if (state.dataSurface->SurfExtConvCoeffIndex(Found) != 0) {
- ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state, "Duplicate (Outside) assignment attempt");
- ErrorsFound = true;
- } else {
- state.dataSurface->SurfExtConvCoeffIndex(Found) = PotentialAssignedValue;
- }
- }
+ if (Alphas(Ptr).empty()) continue;
- } else if (Alphas(Ptr) == "INSIDE") {
- IntValue = 0;
- PotentialAssignedValue = 0;
- std::string equationName = Alphas(Ptr + 1);
- if (HcInt_ConvectionTypesMap.find(equationName) != HcInt_ConvectionTypesMap.end()) {
- IntValue = HcInt_ConvectionTypesMap.at(equationName);
- if ((IntValue == ConvectionConstants::HcInt_ASHRAESimple) || (IntValue == ConvectionConstants::HcInt_ASHRAETARP) ||
- (IntValue == ConvectionConstants::HcInt_AdaptiveConvectionAlgorithm) ||
- (IntValue == ConvectionConstants::HcInt_ASTMC1340)) {
- ApplyConvectionValue(state, Alphas(1), "INSIDE", -IntValue);
- } else if (IntValue == ConvectionConstants::HcInt_Value) {
- ++state.dataSurface->TotIntConvCoeff;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).SurfaceName = Alphas(1);
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).WhichSurface = Found;
- if (Numbers(NumField) < state.dataHeatBal->LowHConvLimit || Numbers(NumField) > state.dataHeatBal->HighHConvLimit) {
- ShowSevereError(state, format("{}{}=\"{}, out of range value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state,
- format("{}={}, {}=[{:.5R}].",
- state.dataIPShortCut->cAlphaFieldNames(Ptr),
- Alphas(Ptr),
- state.dataIPShortCut->cNumericFieldNames(NumField),
- Numbers(NumField)));
- ShowContinueError(state,
- format("Out-of-range from low/high limits=[>={:.9R}, <={:.1R}].",
- state.dataHeatBal->LowHConvLimit,
- state.dataHeatBal->HighHConvLimit));
- ShowContinueError(state, "Limits are set (or default) in HeatBalanceAlgorithm object.");
- ErrorsFound = true;
- }
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).OverrideType =
- ConvectionConstants::ConvCoefOverrideType::Value;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).OverrideValue = Numbers(NumField);
- if (!state.dataIPShortCut->lAlphaFieldBlanks(Ptr + 2)) {
- ShowWarningError(state, format("{}{}=\"{}, duplicate value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state,
- format("Since VALUE is used for \"{}\", {}={} is ignored.",
- state.dataIPShortCut->cAlphaFieldNames(FieldNo + 1),
- state.dataIPShortCut->cAlphaFieldNames(Ptr + 2),
- Alphas(Ptr + 2)));
- }
- PotentialAssignedValue = state.dataSurface->TotIntConvCoeff;
- } else if (IntValue == ConvectionConstants::HcInt_Schedule) {
- ++state.dataSurface->TotIntConvCoeff;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).SurfaceName = Alphas(1);
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).WhichSurface = Found;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).OverrideType =
- ConvectionConstants::ConvCoefOverrideType::Schedule;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).ScheduleIndex =
- ScheduleManager::GetScheduleIndex(state, Alphas(Ptr + 2));
- if (state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).ScheduleIndex == 0) {
- ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state,
- format(" Invalid {} entered={}", state.dataIPShortCut->cAlphaFieldNames(Ptr + 2), Alphas(Ptr + 2)));
- ErrorsFound = true;
- } else {
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).ScheduleName = Alphas(Ptr + 2);
- }
- PotentialAssignedValue = state.dataSurface->TotIntConvCoeff;
- } else if (IntValue == ConvectionConstants::HcInt_UserCurve) {
- ++state.dataSurface->TotIntConvCoeff;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).SurfaceName = Alphas(1);
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).WhichSurface = Found;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).OverrideType =
- ConvectionConstants::ConvCoefOverrideType::UserCurve;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).UserCurveIndex =
- UtilityRoutines::FindItemInList(Alphas(Ptr + 3), state.dataConvectionCoefficient->HcInsideUserCurve);
- if (state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).UserCurveIndex == 0) {
- ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state,
- format(" Invalid {} entered={}", state.dataIPShortCut->cAlphaFieldNames(Ptr + 3), Alphas(Ptr + 3)));
- ErrorsFound = true;
- }
- PotentialAssignedValue = state.dataSurface->TotIntConvCoeff;
- } else if (IntValue > ConvectionConstants::HcInt_UserCurve) {
- // specificmodel
- ++state.dataSurface->TotIntConvCoeff;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).SurfaceName = Alphas(1);
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).WhichSurface = Found;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).OverrideType =
- ConvectionConstants::ConvCoefOverrideType::SpecifiedModel;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).HcModelEq = IntValue;
- PotentialAssignedValue = state.dataSurface->TotIntConvCoeff;
+ if (Alphas(Ptr) == "OUTSIDE") {
+ if (Surface(surfNum).OSCPtr > 0) {
+ ShowSevereError(
+ state,
+ format("GetUserSuppliedConvectionCoefficients: {}, OUTSIDE {} cannot be specified for OtherSideCoefficient Surface={}",
+ CurrentModuleObject,
+ CurrentModuleObject,
+ Alphas(1)));
+ ErrorsFound = true;
+ }
- } else {
- // treat CeilingDiffuser and TrombeWall special
- if (UtilityRoutines::SameString(Alphas(Ptr + 1), "CEILINGDIFFUSER") ||
- UtilityRoutines::SameString(Alphas(Ptr + 1), "TROMBEWALL")) {
- ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(
- state, format("Invalid Value Entered, for {}={}", state.dataIPShortCut->cAlphaFieldNames(Ptr), Alphas(Ptr)));
- ShowContinueError(state,
- format("invalid value in {}={}\". This type is only applicable at a Zone level.",
- state.dataIPShortCut->cAlphaFieldNames(Ptr + 1),
- Alphas(Ptr + 1)));
- ErrorsFound = true;
- } else { // really invalid
- ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(
- state, format("Invalid Value Entered, for {}={}", state.dataIPShortCut->cAlphaFieldNames(Ptr), Alphas(Ptr)));
- ShowContinueError(state,
- format("invalid value in {}={}", state.dataIPShortCut->cAlphaFieldNames(Ptr + 1), Alphas(Ptr + 1)));
- ErrorsFound = true;
- }
- }
+ HcExt hcExt = static_cast(getEnumValue(HcExtNamesUC, Alphas(Ptr + 1)));
+
+ switch (hcExt) {
+
+ case HcExt::ASHRAESimpleCombined:
+ case HcExt::TarpHcOutside:
+ case HcExt::MoWiTTHcOutside:
+ case HcExt::DOE2HcOutside:
+ case HcExt::AdaptiveConvectionAlgorithm: {
+ ApplyExtConvValue(state, surfNum, hcExt, 0);
+ } break;
+
+ case HcExt::Value: {
+ ++state.dataSurface->TotUserExtConvModels;
+ auto &userExtConvModel = state.dataSurface->userExtConvModels(state.dataSurface->TotUserExtConvModels);
+ userExtConvModel.SurfaceName = Alphas(1);
+ userExtConvModel.WhichSurface = surfNum;
+ if (Numbers(NumField) < state.dataHeatBal->LowHConvLimit || Numbers(NumField) > state.dataHeatBal->HighHConvLimit) {
+ ShowSevereError(state, format("{}{}=\"{}, out of range value", RoutineName, CurrentModuleObject, Alphas(1)));
+ ShowContinueError(state,
+ format("{}={}, {}=[{:.5R}].",
+ ipsc->cAlphaFieldNames(Ptr),
+ Alphas(Ptr),
+ ipsc->cNumericFieldNames(NumField),
+ Numbers(NumField)));
+ ShowContinueError(state,
+ format("Out-of-range from low/high limits=[>={:.9R}, <={:.1R}].",
+ state.dataHeatBal->LowHConvLimit,
+ state.dataHeatBal->HighHConvLimit));
+ ShowContinueError(state, "Limits are set (or default) in HeatBalanceAlgorithm object.");
+ ErrorsFound = true;
}
- if (state.dataSurface->SurfIntConvCoeffIndex(Found) != 0) {
- ShowSevereError(state, format("{}{}=\"{}, duplicate (inside)", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state, "Duplicate (Inside) assignment attempt.");
+ userExtConvModel.overrideType = OverrideType::Value;
+ userExtConvModel.OverrideValue = Numbers(NumField);
+ if (!ipsc->lAlphaFieldBlanks(Ptr + 2)) {
+ ShowWarningError(state, format("{}{}=\"{}, duplicate value", RoutineName, CurrentModuleObject, Alphas(1)));
+ ShowContinueError(state,
+ format("Since VALUE is used for \"{}\", {}={} is ignored.",
+ ipsc->cAlphaFieldNames(FieldNo + 2),
+ ipsc->cAlphaFieldNames(Ptr + 2),
+ Alphas(Ptr + 2)));
+ }
+ ApplyExtConvValue(state, surfNum, hcExt, state.dataSurface->TotUserExtConvModels);
+ } break;
+
+ case HcExt::Schedule: { // Schedule
+ ++state.dataSurface->TotUserExtConvModels;
+ auto &userExtConvModel = state.dataSurface->userExtConvModels(state.dataSurface->TotUserExtConvModels);
+ userExtConvModel.SurfaceName = Alphas(1);
+ userExtConvModel.WhichSurface = surfNum;
+ userExtConvModel.overrideType = OverrideType::Schedule;
+ userExtConvModel.ScheduleIndex = ScheduleManager::GetScheduleIndex(state, Alphas(Ptr + 2));
+ if (userExtConvModel.ScheduleIndex == 0) {
+ ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(Ptr + 2), Alphas(Ptr + 2));
+ ErrorsFound = true;
+ } else if (!ScheduleManager::CheckScheduleValueMinMax(state,
+ userExtConvModel.ScheduleIndex,
+ ScheduleManager::Clusivity::Inclusive,
+ state.dataHeatBal->LowHConvLimit, // >=
+ ScheduleManager::Clusivity::Inclusive,
+ state.dataHeatBal->HighHConvLimit)) { // <=
+ ShowSevereScheduleOutOfRange(state,
+ eoh,
+ ipsc->cAlphaFieldNames(Ptr + 2),
+ Alphas(Ptr + 2),
+ state.dataHeatBal->LowHConvLimit,
+ state.dataHeatBal->HighHConvLimit,
+ "Limits are set (or default) in HeatBalanceAlgorithm object.");
ErrorsFound = true;
} else {
- state.dataSurface->SurfIntConvCoeffIndex(Found) = PotentialAssignedValue;
+ userExtConvModel.ScheduleName = Alphas(Ptr + 2);
}
+ ApplyExtConvValue(state, surfNum, hcExt, state.dataSurface->TotUserExtConvModels);
+ } break;
+
+ case HcExt::UserCurve: { // User curve
+ ++state.dataSurface->TotUserExtConvModels;
+ auto &userExtConvModel = state.dataSurface->userExtConvModels(state.dataSurface->TotUserExtConvModels);
+ userExtConvModel.SurfaceName = Alphas(1);
+ userExtConvModel.WhichSurface = surfNum;
+ userExtConvModel.overrideType = OverrideType::UserCurve;
+ userExtConvModel.UserCurveIndex = UtilityRoutines::FindItemInList(Alphas(Ptr + 3), state.dataConvect->hcExtUserCurve);
+ if (userExtConvModel.UserCurveIndex == 0) {
+ ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(Ptr + 3), Alphas(Ptr + 3));
+ ErrorsFound = true;
+ }
+ ApplyExtConvValue(state, surfNum, hcExt, state.dataSurface->TotUserExtConvModels);
+ } break;
+
+ case HcExt::UserValue: // Unhandled cases < HcExt::UserCurve
+ case HcExt::UserSchedule:
+ case HcExt::SetByZone:
+ case HcExt::ASHRAETARP:
+ case HcExt::BLASTHcOutside:
+ case HcExt::None: {
+ ShowSevereError(state, format("{}{}=\"{}, check input", RoutineName, CurrentModuleObject, Alphas(1)));
+ ShowContinueError(state, format("Check Input Entered :{}", Alphas(Ptr + 1)));
+ ErrorsFound = true;
+ } break;
+
+ default: { // ExtValue > HcExt::UserCurve
+ // specificmodel
+ ++state.dataSurface->TotUserExtConvModels;
+ auto &userExtConvModel = state.dataSurface->userExtConvModels(state.dataSurface->TotUserExtConvModels);
+ userExtConvModel.SurfaceName = Alphas(1);
+ userExtConvModel.WhichSurface = surfNum;
+ userExtConvModel.overrideType = OverrideType::SpecifiedModel;
+ userExtConvModel.HcExtModelEq = hcExt;
+ ApplyExtConvValue(state, surfNum, hcExt, state.dataSurface->TotUserExtConvModels);
+ } break;
+ } // switch (ExtValue)
+
+ } else if (Alphas(Ptr) == "INSIDE") {
+
+ if (state.dataSurface->surfIntConv(surfNum).userModelNum != 0) {
+ ShowSevereError(state, format("{}{}=\"{}, duplicate (inside)", RoutineName, CurrentModuleObject, Alphas(1)));
+ ShowContinueError(state, "Duplicate (Inside) assignment attempt.");
+ ErrorsFound = true;
+ continue;
+ }
- } else if (Alphas(Ptr).empty()) { // Blank
+ HcInt hcInt = static_cast(getEnumValue(HcIntNamesUC, Alphas(Ptr + 1)));
- } else {
+ switch (hcInt) {
+ // Are these not used anymore? They can be deleted then
+ case HcInt::UserValue:
+ case HcInt::UserSchedule:
+ case HcInt::SetByZone: {
ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state, format("Invalid Value Entered, for {}={}", state.dataIPShortCut->cAlphaFieldNames(Ptr), Alphas(Ptr)));
+ ShowContinueError(state, format("Invalid Value Entered, for {}={}", ipsc->cAlphaFieldNames(Ptr), Alphas(Ptr)));
+ ShowContinueError(state, format("invalid value in {}={}", ipsc->cAlphaFieldNames(Ptr + 1), Alphas(Ptr + 1)));
ErrorsFound = true;
- }
- }
+ } break;
- Ptr += 4;
- FieldNo += 4;
- ++NumField;
- }
- }
+ case HcInt::CeilingDiffuser:
+ case HcInt::TrombeWall: {
+ ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, Alphas(1)));
+ ShowContinueError(state, format("Invalid Value Entered, for {}={}", ipsc->cAlphaFieldNames(Ptr), Alphas(Ptr)));
+ ShowContinueError(state,
+ format("invalid value in {}={}\". This type is only applicable at a Zone level.",
+ ipsc->cAlphaFieldNames(Ptr + 1),
+ Alphas(Ptr + 1)));
+ ErrorsFound = true;
+ } break;
+
+ case HcInt::ASHRAESimple:
+ case HcInt::ASHRAETARP:
+ case HcInt::AdaptiveConvectionAlgorithm:
+ case HcInt::ASTMC1340: {
+ ApplyIntConvValue(state, surfNum, hcInt, 0);
+ } break;
+
+ case HcInt::Value: {
+ ++state.dataSurface->TotUserIntConvModels;
+ auto &userIntConvModel = state.dataSurface->userIntConvModels(state.dataSurface->TotUserIntConvModels);
+ userIntConvModel.SurfaceName = Alphas(1);
+ userIntConvModel.WhichSurface = surfNum;
+ if (Numbers(NumField) < state.dataHeatBal->LowHConvLimit || Numbers(NumField) > state.dataHeatBal->HighHConvLimit) {
+ ShowSevereValueOutOfRange(state,
+ eoh,
+ ipsc->cNumericFieldNames(NumField),
+ Numbers(NumField),
+ state.dataHeatBal->LowHConvLimit,
+ state.dataHeatBal->HighHConvLimit,
+ "Limits are set (or default) in HeatBalanceAlgorithm object.");
+ ErrorsFound = true;
+ }
+ userIntConvModel.overrideType = OverrideType::Value;
+ userIntConvModel.OverrideValue = Numbers(NumField);
+ if (!ipsc->lAlphaFieldBlanks(Ptr + 2)) {
+ ShowWarningError(state, format("{}{}=\"{}, duplicate value", RoutineName, CurrentModuleObject, Alphas(1)));
+ ShowContinueError(state,
+ format("Since VALUE is used for \"{}\", {}={} is ignored.",
+ ipsc->cAlphaFieldNames(FieldNo + 1),
+ ipsc->cAlphaFieldNames(Ptr + 2),
+ Alphas(Ptr + 2)));
+ }
+ ApplyIntConvValue(state, surfNum, hcInt, state.dataSurface->TotUserIntConvModels);
+ } break;
+
+ case HcInt::Schedule: {
+ ++state.dataSurface->TotUserIntConvModels;
+ auto &userIntConvModel = state.dataSurface->userIntConvModels(state.dataSurface->TotUserIntConvModels);
+ userIntConvModel.SurfaceName = Alphas(1);
+ userIntConvModel.WhichSurface = surfNum;
+ userIntConvModel.overrideType = OverrideType::Schedule;
+ userIntConvModel.ScheduleIndex = ScheduleManager::GetScheduleIndex(state, Alphas(Ptr + 2));
+ if (userIntConvModel.ScheduleIndex == 0) {
+ ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(Ptr + 2), Alphas(Ptr + 2));
+ ErrorsFound = true;
+ } else if (!ScheduleManager::CheckScheduleValueMinMax(state,
+ userIntConvModel.ScheduleIndex,
+ ScheduleManager::Clusivity::Inclusive,
+ state.dataHeatBal->LowHConvLimit,
+ ScheduleManager::Clusivity::Inclusive,
+ state.dataHeatBal->HighHConvLimit)) {
+ ShowSevereScheduleOutOfRange(state,
+ eoh,
+ ipsc->cAlphaFieldNames(Ptr + 2),
+ Alphas(Ptr + 2),
+ state.dataHeatBal->LowHConvLimit,
+ state.dataHeatBal->HighHConvLimit,
+ "Limits are set (or default) in HeatBalanceAlgorithm object.");
+ ErrorsFound = true;
+ } else {
+ userIntConvModel.ScheduleName = Alphas(Ptr + 2);
+ }
+ ApplyIntConvValue(state, surfNum, hcInt, state.dataSurface->TotUserIntConvModels);
+ } break;
+
+ case HcInt::UserCurve: {
+ ++state.dataSurface->TotUserIntConvModels;
+ auto &userIntConvModel = state.dataSurface->userIntConvModels(state.dataSurface->TotUserIntConvModels);
+ userIntConvModel.SurfaceName = Alphas(1);
+ userIntConvModel.WhichSurface = surfNum;
+ userIntConvModel.overrideType = OverrideType::UserCurve;
+ userIntConvModel.UserCurveIndex = UtilityRoutines::FindItemInList(Alphas(Ptr + 3), state.dataConvect->hcIntUserCurve);
+ if (userIntConvModel.UserCurveIndex == 0) {
+ ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(Ptr + 3), Alphas(Ptr + 3));
+ ErrorsFound = true;
+ }
+ ApplyIntConvValue(state, surfNum, hcInt, state.dataSurface->TotUserIntConvModels);
+ } break;
+
+ default: { // > HcInt::UserCurve
+ // specificmodel
+ ++state.dataSurface->TotUserIntConvModels;
+ auto &userIntConvModel = state.dataSurface->userIntConvModels(state.dataSurface->TotUserIntConvModels);
+ userIntConvModel.SurfaceName = Alphas(1);
+ userIntConvModel.WhichSurface = surfNum;
+ userIntConvModel.overrideType = OverrideType::SpecifiedModel;
+ userIntConvModel.HcIntModelEq = hcInt;
+ ApplyIntConvValue(state, surfNum, hcInt, state.dataSurface->TotUserIntConvModels);
+ } break;
+ } // switch(HcInt)
+ } // if ("INSIDE")
+ } // for (pass)
+ } // for (Loop)
CurrentModuleObject = "SurfaceProperty:ConvectionCoefficients:MultipleSurface";
Count = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject);
@@ -1540,1559 +1291,498 @@ void GetUserConvectionCoefficients(EnergyPlusData &state)
Numbers,
NumNumbers,
Status,
- state.dataIPShortCut->lNumericFieldBlanks,
- state.dataIPShortCut->lAlphaFieldBlanks,
- state.dataIPShortCut->cAlphaFieldNames,
- state.dataIPShortCut->cNumericFieldNames);
+ ipsc->lNumericFieldBlanks,
+ ipsc->lAlphaFieldBlanks,
+ ipsc->cAlphaFieldNames,
+ ipsc->cNumericFieldNames);
// Check Field 1 for validity
- if (ValidSurfaceTypes.find(Alphas(1)) == ValidSurfaceTypes.end()) {
- ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state, format("illegal value for {}={}", state.dataIPShortCut->cAlphaFieldNames(1), Alphas(1)));
- ErrorsFound = true;
- }
- Ptr = 2;
- FieldNo = 2;
- NumField = 1;
- for (Pass = 1; Pass <= 2; ++Pass) {
-
- {
- if (Alphas(Ptr) == "OUTSIDE") {
- std::string equationName = Alphas(Ptr + 1);
- if (HcExt_ConvectionTypesMap.find(equationName) != HcExt_ConvectionTypesMap.end()) {
- ExtValue = HcExt_ConvectionTypesMap.at(equationName);
- if ((ExtValue == ConvectionConstants::HcExt_ASHRAESimple) || (ExtValue == ConvectionConstants::HcExt_ASHRAETARP) ||
- (ExtValue == ConvectionConstants::HcExt_MoWiTTHcOutside) || (ExtValue == ConvectionConstants::HcExt_DOE2HcOutside) ||
- (ExtValue == ConvectionConstants::HcExt_AdaptiveConvectionAlgorithm)) {
- ApplyConvectionValue(state, Alphas(1), "OUTSIDE", -ExtValue);
- } else if (ExtValue == ConvectionConstants::HcExt_Value) {
- // SimpleValueAssignment via UserExtConvectionCoeffs array
- ++state.dataSurface->TotExtConvCoeff;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).SurfaceName = Alphas(Ptr);
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).WhichSurface = -999;
- if (Numbers(NumField) < state.dataHeatBal->LowHConvLimit || Numbers(NumField) > state.dataHeatBal->HighHConvLimit) {
- ShowSevereError(state, format("{}{}=\"{}, out of range value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state,
- format("{}={}, {}=[{:.5R}].",
- state.dataIPShortCut->cAlphaFieldNames(Ptr),
- Alphas(Ptr),
- state.dataIPShortCut->cNumericFieldNames(NumField),
- Numbers(NumField)));
- ShowContinueError(state,
- format("Out-of-range from low/high limits=[>={:.9R}, <={:.1R}].",
- state.dataHeatBal->LowHConvLimit,
- state.dataHeatBal->HighHConvLimit));
- ShowContinueError(state, "Limits are set (or default) in HeatBalanceAlgorithm object.");
- ErrorsFound = true;
- }
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).OverrideType =
- ConvectionConstants::ConvCoefOverrideType::Value;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).OverrideValue = Numbers(NumField);
- if (!state.dataIPShortCut->lAlphaFieldBlanks(Ptr + 2)) {
- ShowWarningError(state, format("{}{}=\"{}, duplicate value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state,
- format("Since VALUE is used for \"{}\", {}={} is ignored.",
- state.dataIPShortCut->cAlphaFieldNames(FieldNo + 2),
- state.dataIPShortCut->cAlphaFieldNames(Ptr + 2),
- Alphas(Ptr + 2)));
- }
- ApplyConvectionValue(state, Alphas(1), "OUTSIDE", state.dataSurface->TotExtConvCoeff);
- } else if (ExtValue == ConvectionConstants::HcExt_Schedule) {
- ++state.dataSurface->TotExtConvCoeff;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).SurfaceName = Alphas(Ptr);
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).WhichSurface = -999;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).OverrideType =
- ConvectionConstants::ConvCoefOverrideType::Schedule;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).ScheduleIndex =
- ScheduleManager::GetScheduleIndex(state, Alphas(Ptr + 2));
- if (state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).ScheduleIndex == 0) {
- ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state,
- format(" Invalid {} entered={}", state.dataIPShortCut->cAlphaFieldNames(Ptr + 2), Alphas(Ptr + 2)));
- ErrorsFound = true;
- } else {
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).ScheduleName = Alphas(Ptr + 2);
- }
- ApplyConvectionValue(state, Alphas(1), "OUTSIDE", state.dataSurface->TotExtConvCoeff);
- } else if (ExtValue == ConvectionConstants::HcExt_UserCurve) { // User curve
- ++state.dataSurface->TotExtConvCoeff;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).SurfaceName = Alphas(Ptr);
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).WhichSurface = -999;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).OverrideType =
- ConvectionConstants::ConvCoefOverrideType::UserCurve;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).UserCurveIndex =
- UtilityRoutines::FindItemInList(Alphas(Ptr + 3), state.dataConvectionCoefficient->HcOutsideUserCurve);
- if (state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).UserCurveIndex == 0) {
- ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state,
- format(" Invalid {} entered={}", state.dataIPShortCut->cAlphaFieldNames(Ptr + 3), Alphas(Ptr + 3)));
- ErrorsFound = true;
- }
- PotentialAssignedValue = state.dataSurface->TotExtConvCoeff;
- ApplyConvectionValue(state, Alphas(1), "OUTSIDE", state.dataSurface->TotExtConvCoeff);
-
- } else if (ExtValue > ConvectionConstants::HcExt_UserCurve) {
- // specificmodel
- ++state.dataSurface->TotExtConvCoeff;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).SurfaceName = Alphas(Ptr);
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).WhichSurface = -999;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).OverrideType =
- ConvectionConstants::ConvCoefOverrideType::SpecifiedModel;
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->TotExtConvCoeff).HcModelEq = ExtValue;
- PotentialAssignedValue = state.dataSurface->TotExtConvCoeff;
- ApplyConvectionValue(state, Alphas(1), "OUTSIDE", state.dataSurface->TotExtConvCoeff);
- }
- } else {
- ShowSevereError(state, format("{}{}=\"{}, check input", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state, format("Check Input Entered :{}", Alphas(Ptr + 1)));
- ErrorsFound = true;
- }
- } else if (Alphas(Ptr) == "INSIDE") {
- std::string equationName = Alphas(Ptr + 1);
- if (HcInt_ConvectionTypesMap.find(equationName) != HcInt_ConvectionTypesMap.end()) {
- IntValue = HcInt_ConvectionTypesMap.at(equationName);
- if ((IntValue == ConvectionConstants::HcInt_ASHRAESimple) || (IntValue == ConvectionConstants::HcInt_ASHRAETARP) ||
- (IntValue == ConvectionConstants::HcInt_AdaptiveConvectionAlgorithm ||
- (IntValue == ConvectionConstants::HcInt_ASTMC1340))) {
- ApplyConvectionValue(state, Alphas(1), "INSIDE", -IntValue);
- } else if (IntValue == ConvectionConstants::HcInt_Value) {
- // SimpleValueAssignment via UserExtConvectionCoeffs array
- ++state.dataSurface->TotIntConvCoeff;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).SurfaceName = Alphas(Ptr);
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).WhichSurface = -999;
- if (Numbers(NumField) < state.dataHeatBal->LowHConvLimit || Numbers(NumField) > state.dataHeatBal->HighHConvLimit) {
- ShowSevereError(state, format("{}{}=\"{}, out of range value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state,
- format("{}={}, {}=[{:.5R}].",
- state.dataIPShortCut->cAlphaFieldNames(Ptr),
- Alphas(Ptr),
- state.dataIPShortCut->cNumericFieldNames(NumField),
- Numbers(NumField)));
- ShowContinueError(state,
- format("Out-of-range from low/high limits=[>={:.9R}, <={:.1R}].",
- state.dataHeatBal->LowHConvLimit,
- state.dataHeatBal->HighHConvLimit));
- ShowContinueError(state, "Limits are set (or default) in HeatBalanceAlgorithm object.");
- ErrorsFound = true;
- }
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).OverrideType =
- ConvectionConstants::ConvCoefOverrideType::Value;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).OverrideValue = Numbers(NumField);
- if (!state.dataIPShortCut->lAlphaFieldBlanks(Ptr + 2)) {
- ShowWarningError(state, format("{}{}=\"{}, duplicate value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state,
- format("Since VALUE is used for \"{}\", {}={} is ignored.",
- state.dataIPShortCut->cAlphaFieldNames(FieldNo + 2),
- state.dataIPShortCut->cAlphaFieldNames(Ptr + 2),
- Alphas(Ptr + 2)));
- }
- ApplyConvectionValue(state, Alphas(1), "INSIDE", state.dataSurface->TotIntConvCoeff);
- } else if (IntValue == ConvectionConstants::HcInt_Schedule) {
- ++state.dataSurface->TotIntConvCoeff;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).SurfaceName = Alphas(Ptr);
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).WhichSurface = -999;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).OverrideType =
- ConvectionConstants::ConvCoefOverrideType::Schedule;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).ScheduleIndex =
- ScheduleManager::GetScheduleIndex(state, Alphas(Ptr + 2));
- if (state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).ScheduleIndex == 0) {
- ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state,
- format(" Invalid {} entered={}", state.dataIPShortCut->cAlphaFieldNames(Ptr + 2), Alphas(Ptr + 2)));
- ErrorsFound = true;
- } else {
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).ScheduleName = Alphas(Ptr + 2);
- }
- ApplyConvectionValue(state, Alphas(1), "INSIDE", state.dataSurface->TotIntConvCoeff);
- } else if (IntValue == ConvectionConstants::HcInt_UserCurve) {
- ++state.dataSurface->TotIntConvCoeff;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).SurfaceName = Alphas(Ptr);
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).WhichSurface = -999;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).OverrideType =
- ConvectionConstants::ConvCoefOverrideType::UserCurve;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).UserCurveIndex =
- UtilityRoutines::FindItemInList(Alphas(Ptr + 3), state.dataConvectionCoefficient->HcInsideUserCurve);
- if (state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).UserCurveIndex == 0) {
-
- ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state,
- format(" Invalid {} entered={}", state.dataIPShortCut->cAlphaFieldNames(Ptr + 3), Alphas(Ptr + 3)));
- ErrorsFound = true;
- }
- PotentialAssignedValue = state.dataSurface->TotIntConvCoeff;
- ApplyConvectionValue(state, Alphas(1), "INSIDE", state.dataSurface->TotIntConvCoeff);
- } else if (IntValue > ConvectionConstants::HcInt_UserCurve) {
- // specificmodel
- ++state.dataSurface->TotIntConvCoeff;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).SurfaceName = Alphas(Ptr);
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).WhichSurface = -999;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).OverrideType =
- ConvectionConstants::ConvCoefOverrideType::SpecifiedModel;
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->TotIntConvCoeff).HcModelEq = IntValue;
- PotentialAssignedValue = state.dataSurface->TotIntConvCoeff;
- ApplyConvectionValue(state, Alphas(1), "INSIDE", state.dataSurface->TotIntConvCoeff);
-
- } else {
- // treat CeilingDiffuser and TrombeWall special
- if (UtilityRoutines::SameString(Alphas(Ptr + 1), "CEILINGDIFFUSER") ||
- UtilityRoutines::SameString(Alphas(Ptr + 1), "TROMBEWALL")) {
- ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state, format(" Invalid {} entered={}", state.dataIPShortCut->cAlphaFieldNames(Ptr), Alphas(Ptr)));
- ShowContinueError(state,
- format("invalid value in {}={}\". This type is only applicable at a Zone level.",
- state.dataIPShortCut->cAlphaFieldNames(Ptr + 1),
- Alphas(Ptr + 1)));
- ErrorsFound = true;
- } else { // really invalid
- ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state,
- format(" Invalid {} entered={}", state.dataIPShortCut->cAlphaFieldNames(Ptr + 1), Alphas(Ptr + 1)));
- ErrorsFound = true;
- }
- }
- }
- } else if (Alphas(Ptr).empty()) { // Blank
-
- } else { // Error Case
- ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, Alphas(1)));
- ShowContinueError(state, format(" Invalid {} entered={}", state.dataIPShortCut->cAlphaFieldNames(Ptr), Alphas(Ptr)));
- ErrorsFound = true;
- }
- }
-
- Ptr += 4;
- FieldNo += 4;
- ++NumField;
- }
- }
+ ErrorObjectHeader eoh{RoutineName, CurrentModuleObject, ""};
+ SurfaceFilter surfaceFilter = static_cast(getEnumValue(SurfaceFilterNamesUC, Alphas(1)));
- for (int Loop = 1; Loop <= state.dataSurface->TotIntConvCoeff; ++Loop) {
- if (state.dataSurface->UserIntConvectionCoeffs(Loop).OverrideType != ConvectionConstants::ConvCoefOverrideType::Schedule) continue;
- if (state.dataSurface->UserIntConvectionCoeffs(Loop).ScheduleIndex == 0) continue;
- if (ScheduleManager::CheckScheduleValueMinMax(state,
- state.dataSurface->UserIntConvectionCoeffs(Loop).ScheduleIndex,
- ">=",
- state.dataHeatBal->LowHConvLimit,
- "<=",
- state.dataHeatBal->HighHConvLimit))
- continue;
- ShowSevereError(
- state,
- format(
- "{}Surface=\"{}\", out-of-range convection coefficient:", RoutineName, state.dataSurface->UserIntConvectionCoeffs(Loop).SurfaceName));
- ShowContinueError(state, format("Out-of-range value found in schedule={}", state.dataSurface->UserIntConvectionCoeffs(Loop).ScheduleName));
- ShowContinueError(state,
- format("User supplied convection coefficients must be in range [>={:.9R}, <={:.1R}]",
- state.dataHeatBal->LowHConvLimit,
- state.dataHeatBal->HighHConvLimit));
- ShowContinueError(state, "Limits are set (or default) in HeatBalanceAlgorithm object.");
- ErrorsFound = true;
- }
+ for (int Pass = 1, Ptr = 2, FieldNo = 2, NumField = 1; Pass <= 2; ++Pass, Ptr += 4, FieldNo += 4, ++NumField) {
- for (int Loop = 1; Loop <= state.dataSurface->TotExtConvCoeff; ++Loop) {
- if (state.dataSurface->UserExtConvectionCoeffs(Loop).OverrideType != ConvectionConstants::ConvCoefOverrideType::Schedule) continue;
- if (state.dataSurface->UserExtConvectionCoeffs(Loop).ScheduleIndex == 0) continue;
- if (ScheduleManager::CheckScheduleValueMinMax(state,
- state.dataSurface->UserExtConvectionCoeffs(Loop).ScheduleIndex,
- ">=",
- state.dataHeatBal->LowHConvLimit,
- "<=",
- state.dataHeatBal->HighHConvLimit))
- continue;
- ShowSevereError(
- state,
- format(
- "{}Surface=\"{}\", out-of-range convection coefficient:", RoutineName, state.dataSurface->UserExtConvectionCoeffs(Loop).SurfaceName));
- ShowContinueError(state, format("Out-of-range value found in schedule={}", state.dataSurface->UserExtConvectionCoeffs(Loop).ScheduleName));
- ShowContinueError(state,
- format("User supplied convection coefficients must be in range [>={:.9R}, <={:.1R}]",
- state.dataHeatBal->LowHConvLimit,
- state.dataHeatBal->HighHConvLimit));
- ShowContinueError(state, "Limits are set (or default) in HeatBalanceAlgorithm object.");
- ErrorsFound = true;
- }
+ if (Alphas(Ptr).empty()) continue;
- if (state.dataHeatBal->DefaultOutsideConvectionAlgo == ConvectionConstants::HcExt_ASHRAESimple ||
- std::any_of(Zone.begin(), Zone.end(), [](DataHeatBalance::ZoneData const &e) {
- return e.OutsideConvectionAlgo == ConvectionConstants::HcExt_ASHRAESimple;
- })) {
- Count = 0;
- for (int Loop = 1; Loop <= state.dataSurface->TotExtConvCoeff; ++Loop) {
- int SurfNum = state.dataSurface->UserExtConvectionCoeffs(Loop).WhichSurface;
- // Tests show that Zone will override the simple convection specification of global.
- if (SurfNum <= 0) continue; // ignore this error condition
- if (Surface(SurfNum).Zone == 0) continue; // ignore this error condition
- if (Zone(Surface(SurfNum).Zone).OutsideConvectionAlgo == ConvectionConstants::HcExt_ASHRAESimple &&
- ((state.dataSurface->UserExtConvectionCoeffs(Loop).OverrideType == ConvectionConstants::ConvCoefOverrideType::SpecifiedModel &&
- state.dataSurface->UserExtConvectionCoeffs(Loop).HcModelEq != ConvectionConstants::HcExt_ASHRAESimple) ||
- state.dataSurface->UserExtConvectionCoeffs(Loop).OverrideType != ConvectionConstants::ConvCoefOverrideType::SpecifiedModel)) {
- ++Count;
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowSevereError(
- state,
- format("{}Surface=\"{}\", mixed algorithms.", RoutineName, state.dataSurface->UserExtConvectionCoeffs(Loop).SurfaceName));
- ShowContinueError(
- state, "Zone Outside Convection Algorithm specifies \"SimpleCombined\". SimpleCombined will be used for this surface.");
- }
- }
- }
- if (Count > 0) {
- ShowSevereMessage(state,
- format("{}{}", RoutineName, format("{} surfaces had different outside convection algorithms specified when", Count)));
- ShowContinueError(state,
- "the Zone Outside Convection Algorithm specifies \"SimpleCombined\". SimpleCombined will be used for these surfaces.");
- if (!state.dataGlobal->DisplayExtraWarnings) {
- ShowContinueError(state, "Use OutputDiagnostics,DisplayExtraWarnings; to see specific instances.");
- state.dataErrTracking->TotalSevereErrors += Count;
- }
- }
- }
+ if (Alphas(Ptr) == "OUTSIDE") {
- // get SurfaceConvectionAlgorithm:Inside:AdaptiveModelSelections
+ HcExt hcExt = static_cast(getEnumValue(HcExtNamesUC, Alphas(Ptr + 1)));
- CurrentModuleObject = "SurfaceConvectionAlgorithm:Inside:AdaptiveModelSelections";
- Count = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject);
- if (Count == 1) {
- state.dataInputProcessing->inputProcessor->getObjectItem(state,
- CurrentModuleObject,
- 1,
- state.dataIPShortCut->cAlphaArgs,
- NumAlphas,
- state.dataIPShortCut->rNumericArgs,
- NumNumbers,
- Status,
- state.dataIPShortCut->lNumericFieldBlanks,
- state.dataIPShortCut->lAlphaFieldBlanks,
- state.dataIPShortCut->cAlphaFieldNames,
- state.dataIPShortCut->cNumericFieldNames);
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.Name = state.dataIPShortCut->cAlphaArgs(1); // not used by E+, unique object
-
- int i = 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBuoyVertWallEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBuoyStableHorizEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBuoyUnstableHorizEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBuoyStableTiltedEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBuoyUnstableTiltedEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBuoyWindowsEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolVertWallEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolStableHorizEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolUnstableHorizEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolHeatedFloorEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolChilledCeilingEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolStableTiltedEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolUnstableTiltedEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolWindowsEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatVertWallEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatHeatedWallEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatStableHorizEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatUnstableHorizEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatStableTiltedEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatUnstableTiltedEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatWindowsEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatVertWallEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatVertWallNearHeaterEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatStableHorizEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatUnstableHorizEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatStableTiltedEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatUnstableTiltedEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatWindowsEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWallEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirCeilingEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirFloorEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWindowsEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircVertWallEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircStableHorizEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircUnstableHorizEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircStableTiltedEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircUnstableTiltedEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircWindowsEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedBuoyAssistingFlowWallEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedBuoyOpposingFlowWallEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedStableFloorEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedUnstableFloorEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedStableCeilingEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedUnstableCeilingEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedWindowsEqNum =
- SetInsideAdaptiveConvectionAlgo(state,
- HcInt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
- }
+ switch (hcExt) {
- CurrentModuleObject = "SurfaceConvectionAlgorithm:Outside:AdaptiveModelSelections";
- Count = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject);
- if (Count == 1) {
- state.dataInputProcessing->inputProcessor->getObjectItem(state,
- CurrentModuleObject,
- 1,
- state.dataIPShortCut->cAlphaArgs,
- NumAlphas,
- state.dataIPShortCut->rNumericArgs,
- NumNumbers,
- Status,
- state.dataIPShortCut->lNumericFieldBlanks,
- state.dataIPShortCut->lAlphaFieldBlanks,
- state.dataIPShortCut->cAlphaFieldNames,
- state.dataIPShortCut->cNumericFieldNames);
- state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.Name =
- state.dataIPShortCut->cAlphaArgs(1); // not used by E+, unique object
-
- int i = 2;
- state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindWallWindwardEqNum =
- SetOutsideAdaptiveConvectionAlgo(state,
- HcExt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindWallLeewardEqNum =
- SetOutsideAdaptiveConvectionAlgo(state,
- HcExt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindHorizRoofEqNum =
- SetOutsideAdaptiveConvectionAlgo(state,
- HcExt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatVertWallEqNum =
- SetOutsideAdaptiveConvectionAlgo(state,
- HcExt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatStableHorizEqNum =
- SetOutsideAdaptiveConvectionAlgo(state,
- HcExt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
-
- i += 2;
- state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatUnstableHorizEqNum =
- SetOutsideAdaptiveConvectionAlgo(state,
- HcExt_ConvectionTypesMap,
- ErrorsFound,
- state.dataIPShortCut->cAlphaArgs(i),
- state.dataIPShortCut->cAlphaArgs(i + 1),
- state.dataIPShortCut->cAlphaFieldNames(i),
- state.dataIPShortCut->cAlphaFieldNames(i + 1),
- RoutineName,
- CurrentModuleObject);
- }
-
- if (ErrorsFound) {
- ShowFatalError(state, format("{}Errors found getting input. Program termination.", RoutineName));
- }
-
- SetupAdaptiveConvectionStaticMetaData(state);
-}
-
-void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes, std::string const &ConvectionType, int const Value)
-{
-
- // SUBROUTINE INFORMATION:
- // AUTHOR Linda Lawrie
- // DATE WRITTEN November 2004
- // MODIFIED na
- // RE-ENGINEERED na
-
- // PURPOSE OF THIS SUBROUTINE:
- // This subroutine applies a convection type to a set of surfaces. This is
- // one of the "regular" convection types and becomes a "negative" convection
- // type to that surface.
-
- // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
- int SurfNum;
- bool SurfacesOfType;
- int SurfaceCountOutside;
- int SurfaceCountInside;
- std::string OverwriteMessage;
-
- auto &Surface(state.dataSurface->Surface);
-
- SurfacesType SurfType = static_cast(getEnumerationValue(SurfacesTypeNamesUC, UtilityRoutines::MakeUPPERCase(SurfaceTypes)));
-
- switch (SurfType) {
- case SurfacesType::AllExteriorSurfaces: {
- SurfacesOfType = false;
- SurfaceCountOutside = 0;
- SurfaceCountInside = 0;
- for (SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) {
- if (!Surface(SurfNum).HeatTransSurf) continue;
- if (Surface(SurfNum).ExtBoundCond > 0) continue; // Interior surfaces
- SurfacesOfType = true;
- if (ConvectionType == "OUTSIDE") {
- if (Surface(SurfNum).OSCPtr > 0) continue;
- if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) != 0) {
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
- "assigned value for (Outside) in Surface={}",
- SurfaceTypes,
- Surface(SurfNum).Name));
- } else {
- ++SurfaceCountOutside;
- }
- } else {
- state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = Value;
- }
- } else {
- if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) {
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
- "assigned value for (Inside) in Surface={}",
- SurfaceTypes,
- Surface(SurfNum).Name));
- } else {
- ++SurfaceCountInside;
- }
- } else {
- state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = Value;
- }
- }
- }
- if (!state.dataGlobal->DisplayExtraWarnings && (SurfaceCountOutside > 0 || SurfaceCountInside > 0)) {
- if (SurfaceCountOutside > 0) {
- OverwriteMessage = format("{} Outside", SurfaceCountOutside);
- }
- if (SurfaceCountInside > 0) {
- OverwriteMessage = format("{} Inside", SurfaceCountInside);
- }
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already assigned "
- "values for {} assignments.",
- SurfaceTypes,
- OverwriteMessage));
- }
- } break;
- case SurfacesType::AllExteriorWindows: {
- SurfacesOfType = false;
- SurfaceCountOutside = 0;
- SurfaceCountInside = 0;
- for (SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) {
- if (!Surface(SurfNum).HeatTransSurf) continue;
- if (Surface(SurfNum).ExtBoundCond > 0) continue; // Interior surfaces
- if (!state.dataConstruction->Construct(Surface(SurfNum).Construction).TypeIsWindow) continue;
- SurfacesOfType = true;
- if (ConvectionType == "OUTSIDE") {
- if (Surface(SurfNum).OSCPtr > 0) continue;
- if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) != 0) {
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
- "assigned value for (Outside) in Surface={}",
- SurfaceTypes,
- Surface(SurfNum).Name));
- } else {
- ++SurfaceCountOutside;
- }
- } else {
- state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = Value;
- }
- } else {
- if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) {
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
- "assigned value for (Inside) in Surface={}",
- SurfaceTypes,
- Surface(SurfNum).Name));
- } else {
- ++SurfaceCountInside;
- }
- } else {
- state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = Value;
- }
- }
- }
- if (!state.dataGlobal->DisplayExtraWarnings && (SurfaceCountOutside > 0 || SurfaceCountInside > 0)) {
- if (SurfaceCountOutside > 0) {
- OverwriteMessage = format("{} Outside", SurfaceCountOutside);
- }
- if (SurfaceCountInside > 0) {
- OverwriteMessage = format("{} Inside", SurfaceCountInside);
- }
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already assigned "
- "values for {} assignments.",
- SurfaceTypes,
- OverwriteMessage));
- }
- } break;
- case SurfacesType::AllExteriorWalls: {
- SurfacesOfType = false;
- SurfaceCountOutside = 0;
- SurfaceCountInside = 0;
- for (SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) {
- if (!Surface(SurfNum).HeatTransSurf) continue;
- if (Surface(SurfNum).ExtBoundCond > 0) continue; // Interior surfaces
- if (Surface(SurfNum).Class != SurfaceClass::Wall) continue;
- SurfacesOfType = true;
- if (ConvectionType == "OUTSIDE") {
- if (Surface(SurfNum).OSCPtr > 0) continue;
- if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) != 0) {
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
- "assigned value for (Outside) in Surface={}",
- SurfaceTypes,
- Surface(SurfNum).Name));
- } else {
- ++SurfaceCountOutside;
- }
- } else {
- state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = Value;
- }
- } else {
- if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) {
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
- "assigned value for (Inside) in Surface={}",
- SurfaceTypes,
- Surface(SurfNum).Name));
- } else {
- ++SurfaceCountInside;
- }
- } else {
- state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = Value;
- }
- }
- }
- if (!state.dataGlobal->DisplayExtraWarnings && (SurfaceCountOutside > 0 || SurfaceCountInside > 0)) {
- if (SurfaceCountOutside > 0) {
- OverwriteMessage = format("{} Outside", SurfaceCountOutside);
- }
- if (SurfaceCountInside > 0) {
- OverwriteMessage = format("{} Inside", SurfaceCountInside);
- }
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already assigned "
- "values for {} assignments.",
- SurfaceTypes,
- OverwriteMessage));
- }
- } break;
- case SurfacesType::AllExteriorRoofs: {
- SurfacesOfType = false;
- SurfaceCountOutside = 0;
- SurfaceCountInside = 0;
- for (SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) {
- if (!Surface(SurfNum).HeatTransSurf) continue;
- if (Surface(SurfNum).ExtBoundCond > 0) continue; // Interior surfaces
- if (Surface(SurfNum).Class != SurfaceClass::Roof) continue;
- SurfacesOfType = true;
- if (ConvectionType == "OUTSIDE") {
- if (Surface(SurfNum).OSCPtr > 0) continue;
- if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) != 0) {
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
- "assigned value for (Outside) in Surface={}",
- SurfaceTypes,
- Surface(SurfNum).Name));
- } else {
- ++SurfaceCountOutside;
- }
- } else {
- state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = Value;
- }
- } else {
- if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) {
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
- "assigned value for (Inside) in Surface={}",
- SurfaceTypes,
- Surface(SurfNum).Name));
- } else {
- ++SurfaceCountInside;
- }
- } else {
- state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = Value;
- }
- }
- }
- if (!state.dataGlobal->DisplayExtraWarnings && (SurfaceCountOutside > 0 || SurfaceCountInside > 0)) {
- if (SurfaceCountOutside > 0) {
- OverwriteMessage = format("{} Outside", SurfaceCountOutside);
- }
- if (SurfaceCountInside > 0) {
- OverwriteMessage = format("{} Inside", SurfaceCountInside);
- }
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already assigned "
- "values for {} assignments.",
- SurfaceTypes,
- OverwriteMessage));
- }
- } break;
- case SurfacesType::AllExteriorFloors: {
- SurfacesOfType = false;
- SurfaceCountOutside = 0;
- SurfaceCountInside = 0;
- for (SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) {
- if (!Surface(SurfNum).HeatTransSurf) continue;
- if (Surface(SurfNum).ExtBoundCond > 0) continue; // Interior surfaces
- if (Surface(SurfNum).Class != SurfaceClass::Floor) continue;
- SurfacesOfType = true;
- if (ConvectionType == "OUTSIDE") {
- if (Surface(SurfNum).OSCPtr > 0) continue;
- if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) != 0) {
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
- "assigned value for (Outside) in Surface={}",
- SurfaceTypes,
- Surface(SurfNum).Name));
- } else {
- ++SurfaceCountOutside;
+ // Are these not used anymore? Can just get rid of them and let these inputs become HcExt::Invalid;
+ case HcExt::SetByZone:
+ case HcExt::BLASTHcOutside:
+ case HcExt::UserValue:
+ case HcExt::UserSchedule: {
+ ShowSevereError(state, format("{}{}=\"{}, check input", RoutineName, CurrentModuleObject, Alphas(1)));
+ ShowContinueError(state, format("Check Input Entered :{}", Alphas(Ptr + 1)));
+ ErrorsFound = true;
+ } break;
+
+ case HcExt::ASHRAESimple:
+ case HcExt::ASHRAETARP:
+ case HcExt::MoWiTTHcOutside:
+ case HcExt::DOE2HcOutside:
+ case HcExt::AdaptiveConvectionAlgorithm: {
+ ApplyExtConvValueMulti(state, surfaceFilter, hcExt, 0);
+ } break;
+
+ case HcExt::Value: {
+ // SimpleValueAssignment via userExtConvModels array
+ ++state.dataSurface->TotUserExtConvModels;
+ auto &userExtConvModel = state.dataSurface->userExtConvModels(state.dataSurface->TotUserExtConvModels);
+ userExtConvModel.SurfaceName = Alphas(Ptr);
+ userExtConvModel.WhichSurface = -999;
+ if (Numbers(NumField) < state.dataHeatBal->LowHConvLimit || Numbers(NumField) > state.dataHeatBal->HighHConvLimit) {
+ ShowSevereValueOutOfRange(state,
+ eoh,
+ ipsc->cNumericFieldNames(NumField),
+ Numbers(NumField),
+ state.dataHeatBal->LowHConvLimit,
+ state.dataHeatBal->HighHConvLimit,
+ "Limits are set (or default) in HeatBalanceAlgorithm object.");
+ ErrorsFound = true;
}
- } else {
- state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = Value;
- }
- } else {
- if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) {
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
- "assigned value for (Inside) in Surface={}",
- SurfaceTypes,
- Surface(SurfNum).Name));
- } else {
- ++SurfaceCountInside;
+ userExtConvModel.overrideType = OverrideType::Value;
+ userExtConvModel.OverrideValue = Numbers(NumField);
+ if (!ipsc->lAlphaFieldBlanks(Ptr + 2)) {
+ ShowWarningError(state, format("{}{}=\"{}, duplicate value", RoutineName, CurrentModuleObject, Alphas(1)));
+ ShowContinueError(state,
+ format("Since VALUE is used for \"{}\", {}={} is ignored.",
+ ipsc->cAlphaFieldNames(FieldNo + 2),
+ ipsc->cAlphaFieldNames(Ptr + 2),
+ Alphas(Ptr + 2)));
}
- } else {
- state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = Value;
- }
- }
- }
- if (!state.dataGlobal->DisplayExtraWarnings && (SurfaceCountOutside > 0 || SurfaceCountInside > 0)) {
- if (SurfaceCountOutside > 0) {
- OverwriteMessage = format("{} Outside", SurfaceCountOutside);
- }
- if (SurfaceCountInside > 0) {
- OverwriteMessage = format("{} Inside", SurfaceCountInside);
- }
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already assigned "
- "values for {} assignments.",
- SurfaceTypes,
- OverwriteMessage));
- }
- } break;
- case SurfacesType::AllInteriorSurfaces: {
- SurfacesOfType = false;
- SurfaceCountOutside = 0;
- SurfaceCountInside = 0;
- for (SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) {
- if (!Surface(SurfNum).HeatTransSurf) continue;
- if (Surface(SurfNum).ExtBoundCond <= 0) continue; // Exterior surfaces
- SurfacesOfType = true;
- if (ConvectionType == "OUTSIDE") {
- if (Surface(SurfNum).OSCPtr > 0) continue;
- if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) != 0) {
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
- "assigned value for (Outside) in Surface={}",
- SurfaceTypes,
- Surface(SurfNum).Name));
+ ApplyExtConvValueMulti(state, surfaceFilter, hcExt, state.dataSurface->TotUserExtConvModels);
+ } break;
+
+ case HcExt::Schedule: {
+ ++state.dataSurface->TotUserExtConvModels;
+ auto &userExtConvModel = state.dataSurface->userExtConvModels(state.dataSurface->TotUserExtConvModels);
+ userExtConvModel.SurfaceName = Alphas(Ptr);
+ userExtConvModel.WhichSurface = -999;
+ userExtConvModel.overrideType = OverrideType::Schedule;
+ userExtConvModel.ScheduleIndex = ScheduleManager::GetScheduleIndex(state, Alphas(Ptr + 2));
+ if (userExtConvModel.ScheduleIndex == 0) {
+ ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(Ptr + 2), Alphas(Ptr + 2));
+ ErrorsFound = true;
+ } else if (!ScheduleManager::CheckScheduleValueMinMax(state,
+ userExtConvModel.ScheduleIndex,
+ ScheduleManager::Clusivity::Inclusive,
+ state.dataHeatBal->LowHConvLimit, // >=
+ ScheduleManager::Clusivity::Inclusive,
+ state.dataHeatBal->HighHConvLimit)) { // <=
+ ShowSevereScheduleOutOfRange(state,
+ eoh,
+ ipsc->cAlphaFieldNames(Ptr + 2),
+ Alphas(Ptr + 2),
+ state.dataHeatBal->LowHConvLimit,
+ state.dataHeatBal->HighHConvLimit,
+ "Limits are set (or default) in HeatBalanceAlgorithm object.");
+ ErrorsFound = true;
} else {
- ++SurfaceCountOutside;
+ userExtConvModel.ScheduleName = Alphas(Ptr + 2);
}
- } else {
- state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = Value;
- }
- } else {
- if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) {
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
- "assigned value for (Inside) in Surface={}",
- SurfaceTypes,
- Surface(SurfNum).Name));
- } else {
- ++SurfaceCountInside;
+ ApplyExtConvValueMulti(state, surfaceFilter, hcExt, state.dataSurface->TotUserExtConvModels);
+ } break;
+
+ case HcExt::UserCurve: { // User curve
+ ++state.dataSurface->TotUserExtConvModels;
+ auto &userExtConvModel = state.dataSurface->userExtConvModels(state.dataSurface->TotUserExtConvModels);
+ userExtConvModel.SurfaceName = Alphas(Ptr);
+ userExtConvModel.WhichSurface = -999;
+ userExtConvModel.overrideType = OverrideType::UserCurve;
+ userExtConvModel.UserCurveIndex = UtilityRoutines::FindItemInList(Alphas(Ptr + 3), state.dataConvect->hcExtUserCurve);
+ if (userExtConvModel.UserCurveIndex == 0) {
+ ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(Ptr + 3), Alphas(Ptr + 3));
+ ErrorsFound = true;
}
- } else {
- state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = Value;
- }
- }
- }
- if (!state.dataGlobal->DisplayExtraWarnings && (SurfaceCountOutside > 0 || SurfaceCountInside > 0)) {
- if (SurfaceCountOutside > 0) {
- OverwriteMessage = format("{} Outside", SurfaceCountOutside);
- }
- if (SurfaceCountInside > 0) {
- OverwriteMessage = format("{} Inside", SurfaceCountInside);
- }
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already assigned "
- "values for {} assignments.",
- SurfaceTypes,
- OverwriteMessage));
- }
- } break;
- case SurfacesType::AllInteriorWindows: {
- SurfacesOfType = false;
- SurfaceCountOutside = 0;
- SurfaceCountInside = 0;
- for (SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) {
- if (!Surface(SurfNum).HeatTransSurf) continue;
- if (Surface(SurfNum).ExtBoundCond <= 0) continue; // Exterior surfaces
- if (!state.dataConstruction->Construct(Surface(SurfNum).Construction).TypeIsWindow) continue;
- SurfacesOfType = true;
- if (ConvectionType == "OUTSIDE") {
- if (Surface(SurfNum).OSCPtr > 0) continue;
- if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) != 0) {
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
- "assigned value for (Outside) in Surface={}",
- SurfaceTypes,
- Surface(SurfNum).Name));
- } else {
- ++SurfaceCountOutside;
+ ApplyExtConvValueMulti(state, surfaceFilter, hcExt, state.dataSurface->TotUserExtConvModels);
+ } break;
+
+ default: { // > HcExt::UserCurve
+ // specificmodel
+ ++state.dataSurface->TotUserExtConvModels;
+ auto &userExtConvModel = state.dataSurface->userExtConvModels(state.dataSurface->TotUserExtConvModels);
+ userExtConvModel.SurfaceName = Alphas(Ptr);
+ userExtConvModel.WhichSurface = -999;
+ userExtConvModel.overrideType = OverrideType::SpecifiedModel;
+ userExtConvModel.HcExtModelEq = hcExt;
+ ApplyExtConvValueMulti(state, surfaceFilter, hcExt, state.dataSurface->TotUserExtConvModels);
+ } break;
+ } // switch (hcExt)
+
+ } else if (Alphas(Ptr) == "INSIDE") {
+ HcInt hcInt = static_cast(getEnumValue(HcIntNamesUC, Alphas(Ptr + 1)));
+
+ switch (hcInt) {
+
+ // Are these not used anymore? We can delete them and let them become HcInt::Invalid
+ case HcInt::SetByZone:
+ case HcInt::UserValue:
+ case HcInt::UserSchedule: {
+ ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, Alphas(1)));
+ ShowContinueError(state, format(" Invalid {} entered={}", ipsc->cAlphaFieldNames(Ptr + 1), Alphas(Ptr + 1)));
+ ErrorsFound = true;
+ } break;
+
+ case HcInt::CeilingDiffuser:
+ case HcInt::TrombeWall: {
+ ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, Alphas(1)));
+ ShowContinueError(state, format(" Invalid {} entered={}", ipsc->cAlphaFieldNames(Ptr), Alphas(Ptr)));
+ ShowContinueError(state,
+ format("invalid value in {}={}\". This type is only applicable at a Zone level.",
+ ipsc->cAlphaFieldNames(Ptr + 1),
+ Alphas(Ptr + 1)));
+ ErrorsFound = true;
+ } break;
+
+ case HcInt::ASHRAESimple:
+ case HcInt::ASHRAETARP:
+ case HcInt::AdaptiveConvectionAlgorithm:
+ case HcInt::ASTMC1340: {
+ ApplyIntConvValueMulti(state, surfaceFilter, hcInt, 0);
+ } break;
+
+ case HcInt::Value: {
+ // SimpleValueAssignment via userExtConvModels array
+ ++state.dataSurface->TotUserIntConvModels;
+ auto &userIntConvModel = state.dataSurface->userIntConvModels(state.dataSurface->TotUserIntConvModels);
+ userIntConvModel.SurfaceName = Alphas(Ptr);
+ userIntConvModel.WhichSurface = -999;
+ if (Numbers(NumField) < state.dataHeatBal->LowHConvLimit || Numbers(NumField) > state.dataHeatBal->HighHConvLimit) {
+ ShowSevereValueOutOfRange(state,
+ eoh,
+ ipsc->cNumericFieldNames(NumField),
+ Numbers(NumField),
+ state.dataHeatBal->LowHConvLimit,
+ state.dataHeatBal->HighHConvLimit,
+ "Limits are set (or default) in HeatBalanceAlgorithm object.");
+ ErrorsFound = true;
}
- } else {
- state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = Value;
- }
- } else {
- if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) {
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
- "assigned value for (Inside) in Surface={}",
- SurfaceTypes,
- Surface(SurfNum).Name));
- } else {
- ++SurfaceCountInside;
+ userIntConvModel.overrideType = OverrideType::Value;
+ userIntConvModel.OverrideValue = Numbers(NumField);
+ if (!ipsc->lAlphaFieldBlanks(Ptr + 2)) {
+ ShowWarningError(state, format("{}{}=\"{}, duplicate value", RoutineName, CurrentModuleObject, Alphas(1)));
+ ShowContinueError(state,
+ format("Since VALUE is used for \"{}\", {}={} is ignored.",
+ ipsc->cAlphaFieldNames(FieldNo + 2),
+ ipsc->cAlphaFieldNames(Ptr + 2),
+ Alphas(Ptr + 2)));
}
- } else {
- state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = Value;
- }
- }
- }
- if (!state.dataGlobal->DisplayExtraWarnings && (SurfaceCountOutside > 0 || SurfaceCountInside > 0)) {
- if (SurfaceCountOutside > 0) {
- OverwriteMessage = format("{} Outside", SurfaceCountOutside);
- }
- if (SurfaceCountInside > 0) {
- OverwriteMessage = format("{} Inside", SurfaceCountInside);
- }
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already assigned "
- "values for {} assignments.",
- SurfaceTypes,
- OverwriteMessage));
- }
- } break;
- case SurfacesType::AllInteriorWalls: {
- SurfacesOfType = false;
- SurfaceCountOutside = 0;
- SurfaceCountInside = 0;
- for (SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) {
- if (!Surface(SurfNum).HeatTransSurf) continue;
- if (Surface(SurfNum).ExtBoundCond <= 0) continue; // Exterior surfaces
- if (Surface(SurfNum).Class != SurfaceClass::Wall) continue;
- SurfacesOfType = true;
- if (ConvectionType == "OUTSIDE") {
- if (Surface(SurfNum).OSCPtr > 0) continue;
- if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) != 0) {
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
- "assigned value for (Outside) in Surface={}",
- SurfaceTypes,
- Surface(SurfNum).Name));
+ ApplyIntConvValueMulti(state, surfaceFilter, hcInt, state.dataSurface->TotUserIntConvModels);
+ } break;
+
+ case HcInt::Schedule: {
+ ++state.dataSurface->TotUserIntConvModels;
+ auto &userIntConvModel = state.dataSurface->userIntConvModels(state.dataSurface->TotUserIntConvModels);
+ userIntConvModel.SurfaceName = Alphas(Ptr);
+ userIntConvModel.WhichSurface = -999;
+ userIntConvModel.overrideType = OverrideType::Schedule;
+ userIntConvModel.ScheduleIndex = ScheduleManager::GetScheduleIndex(state, Alphas(Ptr + 2));
+ if (userIntConvModel.ScheduleIndex == 0) {
+ ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(Ptr + 2), Alphas(Ptr + 2));
+ ErrorsFound = true;
+ } else if (!ScheduleManager::CheckScheduleValueMinMax(state,
+ userIntConvModel.ScheduleIndex,
+ ScheduleManager::Clusivity::Inclusive,
+ state.dataHeatBal->LowHConvLimit, // >=
+ ScheduleManager::Clusivity::Inclusive,
+ state.dataHeatBal->HighHConvLimit)) { // <=
+ ShowSevereScheduleOutOfRange(state,
+ eoh,
+ ipsc->cAlphaFieldNames(Ptr + 2),
+ Alphas(Ptr + 2),
+ state.dataHeatBal->LowHConvLimit,
+ state.dataHeatBal->HighHConvLimit,
+ "Limits are set (or default) in HeatBalanceAlgorithm object.");
+ ErrorsFound = true;
} else {
- ++SurfaceCountOutside;
+ userIntConvModel.ScheduleName = Alphas(Ptr + 2);
}
- } else {
- state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = Value;
- }
- } else {
- if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) {
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
- "assigned value for (Inside) in Surface={}",
- SurfaceTypes,
- Surface(SurfNum).Name));
- } else {
- ++SurfaceCountInside;
+ ApplyIntConvValueMulti(state, surfaceFilter, hcInt, state.dataSurface->TotUserIntConvModels);
+ } break;
+
+ case HcInt::UserCurve: {
+ ++state.dataSurface->TotUserIntConvModels;
+ auto &userIntConvModel = state.dataSurface->userIntConvModels(state.dataSurface->TotUserIntConvModels);
+ userIntConvModel.SurfaceName = Alphas(Ptr);
+ userIntConvModel.WhichSurface = -999;
+ userIntConvModel.overrideType = OverrideType::UserCurve;
+ userIntConvModel.UserCurveIndex = UtilityRoutines::FindItemInList(Alphas(Ptr + 3), state.dataConvect->hcIntUserCurve);
+ if (userIntConvModel.UserCurveIndex == 0) {
+ ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(Ptr + 3), Alphas(Ptr + 3));
+ ErrorsFound = true;
}
- } else {
- state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = Value;
- }
- }
- }
- if (!state.dataGlobal->DisplayExtraWarnings && (SurfaceCountOutside > 0 || SurfaceCountInside > 0)) {
- if (SurfaceCountOutside > 0) {
- OverwriteMessage = format("{} Outside", SurfaceCountOutside);
- }
- if (SurfaceCountInside > 0) {
- OverwriteMessage = format("{} Inside", SurfaceCountInside);
+ ApplyIntConvValueMulti(state, surfaceFilter, hcInt, state.dataSurface->TotUserIntConvModels);
+ } break;
+
+ default: { // > HcInt::UserCurve
+ // specificmodel
+ ++state.dataSurface->TotUserIntConvModels;
+ auto &userIntConvModel = state.dataSurface->userIntConvModels(state.dataSurface->TotUserIntConvModels);
+ userIntConvModel.SurfaceName = Alphas(Ptr);
+ userIntConvModel.WhichSurface = -999;
+ userIntConvModel.overrideType = OverrideType::SpecifiedModel;
+ userIntConvModel.HcIntModelEq = hcInt;
+ ApplyIntConvValueMulti(state, surfaceFilter, hcInt, state.dataSurface->TotUserIntConvModels);
+ } break;
+ } // switch (hcIn)
+
+ } else { // Error Case
+ ShowSevereError(state, format("{}{}=\"{}, invalid value", RoutineName, CurrentModuleObject, Alphas(1)));
+ ShowContinueError(state, format(" Invalid {} entered={}", ipsc->cAlphaFieldNames(Ptr), Alphas(Ptr)));
+ ErrorsFound = true;
}
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already assigned "
- "values for {} assignments.",
- SurfaceTypes,
- OverwriteMessage));
- }
- } break;
- case SurfacesType::AllInteriorRoofs:
- case SurfacesType::AllInteriorCeilings: {
- SurfacesOfType = false;
- SurfaceCountOutside = 0;
- SurfaceCountInside = 0;
- for (SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) {
- if (!Surface(SurfNum).HeatTransSurf) continue;
- if (Surface(SurfNum).ExtBoundCond <= 0) continue; // Exterior surfaces
- if (Surface(SurfNum).Class != SurfaceClass::Roof) continue;
- SurfacesOfType = true;
- if (ConvectionType == "OUTSIDE") {
- if (Surface(SurfNum).OSCPtr > 0) continue;
- if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) != 0) {
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
- "assigned value for (Outside) in Surface={}",
- SurfaceTypes,
- Surface(SurfNum).Name));
- } else {
- ++SurfaceCountOutside;
- }
- } else {
- state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = Value;
- }
- } else {
- if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) {
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
- "assigned value for (Inside) in Surface={}",
- SurfaceTypes,
- Surface(SurfNum).Name));
- } else {
- ++SurfaceCountInside;
- }
- } else {
- state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = Value;
+ } // for (Pass)
+ } // for (Loop)
+
+ if (state.dataHeatBal->DefaultExtConvAlgo == HcExt::ASHRAESimple ||
+ std::any_of(Zone.begin(), Zone.end(), [](DataHeatBalance::ZoneData const &e) { return e.ExtConvAlgo == HcExt::ASHRAESimple; })) {
+ Count = 0;
+ for (int Loop = 1; Loop <= state.dataSurface->TotUserExtConvModels; ++Loop) {
+ auto const &userExtConvModel = state.dataSurface->userExtConvModels(Loop);
+ int SurfNum = userExtConvModel.WhichSurface;
+ // Tests show that Zone will override the simple convection specification of global.
+ if (SurfNum <= 0) continue; // ignore this error condition
+ if (Surface(SurfNum).Zone == 0) continue; // ignore this error condition
+ if (Zone(Surface(SurfNum).Zone).ExtConvAlgo == HcExt::ASHRAESimple &&
+ ((userExtConvModel.overrideType == OverrideType::SpecifiedModel && userExtConvModel.HcExtModelEq != HcExt::ASHRAESimple) ||
+ userExtConvModel.overrideType != OverrideType::SpecifiedModel)) {
+ ++Count;
+ if (state.dataGlobal->DisplayExtraWarnings) {
+ ShowSevereError(state, format("{}Surface=\"{}\", mixed algorithms.", RoutineName, userExtConvModel.SurfaceName));
+ ShowContinueError(
+ state, "Zone Outside Convection Algorithm specifies \"SimpleCombined\". SimpleCombined will be used for this surface.");
}
}
}
- if (!state.dataGlobal->DisplayExtraWarnings && (SurfaceCountOutside > 0 || SurfaceCountInside > 0)) {
- if (SurfaceCountOutside > 0) {
- OverwriteMessage = format("{} Outside", SurfaceCountOutside);
- }
- if (SurfaceCountInside > 0) {
- OverwriteMessage = format("{} Inside", SurfaceCountInside);
+ if (Count > 0) {
+ ShowSevereMessage(state,
+ format("{}{}", RoutineName, format("{} surfaces had different outside convection algorithms specified when", Count)));
+ ShowContinueError(state,
+ "the Zone Outside Convection Algorithm specifies \"SimpleCombined\". SimpleCombined will be used for these surfaces.");
+ if (!state.dataGlobal->DisplayExtraWarnings) {
+ ShowContinueError(state, "Use OutputDiagnostics,DisplayExtraWarnings; to see specific instances.");
+ state.dataErrTracking->TotalSevereErrors += Count;
}
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already assigned "
- "values for {} assignments.",
- SurfaceTypes,
- OverwriteMessage));
}
- } break;
- case SurfacesType::AllInteriorFloors: {
- SurfacesOfType = false;
- SurfaceCountOutside = 0;
- SurfaceCountInside = 0;
- for (SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) {
- if (!Surface(SurfNum).HeatTransSurf) continue;
- if (Surface(SurfNum).ExtBoundCond <= 0) continue; // Exterior surfaces
- if (Surface(SurfNum).Class != SurfaceClass::Floor) continue;
- SurfacesOfType = true;
- if (ConvectionType == "OUTSIDE") {
- if (Surface(SurfNum).OSCPtr > 0) continue;
- if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) != 0) {
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
- "assigned value for (Outside) in Surface={}",
- SurfaceTypes,
- Surface(SurfNum).Name));
- } else {
- ++SurfaceCountOutside;
- }
- } else {
- state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = Value;
- }
- } else {
- if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) {
- if (state.dataGlobal->DisplayExtraWarnings) {
- ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
- "assigned value for (Inside) in Surface={}",
- SurfaceTypes,
- Surface(SurfNum).Name));
- } else {
- ++SurfaceCountInside;
- }
- } else {
- state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = Value;
+ }
+
+ // get SurfaceConvectionAlgorithm:Inside:AdaptiveModelSelections
+
+ CurrentModuleObject = "SurfaceConvectionAlgorithm:Inside:AdaptiveModelSelections";
+ Count = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject);
+ if (Count == 1) {
+ state.dataInputProcessing->inputProcessor->getObjectItem(state,
+ CurrentModuleObject,
+ 1,
+ ipsc->cAlphaArgs,
+ NumAlphas,
+ ipsc->rNumericArgs,
+ NumNumbers,
+ Status,
+ ipsc->lNumericFieldBlanks,
+ ipsc->lAlphaFieldBlanks,
+ ipsc->cAlphaFieldNames,
+ ipsc->cNumericFieldNames);
+ // state.dataConvect->intAdaptiveConvAlgo.Name = ipsc->cAlphaArgs(1); // not used by E+, unique object
+ ErrorObjectHeader eoh{RoutineName, CurrentModuleObject, ipsc->cAlphaArgs(1)};
+
+ auto &intAlgo = state.dataConvect->intAdaptiveConvAlgo;
+ for (int iInConvClass = 0, i = 2; iInConvClass < (int)IntConvClass::Num && i <= NumAlphas; ++iInConvClass, i += 2) {
+
+ intAlgo.intConvClassEqNums[iInConvClass] = static_cast(getEnumValue(HcIntNamesUC, ipsc->cAlphaArgs(i)));
+
+ if (intAlgo.intConvClassEqNums[iInConvClass] == HcInt::Invalid) {
+ ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(i), ipsc->cAlphaArgs(i));
+ ErrorsFound = true;
+ } else if (intAlgo.intConvClassEqNums[iInConvClass] == HcInt::UserCurve) {
+ intAlgo.intConvClassUserCurveNums[iInConvClass] =
+ UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(i + 1), state.dataConvect->hcIntUserCurve);
+ if (intAlgo.intConvClassUserCurveNums[iInConvClass] == 0) {
+ ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(i + 1), ipsc->cAlphaArgs(i + 1));
+ ErrorsFound = true;
}
}
- }
- if (!state.dataGlobal->DisplayExtraWarnings && (SurfaceCountOutside > 0 || SurfaceCountInside > 0)) {
- if (SurfaceCountOutside > 0) {
- OverwriteMessage = format("{} Outside", SurfaceCountOutside);
- }
- if (SurfaceCountInside > 0) {
- OverwriteMessage = format("{} Inside", SurfaceCountInside);
+ } // for (iInConvClass)
+ }
+
+ CurrentModuleObject = "SurfaceConvectionAlgorithm:Outside:AdaptiveModelSelections";
+ Count = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject);
+ if (Count == 1) {
+ state.dataInputProcessing->inputProcessor->getObjectItem(state,
+ CurrentModuleObject,
+ 1,
+ ipsc->cAlphaArgs,
+ NumAlphas,
+ ipsc->rNumericArgs,
+ NumNumbers,
+ Status,
+ ipsc->lNumericFieldBlanks,
+ ipsc->lAlphaFieldBlanks,
+ ipsc->cAlphaFieldNames,
+ ipsc->cNumericFieldNames);
+
+ // state.dataConvect->ExtAdaptiveConvAlgo.Name = ipsc->cAlphaArgs(1); // not used by E+, unique object
+ ErrorObjectHeader eoh{RoutineName, CurrentModuleObject, ipsc->cAlphaArgs(1)};
+ auto &extAlgo = state.dataConvect->extAdaptiveConvAlgo;
+
+ for (int iOutConvClass = 0, i = 2; i < (int)ExtConvClass::Num && i <= NumAlphas; ++iOutConvClass, i += 2) {
+
+ extAlgo.extConvClass2EqNums[iOutConvClass] = static_cast(getEnumValue(HcExtNamesUC, ipsc->cAlphaArgs(i)));
+
+ if (extAlgo.extConvClass2EqNums[iOutConvClass] == HcExt::Invalid) {
+ ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(i), ipsc->cAlphaArgs(i));
+ ErrorsFound = true;
+
+ } else if (extAlgo.extConvClass2EqNums[iOutConvClass] == HcExt::UserCurve) {
+ extAlgo.extConvClass2UserCurveNums[iOutConvClass] =
+ UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(i + 1), state.dataConvect->hcExtUserCurve);
+ if (extAlgo.extConvClass2UserCurveNums[iOutConvClass] == 0) {
+ ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(i + 1), ipsc->cAlphaArgs(i + 1));
+ ErrorsFound = true;
+ }
}
+ } // for (iOutConvClass)
+ } // if (Count == 1)
+
+ if (ErrorsFound) {
+ ShowFatalError(state, format("{}Errors found getting input. Program termination.", RoutineName));
+ }
+
+ SetupAdaptiveConvStaticMetaData(state);
+}
+
+void ApplyIntConvValue(EnergyPlusData &state, int surfNum, HcInt model, int convUserCoeffNum)
+{
+ auto &surfIntConv = state.dataSurface->surfIntConv(surfNum);
+ if (convUserCoeffNum == 0) {
+ surfIntConv.model = model;
+ } else if (surfIntConv.userModelNum == 0) {
+ surfIntConv.model = model;
+ surfIntConv.userModelNum = convUserCoeffNum;
+ } else {
+ ShowWarningError(state,
+ format("User Supplied Convection Coefficients not overwriting already assigned value for (Inside) in Surface={}",
+ state.dataSurface->Surface(surfNum).Name));
+ }
+}
+
+void ApplyIntConvValueMulti(EnergyPlusData &state, SurfaceFilter surfaceFilter, HcInt model, int userModelNum)
+{
+
+ // SUBROUTINE INFORMATION:
+ // AUTHOR Linda Lawrie
+ // DATE WRITTEN November 2004
+
+ // PURPOSE OF THIS SUBROUTINE:
+ // This subroutine applies a convection type to a set of surfaces.
+
+ if (state.dataSurface->SurfaceFilterLists[(int)surfaceFilter].size() == 0) {
+ ShowWarningError(state,
+ format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", there were no surfaces of that type "
+ "found for Inside assignment.",
+ SurfaceFilterNamesUC[(int)surfaceFilter]));
+ return;
+ }
+
+ int numWarnings = 0;
+ for (int surfNum : state.dataSurface->SurfaceFilterLists[(int)surfaceFilter]) {
+ auto &surfIntConv = state.dataSurface->surfIntConv(surfNum);
+ if (userModelNum == 0) {
+ surfIntConv.model = model;
+ } else if (surfIntConv.userModelNum == 0) {
+ surfIntConv.model = model;
+ surfIntConv.userModelNum = userModelNum;
+ } else if (state.dataGlobal->DisplayExtraWarnings) {
ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already assigned "
- "values for {} assignments.",
- SurfaceTypes,
- OverwriteMessage));
+ format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
+ "assigned value for (Inside) in Surface={}",
+ SurfaceFilterNamesUC[(int)surfaceFilter],
+ state.dataSurface->Surface(surfNum).Name));
+ } else {
+ ++numWarnings;
}
- } break;
- default: {
- SurfacesOfType = false;
- } break;
+ } // for (surfNum)
+
+ if (!state.dataGlobal->DisplayExtraWarnings && numWarnings > 0) {
+ ShowWarningError(state,
+ format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already assigned "
+ "values for {} Inside assignments.",
+ SurfaceFilterNamesUC[(int)surfaceFilter],
+ numWarnings));
}
+}
- if (!SurfacesOfType) {
+void ApplyExtConvValue(EnergyPlusData &state, int surfNum, HcExt model, int userModelNum)
+{
+ if (state.dataSurface->Surface(surfNum).OSCPtr > 0) return;
+
+ auto &surfExtConv = state.dataSurface->surfExtConv(surfNum);
+ if (userModelNum == 0) {
+ surfExtConv.model = model;
+ } else if (surfExtConv.userModelNum == 0) {
+ surfExtConv.model = model;
+ surfExtConv.userModelNum = userModelNum;
+ } else {
ShowWarningError(state,
- format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", there were no surfaces of that type "
- "found for {} assignment.",
- SurfaceTypes,
- ConvectionType));
+ format("User Supplied Convection Coefficients not overwriting already assigned value for (Outside) in Surface={}",
+ state.dataSurface->Surface(surfNum).Name));
+ }
+}
+
+void ApplyExtConvValueMulti(EnergyPlusData &state, SurfaceFilter surfaceFilter, HcExt model, int convUserCoeffNum)
+{
+
+ // SUBROUTINE INFORMATION:
+ // AUTHOR Linda Lawrie
+ // DATE WRITTEN November 2004
+
+ // PURPOSE OF THIS SUBROUTINE:
+ // This subroutine applies a convection type to a set of surfaces.
+
+ if (state.dataSurface->SurfaceFilterLists[(int)surfaceFilter].size() == 0) {
+ return;
+ }
+
+ int numWarnings = 0;
+ for (int surfNum : state.dataSurface->SurfaceFilterLists[(int)surfaceFilter]) {
+ if (state.dataSurface->Surface(surfNum).OSCPtr > 0) continue;
+ auto &surfExtConv = state.dataSurface->surfExtConv(surfNum);
+ if (convUserCoeffNum == 0) {
+ surfExtConv.model = model;
+ } else if (surfExtConv.userModelNum == 0) {
+ surfExtConv.model = model;
+ surfExtConv.userModelNum = convUserCoeffNum;
+ } else if (state.dataGlobal->DisplayExtraWarnings) {
+ ShowWarningError(state,
+ format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already "
+ "assigned value for (Outside) in Surface={}",
+ SurfaceFilterNamesUC[(int)surfaceFilter],
+ state.dataSurface->Surface(surfNum).Name));
+ } else {
+ ++numWarnings;
+ }
+ } // for (surfNum)
+
+ if (!state.dataGlobal->DisplayExtraWarnings && numWarnings > 0) {
+ ShowWarningError(state,
+ format("User Supplied Convection Coefficients, Multiple Surface Assignments=\"{}\", not overwriting already assigned "
+ "values for {} Outside assignments.",
+ SurfaceFilterNamesUC[(int)surfaceFilter],
+ numWarnings));
}
}
-Real64 CalcASHRAESimpExtConvectCoeff(Material::SurfaceRoughness const Roughness, // Integer index for roughness, relates to parameter array indices
- Real64 const SurfWindSpeed // Current wind speed, m/s
+Real64 CalcASHRAESimpExtConvCoeff(Material::SurfaceRoughness const Roughness, // Integer index for roughness, relates to parameter array indices
+ Real64 const SurfWindSpeed // Current wind speed, m/s
)
{
// FUNCTION INFORMATION:
// AUTHOR Rick Strand
// DATE WRITTEN August 2000
- // MODIFIED na
- // RE-ENGINEERED na
// PURPOSE OF THIS FUNCTION:
// This subroutine calculates the exterior convection coefficient
@@ -3100,24 +1790,15 @@ Real64 CalcASHRAESimpExtConvectCoeff(Material::SurfaceRoughness const Roughness,
// on p. 22.4 of the 1989 ASHRAE Handbook of Fundamentals.
// This is a combined coefficient that includes radiation to sky, ground, and air.
- // METHODOLOGY EMPLOYED:
- // Apply the correlation based on the input data.
-
// REFERENCES:
// ASHRAE Handbook of Fundamentals 1989, p.22.4
- // Return value
- Real64 CalcASHRAESimpExtConvectCoeff;
-
// FUNCTION PARAMETER DEFINITIONS:
constexpr static std::array D = {11.58, 12.49, 10.79, 8.23, 10.22, 8.23};
constexpr static std::array E = {5.894, 4.065, 4.192, 4.00, 3.100, 3.33};
constexpr static std::array F = {0.0, 0.028, 0.0, -0.057, 0.0, -0.036};
- CalcASHRAESimpExtConvectCoeff =
- D[static_cast(Roughness)] + E[static_cast(Roughness)] * SurfWindSpeed + F[static_cast(Roughness)] * pow_2(SurfWindSpeed);
-
- return CalcASHRAESimpExtConvectCoeff;
+ return D[(int)Roughness] + E[(int)Roughness] * SurfWindSpeed + F[(int)Roughness] * pow_2(SurfWindSpeed);
}
Real64 CalcASHRAESimpleIntConvCoeff(Real64 const Tsurf, Real64 const Tamb, Real64 const cosTilt)
@@ -3125,8 +1806,6 @@ Real64 CalcASHRAESimpleIntConvCoeff(Real64 const Tsurf, Real64 const Tamb, Real6
// SUBROUTINE INFORMATION:
// AUTHOR Rick Strand
// DATE WRITTEN August 2000
- // MODIFIED na
- // RE-ENGINEERED na
// PURPOSE OF THIS FUNCTION:
// This subroutine calculates the interior convection coefficient for a surface.
@@ -3206,8 +1885,6 @@ Real64 CalcASHRAETARPNatural(Real64 const Tsurf, Real64 const Tamb, Real64 const
// SUBROUTINE INFORMATION:
// AUTHOR Rick Strand
// DATE WRITTEN August 2000
- // MODIFIED na
- // RE-ENGINEERED na
// PURPOSE OF THIS FUNCTION:
// This subroutine calculates the convection coefficient for a surface.
@@ -3305,15 +1982,15 @@ void CalcDetailedHcInForDVModel(EnergyPlusData &state,
}
}
- assert(state.dataRoomAirMod->AirModel.allocated());
- if (state.dataRoomAirMod->AirModel(surface.Zone).AirModelType == DataRoomAirModel::RoomAirModel::UCSDDV ||
- state.dataRoomAirMod->AirModel(surface.Zone).AirModelType == DataRoomAirModel::RoomAirModel::UCSDUFI ||
- state.dataRoomAirMod->AirModel(surface.Zone).AirModelType == DataRoomAirModel::RoomAirModel::UCSDUFE) {
+ assert(state.dataRoomAir->AirModel.allocated());
+ if (state.dataRoomAir->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::DispVent3Node ||
+ state.dataRoomAir->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::UFADInt ||
+ state.dataRoomAir->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::UFADExt) {
// Set HConvIn using the proper correlation based on DeltaTemp and CosTiltSurf
- if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) {
+ if (state.dataSurface->surfIntConv(SurfNum).userModelNum != 0) {
- HcIn(SurfNum) = SetIntConvectionCoeff(state, SurfNum);
+ HcIn(SurfNum) = SetIntConvCoeff(state, SurfNum);
} else {
HcIn(SurfNum) = CalcASHRAETARPNatural(SurfaceTemperatures(SurfNum),
@@ -3321,14 +1998,14 @@ void CalcDetailedHcInForDVModel(EnergyPlusData &state,
-surface.CosTilt); // negative CosTilt because CosTilt is relative to exterior
}
- } else if (state.dataRoomAirMod->AirModel(surface.Zone).AirModelType == DataRoomAirModel::RoomAirModel::UCSDCV) {
+ } else if (state.dataRoomAir->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::CrossVent) {
Hf = 4.3 * Vhc()(surface.Zone);
// Set HConvIn using the proper correlation based on DeltaTemp and CosTiltSurf
- if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) {
+ if (state.dataSurface->surfIntConv(SurfNum).userModelNum != 0) {
- HcIn(SurfNum) = SetIntConvectionCoeff(state, SurfNum);
+ HcIn(SurfNum) = SetIntConvCoeff(state, SurfNum);
} else {
HcIn(SurfNum) = CalcASHRAETARPNatural(SurfaceTemperatures(SurfNum),
@@ -3362,32 +2039,35 @@ Real64 CalcZoneSupplyAirTemp(EnergyPlusData &state, int const ZoneNum)
{
int ZoneNode = state.dataHeatBal->Zone(ZoneNum).SystemZoneNodeNumber;
- if (ZoneNode > 0) {
- int thisZoneInletNode = 0;
- Real64 SumMdotTemp = 0.0;
- Real64 SumMdot = 0.0;
- for (int EquipNum = 1;
- EquipNum <= state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex).NumOfEquipTypes;
- ++EquipNum) {
- if (state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex).EquipData(EquipNum).NumOutlets > 0) {
- thisZoneInletNode = state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .EquipData(EquipNum)
- .OutletNodeNums(1);
- if ((thisZoneInletNode > 0) && (state.dataLoopNodes->Node(thisZoneInletNode).MassFlowRate > 0.0)) {
- SumMdotTemp += state.dataLoopNodes->Node(thisZoneInletNode).MassFlowRate * state.dataLoopNodes->Node(thisZoneInletNode).Temp;
- SumMdot += state.dataLoopNodes->Node(thisZoneInletNode).MassFlowRate;
- }
- }
- }
- if (SumMdot > 0.0) {
- return SumMdotTemp / SumMdot; // mass flow weighted inlet temperature
- } else {
- if (thisZoneInletNode > 0) {
- return state.dataLoopNodes->Node(thisZoneInletNode).Temp;
- } else {
- return state.dataLoopNodes->Node(ZoneNode).Temp;
- }
+ if (ZoneNode <= 0) return state.dataLoopNodes->Node(ZoneNode).Temp;
+
+ auto &zoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(ZoneNum);
+ auto &zoneEquipList = state.dataZoneEquip->ZoneEquipList(zoneEquipConfig.EquipListIndex);
+
+ int zoneInletNodeNum = 0;
+
+ Real64 SumMdotTemp = 0.0;
+ Real64 SumMdot = 0.0;
+
+ for (int EquipNum = 1; EquipNum <= zoneEquipList.NumOfEquipTypes; ++EquipNum) {
+
+ auto &equipData = zoneEquipList.EquipData(EquipNum);
+ if (equipData.NumOutlets == 0) continue;
+
+ zoneInletNodeNum = equipData.OutletNodeNums(1);
+ if (zoneInletNodeNum == 0) continue;
+
+ auto &zoneInletNode = state.dataLoopNodes->Node(zoneInletNodeNum);
+ if (zoneInletNode.MassFlowRate > 0.0) {
+ SumMdotTemp += zoneInletNode.MassFlowRate * zoneInletNode.Temp;
+ SumMdot += zoneInletNode.MassFlowRate;
}
+ }
+
+ if (SumMdot > 0.0) return SumMdotTemp / SumMdot; // mass flow weighted inlet temperature
+
+ if (zoneInletNodeNum > 0) {
+ return state.dataLoopNodes->Node(zoneInletNodeNum).Temp;
} else {
return state.dataLoopNodes->Node(ZoneNode).Temp;
}
@@ -3397,18 +2077,13 @@ Real64 CalcZoneSystemVolFlowRate(EnergyPlusData &state, int const ZoneNum)
{
auto const &zone = state.dataHeatBal->Zone(ZoneNum);
- int ZoneNode = zone.SystemZoneNodeNumber;
- if (!state.dataGlobal->BeginEnvrnFlag && ZoneNode > 0) {
- int ZoneMult = zone.Multiplier * zone.ListMultiplier;
- Real64 AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(
- state,
- state.dataEnvrn->OutBaroPress,
- state.dataLoopNodes->Node(ZoneNode).Temp,
- Psychrometrics::PsyWFnTdpPb(state, state.dataLoopNodes->Node(ZoneNode).Temp, state.dataEnvrn->OutBaroPress));
- return state.dataLoopNodes->Node(ZoneNode).MassFlowRate / (AirDensity * ZoneMult);
- } else {
- return 0.0;
- }
+ if (state.dataGlobal->BeginEnvrnFlag || zone.SystemZoneNodeNumber <= 0) return 0.0;
+
+ auto const &zoneNode = state.dataLoopNodes->Node(zone.SystemZoneNodeNumber);
+ int ZoneMult = zone.Multiplier * zone.ListMultiplier;
+ Real64 AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(
+ state, state.dataEnvrn->OutBaroPress, zoneNode.Temp, Psychrometrics::PsyWFnTdpPb(state, zoneNode.Temp, state.dataEnvrn->OutBaroPress));
+ return zoneNode.MassFlowRate / (AirDensity * ZoneMult);
}
Real64 CalcCeilingDiffuserACH(EnergyPlusData &state, int const ZoneNum)
@@ -3452,16 +2127,11 @@ Real64 CalcCeilingDiffuserIntConvCoeff(EnergyPlusData &state,
// SUBROUTINE INFORMATION:
// AUTHOR Rick Strand
// DATE WRITTEN August 2000
- // MODIFIED na
- // RE-ENGINEERED na
// PURPOSE OF THIS FUNCTION:
// This subroutine calculates the interior convection coefficients
// for ceiling diffusers correlated to the outlet air temperature.
- // METHODOLOGY EMPLOYED:
- // call functions with the actual model equations
-
// REFERENCES:
// Fisher, D.E. and C.O. Pedersen, Convective Heat Transfer in Building Energy and
// Thermal Load Calculations, ASHRAE Transactions, vol. 103, Pt. 2, 1997, p.137
@@ -3555,33 +2225,24 @@ void CalcCeilingDiffuserInletCorr(EnergyPlusData &state,
Real64 constexpr MinFlow(0.01); // Minimum mass flow rate
Real64 constexpr MaxACH(100.0); // Maximum ceiling diffuser correlation limit
Real64 ACH; // Air changes per hour
- Real64 ZoneVolume; // Zone node as defined in system simulation
- Real64 ZoneMassFlowRate; // Zone node as defined in system simulation
- Real64 AirDensity; // zone air density
- int SurfNum; // DO loop counter for surfaces
- Real64 Tilt; // Surface tilt
- Real64 ZoneMult;
- auto const &Zone(state.dataHeatBal->Zone);
+ auto const &zone = state.dataHeatBal->Zone(ZoneNum);
if (state.dataGlobal->SysSizingCalc || state.dataGlobal->ZoneSizingCalc || !allocated(state.dataLoopNodes->Node)) {
ACH = 0.0;
} else {
// Set local variables
- ZoneVolume = Zone(ZoneNum).Volume;
- int ZoneNode = Zone(ZoneNum).SystemZoneNodeNumber;
- ZoneMult = Zone(ZoneNum).Multiplier * Zone(ZoneNum).ListMultiplier;
- AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(
- state,
- state.dataEnvrn->OutBaroPress,
- state.dataLoopNodes->Node(ZoneNode).Temp,
- Psychrometrics::PsyWFnTdpPb(state, state.dataLoopNodes->Node(ZoneNode).Temp, state.dataEnvrn->OutBaroPress));
- ZoneMassFlowRate = state.dataLoopNodes->Node(ZoneNode).MassFlowRate / ZoneMult;
+ Real64 ZoneVolume = zone.Volume;
+ Real64 ZoneMult = zone.Multiplier * zone.ListMultiplier;
+ auto const &zoneNode = state.dataLoopNodes->Node(zone.SystemZoneNodeNumber);
+ Real64 AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(
+ state, state.dataEnvrn->OutBaroPress, zoneNode.Temp, Psychrometrics::PsyWFnTdpPb(state, zoneNode.Temp, state.dataEnvrn->OutBaroPress));
+ Real64 ZoneMassFlowRate = zoneNode.MassFlowRate / ZoneMult;
if (ZoneMassFlowRate < MinFlow) {
ACH = 0.0;
} else {
- // Calculate ACH
+ // Calculate ACH (AR: can we please stop with these unparenthesized multiple divides? / / )
ACH = ZoneMassFlowRate / AirDensity / ZoneVolume * Constant::SecInHour;
// Limit ACH to range of correlation
ACH = min(ACH, MaxACH);
@@ -3591,7 +2252,7 @@ void CalcCeilingDiffuserInletCorr(EnergyPlusData &state,
for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
auto const &thisSpace = state.dataHeatBal->space(spaceNum);
- for (SurfNum = thisSpace.HTSurfaceFirst; SurfNum <= thisSpace.HTSurfaceLast; ++SurfNum) {
+ for (int SurfNum = thisSpace.HTSurfaceFirst; SurfNum <= thisSpace.HTSurfaceLast; ++SurfNum) {
if (ACH <= 3.0) { // Use the other convection algorithm
if (!state.dataConstruction->Construct(state.dataSurface->Surface(SurfNum).Construction).TypeIsWindow) {
CalcASHRAEDetailedIntConvCoeff(
@@ -3601,7 +2262,7 @@ void CalcCeilingDiffuserInletCorr(EnergyPlusData &state,
state, SurfNum, SurfaceTemperatures(SurfNum), state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT);
}
} else { // Use forced convection correlations
- Tilt = state.dataSurface->Surface(SurfNum).Tilt;
+ Real64 Tilt = state.dataSurface->Surface(SurfNum).Tilt;
// 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
@@ -3645,24 +2306,10 @@ void CalcTrombeWallIntConvCoeff(EnergyPlusData &state,
constexpr Real64 k(0.0263); // thermal conductivity (W/m K) for air at 300 K
constexpr Real64 Pr(0.71); // Prandtl number for air at ?
- auto const &Zone(state.dataHeatBal->Zone);
-
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
int Surf1 = 0; // first major wall surface
int Surf2 = 0; // second major wall surface
- Real64 H; // height of enclosure
- Real64 minorW; // width of enclosure (narrow dimension)
- Real64 majorW; // width of major surface
- Real64 gapW; // width of air gap
- Real64 asp; // aspect ratio H/gapW
- Real64 beta; // volumetric thermal expansion coefficient
- Real64 Gr; // Grashof number
- Real64 Nu; // Nusselt number
- Real64 HConvNet; // net heat transfer coefficient from wall to wall
- Real64 Tso; // outside surface temperature [K]
- Real64 Tsi; // inside surface temperature [K]
-
// If the Trombe Wall option is selected the following correlations
// will be used based on references by .....
// tall enclosed rectangular cavity
@@ -3672,14 +2319,12 @@ void CalcTrombeWallIntConvCoeff(EnergyPlusData &state,
// are assumed to have exactly equal widths AND must have a greater
// width than the side surfaces.
- H = Zone(ZoneNum).CeilingHeight;
- minorW = 100000.0; // An impossibly big width
- majorW = 0.0;
- gapW = 0.0;
+ auto &zone = state.dataHeatBal->Zone(ZoneNum);
+ Real64 H = zone.CeilingHeight; // height of enclosure
+ Real64 minorW = 100000.0; // width of enclosure (narrow dimension) // An impossibly big width
+ Real64 majorW = 0.0; // width of major surface
- Tso = 0.0;
- Tsi = 0.0;
- HConvNet = 0.0;
+ Real64 HConvNet = 0.0; // net heat transfer coefficient from wall to wall
// determine major width and minor width
for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
@@ -3691,7 +2336,6 @@ void CalcTrombeWallIntConvCoeff(EnergyPlusData &state,
if (surface.Width > majorW) {
majorW = surface.Width;
}
-
if (surface.Width < minorW) {
minorW = surface.Width;
}
@@ -3716,11 +2360,12 @@ void CalcTrombeWallIntConvCoeff(EnergyPlusData &state,
// check to make sure major surfaces were found
if (Surf1 > 0 && Surf2 > 0) {
- gapW = minorW;
- asp = H / gapW; // This calc should only be done once for the zone
+ Real64 gapW = minorW;
+ Real64 asp = H / gapW; // aspect ratio H/gapW // This calc should only be done once for the zone
// make sure inside surface is hot, outside is cold
// NOTE: this is not ideal. could have circumstances that reverse this?
+ Real64 Tso, Tsi;
if (SurfaceTemperatures(Surf1) > SurfaceTemperatures(Surf2)) {
Tsi = SurfaceTemperatures(Surf1) + Constant::KelvinConv;
Tso = SurfaceTemperatures(Surf2) + Constant::KelvinConv;
@@ -3729,11 +2374,9 @@ void CalcTrombeWallIntConvCoeff(EnergyPlusData &state,
Tsi = SurfaceTemperatures(Surf2) + Constant::KelvinConv;
}
- beta = 2.0 / (Tso + Tsi);
-
- Gr = (g * beta * std::abs(Tsi - Tso) * pow_3(gapW)) / pow_2(v); // curve fit for v = v(T)?
-
- CalcNusselt(state, Surf2, asp, Tso, Tsi, Gr, Pr, Nu); // curve fit for Pr = Pr(T)?
+ Real64 beta = 2.0 / (Tso + Tsi); // volumetric thermal expansion coefficient
+ Real64 Gr = (g * beta * std::abs(Tsi - Tso) * pow_3(gapW)) / pow_2(v); // Grashof // curve fit for v = v(T)?
+ Real64 Nu = CalcNusselt(state, Surf2, asp, Tso, Tsi, Gr, Pr); // Nusselt // curve fit for Pr = Pr(T)?
HConvNet = (k / gapW) * Nu; // curve fit for k = k(T)?
@@ -3761,27 +2404,23 @@ void CalcTrombeWallIntConvCoeff(EnergyPlusData &state,
// Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems)
if (state.dataHeatBalSurf->SurfHConvInt(SurfNum) < state.dataHeatBal->LowHConvLimit)
state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataHeatBal->LowHConvLimit;
- }
- }
+ } // for (surfNum)
+ } // for (spaceNum)
}
-void CalcNusselt(EnergyPlusData &state,
- int const SurfNum, // Surface number
- Real64 const asp, // Aspect ratio: window height to gap width
- Real64 const tso, // Temperature of gap surface closest to outside (K)
- Real64 const tsi, // Temperature of gap surface closest to zone (K)
- Real64 const gr, // Gap gas Grashof number
- Real64 const pr, // Gap gas Prandtl number
- Real64 &gnu // Gap gas Nusselt number
-)
+Real64 CalcNusselt(EnergyPlusData &state,
+ int const SurfNum, // Surface number
+ Real64 const asp, // Aspect ratio: window height to gap width
+ Real64 const tso, // Temperature of gap surface closest to outside (K)
+ Real64 const tsi, // Temperature of gap surface closest to zone (K)
+ Real64 const gr, // Gap gas Grashof number
+ Real64 const pr) // Gap gas Prandtl number
{
// SUBROUTINE INFORMATION:
// AUTHOR Peter Graham Ellis, based on code adapted by Fred Winkelmann
// from Window5 subroutine NusseltNumber
// DATE WRITTEN September 2001
- // MODIFIED na
- // RE-ENGINEERED na
// PURPOSE OF THIS SUBROUTINE:
// Finds the Nusselt number for gas-filled gaps between isothermal solid layers.
@@ -3795,78 +2434,59 @@ void CalcNusselt(EnergyPlusData &state,
// REFERENCES:
// Window5 source code; ISO 15099
- // SUBROUTINE LOCAL VARIABLE DECLARATIONS
- Real64 ra; // Rayleigh number
- Real64 gnu901; // Nusselt number temporary variables for
- Real64 gnu902;
- Real64 gnu90;
- Real64 gnu601;
- Real64 gnu602; // different tilt and Ra ranges
- Real64 gnu60;
- Real64 gnu601a;
- Real64 gnua;
- Real64 gnub;
- Real64 cra; // Temporary variables
- Real64 a;
- Real64 b;
- Real64 g;
- Real64 ang;
- Real64 tilt;
- Real64 tiltr;
- Real64 costilt;
- Real64 sintilt;
-
auto const &surface = state.dataSurface->Surface(SurfNum);
- tilt = surface.Tilt;
- tiltr = tilt * Constant::DegToRadians;
- costilt = surface.CosTilt;
- sintilt = surface.SinTilt;
- ra = gr * pr;
+ Real64 tilt = surface.Tilt;
+ Real64 tiltr = tilt * Constant::DegToRadians;
+ Real64 costilt = surface.CosTilt;
+ Real64 sintilt = surface.SinTilt;
+ Real64 ra = gr * pr; // Rayleigh number
//! fw if (ra > 2.0e6): error that outside range of Rayleigh number?
- if (ra <= 1.0e4) gnu901 = 1.0 + 1.7596678e-10 * std::pow(ra, 2.2984755); // eq. 51
- if (ra > 1.0e4 && ra <= 5.0e4) gnu901 = 0.028154 * std::pow(ra, 0.4134); // eq. 50
- if (ra > 5.0e4) gnu901 = 0.0673838 * std::pow(ra, 1.0 / 3.0); // eq. 49
-
- gnu902 = 0.242 * std::pow(ra / asp, 0.272); // eq. 52
- gnu90 = max(gnu901, gnu902);
-
- if (tso > tsi) { // window heated from above
- gnu = 1.0 + (gnu90 - 1.0) * sintilt; // eq. 53
- } else { // window heated from below
- if (tilt >= 60.0) {
- g = 0.5 * std::pow(1.0 + std::pow(ra / 3160.0, 20.6), -0.1); // eq. 47
- gnu601a = 1.0 + pow_7(0.0936 * std::pow(ra, 0.314) / (1.0 + g)); // eq. 45
- gnu601 = std::pow(gnu601a, 0.142857);
-
- // For any aspect ratio
- gnu602 = (0.104 + 0.175 / asp) * std::pow(ra, 0.283); // eq. 46
- gnu60 = max(gnu601, gnu602);
-
- // linear interpolation for layers inclined at angles between 60 and 90 deg
- gnu = ((90.0 - tilt) * gnu60 + (tilt - 60.0) * gnu90) / 30.0;
- }
- if (tilt < 60.0) { // eq. 42
- cra = ra * costilt;
- a = 1.0 - 1708.0 / cra;
- b = std::pow(cra / 5830.0, 0.33333) - 1.0; // LKL- replace .333 with OneThird?
- gnua = (std::abs(a) + a) / 2.0;
- gnub = (std::abs(b) + b) / 2.0;
- ang = 1708.0 * std::pow(std::sin(1.8 * tiltr), 1.6);
- gnu = 1.0 + 1.44 * gnua * (1.0 - ang / cra) + gnub;
- }
+ Real64 gnu901; // Nusselt number temporary variables for
+ if (ra <= 1.0e4)
+ gnu901 = 1.0 + 1.7596678e-10 * std::pow(ra, 2.2984755); // eq. 51
+ else if (ra > 1.0e4 && ra <= 5.0e4)
+ gnu901 = 0.028154 * std::pow(ra, 0.4134); // eq. 50
+ else
+ gnu901 = 0.0673838 * std::pow(ra, 1.0 / 3.0); // eq. 49
+
+ Real64 gnu902 = 0.242 * std::pow(ra / asp, 0.272); // eq. 52
+ Real64 gnu90 = max(gnu901, gnu902);
+
+ if (tso > tsi) { // window heated from above
+ return 1.0 + (gnu90 - 1.0) * sintilt; // eq. 53
+ }
+
+ // window heated from below
+ if (tilt >= 60.0) {
+ Real64 g = 0.5 * std::pow(1.0 + std::pow(ra / 3160.0, 20.6), -0.1); // eq. 47
+ Real64 gnu601a = 1.0 + pow_7(0.0936 * std::pow(ra, 0.314) / (1.0 + g)); // eq. 45
+ Real64 gnu601 = std::pow(gnu601a, 0.142857);
+ // For any aspect ratio
+ Real64 gnu602 = (0.104 + 0.175 / asp) * std::pow(ra, 0.283); // eq. 46
+ Real64 gnu60 = max(gnu601, gnu602);
+
+ // linear interpolation for layers inclined at angles between 60 and 90 deg
+ return ((90.0 - tilt) * gnu60 + (tilt - 60.0) * gnu90) / 30.0;
+
+ } else { // eq. 42
+ Real64 cra = ra * costilt;
+ Real64 a = 1.0 - 1708.0 / cra;
+ Real64 b = std::pow(cra / 5830.0, 0.33333) - 1.0; // LKL- replace .333 with OneThird?
+ Real64 gnua = (std::abs(a) + a) / 2.0;
+ Real64 gnub = (std::abs(b) + b) / 2.0;
+ Real64 ang = 1708.0 * std::pow(std::sin(1.8 * tiltr), 1.6);
+ return 1.0 + 1.44 * gnua * (1.0 - ang / cra) + gnub;
}
}
-Real64 SetExtConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surface Number
+Real64 SetExtConvCoeff(EnergyPlusData &state, int const SurfNum) // Surface Number
{
// FUNCTION INFORMATION:
// AUTHOR Linda K. Lawrie
// DATE WRITTEN May 1998
- // MODIFIED na
- // RE-ENGINEERED na
// PURPOSE OF THIS FUNCTION:
// This function accesses the data structure for the User
@@ -3874,71 +2494,65 @@ Real64 SetExtConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac
// as the result of this function. The surface has already
// been verified to have user supplied exterior convection values.
- // Return value
- Real64 SetExtConvectionCoeff;
-
// FUNCTION LOCAL VARIABLE DECLARATIONS:
- Real64 HExt(0.0); // Will become the returned value
+ Real64 HExt = 0.0; // Will become the returned value
auto const &surface = state.dataSurface->Surface(SurfNum);
+ auto &surfExtConv = state.dataSurface->surfExtConv(SurfNum);
+ auto const &userExtConvModel = state.dataSurface->userExtConvModels(surfExtConv.userModelNum);
- switch (state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeffIndex(SurfNum)).OverrideType) {
- case ConvectionConstants::ConvCoefOverrideType::Value:
- HExt = state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeffIndex(SurfNum)).OverrideValue;
+ switch (userExtConvModel.overrideType) {
+ case OverrideType::Value: {
+ HExt = userExtConvModel.OverrideValue;
if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = KIVA_HF_ZERO;
state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].out = KIVA_CONST_CONV(HExt);
}
- state.dataSurface->SurfOutConvHfModelEq(SurfNum) = ConvectionConstants::HcExt_UserValue; // reporting
- state.dataSurface->SurfOutConvHnModelEq(SurfNum) = ConvectionConstants::HcExt_None; // reporting
- break;
- case ConvectionConstants::ConvCoefOverrideType::Schedule:
- HExt = ScheduleManager::GetCurrentScheduleValue(
- state, state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeffIndex(SurfNum)).ScheduleIndex);
+ surfExtConv.hfModelEq = HcExt::UserValue; // reporting
+ surfExtConv.hnModelEq = HcExt::None; // reporting
+ } break;
+
+ case OverrideType::Schedule: {
+ HExt = ScheduleManager::GetCurrentScheduleValue(state, userExtConvModel.ScheduleIndex);
// Need to check for validity
if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = KIVA_HF_ZERO;
state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].out = KIVA_CONST_CONV(HExt);
}
- state.dataSurface->SurfOutConvHfModelEq(SurfNum) = ConvectionConstants::HcExt_UserSchedule; // reporting
- state.dataSurface->SurfOutConvHnModelEq(SurfNum) = ConvectionConstants::HcExt_None; // reporting
- break;
- case ConvectionConstants::ConvCoefOverrideType::UserCurve:
- CalcUserDefinedOutsideHcModel(
- state, SurfNum, state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeffIndex(SurfNum)).UserCurveIndex, HExt);
+ surfExtConv.hfModelEq = HcExt::UserSchedule; // reporting
+ surfExtConv.hnModelEq = HcExt::None; // reporting
+ } break;
+
+ case OverrideType::UserCurve: {
+ HExt = CalcUserDefinedExtHcModel(state, SurfNum, userExtConvModel.UserCurveIndex);
// Kiva convection handled in function above
- state.dataSurface->SurfOutConvHfModelEq(SurfNum) = ConvectionConstants::HcExt_UserCurve; // reporting
- state.dataSurface->SurfOutConvHnModelEq(SurfNum) = ConvectionConstants::HcExt_None; // reporting
- break;
- case ConvectionConstants::ConvCoefOverrideType::SpecifiedModel:
- EvaluateExtHcModels(state,
- SurfNum,
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeffIndex(SurfNum)).HcModelEq,
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeffIndex(SurfNum)).HcModelEq,
- HExt);
+ surfExtConv.hfModelEq = HcExt::UserCurve; // reporting
+ surfExtConv.hnModelEq = HcExt::None; // reporting
+ } break;
+
+ case OverrideType::SpecifiedModel: {
+ HExt = EvaluateExtHcModels(state, SurfNum, userExtConvModel.HcExtModelEq, userExtConvModel.HcExtModelEq);
// Kiva convection handled in function above
- state.dataSurface->SurfOutConvHfModelEq(SurfNum) =
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeffIndex(SurfNum)).HcModelEq; // reporting
- state.dataSurface->SurfOutConvHnModelEq(SurfNum) =
- state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeffIndex(SurfNum)).HcModelEq; // reporting
- break;
+ surfExtConv.hfModelEq = userExtConvModel.HcExtModelEq; // reporting
+ surfExtConv.hnModelEq = userExtConvModel.HcExtModelEq; // reporting
+ } break;
+
default:
assert(false);
}
- SetExtConvectionCoeff = HExt;
+ surfExtConv.hfModelEqRpt = HcExtReportVals[(int)surfExtConv.hfModelEq];
+ surfExtConv.hnModelEqRpt = HcExtReportVals[(int)surfExtConv.hnModelEq];
- return SetExtConvectionCoeff;
+ return HExt;
}
-Real64 SetIntConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surface Number
+Real64 SetIntConvCoeff(EnergyPlusData &state, int const SurfNum) // Surface Number
{
// FUNCTION INFORMATION:
// AUTHOR Linda K. Lawrie
// DATE WRITTEN May 1998
- // MODIFIED na
- // RE-ENGINEERED na
// PURPOSE OF THIS FUNCTION:
// This function accesses the data structure for the User
@@ -3946,50 +2560,50 @@ Real64 SetIntConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac
// as the result of this function. The surface has already
// been verified to have user supplied interior convection values.
- // Return value
- Real64 SetIntConvectionCoeff;
-
- Real64 HInt(0.0); // Will become the returned value
+ Real64 HInt = 0.0; // Will become the returned value
auto const &surface = state.dataSurface->Surface(SurfNum);
+ auto &surfIntConv = state.dataSurface->surfIntConv(SurfNum);
+ auto const &userIntConvModel = state.dataSurface->userIntConvModels(surfIntConv.userModelNum);
- switch (state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeffIndex(SurfNum)).OverrideType) {
- case ConvectionConstants::ConvCoefOverrideType::Value:
- HInt = state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeffIndex(SurfNum)).OverrideValue;
+ switch (userIntConvModel.overrideType) {
+ case OverrideType::Value: {
+ HInt = userIntConvModel.OverrideValue;
if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].in = KIVA_CONST_CONV(HInt);
}
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) = ConvectionConstants::HcInt_UserValue; // reporting
- break;
- case ConvectionConstants::ConvCoefOverrideType::Schedule:
- HInt = ScheduleManager::GetCurrentScheduleValue(
- state, state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeffIndex(SurfNum)).ScheduleIndex);
+ surfIntConv.hcModelEq = HcInt::UserValue; // reporting
+ surfIntConv.hcModelEqRpt = HcIntReportVals[(int)surfIntConv.hcModelEq];
+ } break;
+
+ case OverrideType::Schedule: {
+ HInt = ScheduleManager::GetCurrentScheduleValue(state, userIntConvModel.ScheduleIndex);
// Need to check for validity
if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].in = KIVA_CONST_CONV(HInt);
}
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) = ConvectionConstants::HcInt_UserSchedule; // reporting
- break;
- case ConvectionConstants::ConvCoefOverrideType::UserCurve:
- CalcUserDefinedInsideHcModel(
- state, SurfNum, state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeffIndex(SurfNum)).UserCurveIndex, HInt);
+ surfIntConv.hcModelEq = HcInt::UserSchedule; // reporting
+ surfIntConv.hcModelEqRpt = HcIntReportVals[(int)surfIntConv.hcModelEq];
+ } break;
+
+ case OverrideType::UserCurve: {
+ HInt = CalcUserDefinedIntHcModel(state, SurfNum, userIntConvModel.UserCurveIndex);
// Kiva convection handled in function above
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) = ConvectionConstants::HcInt_UserCurve; // reporting
- break;
- case ConvectionConstants::ConvCoefOverrideType::SpecifiedModel:
- EvaluateIntHcModels(
- state, SurfNum, state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeffIndex(SurfNum)).HcModelEq, HInt);
+ surfIntConv.hcModelEq = HcInt::UserCurve; // reporting
+ surfIntConv.hcModelEqRpt = HcIntReportVals[(int)surfIntConv.hcModelEq];
+ } break;
+ case OverrideType::SpecifiedModel: {
+ HInt = EvaluateIntHcModels(state, SurfNum, userIntConvModel.HcIntModelEq);
// Kiva convection handled in function above
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeffIndex(SurfNum)).HcModelEq;
- break;
- default:
+ surfIntConv.hcModelEq = userIntConvModel.HcIntModelEq;
+ surfIntConv.hcModelEqRpt = HcIntReportVals[(int)surfIntConv.hcModelEq];
+ } break;
+ default: {
assert(false);
}
+ }
- SetIntConvectionCoeff = HInt;
-
- return SetIntConvectionCoeff;
+ return HInt;
}
Real64 CalcISO15099WindowIntConvCoeff(EnergyPlusData &state,
@@ -4025,23 +2639,12 @@ Real64 CalcISO15099WindowIntConvCoeff(EnergyPlusData &state,
static constexpr std::string_view RoutineName("WindowTempsForNominalCond");
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
- Real64 DeltaTemp; // Temperature difference between the zone air and the surface
- Real64 TmeanFilm; // mean film temperature
- Real64 TmeanFilmKelvin; // mean film temperature for property evaluation
- Real64 rho; // density of air [kg/m3]
- Real64 g; // acceleration due to gravity [m/s2]
- Real64 Cp; // specific heat of air [J/kg-K]
- Real64 lambda; // thermal conductivity of air [W/m-K]
- Real64 mu; // dynamic viscosity of air [kg/m-s]
- Real64 RaH; // Rayleigh number for cavity height [ Non dim]
- Real64 RaCV; // Rayleigh number for slanted cavity
- Real64 Nuint(0.0); // Nusselt number for interior surface convection
- Real64 SurfTempKelvin; // surface temperature in Kelvin
- Real64 AirTempKelvin; // air temperature in Kelvin
-
- SurfTempKelvin = SurfaceTemperature + 273.15;
- AirTempKelvin = AirTemperature + 273.15;
- DeltaTemp = SurfaceTemperature - AirTemperature;
+ Real64 constexpr g(9.81); // acceleration due to gravity [m/s2]
+ Real64 Nuint(0.0); // Nusselt number for interior surface convection
+
+ Real64 SurfTempKelvin = SurfaceTemperature + Constant::KelvinConv;
+ Real64 AirTempKelvin = AirTemperature + Constant::KelvinConv;
+ Real64 DeltaTemp = SurfaceTemperature - AirTemperature;
// protect against wildly out of range temperatures
if ((AirTempKelvin < 200.0) || (AirTempKelvin > 400.0)) { // out of range
@@ -4052,22 +2655,22 @@ Real64 CalcISO15099WindowIntConvCoeff(EnergyPlusData &state,
}
// mean film temperature
- TmeanFilmKelvin = AirTempKelvin + 0.25 * (SurfTempKelvin - AirTempKelvin); // eq. 133 in ISO 15099
- TmeanFilm = TmeanFilmKelvin - 273.15;
+ Real64 TmeanFilmKelvin = AirTempKelvin + 0.25 * (DeltaTemp); // eq. 133 in ISO 15099
+ Real64 TmeanFilm = TmeanFilmKelvin - 273.15;
- rho = Psychrometrics::PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, TmeanFilm, AirHumRat, RoutineName);
- g = 9.81;
+ // density of air [kg/m3]
+ Real64 rho = Psychrometrics::PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, TmeanFilm, AirHumRat, RoutineName);
// the following properties are probably for dry air, should maybe be remade for moist-air
- lambda = 2.873E-3 + 7.76E-5 * TmeanFilmKelvin; // Table B.1 in ISO 15099,
- mu = 3.723E-6 + 4.94E-8 * TmeanFilmKelvin; // Table B.2 in ISO 15099
-
- Cp = Psychrometrics::PsyCpAirFnW(AirHumRat);
+ Real64 lambda = 2.873E-3 + 7.76E-5 * TmeanFilmKelvin; // thermal conductivity of air [W/m-K] // Table B.1 in ISO 15099,
+ Real64 mu = 3.723E-6 + 4.94E-8 * TmeanFilmKelvin; // dynamic viscosity of air [kg/m-s] // Table B.2 in ISO 15099
+ Real64 Cp = Psychrometrics::PsyCpAirFnW(AirHumRat); // specific heat of air [J/kg-K]
// four cases depending on tilt and DeltaTemp (heat flow direction )
if (DeltaTemp > 0.0) TiltDeg = 180.0 - TiltDeg; // complement angle if cooling situation
- RaH = (pow_2(rho) * pow_3(Height) * g * Cp * (std::abs(SurfTempKelvin - AirTempKelvin))) / (TmeanFilmKelvin * mu * lambda); // eq 132 in ISO 15099
+ // Rayleigh number for cavity height [ Non dim]
+ Real64 RaH = (pow_2(rho) * pow_3(Height) * g * Cp * (std::abs(DeltaTemp))) / (TmeanFilmKelvin * mu * lambda); // eq 132 in ISO 15099
// case a)
if ((0.0 <= TiltDeg) && (TiltDeg < 15.0)) {
@@ -4077,7 +2680,8 @@ Real64 CalcISO15099WindowIntConvCoeff(EnergyPlusData &state,
// case b)
} else if ((15.0 <= TiltDeg) && (TiltDeg <= 90.0)) {
- RaCV = 2.5E+5 * std::pow(std::exp(0.72 * TiltDeg) / sineTilt, 0.2); // eq. 137
+ // Rayleigh number for slanted cavity
+ Real64 RaCV = 2.5E+5 * std::pow(std::exp(0.72 * TiltDeg) / sineTilt, 0.2); // eq. 137
if (RaH <= RaCV) {
Nuint = 0.56 * root_4(RaH * sineTilt); // eq. 135 in ISO 15099
@@ -4120,151 +2724,33 @@ void CalcISO15099WindowIntConvCoeff(EnergyPlusData &state,
{
auto const &surface = state.dataSurface->Surface(SurfNum);
- // Get humidity ratio
- Real64 AirHumRat;
- if (surface.Zone > 0) {
- AirHumRat = state.dataZoneTempPredictorCorrector->zoneHeatBalance(surface.Zone).ZoneAirHumRatAvg;
- } else {
- AirHumRat = state.dataEnvrn->OutHumRat;
- }
-
- Real64 Height = surface.Height;
- Real64 TiltDeg = surface.Tilt;
- Real64 sineTilt = surface.SinTilt;
-
- if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
- ShowFatalError(state, format("ISO15099 convection model not applicable for foundation surface ={}", surface.Name));
- }
-
- 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.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataSurface->SurfEMSValueForIntConvCoef(SurfNum);
- else
- state.dataHeatBalSurf->SurfHConvInt(SurfNum) *= state.dataHeatBalSurf->SurfWinCoeffAdjRatio(SurfNum);
-
- // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems)
- if (state.dataHeatBalSurf->SurfHConvInt(SurfNum) < state.dataHeatBal->LowHConvLimit)
- state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataHeatBal->LowHConvLimit;
-}
-
-RoofGeoCharacteristicsStruct getRoofGeometryInformation(EnergyPlusData &state)
-{
- RoofGeoCharacteristicsStruct RoofGeo;
-
- std::vector uniqueRoofVertices;
- std::vector uniqEdgeOfSurfs; // I'm only partially using this
- for (const auto &surface : state.dataSurface->Surface) {
-
- if (surface.ExtBoundCond != ExternalEnvironment) {
- continue;
- }
- if (!surface.HeatTransSurf) {
- continue;
- }
-
- if (surface.Tilt > 45.0) { // TODO Double check tilt wrt outside vs inside?
- continue;
- }
-
- Real64 const z_min(minval(surface.Vertex, &Vector::z));
- Real64 const z_max(maxval(surface.Vertex, &Vector::z));
- Real64 const verticalHeight = z_max - z_min;
- RoofGeo.Height += verticalHeight * surface.Area;
- RoofGeo.Tilt += surface.Tilt * surface.Area;
- RoofGeo.Azimuth += surface.Azimuth * surface.Area;
- RoofGeo.Area += surface.Area;
-
- for (auto it = surface.Vertex.begin(); it != surface.Vertex.end(); ++it) {
-
- auto itnext = std::next(it);
- if (itnext == std::end(surface.Vertex)) {
- itnext = std::begin(surface.Vertex);
- }
-
- auto &curVertex = *it;
- auto &nextVertex = *itnext;
- auto it2 = std::find_if(uniqueRoofVertices.begin(), uniqueRoofVertices.end(), [&curVertex](const auto &unqV) {
- return SurfaceGeometry::isAlmostEqual3dPt(curVertex, unqV);
- });
- if (it2 == std::end(uniqueRoofVertices)) {
- uniqueRoofVertices.emplace_back(curVertex);
- }
-
- SurfaceGeometry::EdgeOfSurf thisEdge;
- thisEdge.start = std::move(curVertex);
- thisEdge.end = std::move(nextVertex);
- thisEdge.count = 1;
-
- // Uses the custom operator== that uses isAlmostEqual3dPt internally and doesn't care about order of the start/end
- auto itEdge = std::find(uniqEdgeOfSurfs.begin(), uniqEdgeOfSurfs.end(), thisEdge);
- if (itEdge == uniqEdgeOfSurfs.end()) {
- uniqEdgeOfSurfs.emplace_back(std::move(thisEdge));
- } else {
- ++(itEdge->count);
- }
- }
- }
-
- if (RoofGeo.Area > 0) {
- RoofGeo.Height /= RoofGeo.Area;
- RoofGeo.Tilt /= RoofGeo.Area;
- RoofGeo.Azimuth /= RoofGeo.Area;
- } else {
- RoofGeo.Height = 0.0;
- RoofGeo.Tilt = 0.0;
- RoofGeo.Azimuth = 0.0;
- }
-
- // Remove the ones that are already used twice
- uniqEdgeOfSurfs.erase(std::remove_if(uniqEdgeOfSurfs.begin(), uniqEdgeOfSurfs.end(), [](const auto &edge) -> bool { return edge.count == 2; }),
- uniqEdgeOfSurfs.end());
-
- // Intersect with unique vertices as much as needed
- bool insertedVertext = true;
- while (insertedVertext) {
- insertedVertext = false;
-
- for (auto &edge : uniqEdgeOfSurfs) {
-
- // now go through all the vertices and see if they are colinear with start and end vertices
- for (const auto &testVertex : uniqueRoofVertices) {
- if (edge.containsPoints(testVertex)) {
- SurfaceGeometry::EdgeOfSurf newEdgeOfSurface;
- newEdgeOfSurface.start = testVertex;
- newEdgeOfSurface.end = edge.end;
- edge.end = testVertex;
- uniqEdgeOfSurfs.emplace_back(std::move(newEdgeOfSurface));
- insertedVertext = true;
- break;
- }
- }
- // Break out of the loop on edges, and start again at the while
- if (insertedVertext) {
- break;
- }
- }
- }
+ // Get humidity ratio
+ Real64 AirHumRat =
+ (surface.Zone > 0) ? state.dataZoneTempPredictorCorrector->zoneHeatBalance(surface.Zone).ZoneAirHumRatAvg : state.dataEnvrn->OutHumRat;
+
+ Real64 Height = surface.Height;
+ Real64 TiltDeg = surface.Tilt;
+ Real64 sineTilt = surface.SinTilt;
- // recount
- for (auto &edge : uniqEdgeOfSurfs) {
- edge.count = std::count(uniqEdgeOfSurfs.begin(), uniqEdgeOfSurfs.end(), edge);
+ if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
+ ShowFatalError(state, format("ISO15099 convection model not applicable for foundation surface ={}", surface.Name));
}
- uniqEdgeOfSurfs.erase(std::remove_if(uniqEdgeOfSurfs.begin(), uniqEdgeOfSurfs.end(), [](const auto &edge) -> bool { return edge.count == 2; }),
- uniqEdgeOfSurfs.end());
+ state.dataHeatBalSurf->SurfHConvInt(SurfNum) =
+ CalcISO15099WindowIntConvCoeff(state, SurfaceTemperature, AirTemperature, AirHumRat, Height, TiltDeg, sineTilt);
- RoofGeo.Perimeter =
- std::accumulate(uniqEdgeOfSurfs.cbegin(), uniqEdgeOfSurfs.cend(), 0.0, [](const double &sum, const SurfaceGeometry::EdgeOfSurf &edge) {
- return sum + edge.length();
- });
+ // EMS override point (Violates Standard 15099? throw warning? scary.
+ if (state.dataSurface->SurfEMSOverrideIntConvCoef(SurfNum))
+ state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataSurface->SurfEMSValueForIntConvCoef(SurfNum);
+ else
+ state.dataHeatBalSurf->SurfHConvInt(SurfNum) *= state.dataHeatBalSurf->SurfWinCoeffAdjRatio(SurfNum);
- return RoofGeo;
+ // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems)
+ if (state.dataHeatBalSurf->SurfHConvInt(SurfNum) < state.dataHeatBal->LowHConvLimit)
+ state.dataHeatBalSurf->SurfHConvInt(SurfNum) = state.dataHeatBal->LowHConvLimit;
}
-void SetupAdaptiveConvectionStaticMetaData(EnergyPlusData &state)
+void SetupAdaptiveConvStaticMetaData(EnergyPlusData &state)
{
// SUBROUTINE INFORMATION:
@@ -4275,47 +2761,38 @@ void SetupAdaptiveConvectionStaticMetaData(EnergyPlusData &state)
// do one-time setup needed to store static data for adaptive convection algorithm
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
- Real64 thisWWR;
Real64 thisZoneHorizHydralicDiameter;
bool DoReport;
- auto const &Zone(state.dataHeatBal->Zone);
- auto const &Surface(state.dataSurface->Surface);
-
Real64 BldgVolumeSum = 0.0;
for (int ZoneLoop = 1; ZoneLoop <= state.dataGlobal->NumOfZones; ++ZoneLoop) {
-
- BldgVolumeSum += Zone(ZoneLoop).Volume * Zone(ZoneLoop).Multiplier * Zone(ZoneLoop).ListMultiplier;
+ auto const &zone = state.dataHeatBal->Zone(ZoneLoop);
+ BldgVolumeSum += zone.Volume * zone.Multiplier * zone.ListMultiplier;
Real64 PerimExtLengthSum = 0.0; // init
int ExtWallCount = 0; // init
int ExtWindowCount = 0; // init
// model perimeter of bounding horizontal rectangle from max and min x and y values
- Real64 thisZoneSimplePerim =
- 2.0 * (Zone(ZoneLoop).MaximumY - Zone(ZoneLoop).MinimumY) + 2.0 * (Zone(ZoneLoop).MaximumX - Zone(ZoneLoop).MinimumX);
+ Real64 thisZoneSimplePerim = 2.0 * (zone.MaximumY - zone.MinimumY) + 2.0 * (zone.MaximumX - zone.MinimumX);
if (thisZoneSimplePerim > 0.0) {
- thisZoneHorizHydralicDiameter = 4.0 * Zone(ZoneLoop).FloorArea / thisZoneSimplePerim;
- } else {
- if (Zone(ZoneLoop).FloorArea > 0.0) {
- thisZoneHorizHydralicDiameter = std::sqrt(Zone(ZoneLoop).FloorArea);
- }
+ thisZoneHorizHydralicDiameter = 4.0 * zone.FloorArea / thisZoneSimplePerim;
+ } else if (zone.FloorArea > 0.0) {
+ thisZoneHorizHydralicDiameter = std::sqrt(zone.FloorArea);
}
- if (Zone(ZoneLoop).ExtGrossWallArea > 0.0) {
- thisWWR = Zone(ZoneLoop).ExtWindowArea / Zone(ZoneLoop).ExtGrossWallArea;
- } else {
- thisWWR = -999.0; // throw error?
- }
- for (int spaceNum : state.dataHeatBal->Zone(ZoneLoop).spaceIndexes) {
+ Real64 thisWWR = (zone.ExtGrossWallArea > 0.0) ? (zone.ExtWindowArea / zone.ExtGrossWallArea) : -999.0; // throw error?
+
+ for (int spaceNum : zone.spaceIndexes) {
auto const &thisSpace = state.dataHeatBal->space(spaceNum);
// first pass thru this zones surfaces to gather data
for (int SurfLoop = thisSpace.HTSurfaceFirst; SurfLoop <= thisSpace.HTSurfaceLast; ++SurfLoop) {
+ auto const &surf = state.dataSurface->Surface(SurfLoop);
// first catch exterior walls and do summations
- if ((Surface(SurfLoop).ExtBoundCond == ExternalEnvironment) && (Surface(SurfLoop).Class == SurfaceClass::Wall)) {
- PerimExtLengthSum += Surface(SurfLoop).Width;
+ if (surf.ExtBoundCond != ExternalEnvironment) continue;
+
+ if (surf.Class == SurfaceClass::Wall) {
+ PerimExtLengthSum += surf.Width;
++ExtWallCount;
- }
- if ((Surface(SurfLoop).ExtBoundCond == ExternalEnvironment) &&
- ((Surface(SurfLoop).Class == SurfaceClass::Window) || (Surface(SurfLoop).Class == SurfaceClass::GlassDoor))) {
+ } else if (surf.Class == SurfaceClass::Window || surf.Class == SurfaceClass::GlassDoor) {
++ExtWindowCount;
}
}
@@ -4324,11 +2801,11 @@ void SetupAdaptiveConvectionStaticMetaData(EnergyPlusData &state)
auto const &thisSpace = state.dataHeatBal->space(spaceNum);
// second pass thru zone surfs to fill data
for (int SurfLoop = thisSpace.HTSurfaceFirst; SurfLoop <= thisSpace.HTSurfaceLast; ++SurfLoop) {
- // now fill values
- state.dataSurface->SurfIntConvZoneWallHeight(SurfLoop) = Zone(ZoneLoop).CeilingHeight;
- state.dataSurface->SurfIntConvZonePerimLength(SurfLoop) = PerimExtLengthSum;
- state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfLoop) = thisZoneHorizHydralicDiameter;
- state.dataSurface->SurfIntConvWindowWallRatio(SurfLoop) = thisWWR;
+ auto &surfIntConv = state.dataSurface->surfIntConv(SurfLoop);
+ surfIntConv.zoneWallHeight = zone.CeilingHeight;
+ surfIntConv.zonePerimLength = PerimExtLengthSum;
+ surfIntConv.zoneHorizHydrDiam = thisZoneHorizHydralicDiameter;
+ surfIntConv.windowWallRatio = thisWWR;
} // 2nd pass over surfaces.
}
@@ -4336,240 +2813,132 @@ void SetupAdaptiveConvectionStaticMetaData(EnergyPlusData &state)
if ((ExtWindowCount > 0) && (ExtWallCount > 0)) {
for (int spaceNum : state.dataHeatBal->Zone(ZoneLoop).spaceIndexes) {
auto const &thisSpace = state.dataHeatBal->space(spaceNum);
+
for (int SurfLoop = thisSpace.HTSurfaceFirst; SurfLoop <= thisSpace.HTSurfaceLast; ++SurfLoop) {
- if ((Surface(SurfLoop).ExtBoundCond == ExternalEnvironment) &&
- ((Surface(SurfLoop).Class == SurfaceClass::Window) || (Surface(SurfLoop).Class == SurfaceClass::GlassDoor))) {
- if (state.dataSurface->SurfIntConvWindowWallRatio(SurfLoop) < 0.5) {
- if (Surface(SurfLoop).Centroid.z < Zone(ZoneLoop).Centroid.z) {
- state.dataSurface->SurfIntConvWindowLocation(SurfLoop) = ConvectionConstants::InConvWinLoc::LowerPartOfExteriorWall;
- } else {
- state.dataSurface->SurfIntConvWindowLocation(SurfLoop) = ConvectionConstants::InConvWinLoc::UpperPartOfExteriorWall;
- }
- } else {
- state.dataSurface->SurfIntConvWindowLocation(SurfLoop) = ConvectionConstants::InConvWinLoc::LargePartOfExteriorWall;
- }
- if ((Surface(Surface(SurfLoop).BaseSurf).ExtBoundCond == ExternalEnvironment) &&
- (Surface(Surface(SurfLoop).BaseSurf).Class == SurfaceClass::Wall)) {
- if (Surface(Surface(SurfLoop).BaseSurf).Centroid.z < Surface(SurfLoop).Centroid.z) {
- state.dataSurface->SurfIntConvWindowLocation(Surface(SurfLoop).BaseSurf) =
- ConvectionConstants::InConvWinLoc::WindowAboveThis;
- } else {
- state.dataSurface->SurfIntConvWindowLocation(Surface(SurfLoop).BaseSurf) =
- ConvectionConstants::InConvWinLoc::WindowBelowThis;
- }
- }
- }
- if ((Surface(SurfLoop).ExtBoundCond == ExternalEnvironment) && (Surface(SurfLoop).Class == SurfaceClass::Wall) &&
- (state.dataSurface->SurfIntConvWindowLocation(SurfLoop) == ConvectionConstants::InConvWinLoc::NotSet)) {
- if (Surface(SurfLoop).Centroid.z < Zone(ZoneLoop).Centroid.z) {
- state.dataSurface->SurfIntConvWindowLocation(SurfLoop) = ConvectionConstants::InConvWinLoc::WindowAboveThis;
+ auto const &surf = state.dataSurface->Surface(SurfLoop);
+ auto &surfIntConv = state.dataSurface->surfIntConv(SurfLoop);
+ if (surf.ExtBoundCond != ExternalEnvironment) continue;
+
+ if (surf.Class == SurfaceClass::Window || surf.Class == SurfaceClass::GlassDoor) {
+
+ if (surfIntConv.windowWallRatio < 0.5) {
+ surfIntConv.windowLocation =
+ (surf.Centroid.z < zone.Centroid.z) ? IntConvWinLoc::LowerPartOfExteriorWall : IntConvWinLoc::UpperPartOfExteriorWall;
} else {
- state.dataSurface->SurfIntConvWindowLocation(SurfLoop) = ConvectionConstants::InConvWinLoc::WindowBelowThis;
+ surfIntConv.windowLocation = IntConvWinLoc::LargePartOfExteriorWall;
}
+
+ auto const &baseSurf = state.dataSurface->Surface(surf.BaseSurf);
+ auto &baseSurfIntConv = state.dataSurface->surfIntConv(surf.BaseSurf);
+ if (baseSurf.ExtBoundCond != ExternalEnvironment) continue;
+ if (baseSurf.Class != SurfaceClass::Wall) continue;
+
+ baseSurfIntConv.windowLocation =
+ (baseSurf.Centroid.z < surf.Centroid.z) ? IntConvWinLoc::WindowAboveThis : IntConvWinLoc::WindowBelowThis;
+
+ } else if (surf.Class == SurfaceClass::Wall && surfIntConv.windowLocation == IntConvWinLoc::NotSet) {
+ surfIntConv.windowLocation =
+ (surf.Centroid.z < zone.Centroid.z) ? IntConvWinLoc::WindowAboveThis : IntConvWinLoc::WindowBelowThis;
}
}
} // third pass over surfaces
}
} // loop over zones for inside face parameters
- state.dataConvectionCoefficient->CubeRootOfOverallBuildingVolume = std::pow(BldgVolumeSum, ConvectionConstants::OneThird);
+ state.dataConvect->CubeRootOfOverallBuildingVolume = std::pow(BldgVolumeSum, 1.0 / 3.0);
+
+ SurfaceGeometry::GeoSummary geoSummaryRoof;
+ SurfaceGeometry::GetGeoSummaryRoof(state, geoSummaryRoof);
- auto &NorthFacade = state.dataConvectionCoefficient->NorthFacade;
- auto &NorthEastFacade = state.dataConvectionCoefficient->NorthEastFacade;
- auto &EastFacade = state.dataConvectionCoefficient->EastFacade;
- auto &SouthEastFacade = state.dataConvectionCoefficient->SouthEastFacade;
- auto &SouthFacade = state.dataConvectionCoefficient->SouthFacade;
- auto &SouthWestFacade = state.dataConvectionCoefficient->SouthWestFacade;
- auto &WestFacade = state.dataConvectionCoefficient->WestFacade;
- auto &NorthWestFacade = state.dataConvectionCoefficient->NorthWestFacade;
+ state.dataConvect->RoofLongAxisOutwardAzimuth = geoSummaryRoof.Azimuth;
- // Calculate roof perimeter, Area, weighted-by-area average height azimuth
- auto &RoofGeo = state.dataConvectionCoefficient->RoofGeo;
- RoofGeo = getRoofGeometryInformation(state);
- state.dataConvectionCoefficient->RoofLongAxisOutwardAzimuth = RoofGeo.Azimuth;
+ // Calculate facade areas, perimeters, and heights.
+ // Why are these calculations so quick and dirty while the roof calcluation is much more detailed?
+ std::array geoSummaryFacades;
// first pass over surfaces for outside face params
- for (int SurfLoop = 1; SurfLoop <= state.dataSurface->TotSurfaces; ++SurfLoop) {
- if (Surface(SurfLoop).ExtBoundCond != ExternalEnvironment) {
+ for (auto const &surf : state.dataSurface->Surface) {
+ if (surf.ExtBoundCond != ExternalEnvironment) {
continue;
}
- if (!Surface(SurfLoop).HeatTransSurf) {
+ if (!surf.HeatTransSurf) {
continue;
}
- Real64 thisAzimuth = Surface(SurfLoop).Azimuth;
- Real64 thisArea = Surface(SurfLoop).Area;
- if ((Surface(SurfLoop).Tilt >= 45.0) && (Surface(SurfLoop).Tilt < 135.0)) { // treat as vertical wall
-
- auto const &vertices(Surface(SurfLoop).Vertex);
- Real64 const x_min(minval(vertices, &Vector::x));
- Real64 const y_min(minval(vertices, &Vector::y));
- Real64 const z_min(minval(vertices, &Vector::z));
- Real64 const x_max(maxval(vertices, &Vector::x));
- Real64 const y_max(maxval(vertices, &Vector::y));
- Real64 const z_max(maxval(vertices, &Vector::z));
-
- if ((thisAzimuth >= NorthFacade.AzimuthRangeLow) || (thisAzimuth < NorthFacade.AzimuthRangeHi)) {
- NorthFacade.Area += thisArea;
- NorthFacade.Zmax = max(z_max, NorthFacade.Zmax);
- NorthFacade.Zmin = min(z_min, NorthFacade.Zmin);
- NorthFacade.Ymax = max(y_max, NorthFacade.Ymax);
- NorthFacade.Ymin = min(y_min, NorthFacade.Ymin);
- NorthFacade.Xmax = max(x_max, NorthFacade.Xmax);
- NorthFacade.Xmin = min(x_min, NorthFacade.Xmin);
-
- } else if ((thisAzimuth >= NorthEastFacade.AzimuthRangeLow) && (thisAzimuth < NorthEastFacade.AzimuthRangeHi)) {
- NorthEastFacade.Area += thisArea;
- NorthEastFacade.Zmax = max(z_max, NorthEastFacade.Zmax);
- NorthEastFacade.Zmin = min(z_min, NorthEastFacade.Zmin);
- NorthEastFacade.Ymax = max(y_max, NorthEastFacade.Ymax);
- NorthEastFacade.Ymin = min(y_min, NorthEastFacade.Ymin);
- NorthEastFacade.Xmax = max(x_max, NorthEastFacade.Xmax);
- NorthEastFacade.Xmin = min(x_min, NorthEastFacade.Xmin);
-
- } else if ((thisAzimuth >= EastFacade.AzimuthRangeLow) && (thisAzimuth < EastFacade.AzimuthRangeHi)) {
- EastFacade.Area += thisArea;
- EastFacade.Zmax = max(z_max, EastFacade.Zmax);
- EastFacade.Zmin = min(z_min, EastFacade.Zmin);
- EastFacade.Ymax = max(y_max, EastFacade.Ymax);
- EastFacade.Ymin = min(y_min, EastFacade.Ymin);
- EastFacade.Xmax = max(x_max, EastFacade.Xmax);
- EastFacade.Xmin = min(x_min, EastFacade.Xmin);
- } else if ((thisAzimuth >= SouthEastFacade.AzimuthRangeLow) && (thisAzimuth < SouthEastFacade.AzimuthRangeHi)) {
- SouthEastFacade.Area += thisArea;
- SouthEastFacade.Zmax = max(z_max, SouthEastFacade.Zmax);
- SouthEastFacade.Zmin = min(z_min, SouthEastFacade.Zmin);
- SouthEastFacade.Ymax = max(y_max, SouthEastFacade.Ymax);
- SouthEastFacade.Ymin = min(y_min, SouthEastFacade.Ymin);
- SouthEastFacade.Xmax = max(x_max, SouthEastFacade.Xmax);
- SouthEastFacade.Xmin = min(x_min, SouthEastFacade.Xmin);
-
- } else if ((thisAzimuth >= SouthFacade.AzimuthRangeLow) && (thisAzimuth < SouthFacade.AzimuthRangeHi)) {
- SouthFacade.Area += thisArea;
- SouthFacade.Zmax = max(z_max, SouthFacade.Zmax);
- SouthFacade.Zmin = min(z_min, SouthFacade.Zmin);
- SouthFacade.Ymax = max(y_max, SouthFacade.Ymax);
- SouthFacade.Ymin = min(y_min, SouthFacade.Ymin);
- SouthFacade.Xmax = max(x_max, SouthFacade.Xmax);
- SouthFacade.Xmin = min(x_min, SouthFacade.Xmin);
-
- } else if ((thisAzimuth >= SouthWestFacade.AzimuthRangeLow) && (thisAzimuth < SouthWestFacade.AzimuthRangeHi)) {
- SouthWestFacade.Area += thisArea;
- SouthWestFacade.Zmax = max(z_max, SouthWestFacade.Zmax);
- SouthWestFacade.Zmin = min(z_min, SouthWestFacade.Zmin);
- SouthWestFacade.Ymax = max(y_max, SouthWestFacade.Ymax);
- SouthWestFacade.Ymin = min(y_min, SouthWestFacade.Ymin);
- SouthWestFacade.Xmax = max(x_max, SouthWestFacade.Xmax);
- SouthWestFacade.Xmin = min(x_min, SouthWestFacade.Xmin);
-
- } else if ((thisAzimuth >= WestFacade.AzimuthRangeLow) && (thisAzimuth < WestFacade.AzimuthRangeHi)) {
- WestFacade.Area += thisArea;
- WestFacade.Zmax = max(z_max, WestFacade.Zmax);
- WestFacade.Zmin = min(z_min, WestFacade.Zmin);
- WestFacade.Ymax = max(y_max, WestFacade.Ymax);
- WestFacade.Ymin = min(y_min, WestFacade.Ymin);
- WestFacade.Xmax = max(x_max, WestFacade.Xmax);
- WestFacade.Xmin = min(x_min, WestFacade.Xmin);
-
- } else if ((thisAzimuth >= NorthWestFacade.AzimuthRangeLow) && (thisAzimuth < NorthWestFacade.AzimuthRangeHi)) {
- NorthWestFacade.Area += thisArea;
- NorthWestFacade.Zmax = max(z_max, NorthWestFacade.Zmax);
- NorthWestFacade.Zmin = min(z_min, NorthWestFacade.Zmin);
- NorthWestFacade.Ymax = max(y_max, NorthWestFacade.Ymax);
- NorthWestFacade.Ymin = min(y_min, NorthWestFacade.Ymin);
- NorthWestFacade.Xmax = max(x_max, NorthWestFacade.Xmax);
- NorthWestFacade.Xmin = min(x_min, NorthWestFacade.Xmin);
+ if ((surf.Tilt < 45.0) || (surf.Tilt >= 135.0)) continue; // not a vertical wall
+
+ DataSurfaces::Compass8 compass8 = AzimuthToCompass8(surf.Azimuth);
+
+ Real64 x_min = Constant::BigNumber;
+ Real64 x_max = -Constant::BigNumber;
+ Real64 y_min = Constant::BigNumber;
+ Real64 y_max = -Constant::BigNumber;
+ Real64 z_min = Constant::BigNumber;
+ Real64 z_max = -Constant::BigNumber;
+
+ for (auto const &v : surf.Vertex) {
+ if (v.x < x_min) {
+ x_min = v.x;
+ } else if (v.x > x_max) {
+ x_max = v.x;
+ }
+ if (v.y < y_min) {
+ y_min = v.y;
+ } else if (v.y > y_max) {
+ y_max = v.y;
+ }
+ if (v.z < z_min) {
+ z_min = v.z;
+ } else if (v.z > z_max) {
+ z_max = v.z;
}
}
+
+ auto &facade = geoSummaryFacades[(int)compass8];
+ facade.Area += surf.Area;
+ facade.Zmax = max(z_max, facade.Zmax);
+ facade.Zmin = min(z_min, facade.Zmin);
+ facade.Ymax = max(y_max, facade.Ymax);
+ facade.Ymin = min(y_min, facade.Ymin);
+ facade.Xmax = max(x_max, facade.Xmax);
+ facade.Xmin = min(x_min, facade.Xmin);
} // fist loop over surfaces for outside face params
- NorthFacade.Perimeter = 2.0 * std::sqrt(pow_2(NorthFacade.Xmax - NorthFacade.Xmin) + pow_2(NorthFacade.Ymax - NorthFacade.Ymin)) +
- 2.0 * (NorthFacade.Zmax - NorthFacade.Zmin);
- NorthFacade.Height = NorthFacade.Zmax - NorthFacade.Zmin;
-
- NorthEastFacade.Perimeter =
- 2.0 * std::sqrt(pow_2(NorthEastFacade.Xmax - NorthEastFacade.Xmin) + pow_2(NorthEastFacade.Ymax - NorthEastFacade.Ymin)) +
- 2.0 * (NorthEastFacade.Zmax - NorthEastFacade.Zmin);
- NorthEastFacade.Height = NorthEastFacade.Zmax - NorthEastFacade.Zmin;
-
- EastFacade.Perimeter = 2.0 * std::sqrt(pow_2(EastFacade.Xmax - EastFacade.Xmin) + pow_2(EastFacade.Ymax - EastFacade.Ymin)) +
- 2.0 * (EastFacade.Zmax - EastFacade.Zmin);
- EastFacade.Height = EastFacade.Zmax - EastFacade.Zmin;
-
- SouthEastFacade.Perimeter =
- 2.0 * std::sqrt(pow_2(SouthEastFacade.Xmax - SouthEastFacade.Xmin) + pow_2(SouthEastFacade.Ymax - SouthEastFacade.Ymin)) +
- 2.0 * (SouthEastFacade.Zmax - SouthEastFacade.Zmin);
- SouthEastFacade.Height = SouthEastFacade.Zmax - SouthEastFacade.Zmin;
-
- SouthFacade.Perimeter = 2.0 * std::sqrt(pow_2(SouthFacade.Xmax - SouthFacade.Xmin) + pow_2(SouthFacade.Ymax - SouthFacade.Ymin)) +
- 2.0 * (SouthFacade.Zmax - SouthFacade.Zmin);
- SouthFacade.Height = SouthFacade.Zmax - SouthFacade.Zmin;
-
- SouthWestFacade.Perimeter =
- 2.0 * std::sqrt(pow_2(SouthWestFacade.Xmax - SouthWestFacade.Xmin) + pow_2(SouthWestFacade.Ymax - SouthWestFacade.Ymin)) +
- 2.0 * (SouthWestFacade.Zmax - SouthWestFacade.Zmin);
- SouthWestFacade.Height = SouthWestFacade.Zmax - SouthWestFacade.Zmin;
-
- WestFacade.Perimeter = 2.0 * std::sqrt(pow_2(WestFacade.Xmax - WestFacade.Xmin) + pow_2(WestFacade.Ymax - WestFacade.Ymin)) +
- 2.0 * (WestFacade.Zmax - WestFacade.Zmin);
- WestFacade.Height = WestFacade.Zmax - WestFacade.Zmin;
-
- NorthWestFacade.Perimeter =
- 2.0 * std::sqrt(pow_2(NorthWestFacade.Xmax - NorthWestFacade.Xmin) + pow_2(NorthWestFacade.Ymax - NorthWestFacade.Ymin)) +
- 2.0 * (NorthWestFacade.Zmax - NorthWestFacade.Zmin);
- NorthWestFacade.Height = NorthWestFacade.Zmax - NorthWestFacade.Zmin;
-
- for (int SurfLoop = 1; SurfLoop <= state.dataSurface->TotSurfaces; ++SurfLoop) {
- if (Surface(SurfLoop).ExtBoundCond != ExternalEnvironment) continue;
- if (!Surface(SurfLoop).HeatTransSurf) continue;
- Real64 thisAzimuth = Surface(SurfLoop).Azimuth;
-
- auto const &vertices(Surface(SurfLoop).Vertex);
- Real64 const z_min(minval(vertices, &Vector::z));
- Real64 const z_max(maxval(vertices, &Vector::z));
- Real64 const z_del(z_max - z_min);
-
- if ((Surface(SurfLoop).Tilt >= 45.0) && (Surface(SurfLoop).Tilt < 135.0)) { // treat as vertical wall
- if ((thisAzimuth >= NorthFacade.AzimuthRangeLow) || (thisAzimuth < NorthFacade.AzimuthRangeHi)) {
- state.dataSurface->SurfOutConvFaceArea(SurfLoop) = max(NorthFacade.Area, Surface(SurfLoop).GrossArea);
- state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = max(NorthFacade.Perimeter, Surface(SurfLoop).Perimeter);
- state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = max(NorthFacade.Height, z_del);
- } else if ((thisAzimuth >= NorthEastFacade.AzimuthRangeLow) && (thisAzimuth < NorthEastFacade.AzimuthRangeHi)) {
- state.dataSurface->SurfOutConvFaceArea(SurfLoop) = max(NorthEastFacade.Area, Surface(SurfLoop).GrossArea);
- state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = max(NorthEastFacade.Perimeter, Surface(SurfLoop).Perimeter);
- state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = max(NorthEastFacade.Height, z_del);
- } else if ((thisAzimuth >= EastFacade.AzimuthRangeLow) && (thisAzimuth < EastFacade.AzimuthRangeHi)) {
- state.dataSurface->SurfOutConvFaceArea(SurfLoop) = max(EastFacade.Area, Surface(SurfLoop).GrossArea);
- state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = max(EastFacade.Perimeter, Surface(SurfLoop).Perimeter);
- state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = max(EastFacade.Height, z_del);
- } else if ((thisAzimuth >= SouthEastFacade.AzimuthRangeLow) && (thisAzimuth < SouthEastFacade.AzimuthRangeHi)) {
- state.dataSurface->SurfOutConvFaceArea(SurfLoop) = max(SouthEastFacade.Area, Surface(SurfLoop).GrossArea);
- state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = max(SouthEastFacade.Perimeter, Surface(SurfLoop).Perimeter);
- state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = max(SouthEastFacade.Height, z_del);
- } else if ((thisAzimuth >= SouthFacade.AzimuthRangeLow) && (thisAzimuth < SouthFacade.AzimuthRangeHi)) {
- state.dataSurface->SurfOutConvFaceArea(SurfLoop) = max(SouthFacade.Area, Surface(SurfLoop).GrossArea);
- state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = max(SouthFacade.Perimeter, Surface(SurfLoop).Perimeter);
- state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = max(SouthFacade.Height, z_del);
- } else if ((thisAzimuth >= SouthWestFacade.AzimuthRangeLow) && (thisAzimuth < SouthWestFacade.AzimuthRangeHi)) {
- state.dataSurface->SurfOutConvFaceArea(SurfLoop) = max(SouthWestFacade.Area, Surface(SurfLoop).GrossArea);
- state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = max(SouthWestFacade.Perimeter, Surface(SurfLoop).Perimeter);
- state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = max(SouthWestFacade.Height, z_del);
- } else if ((thisAzimuth >= WestFacade.AzimuthRangeLow) && (thisAzimuth < WestFacade.AzimuthRangeHi)) {
- state.dataSurface->SurfOutConvFaceArea(SurfLoop) = max(WestFacade.Area, Surface(SurfLoop).GrossArea);
- state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = max(WestFacade.Perimeter, Surface(SurfLoop).Perimeter);
- state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = max(WestFacade.Height, z_del);
- } else if ((thisAzimuth >= NorthWestFacade.AzimuthRangeLow) && (thisAzimuth < NorthWestFacade.AzimuthRangeHi)) {
- state.dataSurface->SurfOutConvFaceArea(SurfLoop) = max(NorthWestFacade.Area, Surface(SurfLoop).GrossArea);
- state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = max(NorthWestFacade.Perimeter, Surface(SurfLoop).Perimeter);
- state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = max(NorthWestFacade.Height, z_del);
+ for (auto &facade : geoSummaryFacades) {
+ facade.Perimeter = 2.0 * std::sqrt(pow_2(facade.Xmax - facade.Xmin) + pow_2(facade.Ymax - facade.Ymin)) + 2.0 * (facade.Zmax - facade.Zmin);
+ facade.Height = facade.Zmax - facade.Zmin;
+ }
+ for (int surfNum = 1; surfNum <= state.dataSurface->TotSurfaces; ++surfNum) {
+ auto const &surf = state.dataSurface->Surface(surfNum);
+ if (surf.ExtBoundCond != ExternalEnvironment) continue;
+ if (!surf.HeatTransSurf) continue;
+
+ Real64 z_min = Constant::BigNumber;
+ Real64 z_max = -Constant::BigNumber;
+ for (auto const &v : surf.Vertex) {
+ if (v.z < z_min) {
+ z_min = v.z;
+ } else if (v.z > z_max) {
+ z_max = v.z;
}
- } else if (Surface(SurfLoop).Tilt < 45.0) { // assume part of roof
- state.dataSurface->SurfOutConvFaceArea(SurfLoop) = max(RoofGeo.Area, Surface(SurfLoop).GrossArea);
- state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = max(RoofGeo.Perimeter, Surface(SurfLoop).Perimeter);
- state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = max(RoofGeo.Height, z_del);
- } else if (Surface(SurfLoop).Tilt >= 135.0) { // assume floor over exterior, just use surface's geometry
- state.dataSurface->SurfOutConvFaceArea(SurfLoop) = Surface(SurfLoop).GrossArea;
- state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = Surface(SurfLoop).Perimeter;
- state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = z_del;
+ }
+ Real64 z_del = z_max - z_min;
+
+ auto &surfExtConv = state.dataSurface->surfExtConv(surfNum);
+ if ((surf.Tilt >= 45.0) && (surf.Tilt < 135.0)) { // treat as vertical wall
+ DataSurfaces::Compass8 compass8 = AzimuthToCompass8(surf.Azimuth);
+ auto const &facade = geoSummaryFacades[(int)compass8];
+
+ surfExtConv.faceArea = max(facade.Area, surf.GrossArea);
+ surfExtConv.facePerimeter = max(facade.Perimeter, surf.Perimeter);
+ surfExtConv.faceHeight = max(facade.Height, z_del);
+ } else if (surf.Tilt < 45.0) { // assume part of roof
+ surfExtConv.faceArea = max(geoSummaryRoof.Area, surf.GrossArea);
+ surfExtConv.facePerimeter = max(geoSummaryRoof.Perimeter, surf.Perimeter);
+ surfExtConv.faceHeight = max(geoSummaryRoof.Height, z_del);
+ } else if (surf.Tilt >= 135.0) { // assume floor over exterior, just use surface's geometry
+ surfExtConv.faceArea = surf.GrossArea;
+ surfExtConv.facePerimeter = surf.Perimeter;
+ surfExtConv.faceHeight = z_del;
}
} // second pass thru surfs for outside face convection params.
@@ -4583,27 +2952,38 @@ void SetupAdaptiveConvectionStaticMetaData(EnergyPlusData &state)
"Window Location, Near Radiant {{Yes/No}}, Has Active HVAC {{Yes/No}}\n");
print(state.files.eio, Format_900); // header
for (int SurfLoop : state.dataSurface->AllSurfaceListReportOrder) {
- if (!Surface(SurfLoop).HeatTransSurf) {
- continue;
- }
+ auto const &surf = state.dataSurface->Surface(SurfLoop);
+ auto const &surfExtConv = state.dataSurface->surfExtConv(SurfLoop);
+ auto const &surfIntConv = state.dataSurface->surfIntConv(SurfLoop);
+
+ if (!surf.HeatTransSurf) continue;
static constexpr std::string_view Format_901(
"Surface Convection Parameters,{},{},{:.2R},{:.2R},{:.2R},{},{:.2R},{:.2R},{:.2R},{:.2R},{},{},{}\n");
+
+ // This reporting rubric (using numbers instead of strings, using negative numbers for "built-in" coefficients) is stupid,
+ // but we are maintaining compatiblity here
+ int hcExtRptNum = surfExtConv.userModelNum;
+ if (hcExtRptNum == 0) hcExtRptNum = -Convect::HcExtReportVals[(int)surfExtConv.model];
+
+ int hcIntRptNum = surfIntConv.userModelNum;
+ if (hcIntRptNum == 0) hcIntRptNum = -Convect::HcIntReportVals[(int)surfIntConv.model];
+
print(state.files.eio,
Format_901,
- Surface(SurfLoop).Name,
- state.dataSurface->SurfExtConvCoeffIndex(SurfLoop),
- state.dataSurface->SurfOutConvFaceArea(SurfLoop),
- state.dataSurface->SurfOutConvFacePerimeter(SurfLoop),
- state.dataSurface->SurfOutConvFaceHeight(SurfLoop),
- state.dataSurface->SurfIntConvCoeffIndex(SurfLoop),
- state.dataSurface->SurfIntConvZoneWallHeight(SurfLoop),
- state.dataSurface->SurfIntConvZonePerimLength(SurfLoop),
- state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfLoop),
- state.dataSurface->SurfIntConvWindowWallRatio(SurfLoop),
- state.dataSurface->SurfIntConvWindowLocation(SurfLoop),
- state.dataSurface->SurfIntConvSurfGetsRadiantHeat(SurfLoop) ? "Yes" : "No",
- state.dataSurface->SurfIntConvSurfHasActiveInIt(SurfLoop) ? "Yes" : "No");
+ surf.Name,
+ hcExtRptNum,
+ surfExtConv.faceArea,
+ surfExtConv.facePerimeter,
+ surfExtConv.faceHeight,
+ hcIntRptNum,
+ surfIntConv.zoneWallHeight,
+ surfIntConv.zonePerimLength,
+ surfIntConv.zoneHorizHydrDiam,
+ surfIntConv.windowWallRatio,
+ surfIntConv.windowLocation,
+ surfIntConv.getsRadiantHeat ? "Yes" : "No",
+ surfIntConv.hasActiveInIt ? "Yes" : "No");
// [m] length of perimeter zone's exterior wall | [m] hydraulic diameter, usually 4 times the zone floor area div by
// perimeter | [-] area of windows over area of exterior wall for zone | relative location of window in zone for
@@ -4612,138 +2992,46 @@ void SetupAdaptiveConvectionStaticMetaData(EnergyPlusData &state)
// if display advanced reports also dump meta group data used for convection geometry
if (state.dataGlobal->DisplayAdvancedReportVariables) {
- static constexpr std::string_view Format_8000(
- "! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax \n");
- print(state.files.eio, Format_8000); // header for north facade
- static constexpr std::string_view Format_8001(
- "Building Convection Parameters:North Facade, {:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R}\n");
- print(state.files.eio,
- Format_8001,
- NorthFacade.Perimeter,
- NorthFacade.Height,
- NorthFacade.Xmin,
- NorthFacade.Xmax,
- NorthFacade.Ymin,
- NorthFacade.Ymax,
- NorthFacade.Zmin,
- NorthFacade.Zmax);
- static constexpr std::string_view Format_8100(
- "! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax \n");
- print(state.files.eio, Format_8100); // header for northeast facade
- static constexpr std::string_view Format_8101(
- "Building Convection Parameters:Northeast Facade, {:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R}\n");
- print(state.files.eio,
- Format_8101,
- NorthEastFacade.Perimeter,
- NorthEastFacade.Height,
- NorthEastFacade.Xmin,
- NorthEastFacade.Xmax,
- NorthEastFacade.Ymin,
- NorthEastFacade.Ymax,
- NorthEastFacade.Zmin,
- NorthEastFacade.Zmax);
- static constexpr std::string_view Format_8200(
- "! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax \n");
- print(state.files.eio, Format_8200); // header for east facade
- static constexpr std::string_view Format_8201(
- "Building Convection Parameters:East Facade, {:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R}\n");
- print(state.files.eio,
- Format_8201,
- EastFacade.Perimeter,
- EastFacade.Height,
- EastFacade.Xmin,
- EastFacade.Xmax,
- EastFacade.Ymin,
- EastFacade.Ymax,
- EastFacade.Zmin,
- EastFacade.Zmax);
-
- static constexpr std::string_view Format_8300(
- "! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax \n");
- print(state.files.eio, Format_8300); // header for southeast facade
- static constexpr std::string_view Format_8301(
- "Building Convection Parameters:Southeast Facade, {:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R}\n");
- print(state.files.eio,
- Format_8301,
- SouthEastFacade.Perimeter,
- SouthEastFacade.Height,
- SouthEastFacade.Xmin,
- SouthEastFacade.Xmax,
- SouthEastFacade.Ymin,
- SouthEastFacade.Ymax,
- SouthEastFacade.Zmin,
- SouthEastFacade.Zmax);
-
- static constexpr std::string_view Format_8400(
- "! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax \n");
- print(state.files.eio, Format_8400); // header for south facade
- static constexpr std::string_view Format_8401(
- "Building Convection Parameters:South Facade, {:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R}\n");
- print(state.files.eio,
- Format_8401,
- SouthFacade.Perimeter,
- SouthFacade.Height,
- SouthFacade.Xmin,
- SouthFacade.Xmax,
- SouthFacade.Ymin,
- SouthFacade.Ymax,
- SouthFacade.Zmin,
- SouthFacade.Zmax);
- static constexpr std::string_view Format_8500(
- "! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax \n");
- print(state.files.eio, Format_8500); // header for southwest facade
- static constexpr std::string_view Format_8501(
- "Building Convection Parameters:Southwest Facade, {:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R}\n");
- print(state.files.eio,
- Format_8501,
- SouthWestFacade.Perimeter,
- SouthWestFacade.Height,
- SouthWestFacade.Xmin,
- SouthWestFacade.Xmax,
- SouthWestFacade.Ymin,
- SouthWestFacade.Ymax,
- SouthWestFacade.Zmin,
- SouthWestFacade.Zmax);
- static constexpr std::string_view Format_8600(
- "! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax \n");
- print(state.files.eio, Format_8600); // header for west facade
- static constexpr std::string_view Format_8601(
- "Building Convection Parameters:West Facade, {:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R}\n");
- print(state.files.eio,
- Format_8601,
- WestFacade.Perimeter,
- WestFacade.Height,
- WestFacade.Xmin,
- WestFacade.Xmax,
- WestFacade.Ymin,
- WestFacade.Ymax,
- WestFacade.Zmin,
- WestFacade.Zmax);
- static constexpr std::string_view Format_8700(
- "! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax \n");
- print(state.files.eio, Format_8700); // header for northwest facade
- static constexpr std::string_view Format_8701(
- "Building Convection Parameters:NorthwWest Facade, {:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R}\n");
- print(state.files.eio,
- Format_8701,
- NorthWestFacade.Perimeter,
- NorthWestFacade.Height,
- NorthWestFacade.Xmin,
- NorthWestFacade.Xmax,
- NorthWestFacade.Ymin,
- NorthWestFacade.Ymax,
- NorthWestFacade.Zmin,
- NorthWestFacade.Zmax);
+ static constexpr std::string_view Format_8000 =
+ "! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax \n";
+ static constexpr std::string_view Format_8001 =
+ "Building Convection Parameters:{} Facade, {:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R},{:.2R}\n";
+
+ for (int c8 = 0; c8 < (int)DataSurfaces::Compass8::Num; ++c8) {
+
+ // header for north facade
+ print(state.files.eio, Format_8000, DataSurfaces::compass8Names[c8]);
+
+ auto const &facade = geoSummaryFacades[c8];
+ print(state.files.eio,
+ Format_8001,
+ DataSurfaces::compass8Names[c8],
+ facade.Perimeter,
+ facade.Height,
+ facade.Xmin,
+ facade.Xmax,
+ facade.Ymin,
+ facade.Ymax,
+ facade.Zmin,
+ facade.Zmax);
+ }
+
static constexpr std::string_view Format_8800(
"! , Area [m2], Perimeter [m], Height [m], Tilt [deg], Azimuth [deg]\n");
print(state.files.eio, Format_8800); // header for roof
static constexpr std::string_view Format_8801("Building Convection Parameters:Roof,{:.2R},{:.2R},{:.2R},{:.2R},{:.2R}");
- print(state.files.eio, Format_8801, RoofGeo.Area, RoofGeo.Perimeter, RoofGeo.Height, RoofGeo.Tilt, RoofGeo.Azimuth);
- }
- }
+ print(state.files.eio,
+ Format_8801,
+ geoSummaryRoof.Area,
+ geoSummaryRoof.Perimeter,
+ geoSummaryRoof.Height,
+ geoSummaryRoof.Tilt,
+ geoSummaryRoof.Azimuth);
+ } // Display
+ } // Do Report
}
-void SetupAdaptiveConvectionRadiantSurfaceData(EnergyPlusData &state)
+void SetupAdaptiveConvRadiantSurfaceData(EnergyPlusData &state)
{
// SUBROUTINE INFORMATION:
@@ -4758,46 +3046,41 @@ void SetupAdaptiveConvectionRadiantSurfaceData(EnergyPlusData &state)
// and ZoneEquipConfig(ZoneNum)%InFloorActiveElement.
for (int ZoneLoop = 1; ZoneLoop <= state.dataGlobal->NumOfZones; ++ZoneLoop) {
- state.dataConvectionCoefficient->ActiveWallCount = 0;
- state.dataConvectionCoefficient->ActiveWallArea = 0.0;
- state.dataConvectionCoefficient->ActiveCeilingCount = 0;
- state.dataConvectionCoefficient->ActiveCeilingArea = 0.0;
- state.dataConvectionCoefficient->ActiveFloorCount = 0;
- state.dataConvectionCoefficient->ActiveFloorArea = 0.0;
-
- for (int spaceNum : state.dataHeatBal->Zone(ZoneLoop).spaceIndexes) {
+ int activeWallCount = 0;
+ Real64 activeWallArea = 0.0;
+ int activeCeilingCount = 0;
+ Real64 activeCeilingArea = 0.0;
+ int activeFloorCount = 0;
+ Real64 activeFloorArea = 0.0;
+
+ auto &zone = state.dataHeatBal->Zone(ZoneLoop);
+ for (int spaceNum : zone.spaceIndexes) {
auto const &thisSpace = state.dataHeatBal->space(spaceNum);
for (int SurfLoop = thisSpace.HTSurfaceFirst; SurfLoop <= thisSpace.HTSurfaceLast; ++SurfLoop) {
auto const &surface = state.dataSurface->Surface(SurfLoop);
-
- if (!state.dataSurface->SurfIntConvSurfHasActiveInIt(SurfLoop)) continue;
+ if (!state.dataSurface->surfIntConv(SurfLoop).hasActiveInIt) continue;
if (surface.Class == SurfaceClass::Wall || surface.Class == SurfaceClass::Door) {
- ++state.dataConvectionCoefficient->ActiveWallCount;
- state.dataConvectionCoefficient->ActiveWallArea += surface.Area;
+ ++activeWallCount;
+ activeWallArea += surface.Area;
} else if (surface.Class == SurfaceClass::Roof) {
- ++state.dataConvectionCoefficient->ActiveCeilingCount;
- state.dataConvectionCoefficient->ActiveCeilingArea += surface.Area;
+ ++activeCeilingCount;
+ activeCeilingArea += surface.Area;
} else if (surface.Class == SurfaceClass::Floor) {
- ++state.dataConvectionCoefficient->ActiveFloorCount;
- state.dataConvectionCoefficient->ActiveFloorArea += surface.Area;
+ ++activeFloorCount;
+ activeFloorArea += surface.Area;
}
}
} // surface loop
- if ((state.dataConvectionCoefficient->ActiveWallCount > 0) && (state.dataConvectionCoefficient->ActiveWallArea > 0.0)) {
- state.dataZoneEquip->ZoneEquipConfig(ZoneLoop).InWallActiveElement = true;
- }
- if ((state.dataConvectionCoefficient->ActiveCeilingCount > 0) && (state.dataConvectionCoefficient->ActiveCeilingArea > 0.0)) {
- state.dataZoneEquip->ZoneEquipConfig(ZoneLoop).InCeilingActiveElement = true;
- }
- if ((state.dataConvectionCoefficient->ActiveFloorCount > 0) && (state.dataConvectionCoefficient->ActiveFloorArea > 0)) {
- state.dataZoneEquip->ZoneEquipConfig(ZoneLoop).InFloorActiveElement = true;
- }
+ auto &zoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(ZoneLoop);
+ zoneEquipConfig.InWallActiveElement = (activeWallCount > 0 && activeWallArea > 0.0);
+ zoneEquipConfig.InCeilingActiveElement = (activeCeilingCount > 0 && activeCeilingArea > 0.0);
+ zoneEquipConfig.InFloorActiveElement = (activeFloorCount > 0 && activeFloorArea > 0);
} // zone loop
}
-void ManageInsideAdaptiveConvectionAlgo(EnergyPlusData &state,
- int const SurfNum) // surface number for which coefficients are being calculated
+void ManageIntAdaptiveConvAlgo(EnergyPlusData &state,
+ int const SurfNum) // surface number for which coefficients are being calculated
{
// SUBROUTINE INFORMATION:
@@ -4820,15 +3103,13 @@ void ManageInsideAdaptiveConvectionAlgo(EnergyPlusData &state,
DynamicIntConvSurfaceClassification(state, SurfNum);
// simple worker routine takes surface classification and fills in model to use (IntConvHcModelEq) for that surface
- MapIntConvClassificationToHcModels(state, SurfNum);
+ MapIntConvClassToHcModels(state, SurfNum);
- EvaluateIntHcModels(state, SurfNum, state.dataSurface->SurfIntConvHcModelEq(SurfNum), state.dataHeatBalSurf->SurfHConvInt(SurfNum));
+ state.dataHeatBalSurf->SurfHConvInt(SurfNum) = EvaluateIntHcModels(state, SurfNum, state.dataSurface->surfIntConv(SurfNum).hcModelEq);
}
-void ManageOutsideAdaptiveConvectionAlgo(EnergyPlusData &state,
- int const SurfNum, // surface number for which coefficients are being calculated
- Real64 &Hc // result for Hc Outside face, becomes HExt.
-)
+Real64 ManageExtAdaptiveConvAlgo(EnergyPlusData &state,
+ int const SurfNum) // surface number for which coefficients are being calculated
{
// SUBROUTINE INFORMATION:
@@ -4844,16 +3125,13 @@ void ManageOutsideAdaptiveConvectionAlgo(EnergyPlusData &state,
DynamicExtConvSurfaceClassification(state, SurfNum);
- MapExtConvClassificationToHcModels(state, SurfNum);
+ MapExtConvClassToHcModels(state, SurfNum);
- EvaluateExtHcModels(state, SurfNum, state.dataSurface->SurfOutConvHnModelEq(SurfNum), state.dataSurface->SurfOutConvHfModelEq(SurfNum), Hc);
+ auto const &surfExtConv = state.dataSurface->surfExtConv(SurfNum);
+ return EvaluateExtHcModels(state, SurfNum, surfExtConv.hnModelEq, surfExtConv.hfModelEq);
}
-void EvaluateIntHcModels(EnergyPlusData &state,
- int const SurfNum,
- int const ConvModelEquationNum,
- Real64 &Hc // calculated Hc value
-)
+Real64 EvaluateIntHcModels(EnergyPlusData &state, int const SurfNum, HcInt const ConvModelEquationNum)
{
// SUBROUTINE INFORMATION:
@@ -4871,6 +3149,8 @@ void EvaluateIntHcModels(EnergyPlusData &state,
Real64 tmpHc = 0.0;
auto const &thisSurface = state.dataSurface->Surface(SurfNum);
+ auto const &surfIntConv = state.dataSurface->surfIntConv(SurfNum);
+
int const ZoneNum = thisSurface.Zone;
Real64 const Tsurface = state.dataHeatBalSurf->SurfInsideTempHist(1)(SurfNum);
Real64 const Tzone = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT;
@@ -4879,18 +3159,21 @@ void EvaluateIntHcModels(EnergyPlusData &state,
// now call appropriate function to calculate Hc
switch (ConvModelEquationNum) {
- case ConvectionConstants::HcInt_UserCurve:
- CalcUserDefinedInsideHcModel(state, SurfNum, state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum), tmpHc);
- break;
- case ConvectionConstants::HcInt_ASHRAEVerticalWall:
+ case HcInt::UserCurve: {
+ tmpHc = CalcUserDefinedIntHcModel(state, SurfNum, surfIntConv.hcUserCurveNum);
+ } break;
+
+ case HcInt::ASHRAEVerticalWall: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
HnFn = [](double Tsurf, double Tamb, double, double, double) -> double { return CalcASHRAEVerticalWall(Tsurf - Tamb); };
} else {
tmpHc = CalcASHRAEVerticalWall((Tsurface - Tzone));
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_WaltonUnstableHorizontalOrTilt:
+
+ } break;
+
+ case HcInt::WaltonUnstableHorizontalOrTilt: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
HnFn = [](double Tsurf, double Tamb, double, double, double cosTilt) -> double {
return CalcWaltonUnstableHorizontalOrTilt(Tsurf - Tamb, cosTilt);
@@ -4899,8 +3182,9 @@ void EvaluateIntHcModels(EnergyPlusData &state,
tmpHc = CalcWaltonUnstableHorizontalOrTilt((Tsurface - Tzone), thisSurface.CosTilt); // TODO verify CosTilt in vs out
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_WaltonStableHorizontalOrTilt:
+ } break;
+
+ case HcInt::WaltonStableHorizontalOrTilt: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
HnFn = [](double Tsurf, double Tamb, double, double, double cosTilt) -> double {
return CalcWaltonStableHorizontalOrTilt(Tsurf - Tamb, cosTilt);
@@ -4909,8 +3193,9 @@ void EvaluateIntHcModels(EnergyPlusData &state,
tmpHc = CalcWaltonStableHorizontalOrTilt((Tsurface - Tzone), thisSurface.CosTilt); // TODO verify CosTilt in vs out
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_FisherPedersenCeilDiffuserFloor: {
+ } break;
+
+ case HcInt::FisherPedersenCeilDiffuserFloor: {
Real64 AirChangeRate = CalcCeilingDiffuserACH(state, ZoneNum);
Real64 AirHumRat = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).ZoneAirHumRatAvg;
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
@@ -4929,9 +3214,9 @@ void EvaluateIntHcModels(EnergyPlusData &state,
state.dataConstruction->Construct(thisSurface.Construction).TypeIsWindow);
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- }
- case ConvectionConstants::HcInt_FisherPedersenCeilDiffuserCeiling: {
+ } break;
+
+ case HcInt::FisherPedersenCeilDiffuserCeiling: {
Real64 AirChangeRate = CalcCeilingDiffuserACH(state, ZoneNum);
Real64 AirHumRat = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).ZoneAirHumRatAvg;
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
@@ -4950,9 +3235,9 @@ void EvaluateIntHcModels(EnergyPlusData &state,
state.dataConstruction->Construct(thisSurface.Construction).TypeIsWindow);
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- }
- case ConvectionConstants::HcInt_FisherPedersenCeilDiffuserWalls: {
+ } break;
+
+ case HcInt::FisherPedersenCeilDiffuserWalls: {
Real64 AirChangeRate = CalcCeilingDiffuserACH(state, ZoneNum);
Real64 AirHumRat = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).ZoneAirHumRatAvg;
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
@@ -4974,196 +3259,187 @@ void EvaluateIntHcModels(EnergyPlusData &state,
HnFn = [=](double, double, double, double, double) -> double { return tmpHc; };
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- }
- case ConvectionConstants::HcInt_AlamdariHammondStableHorizontal:
+ } break;
+
+ case HcInt::AlamdariHammondStableHorizontal: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
- Real64 HorizHydrDiam = state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum);
+ Real64 HorizHydrDiam = surfIntConv.zoneHorizHydrDiam;
HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double {
return CalcAlamdariHammondStableHorizontal(Tsurf - Tamb, HorizHydrDiam);
};
} else {
- tmpHc = CalcAlamdariHammondStableHorizontal(state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), SurfNum);
+ tmpHc = CalcAlamdariHammondStableHorizontal(state, (Tsurface - Tzone), surfIntConv.zoneHorizHydrDiam, SurfNum);
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_AlamdariHammondVerticalWall:
+ } break;
+
+ case HcInt::AlamdariHammondVerticalWall: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
- Real64 WallHeight = state.dataSurface->SurfIntConvZoneWallHeight(SurfNum);
+ Real64 WallHeight = surfIntConv.zoneWallHeight;
HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double {
return CalcAlamdariHammondVerticalWall(Tsurf - Tamb, WallHeight);
};
} else {
- tmpHc = CalcAlamdariHammondVerticalWall(state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneWallHeight(SurfNum), SurfNum);
+ tmpHc = CalcAlamdariHammondVerticalWall(state, (Tsurface - Tzone), surfIntConv.zoneWallHeight, SurfNum);
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_AlamdariHammondUnstableHorizontal:
+ } break;
+
+ case HcInt::AlamdariHammondUnstableHorizontal: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
- Real64 HorizHydrDiam = state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum);
+ Real64 HorizHydrDiam = surfIntConv.zoneHorizHydrDiam;
HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double {
return CalcAlamdariHammondStableHorizontal(Tsurf - Tamb, HorizHydrDiam);
};
} else {
- tmpHc =
- CalcAlamdariHammondUnstableHorizontal(state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), SurfNum);
+ tmpHc = CalcAlamdariHammondUnstableHorizontal(state, (Tsurface - Tzone), surfIntConv.zoneHorizHydrDiam, SurfNum);
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_KhalifaEq3WallAwayFromHeat:
+ } break;
+
+ case HcInt::KhalifaEq3WallAwayFromHeat: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcKhalifaEq3WallAwayFromHeat(Tsurf - Tamb); };
} else {
tmpHc = CalcKhalifaEq3WallAwayFromHeat((Tsurface - Tzone));
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_KhalifaEq4CeilingAwayFromHeat:
+ } break;
+
+ case HcInt::KhalifaEq4CeilingAwayFromHeat: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcKhalifaEq4CeilingAwayFromHeat(Tsurf - Tamb); };
} else {
tmpHc = CalcKhalifaEq4CeilingAwayFromHeat((Tsurface - Tzone));
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_KhalifaEq5WallNearHeat:
+ } break;
+
+ case HcInt::KhalifaEq5WallNearHeat: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcKhalifaEq5WallsNearHeat(Tsurf - Tamb); };
} else {
tmpHc = CalcKhalifaEq5WallsNearHeat((Tsurface - Tzone));
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_KhalifaEq6NonHeatedWalls:
+ } break;
+
+ case HcInt::KhalifaEq6NonHeatedWalls: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcKhalifaEq6NonHeatedWalls(Tsurf - Tamb); };
} else {
tmpHc = CalcKhalifaEq6NonHeatedWalls((Tsurface - Tzone));
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_KhalifaEq7Ceiling:
+ } break;
+
+ case HcInt::KhalifaEq7Ceiling: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcKhalifaEq7Ceiling(Tsurf - Tamb); };
} else {
tmpHc = CalcKhalifaEq7Ceiling((Tsurface - Tzone));
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_AwbiHattonHeatedFloor:
+ } break;
+
+ case HcInt::AwbiHattonHeatedFloor: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
- Real64 HorizHydrDiam = state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum);
+ Real64 HorizHydrDiam = surfIntConv.zoneHorizHydrDiam;
HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double {
return CalcAwbiHattonHeatedFloor(Tsurf - Tamb, HorizHydrDiam);
};
} else {
- tmpHc = CalcAwbiHattonHeatedFloor((Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum));
+ tmpHc = CalcAwbiHattonHeatedFloor((Tsurface - Tzone), surfIntConv.zoneHorizHydrDiam);
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_AwbiHattonHeatedWall:
+ } break;
+
+ case HcInt::AwbiHattonHeatedWall: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
- Real64 HorizHydrDiam = state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum);
+ Real64 HorizHydrDiam = surfIntConv.zoneHorizHydrDiam;
HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcAwbiHattonHeatedWall(Tsurf - Tamb, HorizHydrDiam); };
} else {
- tmpHc = CalcAwbiHattonHeatedWall((Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum));
+ tmpHc = CalcAwbiHattonHeatedWall((Tsurface - Tzone), surfIntConv.zoneHorizHydrDiam);
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_BeausoleilMorrisonMixedAssistingWall:
+ } break;
+
+ case HcInt::BeausoleilMorrisonMixedAssistingWall: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
HnFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double {
- return CalcBeausoleilMorrisonMixedAssistedWall(Tsurf - Tamb,
- state.dataSurface->SurfIntConvZoneWallHeight(SurfNum),
- Tsurf,
- CalcZoneSupplyAirTemp(state, ZoneNum),
- CalcZoneSystemACH(state, ZoneNum));
+ return CalcBeausoleilMorrisonMixedAssistedWall(
+ Tsurf - Tamb, surfIntConv.zoneWallHeight, Tsurf, CalcZoneSupplyAirTemp(state, ZoneNum), CalcZoneSystemACH(state, ZoneNum));
};
} else {
- tmpHc = CalcBeausoleilMorrisonMixedAssistedWall(
- state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneWallHeight(SurfNum), Tsurface, ZoneNum);
+ tmpHc = CalcBeausoleilMorrisonMixedAssistedWall(state, (Tsurface - Tzone), surfIntConv.zoneWallHeight, Tsurface, ZoneNum);
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_BeausoleilMorrisonMixedOppossingWall:
+ } break;
+
+ case HcInt::BeausoleilMorrisonMixedOppossingWall: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
HnFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double {
- return CalcBeausoleilMorrisonMixedOpposingWall(Tsurf - Tamb,
- state.dataSurface->SurfIntConvZoneWallHeight(SurfNum),
- Tsurf,
- CalcZoneSupplyAirTemp(state, ZoneNum),
- CalcZoneSystemACH(state, ZoneNum));
+ return CalcBeausoleilMorrisonMixedOpposingWall(
+ Tsurf - Tamb, surfIntConv.zoneWallHeight, Tsurf, CalcZoneSupplyAirTemp(state, ZoneNum), CalcZoneSystemACH(state, ZoneNum));
};
} else {
- tmpHc = CalcBeausoleilMorrisonMixedOpposingWall(
- state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneWallHeight(SurfNum), Tsurface, ZoneNum);
+ tmpHc = CalcBeausoleilMorrisonMixedOpposingWall(state, (Tsurface - Tzone), surfIntConv.zoneWallHeight, Tsurface, ZoneNum);
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_BeausoleilMorrisonMixedStableCeiling:
+ } break;
+
+ case HcInt::BeausoleilMorrisonMixedStableCeiling: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
HnFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double {
- return CalcBeausoleilMorrisonMixedStableCeiling(Tsurf - Tamb,
- state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum),
- Tsurf,
- CalcZoneSupplyAirTemp(state, ZoneNum),
- CalcZoneSystemACH(state, ZoneNum));
+ return CalcBeausoleilMorrisonMixedStableCeiling(
+ Tsurf - Tamb, surfIntConv.zoneHorizHydrDiam, Tsurf, CalcZoneSupplyAirTemp(state, ZoneNum), CalcZoneSystemACH(state, ZoneNum));
};
} else {
- tmpHc = CalcBeausoleilMorrisonMixedStableCeiling(
- state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), Tsurface, ZoneNum);
+ tmpHc = CalcBeausoleilMorrisonMixedStableCeiling(state, (Tsurface - Tzone), surfIntConv.zoneHorizHydrDiam, Tsurface, ZoneNum);
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_BeausoleilMorrisonMixedUnstableCeiling:
+ } break;
+
+ case HcInt::BeausoleilMorrisonMixedUnstableCeiling: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
HnFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double {
- return CalcBeausoleilMorrisonMixedUnstableCeiling(Tsurf - Tamb,
- state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum),
- Tsurf,
- CalcZoneSupplyAirTemp(state, ZoneNum),
- CalcZoneSystemACH(state, ZoneNum));
+ return CalcBeausoleilMorrisonMixedUnstableCeiling(
+ Tsurf - Tamb, surfIntConv.zoneHorizHydrDiam, Tsurf, CalcZoneSupplyAirTemp(state, ZoneNum), CalcZoneSystemACH(state, ZoneNum));
};
} else {
- tmpHc = CalcBeausoleilMorrisonMixedUnstableCeiling(
- state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), Tsurface, ZoneNum);
+ tmpHc = CalcBeausoleilMorrisonMixedUnstableCeiling(state, (Tsurface - Tzone), surfIntConv.zoneHorizHydrDiam, Tsurface, ZoneNum);
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_BeausoleilMorrisonMixedStableFloor:
+ } break;
+
+ case HcInt::BeausoleilMorrisonMixedStableFloor: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
HnFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double {
- return CalcBeausoleilMorrisonMixedStableFloor(Tsurf - Tamb,
- state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum),
- Tsurf,
- CalcZoneSupplyAirTemp(state, ZoneNum),
- CalcZoneSystemACH(state, ZoneNum));
+ return CalcBeausoleilMorrisonMixedStableFloor(
+ Tsurf - Tamb, surfIntConv.zoneHorizHydrDiam, Tsurf, CalcZoneSupplyAirTemp(state, ZoneNum), CalcZoneSystemACH(state, ZoneNum));
};
} else {
- tmpHc = CalcBeausoleilMorrisonMixedStableFloor(
- state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), Tsurface, ZoneNum);
+ tmpHc = CalcBeausoleilMorrisonMixedStableFloor(state, (Tsurface - Tzone), surfIntConv.zoneHorizHydrDiam, Tsurface, ZoneNum);
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_BeausoleilMorrisonMixedUnstableFloor:
+ } break;
+
+ case HcInt::BeausoleilMorrisonMixedUnstableFloor: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
HnFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double {
- return CalcBeausoleilMorrisonMixedUnstableFloor(Tsurf - Tamb,
- state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum),
- Tsurf,
- CalcZoneSupplyAirTemp(state, ZoneNum),
- CalcZoneSystemACH(state, ZoneNum));
+ return CalcBeausoleilMorrisonMixedUnstableFloor(
+ Tsurf - Tamb, surfIntConv.zoneHorizHydrDiam, Tsurf, CalcZoneSupplyAirTemp(state, ZoneNum), CalcZoneSystemACH(state, ZoneNum));
};
} else {
- tmpHc = CalcBeausoleilMorrisonMixedUnstableFloor(
- state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), Tsurface, ZoneNum);
+ tmpHc = CalcBeausoleilMorrisonMixedUnstableFloor(state, (Tsurface - Tzone), surfIntConv.zoneHorizHydrDiam, Tsurface, ZoneNum);
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_FohannoPolidoriVerticalWall:
+ } break;
+
+ case HcInt::FohannoPolidoriVerticalWall: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
Real64 QdotConvection = -state.dataHeatBalSurf->SurfQdotConvInPerArea(SurfNum);
- Real64 WallHeight = state.dataSurface->SurfIntConvZoneWallHeight(SurfNum);
+ Real64 WallHeight = surfIntConv.zoneWallHeight;
HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double {
return CalcFohannoPolidoriVerticalWall(Tsurf - Tamb,
WallHeight,
@@ -5171,34 +3447,30 @@ void EvaluateIntHcModels(EnergyPlusData &state,
QdotConvection);
};
} else {
- tmpHc = CallCalcFohannoPolidoriVerticalWall(state,
- (Tsurface - Tzone),
- state.dataSurface->SurfIntConvZoneWallHeight(SurfNum),
- Tsurface,
- -state.dataHeatBalSurf->SurfQdotConvInPerArea(SurfNum),
- SurfNum);
+ tmpHc = CallCalcFohannoPolidoriVerticalWall(
+ state, (Tsurface - Tzone), surfIntConv.zoneWallHeight, Tsurface, -state.dataHeatBalSurf->SurfQdotConvInPerArea(SurfNum), SurfNum);
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_KaradagChilledCeiling:
+ } break;
+
+ case HcInt::KaradagChilledCeiling: {
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcKaradagChilledCeiling(Tsurf - Tamb); };
} else {
tmpHc = CalcKaradagChilledCeiling((Tsurface - Tzone));
}
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_ISO15099Windows:
+ } break;
+
+ case HcInt::ISO15099Windows: {
CalcISO15099WindowIntConvCoeff(state, SurfNum, Tsurface, Tzone);
tmpHc = state.dataHeatBalSurf->SurfHConvInt(SurfNum);
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
- break;
- case ConvectionConstants::HcInt_GoldsteinNovoselacCeilingDiffuserWindow: {
- tmpHc = CalcGoldsteinNovoselacCeilingDiffuserWindow(state,
- state.dataSurface->SurfIntConvZonePerimLength(SurfNum),
- state.dataSurface->SurfIntConvWindowWallRatio(SurfNum),
- state.dataSurface->SurfIntConvWindowLocation(SurfNum),
- ZoneNum);
+ } break;
+
+ case HcInt::GoldsteinNovoselacCeilingDiffuserWindow: {
+ tmpHc = CalcGoldsteinNovoselacCeilingDiffuserWindow(
+ state, surfIntConv.zonePerimLength, surfIntConv.windowWallRatio, surfIntConv.windowLocation, ZoneNum);
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
HnFn = [=](double, double, double, double, double) -> double { return tmpHc; };
}
@@ -5207,11 +3479,10 @@ void EvaluateIntHcModels(EnergyPlusData &state,
} else {
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
}
- break;
- }
- case ConvectionConstants::HcInt_GoldsteinNovoselacCeilingDiffuserWalls: {
- tmpHc = CalcGoldsteinNovoselacCeilingDiffuserWall(
- state, state.dataSurface->SurfIntConvZonePerimLength(SurfNum), state.dataSurface->SurfIntConvWindowLocation(SurfNum), ZoneNum);
+ } break;
+
+ case HcInt::GoldsteinNovoselacCeilingDiffuserWalls: {
+ tmpHc = CalcGoldsteinNovoselacCeilingDiffuserWall(state, surfIntConv.zonePerimLength, surfIntConv.windowLocation, ZoneNum);
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
HnFn = [=](double, double, double, double, double) -> double { return tmpHc; };
}
@@ -5220,10 +3491,10 @@ void EvaluateIntHcModels(EnergyPlusData &state,
} else {
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
}
- break;
- }
- case ConvectionConstants::HcInt_GoldsteinNovoselacCeilingDiffuserFloor: {
- tmpHc = CalcGoldsteinNovoselacCeilingDiffuserFloor(state.dataSurface->SurfIntConvZonePerimLength(SurfNum), ZoneNum);
+ } break;
+
+ case HcInt::GoldsteinNovoselacCeilingDiffuserFloor: {
+ tmpHc = CalcGoldsteinNovoselacCeilingDiffuserFloor(surfIntConv.zonePerimLength, ZoneNum);
if (thisSurface.ExtBoundCond == DataSurfaces::KivaFoundation) {
HnFn = [=](double, double, double, double, double) -> double { return tmpHc; };
}
@@ -5232,18 +3503,20 @@ void EvaluateIntHcModels(EnergyPlusData &state,
} else {
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
}
- break;
- }
- }
+ } break;
+ default: {
+ assert(false);
+ } break;
+ } // switch (ConvModelEqNum)
state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)];
- if (tmpHc < ConvectionConstants::AdaptiveHcInsideLowLimit) tmpHc = ConvectionConstants::AdaptiveHcInsideLowLimit;
+ if (tmpHc < AdaptiveHcIntLowLimit) tmpHc = AdaptiveHcIntLowLimit;
- Hc = tmpHc;
+ return tmpHc;
}
-void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const NaturalConvModelEqNum, int const ForcedConvModelEqNum, Real64 &Hc)
+Real64 EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, HcExt const NaturalConvModelEqNum, HcExt const ForcedConvModelEqNum)
{
// SUBROUTINE INFORMATION:
@@ -5253,9 +3526,6 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat
// PURPOSE OF THIS SUBROUTINE:
// central case statement for evaluating exterior specific convection models
- // METHODOLOGY EMPLOYED:
- // separated out long case statement for selecting models.
-
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
Real64 Hf(0.0); // the forced, or wind driven portion of film coefficient
Real64 Hn(0.0); // the natural, or buoyancy driven portion of film coefficient
@@ -5269,77 +3539,88 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat
Kiva::ConvectionAlgorithm HnFn(KIVA_CONST_CONV(0.0));
auto const &surface = state.dataSurface->Surface(SurfNum);
+ auto const &surfExtConv = state.dataSurface->surfExtConv(SurfNum);
auto const &SurfQdotConvOutRepPerArea = state.dataHeatBalSurf->SurfQdotConvOutPerArea;
Real64 SurfOutTemp = state.dataHeatBalSurf->SurfOutsideTempHist(1)(SurfNum);
// first call Hn models
switch (NaturalConvModelEqNum) {
- case ConvectionConstants::HcExt_None:
+ case HcExt::None: {
Hn = 0.0;
HnFn = KIVA_CONST_CONV(0.0);
- break;
- case ConvectionConstants::HcExt_UserCurve:
- CalcUserDefinedOutsideHcModel(state, SurfNum, state.dataSurface->SurfOutConvHnUserCurveIndex(SurfNum), Hn);
+ } break;
+
+ case HcExt::UserCurve: {
+ Hn = CalcUserDefinedExtHcModel(state, SurfNum, surfExtConv.hnUserCurveNum);
if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
HnFn = [=, &state](double Tsurf, double Tamb, double HfTerm, double Roughness, double CosTilt) -> double {
// Remove Hfterm since this is only used for the natural convection portion
return state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].out(Tsurf, Tamb, HfTerm, Roughness, CosTilt) - HfTerm;
};
}
- break;
- case ConvectionConstants::HcExt_NaturalASHRAEVerticalWall:
+ } break;
+
+ case HcExt::NaturalASHRAEVerticalWall: {
Hn = CalcASHRAEVerticalWall((SurfOutTemp - state.dataSurface->SurfOutDryBulbTemp(SurfNum)));
HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcASHRAEVerticalWall(Tsurf - Tamb); };
- break;
- case ConvectionConstants::HcExt_NaturalWaltonUnstableHorizontalOrTilt:
+ } break;
+
+ case HcExt::NaturalWaltonUnstableHorizontalOrTilt: {
Hn = CalcWaltonUnstableHorizontalOrTilt((SurfOutTemp - state.dataSurface->SurfOutDryBulbTemp(SurfNum)),
surface.CosTilt); // TODO verify CosTilt in vs out
HnFn = [=](double Tsurf, double Tamb, double, double, double cosTilt) -> double {
return CalcWaltonUnstableHorizontalOrTilt(Tsurf - Tamb, cosTilt);
};
- break;
- case ConvectionConstants::HcExt_NaturalWaltonStableHorizontalOrTilt:
+ } break;
+
+ case HcExt::NaturalWaltonStableHorizontalOrTilt: {
Hn = CalcWaltonStableHorizontalOrTilt((SurfOutTemp - state.dataSurface->SurfOutDryBulbTemp(SurfNum)),
surface.CosTilt); // TODO verify CosTilt in vs out
HnFn = [=](double Tsurf, double Tamb, double, double, double cosTilt) -> double {
return CalcWaltonStableHorizontalOrTilt(Tsurf - Tamb, cosTilt);
};
- break;
- case ConvectionConstants::HcExt_AlamdariHammondVerticalWall: {
- Real64 FaceHeight = state.dataSurface->SurfOutConvFaceHeight(SurfNum);
+ } break;
+
+ case HcExt::AlamdariHammondVerticalWall: {
+ Real64 FaceHeight = surfExtConv.faceHeight;
Hn = CalcAlamdariHammondVerticalWall(state, (SurfOutTemp - state.dataSurface->SurfOutDryBulbTemp(SurfNum)), FaceHeight, SurfNum);
HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcAlamdariHammondVerticalWall(Tsurf - Tamb, FaceHeight); };
- break;
- }
- case ConvectionConstants::HcExt_FohannoPolidoriVerticalWall:
+ } break;
+
+ case HcExt::FohannoPolidoriVerticalWall: {
if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
// Not compatible with Kiva (Exterior surfaces in Kiva are not currently reported. Also need to add cell-level convection.)
ShowFatalError(state, format("Fohanno Polidori convection model not applicable for foundation surface ={}", surface.Name));
}
Hn = CallCalcFohannoPolidoriVerticalWall(state,
(SurfOutTemp - state.dataSurface->SurfOutDryBulbTemp(SurfNum)),
- state.dataSurface->SurfOutConvFaceHeight(SurfNum),
+ surfExtConv.faceHeight,
SurfOutTemp,
-SurfQdotConvOutRepPerArea(SurfNum),
SurfNum);
- break;
- case ConvectionConstants::HcExt_AlamdariHammondStableHorizontal:
- if (state.dataSurface->SurfOutConvFacePerimeter(SurfNum) > 0.0) {
- HydraulicDiameter = 4.0 * state.dataSurface->SurfOutConvFaceArea(SurfNum) / state.dataSurface->SurfOutConvFacePerimeter(SurfNum);
+ } break;
+
+ case HcExt::AlamdariHammondStableHorizontal: {
+ if (surfExtConv.facePerimeter > 0.0) {
+ HydraulicDiameter = 4.0 * surfExtConv.faceArea / surfExtConv.facePerimeter;
} else {
- HydraulicDiameter = std::sqrt(state.dataSurface->SurfOutConvFaceArea(SurfNum));
+ HydraulicDiameter = std::sqrt(surfExtConv.faceArea);
}
Hn = CalcAlamdariHammondStableHorizontal(state, (SurfOutTemp - state.dataSurface->SurfOutDryBulbTemp(SurfNum)), HydraulicDiameter, SurfNum);
- break;
- case ConvectionConstants::HcExt_AlamdariHammondUnstableHorizontal:
- if (state.dataSurface->SurfOutConvFacePerimeter(SurfNum) > 0.0) {
- HydraulicDiameter = 4.0 * state.dataSurface->SurfOutConvFaceArea(SurfNum) / state.dataSurface->SurfOutConvFacePerimeter(SurfNum);
+ } break;
+
+ case HcExt::AlamdariHammondUnstableHorizontal: {
+ if (surfExtConv.facePerimeter > 0.0) {
+ HydraulicDiameter = 4.0 * surfExtConv.faceArea / surfExtConv.facePerimeter;
} else {
- HydraulicDiameter = std::sqrt(state.dataSurface->SurfOutConvFaceArea(SurfNum));
+ HydraulicDiameter = std::sqrt(surfExtConv.faceArea);
}
Hn = CalcAlamdariHammondUnstableHorizontal(state, (SurfOutTemp - state.dataSurface->SurfOutDryBulbTemp(SurfNum)), HydraulicDiameter, SurfNum);
- break;
+ } break;
+ default: {
+ assert(false);
}
+ } // switch (NaturalConvModelEqNum)
if (!surface.ExtWind) {
SurfWindSpeed = 0.0; // No wind exposure
@@ -5353,25 +3634,22 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat
state.dataMaterial->Material(state.dataConstruction->Construct(surface.Construction).LayerPoint(1))->Roughness;
switch (ForcedConvModelEqNum) {
- case ConvectionConstants::HcExt_None:
+ case HcExt::None: {
Hf = 0.0;
HfTermFn = KIVA_HF_DEF;
HfFn = KIVA_CONST_CONV(0.0);
- break;
- case ConvectionConstants::HcExt_UserCurve:
- CalcUserDefinedOutsideHcModel(state, SurfNum, state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum), Hf);
+ } break;
+
+ case HcExt::UserCurve: {
+ Hf = CalcUserDefinedExtHcModel(state, SurfNum, surfExtConv.hfUserCurveNum);
if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
HfTermFn = state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f;
HnFn = state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].out;
}
- break;
- case ConvectionConstants::HcExt_SparrowWindward:
- Hf = CalcSparrowWindward(state,
- Roughness,
- state.dataSurface->SurfOutConvFacePerimeter(SurfNum),
- state.dataSurface->SurfOutConvFaceArea(SurfNum),
- SurfWindSpeed,
- SurfNum);
+ } break;
+
+ case HcExt::SparrowWindward: {
+ Hf = CalcSparrowWindward(state, Roughness, surfExtConv.facePerimeter, surfExtConv.faceArea, SurfWindSpeed, SurfNum);
if (surface.Class == SurfaceClass::Floor) { // used for exterior grade
// Assume very large area for grade (relative to perimeter).
@@ -5394,14 +3672,10 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat
}
}
HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; };
- break;
- case ConvectionConstants::HcExt_SparrowLeeward:
- Hf = CalcSparrowLeeward(state,
- Roughness,
- state.dataSurface->SurfOutConvFacePerimeter(SurfNum),
- state.dataSurface->SurfOutConvFaceArea(SurfNum),
- SurfWindSpeed,
- SurfNum);
+ } break;
+
+ case HcExt::SparrowLeeward: {
+ Hf = CalcSparrowLeeward(state, Roughness, surfExtConv.facePerimeter, surfExtConv.faceArea, SurfWindSpeed, SurfNum);
if (surface.Class == SurfaceClass::Floor) { // used for exterior grade
// Assume very large area for grade (relative to perimeter).
constexpr double area = 9999999.;
@@ -5423,8 +3697,9 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat
}
}
HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; };
- break;
- case ConvectionConstants::HcExt_MoWiTTWindward:
+ } break;
+
+ case HcExt::MoWiTTWindward: {
Hf = CalcMoWITTWindward(SurfOutTemp - state.dataSurface->SurfOutDryBulbTemp(SurfNum), SurfWindSpeed);
if (surface.Class == SurfaceClass::Floor) { // used for exterior grade
HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcMoWITTForcedWindward(windSpeed); };
@@ -5437,8 +3712,9 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat
};
}
HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; };
- break;
- case ConvectionConstants::HcExt_MoWiTTLeeward:
+ } break;
+
+ case HcExt::MoWiTTLeeward: {
Hf = CalcMoWITTLeeward((SurfOutTemp - state.dataSurface->SurfOutDryBulbTemp(SurfNum)), SurfWindSpeed);
if (surface.Class == SurfaceClass::Floor) { // used for exterior grade
HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcMoWITTForcedLeeward(windSpeed); };
@@ -5451,8 +3727,9 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat
};
}
HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; };
- break;
- case ConvectionConstants::HcExt_DOE2Windward:
+ } break;
+
+ case HcExt::DOE2Windward: {
Hf = CalcDOE2Windward(SurfOutTemp, state.dataSurface->SurfOutDryBulbTemp(SurfNum), surface.CosTilt, SurfWindSpeed, Roughness);
if (surface.Class == SurfaceClass::Floor) { // used for exterior grade
HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcMoWITTForcedWindward(windSpeed); };
@@ -5465,8 +3742,9 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat
};
}
HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; };
- break;
- case ConvectionConstants::HcExt_DOE2Leeward:
+ } break;
+
+ case HcExt::DOE2Leeward: {
Hf = CalcDOE2Leeward(SurfOutTemp, state.dataSurface->SurfOutDryBulbTemp(SurfNum), surface.CosTilt, SurfWindSpeed, Roughness);
if (surface.Class == SurfaceClass::Floor) { // used for exterior grade
HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcMoWITTForcedWindward(windSpeed); };
@@ -5481,25 +3759,29 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat
HfFn = [=](double Tsurf, double Tamb, double hfTerm, double, double cosTilt) -> double {
return CalcDOE2Forced(Tsurf, Tamb, cosTilt, hfTerm, Roughness);
};
- break;
- case ConvectionConstants::HcExt_NusseltJurges:
+ } break;
+
+ case HcExt::NusseltJurges: {
Hf = CalcNusseltJurges(SurfWindSpeed);
HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcNusseltJurges(windSpeed); };
HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; };
- break;
- case ConvectionConstants::HcExt_McAdams:
+ } break;
+
+ case HcExt::McAdams: {
Hf = CalcMcAdams(SurfWindSpeed);
HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcMcAdams(windSpeed); };
HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; };
- break;
- case ConvectionConstants::HcExt_Mitchell:
- Hf = CalcMitchell(state, SurfWindSpeed, state.dataConvectionCoefficient->CubeRootOfOverallBuildingVolume, SurfNum);
+ } break;
+
+ case HcExt::Mitchell: {
+ Hf = CalcMitchell(state, SurfWindSpeed, state.dataConvect->CubeRootOfOverallBuildingVolume, SurfNum);
HfTermFn = [&](double, double, double, double windSpeed) -> double {
- return CalcMitchell(windSpeed, state.dataConvectionCoefficient->CubeRootOfOverallBuildingVolume);
+ return CalcMitchell(windSpeed, state.dataConvect->CubeRootOfOverallBuildingVolume);
};
HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; };
- break;
- case ConvectionConstants::HcExt_ClearRoof:
+ } break;
+
+ case HcExt::ClearRoof: {
SurfWindDir = state.dataSurface->SurfOutWindDir(SurfNum);
Hf = CalcClearRoof(state,
SurfNum,
@@ -5507,8 +3789,8 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat
state.dataSurface->SurfOutDryBulbTemp(SurfNum),
SurfWindSpeed,
SurfWindDir,
- state.dataSurface->SurfOutConvFaceArea(SurfNum),
- state.dataSurface->SurfOutConvFacePerimeter(SurfNum));
+ surfExtConv.faceArea,
+ surfExtConv.facePerimeter);
HfTermFn = [=](double, double, double, double windSpeed) -> double { return windSpeed; };
if (surface.Class == SurfaceClass::Floor) { // used for exterior grade
// Assume very large area for grade (relative to perimeter).
@@ -5529,44 +3811,53 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat
};
}
}
- break;
- case ConvectionConstants::HcExt_BlockenWindward:
+ } break;
+
+ case HcExt::BlockenWindward: {
Hf = CalcBlockenWindward(state, state.dataEnvrn->WindSpeed, state.dataEnvrn->WindDir, surface.Azimuth, SurfNum);
// Not compatible with Kiva (doesn't use weather station windspeed)
if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
ShowFatalError(state, format("Blocken Windward convection model not applicable for foundation surface ={}", surface.Name));
}
- break;
- case ConvectionConstants::HcExt_EmmelVertical:
+ } break;
+
+ case HcExt::EmmelVertical: {
Hf = CalcEmmelVertical(state.dataEnvrn->WindSpeed, state.dataEnvrn->WindDir, surface.Azimuth);
// Not compatible with Kiva (doesn't use weather station windspeed)
if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
ShowFatalError(state, format("Emmel Vertical convection model not applicable for foundation surface ={}", surface.Name));
}
- break;
- case ConvectionConstants::HcExt_EmmelRoof:
- Hf = CalcEmmelRoof(state.dataEnvrn->WindSpeed, state.dataEnvrn->WindDir, state.dataConvectionCoefficient->RoofLongAxisOutwardAzimuth);
+ } break;
+
+ case HcExt::EmmelRoof: {
+ Hf = CalcEmmelRoof(state.dataEnvrn->WindSpeed, state.dataEnvrn->WindDir, state.dataConvect->RoofLongAxisOutwardAzimuth);
// Not compatible with Kiva (doesn't use weather station windspeed)
if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
ShowFatalError(state, format("Emmel Roof convection model not applicable for foundation surface ={}", surface.Name));
}
break;
+ } break;
+
+ default: {
+ assert(false);
}
+ } // swtich (ForcedConvModelEqNum)
- Hc = Hf + Hn;
+ Real64 Hc = Hf + Hn;
if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = HfTermFn;
state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].out =
[=](double Tsurf, double Tamb, double HfTerm, double Roughness, double cosTilt) -> double {
- Real64 HcExt = HfFn(Tsurf, Tamb, HfTerm, Roughness, cosTilt) + HnFn(Tsurf, Tamb, HfTerm, Roughness, cosTilt);
- if (HcExt < ConvectionConstants::AdaptiveHcOutsideLowLimit) HcExt = ConvectionConstants::AdaptiveHcOutsideLowLimit;
- return HcExt;
+ Real64 hcExt = HfFn(Tsurf, Tamb, HfTerm, Roughness, cosTilt) + HnFn(Tsurf, Tamb, HfTerm, Roughness, cosTilt);
+ if (hcExt < AdaptiveHcExtLowLimit) hcExt = AdaptiveHcExtLowLimit;
+ return hcExt;
};
Hc = 0.0; // Not used in Kiva
}
- if (Hc < ConvectionConstants::AdaptiveHcOutsideLowLimit) Hc = ConvectionConstants::AdaptiveHcOutsideLowLimit;
+ if (Hc < AdaptiveHcExtLowLimit) Hc = AdaptiveHcExtLowLimit;
+ return Hc;
}
void DynamicExtConvSurfaceClassification(EnergyPlusData &state, int const SurfNum) // surface number
@@ -5579,104 +3870,71 @@ void DynamicExtConvSurfaceClassification(EnergyPlusData &state, int const SurfNu
// METHODOLOGY EMPLOYED:
// Decide surface classification based on wind and buoyancy, class, orientation
- // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
- Real64 DeltaTemp(0.0);
- Real64 surfWindDir;
-
auto const &surface = state.dataSurface->Surface(SurfNum);
+ auto &surfExtConv = state.dataSurface->surfExtConv(SurfNum);
- surfWindDir = state.dataSurface->SurfOutWindDir(SurfNum);
+ Real64 surfWindDir = state.dataSurface->SurfOutWindDir(SurfNum);
if (surface.Class == SurfaceClass::Roof ||
(surface.Class == SurfaceClass::Floor && surface.ExtBoundCond == DataSurfaces::KivaFoundation) // Applies to exterior grade
) {
- if (surface.ExtBoundCond == DataSurfaces::KivaFoundation) {
- DeltaTemp = state.dataSurfaceGeometry->kivaManager.surfaceMap[SurfNum].results.Tconv - state.dataSurface->SurfOutDryBulbTemp(SurfNum);
- } else {
- DeltaTemp = state.dataHeatBalSurf->SurfOutsideTempHist(1)(SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum);
- }
-
- if (DeltaTemp < 0.0) {
- state.dataSurface->SurfOutConvClassification(SurfNum) = ConvectionConstants::OutConvClass::RoofStable;
- } else {
- state.dataSurface->SurfOutConvClassification(SurfNum) = ConvectionConstants::OutConvClass::RoofUnstable;
- }
+ Real64 DeltaTemp =
+ (surface.ExtBoundCond == DataSurfaces::KivaFoundation)
+ ? (state.dataSurfaceGeometry->kivaManager.surfaceMap[SurfNum].results.Tconv - state.dataSurface->SurfOutDryBulbTemp(SurfNum))
+ : (state.dataHeatBalSurf->SurfOutsideTempHist(1)(SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum));
- } else {
+ surfExtConv.convClass = (DeltaTemp < 0.0) ? ExtConvClass::RoofStable : ExtConvClass::RoofUnstable;
- if (Windward(surface.CosTilt, surface.Azimuth, surfWindDir)) {
- state.dataSurface->SurfOutConvClassification(SurfNum) = ConvectionConstants::OutConvClass::WindwardVertWall;
- } else {
- state.dataSurface->SurfOutConvClassification(SurfNum) = ConvectionConstants::OutConvClass::LeewardVertWall;
- }
+ } else {
+ surfExtConv.convClass =
+ Windward(surface.CosTilt, surface.Azimuth, surfWindDir) ? ExtConvClass::WindwardVertWall : ExtConvClass::LeewardVertWall;
}
}
-void MapExtConvClassificationToHcModels(EnergyPlusData &state, int const SurfNum) // surface number
+void MapExtConvClassToHcModels(EnergyPlusData &state, int const SurfNum) // surface number
{
// SUBROUTINE INFORMATION:
// AUTHOR Brent Griffith
// DATE WRITTEN Aug 2010
- switch (state.dataSurface->SurfOutConvClassification(SurfNum)) {
- case ConvectionConstants::OutConvClass::WindwardVertWall:
- state.dataSurface->SurfOutConvHfModelEq(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindWallWindwardEqNum;
- if (state.dataSurface->SurfOutConvHfModelEq(SurfNum) == ConvectionConstants::HcExt_UserCurve) {
- state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindWallWindwardUserCurveNum;
- }
- state.dataSurface->SurfOutConvHnModelEq(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatVertWallEqNum;
- if (state.dataSurface->SurfOutConvHnModelEq(SurfNum) == ConvectionConstants::HcExt_UserCurve) {
- state.dataSurface->SurfOutConvHnUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatVertWallUserCurveNum;
- }
- break;
- case ConvectionConstants::OutConvClass::LeewardVertWall:
- state.dataSurface->SurfOutConvHfModelEq(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindWallLeewardEqNum;
- if (state.dataSurface->SurfOutConvHfModelEq(SurfNum) == ConvectionConstants::HcExt_UserCurve) {
- state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindWallLeewardUserCurveNum;
- }
- state.dataSurface->SurfOutConvHnModelEq(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatVertWallEqNum;
- if (state.dataSurface->SurfOutConvHnModelEq(SurfNum) == ConvectionConstants::HcExt_UserCurve) {
- state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatVertWallUserCurveNum;
- }
- break;
- case ConvectionConstants::OutConvClass::RoofStable:
- state.dataSurface->SurfOutConvHfModelEq(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindHorizRoofEqNum;
- if (state.dataSurface->SurfOutConvHfModelEq(SurfNum) == ConvectionConstants::HcExt_UserCurve) {
- state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindHorizRoofUserCurveNum;
- }
- state.dataSurface->SurfOutConvHnModelEq(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatStableHorizEqNum;
- if (state.dataSurface->SurfOutConvHnModelEq(SurfNum) == ConvectionConstants::HcExt_UserCurve) {
- state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatStableHorizUserCurveNum;
- }
- break;
- case ConvectionConstants::OutConvClass::RoofUnstable:
- state.dataSurface->SurfOutConvHfModelEq(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindHorizRoofEqNum;
- if (state.dataSurface->SurfOutConvHfModelEq(SurfNum) == ConvectionConstants::HcExt_UserCurve) {
- state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindHorizRoofUserCurveNum;
- }
- state.dataSurface->SurfOutConvHnModelEq(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatUnstableHorizEqNum;
- if (state.dataSurface->SurfOutConvHnModelEq(SurfNum) == ConvectionConstants::HcExt_UserCurve) {
- state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatUnstableHorizUserCurveNum;
- }
- break;
- default:
- ShowSevereError(state,
- format("MapExtConvClassificationToHcModels: caught unknown outdoor surface classification: {}",
- state.dataSurface->SurfOutConvClassification(SurfNum)));
+ // Use these arrays to convert general surface classifications to
+ // specific classifications for both wind-driven and natural
+ // convection
+ static constexpr std::array WindConvectionExtConvClass2s = {
+ ExtConvClass2::WindConvection_WallWindward, // WindwardWall
+ ExtConvClass2::WindConvection_WallLeeward, // LeewardWall
+ ExtConvClass2::WindConvection_HorizRoof, // RoofStable
+ ExtConvClass2::WindConvection_HorizRoof // RoofUnstable
+ };
+
+ static constexpr std::array NaturalConvectionExtConvClass2s = {
+ ExtConvClass2::NaturalConvection_VertWall, // WindwardWall
+ ExtConvClass2::NaturalConvection_VertWall, // LeewardWall
+ ExtConvClass2::NaturalConvection_StableHoriz, // RoofStable
+ ExtConvClass2::NaturalConvection_UnstableHoriz // RoofUnstable
+ };
+
+ auto &surfExtConv = state.dataSurface->surfExtConv(SurfNum);
+
+ ExtConvClass outConvClass = surfExtConv.convClass;
+ surfExtConv.convClassRpt = ExtConvClassReportVals[(int)outConvClass];
+
+ ExtConvClass2 outConvClass2Wind = WindConvectionExtConvClass2s[(int)outConvClass];
+ ExtConvClass2 outConvClass2Natural = NaturalConvectionExtConvClass2s[(int)outConvClass];
+
+ surfExtConv.hfModelEq = state.dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)outConvClass2Wind];
+ surfExtConv.hfModelEqRpt = HcExtReportVals[(int)surfExtConv.hfModelEq];
+
+ if (surfExtConv.hfModelEq == HcExt::UserCurve) {
+ surfExtConv.hfUserCurveNum = state.dataConvect->extAdaptiveConvAlgo.extConvClass2UserCurveNums[(int)outConvClass2Wind];
}
- // Set report var after surface has been classified
- state.dataSurface->SurfOutConvClassificationRpt(SurfNum) =
- ConvectionConstants::OutConvClassReportVals[static_cast(state.dataSurface->SurfOutConvClassification(SurfNum))];
+ surfExtConv.hnModelEq = state.dataConvect->extAdaptiveConvAlgo.extConvClass2EqNums[(int)outConvClass2Natural];
+ surfExtConv.hnModelEqRpt = HcExtReportVals[(int)surfExtConv.hnModelEq];
+ if (surfExtConv.hnModelEq == HcExt::UserCurve) {
+ surfExtConv.hnUserCurveNum = state.dataConvect->extAdaptiveConvAlgo.extConvClass2UserCurveNums[(int)outConvClass2Natural];
+ }
}
void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNum) // surface number
@@ -5700,7 +3958,6 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu
Real64 constexpr ActiveDelTempThreshold(1.5); // deg C, temperature difference for surfaces to be considered "active"
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
- int ZoneNum(0);
int PriorityEquipOn(0);
constexpr int MaxZoneEquipmentOn{11};
constexpr int MaxZoneEquipmentIdx{MaxZoneEquipmentOn - 1};
@@ -5708,10 +3965,7 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu
std::array CoolingPriorityStack{};
std::array FlowRegimeStack{};
FlowRegimeStack.fill(InConvFlowRegime::Invalid);
- int EquipNum(0);
- int ZoneNode(0);
int EquipOnCount(0);
- int thisZoneInletNode(0);
InConvFlowRegime FinalFlowRegime(InConvFlowRegime::Invalid);
Real64 Tmin(std::numeric_limits::max()); // temporary min surf temp
Real64 Tmax(std::numeric_limits::min()); // temporary max surf temp
@@ -5721,225 +3975,172 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu
Real64 AirDensity(0.0); // temporary zone air density
Real64 DeltaTemp(0.0); // temporary temperature difference (Tsurf - Tair)
- auto &Zone(state.dataHeatBal->Zone);
- auto &Surface(state.dataSurface->Surface);
+ auto &surface = state.dataSurface->Surface(SurfNum);
+ int zoneNum = surface.Zone;
+ auto &zone = state.dataHeatBal->Zone(zoneNum);
EquipOnCount = 0;
- ZoneNum = Surface(SurfNum).Zone;
- ZoneNode = Zone(ZoneNum).SystemZoneNodeNumber;
// HVAC connections
- if (!Zone(ZoneNum).IsControlled) { // no HVAC control
+ if (!zone.IsControlled) { // no HVAC control
FlowRegimeStack[0] = InConvFlowRegime::A3;
} else { // is controlled, lets see by how and if that means is currently active
- if (!(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex > 0) || state.dataGlobal->SysSizingCalc ||
- state.dataGlobal->ZoneSizingCalc || !state.dataZoneEquip->ZoneEquipSimulatedOnce) {
+ auto &zoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(surface.Zone);
+ auto &zoneNode = state.dataLoopNodes->Node(zone.SystemZoneNodeNumber);
+
+ if (!(zoneEquipConfig.EquipListIndex > 0) || state.dataGlobal->SysSizingCalc || state.dataGlobal->ZoneSizingCalc ||
+ !state.dataZoneEquip->ZoneEquipSimulatedOnce) {
FlowRegimeStack[0] = InConvFlowRegime::A3;
} else {
- for (EquipNum = 1;
- EquipNum <= state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex).NumOfEquipTypes;
- ++EquipNum) {
-
- switch (state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex).EquipTypeEnum(EquipNum)) {
- case DataZoneEquipment::ZoneEquip::AirDistUnit:
- case DataZoneEquipment::ZoneEquip::PurchasedAir:
- if (!(allocated(state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .EquipData(EquipNum)
- .OutletNodeNums)))
- continue;
+ auto &zoneEquipList = state.dataZoneEquip->ZoneEquipList(zoneEquipConfig.EquipListIndex);
+ for (int EquipNum = 1; EquipNum <= zoneEquipList.NumOfEquipTypes; ++EquipNum) {
+
+ switch (zoneEquipList.EquipType(EquipNum)) {
+ case DataZoneEquipment::ZoneEquipType::AirDistributionUnit:
+ case DataZoneEquipment::ZoneEquipType::PurchasedAir: {
+ if (!allocated(zoneEquipList.EquipData(EquipNum).OutletNodeNums)) continue;
+
// get inlet node, not zone node if possible
- thisZoneInletNode = state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .EquipData(EquipNum)
- .OutletNodeNums(1);
- if (thisZoneInletNode > 0) {
- if (state.dataLoopNodes->Node(thisZoneInletNode).MassFlowRate > 0.0) {
- EquipOnCount = min(EquipOnCount + 1, MaxZoneEquipmentIdx);
- FlowRegimeStack[EquipOnCount] = InConvFlowRegime::C;
- HeatingPriorityStack[EquipOnCount] =
- state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .HeatingPriority(EquipNum);
- CoolingPriorityStack[EquipOnCount] =
- state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .CoolingPriority(EquipNum);
- }
- } else {
- if (state.dataLoopNodes->Node(ZoneNode).MassFlowRate > 0.0) {
- EquipOnCount = min(EquipOnCount + 1, MaxZoneEquipmentIdx);
- FlowRegimeStack[EquipOnCount] = InConvFlowRegime::C;
- HeatingPriorityStack[EquipOnCount] =
- state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .HeatingPriority(EquipNum);
- CoolingPriorityStack[EquipOnCount] =
- state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .CoolingPriority(EquipNum);
- }
+ int zoneInletNodeNum = zoneEquipList.EquipData(EquipNum).OutletNodeNums(1);
+ if ((zoneInletNodeNum > 0 && state.dataLoopNodes->Node(zoneInletNodeNum).MassFlowRate > 0.0) ||
+ (zoneInletNodeNum <= 0 && zoneNode.MassFlowRate > 0.0)) {
+ EquipOnCount = min(EquipOnCount + 1, MaxZoneEquipmentIdx);
+ FlowRegimeStack[EquipOnCount] = InConvFlowRegime::C;
+ HeatingPriorityStack[EquipOnCount] = zoneEquipList.HeatingPriority(EquipNum);
+ CoolingPriorityStack[EquipOnCount] = zoneEquipList.CoolingPriority(EquipNum);
}
- break;
- case DataZoneEquipment::ZoneEquip::WindowAC:
- case DataZoneEquipment::ZoneEquip::PkgTermHPAirToAir:
- case DataZoneEquipment::ZoneEquip::PkgTermACAirToAir:
- case DataZoneEquipment::ZoneEquip::ZoneDXDehumidifier:
- case DataZoneEquipment::ZoneEquip::PkgTermHPWaterToAir:
- case DataZoneEquipment::ZoneEquip::FanCoil4Pipe:
- case DataZoneEquipment::ZoneEquip::UnitVentilator:
- case DataZoneEquipment::ZoneEquip::UnitHeater:
- case DataZoneEquipment::ZoneEquip::OutdoorAirUnit:
- if (!(allocated(state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .EquipData(EquipNum)
- .OutletNodeNums)))
- continue;
- thisZoneInletNode = state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .EquipData(EquipNum)
- .OutletNodeNums(1);
- if (thisZoneInletNode > 0) {
- if (state.dataLoopNodes->Node(thisZoneInletNode).MassFlowRate > 0.0) {
- EquipOnCount = min(EquipOnCount + 1, MaxZoneEquipmentIdx);
- FlowRegimeStack[EquipOnCount] = InConvFlowRegime::D;
- HeatingPriorityStack[EquipOnCount] =
- state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .HeatingPriority(EquipNum);
- CoolingPriorityStack[EquipOnCount] =
- state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .CoolingPriority(EquipNum);
- }
- } else {
- if (state.dataLoopNodes->Node(ZoneNode).MassFlowRate > 0.0) {
- EquipOnCount = min(EquipOnCount + 1, MaxZoneEquipmentIdx);
- FlowRegimeStack[EquipOnCount] = InConvFlowRegime::D;
- HeatingPriorityStack[EquipOnCount] =
- state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .HeatingPriority(EquipNum);
- CoolingPriorityStack[EquipOnCount] =
- state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .CoolingPriority(EquipNum);
- }
+ } break;
+ case DataZoneEquipment::ZoneEquipType::WindowAirConditioner:
+ case DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPump:
+ case DataZoneEquipment::ZoneEquipType::PackagedTerminalAirConditioner:
+ case DataZoneEquipment::ZoneEquipType::DehumidifierDX:
+ case DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPumpWaterToAir:
+ case DataZoneEquipment::ZoneEquipType::FourPipeFanCoil:
+ case DataZoneEquipment::ZoneEquipType::UnitVentilator:
+ case DataZoneEquipment::ZoneEquipType::UnitHeater:
+ case DataZoneEquipment::ZoneEquipType::OutdoorAirUnit: {
+ if (!allocated(zoneEquipList.EquipData(EquipNum).OutletNodeNums)) continue;
+
+ int zoneInletNodeNum = zoneEquipList.EquipData(EquipNum).OutletNodeNums(1);
+ if ((zoneInletNodeNum > 0 && state.dataLoopNodes->Node(zoneInletNodeNum).MassFlowRate > 0.0) ||
+ (zoneInletNodeNum <= 0 && zoneNode.MassFlowRate > 0.0)) {
+
+ EquipOnCount = min(EquipOnCount + 1, MaxZoneEquipmentIdx);
+ FlowRegimeStack[EquipOnCount] = InConvFlowRegime::D;
+ HeatingPriorityStack[EquipOnCount] = zoneEquipList.HeatingPriority(EquipNum);
+ CoolingPriorityStack[EquipOnCount] = zoneEquipList.CoolingPriority(EquipNum);
}
- break;
- case DataZoneEquipment::ZoneEquip::CoolingPanel:
- case DataZoneEquipment::ZoneEquip::BBSteam:
- case DataZoneEquipment::ZoneEquip::BBWaterConvective:
- case DataZoneEquipment::ZoneEquip::BBElectricConvective:
- case DataZoneEquipment::ZoneEquip::BBWater:
- if (state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex).EquipData(EquipNum).ON) {
+ } break;
+ case DataZoneEquipment::ZoneEquipType::CoolingPanel:
+ case DataZoneEquipment::ZoneEquipType::BaseboardSteam:
+ case DataZoneEquipment::ZoneEquipType::BaseboardConvectiveWater:
+ case DataZoneEquipment::ZoneEquipType::BaseboardConvectiveElectric:
+ case DataZoneEquipment::ZoneEquipType::BaseboardWater: {
+ if (zoneEquipList.EquipData(EquipNum).ON) {
EquipOnCount = min(EquipOnCount + 1, MaxZoneEquipmentIdx);
FlowRegimeStack[EquipOnCount] = InConvFlowRegime::B;
- HeatingPriorityStack[EquipOnCount] =
- state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .HeatingPriority(EquipNum);
- CoolingPriorityStack[EquipOnCount] =
- state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .CoolingPriority(EquipNum);
+ HeatingPriorityStack[EquipOnCount] = zoneEquipList.HeatingPriority(EquipNum);
+ CoolingPriorityStack[EquipOnCount] = zoneEquipList.CoolingPriority(EquipNum);
}
- break;
- case DataZoneEquipment::ZoneEquip::BBElectric:
- case DataZoneEquipment::ZoneEquip::HiTempRadiant:
- if (state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex).EquipData(EquipNum).ON) {
+ } break;
+ // Is this the same case as above?
+ case DataZoneEquipment::ZoneEquipType::BaseboardElectric:
+ case DataZoneEquipment::ZoneEquipType::HighTemperatureRadiant: {
+ if (zoneEquipList.EquipData(EquipNum).ON) {
EquipOnCount = min(EquipOnCount + 1, MaxZoneEquipmentIdx);
FlowRegimeStack[EquipOnCount] = InConvFlowRegime::B;
- HeatingPriorityStack[EquipOnCount] =
- state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .HeatingPriority(EquipNum);
- CoolingPriorityStack[EquipOnCount] =
- state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .CoolingPriority(EquipNum);
+ HeatingPriorityStack[EquipOnCount] = zoneEquipList.HeatingPriority(EquipNum);
+ CoolingPriorityStack[EquipOnCount] = zoneEquipList.CoolingPriority(EquipNum);
}
- break;
- case DataZoneEquipment::ZoneEquip::VentilatedSlab:
- case DataZoneEquipment::ZoneEquip::LoTempRadiant:
- if (state.dataZoneEquip->ZoneEquipConfig(ZoneNum).InFloorActiveElement) {
- for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
+ } break;
+ case DataZoneEquipment::ZoneEquipType::VentilatedSlab:
+ case DataZoneEquipment::ZoneEquipType::LowTemperatureRadiant: {
+ if (zoneEquipConfig.InFloorActiveElement) {
+ for (int spaceNum : zone.spaceIndexes) {
auto const &thisSpace = state.dataHeatBal->space(spaceNum);
+
for (int SurfLoop = thisSpace.HTSurfaceFirst; SurfLoop <= thisSpace.HTSurfaceLast; ++SurfLoop) {
- if (!state.dataSurface->SurfIntConvSurfHasActiveInIt(SurfLoop)) continue;
- if (Surface(SurfLoop).Class == SurfaceClass::Floor) {
- DeltaTemp = state.dataHeatBalSurf->SurfInsideTempHist(1)(SurfLoop) -
- state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT;
- if (DeltaTemp > ActiveDelTempThreshold) { // assume heating with floor
- // system ON is not enough because floor surfaces can continue to heat because of thermal capacity
- EquipOnCount = min(EquipOnCount + 1, MaxZoneEquipmentIdx);
- FlowRegimeStack[EquipOnCount] = InConvFlowRegime::A1;
- HeatingPriorityStack[EquipOnCount] =
- state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .HeatingPriority(EquipNum);
- CoolingPriorityStack[EquipOnCount] =
- state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .CoolingPriority(EquipNum);
- break;
- }
- }
- }
- }
- }
- if (state.dataZoneEquip->ZoneEquipConfig(ZoneNum).InCeilingActiveElement) {
- for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
+ if (!state.dataSurface->surfIntConv(SurfLoop).hasActiveInIt) continue;
+ auto &surface = state.dataSurface->Surface(SurfLoop);
+ if (surface.Class != SurfaceClass::Floor) continue;
+
+ Real64 DeltaTemp = state.dataHeatBalSurf->SurfInsideTempHist(1)(SurfLoop) -
+ state.dataZoneTempPredictorCorrector->zoneHeatBalance(zoneNum).MAT;
+ if (DeltaTemp > ActiveDelTempThreshold) { // assume heating with floor
+ // system ON is not enough because floor surfaces can continue to heat because of thermal capacity
+ EquipOnCount = min(EquipOnCount + 1, MaxZoneEquipmentIdx);
+ FlowRegimeStack[EquipOnCount] = InConvFlowRegime::A1;
+ HeatingPriorityStack[EquipOnCount] = zoneEquipList.HeatingPriority(EquipNum);
+ CoolingPriorityStack[EquipOnCount] = zoneEquipList.CoolingPriority(EquipNum);
+ break;
+ } // if (DeltaTemp)
+ } // for (SurfLoop)
+ } // for (spaceNum)
+ } // if (InFloorActiveElement)
+
+ if (zoneEquipConfig.InCeilingActiveElement) {
+ for (int spaceNum : zone.spaceIndexes) {
auto const &thisSpace = state.dataHeatBal->space(spaceNum);
- for (int SurfLoop = thisSpace.HTSurfaceFirst; SurfLoop <= thisSpace.HTSurfaceLast; ++SurfLoop) {
- if (!state.dataSurface->SurfIntConvSurfHasActiveInIt(SurfLoop)) continue;
- if (Surface(SurfLoop).Class == SurfaceClass::Roof) {
- DeltaTemp = state.dataHeatBalSurf->SurfInsideTempHist(1)(SurfLoop) -
- state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT;
- if (DeltaTemp < ActiveDelTempThreshold) { // assume cooling with ceiling
- // system ON is not enough because surfaces can continue to cool because of thermal capacity
- EquipOnCount = min(EquipOnCount + 1, MaxZoneEquipmentIdx);
- FlowRegimeStack[EquipOnCount] = InConvFlowRegime::A1;
- HeatingPriorityStack[EquipOnCount] =
- state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .HeatingPriority(EquipNum);
- CoolingPriorityStack[EquipOnCount] =
- state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .CoolingPriority(EquipNum);
- break;
- }
- }
- }
- }
- }
- if (state.dataZoneEquip->ZoneEquipConfig(ZoneNum).InWallActiveElement) {
- for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
+ for (int SurfLoop = thisSpace.HTSurfaceFirst; SurfLoop <= thisSpace.HTSurfaceLast; ++SurfLoop) {
+ if (!state.dataSurface->surfIntConv(SurfLoop).hasActiveInIt) continue;
+ auto const &surface = state.dataSurface->Surface(SurfLoop);
+ if (surface.Class != SurfaceClass::Roof) continue;
+
+ Real64 DeltaTemp = state.dataHeatBalSurf->SurfInsideTempHist(1)(SurfLoop) -
+ state.dataZoneTempPredictorCorrector->zoneHeatBalance(zoneNum).MAT;
+ if (DeltaTemp < ActiveDelTempThreshold) { // assume cooling with ceiling
+ // system ON is not enough because surfaces can continue to cool because of thermal capacity
+ EquipOnCount = min(EquipOnCount + 1, MaxZoneEquipmentIdx);
+ FlowRegimeStack[EquipOnCount] = InConvFlowRegime::A1;
+ HeatingPriorityStack[EquipOnCount] = zoneEquipList.HeatingPriority(EquipNum);
+ CoolingPriorityStack[EquipOnCount] = zoneEquipList.CoolingPriority(EquipNum);
+ break;
+ } // if (DeltaTemp)
+ } // for (SurfLoop)
+ } // for (spaceNum)
+ } // if (InCeilingActiveElement)
+
+ if (zoneEquipConfig.InWallActiveElement) {
+ for (int spaceNum : zone.spaceIndexes) {
auto const &thisSpace = state.dataHeatBal->space(spaceNum);
+
for (int SurfLoop = thisSpace.HTSurfaceFirst; SurfLoop <= thisSpace.HTSurfaceLast; ++SurfLoop) {
- if (!state.dataSurface->SurfIntConvSurfHasActiveInIt(SurfLoop)) continue;
- if (Surface(SurfLoop).Class == SurfaceClass::Wall || Surface(SurfLoop).Class == SurfaceClass::Door) {
- DeltaTemp = state.dataHeatBalSurf->SurfInsideTempHist(1)(SurfLoop) -
- state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT;
- if (DeltaTemp > ActiveDelTempThreshold) { // assume heating with wall panel
- // system ON is not enough because surfaces can continue to heat because of thermal capacity
- EquipOnCount = min(EquipOnCount + 1, MaxZoneEquipmentIdx);
- FlowRegimeStack[EquipOnCount] = InConvFlowRegime::A2;
- HeatingPriorityStack[EquipOnCount] =
- state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .HeatingPriority(EquipNum);
- CoolingPriorityStack[EquipOnCount] =
- state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .CoolingPriority(EquipNum);
- } else { // not heating, no special models wall cooling so use simple buoyancy
- EquipOnCount = min(EquipOnCount + 1, MaxZoneEquipmentIdx);
- FlowRegimeStack[EquipOnCount] = InConvFlowRegime::A3;
- HeatingPriorityStack[EquipOnCount] =
- state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .HeatingPriority(EquipNum);
- CoolingPriorityStack[EquipOnCount] =
- state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .CoolingPriority(EquipNum);
- }
- }
- }
- }
- }
+ if (!state.dataSurface->surfIntConv(SurfLoop).hasActiveInIt) continue;
+ auto const &surface = state.dataSurface->Surface(SurfLoop);
+ if (surface.Class != SurfaceClass::Wall && surface.Class != SurfaceClass::Door) continue;
+
+ DeltaTemp = state.dataHeatBalSurf->SurfInsideTempHist(1)(SurfLoop) -
+ state.dataZoneTempPredictorCorrector->zoneHeatBalance(zoneNum).MAT;
+ if (DeltaTemp > ActiveDelTempThreshold) { // assume heating with wall panel
+ // system ON is not enough because surfaces can continue to heat because of thermal capacity
+ EquipOnCount = min(EquipOnCount + 1, MaxZoneEquipmentIdx);
+ FlowRegimeStack[EquipOnCount] = InConvFlowRegime::A2;
+ HeatingPriorityStack[EquipOnCount] = zoneEquipList.HeatingPriority(EquipNum);
+ CoolingPriorityStack[EquipOnCount] = zoneEquipList.CoolingPriority(EquipNum);
+ } else { // not heating, no special models wall cooling so use simple buoyancy
+ EquipOnCount = min(EquipOnCount + 1, MaxZoneEquipmentIdx);
+ FlowRegimeStack[EquipOnCount] = InConvFlowRegime::A3;
+ HeatingPriorityStack[EquipOnCount] = zoneEquipList.HeatingPriority(EquipNum);
+ CoolingPriorityStack[EquipOnCount] = zoneEquipList.CoolingPriority(EquipNum);
+ } // else (DeltaTemp)
+ } // for (SurfLoop)
+ } // for (spaceNum)
+ } // if (InWallActiveElement)
+ } break;
default:; // nothing
}
- } // loop over equipment for this zone
+ } // for (EquipNum)
}
}
// now select which equipment type is dominant compared to all those that are ON
if (EquipOnCount > 0) {
- if (state.dataZoneEnergyDemand->ZoneSysEnergyDemand(ZoneNum).ZoneSNLoadPredictedRate >= 0.0) { // heating load
+ if (state.dataZoneEnergyDemand->ZoneSysEnergyDemand(zoneNum).ZoneSNLoadPredictedRate >= 0.0) { // heating load
PriorityEquipOn = 1;
for (int EquipOnLoop = 1; EquipOnLoop <= EquipOnCount; ++EquipOnLoop) {
// assume highest priority/first sim order is dominant for flow regime
@@ -5947,7 +4148,7 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu
PriorityEquipOn = EquipOnLoop;
}
}
- } else if (state.dataZoneEnergyDemand->ZoneSysEnergyDemand(ZoneNum).ZoneSNLoadPredictedRate < 0.0) { // cooling load
+ } else if (state.dataZoneEnergyDemand->ZoneSysEnergyDemand(zoneNum).ZoneSNLoadPredictedRate < 0.0) { // cooling load
PriorityEquipOn = 1;
for (int EquipOnLoop = 1; EquipOnLoop <= EquipOnCount; ++EquipOnLoop) {
// assume highest priority/first sim order is dominant for flow regime
@@ -5965,9 +4166,10 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu
// now if flow regimes C or D, then check for Mixed regime or very low flow rates
if ((FinalFlowRegime == InConvFlowRegime::C) || (FinalFlowRegime == InConvFlowRegime::D)) {
+ auto const &zoneNode = state.dataLoopNodes->Node(zone.SystemZoneNodeNumber);
// Calculate Grashof, Reynolds, and Richardson numbers for the zone
// Grashof for zone air based on largest delta T between surfaces and zone height
- for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) {
+ for (int spaceNum : zone.spaceIndexes) {
auto const &thisSpace = state.dataHeatBal->space(spaceNum);
for (int surfNum = thisSpace.HTSurfaceFirst; surfNum <= thisSpace.HTSurfaceLast; ++surfNum) {
Real64 SurfTemp = state.dataHeatBalSurf->SurfInsideTempHist(1)(surfNum);
@@ -5977,17 +4179,16 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu
Tmax = SurfTemp;
}
}
- GrH = (g * (Tmax - Tmin) * pow_3(Zone(ZoneNum).CeilingHeight)) /
- ((state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT + Constant::KelvinConv) * pow_2(v));
+ GrH = (g * (Tmax - Tmin) * pow_3(zone.CeilingHeight)) /
+ ((state.dataZoneTempPredictorCorrector->zoneHeatBalance(zoneNum).MAT + Constant::KelvinConv) * pow_2(v));
// Reynolds number = Vdot supply / v * cube root of zone volume (Goldstein and Noveselac 2010)
- if (state.dataLoopNodes->Node(ZoneNode).MassFlowRate > 0.0) {
- AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(
- state,
- state.dataEnvrn->OutBaroPress,
- state.dataLoopNodes->Node(ZoneNode).Temp,
- Psychrometrics::PsyWFnTdpPb(state, state.dataLoopNodes->Node(ZoneNode).Temp, state.dataEnvrn->OutBaroPress));
- Re = state.dataLoopNodes->Node(ZoneNode).MassFlowRate / (v * AirDensity * std::pow(Zone(ZoneNum).Volume, ConvectionConstants::OneThird));
+ if (zoneNode.MassFlowRate > 0.0) {
+ AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(state,
+ state.dataEnvrn->OutBaroPress,
+ zoneNode.Temp,
+ Psychrometrics::PsyWFnTdpPb(state, zoneNode.Temp, state.dataEnvrn->OutBaroPress));
+ Re = zoneNode.MassFlowRate / (v * AirDensity * std::pow(zone.Volume, 1.0 / 3.0));
} else {
Re = 0.0;
}
@@ -6006,104 +4207,104 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu
}
}
- static constexpr std::array,
- (int)ConvectionConstants::SurfConvOrientation::Num>
+ static constexpr std::array,
+ (int)SurfOrientation::Num>
A1{{
- {ConvectionConstants::InConvClass::A1_StableHoriz, // HorizontalDown, Positive
- ConvectionConstants::InConvClass::A1_StableHoriz, // HorizontalDown, Zero
- ConvectionConstants::InConvClass::A1_UnstableHoriz}, // HorizontalDown, Negative
- {ConvectionConstants::InConvClass::A1_StableTilted, // TiltedDownward, Positive
- ConvectionConstants::InConvClass::A1_StableTilted, // TiltedDownward, Zero
- ConvectionConstants::InConvClass::A1_UnstableTilted}, // TiltedDownward, Negative
- {ConvectionConstants::InConvClass::A1_VertWalls, // Vertical, Positive
- ConvectionConstants::InConvClass::A1_VertWalls, // Vertical, Zero
- ConvectionConstants::InConvClass::A1_VertWalls}, // Vertical, Negative
- {ConvectionConstants::InConvClass::A1_UnstableTilted, // TiltedUpward, Positive
- ConvectionConstants::InConvClass::A1_StableTilted, // TiltedUpward, Zero
- ConvectionConstants::InConvClass::A1_StableTilted}, // TiltedUpward, Negative
- {ConvectionConstants::InConvClass::A1_UnstableHoriz, // HorizontalUp, Positive
- ConvectionConstants::InConvClass::A1_StableHoriz, // HorizontalUp, Zero
- ConvectionConstants::InConvClass::A1_StableHoriz} // HorizontalUp, Negative
+ {IntConvClass::A1_FloorHeatCeilCool_StableHoriz, // HorizontalDown, Positive
+ IntConvClass::A1_FloorHeatCeilCool_StableHoriz, // HorizontalDown, Zero
+ IntConvClass::A1_FloorHeatCeilCool_UnstableHoriz}, // HorizontalDown, Negative
+ {IntConvClass::A1_FloorHeatCeilCool_StableTilted, // TiltedDownward, Positive
+ IntConvClass::A1_FloorHeatCeilCool_StableTilted, // TiltedDownward, Zero
+ IntConvClass::A1_FloorHeatCeilCool_UnstableTilted}, // TiltedDownward, Negative
+ {IntConvClass::A1_FloorHeatCeilCool_VertWalls, // Vertical, Positive
+ IntConvClass::A1_FloorHeatCeilCool_VertWalls, // Vertical, Zero
+ IntConvClass::A1_FloorHeatCeilCool_VertWalls}, // Vertical, Negative
+ {IntConvClass::A1_FloorHeatCeilCool_UnstableTilted, // TiltedUpward, Positive
+ IntConvClass::A1_FloorHeatCeilCool_StableTilted, // TiltedUpward, Zero
+ IntConvClass::A1_FloorHeatCeilCool_StableTilted}, // TiltedUpward, Negative
+ {IntConvClass::A1_FloorHeatCeilCool_UnstableHoriz, // HorizontalUp, Positive
+ IntConvClass::A1_FloorHeatCeilCool_StableHoriz, // HorizontalUp, Zero
+ IntConvClass::A1_FloorHeatCeilCool_StableHoriz} // HorizontalUp, Negative
}};
- static constexpr std::array,
- (int)ConvectionConstants::SurfConvOrientation::Num>
+ static constexpr std::array,
+ (int)SurfOrientation::Num>
A2{{
- {ConvectionConstants::InConvClass::A2_StableHoriz, // HorizontalDown, Positive
- ConvectionConstants::InConvClass::A2_StableHoriz, // HorizontalDown, Zero
- ConvectionConstants::InConvClass::A2_UnstableHoriz}, // HorizontalDown, Negative
- {ConvectionConstants::InConvClass::A2_StableTilted, // TiltedDownward, Positive
- ConvectionConstants::InConvClass::A2_StableTilted, // TiltedDownward, Zero
- ConvectionConstants::InConvClass::A2_UnstableTilted}, // TiltedDownward, Negative
- {ConvectionConstants::InConvClass::A2_VertWallsNonHeated, // Vertical, Positive
- ConvectionConstants::InConvClass::A2_VertWallsNonHeated, // Vertical, Zero
- ConvectionConstants::InConvClass::A2_VertWallsNonHeated}, // Vertical, Negative
- {ConvectionConstants::InConvClass::A2_UnstableTilted, // TiltedUpward, Positive
- ConvectionConstants::InConvClass::A2_StableTilted, // TiltedUpward, Zero
- ConvectionConstants::InConvClass::A2_StableTilted}, // TiltedUpward, Negative
- {ConvectionConstants::InConvClass::A2_UnstableHoriz, // HorizontalUp, Positive
- ConvectionConstants::InConvClass::A2_StableHoriz, // HorizontalUp, Zero
- ConvectionConstants::InConvClass::A2_StableHoriz} // HorizontalUp, Negative
+ {IntConvClass::A2_WallPanelHeat_StableHoriz, // HorizontalDown, Positive
+ IntConvClass::A2_WallPanelHeat_StableHoriz, // HorizontalDown, Zero
+ IntConvClass::A2_WallPanelHeat_UnstableHoriz}, // HorizontalDown, Negative
+ {IntConvClass::A2_WallPanelHeat_StableTilted, // TiltedDownward, Positive
+ IntConvClass::A2_WallPanelHeat_StableTilted, // TiltedDownward, Zero
+ IntConvClass::A2_WallPanelHeat_UnstableTilted}, // TiltedDownward, Negative
+ {IntConvClass::A2_WallPanelHeat_VertWallsNonHeated, // Vertical, Positive
+ IntConvClass::A2_WallPanelHeat_VertWallsNonHeated, // Vertical, Zero
+ IntConvClass::A2_WallPanelHeat_VertWallsNonHeated}, // Vertical, Negative
+ {IntConvClass::A2_WallPanelHeat_UnstableTilted, // TiltedUpward, Positive
+ IntConvClass::A2_WallPanelHeat_StableTilted, // TiltedUpward, Zero
+ IntConvClass::A2_WallPanelHeat_StableTilted}, // TiltedUpward, Negative
+ {IntConvClass::A2_WallPanelHeat_UnstableHoriz, // HorizontalUp, Positive
+ IntConvClass::A2_WallPanelHeat_StableHoriz, // HorizontalUp, Zero
+ IntConvClass::A2_WallPanelHeat_StableHoriz} // HorizontalUp, Negative
}};
- static constexpr std::array,
- (int)ConvectionConstants::SurfConvOrientation::Num>
+ static constexpr std::array,
+ (int)SurfOrientation::Num>
A3{{
- {ConvectionConstants::InConvClass::A3_StableHoriz, // HorizontalDown, Positive
- ConvectionConstants::InConvClass::A3_StableHoriz, // HorizontalDown, Zero
- ConvectionConstants::InConvClass::A3_UnstableHoriz}, // HorizontalDown, Negative
- {ConvectionConstants::InConvClass::A3_StableTilted, // TiltedDownward, Positive
- ConvectionConstants::InConvClass::A3_StableTilted, // TiltedDownward, Zero
- ConvectionConstants::InConvClass::A3_UnstableTilted}, // TiltedDownward, Negative
- {ConvectionConstants::InConvClass::A3_VertWalls, // Vertical, Positive
- ConvectionConstants::InConvClass::A3_VertWalls, // Vertical, Zero
- ConvectionConstants::InConvClass::A3_VertWalls}, // Vertical, Negative
- {ConvectionConstants::InConvClass::A3_UnstableTilted, // TiltedUpward, Positive
- ConvectionConstants::InConvClass::A3_StableTilted, // TiltedUpward, Zero
- ConvectionConstants::InConvClass::A3_StableTilted}, // TiltedUpward, Negative
- {ConvectionConstants::InConvClass::A3_UnstableHoriz, // HorizontalUp, Positive
- ConvectionConstants::InConvClass::A3_StableHoriz, // HorizontalUp, Zero
- ConvectionConstants::InConvClass::A3_StableHoriz} // HorizontalUp, Negative
+ {IntConvClass::A3_SimpleBuoy_StableHoriz, // HorizontalDown, Positive
+ IntConvClass::A3_SimpleBuoy_StableHoriz, // HorizontalDown, Zero
+ IntConvClass::A3_SimpleBuoy_UnstableHoriz}, // HorizontalDown, Negative
+ {IntConvClass::A3_SimpleBuoy_StableTilted, // TiltedDownward, Positive
+ IntConvClass::A3_SimpleBuoy_StableTilted, // TiltedDownward, Zero
+ IntConvClass::A3_SimpleBuoy_UnstableTilted}, // TiltedDownward, Negative
+ {IntConvClass::A3_SimpleBuoy_VertWalls, // Vertical, Positive
+ IntConvClass::A3_SimpleBuoy_VertWalls, // Vertical, Zero
+ IntConvClass::A3_SimpleBuoy_VertWalls}, // Vertical, Negative
+ {IntConvClass::A3_SimpleBuoy_UnstableTilted, // TiltedUpward, Positive
+ IntConvClass::A3_SimpleBuoy_StableTilted, // TiltedUpward, Zero
+ IntConvClass::A3_SimpleBuoy_StableTilted}, // TiltedUpward, Negative
+ {IntConvClass::A3_SimpleBuoy_UnstableHoriz, // HorizontalUp, Positive
+ IntConvClass::A3_SimpleBuoy_StableHoriz, // HorizontalUp, Zero
+ IntConvClass::A3_SimpleBuoy_StableHoriz} // HorizontalUp, Negative
}};
- static constexpr std::array,
- (int)ConvectionConstants::SurfConvOrientation::Num>
+ static constexpr std::array,
+ (int)SurfOrientation::Num>
B{{
- {ConvectionConstants::InConvClass::B_StableHoriz, // HorizontalDown, Positive
- ConvectionConstants::InConvClass::B_StableHoriz, // HorizontalDown, Zero
- ConvectionConstants::InConvClass::B_UnstableHoriz}, // HorizontalDown, Negative
- {ConvectionConstants::InConvClass::B_StableTilted, // TiltedDownward, Positive
- ConvectionConstants::InConvClass::B_StableTilted, // TiltedDownward, Zero
- ConvectionConstants::InConvClass::B_UnstableTilted}, // TiltedDownward, Negative
- {ConvectionConstants::InConvClass::B_VertWalls, // Vertical, Positive
- ConvectionConstants::InConvClass::B_VertWalls, // Vertical, Zero
- ConvectionConstants::InConvClass::B_VertWalls}, // Vertical, Negative
- {ConvectionConstants::InConvClass::B_UnstableTilted, // TiltedUpward, Positive
- ConvectionConstants::InConvClass::B_StableTilted, // TiltedUpward, Zero
- ConvectionConstants::InConvClass::B_StableTilted}, // TiltedUpward, Negative
- {ConvectionConstants::InConvClass::B_UnstableHoriz, // HorizontalUp, Positive
- ConvectionConstants::InConvClass::B_StableHoriz, // HorizontalUp, Zero
- ConvectionConstants::InConvClass::B_StableHoriz} // HorizontalUp, Negative
+ {IntConvClass::B_ConvectiveHeat_StableHoriz, // HorizontalDown, Positive
+ IntConvClass::B_ConvectiveHeat_StableHoriz, // HorizontalDown, Zero
+ IntConvClass::B_ConvectiveHeat_UnstableHoriz}, // HorizontalDown, Negative
+ {IntConvClass::B_ConvectiveHeat_StableTilted, // TiltedDownward, Positive
+ IntConvClass::B_ConvectiveHeat_StableTilted, // TiltedDownward, Zero
+ IntConvClass::B_ConvectiveHeat_UnstableTilted}, // TiltedDownward, Negative
+ {IntConvClass::B_ConvectiveHeat_VertWalls, // Vertical, Positive
+ IntConvClass::B_ConvectiveHeat_VertWalls, // Vertical, Zero
+ IntConvClass::B_ConvectiveHeat_VertWalls}, // Vertical, Negative
+ {IntConvClass::B_ConvectiveHeat_UnstableTilted, // TiltedUpward, Positive
+ IntConvClass::B_ConvectiveHeat_StableTilted, // TiltedUpward, Zero
+ IntConvClass::B_ConvectiveHeat_StableTilted}, // TiltedUpward, Negative
+ {IntConvClass::B_ConvectiveHeat_UnstableHoriz, // HorizontalUp, Positive
+ IntConvClass::B_ConvectiveHeat_StableHoriz, // HorizontalUp, Zero
+ IntConvClass::B_ConvectiveHeat_StableHoriz} // HorizontalUp, Negative
}};
- static constexpr std::array,
- (int)ConvectionConstants::SurfConvOrientation::Num>
+ static constexpr std::array,
+ (int)SurfOrientation::Num>
D{{
- {ConvectionConstants::InConvClass::D_StableHoriz, // HorizontalDown, Positive
- ConvectionConstants::InConvClass::D_StableHoriz, // HorizontalDown, Zero
- ConvectionConstants::InConvClass::D_UnstableHoriz}, // HorizontalDown, Negative
- {ConvectionConstants::InConvClass::D_StableTilted, // TiltedDownward, Positive
- ConvectionConstants::InConvClass::D_StableTilted, // TiltedDownward, Zero
- ConvectionConstants::InConvClass::D_UnstableTilted}, // TiltedDownward, Negative
- {ConvectionConstants::InConvClass::D_Walls, // Vertical, Positive
- ConvectionConstants::InConvClass::D_Walls, // Vertical, Zero
- ConvectionConstants::InConvClass::D_Walls}, // Vertical, Negative
- {ConvectionConstants::InConvClass::D_UnstableTilted, // TiltedUpward, Positive
- ConvectionConstants::InConvClass::D_StableTilted, // TiltedUpward, Zero
- ConvectionConstants::InConvClass::D_StableTilted}, // TiltedUpward, Negative
- {ConvectionConstants::InConvClass::D_UnstableHoriz, // HorizontalUp, Positive
- ConvectionConstants::InConvClass::D_StableHoriz, // HorizontalUp, Zero
- ConvectionConstants::InConvClass::D_StableHoriz} // HorizontalUp, Negative
+ {IntConvClass::D_ZoneFanCirc_StableHoriz, // HorizontalDown, Positive
+ IntConvClass::D_ZoneFanCirc_StableHoriz, // HorizontalDown, Zero
+ IntConvClass::D_ZoneFanCirc_UnstableHoriz}, // HorizontalDown, Negative
+ {IntConvClass::D_ZoneFanCirc_StableTilted, // TiltedDownward, Positive
+ IntConvClass::D_ZoneFanCirc_StableTilted, // TiltedDownward, Zero
+ IntConvClass::D_ZoneFanCirc_UnstableTilted}, // TiltedDownward, Negative
+ {IntConvClass::D_ZoneFanCirc_Walls, // Vertical, Positive
+ IntConvClass::D_ZoneFanCirc_Walls, // Vertical, Zero
+ IntConvClass::D_ZoneFanCirc_Walls}, // Vertical, Negative
+ {IntConvClass::D_ZoneFanCirc_UnstableTilted, // TiltedUpward, Positive
+ IntConvClass::D_ZoneFanCirc_StableTilted, // TiltedUpward, Zero
+ IntConvClass::D_ZoneFanCirc_StableTilted}, // TiltedUpward, Negative
+ {IntConvClass::D_ZoneFanCirc_UnstableHoriz, // HorizontalUp, Positive
+ IntConvClass::D_ZoneFanCirc_StableHoriz, // HorizontalUp, Zero
+ IntConvClass::D_ZoneFanCirc_StableHoriz} // HorizontalUp, Negative
}};
auto DeltaTempLambda = [](Real64 surfTemp, Real64 airTemp) {
@@ -6120,284 +4321,247 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu
// now finish out specific model eq for this surface
int iDeltaTemp =
- DeltaTempLambda(state.dataHeatBalSurf->SurfInsideTempHist(1)(SurfNum), state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT);
- int iConvOrient = int(Surface(SurfNum).ConvOrientation);
+ DeltaTempLambda(state.dataHeatBalSurf->SurfInsideTempHist(1)(SurfNum), state.dataZoneTempPredictorCorrector->zoneHeatBalance(zoneNum).MAT);
+ int iConvOrient = int(surface.convOrientation);
+ auto &surfIntConv = state.dataSurface->surfIntConv(SurfNum);
switch (FinalFlowRegime) {
- case InConvFlowRegime::A1:
+ case InConvFlowRegime::A1: {
- switch (Surface(SurfNum).Class) {
+ switch (surface.Class) {
case SurfaceClass::Wall:
case SurfaceClass::Door:
- case SurfaceClass::IntMass:
- state.dataSurface->SurfIntConvClassification(SurfNum) = A1[iConvOrient][iDeltaTemp];
- break;
- case SurfaceClass::Roof:
- if (state.dataSurface->SurfIntConvSurfHasActiveInIt(SurfNum)) {
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::A1_ChilledCeil;
- } else {
- state.dataSurface->SurfIntConvClassification(SurfNum) = A1[iConvOrient][iDeltaTemp];
- }
- break;
- case SurfaceClass::Floor:
- if (state.dataSurface->SurfIntConvSurfHasActiveInIt(SurfNum)) {
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::A1_HeatedFloor;
- } else {
- state.dataSurface->SurfIntConvClassification(SurfNum) = A1[iConvOrient][iDeltaTemp];
- }
- break;
+ case SurfaceClass::IntMass: {
+ surfIntConv.convClass = A1[iConvOrient][iDeltaTemp];
+ } break;
+ case SurfaceClass::Roof: {
+ surfIntConv.convClass = (surfIntConv.hasActiveInIt) ? IntConvClass::A1_FloorHeatCeilCool_ChilledCeil : A1[iConvOrient][iDeltaTemp];
+ } break;
+ case SurfaceClass::Floor: {
+ surfIntConv.convClass = (surfIntConv.hasActiveInIt) ? IntConvClass::A1_FloorHeatCeilCool_HeatedFloor : A1[iConvOrient][iDeltaTemp];
+ } break;
case SurfaceClass::Window:
case SurfaceClass::GlassDoor:
- case SurfaceClass::TDD_Diffuser:
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::A1_Windows;
- break;
+ case SurfaceClass::TDD_Diffuser: {
+ surfIntConv.convClass = IntConvClass::A1_FloorHeatCeilCool_Windows;
+ } break;
default:
assert(false);
}
- if (state.dataSurface->SurfIntConvClassification(SurfNum) == ConvectionConstants::InConvClass::Invalid) {
- ShowSevereError(state,
- format("DynamicIntConvSurfaceClassification: failed to resolve Hc model for A1 surface named{}", Surface(SurfNum).Name));
+ if (surfIntConv.convClass == IntConvClass::Invalid) {
+ ShowSevereError(state, format("DynamicIntConvSurfaceClassification: failed to resolve Hc model for A1 surface named{}", surface.Name));
}
- break;
+ } break; // A1
- case InConvFlowRegime::A2:
+ case InConvFlowRegime::A2: {
- switch (Surface(SurfNum).Class) {
+ switch (surface.Class) {
case SurfaceClass::Roof:
case SurfaceClass::Floor:
- case SurfaceClass::IntMass:
- state.dataSurface->SurfIntConvClassification(SurfNum) = A2[iConvOrient][iDeltaTemp];
- break;
+ case SurfaceClass::IntMass: {
+ surfIntConv.convClass = A2[iConvOrient][iDeltaTemp];
+ } break;
case SurfaceClass::Wall:
- case SurfaceClass::Door:
- if (state.dataSurface->SurfIntConvSurfHasActiveInIt(SurfNum)) {
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::A2_HeatedVerticalWall;
- } else {
- state.dataSurface->SurfIntConvClassification(SurfNum) = A2[iConvOrient][iDeltaTemp];
- }
- break;
+ case SurfaceClass::Door: {
+ surfIntConv.convClass = (surfIntConv.hasActiveInIt) ? IntConvClass::A2_WallPanelHeat_HeatedVerticalWall : A2[iConvOrient][iDeltaTemp];
+ } break;
case SurfaceClass::Window:
case SurfaceClass::GlassDoor:
- case SurfaceClass::TDD_Diffuser:
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::A2_Windows;
- break;
+ case SurfaceClass::TDD_Diffuser: {
+ surfIntConv.convClass = IntConvClass::A2_WallPanelHeat_Windows;
+ } break;
default:
assert(false);
}
- if (state.dataSurface->SurfIntConvClassification(SurfNum) == ConvectionConstants::InConvClass::Invalid) {
- ShowSevereError(state,
- format("DynamicIntConvSurfaceClassification: failed to resolve Hc model for A2 surface named{}", Surface(SurfNum).Name));
+ if (surfIntConv.convClass == IntConvClass::Invalid) {
+ ShowSevereError(state, format("DynamicIntConvSurfaceClassification: failed to resolve Hc model for A2 surface named{}", surface.Name));
}
- break;
+ } break; // A2
- case InConvFlowRegime::A3:
+ case InConvFlowRegime::A3: {
- switch (Surface(SurfNum).Class) {
+ switch (surface.Class) {
case SurfaceClass::Wall:
case SurfaceClass::Door:
case SurfaceClass::Roof:
- case SurfaceClass::Floor:
- state.dataSurface->SurfIntConvClassification(SurfNum) = A3[iConvOrient][iDeltaTemp];
- break;
- case SurfaceClass::IntMass:
+ case SurfaceClass::Floor: {
+ surfIntConv.convClass = A3[iConvOrient][iDeltaTemp];
+ } break;
+ case SurfaceClass::IntMass: {
// assume horizontal upwards
- state.dataSurface->SurfIntConvClassification(SurfNum) = A3[int(ConvectionConstants::SurfConvOrientation::HorizontalUp)][iDeltaTemp];
- break;
+ surfIntConv.convClass = A3[int(SurfOrientation::HorizontalUp)][iDeltaTemp];
+ } break;
case SurfaceClass::Window:
case SurfaceClass::GlassDoor:
- case SurfaceClass::TDD_Diffuser:
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::A3_Windows;
- break;
+ case SurfaceClass::TDD_Diffuser: {
+ surfIntConv.convClass = IntConvClass::A3_SimpleBuoy_Windows;
+ } break;
default:
assert(false);
}
- if (state.dataSurface->SurfIntConvClassification(SurfNum) == ConvectionConstants::InConvClass::Invalid) {
- ShowSevereError(state,
- format("DynamicIntConvSurfaceClassification: failed to resolve Hc model for A3 surface named{}", Surface(SurfNum).Name));
+ if (surfIntConv.convClass == IntConvClass::Invalid) {
+ ShowSevereError(state, format("DynamicIntConvSurfaceClassification: failed to resolve Hc model for A3 surface named{}", surface.Name));
}
- break;
+ } break; // A3
- case InConvFlowRegime::B:
+ case InConvFlowRegime::B: {
- switch (Surface(SurfNum).Class) {
+ switch (surface.Class) {
case SurfaceClass::Wall:
- case SurfaceClass::Door:
- if (state.dataSurface->SurfIntConvSurfGetsRadiantHeat(SurfNum)) {
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::B_VertWallsNearHeat;
- } else {
- state.dataSurface->SurfIntConvClassification(SurfNum) = B[iConvOrient][iDeltaTemp];
- }
- break;
+ case SurfaceClass::Door: {
+ surfIntConv.convClass = (surfIntConv.getsRadiantHeat) ? IntConvClass::B_ConvectiveHeat_VertWallsNearHeat : B[iConvOrient][iDeltaTemp];
+ } break;
case SurfaceClass::Roof:
- case SurfaceClass::Floor:
- state.dataSurface->SurfIntConvClassification(SurfNum) = B[iConvOrient][iDeltaTemp];
- break;
+ case SurfaceClass::Floor: {
+ surfIntConv.convClass = B[iConvOrient][iDeltaTemp];
+ } break;
case SurfaceClass::Window:
case SurfaceClass::GlassDoor:
- case SurfaceClass::TDD_Diffuser:
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::B_Windows;
- break;
- case SurfaceClass::IntMass:
+ case SurfaceClass::TDD_Diffuser: {
+ surfIntConv.convClass = IntConvClass::B_ConvectiveHeat_Windows;
+ } break;
+ case SurfaceClass::IntMass: {
// assume horizontal upwards
- state.dataSurface->SurfIntConvClassification(SurfNum) = B[int(ConvectionConstants::SurfConvOrientation::HorizontalUp)][iDeltaTemp];
- break;
+ surfIntConv.convClass = B[int(SurfOrientation::HorizontalUp)][iDeltaTemp];
+ } break;
default:
assert(false);
}
- if (state.dataSurface->SurfIntConvClassification(SurfNum) == ConvectionConstants::InConvClass::Invalid) {
- ShowSevereError(state,
- format("DynamicIntConvSurfaceClassification: failed to resolve Hc model for B surface named{}", Surface(SurfNum).Name));
+ if (surfIntConv.convClass == IntConvClass::Invalid) {
+ ShowSevereError(state, format("DynamicIntConvSurfaceClassification: failed to resolve Hc model for B surface named{}", surface.Name));
}
- break;
+ } break; // B
- case InConvFlowRegime::C:
+ case InConvFlowRegime::C: {
- switch (Surface(SurfNum).Class) {
+ switch (surface.Class) {
case SurfaceClass::Wall:
- case SurfaceClass::Door:
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::C_Walls;
- break;
- case SurfaceClass::Roof:
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::C_Ceiling;
- break;
- case SurfaceClass::Floor:
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::C_Floor;
- break;
+ case SurfaceClass::Door: {
+ surfIntConv.convClass = IntConvClass::C_CentralAirHeat_Walls;
+ } break;
+ case SurfaceClass::Roof: {
+ surfIntConv.convClass = IntConvClass::C_CentralAirHeat_Ceiling;
+ } break;
+ case SurfaceClass::Floor: {
+ surfIntConv.convClass = IntConvClass::C_CentralAirHeat_Floor;
+ } break;
case SurfaceClass::Window:
case SurfaceClass::GlassDoor:
- case SurfaceClass::TDD_Diffuser:
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::C_Windows;
- break;
- case SurfaceClass::IntMass:
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::C_Floor;
- break;
+ case SurfaceClass::TDD_Diffuser: {
+ surfIntConv.convClass = IntConvClass::C_CentralAirHeat_Windows;
+ } break;
+ case SurfaceClass::IntMass: {
+ surfIntConv.convClass = IntConvClass::C_CentralAirHeat_Floor;
+ } break;
default:
assert(false);
}
- if (state.dataSurface->SurfIntConvClassification(SurfNum) == ConvectionConstants::InConvClass::Invalid) {
- ShowSevereError(state,
- format("DynamicIntConvSurfaceClassification: failed to resolve Hc model for C surface named{}", Surface(SurfNum).Name));
+ if (surfIntConv.convClass == IntConvClass::Invalid) {
+ ShowSevereError(state, format("DynamicIntConvSurfaceClassification: failed to resolve Hc model for C surface named{}", surface.Name));
}
- break;
+ } break; // C
- case InConvFlowRegime::D:
+ case InConvFlowRegime::D: {
- switch (Surface(SurfNum).Class) {
+ switch (surface.Class) {
case SurfaceClass::Wall:
case SurfaceClass::Door:
case SurfaceClass::Roof:
- case SurfaceClass::Floor:
- state.dataSurface->SurfIntConvClassification(SurfNum) = D[iConvOrient][iDeltaTemp];
- break;
+ case SurfaceClass::Floor: {
+ surfIntConv.convClass = D[iConvOrient][iDeltaTemp];
+ } break;
case SurfaceClass::Window:
case SurfaceClass::GlassDoor:
- case SurfaceClass::TDD_Diffuser:
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::D_Windows;
- break;
- case SurfaceClass::IntMass:
+ case SurfaceClass::TDD_Diffuser: {
+ surfIntConv.convClass = IntConvClass::D_ZoneFanCirc_Windows;
+ } break;
+ case SurfaceClass::IntMass: {
// assume horizontal upwards.
- state.dataSurface->SurfIntConvClassification(SurfNum) = D[int(ConvectionConstants::SurfConvOrientation::HorizontalUp)][iDeltaTemp];
- break;
+ surfIntConv.convClass = D[int(SurfOrientation::HorizontalUp)][iDeltaTemp];
+ } break;
default:
assert(false);
}
- if (state.dataSurface->SurfIntConvClassification(SurfNum) == ConvectionConstants::InConvClass::Invalid) {
- ShowSevereError(state,
- format("DynamicIntConvSurfaceClassification: failed to resolve Hc model for D surface named{}", Surface(SurfNum).Name));
+ if (surfIntConv.convClass == IntConvClass::Invalid) {
+ ShowSevereError(state, format("DynamicIntConvSurfaceClassification: failed to resolve Hc model for D surface named{}", surface.Name));
}
- break;
-
- case InConvFlowRegime::E:
+ } break; // D
- {
- Real64 deltaTemp = state.dataHeatBalSurf->SurfInsideTempHist(1)(SurfNum) - state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT;
+ case InConvFlowRegime::E: {
+ Real64 deltaTemp = state.dataHeatBalSurf->SurfInsideTempHist(1)(SurfNum) - state.dataZoneTempPredictorCorrector->zoneHeatBalance(zoneNum).MAT;
- switch (Surface(SurfNum).Class) {
+ switch (surface.Class) {
case SurfaceClass::Wall:
- case SurfaceClass::Door:
+ case SurfaceClass::Door: {
switch (FlowRegimeStack[PriorityEquipOn]) {
- case InConvFlowRegime::C:
+ case InConvFlowRegime::C: {
// assume forced flow is down along wall (ceiling diffuser)
- if (deltaTemp > 0.0) { // surface is hotter so plume upwards and forces oppose
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::E_OpposFlowWalls;
- } else { // surface is cooler so plume down and forces assist
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::E_AssistFlowWalls;
- }
- break;
- case InConvFlowRegime::D:
+ surfIntConv.convClass = (deltaTemp > 0.0) ? IntConvClass::E_MixedBuoy_OpposFlowWalls
+ : // surface is hotter so plume upwards and forces oppose
+ IntConvClass::E_MixedBuoy_AssistFlowWalls; // surface is cooler so plume down and forces assist
+ } break;
+ case InConvFlowRegime::D: {
// assume forced flow is upward along wall (perimeter zone HVAC with fan)
- if (deltaTemp > 0.0) { // surface is hotter so plume up and forces assist
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::E_AssistFlowWalls;
- } else { // surface is cooler so plume downward and forces oppose
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::E_OpposFlowWalls;
- }
- break;
+ surfIntConv.convClass = (deltaTemp > 0.0) ? IntConvClass::E_MixedBuoy_AssistFlowWalls
+ : // surface is hotter so plume up and forces assist
+ IntConvClass::E_MixedBuoy_OpposFlowWalls; // surface is cooler so plume downward and forces oppose
+ } break;
default:
assert(false);
}
- break;
-
- case SurfaceClass::Roof:
- if (deltaTemp > 0.0) { // surface is hotter so stable
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::E_StableCeiling;
- } else {
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::E_UnstableCeiling;
- }
- break;
- case SurfaceClass::Floor:
- if (deltaTemp > 0.0) { // surface is hotter so unstable
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::E_UnstableFloor;
- } else {
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::E_StableFloor;
- }
- break;
- case SurfaceClass::Window:
+ } break;
+
+ case SurfaceClass::Roof: {
+ surfIntConv.convClass = (deltaTemp > 0.0) ? // surface is hotter so stable
+ IntConvClass::E_MixedBuoy_StableCeiling
+ : IntConvClass::E_MixedBuoy_UnstableCeiling;
+ } break;
+ case SurfaceClass::Floor: {
+ surfIntConv.convClass = (deltaTemp > 0.0) ? // surface is hotter so unstable
+ IntConvClass::E_MixedBuoy_UnstableFloor
+ : IntConvClass::E_MixedBuoy_StableFloor;
+ } break;
+ case SurfaceClass::Window: {
case SurfaceClass::GlassDoor:
- case SurfaceClass::TDD_Diffuser:
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::E_Windows;
- break;
- case SurfaceClass::IntMass:
- if (deltaTemp > 0.0) {
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::E_UnstableFloor;
- } else {
- state.dataSurface->SurfIntConvClassification(SurfNum) = ConvectionConstants::InConvClass::E_StableFloor;
- }
- break;
+ case SurfaceClass::TDD_Diffuser: {
+ surfIntConv.convClass = IntConvClass::E_MixedBuoy_Windows;
+ } break;
+ case SurfaceClass::IntMass: {
+ surfIntConv.convClass = (deltaTemp > 0.0) ? IntConvClass::E_MixedBuoy_UnstableFloor : IntConvClass::E_MixedBuoy_StableFloor;
+ } break;
default:
assert(false);
}
- if (state.dataSurface->SurfIntConvClassification(SurfNum) == ConvectionConstants::InConvClass::Invalid) {
- ShowSevereError(state,
- format("DynamicIntConvSurfaceClassification: failed to resolve Hc model for E surface named {}", Surface(SurfNum).Name));
+ if (surfIntConv.convClass == IntConvClass::Invalid) {
+ ShowSevereError(state,
+ format("DynamicIntConvSurfaceClassification: failed to resolve Hc model for E surface named {}", surface.Name));
+ }
}
-
- break;
- }
+ } break; // E
default:
- ShowSevereError(
- state, format("DynamicIntConvSurfaceClassification: failed to determine zone flow regime for surface named {}", Surface(SurfNum).Name));
+ ShowSevereError(state,
+ format("DynamicIntConvSurfaceClassification: failed to determine zone flow regime for surface named {}", surface.Name));
}
// Set report var after surface has been classified
- state.dataSurface->SurfIntConvClassificationRpt(SurfNum) =
- ConvectionConstants::InConvClassReportVals[static_cast(state.dataSurface->SurfIntConvClassification(SurfNum))];
+ surfIntConv.convClassRpt = IntConvClassReportVals[(int)surfIntConv.convClass];
}
-void MapIntConvClassificationToHcModels(EnergyPlusData &state, int const SurfNum) // surface pointer index
+void MapIntConvClassToHcModels(EnergyPlusData &state, int const SurfNum) // surface pointer index
{
// SUBROUTINE INFORMATION:
@@ -6412,383 +4576,68 @@ void MapIntConvClassificationToHcModels(EnergyPlusData &state, int const SurfNum
// then simply map data stored in InsideFaceAdaptiveConvectionAlgo into the surface's structure
// if model type is user-defined, also store the index to the user curve to be used.
- switch (state.dataSurface->SurfIntConvClassification(SurfNum)) {
- case ConvectionConstants::InConvClass::A1_VertWalls:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolVertWallEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolVertWallUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::A1_StableHoriz:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolStableHorizEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolStableHorizUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::A1_UnstableHoriz:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolUnstableHorizEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolUnstableHorizUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::A1_HeatedFloor:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolHeatedFloorEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolHeatedFloorUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::A1_ChilledCeil:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolChilledCeilingEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolChilledCeilingUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::A1_StableTilted:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolStableTiltedEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolStableTiltedUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::A1_UnstableTilted:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolUnstableTiltedEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolUnstableTiltedUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::A1_Windows:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolWindowsEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolWindowsUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::A2_VertWallsNonHeated:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatVertWallEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatVertWallUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::A2_HeatedVerticalWall:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatHeatedWallEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatHeatedWallUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::A2_StableHoriz:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatStableHorizEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatStableHorizUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::A2_UnstableHoriz:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatUnstableHorizEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatUnstableHorizUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::A2_StableTilted:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatStableTiltedEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatStableTiltedUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::A2_UnstableTilted:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatUnstableTiltedEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatUnstableTiltedUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::A2_Windows:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatWindowsEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatWindowsUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::A3_VertWalls:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBuoyVertWallEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBuoyVertWallUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::A3_StableHoriz:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBuoyStableHorizEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBuoyStableHorizUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::A3_UnstableHoriz:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBuoyUnstableHorizEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBuoyUnstableHorizUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::A3_StableTilted:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBuoyStableTiltedEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBuoyStableTiltedUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::A3_UnstableTilted:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBuoyUnstableTiltedEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBuoyUnstableTiltedUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::A3_Windows:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBuoyWindowsEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBuoyWindowsUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::B_VertWalls:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatVertWallEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatVertWallUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::B_VertWallsNearHeat:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatVertWallNearHeaterEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatVertWallNearHeaterUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::B_StableHoriz:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatStableHorizEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatStableHorizUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::B_UnstableHoriz:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatUnstableHorizEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatUnstableHorizUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::B_StableTilted:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatStableTiltedEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatStableTiltedUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::B_UnstableTilted:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatUnstableTiltedEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatUnstableTiltedUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::B_Windows:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatWindowsEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatWindowsUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::C_Walls:
- if ((state.dataSurface->SurfIntConvZonePerimLength(SurfNum) == 0.0) &&
- (state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWallEqNum ==
- ConvectionConstants::HcInt_GoldsteinNovoselacCeilingDiffuserWalls)) {
+ auto &surfIntConv = state.dataSurface->surfIntConv(SurfNum);
+ IntConvClass intConvClass = surfIntConv.convClass;
+ assert(intConvClass != IntConvClass::Invalid);
+
+ switch (intConvClass) {
+ // A few cases require special handling
+ case IntConvClass::C_CentralAirHeat_Walls: {
+ if ((surfIntConv.zonePerimLength == 0.0) &&
+ (state.dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)intConvClass] == HcInt::GoldsteinNovoselacCeilingDiffuserWalls)) {
// no perimeter, Goldstein Novolselac model not good so revert to fisher pedersen model
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) = ConvectionConstants::HcInt_FisherPedersenCeilDiffuserWalls;
+ surfIntConv.hcModelEq = HcInt::FisherPedersenCeilDiffuserWalls;
+ surfIntConv.hcModelEqRpt = HcIntReportVals[(int)surfIntConv.hcModelEq];
} else {
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWallEqNum;
+ surfIntConv.hcModelEq = state.dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)intConvClass];
+ surfIntConv.hcModelEqRpt = HcIntReportVals[(int)surfIntConv.hcModelEq];
}
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWallUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::C_Ceiling:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirCeilingEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirCeilingUserCurveNum;
+ if (surfIntConv.hcModelEq == HcInt::UserCurve) {
+ surfIntConv.hcUserCurveNum = state.dataConvect->intAdaptiveConvAlgo.intConvClassUserCurveNums[(int)intConvClass];
}
- break;
- case ConvectionConstants::InConvClass::C_Floor:
- if ((state.dataSurface->SurfIntConvZonePerimLength(SurfNum) == 0.0) &&
- (state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirFloorEqNum ==
- ConvectionConstants::HcInt_GoldsteinNovoselacCeilingDiffuserFloor)) {
+ } break;
+
+ case IntConvClass::C_CentralAirHeat_Floor: {
+ if ((surfIntConv.zonePerimLength == 0.0) &&
+ (state.dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)intConvClass] == HcInt::GoldsteinNovoselacCeilingDiffuserFloor)) {
// no perimeter, Goldstein Novolselac model not good so revert to fisher pedersen model
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) = ConvectionConstants::HcInt_FisherPedersenCeilDiffuserFloor;
+ surfIntConv.hcModelEq = HcInt::FisherPedersenCeilDiffuserFloor;
+ surfIntConv.hcModelEqRpt = HcIntReportVals[(int)surfIntConv.hcModelEq];
} else {
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirFloorEqNum;
+ surfIntConv.hcModelEq = state.dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)intConvClass];
+ surfIntConv.hcModelEqRpt = HcIntReportVals[(int)surfIntConv.hcModelEq];
}
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirFloorUserCurveNum;
+ if (surfIntConv.hcModelEq == HcInt::UserCurve) {
+ surfIntConv.hcUserCurveNum = state.dataConvect->intAdaptiveConvAlgo.intConvClassUserCurveNums[(int)intConvClass];
}
- break;
- case ConvectionConstants::InConvClass::C_Windows:
- if ((state.dataSurface->SurfIntConvZonePerimLength(SurfNum) == 0.0) &&
- (state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWindowsEqNum ==
- ConvectionConstants::HcInt_GoldsteinNovoselacCeilingDiffuserWindow)) {
+ } break;
+
+ case IntConvClass::C_CentralAirHeat_Windows: {
+ if ((surfIntConv.zonePerimLength == 0.0) &&
+ (state.dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)intConvClass] == HcInt::GoldsteinNovoselacCeilingDiffuserWindow)) {
// no perimeter, Goldstein Novolselac model not good so revert to ISO15099
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) = ConvectionConstants::HcInt_ISO15099Windows;
+ surfIntConv.hcModelEq = HcInt::ISO15099Windows;
+ surfIntConv.hcModelEqRpt = HcIntReportVals[(int)surfIntConv.hcModelEq];
} else {
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWindowsEqNum;
- }
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWindowsUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::D_Walls:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircVertWallEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircVertWallUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::D_StableHoriz:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircStableHorizEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircStableHorizUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::D_UnstableHoriz:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircUnstableHorizEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircUnstableHorizUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::D_StableTilted:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircStableTiltedEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircStableTiltedUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::D_UnstableTilted:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircUnstableTiltedEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircUnstableTiltedUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::D_Windows:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircWindowsEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircWindowsUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::E_AssistFlowWalls:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedBuoyAssistingFlowWallEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedBuoyAssistingFlowWallUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::E_OpposFlowWalls:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedBuoyOpposingFlowWallEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedBuoyOpposingFlowWallUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::E_StableFloor:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedStableFloorEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedStableFloorUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::E_UnstableFloor:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedUnstableFloorEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedUnstableFloorUserCurveNum;
- }
- break;
- case ConvectionConstants::InConvClass::E_StableCeiling:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedStableCeilingEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedStableCeilingUserCurveNum;
+ surfIntConv.hcModelEq = state.dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)intConvClass];
+ surfIntConv.hcModelEqRpt = HcIntReportVals[(int)surfIntConv.hcModelEq];
}
- break;
- case ConvectionConstants::InConvClass::E_UnstableCeiling:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedUnstableCeilingEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedUnstableCeilingUserCurveNum;
+ if (surfIntConv.hcModelEq == HcInt::UserCurve) {
+ surfIntConv.hcUserCurveNum = state.dataConvect->intAdaptiveConvAlgo.intConvClassUserCurveNums[(int)intConvClass];
}
- break;
- case ConvectionConstants::InConvClass::E_Windows:
- state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedWindowsEqNum;
- if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == ConvectionConstants::HcInt_UserCurve) {
- state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) =
- state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedWindowsUserCurveNum;
+ } break;
+
+ default: { // Invalid has been asserted above so we can use default here
+ surfIntConv.hcModelEq = state.dataConvect->intAdaptiveConvAlgo.intConvClassEqNums[(int)intConvClass];
+ surfIntConv.hcModelEqRpt = HcIntReportVals[(int)surfIntConv.hcModelEq];
+ if (surfIntConv.hcModelEq == HcInt::UserCurve) {
+ surfIntConv.hcUserCurveNum = state.dataConvect->intAdaptiveConvAlgo.intConvClassUserCurveNums[(int)intConvClass];
}
- break;
- default:
- assert(false);
}
+ } // switch (intConvClass)
}
-void CalcUserDefinedInsideHcModel(EnergyPlusData &state, int const SurfNum, int const UserCurveNum, Real64 &Hc)
+Real64 CalcUserDefinedIntHcModel(EnergyPlusData &state, int const SurfNum, int const UserCurveNum)
{
// SUBROUTINE INFORMATION:
@@ -6804,60 +4653,53 @@ void CalcUserDefinedInsideHcModel(EnergyPlusData &state, int const SurfNum, int
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
Real64 tmpAirTemp;
- Real64 SupplyAirTemp;
Real64 AirChangeRate;
- int ZoneNum;
- Real64 SumMdotTemp;
- Real64 SumMdot;
- Real64 AirDensity;
-
- auto const &Zone(state.dataHeatBal->Zone);
-
- ZoneNum = state.dataSurface->Surface(SurfNum).Zone;
- SumMdotTemp = 0.0;
- SumMdot = 0.0;
- SupplyAirTemp = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT;
- if (Zone(ZoneNum).IsControlled) {
- int ZoneNode = Zone(ZoneNum).SystemZoneNodeNumber;
- AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(
- state,
- state.dataEnvrn->OutBaroPress,
- state.dataLoopNodes->Node(ZoneNode).Temp,
- Psychrometrics::PsyWFnTdpPb(state, state.dataLoopNodes->Node(ZoneNode).Temp, state.dataEnvrn->OutBaroPress));
- AirChangeRate = (state.dataLoopNodes->Node(ZoneNode).MassFlowRate * Constant::SecInHour) / (AirDensity * Zone(ZoneNum).Volume);
- if (state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex > 0) {
- for (int EquipNum = 1;
- EquipNum <= state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex).NumOfEquipTypes;
- ++EquipNum) {
- if (allocated(state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .EquipData(EquipNum)
- .OutletNodeNums)) {
- int thisZoneInletNode = state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ZoneNum).EquipListIndex)
- .EquipData(EquipNum)
- .OutletNodeNums(1);
- if ((thisZoneInletNode > 0) && (state.dataLoopNodes->Node(thisZoneInletNode).MassFlowRate > 0.0)) {
- SumMdotTemp += state.dataLoopNodes->Node(thisZoneInletNode).MassFlowRate * state.dataLoopNodes->Node(thisZoneInletNode).Temp;
- }
+
+ auto const &surface = state.dataSurface->Surface(SurfNum);
+ int zoneNum = state.dataSurface->Surface(SurfNum).Zone;
+ auto const &zone = state.dataHeatBal->Zone(zoneNum);
+
+ Real64 SumMdotTemp = 0.0;
+ Real64 SumMdot = 0.0;
+ Real64 SupplyAirTemp = state.dataZoneTempPredictorCorrector->zoneHeatBalance(zoneNum).MAT;
+ if (zone.IsControlled) {
+ auto const &zoneNode = state.dataLoopNodes->Node(zone.SystemZoneNodeNumber);
+ Real64 AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(
+ state, state.dataEnvrn->OutBaroPress, zoneNode.Temp, Psychrometrics::PsyWFnTdpPb(state, zoneNode.Temp, state.dataEnvrn->OutBaroPress));
+ AirChangeRate = (zoneNode.MassFlowRate * Constant::SecInHour) / (AirDensity * zone.Volume);
+
+ auto const &zoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(surface.Zone);
+ if (zoneEquipConfig.EquipListIndex > 0) {
+ auto const &zoneEquipList = state.dataZoneEquip->ZoneEquipList(zoneEquipConfig.EquipListIndex);
+ for (int EquipNum = 1; EquipNum <= zoneEquipList.NumOfEquipTypes; ++EquipNum) {
+ if (!allocated(zoneEquipList.EquipData(EquipNum).OutletNodeNums)) continue;
+
+ int zoneInletNodeNum = zoneEquipList.EquipData(EquipNum).OutletNodeNums(1);
+ if (zoneInletNodeNum <= 0) continue;
+ auto const &zoneInletNode = state.dataLoopNodes->Node(zoneInletNodeNum);
+ if (zoneInletNode.MassFlowRate > 0.0) { // Technically speaking, this check is not necessary since x += 0.0 is x.
+ SumMdotTemp += zoneInletNode.MassFlowRate * zoneInletNode.Temp;
}
- }
+ } // for (EquipNum)
}
if (SumMdot > 0.0) {
SupplyAirTemp = SumMdotTemp / SumMdot; // mass flow weighted inlet temperature
}
}
- auto &UserCurve = state.dataConvectionCoefficient->HcInsideUserCurve(UserCurveNum);
+ auto &userCurve = state.dataConvect->hcIntUserCurve(UserCurveNum);
+ auto &surfIntConv = state.dataSurface->surfIntConv(SurfNum);
- switch (UserCurve.ReferenceTempType) {
- case ConvectionConstants::RefTemp::MeanAirTemp:
- tmpAirTemp = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT;
+ switch (userCurve.refTempType) {
+ case RefTemp::MeanAirTemp:
+ tmpAirTemp = state.dataZoneTempPredictorCorrector->zoneHeatBalance(zoneNum).MAT;
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp;
break;
- case ConvectionConstants::RefTemp::AdjacentAirTemp:
+ case RefTemp::AdjacentAirTemp:
tmpAirTemp = state.dataHeatBal->SurfTempEffBulkAir(SurfNum);
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp;
break;
- case ConvectionConstants::RefTemp::SupplyAirTemp:
+ case RefTemp::SupplyAirTemp:
tmpAirTemp = SupplyAirTemp;
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::ZoneSupplyAirTemp;
break;
@@ -6869,32 +4711,30 @@ void CalcUserDefinedInsideHcModel(EnergyPlusData &state, int const SurfNum, int
Real64 HcFnTempDiff(0.0), HcFnTempDiffDivHeight(0.0), HcFnACH(0.0), HcFnACHDivPerimLength(0.0);
Kiva::ConvectionAlgorithm HcFnTempDiffFn(KIVA_CONST_CONV(0.0)), HcFnTempDiffDivHeightFn(KIVA_CONST_CONV(0.0));
- if (UserCurve.HcFnTempDiffCurveNum > 0) {
+ if (userCurve.hcFnTempDiffCurveNum > 0) {
HcFnTempDiff =
- Curve::CurveValue(state, UserCurve.HcFnTempDiffCurveNum, std::abs(state.dataHeatBalSurf->SurfInsideTempHist(1)(SurfNum) - tmpAirTemp));
+ Curve::CurveValue(state, userCurve.hcFnTempDiffCurveNum, std::abs(state.dataHeatBalSurf->SurfInsideTempHist(1)(SurfNum) - tmpAirTemp));
HcFnTempDiffFn = [&](double Tsurf, double Tamb, double, double, double) -> double {
- return Curve::CurveValue(state, UserCurve.HcFnTempDiffCurveNum, std::abs(Tsurf - Tamb));
+ return Curve::CurveValue(state, userCurve.hcFnTempDiffCurveNum, std::abs(Tsurf - Tamb));
};
}
- if (UserCurve.HcFnTempDiffDivHeightCurveNum > 0) {
- HcFnTempDiffDivHeight = Curve::CurveValue(
- state,
- UserCurve.HcFnTempDiffDivHeightCurveNum,
- (std::abs(state.dataHeatBalSurf->SurfInsideTempHist(1)(SurfNum) - tmpAirTemp) / state.dataSurface->SurfIntConvZoneWallHeight(SurfNum)));
+ if (userCurve.hcFnTempDiffDivHeightCurveNum > 0) {
+ HcFnTempDiffDivHeight =
+ Curve::CurveValue(state,
+ userCurve.hcFnTempDiffDivHeightCurveNum,
+ (std::abs(state.dataHeatBalSurf->SurfInsideTempHist(1)(SurfNum) - tmpAirTemp) / surfIntConv.zoneWallHeight));
HcFnTempDiffDivHeightFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double {
- return Curve::CurveValue(
- state, UserCurve.HcFnTempDiffDivHeightCurveNum, std::abs(Tsurf - Tamb) / state.dataSurface->SurfIntConvZoneWallHeight(SurfNum));
+ return Curve::CurveValue(state, userCurve.hcFnTempDiffDivHeightCurveNum, std::abs(Tsurf - Tamb) / surfIntConv.zoneWallHeight);
};
}
- if (UserCurve.HcFnACHCurveNum > 0) {
- HcFnACH = Curve::CurveValue(state, UserCurve.HcFnACHCurveNum, AirChangeRate);
+ if (userCurve.hcFnACHCurveNum > 0) {
+ HcFnACH = Curve::CurveValue(state, userCurve.hcFnACHCurveNum, AirChangeRate);
}
- if (UserCurve.HcFnACHDivPerimLengthCurveNum > 0) {
- HcFnACHDivPerimLength = Curve::CurveValue(
- state, UserCurve.HcFnACHDivPerimLengthCurveNum, (AirChangeRate / state.dataSurface->SurfIntConvZonePerimLength(SurfNum)));
+ if (userCurve.hcFnACHDivPerimLengthCurveNum > 0) {
+ HcFnACHDivPerimLength = Curve::CurveValue(state, userCurve.hcFnACHDivPerimLengthCurveNum, (AirChangeRate / surfIntConv.zonePerimLength));
}
if (state.dataSurface->Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) {
@@ -6903,13 +4743,13 @@ void CalcUserDefinedInsideHcModel(EnergyPlusData &state, int const SurfNum, int
return HcFnTempDiffFn(Tsurf, Tamb, HfTerm, Roughness, CosTilt) + HcFnTempDiffDivHeightFn(Tsurf, Tamb, HfTerm, Roughness, CosTilt) +
HcFnACH + HcFnACHDivPerimLength;
};
- Hc = 0.0;
+ return 0.0;
} else {
- Hc = HcFnTempDiff + HcFnTempDiffDivHeight + HcFnACH + HcFnACHDivPerimLength;
+ return HcFnTempDiff + HcFnTempDiffDivHeight + HcFnACH + HcFnACHDivPerimLength;
}
}
-void CalcUserDefinedOutsideHcModel(EnergyPlusData &state, int const SurfNum, int const UserCurveNum, Real64 &H)
+Real64 CalcUserDefinedExtHcModel(EnergyPlusData &state, int const SurfNum, int const UserCurveNum)
{
// SUBROUTINE INFORMATION:
@@ -6919,31 +4759,27 @@ void CalcUserDefinedOutsideHcModel(EnergyPlusData &state, int const SurfNum, int
// PURPOSE OF THIS SUBROUTINE:
// calculate user-defined convection correlations for outside face
- // METHODOLOGY EMPLOYED:
- // call curve objects to evaluate user's model equation
- // prepare independent parameters for x values
-
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
Real64 windVel;
Real64 Theta;
Real64 ThetaRad;
- auto &UserCurve = state.dataConvectionCoefficient->HcOutsideUserCurve(UserCurveNum);
+ auto &userCurve = state.dataConvect->hcExtUserCurve(UserCurveNum);
auto const &surface = state.dataSurface->Surface(SurfNum);
- switch (UserCurve.WindSpeedType) {
- case ConvectionConstants::RefWind::WeatherFile:
+ switch (userCurve.windSpeedType) {
+ case RefWind::WeatherFile:
windVel = state.dataEnvrn->WindSpeed;
break;
- case ConvectionConstants::RefWind::AtZ:
+ case RefWind::AtZ:
windVel = state.dataSurface->SurfOutWindSpeed(SurfNum);
break;
- case ConvectionConstants::RefWind::ParallelComp:
+ case RefWind::ParallelComp:
// WindSpeed , WindDir, surface Azimuth
Theta = CalcWindSurfaceTheta(state.dataEnvrn->WindDir, surface.Azimuth);
ThetaRad = Theta * Constant::DegToRadians;
break;
- case ConvectionConstants::RefWind::ParallelCompAtZ:
+ case RefWind::ParallelCompAtZ:
// Surface WindSpeed , Surface WindDir, surface Azimuth
Theta = CalcWindSurfaceTheta(state.dataSurface->SurfOutWindDir(SurfNum), surface.Azimuth);
ThetaRad = Theta * Constant::DegToRadians;
@@ -6957,33 +4793,29 @@ void CalcUserDefinedOutsideHcModel(EnergyPlusData &state, int const SurfNum, int
Kiva::ConvectionAlgorithm HnFnTempDiffFn(KIVA_CONST_CONV(0.0)), HnFnTempDiffDivHeightFn(KIVA_CONST_CONV(0.0));
Real64 HfFnWindSpeed(0.0), HnFnTempDiff(0.0), HnFnTempDiffDivHeight(0.0);
- if (UserCurve.HfFnWindSpeedCurveNum > 0) {
- HfFnWindSpeed = Curve::CurveValue(state, UserCurve.HfFnWindSpeedCurveNum, windVel);
+
+ if (userCurve.hfFnWindSpeedCurveNum > 0) {
+ HfFnWindSpeed = Curve::CurveValue(state, userCurve.hfFnWindSpeedCurveNum, windVel);
HfFnWindSpeedFn = [&](double, double, double, double windSpeed) -> double {
- return Curve::CurveValue(state, UserCurve.HfFnWindSpeedCurveNum, windSpeed);
+ return Curve::CurveValue(state, userCurve.hfFnWindSpeedCurveNum, windSpeed);
};
}
- if (UserCurve.HnFnTempDiffCurveNum > 0) {
- HnFnTempDiff =
- Curve::CurveValue(state,
- UserCurve.HnFnTempDiffCurveNum,
- std::abs(state.dataHeatBalSurf->SurfInsideTempHist(1)(SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum)));
+ auto const &surfExtConv = state.dataSurface->surfExtConv(SurfNum);
+
+ Real64 surfDeltaTemp = std::abs(state.dataHeatBalSurf->SurfInsideTempHist(1)(SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum));
+ if (userCurve.hnFnTempDiffCurveNum > 0) {
+ HnFnTempDiff = Curve::CurveValue(state, userCurve.hnFnTempDiffCurveNum, surfDeltaTemp);
HnFnTempDiffFn = [&](double Tsurf, double Tamb, double, double, double) -> double {
- return Curve::CurveValue(state, UserCurve.HnFnTempDiffCurveNum, std::abs(Tsurf - Tamb));
+ return Curve::CurveValue(state, userCurve.hnFnTempDiffCurveNum, std::abs(Tsurf - Tamb));
};
}
- if (UserCurve.HnFnTempDiffDivHeightCurveNum > 0) {
- if (state.dataSurface->SurfOutConvFaceHeight(SurfNum) > 0.0) {
- HnFnTempDiffDivHeight = Curve::CurveValue(
- state,
- UserCurve.HnFnTempDiffDivHeightCurveNum,
- ((std::abs(state.dataHeatBalSurf->SurfInsideTempHist(1)(SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum))) /
- state.dataSurface->SurfOutConvFaceHeight(SurfNum)));
+ if (userCurve.hnFnTempDiffDivHeightCurveNum > 0) {
+ if (surfExtConv.faceHeight > 0.0) {
+ HnFnTempDiffDivHeight = Curve::CurveValue(state, userCurve.hnFnTempDiffDivHeightCurveNum, surfDeltaTemp / surfExtConv.faceHeight);
HnFnTempDiffDivHeightFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double {
- return Curve::CurveValue(
- state, UserCurve.HnFnTempDiffDivHeightCurveNum, ((std::abs(Tsurf - Tamb)) / state.dataSurface->SurfOutConvFaceHeight(SurfNum)));
+ return Curve::CurveValue(state, userCurve.hnFnTempDiffDivHeightCurveNum, (std::abs(Tsurf - Tamb) / surfExtConv.faceHeight));
};
}
}
@@ -6996,7 +4828,7 @@ void CalcUserDefinedOutsideHcModel(EnergyPlusData &state, int const SurfNum, int
HfTerm;
};
}
- H = HfFnWindSpeed + HnFnTempDiff + HnFnTempDiffDivHeight;
+ return HfFnWindSpeed + HnFnTempDiff + HnFnTempDiffDivHeight;
}
//** Begin catalog of Hc equation functions. **** !*************************************************
@@ -7016,13 +4848,10 @@ Real64 CalcFisherPedersenCeilDiffuserFloor(EnergyPlusData &state,
// REFERENCE: Fisher, D.E. and C.O. Pedersen, Convective Heat Transfer in Building Energy and Thermal Load Calculations,
// ASHRAE Transactions, vol. 103, Pt. 2, 1997, p.13
- Real64 Hforced;
-
if (ACH >= 3.0) {
- Hforced = 3.873 + 0.082 * std::pow(ACH, 0.98);
- return Hforced;
- } else { // Revert to purely natural convection
- Hforced = 4.11365377688938; // Value of Hforced when ACH=3
+ return 3.873 + 0.082 * std::pow(ACH, 0.98);
+ } else { // Revert to purely natural convection
+ Real64 Hforced = 4.11365377688938; // Value of Hforced when ACH=3
return CalcFisherPedersenCeilDiffuserNatConv(state, Hforced, ACH, Tsurf, Tair, cosTilt, humRat, height, isWindow);
}
}
@@ -7042,13 +4871,10 @@ Real64 CalcFisherPedersenCeilDiffuserCeiling(EnergyPlusData &state,
// REFERENCE: Fisher, D.E. and C.O. Pedersen, Convective Heat Transfer in Building Energy and Thermal Load Calculations,
// ASHRAE Transactions, vol. 103, Pt. 2, 1997, p.13
- Real64 Hforced;
-
if (ACH >= 3.0) {
- Hforced = 2.234 + 4.099 * std::pow(ACH, 0.503);
- return Hforced;
- } else { // Revert to purely natural convection
- Hforced = 9.35711423763866; // Value of Hforced when ACH=3
+ return 2.234 + 4.099 * std::pow(ACH, 0.503);
+ } else { // Revert to purely natural convection
+ Real64 Hforced = 9.35711423763866; // Value of Hforced when ACH=3
return CalcFisherPedersenCeilDiffuserNatConv(state, Hforced, ACH, Tsurf, Tair, cosTilt, humRat, height, isWindow);
}
}
@@ -7068,13 +4894,10 @@ Real64 CalcFisherPedersenCeilDiffuserWalls(EnergyPlusData &state,
// REFERENCE: Fisher, D.E. and C.O. Pedersen, Convective Heat Transfer in Building Energy and Thermal Load Calculations,
// ASHRAE Transactions, vol. 103, Pt. 2, 1997, p.13
- Real64 Hforced;
-
if (ACH >= 3.0) {
- Hforced = 1.208 + 1.012 * std::pow(ACH, 0.604);
- return Hforced;
- } else { // Revert to purely natural convection
- Hforced = 3.17299636062606; // Value of Hforced when ACH=3
+ return 1.208 + 1.012 * std::pow(ACH, 0.604);
+ } else { // Revert to purely natural convection
+ Real64 Hforced = 3.17299636062606; // Value of Hforced when ACH=3
return CalcFisherPedersenCeilDiffuserNatConv(state, Hforced, ACH, Tsurf, Tair, cosTilt, humRat, height, isWindow);
}
}
@@ -7119,16 +4942,13 @@ Real64 CalcAlamdariHammondUnstableHorizontal(Real64 const DeltaTemp, // [
// Calculate model equation for Alamdari and Hammond
// This function only for the Unstable heat flow direction for horizontal surfaces
- // METHODOLOGY EMPLOYED:
- // isolate function for equation.
-
// REFERENCES:
// Alamdari, F. and G.P. Hammond. 1983. Improved data correlations
// for buoyancy-driven convection in rooms. Building Services Engineering
// Research & Technology. Vol. 4, No. 3.
- return std::pow(pow_6(1.4 * std::pow(std::abs(DeltaTemp) / HydraulicDiameter, ConvectionConstants::OneFourth)) + (1.63 * pow_2(DeltaTemp)),
- ConvectionConstants::OneSixth); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), OneThird ) ) changed to pow_2( DeltaTemp )
+ return std::pow(pow_6(1.4 * std::pow(std::abs(DeltaTemp) / HydraulicDiameter, 0.25)) + (1.63 * pow_2(DeltaTemp)),
+ 1.0 / 6.0); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), 1.0/3.0 ) ) changed to pow_2( DeltaTemp )
}
Real64 CalcAlamdariHammondUnstableHorizontal(EnergyPlusData &state,
@@ -7137,26 +4957,14 @@ Real64 CalcAlamdariHammondUnstableHorizontal(EnergyPlusData &state,
int const SurfNum // for messages
)
{
- Real64 Hn; // function result
-
+ std::string_view constexpr routineName = "CalcAlamdariHammondUnstableHorizontal";
if (HydraulicDiameter > 0.0) {
- Hn = CalcAlamdariHammondUnstableHorizontal(DeltaTemp, HydraulicDiameter);
+ return CalcAlamdariHammondUnstableHorizontal(DeltaTemp, HydraulicDiameter);
} else {
- Hn = 9.999;
- if (state.dataConvectionCoefficient->AHUnstableHorizontalErrorIDX == 0) {
- ShowSevereMessage(state, "CalcAlamdariHammondUnstableHorizontal: Convection model not evaluated (would divide by zero)");
- ShowContinueError(state,
- format("Effective hydraulic diameter is zero, convection model not applicable for surface ={}",
- state.dataSurface->Surface(SurfNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
- ShowRecurringSevereErrorAtEnd(
- state,
- "CalcAlamdariHammondUnstableHorizontal: Convection model not evaluated because zero hydraulic diameter and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->AHUnstableHorizontalErrorIDX);
+ ErrorObjectHeader eoh{routineName, "Surface", state.dataSurface->Surface(SurfNum).Name};
+ ShowWarningHydraulicDiameterZero(state, state.dataConvect->AHUnstableHorizontalErrorIDX, eoh);
+ return 9.999;
}
-
- return Hn;
}
Real64 CalcAlamdariHammondStableHorizontal(Real64 const DeltaTemp, // [C] temperature difference between surface and air
@@ -7172,15 +4980,12 @@ Real64 CalcAlamdariHammondStableHorizontal(Real64 const DeltaTemp, // [C]
// Calculate model equation for Alamdari and Hammond
// This function only for the Stable heat flow direction for horizontal surfaces
- // METHODOLOGY EMPLOYED:
- // isolate function for equation.
-
// REFERENCES:
// Alamdari, F. and G.P. Hammond. 1983. Improved data correlations
// for buoyancy-driven convection in rooms. Building Services Engineering
// Research & Technology. Vol. 4, No. 3.
- return 0.6 * std::pow(std::abs(DeltaTemp) / pow_2(HydraulicDiameter), ConvectionConstants::OneFifth);
+ return 0.6 * std::pow(std::abs(DeltaTemp) / pow_2(HydraulicDiameter), 0.2);
}
Real64 CalcAlamdariHammondStableHorizontal(EnergyPlusData &state,
@@ -7189,27 +4994,17 @@ Real64 CalcAlamdariHammondStableHorizontal(EnergyPlusData &state,
int const SurfNum // for messages
)
{
-
- Real64 Hn; // function result, natural convection Hc value
-
+ std::string_view constexpr routineName = "CalcAlamdariHammondStableHorizontal";
if (HydraulicDiameter > 0.0) {
- Hn = CalcAlamdariHammondStableHorizontal(DeltaTemp, HydraulicDiameter);
- } else {
- Hn = 9.999;
- if (state.dataConvectionCoefficient->AHStableHorizontalErrorIDX == 0) {
- ShowSevereMessage(state, "CalcAlamdariHammondStableHorizontal: Convection model not evaluated (would divide by zero)");
- ShowContinueError(state,
- format("Effective hydraulic diameter is zero, convection model not applicable for surface ={}",
- state.dataSurface->Surface(SurfNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
+ return CalcAlamdariHammondStableHorizontal(DeltaTemp, HydraulicDiameter);
+ } else {
+ ErrorObjectHeader eoh{routineName, "Surface", state.dataSurface->Surface(SurfNum).Name};
+ ShowWarningHydraulicDiameterZero(state, state.dataConvect->AHStableHorizontalErrorIDX, eoh);
+ if (DeltaTemp == 0.0 && !state.dataGlobal->WarmupFlag) {
+ ShowWarningDeltaTempZero(state, state.dataConvect->BMMixedAssistedWallErrorIDX1, eoh);
}
- ShowRecurringSevereErrorAtEnd(
- state,
- "CalcAlamdariHammondStableHorizontal: Convection model not evaluated because zero hydraulic diameter and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->AHStableHorizontalErrorIDX);
+ return 9.999;
}
-
- return Hn;
}
Real64 CalcAlamdariHammondVerticalWall(Real64 const DeltaTemp, // [C] temperature difference between surface and air
@@ -7232,8 +5027,8 @@ Real64 CalcAlamdariHammondVerticalWall(Real64 const DeltaTemp, // [C] temperatur
// for buoyancy-driven convection in rooms. Building Services Engineering
// Research & Technology. Vol. 4, No. 3.
- return std::pow(pow_6(1.5 * std::pow(std::abs(DeltaTemp) / Height, ConvectionConstants::OneFourth)) + (1.23 * pow_2(DeltaTemp)),
- ConvectionConstants::OneSixth); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), OneThird ) ) changed to pow_2( DeltaTemp )
+ return std::pow(pow_6(1.5 * std::pow(std::abs(DeltaTemp) / Height, 0.25)) + (1.23 * pow_2(DeltaTemp)),
+ 1.0 / 6.0); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), 1.0/3.0 ) ) changed to pow_2( DeltaTemp )
}
Real64 CalcAlamdariHammondVerticalWall(EnergyPlusData &state,
@@ -7242,27 +5037,15 @@ Real64 CalcAlamdariHammondVerticalWall(EnergyPlusData &state,
int const SurfNum // for messages
)
{
- // Return value
- Real64 Hn; // function result, natural convection Hc value
+ std::string_view constexpr routineName = "CalcAlamdariHammondVerticalWall";
if (Height > 0.0) {
- Hn = CalcAlamdariHammondVerticalWall(DeltaTemp, Height);
+ return CalcAlamdariHammondVerticalWall(DeltaTemp, Height);
} else {
- Hn = 9.999;
- if (state.dataConvectionCoefficient->AHVerticalWallErrorIDX == 0) {
- ShowSevereMessage(state, "CalcAlamdariHammondVerticalWall: Convection model not evaluated (would divide by zero)");
- ShowContinueError(state,
- format("Effective hydraulic diameter is zero, convection model not applicable for surface ={}",
- state.dataSurface->Surface(SurfNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
- ShowRecurringSevereErrorAtEnd(
- state,
- "CalcAlamdariHammondVerticalWall: Convection model not evaluated because zero hydraulic diameter and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->AHVerticalWallErrorIDX);
+ ErrorObjectHeader eoh{routineName, "Surface", state.dataSurface->Surface(SurfNum).Name};
+ ShowWarningHydraulicDiameterZero(state, state.dataConvect->AHVerticalWallErrorIDX, eoh);
+ return 9.999;
}
-
- return Hn;
}
Real64 CalcKhalifaEq3WallAwayFromHeat(Real64 const DeltaTemp) // [C] temperature difference between surface and air
@@ -7286,12 +5069,7 @@ Real64 CalcKhalifaEq3WallAwayFromHeat(Real64 const DeltaTemp) // [C] temperature
// air flow modeling within dynamic whole-building simulations.
// PhD. Thesis. University of Strathclyde, Glasgow, UK.
- // Return value
- Real64 Hc; // function result
-
- Hc = 2.07 * std::pow(std::abs(DeltaTemp), 0.23);
-
- return Hc;
+ return 2.07 * std::pow(std::abs(DeltaTemp), 0.23);
}
Real64 CalcKhalifaEq4CeilingAwayFromHeat(Real64 const DeltaTemp) // [C] temperature difference between surface and air
@@ -7304,9 +5082,6 @@ Real64 CalcKhalifaEq4CeilingAwayFromHeat(Real64 const DeltaTemp) // [C] temperat
// PURPOSE OF THIS FUNCTION:
// Calculate model equation for Khalifa's Eq 4 for Ceilings Away From Heat
- // METHODOLOGY EMPLOYED:
- // isolate function for equation.
-
// REFERENCES:
// Khalifa AJN. 1989 Heat transfer processes in buildings. Ph.D. Thesis,
// University of Wales College of Cardiff, Cardiff, UK.
@@ -7315,12 +5090,7 @@ Real64 CalcKhalifaEq4CeilingAwayFromHeat(Real64 const DeltaTemp) // [C] temperat
// air flow modeling within dynamic whole-building simulations.
// PhD. Thesis. University of Strathclyde, Glasgow, UK.
- // Return value
- Real64 Hc; // function result
-
- Hc = 2.72 * std::pow(std::abs(DeltaTemp), 0.13);
-
- return Hc;
+ return 2.72 * std::pow(std::abs(DeltaTemp), 0.13);
}
Real64 CalcKhalifaEq5WallsNearHeat(Real64 const DeltaTemp) // [C] temperature difference between surface and air
@@ -7333,9 +5103,6 @@ Real64 CalcKhalifaEq5WallsNearHeat(Real64 const DeltaTemp) // [C] temperature di
// PURPOSE OF THIS FUNCTION:
// Calculate model equation for Khalifa's Eq 5 for Walls near the heater
- // METHODOLOGY EMPLOYED:
- // isolate function for equation.
-
// REFERENCES:
// Khalifa AJN. 1989 Heat transfer processes in buildings. Ph.D. Thesis,
// University of Wales College of Cardiff, Cardiff, UK.
@@ -7344,12 +5111,7 @@ Real64 CalcKhalifaEq5WallsNearHeat(Real64 const DeltaTemp) // [C] temperature di
// air flow modeling within dynamic whole-building simulations.
// PhD. Thesis. University of Strathclyde, Glasgow, UK.
- // Return value
- Real64 Hc; // function result
-
- Hc = 1.98 * std::pow(std::abs(DeltaTemp), 0.32);
-
- return Hc;
+ return 1.98 * std::pow(std::abs(DeltaTemp), 0.32);
}
Real64 CalcKhalifaEq6NonHeatedWalls(Real64 const DeltaTemp) // [C] temperature difference between surface and air
@@ -7362,9 +5124,6 @@ Real64 CalcKhalifaEq6NonHeatedWalls(Real64 const DeltaTemp) // [C] temperature d
// PURPOSE OF THIS FUNCTION:
// Calculate model equation for Khalifa's Eq 6 for non-heated walls
- // METHODOLOGY EMPLOYED:
- // isolate function for equation.
-
// REFERENCES:
// Khalifa AJN. 1989 Heat transfer processes in buildings. Ph.D. Thesis,
// University of Wales College of Cardiff, Cardiff, UK.
@@ -7373,12 +5132,7 @@ Real64 CalcKhalifaEq6NonHeatedWalls(Real64 const DeltaTemp) // [C] temperature d
// air flow modeling within dynamic whole-building simulations.
// PhD. Thesis. University of Strathclyde, Glasgow, UK.
- // Return value
- Real64 Hc; // function result
-
- Hc = 2.30 * std::pow(std::abs(DeltaTemp), 0.24);
-
- return Hc;
+ return 2.30 * std::pow(std::abs(DeltaTemp), 0.24);
}
Real64 CalcKhalifaEq7Ceiling(Real64 const DeltaTemp) // [C] temperature difference between surface and air
@@ -7391,9 +5145,6 @@ Real64 CalcKhalifaEq7Ceiling(Real64 const DeltaTemp) // [C] temperature differen
// PURPOSE OF THIS FUNCTION:
// Calculate model equation for Khalifa's Eq 7 for ceilings
- // METHODOLOGY EMPLOYED:
- // isolate function for equation.
-
// REFERENCES:
// Khalifa AJN. 1989 Heat transfer processes in buildings. Ph.D. Thesis,
// University of Wales College of Cardiff, Cardiff, UK.
@@ -7402,12 +5153,7 @@ Real64 CalcKhalifaEq7Ceiling(Real64 const DeltaTemp) // [C] temperature differen
// air flow modeling within dynamic whole-building simulations.
// PhD. Thesis. University of Strathclyde, Glasgow, UK.
- // Return value
- Real64 Hc; // function result
-
- Hc = 3.10 * std::pow(std::abs(DeltaTemp), 0.17);
-
- return Hc;
+ return 3.10 * std::pow(std::abs(DeltaTemp), 0.17);
}
Real64 CalcAwbiHattonHeatedFloor(Real64 const DeltaTemp, // [C] temperature difference between surface and air
@@ -7423,7 +5169,6 @@ Real64 CalcAwbiHattonHeatedFloor(Real64 const DeltaTemp, // [C] temperatu
// Calculate model equation for Awbi and Hatton for heated floors
// METHODOLOGY EMPLOYED:
- // isolate function for equation.
// apply numerical protection for low values of hydraulic diameter
// REFERENCES:
@@ -7431,18 +5176,12 @@ Real64 CalcAwbiHattonHeatedFloor(Real64 const DeltaTemp, // [C] temperatu
// Energy and Buildings 30 (1999) 233-244.
// This function is for equation 15 in the reference
- // Return value
- Real64 Hc; // function result
-
- Real64 const pow_fac(2.175 / std::pow(1.0, 0.076));
-
if (HydraulicDiameter > 1.0) {
- Hc = 2.175 * std::pow(std::abs(DeltaTemp), 0.308) / std::pow(HydraulicDiameter, 0.076);
+ return 2.175 * std::pow(std::abs(DeltaTemp), 0.308) / std::pow(HydraulicDiameter, 0.076);
} else {
- Hc = pow_fac * std::pow(std::abs(DeltaTemp), 0.308);
+ Real64 const pow_fac(2.175 / std::pow(1.0, 0.076));
+ return pow_fac * std::pow(std::abs(DeltaTemp), 0.308);
}
-
- return Hc;
}
Real64 CalcAwbiHattonHeatedWall(Real64 const DeltaTemp, // [C] temperature difference between surface and air
@@ -7457,24 +5196,12 @@ Real64 CalcAwbiHattonHeatedWall(Real64 const DeltaTemp, // [C] temperatur
// PURPOSE OF THIS FUNCTION:
// Calculate model equation for Awbi and Hatton for heated walls
- // METHODOLOGY EMPLOYED:
- // isolate function for equation.
-
// REFERENCES:
// Awbi, H.B. and A. Hatton. 1999. Natural convection from heated room surfaces.
// Energy and Buildings 30 (1999) 233-244.
// This function is for equation 12 in the reference
- // Return value
- Real64 Hc; // function result
-
- if (HydraulicDiameter > 1.0) {
- Hc = 1.823 * std::pow(std::abs(DeltaTemp), 0.293) / std::pow(HydraulicDiameter, 0.121);
- } else {
- Hc = 1.823 * std::pow(std::abs(DeltaTemp), 0.293) / std::pow(1.0, 0.121);
- }
-
- return Hc;
+ return 1.823 * std::pow(std::abs(DeltaTemp), 0.293) / std::pow(max(HydraulicDiameter, 1.0), 0.121);
}
Real64 CalcBeausoleilMorrisonMixedAssistedWall(Real64 const DeltaTemp, // [C] temperature difference between surface and air
@@ -7493,22 +5220,18 @@ Real64 CalcBeausoleilMorrisonMixedAssistedWall(Real64 const DeltaTemp, // [C
// Calculate model equation Beausoleil-Morrison's mixed flow regime
// with mechanical and buoyancy forces assisting each other along a Wall
- // METHODOLOGY EMPLOYED:
- // isolate function for equation.
-
// REFERENCES:
// Beausoleil-Morrison, I. 2000. The adaptive coupling of heat and
// air flow modeling within dynamic whole-building simulations.
// PhD. Thesis. University of Strathclyde, Glasgow, UK.
Real64 cofpow =
- std::sqrt(pow_6(1.5 * std::pow(std::abs(DeltaTemp) / Height, ConvectionConstants::OneFourth)) +
- std::pow(1.23 * pow_2(DeltaTemp), ConvectionConstants::OneSixth)) +
+ std::sqrt(pow_6(1.5 * std::pow(std::abs(DeltaTemp) / Height, 0.25)) + std::pow(1.23 * pow_2(DeltaTemp), 1.0 / 6.0)) +
pow_3(((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) *
(-0.199 + 0.190 * std::pow(AirChangeRate,
- 0.8))); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), OneThird ) ) changed to pow_2( DeltaTemp )
+ 0.8))); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), 1.0/3.0 ) ) changed to pow_2( DeltaTemp )
Real64 Hc = std::pow(std::abs(cofpow),
- ConvectionConstants::OneThird); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), OneThird ) ) changed to pow_2( DeltaTemp )
+ 1.0 / 3.0); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), 1.0/3.0 ) ) changed to pow_2( DeltaTemp )
if (cofpow < 0.0) {
Hc = -Hc;
}
@@ -7522,37 +5245,19 @@ Real64 CalcBeausoleilMorrisonMixedAssistedWall(EnergyPlusData &state,
int const ZoneNum // index of zone for messaging
)
{
+ std::string_view constexpr routineName = "CalcBeausoleilMorrisonMixedAssistedWall";
+
if ((std::abs(DeltaTemp) > DataHVACGlobals::SmallTempDiff) && (Height != 0.0)) {
Real64 SupplyAirTemp = CalcZoneSupplyAirTemp(state, ZoneNum);
Real64 AirChangeRate = CalcZoneSystemACH(state, ZoneNum);
return CalcBeausoleilMorrisonMixedAssistedWall(DeltaTemp, Height, SurfTemp, SupplyAirTemp, AirChangeRate);
} else {
+ ErrorObjectHeader eoh{routineName, "Zone", state.dataHeatBal->Zone(ZoneNum).Name};
if (Height == 0.0) {
- if (state.dataConvectionCoefficient->BMMixedAssistedWallErrorIDX2 == 0) {
- ShowWarningMessage(state, "CalcBeausoleilMorrisonMixedAssistedWall: Convection model not evaluated (would divide by zero)");
- ShowContinueError(
- state,
- format("Effective height is zero, convection model not applicable for zone named ={}", state.dataHeatBal->Zone(ZoneNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
-
- ShowRecurringWarningErrorAtEnd(state,
- "CalcBeausoleilMorrisonMixedAssistedWall: Convection model not evaluated because of zero height "
- "and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->BMMixedAssistedWallErrorIDX2);
+ ShowWarningHydraulicDiameterZero(state, state.dataConvect->BMMixedAssistedWallErrorIDX2, eoh);
}
if (DeltaTemp == 0.0 && !state.dataGlobal->WarmupFlag) {
- if (state.dataConvectionCoefficient->BMMixedAssistedWallErrorIDX1 == 0) {
- ShowWarningMessage(state, "CalcBeausoleilMorrisonMixedAssistedWall: Convection model not evaluated (would divide by zero)");
- ShowContinueError(state, "The temperature difference between surface and air is zero");
- ShowContinueError(state, format("Occurs for zone named = {}", state.dataHeatBal->Zone(ZoneNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
-
- ShowRecurringWarningErrorAtEnd(state,
- "CalcBeausoleilMorrisonMixedAssistedWall: Convection model not evaluated because of zero temperature "
- "difference and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->BMMixedAssistedWallErrorIDX1);
+ ShowWarningDeltaTempZero(state, state.dataConvect->BMMixedAssistedWallErrorIDX1, eoh);
}
return 9.999;
}
@@ -7574,39 +5279,31 @@ Real64 CalcBeausoleilMorrisonMixedOpposingWall(Real64 const DeltaTemp, // [C
// Calculate model equation Beausoleil-Morrison's mixed flow regime
// with mechanical and buoyancy forces opposing each other along a Wall
- // METHODOLOGY EMPLOYED:
- // isolate function for equation.
-
// REFERENCES:
// Beausoleil-Morrison, I. 2000. The adaptive coupling of heat and
// air flow modeling within dynamic whole-building simulations.
// PhD. Thesis. University of Strathclyde, Glasgow, UK.
- Real64 HcTmp1;
- Real64 HcTmp2;
- Real64 HcTmp3;
- Real64 cofpow;
+ Real64 HcTmp1 = 9.999;
+ Real64 HcTmp2 = 9.999;
if (Height != 0.0) {
- cofpow = std::sqrt(pow_6(1.5 * std::pow(std::abs(DeltaTemp) / Height, ConvectionConstants::OneFourth)) +
- std::pow(1.23 * pow_2(DeltaTemp), ConvectionConstants::OneSixth)) -
- pow_3(((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) *
- (-0.199 + 0.190 * std::pow(AirChangeRate,
- 0.8))); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), OneThird ) ) changed to pow_2( DeltaTemp )
+ Real64 cofpow =
+ std::sqrt(pow_6(1.5 * std::pow(std::abs(DeltaTemp) / Height, 0.25)) + std::pow(1.23 * pow_2(DeltaTemp), 1.0 / 6.0)) -
+ pow_3(((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) *
+ (-0.199 + 0.190 * std::pow(AirChangeRate,
+ 0.8))); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), 1.0/3.0 ) ) changed to pow_2( DeltaTemp )
HcTmp1 = std::pow(std::abs(cofpow),
- ConvectionConstants::OneThird); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), OneThird ) ) changed to pow_2( DeltaTemp )
+ 1.0 / 3.0); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), 1.0/3.0 ) ) changed to pow_2( DeltaTemp )
if (cofpow < 0.0) {
HcTmp1 = -HcTmp1;
}
- HcTmp2 =
- 0.8 * std::pow(pow_6(1.5 * std::pow(std::abs(DeltaTemp) / Height, ConvectionConstants::OneFourth)) + (1.23 * pow_2(DeltaTemp)),
- ConvectionConstants::OneSixth); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), OneThird ) ) changed to pow_2( DeltaTemp )
- } else {
- HcTmp1 = 9.999;
- HcTmp2 = 9.999;
+ HcTmp2 = 0.8 * std::pow(pow_6(1.5 * std::pow(std::abs(DeltaTemp) / Height, 0.25)) + (1.23 * pow_2(DeltaTemp)),
+ 1.0 / 6.0); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), 1.0/3.0 ) ) changed to pow_2( DeltaTemp )
}
- HcTmp3 = 0.8 * ((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) * (-0.199 + 0.190 * std::pow(AirChangeRate, 0.8));
+
+ Real64 HcTmp3 = 0.8 * ((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) * (-0.199 + 0.190 * std::pow(AirChangeRate, 0.8));
return max(max(HcTmp1, HcTmp2), HcTmp3);
}
@@ -7618,21 +5315,13 @@ Real64 CalcBeausoleilMorrisonMixedOpposingWall(EnergyPlusData &state,
int const ZoneNum // index of zone for messaging
)
{
+ std::string_view constexpr routineName = "CalcBeausoleilMorrisonMixedOpposingWall";
+ ErrorObjectHeader eoh{routineName, "Zone", state.dataHeatBal->Zone(ZoneNum).Name};
if (std::abs(DeltaTemp) > DataHVACGlobals::SmallTempDiff) { // protect divide by zero
if (Height == 0.0) {
- if (state.dataConvectionCoefficient->BMMixedOpposingWallErrorIDX2 == 0) {
- ShowSevereMessage(state, "CalcBeausoleilMorrisonMixedOpposingWall: Convection model not evaluated (would divide by zero)");
- ShowContinueError(
- state,
- format("Effective height is zero, convection model not applicable for zone named ={}", state.dataHeatBal->Zone(ZoneNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
-
- ShowRecurringSevereErrorAtEnd(
- state,
- "CalcBeausoleilMorrisonMixedOpposingWall: Convection model not evaluated because of zero height and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->BMMixedOpposingWallErrorIDX2);
+ ShowWarningHydraulicDiameterZero(state, state.dataConvect->BMMixedOpposingWallErrorIDX2, eoh);
+ return 9.999;
}
Real64 SupplyAirTemp = CalcZoneSupplyAirTemp(state, ZoneNum);
Real64 AirChangeRate = CalcZoneSystemACH(state, ZoneNum);
@@ -7640,17 +5329,7 @@ Real64 CalcBeausoleilMorrisonMixedOpposingWall(EnergyPlusData &state,
} else {
if (!state.dataGlobal->WarmupFlag) {
- if (state.dataConvectionCoefficient->BMMixedOpposingWallErrorIDX1 == 0) {
- ShowSevereMessage(state, "CalcBeausoleilMorrisonMixedOpposingWall: Convection model not evaluated (would divide by zero)");
- ShowContinueError(state, "The temperature difference between surface and air is zero");
- ShowContinueError(state, format("Occurs for zone named = {}", state.dataHeatBal->Zone(ZoneNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
-
- ShowRecurringSevereErrorAtEnd(state,
- "CalcBeausoleilMorrisonMixedOpposingWall: Convection model not evaluated because of zero temperature "
- "difference and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->BMMixedOpposingWallErrorIDX1);
+ ShowWarningDeltaTempZero(state, state.dataConvect->BMMixedOpposingWallErrorIDX1, eoh);
}
return 9.999;
}
@@ -7672,23 +5351,93 @@ Real64 CalcBeausoleilMorrisonMixedStableFloor(Real64 const DeltaTemp, //
// Calculate model equation Beausoleil-Morrison's mixed flow regime
// with mechanical and buoyancy forces acting on an thermally stable floor
- // METHODOLOGY EMPLOYED:
- // isolate function for equation.
-
// REFERENCES:
// Beausoleil-Morrison, I. 2000. The adaptive coupling of heat and
// air flow modeling within dynamic whole-building simulations.
// PhD. Thesis. University of Strathclyde, Glasgow, UK.
- Real64 cofpow = pow_3(0.6 * std::pow(std::abs(DeltaTemp) / HydraulicDiameter, ConvectionConstants::OneFifth)) +
+ Real64 cofpow = pow_3(0.6 * std::pow(std::abs(DeltaTemp) / HydraulicDiameter, 0.2)) +
pow_3(((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) * (0.159 + 0.116 * std::pow(AirChangeRate, 0.8)));
- Real64 Hc = std::pow(std::abs(cofpow), ConvectionConstants::OneThird);
+ Real64 Hc = std::pow(std::abs(cofpow), 1.0 / 3.0);
if (cofpow < 0.0) {
Hc = -Hc;
}
return Hc;
}
+void ShowWarningHydraulicDiameterZero(EnergyPlusData &state, int &errorIdx, ErrorObjectHeader const &eoh)
+{
+ if (errorIdx == 0) {
+ ShowWarningMessage(state, format("{}: Convection model not evaluated (would divide by zero)", eoh.routineName));
+ ShowContinueError(
+ state, format("Effective hydraulic diameter is zero, convection model not applicable for {} named {}", eoh.objectType, eoh.objectName));
+ ShowContinueError(state, "Convection heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
+ }
+ ShowRecurringWarningErrorAtEnd(state,
+ format("{}: Convection model not evaluated because effective hydraulic diameter is zero "
+ "and set to 9.999 [W/m2-K]",
+ eoh.routineName),
+ errorIdx);
+}
+
+void ShowWarningDeltaTempZero(EnergyPlusData &state, int &errorIdx, ErrorObjectHeader const &eoh)
+{
+ if (errorIdx == 0) {
+ ShowWarningMessage(state, format("{}: Convection model not evaluated (would divide by zero)", eoh.routineName));
+ ShowContinueError(state, "The temperature difference between surface and air is zero");
+ ShowContinueError(state, format("Occurs for {} named {}", eoh.objectType, eoh.objectName));
+ ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
+ }
+
+ ShowRecurringWarningErrorAtEnd(state,
+ format("{}: Convection model not evaluated because of zero temperature "
+ "difference and set to 9.999 [W/m2-K]",
+ eoh.routineName),
+ errorIdx);
+}
+
+void ShowWarningWindowLocation(EnergyPlusData &state, int &errorIdx, ErrorObjectHeader const &eoh, IntConvWinLoc winLoc)
+{
+ if (errorIdx == 0) {
+ ShowSevereMessage(state, format("{}: Convection model not evaluated (bad relative window location)", eoh.routineName));
+ ShowContinueError(state, format("Value for window location = {}", winLoc));
+ ShowContinueError(state, format("Occurs for {} named {}", eoh.objectType, eoh.objectName));
+ ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
+ }
+ ShowRecurringSevereErrorAtEnd(state,
+ format("{}: Convection model not evaluated because bad window "
+ "location and set to 9.999 [W/m2-K]",
+ eoh.routineName),
+ errorIdx);
+}
+
+void ShowWarningPerimeterLengthZero(EnergyPlusData &state, int &errorIdx, ErrorObjectHeader const &eoh)
+{
+ if (errorIdx == 0) {
+ ShowWarningError(state, format("{}: Convection model not evaluated (zero zone exterior perimeter length)", eoh.routineName));
+ ShowContinueError(state, "Value for zone exterior perimeter length = 0.0");
+ ShowContinueError(state, format("Occurs for {} named {}", eoh.objectType, eoh.objectName));
+ ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
+ }
+ ShowRecurringSevereErrorAtEnd(state,
+ format("{}: Convection model not evaluated because bad perimeter "
+ "length and set to 9.999 [W/m2-K]",
+ eoh.routineName),
+ errorIdx);
+}
+
+void ShowWarningFaceAreaZero(EnergyPlusData &state, int &errorIdx, ErrorObjectHeader const &eoh)
+{
+ if (errorIdx == 0) {
+ ShowSevereMessage(state, format("{}: Convection model not evaluated (bad face area)", eoh.routineName));
+ ShowContinueError(state, "Value for effective face area = 0.0");
+ ShowContinueError(state, format("Occurs for {} named {}", eoh.objectType, eoh.objectName));
+ ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
+ }
+ ShowRecurringSevereErrorAtEnd(
+ state, format("{}: Convection model not evaluated because bad face area and set to 9.999 [W/m2-k]", eoh.routineName), errorIdx);
+}
+
Real64 CalcBeausoleilMorrisonMixedStableFloor(EnergyPlusData &state,
Real64 const DeltaTemp, // [C] temperature difference between surface and air
Real64 const HydraulicDiameter, // [m] characteristic size, = (4 * area) / perimeter
@@ -7696,38 +5445,19 @@ Real64 CalcBeausoleilMorrisonMixedStableFloor(EnergyPlusData &state,
int const ZoneNum // index of zone for messaging
)
{
+ std::string_view constexpr routineName = "CalcBeausoleilMorrisonMixedStableFloor";
+
if ((HydraulicDiameter != 0.0) && (std::abs(DeltaTemp) > DataHVACGlobals::SmallTempDiff)) {
Real64 SupplyAirTemp = CalcZoneSupplyAirTemp(state, ZoneNum);
Real64 AirChangeRate = CalcZoneSystemACH(state, ZoneNum);
return CalcBeausoleilMorrisonMixedStableFloor(DeltaTemp, HydraulicDiameter, SurfTemp, SupplyAirTemp, AirChangeRate);
} else {
+ ErrorObjectHeader eoh{routineName, "Zone", state.dataHeatBal->Zone(ZoneNum).Name};
if (HydraulicDiameter == 0.0) {
- if (state.dataConvectionCoefficient->BMMixedStableFloorErrorIDX1 == 0) {
- ShowWarningMessage(state, "CalcBeausoleilMorrisonMixedStableFloor: Convection model not evaluated (would divide by zero)");
- ShowContinueError(state,
- format("Effective hydraulic diameter is zero, convection model not applicable for zone named ={}",
- state.dataHeatBal->Zone(ZoneNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
-
- ShowRecurringWarningErrorAtEnd(
- state,
- "CalcBeausoleilMorrisonMixedStableFloor: Convection model not evaluated because effective hydraulic diameter is zero "
- "and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->BMMixedStableFloorErrorIDX1);
+ ShowWarningHydraulicDiameterZero(state, state.dataConvect->BMMixedStableFloorErrorIDX1, eoh);
}
if (DeltaTemp == 0.0 && !state.dataGlobal->WarmupFlag) {
- if (state.dataConvectionCoefficient->BMMixedStableFloorErrorIDX2 == 0) {
- ShowWarningMessage(state, "CalcBeausoleilMorrisonMixedStableFloor: Convection model not evaluated (would divide by zero)");
- ShowContinueError(state, "The temperature difference between surface and air is zero");
- ShowContinueError(state, format("Occurs for zone named = {}", state.dataHeatBal->Zone(ZoneNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
-
- ShowRecurringWarningErrorAtEnd(state,
- "CalcBeausoleilMorrisonMixedStableFloor: Convection model not evaluated because of zero temperature "
- "difference and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->BMMixedStableFloorErrorIDX2);
+ ShowWarningDeltaTempZero(state, state.dataConvect->BMMixedStableFloorErrorIDX2, eoh);
}
return 9.999;
}
@@ -7749,18 +5479,15 @@ Real64 CalcBeausoleilMorrisonMixedUnstableFloor(Real64 const DeltaTemp,
// Calculate model equation Beausoleil-Morrison's mixed flow regime
// with mechanical and buoyancy forces acting on an thermally unstable floor
- // METHODOLOGY EMPLOYED:
- // isolate function for equation.
-
// REFERENCES:
// Beausoleil-Morrison, I. 2000. The adaptive coupling of heat and
// air flow modeling within dynamic whole-building simulations.
// PhD. Thesis. University of Strathclyde, Glasgow, UK.
- Real64 cofpow = std::sqrt(pow_6(1.4 * std::pow(std::abs(DeltaTemp) / HydraulicDiameter, ConvectionConstants::OneFourth)) +
- pow_6(1.63 * std::pow(std::abs(DeltaTemp), ConvectionConstants::OneThird))) +
- pow_3(((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) * (0.159 + 0.116 * std::pow(AirChangeRate, 0.8)));
- Real64 Hc = std::pow(std::abs(cofpow), ConvectionConstants::OneThird);
+ Real64 cofpow =
+ std::sqrt(pow_6(1.4 * std::pow(std::abs(DeltaTemp) / HydraulicDiameter, 0.25)) + pow_6(1.63 * std::pow(std::abs(DeltaTemp), 1.0 / 3.0))) +
+ pow_3(((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) * (0.159 + 0.116 * std::pow(AirChangeRate, 0.8)));
+ Real64 Hc = std::pow(std::abs(cofpow), 1.0 / 3.0);
if (cofpow < 0.0) {
Hc = -Hc;
}
@@ -7775,39 +5502,19 @@ Real64 CalcBeausoleilMorrisonMixedUnstableFloor(EnergyPlusData &state,
int const ZoneNum // index of zone for messaging
)
{
+ std::string_view constexpr routineName = "CalcBeausoleilMorrisonMixedUnstableFloor";
if ((HydraulicDiameter != 0.0) && (std::abs(DeltaTemp) > DataHVACGlobals::SmallTempDiff)) {
Real64 SupplyAirTemp = CalcZoneSupplyAirTemp(state, ZoneNum);
Real64 AirChangeRate = CalcZoneSystemACH(state, ZoneNum);
return CalcBeausoleilMorrisonMixedUnstableFloor(DeltaTemp, HydraulicDiameter, SurfTemp, SupplyAirTemp, AirChangeRate);
} else {
+ ErrorObjectHeader eoh{routineName, "Zone", state.dataHeatBal->Zone(ZoneNum).Name};
if (HydraulicDiameter == 0.0) {
- if (state.dataConvectionCoefficient->BMMixedUnstableFloorErrorIDX1 == 0) {
- ShowWarningMessage(state, "CalcBeausoleilMorrisonMixedUnstableFloor: Convection model not evaluated (would divide by zero)");
- ShowContinueError(state,
- format("Effective hydraulic diameter is zero, convection model not applicable for zone named ={}",
- state.dataHeatBal->Zone(ZoneNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
-
- ShowRecurringWarningErrorAtEnd(
- state,
- "CalcBeausoleilMorrisonMixedUnstableFloor: Convection model not evaluated because effective hydraulic diameter is zero "
- "and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->BMMixedUnstableFloorErrorIDX1);
+ ShowWarningHydraulicDiameterZero(state, state.dataConvect->BMMixedUnstableFloorErrorIDX1, eoh);
}
if (DeltaTemp == 0.0 && !state.dataGlobal->WarmupFlag) {
- if (state.dataConvectionCoefficient->BMMixedUnstableFloorErrorIDX2 == 0) {
- ShowWarningMessage(state, "CalcBeausoleilMorrisonMixedUnstableFloor: Convection model not evaluated (would divide by zero)");
- ShowContinueError(state, "The temperature difference between surface and air is zero");
- ShowContinueError(state, format("Occurs for zone named = {}", state.dataHeatBal->Zone(ZoneNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
-
- ShowRecurringWarningErrorAtEnd(state,
- "CalcBeausoleilMorrisonMixedUnstableFloor: Convection model not evaluated because of zero temperature "
- "difference and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->BMMixedUnstableFloorErrorIDX2);
+ ShowWarningDeltaTempZero(state, state.dataConvect->BMMixedUnstableFloorErrorIDX2, eoh);
}
return 9.999;
}
@@ -7829,17 +5536,14 @@ Real64 CalcBeausoleilMorrisonMixedStableCeiling(Real64 const DeltaTemp,
// Calculate model equation Beausoleil-Morrison's mixed flow regime
// with mechanical and buoyancy forces acting on a thermally stable ceiling
- // METHODOLOGY EMPLOYED:
- // isolate function for equation.
-
// REFERENCES:
// Beausoleil-Morrison, I. 2000. The adaptive coupling of heat and
// air flow modeling within dynamic whole-building simulations.
// PhD. Thesis. University of Strathclyde, Glasgow, UK.
- Real64 cofpow = pow_3(0.6 * std::pow(std::abs(DeltaTemp) / HydraulicDiameter, ConvectionConstants::OneFifth)) +
+ Real64 cofpow = pow_3(0.6 * std::pow(std::abs(DeltaTemp) / HydraulicDiameter, 0.2)) +
pow_3(((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) * (-0.166 + 0.484 * std::pow(AirChangeRate, 0.8)));
- Real64 Hc = std::pow(std::abs(cofpow), ConvectionConstants::OneThird);
+ Real64 Hc = std::pow(std::abs(cofpow), 1.0 / 3.0);
if (cofpow < 0.0) {
Hc = -Hc;
}
@@ -7853,38 +5557,19 @@ Real64 CalcBeausoleilMorrisonMixedStableCeiling(EnergyPlusData &state,
int const ZoneNum // index of zone for messaging
)
{
+ std::string_view constexpr routineName = "CalcBeausoleilMorrisonMixedStableCeiling";
if ((HydraulicDiameter != 0.0) && (std::abs(DeltaTemp) > DataHVACGlobals::SmallTempDiff)) {
Real64 SupplyAirTemp = CalcZoneSupplyAirTemp(state, ZoneNum);
Real64 AirChangeRate = CalcZoneSystemACH(state, ZoneNum);
return CalcBeausoleilMorrisonMixedStableCeiling(DeltaTemp, HydraulicDiameter, SurfTemp, SupplyAirTemp, AirChangeRate);
} else {
- if (HydraulicDiameter == 0.0) {
- if (state.dataConvectionCoefficient->BMMixedStableCeilingErrorIDX1 == 0) {
- ShowWarningMessage(state, "CalcBeausoleilMorrisonMixedStableCeiling: Convection model not evaluated (would divide by zero)");
- ShowContinueError(state,
- format("Effective hydraulic diameter is zero, convection model not applicable for zone named ={}",
- state.dataHeatBal->Zone(ZoneNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
+ ErrorObjectHeader eoh{routineName, "Zone", state.dataHeatBal->Zone(ZoneNum).Name};
- ShowRecurringWarningErrorAtEnd(
- state,
- "CalcBeausoleilMorrisonMixedStableCeiling: Convection model not evaluated because effective hydraulic diameter is zero "
- "and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->BMMixedStableCeilingErrorIDX1);
+ if (HydraulicDiameter == 0.0) {
+ ShowWarningHydraulicDiameterZero(state, state.dataConvect->BMMixedStableCeilingErrorIDX1, eoh);
}
if (DeltaTemp == 0.0 && !state.dataGlobal->WarmupFlag) {
- if (state.dataConvectionCoefficient->BMMixedStableCeilingErrorIDX2 == 0) {
- ShowWarningMessage(state, "CalcBeausoleilMorrisonMixedStableCeiling: Convection model not evaluated (would divide by zero)");
- ShowContinueError(state, "The temperature difference between surface and air is zero");
- ShowContinueError(state, format("Occurs for zone named = {}", state.dataHeatBal->Zone(ZoneNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
-
- ShowRecurringWarningErrorAtEnd(state,
- "CalcBeausoleilMorrisonMixedStableCeiling: Convection model not evaluated because of zero temperature "
- "difference and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->BMMixedStableCeilingErrorIDX2);
+ ShowWarningDeltaTempZero(state, state.dataConvect->BMMixedStableCeilingErrorIDX2, eoh);
}
return 9.999;
}
@@ -7906,18 +5591,15 @@ Real64 CalcBeausoleilMorrisonMixedUnstableCeiling(Real64 const DeltaTemp,
// Calculate model equation Beausoleil-Morrison's mixed flow regime
// with mechanical and buoyancy forces acting on a thermally unstable ceiling
- // METHODOLOGY EMPLOYED:
- // isolate function for equation.
-
// REFERENCES:
// Beausoleil-Morrison, I. 2000. The adaptive coupling of heat and
// air flow modeling within dynamic whole-building simulations.
// PhD. Thesis. University of Strathclyde, Glasgow, UK.
- Real64 cofpow = std::sqrt(pow_6(1.4 * std::pow(std::abs(DeltaTemp) / HydraulicDiameter, ConvectionConstants::OneFourth)) +
- pow_6(1.63 * std::pow(std::abs(DeltaTemp), ConvectionConstants::OneThird))) +
- pow_3(((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) * (-0.166 + 0.484 * std::pow(AirChangeRate, 0.8)));
- Real64 Hc = std::pow(std::abs(cofpow), ConvectionConstants::OneThird);
+ Real64 cofpow =
+ std::sqrt(pow_6(1.4 * std::pow(std::abs(DeltaTemp) / HydraulicDiameter, 0.25)) + pow_6(1.63 * std::pow(std::abs(DeltaTemp), 1.0 / 3.0))) +
+ pow_3(((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) * (-0.166 + 0.484 * std::pow(AirChangeRate, 0.8)));
+ Real64 Hc = std::pow(std::abs(cofpow), 1.0 / 3.0);
if (cofpow < 0.0) {
Hc = -Hc;
}
@@ -7931,38 +5613,19 @@ Real64 CalcBeausoleilMorrisonMixedUnstableCeiling(EnergyPlusData &state,
int const ZoneNum // index of zone for messaging
)
{
+ std::string_view constexpr routineName = "CalcBeausoleilMorrisonMixedUnstableCeiling";
+
if ((HydraulicDiameter != 0.0) && (std::abs(DeltaTemp) > DataHVACGlobals::SmallTempDiff)) {
Real64 SupplyAirTemp = CalcZoneSupplyAirTemp(state, ZoneNum);
Real64 AirChangeRate = CalcZoneSystemACH(state, ZoneNum);
return CalcBeausoleilMorrisonMixedUnstableCeiling(DeltaTemp, HydraulicDiameter, SurfTemp, SupplyAirTemp, AirChangeRate);
} else {
+ ErrorObjectHeader eoh{routineName, "Zone", state.dataHeatBal->Zone(ZoneNum).Name};
if (HydraulicDiameter == 0.0) {
- if (state.dataConvectionCoefficient->BMMixedUnstableCeilingErrorIDX1 == 0) {
- ShowWarningMessage(state, "CalcBeausoleilMorrisonMixedUnstableCeiling: Convection model not evaluated (would divide by zero)");
- ShowContinueError(state,
- format("Effective hydraulic diameter is zero, convection model not applicable for zone named ={}",
- state.dataHeatBal->Zone(ZoneNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
-
- ShowRecurringWarningErrorAtEnd(
- state,
- "CalcBeausoleilMorrisonMixedUnstableCeiling: Convection model not evaluated because effective hydraulic diameter is zero "
- "and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->BMMixedUnstableCeilingErrorIDX1);
+ ShowWarningHydraulicDiameterZero(state, state.dataConvect->BMMixedUnstableCeilingErrorIDX1, eoh);
}
if (DeltaTemp == 0.0 && !state.dataGlobal->WarmupFlag) {
- if (state.dataConvectionCoefficient->BMMixedUnstableCeilingErrorIDX2 == 0) {
- ShowWarningMessage(state, "CalcBeausoleilMorrisonMixedUnstableCeiling: Convection model not evaluated (would divide by zero)");
- ShowContinueError(state, "The temperature difference between surface and air is zero");
- ShowContinueError(state, format("Occurs for zone named = {}", state.dataHeatBal->Zone(ZoneNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
-
- ShowRecurringWarningErrorAtEnd(state,
- "CalcBeausoleilMorrisonMixedUnstableCeiling: Convection model not evaluated because of zero "
- "temperature difference and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->BMMixedUnstableCeilingErrorIDX2);
+ ShowWarningDeltaTempZero(state, state.dataConvect->BMMixedUnstableCeilingErrorIDX2, eoh);
}
return 9.999;
}
@@ -7982,28 +5645,21 @@ Real64 CalcFohannoPolidoriVerticalWall(Real64 const DeltaTemp, // [C] temperatur
// PURPOSE OF THIS FUNCTION:
// Calculate model equation for natural convection
- // METHODOLOGY EMPLOYED:
- // isolate function for equation.
-
// REFERENCES:
// Fohanno, S., and G. Polidori. 2006. Modelling of natural convective heat transfer
// at an internal surface. Energy and Buildings 38 (2006) 548 - 553
// FUNCTION PARAMETER DEFINITIONS:
- Real64 constexpr g(9.81); // gravity constant (m/s**2)
- Real64 constexpr v(15.89e-6); // kinematic viscosity (m**2/s) for air at 300 K
- Real64 constexpr k(0.0263); // thermal conductivity (W/m K) for air at 300 K
- Real64 constexpr Pr(0.71); // Prandtl number for air at ?
-
- // FUNCTION LOCAL VARIABLE DECLARATIONS:
- Real64 RaH(0.0);
- Real64 BetaFilm(0.0);
+ Real64 constexpr g = 9.81; // gravity constant (m/s**2) // Constant::Gravity is 9.807
+ Real64 constexpr v = 15.89e-6; // kinematic viscosity (m**2/s) for air at 300 K
+ Real64 constexpr k = 0.0263; // thermal conductivity (W/m K) for air at 300 K
+ Real64 constexpr Pr = 0.71; // Prandtl number for air at ?
- BetaFilm = 1.0 / (Constant::KelvinConv + SurfTemp + 0.5 * DeltaTemp); // TODO check sign on DeltaTemp
- RaH = (g * BetaFilm * QdotConv * pow_4(Height) * Pr) / (k * pow_2(v));
+ Real64 BetaFilm = 1.0 / (Constant::KelvinConv + SurfTemp + 0.5 * DeltaTemp); // TODO check sign on DeltaTemp
+ Real64 RaH = (g * BetaFilm * QdotConv * pow_4(Height) * Pr) / (k * pow_2(v));
if (RaH <= 6.3e09) {
- return 1.332 * std::pow(std::abs(DeltaTemp) / Height, ConvectionConstants::OneFourth);
+ return 1.332 * std::pow(std::abs(DeltaTemp) / Height, 0.25);
} else {
return 1.235 * std::exp(0.0467 * Height) * std::pow(std::abs(DeltaTemp), 0.316);
}
@@ -8017,21 +5673,13 @@ Real64 CallCalcFohannoPolidoriVerticalWall(EnergyPlusData &state,
int const SurfNum // for messages
)
{
-
+ std::string_view constexpr routineName = "CalcFohannoPolidoriVerticalWall";
if (Height > 0.0) {
return CalcFohannoPolidoriVerticalWall(DeltaTemp, Height, SurfTemp, QdotConv);
} else {
+ ErrorObjectHeader eoh{routineName, "Surface", state.dataSurface->Surface(SurfNum).Name};
// bad value for Height, but we have little info to identify calling culprit
- if (state.dataConvectionCoefficient->CalcFohannoPolidoriVerticalWallErrorIDX == 0) {
- ShowSevereMessage(state, "CalcFohannoPolidoriVerticalWall: Convection model not evaluated (would divide by zero)");
- ShowContinueError(state,
- format("Effective surface height is zero, convection model not applicable for surface ={}",
- state.dataSurface->Surface(SurfNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
- ShowRecurringSevereErrorAtEnd(state,
- "CalcFohannoPolidoriVerticalWall: Convection model not evaluated because zero height and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->CalcFohannoPolidoriVerticalWallErrorIDX);
+ ShowWarningHydraulicDiameterZero(state, state.dataConvect->CalcFohannoPolidoriVerticalWallErrorIDX, eoh);
return 9.999;
}
}
@@ -8046,27 +5694,19 @@ Real64 CalcKaradagChilledCeiling(Real64 const DeltaTemp) // [C] temperature diff
// PURPOSE OF THIS FUNCTION:
// Calculate model equation for natural convection developed by Karadag for chilled ceilings
- // METHODOLOGY EMPLOYED:
- // isolate function for equation.
-
// REFERENCES:
// Karadag, R. 2009. New approach relevant to total heat transfer coefficient
// including the effect of radiation and convection at the ceiling in a cooled
// ceiling room. Applied Thermal Engineering 29 (2009) 1561-1565
// This function is for equation 8 in the reference
- // Return value
- Real64 Hn; // function result, natural convection coefficient
-
- Hn = 3.1 * std::pow(std::abs(DeltaTemp), 0.22);
-
- return Hn;
+ return 3.1 * std::pow(std::abs(DeltaTemp), 0.22);
}
-Real64 CalcGoldsteinNovoselacCeilingDiffuserWindow(Real64 const AirSystemFlowRate, // [m3/s] air system flow rate
- Real64 const ZoneExtPerimLength, // [m] length of zone perimeter with exterior walls
- Real64 const WindWallRatio, // [ ] fraction of window area to wall area for zone
- ConvectionConstants::InConvWinLoc const WindowLocationType // index for location types
+Real64 CalcGoldsteinNovoselacCeilingDiffuserWindow(Real64 const AirSystemFlowRate, // [m3/s] air system flow rate
+ Real64 const ZoneExtPerimLength, // [m] length of zone perimeter with exterior walls
+ Real64 const WindWallRatio, // [ ] fraction of window area to wall area for zone
+ IntConvWinLoc const WindowLocationType // index for location types
)
{
@@ -8078,9 +5718,6 @@ Real64 CalcGoldsteinNovoselacCeilingDiffuserWindow(Real64 const AirSystemFlowRat
// Calculate model equation for windows in zones with slot diffusers on them
// developed by Novoselac for RP-1416
- // METHODOLOGY EMPLOYED:
- // isolate function for equation.
-
// REFERENCES:
// Goldstien, K. and A. Novoselac. 2010. Convective Heat Transfer in Rooms
// With Ceiling Slot Diffusers (RP-1416). HVAC&R Research Journal TBD
@@ -8089,14 +5726,14 @@ Real64 CalcGoldsteinNovoselacCeilingDiffuserWindow(Real64 const AirSystemFlowRat
if (WindWallRatio <= 0.5) {
switch (WindowLocationType) {
- case ConvectionConstants::InConvWinLoc::UpperPartOfExteriorWall:
- case ConvectionConstants::InConvWinLoc::LargePartOfExteriorWall:
- case ConvectionConstants::InConvWinLoc::NotSet:
+ case IntConvWinLoc::UpperPartOfExteriorWall:
+ case IntConvWinLoc::LargePartOfExteriorWall:
+ case IntConvWinLoc::NotSet:
return 0.117 * std::pow(AirSystemFlowRate / ZoneExtPerimLength, 0.8);
- case ConvectionConstants::InConvWinLoc::LowerPartOfExteriorWall:
+ case IntConvWinLoc::LowerPartOfExteriorWall:
return 0.093 * std::pow(AirSystemFlowRate / ZoneExtPerimLength, 0.8);
default:
- // shouldn't come
+ assert(false);
return 9.999;
}
@@ -8109,53 +5746,34 @@ Real64 CalcGoldsteinNovoselacCeilingDiffuserWindow(Real64 const AirSystemFlowRat
}
Real64 CalcGoldsteinNovoselacCeilingDiffuserWindow(EnergyPlusData &state,
- Real64 const ZoneExtPerimLength, // [m] length of zone perimeter with exterior walls
+ Real64 const zoneExtPerimLength, // [m] length of zone perimeter with exterior walls
Real64 const WindWallRatio, // [ ] fraction of window area to wall area for zone
- ConvectionConstants::InConvWinLoc const WindowLocationType, // index for location types
- int const ZoneNum // for messages
+ IntConvWinLoc const winLoc, // index for location types
+ int const ZoneNum // for messages
)
{
+ std::string_view constexpr routineName = "CalcGoldsteinNovoselacCeilingDiffuserWindow";
+ ErrorObjectHeader eoh{routineName, "Zone", state.dataHeatBal->Zone(ZoneNum).Name};
+
Real64 AirSystemFlowRate = CalcZoneSystemVolFlowRate(state, ZoneNum);
- if (ZoneExtPerimLength > 0.0) {
+ if (zoneExtPerimLength > 0.0) {
if (WindWallRatio <= 0.5) {
-
- if (!((WindowLocationType == ConvectionConstants::InConvWinLoc::UpperPartOfExteriorWall) ||
- (WindowLocationType == ConvectionConstants::InConvWinLoc::LowerPartOfExteriorWall) ||
- (WindowLocationType == ConvectionConstants::InConvWinLoc::LargePartOfExteriorWall) ||
- (WindowLocationType == ConvectionConstants::InConvWinLoc::NotSet))) {
- if (state.dataConvectionCoefficient->CalcGoldsteinNovoselacCeilingDiffuserWindowErrorIDX1 == 0) {
- ShowSevereMessage(state,
- "CalcGoldsteinNovoselacCeilingDiffuserWindow: Convection model not evaluated (bad relative window location)");
- ShowContinueError(state, format("Value for window location = {}", WindowLocationType));
- ShowContinueError(state, format("Occurs for zone named = {}", state.dataHeatBal->Zone(ZoneNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
- ShowRecurringSevereErrorAtEnd(state,
- "CalcGoldsteinNovoselacCeilingDiffuserWindow: Convection model not evaluated because bad window "
- "location and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->CalcGoldsteinNovoselacCeilingDiffuserWindowErrorIDX1);
+ if (winLoc != IntConvWinLoc::UpperPartOfExteriorWall && winLoc != IntConvWinLoc::LowerPartOfExteriorWall &&
+ winLoc != IntConvWinLoc::LargePartOfExteriorWall && winLoc != IntConvWinLoc::NotSet) {
+ // Should we not be returning 9.999 here as we do everywhere else?
+ ShowWarningWindowLocation(state, state.dataConvect->CalcGoldsteinNovoselacCeilingDiffuserWindowErrorIDX1, eoh, winLoc);
}
}
} else {
- if (state.dataConvectionCoefficient->CalcGoldsteinNovoselacCeilingDiffuserWindowErrorIDX2 == 0) {
- ShowSevereMessage(state,
- "CalcGoldsteinNovoselacCeilingDiffuserWindow: Convection model not evaluated (zero zone exterior perimeter length)");
- ShowContinueError(state, format("Value for zone exterior perimeter length = {:.5R}", ZoneExtPerimLength));
- ShowContinueError(state, format("Occurs for zone named = {}", state.dataHeatBal->Zone(ZoneNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
- ShowRecurringSevereErrorAtEnd(state,
- "CalcGoldsteinNovoselacCeilingDiffuserWindow: Convection model not evaluated because bad perimeter "
- "length and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->CalcGoldsteinNovoselacCeilingDiffuserWindowErrorIDX2);
+ ShowWarningPerimeterLengthZero(state, state.dataConvect->CalcGoldsteinNovoselacCeilingDiffuserWindowErrorIDX2, eoh);
}
- return CalcGoldsteinNovoselacCeilingDiffuserWindow(AirSystemFlowRate, ZoneExtPerimLength, WindWallRatio, WindowLocationType);
+ return CalcGoldsteinNovoselacCeilingDiffuserWindow(AirSystemFlowRate, zoneExtPerimLength, WindWallRatio, winLoc);
}
-Real64 CalcGoldsteinNovoselacCeilingDiffuserWall(Real64 const AirSystemFlowRate, // [m3/s] air system flow rate
- Real64 const ZoneExtPerimLength, // [m] length of zone perimeter with exterior walls
- ConvectionConstants::InConvWinLoc const WindowLocationType // index for location types
+Real64 CalcGoldsteinNovoselacCeilingDiffuserWall(Real64 const AirSystemFlowRate, // [m3/s] air system flow rate
+ Real64 const ZoneExtPerimLength, // [m] length of zone perimeter with exterior walls
+ IntConvWinLoc const WindowLocationType // index for location types
)
{
@@ -8167,9 +5785,6 @@ Real64 CalcGoldsteinNovoselacCeilingDiffuserWall(Real64 const AirSystemFlowRate,
// Calculate model equation for exterior walls in zones with slot diffusers on them
// developed by Novoselac for RP-1416
- // METHODOLOGY EMPLOYED:
- // isolate function for equation.
-
// REFERENCES:
// Goldstien, K. and A. Novoselac. 2010. Convective Heat Transfer in Rooms
// With Ceiling Slot Diffusers (RP-1416). HVAC&R Research Journal TBD
@@ -8177,12 +5792,13 @@ Real64 CalcGoldsteinNovoselacCeilingDiffuserWall(Real64 const AirSystemFlowRate,
if (ZoneExtPerimLength > 0.0) {
switch (WindowLocationType) {
- case ConvectionConstants::InConvWinLoc::WindowAboveThis:
- case ConvectionConstants::InConvWinLoc::NotSet:
+ case IntConvWinLoc::WindowAboveThis:
+ case IntConvWinLoc::NotSet:
return 0.063 * std::pow(AirSystemFlowRate / ZoneExtPerimLength, 0.8);
- case ConvectionConstants::InConvWinLoc::WindowBelowThis:
+ case IntConvWinLoc::WindowBelowThis:
return 0.093 * std::pow(AirSystemFlowRate / ZoneExtPerimLength, 0.8);
default:
+ assert(false);
return 9.999;
}
} else {
@@ -8191,43 +5807,24 @@ Real64 CalcGoldsteinNovoselacCeilingDiffuserWall(Real64 const AirSystemFlowRate,
}
Real64 CalcGoldsteinNovoselacCeilingDiffuserWall(EnergyPlusData &state,
- Real64 const ZoneExtPerimLength, // [m] length of zone perimeter with exterior walls
- ConvectionConstants::InConvWinLoc const WindowLocationType, // index for location types
- int const ZoneNum // for messages
+ Real64 const zoneExtPerimLength, // [m] length of zone perimeter with exterior walls
+ IntConvWinLoc const winLoc, // index for location types
+ int const ZoneNum // for messages
)
{
+ std::string_view constexpr routineName = "CalcGoldsteinNovoselacCeilingDiffuserWall";
+ ErrorObjectHeader eoh{routineName, "Zone", state.dataHeatBal->Zone(ZoneNum).Name};
Real64 AirSystemFlowRate = CalcZoneSystemVolFlowRate(state, ZoneNum);
- if (ZoneExtPerimLength > 0.0) {
- if (!((WindowLocationType == ConvectionConstants::InConvWinLoc::WindowAboveThis) ||
- (WindowLocationType == ConvectionConstants::InConvWinLoc::WindowBelowThis) ||
- (WindowLocationType == ConvectionConstants::InConvWinLoc::NotSet))) {
-
- if (state.dataConvectionCoefficient->CalcGoldsteinNovoselacCeilingDiffuserWallErrorIDX1 == 0) {
- ShowSevereMessage(state, "CalcGoldsteinNovoselacCeilingDiffuserWall: Convection model not evaluated (bad relative window location)");
- ShowContinueError(state, format("Value for window location = {}", WindowLocationType));
- ShowContinueError(state, format("Occurs for zone named = {}", state.dataHeatBal->Zone(ZoneNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
- ShowRecurringSevereErrorAtEnd(state,
- "CalcGoldsteinNovoselacCeilingDiffuserWall: Convection model not evaluated because bad window "
- "location and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->CalcGoldsteinNovoselacCeilingDiffuserWallErrorIDX1);
+ // Should we not be returning 9.999 under these conditions?
+ if (zoneExtPerimLength > 0.0) {
+ if (winLoc != IntConvWinLoc::WindowAboveThis && winLoc != IntConvWinLoc::WindowBelowThis && winLoc != IntConvWinLoc::NotSet) {
+ ShowWarningWindowLocation(state, state.dataConvect->CalcGoldsteinNovoselacCeilingDiffuserWallErrorIDX1, eoh, winLoc);
}
} else {
- if (state.dataConvectionCoefficient->CalcGoldsteinNovoselacCeilingDiffuserWallErrorIDX2 == 0) {
- ShowSevereMessage(state,
- "CalcGoldsteinNovoselacCeilingDiffuserWall: Convection model not evaluated (zero zone exterior perimeter length)");
- ShowContinueError(state, format("Value for zone exterior perimeter length = {:.5R}", ZoneExtPerimLength));
- ShowContinueError(state, format("Occurs for zone named = {}", state.dataHeatBal->Zone(ZoneNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
- ShowRecurringSevereErrorAtEnd(state,
- "CalcGoldsteinNovoselacCeilingDiffuserWall: Convection model not evaluated because bad perimeter "
- "length and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->CalcGoldsteinNovoselacCeilingDiffuserWallErrorIDX2);
+ ShowWarningPerimeterLengthZero(state, state.dataConvect->CalcGoldsteinNovoselacCeilingDiffuserWallErrorIDX2, eoh);
}
- return CalcGoldsteinNovoselacCeilingDiffuserWall(AirSystemFlowRate, ZoneExtPerimLength, WindowLocationType);
+ return CalcGoldsteinNovoselacCeilingDiffuserWall(AirSystemFlowRate, zoneExtPerimLength, winLoc);
}
Real64 CalcGoldsteinNovoselacCeilingDiffuserFloor(Real64 const AirSystemFlowRate, // [m3/s] air system flow rate
@@ -8243,9 +5840,6 @@ Real64 CalcGoldsteinNovoselacCeilingDiffuserFloor(Real64 const AirSystemFlowRate
// Calculate model equation for floors in zones with slot diffusers on them
// developed by Novoselac for RP-1416
- // METHODOLOGY EMPLOYED:
- // isolate function for equation.
-
// REFERENCES:
// Goldstien, K. and A. Novoselac. 2010. Convective Heat Transfer in Rooms
// With Ceiling Slot Diffusers (RP-1416). HVAC&R Research Journal TBD
@@ -8262,20 +5856,13 @@ Real64 CalcGoldsteinNovoselacCeilingDiffuserFloor(EnergyPlusData &state,
int const ZoneNum // for messages
)
{
+ std::string_view constexpr routineName = "CalcGoldsteinNovoselacCeilingDiffuserFloor";
Real64 AirSystemFlowRate = CalcZoneSystemVolFlowRate(state, ZoneNum);
if (ZoneExtPerimLength <= 0.0) {
- if (state.dataConvectionCoefficient->CalcGoldsteinNovoselacCeilingDiffuserFloorErrorIDX == 0) {
- ShowSevereMessage(state,
- "CalcGoldsteinNovoselacCeilingDiffuserFloor: Convection model not evaluated (zero zone exterior perimeter length)");
- ShowContinueError(state, format("Value for zone exterior perimeter length = {:.5R}", ZoneExtPerimLength));
- ShowContinueError(state, format("Occurs for zone named = {}", state.dataHeatBal->Zone(ZoneNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
- ShowRecurringSevereErrorAtEnd(state,
- "CalcGoldsteinNovoselacCeilingDiffuserFloor: Convection model not evaluated because bad perimeter "
- "length and set to 9.999 [W/m2-K]",
- state.dataConvectionCoefficient->CalcGoldsteinNovoselacCeilingDiffuserFloorErrorIDX);
+ ErrorObjectHeader eoh{routineName, "Zone", state.dataHeatBal->Zone(ZoneNum).Name};
+ ShowWarningPerimeterLengthZero(state, state.dataConvect->CalcGoldsteinNovoselacCeilingDiffuserFloorErrorIDX, eoh);
+ // return 9.999?
}
return CalcGoldsteinNovoselacCeilingDiffuserFloor(AirSystemFlowRate, ZoneExtPerimLength);
}
@@ -8290,9 +5877,6 @@ Real64 CalcSparrowWindward(Material::SurfaceRoughness const RoughnessIndex, Real
// PURPOSE OF THIS FUNCTION:
// Calculate Sparrow Hf for windward surfaces
- // METHODOLOGY EMPLOYED:
- // encapsulate equation as a function
-
// REFERENCES:
// 1. TARP Reference Manual, "Surface Outside Heat Balances", pp 71ff
@@ -8304,7 +5888,7 @@ Real64 CalcSparrowWindward(Material::SurfaceRoughness const RoughnessIndex, Real
// M.S. Thesis, Department of Mechanical and Industrial Engineering,
// University of Illinois at Urbana-Champaign.
- return 2.537 * RoughnessMultiplier[static_cast(RoughnessIndex)] * std::sqrt(FacePerimeter * WindAtZ / FaceArea);
+ return 2.537 * RoughnessMultiplier[(int)RoughnessIndex] * std::sqrt(FacePerimeter * WindAtZ / FaceArea);
}
Real64 CalcSparrowLeeward(Material::SurfaceRoughness const RoughnessIndex, Real64 const FacePerimeter, Real64 const FaceArea, Real64 const WindAtZ)
@@ -8317,9 +5901,6 @@ Real64 CalcSparrowLeeward(Material::SurfaceRoughness const RoughnessIndex, Real6
// PURPOSE OF THIS FUNCTION:
// Calculate Sparrow Hf for leeward surfaces
- // METHODOLOGY EMPLOYED:
- // encapsulate equation as a function
-
// REFERENCES:
// 1. TARP Reference Manual, "Surface Outside Heat Balances", pp 71ff
@@ -8341,19 +5922,14 @@ Real64 CalcSparrowWindward(EnergyPlusData &state,
Real64 const WindAtZ,
int const SurfNum)
{
+ std::string_view constexpr routineName = "CalcSparrowWindward";
+
if (FaceArea > 0.0) {
return CalcSparrowWindward(RoughnessIndex, FacePerimeter, FaceArea, WindAtZ);
} else {
- if (state.dataConvectionCoefficient->CalcSparrowWindwardErrorIDX == 0) {
- ShowSevereMessage(state, "CalcSparrowWindward: Convection model not evaluated (bad face area)");
- ShowContinueError(state, format("Value for effective face area = {:.5R}", FaceArea));
- ShowContinueError(state, format("Occurs for surface named = {}", state.dataSurface->Surface(SurfNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
- ShowRecurringSevereErrorAtEnd(state,
- "CalcSparrowWindward: Convection model not evaluated because bad face area and set to 9.999 [W/m2-k]",
- state.dataConvectionCoefficient->CalcSparrowWindwardErrorIDX);
+ ErrorObjectHeader eoh{routineName, "Surface", state.dataSurface->Surface(SurfNum).Name};
+ ShowWarningFaceAreaZero(state, state.dataConvect->CalcSparrowWindwardErrorIDX, eoh);
return 9.999; // safe but noticeable
}
}
@@ -8365,19 +5941,13 @@ Real64 CalcSparrowLeeward(EnergyPlusData &state,
Real64 const WindAtZ,
int const SurfNum)
{
+ std::string_view constexpr routineName = "CalcSparrowLeeward";
+
if (FaceArea > 0.0) {
return CalcSparrowLeeward(RoughnessIndex, FacePerimeter, FaceArea, WindAtZ);
} else {
- if (state.dataConvectionCoefficient->CalcSparrowLeewardErrorIDX == 0) {
- ShowSevereMessage(state, "CalcSparrowLeeward: Convection model not evaluated (bad face area)");
- ShowContinueError(state, format("Value for effective face area = {:.5R}", FaceArea));
- ShowContinueError(state, format("Occurs for surface named = {}", state.dataSurface->Surface(SurfNum).Name));
- ShowContinueError(state, "Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues");
- }
- ShowRecurringSevereErrorAtEnd(state,
- "CalcSparrowLeeward: Convection model not evaluated because bad face area and set to 9.999 [W/m2-k]",
- state.dataConvectionCoefficient->CalcSparrowLeewardErrorIDX);
-
+ ErrorObjectHeader eoh{routineName, "Surface", state.dataSurface->Surface(SurfNum).Name};
+ ShowWarningFaceAreaZero(state, state.dataConvect->CalcSparrowLeewardErrorIDX, eoh);
return 9.999; // safe but noticeable
}
}
@@ -8412,9 +5982,6 @@ Real64 CalcMoWITTWindward(Real64 const DeltaTemp, Real64 const WindAtZ)
// PURPOSE OF THIS FUNCTION:
// calculate MoWITT Hc equation for windward surfaces
- // METHODOLOGY EMPLOYED:
- // encapsulate model equation in a function
-
// REFERENCES:
// Yazdanian, M. and J.H. Klems. 1994. Measurement of the exterior convective
// film coefficient for windows in low-rise buildings.
@@ -8435,9 +6002,6 @@ Real64 CalcMoWITTLeeward(Real64 const DeltaTemp, Real64 const WindAtZ)
// PURPOSE OF THIS FUNCTION:
// calculate MoWITT Hc equation for leeward surfaces
- // METHODOLOGY EMPLOYED:
- // encapsulate model equation in a function
-
// REFERENCES:
// Yazdanian, M. and J.H. Klems. 1994. Measurement of the exterior convective
// film coefficient for windows in low-rise buildings.
@@ -8454,7 +6018,7 @@ Real64 CalcDOE2Forced(
// This allows costly HfSmooth to be calculated independently (avoids excessive use of std::pow() in Kiva)
Real64 Hn = CalcASHRAETARPNatural(SurfaceTemp, AirTemp, CosineTilt);
Real64 HcSmooth = std::sqrt(pow_2(Hn) + pow_2(HfSmooth));
- return RoughnessMultiplier[static_cast(RoughnessIndex)] * (HcSmooth - Hn);
+ return RoughnessMultiplier[(int)RoughnessIndex] * (HcSmooth - Hn);
}
Real64 CalcDOE2Windward(
@@ -8468,9 +6032,6 @@ Real64 CalcDOE2Windward(
// PURPOSE OF THIS FUNCTION:
// calculate DOE-2 Hf equation for windward surfaces
- // METHODOLOGY EMPLOYED:
- // encapsulate model equation in a function
-
// REFERENCES:
// Lawrence Berkeley Laboratory. 1994. DOE2.1E-053 source code.
// Yazdanian, M. and J.H. Klems. 1994. Measurement of the exterior convective
@@ -8491,9 +6052,6 @@ Real64 CalcDOE2Leeward(
// PURPOSE OF THIS FUNCTION:
// calculate DOE-2 Hf equation for leeward surfaces
- // METHODOLOGY EMPLOYED:
- // encapsulate model equation in a function
-
// REFERENCES:
// Lawrence Berkeley Laboratory. 1994. DOE2.1E-053 source code.
// Yazdanian, M. and J.H. Klems. 1994. Measurement of the exterior convective
@@ -8517,21 +6075,13 @@ Real64 CalcNusseltJurges(Real64 const WindAtZ)
// model is attributed to Nusselt and Jurges but the equation is recast in current units
// by Palyvos
- // METHODOLOGY EMPLOYED:
- // encapsulate the model equation in a function
-
// REFERENCES:
// 1. Nusselt, W., W. Jurges. 1922. Die Kuhlung einer ebenen Wand durch einen Luftstrom
// (The cooling of a plane wall by an air flow). Gesundheits Ingenieur 52, Heft, 45, Jargang.
// 2. Palyvos, J.A., 2008. A survey of wind convection coefficient correlations for building
// envelope energy systems' modeling. Applied Thermal Engineering 28 (2008) 801-808. Elsevier.
- // Return value
- Real64 Hc;
-
- Hc = 5.8 + 3.94 * WindAtZ;
-
- return Hc;
+ return 5.8 + 3.94 * WindAtZ;
}
Real64 CalcMcAdams(Real64 const WindAtZ)
@@ -8546,20 +6096,12 @@ Real64 CalcMcAdams(Real64 const WindAtZ)
// model is attributed to McAdams but the equation is as recast in current units
// by Palyvos
- // METHODOLOGY EMPLOYED:
- // encapsulate the model equation in a function
-
// REFERENCES:
// 1. McAdams, W.H., 1954. Heat Transmission, third ed., McGraw-Hill, New York.
// 2. Palyvos, J.A., 2008. A survey of wind convection coefficient correlations for building
// envelope energy systems' modeling. Applied Thermal Engineering 28 (2008) 801-808. Elsevier.
- // Return value
- Real64 Hc;
-
- Hc = 5.8 + 3.8 * WindAtZ;
-
- return Hc;
+ return 5.8 + 3.8 * WindAtZ;
}
Real64 CalcMitchell(Real64 const WindAtZ, Real64 const LengthScale)
@@ -8574,9 +6116,6 @@ Real64 CalcMitchell(Real64 const WindAtZ, Real64 const LengthScale)
// model is attributed to Mitchell but the equation is as recast in current units
// by Palyvos
- // METHODOLOGY EMPLOYED:
- // encapsulate the model equation in a function
-
// REFERENCES:
// 1. Mitchell, J.W., 1976. Heat transfer from spheres and other animal forms. Biophy. J. 16 (1976) 561
// 2. Palyvos, J.A., 2008. A survey of wind convection coefficient correlations for building
@@ -8590,7 +6129,7 @@ Real64 CalcMitchell(EnergyPlusData &state, Real64 const WindAtZ, Real64 const Le
if (LengthScale > 0.0) {
return CalcMitchell(WindAtZ, LengthScale);
} else {
- if (state.dataConvectionCoefficient->CalcMitchellErrorIDX == 0) {
+ if (state.dataConvect->CalcMitchellErrorIDX == 0) {
ShowSevereMessage(state, "CalcMitchell: Convection model not evaluated (bad length scale)");
ShowContinueError(state, format("Value for effective length scale = {:.5R}", LengthScale));
ShowContinueError(state, format("Occurs for surface named = {}", state.dataSurface->Surface(SurfNum).Name));
@@ -8598,7 +6137,7 @@ Real64 CalcMitchell(EnergyPlusData &state, Real64 const WindAtZ, Real64 const Le
}
ShowRecurringSevereErrorAtEnd(state,
"CalcMitchell: Convection model not evaluated because bad length scale and set to 9.999 [W/m2-k]",
- state.dataConvectionCoefficient->CalcMitchellErrorIDX);
+ state.dataConvect->CalcMitchellErrorIDX);
return 9.999; // safe but noticeable
}
}
@@ -8632,9 +6171,6 @@ Real64 CalcBlockenWindward(EnergyPlusData &state,
// PURPOSE OF THIS FUNCTION:
// calculate model equation for forced convection using Blocken correlation
- // METHODOLOGY EMPLOYED:
- // encapsulate model in function
-
// REFERENCES:
// Blocken, B., T. Defraeye, D. Derome, J. Carmeliet. 2009.
// High-Resolution CFD Simulations for Forced Convection
@@ -8652,15 +6188,14 @@ Real64 CalcBlockenWindward(EnergyPlusData &state,
} else if (Theta <= 100.0) {
return 4.5 * std::pow(WindAt10m, 0.81);
} else {
- if (state.dataConvectionCoefficient->CalcBlockenWindwardErrorIDX == 0) {
+ if (state.dataConvect->CalcBlockenWindwardErrorIDX == 0) {
ShowSevereMessage(state, "CalcBlockenWindward: Convection model wind angle calculation suspect (developer issue)");
ShowContinueError(state, format("Value for theta angle = {:.5R}", Theta));
ShowContinueError(state, format("Occurs for surface named = {}", state.dataSurface->Surface(SurfNum).Name));
ShowContinueError(state, "Convection model uses EmmelVertical correlation and the simulation continues");
}
- ShowRecurringSevereErrorAtEnd(state,
- "CalcBlockenWindward: Convection model wind angle calculation suspect.",
- state.dataConvectionCoefficient->CalcBlockenWindwardErrorIDX);
+ ShowRecurringSevereErrorAtEnd(
+ state, "CalcBlockenWindward: Convection model wind angle calculation suspect.", state.dataConvect->CalcBlockenWindwardErrorIDX);
return CalcEmmelVertical(WindAt10m, WindDir, SurfAzimuth);
}
}
@@ -8678,9 +6213,6 @@ Real64 CalcEmmelVertical(Real64 const WindAt10m,
// calculate model equation for forced convection using Emmel correlation
// for vertical walls
- // METHODOLOGY EMPLOYED:
- // encapsulate model in function
-
// REFERENCES:
// Emmel, M.G., M.O. Abadie, N. Mendes. 2007. New external convective
// heat transfer coefficient correlations for isolated low-rise buildings.
@@ -8714,9 +6246,6 @@ Real64 CalcEmmelRoof(Real64 const WindAt10m,
// calculate model equation for forced convection using Emmel correlation
// for horizontal roofs
- // METHODOLOGY EMPLOYED:
- // encapsulate model in function
-
// REFERENCES:
// Emmel, M.G., M.O. Abadie, N. Mendes. 2007. New external convective
// heat transfer coefficient correlations for isolated low-rise buildings.
@@ -8747,41 +6276,28 @@ Real64 CalcClearRoof(EnergyPlusData &state,
{
// FUNCTION PARAMETER DEFINITIONS:
- Real64 constexpr g(9.81); // gravity constant (m/s**2)
- Real64 constexpr v(15.89e-6); // kinematic viscosity (m**2/s) for air at 300 K
- Real64 constexpr k(0.0263); // thermal conductivity (W/m K) for air at 300 K
- Real64 constexpr Pr(0.71); // Prandtl number for air at ?
+ Real64 constexpr g = 9.81; // gravity constant (m/s**2)
+ Real64 constexpr v = 15.89e-6; // kinematic viscosity (m**2/s) for air at 300 K
+ Real64 constexpr k = 0.0263; // thermal conductivity (W/m K) for air at 300 K
+ Real64 constexpr Pr = 0.71; // Prandtl number for air at ?
// FUNCTION LOCAL VARIABLE DECLARATIONS:
- Real64 DeltaTemp;
- Real64 Ln;
- Real64 RaLn; // Rayleigh number
- Real64 GrLn; // Grashof number
- Real64 AirDensity;
- Real64 Rex; // Reynolds number
- Real64 x; // distance to roof edge toward wind direction
Real64 eta;
- Array1D RfARR(6);
- Real64 BetaFilm;
// find x, don't know x. avoid time consuming geometry algorithm
- x = std::sqrt(RoofArea) / 2.0; // quick simplification, geometry routines to develop
+ Real64 x = std::sqrt(RoofArea) / 2.0; // quick simplification, geometry routines to develop
- if (RoofPerimeter > 0.0) {
- Ln = RoofArea / RoofPerimeter;
- } else {
- Ln = std::sqrt(RoofArea);
- }
- DeltaTemp = SurfTemp - AirTemp;
- BetaFilm = 1.0 / (Constant::KelvinConv + SurfTemp + 0.5 * DeltaTemp);
- AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, AirTemp, state.dataEnvrn->OutHumRat);
+ Real64 Ln = (RoofPerimeter > 0.0) ? (RoofArea / RoofPerimeter) : std::sqrt(RoofArea);
+ Real64 DeltaTemp = SurfTemp - AirTemp;
+ Real64 BetaFilm = 1.0 / (Constant::KelvinConv + SurfTemp + 0.5 * DeltaTemp);
+ Real64 AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, AirTemp, state.dataEnvrn->OutHumRat);
- GrLn = g * pow_2(AirDensity) * pow_3(Ln) * std::abs(DeltaTemp) * BetaFilm / pow_2(v);
- RaLn = GrLn * Pr;
+ Real64 GrLn = g * pow_2(AirDensity) * pow_3(Ln) * std::abs(DeltaTemp) * BetaFilm / pow_2(v);
+ Real64 RaLn = GrLn * Pr;
- Rex = WindAtZ * AirDensity * x / v;
+ Real64 Rex = WindAtZ * AirDensity * x / v;
- Real64 Rf = RoughnessMultiplier[static_cast(RoughnessIndex)];
+ Real64 Rf = RoughnessMultiplier[(int)RoughnessIndex];
if (Rex > 0.1) { // avoid zero and crazy small denominators
Real64 tmp = std::log(1.0 + GrLn / pow_2(Rex));
eta = tmp / (1.0 + tmp);
@@ -8789,8 +6305,7 @@ Real64 CalcClearRoof(EnergyPlusData &state,
eta = 1.0; // forced convection gone because no wind
}
- return eta * (k / Ln) * 0.15 * std::pow(RaLn, ConvectionConstants::OneThird) +
- (k / x) * Rf * 0.0296 * std::pow(Rex, ConvectionConstants::FourFifths) * std::pow(Pr, ConvectionConstants::OneThird);
+ return eta * (k / Ln) * 0.15 * std::pow(RaLn, 1.0 / 3.0) + (k / x) * Rf * 0.0296 * std::pow(Rex, 0.8) * std::pow(Pr, 1.0 / 3.0);
}
Real64 CalcClearRoof(EnergyPlusData &state,
@@ -8802,18 +6317,16 @@ Real64 CalcClearRoof(EnergyPlusData &state,
Real64 const RoofArea,
Real64 const RoofPerimeter)
{
- Real64 x; // distance to roof edge toward wind direction
-
Material::SurfaceRoughness const RoughnessIndex =
state.dataMaterial->Material(state.dataConstruction->Construct(state.dataSurface->Surface(SurfNum).Construction).LayerPoint(1))->Roughness;
// find x, don't know x. avoid time consuming geometry algorithm
- x = std::sqrt(RoofArea) / 2.0; // quick simplification, geometry routines to develop
+ Real64 x = std::sqrt(RoofArea) / 2.0; // quick simplification, geometry routines to develop
if (x > 0.0) {
return CalcClearRoof(state, SurfTemp, AirTemp, WindAtZ, RoofArea, RoofPerimeter, RoughnessIndex);
} else {
if (state.dataSurface->Surface(SurfNum).ExtBoundCond != DataSurfaces::OtherSideCondModeledExt) {
- if (state.dataConvectionCoefficient->CalcClearRoofErrorIDX == 0) {
+ if (state.dataConvect->CalcClearRoofErrorIDX == 0) {
ShowSevereMessage(state, "CalcClearRoof: Convection model not evaluated (bad value for distance to roof edge)");
ShowContinueError(state, format("Value for distance to roof edge ={:.3R}", x));
ShowContinueError(state, format("Occurs for surface named = {}", state.dataSurface->Surface(SurfNum).Name));
@@ -8822,7 +6335,7 @@ Real64 CalcClearRoof(EnergyPlusData &state,
ShowRecurringSevereErrorAtEnd(
state,
"CalcClearRoof: Convection model not evaluated because bad value for distance to roof edge and set to 9.999 [W/m2-k]",
- state.dataConvectionCoefficient->CalcClearRoofErrorIDX);
+ state.dataConvect->CalcClearRoofErrorIDX);
}
return 9.9999; // safe but noticeable
}
@@ -8838,7 +6351,7 @@ void CalcASTMC1340ConvCoeff(EnergyPlusData &state,
int ZoneNum = surface.Zone;
Real64 Volume = state.dataHeatBal->Zone(ZoneNum).Volume; // Volume of the zone in m3
- Real64 Vair = std::pow(Volume, ConvectionConstants::OneThird) * CalcZoneSystemACH(state, ZoneNum) / 3600;
+ Real64 Vair = std::pow(Volume, 1.0 / 3.0) * CalcZoneSystemACH(state, ZoneNum) / 3600;
state.dataHeatBalSurf->SurfHConvInt(SurfNum) =
CalcASTMC1340ConvCoeff(state, SurfNum, SurfaceTemperature, ZoneMeanAirTemperature, Vair, surface.Tilt);
@@ -8864,62 +6377,45 @@ Real64 CalcASTMC1340ConvCoeff(EnergyPlusData &state, int const SurfNum, Real64 c
// Predicting the performance of radiant technologies in attics: Reducing the discrepancies between attic specific
// and whole-building energy models. Energy and Buildings, 169, 69-83.
- // Return Value
- Real64 h; // Combined convection coefficient
-
- Real64 Nun; // Nusselt number for natural convection
- Real64 Nuf; // Nusselt number for forced convection
- Real64 hn; // Natural convection coefficient
- Real64 hf; // Forced convection coefficient
- Real64 Grc; // Critical Grashof number
- Real64 DeltaTemp; // Temperature difference between TSurf and Tair
- Real64 L; // Characteristic length: the length along the heat flow direction
- // (the square root of surface area for floors and ceilings, average height for gables and walls, and length of pitched roof
- // from soffit to ridge)
- Real64 v; // The velocity of the air stream in m/s, (for interior surfaces)
- // Surface Outside Face Outdoor Air Wind Speed (for exterior surfaces)
- Real64 Pr; // Prandtl number
- Real64 beta_SI; // Volume coefficient of expansion of air, 1/K
- Real64 rho_SI; // Density of air, kg/m3
- Real64 cp_SI; // Specific heat of air, J/kg.k
- Real64 dv;
- Real64 visc; // Kinematic viscosity of air, m2/s
- Real64 k_SI_n;
- Real64 k_SI_d;
- Real64 k_SI; // Thermal conductivity of air, W/m.K
- Real64 Ra; // Rayleigh number
- Real64 Re; // Reynolds number
+ Real64 Nun; // Nusselt number for natural convection
+ Real64 Nuf; // Nusselt number for forced convection
+ Real64 Grc; // Critical Grashof number
+
constexpr Real64 g = Constant::GravityConstant; // Acceleration of gravity, m/s2
auto const &surface = state.dataSurface->Surface(SurfNum);
- if (Tilt == 0 || Tilt == 180) { // Horizontal surface
- L = std::sqrt(surface.Area);
- } else {
- L = surface.Height;
- }
-
- if (surface.ExtBoundCond == 0) {
- v = state.dataSurface->SurfOutWindSpeed(SurfNum);
- } else {
- v = Vair;
- }
-
- Pr = 0.7880 - (2.631 * std::pow(10, -4) * (Tair + 273.15));
- beta_SI = 1 / (Tair + 273.15);
- rho_SI = (22.0493 / (Tair + 273.15)) * 16;
- cp_SI = 0.068559 * (3.4763 + (1.066 * std::pow(10, -4) * (Tair + 273.15))) * 4186.8;
- dv = (241.9 * std::pow(10, -7)) * (145.8 * (Tair + 273.15) * std::pow((Tair + 273.15), 0.5)) / ((Tair + 273.15) + 110.4);
- visc = dv * (0.45359237 / (0.3048 * 3600)) / rho_SI;
- k_SI_n = (0.6325 * std::pow(10, -5) * std::pow((Tair + 273.15), 0.5) * 241.77);
- k_SI_d = (1.0 + (245.4 * std::pow(10, (-12 / (Tair + 273.15)))) / (Tair + 273.15));
- k_SI = 1.730735 * (k_SI_n / k_SI_d);
-
- // Calculation of DeltaTemp
- DeltaTemp = Tsurf - Tair;
-
- Ra = std::abs(g * beta_SI * rho_SI * cp_SI * DeltaTemp * (L * L * L)) / (visc * k_SI);
- Re = (v * L) / visc;
+ // Characteristic length: the length along the heat flow direction
+ // (the square root of surface area for floors and ceilings,
+ // average height for gables and walls, and length of pitched roof
+ // from soffit to ridge) Surface Outside Face Outdoor Air Wind
+ // Speed (for exterior surfaces)
+ Real64 L = (Tilt == 0 || Tilt == 180) ? std::sqrt(surface.Area) : surface.Height;
+ // The velocity of the air stream in m/s, (for interior surfaces)
+ Real64 v = (surface.ExtBoundCond == 0) ? state.dataSurface->SurfOutWindSpeed(SurfNum) : Vair;
+ // Prandtl number
+ Real64 Pr = 0.7880 - (2.631 * std::pow(10, -4) * (Tair + 273.15));
+ // Volume coefficient of expansion of air, 1/K
+ Real64 beta_SI = 1 / (Tair + 273.15);
+ // Density of air, kg/m3
+ Real64 rho_SI = (22.0493 / (Tair + 273.15)) * 16;
+ // Specific heat of air, J/kg.k
+ Real64 cp_SI = 0.068559 * (3.4763 + (1.066 * std::pow(10, -4) * (Tair + 273.15))) * 4186.8;
+ Real64 dv = (241.9 * std::pow(10, -7)) * (145.8 * (Tair + 273.15) * std::pow((Tair + 273.15), 0.5)) / ((Tair + 273.15) + 110.4);
+ // Kinematic viscosity of air, m2/s
+ Real64 visc = dv * (0.45359237 / (0.3048 * 3600)) / rho_SI;
+ Real64 k_SI_n = (0.6325 * std::pow(10, -5) * std::pow((Tair + 273.15), 0.5) * 241.77);
+ Real64 k_SI_d = (1.0 + (245.4 * std::pow(10, (-12 / (Tair + 273.15)))) / (Tair + 273.15));
+ // Thermal conductivity of air, W/m.K
+ Real64 k_SI = 1.730735 * (k_SI_n / k_SI_d);
+
+ // Temperature difference between TSurf and Tair
+ Real64 DeltaTemp = Tsurf - Tair;
+
+ // Rayleigh number
+ Real64 Ra = std::abs(g * beta_SI * rho_SI * cp_SI * DeltaTemp * (L * L * L)) / (visc * k_SI);
+ // Reynolds number
+ Real64 Re = (v * L) / visc;
// Natural convection (Nun)
if (Tilt == 0) { // Horizontal surface: Roof
@@ -8928,7 +6424,7 @@ Real64 CalcASTMC1340ConvCoeff(EnergyPlusData &state, int const SurfNum, Real64 c
} else if (Ra < 8000000) { // heat flow up
Nun = 0.54 * std::pow(Ra, 0.25);
} else {
- Nun = 0.15 * std::pow(Ra, ConvectionConstants::OneThird);
+ Nun = 0.15 * std::pow(Ra, 1.0 / 3.0);
}
} else if (Tilt > 0 && Tilt < 90) { // Tilted roof
if (DeltaTemp > 0) { // heat flow down
@@ -8948,7 +6444,7 @@ Real64 CalcASTMC1340ConvCoeff(EnergyPlusData &state, int const SurfNum, Real64 c
if ((Ra / Pr) <= Grc) {
Nun = 0.56 * std::pow(Ra * (std::sin(Tilt * 3.14159 / 180)), 0.25);
} else {
- Nun = 0.14 * (std::pow(Ra, ConvectionConstants::OneThird) - std::pow(Grc * Pr, ConvectionConstants::OneThird)) +
+ Nun = 0.14 * (std::pow(Ra, Constant::OneThird) - std::pow(Grc * Pr, Constant::OneThird)) +
0.56 * std::pow(Grc * Pr * (std::sin(Tilt * Constant::DegToRadians)), 0.25);
}
}
@@ -8958,7 +6454,7 @@ Real64 CalcASTMC1340ConvCoeff(EnergyPlusData &state, int const SurfNum, Real64 c
} else if (Ra < 8000000) { // heat flow up
Nun = 0.54 * std::pow(Ra, 0.25);
} else {
- Nun = 0.15 * std::pow(Ra, ConvectionConstants::OneThird);
+ Nun = 0.15 * std::pow(Ra, 1.0 / 3.0);
}
} else if (Tilt > 90 && Tilt < 180) { // Tilted Floor
if (DeltaTemp <= 0) { // heat flow down
@@ -8978,7 +6474,7 @@ Real64 CalcASTMC1340ConvCoeff(EnergyPlusData &state, int const SurfNum, Real64 c
if ((Ra / Pr) <= Grc) {
Nun = 0.56 * std::pow(Ra * (std::sin(Tilt * Constant::DegToRadians)), 0.25);
} else {
- Nun = 0.14 * (std::pow(Ra, ConvectionConstants::OneThird) - std::pow(Grc * Pr, ConvectionConstants::OneThird)) +
+ Nun = 0.14 * (std::pow(Ra, Constant::OneThird) - std::pow(Grc * Pr, Constant::OneThird)) +
0.56 * std::pow(Grc * Pr * (std::sin(Tilt * Constant::DegToRadians)), 0.25);
}
}
@@ -8986,39 +6482,74 @@ Real64 CalcASTMC1340ConvCoeff(EnergyPlusData &state, int const SurfNum, Real64 c
if (Ra < 1000000000) {
Nun = 0.59 * std::pow(Ra, 0.25);
} else {
- Nun = 0.10 * std::pow(Ra, ConvectionConstants::OneThird);
+ Nun = 0.10 * std::pow(Ra, 1.0 / 3.0);
}
}
// Forced convection (Nuf)
if (Re < 500000) {
- Nuf = 0.664 * std::pow(Pr, ConvectionConstants::OneThird) * std::pow(Re, 0.5);
+ Nuf = 0.664 * std::pow(Pr, 1.0 / 3.0) * std::pow(Re, 0.5);
} else {
- Nuf = std::pow(Pr, ConvectionConstants::OneThird) * ((0.037 * std::pow(Re, 0.8)) - 850);
+ Nuf = std::pow(Pr, 1.0 / 3.0) * ((0.037 * std::pow(Re, 0.8)) - 850);
}
// Combined convection coefficient
- hf = Nuf * k_SI / L;
- hn = Nun * k_SI / L;
- h = std::pow((std::pow(hf, 3) + std::pow(hn, 3)), ConvectionConstants::OneThird);
-
- return h;
+ Real64 hf = Nuf * k_SI / L;
+ Real64 hn = Nun * k_SI / L;
+ return std::pow((std::pow(hf, 3) + std::pow(hn, 3)), 1.0 / 3.0);
}
-ConvectionConstants::SurfConvOrientation GetSurfConvOrientation(Real64 const Tilt)
+SurfOrientation GetSurfConvOrientation(Real64 const Tilt)
{
if (Tilt < 5.0) {
- return ConvectionConstants::SurfConvOrientation::HorizontalDown;
+ return SurfOrientation::HorizontalDown;
} else if ((Tilt >= 5.0) && (Tilt < 85.0)) {
- return ConvectionConstants::SurfConvOrientation::TiltedDownward;
+ return SurfOrientation::TiltedDownward;
} else if ((Tilt >= 85.0) && (Tilt < 95.0)) {
- return ConvectionConstants::SurfConvOrientation::Vertical;
+ return SurfOrientation::Vertical;
} else if ((Tilt >= 95.0) && (Tilt < 175.0)) {
- return ConvectionConstants::SurfConvOrientation::TiltedUpward;
+ return SurfOrientation::TiltedUpward;
} else if (Tilt >= 175.0) {
- return ConvectionConstants::SurfConvOrientation::HorizontalUp;
+ return SurfOrientation::HorizontalUp;
} else {
- return ConvectionConstants::SurfConvOrientation::Invalid;
+ return SurfOrientation::Invalid;
}
}
-} // namespace EnergyPlus::ConvectionCoefficients
+
+void ShowSevereValueOutOfRange(
+ EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, Real64 fieldVal, Real64 lo, Real64 hi, std::string const &msg)
+{
+ ShowSevereError(state, format("{}: {} = {} out of range value", eoh.routineName, eoh.objectType, eoh.objectName));
+ ShowContinueError(state, format("{} = [{:.5R}] is out-of-range", fieldName, fieldVal));
+ ShowContinueError(state, format("Low/high limits = [>={:.9R}, <={:.1R}].", lo, hi));
+ if (!msg.empty()) ShowContinueError(state, msg);
+}
+
+void ShowSevereScheduleOutOfRange(EnergyPlusData &state,
+ ErrorObjectHeader const &eoh,
+ std::string_view fieldName,
+ std::string_view fieldVal,
+ Real64 lo,
+ Real64 hi,
+ std::string const &msg)
+{
+ ShowSevereError(state, format("{}: {} = {} out of range value", eoh.routineName, eoh.objectType, eoh.objectName));
+ ShowContinueError(state, format("{} = {} contains an out-of-range value", fieldName, fieldVal));
+ ShowContinueError(state, format("Low/high limits = [>={:.9R}, <={:.1R}].", lo, hi));
+ if (!msg.empty()) ShowContinueError(state, msg);
+}
+
+Real64 SurroundingSurfacesRadCoeffAverage(EnergyPlusData &state, int const SurfNum, Real64 const TSurfK, Real64 const AbsExt)
+{
+ // compute exterior surfaces LW radiation transfer coefficient to surrounding surfaces
+ // the surface.SrdSurfTemp is weighed by surrounding surfaces view factor
+ Real64 HSrdSurf = 0.0;
+ auto &surface = state.dataSurface->Surface(SurfNum);
+ Real64 SrdSurfsTK = surface.SrdSurfTemp + Constant::KelvinConv;
+ if (TSurfK != SrdSurfsTK) {
+ HSrdSurf = Constant::StefanBoltzmann * AbsExt * surface.ViewFactorSrdSurfs * (pow_4(TSurfK) - pow_4(SrdSurfsTK)) / (TSurfK - SrdSurfsTK);
+ }
+ return HSrdSurf;
+}
+
+} // namespace EnergyPlus::Convect
diff --git a/src/EnergyPlus/ConvectionCoefficients.hh b/src/EnergyPlus/ConvectionCoefficients.hh
index 6b1e5882ffc..5b5f421e004 100644
--- a/src/EnergyPlus/ConvectionCoefficients.hh
+++ b/src/EnergyPlus/ConvectionCoefficients.hh
@@ -58,231 +58,190 @@
#include
#include
#include
-#include
#include
+#include
namespace EnergyPlus {
// Forward declarations
struct EnergyPlusData;
-namespace ConvectionCoefficients {
+namespace Convect {
- // Using/Aliasing
- using DataVectorTypes::Vector;
-
- struct HcInsideFaceUserCurveStruct
+ struct HcIntUserCurve
{
// Members
std::string Name; // user's name for object
- ConvectionConstants::RefTemp ReferenceTempType = ConvectionConstants::RefTemp::Invalid;
- int HcFnTempDiffCurveNum = 0;
- int HcFnTempDiffDivHeightCurveNum = 0;
- int HcFnACHCurveNum = 0;
- int HcFnACHDivPerimLengthCurveNum = 0;
+ RefTemp refTempType = RefTemp::Invalid;
+ int hcFnTempDiffCurveNum = 0;
+ int hcFnTempDiffDivHeightCurveNum = 0;
+ int hcFnACHCurveNum = 0;
+ int hcFnACHDivPerimLengthCurveNum = 0;
};
- struct HcOutsideFaceUserCurveStruct
+ struct HcExtUserCurve
{
// Members
std::string Name;
- int ReferenceTempType = 0;
- bool SuppressRainChange = false;
- ConvectionConstants::RefWind WindSpeedType = ConvectionConstants::RefWind::Invalid;
- int HfFnWindSpeedCurveNum = 0;
- int HnFnTempDiffCurveNum = 0;
- int HnFnTempDiffDivHeightCurveNum = 0;
+ RefTemp refTempType = RefTemp::Invalid;
+ bool suppressRainChange = false;
+ RefWind windSpeedType = RefWind::Invalid;
+ int hfFnWindSpeedCurveNum = 0;
+ int hnFnTempDiffCurveNum = 0;
+ int hnFnTempDiffDivHeightCurveNum = 0;
};
- struct InsideFaceAdaptiveConvAlgoStruct
+ struct IntAdaptiveConvAlgo
{
// Members
std::string Name;
- int SimpleBuoyVertWallEqNum = ConvectionConstants::HcInt_FohannoPolidoriVerticalWall; // InConvClass_A3_VertWalls
- int SimpleBuoyVertWallUserCurveNum = 0;
- int SimpleBuoyStableHorizEqNum = ConvectionConstants::HcInt_AlamdariHammondStableHorizontal; // InConvClass_A3_StableHoriz
- int SimpleBuoyStableHorizUserCurveNum = 0;
- int SimpleBuoyUnstableHorizEqNum = ConvectionConstants::HcInt_AlamdariHammondUnstableHorizontal; // InConvClass_A3_UnstableHoriz
- int SimpleBuoyUnstableHorizUserCurveNum = 0;
- int SimpleBuoyStableTiltedEqNum = ConvectionConstants::HcInt_WaltonStableHorizontalOrTilt; // InConvClass_A3_StableTilted
- int SimpleBuoyStableTiltedUserCurveNum = 0;
- int SimpleBuoyUnstableTiltedEqNum = ConvectionConstants::HcInt_WaltonUnstableHorizontalOrTilt; // InConvClass_A3_UnstableTilted
- int SimpleBuoyUnstableTiltedUserCurveNum = 0;
- int SimpleBuoyWindowsEqNum = ConvectionConstants::HcInt_ISO15099Windows; // InConvClass_A3_Windows
- int SimpleBuoyWindowsUserCurveNum = 0;
- int FloorHeatCeilingCoolVertWallEqNum = ConvectionConstants::HcInt_KhalifaEq3WallAwayFromHeat; // InConvClass_A1_VertWalls
- int FloorHeatCeilingCoolVertWallUserCurveNum = 0;
- int FloorHeatCeilingCoolStableHorizEqNum = ConvectionConstants::HcInt_AlamdariHammondStableHorizontal; // InConvClass_A1_StableHoriz
- int FloorHeatCeilingCoolStableHorizUserCurveNum = 0;
- int FloorHeatCeilingCoolUnstableHorizEqNum = ConvectionConstants::HcInt_KhalifaEq4CeilingAwayFromHeat; // InConvClass_A1_UnstableHoriz
- int FloorHeatCeilingCoolUnstableHorizUserCurveNum = 0;
- int FloorHeatCeilingCoolHeatedFloorEqNum = ConvectionConstants::HcInt_AwbiHattonHeatedFloor; // InConvClass_A1_HeatedFloor
- int FloorHeatCeilingCoolHeatedFloorUserCurveNum = 0;
- int FloorHeatCeilingCoolChilledCeilingEqNum = ConvectionConstants::HcInt_KaradagChilledCeiling; // InConvClass_A1_ChilledCeil
- int FloorHeatCeilingCoolChilledCeilingUserCurveNum = 0;
- int FloorHeatCeilingCoolStableTiltedEqNum = ConvectionConstants::HcInt_WaltonStableHorizontalOrTilt; // InConvClass_A1_StableTilted
- int FloorHeatCeilingCoolStableTiltedUserCurveNum = 0;
- int FloorHeatCeilingCoolUnstableTiltedEqNum = ConvectionConstants::HcInt_WaltonUnstableHorizontalOrTilt; // InConvClass_A1_UnstableTilted
- int FloorHeatCeilingCoolUnstableTiltedUserCurveNum = 0;
- int FloorHeatCeilingCoolWindowsEqNum = ConvectionConstants::HcInt_ISO15099Windows; // InConvClass_A1_Windows
- int FloorHeatCeilingCoolWindowsUserCurveNum = 0;
- int WallPanelHeatVertWallEqNum = ConvectionConstants::HcInt_KhalifaEq6NonHeatedWalls; // InConvClass_A2_VertWallsNonHeated
- int WallPanelHeatVertWallUserCurveNum = 0;
- int WallPanelHeatHeatedWallEqNum = ConvectionConstants::HcInt_AwbiHattonHeatedWall; // InConvClass_A2_HeatedVerticalWall
- int WallPanelHeatHeatedWallUserCurveNum = 0;
- int WallPanelHeatStableHorizEqNum = ConvectionConstants::HcInt_AlamdariHammondStableHorizontal; // InConvClass_A2_StableHoriz
- int WallPanelHeatStableHorizUserCurveNum = 0;
- int WallPanelHeatUnstableHorizEqNum = ConvectionConstants::HcInt_KhalifaEq7Ceiling; // InConvClass_A2_UnstableHoriz
- int WallPanelHeatUnstableHorizUserCurveNum = 0;
- int WallPanelHeatStableTiltedEqNum = ConvectionConstants::HcInt_WaltonStableHorizontalOrTilt; // InConvClass_A2_StableTilted
- int WallPanelHeatStableTiltedUserCurveNum = 0;
- int WallPanelHeatUnstableTiltedEqNum = ConvectionConstants::HcInt_WaltonUnstableHorizontalOrTilt; // InConvClass_A2_UnstableTilted
- int WallPanelHeatUnstableTiltedUserCurveNum = 0;
- int WallPanelHeatWindowsEqNum = ConvectionConstants::HcInt_ISO15099Windows; // InConvClass_A2_Windows
- int WallPanelHeatWindowsUserCurveNum = 0;
- int ConvectiveHeatVertWallEqNum = ConvectionConstants::HcInt_FohannoPolidoriVerticalWall;
- int ConvectiveHeatVertWallUserCurveNum = 0;
- int ConvectiveHeatVertWallNearHeaterEqNum = ConvectionConstants::HcInt_KhalifaEq5WallNearHeat;
- int ConvectiveHeatVertWallNearHeaterUserCurveNum = 0;
- int ConvectiveHeatStableHorizEqNum = ConvectionConstants::HcInt_AlamdariHammondStableHorizontal;
- int ConvectiveHeatStableHorizUserCurveNum = 0;
- int ConvectiveHeatUnstableHorizEqNum = ConvectionConstants::HcInt_KhalifaEq7Ceiling;
- int ConvectiveHeatUnstableHorizUserCurveNum = 0;
- int ConvectiveHeatStableTiltedEqNum = ConvectionConstants::HcInt_WaltonStableHorizontalOrTilt;
- int ConvectiveHeatStableTiltedUserCurveNum = 0;
- int ConvectiveHeatUnstableTiltedEqNum = ConvectionConstants::HcInt_WaltonUnstableHorizontalOrTilt;
- int ConvectiveHeatUnstableTiltedUserCurveNum = 0;
- int ConvectiveHeatWindowsEqNum = ConvectionConstants::HcInt_ISO15099Windows;
- int ConvectiveHeatWindowsUserCurveNum = 0;
- int CentralAirWallEqNum = ConvectionConstants::HcInt_GoldsteinNovoselacCeilingDiffuserWalls;
- int CentralAirWallUserCurveNum = 0;
- int CentralAirCeilingEqNum = ConvectionConstants::HcInt_FisherPedersenCeilDiffuserCeiling;
- int CentralAirCeilingUserCurveNum = 0;
- int CentralAirFloorEqNum = ConvectionConstants::HcInt_GoldsteinNovoselacCeilingDiffuserFloor;
- int CentralAirFloorUserCurveNum = 0;
- int CentralAirWindowsEqNum = ConvectionConstants::HcInt_GoldsteinNovoselacCeilingDiffuserWindow;
- int CentralAirWindowsUserCurveNum = 0;
- int ZoneFanCircVertWallEqNum = ConvectionConstants::HcInt_KhalifaEq3WallAwayFromHeat;
- int ZoneFanCircVertWallUserCurveNum = 0;
- int ZoneFanCircStableHorizEqNum = ConvectionConstants::HcInt_AlamdariHammondStableHorizontal;
- int ZoneFanCircStableHorizUserCurveNum = 0;
- int ZoneFanCircUnstableHorizEqNum = ConvectionConstants::HcInt_KhalifaEq4CeilingAwayFromHeat;
- int ZoneFanCircUnstableHorizUserCurveNum = 0;
- int ZoneFanCircStableTiltedEqNum = ConvectionConstants::HcInt_WaltonStableHorizontalOrTilt;
- int ZoneFanCircStableTiltedUserCurveNum = 0;
- int ZoneFanCircUnstableTiltedEqNum = ConvectionConstants::HcInt_WaltonUnstableHorizontalOrTilt;
- int ZoneFanCircUnstableTiltedUserCurveNum = 0;
- int ZoneFanCircWindowsEqNum = ConvectionConstants::HcInt_ISO15099Windows;
- int ZoneFanCircWindowsUserCurveNum = 0;
- int MixedBuoyAssistingFlowWallEqNum = ConvectionConstants::HcInt_BeausoleilMorrisonMixedAssistingWall;
- int MixedBuoyAssistingFlowWallUserCurveNum = 0;
- int MixedBuoyOpposingFlowWallEqNum = ConvectionConstants::HcInt_BeausoleilMorrisonMixedOppossingWall;
- int MixedBuoyOpposingFlowWallUserCurveNum = 0;
- int MixedStableFloorEqNum = ConvectionConstants::HcInt_BeausoleilMorrisonMixedStableFloor;
- int MixedStableFloorUserCurveNum = 0;
- int MixedUnstableFloorEqNum = ConvectionConstants::HcInt_BeausoleilMorrisonMixedUnstableFloor;
- int MixedUnstableFloorUserCurveNum = 0;
- int MixedStableCeilingEqNum = ConvectionConstants::HcInt_BeausoleilMorrisonMixedStableCeiling;
- int MixedStableCeilingUserCurveNum = 0;
- int MixedUnstableCeilingEqNum = ConvectionConstants::HcInt_BeausoleilMorrisonMixedUnstableCeiling;
- int MixedUnstableCeilingUserCurveNum = 0;
- int MixedWindowsEqNum = ConvectionConstants::HcInt_GoldsteinNovoselacCeilingDiffuserWindow;
- int MixedWindowsUserCurveNum = 0;
- };
-
- struct OutsideFaceAdaptiveConvAlgoStruct
- {
- // Members
- std::string Name;
- bool SuppressRainChange = false;
- int HWindWallWindwardEqNum = ConvectionConstants::HcExt_SparrowWindward;
- int HWindWallWindwardUserCurveNum = 0;
- int HWindWallLeewardEqNum = ConvectionConstants::HcExt_SparrowLeeward;
- int HWindWallLeewardUserCurveNum = 0;
- int HWindHorizRoofEqNum = ConvectionConstants::HcExt_ClearRoof;
- int HWindHorizRoofUserCurveNum = 0;
- int HNatVertWallEqNum = ConvectionConstants::HcExt_NaturalASHRAEVerticalWall;
- int HNatVertWallUserCurveNum = 0;
- int HNatStableHorizEqNum = ConvectionConstants::HcExt_NaturalWaltonStableHorizontalOrTilt;
- int HNatStableHorizUserCurveNum = 0;
- int HNatUnstableHorizEqNum = ConvectionConstants::HcExt_NaturalWaltonUnstableHorizontalOrTilt;
- int HNatUnstableHorizUserCurveNum = 0;
- };
- struct BoundingBoxVertStruct
- {
- // Members
- int SurfNum = 0;
- int VertNum = 0;
- Vector Vertex{0.0, 0.0, 0.0};
- };
-
- struct RoofGeoCharacteristicsStruct
- {
- // Members
- Real64 Area = 0.0; // Sum of all roof surface areas
- Real64 Perimeter = 0.0; // Actual perimeter of all roof surfaces, after removing all edges that are used twice (and inserting vertices
- // to split surfaces as needed)
- Real64 Height = 0.0; // Weighted average mean vertical height: for each surface, take max - Zmin value,
- // then do a weighted average by surface area
- Real64 Azimuth = 0.0; // Weighted average azimuth
- Real64 Tilt = 0.0; // Weighted average tilt
+ std::array(IntConvClass::Num)> intConvClassEqNums = {
+ HcInt::FohannoPolidoriVerticalWall, // A3_SimpleBuoy_VertWalls
+ HcInt::AlamdariHammondStableHorizontal, // A3_SimpleBuoy_StableHoriz
+ HcInt::AlamdariHammondUnstableHorizontal, // A3_SimpleBuoy_UnstableHoriz
+ HcInt::WaltonStableHorizontalOrTilt, // A3_SimpleBuoy_StableTilted
+ HcInt::WaltonUnstableHorizontalOrTilt, // A3_SimpleBuoy_UnstableTilted
+ HcInt::ISO15099Windows, // A3_SimpleBuoy_Windows
+ HcInt::KhalifaEq3WallAwayFromHeat, // A1_FloorHeatCeilingCool_VertWalls
+ HcInt::AlamdariHammondStableHorizontal, // A1_FloorHeatCeilingCool_StableHoriz
+ HcInt::KhalifaEq4CeilingAwayFromHeat, // A1_FloorHeatCeilingCool_UnstableHoriz
+ HcInt::AwbiHattonHeatedFloor, // A1_FloorHeatCeilingCool_HeatedFloor
+ HcInt::KaradagChilledCeiling, // A1_FloorHeatCeilingCool_ChilledCeil
+ HcInt::WaltonStableHorizontalOrTilt, // A1_FloorHeatCeilingCool_StableTilted
+ HcInt::WaltonUnstableHorizontalOrTilt, // A1_FloorHeatCeilingCool_UnstableTilted
+ HcInt::ISO15099Windows, // A1_FloorHeatCeilingCool_Windows
+ HcInt::KhalifaEq6NonHeatedWalls, // A2_WallPanelHeat_VertWallsNonHeated
+ HcInt::AwbiHattonHeatedWall, // A2_WallPanelHeat_HeatedVerticalWall
+ HcInt::AlamdariHammondStableHorizontal, // A2_WallPanelHeat_StableHoriz
+ HcInt::KhalifaEq7Ceiling, // A2_WallPanelHeat_UnstableHoriz
+ HcInt::WaltonStableHorizontalOrTilt, // A2_WallPanelHeat_StableTilted
+ HcInt::WaltonUnstableHorizontalOrTilt, // A2_WallPanelHeat_UnstableTilted
+ HcInt::ISO15099Windows, // A2_WallPanelHeat_Windows
+ HcInt::FohannoPolidoriVerticalWall, // B_ConvectiveHeat_VertWall
+ HcInt::KhalifaEq5WallNearHeat, // B_ConvectiveHeat_VertWallNearHeater
+ HcInt::AlamdariHammondStableHorizontal, // B_ConvectiveHeat_StableHoriz
+ HcInt::KhalifaEq7Ceiling, // B_ConvectiveHeat_UnstableHoriz
+ HcInt::WaltonStableHorizontalOrTilt, // B_ConvectiveHeat_StableTilted
+ HcInt::WaltonUnstableHorizontalOrTilt, // B_ConvectiveHeat_UnstableTilted
+ HcInt::ISO15099Windows, // B_ConvectiveHeat_Windows
+ HcInt::GoldsteinNovoselacCeilingDiffuserWalls, // C_CentralAir_Walls
+ HcInt::FisherPedersenCeilDiffuserCeiling, // C_CentralAir_Ceiling
+ HcInt::GoldsteinNovoselacCeilingDiffuserFloor, // C_CentralAir_Floor
+ HcInt::GoldsteinNovoselacCeilingDiffuserWindow, // C_CentralAir_Windows
+ HcInt::KhalifaEq3WallAwayFromHeat, // D_ZoneFanCirc_VertWall
+ HcInt::AlamdariHammondStableHorizontal, // D_ZoneFanCirc_StableHoriz
+ HcInt::KhalifaEq4CeilingAwayFromHeat, // D_ZoneFanCirc_UnstableHoriz
+ HcInt::WaltonStableHorizontalOrTilt, // D_ZoneFanCirc_StableTilted
+ HcInt::WaltonUnstableHorizontalOrTilt, // D_ZoneFanCirc_UnstableTilted
+ HcInt::ISO15099Windows, // D_ZoneFanCirc_Windows
+ HcInt::BeausoleilMorrisonMixedAssistingWall, // E_MixedBuoy_AssistFlowWall
+ HcInt::BeausoleilMorrisonMixedOppossingWall, // E_MixedBuoy_OppositeFlowWall
+ HcInt::BeausoleilMorrisonMixedStableFloor, // E_MixedBuoy_StableFloor
+ HcInt::BeausoleilMorrisonMixedUnstableFloor, // E_MixedBuoy_UnstableFloor
+ HcInt::BeausoleilMorrisonMixedStableCeiling, // E_MixedBuoy_StableCeiling
+ HcInt::BeausoleilMorrisonMixedUnstableCeiling, // E_MixedBuoy_UnstableCeiling
+ HcInt::GoldsteinNovoselacCeilingDiffuserWindow // E_MixedBuoy_Windows
+ };
+
+ std::array(IntConvClass::Num)> intConvClassUserCurveNums = {
+ 0, // A3_SimpleBuoy_VertWalls
+ 0, // A3_SimpleBuoy_StableHoriz
+ 0, // A3_SimpleBuoy_UnstableHoriz
+ 0, // A3_SimpleBuoy_StableTilted
+ 0, // A3_SimpleBuoy_UnstableTilted
+ 0, // A3_SimpleBuoy_Windows
+ 0, // A1_FloorHeatCeilingCool_VertWalls
+ 0, // A1_FloorHeatCeilingCool_StableHoriz
+ 0, // A1_FloorHeatCeilingCool_UnstableHoriz
+ 0, // A1_FloorHeatCeilingCool_HeatedFloor
+ 0, // A1_FloorHeatCeilingCool_ChilledCeil
+ 0, // A1_FloorHeatCeilingCool_StableTilted
+ 0, // A1_FloorHeatCeilingCool_UnstableTilted
+ 0, // A1_FloorHeatCeilingCool_Windows
+ 0, // A2_WallPanelHeat_VertWallsNonHeated
+ 0, // A2_WallPanelHeat_HeatedVerticalWall
+ 0, // A2_WallPanelHeat_StableHoriz
+ 0, // A2_WallPanelHeat_UnstableHoriz
+ 0, // A2_WallPanelHeat_StableTilted
+ 0, // A2_WallPanelHeat_UnstableTilted
+ 0, // A2_WallPanelHeat_Windows
+ 0, // B_ConvectiveHeat_VertWall
+ 0, // B_ConvectiveHeat_VertWallNearHeater
+ 0, // B_ConvectiveHeat_StableHoriz
+ 0, // B_ConvectiveHeat_UnstableHoriz
+ 0, // B_ConvectiveHeat_StableTilted
+ 0, // B_ConvectiveHeat_UnstableTilted
+ 0, // B_ConvectiveHeat_Windows
+ 0, // C_CentralAir_Walls
+ 0, // C_CentralAir_Ceiling
+ 0, // C_CentralAir_Floor
+ 0, // C_CentralAir_Windows
+ 0, // D_ZoneFanCirc_VertWall
+ 0, // D_ZoneFanCirc_StableHoriz
+ 0, // D_ZoneFanCirc_UnstableHoriz
+ 0, // D_ZoneFanCirc_StableTilted
+ 0, // D_ZoneFanCirc_UnstableTilted
+ 0, // D_ZoneFanCirc_Windows
+ 0, // E_MixedBuoy_AssistFlowWall
+ 0, // E_MixedBuoy_OppositeFlowWall
+ 0, // E_MixedBuoy_StableFloor
+ 0, // E_MixedBuoy_UnstableFloor
+ 0, // E_MixedBuoy_StableCeiling
+ 0, // E_MixedBuoy_UnstableCeiling
+ 0 // E_MixedBuoy_Windows
+ };
};
- struct FacadeGeoCharacteristicsStruct
+ struct ExtAdaptiveConvAlgo
{
// Members
- Real64 AzimuthRangeLow;
- Real64 AzimuthRangeHi;
- Real64 Zmax;
- Real64 Zmin;
- Real64 Ymax;
- Real64 Ymin;
- Real64 Xmax;
- Real64 Xmin;
- Real64 Area;
- Real64 Perimeter;
- Real64 Height;
-
- // Default Constructor
- FacadeGeoCharacteristicsStruct() = default;
-
- // Member Constructor
- FacadeGeoCharacteristicsStruct(Real64 const AzimuthRangeLow,
- Real64 const AzimuthRangeHi,
- Real64 const Zmax,
- Real64 const Zmin,
- Real64 const Ymax,
- Real64 const Ymin,
- Real64 const Xmax,
- Real64 const Xmin,
- Real64 const Area,
- Real64 const Perimeter,
- Real64 const Height)
- : AzimuthRangeLow(AzimuthRangeLow), AzimuthRangeHi(AzimuthRangeHi), Zmax(Zmax), Zmin(Zmin), Ymax(Ymax), Ymin(Ymin), Xmax(Xmax),
- Xmin(Xmin), Area(Area), Perimeter(Perimeter), Height(Height)
- {
- }
+ std::string Name;
+ bool suppressRainChange = false;
+
+ std::array(ExtConvClass2::Num)> extConvClass2EqNums = {
+ HcExt::SparrowWindward, // WindConvection_WindwardWall
+ HcExt::SparrowLeeward, // WindConvection_LeewardWall
+ HcExt::ClearRoof, // WindConvection_HorizRoof
+ HcExt::NaturalASHRAEVerticalWall, // NaturalConvection_VertWall
+ HcExt::NaturalWaltonStableHorizontalOrTilt, // NaturalConvection_StableHorizOrTilt
+ HcExt::NaturalWaltonUnstableHorizontalOrTilt // NaturalConvection_StableHorizOrTilt
+ };
+
+ std::array(ExtConvClass2::Num)> extConvClass2UserCurveNums = {
+ 0, // WindConvection_WindwardWall
+ 0, // WindConvection_LeewardWall
+ 0, // WindConvection_HorizRoof
+ 0, // NaturalConvection_VertWall
+ 0, // NaturalConvection_StableHorizOrTilt
+ 0 // NaturalConvection_StableHorizOrTilt
+ };
};
// Functions
- void
- InitInteriorConvectionCoeffs(EnergyPlusData &state,
- const Array1D &SurfaceTemperatures, // Temperature of surfaces for evaluation of HcIn
- ObjexxFCL::Optional_int_const ZoneToResimulate = _ // if passed in, then only calculate surfaces that have this zone
+ void InitIntConvCoeff(EnergyPlusData &state,
+ const Array1D &SurfaceTemperatures, // Temperature of surfaces for evaluation of HcIn
+ ObjexxFCL::Optional_int_const ZoneToResimulate = _ // if passed in, then only calculate surfaces that have this zone
+ );
+
+ void InitExtConvCoeff(EnergyPlusData &state,
+ int SurfNum, // Surface number (in Surface derived type)
+ Real64 HMovInsul, // Equivalent convection coefficient of movable insulation
+ Material::SurfaceRoughness Roughness, // Roughness index (1-6), see DataHeatBalance parameters
+ Real64 AbsExt, // Exterior thermal absorptance
+ Real64 TempExt, // Exterior surface temperature (C)
+ Real64 &HExt, // Convection coefficient to exterior air
+ Real64 &HSky, // "Convection" coefficient to sky temperature
+ Real64 &HGround, // "Convection" coefficient to ground temperature
+ Real64 &HAir, // Radiation to Air Component
+ Real64 &HSrdSurf // Radiation to surrounding surfaces
);
- void InitExteriorConvectionCoeff(EnergyPlusData &state,
- int SurfNum, // Surface number (in Surface derived type)
- Real64 HMovInsul, // Equivalent convection coefficient of movable insulation
- Material::SurfaceRoughness Roughness, // Roughness index (1-6), see DataHeatBalance parameters
- Real64 AbsExt, // Exterior thermal absorptance
- Real64 TempExt, // Exterior surface temperature (C)
- Real64 &HExt, // Convection coefficient to exterior air
- Real64 &HSky, // "Convection" coefficient to sky temperature
- Real64 &HGround, // "Convection" coefficient to ground temperature
- Real64 &HAir // Radiation to Air Component
+ Real64 SurroundingSurfacesRadCoeffAverage(EnergyPlusData &state,
+ int const SurfNum, // Surface number (in Surface derived type)
+ Real64 const TempExtK, // Exterior surface temperature (K)
+ Real64 const AbsExt // Exterior thermal absorptance
);
Real64 CalcHfExteriorSparrow(Real64 SurfWindSpeed, // Local wind speed at height of the heat transfer surface (m/s)
@@ -299,12 +258,15 @@ namespace ConvectionCoefficients {
Real64 WindDirection // Wind direction measured clockwise from geographhic North
);
- void GetUserConvectionCoefficients(EnergyPlusData &state);
+ void GetUserConvCoeffs(EnergyPlusData &state);
- void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes, std::string const &ConvectionType, int Value);
+ void ApplyIntConvValue(EnergyPlusData &state, int surfNum, HcInt model, int userNum);
+ void ApplyExtConvValue(EnergyPlusData &state, int surfNum, HcExt model, int userNum);
+ void ApplyIntConvValueMulti(EnergyPlusData &state, DataSurfaces::SurfaceFilter surfaceFilter, HcInt model, int userNum);
+ void ApplyExtConvValueMulti(EnergyPlusData &state, DataSurfaces::SurfaceFilter surfaceFilter, HcExt model, int userNum);
- Real64 CalcASHRAESimpExtConvectCoeff(Material::SurfaceRoughness Roughness, // Integer index for roughness, relates to parameter array indices
- Real64 SurfWindSpeed // Current wind speed, m/s
+ Real64 CalcASHRAESimpExtConvCoeff(Material::SurfaceRoughness Roughness, // Integer index for roughness, relates to parameter array indices
+ Real64 SurfWindSpeed // Current wind speed, m/s
);
Real64 CalcASHRAESimpleIntConvCoeff(Real64 Tsurf, Real64 Tamb, Real64 cosTilt);
@@ -364,19 +326,18 @@ namespace ConvectionCoefficients {
const Array1D &SurfaceTemperatures // Temperature of surfaces for evaluation of HcIn
);
- void CalcNusselt(EnergyPlusData &state,
- int SurfNum, // Surface number
- Real64 asp, // Aspect ratio: window height to gap width
- Real64 tso, // Temperature of gap surface closest to outside (K)
- Real64 tsi, // Temperature of gap surface closest to zone (K)
- Real64 gr, // Gap gas Grashof number
- Real64 pr, // Gap gas Prandtl number
- Real64 &gnu // Gap gas Nusselt number
+ Real64 CalcNusselt(EnergyPlusData &state,
+ int SurfNum, // Surface number
+ Real64 asp, // Aspect ratio: window height to gap width
+ Real64 tso, // Temperature of gap surface closest to outside (K)
+ Real64 tsi, // Temperature of gap surface closest to zone (K)
+ Real64 gr, // Gap gas Grashof number
+ Real64 pr // Gap gas Prandtl number
);
- Real64 SetExtConvectionCoeff(EnergyPlusData &state, int SurfNum); // Surface Number
+ Real64 SetExtConvCoeff(EnergyPlusData &state, int SurfNum); // Surface Number
- Real64 SetIntConvectionCoeff(EnergyPlusData &state, int SurfNum); // Surface Number
+ Real64 SetIntConvCoeff(EnergyPlusData &state, int SurfNum); // Surface Number
Real64 CalcISO15099WindowIntConvCoeff(EnergyPlusData &state,
Real64 SurfaceTemperature, // Temperature of surface for evaluation of HcIn
@@ -393,38 +354,40 @@ namespace ConvectionCoefficients {
Real64 AirTemperature // Mean Air Temperature of Zone (or adjacent air temperature)
);
- RoofGeoCharacteristicsStruct getRoofGeometryInformation(EnergyPlusData &state);
+ void SetupAdaptiveConvStaticMetaData(EnergyPlusData &state);
- void SetupAdaptiveConvectionStaticMetaData(EnergyPlusData &state);
+ void SetupAdaptiveConvRadiantSurfaceData(EnergyPlusData &state);
- void SetupAdaptiveConvectionRadiantSurfaceData(EnergyPlusData &state);
+ void ManageIntAdaptiveConvAlgo(EnergyPlusData &state, int SurfNum); // surface number for which coefficients are being calculated
- void ManageInsideAdaptiveConvectionAlgo(EnergyPlusData &state, int SurfNum); // surface number for which coefficients are being calculated
+ Real64 ManageExtAdaptiveConvAlgo(EnergyPlusData &state,
+ int SurfNum); // surface number for which coefficients are being calculated
- void ManageOutsideAdaptiveConvectionAlgo(EnergyPlusData &state,
- int SurfNum, // surface number for which coefficients are being calculated
- Real64 &Hc // result for Hc Outside face, becomes HExt.
- );
+ Real64 EvaluateIntHcModels(EnergyPlusData &state, int SurfNum, HcInt ConvModelEquationNum);
- void EvaluateIntHcModels(EnergyPlusData &state,
- int SurfNum,
- int ConvModelEquationNum,
- Real64 &Hc // calculated Hc value
- );
-
- void EvaluateExtHcModels(EnergyPlusData &state, int SurfNum, int NaturalConvModelEqNum, int ForcedConvModelEqNum, Real64 &Hc);
+ Real64 EvaluateExtHcModels(EnergyPlusData &state, int SurfNum, HcExt NaturalConvModelEqNum, HcExt ForcedConvModelEqNum);
void DynamicExtConvSurfaceClassification(EnergyPlusData &state, int SurfNum); // surface number
- void MapExtConvClassificationToHcModels(EnergyPlusData &state, int SurfNum); // surface number
+ void MapExtConvClassToHcModels(EnergyPlusData &state, int SurfNum); // surface number
void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int SurfNum); // surface number
- void MapIntConvClassificationToHcModels(EnergyPlusData &state, int SurfNum); // surface pointer index
+ void MapIntConvClassToHcModels(EnergyPlusData &state, int SurfNum); // surface pointer index
+
+ Real64 CalcUserDefinedIntHcModel(EnergyPlusData &state, int SurfNum, int UserCurveNum);
- void CalcUserDefinedInsideHcModel(EnergyPlusData &state, int SurfNum, int UserCurveNum, Real64 &Hc);
+ Real64 CalcUserDefinedExtHcModel(EnergyPlusData &state, int SurfNum, int UserCurveNum);
- void CalcUserDefinedOutsideHcModel(EnergyPlusData &state, int SurfNum, int UserCurveNum, Real64 &H);
+ void ShowWarningHydraulicDiameterZero(EnergyPlusData &state, int &errorIdx, ErrorObjectHeader const &eoh);
+
+ void ShowWarningDeltaTempZero(EnergyPlusData &state, int &errorIdx, ErrorObjectHeader const &eoh);
+
+ void ShowWarningWindowLocation(EnergyPlusData &state, int &errorIdx, ErrorObjectHeader const &eoh, IntConvWinLoc winLoc);
+
+ void ShowWarningPerimeterLengthZero(EnergyPlusData &state, int &errorIdx, ErrorObjectHeader const &eoh);
+
+ void ShowWarningFaceAreaZero(EnergyPlusData &state, int &errorIdx, ErrorObjectHeader const &eoh);
//** Begin catalog of Hc equation functions. **** !*************************************************
@@ -443,7 +406,7 @@ namespace ConvectionCoefficients {
// REFERENCES:
// 2. ASHRAE Handbook of Fundamentals 2001, p. 3.12, Table 5.
- return 1.31 * std::pow(std::abs(DeltaTemp), ConvectionConstants::OneThird);
+ return 1.31 * std::pow(std::abs(DeltaTemp), 1.0 / 3.0);
}
inline Real64 CalcWaltonUnstableHorizontalOrTilt(Real64 const DeltaTemp, // [C] temperature difference between surface and air
@@ -467,7 +430,7 @@ namespace ConvectionCoefficients {
// 1. Walton, G. N. 1983. Thermal Analysis Research Program (TARP) Reference Manual,
// NBSSIR 83-2655, National Bureau of Standards, "Surface Inside Heat Balances", pp 79-80.
- return 9.482 * std::pow(std::abs(DeltaTemp), ConvectionConstants::OneThird) / (7.238 - std::abs(CosineTilt));
+ return 9.482 * std::pow(std::abs(DeltaTemp), 1.0 / 3.0) / (7.238 - std::abs(CosineTilt));
}
inline Real64 CalcWaltonStableHorizontalOrTilt(Real64 const DeltaTemp, // [C] temperature difference between surface and air
@@ -489,7 +452,7 @@ namespace ConvectionCoefficients {
// 1. Walton, G. N. 1983. Thermal Analysis Research Program (TARP) Reference Manual,
// NBSSIR 83-2655, National Bureau of Standards, "Surface Inside Heat Balances", pp 79-80.
- return 1.810 * std::pow(std::abs(DeltaTemp), ConvectionConstants::OneThird) / (1.382 + std::abs(CosineTilt));
+ return 1.810 * std::pow(std::abs(DeltaTemp), 1.0 / 3.0) / (1.382 + std::abs(CosineTilt));
}
Real64 CalcFisherPedersenCeilDiffuserFloor(EnergyPlusData &state,
@@ -670,28 +633,28 @@ namespace ConvectionCoefficients {
Real64 CalcKaradagChilledCeiling(Real64 DeltaTemp); // [C] temperature difference between surface and air
- Real64 CalcGoldsteinNovoselacCeilingDiffuserWindow(Real64 AirSystemFlowRate, // [m3/s] air system flow rate
- Real64 ZoneExtPerimLength, // [m] length of zone perimeter with exterior walls
- Real64 WindWallRatio, // [ ] fraction of window area to wall area for zone
- ConvectionConstants::InConvWinLoc WindowLocationType // index for location types
+ Real64 CalcGoldsteinNovoselacCeilingDiffuserWindow(Real64 AirSystemFlowRate, // [m3/s] air system flow rate
+ Real64 ZoneExtPerimLength, // [m] length of zone perimeter with exterior walls
+ Real64 WindWallRatio, // [ ] fraction of window area to wall area for zone
+ IntConvWinLoc WindowLocationType // index for location types
);
Real64 CalcGoldsteinNovoselacCeilingDiffuserWindow(EnergyPlusData &state,
- Real64 ZoneExtPerimLength, // [m] length of zone perimeter with exterior walls
- Real64 WindWallRatio, // [ ] fraction of window area to wall area for zone
- ConvectionConstants::InConvWinLoc WindowLocationType, // index for location types
- int ZoneNum // for messages
+ Real64 ZoneExtPerimLength, // [m] length of zone perimeter with exterior walls
+ Real64 WindWallRatio, // [ ] fraction of window area to wall area for zone
+ IntConvWinLoc WindowLocationType, // index for location types
+ int ZoneNum // for messages
);
- Real64 CalcGoldsteinNovoselacCeilingDiffuserWall(Real64 AirSystemFlowRate, // [m3/s] air system flow rate
- Real64 ZoneExtPerimLength, // [m] length of zone perimeter with exterior walls
- ConvectionConstants::InConvWinLoc WindowLocationType // index for location types
+ Real64 CalcGoldsteinNovoselacCeilingDiffuserWall(Real64 AirSystemFlowRate, // [m3/s] air system flow rate
+ Real64 ZoneExtPerimLength, // [m] length of zone perimeter with exterior walls
+ IntConvWinLoc WindowLocationType // index for location types
);
Real64 CalcGoldsteinNovoselacCeilingDiffuserWall(EnergyPlusData &state,
- Real64 ZoneExtPerimLength, // [m] length of zone perimeter with exterior walls
- ConvectionConstants::InConvWinLoc WindowLocationType, // index for location types
- int ZoneNum // for messages
+ Real64 ZoneExtPerimLength, // [m] length of zone perimeter with exterior walls
+ IntConvWinLoc WindowLocationType, // index for location types
+ int ZoneNum // for messages
);
Real64 CalcGoldsteinNovoselacCeilingDiffuserFloor(Real64 AirSystemFlowRate, // [m3/s] air system flow rate
@@ -703,15 +666,15 @@ namespace ConvectionCoefficients {
int ZoneNum // for messages
);
- Real64 CalcSparrowWindward(Material::SurfaceRoughness RoughnessIndex, Real64 FacePerimeter, Real64 FaceArea, Real64 WindAtZ);
+ Real64 CalcSparrowWindward(Material::SurfaceRoughness roughness, Real64 FacePerimeter, Real64 FaceArea, Real64 WindAtZ);
Real64 CalcSparrowWindward(
- EnergyPlusData &state, Material::SurfaceRoughness RoughnessIndex, Real64 FacePerimeter, Real64 FaceArea, Real64 WindAtZ, int SurfNum);
+ EnergyPlusData &state, Material::SurfaceRoughness roughness, Real64 FacePerimeter, Real64 FaceArea, Real64 WindAtZ, int SurfNum);
- Real64 CalcSparrowLeeward(Material::SurfaceRoughness RoughnessIndex, Real64 FacePerimeter, Real64 FaceArea, Real64 WindAtZ);
+ Real64 CalcSparrowLeeward(Material::SurfaceRoughness roughness, Real64 FacePerimeter, Real64 FaceArea, Real64 WindAtZ);
Real64 CalcSparrowLeeward(
- EnergyPlusData &state, Material::SurfaceRoughness RoughnessIndex, Real64 FacePerimeter, Real64 FaceArea, Real64 WindAtZ, int SurfNum);
+ EnergyPlusData &state, Material::SurfaceRoughness roughness, Real64 FacePerimeter, Real64 FaceArea, Real64 WindAtZ, int SurfNum);
Real64 CalcMoWITTNatural(Real64 DeltaTemp);
@@ -723,11 +686,11 @@ namespace ConvectionCoefficients {
Real64 CalcMoWITTLeeward(Real64 DeltaTemp, Real64 WindAtZ);
- Real64 CalcDOE2Forced(Real64 SurfaceTemp, Real64 AirTemp, Real64 CosineTilt, Real64 HfSmooth, Material::SurfaceRoughness RoughnessIndex);
+ Real64 CalcDOE2Forced(Real64 SurfaceTemp, Real64 AirTemp, Real64 CosineTilt, Real64 HfSmooth, Material::SurfaceRoughness roughness);
- Real64 CalcDOE2Windward(Real64 SurfaceTemp, Real64 AirTemp, Real64 CosineTilt, Real64 WindAtZ, Material::SurfaceRoughness RoughnessIndex);
+ Real64 CalcDOE2Windward(Real64 SurfaceTemp, Real64 AirTemp, Real64 CosineTilt, Real64 WindAtZ, Material::SurfaceRoughness roughness);
- Real64 CalcDOE2Leeward(Real64 SurfaceTemp, Real64 AirTemp, Real64 CosineTilt, Real64 WindAtZ, Material::SurfaceRoughness RoughnessIndex);
+ Real64 CalcDOE2Leeward(Real64 SurfaceTemp, Real64 AirTemp, Real64 CosineTilt, Real64 WindAtZ, Material::SurfaceRoughness roughness);
Real64 CalcNusseltJurges(Real64 WindAtZ);
@@ -759,7 +722,7 @@ namespace ConvectionCoefficients {
Real64 WindDirect, // Wind direction measured clockwise from geographic North
Real64 RoofArea,
Real64 RoofPerimeter,
- Material::SurfaceRoughness RoughnessIndex);
+ Material::SurfaceRoughness roughness);
Real64 CalcClearRoof(EnergyPlusData &state,
int SurfNum,
@@ -779,9 +742,25 @@ namespace ConvectionCoefficients {
Real64
CalcASTMC1340ConvCoeff(EnergyPlusData &state, int const SurfNum, Real64 const Tsurf, Real64 const Tair, Real64 const Vair, Real64 const Tilt);
- ConvectionConstants::SurfConvOrientation GetSurfConvOrientation(Real64 const Tilt);
+ SurfOrientation GetSurfConvOrientation(Real64 const Tilt);
+
+ void ShowSevereValueOutOfRange(EnergyPlusData &state,
+ ErrorObjectHeader const &eoh,
+ std::string_view fieldName,
+ Real64 fieldVal,
+ Real64 lo,
+ Real64 hi,
+ std::string const &msg);
+
+ void ShowSevereScheduleOutOfRange(EnergyPlusData &state,
+ ErrorObjectHeader const &eoh,
+ std::string_view fieldName,
+ std::string_view fieldVal,
+ Real64 lo,
+ Real64 hi,
+ std::string const &msg);
-} // namespace ConvectionCoefficients
+} // namespace Convect
struct ConvectionCoefficientsData : BaseGlobalStruct
{
@@ -822,32 +801,16 @@ struct ConvectionCoefficientsData : BaseGlobalStruct
bool ActiveSurfaceCheck = true;
bool MyEnvirnFlag = true;
bool FirstRoofSurf = true;
- int ActiveWallCount = 0;
- Real64 ActiveWallArea = 0.0;
- int ActiveCeilingCount = 0;
- Real64 ActiveCeilingArea = 0.0;
- int ActiveFloorCount = 0;
- Real64 ActiveFloorArea = 0.0;
// Object Data
- ConvectionCoefficients::InsideFaceAdaptiveConvAlgoStruct InsideFaceAdaptiveConvectionAlgo; // stores rules for Hc model equations
- ConvectionCoefficients::OutsideFaceAdaptiveConvAlgoStruct OutsideFaceAdaptiveConvectionAlgo;
- Array1D HcInsideUserCurve;
- Array1D HcOutsideUserCurve;
- ConvectionCoefficients::RoofGeoCharacteristicsStruct RoofGeo;
-
- ConvectionCoefficients::FacadeGeoCharacteristicsStruct NorthFacade = {332.5, 22.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
- ConvectionCoefficients::FacadeGeoCharacteristicsStruct NorthEastFacade = {22.5, 67.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
- ConvectionCoefficients::FacadeGeoCharacteristicsStruct EastFacade = {67.5, 112.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
- ConvectionCoefficients::FacadeGeoCharacteristicsStruct SouthEastFacade = {112.5, 157.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
- ConvectionCoefficients::FacadeGeoCharacteristicsStruct SouthFacade = {157.5, 202.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
- ConvectionCoefficients::FacadeGeoCharacteristicsStruct SouthWestFacade = {202.5, 247.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
- ConvectionCoefficients::FacadeGeoCharacteristicsStruct WestFacade = {247.5, 287.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
- ConvectionCoefficients::FacadeGeoCharacteristicsStruct NorthWestFacade = {287.5, 332.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
+ Convect::IntAdaptiveConvAlgo intAdaptiveConvAlgo; // stores rules for Hc model equations
+ Convect::ExtAdaptiveConvAlgo extAdaptiveConvAlgo;
+ Array1D hcIntUserCurve;
+ Array1D hcExtUserCurve;
void clear_state() override
{
- *this = ConvectionCoefficientsData();
+ new (this) ConvectionCoefficientsData();
}
};
diff --git a/src/EnergyPlus/ConvectionConstants.hh b/src/EnergyPlus/ConvectionConstants.hh
index 63d518cf144..c35b379daad 100644
--- a/src/EnergyPlus/ConvectionConstants.hh
+++ b/src/EnergyPlus/ConvectionConstants.hh
@@ -51,100 +51,344 @@
// EnergyPlus Headers
#include
-namespace EnergyPlus::ConvectionConstants {
+namespace EnergyPlus::Convect {
// Data
// MODULE PARAMETER DEFINITIONS:
-Real64 constexpr AdaptiveHcInsideLowLimit{0.5}; // W/m2-K
-Real64 constexpr AdaptiveHcOutsideLowLimit{1.0}; // W/m2-K
-
-Real64 constexpr OneThird{1.0 / 3.0}; // 1/3 in highest precision
-Real64 constexpr OneFourth{1.0 / 4.0}; // 1/4 in highest precision
-Real64 constexpr OneFifth{1.0 / 5.0}; // 1/5 in highest precision
-Real64 constexpr OneSixth{1.0 / 6.0}; // 1/6 in highest precision
-Real64 constexpr FourFifths{4.0 / 5.0}; // 4/5 in highest precision
+Real64 constexpr AdaptiveHcIntLowLimit = 0.5; // W/m2-K
+Real64 constexpr AdaptiveHcExtLowLimit = 1.0; // W/m2-K
// parameters for identifying more specific hc model equations, inside face
-int constexpr HcInt_Value{-999};
-int constexpr HcInt_Schedule{-998};
-int constexpr HcInt_SetByZone{0};
-int constexpr HcInt_ASHRAESimple{1};
-int constexpr HcInt_ASHRAETARP{2};
-int constexpr HcInt_CeilingDiffuser{3};
-int constexpr HcInt_TrombeWall{4};
-int constexpr HcInt_AdaptiveConvectionAlgorithm{9};
-int constexpr HcInt_ASTMC1340{10};
-int constexpr HcInt_UserValue{200};
-int constexpr HcInt_UserSchedule{201};
-int constexpr HcInt_UserCurve{202};
-int constexpr HcInt_ASHRAEVerticalWall{203};
-int constexpr HcInt_WaltonUnstableHorizontalOrTilt{204};
-int constexpr HcInt_WaltonStableHorizontalOrTilt{205};
-int constexpr HcInt_FisherPedersenCeilDiffuserFloor{206};
-int constexpr HcInt_FisherPedersenCeilDiffuserCeiling{207};
-int constexpr HcInt_FisherPedersenCeilDiffuserWalls{208};
-int constexpr HcInt_AlamdariHammondStableHorizontal{209};
-int constexpr HcInt_AlamdariHammondVerticalWall{210};
-int constexpr HcInt_AlamdariHammondUnstableHorizontal{211};
-int constexpr HcInt_KhalifaEq3WallAwayFromHeat{212};
-int constexpr HcInt_KhalifaEq4CeilingAwayFromHeat{213};
-int constexpr HcInt_KhalifaEq5WallNearHeat{214};
-int constexpr HcInt_KhalifaEq6NonHeatedWalls{215};
-int constexpr HcInt_KhalifaEq7Ceiling{216};
-int constexpr HcInt_AwbiHattonHeatedFloor{217};
-int constexpr HcInt_AwbiHattonHeatedWall{218};
-int constexpr HcInt_BeausoleilMorrisonMixedAssistingWall{219};
-int constexpr HcInt_BeausoleilMorrisonMixedOppossingWall{220};
-int constexpr HcInt_BeausoleilMorrisonMixedStableCeiling{221};
-int constexpr HcInt_BeausoleilMorrisonMixedUnstableCeiling{222};
-int constexpr HcInt_BeausoleilMorrisonMixedStableFloor{223};
-int constexpr HcInt_BeausoleilMorrisonMixedUnstableFloor{224};
-int constexpr HcInt_FohannoPolidoriVerticalWall{225};
-int constexpr HcInt_KaradagChilledCeiling{226};
-int constexpr HcInt_ISO15099Windows{227};
-int constexpr HcInt_GoldsteinNovoselacCeilingDiffuserWindow{228};
-int constexpr HcInt_GoldsteinNovoselacCeilingDiffuserWalls{229};
-int constexpr HcInt_GoldsteinNovoselacCeilingDiffuserFloor{230};
+enum class HcInt
+{
+ Invalid = -1,
+ Value,
+ Schedule,
+ SetByZone,
+ ASHRAESimple,
+ ASHRAETARP,
+ CeilingDiffuser,
+ TrombeWall,
+ AdaptiveConvectionAlgorithm,
+ ASTMC1340,
+ UserValue,
+ UserSchedule,
+ UserCurve,
+ ASHRAEVerticalWall,
+ WaltonUnstableHorizontalOrTilt,
+ WaltonStableHorizontalOrTilt,
+ FisherPedersenCeilDiffuserFloor,
+ FisherPedersenCeilDiffuserCeiling,
+ FisherPedersenCeilDiffuserWalls,
+ AlamdariHammondStableHorizontal,
+ AlamdariHammondVerticalWall,
+ AlamdariHammondUnstableHorizontal,
+ KhalifaEq3WallAwayFromHeat,
+ KhalifaEq4CeilingAwayFromHeat,
+ KhalifaEq5WallNearHeat,
+ KhalifaEq6NonHeatedWalls,
+ KhalifaEq7Ceiling,
+ AwbiHattonHeatedFloor,
+ AwbiHattonHeatedWall,
+ BeausoleilMorrisonMixedAssistingWall,
+ BeausoleilMorrisonMixedOppossingWall,
+ BeausoleilMorrisonMixedStableFloor,
+ BeausoleilMorrisonMixedUnstableFloor,
+ BeausoleilMorrisonMixedStableCeiling,
+ BeausoleilMorrisonMixedUnstableCeiling,
+ FohannoPolidoriVerticalWall,
+ KaradagChilledCeiling,
+ ISO15099Windows,
+ GoldsteinNovoselacCeilingDiffuserWindow,
+ GoldsteinNovoselacCeilingDiffuserWalls,
+ GoldsteinNovoselacCeilingDiffuserFloor,
+ Num
+};
+
+constexpr std::array(HcInt::Num)> HcIntNames = {
+ "Value",
+ "Schedule",
+ "SetByZone",
+ "Simple",
+ "TARP",
+ "CeilingDiffuser",
+ "TrombeWall",
+ "AdaptiveConvectionAlgorithm",
+ "ASTMC1340",
+ "UserValue",
+ "UserSchedule",
+ "UserCurve",
+ "ASHRAEVerticalWall",
+ "WaltonUnstableHorizontalOrTilt",
+ "WaltonStableHorizontalOrTilt",
+ "FisherPedersenCeilingDiffuserWalls",
+ "FisherPedersenCeilingDiffuserCeling",
+ "FisherPedersenCeilingDiffuserFloor",
+ "AlamdariHammondStableHorizontal",
+ "AlamdariHammondVerticalWall",
+ "AlamdariHammondUnstableHorizontal",
+ "KhalifaEQ3WallAwayFromHeat",
+ "KhalifaEQ4CeilingAwayFromHeat",
+ "KhalifaEQ5WallNearHeat",
+ "KhalifaEQ6NonHeatedWalls",
+ "KhalifaEQ7Ceiling",
+ "AwbiHattonHeatedFloor",
+ "AwbiHattonHeatedWall",
+ "BeausoleilMorrisonMixedAassitedWall",
+ "BeausoleilMorrisonMixedOpposingWall",
+ "BeausoleilMorrisonMixedStableFloor",
+ "BeausoleilMorrisonMixedUnstableFloor",
+ "BeausoleilMorrisonMixedStableCeiling",
+ "BeausoleilMorrisonMixedUnstableCeiling",
+ "FohannoPolidoriVerticalWall",
+ "KaradagChilledCeiling",
+ "ISO15099Windows",
+ "GoldsteinNovoselacCeilingDiffuserWindow",
+ "GoldsteinNovoselacCeilingDiffuserWalls",
+ "GoldsteinNovoselacCeilingDiffuserFloor",
+};
+
+constexpr std::array(HcInt::Num)> HcIntNamesUC = {"VALUE",
+ "SCHEDULE",
+ "SETBYZONE",
+ "SIMPLE",
+ "TARP",
+ "CEILINGDIFFUSER",
+ "TROMBEWALL",
+ "ADAPTIVECONVECTIONALGORITHM",
+ "ASTMC1340",
+ "USERVALUE",
+ "USERSCHEDULE",
+ "USERCURVE",
+ "ASHRAEVERTICALWALL",
+ "WALTONUNSTABLEHORIZONTALORTILT",
+ "WALTONSTABLEHORIZONTALORTILT",
+ "FISHERPEDERSENCEILINGDIFFUSERWALLS",
+ "FISHERPEDERSENCEILINGDIFFUSERCEILING",
+ "FISHERPEDERSENCEILINGDIFFUSERFLOOR",
+ "ALAMDARIHAMMONDSTABLEHORIZONTAL",
+ "ALAMDARIHAMMONDVERTICALWALL",
+ "ALAMDARIHAMMONDUNSTABLEHORIZONTAL",
+ "KHALIFAEQ3WALLAWAYFROMHEAT",
+ "KHALIFAEQ4CEILINGAWAYFROMHEAT",
+ "KHALIFAEQ5WALLNEARHEAT",
+ "KHALIFAEQ6NONHEATEDWALLS",
+ "KHALIFAEQ7CEILING",
+ "AWBIHATTONHEATEDFLOOR",
+ "AWBIHATTONHEATEDWALL",
+ "BEAUSOLEILMORRISONMIXEDASSISTEDWALL",
+ "BEAUSOLEILMORRISONMIXEDOPPOSINGWALL",
+ "BEAUSOLEILMORRISONMIXEDSTABLEFLOOR",
+ "BEAUSOLEILMORRISONMIXEDUNSTABLEFLOOR",
+ "BEAUSOLEILMORRISONMIXEDSTABLECEILING",
+ "BEAUSOLEILMORRISONMIXEDUNSTABLECEILING",
+ "FOHANNOPOLIDORIVERTICALWALL",
+ "KARADAGCHILLEDCEILING",
+ "ISO15099WINDOWS",
+ "GOLDSTEINNOVOSELACCEILINGDIFFUSERWINDOW",
+ "GOLDSTEINNOVOSELACCEILINGDIFFUSERWALLS",
+ "GOLDSTEINNOVOSELACCEILINGDIFFUSERFLOOR"};
+
+constexpr std::array(HcInt::Num)> HcIntReportVals = {
+ -999, // Value
+ -998, // Schedule
+ 0, // SetByZone
+ 1, // ASHRAESimple
+ 2, // ASHRAETARP
+ 3, // CeilingDiffuser
+ 4, // TrombeWall
+ 9, // AdaptiveConvectionAlgorithm
+ 10, // ASTMC1340
+ 200, // UserValue
+ 201, // UesrSchedule
+ 202, // UserCurve
+ 203, // ASHRAEVerticalWall
+ 204, // WaltonUnstableHorizontalOrTilt
+ 205, // WaltonStableHorizontalOrTilt
+ 206, // FisherPedersenCeilDiffuserWalls
+ 207, // FisherPedersenCeilDiffuserCeiling
+ 208, // FisherPedersenCeilDiffuserFloor
+ 209, // AlamdariHammondStableHorizontal
+ 210, // AlamdariHammondUnstableHorizontal
+ 211, // AlamdariHammondVerticalWall
+ 212, // KhalifaEq3WallAwayFromHeat
+ 213, // KhalifaEq4CeilingAwayFromHeat
+ 214, // KhalifaEq5WallNearHeat
+ 215, // KhalifaEq6NonHeatedWalls
+ 216, // KhalifaEq7Ceiling
+ 217, // AwbiHattonHeatedFloor
+ 218, // AwbiHattonHeatedWall
+ 219, // BeausoleilMorrisonMixedAssistingWall
+ 220, // BeausoleilMorrisonMixedOppossingWall
+ 221, // BeausoleilMorrisonMixedStableFloor
+ 222, // BeausoleilMorrisonMixedUnstableFloor
+ 223, // BeausoleilMorrisonMixedStableCeiling
+ 224, // BeausoleilMorrisonMixedUnstableCeiling
+ 225, // FohannoPolidoriVerticalWall
+ 226, // KaradagChilledCeiling
+ 227, // ISO15099Windows
+ 228, // GoldsteinNovoselacCeilingDiffuserWindow
+ 229, // GoldsteinNovoselacCeilingDiffuserWalls
+ 230 // GoldsteinNovoselacCeilingDiffuserFloor
+};
+
+enum class HcExt
+{
+ Invalid = -1,
+ Value,
+ Schedule,
+ SetByZone,
+ ASHRAESimple,
+ ASHRAETARP,
+ TarpHcOutside,
+ MoWiTTHcOutside,
+ DOE2HcOutside,
+ BLASTHcOutside,
+ AdaptiveConvectionAlgorithm,
+ None, // none is allowed because Hn and Hf are split
+ UserValue,
+ UserSchedule,
+ UserCurve,
+ ASHRAESimpleCombined,
+ NaturalASHRAEVerticalWall,
+ NaturalWaltonUnstableHorizontalOrTilt,
+ NaturalWaltonStableHorizontalOrTilt,
+ SparrowWindward,
+ SparrowLeeward,
+ MoWiTTWindward,
+ MoWiTTLeeward,
+ DOE2Windward,
+ DOE2Leeward,
+ NusseltJurges,
+ McAdams,
+ Mitchell,
+ ClearRoof,
+ BlockenWindward,
+ EmmelVertical,
+ EmmelRoof,
+ AlamdariHammondVerticalWall,
+ FohannoPolidoriVerticalWall,
+ ISO15099Windows,
+ AlamdariHammondStableHorizontal,
+ AlamdariHammondUnstableHorizontal,
+ Num
+};
-// parameters for identifying more specific hc model equations, outside face
-int constexpr HcExt_Value{-999};
-int constexpr HcExt_Schedule{-998};
-int constexpr HcExt_ASHRAESimple{1};
-int constexpr HcExt_ASHRAETARP{2};
-int constexpr HcExt_TarpHcOutside{5};
-int constexpr HcExt_MoWiTTHcOutside{6};
-int constexpr HcExt_DOE2HcOutside{7};
-int constexpr HcExt_BLASTHcOutside{8};
-int constexpr HcExt_AdaptiveConvectionAlgorithm{9};
-int constexpr HcExt_None{300}; // none is allowed because Hn and Hf are split
-int constexpr HcExt_UserValue{301};
-int constexpr HcExt_UserSchedule{302};
-int constexpr HcExt_UserCurve{303};
-int constexpr HcExt_ASHRAESimpleCombined{304};
-int constexpr HcExt_NaturalASHRAEVerticalWall{305};
-int constexpr HcExt_NaturalWaltonUnstableHorizontalOrTilt{306};
-int constexpr HcExt_NaturalWaltonStableHorizontalOrTilt{307};
-int constexpr HcExt_SparrowWindward{308};
-int constexpr HcExt_SparrowLeeward{309};
-int constexpr HcExt_MoWiTTWindward{310};
-int constexpr HcExt_MoWiTTLeeward{311};
-int constexpr HcExt_DOE2Windward{312};
-int constexpr HcExt_DOE2Leeward{313};
-int constexpr HcExt_NusseltJurges{314};
-int constexpr HcExt_McAdams{315};
-int constexpr HcExt_Mitchell{316};
-int constexpr HcExt_ClearRoof{317};
-int constexpr HcExt_BlockenWindward{318};
-int constexpr HcExt_EmmelVertical{319};
-int constexpr HcExt_EmmelRoof{320};
-int constexpr HcExt_AlamdariHammondVerticalWall{321};
-int constexpr HcExt_FohannoPolidoriVerticalWall{322};
-int constexpr HcExt_ISO15099Windows{323};
-int constexpr HcExt_AlamdariHammondStableHorizontal{324};
-int constexpr HcExt_AlamdariHammondUnstableHorizontal{325};
+constexpr std::array(HcExt::Num)> HcExtNames = {"Value",
+ "Schedule",
+ "SetByZone",
+ "SimpleCombined",
+ "TARP",
+ "TARPOoutside",
+ "MoWiTT",
+ "DOE-2",
+ "BLAST",
+ "AdaptiveConvectionAlgorithm",
+ "None",
+ "UserValue",
+ "UserSchedule",
+ "UserCurve",
+ "SimpleCombined",
+ "ASHRAEVerticalWall",
+ "WaltonUnstableHorizontalOrTilt",
+ "WaltonStableHorizontalOrTilt",
+ "TARPWindward",
+ "TARPLeeward",
+ "MoWiTTWindward",
+ "MoWiTTLeeward",
+ "DOE2Windward",
+ "DOE2Leeward",
+ "NussletJurges",
+ "McAdams",
+ "Mitchell",
+ "ClearRoof",
+ "BlockenWindward",
+ "EmmelVertical",
+ "EmmelRoof",
+ "AlamdariHammondVerticalWall",
+ "FohannoPolidoriVerticalWall",
+ "ISO15099Windows",
+ "AlamdariHammondStableHorizontal",
+ "AlamdariHammondUnstableHorizontal"};
+
+constexpr std::array(HcExt::Num)> HcExtNamesUC = {"VALUE",
+ "SCHEDULE",
+ "SETBYZONE",
+ "SIMPLECOMBINED",
+ "TARP",
+ "TARPOUTSIDE",
+ "MOWITT",
+ "DOE-2",
+ "BLAST",
+ "ADAPTIVECONVECTIONALGORITHM",
+ "NONE",
+ "USERVALUE",
+ "USERSCHEDULE",
+ "USERCURVE",
+ "SIMPLECOMBINED",
+ "ASHRAEVERTICALWALL",
+ "WALTONUNSTABLEHORIZONTALORTILT",
+ "WALTONSTABLEHORIZONTALORTILT",
+ "TARPWINDWARD",
+ "TARPLEEWARD",
+ "MOWITTWINDWARD",
+ "MOWITTLEEWARD",
+ "DOE2WINDWARD",
+ "DOE2LEEWARD",
+ "NUSSELTJURGES",
+ "MCADAMS",
+ "MITCHELL",
+ "CLEARROOF",
+ "BLOCKENWINDWARD",
+ "EMMELVERTICAL",
+ "EMMELROOF",
+ "ALAMDARIHAMMONDVERTICALWALL",
+ "FOHANNOPOLIDORIVERTICALWALL",
+ "ISO15099WINDOWS",
+ "ALAMDARIHAMMONDSTABLEHORIZONTAL",
+ "ALAMDARIHAMMONDUNSTABLEHORIZONTAL"};
+
+constexpr std::array(HcExt::Num)> HcExtReportVals = {
+ -999, // Value
+ -998, // Schedule
+ 0, // SetByZone
+ 1, // ASHRAESimple
+ 2, // ASHRAETARP
+ 5, // TarpHcOutside
+ 6, // MoWiTTHcOutside
+ 7, // DOE2HcOutside
+ 8, // BLASTHcOutside
+ 9, // AdaptiveConvectionAlgorithm
+ 300, // None
+ 301, // UserValue
+ 302, // UserSchedule
+ 303, // UserCurve
+ 304, // ASHRAESimpleCombined
+ 305, // NaturalASHRAEVerticalWall
+ 306, // NaturalWaltonUnstableHorizontalOrTilt
+ 307, // NaturalWaltonStableHorizontalOrTilt
+ 308, // SparrowWindward
+ 309, // SparrowLeeward
+ 310, // MoWiTTWindward
+ 311, // MoWiTTLeeward
+ 312, // DOE2Windward
+ 313, // DOE2Leeward
+ 314, // NusseltJurges
+ 315, // McAdams
+ 316, // Mitchell
+ 317, // ClearRoof
+ 318, // BlockenWindward
+ 319, // EmmelVertical
+ 320, // EmmelRoof
+ 321, // AlamdariHammondVerticalWall
+ 322, // FohannoPolidoriVerticalWall
+ 323, // ISO15099Windows
+ 324, // AlamdariHammondStableHorizontal
+ 325 // AlamdariHammondUnstableHorizontal
+};
// Parameters for classification of outside face of surfaces
-enum class OutConvClass
+enum class ExtConvClass
{
Invalid = -1,
WindwardVertWall,
@@ -154,12 +398,24 @@ enum class OutConvClass
Num
};
+enum class ExtConvClass2
+{
+ Invalid = -1,
+ WindConvection_WallWindward,
+ WindConvection_WallLeeward,
+ WindConvection_HorizRoof,
+ NaturalConvection_VertWall,
+ NaturalConvection_StableHoriz,
+ NaturalConvection_UnstableHoriz,
+ Num
+};
+
// Report Values for "Surface Outside Face Convection Classification Index"
// note that Invalid (-1) is also reported but not included here
// where used, that should be handled with a static_cast(OutConvClass::Invalid)
-constexpr static std::array(OutConvClass::Num)> OutConvClassReportVals = {101, 102, 103, 104};
+constexpr static std::array(ExtConvClass::Num)> ExtConvClassReportVals = {101, 102, 103, 104};
-enum class SurfConvOrientation
+enum class SurfOrientation
{
Invalid = -1,
HorizontalDown,
@@ -171,7 +427,7 @@ enum class SurfConvOrientation
};
// Parameters for fenestration relative location in zone
-enum class InConvWinLoc
+enum class IntConvWinLoc
{
Invalid = -1,
NotSet,
@@ -184,66 +440,112 @@ enum class InConvWinLoc
};
// Parameters for adaptive convection algorithm's classification of inside face of surfaces
-enum class InConvClass
+enum class IntConvClass
{
Invalid = -1,
- A1_VertWalls, // flow regime A1, vertical walls
- A1_StableHoriz, // flow regime A1
- A1_UnstableHoriz, // flow regime A1
- A1_HeatedFloor, // flow regime A1
- A1_ChilledCeil, // flow regime A1
- A1_StableTilted, // flow regime A1
- A1_UnstableTilted, // flow regime A1
- A1_Windows, // flow regime A1
- A2_VertWallsNonHeated, // flow regime A2
- A2_HeatedVerticalWall, // flow regime A2
- A2_StableHoriz, // flow regime A2
- A2_UnstableHoriz, // flow regime A2
- A2_StableTilted, // flow regime A2
- A2_UnstableTilted, // flow regime A2
- A2_Windows, // flow regime A2
- A3_VertWalls, // flow regime A3
- A3_StableHoriz, // flow regime A3
- A3_UnstableHoriz, // flow regime A3
- A3_StableTilted, // flow regime A3
- A3_UnstableTilted, // flow regime A3
- A3_Windows, // flow regime A3
- B_VertWalls, // flow regime B
- B_VertWallsNearHeat, // flow regime B
- B_StableHoriz, // flow regime B
- B_UnstableHoriz, // flow regime B
- B_StableTilted, // flow regime B
- B_UnstableTilted, // flow regime B
- B_Windows, // flow regime B
- C_Walls, // flow regime C
- C_Ceiling, // flow regime C
- C_Floor, // flow regime C
- C_Windows, // flow regime C
- D_Walls, // flow regime D
- D_StableHoriz, // flow regime D
- D_UnstableHoriz, // flow regime D
- D_StableTilted, // flow regime D
- D_UnstableTilted, // flow regime D
- D_Windows, // flow regime D
- E_AssistFlowWalls, // flow regime E
- E_OpposFlowWalls, // flow regime E
- E_StableFloor, // flow regime E
- E_UnstableFloor, // flow regime E
- E_StableCeiling, // flow regime E
- E_UnstableCeiling, // flow regime E
- E_Windows, // flow regime E
+ // SimpleBuoy goes first in the IDF objects, so has to go first here too, A3 or not.
+ A3_SimpleBuoy_VertWalls, // flow regime A3
+ A3_SimpleBuoy_StableHoriz, // flow regime A3
+ A3_SimpleBuoy_UnstableHoriz, // flow regime A3
+ A3_SimpleBuoy_StableTilted, // flow regime A3
+ A3_SimpleBuoy_UnstableTilted, // flow regime A3
+ A3_SimpleBuoy_Windows, // flow regime A3
+ A1_FloorHeatCeilCool_VertWalls, // flow regime A1, vertical walls
+ A1_FloorHeatCeilCool_StableHoriz, // flow regime A1
+ A1_FloorHeatCeilCool_UnstableHoriz, // flow regime A1
+ A1_FloorHeatCeilCool_HeatedFloor, // flow regime A1
+ A1_FloorHeatCeilCool_ChilledCeil, // flow regime A1
+ A1_FloorHeatCeilCool_StableTilted, // flow regime A1
+ A1_FloorHeatCeilCool_UnstableTilted, // flow regime A1
+ A1_FloorHeatCeilCool_Windows, // flow regime A1
+ A2_WallPanelHeat_VertWallsNonHeated, // flow regime A2
+ A2_WallPanelHeat_HeatedVerticalWall, // flow regime A2
+ A2_WallPanelHeat_StableHoriz, // flow regime A2
+ A2_WallPanelHeat_UnstableHoriz, // flow regime A2
+ A2_WallPanelHeat_StableTilted, // flow regime A2
+ A2_WallPanelHeat_UnstableTilted, // flow regime A2
+ A2_WallPanelHeat_Windows, // flow regime A2
+ B_ConvectiveHeat_VertWalls, // flow regime B
+ B_ConvectiveHeat_VertWallsNearHeat, // flow regime B
+ B_ConvectiveHeat_StableHoriz, // flow regime B
+ B_ConvectiveHeat_UnstableHoriz, // flow regime B
+ B_ConvectiveHeat_StableTilted, // flow regime B
+ B_ConvectiveHeat_UnstableTilted, // flow regime B
+ B_ConvectiveHeat_Windows, // flow regime B
+ C_CentralAirHeat_Walls, // flow regime C
+ C_CentralAirHeat_Ceiling, // flow regime C
+ C_CentralAirHeat_Floor, // flow regime C
+ C_CentralAirHeat_Windows, // flow regime C
+ D_ZoneFanCirc_Walls, // flow regime D
+ D_ZoneFanCirc_StableHoriz, // flow regime D
+ D_ZoneFanCirc_UnstableHoriz, // flow regime D
+ D_ZoneFanCirc_StableTilted, // flow regime D
+ D_ZoneFanCirc_UnstableTilted, // flow regime D
+ D_ZoneFanCirc_Windows, // flow regime D
+ E_MixedBuoy_AssistFlowWalls, // flow regime E
+ E_MixedBuoy_OpposFlowWalls, // flow regime E
+ E_MixedBuoy_StableFloor, // flow regime E
+ E_MixedBuoy_UnstableFloor, // flow regime E
+ E_MixedBuoy_StableCeiling, // flow regime E
+ E_MixedBuoy_UnstableCeiling, // flow regime E
+ E_MixedBuoy_Windows, // flow regime E
Num
};
// Report values for "Surface Inside Face Convection Classification Index"
// note that Invalid (-1) is also reported but not included here
// where used, that should be handled with a static_cast(InConvClass::Invalid)
-constexpr static std::array(InConvClass::Num)> InConvClassReportVals = {
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45};
+constexpr static std::array(IntConvClass::Num)> IntConvClassReportVals = {
+ // SimpleBuoy goes first in the IDF objects, so has to go first here too, A3 or not.
+ 16, // A3_SimpleBuoy_VertWalls
+ 17, // A3_SimpleBuoy_StableHoriz
+ 18, // A3_SimpleBuoy_UnstableHoriz
+ 19, // A3_SimpleBuoy_StableTilted
+ 20, // A3_SimpleBuoy_UnstableTilted
+ 21, // A3_SimpleBuoy_Windows
+ 1, // A1_FloorHeatCeilCool_VertWalls
+ 2, // A1_FloorHeatCeilCool_StableHoriz
+ 3, // A1_FloorHeatCeilCool_UnstableHoriz
+ 4, // A1_FloorHeatCeilCool_HeatedFloor
+ 5, // A1_FloorHeatCeilCool_ChilledCeil
+ 6, // A1_FloorHeatCeilCool_StableTilted
+ 7, // A1_FloorHeatCeilCool_UnstableTilted
+ 8, // A1_FloorHeatCeilCool_Windows
+ 9, // A2_WallPanelHeat_VertWallsNonHeated
+ 10, // A2_WallPanelHeat_HeatedVerticalWall
+ 11, // A2_WallPanelHeat_StableHoriz
+ 12, // A2_WallPanelHeat_UnstableHoriz
+ 13, // A2_WallPanelHeat_StableTilted
+ 14, // A2_WallPanelHeat_UnstableTilted
+ 15, // A2_WallPanelHeat_Windows
+ 22, // B_ConvectiveHeat_VertWalls
+ 23, // B_ConvectiveHeat_VertWallsNearHeat
+ 24, // B_ConvectiveHeat_StableHoriz
+ 25, // B_ConvectiveHeat_UnstableHoriz
+ 26, // B_ConvectiveHeat_StableTilted
+ 27, // B_ConvectiveHeat_UnstableTilted
+ 28, // B_ConvectiveHeat_Windows
+ 29, // C_CentralAirHeat_Walls
+ 30, // C_CentralAirHeat_Ceiling
+ 31, // C_CentralAirHeat_Floor
+ 32, // C_CentralAirHeat_Windows
+ 33, // D_ZoneFanCirc_Walls
+ 34, // D_ZoneFanCirc_StableHoriz
+ 35, // D_ZoneFanCirc_UnstableHoriz
+ 36, // D_ZoneFanCirc_StableTilted
+ 37, // D_ZoneFanCirc_UnstableTilted
+ 38, // D_ZoneFanCirc_Windows
+ 39, // E_MixedBuoy_AssistFlowWalls
+ 40, // E_MixedBuoy_OpposFlowWalls
+ 41, // E_MixedBuoy_StableFloor
+ 42, // E_MixedBuoy_UnstableFloor
+ 43, // E_MixedBuoy_StableCeiling
+ 44, // E_MixedBuoy_UnstableCeiling
+ 45 // E_MixedBuoy_Windows
+};
// Parameters to indicate user specified convection coefficients (for surface)
-enum class ConvCoefOverrideType
+enum class OverrideType
{
Invalid = -1,
Value, // User specified "value" as the override type
@@ -274,6 +576,6 @@ enum class RefWind
Num
};
-} // namespace EnergyPlus::ConvectionConstants
+} // namespace EnergyPlus::Convect
#endif
diff --git a/src/EnergyPlus/CoolTower.cc b/src/EnergyPlus/CoolTower.cc
index 107b7180fe8..3f80f4eb588 100644
--- a/src/EnergyPlus/CoolTower.cc
+++ b/src/EnergyPlus/CoolTower.cc
@@ -233,7 +233,7 @@ namespace CoolTower {
{
state.dataCoolTower->CoolTowerSys(CoolTowerNum).FlowCtrlType =
- static_cast(getEnumerationValue(FlowCtrlNamesUC, state.dataIPShortCut->cAlphaArgs(5))); // Type of flow control
+ static_cast(getEnumValue(FlowCtrlNamesUC, state.dataIPShortCut->cAlphaArgs(5))); // Type of flow control
if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).FlowCtrlType == FlowCtrl::Invalid) {
ShowSevereError(state,
format("{}=\"{}\" invalid {}=\"{}\".",
diff --git a/src/EnergyPlus/CostEstimateManager.cc b/src/EnergyPlus/CostEstimateManager.cc
index 1fbbcdd9aa9..17a6439640c 100644
--- a/src/EnergyPlus/CostEstimateManager.cc
+++ b/src/EnergyPlus/CostEstimateManager.cc
@@ -182,7 +182,7 @@ namespace CostEstimateManager {
IOStatus);
state.dataCostEstimateManager->CostLineItem(Item).LineName = state.dataIPShortCut->cAlphaArgs(1);
state.dataCostEstimateManager->CostLineItem(Item).ParentObjType =
- static_cast(getEnumerationValue(ParentObjectNamesUC, state.dataIPShortCut->cAlphaArgs(3)));
+ static_cast(getEnumValue(ParentObjectNamesUC, state.dataIPShortCut->cAlphaArgs(3)));
state.dataCostEstimateManager->CostLineItem(Item).ParentObjName = state.dataIPShortCut->cAlphaArgs(4);
state.dataCostEstimateManager->CostLineItem(Item).PerEach = state.dataIPShortCut->rNumericArgs(1);
state.dataCostEstimateManager->CostLineItem(Item).PerSquareMeter = state.dataIPShortCut->rNumericArgs(2);
@@ -884,7 +884,7 @@ namespace CostEstimateManager {
case ParentObject::DaylightingControls: {
if (state.dataCostEstimateManager->CostLineItem(Item).ParentObjName == "*") { // wildcard, apply to all such components
state.dataCostEstimateManager->CostLineItem(Item).Qty =
- sum(state.dataDaylightingData->ZoneDaylight, &DataDaylighting::ZoneDaylightCalc::totRefPts);
+ sum(state.dataDaylightingData->ZoneDaylight, &Dayltg::ZoneDaylightCalc::totRefPts);
} else if (!state.dataCostEstimateManager->CostLineItem(Item).ParentObjName.empty()) {
ThisZoneID = UtilityRoutines::FindItem(state.dataCostEstimateManager->CostLineItem(Item).ParentObjName, Zone);
if (ThisZoneID > 0) {
diff --git a/src/EnergyPlus/CrossVentMgr.cc b/src/EnergyPlus/CrossVentMgr.cc
index 6aa93df0734..7843cc084d2 100644
--- a/src/EnergyPlus/CrossVentMgr.cc
+++ b/src/EnergyPlus/CrossVentMgr.cc
@@ -64,7 +64,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -73,7 +72,7 @@
namespace EnergyPlus {
-namespace CrossVentMgr {
+namespace RoomAir {
// MODULE INFORMATION:
// AUTHOR G. Carrilho da Graca
@@ -86,8 +85,7 @@ namespace CrossVentMgr {
using namespace DataHeatBalance;
using namespace DataHeatBalSurface;
using namespace DataSurfaces;
- using namespace DataRoomAirModel;
- using ConvectionCoefficients::CalcDetailedHcInForDVModel;
+ using Convect::CalcDetailedHcInForDVModel;
Real64 constexpr Cjet1(1.873); // First correlation constant for the jet velocity
Real64 constexpr Cjet2(0.243); // Second correlation constant for the jet velocity
@@ -98,8 +96,8 @@ namespace CrossVentMgr {
Real64 constexpr CrecFlow1(0.415); // First correlation constant for the recirculation flow rate
Real64 constexpr CrecFlow2(0.466); // Second correlation constant for the recirculation flow rate
- void ManageUCSDCVModel(EnergyPlusData &state,
- int const ZoneNum) // index number for the specified zone
+ void ManageCrossVent(EnergyPlusData &state,
+ int const ZoneNum) // index number for the specified zone
{
// SUBROUTINE INFORMATION:
@@ -109,13 +107,13 @@ namespace CrossVentMgr {
// PURPOSE OF THIS SUBROUTINE:
// manage the UCSD Cross Ventilation model
- InitUCSDCV(state, ZoneNum);
+ InitCrossVent(state, ZoneNum);
// perform Cross Ventilation model calculations
- CalcUCSDCV(state, ZoneNum);
+ CalcCrossVent(state, ZoneNum);
}
- void InitUCSDCV(EnergyPlusData &state, int const ZoneNum)
+ void InitCrossVent(EnergyPlusData &state, int const ZoneNum)
{
// SUBROUTINE INFORMATION:
@@ -144,7 +142,7 @@ namespace CrossVentMgr {
}
}
- void HcUCSDCV(EnergyPlusData &state, int const ZoneNum)
+ void HcCrossVent(EnergyPlusData &state, int const ZoneNum)
{
// SUBROUTINE INFORMATION:
@@ -166,181 +164,164 @@ namespace CrossVentMgr {
state.dataCrossVentMgr->HA_R = 0.0;
// Is the air flow model for this zone set to UCSDCV Cross Ventilation?
- if (state.dataRoomAirMod->IsZoneCV(ZoneNum)) {
+ if (state.dataRoomAir->IsZoneCrossVent(ZoneNum)) {
+
+ Real64 zoneJetRecAreaRatio = state.dataRoomAir->JetRecAreaRatio(ZoneNum);
+
// WALL Hc, HA and HAT calculation
- for (int Ctd = state.dataUCSDShared->PosZ_Wall((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Wall((ZoneNum - 1) * 2 + 2);
- ++Ctd) {
- int SurfNum = state.dataUCSDShared->APos_Wall(Ctd);
+ for (int Ctd = state.dataRoomAir->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Wall(ZoneNum).end; ++Ctd) {
+ int SurfNum = state.dataRoomAir->APos_Wall(Ctd);
+ if (SurfNum == 0) continue;
+
+ auto const &surf = state.dataSurface->Surface(SurfNum);
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp;
state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)];
- if (SurfNum == 0) continue;
- state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum);
+ state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum);
CalcDetailedHcInForDVModel(
- 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->SurfTempIn(SurfNum) * state.dataUCSDShared->HWall(Ctd);
- state.dataCrossVentMgr->HA_R += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWall(Ctd);
+ state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec);
+ state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->CrossVentHcIn(SurfNum);
+ state.dataCrossVentMgr->HAT_R += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd);
+ state.dataCrossVentMgr->HA_R += surf.Area * state.dataRoomAir->HWall(Ctd);
} // END WALL
// WINDOW Hc, HA and HAT CALCULATION
- for (int Ctd = state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 2);
- ++Ctd) {
- int SurfNum = state.dataUCSDShared->APos_Window(Ctd);
+ for (int Ctd = state.dataRoomAir->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Window(ZoneNum).end; ++Ctd) {
+ int SurfNum = state.dataRoomAir->APos_Window(Ctd);
+ if (SurfNum == 0) continue;
+
+ auto const &surf = state.dataSurface->Surface(SurfNum);
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp;
state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)];
- if (SurfNum == 0) continue;
- 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);
+ if (surf.Tilt > 10.0 && surf.Tilt < 170.0) { // Window Wall
+ state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum);
CalcDetailedHcInForDVModel(
- 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->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd);
- state.dataCrossVentMgr->HA_R += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd);
+ state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec);
+ state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->CrossVentHcIn(SurfNum);
+ state.dataCrossVentMgr->HAT_R += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd);
+ state.dataCrossVentMgr->HA_R += surf.Area * state.dataRoomAir->HWindow(Ctd);
}
- if (state.dataSurface->Surface(SurfNum).Tilt <= 10.0) { // Window Ceiling
- state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum);
+ if (surf.Tilt <= 10.0) { // Window Ceiling
+ state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTJET(ZoneNum);
CalcDetailedHcInForDVModel(
- state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Ujet);
- Real64 Hjet = state.dataRoomAirMod->CVHcIn(SurfNum);
- state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum);
+ state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Ujet);
+ Real64 Hjet = state.dataRoomAir->CrossVentHcIn(SurfNum);
+ state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum);
CalcDetailedHcInForDVModel(
- state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec);
- Real64 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->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->SurfTempIn(SurfNum) * Hjet;
- state.dataCrossVentMgr->HA_J += state.dataSurface->Surface(SurfNum).Area * state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * Hjet;
+ state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec);
+ Real64 Hrec = state.dataRoomAir->CrossVentHcIn(SurfNum);
+ state.dataRoomAir->HWindow(Ctd) = zoneJetRecAreaRatio * Hjet + (1 - zoneJetRecAreaRatio) * Hrec;
+ state.dataCrossVentMgr->HAT_R += surf.Area * (1.0 - zoneJetRecAreaRatio) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hrec;
+ state.dataCrossVentMgr->HA_R += surf.Area * (1.0 - zoneJetRecAreaRatio) * Hrec;
+ state.dataCrossVentMgr->HAT_J += surf.Area * zoneJetRecAreaRatio * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hjet;
+ state.dataCrossVentMgr->HA_J += surf.Area * zoneJetRecAreaRatio * Hjet;
state.dataHeatBal->SurfTempEffBulkAir(SurfNum) =
- state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * state.dataRoomAirMod->ZTJET(ZoneNum) +
- (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * state.dataRoomAirMod->ZTREC(ZoneNum);
+ zoneJetRecAreaRatio * state.dataRoomAir->ZTJET(ZoneNum) + (1 - zoneJetRecAreaRatio) * state.dataRoomAir->ZTREC(ZoneNum);
}
- if (state.dataSurface->Surface(SurfNum).Tilt >= 170.0) { // Window Floor
- state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum);
+ if (surf.Tilt >= 170.0) { // Window Floor
+ state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTJET(ZoneNum);
CalcDetailedHcInForDVModel(
- state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Ujet);
- Real64 Hjet = state.dataRoomAirMod->CVHcIn(SurfNum);
- state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum);
+ state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Ujet);
+ Real64 Hjet = state.dataRoomAir->CrossVentHcIn(SurfNum);
+ state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum);
CalcDetailedHcInForDVModel(
- state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec);
- Real64 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->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->SurfTempIn(SurfNum) * Hjet;
- state.dataCrossVentMgr->HA_J += state.dataSurface->Surface(SurfNum).Area * state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * Hjet;
+ state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec);
+ Real64 Hrec = state.dataRoomAir->CrossVentHcIn(SurfNum);
+ state.dataRoomAir->HWindow(Ctd) = zoneJetRecAreaRatio * Hjet + (1 - zoneJetRecAreaRatio) * Hrec;
+ state.dataCrossVentMgr->HAT_R += surf.Area * (1.0 - zoneJetRecAreaRatio) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hrec;
+ state.dataCrossVentMgr->HA_R += surf.Area * (1.0 - zoneJetRecAreaRatio) * Hrec;
+ state.dataCrossVentMgr->HAT_J += surf.Area * zoneJetRecAreaRatio * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hjet;
+ state.dataCrossVentMgr->HA_J += surf.Area * zoneJetRecAreaRatio * Hjet;
state.dataHeatBal->SurfTempEffBulkAir(SurfNum) =
- state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * state.dataRoomAirMod->ZTJET(ZoneNum) +
- (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * state.dataRoomAirMod->ZTREC(ZoneNum);
+ zoneJetRecAreaRatio * state.dataRoomAir->ZTJET(ZoneNum) + (1 - zoneJetRecAreaRatio) * state.dataRoomAir->ZTREC(ZoneNum);
}
- state.dataRoomAirMod->CVHcIn(SurfNum) = state.dataUCSDShared->HWindow(Ctd);
+ state.dataRoomAir->CrossVentHcIn(SurfNum) = state.dataRoomAir->HWindow(Ctd);
} // END WINDOW
// DOOR Hc, HA and HAT CALCULATION
- for (int Ctd = state.dataUCSDShared->PosZ_Door((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Door((ZoneNum - 1) * 2 + 2);
- ++Ctd) { // DOOR
- int SurfNum = state.dataUCSDShared->APos_Door(Ctd);
+ for (int Ctd = state.dataRoomAir->PosZ_Door(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Door(ZoneNum).end; ++Ctd) { // DOOR
+ int SurfNum = state.dataRoomAir->APos_Door(Ctd);
+ if (SurfNum == 0) continue;
+
+ auto const &surf = state.dataSurface->Surface(SurfNum);
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp;
state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)];
- if (SurfNum == 0) continue;
- state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum);
+ state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum);
CalcDetailedHcInForDVModel(
- 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->SurfTempIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd);
- state.dataCrossVentMgr->HA_R += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HDoor(Ctd);
+ state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec);
+ state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->CrossVentHcIn(SurfNum);
+ state.dataCrossVentMgr->HAT_R += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd);
+ state.dataCrossVentMgr->HA_R += surf.Area * state.dataRoomAir->HDoor(Ctd);
} // END DOOR
+
// INTERNAL Hc, HA and HAT CALCULATION
- for (int Ctd = state.dataUCSDShared->PosZ_Internal((ZoneNum - 1) * 2 + 1);
- Ctd <= state.dataUCSDShared->PosZ_Internal((ZoneNum - 1) * 2 + 2);
- ++Ctd) {
- int SurfNum = state.dataUCSDShared->APos_Internal(Ctd);
+ for (int Ctd = state.dataRoomAir->PosZ_Internal(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Internal(ZoneNum).end; ++Ctd) {
+ int SurfNum = state.dataRoomAir->APos_Internal(Ctd);
+ if (SurfNum == 0) continue;
+
+ auto const &surf = state.dataSurface->Surface(SurfNum);
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp;
state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)];
- if (SurfNum == 0) continue;
- state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum);
+ state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum);
CalcDetailedHcInForDVModel(
- 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->SurfTempIn(SurfNum) * state.dataUCSDShared->HInternal(Ctd);
- state.dataCrossVentMgr->HA_R += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HInternal(Ctd);
+ state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec);
+ state.dataRoomAir->HInternal(Ctd) = state.dataRoomAir->CrossVentHcIn(SurfNum);
+ state.dataCrossVentMgr->HAT_R += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HInternal(Ctd);
+ state.dataCrossVentMgr->HA_R += surf.Area * state.dataRoomAir->HInternal(Ctd);
} // END INTERNAL
// CEILING Hc, HA and HAT CALCULATION
- for (int Ctd = state.dataUCSDShared->PosZ_Ceiling((ZoneNum - 1) * 2 + 1);
- Ctd <= state.dataUCSDShared->PosZ_Ceiling((ZoneNum - 1) * 2 + 2);
- ++Ctd) {
- int SurfNum = state.dataUCSDShared->APos_Ceiling(Ctd);
+ for (int Ctd = state.dataRoomAir->PosZ_Ceiling(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Ceiling(ZoneNum).end; ++Ctd) {
+ int SurfNum = state.dataRoomAir->APos_Ceiling(Ctd);
+ if (SurfNum == 0) continue;
+
+ auto const &surf = state.dataSurface->Surface(SurfNum);
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp;
state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)];
- if (SurfNum == 0) continue;
- state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum);
+ state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTJET(ZoneNum);
CalcDetailedHcInForDVModel(
- state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Ujet);
- Real64 Hjet = state.dataRoomAirMod->CVHcIn(SurfNum);
- state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum);
+ state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Ujet);
+ Real64 Hjet = state.dataRoomAir->CrossVentHcIn(SurfNum);
+ state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum);
CalcDetailedHcInForDVModel(
- state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec);
- Real64 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->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->SurfTempIn(SurfNum) * Hjet;
- state.dataCrossVentMgr->HA_J += state.dataSurface->Surface(SurfNum).Area * state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * Hjet;
+ state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec);
+ Real64 Hrec = state.dataRoomAir->CrossVentHcIn(SurfNum);
+
+ state.dataRoomAir->HCeiling(Ctd) = zoneJetRecAreaRatio * Hjet + (1 - zoneJetRecAreaRatio) * Hrec;
+ state.dataCrossVentMgr->HAT_R += surf.Area * (1 - zoneJetRecAreaRatio) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hrec;
+ state.dataCrossVentMgr->HA_R += surf.Area * (1 - zoneJetRecAreaRatio) * Hrec;
+ state.dataCrossVentMgr->HAT_J += surf.Area * zoneJetRecAreaRatio * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hjet;
+ state.dataCrossVentMgr->HA_J += surf.Area * zoneJetRecAreaRatio * Hjet;
state.dataHeatBal->SurfTempEffBulkAir(SurfNum) =
- state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * state.dataRoomAirMod->ZTJET(ZoneNum) +
- (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * state.dataRoomAirMod->ZTREC(ZoneNum);
- state.dataRoomAirMod->CVHcIn(SurfNum) = state.dataUCSDShared->HCeiling(Ctd);
+ zoneJetRecAreaRatio * state.dataRoomAir->ZTJET(ZoneNum) + (1 - zoneJetRecAreaRatio) * state.dataRoomAir->ZTREC(ZoneNum);
+ state.dataRoomAir->CrossVentHcIn(SurfNum) = state.dataRoomAir->HCeiling(Ctd);
} // END CEILING
// FLOOR Hc, HA and HAT CALCULATION
- for (int Ctd = state.dataUCSDShared->PosZ_Floor((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Floor((ZoneNum - 1) * 2 + 2);
- ++Ctd) {
- int SurfNum = state.dataUCSDShared->APos_Floor(Ctd);
+ for (int Ctd = state.dataRoomAir->PosZ_Floor(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Floor(ZoneNum).end; ++Ctd) {
+ int SurfNum = state.dataRoomAir->APos_Floor(Ctd);
+ if (SurfNum == 0) continue;
+
+ auto const &surf = state.dataSurface->Surface(SurfNum);
state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp;
state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)];
- if (SurfNum == 0) continue;
- state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum);
+ state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTJET(ZoneNum);
CalcDetailedHcInForDVModel(
- state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Ujet);
- Real64 Hjet = state.dataRoomAirMod->CVHcIn(SurfNum);
- state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum);
+ state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Ujet);
+ Real64 Hjet = state.dataRoomAir->CrossVentHcIn(SurfNum);
+ state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum);
CalcDetailedHcInForDVModel(
- state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec);
- Real64 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->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->SurfTempIn(SurfNum) * Hjet;
- state.dataCrossVentMgr->HA_J += state.dataSurface->Surface(SurfNum).Area * state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * Hjet;
+ state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec);
+ Real64 Hrec = state.dataRoomAir->CrossVentHcIn(SurfNum);
+ state.dataRoomAir->HFloor(Ctd) = zoneJetRecAreaRatio * Hjet + (1 - zoneJetRecAreaRatio) * Hrec;
+ state.dataCrossVentMgr->HAT_R += surf.Area * (1 - zoneJetRecAreaRatio) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hrec;
+ state.dataCrossVentMgr->HA_R += surf.Area * (1 - zoneJetRecAreaRatio) * Hrec;
+ state.dataCrossVentMgr->HAT_J += surf.Area * zoneJetRecAreaRatio * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hjet;
+ state.dataCrossVentMgr->HA_J += surf.Area * zoneJetRecAreaRatio * Hjet;
state.dataHeatBal->SurfTempEffBulkAir(SurfNum) =
- state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * state.dataRoomAirMod->ZTJET(ZoneNum) +
- (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * state.dataRoomAirMod->ZTREC(ZoneNum);
- state.dataRoomAirMod->CVHcIn(SurfNum) = state.dataUCSDShared->HFloor(Ctd);
+ zoneJetRecAreaRatio * state.dataRoomAir->ZTJET(ZoneNum) + (1 - zoneJetRecAreaRatio) * state.dataRoomAir->ZTREC(ZoneNum);
+ state.dataRoomAir->CrossVentHcIn(SurfNum) = state.dataRoomAir->HFloor(Ctd);
} // END FLOOR
}
}
- void EvolveParaUCSDCV(EnergyPlusData &state, int const ZoneNum)
+ void EvolveParaCrossVent(EnergyPlusData &state, int const ZoneNum)
{
// SUBROUTINE INFORMATION:
@@ -361,49 +342,46 @@ namespace CrossVentMgr {
Real64 SumToZone(0.0); // Sum of velocities through
Real64 MaxFlux(0.0);
int MaxSurf(0);
- Real64 XX;
- Real64 YY;
- Real64 ZZ;
- Real64 XX_Wall;
- Real64 YY_Wall;
- Real64 ZZ_Wall;
Real64 ActiveSurfNum;
int NSides; // Number of sides in surface
Real64 Wroom; // Room width
Real64 Aroom; // Room area cross section
- assert(state.dataRoomAirMod->AirModel.allocated());
- state.dataRoomAirMod->RecInflowRatio(ZoneNum) = 0.0;
+ assert(state.dataRoomAir->AirModel.allocated());
+ state.dataRoomAir->RecInflowRatio(ZoneNum) = 0.0;
auto const &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum);
// Identify the dominant aperture:
- MaxSurf = state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(1, ZoneNum);
+ MaxSurf = state.dataRoomAir->AFNSurfaceCrossVent(1, ZoneNum);
int const surfNum = state.afn->MultizoneSurfaceData(MaxSurf).SurfNum;
auto const &thisSurface = state.dataSurface->Surface(surfNum);
+
+ int afnSurfNum1 = state.dataRoomAir->AFNSurfaceCrossVent(1, ZoneNum);
+
if (thisSurface.Zone == ZoneNum) {
// this is a direct airflow network aperture
- SumToZone = state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(1, ZoneNum)).VolFLOW2;
- MaxFlux = state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(1, ZoneNum)).VolFLOW2;
+ SumToZone = state.afn->AirflowNetworkLinkSimu(afnSurfNum1).VolFLOW2;
+ MaxFlux = state.afn->AirflowNetworkLinkSimu(afnSurfNum1).VolFLOW2;
} else {
// this is an indirect airflow network aperture
- SumToZone = state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(1, ZoneNum)).VolFLOW;
- MaxFlux = state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(1, ZoneNum)).VolFLOW;
+ SumToZone = state.afn->AirflowNetworkLinkSimu(afnSurfNum1).VolFLOW;
+ MaxFlux = state.afn->AirflowNetworkLinkSimu(afnSurfNum1).VolFLOW;
}
- for (int Ctd2 = 2; Ctd2 <= state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, ZoneNum); ++Ctd2) {
- if (state.dataSurface->Surface(state.afn->MultizoneSurfaceData(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd2, ZoneNum)).SurfNum)
- .Zone == ZoneNum) {
- if (state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd2, ZoneNum)).VolFLOW2 > MaxFlux) {
- MaxFlux = state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd2, ZoneNum)).VolFLOW2;
- MaxSurf = state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd2, ZoneNum);
+ for (int Ctd2 = 2; Ctd2 <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd2) {
+ int afnSurfNum = state.dataRoomAir->AFNSurfaceCrossVent(Ctd2, ZoneNum);
+ if (state.dataSurface->Surface(state.afn->MultizoneSurfaceData(afnSurfNum).SurfNum).Zone == ZoneNum) {
+ if (state.afn->AirflowNetworkLinkSimu(afnSurfNum).VolFLOW2 > MaxFlux) {
+ MaxFlux = state.afn->AirflowNetworkLinkSimu(afnSurfNum).VolFLOW2;
+ MaxSurf = afnSurfNum;
}
- SumToZone += state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd2, ZoneNum)).VolFLOW2;
+ SumToZone += state.afn->AirflowNetworkLinkSimu(afnSurfNum).VolFLOW2;
} else {
- if (state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd2, ZoneNum)).VolFLOW > MaxFlux) {
- MaxFlux = state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd2, ZoneNum)).VolFLOW;
- MaxSurf = state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd2, ZoneNum);
+ if (state.afn->AirflowNetworkLinkSimu(afnSurfNum).VolFLOW > MaxFlux) {
+ MaxFlux = state.afn->AirflowNetworkLinkSimu(afnSurfNum).VolFLOW;
+ MaxSurf = afnSurfNum;
}
- SumToZone += state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd2, ZoneNum)).VolFLOW;
+ SumToZone += state.afn->AirflowNetworkLinkSimu(afnSurfNum).VolFLOW;
}
}
@@ -411,45 +389,44 @@ namespace CrossVentMgr {
SurfNorm = thisSurface.Azimuth;
CosPhi = std::cos((state.dataEnvrn->WindDir - SurfNorm) * Constant::DegToRadians);
if (CosPhi <= 0) {
- state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false;
- auto flows(state.dataRoomAirMod->CVJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK)
+ state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false;
+ auto flows(state.dataRoomAir->CrossVentJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK)
for (int i = 1, u = flows.u(); i <= u; ++i) {
auto &e(flows(i));
e.Ujet = e.Urec = 0.0;
}
- state.dataRoomAirMod->Urec(ZoneNum) = 0.0;
- state.dataRoomAirMod->Ujet(ZoneNum) = 0.0;
- state.dataRoomAirMod->Qrec(ZoneNum) = 0.0;
+ state.dataRoomAir->Urec(ZoneNum) = 0.0;
+ state.dataRoomAir->Ujet(ZoneNum) = 0.0;
+ state.dataRoomAir->Qrec(ZoneNum) = 0.0;
if (thisSurface.ExtBoundCond > 0) {
- state.dataRoomAirMod->Tin(ZoneNum) =
+ state.dataRoomAir->Tin(ZoneNum) =
state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).MAT;
} else if (thisSurface.ExtBoundCond == ExternalEnvironment) {
- state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
+ state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
} else if (thisSurface.ExtBoundCond == Ground) {
- state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
+ state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
} else if (thisSurface.ExtBoundCond == OtherSideCoefNoCalcExt || thisSurface.ExtBoundCond == OtherSideCoefCalcExt) {
auto &thisOSC = state.dataSurface->OSC(thisSurface.OSCPtr);
thisOSC.OSCTempCalc =
(thisOSC.ZoneAirTempCoef * thisZoneHB.MAT + thisOSC.ExtDryBulbCoef * state.dataSurface->SurfOutDryBulbTemp(surfNum) +
thisOSC.ConstTempCoef * thisOSC.ConstTemp + thisOSC.GroundTempCoef * state.dataEnvrn->GroundTemp +
thisOSC.WindSpeedCoef * state.dataSurface->SurfOutWindSpeed(surfNum) * state.dataSurface->SurfOutDryBulbTemp(surfNum));
- state.dataRoomAirMod->Tin(ZoneNum) = thisOSC.OSCTempCalc;
+ state.dataRoomAir->Tin(ZoneNum) = thisOSC.OSCTempCalc;
} else {
- state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
+ state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
}
return;
}
// Calculate the opening area for all apertures
- for (int Ctd = 1; Ctd <= state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, ZoneNum); ++Ctd) {
+ for (int Ctd = 1; Ctd <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) {
+ auto &jetRecFlows = state.dataRoomAir->CrossVentJetRecFlows(Ctd, ZoneNum);
+ auto const &surfParams = state.dataRoomAir->SurfParametersCrossDispVent(Ctd);
int cCompNum = state.afn->AirflowNetworkLinkageData(Ctd).CompNum;
if (state.afn->AirflowNetworkCompData(cCompNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::DOP) {
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area = state.dataRoomAirMod->SurfParametersCVDV(Ctd).Width *
- state.dataRoomAirMod->SurfParametersCVDV(Ctd).Height *
- state.afn->MultizoneSurfaceData(Ctd).OpenFactor;
+ jetRecFlows.Area = surfParams.Width * surfParams.Height * state.afn->MultizoneSurfaceData(Ctd).OpenFactor;
} else if (state.afn->AirflowNetworkCompData(cCompNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::SCR) {
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area =
- state.dataRoomAirMod->SurfParametersCVDV(Ctd).Width * state.dataRoomAirMod->SurfParametersCVDV(Ctd).Height;
+ jetRecFlows.Area = surfParams.Width * surfParams.Height;
} else {
ShowSevereError(
state, "RoomAirModelCrossVent:EvolveParaUCSDCV: Illegal leakage component referenced in the cross ventilation room air model");
@@ -468,77 +445,66 @@ namespace CrossVentMgr {
// Droom the distance between the average point of the base surface of the airflow network Surface (if the base surface
// is a Window or Door it looks for the second base surface).
// Dstar is Droom corrected for wind angle
+
+ Vector3 baseCentroid;
+
Wroom = state.dataHeatBal->Zone(ZoneNum).Volume / state.dataHeatBal->Zone(ZoneNum).FloorArea;
- auto const &baseSurface(state.dataSurface->Surface(thisSurface.BaseSurf));
+ auto const &baseSurface = state.dataSurface->Surface(thisSurface.BaseSurf);
if ((baseSurface.Sides == 3) || (baseSurface.Sides == 4)) {
- XX = baseSurface.Centroid.x;
- YY = baseSurface.Centroid.y;
- ZZ = baseSurface.Centroid.z;
+ baseCentroid = baseSurface.Centroid;
} else {
// If the surface has more than 4 vertex then average the vertex coordinates in X, Y and Z.
NSides = baseSurface.Sides;
assert(NSides > 0);
- XX = YY = ZZ = 0.0;
+ baseCentroid = {0.0, 0.0, 0.0};
for (int i = 1; i <= NSides; ++i) {
- auto const &v(baseSurface.Vertex(i));
- XX += v.x;
- YY += v.y;
- ZZ += v.z;
+ baseCentroid += baseSurface.Vertex(i);
}
- XX /= double(NSides);
- YY /= double(NSides);
- ZZ /= double(NSides);
+ baseCentroid /= double(NSides);
}
+ Vector3 wallCentroid;
Real64 const Wroom_2(pow_2(Wroom));
- for (int Ctd = state.dataUCSDShared->PosZ_Wall(2 * ZoneNum - 1); Ctd <= state.dataUCSDShared->PosZ_Wall(2 * ZoneNum); ++Ctd) {
- if ((state.dataSurface->Surface(state.dataUCSDShared->APos_Wall(Ctd)).Sides == 3) ||
- (state.dataSurface->Surface(state.dataUCSDShared->APos_Wall(Ctd)).Sides == 4)) {
- XX_Wall = state.dataSurface->Surface(state.dataUCSDShared->APos_Wall(Ctd)).Centroid.x;
- YY_Wall = state.dataSurface->Surface(state.dataUCSDShared->APos_Wall(Ctd)).Centroid.y;
- ZZ_Wall = state.dataSurface->Surface(state.dataUCSDShared->APos_Wall(Ctd)).Centroid.z;
+ for (int Ctd = state.dataRoomAir->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Wall(ZoneNum).end; ++Ctd) {
+ if ((state.dataSurface->Surface(state.dataRoomAir->APos_Wall(Ctd)).Sides == 3) ||
+ (state.dataSurface->Surface(state.dataRoomAir->APos_Wall(Ctd)).Sides == 4)) {
+ wallCentroid = state.dataSurface->Surface(state.dataRoomAir->APos_Wall(Ctd)).Centroid;
} else {
- NSides = state.dataSurface->Surface(state.dataUCSDShared->APos_Wall(Ctd)).Sides;
+ NSides = state.dataSurface->Surface(state.dataRoomAir->APos_Wall(Ctd)).Sides;
assert(NSides > 0);
- XX_Wall = YY_Wall = ZZ_Wall = 0.0;
+ wallCentroid = {0.0, 0.0, 0.0};
for (int i = 1; i <= NSides; ++i) {
- auto const &v(state.dataSurface->Surface(state.dataUCSDShared->APos_Wall(Ctd)).Vertex(i));
- XX_Wall += v.x;
- YY_Wall += v.y;
- ZZ_Wall += v.z;
+ wallCentroid += state.dataSurface->Surface(state.dataRoomAir->APos_Wall(Ctd)).Vertex(i);
}
- XX_Wall /= double(NSides);
- YY_Wall /= double(NSides);
- ZZ_Wall /= double(NSides);
+ wallCentroid /= double(NSides);
}
- double DroomTemp = std::sqrt(pow_2(XX - XX_Wall) + pow_2(YY - YY_Wall) + pow_2(ZZ - ZZ_Wall));
- if (DroomTemp > state.dataRoomAirMod->Droom(ZoneNum)) {
- state.dataRoomAirMod->Droom(ZoneNum) = DroomTemp;
+ double DroomTemp =
+ std::sqrt(pow_2(baseCentroid.x - wallCentroid.x) + pow_2(baseCentroid.y - wallCentroid.y) + pow_2(baseCentroid.z - wallCentroid.z));
+ if (DroomTemp > state.dataRoomAir->Droom(ZoneNum)) {
+ state.dataRoomAir->Droom(ZoneNum) = DroomTemp;
}
- state.dataRoomAirMod->Dstar(ZoneNum) =
- min(state.dataRoomAirMod->Droom(ZoneNum) / CosPhi, std::sqrt(Wroom_2 + pow_2(state.dataRoomAirMod->Droom(ZoneNum))));
+ state.dataRoomAir->Dstar(ZoneNum) =
+ min(state.dataRoomAir->Droom(ZoneNum) / CosPhi, std::sqrt(Wroom_2 + pow_2(state.dataRoomAir->Droom(ZoneNum))));
}
// Room area
- Aroom = state.dataHeatBal->Zone(ZoneNum).Volume / state.dataRoomAirMod->Droom(ZoneNum);
+ Aroom = state.dataHeatBal->Zone(ZoneNum).Volume / state.dataRoomAir->Droom(ZoneNum);
// Populate an array of inflow volume fluxes (Fin) for all apertures in the zone
// Calculate inflow velocity (%Uin) for each aperture in the zone
- for (int Ctd = 1; Ctd <= state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, ZoneNum); ++Ctd) {
+ for (int Ctd = 1; Ctd <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) {
+ auto &jetRecFlows = state.dataRoomAir->CrossVentJetRecFlows(Ctd, ZoneNum);
if (state.dataSurface->Surface(state.afn->MultizoneSurfaceData(Ctd).SurfNum).Zone == ZoneNum) {
// this is a direct airflow network aperture
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Fin =
- state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd, ZoneNum)).VolFLOW2;
+ jetRecFlows.Fin = state.afn->AirflowNetworkLinkSimu(state.dataRoomAir->AFNSurfaceCrossVent(Ctd, ZoneNum)).VolFLOW2;
} else {
// this is an indirect airflow network aperture
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Fin =
- state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd, ZoneNum)).VolFLOW;
+ jetRecFlows.Fin = state.afn->AirflowNetworkLinkSimu(state.dataRoomAir->AFNSurfaceCrossVent(Ctd, ZoneNum)).VolFLOW;
}
- if (state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area != 0) {
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin =
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Fin / state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area;
+ if (jetRecFlows.Area != 0) {
+ jetRecFlows.Uin = jetRecFlows.Fin / jetRecFlows.Area;
} else {
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin = 0.0;
+ jetRecFlows.Uin = 0.0;
}
}
@@ -546,42 +512,39 @@ namespace CrossVentMgr {
// Create a flow flag for each aperture
// Calculate the total area of all active apertures
ActiveSurfNum = 0.0;
- state.dataRoomAirMod->Ain(ZoneNum) = 0.0;
- for (int Ctd = 1; Ctd <= state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, ZoneNum); ++Ctd) {
- if (state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin <= MinUin) {
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).FlowFlag = 0;
- } else {
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).FlowFlag = 1;
- }
- ActiveSurfNum += state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).FlowFlag;
- state.dataRoomAirMod->Ain(ZoneNum) +=
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area * state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).FlowFlag;
+ state.dataRoomAir->Ain(ZoneNum) = 0.0;
+ for (int Ctd = 1; Ctd <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) {
+ auto &jetRecFlows = state.dataRoomAir->CrossVentJetRecFlows(Ctd, ZoneNum);
+ jetRecFlows.FlowFlag = (int)(jetRecFlows.Uin > MinUin);
+
+ ActiveSurfNum += jetRecFlows.FlowFlag;
+ state.dataRoomAir->Ain(ZoneNum) += jetRecFlows.Area * jetRecFlows.FlowFlag;
}
// Verify if any of the apertures have minimum flow
if (ActiveSurfNum == 0) {
- state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false;
+ state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false;
if (thisSurface.ExtBoundCond > 0) {
- state.dataRoomAirMod->Tin(ZoneNum) =
+ state.dataRoomAir->Tin(ZoneNum) =
state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).MAT;
} else if (thisSurface.ExtBoundCond == ExternalEnvironment) {
- state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
+ state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
} else if (thisSurface.ExtBoundCond == Ground) {
- state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
+ state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
} else if (thisSurface.ExtBoundCond == OtherSideCoefNoCalcExt || thisSurface.ExtBoundCond == OtherSideCoefCalcExt) {
auto &thisOSC = state.dataSurface->OSC(thisSurface.OSCPtr);
thisOSC.OSCTempCalc =
(thisOSC.ZoneAirTempCoef * thisZoneHB.MAT + thisOSC.ExtDryBulbCoef * state.dataSurface->SurfOutDryBulbTemp(surfNum) +
thisOSC.ConstTempCoef * thisOSC.ConstTemp + thisOSC.GroundTempCoef * state.dataEnvrn->GroundTemp +
thisOSC.WindSpeedCoef * state.dataSurface->SurfOutWindSpeed(surfNum) * state.dataSurface->SurfOutDryBulbTemp(surfNum));
- state.dataRoomAirMod->Tin(ZoneNum) = thisOSC.OSCTempCalc;
+ state.dataRoomAir->Tin(ZoneNum) = thisOSC.OSCTempCalc;
} else {
- state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
+ state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
}
- state.dataRoomAirMod->Urec(ZoneNum) = 0.0;
- state.dataRoomAirMod->Ujet(ZoneNum) = 0.0;
- state.dataRoomAirMod->Qrec(ZoneNum) = 0.0;
- auto flows(state.dataRoomAirMod->CVJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK)
+ state.dataRoomAir->Urec(ZoneNum) = 0.0;
+ state.dataRoomAir->Ujet(ZoneNum) = 0.0;
+ state.dataRoomAir->Qrec(ZoneNum) = 0.0;
+ auto flows(state.dataRoomAir->CrossVentJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK)
for (int i = 1, u = flows.u(); i <= u; ++i) {
auto &e(flows(i));
e.Ujet = e.Urec = 0.0;
@@ -593,128 +556,107 @@ namespace CrossVentMgr {
// Calculate Qtot, the total volumetric flow rate through all active openings in the zone
Uin = 0.0;
- for (int Ctd = 1; Ctd <= state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, ZoneNum); ++Ctd) {
- Uin += state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area * state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin *
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).FlowFlag / state.dataRoomAirMod->Ain(ZoneNum);
+ for (int Ctd = 1; Ctd <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) {
+ auto const &jetRecFlows = state.dataRoomAir->CrossVentJetRecFlows(Ctd, ZoneNum);
+ Uin += jetRecFlows.Area * jetRecFlows.Uin * jetRecFlows.FlowFlag / state.dataRoomAir->Ain(ZoneNum);
}
// Verify if Uin is higher than minimum:
if (Uin < MinUin) {
- state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false;
- state.dataRoomAirMod->Urec(ZoneNum) = 0.0;
- state.dataRoomAirMod->Ujet(ZoneNum) = 0.0;
- state.dataRoomAirMod->Qrec(ZoneNum) = 0.0;
- state.dataRoomAirMod->RecInflowRatio(ZoneNum) = 0.0;
- auto flows(state.dataRoomAirMod->CVJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK)
+ state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false;
+ state.dataRoomAir->Urec(ZoneNum) = 0.0;
+ state.dataRoomAir->Ujet(ZoneNum) = 0.0;
+ state.dataRoomAir->Qrec(ZoneNum) = 0.0;
+ state.dataRoomAir->RecInflowRatio(ZoneNum) = 0.0;
+ auto flows(state.dataRoomAir->CrossVentJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK)
for (int i = 1, u = flows.u(); i <= u; ++i) {
auto &e(flows(i));
e.Ujet = e.Urec = 0.0;
}
if (thisSurface.ExtBoundCond > 0) {
- state.dataRoomAirMod->Tin(ZoneNum) =
+ state.dataRoomAir->Tin(ZoneNum) =
state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).MAT;
} else if (thisSurface.ExtBoundCond == ExternalEnvironment) {
- state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
+ state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
} else if (thisSurface.ExtBoundCond == Ground) {
- state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
+ state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
} else if (thisSurface.ExtBoundCond == OtherSideCoefNoCalcExt || thisSurface.ExtBoundCond == OtherSideCoefCalcExt) {
auto &thisOSC = state.dataSurface->OSC(thisSurface.OSCPtr);
thisOSC.OSCTempCalc =
(thisOSC.ZoneAirTempCoef * thisZoneHB.MAT + thisOSC.ExtDryBulbCoef * state.dataSurface->SurfOutDryBulbTemp(surfNum) +
thisOSC.ConstTempCoef * thisOSC.ConstTemp + thisOSC.GroundTempCoef * state.dataEnvrn->GroundTemp +
thisOSC.WindSpeedCoef * state.dataSurface->SurfOutWindSpeed(surfNum) * state.dataSurface->SurfOutDryBulbTemp(surfNum));
- state.dataRoomAirMod->Tin(ZoneNum) = thisOSC.OSCTempCalc;
+ state.dataRoomAir->Tin(ZoneNum) = thisOSC.OSCTempCalc;
} else {
- state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
+ state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
}
return;
}
// Evaluate parameter that determines whether recirculations are present
- for (int Ctd = 1; Ctd <= state.dataRoomAirMod->TotUCSDCV; ++Ctd) {
- if (ZoneNum == state.dataRoomAirMod->ZoneUCSDCV(Ctd).ZonePtr) {
- if (state.dataRoomAirMod->Ain(ZoneNum) / Aroom > 1.0 / 2.0) {
- state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) = 1.0;
+ for (int Ctd = 1; Ctd <= state.dataRoomAir->TotCrossVent; ++Ctd) {
+ if (ZoneNum == state.dataRoomAir->ZoneCrossVent(Ctd).ZonePtr) {
+ if (state.dataRoomAir->Ain(ZoneNum) / Aroom > 1.0 / 2.0) {
+ state.dataRoomAir->JetRecAreaRatio(ZoneNum) = 1.0;
} else {
- state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) = std::sqrt(state.dataRoomAirMod->Ain(ZoneNum) / Aroom);
+ state.dataRoomAir->JetRecAreaRatio(ZoneNum) = std::sqrt(state.dataRoomAir->Ain(ZoneNum) / Aroom);
}
}
}
- state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true;
+ state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true;
// Calculate jet and recirculation velocities for all active apertures
- state.dataRoomAirMod->Ujet(ZoneNum) = 0.0;
- state.dataRoomAirMod->Urec(ZoneNum) = 0.0;
- state.dataRoomAirMod->Qrec(ZoneNum) = 0.0;
- state.dataRoomAirMod->Qtot(ZoneNum) = 0.0;
- auto flows(state.dataRoomAirMod->CVJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK)
+ state.dataRoomAir->Ujet(ZoneNum) = 0.0;
+ state.dataRoomAir->Urec(ZoneNum) = 0.0;
+ state.dataRoomAir->Qrec(ZoneNum) = 0.0;
+ state.dataRoomAir->Qtot(ZoneNum) = 0.0;
+ auto flows(state.dataRoomAir->CrossVentJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK)
for (int i = 1, u = flows.u(); i <= u; ++i) {
auto &e(flows(i));
e.Ujet = e.Urec = e.Qrec = 0.0;
}
- for (int Ctd = 1; Ctd <= state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, ZoneNum); ++Ctd) {
- if (state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin != 0) {
- Real64 dstarexp =
- max(state.dataRoomAirMod->Dstar(ZoneNum) / (6.0 * std::sqrt(state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area)), 1.0);
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Vjet = state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin *
- std::sqrt(state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area) * 6.3 *
- std::log(dstarexp) / state.dataRoomAirMod->Dstar(ZoneNum);
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Yjet =
- Cjet1 * std::sqrt(state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area / Aroom) *
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Vjet / state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin +
- Cjet2;
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Yrec =
- Crec1 * std::sqrt(state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area / Aroom) *
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Vjet / state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin +
- Crec2;
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).YQrec =
- CrecFlow1 * std::sqrt(state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area * Aroom) *
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Vjet / state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin +
- CrecFlow2;
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Ujet = state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).FlowFlag *
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Yjet /
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin;
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Urec = state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).FlowFlag *
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Yrec /
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin;
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Qrec = state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).FlowFlag *
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).YQrec /
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin;
- state.dataRoomAirMod->Ujet(ZoneNum) += state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area *
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Ujet / state.dataRoomAirMod->Ain(ZoneNum);
- state.dataRoomAirMod->Urec(ZoneNum) += state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area *
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Urec / state.dataRoomAirMod->Ain(ZoneNum);
- state.dataRoomAirMod->Qrec(ZoneNum) += state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Qrec;
- state.dataRoomAirMod->Qtot(ZoneNum) +=
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Fin * state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).FlowFlag;
- state.dataRoomAirMod->Urec(ZoneNum) += state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area *
- state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Urec / state.dataRoomAirMod->Ain(ZoneNum);
- }
+ for (int Ctd = 1; Ctd <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) {
+ auto &jetRecFlows = state.dataRoomAir->CrossVentJetRecFlows(Ctd, ZoneNum);
+ if (jetRecFlows.Uin == 0) continue;
+
+ Real64 dstarexp = max(state.dataRoomAir->Dstar(ZoneNum) / (6.0 * std::sqrt(jetRecFlows.Area)), 1.0);
+ jetRecFlows.Vjet = jetRecFlows.Uin * std::sqrt(jetRecFlows.Area) * 6.3 * std::log(dstarexp) / state.dataRoomAir->Dstar(ZoneNum);
+ jetRecFlows.Yjet = Cjet1 * std::sqrt(jetRecFlows.Area / Aroom) * jetRecFlows.Vjet / jetRecFlows.Uin + Cjet2;
+ jetRecFlows.Yrec = Crec1 * std::sqrt(jetRecFlows.Area / Aroom) * jetRecFlows.Vjet / jetRecFlows.Uin + Crec2;
+ jetRecFlows.YQrec = CrecFlow1 * std::sqrt(jetRecFlows.Area * Aroom) * jetRecFlows.Vjet / jetRecFlows.Uin + CrecFlow2;
+ jetRecFlows.Ujet = jetRecFlows.FlowFlag * jetRecFlows.Yjet / jetRecFlows.Uin;
+ jetRecFlows.Urec = jetRecFlows.FlowFlag * jetRecFlows.Yrec / jetRecFlows.Uin;
+ jetRecFlows.Qrec = jetRecFlows.FlowFlag * jetRecFlows.YQrec / jetRecFlows.Uin;
+ state.dataRoomAir->Ujet(ZoneNum) += jetRecFlows.Area * jetRecFlows.Ujet / state.dataRoomAir->Ain(ZoneNum);
+ state.dataRoomAir->Urec(ZoneNum) += jetRecFlows.Area * jetRecFlows.Urec / state.dataRoomAir->Ain(ZoneNum);
+ state.dataRoomAir->Qrec(ZoneNum) += jetRecFlows.Qrec;
+ state.dataRoomAir->Qtot(ZoneNum) += jetRecFlows.Fin * jetRecFlows.FlowFlag;
+ state.dataRoomAir->Urec(ZoneNum) += jetRecFlows.Area * jetRecFlows.Urec / state.dataRoomAir->Ain(ZoneNum);
}
// Ratio between recirculation flow rate and total inflow rate
- if (state.dataRoomAirMod->Qtot(ZoneNum) != 0) {
- state.dataRoomAirMod->RecInflowRatio(ZoneNum) = state.dataRoomAirMod->Qrec(ZoneNum) / state.dataRoomAirMod->Qtot(ZoneNum);
+ if (state.dataRoomAir->Qtot(ZoneNum) != 0) {
+ state.dataRoomAir->RecInflowRatio(ZoneNum) = state.dataRoomAir->Qrec(ZoneNum) / state.dataRoomAir->Qtot(ZoneNum);
} else {
- state.dataRoomAirMod->RecInflowRatio(ZoneNum) = 0.0;
+ state.dataRoomAir->RecInflowRatio(ZoneNum) = 0.0;
}
// Set Tin based on external conditions of the dominant aperture
if (thisSurface.ExtBoundCond <= 0) {
if (thisSurface.ExtBoundCond == ExternalEnvironment) {
- state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
+ state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
} else if (thisSurface.ExtBoundCond == Ground) {
- state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
+ state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
} else if (thisSurface.ExtBoundCond == OtherSideCoefNoCalcExt || thisSurface.ExtBoundCond == OtherSideCoefCalcExt) {
auto &thisOSC = state.dataSurface->OSC(thisSurface.OSCPtr);
thisOSC.OSCTempCalc =
(thisOSC.ZoneAirTempCoef * thisZoneHB.MAT + thisOSC.ExtDryBulbCoef * state.dataSurface->SurfOutDryBulbTemp(surfNum) +
thisOSC.ConstTempCoef * thisOSC.ConstTemp + thisOSC.GroundTempCoef * state.dataEnvrn->GroundTemp +
thisOSC.WindSpeedCoef * state.dataSurface->SurfOutWindSpeed(surfNum) * state.dataSurface->SurfOutDryBulbTemp(surfNum));
- state.dataRoomAirMod->Tin(ZoneNum) = thisOSC.OSCTempCalc;
+ state.dataRoomAir->Tin(ZoneNum) = thisOSC.OSCTempCalc;
} else {
- state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
+ state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
}
} else {
// adiabatic surface
@@ -723,49 +665,49 @@ namespace CrossVentMgr {
int NodeNum2 = state.afn->AirflowNetworkLinkageData(MaxSurf).NodeNums[1];
if (thisSurface.Zone == ZoneNum) {
if (state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum <= 0) {
- state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
- } else if (state.dataRoomAirMod->AirModel(state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum).AirModelType ==
- DataRoomAirModel::RoomAirModel::UCSDCV) {
- state.dataRoomAirMod->Tin(ZoneNum) =
- state.dataRoomAirMod->RoomOutflowTemp(state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum);
+ state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
+ } else if (state.dataRoomAir->AirModel(state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum).AirModel ==
+ RoomAir::RoomAirModel::CrossVent) {
+ state.dataRoomAir->Tin(ZoneNum) =
+ state.dataRoomAir->RoomOutflowTemp(state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum);
} else {
- state.dataRoomAirMod->Tin(ZoneNum) =
+ state.dataRoomAir->Tin(ZoneNum) =
state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum).MAT;
}
} else {
if (state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum <= 0) {
- state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
- } else if (state.dataRoomAirMod->AirModel(state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum).AirModelType ==
- DataRoomAirModel::RoomAirModel::UCSDCV) {
- state.dataRoomAirMod->Tin(ZoneNum) =
- state.dataRoomAirMod->RoomOutflowTemp(state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum);
+ state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
+ } else if (state.dataRoomAir->AirModel(state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum).AirModel ==
+ RoomAir::RoomAirModel::CrossVent) {
+ state.dataRoomAir->Tin(ZoneNum) =
+ state.dataRoomAir->RoomOutflowTemp(state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum);
} else {
- state.dataRoomAirMod->Tin(ZoneNum) =
+ state.dataRoomAir->Tin(ZoneNum) =
state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum).MAT;
}
}
} else if ((thisSurface.Zone == ZoneNum) &&
- (state.dataRoomAirMod->AirModel(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).AirModelType ==
- DataRoomAirModel::RoomAirModel::UCSDCV)) {
- state.dataRoomAirMod->Tin(ZoneNum) = state.dataRoomAirMod->RoomOutflowTemp(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone);
+ (state.dataRoomAir->AirModel(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).AirModel ==
+ RoomAir::RoomAirModel::CrossVent)) {
+ state.dataRoomAir->Tin(ZoneNum) = state.dataRoomAir->RoomOutflowTemp(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone);
} else if ((thisSurface.Zone != ZoneNum) &&
- (state.dataRoomAirMod->AirModel(thisSurface.Zone).AirModelType == DataRoomAirModel::RoomAirModel::UCSDCV)) {
- state.dataRoomAirMod->Tin(ZoneNum) = state.dataRoomAirMod->RoomOutflowTemp(surfNum);
+ (state.dataRoomAir->AirModel(thisSurface.Zone).AirModel == RoomAir::RoomAirModel::CrossVent)) {
+ state.dataRoomAir->Tin(ZoneNum) = state.dataRoomAir->RoomOutflowTemp(surfNum);
} else {
if (thisSurface.Zone == ZoneNum) {
- state.dataRoomAirMod->Tin(ZoneNum) =
+ state.dataRoomAir->Tin(ZoneNum) =
state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).MAT;
} else {
- state.dataRoomAirMod->Tin(ZoneNum) = state.dataZoneTempPredictorCorrector->zoneHeatBalance(thisSurface.Zone).MAT;
+ state.dataRoomAir->Tin(ZoneNum) = state.dataZoneTempPredictorCorrector->zoneHeatBalance(thisSurface.Zone).MAT;
}
}
}
}
- void CalcUCSDCV(EnergyPlusData &state,
- int const ZoneNum) // Which Zonenum
+ void CalcCrossVent(EnergyPlusData &state,
+ int const ZoneNum) // Which Zonenum
{
// SUBROUTINE INFORMATION:
@@ -788,9 +730,9 @@ namespace CrossVentMgr {
Real64 ZoneMult = zone.Multiplier * zone.ListMultiplier; // total zone multiplier
auto const &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum);
- for (int Ctd = 1; Ctd <= state.dataRoomAirMod->TotUCSDCV; ++Ctd) {
- if (ZoneNum == state.dataRoomAirMod->ZoneUCSDCV(Ctd).ZonePtr) {
- GainsFrac = ScheduleManager::GetCurrentScheduleValue(state, state.dataRoomAirMod->ZoneUCSDCV(Ctd).SchedGainsPtr);
+ for (int Ctd = 1; Ctd <= state.dataRoomAir->TotCrossVent; ++Ctd) {
+ if (ZoneNum == state.dataRoomAir->ZoneCrossVent(Ctd).ZonePtr) {
+ GainsFrac = ScheduleManager::GetCurrentScheduleValue(state, state.dataRoomAir->ZoneCrossVent(Ctd).SchedGainsPtr);
}
}
@@ -817,103 +759,103 @@ namespace CrossVentMgr {
state.afn->exchangeData(ZoneNum).SumMCpT + state.afn->exchangeData(ZoneNum).SumMVCpT + state.afn->exchangeData(ZoneNum).SumMMCpT;
}
- EvolveParaUCSDCV(state, ZoneNum);
- // Real64 L = state.dataRoomAirMod->Droom(ZoneNum);
+ EvolveParaCrossVent(state, ZoneNum);
+ // Real64 L = state.dataRoomAir->Droom(ZoneNum);
- if (state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel) {
+ if (state.dataRoomAir->AirModel(ZoneNum).SimAirModel) {
//=============================== CROSS VENTILATION Calculation ==============================================
- state.dataRoomAirMod->ZoneCVisMixing(ZoneNum) = 0.0;
- state.dataRoomAirMod->ZoneCVhasREC(ZoneNum) = 1.0;
+ state.dataRoomAir->ZoneCrossVentIsMixing(ZoneNum) = 0.0;
+ state.dataRoomAir->ZoneCrossVentHasREC(ZoneNum) = 1.0;
for (int Ctd = 1; Ctd <= 4; ++Ctd) {
- HcUCSDCV(state, ZoneNum);
- if (state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) != 1.0) {
- state.dataRoomAirMod->ZTREC(ZoneNum) =
- (ConvGainsRec * CrecTemp + CrecTemp * state.dataCrossVentMgr->HAT_R + state.dataRoomAirMod->Tin(ZoneNum) * MCp_Total) /
+ HcCrossVent(state, ZoneNum);
+ if (state.dataRoomAir->JetRecAreaRatio(ZoneNum) != 1.0) {
+ state.dataRoomAir->ZTREC(ZoneNum) =
+ (ConvGainsRec * CrecTemp + CrecTemp * state.dataCrossVentMgr->HAT_R + state.dataRoomAir->Tin(ZoneNum) * MCp_Total) /
(CrecTemp * state.dataCrossVentMgr->HA_R + MCp_Total);
}
- state.dataRoomAirMod->ZTJET(ZoneNum) = (ConvGainsJet * CjetTemp + ConvGainsRec * CjetTemp + CjetTemp * state.dataCrossVentMgr->HAT_J +
- CjetTemp * state.dataCrossVentMgr->HAT_R + state.dataRoomAirMod->Tin(ZoneNum) * MCp_Total -
- CjetTemp * state.dataCrossVentMgr->HA_R * state.dataRoomAirMod->ZTREC(ZoneNum)) /
- (CjetTemp * state.dataCrossVentMgr->HA_J + MCp_Total);
- state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) =
+ state.dataRoomAir->ZTJET(ZoneNum) = (ConvGainsJet * CjetTemp + ConvGainsRec * CjetTemp + CjetTemp * state.dataCrossVentMgr->HAT_J +
+ CjetTemp * state.dataCrossVentMgr->HAT_R + state.dataRoomAir->Tin(ZoneNum) * MCp_Total -
+ CjetTemp * state.dataCrossVentMgr->HA_R * state.dataRoomAir->ZTREC(ZoneNum)) /
+ (CjetTemp * state.dataCrossVentMgr->HA_J + MCp_Total);
+ state.dataRoomAir->RoomOutflowTemp(ZoneNum) =
(ConvGainsJet + ConvGainsRec + state.dataCrossVentMgr->HAT_J + state.dataCrossVentMgr->HAT_R +
- state.dataRoomAirMod->Tin(ZoneNum) * MCp_Total - state.dataCrossVentMgr->HA_J * state.dataRoomAirMod->ZTJET(ZoneNum) -
- state.dataCrossVentMgr->HA_R * state.dataRoomAirMod->ZTREC(ZoneNum)) /
+ state.dataRoomAir->Tin(ZoneNum) * MCp_Total - state.dataCrossVentMgr->HA_J * state.dataRoomAir->ZTJET(ZoneNum) -
+ state.dataCrossVentMgr->HA_R * state.dataRoomAir->ZTREC(ZoneNum)) /
MCp_Total;
}
- if (state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) == 1.0) {
- state.dataRoomAirMod->ZoneCVhasREC(ZoneNum) = 0.0;
- state.dataRoomAirMod->ZTREC(ZoneNum) = state.dataRoomAirMod->RoomOutflowTemp(ZoneNum);
- state.dataRoomAirMod->ZTREC(ZoneNum) = state.dataRoomAirMod->ZTJET(ZoneNum);
- state.dataRoomAirMod->ZTREC(ZoneNum) = state.dataRoomAirMod->ZTJET(ZoneNum);
+ if (state.dataRoomAir->JetRecAreaRatio(ZoneNum) == 1.0) {
+ state.dataRoomAir->ZoneCrossVentHasREC(ZoneNum) = 0.0;
+ state.dataRoomAir->ZTREC(ZoneNum) = state.dataRoomAir->RoomOutflowTemp(ZoneNum);
+ state.dataRoomAir->ZTREC(ZoneNum) = state.dataRoomAir->ZTJET(ZoneNum);
+ state.dataRoomAir->ZTREC(ZoneNum) = state.dataRoomAir->ZTJET(ZoneNum);
}
// If temperature increase is above 1.5C then go to mixing
- if (state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) - state.dataRoomAirMod->Tin(ZoneNum) > 1.5) {
- state.dataRoomAirMod->ZoneCVisMixing(ZoneNum) = 1.0;
- state.dataRoomAirMod->ZoneCVhasREC(ZoneNum) = 0.0;
- state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false;
- state.dataRoomAirMod->Ujet(ZoneNum) = 0.0;
- state.dataRoomAirMod->Urec(ZoneNum) = 0.0;
- state.dataRoomAirMod->Qrec(ZoneNum) = 0.0;
- state.dataRoomAirMod->RecInflowRatio(ZoneNum) = 0.0;
- for (auto &e : state.dataRoomAirMod->CVJetRecFlows) {
+ if (state.dataRoomAir->RoomOutflowTemp(ZoneNum) - state.dataRoomAir->Tin(ZoneNum) > 1.5) {
+ state.dataRoomAir->ZoneCrossVentIsMixing(ZoneNum) = 1.0;
+ state.dataRoomAir->ZoneCrossVentHasREC(ZoneNum) = 0.0;
+ state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false;
+ state.dataRoomAir->Ujet(ZoneNum) = 0.0;
+ state.dataRoomAir->Urec(ZoneNum) = 0.0;
+ state.dataRoomAir->Qrec(ZoneNum) = 0.0;
+ state.dataRoomAir->RecInflowRatio(ZoneNum) = 0.0;
+ for (auto &e : state.dataRoomAir->CrossVentJetRecFlows) {
e.Ujet = 0.0;
e.Urec = 0.0;
}
for (int Ctd = 1; Ctd <= 3; ++Ctd) {
Real64 ZTAveraged = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT;
- state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->ZTJET(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->ZTJET(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged;
- HcUCSDCV(state, ZoneNum);
+ state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
+ HcCrossVent(state, ZoneNum);
ZTAveraged = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT;
- state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->ZTJET(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->ZTJET(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
}
}
} else {
//=============================== M I X E D Calculation ======================================================
- state.dataRoomAirMod->ZoneCVisMixing(ZoneNum) = 1.0;
- state.dataRoomAirMod->ZoneCVhasREC(ZoneNum) = 0.0;
- state.dataRoomAirMod->Ujet(ZoneNum) = 0.0;
- state.dataRoomAirMod->Urec(ZoneNum) = 0.0;
- state.dataRoomAirMod->Qrec(ZoneNum) = 0.0;
- state.dataRoomAirMod->RecInflowRatio(ZoneNum) = 0.0;
- for (auto &e : state.dataRoomAirMod->CVJetRecFlows) {
+ state.dataRoomAir->ZoneCrossVentIsMixing(ZoneNum) = 1.0;
+ state.dataRoomAir->ZoneCrossVentHasREC(ZoneNum) = 0.0;
+ state.dataRoomAir->Ujet(ZoneNum) = 0.0;
+ state.dataRoomAir->Urec(ZoneNum) = 0.0;
+ state.dataRoomAir->Qrec(ZoneNum) = 0.0;
+ state.dataRoomAir->RecInflowRatio(ZoneNum) = 0.0;
+ for (auto &e : state.dataRoomAir->CrossVentJetRecFlows) {
e.Ujet = 0.0;
e.Urec = 0.0;
}
for (int Ctd = 1; Ctd <= 3; ++Ctd) {
Real64 ZTAveraged = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT;
- state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->ZTJET(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->ZTJET(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged;
- HcUCSDCV(state, ZoneNum);
+ state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
+ HcCrossVent(state, ZoneNum);
ZTAveraged = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT;
- state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->ZTJET(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->ZTJET(ZoneNum) = ZTAveraged;
- state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged;
+ state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
}
}
}
-} // namespace CrossVentMgr
+} // namespace RoomAir
} // namespace EnergyPlus
diff --git a/src/EnergyPlus/CrossVentMgr.hh b/src/EnergyPlus/CrossVentMgr.hh
index 0ffe03c4b1f..82987f4cb8b 100644
--- a/src/EnergyPlus/CrossVentMgr.hh
+++ b/src/EnergyPlus/CrossVentMgr.hh
@@ -57,19 +57,19 @@ namespace EnergyPlus {
// Forward declarations
struct EnergyPlusData;
-namespace CrossVentMgr {
+namespace RoomAir {
- void ManageUCSDCVModel(EnergyPlusData &state, int ZoneNum);
+ void ManageCrossVent(EnergyPlusData &state, int ZoneNum);
- void InitUCSDCV(EnergyPlusData &state, int ZoneNum);
+ void InitCrossVent(EnergyPlusData &state, int ZoneNum);
- void HcUCSDCV(EnergyPlusData &state, int ZoneNum);
+ void HcCrossVent(EnergyPlusData &state, int ZoneNum);
- void EvolveParaUCSDCV(EnergyPlusData &state, int ZoneNum);
+ void EvolveParaCrossVent(EnergyPlusData &state, int ZoneNum);
- void CalcUCSDCV(EnergyPlusData &state, int ZoneNum);
+ void CalcCrossVent(EnergyPlusData &state, int ZoneNum);
-} // namespace CrossVentMgr
+} // namespace RoomAir
struct CrossVentMgrData : BaseGlobalStruct
{
@@ -83,7 +83,7 @@ struct CrossVentMgrData : BaseGlobalStruct
void clear_state() override
{
- *this = CrossVentMgrData();
+ new (this) CrossVentMgrData();
}
};
diff --git a/src/EnergyPlus/CurveManager.cc b/src/EnergyPlus/CurveManager.cc
index 1930bae1068..bec8f4694b1 100644
--- a/src/EnergyPlus/CurveManager.cc
+++ b/src/EnergyPlus/CurveManager.cc
@@ -2269,7 +2269,7 @@ namespace Curve {
auto const &fields = instance.value();
std::string const &thisObjectName = instance.key();
state.dataInputProcessing->inputProcessor->markObjectAsUsed("Table:IndependentVariable", thisObjectName);
- state.dataCurveManager->btwxtManager.independentVarRefs.emplace(UtilityRoutines::MakeUPPERCase(thisObjectName), fields);
+ state.dataCurveManager->btwxtManager.independentVarRefs.emplace(UtilityRoutines::makeUPPER(thisObjectName), fields);
}
}
@@ -2285,13 +2285,13 @@ namespace Curve {
auto const &fields = instance.value();
std::string const &thisObjectName = instance.key();
state.dataInputProcessing->inputProcessor->markObjectAsUsed("Table:IndependentVariableList", thisObjectName);
- std::string varListName = UtilityRoutines::MakeUPPERCase(thisObjectName);
+ std::string varListName = UtilityRoutines::makeUPPER(thisObjectName);
std::vector gridAxes;
// Loop through independent variables in list and add them to the grid
for (auto &indVar : fields.at("independent_variables")) {
- std::string indVarName = UtilityRoutines::MakeUPPERCase(indVar.at("independent_variable_name").get());
+ std::string indVarName = UtilityRoutines::makeUPPER(indVar.at("independent_variable_name").get());
std::string contextString = format("Table:IndependentVariable \"{}\"", indVarName);
std::pair