From 55dea13d977a66f75ba50cb2be792d0aa9fbf3ca Mon Sep 17 00:00:00 2001 From: Michael Wetter Date: Fri, 27 May 2022 03:23:32 -0700 Subject: [PATCH] Patch to avoid division by zero if nEle=1 (#3048) This only affects the special case of nEle=1. Results are not affected by this change --- Buildings/Fluid/HeatExchangers/DryCoilCounterFlow.mo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Buildings/Fluid/HeatExchangers/DryCoilCounterFlow.mo b/Buildings/Fluid/HeatExchangers/DryCoilCounterFlow.mo index 4262e378a5d..3196c2e98ad 100644 --- a/Buildings/Fluid/HeatExchangers/DryCoilCounterFlow.mo +++ b/Buildings/Fluid/HeatExchangers/DryCoilCounterFlow.mo @@ -45,8 +45,8 @@ model DryCoilCounterFlow "Set to false to make air-side hA independent of temperature" annotation (Dialog(tab="Heat transfer")); - parameter Modelica.Units.SI.ThermalConductance GDif=1E-2*UA_nominal/(nEle - 1) - "Thermal conductance to approximate diffusion (which improves model at near-zero flow rates" + parameter Modelica.Units.SI.ThermalConductance GDif=1E-2*UA_nominal/max(1, (nEle - 1)) + "Thermal conductance to approximate diffusion (which improves model at near-zero flow rates)" annotation (Dialog(tab="Experimental")); Modelica.Units.SI.HeatFlowRate Q1_flow=sum(ele[i].Q1_flow for i in 1:nEle) "Heat transferred from solid into medium 1";