Skip to content

Commit

Permalink
Re-arrange models to avoid connections and blocks on the border [ci s…
Browse files Browse the repository at this point in the history
…kip]
  • Loading branch information
FWuellhorst committed Dec 6, 2023
1 parent ad6abfc commit 9c60776
Show file tree
Hide file tree
Showing 29 changed files with 286 additions and 274 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ model LargeScaleWaterToWater "Large scale water to water chiller"
IBPSA.Fluid.Chillers.ModularReversible.Data.TableData2D.EN14511.Carrier30XWP1012_1MW
datTab constrainedby Data.TableData2D.Generic "Data Table of Chiller"
annotation (choicesAllMatching=true,
Placement(transformation(extent={{60,20},{80,40}})));
Placement(transformation(extent={{42,12},{58,28}})));
replaceable parameter
IBPSA.Fluid.HeatPumps.ModularReversible.Controls.Safety.Data.Wuellhorst2021
safCtrParEurNor constrainedby
Expand All @@ -54,7 +54,7 @@ model LargeScaleWaterToWater "Large scale water to water chiller"
final use_TAmbSidOut=datTab.use_TConOutForOpeEnv) "Safety control parameters"
annotation (Dialog(enable=use_intSafCtr, group="Safety control"),
choicesAllMatching=true,
Placement(transformation(extent={{60,-18},{80,2}})));
Placement(transformation(extent={{72,12},{88,28}})));
// Upper boundary has no influence as use_rev=false

