Skip to content

Commit

Permalink
Restructure, move iceFac to innerCycle, adjust names and grids #1576
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian.wuellhorst committed Jun 1, 2022
1 parent 79c3ecf commit 57b1411
Show file tree
Hide file tree
Showing 72 changed files with 647 additions and 526 deletions.
4 changes: 2 additions & 2 deletions IBPSA/Fluid/Chillers/BaseClasses/InnerCycle_Chiller.mo
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ model InnerCycle_Chiller "Blackbox model of refrigerant cycle of a chiller"
annotation (choicesAllMatching=true);

replaceable model PerDataRevChi =
IBPSA.Fluid.HeatPumps.BlackBoxData.BlackBox.BaseClasses.PartialBlackBox
IBPSA.Fluid.HeatPumps.BlackBoxData.BaseClasses.PartialBlackBox
constrainedby
IBPSA.Fluid.HeatPumps.BlackBoxData.BlackBox.BaseClasses.PartialBlackBox(
IBPSA.Fluid.HeatPumps.BlackBoxData.BaseClasses.PartialBlackBox(
final scalingFactor = scalingFactor)
"Replaceable model for performance data of a chiller in reversible operation mode"
annotation (Dialog(enable=use_rev),choicesAllMatching=true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,15 @@ partial model PartialBlackBox
protected
parameter Real scalingFactor=1 "Scaling factor of chiller";

annotation (Icon(graphics={ Rectangle(
extent={{-100,-100},{100,100}},
lineColor={0,0,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid), Text(
extent={{-57.5,-35},{57.5,35}},
lineColor={0,0,255},
pattern=LinePattern.Dash,
textString="%name
", origin={-3.5,-15},
rotation=180)}));
end PartialBlackBox;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ model PolynomalApproach
IBPSA.Fluid.Chillers.BlackBoxData.BlackBox.BaseClasses.PartialBlackBox;

replaceable function PolyData =
IBPSA.Fluid.HeatPumps.BlackBoxData.Functions.Characteristics.PartialBaseFct
IBPSA.Fluid.HeatPumps.BlackBoxData.Functions.BaseClasses.PartialBaseFct
"Function to calculate peformance Data" annotation(choicesAllMatching=true);
protected
Real Char[2];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
within IBPSA.Fluid.Chillers.BlackBoxData;
record ChillerBaseDataDefinition "Basic chiller data"
extends IBPSA.Fluid.HeatPumps.BlackBoxData.HeatPumpBaseDataDefinition(
extends IBPSA.Fluid.HeatPumps.BlackBoxData.EuropeanNom2D.HeatPumpBaseDataDefinition(
tableQdot_con = tableQdot_eva);

parameter Real tableQdot_eva[:,:] "Cooling power table; T in degC; Q_flow in W";
Expand Down
2 changes: 1 addition & 1 deletion IBPSA/Fluid/Chillers/Chiller.mo
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ model Chiller
"Performance data of a chiller in main operation mode"
annotation (choicesAllMatching=true);
replaceable model PerDataRevChi =
IBPSA.Fluid.HeatPumps.BlackBoxData.BlackBox.BaseClasses.PartialBlackBox
IBPSA.Fluid.HeatPumps.BlackBoxData.BaseClasses.PartialBlackBox
"Performance data of a chiller in reversible operation mode"
annotation (Dialog(enable=use_rev),choicesAllMatching=true);

Expand Down
11 changes: 6 additions & 5 deletions IBPSA/Fluid/Chillers/Examples/Chiller.mo
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ model Chiller "Example for the reversible chiller model."
GConOut=5,
dpEva_nominal=0,
dpCon_nominal=0,
mFlow_conNominal=0.5,
mFlow_evaNominal=0.5,
mCon_flow_nominal=0.5,
mEva_flow_nominal=0.5,
use_conCap=false,
use_evaCap=false,
redeclare package Medium_con = Medium_sin,
Expand All @@ -52,9 +52,10 @@ 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.BlackBox.LookUpTable2D (smoothness=
Modelica.Blocks.Types.Smoothness.LinearSegments, dataTable=
IBPSA.Fluid.HeatPumps.BlackBoxData.EN14511.Vitocal200AWO201()),
IBPSA.Fluid.HeatPumps.BlackBoxData.LookUpTable2D (smoothness=Modelica.Blocks.Types.Smoothness.LinearSegments,
dataTable=
IBPSA.Fluid.HeatPumps.BlackBoxData.EuropeanNom2D.EN14511.Vitocal200AWO201
()),
use_rev=true,
use_autoCalc=false,
VEva=0.4,
Expand Down
52 changes: 27 additions & 25 deletions IBPSA/Fluid/HeatPumps/BaseClasses/InnerCycle_HeatPump.mo
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ model InnerCycle_HeatPump "Blackbox model of refrigerant cycle of a heat pump"
extends IBPSA.Fluid.HeatPumps.BaseClasses.PartialInnerCycle;

replaceable model BlaBoxHPHeating =
IBPSA.Fluid.HeatPumps.BlackBoxData.BlackBox.BaseClasses.PartialBlackBox
IBPSA.Fluid.HeatPumps.BlackBoxData.BaseClasses.PartialBlackBox
constrainedby
IBPSA.Fluid.HeatPumps.BlackBoxData.BlackBox.BaseClasses.PartialBlackBox(
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);
Expand All @@ -19,63 +19,65 @@ model InnerCycle_HeatPump "Blackbox model of refrigerant cycle of a heat pump"
annotation (Dialog(enable=use_rev),choicesAllMatching=true);

BlaBoxHPHeating BlackBoxHeaPumHeating
annotation (Placement(transformation(extent={{7,20},{61,76}}, rotation=0)));
annotation (Placement(transformation(extent={{60,40},{20,80}},rotation=0)));
BlaBoxHPCooling BlackBoxHeaPumCooling if use_rev
annotation (Placement(transformation(extent={{-27,-28},{27,28}}, rotation=0)));
annotation (Placement(transformation(extent={{-19,40},{-60,80}}, rotation=0)));
Modelica.Blocks.Math.Gain gainEva(final k=-1)
"Negate QEva to match definition of heat flow direction" annotation (
Placement(transformation(
extent={{-4,-4},{4,4}},
extent={{-8,-8},{8,8}},
rotation=180,
origin={-56,-6})));
origin={-32,8})));
Modelica.Blocks.Math.Gain gainCon(final k=-1) if use_rev
"Negate QCon to match definition of heat flow direction" annotation (
Placement(transformation(
extent={{-4,-4},{4,4}},
extent={{-8,-8},{8,8}},
rotation=0,
origin={58,-20})));
origin={30,-8})));

