Skip to content

Commit

Permalink
Merge pull request #1820 from ibpsa/issue1576_heatPumpModelIntegratio…
Browse files Browse the repository at this point in the history
…n_removeCp_and_rho_parameters

Issue1576 heat pump model integration remove cp and rho parameters
  • Loading branch information
FWuellhorst authored Dec 20, 2023
2 parents ade8c9a + b40de93 commit 4ebe280
Show file tree
Hide file tree
Showing 28 changed files with 199 additions and 184 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ model ModularReversible
CCon=0,
GConOut=0,
GConIns=0,
cpCon=1000,
TEva_nominal=278.15,
dTEva_nominal=5,
dTCon_nominal=5,
Expand All @@ -33,15 +32,11 @@ model ModularReversible
CEva=0,
GEvaOut=0,
GEvaIns=0,
cpEva=4184,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
show_T=true,
redeclare model RefrigerantCycleChillerCooling =
IBPSA.Fluid.Chillers.ModularReversible.RefrigerantCycle.ConstantCarnotEffectiveness
(
cpCon=chi.cpCon,
cpEva=chi.cpEva,
etaCarnot_nominal=0.35),
(etaCarnot_nominal=0.35),
redeclare model RefrigerantCycleChillerHeating =
IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.TableData2D (
redeclare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ model ReversibleCarnotWithLosses
CCon=0,
GConOut=0,
GConIns=0,
cpCon=4184,
TEva_nominal=278.15,
dTEva_nominal(displayUnit="K") = 10,
dTCon_nominal(displayUnit="K") = 5,
Expand All @@ -32,7 +31,6 @@ model ReversibleCarnotWithLosses
CEva=0,
GEvaOut=0,
GEvaIns=0,
cpEva=4184,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
show_T=true) "Chiller instance with reversbile Carnot approach"
annotation (Placement(transformation(extent={{0,0},{20,20}})));
Expand Down Expand Up @@ -79,19 +77,19 @@ model ReversibleCarnotWithLosses
annotation (Placement(transformation(extent={{-60,-60},{-40,-40}})));
equation
connect(souCon.ports[1], chi.port_a1) annotation (Line(
points={{-40,16},{-20,16},{-20,15},{-5.55112e-16,15}},
points={{-40,16},{-20,16},{-20,16},{-5.55112e-16,16}},
color={0,127,255},
smooth=Smooth.None));
connect(souEva.ports[1], chi.port_a2) annotation (Line(
points={{40,4},{30,4},{30,5},{20,5}},
points={{40,4},{30,4},{30,4},{20,4}},
color={0,127,255},
smooth=Smooth.None));
connect(chi.port_b1, sinCon.ports[1]) annotation (Line(
points={{20,15},{30,15},{30,40},{60,40}},
points={{20,16},{30,16},{30,40},{60,40}},
color={0,127,255},
smooth=Smooth.None));
connect(sinEva.ports[1], chi.port_b2) annotation (Line(
points={{-40,-20},{-10,-20},{-10,5},{-5.55112e-16,5}},
points={{-40,-20},{-10,-20},{-10,4},{-5.55112e-16,4}},
color={0,127,255},
smooth=Smooth.None));
connect(TConIn.y, souCon.T_in) annotation (Line(
Expand All @@ -102,10 +100,10 @@ equation
points={{73,-30},{80,-30},{80,8},{62,8}},
color={0,0,127},
smooth=Smooth.None));
connect(ySet.y, chi.ySet) annotation (Line(points={{-39,60},{-16,60},{-16,
11.6667},{-1.6,11.6667}}, color={0,0,127}));
connect(chiCoo.y, chi.coo) annotation (Line(points={{-39,-50},{-22,-50},
{-22,2.5},{-1.6,2.5}}, color={255,0,255}));
connect(ySet.y, chi.ySet) annotation (Line(points={{-39,60},{-16,60},{-16,12},
{-1.2,12}}, color={0,0,127}));
connect(chiCoo.y, chi.coo) annotation (Line(points={{-39,-50},{-22,-50},{-22,7.9},
{-1.1,7.9}}, color={255,0,255}));
annotation (experiment(Tolerance=1e-6, StopTime=3600),
__Dymola_Commands(file="modelica://IBPSA/Resources/Scripts/Dymola/Fluid/Chillers/ModularReversible/Examples/ReversibleCarnotWithLosses.mos"
"Simulate and plot"),
Expand Down
5 changes: 4 additions & 1 deletion IBPSA/Fluid/Chillers/ModularReversible/ModularReversible.mo
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ model ModularReversible
final dTEva_nominal=dTEva_nominal,
final mCon_flow_nominal=mCon_flow_nominal,
final mEva_flow_nominal=mEva_flow_nominal,
final cpCon=cpCon,
final cpEva=cpEva,
final y_nominal=y_nominal)
"Refrigerant cycle module for the cooling mode"
annotation (choicesAllMatching=true);
Expand All @@ -41,14 +43,15 @@ model ModularReversible
IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialHeatPumpCycle(
final useInHeaPum=false,
final QUse_flow_nominal=QHea_flow_nominal,
final scaFac=scaFac,
final PEle_nominal=refCyc.refCycChiCoo.PEle_nominal,
final TCon_nominal=TCon_nominal,
final TEva_nominal=TEva_nominal,
final dTCon_nominal=dTCon_nominal,
final dTEva_nominal=dTEva_nominal,
final mCon_flow_nominal=mCon_flow_nominal,
final mEva_flow_nominal=mEva_flow_nominal,
final cpCon=cpCon,
final cpEva=cpEva,
final y_nominal=y_nominal)
"Refrigerant cycle module for the heating mode"
annotation (Dialog(enable=use_rev),choicesAllMatching=true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ model ConstantCarnotEffectiveness "Carnot EER with a constant Carnot effectivene
datSou="ConstantCarnotEffectiveness");
extends
IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialCarnot(
TAppCon_nominal=if cpCon < 1500 then 5 else 2,
TAppEva_nominal=if cpEva < 1500 then 5 else 2,
final useForChi=true,
final QEva_flow_nominal=QUse_flow_nominal,
final QCon_flow_nominal=QUse_flow_nominal+PEle_nominal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@ model TableData2D
final use_TEvaOutForTab=datTab.use_TEvaOutForTab,
tabQUse_flow(final table=datTab.tabQEva_flow),
tabPEle(final table=datTab.tabPEle),
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,
final valTabQEva_flow = {{tabQUse_flow.table[j, i] for i in 2:numCol} for j in 2:numRow},
final valTabQCon_flow = valTabQEva_flow .+ valTabPEle,
final mCon_flow_nominal_internal=mCon_flow_nominal,
final mEva_flow_nominal_internal=mEva_flow_nominal,
final mCon_flow_max=max(valTabQCon_flow) * scaFac / cpCon / dTMin,
final mCon_flow_min=min(valTabQCon_flow) * scaFac / cpCon / dTMax,
final mEva_flow_min=min(valTabQEva_flow) * scaFac / cpCon / dTMax,
final mEva_flow_max=max(valTabQEva_flow) * scaFac / cpCon / dTMin,
constScaFac(final k=scaFac));
replaceable parameter IBPSA.Fluid.Chillers.ModularReversible.Data.TableData2D.Generic datTab
"Data Table of Chiller" annotation (choicesAllMatching=true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ model ReversibleCarnotWithLosses
iceFacCal,
etaCarnot_nominal=etaCarnot_nominal,
use_constAppTem=true,
cpCon=cpCon,
cpEva=cpEva,
TAppCon_nominal=TAppCon_nominal,
TAppEva_nominal=TAppEva_nominal),
redeclare model RefrigerantCycleChillerCooling =
Expand All @@ -22,8 +20,6 @@ model ReversibleCarnotWithLosses
IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.Frosting.FunctionalIcingFactor
iceFacCal(redeclare function icingFactor =
IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.Frosting.Functions.wetterAfjei1997),
cpCon=cpCon,
cpEva=cpEva,
TAppCon_nominal=TAppCon_nominal,
TAppEva_nominal=TAppEva_nominal,
etaCarnot_nominal=etaCarnot_nominal),
Expand All @@ -37,13 +33,18 @@ model ReversibleCarnotWithLosses
parameter Real etaCarnot_nominal=0.3 "Constant Carnot effectiveness";
parameter Modelica.Units.SI.TemperatureDifference TAppCon_nominal=if
cpCon < 1500 then 5 else 2
"Temperature difference between refrigerant and working fluid outlet in condenser";
"Temperature difference between refrigerant and working fluid outlet in condenser"
annotation(Dialog(group="Nominal condition"));
parameter Modelica.Units.SI.TemperatureDifference TAppEva_nominal=if
cpEva < 1500 then 5 else 2
"Temperature difference between refrigerant and working fluid outlet in evaporator";
"Temperature difference between refrigerant and working fluid outlet in evaporator"
annotation(Dialog(group="Nominal condition"));
parameter Modelica.Units.SI.Time refIneTimCon = 300
"Refrigerant cycle inertia time constant for first order delay";
parameter Integer nthOrd=1 "Order of refrigerant cycle interia";
"Refrigerant cycle inertia time constant for first order delay"
annotation(Dialog(group="Refrigerant cycle inertia"));
parameter Integer nthOrd=1 "Order of refrigerant cycle interia"
annotation(Dialog(group="Refrigerant cycle inertia"));


