@@ -8,10 +8,8 @@ model PartialEffectivenessNTU
88 Q2_flow = - Q1_flow,
99 mWat1_flow = 0 ,
1010 mWat2_flow = 0 );
11- import con = Buildings.Fluid.Types.HeatExchangerConfiguration;
12- import flo = Buildings.Fluid.Types.HeatExchangerFlowRegime;
1311
14- parameter con configuration "Heat exchanger configuration"
12+ parameter Buildings.Fluid.Types.HeatExchangerConfiguration configuration "Heat exchanger configuration"
1513 annotation (Evaluate=true);
1614
1715 constant Boolean use_dynamicFlowRegime = false
@@ -85,9 +83,9 @@ protected
8583 "Nominal temperature at port b1" ;
8684 parameter Modelica.Units.SI.Temperature T_b2_nominal(fixed= false )
8785 "Nominal temperature at port b2" ;
88- parameter flo flowRegime_nominal(fixed= false )
86+ parameter Buildings.Fluid.Types.HeatExchangerFlowRegime flowRegime_nominal(fixed= false )
8987 "Heat exchanger flow regime at nominal flow rates" ;
90- flo flowRegime(fixed= false , start= flowRegime_nominal)
88+ Buildings.Fluid.Types.HeatExchangerFlowRegime flowRegime(fixed= false , start= flowRegime_nominal)
9189 "Heat exchanger flow regime" ;
9290initial equation
9391 assert (m1_flow_nominal > Modelica.Constants.eps,
@@ -131,22 +129,22 @@ initial equation
131129 "\n CMin_flow_nominal = " + String (CMin_flow_nominal) +
132130 "\n CMax_flow_nominal = " + String (CMax_flow_nominal));
133131 // Assign the flow regime for the given heat exchanger configuration and capacity flow rates
134- if (configuration == con .CrossFlowStream1MixedStream2Unmixed) then
135- flowRegime_nominal = if (C1_flow_nominal < C2_flow_nominal) then flo .CrossFlowCMinMixedCMaxUnmixed
136- else flo .CrossFlowCMinUnmixedCMaxMixed;
137- elseif (configuration == con .CrossFlowStream1UnmixedStream2Mixed) then
138- flowRegime_nominal = if (C1_flow_nominal < C2_flow_nominal) then flo .CrossFlowCMinUnmixedCMaxMixed
139- else flo .CrossFlowCMinMixedCMaxUnmixed;
140- elseif (configuration == con .ParallelFlow) then
141- flowRegime_nominal = flo .ParallelFlow;
142- elseif (configuration == con .CounterFlow) then
143- flowRegime_nominal = flo .CounterFlow;
144- elseif (configuration == con .CrossFlowUnmixed) then
145- flowRegime_nominal = flo .CrossFlowUnmixed;
132+ if (configuration == Buildings.Fluid.Types.HeatExchangerConfiguration .CrossFlowStream1MixedStream2Unmixed) then
133+ flowRegime_nominal = if (C1_flow_nominal < C2_flow_nominal) then Buildings.Fluid.Types.HeatExchangerFlowRegime .CrossFlowCMinMixedCMaxUnmixed
134+ else Buildings.Fluid.Types.HeatExchangerFlowRegime .CrossFlowCMinUnmixedCMaxMixed;
135+ elseif (configuration == Buildings.Fluid.Types.HeatExchangerConfiguration .CrossFlowStream1UnmixedStream2Mixed) then
136+ flowRegime_nominal = if (C1_flow_nominal < C2_flow_nominal) then Buildings.Fluid.Types.HeatExchangerFlowRegime .CrossFlowCMinUnmixedCMaxMixed
137+ else Buildings.Fluid.Types.HeatExchangerFlowRegime .CrossFlowCMinMixedCMaxUnmixed;
138+ elseif (configuration == Buildings.Fluid.Types.HeatExchangerConfiguration .ParallelFlow) then
139+ flowRegime_nominal = Buildings.Fluid.Types.HeatExchangerFlowRegime .ParallelFlow;
140+ elseif (configuration == Buildings.Fluid.Types.HeatExchangerConfiguration .CounterFlow) then
141+ flowRegime_nominal = Buildings.Fluid.Types.HeatExchangerFlowRegime .CounterFlow;
142+ elseif (configuration == Buildings.Fluid.Types.HeatExchangerConfiguration .CrossFlowUnmixed) then
143+ flowRegime_nominal = Buildings.Fluid.Types.HeatExchangerFlowRegime .CrossFlowUnmixed;
146144 else
147145 // Invalid flow regime. Assign a value to flowRegime_nominal, and stop with an assert
148- flowRegime_nominal = flo .CrossFlowUnmixed;
149- assert (configuration > = con. ParallelFlow and configuration < = con .CrossFlowStream1UnmixedStream2Mixed,
146+ flowRegime_nominal = Buildings.Fluid.Types.HeatExchangerFlowRegime .CrossFlowUnmixed;
147+ assert (configuration > = Buildings.Fluid.Types.HeatExchangerConfiguration. ParallelFlow and configuration < = Buildings.Fluid.Types.HeatExchangerConfiguration .CrossFlowStream1UnmixedStream2Mixed,
150148 "Invalid heat exchanger configuration." );
151149 end if ;
152150 // The equation sorter of Dymola 7.3 does not guarantee that the above assert is tested prior to the
@@ -161,19 +159,19 @@ initial equation
161159equation
162160 // Assign the flow regime for the given heat exchanger configuration and capacity flow rates
163161 if use_dynamicFlowRegime then
164- if (configuration == con .ParallelFlow) then
165- flowRegime = if (C1_flow* C2_flow > = 0 ) then flo. ParallelFlow else flo .CounterFlow;
166- elseif (configuration == con .CounterFlow) then
167- flowRegime = if (C1_flow* C2_flow > = 0 ) then flo. CounterFlow else flo .ParallelFlow;
168- elseif (configuration == con .CrossFlowUnmixed) then
169- flowRegime = flo .CrossFlowUnmixed;
170- elseif (configuration == con .CrossFlowStream1MixedStream2Unmixed) then
171- flowRegime = if (C1_flow < C2_flow) then flo .CrossFlowCMinMixedCMaxUnmixed
172- else flo .CrossFlowCMinUnmixedCMaxMixed;
162+ if (configuration == Buildings.Fluid.Types.HeatExchangerConfiguration .ParallelFlow) then
163+ flowRegime = if (C1_flow* C2_flow > = 0 ) then Buildings.Fluid.Types.HeatExchangerFlowRegime. ParallelFlow else Buildings.Fluid.Types.HeatExchangerFlowRegime .CounterFlow;
164+ elseif (configuration == Buildings.Fluid.Types.HeatExchangerConfiguration .CounterFlow) then
165+ flowRegime = if (C1_flow* C2_flow > = 0 ) then Buildings.Fluid.Types.HeatExchangerFlowRegime. CounterFlow else Buildings.Fluid.Types.HeatExchangerFlowRegime .ParallelFlow;
166+ elseif (configuration == Buildings.Fluid.Types.HeatExchangerConfiguration .CrossFlowUnmixed) then
167+ flowRegime = Buildings.Fluid.Types.HeatExchangerFlowRegime .CrossFlowUnmixed;
168+ elseif (configuration == Buildings.Fluid.Types.HeatExchangerConfiguration .CrossFlowStream1MixedStream2Unmixed) then
169+ flowRegime = if (C1_flow < C2_flow) then Buildings.Fluid.Types.HeatExchangerFlowRegime .CrossFlowCMinMixedCMaxUnmixed
170+ else Buildings.Fluid.Types.HeatExchangerFlowRegime .CrossFlowCMinUnmixedCMaxMixed;
173171 else
174- // have ( configuration == con .CrossFlowStream1UnmixedStream2Mixed)
175- flowRegime = if (C1_flow < C2_flow) then flo .CrossFlowCMinUnmixedCMaxMixed
176- else flo .CrossFlowCMinMixedCMaxUnmixed;
172+ // have ( configuration == Buildings.Fluid.Types.HeatExchangerConfiguration .CrossFlowStream1UnmixedStream2Mixed)
173+ flowRegime = if (C1_flow < C2_flow) then Buildings.Fluid.Types.HeatExchangerFlowRegime .CrossFlowCMinUnmixedCMaxMixed
174+ else Buildings.Fluid.Types.HeatExchangerFlowRegime .CrossFlowCMinMixedCMaxUnmixed;
177175 end if ;
178176 else
179177 flowRegime = flowRegime_nominal;
@@ -253,6 +251,12 @@ for <code>UA</code>.
253251</html>" , revisions="<html>
254252<ul>
255253<li>
254+ February 7, 2025, by Jelger Jansen:<br/>
255+ Removed <code>import</code> statement.
256+ This is for
257+ <a href=\" https://github.com/ibpsa/modelica-ibpsa/issues/1961\">IBPSA, #1961</a>.
258+ </li>
259+ <li>
256260February 3, 2023, by Jianjun Hu:<br/>
257261Added <code>noEvent()</code> in the assertion function to avoid Optimica to not converge.<br/>
258262This is for
0 commit comments