Buildings.Obsolete.DistrictHeatingCooling.SubStations.BaseClasses
Package with base classes for substations
Information
This package contains base classes that are used to construct the models in Buildings.Obsolete.DistrictHeatingCooling.SubStations.
Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).
Package Content
Name | Description |
---|---|
HeatingOrCooling | Base class for heating or cooling substation |
Buildings.Obsolete.DistrictHeatingCooling.SubStations.BaseClasses.HeatingOrCooling
Base class for heating or cooling substation
Information
Base class for a heating or cooling substation that draws
as much water as needed to maintain the prescribed temperature
difference dTHex
over the heat exchanger.
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 | false | = 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] |
Diagnostics | |||
Boolean | show_T | false | = true, if actual temperature at port is computed |
Flow resistance | |||
Real | deltaM | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |
Dynamics | |||
Time | tau | 30 | Time constant at nominal flow (if energyDynamics <> SteadyState) [s] |
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
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 | PPum | Electrical power consumed by pump [W] |
Modelica definition
partial model HeatingOrCooling "Base class for heating or cooling substation"
extends Buildings.Fluid.Interfaces.PartialTwoPortInterface(
final m_flow(start=0),
final dp(start=0),
final allowFlowReversal=false);
parameter Modelica.Units.SI.Pressure dp_nominal(displayUnit="Pa") = 30000
"Pressure difference at nominal flow rate";
Modelica.Blocks.Interfaces.RealOutput PPum(unit="W")
"Electrical power consumed by pump";
parameter Real deltaM=0.1
"Fraction of nominal flow rate where flow transitions to laminar";
parameter Modelica.Units.SI.Time tau=30
"Time constant at nominal flow (if energyDynamics <> SteadyState)";
parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState
"Type of energy balance: dynamic (3 initialization options) or steady state";
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]) "Medium state at default properties";
final parameter Modelica.Units.SI.SpecificHeatCapacity cp_default=
Medium.specificHeatCapacityCp(sta_default)
"Specific heat capacity of the fluid";
Buildings.Fluid.HeatExchangers.HeaterCooler_u hex(
redeclare final package Medium = Medium,
final allowFlowReversal=allowFlowReversal,
final m_flow_nominal=m_flow_nominal,
final from_dp=false,
final linearizeFlowResistance=true,
final show_T=false,
final Q_flow_nominal=-1,
final dp_nominal=dp_nominal,
final deltaM=deltaM,
final tau=tau,
final energyDynamics=energyDynamics)
"Component to remove heat from or add heat to fluid";
Buildings.Fluid.Movers.FlowControlled_m_flow pum(
redeclare final package Medium = Medium,
final energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState,
final allowFlowReversal=allowFlowReversal,
final m_flow_nominal=m_flow_nominal,
final inputType=Buildings.Fluid.Types.InputType.Continuous,
final use_inputFilter=false) "Pump";
Modelica.Blocks.Math.Gain mPum_flow "Mass flow rate";
equation
connect(port_a, pum.port_a);
connect(pum.port_b,hex. port_a);
connect(hex.port_b, port_b);
connect(mPum_flow.y, pum.m_flow_in);
connect(pum.P, PPum);
end HeatingOrCooling;