Skip to content

Commit

Permalink
Rename nSet to ySet #1576
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian.wuellhorst committed May 11, 2022
1 parent b0c0708 commit 3e96e3e
Show file tree
Hide file tree
Showing 30 changed files with 110 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ partial model PartialReversibleVapourCompressionMachine
enable=use_refIne, group="Refrigerant inertia"), Evaluate=true);
parameter Integer nthOrder=3 "Order of refrigerant cycle interia" annotation (Dialog(enable=
use_refIne, group="Refrigerant inertia"));
parameter Boolean useBusConnectorOnly = false "Set true to use bus connector for modeSet, nSet and iceFac input"
parameter Boolean useBusConnectorOnly = false "Set true to use bus connector for modeSet, ySet and iceFac input"
annotation(choices(checkBox=true), Dialog(group="Input Connectors"));

//Condenser
Expand Down Expand Up @@ -281,9 +281,9 @@ partial model PartialReversibleVapourCompressionMachine
extent={{6,6},{-6,-6}},
rotation=90,
origin={-14,-52})));
Modelica.Blocks.Routing.RealPassThrough realPassThroughnSetCon
Modelica.Blocks.Routing.RealPassThrough realPassThroughySetCon
if not use_refIne
"Use default nSet value" annotation (Placement(transformation(
"Use default ySet value" annotation (Placement(transformation(
extent={{-6,-6},{6,6}},
rotation=90,
origin={16,58})));
Expand All @@ -300,8 +300,8 @@ partial model PartialReversibleVapourCompressionMachine
extent={{-6,-6},{6,6}},
rotation=90,
origin={-16,58})));
Modelica.Blocks.Routing.RealPassThrough realPassThroughnSetEva if not use_refIne
"Use default nSet value" annotation (Placement(transformation(
Modelica.Blocks.Routing.RealPassThrough realPassThroughySetEva if not use_refIne
"Use default ySet value" annotation (Placement(transformation(
extent={{6,-6},{-6,6}},
rotation=90,
origin={16,-52})));
Expand All @@ -323,7 +323,7 @@ partial model PartialReversibleVapourCompressionMachine
rotation=0,
origin={-52,114})));

