Package with plant models
Information
This package contains component models for district heating and cooling plants.
Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).
Package Content
Name |
Description |
HeatingCoolingCarnot_T
|
Ideal heating and cooling plant with leaving temperature as set point and vapor compression engines that are approximated by Carnot cycles |
Ideal_T
|
Ideal heating and cooling plant with leaving temperature as set point |
LakeWaterHeatExchanger_T
|
Heat exchanger with lake, ocean or river water |
Validation
|
Collection of validation models |
Ideal heating and cooling plant with leaving temperature as set point and vapor compression engines that are approximated by Carnot cycles
Information
Model of an ideal heating and cooling plant that takes as a parameter the set point
for the leaving fluid temperature.
The power consumptions are modeled using a vapor compression engine
for heating and for cooling.
The efficiency of these vapor compression engines varies using the
Carnot cycle analogy.
Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy).
Parameters
Type | Name | Default | Description |
replaceable package Medium | PartialMedium | Medium in the component |
TemperatureDifference | dTEva_nominal | -10 | Temperature difference evaporator outlet-inlet of heat pump [K] |
TemperatureDifference | dTCon_nominal | 10 | Temperature difference condenser outlet-inlet of chiller [K] |
Nominal condition |
MassFlowRate | m_flow_nominal | | Nominal mass flow rate [kg/s] |
Design parameter |
Pressure | dp_nominal | 30000 | Pressure difference at nominal flow rate [Pa] |
Assumptions |
Boolean | allowFlowReversal | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
Advanced |
MassFlowRate | m_flow_small | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Boolean | linearizeFlowResistance | false | = true, use linear relation between m_flow and dp for any flow rate |
Diagnostics |
Boolean | show_T | false | = true, if actual temperature at port is computed |
Connectors
Type | Name | Description |
FluidPort_a | port_a | Fluid connector a (positive design flow direction is from port_a to port_b) |
FluidPort_b | port_b | Fluid connector b (positive design flow direction is from port_a to port_b) |
input RealInput | TSetHea | Temperature set point for heating [K] |
input RealInput | TSetCoo | Temperature set point for cooling [K] |
input RealInput | TSink | Temperature of heat sink [K] |
output RealOutput | PComHea | Compressor energy for heating [W] |
output RealOutput | PComCoo | Compressor energy for cooling [W] |
output RealOutput | QHea_flow | Heat input into fluid [W] |
output RealOutput | QCoo_flow | Heat extracted from fluid [W] |
output RealOutput | QAmbHea_flow | Heat from ambient to heat pump evaporator [W] |
output RealOutput | QAmbChi_flow | Heat from chiller condenser to ambient [W] |
Modelica definition
model HeatingCoolingCarnot_T
extends Buildings.Fluid.Interfaces.PartialTwoPortInterface(
final m_flow(start=0),
final allowFlowReversal = true,
final dp(start=0));
parameter Modelica.SIunits.TemperatureDifference dTEva_nominal=-10
;
parameter Modelica.SIunits.TemperatureDifference dTCon_nominal=10
;
parameter Modelica.SIunits.Pressure dp_nominal(displayUnit="Pa")=30000
;
parameter Boolean linearizeFlowResistance=false
;
Modelica.Blocks.Interfaces.RealInput TSetHea(unit="K")
;
Modelica.Blocks.Interfaces.RealInput TSetCoo(unit="K")
;
Modelica.Blocks.Interfaces.RealInput TSink(unit="K")
;
Modelica.Blocks.Interfaces.RealOutput PComHea(unit="W")
;
Modelica.Blocks.Interfaces.RealOutput PComCoo(unit="W")
;
Modelica.Blocks.Interfaces.RealOutput QHea_flow(unit="W")
;
Modelica.Blocks.Interfaces.RealOutput QCoo_flow(unit="W")
;
Modelica.Blocks.Interfaces.RealOutput QAmbHea_flow(unit="W")
;
Modelica.Blocks.Interfaces.RealOutput QAmbChi_flow(unit="W")
;
protected
replaceable package MediumSin =
Buildings.Media.Air ;
parameter Modelica.SIunits.TemperatureDifference dTSin = 2
;
final parameter Medium.ThermodynamicState staSin_default =
Medium.setState_pTX(
T=MediumSin.T_default,
p=MediumSin.p_default,
X=MediumSin.X_default[1:MediumSin.nXi])
;
final parameter Modelica.SIunits.SpecificHeatCapacity cpSin_default=
Medium.specificHeatCapacityCp(staSin_default)
;
final parameter Medium.ThermodynamicState sta_default =
Medium.setState_pTX(
T=Medium.T_default,
p=Medium.p_default,
X=Medium.X_default[1:Medium.nXi]) ;
final parameter Modelica.SIunits.SpecificHeatCapacity cp_default=
Medium.specificHeatCapacityCp(sta_default)
;
Buildings.Fluid.Chillers.Carnot_TEva coo(
show_T=true,
redeclare package Medium1 =
MediumSin,
redeclare package Medium2 =
Medium,
m2_flow_nominal=m_flow_nominal,
QEva_flow_nominal=m_flow_nominal*cp_default*dTEva_nominal,
use_eta_Carnot_nominal=true,
etaCarnot_nominal=0.3,
dp1_nominal=6000,
dp2_nominal=0,
dTEva_nominal=-dTSin,
dTCon_nominal=dTCon_nominal,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
allowFlowReversal1=false) ;
Buildings.Fluid.HeatPumps.Carnot_TCon hea(
redeclare package Medium1 =
Medium,
redeclare package Medium2 =
MediumSin,
show_T=true,
m1_flow_nominal=m_flow_nominal,
QCon_flow_nominal=m_flow_nominal*cp_default*dTCon_nominal,
dp2_nominal=6000,
use_eta_Carnot_nominal=true,
etaCarnot_nominal=0.3,
dTEva_nominal=dTEva_nominal,
dTCon_nominal=dTSin,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
allowFlowReversal2=false,
dp1_nominal=dp_nominal) ;
Buildings.Fluid.Sources.Boundary_pT sinHea(
redeclare package Medium =
MediumSin,
nPorts=1) ;
Buildings.Fluid.Sources.MassFlowSource_T souHea(
redeclare package Medium =
MediumSin,
use_m_flow_in=true,
use_T_in=true,
nPorts=1) ;
Modelica.Blocks.Math.Gain mHeaSin_flow(k=1/(cpSin_default*dTSin))
;
Modelica.Blocks.Math.Add addHea(k2=-1) ;
Modelica.Blocks.Math.Add addCoo ;
Modelica.Blocks.Math.Gain mCooSin_flow(k=-1/(cpSin_default*dTSin))
;
Buildings.Fluid.Sources.MassFlowSource_T sou2(
redeclare package Medium =
MediumSin,
use_m_flow_in=true,
use_T_in=true,
nPorts=1) ;
Buildings.Fluid.Sources.Boundary_pT sinCoo(
redeclare package Medium =
MediumSin,
nPorts=1) ;
equation
connect(hea.TSet, TSetHea);
connect(port_a, hea.port_a1);
connect(hea.QCon_flow, addHea.u1);
connect(hea.P, addHea.u2);
connect(mHeaSin_flow.u, addHea.y);
connect(coo.P, addCoo.u2);
connect(addCoo.y, mCooSin_flow.u);
connect(sinHea.ports[1], hea.port_b2);
connect(mHeaSin_flow.y, souHea.m_flow_in);
connect(TSink, souHea.T_in);
connect(souHea.ports[1], hea.port_a2);
connect(mCooSin_flow.y, sou2.m_flow_in);
connect(sou2.T_in, TSink);
connect(hea.P, PComHea);
connect(coo.P, PComCoo);
connect(hea.QCon_flow, QHea_flow);
connect(TSetCoo, coo.TSet);
connect(sou2.ports[1], coo.port_a1);
connect(coo.port_b1, sinCoo.ports[1]);
connect(port_b, coo.port_a2);
connect(addCoo.u1, coo.QEva_flow);
connect(coo.QEva_flow, QCoo_flow);
connect(hea.port_b1, coo.port_b2);
connect(hea.QEva_flow, QAmbHea_flow);
connect(coo.QCon_flow, QAmbChi_flow);
end HeatingCoolingCarnot_T;
Ideal heating and cooling plant with leaving temperature as set point
Information
Model of an ideal heating and cooling plant that takes as a parameter the set point
for the leaving fluid temperature.
Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy).
Parameters
Type | Name | Default | Description |
replaceable package Medium | PartialMedium | Medium in the component |
Nominal condition |
MassFlowRate | m_flow_nominal | | Nominal mass flow rate [kg/s] |
Design parameter |
Pressure | dp_nominal | 30000 | Pressure difference at nominal flow rate [Pa] |
Assumptions |
Boolean | allowFlowReversal | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
Advanced |
MassFlowRate | m_flow_small | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Boolean | linearizeFlowResistance | false | = true, use linear relation between m_flow and dp for any flow rate |
Diagnostics |
Boolean | show_T | false | = true, if actual temperature at port is computed |
Connectors
Type | Name | Description |
FluidPort_a | port_a | Fluid connector a (positive design flow direction is from port_a to port_b) |
FluidPort_b | port_b | Fluid connector b (positive design flow direction is from port_a to port_b) |
output RealOutput | QHea_flow | Heat input into fluid [W] |
output RealOutput | QCoo_flow | Heat extracted from fluid [W] |
input RealInput | TSetHea | Temperature set point for heating [K] |
input RealInput | TSetCoo | Temperature set point for cooling [K] |
Modelica definition
model Ideal_T
extends Buildings.Fluid.Interfaces.PartialTwoPortInterface(
final m_flow(start=0),
final allowFlowReversal = true,
final dp(start=0));
parameter Modelica.SIunits.Pressure dp_nominal(displayUnit="Pa")=30000
;
parameter Boolean linearizeFlowResistance=false
;
Modelica.Blocks.Interfaces.RealOutput QHea_flow(unit="W")
;
Modelica.Blocks.Interfaces.RealOutput QCoo_flow(unit="W")
;
protected
final parameter Medium.ThermodynamicState sta_default =
Medium.setState_pTX(
T=Medium.T_default,
p=Medium.p_default,
X=Medium.X_default[1:Medium.nXi]) ;
final parameter Modelica.SIunits.SpecificHeatCapacity cp_default=
Medium.specificHeatCapacityCp(sta_default)
;
Buildings.Fluid.HeatExchangers.PrescribedOutlet coo(
redeclare package Medium =
Medium,
allowFlowReversal=allowFlowReversal,
m_flow_nominal=m_flow_nominal,
show_T=true,
QMax_flow=0,
dp_nominal=0,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
tau=60,
use_X_wSet=false)
;
Buildings.Fluid.HeatExchangers.PrescribedOutlet hea(
redeclare package Medium =
Medium,
allowFlowReversal=allowFlowReversal,
m_flow_nominal=m_flow_nominal,
from_dp=false,
show_T=true,
QMin_flow=0,
dp_nominal=dp_nominal,
linearizeFlowResistance=linearizeFlowResistance,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
tau=60,
use_X_wSet=false)
;
Buildings.Fluid.Sensors.TemperatureTwoPort senTem(
redeclare package Medium =
Medium,
m_flow_nominal=m_flow_nominal,
tau=0) ;
public
Modelica.Blocks.Interfaces.RealInput TSetHea(unit="K")
;
Modelica.Blocks.Interfaces.RealInput TSetCoo(unit="K")
;
equation
connect(QHea_flow, hea.Q_flow);
connect(coo.Q_flow, QCoo_flow);
connect(port_a, hea.port_a);
connect(coo.port_a, port_b);
connect(hea.port_b, senTem.port_a);
connect(senTem.port_b, coo.port_b);
connect(hea.TSet, TSetHea);
connect(TSetCoo, coo.TSet);
end Ideal_T;
Heat exchanger with lake, ocean or river water
Information
Model for a heat exchanger that uses water such as from a lake, the ocean or a river,
or the ambient air to either provide heating or cooling.
The model has built-in controls in order to exchange heat,
up to a maximum approach temperature difference
set by TApp
.
There are three input signals for the heat or cold source:
-
TSouWat
is the temperature of the ocean, lake or river to which
heat is rejected, or from which heat is extracted from.
-
TSouHea
is the temperature used to heat the water.
This could be set to the outdoor drybulb temperature if there is an air-to-water
heat exchanger, or else to the same value as is used for TSouWat
below.
-
TSouCoo
is the temperature used to cool the water.
This could be set to the outdoor wet bulb temperature if there is a wet cooling
tower,
to the outdoor dry-bulb temperature if there is a dry cooling tower,
or else to TSouWat
.
The parameters TLooMin
and TLooMax
are used to avoid
that the water of the district heating/cooling
is below or above a maximum threshold.
Implementation
The pressure drop of the heat exchanger is implemented in the valve
instances valCoo
and valHea
.
Extends from Buildings.Fluid.Interfaces.PartialFourPortInterface (Partial model transporting fluid between two ports without storing mass or energy).
Parameters
Type | Name | Default | Description |
replaceable package Medium1 | PartialMedium | Medium 1 in the component |
replaceable package Medium2 | PartialMedium | Medium 2 in the component |
replaceable package Medium | Modelica.Media.Interfaces.Pa... | Medium in the component |
Boolean | disableHeatExchanger | false | Set to true to disable the heat exchanger |
TemperatureDifference | TApp | 0.5 | Approach temperature difference [K] |
Nominal condition |
MassFlowRate | m1_flow_nominal | m_flow_nominal | Nominal mass flow rate [kg/s] |
MassFlowRate | m2_flow_nominal | m_flow_nominal | Nominal mass flow rate [kg/s] |
MassFlowRate | m_flow_nominal | | Nominal mass flow rate [kg/s] |
PressureDifference | dpValve_nominal | 1000 | Nominal pressure drop of fully open valve [Pa] |
PressureDifference | dpHex_nominal | | Pressure drop of heat exchanger pipe and other resistances in the heat exchanger flow leg that are in series with the valve [Pa] |
Assumptions |
Boolean | allowFlowReversal1 | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1 |
Boolean | allowFlowReversal2 | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2 |
Advanced |
MassFlowRate | m1_flow_small | 1E-4*abs(m1_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
MassFlowRate | m2_flow_small | 1E-4*abs(m2_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Diagnostics |
Boolean | show_T | false | = true, if actual temperature at port is computed |
Flow resistance |
Boolean | from_dp | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
Boolean | linearizeFlowResistance | false | = true, use linear relation between m_flow and dp for any flow rate |
Real | deltaM | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |
Connectors
Type | Name | Description |
replaceable package Medium1 | Medium 1 in the component |
replaceable package Medium2 | Medium 2 in the component |
FluidPort_a | port_a1 | Fluid connector a1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_b | port_b1 | Fluid connector b1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_a | port_a2 | Fluid connector a2 (positive design flow direction is from port_a2 to port_b2) |
FluidPort_b | port_b2 | Fluid connector b2 (positive design flow direction is from port_a2 to port_b2) |
replaceable package Medium | Medium in the component |
input RealInput | TSouWat | Temperature of ocean, lake or river [K] |
input RealInput | TSouHea | Source temperature to add heat the loop water (such as outdoor drybulb temperature) [K] |
input RealInput | TSouCoo | Source temperature to reject heat, such as outdoor wet bulb, outdoor drybulb, or else TSouWat [K] |
input RealInput | TSetHea | Temperature set point for heating [K] |
input RealInput | TSetCoo | Temperature set point for cooling [K] |
output RealOutput | QWat_flow | Heat exchanged with water reservoir (positive if added to reservoir) [W] |
Modelica definition
model LakeWaterHeatExchanger_T
extends Buildings.Fluid.Interfaces.PartialFourPortInterface(
redeclare final package Medium1 =
Medium,
redeclare final package Medium2 =
Medium,
final allowFlowReversal1 = true,
final allowFlowReversal2 = true,
final m1_flow_nominal = m_flow_nominal,
final m2_flow_nominal = m_flow_nominal);
replaceable package Medium =
Modelica.Media.Interfaces.PartialMedium ;
parameter Boolean disableHeatExchanger = false
;
parameter Modelica.SIunits.TemperatureDifference TApp(
min=0,
displayUnit="K") = 0.5
;
parameter Modelica.SIunits.MassFlowRate m_flow_nominal
;
parameter Modelica.SIunits.PressureDifference dpValve_nominal(
displayUnit="Pa",
min=0) = 1000 ;
parameter Modelica.SIunits.PressureDifference dpHex_nominal(
displayUnit="Pa",
min=0)
;
parameter Boolean from_dp = false
;
parameter Boolean linearizeFlowResistance = false
;
parameter Real deltaM = 0.1
;
Modelica.Blocks.Interfaces.RealInput TSouWat(
unit="K",
displayUnit="degC")
;
Modelica.Blocks.Interfaces.RealInput TSouHea(
unit="K",
displayUnit="degC")
;
Modelica.Blocks.Interfaces.RealInput TSouCoo(
unit="K",
displayUnit="degC")
;
Modelica.Blocks.Interfaces.RealInput TSetHea(unit="K")
;
Modelica.Blocks.Interfaces.RealInput TSetCoo(unit="K")
;
Modelica.Blocks.Interfaces.RealOutput QWat_flow(unit="W")
;
Buildings.Fluid.Actuators.Valves.ThreeWayLinear valCoo(
redeclare final package Medium =
Medium,
final m_flow_nominal=m_flow_nominal,
dpValve_nominal=1000,
use_inputFilter=false,
final energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyStateInitial,
final dpFixed_nominal={
if disableHeatExchanger
then 0
else dpHex_nominal,0})
;
Buildings.Fluid.Actuators.Valves.ThreeWayLinear valHea(
redeclare final package Medium =
Medium,
final m_flow_nominal=m_flow_nominal,
dpValve_nominal=1000,
use_inputFilter=false,
final energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyStateInitial,
final dpFixed_nominal={
if disableHeatExchanger
then 0
else dpHex_nominal,0})
;
protected
Buildings.Fluid.HeatExchangers.SensibleCooler_T coo(
redeclare final package Medium =
Medium,
final m_flow_nominal=m_flow_nominal,
final dp_nominal=0,
final allowFlowReversal=true,
final show_T=false,
final from_dp=from_dp,
final linearizeFlowResistance=linearizeFlowResistance,
final deltaM=deltaM,
final energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState,
QMin_flow=
if disableHeatExchanger
then 0
else -Modelica.Constants.inf)
;
Modelica.Blocks.Sources.RealExpression TWarIn(y=
Medium.temperature_phX(
p=port_b1.p,
h=
inStream(port_b1.h_outflow),
X=
cat(1,
inStream(port_b1.Xi_outflow),
{1-
sum(
inStream(port_b1.Xi_outflow))})))
;
Buildings.Fluid.HeatExchangers.Heater_T hea(
redeclare final package Medium =
Medium,
final m_flow_nominal=m_flow_nominal,
final dp_nominal=0,
final allowFlowReversal=true,
final show_T=false,
final from_dp=from_dp,
final linearizeFlowResistance=linearizeFlowResistance,
final deltaM=deltaM,
final energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState,
QMax_flow=
if disableHeatExchanger
then 0
else Modelica.Constants.inf)
;
Modelica.Blocks.Sources.RealExpression TColIn(y=
Medium.temperature_phX(
p=port_a2.p,
h=
inStream(port_a2.h_outflow),
X=
cat(1,
inStream(port_a2.Xi_outflow),
{1-
sum(
inStream(port_a2.Xi_outflow))}))) ;
Utilities.Math.SmoothMax maxHeaLea(deltaX=0.1) ;
Utilities.Math.SmoothMin minHeaLvg(deltaX=0.1) ;
Utilities.Math.SmoothMax maxCooLea(deltaX=0.1) ;
Utilities.Math.SmoothMin minCooLvg(deltaX=0.1) ;
Modelica.Blocks.Sources.Constant TAppHex(k=TApp)
;
Modelica.Blocks.Math.Add TWatHea(k2=-1)
;
Modelica.Blocks.Math.Add TWatCoo
;
Modelica.Blocks.Math.Add QExc_flow(k1=-1) ;
Utilities.Math.SmoothMax smoothMax(deltaX=0.1);
Utilities.Math.SmoothMin smoothMin(deltaX=0.1);
Controller conCoo(
final m_flow_nominal=m_flow_nominal)
;
Buildings.Fluid.Sensors.MassFlowRate senMasFloCoo(
redeclare package Medium =
Medium)
;
Buildings.Fluid.Sensors.MassFlowRate senMasFloHea(
redeclare package Medium =
Medium)
;
Controller conHea(
final m_flow_nominal=m_flow_nominal)
;
equation
connect(TColIn.y, maxHeaLea.u2);
connect(maxHeaLea.y, minHeaLvg.u2);
connect(minHeaLvg.y, hea.TSet);
connect(TWarIn.y, minCooLvg.u1);
connect(minCooLvg.y, maxCooLea.u2);
connect(maxCooLea.y, coo.TSet);
connect(TAppHex.y, TWatHea.u2);
connect(TAppHex.y, TWatCoo.u2);
connect(TWatCoo.y, minCooLvg.u2);
connect(TWatHea.y, maxHeaLea.u1);
connect(coo.Q_flow, QExc_flow.u1);
connect(hea.Q_flow, QExc_flow.u2);
connect(QExc_flow.y, QWat_flow);
connect(smoothMax.y, TWatHea.u1);
connect(smoothMin.y, TWatCoo.u1);
connect(TSetCoo, maxCooLea.u1);
connect(valCoo.port_2, port_b1);
connect(conCoo.y, valCoo.y);
protected
model Controller
parameter Modelica.SIunits.MassFlowRate m_flow_nominal
;
Modelica.Blocks.Nonlinear.Limiter limTem(
uMax=1,
uMin=0,
limitsAtInit=false,
strict=true)
;
Modelica.Blocks.Math.Gain gaiTem(k=4) ;
Modelica.Blocks.Math.Feedback feeBac ;
Modelica.Blocks.Interfaces.RealInput u1;
Modelica.Blocks.Interfaces.RealInput u2;
Modelica.Blocks.Interfaces.RealOutput y
;
Modelica.Blocks.Interfaces.RealInput m_flow ;
Modelica.Blocks.Math.Gain norFlo(
final k=1/m_flow_nominal)
;
Modelica.Blocks.Nonlinear.Limiter limFlo(
uMax=1,
uMin=0,
limitsAtInit=false,
strict=true)
;
Modelica.Blocks.Math.Gain gaiFlo(k=100) ;
Modelica.Blocks.Math.Product product;
equation
connect(feeBac.y, gaiTem.u);
connect(gaiTem.y, limTem.u);
connect(u1, feeBac.u1);
connect(u2, feeBac.u2);
connect(m_flow, norFlo.u);
connect(norFlo.y, gaiFlo.u);
connect(gaiFlo.y, limFlo.u);
connect(limFlo.y, product.u1);
connect(limTem.y, product.u2);
connect(product.y, y);
end Controller;
equation
connect(valCoo.port_1, coo.port_a);
connect(senMasFloCoo.m_flow, conCoo.m_flow);
connect(senMasFloCoo.port_b, port_a1);
connect(port_b2, senMasFloHea.port_b);
connect(conHea.m_flow, senMasFloHea.m_flow);
connect(valHea.port_2, port_a2);
connect(valHea.port_1, hea.port_a);
connect(conHea.y, valHea.y);
connect(TColIn.y, conHea.u2);
connect(conHea.u1, minHeaLvg.y);
connect(TWarIn.y, conCoo.u1);
connect(maxCooLea.y, conCoo.u2);
connect(coo.port_b, senMasFloCoo.port_a);
connect(valCoo.port_3, senMasFloCoo.port_a);
connect(senMasFloHea.port_a, hea.port_b);
connect(senMasFloHea.port_a, valHea.port_3);
connect(smoothMin.u2, TSouWat);
connect(smoothMax.u2, TSouWat);
connect(smoothMax.u1, TSouHea);
connect(smoothMin.u1, TSouCoo);
connect(minHeaLvg.u1, TSetHea);
end LakeWaterHeatExchanger_T;
Controller for bay water heat exchanger
Parameters
Type | Name | Default | Description |
Nominal condition |
MassFlowRate | m_flow_nominal | | Nominal mass flow rate [kg/s] |
Connectors
Modelica definition
model Controller
parameter Modelica.SIunits.MassFlowRate m_flow_nominal
;
Modelica.Blocks.Nonlinear.Limiter limTem(
uMax=1,
uMin=0,
limitsAtInit=false,
strict=true)
;
Modelica.Blocks.Math.Gain gaiTem(k=4) ;
Modelica.Blocks.Math.Feedback feeBac ;
Modelica.Blocks.Interfaces.RealInput u1;
Modelica.Blocks.Interfaces.RealInput u2;
Modelica.Blocks.Interfaces.RealOutput y
;
Modelica.Blocks.Interfaces.RealInput m_flow ;
Modelica.Blocks.Math.Gain norFlo(
final k=1/m_flow_nominal)
;
Modelica.Blocks.Nonlinear.Limiter limFlo(
uMax=1,
uMin=0,
limitsAtInit=false,
strict=true)
;
Modelica.Blocks.Math.Gain gaiFlo(k=100) ;
Modelica.Blocks.Math.Product product;
equation
connect(feeBac.y, gaiTem.u);
connect(gaiTem.y, limTem.u);
connect(u1, feeBac.u1);
connect(u2, feeBac.u2);
connect(m_flow, norFlo.u);
connect(norFlo.y, gaiFlo.u);
connect(gaiFlo.y, limFlo.u);
connect(limFlo.y, product.u1);
connect(limTem.y, product.u2);
connect(product.y, y);
end Controller;