equation

connect(BlackBoxHeaPumHeating.QCon_flow, switchQCon.u1)
annotation (Line(points={{12.4,17.2},{12.4,-4},{68,-4}}, color={0,0,127}));
connect(BlackBoxHeaPumHeating.Pel, switchPel.u1) annotation (Line(points={{34,
17.2},{34,-30},{8,-30},{8,-68}}, color={0,0,127}));
annotation (Line(points={{56,38},{56,8},{58,8}}, color={0,0,127}));
connect(BlackBoxHeaPumHeating.Pel, switchPel.u1) annotation (Line(points={{40,38},
{40,30},{86,30},{86,-52},{8,-52},{8,-58}},
color={0,0,127}));
connect(BlackBoxHeaPumCooling.Pel, switchPel.u3) annotation (Line(
points={{0,-30.8},{0,-30},{-8,-30},{-8,-68}},
points={{-39.5,38},{-40,38},{-40,30},{-90,30},{-90,-50},{-8,-50},{-8,-58}},
color={0,0,127},
pattern=LinePattern.Dash));
connect(BlackBoxHeaPumCooling.QEva_flow, switchQEva.u3) annotation (Line(
points={{21.6,-30.8},{21.6,-22},{-68,-22}},
points={{-55.9,38},{-56,38},{-56,24},{-52,24},{-52,-8},{-58,-8}},
color={0,0,127},
pattern=LinePattern.Dash));
connect(constZero.y, switchPel.u3)
annotation (Line(points={{-59,-68},{-34,-68},{-34,-68},{-8,-68}},
annotation (Line(points={{-59,-70},{-40,-70},{-40,-50},{-8,-50},{-8,-58}},
color={0,0,127}));
connect(constZero.y, switchQEva.u3) annotation (Line(points={{-59,-68},{-52,-68},
{-52,-22},{-68,-22}}, color={0,0,127},
connect(constZero.y, switchQEva.u3) annotation (Line(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},{-20,
-70},{-20,-20},{50,-20},{50,-8},{58,-8}},
color={0,0,127},
pattern=LinePattern.Dash));
connect(gainEva.y, switchQEva.u1)
annotation (Line(points={{-60.4,-6},{-68,-6}}, color={0,0,127}));
annotation (Line(points={{-40.8,8},{-58,8}}, color={0,0,127}));
connect(switchQCon.u3, gainCon.y) annotation (Line(
points={{68,-20},{62.4,-20}},
points={{58,-8},{38.8,-8}},
color={0,0,127},
pattern=LinePattern.Dash));
connect(BlackBoxHeaPumCooling.QCon_flow, gainCon.u) annotation (Line(
points={{-21.6,-30.8},{-21.6,2},{-24,2},{-24,-20},{53.2,-20}},
points={{-23.1,38},{-24,38},{-24,32},{10,32},{10,-8},{20.4,-8}},
color={0,0,127},
pattern=LinePattern.Dash));
connect(BlackBoxHeaPumHeating.QEva_flow, gainEva.u) annotation (Line(points={{
55.6,17.2},{55.6,-6},{-51.2,-6}}, color={0,0,127}));
connect(BlackBoxHeaPumHeating.QEva_flow, gainEva.u) annotation (Line(points={{24,38},
{24,8},{-22.4,8}}, color={0,0,127}));
connect(sigBus, BlackBoxHeaPumCooling.sigBus) annotation (Line(
points={{0,102},{0,86},{0.27,86},{0.27,29.12}},
points={{0,102},{0,90},{-40,90},{-40,86},{-39.705,86},{-39.705,80.8}},
color={255,204,51},
thickness=0.5));
connect(sigBus, BlackBoxHeaPumHeating.sigBus) annotation (Line(
points={{0,102},{0,86},{34.27,86},{34.27,77.12}},
points={{0,102},{0,90},{39.8,90},{39.8,80.8}},
color={255,204,51},
thickness=0.5));
annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
Expand Down
33 changes: 17 additions & 16 deletions IBPSA/Fluid/HeatPumps/BaseClasses/PartialInnerCycle.mo
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,25 @@ partial model PartialInnerCycle
extent={{-16,88},{18,118}})));
Modelica.Blocks.Sources.Constant constZero(final k=0) if not use_rev
"If no heating is used, the switches may still be connected"
annotation (Placement(transformation(extent={{-80,-78},{-60,-58}})));
Modelica.Blocks.Interfaces.RealOutput QCon(unit="W", displayUnit="kW") "Heat Flow to condenser"
annotation (Placement(transformation(extent={{-80,-80},{-60,-60}})));
Modelica.Blocks.Interfaces.RealOutput QCon_flow(unit="W", displayUnit="kW")
"Heat Flow to condenser"
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
Modelica.Blocks.Interfaces.RealOutput QEva(unit="W", displayUnit="kW") "Heat flow from evaporator"
Modelica.Blocks.Interfaces.RealOutput QEva_flow(unit="W", displayUnit="kW")
"Heat flow from evaporator"
annotation (Placement(transformation(extent={{-100,-10},{-120,10}})));
Modelica.Blocks.Logical.Switch switchQEva(
u1(unit="W", displayUnit="kW"),
u3(unit="W", displayUnit="kW"),
y(unit="W", displayUnit="kW"))
"If mode is false, Condenser becomes Evaporator and vice versa"
annotation (Placement(transformation(extent={{-70,-24},{-90,-4}})));
annotation (Placement(transformation(extent={{-60,-10},{-80,10}})));
Modelica.Blocks.Logical.Switch switchQCon(
y(unit="W", displayUnit="kW"),
u1(unit="W", displayUnit="kW"),
u3(unit="W", displayUnit="kW"))
"If mode is false, Condenser becomes Evaporator and vice versa"
annotation (Placement(transformation(extent={{70,-22},{90,-2}})));
annotation (Placement(transformation(extent={{60,-10},{80,10}})));
Modelica.Blocks.Interfaces.RealOutput Pel(unit="W", displayUnit="kW")
"Electrical power consumed by compressor" annotation (Placement(
transformation(
Expand All @@ -42,7 +44,7 @@ partial model PartialInnerCycle
transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={0,-80})));
origin={0,-70})));

