Skip to content

Commit

Permalink
Add SafetyControl.mo to heat pump and align grid for most models #1576
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian.wuellhorst committed Jun 23, 2022
1 parent 57b1411 commit 8b8811f
Show file tree
Hide file tree
Showing 42 changed files with 852 additions and 712 deletions.
29 changes: 15 additions & 14 deletions IBPSA/Fluid/Chillers/BaseClasses/InnerCycle_Chiller.mo
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@ model InnerCycle_Chiller "Blackbox model of refrigerant cycle of a chiller"
replaceable model PerDataMainChi =
IBPSA.Fluid.Chillers.BlackBoxData.BlackBox.BaseClasses.PartialBlackBox
constrainedby
IBPSA.Fluid.Chillers.BlackBoxData.BlackBox.BaseClasses.PartialBlackBox(
final scalingFactor = scalingFactor)
IBPSA.Fluid.Chillers.BlackBoxData.BlackBox.BaseClasses.PartialBlackBox
"Replaceable model for performance data of a chiller in main operation mode"
annotation (choicesAllMatching=true);

replaceable model PerDataRevChi =
IBPSA.Fluid.HeatPumps.BlackBoxData.BaseClasses.PartialBlackBox
constrainedby
IBPSA.Fluid.HeatPumps.BlackBoxData.BaseClasses.PartialBlackBox(
final scalingFactor = scalingFactor)
IBPSA.Fluid.HeatPumps.BlackBoxData.BaseClasses.PartialBlackBox
"Replaceable model for performance data of a chiller in reversible operation mode"
annotation (Dialog(enable=use_rev),choicesAllMatching=true);

Expand Down Expand Up @@ -42,20 +40,21 @@ model InnerCycle_Chiller "Blackbox model of refrigerant cycle of a chiller"
equation

