From c5f17910dca5023d1d8fa7a46d8a4eef69e5dccb Mon Sep 17 00:00:00 2001 From: Lerond Date: Fri, 16 May 2025 15:24:30 -0700 Subject: [PATCH 1/8] Recalculate outlet water temperature. --- src/EnergyPlus/WaterCoils.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index ff3cd4e8a9d..6e15af444af 100644 --- a/src/EnergyPlus/WaterCoils.cc +++ b/src/EnergyPlus/WaterCoils.cc @@ -2835,6 +2835,7 @@ void CalcSimpleHeatingCoil(EnergyPlusData &state, if (fanOp == HVAC::FanOp::Cycling) { HeatingCoilLoad *= PartLoadRatio; + TempWaterOut = TempWaterIn - HeatingCoilLoad / CapacitanceWater; } // Set the outlet conditions From fa2341477797c6f875bc0aec267f5a2a8681d473 Mon Sep 17 00:00:00 2001 From: Lerond Date: Fri, 16 May 2025 17:09:28 -0700 Subject: [PATCH 2/8] Catch div by 0. --- src/EnergyPlus/WaterCoils.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index 6e15af444af..1ed6fd2ae51 100644 --- a/src/EnergyPlus/WaterCoils.cc +++ b/src/EnergyPlus/WaterCoils.cc @@ -2835,7 +2835,9 @@ void CalcSimpleHeatingCoil(EnergyPlusData &state, if (fanOp == HVAC::FanOp::Cycling) { HeatingCoilLoad *= PartLoadRatio; - TempWaterOut = TempWaterIn - HeatingCoilLoad / CapacitanceWater; + if (CapacitanceWater > 0) { + TempWaterOut = TempWaterIn - HeatingCoilLoad / CapacitanceWater; + } } // Set the outlet conditions From eb50425a739e15aed573215a4c9acfc065db2c3d Mon Sep 17 00:00:00 2001 From: lymereJ Date: Sun, 25 May 2025 23:27:28 -0700 Subject: [PATCH 3/8] Better fix. --- src/EnergyPlus/WaterCoils.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index 8689cfd894b..c01dba5d4a9 100644 --- a/src/EnergyPlus/WaterCoils.cc +++ b/src/EnergyPlus/WaterCoils.cc @@ -2903,7 +2903,8 @@ void CalcSimpleHeatingCoil(EnergyPlusData &state, if (fanOp == HVAC::FanOp::Cycling) { HeatingCoilLoad *= PartLoadRatio; - if (CapacitanceWater > 0) { + if (CapacitanceWater > 0 && + state.dataPlnt->PlantLoop(waterCoil.WaterPlantLoc.loopNum).LoopSide(DataPlant::LoopSideLocation::Supply).FlowRequest > 0) { TempWaterOut = TempWaterIn - HeatingCoilLoad / CapacitanceWater; } } From 63976381ab396ad606984353e517cb68d902ca2f Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Thu, 12 Jun 2025 22:24:08 -0500 Subject: [PATCH 4/8] Try a regression update on a branch with diffs --- .github/workflows/test_pull_requests.yml | 7 + scripts/dev/gha_regressions.py | 282 ++++++++++++++++++++++- 2 files changed, 288 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_pull_requests.yml b/.github/workflows/test_pull_requests.yml index 05f549c93a4..bc2becc71c8 100644 --- a/.github/workflows/test_pull_requests.yml +++ b/.github/workflows/test_pull_requests.yml @@ -184,6 +184,13 @@ jobs: name: "regressions-${{ matrix.os }}" path: "${{ github.workspace }}/regressions" + - uses: actions/upload-artifact@v4 + id: upload_regression_plotter + if: always() && matrix.run_regressions && steps.regressions.outcome == 'failure' # only run this if regressions were encountered "failed" + with: + name: "regressions-plotter-${{ matrix.os }}" + path: "${{ github.workspace }}/regression_plotter.html" + - name: Generate Regression Summary GitHub Script if: always() && matrix.run_regressions && steps.regressions.outcome == 'failure' run: > diff --git a/scripts/dev/gha_regressions.py b/scripts/dev/gha_regressions.py index cf62bb9ec0c..9612706552a 100644 --- a/scripts/dev/gha_regressions.py +++ b/scripts/dev/gha_regressions.py @@ -54,6 +54,7 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. from collections import defaultdict +import csv from datetime import datetime, UTC import json from shutil import copy @@ -459,11 +460,225 @@ def generate_markdown_summary(self, bundle_root: Path): """ (bundle_root / 'summary.md').write_text(content) + @staticmethod + def read_csv_to_columns(file_path: Path) -> dict[str, list[str | float]]: + columns = {} + with open(file_path, 'r', newline='') as file: + reader = csv.reader(file) + header = next(reader) # Read header row + for i, col_name in enumerate(header): + columns[col_name.strip()] = [] + for row in reader: + for i, value in enumerate(row): + value = value.strip() + variable = header[i].strip() + try: + v = float(value) + columns[variable].append(v) + except ValueError: # just take the string timestamp + columns[variable].append(value) + return columns + + @staticmethod + def generate_regression_plotter(bundle_root: Path, metadata_object: dict, results_object: dict, limit: bool): + metadata_string = json.dumps(metadata_object, indent=4) + results_string = json.dumps(results_object, indent=4) + diagnostics_string = "" + limit_string = "" if not limit else r"""""" + content = r""" + + + + EnergyPlus Regression Viewer + + + + + +
+

EnergyPlus Regression Quick Plotter

+
+ + +
+
+ + +
+ + + {{LIMIT}} +
+
+
+ + + + """ + patches = { + '{{METADATA}}': metadata_string, + '{{RESULTS}}': results_string, + '{{LIMIT}}': limit_string + } + for key, value in patches.items(): + content = content.replace(key, value) + (bundle_root / 'regression_plotter.html').write_text(content) + def check_all_regressions(self, base_testfiles: Path, mod_testfiles: Path, bundle_root: Path) -> bool: any_diffs = False bundle_root.mkdir(exist_ok=True) entries = sorted(base_testfiles.iterdir()) backtrace_shown = False + + # temporarily hardcoding metadata stuff + baseline_name = "baseline" + branch_name = "branch" + branch_sha = "abc123de" + metadata_object = { + "baseline": baseline_name, "branch": branch_name, "branchSha": branch_sha + } + results_object = {} + hit_max_limit = False for entry_num, baseline in enumerate(entries): if not baseline.is_dir(): continue @@ -495,7 +710,66 @@ def check_all_regressions(self, base_testfiles: Path, mod_testfiles: Path, bundl contents = potential_diff_file.read_text() wrapped_contents = self.single_diff_html(contents) diff_file_with_html.write_text(wrapped_contents) - index_contents_this_file += self.regression_row_in_single_test_case_html(potential_diff_file.name) + if potential_diff_file.name == "eplusout.csv.absdiff.csv" and not hit_max_limit: + # get data from the csvs, for now just all columns + base_csv = potential_diff_file.parent / "eplusout.csv" + base_column_data = self.read_csv_to_columns(base_csv) + base_timestamps = base_column_data['Date/Time'] + mod_csv = mod_testfiles / baseline.name / "eplusout.csv" + mod_column_data = self.read_csv_to_columns(mod_csv) + mod_timestamps = mod_column_data['Date/Time'] + # but then downselect only the columns that math-diff provided in the summary + abs_diff_columns = self.read_csv_to_columns(potential_diff_file) + variables_with_diffs = abs_diff_columns.keys() + # Alright so here's the trick. If we can tell for sure that these results are + # just two design days only, split evenly, then we will split it into two + # plots. If not, we'll just do one big one + # at this point, we know the time series match between base and branch + do_multi_plot = False + mid_point = 0 + base_times = [base_timestamps] + mod_times = [mod_timestamps] + if len(base_timestamps) % 2 == 0: + mid_point = len(base_timestamps) // 2 + one = base_timestamps[:mid_point] + one_prefix = one[0][0:6] + one_all_same_prefix = all([x.startswith(one_prefix) for x in one]) + two = base_timestamps[mid_point:] + two_prefix = two[0][0:6] + two_all_same_prefix = all([x.startswith(two_prefix) for x in two]) + if one_all_same_prefix and two_all_same_prefix: + do_multi_plot = True + base_times = [one, two] + mod_times = [one, two] + results_object[baseline.name] = { + "timestamps": {"develop": base_times, "branch": mod_times} + } + for v in variables_with_diffs: + if v == 'Date/Time': + continue + base_data = [base_column_data[v]] + mod_data = [mod_column_data[v]] + if do_multi_plot: + plot_one_base_data = base_column_data[v][:mid_point] + plot_one_mod_data = mod_column_data[v][:mid_point] + plot_two_base_data = base_column_data[v][mid_point:] + plot_two_mod_data = mod_column_data[v][mid_point:] + base_data = [plot_one_base_data, plot_two_base_data] + mod_data = [plot_one_mod_data, plot_two_mod_data] + # temporarily hardcode the units and quantity + results_object[baseline.name][v] = { + "develop": base_data, + "branch": mod_data + } + # check if we are at the max limit to avoid making the page way too heavy to load + max_size_megabytes = 75 # 75 MB is probably a good cutoff + max_size_bytes = max_size_megabytes * 1024 * 1024 + estimated_size = len(json.dumps(results_object).encode('utf-8')) + if estimated_size > max_size_bytes: + hit_max_limit = True + index_contents_this_file += self.regression_row_in_single_test_case_html( + potential_diff_file.name + ) index_file = target_dir_for_this_file_diffs / 'index.html' index_this_file = self.single_test_case_html(index_contents_this_file) index_file.write_text(index_this_file) @@ -526,6 +800,12 @@ def check_all_regressions(self, base_testfiles: Path, mod_testfiles: Path, bundl print(f"* Diffs by Type *:\n{json.dumps(self.diffs_by_type, indent=2, sort_keys=True)}\n") if any_diffs: self.generate_markdown_summary(bundle_root) + self.generate_regression_plotter( + bundle_root, metadata_object, results_object, hit_max_limit + ) + self.generate_regression_plotter( + bundle_root.parent, metadata_object, results_object, hit_max_limit + ) # print("::warning title=Regressions::Diffs Detected") return any_diffs From ac19cafdab178bdd860196dbff3826166999bcd7 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Fri, 13 Jun 2025 16:16:48 -0500 Subject: [PATCH 5/8] Annotate the GHA workflow a little, break out html plotter template, add diff plot where possible --- .github/workflows/test_pull_requests.yml | 13 +- scripts/dev/gha_regressions.py | 189 ++---------------- scripts/dev/regression_plotter.in.html | 241 +++++++++++++++++++++++ 3 files changed, 262 insertions(+), 181 deletions(-) create mode 100644 scripts/dev/regression_plotter.in.html diff --git a/.github/workflows/test_pull_requests.yml b/.github/workflows/test_pull_requests.yml index bc2becc71c8..488ec93a477 100644 --- a/.github/workflows/test_pull_requests.yml +++ b/.github/workflows/test_pull_requests.yml @@ -170,6 +170,7 @@ jobs: if: always() && matrix.run_regressions && steps.branch_build.outcome != 'failure' # always run this step as long as we actually built run: pip install energyplus-regressions>=2.1.4 + # This will build out a ./regressions package as well as a ./regressions-plotter-{{matric.os}}.html report - name: Run Regressions if: always() && matrix.run_regressions && steps.branch_build.outcome != 'failure' # always run this step as long as we actually built id: regressions @@ -177,20 +178,23 @@ jobs: continue-on-error: true run: python ./branch/scripts/dev/gha_regressions.py ./baseline/build/testfiles ./branch/build/testfiles/ ./regressions - - uses: actions/upload-artifact@v4 + - name: Upload Regressions Full Bundle + uses: actions/upload-artifact@v4 id: upload_regressions if: always() && matrix.run_regressions && steps.regressions.outcome == 'failure' # only run this if regressions were encountered "failed" with: name: "regressions-${{ matrix.os }}" path: "${{ github.workspace }}/regressions" - - uses: actions/upload-artifact@v4 + - name: Upload Regressions Plotter HTML + uses: actions/upload-artifact@v4 id: upload_regression_plotter if: always() && matrix.run_regressions && steps.regressions.outcome == 'failure' # only run this if regressions were encountered "failed" with: name: "regressions-plotter-${{ matrix.os }}" path: "${{ github.workspace }}/regression_plotter.html" + # This executes a Python script that reads regressions results and produces a JavaScript file meant to run on GitHub - name: Generate Regression Summary GitHub Script if: always() && matrix.run_regressions && steps.regressions.outcome == 'failure' run: > @@ -202,7 +206,9 @@ jobs: ${{ github.run_id }} ${{ steps.upload_regressions.outputs.artifact-url }} - - uses: actions/github-script@v7 + # Run the generated JavaScript file which will post the regressions summary to the PR itself + - name: Post Regression Summary to PR + uses: actions/github-script@v7 if: always() && matrix.run_regressions && steps.regressions.outcome == 'failure' && github.event.pull_request.head.repo.full_name == 'NREL/EnergyPlus' with: script: | @@ -211,6 +217,7 @@ jobs: # - uses: lhotari/action-upterm@v1 + # Unfortunately I can't get forked repository runs to post onto the original PR, so this is needed to alert for regressions - name: Fail on Regressions from Forked Repository if: always() && matrix.run_regressions && steps.regressions.outcome == 'failure' && github.event.pull_request.head.repo.full_name != 'NREL/EnergyPlus' run: | diff --git a/scripts/dev/gha_regressions.py b/scripts/dev/gha_regressions.py index 9612706552a..75b0421d45d 100644 --- a/scripts/dev/gha_regressions.py +++ b/scripts/dev/gha_regressions.py @@ -83,7 +83,7 @@ def __init__(self): import energyplus_regressions self.threshold_file = str(Path(energyplus_regressions.__file__).parent / 'diffs' / 'math_diff.config') - def single_file_regressions(self, baseline: Path, modified: Path) -> [TestEntry, bool]: + def single_file_regressions(self, baseline: Path, modified: Path) -> tuple[TestEntry, bool]: idf = baseline.name self.num_idf_inspected += 1 @@ -481,184 +481,17 @@ def read_csv_to_columns(file_path: Path) -> dict[str, list[str | float]]: @staticmethod def generate_regression_plotter(bundle_root: Path, metadata_object: dict, results_object: dict, limit: bool): - metadata_string = json.dumps(metadata_object, indent=4) - results_string = json.dumps(results_object, indent=4) - diagnostics_string = "" - limit_string = "" if not limit else r"""""" - content = r""" - - - - EnergyPlus Regression Viewer - - - - - -
-

EnergyPlus Regression Quick Plotter

-
- - -
-
- - -
- - - {{LIMIT}} -
-
-
- - - - """ + metadata_string = "metadata = " + json.dumps(metadata_object, indent=4) + ';' + results_string = "results = " + json.dumps(results_object, indent=4) + ';' + limit_string = "" + if limit: + limit_string = r"""""" + template_file = Path(__file__).resolve().parent / 'regression_plotter.in.html' + content = template_file.read_text() patches = { - '{{METADATA}}': metadata_string, - '{{RESULTS}}': results_string, - '{{LIMIT}}': limit_string + '': metadata_string, + '': results_string, + '': limit_string } for key, value in patches.items(): content = content.replace(key, value) diff --git a/scripts/dev/regression_plotter.in.html b/scripts/dev/regression_plotter.in.html new file mode 100644 index 00000000000..337d681f9cd --- /dev/null +++ b/scripts/dev/regression_plotter.in.html @@ -0,0 +1,241 @@ + + + + EnergyPlus Regression Viewer + + + + + +
+

EnergyPlus Regression Quick Plotter

+
+ + +
+
+ + +
+ + + + +
+
+
+ + + \ No newline at end of file From 802cdbaf558f9fb68d444d967b57da503df5b093 Mon Sep 17 00:00:00 2001 From: lymereJ Date: Mon, 23 Nov 2026 09:44:43 -0800 Subject: [PATCH 6/8] Revert changes to workflow --- .github/workflows/test_pull_requests.yml | 11 -- scripts/dev/gha_regressions.py | 43 ---- scripts/dev/regression_plotter.in.html | 241 ----------------------- 3 files changed, 295 deletions(-) delete mode 100644 scripts/dev/regression_plotter.in.html diff --git a/.github/workflows/test_pull_requests.yml b/.github/workflows/test_pull_requests.yml index 82b27b057ff..79e80de36ae 100644 --- a/.github/workflows/test_pull_requests.yml +++ b/.github/workflows/test_pull_requests.yml @@ -241,7 +241,6 @@ jobs: if: always() && matrix.run_regressions && steps.branch_build.outcome != 'failure' # always run this step as long as we actually built run: pip install energyplus-regressions>=2.1.4 - # This will build out a ./regressions package as well as a ./regressions-plotter-{{matric.os}}.html report - name: Run Regressions if: always() && matrix.run_regressions && steps.branch_build.outcome != 'failure' # always run this step as long as we actually built id: regressions @@ -256,15 +255,6 @@ jobs: name: "regressions-${{ matrix.os }}-${{ github.event.pull_request.head.sha }}" path: "${{ github.workspace }}/regressions" - - name: Upload Regressions Plotter HTML - uses: actions/upload-artifact@v4 - id: upload_regression_plotter - if: always() && matrix.run_regressions && steps.regressions.outcome == 'failure' # only run this if regressions were encountered "failed" - with: - name: "regressions-plotter-${{ matrix.os }}" - path: "${{ github.workspace }}/regression_plotter.html" - - # This executes a Python script that reads regressions results and produces a JavaScript file meant to run on GitHub - name: Generate Regression Summary GitHub Script if: always() && matrix.run_regressions && steps.regressions.outcome == 'failure' run: > @@ -286,7 +276,6 @@ jobs: # - uses: lhotari/action-upterm@v1 - # Unfortunately I can't get forked repository runs to post onto the original PR, so this is needed to alert for regressions - name: Fail on Regressions from Forked Repository if: always() && matrix.run_regressions && steps.regressions.outcome == 'failure' && github.event.pull_request.head.repo.full_name != 'NatLabRockies/EnergyPlus' run: | diff --git a/scripts/dev/gha_regressions.py b/scripts/dev/gha_regressions.py index 73ac7935220..1b5be298dd6 100644 --- a/scripts/dev/gha_regressions.py +++ b/scripts/dev/gha_regressions.py @@ -476,43 +476,6 @@ def generate_markdown_summary(self, bundle_root: Path): """ (bundle_root / "summary.md").write_text(content) - @staticmethod - def read_csv_to_columns(file_path: Path) -> dict[str, list[str | float]]: - columns = {} - with open(file_path, 'r', newline='') as file: - reader = csv.reader(file) - header = next(reader) # Read header row - for i, col_name in enumerate(header): - columns[col_name.strip()] = [] - for row in reader: - for i, value in enumerate(row): - value = value.strip() - variable = header[i].strip() - try: - v = float(value) - columns[variable].append(v) - except ValueError: # just take the string timestamp - columns[variable].append(value) - return columns - - @staticmethod - def generate_regression_plotter(bundle_root: Path, metadata_object: dict, results_object: dict, limit: bool): - metadata_string = "metadata = " + json.dumps(metadata_object, indent=4) + ';' - results_string = "results = " + json.dumps(results_object, indent=4) + ';' - limit_string = "" - if limit: - limit_string = r"""""" - template_file = Path(__file__).resolve().parent / 'regression_plotter.in.html' - content = template_file.read_text() - patches = { - '': metadata_string, - '': results_string, - '': limit_string - } - for key, value in patches.items(): - content = content.replace(key, value) - (bundle_root / 'regression_plotter.html').write_text(content) - def check_all_regressions(self, base_testfiles: Path, mod_testfiles: Path, bundle_root: Path) -> bool: any_diffs = False bundle_root.mkdir(exist_ok=True) @@ -606,12 +569,6 @@ def check_all_regressions(self, base_testfiles: Path, mod_testfiles: Path, bundl print(f"* Diffs by Type *:\n{json.dumps(self.diffs_by_type, indent=2, sort_keys=True)}\n") if any_diffs: self.generate_markdown_summary(bundle_root) - self.generate_regression_plotter( - bundle_root, metadata_object, results_object, hit_max_limit - ) - self.generate_regression_plotter( - bundle_root.parent, metadata_object, results_object, hit_max_limit - ) # print("::warning title=Regressions::Diffs Detected") return any_diffs diff --git a/scripts/dev/regression_plotter.in.html b/scripts/dev/regression_plotter.in.html deleted file mode 100644 index 337d681f9cd..00000000000 --- a/scripts/dev/regression_plotter.in.html +++ /dev/null @@ -1,241 +0,0 @@ - - - - EnergyPlus Regression Viewer - - - - - -
-

EnergyPlus Regression Quick Plotter

-
- - -
-
- - -
- - - - -
-
-
- - - \ No newline at end of file From e9c4c234be6f435ee1bde8053dd8c0eefb84a3c9 Mon Sep 17 00:00:00 2001 From: lymereJ Date: Mon, 23 Nov 2026 14:46:29 -0800 Subject: [PATCH 7/8] Recalc water outlet, use `SetComponentFlowRate` instead of setting nodes, clamp pump minimum flow, set `MinAvail` demand side of series plants and warn for parallel --- src/EnergyPlus/Plant/LoopSide.cc | 44 ++++ src/EnergyPlus/Plant/LoopSide.hh | 1 + src/EnergyPlus/Pumps.cc | 7 +- src/EnergyPlus/UnitarySystem.cc | 2 +- src/EnergyPlus/WaterCoils.cc | 10 +- tst/EnergyPlus/unit/UnitarySystem.unit.cc | 2 + tst/EnergyPlus/unit/WaterCoils.unit.cc | 260 ++++++++++++++++++++++ 7 files changed, 316 insertions(+), 10 deletions(-) diff --git a/src/EnergyPlus/Plant/LoopSide.cc b/src/EnergyPlus/Plant/LoopSide.cc index 977b2f36e00..e855ac6ec0c 100644 --- a/src/EnergyPlus/Plant/LoopSide.cc +++ b/src/EnergyPlus/Plant/LoopSide.cc @@ -1290,6 +1290,50 @@ namespace DataPlant { // equal to the inlet flow rate, according to flowlock logic. this->FlowLock = DataPlant::FlowLock::Locked; this->SimulateAllLoopSideBranches(state, ThisLoopSideFlow, FirstHVACIteration, LoopShutDownFlag); + + // Supply side flow exceeds the demand side request and the demand side has no bypass + if (this->plantLoc.loopSideNum == DataPlant::LoopSideLocation::Supply) { + auto &loop = state.dataPlnt->PlantLoop(this->plantLoc.loopNum); + auto &demandSide = loop.LoopSide(DataPlant::LoopSideLocation::Demand); + Real64 const excessFlow = ThisLoopSideFlow - demandSide.flowRequestFinal; + if (!demandSide.BypassExists && loop.CommonPipeType == DataPlant::CommonPipeType::No && + excessFlow > DataBranchAirLoopPlant::MassFlowTolerance) { + if (!demandSide.Splitter.Exists || demandSide.Splitter.TotalOutletNodes == 1) { + // Series demand side: pass the forced flow as MinAvail so components see the flow they receive + auto &outletNode = state.dataLoopNodes->Node(this->NodeNumOut); + outletNode.MassFlowRateMinAvail = max(outletNode.MassFlowRateMinAvail, min(ThisLoopSideFlow, outletNode.MassFlowRateMaxAvail)); + } else if (!state.dataGlobal->WarmupFlag) { + // Parallel demand side branches: forced flow is not passed to the components + if (demandSide.errIndex_ForcedDemandFlow == 0) { + ShowWarningError(state, + std::format("{}=\"{}\": the loop flow rate is greater than the flow rate requested by the demand side " + "components,", + DataPlant::loopTypeNames[static_cast(loop.TypeOfLoop)], + loop.Name)); + ShowContinueError(state, + "and the demand side has no bypass branch, so the excess flow is forced through the demand side branches."); + ShowContinueError(state, + "This typically happens when supply side equipment operates at a constant flow rate (e.g., Boiler:HotWater " + "with Boiler Flow Mode = ConstantFlow, or a pump with Pump Control Type = Continuous)."); + ShowContinueError(state, + "The results of the demand side components may be inaccurate (e.g., the loop demand may not match the " + "energy delivered by the demand side components). Add a bypass branch on the demand side of the loop."); + ShowContinueErrorTimeStamp(state, ""); + } + ShowRecurringWarningErrorAtEnd(state, + std::format("{}=\"{}\": the loop flow rate is greater than the flow rate requested by the " + "demand side components, continues...", + DataPlant::loopTypeNames[static_cast(loop.TypeOfLoop)], + loop.Name), + demandSide.errIndex_ForcedDemandFlow, + excessFlow, + excessFlow, + _, + "[kg/s]", + "[kg/s]"); + } + } + } } void HalfLoopData::ResolveParallelFlows(EnergyPlusData &state, diff --git a/src/EnergyPlus/Plant/LoopSide.hh b/src/EnergyPlus/Plant/LoopSide.hh index 9899aac0c36..bfd33f7fc1a 100644 --- a/src/EnergyPlus/Plant/LoopSide.hh +++ b/src/EnergyPlus/Plant/LoopSide.hh @@ -117,6 +117,7 @@ namespace DataPlant { int errIndex_LoadWasntDist; int errCount_LoadRemains; int errIndex_LoadRemains; + int errIndex_ForcedDemandFlow = 0; Real64 LoopSideInlet_TankTemp; Real64 LoopSideInlet_MdotCpDeltaT; Real64 LoopSideInlet_McpDTdt; diff --git a/src/EnergyPlus/Pumps.cc b/src/EnergyPlus/Pumps.cc index fe3593db6a3..1f3b102708e 100644 --- a/src/EnergyPlus/Pumps.cc +++ b/src/EnergyPlus/Pumps.cc @@ -1610,11 +1610,8 @@ void SetupPumpMinMaxFlows(EnergyPlusData &state, int const LoopNum, int const Pu PumpMassFlowRateMax = min(InletNodeMax, PumpOverridableMaxLimit * PumpSchedFraction); // Check for conflicts (MaxAvail < MinAvail) - if (PumpMassFlowRateMin > PumpMassFlowRateMax) { // the demand side wants to operate outside of the pump range - // shut the pump (and the loop) down - PumpMassFlowRateMin = 0.0; - PumpMassFlowRateMax = 0.0; - // Let the user know that his input file is overconstrained + if (PumpMassFlowRateMin > PumpMassFlowRateMax) { // the demand side cannot accept the pump's minimum flow + PumpMassFlowRateMin = PumpMassFlowRateMax; } switch (thisPump.pumpType) { diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 471e7d16d76..8e01cd40a53 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -12349,7 +12349,7 @@ namespace UnitarySystems { } else { mdot = this->HeatCoilWaterFlowRatio * this->MaxHeatCoilFluidFlow; } - state.dataLoopNodes->Node(this->HeatCoilFluidInletNode).MassFlowRate = mdot; + PlantUtilities::SetComponentFlowRate(state, mdot, this->HeatCoilFluidInletNode, this->HeatCoilFluidOutletNodeNum, this->HeatCoilPlantLoc); WaterCoils::SimulateWaterCoilComponents( state, CompName, FirstHVACIteration, this->m_HeatingCoilIndex, QActual, this->m_FanOpMode, PartLoadRatio); } break; diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index 1c796e1b80a..1fe827090b7 100644 --- a/src/EnergyPlus/WaterCoils.cc +++ b/src/EnergyPlus/WaterCoils.cc @@ -2873,10 +2873,12 @@ void CalcSimpleHeatingCoil(EnergyPlusData &state, if (fanOp == HVAC::FanOp::Cycling) { HeatingCoilLoad *= PartLoadRatio; - if (CapacitanceWater > 0 && - state.dataPlnt->PlantLoop(waterCoil.WaterPlantLoc.loopNum).LoopSide(DataPlant::LoopSideLocation::Supply).FlowRequest > 0) { - TempWaterOut = TempWaterIn - HeatingCoilLoad / CapacitanceWater; - } + } + + // Water outlet state based on the actual water flow rate through the coil + if (HeatingCoilLoad != 0.0 && waterCoil.InletWaterMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { + TempWaterOut = TempWaterIn - HeatingCoilLoad / (Cp * waterCoil.InletWaterMassFlowRate); + waterCoil.OutletWaterEnthalpy = waterCoil.InletWaterEnthalpy - HeatingCoilLoad / waterCoil.InletWaterMassFlowRate; } // Set the outlet conditions diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index 921fd5a32ea..bd36a24b8ad 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -8457,6 +8457,8 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_CalcUnitaryHeatingSystem) thisSys.m_HeatingCoilName = state->dataWaterCoils->WaterCoil(1).Name; thisSys.HeatCoilFluidInletNode = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; thisSys.HeatCoilFluidOutletNodeNum = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; + thisSys.HeatCoilPlantLoc = state->dataWaterCoils->WaterCoil(1).WaterPlantLoc; + PlantUtilities::InitComponentNodes(*state, 0.0, HotWaterMassFlowRate, thisSys.HeatCoilFluidInletNode, thisSys.HeatCoilFluidOutletNodeNum); state->dataGlobal->DoingSizing = true; state->dataWaterCoils->WaterCoil(1).TotWaterHeatingCoilRate = 0.0; diff --git a/tst/EnergyPlus/unit/WaterCoils.unit.cc b/tst/EnergyPlus/unit/WaterCoils.unit.cc index 4c563ca8f00..f16c86b1e32 100644 --- a/tst/EnergyPlus/unit/WaterCoils.unit.cc +++ b/tst/EnergyPlus/unit/WaterCoils.unit.cc @@ -67,6 +67,7 @@ #include "Fixtures/EnergyPlusFixture.hh" // EnergyPlus Headers +#include #include #include #include @@ -88,8 +89,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -1752,3 +1755,260 @@ TEST_F(WaterCoilsTest, FanCoilCoolingWaterFlowTest) // Expect final design water flow rate to equal the user-specified water flow rate from the ZoneHVAC:FourPipeFanCoil object EXPECT_EQ(state->dataWaterCoils->WaterCoil(2).MaxWaterVolFlowRate, 0.0002); } + +namespace { +// Single zone with a cycling fan AirLoopHVAC:UnitarySystem and a Coil:Heating:Water served by a plant loop with a ConstantFlow +// boiler and no demand side bypass (the coil is the only demand side component) +std::string hotWaterLoopWithoutDemandBypassIdf(bool const continuousPump) +{ + std::vector lines = { + " Timestep,6;", + " Building,Building,0,Suburbs,0.04,0.4,FullInteriorAndExterior,25,6;", + " GlobalGeometryRules,UpperLeftCorner,Counterclockwise,World;", + " SimulationControl,No,No,No,Yes,No;", + " Site:Location,Rochester,43.90,-92.50,-6.00,398.00;", + " SizingPeriod:DesignDay,", + " Rochester Htg 99.6% Condns DB, !- Name", + " 1, !- Month", + " 21, !- Day of Month", + " WinterDesignDay, !- Day Type", + " -26.2, !- Maximum Dry-Bulb Temperature {C}", + " 0.0, !- Daily Dry-Bulb Temperature Range {deltaC}", + " DefaultMultipliers, !- Dry-Bulb Temperature Range Modifier Type", + " , !- Dry-Bulb Temperature Range Modifier Day Schedule Name", + " Wetbulb, !- Humidity Condition Type", + " -26.2, !- Wetbulb or DewPoint at Maximum Dry-Bulb {C}", + " , !- Humidity Condition Day Schedule Name", + " , !- Humidity Ratio at Maximum Dry-Bulb {kgWater/kgDryAir}", + " , !- Enthalpy at Maximum Dry-Bulb {J/kg}", + " , !- Daily Wet-Bulb Temperature Range {deltaC}", + " 96634., !- Barometric Pressure {Pa}", + " 5.7, !- Wind Speed {m/s}", + " 310, !- Wind Direction {deg}", + " No, !- Rain Indicator", + " No, !- Snow Indicator", + " No, !- Daylight Saving Time Indicator", + " ASHRAEClearSky, !- Solar Model Indicator", + " , !- Beam Solar Day Schedule Name", + " , !- Diffuse Solar Day Schedule Name", + " , !- ASHRAE Clear Sky Optical Depth for Beam Irradiance (taub) {dimensionless}", + " , !- ASHRAE Clear Sky Optical Depth for Diffuse Irradiance (taud) {dimensionless}", + " 0.00; !- Sky Clearness", + " ScheduleTypeLimits,Any Number;", + " Schedule:Constant,always_avail,Any Number,1;", + " Schedule:Constant,fan_cycle,Any Number,0;", + " Schedule:Constant,zone_control_type,Any Number,4;", + " Schedule:Constant,heating_setpoint,Any Number,21;", + " Schedule:Constant,cooling_setpoint,Any Number,26;", + " Schedule:Constant,hw_loop_setpoint,Any Number,51.7;", + " Material:NoMass,Insulation,MediumRough,2.0;", + " Construction,Envelope,Insulation;", + " Zone,Zone1;", + " BuildingSurface:Detailed,Floor,Floor,Envelope,Zone1,,Adiabatic,,NoSun,NoWind,,4,", + " 10,0,0, 0,0,0, 0,10,0, 10,10,0;", + " BuildingSurface:Detailed,Roof,Roof,Envelope,Zone1,,Outdoors,,SunExposed,WindExposed,,4,", + " 0,10,3, 0,0,3, 10,0,3, 10,10,3;", + " BuildingSurface:Detailed,Wall South,Wall,Envelope,Zone1,,Outdoors,,SunExposed,WindExposed,,4,", + " 0,0,3, 0,0,0, 10,0,0, 10,0,3;", + " BuildingSurface:Detailed,Wall East,Wall,Envelope,Zone1,,Outdoors,,SunExposed,WindExposed,,4,", + " 10,0,3, 10,0,0, 10,10,0, 10,10,3;", + " BuildingSurface:Detailed,Wall North,Wall,Envelope,Zone1,,Outdoors,,SunExposed,WindExposed,,4,", + " 10,10,3, 10,10,0, 0,10,0, 0,10,3;", + " BuildingSurface:Detailed,Wall West,Wall,Envelope,Zone1,,Outdoors,,SunExposed,WindExposed,,4,", + " 0,10,3, 0,10,0, 0,0,0, 0,0,3;", + " ZoneControl:Thermostat,Zone1 Thermostat,Zone1,zone_control_type,,ThermostatSetpoint:DualSetpoint,Zone1 Setpoints;", + " ThermostatSetpoint:DualSetpoint,Zone1 Setpoints,heating_setpoint,cooling_setpoint;", + " ZoneHVAC:EquipmentConnections,Zone1,Zone1 Equipment,Zone1 Inlet Node,,Zone1 Air Node,Zone1 Outlet Node;", + " ZoneHVAC:EquipmentList,Zone1 Equipment,SequentialLoad,ZoneHVAC:AirDistributionUnit,Zone1 ADU,1,1,,;", + " ZoneHVAC:AirDistributionUnit,Zone1 ADU,Zone1 Inlet Node,AirTerminal:SingleDuct:ConstantVolume:NoReheat,Zone1 Terminal;", + " AirTerminal:SingleDuct:ConstantVolume:NoReheat,Zone1 Terminal,always_avail,Zone1 Terminal Inlet Node,Zone1 Inlet Node,0.326847;", + " AirLoopHVAC:SupplyPath,Supply Path,Zone Equipment Inlet Node,AirLoopHVAC:ZoneSplitter,Zone Splitter;", + " AirLoopHVAC:ZoneSplitter,Zone Splitter,Zone Equipment Inlet Node,Zone1 Terminal Inlet Node;", + " AirLoopHVAC:ReturnPath,Return Path,Return Air Mixer Outlet,AirLoopHVAC:ZoneMixer,Zone Mixer;", + " AirLoopHVAC:ZoneMixer,Zone Mixer,Return Air Mixer Outlet,Zone1 Outlet Node;", + " AirLoopHVAC,Air Loop,,,0.326847,Air Loop Branches,,Air Loop Inlet Node,Return Air Mixer Outlet,Zone Equipment Inlet Node,Air Loop Outlet " + "Node;", + " BranchList,Air Loop Branches,Air Loop Main Branch;", + " Branch,Air Loop Main Branch,,AirLoopHVAC:UnitarySystem,Unitary,Air Loop Inlet Node,Air Loop Outlet Node;", + " AirLoopHVAC:UnitarySystem,", + " Unitary, !- Name", + " Load, !- Control Type", + " Zone1, !- Controlling Zone or Thermostat Location", + " None, !- Dehumidification Control Type", + " always_avail, !- Availability Schedule Name", + " Air Loop Inlet Node, !- Air Inlet Node Name", + " Air Loop Outlet Node, !- Air Outlet Node Name", + " Fan:SystemModel, !- Supply Fan Object Type", + " Supply Fan, !- Supply Fan Name", + " BlowThrough, !- Fan Placement", + " fan_cycle, !- Supply Air Fan Operating Mode Schedule Name", + " Coil:Heating:Water, !- Heating Coil Object Type", + " HW Coil, !- Heating Coil Name", + " , !- DX Heating Coil Sizing Ratio", + " , !- Cooling Coil Object Type", + " , !- Cooling Coil Name", + " , !- Use DOAS DX Cooling Coil", + " , !- Minimum Supply Air Temperature {C}", + " , !- Latent Load Control", + " , !- Supplemental Heating Coil Object Type", + " , !- Supplemental Heating Coil Name", + " None, !- Cooling Supply Air Flow Rate Method", + " , !- Cooling Supply Air Flow Rate {m3/s}", + " , !- Cooling Supply Air Flow Rate Per Floor Area {m3/s-m2}", + " , !- Cooling Fraction of Autosized Cooling Supply Air Flow Rate", + " , !- Cooling Supply Air Flow Rate Per Unit of Capacity {m3/s-W}", + " SupplyAirFlowRate, !- Heating Supply Air Flow Rate Method", + " 0.326847, !- Heating Supply Air Flow Rate {m3/s}", + " , !- Heating Supply Air Flow Rate Per Floor Area {m3/s-m2}", + " , !- Heating Fraction of Autosized Heating Supply Air Flow Rate", + " , !- Heating Supply Air Flow Rate Per Unit of Capacity {m3/s-W}", + " SupplyAirFlowRate, !- No Load Supply Air Flow Rate Method", + " 0, !- No Load Supply Air Flow Rate {m3/s}", + " , !- No Load Supply Air Flow Rate Per Floor Area {m3/s-m2}", + " , !- No Load Fraction of Autosized Cooling Supply Air Flow Rate", + " , !- No Load Fraction of Autosized Heating Supply Air Flow Rate", + " , !- No Load Supply Air Flow Rate Per Unit of Capacity During Cooling Operation {m3/s-W}", + " , !- No Load Supply Air Flow Rate Per Unit of Capacity During Heating Operation {m3/s-W}", + " , !- No Load Supply Air Flow Rate Control Set To Low Speed", + " 50; !- Maximum Supply Air Temperature {C}", + " Fan:SystemModel,Supply Fan,always_avail,Air Loop Inlet Node,HW Coil Air Inlet " + "Node,0.326847,Discrete,1,500,0.85,1,200,PowerPerFlow,805.1744,;", + " Coil:Heating:Water,", + " HW Coil, !- Name", + " always_avail, !- Availability Schedule Name", + " 1478.48, !- U-Factor Times Area Value {W/K}", + " 0.000129127, !- Maximum Water Flow Rate {m3/s}", + " HW Coil Water Inlet Node, !- Water Inlet Node Name", + " HW Coil Water Outlet Node, !- Water Outlet Node Name", + " HW Coil Air Inlet Node, !- Air Inlet Node Name", + " Air Loop Outlet Node, !- Air Outlet Node Name", + " UFactorTimesAreaAndDesignWaterFlowRate; !- Performance Input Method", + " PlantLoop,", + " HW Loop, !- Name", + " Water, !- Fluid Type", + " , !- User Defined Fluid Type", + " HW Loop Operation, !- Plant Equipment Operation Scheme Name", + " HW Supply Outlet Node, !- Loop Temperature Setpoint Node Name", + " 100, !- Maximum Loop Temperature {C}", + " 0, !- Minimum Loop Temperature {C}", + " 0.000129127, !- Maximum Loop Flow Rate {m3/s}", + " 0, !- Minimum Loop Flow Rate {m3/s}", + " autocalculate, !- Plant Loop Volume {m3}", + " HW Supply Inlet Node, !- Plant Side Inlet Node Name", + " HW Supply Outlet Node, !- Plant Side Outlet Node Name", + " HW Supply Branches, !- Plant Side Branch List Name", + " HW Supply Connectors, !- Plant Side Connector List Name", + " HW Demand Inlet Node, !- Demand Side Inlet Node Name", + " HW Demand Outlet Node, !- Demand Side Outlet Node Name", + " HW Demand Branches, !- Demand Side Branch List Name", + " HW Demand Connectors, !- Demand Side Connector List Name", + " SequentialLoad; !- Load Distribution Scheme", + " SetpointManager:Scheduled,HW Loop Setpoint Manager,Temperature,hw_loop_setpoint,HW Supply Outlet Node;", + " PlantEquipmentOperationSchemes,HW Loop Operation,PlantEquipmentOperation:HeatingLoad,HW Heating Operation,always_avail;", + " PlantEquipmentOperation:HeatingLoad,HW Heating Operation,0,1E+15,HW Equipment;", + " PlantEquipmentList,HW Equipment,Boiler:HotWater,Boiler;", + " BranchList,HW Supply Branches,HW Pump Branch,HW Boiler Branch,HW Supply Bypass Branch,HW Supply Outlet Branch;", + " ConnectorList,HW Supply Connectors,Connector:Splitter,HW Supply Splitter,Connector:Mixer,HW Supply Mixer;", + " Connector:Splitter,HW Supply Splitter,HW Pump Branch,HW Boiler Branch,HW Supply Bypass Branch;", + " Connector:Mixer,HW Supply Mixer,HW Supply Outlet Branch,HW Boiler Branch,HW Supply Bypass Branch;", + " Branch,HW Pump Branch,,Pump:VariableSpeed,HW Pump,HW Supply Inlet Node,HW Pump Outlet Node;", + " Branch,HW Boiler Branch,,Boiler:HotWater,Boiler,HW Boiler Inlet Node,HW Boiler Outlet Node;", + " Branch,HW Supply Bypass Branch,,Pipe:Adiabatic,HW Supply Bypass Pipe,HW Supply Bypass Inlet Node,HW Supply Bypass Outlet Node;", + " Branch,HW Supply Outlet Branch,,Pipe:Adiabatic,HW Supply Outlet Pipe,HW Supply Outlet Pipe Inlet Node,HW Supply Outlet Node;", + " Pipe:Adiabatic,HW Supply Bypass Pipe,HW Supply Bypass Inlet Node,HW Supply Bypass Outlet Node;", + " Pipe:Adiabatic,HW Supply Outlet Pipe,HW Supply Outlet Pipe Inlet Node,HW Supply Outlet Node;", + " BranchList,HW Demand Branches,HW Demand Inlet Branch,HW Coil Branch,HW Demand Outlet Branch;", + " ConnectorList,HW Demand Connectors,Connector:Splitter,HW Demand Splitter,Connector:Mixer,HW Demand Mixer;", + " Connector:Splitter,HW Demand Splitter,HW Demand Inlet Branch,HW Coil Branch;", + " Connector:Mixer,HW Demand Mixer,HW Demand Outlet Branch,HW Coil Branch;", + " Branch,HW Demand Inlet Branch,,Pipe:Adiabatic,HW Demand Inlet Pipe,HW Demand Inlet Node,HW Demand Inlet Pipe Outlet Node;", + " Branch,HW Coil Branch,,Coil:Heating:Water,HW Coil,HW Coil Water Inlet Node,HW Coil Water Outlet Node;", + " Branch,HW Demand Outlet Branch,,Pipe:Adiabatic,HW Demand Outlet Pipe,HW Demand Outlet Pipe Inlet Node,HW Demand Outlet Node;", + " Pipe:Adiabatic,HW Demand Inlet Pipe,HW Demand Inlet Node,HW Demand Inlet Pipe Outlet Node;", + " Pipe:Adiabatic,HW Demand Outlet Pipe,HW Demand Outlet Pipe Inlet Node,HW Demand Outlet Node;", + " Boiler:HotWater,", + " Boiler, !- Name", + " NaturalGas, !- Fuel Type", + " 10569.2, !- Nominal Capacity {W}", + " 1, !- Nominal Thermal Efficiency", + " , !- Efficiency Curve Temperature Evaluation Variable", + " , !- Normalized Boiler Efficiency Curve Name", + " 0.000129127, !- Design Water Flow Rate {m3/s}", + " , !- Minimum Part Load Ratio", + " 1, !- Maximum Part Load Ratio", + " 1, !- Optimum Part Load Ratio", + " HW Boiler Inlet Node, !- Boiler Water Inlet Node Name", + " HW Boiler Outlet Node, !- Boiler Water Outlet Node Name", + " 99.9, !- Water Outlet Upper Temperature Limit {C}", + " ConstantFlow; !- Boiler Flow Mode", + " Pump:VariableSpeed,", + " HW Pump, !- Name", + " HW Supply Inlet Node, !- Inlet Node Name", + " HW Pump Outlet Node, !- Outlet Node Name", + " 0.000129127, !- Design Maximum Flow Rate {m3/s}", + " 179352, !- Design Pump Head {Pa}", + " 33, !- Design Power Consumption {W}", + " 0.9, !- Motor Efficiency", + " 0, !- Fraction of Motor Inefficiencies to Fluid Stream", + " 0, !- Coefficient 1 of the Part Load Performance Curve", + " 1, !- Coefficient 2 of the Part Load Performance Curve", + " 0, !- Coefficient 3 of the Part Load Performance Curve", + " 0, !- Coefficient 4 of the Part Load Performance Curve", + }; + if (continuousPump) { + lines.insert(lines.end(), + { + " autosize, !- Design Minimum Flow Rate {m3/s}", + " Continuous, !- Pump Control Type", + " ,,,,,,,,,,, !- Pump Flow Rate Schedule Name to Skin Loss Radiative Fraction", + " PowerPerFlowPerPressure, !- Design Power Sizing Method", + " 348701.1, !- Design Electric Power per Unit Flow Rate {W/(m3/s)}", + " 1.282051282, !- Design Shaft Power per Unit Flow Rate per Unit Head {W/((m3/s)-Pa)}", + " 1; !- Design Minimum Flow Rate Fraction", + }); + } else { + lines.insert(lines.end(), + { + " 0, !- Design Minimum Flow Rate {m3/s}", + " Intermittent; !- Pump Control Type", + }); + } + std::string idf; + for (auto const &line : lines) { + idf += std::string(line) + "\n"; + } + return idf; +} + +void checkHotWaterCoilEnergyBalance(EnergyPlus::EnergyPlusData &state) +{ + auto const &coil = state.dataWaterCoils->WaterCoil(1); + auto const &boiler = state.dataBoilers->Boiler[0]; + Real64 const coilWaterFlow = state.dataLoopNodes->Node(coil.WaterInletNodeNum).MassFlowRate; + Real64 const cp = coil.WaterPlantLoc.loop->glycol->getSpecificHeat(state, coil.InletWaterTemp, "checkHotWaterCoilEnergyBalance"); + Real64 const coilWaterSideRate = coilWaterFlow * cp * (coil.InletWaterTemp - coil.OutletWaterTemp); + + // the coil is cycling and the loop flow is forced by the boiler (or pump): the coil receives the loop flow + EXPECT_GT(coil.TotWaterHeatingCoilRate, 1000.0); + EXPECT_NEAR(boiler.DesMassFlowRate, coilWaterFlow, 1.0e-6); + // heat removed from the water matches the heat delivered to the air and the heat provided by the boiler + EXPECT_NEAR(coil.TotWaterHeatingCoilRate, coilWaterSideRate, 0.005 * coil.TotWaterHeatingCoilRate); + EXPECT_NEAR(coil.TotWaterHeatingCoilRate, boiler.BoilerLoad, 0.02 * coil.TotWaterHeatingCoilRate); +} +} // namespace + +TEST_F(EnergyPlusFixture, WaterCoils_CyclingHeatingCoil_ConstantFlowBoilerWithoutDemandBypass) +{ + ASSERT_TRUE(process_idf(hotWaterLoopWithoutDemandBypassIdf(false))); + SimulationManager::ManageSimulation(*state); + checkHotWaterCoilEnergyBalance(*state); +} + +TEST_F(EnergyPlusFixture, WaterCoils_CyclingHeatingCoil_ContinuousPumpWithoutDemandBypass) +{ + // pump minimum flow rate (5.05 C density) exceeds the coil maximum flow rate set by the unitary system (60 C density) + ASSERT_TRUE(process_idf(hotWaterLoopWithoutDemandBypassIdf(true))); + SimulationManager::ManageSimulation(*state); + EXPECT_GT(state->dataLoopNodes->Node(state->dataPumps->PumpEquip(1).OutletNodeNum).MassFlowRate, 0.0); + checkHotWaterCoilEnergyBalance(*state); +} From 2f9290e46ff2222a91840050630743df0584b736 Mon Sep 17 00:00:00 2001 From: lymereJ Date: Mon, 23 Nov 2026 15:27:04 -0800 Subject: [PATCH 8/8] Fix CI failure --- src/EnergyPlus/WaterCoils.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index 1fe827090b7..3e7a96c9d98 100644 --- a/src/EnergyPlus/WaterCoils.cc +++ b/src/EnergyPlus/WaterCoils.cc @@ -2793,7 +2793,7 @@ void CalcSimpleHeatingCoil(EnergyPlusData &state, Real64 E1; Real64 E2; Real64 Effec; - Real64 Cp; + Real64 Cp = 0.0; auto &waterCoil = state.dataWaterCoils->WaterCoil(CoilNum); UA = waterCoil.UACoilVariable;