Modelica.Blocks.Routing.BooleanPassThrough modeSetAssert
"Pass through to enable assertion for non-reversible device";
Expand All @@ -51,27 +53,26 @@ equation
"Can't turn to reversible operation mode on irreversible vapour compression machine",
level=AssertionLevel.error);

connect(switchQEva.y, QEva) annotation (Line(points={{-91,-14},{-94,-14},{-94,
0},{-110,0}}, color={0,0,127}));
connect(switchPel.y, Pel) annotation (Line(points={{-2.22045e-15,-91},{
-2.22045e-15,-110.5},{0.5,-110.5}},
color={0,0,127}));
connect(switchQEva.y, QEva_flow)
annotation (Line(points={{-81,0},{-110,0}}, color={0,0,127}));
connect(switchPel.y, Pel) annotation (Line(points={{-1.9984e-15,-81},{
-1.9984e-15,-95.75},{0.5,-95.75},{0.5,-110.5}}, color={0,0,127}));
connect(sigBus.modeSet, switchPel.u2) annotation (Line(
points={{0,102},{0,-68},{2.22045e-15,-68}},
points={{0,102},{0,22},{2.22045e-15,22},{2.22045e-15,-58}},
color={255,204,51},
thickness=0.5), Text(
string="%first",
index=-1,
extent={{-6,3},{-6,3}}));

connect(switchQCon.y, QCon) annotation (Line(points={{91,-12},{94,-12},{94,0},
{110,0}}, color={0,0,127}));
connect(switchQCon.y, QCon_flow)
annotation (Line(points={{81,0},{110,0}}, color={0,0,127}));
connect(sigBus.modeSet, switchQEva.u2) annotation (Line(
points={{0,102},{-64,102},{-64,-14},{-68,-14}},
points={{0,102},{0,0},{-58,0}},
color={255,204,51},
thickness=0.5));
connect(sigBus.modeSet, switchQCon.u2) annotation (Line(
points={{0,102},{64,102},{64,-12},{68,-12}},
points={{0,102},{0,0},{58,0}},
color={255,204,51},
thickness=0.5));
connect(modeSetAssert.u, sigBus.modeSet);
Expand Down
Loading

0 comments on commit 57b1411

Please sign in to comment.