annotation (Documentation(revisions="<html>
<ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ partial model PartialModularComparison
redeclare final package MediumEva = Medium2,
QUse_flow_nominal=QUse_nominal,
final y_nominal=1,
final cpCon=4184,
final cpEva=4184,
redeclare final model RefrigerantCycleInertia =
IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.Inertias.NoInertia,
final use_rev=false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ model ConstantCarnotEffectiveness
extends BaseClasses.PartialModularComparison(chi(redeclare model
RefrigerantCycleChillerCooling =
IBPSA.Fluid.Chillers.ModularReversible.RefrigerantCycle.ConstantCarnotEffectiveness
(
cpCon=chi.cpCon,
cpEva=chi.cpEva,
etaCarnot_nominal=etaCarnot_nominal)));
(etaCarnot_nominal=etaCarnot_nominal)));
extends Modelica.Icons.Example;

annotation (experiment(Tolerance=1e-6, StopTime=3600),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ partial model PartialReversibleRefrigerantMachine
//General
replaceable package MediumCon =
Modelica.Media.Interfaces.PartialMedium "Medium on condenser side"
annotation (Dialog(tab = "Condenser"),choicesAllMatching=true);
annotation (choicesAllMatching=true);
replaceable package MediumEva =
Modelica.Media.Interfaces.PartialMedium "Medium on evaporator side"
annotation (Dialog(tab = "Evaporator"),choicesAllMatching=true);
annotation (choicesAllMatching=true);
replaceable PartialModularRefrigerantCycle refCyc constrainedby
PartialModularRefrigerantCycle(final use_rev=use_rev)
"Model of the refrigerant cycle" annotation (Placement(transformation(
Expand Down Expand Up @@ -62,49 +62,45 @@ partial model PartialReversibleRefrigerantMachine
annotation (Dialog(group="Nominal condition"));
parameter Modelica.Units.SI.TemperatureDifference dTCon_nominal
"Nominal temperature difference in condenser medium"
annotation (Dialog(group="Nominal condition", tab="Condenser"));
annotation (Dialog(group="Nominal condition"));
parameter Modelica.Units.SI.MassFlowRate mCon_flow_nominal
"Nominal mass flow rate of the condenser medium"
annotation (Dialog(
group="Nominal condition",
tab="Condenser"));
annotation (Dialog(group="Nominal condition"));

parameter Modelica.Units.SI.PressureDifference dpCon_nominal(displayUnit="Pa")
"Pressure drop at nominal mass flow rate"
annotation (Dialog(group="Flow resistance", tab="Condenser"));
annotation (Dialog(group="Nominal condition"));
parameter Real deltaMCon=0.1
"Fraction of nominal mass flow rate where transition to turbulent occurs"
annotation (Dialog(tab="Condenser", group="Flow resistance"));
parameter Boolean use_conCap=true
"=true if using capacitor model for condenser heat loss estimation"
annotation (Dialog(group="Heat Losses", tab="Condenser"),
choices(checkBox=true));
parameter Modelica.Units.SI.HeatCapacity CCon
parameter Modelica.Units.SI.HeatCapacity CCon=0
"Heat capacity of the condenser"
annotation (Dialog(
group="Heat Losses",
tab="Condenser",
enable=use_conCap));
parameter Modelica.Units.SI.ThermalConductance GConOut
parameter Modelica.Units.SI.ThermalConductance GConOut=0
"Outer thermal conductance for condenser heat loss calculations"
annotation (Dialog(
group="Heat Losses",
tab="Condenser",
enable=use_conCap));
parameter Modelica.Units.SI.ThermalConductance GConIns
parameter Modelica.Units.SI.ThermalConductance GConIns=0
"Inner thermal conductance for condenser heat loss calculations"
annotation (Dialog(
group="Heat Losses",
tab="Condenser",
enable=use_conCap));

parameter Modelica.Units.SI.Density rhoCon=MediumCon.density(staCon_nominal)
"Condenser medium density"
annotation (Dialog(tab="Condenser", group="Medium properties"));
parameter Modelica.Units.SI.SpecificHeatCapacity cpCon=
final parameter Modelica.Units.SI.Density rhoCon=MediumCon.density(staCon_nominal)
"Condenser medium density";
final parameter Modelica.Units.SI.SpecificHeatCapacity cpCon=
MediumCon.specificHeatCapacityCp(staCon_nominal)
"Condenser medium specific heat capacity"
annotation (Dialog(tab="Condenser", group="Medium properties"));
"Condenser medium specific heat capacity";

//Evaporator
parameter Modelica.Units.SI.Time tauEva=30
Expand All @@ -115,48 +111,44 @@ partial model PartialReversibleRefrigerantMachine
annotation (Dialog(group="Nominal condition"));
parameter Modelica.Units.SI.TemperatureDifference dTEva_nominal
"Nominal temperature difference in evaporator medium"
annotation (Dialog(group="Nominal condition", tab="Evaporator"));
annotation (Dialog(group="Nominal condition"));
parameter Modelica.Units.SI.MassFlowRate mEva_flow_nominal
"Nominal mass flow rate of the evaporator medium"
annotation (Dialog(
group="Nominal condition",
tab="Evaporator"));
annotation (Dialog(group="Nominal condition"));

parameter Modelica.Units.SI.PressureDifference dpEva_nominal(displayUnit="Pa")
"Pressure drop at nominal mass flow rate" annotation (Dialog(group="Flow resistance",
tab="Evaporator"));
"Pressure drop at nominal mass flow rate"
annotation (Dialog(group="Nominal condition"));
parameter Real deltaMEva=0.1
"Fraction of nominal mass flow rate where transition to turbulent occurs"
annotation (Dialog(tab="Evaporator", group="Flow resistance"));
parameter Boolean use_evaCap=true
"=true if using capacitor model for evaporator heat loss estimation"
annotation (Dialog(group="Heat Losses", tab="Evaporator"),
choices(checkBox=true));
parameter Modelica.Units.SI.HeatCapacity CEva
parameter Modelica.Units.SI.HeatCapacity CEva=0
"Heat capacity of the evaporator"
annotation ( Dialog(
group="Heat Losses",
tab="Evaporator",
enable=use_evaCap));
parameter Modelica.Units.SI.ThermalConductance GEvaOut
parameter Modelica.Units.SI.ThermalConductance GEvaOut=0
"Outer thermal conductance for evaporator heat loss calculations"
annotation ( Dialog(
group="Heat Losses",
tab="Evaporator",
enable=use_evaCap));
parameter Modelica.Units.SI.ThermalConductance GEvaIns
parameter Modelica.Units.SI.ThermalConductance GEvaIns=0
"Inner thermal conductance for evaporator heat loss calculations"
annotation ( Dialog(
group="Heat Losses",
tab="Evaporator",
enable=use_evaCap));
parameter Modelica.Units.SI.Density rhoEva=MediumEva.density(staEva_nominal)
"Evaporator medium density"
annotation (Dialog(tab="Evaporator", group="Medium properties"));
parameter Modelica.Units.SI.SpecificHeatCapacity cpEva=
final parameter Modelica.Units.SI.Density rhoEva=MediumEva.density(staEva_nominal)
"Evaporator medium density";
final parameter Modelica.Units.SI.SpecificHeatCapacity cpEva=
MediumEva.specificHeatCapacityCp(staEva_nominal)
"Evaporator medium specific heat capacity"
annotation (Dialog(tab="Evaporator", group="Medium properties"));
"Evaporator medium specific heat capacity";

//Assumptions
parameter Boolean allowFlowReversalEva=true
Expand Down Expand Up @@ -237,7 +229,8 @@ partial model PartialReversibleRefrigerantMachine
final GOut=GConOut,
final m_flow_nominal=mCon_flow_nominal,
final dp_nominal=dpCon_nominal,
final GInn=GConIns) "Heat exchanger model for the condenser"
final GInn=GConIns,
preDro(m_flow(nominal=abs(QUse_flow_nominal)/1000/10))) "Heat exchanger model for the condenser"
annotation (Placement(transformation(extent={{-20,80},{20,120}})));
IBPSA.Fluid.HeatPumps.ModularReversible.BaseClasses.EvaporatorCondenserWithCapacity eva(
redeclare final package Medium = MediumEva,
Expand All @@ -258,7 +251,8 @@ partial model PartialReversibleRefrigerantMachine
final dp_nominal=dpEva_nominal,
final TCap_start=TEvaCap_start,
final GOut=GEvaOut,
final GInn=GEvaIns) "Heat exchanger model for the evaporator"
final GInn=GEvaIns,
preDro(m_flow(nominal=abs(QUse_flow_nominal)/1000/10))) "Heat exchanger model for the evaporator"
annotation (Placement(transformation(extent={{20,-80},{-20,-120}})));
Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature varTOutEva
if use_evaCap "Forces heat losses according to ambient temperature"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ model BoundaryMap
parameter Real tab[:,2]
"Table for boundary with second column as useful temperature side";
parameter Modelica.Units.SI.TemperatureDifference dT
"Delta value used to avoid state events when used as a safety control"
annotation (Dialog(tab="Safety control", group="Operational Envelope"));
"Delta value used to avoid state events when used as a safety control";
parameter Boolean isUppBou "=true if it is an upper boundary, false for lower";
Modelica.Blocks.Interfaces.BooleanOutput noErr
"=false when an error occurs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ partial model PartialOneRoomRadiator

//----------------------------------------------------------------------------//

Movers.Preconfigured.FlowControlled_m_flow pumHeaPum(
Movers.FlowControlled_m_flow pumHeaPum(
redeclare package Medium = MediumWat,
m_flow_nominal=mCon_flow_nominal,
m_flow_start=0.85,
T_start=TRadSup_nominal,
nominalValuesDefineDefaultPressureCurve=true,
use_inputFilter=false,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState)
"Pump for radiator side" annotation (Placement(transformation(
Expand Down Expand Up @@ -108,10 +109,11 @@ partial model PartialOneRoomRadiator

//--------------------------------------------------------------------------------------//

Movers.Preconfigured.FlowControlled_m_flow pumHeaPumSou(
Movers.FlowControlled_m_flow pumHeaPumSou(
redeclare package Medium = MediumWat,
m_flow_start=0.85,
m_flow_nominal=mEva_flow_nominal,
nominalValuesDefineDefaultPressureCurve=true,
use_inputFilter=false,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState)
"Pump for heat pump source side" annotation (Placement(transformation(
Expand Down
Loading

0 comments on commit 4ebe280

Please sign in to comment.