Modelica.Blocks.Interfaces.RealInput nSet if not useBusConnectorOnly
Modelica.Blocks.Interfaces.RealInput ySet if not useBusConnectorOnly
"Input signal speed for compressor relative between 0 and 1" annotation (Placement(
transformation(extent={{-132,4},{-100,36}})));
Interfaces.VapourCompressionMachineControlBus sigBus annotation (
Expand Down Expand Up @@ -426,7 +426,7 @@ partial model PartialReversibleVapourCompressionMachine
Modelica.Blocks.Logical.Hysteresis hysteresis(
final uLow=Modelica.Constants.eps,
final uHigh=ySet_small,
final pre_y_start=false) "Use default nSet value" annotation (Placement(
final pre_y_start=false) "Use default ySet value" annotation (Placement(
transformation(
extent={{6,-6},{-6,6}},
rotation=180,
Expand Down Expand Up @@ -509,7 +509,7 @@ equation
extent={{-3,-6},{-3,-6}},
horizontalAlignment=TextAlignment.Right));

connect(innerCycle.QEva, realPassThroughnSetEva.u) annotation (Line(
connect(innerCycle.QEva, realPassThroughySetEva.u) annotation (Line(
points={{-1.77636e-15,-30.7},{-1.77636e-15,-38},{16,-38},{16,-44.8}},
color={0,0,127},
pattern=LinePattern.Dash));
Expand All @@ -521,7 +521,7 @@ equation
points={{1.77636e-15,28.7},{1.77636e-15,30},{0,30},{0,40},{-16,40},{-16,50.8}},
color={0,0,127},
pattern=LinePattern.Dash));
connect(innerCycle.QCon, realPassThroughnSetCon.u) annotation (Line(
connect(innerCycle.QCon, realPassThroughySetCon.u) annotation (Line(
points={{1.77636e-15,28.7},{0,28.7},{0,40},{16,40},{16,50.8}},
color={0,0,127},
pattern=LinePattern.Dash));
Expand All @@ -545,7 +545,7 @@ equation
index=1,
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
connect(nSet,sigBus.nSet) annotation (Line(points={{-116,20},{-76,20},{-76,-43},
connect(ySet,sigBus.ySet) annotation (Line(points={{-116,20},{-76,20},{-76,-43},
{-105,-43}}, color={0,0,127}), Text(
string="%second",
index=1,
Expand Down Expand Up @@ -575,15 +575,15 @@ equation
pattern=LinePattern.Dash));
connect(port_b2, port_b2) annotation (Line(points={{-100,-60},{-100,-60},{-100,
-60}}, color={0,127,255}));
connect(realPassThroughnSetCon.y, con.QFlow_in) annotation (Line(
connect(realPassThroughySetCon.y, con.QFlow_in) annotation (Line(
points={{16,64.6},{16,77.04},{0,77.04}},
color={0,0,127},
pattern=LinePattern.Dash));
connect(heatFlowIneCon.y, con.QFlow_in) annotation (Line(
points={{-16,64.6},{-16,77.04},{0,77.04}},
color={0,0,127},
pattern=LinePattern.Dash));
connect(realPassThroughnSetEva.y, eva.QFlow_in) annotation (Line(points={{16,-58.6},
connect(realPassThroughySetEva.y, eva.QFlow_in) annotation (Line(points={{16,-58.6},
{16,-69.04},{0,-69.04}}, color={0,0,127}));
connect(heatFlowIneEva.y, eva.QFlow_in) annotation (Line(points={{-14,-58.6},{
-14,-69.04},{0,-69.04}}, color={0,0,127}));
Expand Down Expand Up @@ -631,7 +631,7 @@ equation
index=1,
extent={{-6,3},{-6,3}},
horizontalAlignment=TextAlignment.Right));
connect(hysteresis.u, sigBus.nSet) annotation (Line(points={{-73.2,-28},{-76,-28},
connect(hysteresis.u, sigBus.ySet) annotation (Line(points={{-73.2,-28},{-76,-28},
{-76,-43},{-105,-43}}, color={0,0,127}), Text(
string="%second",
index=1,
Expand Down
10 changes: 5 additions & 5 deletions IBPSA/Fluid/Chillers/BlackBoxData.mo
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ package BlackBoxData "Collection of Chiller Database Records"
-30},{0,-110}}, color={0,0,127}));
connect(realCorr.y, nTimesSF.u2) annotation (Line(points={{-13,39.7},{-13,
31.4},{-13.2,31.4}}, color={0,0,127}));
connect(sigBus.nSet, nTimesSF.u1) annotation (Line(
connect(sigBus.ySet, nTimesSF.u1) annotation (Line(
points={{1,104},{-4,104},{-4,31.4},{-4.8,31.4}},
color={255,204,51},
thickness=0.5), Text(
Expand Down Expand Up @@ -513,7 +513,7 @@ package BlackBoxData "Collection of Chiller Database Records"
string="%first",
index=-1,
extent={{-6,3},{-6,3}}));
connect(sigBus.nSet, greaterThreshold.u) annotation (Line(
connect(sigBus.ySet, greaterThreshold.u) annotation (Line(
points={{1,104},{-72,104},{-72,71.2}},
color={255,204,51},
thickness=0.5), Text(
Expand All @@ -526,7 +526,7 @@ package BlackBoxData "Collection of Chiller Database Records"
connect(greaterThreshold.y, switchPel.u2) annotation (Line(points={{-72,57.4},
{-72,-18},{38,-18},{38,-34},{50,-34},{50,-48}},
color={255,0,255}));
connect(sigBus.nSet, nConGain.u) annotation (Line(
connect(sigBus.ySet, nConGain.u) annotation (Line(
points={{1,104},{1.77636e-15,104},{1.77636e-15,95.6}},
color={255,204,51},
thickness=0.5), Text(
Expand Down Expand Up @@ -659,12 +659,12 @@ package BlackBoxData "Collection of Chiller Database Records"
Real Char[2];
equation
Char =PolyData(
sigBus.nSet,
sigBus.ySet,
sigBus.TEvaOutMea,
sigBus.TConInMea,
sigBus.m_flowEvaMea,
sigBus.m_flowConMea);
if sigBus.nSet > Modelica.Constants.eps then
if sigBus.ySet > Modelica.Constants.eps then
//Get's the data from the signal Bus and calculates the power and heat flow based on the function one chooses.
QEva = Char[2];
Pel = Char[1];
Expand Down
2 changes: 1 addition & 1 deletion IBPSA/Fluid/Chillers/Examples/Chiller.mo
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ equation
points={{64,-38},{78,-38}}, color={0,127,255}));
connect(senTAct.port_b, Room.ports[2]) annotation (Line(points={{64,-38},{66,-38},
{66,1},{76,1}}, color={0,127,255}));
connect(chiller.nSet, booleanToReal.y) annotation (Line(points={{-2.83333,
connect(chiller.ySet, booleanToReal.y) annotation (Line(points={{-2.83333,
-26.84},{-3,-26.84},{-3,-45.3}}, color={0,0,127}));
connect(sinkSideMassFlowSource.ports[1], chiller.port_a1) annotation (Line(
points={{-34,-48},{-12.5,-48},{-12.5,-23}}, color={0,127,255}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ equation
-80},{0,-110}}, color={0,0,127}));
connect(realCorr.y, nTimesSF.u2) annotation (Line(points={{-15,39.7},{-15,
31.4},{-15.2,31.4}}, color={0,0,127}));
connect(sigBus.nSet, nTimesSF.u1) annotation (Line(
connect(sigBus.ySet, nTimesSF.u1) annotation (Line(
points={{1,104},{-2,104},{-2,31.4},{-6.8,31.4}},
color={255,204,51},
thickness=0.5), Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ equation
string="%first",
index=-1,
extent={{-6,3},{-6,3}}));
connect(sigBus.nSet, nConGain.u) annotation (Line(
connect(sigBus.ySet, nConGain.u) annotation (Line(
points={{1,104},{-22,104},{-22,84.8}},
color={255,204,51},
thickness=0.5), Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ equation
index=1,
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
connect(passThroughYSet.u, sigBus.nSet) annotation (Line(points={{-34,81.2},{-34,
connect(passThroughYSet.u, sigBus.ySet) annotation (Line(points={{-34,81.2},{-34,
104},{1,104}}, color={0,0,127}), Text(
string="%second",
index=1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ equation
36},{50,39}}, color={0,0,127}));
connect(const_minCOP.y, max.u2) annotation (Line(points={{5,39.5},{5,36},{27.6,
36},{27.6,32.8}}, color={0,0,127}));
connect(multiplex3_1.u1[1], sigBus.nSet) annotation (Line(points={{4.2,85.2},
connect(multiplex3_1.u1[1], sigBus.ySet) annotation (Line(points={{4.2,85.2},
{4.2,90},{14,90},{14,104},{1,104}}, color={0,0,127}), Text(
string="%second",
index=1,
Expand Down
2 changes: 1 addition & 1 deletion IBPSA/Fluid/HeatPumps/Controls/AntiFreeze.mo
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ model AntiFreeze "Model to prevent source from freezing"
annotation (Placement(transformation(extent={{-104,-24},{-84,-4}})));

equation
connect(nSet,swiErr.u1) annotation (Line(points={{-136,20},{32,20},{32,8},{84,
connect(ySet,swiErr.u1) annotation (Line(points={{-136,20},{32,20},{32,8},{84,
8}}, color={0,0,127}));
connect(booConAntFre.y, swiErr.u2) annotation (Line(
points={{16.7,-29},{16.7,-28},{42,-28},{42,0},{84,0}},
Expand Down
2 changes: 1 addition & 1 deletion IBPSA/Fluid/HeatPumps/Controls/BaseClasses.mo
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ For the boundaries of the y-input value, a dynamic hysteresis is used to ensure
end BoundaryMapIcon;

partial block PartialSafetyControl "Base Block"
Modelica.Blocks.Interfaces.RealInput nSet
Modelica.Blocks.Interfaces.RealInput ySet
"Set value relative speed of compressor. Analog from 0 to 1"
annotation (Placement(transformation(extent={{-152,4},{-120,36}})));
Modelica.Blocks.Interfaces.RealOutput nOut
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
within IBPSA.Fluid.HeatPumps.Controls.BaseClasses;
model InverterControlledHP "Converter model for an inverter / speed controlled HP modulating between 0 and 1"
extends PartialTSetToNSet;
extends PartialTSetToYSet;
parameter Real hys "Hysteresis of controller";
Modelica.Blocks.Logical.OnOffController onOffController(bandwidth=hys,
pre_y_start=false) "Hysteresis controller for set temperature"
Expand Down
2 changes: 1 addition & 1 deletion IBPSA/Fluid/HeatPumps/Controls/BaseClasses/OnOffHP.mo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
within IBPSA.Fluid.HeatPumps.Controls.BaseClasses;
model OnOffHP "Controller gives full speed or stop signal depending on temperature hysteresis"
extends IBPSA.Fluid.HeatPumps.Controls.BaseClasses.PartialTSetToNSet;
extends IBPSA.Fluid.HeatPumps.Controls.BaseClasses.PartialTSetToYSet;
parameter Real hys "Hysteresis of controller";
Modelica.Blocks.Logical.OnOffController onOffController(bandwidth=hys, pre_y_start=false) "Hysteresis controller for set temperature"
annotation (Placement(transformation(extent={{-54,10},{-26,38}})));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
within IBPSA.Fluid.HeatPumps.Controls.BaseClasses;
partial model PartialTSetToNSet
partial model PartialTSetToYSet
"Partial model to convert set temperature to compressor speed of heat pump"
parameter Boolean use_secHeaGen=false
"True to choose a bivalent system" annotation(choices(checkBox=true));
Expand Down Expand Up @@ -101,4 +101,4 @@ equation
</li>
</ul>
</html>"));
end PartialTSetToNSet;
end PartialTSetToYSet;
2 changes: 1 addition & 1 deletion IBPSA/Fluid/HeatPumps/Controls/BaseClasses/package.order
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
InverterControlledHP
OnOffHP
PartialHPController
PartialTSetToNSet
PartialTSetToYSet
4 changes: 2 additions & 2 deletions IBPSA/Fluid/HeatPumps/Controls/DefrostControl.mo
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ block DefrostControl
origin={10,52})));
Modelica.Blocks.Interfaces.BooleanInput modeSet "Set value of HP mode"
annotation (Placement(transformation(extent={{-132,-36},{-100,-4}})));
Modelica.Blocks.Interfaces.RealInput nSet
Modelica.Blocks.Interfaces.RealInput ySet
"Set value relative speed of compressor. Analog from 0 to 1"
annotation (Placement(transformation(extent={{-132,4},{-100,36}})));
IBPSA.Utilities.Logical.SmoothSwitch swiErr
Expand Down Expand Up @@ -89,7 +89,7 @@ equation
{56,4}}, color={0,0,127}));
connect(swiErr.y, nOut) annotation (Line(points={{79,12},{96,12},{96,20},{110,
20}}, color={0,0,127}));
connect(nSet, swiErr.u1) annotation (Line(points={{-116,20},{56,20}},
connect(ySet, swiErr.u1) annotation (Line(points={{-116,20},{56,20}},
color={0,0,127}));
connect(sigBusHP.iceFacMea, iceFacGreMinHea.u) annotation (Line(
points={{-105.93,-61.93},{-68,-61.93},{-68,-78},{-40.6,-78}},
Expand Down
30 changes: 15 additions & 15 deletions IBPSA/Fluid/HeatPumps/Controls/OnOffControl.mo
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ model OnOffControl
annotation (Dialog(enable=use_runPerHou));
parameter Boolean pre_n_start=true "Start value of pre(n) at initial time";
Modelica.Blocks.Logical.GreaterThreshold
nSetGreaterZero(final threshold=Modelica.Constants.eps)
ySetGreaterZero(final threshold=Modelica.Constants.eps)
"True if device is set on"
annotation (Placement(transformation(extent={{-110,56},{-94,72}})));
Modelica.Blocks.Logical.And andRun
Expand Down Expand Up @@ -56,19 +56,19 @@ model OnOffControl
Modelica.Blocks.Logical.And andIsOn
"Check if both set and actual value are greater zero"
annotation (Placement(transformation(extent={{16,12},{28,24}})));
Modelica.Blocks.Interfaces.RealInput nSet
Modelica.Blocks.Interfaces.RealInput ySet
"Set value relative speed of compressor. Analog from 0 to 1"
annotation (Placement(transformation(extent={{-152,-16},{-120,16}})));
Modelica.Blocks.Interfaces.RealOutput nOut
"Relative speed of compressor. From 0 to 1"
annotation (Placement(transformation(extent={{120,-10},{140,10}})));
IBPSA.Controls.Interfaces.VapourCompressionMachineControlBus sigBusHP
annotation (Placement(transformation(extent={{-152,-84},{-118,-54}})));
IBPSA.Utilities.Logical.SmoothSwitch swinOutnSet
"If any of the ornSet conditions is true, nSet will be passed. Else nOut will stay the same"
IBPSA.Utilities.Logical.SmoothSwitch swinOutySet
"If any of the orySet conditions is true, ySet will be passed. Else nOut will stay the same"
annotation (Placement(transformation(extent={{90,-10},{110,10}})));
Modelica.Blocks.MathBoolean.Or orSetN(nu=4)
"Output is true if nSet value is correct"
"Output is true if ySet value is correct"
annotation (Placement(transformation(extent={{52,-10},{72,10}})));
Modelica.Blocks.Logical.And andIsOff
"Check if both set and actual value are equal to zero"
Expand Down Expand Up @@ -102,25 +102,25 @@ equation
color={255,0,255},
pattern=LinePattern.Dash));

connect(nSet,nSetGreaterZero. u) annotation (Line(points={{-136,0},{-120,0},{-120,
connect(ySet,ySetGreaterZero. u) annotation (Line(points={{-136,0},{-120,0},{-120,
64},{-111.6,64}}, color={0,0,127}));
connect(nSetGreaterZero.y, notSetOn.u) annotation (Line(points={{-93.2,64},{-78,
connect(ySetGreaterZero.y, notSetOn.u) annotation (Line(points={{-93.2,64},{-78,
64},{-78,77},{-67,77}}, color={255,0,255}));
connect(pre1.y, andIsOn.u2) annotation (Line(points={{-71.4,-42},{-71.4,12},{-72,
12},{-72,14},{-42,14},{-42,13.2},{14.8,13.2}},
color={255,0,255}));
connect(nSetGreaterZero.y, andIsOn.u1) annotation (Line(points={{-93.2,64},{-86,
connect(ySetGreaterZero.y, andIsOn.u1) annotation (Line(points={{-93.2,64},{-86,
64},{-86,18},{14.8,18}}, color={255,0,255}));
connect(nOut, nOut)
annotation (Line(points={{130,0},{130,0}}, color={0,0,127}));
connect(swinOutnSet.y, nOut)
connect(swinOutySet.y, nOut)
annotation (Line(points={{111,0},{130,0}}, color={0,0,127}));
connect(nSet, swinOutnSet.u1) annotation (Line(points={{-136,0},{-120,0},{
connect(ySet, swinOutySet.u1) annotation (Line(points={{-136,0},{-120,0},{
-120,98},{78,98},{78,8},{88,8}},
color={0,0,127}));
connect(andTurnOff.y, andRun.u1) annotation (Line(points={{0.6,86},{8,86},{8,78},
{16.8,78}}, color={255,0,255}));
connect(orSetN.y, swinOutnSet.u2)
connect(orSetN.y, swinOutySet.u2)
annotation (Line(points={{73.5,0},{88,0}}, color={255,0,255}));
connect(notSetOn.y, andIsOff.u1) annotation (Line(points={{-55.5,77},{-50,77},
{-50,42},{16,42},{16,38},{14.8,38}}, color={255,0,255}));
Expand All @@ -143,13 +143,13 @@ equation
{-50,81.2},{-13.2,81.2}}, color={255,0,255}));
connect(pre1.y, andTurnOff.u1) annotation (Line(points={{-71.4,-42},{-72,-42},
{-72,86},{-13.2,86}}, color={255,0,255}));
connect(nSetGreaterZero.y, andTurnOn.u2) annotation (Line(points={{-93.2,64},{
connect(ySetGreaterZero.y, andTurnOn.u2) annotation (Line(points={{-93.2,64},{
-86,64},{-86,-98},{24,-98},{24,-88.8},{26.8,-88.8}}, color={255,0,255}));
connect(notIsOn.y, andTurnOn.u1) annotation (Line(points={{-57.6,-18},{-56,-18},
{-56,-96},{22,-96},{22,-84},{26.8,-84}}, color={255,0,255}));
connect(notIsOn.y, andIsOff.u2) annotation (Line(points={{-57.6,-18},{-56,-18},
{-56,33.2},{14.8,33.2}}, color={255,0,255}));
connect(sigBusHP.nSet, swinOutnSet.u3) annotation (Line(
connect(sigBusHP.ySet, swinOutySet.u3) annotation (Line(
points={{-134.915,-68.925},{-134.915,-104},{78,-104},{78,-8},{88,-8}},
color={255,204,51},
thickness=0.5), Text(
Expand All @@ -168,11 +168,11 @@ equation
extent={{-6,3},{-6,3}},
horizontalAlignment=TextAlignment.Right));
annotation (Documentation(info="<html><p>
Checks if the nSet value is legal by checking if the device can
Checks if the ySet value is legal by checking if the device can
either be turned on or off, depending on which state it was in.
</p>
<p>
E.g. If it is turned on, and the new nSet value is 0, it will only
E.g. If it is turned on, and the new ySet value is 0, it will only
turn off if current runtime is longer than the minimal runtime. Else
it will keep the current rotating speed.
</p>
Expand Down
2 changes: 1 addition & 1 deletion IBPSA/Fluid/HeatPumps/Controls/OperationalEnvelope.mo
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ block OperationalEnvelope
equation
connect(boundaryMap.noErr, swiErr.u2) annotation (Line(points={{-1.1,-3},{42,
-3},{42,0},{84,0}}, color={255,0,255}));
connect(nSet,swiErr.u1) annotation (Line(points={{-136,20},{32,20},{32,8},
connect(ySet,swiErr.u1) annotation (Line(points={{-136,20},{32,20},{32,8},
{84,8}},color={0,0,127}));
connect(booConOpeEnv.y, swiErr.u2) annotation (Line(
points={{24.7,-29},{24.7,-28},{42,-28},{42,0},{84,0}},
Expand Down
Loading

0 comments on commit 3e96e3e

Please sign in to comment.