Skip to content

Commit

Permalink
Add COP and EER calculation to models
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian.wuellhorst committed Oct 8, 2023
1 parent 165c212 commit ec91f38
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ partial model PartialChillerCycle
extends
IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialRefrigerantCycle;

HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.CalculateCoefficientOfPerformance
calEER(PEleMin=PEle_nominal*0.01) "Calculate the EER"
annotation (Placement(transformation(extent={{-80,-60},{-100,-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,
Expand All @@ -12,6 +15,14 @@ equation
index=1,
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
connect(calEER.COP, sigBus.EER) annotation (Line(points={{-101,-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}));
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 @@ -50,6 +50,8 @@ equation
horizontalAlignment=TextAlignment.Right));
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}));
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 @@ -24,8 +24,7 @@ model TableData2D
final perDevMasFloEva=(mEva_flow_nominal - datTab.mEva_flow_nominal*scaFac)/mEva_flow_nominal*100,
final perDevMasFloCon=(mCon_flow_nominal - datTab.mCon_flow_nominal*scaFac)/mCon_flow_nominal*100,
constScaFac(final k=scaFac));
parameter IBPSA.Fluid.Chillers.ModularReversible.Data.TableData2D.Generic datTab=
IBPSA.Fluid.Chillers.ModularReversible.Data.TableData2D.EN14511.Vitocal200AWO201()
parameter IBPSA.Fluid.Chillers.ModularReversible.Data.TableData2D.Generic datTab
"Data Table of Chiller" annotation (choicesAllMatching=true);