annotation (Documentation(info="<html>
Expand Down
10 changes: 5 additions & 5 deletions IBPSA/Fluid/Chillers/ModularReversible/ModularReversible.mo
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ model ModularReversible
Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=0,
origin={-90,-110})));
origin={-80,-100})));
equation
connect(conCoo.y, sigBus.coo)
annotation (Line(points={{-79,-110},{-80,-110},{-80,-43},{-105,-43}},
color={255,0,255}));
annotation (Line(points={{-69,-100},{-60,-100},{-60,-80},{-80,-80},{-80,-43},
{-105,-43}}, color={255,0,255}));
connect(coo, sigBus.coo)
annotation (Line(points={{-116,-90},{-80,-90},{-80,-43},{-105,-43}},
color={255,0,255}));
annotation (Line(points={{-116,-90},{-98,-90},{-98,-80},{-80,-80},{-80,-43},{
-105,-43}}, color={255,0,255}));
annotation (Icon(coordinateSystem(extent={{-100,-120},{100,120}}), graphics={
Rectangle(
extent={{-16,83},{16,-83}},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ equation
connect(const.y, PEle)
annotation (Line(points={{-67,26},{0,26},{0,-110}}, color={0,0,127}));
connect(const.y, proRedQEva.u2)
annotation (Line(points={{-67,26},{-44,26},{-44,-58}}, color={0,0,127}));
connect(calEER.PEle, const.y) annotation (Line(points={{-78,-66},{-62,-66},{-62,
annotation (Line(points={{-67,26},{-14,26},{-14,-58}}, color={0,0,127}));
connect(calEER.PEle, const.y) annotation (Line(points={{-58,-66},{-46,-66},{-46,
26},{-67,26}}, color={0,0,127}));
annotation (Documentation(info="<html>
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ partial model PartialChillerCycle
IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.CalculateCOP
calEER(PEleMin=PEle_nominal*0.1) if calEff
"Calculate the EER"
annotation (Placement(transformation(extent={{-80,-60},{-100,-80}})));
annotation (Placement(transformation(extent={{-60,-60},{-80,-80}})));
equation
connect(iceFacCal.iceFac, sigBus.iceFacChiMea) annotation (Line(points={{-79,
-42},{-72,-42},{-72,-26},{-102,-26},{-102,104},{1,104}}, color={0,0,
connect(iceFacCal.iceFac, sigBus.iceFacChiMea) annotation (Line(points={{-69,-40},
{-72,-40},{-72,-26},{-102,-26},{-102,104},{1,104}}, color={0,0,
127}), Text(
string="%second",
index=1,
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
connect(calEER.COP, sigBus.EER) annotation (Line(points={{-101,-70},{-102,-70},{
connect(calEER.COP, sigBus.EER) annotation (Line(points={{-81,-70},{-102,-70},{
-102,104},{1,104}}, color={0,0,127}), Text(
string="%second",
index=1,
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
connect(calEER.QUse_flow, proRedQEva.y) annotation (Line(points={{-78,-74},{-70,
-74},{-70,-88},{-50,-88},{-50,-81}}, color={0,0,127}));
connect(calEER.QUse_flow, proRedQEva.y) annotation (Line(points={{-58,-74},{-46,
-74},{-46,-88},{-20,-88},{-20,-81}}, color={0,0,127}));
annotation (Icon(graphics={Rectangle(
extent={{-100,-100},{100,100}},
lineColor={0,0,255},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ equation
extent={{-3,6},{-3,6}},
horizontalAlignment=TextAlignment.Right));
end if;
connect(swiQUse.y, proRedQEva.u2) annotation (Line(points={{-50,-1},{-50,-30},
{-44,-30},{-44,-58}}, color={0,0,127}));
connect(calEER.PEle, swiPEle.y) annotation (Line(points={{-78,-66},{-70,-66},{
-70,-52},{0,-52},{0,-8},{50,-8},{50,-1}}, color={0,0,127}));
connect(swiQUse.y, proRedQEva.u2) annotation (Line(points={{-50,-1},{-50,-30},{
-14,-30},{-14,-58}}, color={0,0,127}));
connect(calEER.PEle, swiPEle.y) annotation (Line(points={{-78,-66},{-50,-66},{
-50,-52},{0,-52},{0,-8},{50,-8},{50,-1}}, color={0,0,127}));
annotation (Documentation(revisions="<html><ul>
<li>
<i>October 2, 2022</i> by Fabian Wuellhorst:<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,82 +29,85 @@ model TableData2D

equation

connect(scaFacTimPel.y, PEle) annotation (Line(points={{-40,-11},{-40,-26},{-30,
connect(scaFacTimPel.y, PEle) annotation (Line(points={{-40,-9},{-40,-26},{-30,
-26},{-30,-94},{0,-94},{0,-110}}, color={0,0,127}));
connect(scaFacTimPel.y, redQCon.u2) annotation (Line(points={{-40,-11},{-40,-26},
connect(scaFacTimPel.y, redQCon.u2) annotation (Line(points={{-40,-9},{-40,-26},
{-30,-26},{-30,-48},{64,-48},{64,-58}}, color={0,0,127}));
connect(scaFacTimQUse_flow.y, proRedQEva.u2) annotation (Line(points={{40,-11},
{40,-40},{-44,-40},{-44,-58}}, color={0,0,127}));
connect(scaFacTimQUse_flow.y, proRedQEva.u2) annotation (Line(points={{40,-9},{
40,-40},{-14,-40},{-14,-58}}, color={0,0,127}));
connect(ySetTimScaFac.u1, sigBus.ySet) annotation (Line(points={{-64,48},{-64,
100},{-10,100},{-10,104},{1,104}}, color={0,0,127}), Text(
string="%second",
index=1,
extent={{-3,6},{-3,6}},
horizontalAlignment=TextAlignment.Right));
connect(reaPasThrTEvaOut.u, sigBus.TEvaOutMea) annotation (Line(points={{-20,102},
connect(reaPasThrTEvaOut.u, sigBus.TEvaOutMea) annotation (Line(points={{-20,92},
{-20,104},{1,104}}, color={0,0,127}), Text(
string="%second",
index=1,
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
connect(reaPasThrTEvaIn.u, sigBus.TEvaInMea) annotation (Line(points={{-50,102},
connect(reaPasThrTEvaIn.u, sigBus.TEvaInMea) annotation (Line(points={{-50,92},
{-50,106},{0,106},{0,104},{1,104}}, color={0,0,127}), Text(
string="%second",
index=1,
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
connect(reaPasThrTConIn.u, sigBus.TConInMea) annotation (Line(points={{40,102},
{40,104},{1,104}}, color={0,0,127}), Text(
connect(reaPasThrTConIn.u, sigBus.TConInMea) annotation (Line(points={{40,92},{
40,104},{1,104}}, color={0,0,127}), Text(
string="%second",
index=1,
extent={{-6,3},{-6,3}},
horizontalAlignment=TextAlignment.Right));
connect(reaPasThrTConOut.u, sigBus.TConOutMea) annotation (Line(points={{70,102},
connect(reaPasThrTConOut.u, sigBus.TConOutMea) annotation (Line(points={{70,92},
{70,104},{1,104}}, color={0,0,127}), Text(
string="%second",
index=1,
extent={{-6,3},{-6,3}},
horizontalAlignment=TextAlignment.Right));
connect(scaFacTimPel.y, calEER.PEle) annotation (Line(points={{-40,-11},{-40,-26},
{-30,-26},{-30,-86},{-68,-86},{-68,-66},{-78,-66}}, color={0,0,127}));
connect(scaFacTimPel.y, calEER.PEle) annotation (Line(points={{-40,-9},{-40,-66},
{-58,-66}}, color={0,0,127}));

if useInChi then
connect(reaPasThrTConOut.y, tabPEle.u2)
annotation (Line(points={{70,79},{70,48},{74,48},{74,42}}, color={0,0,127}));
annotation (Line(points={{70,69},{70,48},{74,48},{74,42}}, color={0,0,127}));
connect(reaPasThrTConIn.y, tabPEle.u2)
annotation (Line(points={{40,79},{40,48},{74,48},{74,42}}, color={0,0,127}));
annotation (Line(points={{40,69},{40,48},{74,48},{74,42}}, color={0,0,127}));
connect(reaPasThrTConIn.y, tabQUse_flow.u2)
annotation (Line(points={{40,79},{40,48},{34,48},{34,42}}, color={0,0,127}));
annotation (Line(points={{40,69},{40,48},{34,48},{34,42}}, color={0,0,127}));
connect(reaPasThrTConOut.y, tabQUse_flow.u2)
annotation (Line(points={{70,79},{70,48},{34,48},{34,42}}, color={0,0,127}));
connect(reaPasThrTEvaOut.y, tabQUse_flow.u1) annotation (Line(points={{-20,79},
{-20,72},{40,72},{40,48},{46,48},{46,42}},
annotation (Line(points={{70,69},{70,48},{34,48},{34,42}}, color={0,0,127}));
connect(reaPasThrTEvaOut.y, tabQUse_flow.u1) annotation (Line(points={{-20,69},
{-20,66},{40,66},{40,48},{46,48},{46,42}},
color={0,0,127}));
connect(reaPasThrTEvaIn.y, tabQUse_flow.u1) annotation (Line(points={{-50,79},
{-50,72},{40,72},{40,48},{46,48},{46,42}},
connect(reaPasThrTEvaIn.y, tabQUse_flow.u1) annotation (Line(points={{-50,69},
{-50,62},{40,62},{40,48},{46,48},{46,42}},
color={0,0,127}));
connect(reaPasThrTEvaOut.y, tabPEle.u1) annotation (Line(points={{-20,79},{-20,72},
{86,72},{86,42}}, color={0,0,127}));
connect(reaPasThrTEvaIn.y, tabPEle.u1) annotation (Line(points={{-50,79},{-50,
72},{86,72},{86,42}},
connect(reaPasThrTEvaOut.y, tabPEle.u1) annotation (Line(points={{-20,69},{
-20,66},{86,66},{86,42}},
color={0,0,127}));
connect(reaPasThrTEvaIn.y, tabPEle.u1) annotation (Line(points={{-50,69},{-50,
62},{86,62},{86,42}},
color={0,0,127}));
else
connect(reaPasThrTConOut.y, tabPEle.u1)
annotation (Line(points={{70,79},{70,48},{86,48},{86,42}}, color={0,0,127}));
annotation (Line(points={{70,69},{70,48},{86,48},{86,42}}, color={0,0,127}));
connect(reaPasThrTConOut.y, tabQUse_flow.u1)
annotation (Line(points={{70,79},{70,48},{46,48},{46,42}}, color={0,0,127}));
annotation (Line(points={{70,69},{70,48},{46,48},{46,42}}, color={0,0,127}));
connect(reaPasThrTConIn.y, tabQUse_flow.u1)
annotation (Line(points={{40,79},{40,48},{46,48},{46,42}}, color={0,0,127}));
annotation (Line(points={{40,69},{40,48},{46,48},{46,42}}, color={0,0,127}));
connect(reaPasThrTConIn.y, tabPEle.u1)
annotation (Line(points={{40,79},{40,48},{86,48},{86,42}}, color={0,0,127}));
connect(reaPasThrTEvaOut.y, tabPEle.u2) annotation (Line(points={{-20,79},{-20,72},
{40,72},{40,48},{74,48},{74,42}}, color={0,0,127}));
connect(reaPasThrTEvaOut.y, tabQUse_flow.u2) annotation (Line(points={{-20,79},{
-20,72},{40,72},{40,48},{34,48},{34,42}}, color={0,0,127}));
connect(reaPasThrTEvaIn.y, tabQUse_flow.u2) annotation (Line(points={{-50,79},{-50,
72},{40,72},{40,48},{34,48},{34,42}}, color={0,0,127}));
connect(reaPasThrTEvaIn.y, tabPEle.u2) annotation (Line(points={{-50,79},{-50,72},
{40,72},{40,48},{74,48},{74,42}}, color={0,0,127}));
annotation (Line(points={{40,69},{40,48},{86,48},{86,42}}, color={0,0,127}));
connect(reaPasThrTEvaOut.y, tabPEle.u2) annotation (Line(points={{-20,69},{
-20,66},{40,66},{40,48},{74,48},{74,42}},
color={0,0,127}));
connect(reaPasThrTEvaOut.y, tabQUse_flow.u2) annotation (Line(points={{-20,69},
{-20,66},{40,66},{40,48},{34,48},{34,42}},color={0,0,127}));
connect(reaPasThrTEvaIn.y, tabQUse_flow.u2) annotation (Line(points={{-50,69},
{-50,62},{40,62},{40,48},{34,48},{34,42}},
color={0,0,127}));
connect(reaPasThrTEvaIn.y, tabPEle.u2) annotation (Line(points={{-50,69},{-50,
62},{74,62},{74,42}}, color={0,0,127}));
end if;
annotation (Icon(graphics={
Line(points={{-60.0,40.0},{-60.0,-40.0},{60.0,-40.0},{60.0,40.0},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ partial model PartialReversibleRefrigerantMachine
"Safety control parameters" annotation (Dialog(enable=use_intSafCtr,
group="Safety control"),
choicesAllMatching=true,
Placement(transformation(extent={{50,-18},{70,2}})));
Placement(transformation(extent={{42,-18},{58,-2}})));
//Condenser
parameter Modelica.Units.SI.Time tauCon=30
"Condenser heat transfer time constant at nominal flow"
Expand Down Expand Up @@ -270,7 +270,7 @@ partial model PartialReversibleRefrigerantMachine
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=180,
origin={70,110})));
origin={70,100})));
IBPSA.Fluid.HeatPumps.ModularReversible.Controls.Safety.Safety safCtr(
final mEva_flow_nominal=mEva_flow_nominal,
final mCon_flow_nominal=mCon_flow_nominal,
Expand Down Expand Up @@ -336,7 +336,7 @@ partial model PartialReversibleRefrigerantMachine
transformation(
extent={{-10,-10},{10,10}},
rotation=0,
origin={-90,90})));
origin={-80,100})));
IBPSA.Fluid.HeatPumps.ModularReversible.BaseClasses.InflowTemperatureSensor senTEvaIn(
final y=MediumEva.temperature(MediumEva.setState_phX(
port_a2.p,
Expand All @@ -346,7 +346,7 @@ partial model PartialReversibleRefrigerantMachine
transformation(
extent={{-10,-10},{10,10}},
rotation=180,
origin={90,-40})));
origin={80,-30})));

// To avoid using the bus, set the section below to protected
// <!-- @include_Buildings @include_IDEAS @include_BuildingSystems
Expand Down Expand Up @@ -398,19 +398,19 @@ equation
-8.33333},{-61.3333,-8.33333}},
color={0,0,127}));
connect(TConAmb, varTOutCon.T) annotation (Line(
points={{110,100},{88,100},{88,110},{82,110}},
points={{110,100},{82,100}},
color={0,0,127},
pattern=LinePattern.Dash));
connect(varTOutCon.port, con.port_out) annotation (Line(
points={{60,110},{40,110},{40,118},{0,118},{0,112}},
points={{60,100},{40,100},{40,114},{0,114},{0,112}},
color={191,0,0},
pattern=LinePattern.Dash));
connect(TEvaAmb, varTOutEva.T) annotation (Line(
points={{110,-100},{82,-100}},
color={0,0,127},
pattern=LinePattern.Dash));
connect(eva.port_out, varTOutEva.port) annotation (Line(
points={{0,-112},{0,-118},{54,-118},{54,-100},{60,-100}},
points={{0,-112},{0,-116},{54,-116},{54,-100},{60,-100}},
color={191,0,0},
pattern=LinePattern.Dash));
connect(port_b2, port_b2) annotation (Line(points={{-100,-60},{-100,-60}},
Expand Down Expand Up @@ -438,8 +438,8 @@ equation
{0,0,127}));
connect(mCon_flow.port_b, con.port_a)
annotation (Line(points={{-40,92},{-20,92}}, color={0,127,255}));
connect(con.port_b, port_b1) annotation (Line(points={{20,92},{78,92},{78,60},
{100,60}}, color={0,127,255}));
connect(con.port_b, port_b1) annotation (Line(points={{20,92},{44,92},{44,60},{
100,60}}, color={0,127,255}));
// External bus connections
connect(mEva_flow.m_flow, sigBus.mEvaMea_flow) annotation (Line(points={{72,-49},
{72,-40},{26,-40},{26,-30},{-30,-30},{-30,-66},{-76,-66},{-76,-43},{-105,
Expand Down Expand Up @@ -478,7 +478,7 @@ equation
extent={{-6,3},{-6,3}},
horizontalAlignment=TextAlignment.Right));
connect(varTOutCon.T, sigBus.TConAmbMea) annotation (Line(
points={{82,110},{88,110},{88,82},{38,82},{38,32},{-76,32},{-76,-43},{-105,
points={{82,100},{88,100},{88,82},{38,82},{38,32},{-76,32},{-76,-43},{-105,
-43}},
color={0,0,127},
pattern=LinePattern.Dash), Text(
Expand All @@ -487,7 +487,7 @@ equation
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
connect(varTOutEva.T, sigBus.TEvaAmbMea) annotation (Line(
points={{82,-100},{88,-100},{88,-118},{-76,-118},{-76,-43},{-105,-43}},
points={{82,-100},{88,-100},{88,-116},{-76,-116},{-76,-43},{-105,-43}},
color={0,0,127},
pattern=LinePattern.Dash), Text(
string="%second",
Expand All @@ -507,8 +507,8 @@ equation
index=1,
extent={{-6,3},{-6,3}},
horizontalAlignment=TextAlignment.Right));
connect(senTConIn.y, sigBus.TConInMea) annotation (Line(points={{-79,90},{-72,
90},{-72,32},{-76,32},{-76,-43},{-105,-43}}, color={0,0,127}), Text(
connect(senTConIn.y, sigBus.TConInMea) annotation (Line(points={{-69,100},{-64,
100},{-64,32},{-76,32},{-76,-43},{-105,-43}},color={0,0,127}), Text(
string="%second",
index=1,
extent={{-3,-6},{-3,-6}},
Expand All @@ -519,8 +519,8 @@ equation
index=1,
extent={{-6,3},{-6,3}},
horizontalAlignment=TextAlignment.Right));
connect(senTEvaIn.y, sigBus.TEvaInMea) annotation (Line(points={{79,-40},{26,-40},
{26,-30},{-30,-30},{-30,-66},{-76,-66},{-76,-43},{-105,-43}}, color={0,
connect(senTEvaIn.y, sigBus.TEvaInMea) annotation (Line(points={{69,-30},{-30,
-30},{-30,-66},{-76,-66},{-76,-43},{-105,-43}}, color={0,
0,127}), Text(
string="%second",
index=1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ model BoundaryMap
annotation (Placement(transformation(extent={{20,-80},{40,-60}})));
Modelica.Blocks.Sources.Constant conTAmbSidMin(k=TAmbSidMin)
"Constant minimal temperature of ambient temperature side"
annotation (Placement(transformation(extent={{-60,-60},{-40,-40}})));
annotation (Placement(transformation(extent={{-60,-50},{-40,-30}})));
Modelica.Blocks.Sources.Constant conTAmbSidMax(k=TAmbSidMax)
"Constant maximal temperature of ambient temperature side"
annotation (Placement(transformation(extent={{-60,-100},{-40,-80}})));
annotation (Placement(transformation(extent={{-60,-90},{-40,-70}})));

Modelica.Blocks.Math.Add subMax(final k1=+1, final k2=-1)
"Actual minus maximal ambient side temperature"
Expand Down Expand Up @@ -95,9 +95,9 @@ equation
connect(hysRig.y, nor.u[2]) annotation (Line(points={{41,-70},{50,-70},{50,-5.55112e-16},
{60,-5.55112e-16}}, color={255,0,255}));
connect(subMax.u2,conTAmbSidMax.y) annotation (Line(points={{-22,-76},{-32,-76},
{-32,-90},{-39,-90}}, color={0,0,127}));
connect(sub.u2,conTAmbSidMin.y) annotation (Line(points={{-22,-36},{-32,-36},
{-32,-50},{-39,-50}}, color={0,0,127}));
{-32,-80},{-39,-80}}, color={0,0,127}));
connect(sub.u2,conTAmbSidMin.y) annotation (Line(points={{-22,-36},{-32,-36},{
-32,-40},{-39,-40}}, color={0,0,127}));
connect(subMax.y, hysRig.u)
annotation (Line(points={{1,-70},{18,-70}}, color={0,0,127}));
connect(sub.y, hysLef.u)
Expand All @@ -114,8 +114,8 @@ equation
{-62,50}}, color={0,0,127}));
connect(TAmbSid, sub.u1) annotation (Line(points={{-116,-40},{-80,-40},{-80,-24},
{-22,-24}}, color={0,0,127}));
connect(TAmbSid, subMax.u1) annotation (Line(points={{-116,-40},{-80,-40},{-80,-70},
{-32,-70},{-32,-64},{-22,-64}}, color={0,0,127}));
connect(TAmbSid, subMax.u1) annotation (Line(points={{-116,-40},{-80,-40},{-80,
-64},{-22,-64}}, color={0,0,127}));
annotation (Icon(
coordinateSystem(preserveAspectRatio=false,
extent={{-100,-100},{100,100}}), graphics={
Expand Down
Loading

0 comments on commit 9c60776

Please sign in to comment.