This package contains models of building loads that are used to
build example models of steam district heating systems.
Name |
Description |
BuildingTimeSeriesAtETS
|
Steam heating building interconnection with the district piping only
and the load at the ETS provided as a time series. |
Examples
|
Collection of models that illustrate model use and test models |
BaseClasses
|
Package with base classes for Buildings.Experimental.DHC.Loads.Steam |
This model is intended for existing steam district heating systems
where the heating load at the energy transfer station (ETS) is
availble as a time series data input. Thus, the building-side piping and equipement
is not included in this model, as depicted below.
With the time series input, this model is configured such that the control
volume (representing the steam side of the heat exchanger) has steady state
energy and mass balances. The steam trap also has steady state balances by
design. Meanwhile, the condensate return pump allows either dynamic or steady
state balances. The mass flow rate at the pump is prescribed ideally such that
the heat flow rate input from the time series is rejected at the control volume
based on the physical laws.
Type | Name | Default | Description |
replaceable package MediumSte | Buildings.Media.Steam | Steam medium |
replaceable package MediumWat | Buildings.Media.Specialized.... | Water medium |
Boolean | have_prv | false | Set to true if the building has a pressure reducing valve (PRV) station |
Volume | V | 1 | Total volume of the steam side of the heat exchanger [m3] |
Nominal condition |
Power | Q_flow_nominal | | Nominal heat flow rate [W] |
PressureDifference | dp_nominal | | Pressure drop at nominal mass flow rate [Pa] |
AbsolutePressure | pSte_nominal | MediumSte.p_default | Nominal pressure of steam entering the building [Pa] |
AbsolutePressure | pLow_nominal | 0.8*MediumSte.p_default | Nominal low pressure setpoint, downstream of PRV (if present) [Pa] |
Temperature | TSte_nominal | MediumSte.saturationTemperat... | Nominal temperature of steam entering the building [K] |
Temperature | TLow_nominal | MediumSte.temperature(Medium... | Nominal temperature of steam entering heat exchanger, if PRV present [K] |
SpecificEnthalpy | dh_nominal | MediumSte.specificEnthalpy(M... | Nominal change in enthalpy across the heat exchanger [J/kg] |
Dynamics |
Equations |
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Initialization |
AbsolutePressure | p_start | MediumSte.p_default | Start value of pressure [Pa] |
Temperature | T_start | MediumSte.T_default | Start value of temperature [K] |
MassFlowRate | m_flow_start | 0 | Initial value of mass flow rate [kg/s] |
Load Profile |
Table data definition |
Boolean | tableOnFile | false | = true, if table is defined on file or in function usertab |
Real | QHeaLoa[:, :] | fill(0.0, 0, 2) | Table matrix (time = first column; e.g., table=[0, 0; 1, 1; 2, 4]) |
String | tableName | "NoName" | Table name on file or in function usertab (see docu) |
String | fileName | "NoName" | File where matrix is stored |
Table data interpretation |
Integer | columns[:] | 2:size(QHeaLoa, 2) | Columns of table to be interpolated |
Smoothness | smoothness | Modelica.Blocks.Types.Smooth... | Smoothness of table interpolation |
Time | timeScale | 1 | Time scale of first table column [s] |
Advanced |
Diagnostics |
Boolean | show_T | false | = true, if actual temperature at port is computed |
Nominal condition |
Density | rho_a_default | MediumSte.density(MediumSte.... | Default steam density [kg/m3] |
Density | rho_b_default | MediumWat.density(MediumWat.... | Default water density [kg/m3] |
model BuildingTimeSeriesAtETS
replaceable package MediumSte =
Buildings.Media.Steam constrainedby Modelica.Media.Interfaces.PartialMedium
;
replaceable package MediumWat =
Buildings.Media.Specialized.Water.TemperatureDependentDensity
constrainedby Modelica.Media.Interfaces.PartialMedium
;
constant Boolean allowFlowReversal = false
;
parameter Boolean have_prv = false
;
parameter Modelica.Units.SI.Power Q_flow_nominal
;
parameter Modelica.Units.SI.PressureDifference dp_nominal(displayUnit="Pa")
;
parameter Modelica.Units.SI.AbsolutePressure pSte_nominal=MediumSte.p_default
;
parameter Modelica.Units.SI.AbsolutePressure pLow_nominal=0.8*MediumSte.p_default
;
parameter Modelica.Units.SI.Temperature TSte_nominal=
MediumSte.saturationTemperature(pSte_nominal)
;
parameter Modelica.Units.SI.Temperature TLow_nominal=
MediumSte.temperature(
MediumSte.setState_phX(
p=pLow_nominal,
h=
MediumSte.specificEnthalpy(
MediumSte.setState_pTX(
p=pSte_nominal,
T=TSte_nominal,
X=MediumSte.X_default)),
X=MediumSte.X_default))
;
parameter Modelica.Units.SI.SpecificEnthalpy dh_nominal=
MediumSte.specificEnthalpy(
MediumSte.setState_pTX(
p=
if have_prv
then pLow_nominal
else pSte_nominal,
T=
if have_prv
then TLow_nominal
else TSte_nominal,
X=MediumSte.X_default)) -
MediumWat.specificEnthalpy(
MediumWat.setState_pTX(
p=
if have_prv
then pLow_nominal
else pSte_nominal,
T=
if have_prv
then TLow_nominal
else TSte_nominal,
X=MediumWat.X_default))
;
final parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=
Q_flow_nominal/dh_nominal
;
parameter Modelica.Units.SI.Volume V=1
;
parameter Modelica.Fluid.Types.Dynamics energyDynamics=
Modelica.Fluid.Types.Dynamics.DynamicFreeInitial
;
parameter MediumSte.AbsolutePressure p_start=MediumSte.p_default
;
parameter MediumSte.Temperature T_start=MediumSte.T_default
;
parameter Modelica.Units.SI.MassFlowRate m_flow_start=0
;
parameter Boolean tableOnFile=false
;
parameter Real QHeaLoa[:, :] =
fill(0.0, 0, 2)
;
parameter String tableName="NoName"
;
parameter String fileName="NoName" ;
parameter Integer columns[:]=2:
size(QHeaLoa, 2)
;
parameter Modelica.Blocks.Types.Smoothness smoothness=
Modelica.Blocks.Types.Smoothness.LinearSegments
;
parameter Modelica.Units.SI.Time timeScale(
min=Modelica.Constants.eps)=1 ;
parameter Boolean show_T = false
;
MediumSte.ThermodynamicState sta_a=
MediumSte.setState_phX(port_a.p,
noEvent(
actualStream(port_a.h_outflow)),
noEvent(
actualStream(port_a.Xi_outflow)))
if show_T
;
MediumWat.ThermodynamicState sta_b=
MediumWat.setState_phX(port_b.p,
noEvent(
actualStream(port_b.h_outflow)),
noEvent(
actualStream(port_b.Xi_outflow)))
if show_T
;
parameter Modelica.Units.SI.Density rho_a_default=
MediumSte.density(
MediumSte.setState_pTX(
p=pSte_nominal,T=TSte_nominal,X=MediumSte.X_default))
;
parameter Modelica.Units.SI.Density rho_b_default=
MediumWat.density(
MediumWat.setState_pTX(
p=101325,T=273.15+90,X=MediumWat.X_default))
;
Modelica.Blocks.Interfaces.RealOutput Q_flow(
final quantity="HeatFlowRate",
final unit="W",
displayUnit="kW")
;
Modelica.Blocks.Interfaces.RealOutput EHea(
final quantity="HeatFlow",
final unit="J",
displayUnit="kWh")
;
Modelica.Fluid.Interfaces.FluidPort_a port_a(
redeclare final package Medium =
MediumSte)
;
Modelica.Fluid.Interfaces.FluidPort_b port_b(
redeclare final package Medium =
MediumWat)
;
Modelica.Blocks.Sources.CombiTimeTable QHea(
final tableOnFile=tableOnFile,
final table=QHeaLoa,
final tableName=tableName,
final fileName=fileName,
final columns=columns,
final smoothness=smoothness,
final extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic,
final timeScale=timeScale)
;
Modelica.Blocks.Continuous.Integrator IntEHea(y(unit="J"))
;
Buildings.Fluid.Movers.FlowControlled_m_flow pumCNR(
redeclare final package Medium =
MediumWat,
final energyDynamics=energyDynamics,
p_start=steTra.pAtm,
T_start=steTra.TSat,
final allowFlowReversal=allowFlowReversal,
final m_flow_nominal=m_flow_nominal,
final show_T=show_T,
addPowerToMedium=false,
nominalValuesDefineDefaultPressureCurve=true,
init=Modelica.Blocks.Types.Init.InitialOutput,
final m_flow_start=m_flow_start)
;
Buildings.Experimental.DHC.Loads.Steam.BaseClasses.ControlVolumeCondensation vol(
redeclare final package MediumSte =
MediumSte,
redeclare final package MediumWat =
MediumWat,
final allowFlowReversal=allowFlowReversal,
final energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState,
final p_start=
if have_prv
then pLow_nominal
else pSte_nominal,
final m_flow_nominal=m_flow_nominal,
final show_T=show_T,
final V=V)
;
Buildings.Experimental.DHC.Loads.Steam.BaseClasses.SteamTrap steTra(
redeclare final package Medium =
MediumWat,
final allowFlowReversal=allowFlowReversal,
final m_flow_nominal=m_flow_nominal,
final show_T=show_T)
;
Buildings.Fluid.Sensors.SpecificEnthalpyTwoPort hIn(
redeclare final package Medium =
MediumSte,
final m_flow_nominal=m_flow_nominal)
;
Buildings.Fluid.Sensors.SpecificEnthalpyTwoPort hOut(
redeclare final package Medium =
MediumWat,
final m_flow_nominal=m_flow_nominal)
;
Modelica.Blocks.Math.Add dh(
final k2=-1)
;
Modelica.Blocks.Math.Division m_flow ;
Buildings.Experimental.DHC.Loads.Steam.BaseClasses.ValveSelfActing prv(
redeclare final package Medium =
MediumSte,
final m_flow_nominal=m_flow_nominal,
final show_T=show_T,
final pb_nominal=pLow_nominal)
if have_prv
;
equation
connect(Q_flow, Q_flow);
connect(IntEHea.y, EHea);
connect(QHea.y[1], Q_flow);
connect(IntEHea.u, Q_flow);
connect(pumCNR.port_b, port_b);
connect(steTra.port_b, pumCNR.port_a);
connect(hIn.port_b, vol.port_a);
connect(vol.port_b, hOut.port_a);
connect(hOut.port_b, steTra.port_a);
connect(dh.y, m_flow.u2);
connect(QHea.y[1], m_flow.u1);
connect(m_flow.y, pumCNR.m_flow_in);
connect(hIn.h_out, dh.u1);
connect(hOut.h_out, dh.u2);
connect(port_a, prv.port_a);
if have_prv
then
connect(prv.port_b, hIn.port_a);
else
connect(port_a, hIn.port_a);
end if;
end BuildingTimeSeriesAtETS;