Skip to content

Commit

Permalink
Corrected boundary condition and initial conditions for #2488 (#2490)
Browse files Browse the repository at this point in the history
* Corrected boundary condition and initial conditions for #2488

* Updated reference results due to #2488
  • Loading branch information
mwetter authored May 18, 2021
1 parent 0d56d83 commit 1b16c3d
Show file tree
Hide file tree
Showing 15 changed files with 296 additions and 147 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ partial model PartialPlant
transformation(
extent={{10,-10},{-10,10}},
origin={80,-4})));
Buildings.Fluid.Sources.MassFlowSource_T sou1(
Fluid.Sources.Boundary_pT sou1(
p=MediumCW.p_default + 45E3,
use_T_in=true,
redeclare package Medium = MediumCW,
m_flow=mCW_flow_nominal,
T=298.15)
"Source on medium 1 side"
annotation (Placement(transformation(extent={{-60,-14},{-40,6}})));
Expand Down Expand Up @@ -83,6 +83,14 @@ Buildings.Applications.DataCenters.ChillerCooled.Equipment.Validation</a>.
</html>", revisions="<html>
<ul>
<li>
May 13, 2021, by Michael Wetter:<br/>
Changed boundary condition model to prescribed pressure rather than prescribed mass flow rate.
Prescribing the mass flow rate caused
unreasonably large pressure drop because the mass flow rate was forced through a closed valve.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/2488\">#2488</a>.
</li>
<li>
September 11, 2017, by Michael Wetter:<br/>
Corrected wrong use of replaceable model.<br/>
This is for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ model CoolingCoilHumidifyingHeating_OpenLoop
allowFlowReversal1=true,
allowFlowReversal2=true,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
yValve_start=0,
yValve_start=0.2,
tauEleHea=1,
tauHum=1,
m1_flow_nominal=m1_flow_nominal,
Expand Down Expand Up @@ -89,6 +89,13 @@ for different inlet conditions.
</html>", revisions="<html>
<ul>
<li>
May 13, 2021, by Michael Wetter:<br/>
Set start value of valve to avoid unreasonably large pressure drop due to prescribed mass flow
rate that was forced through a closed valve.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/2488\">#2488</a>.
</li>
<li>
April 11, 2017, by Yangyang Fu:<br/>
First implementation.
</li>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
within Buildings.Applications.DataCenters.ChillerCooled.Equipment.Validation;
model ElectricChillerParallel "Model that test electric chiller parallel"
extends Modelica.Icons.Example;
extends Buildings.Fluid.Chillers.Examples.BaseClasses.PartialElectric(
P_nominal=-per1.QEva_flow_nominal/per1.COP_nominal,
mEva_flow_nominal=per1.mEva_flow_nominal,
mCon_flow_nominal=per1.mCon_flow_nominal,
sou1(nPorts=1, m_flow=2*mCon_flow_nominal),
sou2(nPorts=1, m_flow=2*mEva_flow_nominal));

package Medium1 = Buildings.Media.Water "Medium model";
package Medium2 = Buildings.Media.Water "Medium model";

parameter Modelica.SIunits.Power P_nominal = -per1.QEva_flow_nominal/per1.COP_nominal
"Nominal compressor power (at y=1)";
parameter Modelica.SIunits.TemperatureDifference dTEva_nominal=10
"Temperature difference evaporator inlet-outlet";
parameter Modelica.SIunits.TemperatureDifference dTCon_nominal=10
"Temperature difference condenser outlet-inlet";
parameter Real COPc_nominal = 3 "Chiller COP";
parameter Modelica.SIunits.MassFlowRate mEva_flow_nominal = per1.mEva_flow_nominal
"Nominal mass flow rate at evaporator";
parameter Modelica.SIunits.MassFlowRate mCon_flow_nominal = per1.mCon_flow_nominal
"Nominal mass flow rate at condenser";

parameter Buildings.Fluid.Chillers.Data.ElectricEIR.ElectricEIRChiller_McQuay_WSC_471kW_5_89COP_Vanes
per1 "Chiller performance data"
annotation (Placement(transformation(extent={{60,80},{80,100}})));
annotation (Placement(transformation(extent={{60,50},{80,70}})));
parameter Buildings.Fluid.Chillers.Data.ElectricEIR.ElectricEIRChiller_York_YT_563kW_10_61COP_Vanes
per2 "Chiller performance data"
annotation (Placement(transformation(extent={{32,80},{52,100}})));
annotation (Placement(transformation(extent={{32,50},{52,70}})));
Buildings.Applications.DataCenters.ChillerCooled.Equipment.ElectricChillerParallel chiPar(
num=2,
redeclare package Medium1 = Medium1,
Expand All @@ -25,27 +34,107 @@ model ElectricChillerParallel "Model that test electric chiller parallel"
dpValve_nominal={6000,6000},
per={per1,per2})
"Chillers with identical nominal parameters but different performance curves"
annotation (Placement(transformation(extent={{-10,0},{10,20}})));
annotation (Placement(transformation(extent={{-10,-30},{10,-10}})));
Fluid.Sources.Boundary_pT sou1(
redeclare package Medium = Medium1,
p=Medium1.p_default + 18E3,
use_T_in=true,
T=298.15,
nPorts=1) "Pressure boundary condition"
annotation (Placement(transformation(extent={{-80,-24},{-60,-4}})));
Fluid.Sources.Boundary_pT sou2(
redeclare package Medium = Medium2,
p=Medium2.p_default + 18E3,
use_T_in=true,
T=291.15,
nPorts=1) "Pressure boundary condition"
annotation (Placement(transformation(extent={{80,-40},{60,-20}})));
Buildings.Fluid.Sources.Boundary_pT sin1(
redeclare package Medium = Medium1, nPorts=1) "Pressure boundary condition"
annotation (Placement(
transformation(
extent={{10,-10},{-10,10}},
origin={70,10})));
Buildings.Fluid.Sources.Boundary_pT sin2(
redeclare package Medium = Medium2, nPorts=1) "Pressure boundary condition"
annotation (Placement(
transformation(
extent={{-10,-10},{10,10}},
origin={-70,-50})));
Modelica.Blocks.Sources.Ramp TSet(
duration=3600,
startTime=3*3600,
offset=273.15 + 10,
height=8) "Set point for leaving chilled water temperature"
annotation (Placement(transformation(extent={{-80,20},{-60,40}})));
Modelica.Blocks.Sources.Ramp TCon_in(
height=10,
offset=273.15 + 20,
duration=3600,
startTime=2*3600) "Condenser inlet temperature"
annotation (Placement(transformation(extent={{-120,-20},{-100,0}})));
Modelica.Blocks.Sources.Ramp TEva_in(
offset=273.15 + 15,
height=5,
startTime=3600,
duration=3600) "Evaporator inlet temperature"
annotation (Placement(transformation(extent={{120,-36},{100,-16}})));
Modelica.Blocks.Sources.Pulse pulse(period=3600/2)
"Pulse input signal"
annotation (Placement(transformation(extent={{-80,50},{-60,70}})));
Modelica.Blocks.Logical.GreaterThreshold greaterThreshold(threshold=0.5)
"Switch to switch chiller on or off"
annotation (Placement(transformation(extent={{-40,50},{-20,70}})));
Buildings.Fluid.FixedResistances.PressureDrop res1(
redeclare package Medium = Medium1,
m_flow_nominal=mCon_flow_nominal,
dp_nominal=6000) "Flow resistance"
annotation (Placement(transformation(extent={{32,0},{52,20}})));
Buildings.Fluid.FixedResistances.PressureDrop res2(
dp_nominal=6000,
redeclare package Medium = Medium2,
m_flow_nominal=mEva_flow_nominal) "Flow resistance"
annotation (Placement(transformation(extent={{-20,-60},{-40,-40}})));

equation
connect(chiPar.port_b1, res1.port_a)
annotation (Line(points={{10,16},{20,16},
{20,40},{32,40}}, color={0,127,255}));
connect(chiPar.port_a1, sou1.ports[1])
annotation (Line(points={{-10,16},{-26,16},{-40,16}}, color={0,127,255}));
annotation (Line(points={{10,-14},{20,-14},{20,10},{32,10}},
color={0,127,255}));
connect(res2.port_a, chiPar.port_b2)
annotation (Line(points={{-20,-20},{-16,-20},
{-16,4},{-10,4}}, color={0,127,255}));
connect(chiPar.port_a2, sou2.ports[1])
annotation (Line(points={{10,4},{26,4},{40,4}}, color={0,127,255}));
annotation (Line(points={{-20,-50},{-16,-50},{-16,-26},{-10,-26}},
color={0,127,255}));
connect(greaterThreshold.y, chiPar.on[1])
annotation (Line(points={{-19,90},{-16,90},{-16,13},{-12,13}},
annotation (Line(points={{-19,60},{-16,60},{-16,-17},{-12,-17}},
color={255,0,255}));
connect(greaterThreshold.y, chiPar.on[2])
annotation (Line(points={{-19,90},{-16,90},{-16,15},{-12,15}},
annotation (Line(points={{-19,60},{-16,60},{-16,-15},{-12,-15}},
color={255,0,255}));
connect(TSet.y, chiPar.TSet)
annotation (Line(points={{-59,60},{-28,60},{-28,10},{-12,10}},
annotation (Line(points={{-59,30},{-28,30},{-28,-20},{-12,-20}},
color={0,0,127}));

connect(TCon_in.y, sou1.T_in) annotation (Line(
points={{-99,-10},{-82,-10}},
color={0,0,127},
smooth=Smooth.None));
connect(TEva_in.y, sou2.T_in) annotation (Line(
points={{99,-26},{82,-26}},
color={0,0,127},
smooth=Smooth.None));

connect(greaterThreshold.u, pulse.y) annotation (Line(
points={{-42,60},{-59,60}},
color={0,0,127},
smooth=Smooth.None));

connect(res1.port_b, sin1.ports[1]) annotation (Line(points={{52,10},{56,10},{
56,10},{60,10}}, color={0,127,255}));
connect(sou1.ports[1], chiPar.port_a1)
annotation (Line(points={{-60,-14},{-10,-14}}, color={0,127,255}));
connect(res2.port_b, sin2.ports[1]) annotation (Line(points={{-40,-50},{-50,-50},
{-50,-50},{-60,-50}}, color={0,127,255}));
connect(chiPar.port_a2, sou2.ports[1]) annotation (Line(points={{10,-26},{20,-26},
{20,-30},{60,-30}}, color={0,127,255}));
annotation ( __Dymola_Commands(file=
"modelica://Buildings/Resources/Scripts/Dymola/Applications/DataCenters/ChillerCooled/Equipment/Validation/ElectricChillerParallel.mos"
"Simulate and plot"),
Expand All @@ -56,6 +145,14 @@ This example demonstrates how the chiller parallel can operate under different p
</html>", revisions="<html>
<ul>
<li>
May 13, 2021, by Michael Wetter:<br/>
Changed boundary condition model to prescribed pressure rather than prescribed mass flow rate.
Prescribing the mass flow rate caused
unreasonably large pressure drop because the mass flow rate was forced through a closed valve.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/2488\">#2488</a>.
</li>
<li>
July 10, 2017, by Yangyang Fu:<br/>
First implementation.
</li>
Expand All @@ -64,5 +161,7 @@ First implementation.
experiment(
StartTime=0,
StopTime=14400,
Tolerance=1e-06));
Tolerance=1e-06),
Diagram(coordinateSystem(extent={{-140,-100},{140,100}})),
Icon(coordinateSystem(extent={{-100,-100},{100,100}})));
end ElectricChillerParallel;
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,7 @@ April 11, 2017 by Yangyang Fu:<br/>
First implementation.
</li>
</ul>
</html>"));
</html>"),
Diagram(coordinateSystem(extent={{-100,-100},{120,100}})),
Icon(coordinateSystem(extent={{-100,-100},{100,100}})));
end ElectricHeater;
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ model HeatExchanger_ResetController
transformation(
extent={{10,-10},{-10,10}},
origin={78,70})));
Buildings.Fluid.Sources.MassFlowSource_T sou1(
Fluid.Sources.Boundary_pT sou1(
p=MediumW.p_default + 60E3,
use_T_in=true,
nPorts=3,
redeclare package Medium = MediumW,
m_flow=3*m1_flow_nominal,
T=298.15)
"Source on medium 1 side"
annotation (Placement(transformation(extent={{-60,66},{-40,86}})));
Expand Down Expand Up @@ -79,11 +79,11 @@ model HeatExchanger_ResetController
k(unit="K",displayUnit="degC")=273.15+16.56)
"Leaving chilled water temperature setpoint"
annotation (Placement(transformation(extent={{-90,40},{-70,60}})));
Buildings.Fluid.Sources.MassFlowSource_T sou2_1(
Fluid.Sources.Boundary_pT sou2_1(
p=MediumW.p_default + 50E3,
nPorts=3,
redeclare package Medium = MediumW,
use_T_in=true,
m_flow=3*m2_flow_nominal)
use_T_in=true)
"Source on medium 2 side"
annotation (Placement(transformation(extent={{60,14},{40,34}})));
Modelica.Blocks.Sources.Constant TEva_in(k=273.15 + 25.28)
Expand Down Expand Up @@ -158,16 +158,18 @@ equation
annotation (Line(points={{79,28},{62,28}}, color={0,0,127}));
connect(TSen2.port_a, hex2.port_b2)
annotation (Line(points={{-40,-70},{-12,-70}}, color={0,127,255}));
connect(sou1.ports[2], hex2.port_a1) annotation (Line(points={{-40,76},{-22,76},
{-22,-58},{-12,-58}}, color={0,127,255}));
connect(sou1.ports[2], hex2.port_a1) annotation (Line(points={{-40,76},{-22,
76},{-22,-58},{-12,-58}},
color={0,127,255}));
connect(hex2.port_b1, sin1.ports[2]) annotation (Line(points={{8,-58},{20,-58},
{20,70},{68,70}}, color={0,127,255}));
connect(TSet.y, hex2.TSet) annotation (Line(points={{-69,50},{-62,50},{-62,60},
{-20,60},{-20,-60},{-14,-60}}, color={0,0,127}));
connect(tri.y, hex1.trigger)
annotation (Line(points={{-69,10},{-8,10},{-8,46}}, color={255,0,255}));
connect(sou2_1.ports[2], hex2.port_a2) annotation (Line(points={{40,24},{28,24},
{28,-70},{8,-70}}, color={0,127,255}));
connect(sou2_1.ports[2], hex2.port_a2) annotation (Line(points={{40,24},{28,
24},{28,-70},{8,-70}},
color={0,127,255}));
connect(sin2.ports[3], TSen3.port_b) annotation (Line(points={{-72,-44.6667},
{-66,-44.6667},{-66,-156},{-50,-156}},color={0,127,255}));
connect(TSen3.port_a, hex3.port_b2)
Expand Down Expand Up @@ -196,6 +198,14 @@ This example demonstrates how the PID controller in the heat exchanger model can
</html>", revisions="<html>
<ul>
<li>
May 13, 2021, by Michael Wetter:<br/>
Changed boundary condition model to prescribed pressure rather than prescribed mass flow rate.
Prescribing the mass flow rate caused
unreasonably large pressure drop because the mass flow rate was forced through a closed valve.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/2488\">#2488</a>.
</li>
<li>
January 28, 2019, by Yangyang Fu:<br/>
First implementation.
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ model IntegratedPrimaryLoadSide
"Integrated WSE on the load side in a primary-only chilled water system"
extends Modelica.Icons.Example;
extends Buildings.Applications.DataCenters.ChillerCooled.Equipment.Validation.BaseClasses.PartialPlant(
sou1(nPorts=2, m_flow=2*mCW_flow_nominal),
sou1(nPorts=2),
sin1(nPorts=2),
TSet(k=273.15 + 5.56),
TEva_in(k=273.15 + 15.28),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ model IntegratedPrimaryPlantSide
"Integrated WSE on the plant side in a primary-only chilled water system"
extends Modelica.Icons.Example;
extends Buildings.Applications.DataCenters.ChillerCooled.Equipment.Validation.BaseClasses.PartialPlant(
sou1(nPorts=2, m_flow=2*mCW_flow_nominal),
sou1(nPorts=2),
sin1(nPorts=2),
TSet(k=273.15 + 5.56),
TEva_in(k=273.15 + 15.28),
Expand Down Expand Up @@ -40,12 +40,11 @@ model IntegratedPrimaryPlantSide
y=if not onChi.y and onWSE.y then 1 else 0)
"On/off signal for valve 6"
annotation (Placement(transformation(extent={{40,60},{20,80}})));
Buildings.Fluid.Sources.MassFlowSource_T sou2(
Fluid.Sources.Boundary_pT sou2(
redeclare package Medium = MediumCHW,
p=MediumCHW.p_default + 1E5,
nPorts=2,
use_T_in=true,
m_flow=2*mCHW_flow_nominal)
"Source on medium 2 side"
use_T_in=true) "Source on medium 2 side"
annotation (Placement(
transformation(
extent={{10,-10},{-10,10}},
Expand Down Expand Up @@ -90,8 +89,8 @@ equation
-20,-44},{-40,-44}}, color={0,127,255}));
connect(intWSEPri1.port_b1, sin1.ports[1]) annotation (Line(points={{10,-32},{
20,-32},{20,-4},{70,-4}}, color={0,127,255}));
connect(intWSEPri1.port_a2, sou2.ports[1]) annotation (Line(points={{10,-44},{
26,-44},{26,-72},{40,-72}}, color={0,127,255}));
connect(intWSEPri1.port_a2, sou2.ports[1]) annotation (Line(points={{10,-44},
{26,-44},{26,-72},{40,-72}}, color={0,127,255}));
connect(TEva_in.y, sou2.T_in)
annotation (Line(points={{69,-70},{62,-70}}, color={0,0,127}));
connect(TSet.y, intWSEPri1.TSet) annotation (Line(points={{-79,30},{-16,30},{-16,
Expand All @@ -102,8 +101,8 @@ equation
{-18,-30.4},{-11.6,-30.4}}, color={255,0,255}));
connect(sou1.ports[2], intWSEPri2.port_a1) annotation (Line(points={{-40,-4},{
-28,-4},{-28,-102},{-10,-102}}, color={0,127,255}));
connect(sou2.ports[2], intWSEPri2.port_a2) annotation (Line(points={{40,-76},{
26,-76},{26,-114},{10,-114}}, color={0,127,255}));
connect(sou2.ports[2], intWSEPri2.port_a2) annotation (Line(points={{40,-76},
{26,-76},{26,-114},{10,-114}},color={0,127,255}));
connect(intWSEPri2.port_b1, sin1.ports[2]) annotation (Line(points={{10,-102},
{20,-102},{20,-4},{70,-4}}, color={0,127,255}));
connect(TSet.y, intWSEPri2.TSet) annotation (Line(points={{-79,30},{-16,30},{-16,
Expand Down Expand Up @@ -137,6 +136,14 @@ is reset every 1800s.
</html>", revisions="<html>
<ul>
<li>
May 13, 2021, by Michael Wetter:<br/>
Changed boundary condition model to prescribed pressure rather than prescribed mass flow rate.
Prescribing the mass flow rate caused
unreasonably large pressure drop because the mass flow rate was forced through a closed valve.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/2488\">#2488</a>.
</li>
<li>
January 28, 2019, by Yangyang Fu:<br/>
Added test case for PI controller reset.
</li>
Expand Down
Loading

0 comments on commit 1b16c3d

Please sign in to comment.