equation
Expand Down Expand Up @@ -66,6 +65,8 @@ equation
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}));
annotation (Icon(graphics={
Line(points={{-60.0,40.0},{-60.0,-40.0},{60.0,-40.0},{60.0,40.0},
{30.0,40.0},{30.0,-40.0},{-30.0,-40.0},{-30.0,40.0},{-60.0,40.0},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
within IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses;
model CalculateCoefficientOfPerformance
"Calculate the COP or EER of a device"

parameter Modelica.Units.SI.Power PEleMin(min=Modelica.Constants.eps)
"If eletrical power consumption falls below this value, COP will not be calculated";

Modelica.Blocks.Interfaces.RealInput PEle(final unit="W", final displayUnit="kW")
"Electrical power consumed by the system" annotation (Placement(
transformation(extent={{-140,-60},{-100,-20}}), iconTransformation(extent=
{{-140,-60},{-100,-20}})));
Modelica.Blocks.Interfaces.RealInput QUse_flow(final unit="W", final
displayUnit="kW") "Useful heat flow" annotation (Placement(transformation(
extent={{-140,20},{-100,60}}), iconTransformation(extent={{-140,20},{-100,
60}})));
Modelica.Blocks.Interfaces.RealOutput COP "Output for calculated COP value"
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
Modelica.Blocks.Logical.Hysteresis hys(uLow=PEleMin, uHigh=PEleMin*1.1)
"Hysteresis to switch between calculation and no calculation"
annotation (Placement(transformation(extent={{-60,-50},{-40,-30}})));
equation
if hys.y then
COP = QUse_flow/PEle;
else
COP = 0;
end if;


connect(hys.u, PEle)
annotation (Line(points={{-62,-40},{-120,-40}}, color={0,0,127}));
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
coordinateSystem(preserveAspectRatio=false)),
Documentation(revisions="<html><ul>
<li>
<i>November 26, 2018&#160;</i> by Fabian Wüllhorst:<br/>
First implementation (see issue <a href=
\"https://github.com/RWTH-EBC/AixLib/issues/577\">#577</a>)
</li>
</ul>
</html>", info="<html>
<p>
This model is used to calculate the COP or the EER of a device. As
the electrical power can get zero, a lower boundary is used to
avoid division by zero. If the threshold is surpassed by 10 percent,
the efficiency is calculated again.
</p>
</html>"));
end CalculateCoefficientOfPerformance;
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ partial model PartialHeatPumpCycle
Modelica.Blocks.Math.Feedback feeHeaFloEva
"Calculates evaporator heat flow with total energy balance" annotation (
Placement(transformation(extent={{-80,-20},{-60,0}}, rotation=0)));
CalculateCoefficientOfPerformance calCOP(PEleMin=PEle_nominal*0.01)
"Calculate the COP"
annotation (Placement(transformation(extent={{-80,-60},{-100,-80}})));
equation
connect(iceFacCal.iceFac, sigBus.icefacHPMea) annotation (Line(points={{-79,-42},
{-72,-42},{-72,-28},{-102,-28},{-102,104},{1,104}}, color={0,0,127}),
Expand All @@ -15,6 +18,14 @@ equation
horizontalAlignment=TextAlignment.Left));
connect(feeHeaFloEva.y, proRedQEva.u2)
annotation (Line(points={{-61,-10},{-44,-10},{-44,-58}}, color={0,0,127}));
connect(calCOP.QUse_flow, redQCon.y) annotation (Line(points={{-78,-74},{-72,
-74},{-72,-90},{70,-90},{70,-81}}, color={0,0,127}));
connect(calCOP.COP, sigBus.COP) annotation (Line(points={{-101,-70},{-102,-70},
{-102,104},{1,104}}, color={0,0,127}), Text(
string="%second",
index=1,
extent={{-6,3},{-6,3}},
horizontalAlignment=TextAlignment.Right));
annotation (Documentation(info="<html>
<p>
Partial refrigerant cycle model for heat pumps.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ PartialCarnot
PartialHeatPumpCycle
PartialRefrigerantCycle
PartialTableData2D
CalculateCoefficientOfPerformance
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ equation
-26},{62,-58},{64,-58}}, color={0,0,127}));
connect(swiPEle.y, PEle) annotation (Line(points={{50,-1},{50,-92},{0,-92},{0,
-110}}, color={0,0,127}));
connect(swiPEle.y, feeHeaFloEva.u2) annotation (Line(points={{50,-1},{50,-24},
{-70,-24},{-70,-18}}, color={0,0,127}));
connect(swiPEle.y, feeHeaFloEva.u2) annotation (Line(points={{50,-1},{50,-26},{
-70,-26},{-70,-18}}, color={0,0,127}));
connect(swiQUse.y, feeHeaFloEva.u1) annotation (Line(points={{-50,-1},{-88,-1},
{-88,-10},{-78,-10}}, color={0,0,127}));
connect(swiQUse.u2, sigBus.onOffMea) annotation (Line(points={{-50,22},{-50,
Expand All @@ -53,6 +53,8 @@ equation
index=1,
extent={{-3,6},{-3,6}},
horizontalAlignment=TextAlignment.Right));
connect(swiPEle.y, calCOP.PEle) annotation (Line(points={{50,-1},{50,-26},{-70,
-26},{-70,-66},{-78,-66}}, 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 @@ -26,9 +26,7 @@ model TableData2D "Performance data based on condenser outlet and evaporator inl
tabQUse_flow(final table=datTab.tabQCon_flow),
tabPEle(final table=datTab.tabPEle));


parameter IBPSA.Fluid.HeatPumps.ModularReversible.Data.TableData2D.GenericHeatPump datTab=
IBPSA.Fluid.HeatPumps.ModularReversible.Data.TableData2D.EN255.Vitocal350AWI114()
parameter IBPSA.Fluid.HeatPumps.ModularReversible.Data.TableData2D.GenericHeatPump datTab
"Data Table of HP" annotation (choicesAllMatching=true);

equation
Expand Down Expand Up @@ -71,6 +69,8 @@ equation
index=1,
extent={{-6,3},{-6,3}},
horizontalAlignment=TextAlignment.Right));
connect(scaFacTimPel.y, calCOP.PEle) annotation (Line(points={{-40,-11},{-40,
-24},{0,-24},{0,-86},{-70,-86},{-70,-66},{-78,-66}}, color={0,0,127}));
annotation (Icon(graphics={
Line(points={
{-60.0,40.0},{-60.0,-40.0},{60.0,-40.0},{60.0,40.0},{30.0,40.0},
Expand Down

0 comments on commit ec91f38

Please sign in to comment.