connect(PerformanceDataChillerCooling.Pel, switchPel.u1) annotation (Line(
points={{34,17.2},{34,-30},{8,-30},{8,-68}}, color={0,0,127}));
points={{34,17.2},{34,-30},{8,-30},{8,-58}}, color={0,0,127}));
connect(PerformanceDataChillerHeating.Pel, switchPel.u3) annotation (Line(
points={{-34,17.2},{-34,-30},{-8,-30},{-8,-68}},
points={{-34,17.2},{-34,-30},{-8,-30},{-8,-58}},
color={0,0,127},
pattern=LinePattern.Dash));
connect(constZero.y, switchPel.u3) annotation (Line(points={{-59,-68},{-34,-68},{-34,-68},{-8,-68}},
connect(constZero.y, switchPel.u3) annotation (Line(points={{-59,-70},{-34,-70},
{-34,-58},{-8,-58}},
color={0,0,127},
pattern=LinePattern.Dash));
connect(constZero.y, switchQEva.u3) annotation (Line(
points={{-59,-68},{-52,-68},{-52,-22},{-68,-22}},
points={{-59,-70},{-52,-70},{-52,-8},{-58,-8}},
color={0,0,127},
pattern=LinePattern.Dash));
connect(constZero.y, switchQCon.u3) annotation (Line(points={{-59,-68},{-52,-68},
{-52,-38},{68,-38},{68,-20}}, color={0,0,127},
connect(constZero.y, switchQCon.u3) annotation (Line(points={{-59,-70},{-52,-70},
{-52,-38},{58,-38},{58,-8}}, color={0,0,127},
pattern=LinePattern.Dash));
connect(sigBus, PerformanceDataChillerHeating.sigBus) annotation (Line(
points={{0,102},{0,86},{-33.73,86},{-33.73,77.12}},
Expand All @@ -69,21 +68,23 @@ equation
connect(PerformanceDataChillerCooling.QEva_flow, gainEva.u) annotation (Line(
points={{55.6,17.2},{55.6,-6},{-45.2,-6}}, color={0,0,127}));
connect(gainEva.y, switchQEva.u1)
annotation (Line(points={{-54.4,-6},{-68,-6}}, color={0,0,127}));
annotation (Line(points={{-54.4,-6},{-56,-6},{-56,8},{-58,8}},
color={0,0,127}));
connect(PerformanceDataChillerHeating.QEva_flow, switchQEva.u3) annotation (
Line(
points={{-12.4,17.2},{-12.4,-22},{-68,-22}},
points={{-12.4,17.2},{-12.4,-8},{-58,-8}},
color={0,0,127},
pattern=LinePattern.Dash));
connect(PerformanceDataChillerHeating.QCon_flow, gainCon.u) annotation (Line(
points={{-55.6,17.2},{-55.6,2},{-24,2},{-24,-20},{45.2,-20}},
color={0,0,127},
pattern=LinePattern.Dash));
connect(gainCon.y, switchQCon.u3)
annotation (Line(points={{54.4,-20},{68,-20}}, color={0,0,127},
annotation (Line(points={{54.4,-20},{56,-20},{56,-8},{58,-8}},
color={0,0,127},
pattern=LinePattern.Dash));
connect(PerformanceDataChillerCooling.QCon_flow, switchQCon.u1) annotation (
Line(points={{12.4,17.2},{12.4,4},{62,4},{62,-4},{68,-4}}, color={0,0,127}));
Line(points={{12.4,17.2},{12.4,4},{62,4},{62,8},{58,8}}, color={0,0,127}));
annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
Rectangle(
extent={{-100,100},{100,-100}},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ model LookUpTable2D "Performance data coming from manufacturer"
final u1(unit="degC"),
final u2(unit="degC"),
final y(unit="W", displayUnit="kW"),
final table=dataTable.tableP_ele) "Electrical power table" annotation (
final table=dataTable.tablePel) "Electrical power table" annotation (
extent=[-60,-20; -40,0], Placement(transformation(
extent={{-14,-14},{14,14}},
rotation=-90,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
within IBPSA.Fluid.Chillers.BlackBoxData;
record ChillerBaseDataDefinition "Basic chiller data"
extends IBPSA.Fluid.HeatPumps.BlackBoxData.EuropeanNom2D.HeatPumpBaseDataDefinition(
tableQdot_con = tableQdot_eva);
tableQCon_flow = tableQdot_eva);

parameter Real tableQdot_eva[:,:] "Cooling power table; T in degC; Q_flow in W";

Expand Down
6 changes: 3 additions & 3 deletions IBPSA/Fluid/Chillers/BlackBoxData/EN14511/Vitocal200AWO201.mo
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
within IBPSA.Fluid.Chillers.BlackBoxData.EN14511;
record Vitocal200AWO201 "Vitocal200AWO201Chilling"
extends IBPSA.Fluid.Chillers.BlackBoxData.ChillerBaseDataDefinition(
tableP_ele=[0,20,25,27,30,35; 7,1380.0,1590.0,1680.0,1800.0,1970.0; 18,
tablePel=[0,20,25,27,30,35; 7,1380.0,1590.0,1680.0,1800.0,1970.0; 18,
950.0,1060.0,1130.0,1200.0,1350.0],
tableQdot_eva=[0,20,25,27,30,35; 7,2540.0,2440.0,2370.0,2230.0,2170.0;
18,5270.0,5060.0,4920.0,4610.0,4500.0],
mFlow_conNom=3960/4180/5,
mFlow_evaNom=(2250*1.2)/3600,
mCon_flow_nominal=3960/4180/5,
mEva_flow_nominal=(2250*1.2)/3600,
tableUppBou=[20,20; 35,20]);

annotation (
Expand Down
31 changes: 28 additions & 3 deletions IBPSA/Fluid/Chillers/Chiller.mo
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
within IBPSA.Fluid.Chillers;
model Chiller
"Grey-box model for reversible chillers using a black-box to simulate the refrigeration cycle"
extends IBPSA.Fluid.HeatPumps.BaseClasses.PartialReversibleVapourCompressionMachine(
extends
IBPSA.Fluid.HeatPumps.BaseClasses.PartialReversibleVapourCompressionMachine(
mEva_flow_nominal=QUse_flow_nominal/(dTEva_nominal*cpEva),
final use_safetyControl=false,
use_rev=true,
final machineType = false,
redeclare IBPSA.Fluid.Chillers.BaseClasses.InnerCycle_Chiller innerCycle(
final use_rev=use_rev,
final scalingFactor=scalingFactor,
redeclare model PerDataMainChi = PerDataMainChi,
redeclare model PerDataRevChi = PerDataRevChi));

Expand All @@ -26,6 +27,30 @@ equation
index=1,
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
connect(modeSet, sigBus.modeSet) annotation (Line(points={{-116,-90},{-80,-90},
{-80,-43},{-105,-43}}, color={255,0,255}), Text(
string="%second",
index=1,
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
connect(onOffSet, sigBus.onOffSet) annotation (Line(points={{-116,-20},{-80,-20},
{-80,-43},{-105,-43}}, color={255,0,255}), Text(
string="%second",
index=1,
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
connect(ySet, sigBus.ySet) annotation (Line(points={{-116,20},{-80,20},{-80,-43},
{-105,-43}}, color={0,0,127}), Text(
string="%second",
index=1,
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
connect(onOffSet, sigBus.onOffMea) annotation (Line(points={{-116,-20},{-80,-20},
{-80,-43},{-105,-43}}, color={255,0,255}), Text(
string="%second",
index=1,
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
annotation (Icon(coordinateSystem(extent={{-100,-120},{100,120}}), graphics={
Rectangle(
extent={{-16,83},{16,-83}},
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 @@ -52,7 +52,7 @@ model Chiller "Example for the reversible chiller model."
IBPSA.Fluid.Chillers.BlackBoxData.BlackBox.LookUpTable2D (dataTable=
IBPSA.Fluid.Chillers.BlackBoxData.EN14511.Vitocal200AWO201()),
redeclare model PerDataRevChi =
IBPSA.Fluid.HeatPumps.BlackBoxData.LookUpTable2D (smoothness=Modelica.Blocks.Types.Smoothness.LinearSegments,
IBPSA.Fluid.HeatPumps.BlackBoxData.EuropeanNorm2D (smoothness=Modelica.Blocks.Types.Smoothness.LinearSegments,
dataTable=
IBPSA.Fluid.HeatPumps.BlackBoxData.EuropeanNom2D.EN14511.Vitocal200AWO201
()),
Expand Down
6 changes: 0 additions & 6 deletions IBPSA/Fluid/HeatPumps/BaseClasses/InnerCycle_HeatPump.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@ model InnerCycle_HeatPump "Blackbox model of refrigerant cycle of a heat pump"

replaceable model BlaBoxHPHeating =
IBPSA.Fluid.HeatPumps.BlackBoxData.BaseClasses.PartialBlackBox
constrainedby
IBPSA.Fluid.HeatPumps.BlackBoxData.BaseClasses.PartialBlackBox(
final scalingFactor = scalingFactor)
"Replaceable model for black box data of a heat pump in main operation mode"
annotation (choicesAllMatching=true);

replaceable model BlaBoxHPCooling =
IBPSA.Fluid.Chillers.BlackBoxData.BlackBox.BaseClasses.PartialBlackBox
constrainedby
IBPSA.Fluid.Chillers.BlackBoxData.BlackBox.BaseClasses.PartialBlackBox(
final scalingFactor = scalingFactor)
"Replaceable model for black box data of a heat pump in reversible operation mode"
annotation (Dialog(enable=use_rev),choicesAllMatching=true);

Expand Down
2 changes: 0 additions & 2 deletions IBPSA/Fluid/HeatPumps/BaseClasses/PartialInnerCycle.mo
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ partial model PartialInnerCycle
"Blackbox model of refrigerant cycle of a vapour compression machine (heat pump or chiller)"

parameter Boolean use_rev=true "True if the vapour compression machine is reversible";
parameter Real scalingFactor=1 "Scaling factor of vapour compression machine";

IBPSA.Fluid.Interfaces.VapourCompressionMachineControlBus sigBus annotation (
Placement(transformation(extent={{-18,86},{18,118}}), iconTransformation(
extent={{-16,88},{18,118}})));
Expand Down
Loading

0 comments on commit 8b8811f

Please sign in to comment.