Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses

Package with base classes

Information

This package contains base classes that are used to construct the classes in Buildings.Experimental.DHC.EnergyTransferStations.

Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).

Package Content

Name Description
Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.CollectorDistributor CollectorDistributor Model of a collector/distributor with zero pressure drop between connections
Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Connection2PipeLossless Connection2PipeLossless Model of a lossless connection to a collector/distributor
Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Junction Junction Fluid junction with zero pressure drop
Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.PartialETS PartialETS Partial class for modeling an energy transfer station
Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Pump_m_flow Pump_m_flow Pump with prescribed mass flow rate
Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.StratifiedTank StratifiedTank Stratified buffer tank model
Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.computeCoordinates computeCoordinates Coordinates of evenly distributed boreholes given the number of boreholes
Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Validation Validation Collection of validation models

Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.CollectorDistributor Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.CollectorDistributor

Model of a collector/distributor with zero pressure drop between connections

Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.CollectorDistributor

Information

This model represents a collector/distributor which connects nCon hydronic circuits in parallel. The pressure drop between each connection is assumed negligible compared to the pressure drop in each circuit, and is set to zero in the model. By default,

Extends from Networks.BaseClasses.PartialDistribution2Pipe (Partial model for two-pipe distribution network).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium model
IntegernCon Number of connections
replaceable model Model_pipDisFluid.FixedResistances.Lossl...Model for distribution pipe
IntegeriConDpSen-1Index of the connection where the pressure drop is measured
Booleanshow_entFlofalseSet to true to output enthalpy flow rate difference at each connection
Nominal condition
MassFlowRatemDis_flow_nominalsum(mCon_flow_nominal)Nominal mass flow rate in the distribution line before the first connection [kg/s]
MassFlowRatemCon_flow_nominal[nCon] Nominal mass flow rate in each connection line [kg/s]
MassFlowRatemEnd_flow_nominalmDis_flow_nominalNominal mass flow rate in the end of the distribution line [kg/s]
MassFlowRatemDisCon_flow_nominal[nCon]fill(mDis_flow_nominal, nCon)Nominal mass flow rate in the distribution line before each connection [kg/s]
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
Dynamics
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Nominal condition
Timetau10Time constant at nominal flow for dynamic energy and momentum balance [s]

Connectors

TypeNameDescription
FluidPorts_aports_aCon[nCon]Connection return ports
FluidPorts_bports_bCon[nCon]Connection supply ports
FluidPort_aport_aDisSupDistribution supply inlet port
FluidPort_bport_bDisSupDistribution supply outlet port
replaceable model Model_pipDisModel for distribution pipe
FluidPort_bport_bDisRetDistribution return outlet port
FluidPort_aport_aDisRetDistribution return inlet port
output RealOutputdpPressure difference at given location (measured) [Pa]
output RealOutputdH_flow[nCon]Difference in enthalpy flow rate between connection supply and return [W]
output RealOutputmCon_flow[nCon]Connection supply mass flow rate (measured) [kg/s]

Modelica definition

model CollectorDistributor "Model of a collector/distributor with zero pressure drop between connections" extends Networks.BaseClasses.PartialDistribution2Pipe( mDis_flow_nominal=sum( mCon_flow_nominal), final mDisCon_flow_nominal=fill( mDis_flow_nominal, nCon), final mEnd_flow_nominal=mDis_flow_nominal, final allowFlowReversal=true, final iConDpSen=-1, redeclare Connection2PipeLossless con[nCon], redeclare model Model_pipDis=Fluid.FixedResistances.LosslessPipe); end CollectorDistributor;

Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Connection2PipeLossless Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Connection2PipeLossless

Model of a lossless connection to a collector/distributor

Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Connection2PipeLossless

Information

This is a model of a connection for a two-pipe system using a pipe model with no flow resistance, no heat loss and no transport delay.

Extends from Networks.BaseClasses.PartialConnection2Pipe (Partial model for connecting an agent to a two-pipe distribution network).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium model
replaceable model Model_pipDisBuildings.Fluid.FixedResista... 
replaceable model Model_pipConBuildings.Fluid.FixedResista... 
Booleanshow_entFlofalseSet to true to output enthalpy flow rate difference
Nominal condition
MassFlowRatemDis_flow_nominal Nominal mass flow rate in the distribution line [kg/s]
MassFlowRatemCon_flow_nominal Nominal mass flow rate in the connection line [kg/s]
Assumptions
BooleanallowFlowReversalfalse= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
Dynamics
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Nominal condition
Timetau10Time constant at nominal flow for dynamic energy and momentum balance [s]

Connectors

TypeNameDescription
replaceable model Model_pipDis 
replaceable model Model_pipCon 
FluidPort_aport_aDisSupDistribution supply inlet port
FluidPort_bport_bDisSupDistribution supply outlet port
FluidPort_aport_aDisRetDistribution return inlet port
FluidPort_bport_bDisRetDistribution return outlet port
FluidPort_bport_bConConnection supply port
FluidPort_aport_aConConnection return port
output RealOutputmCon_flowConnection supply mass flow rate [kg/s]
output RealOutputdpPressure drop accross the connection (measured) [Pa]
output RealOutputdH_flowDifference in enthalpy flow rate between connection supply and return [W]

Modelica definition

model Connection2PipeLossless "Model of a lossless connection to a collector/distributor" extends Networks.BaseClasses.PartialConnection2Pipe( redeclare model Model_pipDis=Buildings.Fluid.FixedResistances.LosslessPipe, redeclare model Model_pipCon=Buildings.Fluid.FixedResistances.LosslessPipe); end Connection2PipeLossless;

Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Junction Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Junction

Fluid junction with zero pressure drop

Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Junction

Information

This is a model of a fluid junction with zero pressure drop. By default the model is configured in steady-state.

Extends from Fluid.FixedResistances.Junction (Flow splitter with fixed resistance at each port).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Nominal condition
MassFlowRatem_flow_nominal[3] Mass flow rate. Set negative at outflowing ports. [kg/s]
Pressuredp_nominal[3]fill(0, 3)Pressure drop at nominal mass flow rate, set to zero or negative number at outflowing ports. [Pa]
Transition to laminar
RealdeltaM0.3Fraction of nominal mass flow rate where transition to turbulent occurs
Dynamics
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
DynamicsmassDynamicsenergyDynamicsType of mass balance: dynamic (3 initialization options) or steady state
MassFlowRatemDyn_flow_nominalsum(abs(m_flow_nominal[:])/3)Nominal mass flow rate for dynamic momentum and energy balance [kg/s]
Nominal condition
Timetau10Time constant at nominal flow for dynamic energy and momentum balance [s]
Initialization
AbsolutePressurep_startMedium.p_defaultStart value of pressure [Pa]
TemperatureT_startMedium.T_defaultStart value of temperature [K]
MassFractionX_start[Medium.nX]Medium.X_defaultStart value of mass fractions m_i/m [kg/kg]
ExtraPropertyC_start[Medium.nC]fill(0, Medium.nC)Start value of trace substances
ExtraPropertyC_nominal[Medium.nC]fill(1E-2, Medium.nC)Nominal value of trace substances. (Set to typical order of magnitude.)
Advanced
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
PortFlowDirectionportFlowDirection_1Modelica.Fluid.Types.PortFlo...Flow direction for port_1
PortFlowDirectionportFlowDirection_2Modelica.Fluid.Types.PortFlo...Flow direction for port_2
PortFlowDirectionportFlowDirection_3Modelica.Fluid.Types.PortFlo...Flow direction for port_3
BooleanverifyFlowReversalfalse=true, to assert that the flow does not reverse when portFlowDirection_* does not equal Bidirectional
MassFlowRatem_flow_smallmDyn_flow_nominal*1e-4Small mass flow rate for checking flow reversal [kg/s]
Booleanlinearizedfalse= true, use linear relation between m_flow and dp for any flow rate

Connectors

TypeNameDescription
FluidPort_aport_1First port, typically inlet
FluidPort_bport_2Second port, typically outlet
FluidPort_aport_3Third port, can be either inlet or outlet

Modelica definition

model Junction "Fluid junction with zero pressure drop" extends Fluid.FixedResistances.Junction( energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, final dp_nominal=fill( 0, 3), final from_dp=false); end Junction;

Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.PartialETS Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.PartialETS

Partial class for modeling an energy transfer station

Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.PartialETS

Information

Partial class to be used for modeling an energy transfer station and optional in-building primary systems.

The connectors to the service lines are configured based on an enumeration defining the type of district system (CombinedGeneration2to4 by default), see Buildings.Experimental.DHC.Types.DistrictSystemType. In case of a heating service line, the model allows for using two different media at the inlet port port_aSerHea and at the oulet port port_bSerHea to represent a steam supply and condensate return.

The connectors to the building distribution systems are configured based on the Boolean parameters have_heaWat and have_chiWat.

Parameters

TypeNameDefaultDescription
replaceable package MediumSerBuildings.Media.WaterService side medium
replaceable package MediumSerHea_aBuildings.Media.WaterService side medium at heating inlet
replaceable package MediumBuiBuildings.Media.WaterBuilding side medium
Genericfue[nFue] Fuel type
Configuration
DistrictSystemTypetypTypDisSys.CombinedGeneration...Type of district system
Booleanhave_heaWatfalseSet to true if the ETS supplies heating water
Booleanhave_hotWatfalseSet to true if the ETS supplies hot water
Booleanhave_chiWatfalseSet to true if the ETS supplies chilled water
Booleanhave_fanfalseSet to true if fan power is computed
Booleanhave_pumfalseSet to true if pump power is computed
Booleanhave_eleHeafalseSet to true if the ETS has electric heating system
IntegernFue0Number of fuel types (0 means no combustion system)
Booleanhave_eleCoofalseSet to true if the ETS has electric cooling system
Booleanhave_weaBusfalseSet to true to use a weather bus
Nominal condition
HeatFlowRateQHeaWat_flow_nominal0Nominal capacity of heating system (>=0) [W]
HeatFlowRateQHotWat_flow_nominal0Nominal capacity of hot water production system (>=0) [W]
HeatFlowRateQChiWat_flow_nominal0Nominal capacity of cooling system (<=0) [W]
Assumptions
BooleanallowFlowReversalSerfalseSet to true to allow flow reversal on service side
BooleanallowFlowReversalBuifalseSet to true to allow flow reversal on building side

Connectors

TypeNameDescription
replaceable package MediumSerService side medium
replaceable package MediumSerHea_aService side medium at heating inlet
replaceable package MediumBuiBuilding side medium
FluidPorts_aports_aHeaWat[nPorts_aHeaWat]Fluid connectors for heating water return (from building)
FluidPorts_bports_bHeaWat[nPorts_bHeaWat]Fluid connectors for heating water supply (to building)
FluidPorts_aports_aChiWat[nPorts_aChiWat]Fluid connectors for chilled water return (from building)
FluidPorts_bports_bChiWat[nPorts_bChiWat]Fluid connectors for chilled water supply (to building)
FluidPort_aport_aSerAmbFluid connector for ambient water service supply line
FluidPort_bport_bSerAmbFluid connector for ambient water service return line
FluidPort_aport_aSerHeaFluid connector for heating service supply line
FluidPort_bport_bSerHeaFluid connector for heating service return line
FluidPort_aport_aSerCooFluid connector for cooling service supply line
FluidPort_bport_bSerCooFluid connector for cooling service return line
output RealOutputPHeaPower drawn by heating system [W]
output RealOutputPCooPower drawn by cooling system [W]
output RealOutputPFanPower drawn by fan motors [W]
output RealOutputPPumPower drawn by pump motors [W]
output RealOutputQFue_flow[nFue]Fuel energy input rate [W]
BusweaBusWeather data bus

Modelica definition

partial model PartialETS "Partial class for modeling an energy transfer station" import TypDisSys=Buildings.Experimental.DHC.Types.DistrictSystemType "District system type enumeration"; replaceable package MediumSer=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "Service side medium"; replaceable package MediumSerHea_a=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "Service side medium at heating inlet"; replaceable package MediumBui=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "Building side medium"; parameter TypDisSys typ = TypDisSys.CombinedGeneration2to4 "Type of district system"; parameter Integer nPorts_aHeaWat=0 "Number of heating water return ports"; parameter Integer nPorts_bHeaWat=0 "Number of heating water supply ports"; parameter Integer nPorts_aChiWat=0 "Number of chilled water return ports"; parameter Integer nPorts_bChiWat=0 "Number of chilled water supply ports"; parameter Boolean have_heaWat=false "Set to true if the ETS supplies heating water"; parameter Boolean have_hotWat=false "Set to true if the ETS supplies hot water"; parameter Boolean have_chiWat=false "Set to true if the ETS supplies chilled water"; parameter Boolean have_fan=false "Set to true if fan power is computed"; parameter Boolean have_pum=false "Set to true if pump power is computed"; parameter Boolean have_eleHea=false "Set to true if the ETS has electric heating system"; parameter Integer nFue=0 "Number of fuel types (0 means no combustion system)"; parameter Boolean have_eleCoo=false "Set to true if the ETS has electric cooling system"; parameter Boolean have_weaBus=false "Set to true to use a weather bus"; parameter Boolean allowFlowReversalSer=false "Set to true to allow flow reversal on service side"; parameter Boolean allowFlowReversalBui=false "Set to true to allow flow reversal on building side"; parameter Modelica.SIunits.HeatFlowRate QHeaWat_flow_nominal(min=0)=0 "Nominal capacity of heating system (>=0)"; parameter Modelica.SIunits.HeatFlowRate QHotWat_flow_nominal(min=0)=0 "Nominal capacity of hot water production system (>=0)"; parameter Modelica.SIunits.HeatFlowRate QChiWat_flow_nominal(max=0)=0 "Nominal capacity of cooling system (<=0)"; parameter Buildings.Fluid.Data.Fuels.Generic fue[nFue] "Fuel type"; // IO CONNECTORS Modelica.Fluid.Interfaces.FluidPorts_a ports_aHeaWat[nPorts_aHeaWat]( redeclare each package Medium=MediumBui, each m_flow( min= if allowFlowReversalBui then -Modelica.Constants.inf else 0), each h_outflow( start=MediumBui.h_default, nominal=MediumBui.h_default)) if have_heaWat "Fluid connectors for heating water return (from building)"; Modelica.Fluid.Interfaces.FluidPorts_b ports_bHeaWat[nPorts_bHeaWat]( redeclare each package Medium=MediumBui, each m_flow( max= if allowFlowReversalBui then +Modelica.Constants.inf else 0), each h_outflow( start=MediumBui.h_default, nominal=MediumBui.h_default)) if have_heaWat "Fluid connectors for heating water supply (to building)"; Modelica.Fluid.Interfaces.FluidPorts_a ports_aChiWat[nPorts_aChiWat]( redeclare each package Medium=MediumBui, each m_flow( min= if allowFlowReversalBui then -Modelica.Constants.inf else 0), each h_outflow( start=MediumBui.h_default, nominal=MediumBui.h_default)) if have_chiWat "Fluid connectors for chilled water return (from building)"; Modelica.Fluid.Interfaces.FluidPorts_b ports_bChiWat[nPorts_bChiWat]( redeclare each package Medium=MediumBui, each m_flow( max= if allowFlowReversalBui then +Modelica.Constants.inf else 0), each h_outflow( start=MediumBui.h_default, nominal=MediumBui.h_default)) if have_chiWat "Fluid connectors for chilled water supply (to building)"; Modelica.Fluid.Interfaces.FluidPort_a port_aSerAmb( redeclare package Medium = MediumSer, m_flow(min=if allowFlowReversalSer then -Modelica.Constants.inf else 0), h_outflow(start=MediumSer.h_default, nominal=MediumSer.h_default)) if typ == TypDisSys.CombinedGeneration5 "Fluid connector for ambient water service supply line"; Modelica.Fluid.Interfaces.FluidPort_b port_bSerAmb( redeclare package Medium = MediumSer, m_flow(max=if allowFlowReversalSer then +Modelica.Constants.inf else 0), h_outflow(start=MediumSer.h_default, nominal=MediumSer.h_default)) if typ == TypDisSys.CombinedGeneration5 "Fluid connector for ambient water service return line"; Modelica.Fluid.Interfaces.FluidPort_a port_aSerHea( redeclare package Medium = MediumSerHea_a, m_flow(min=if allowFlowReversalSer then -Modelica.Constants.inf else 0), h_outflow(start=MediumSerHea_a.h_default, nominal=MediumSerHea_a.h_default)) if typ <> TypDisSys.Cooling and typ <> TypDisSys.CombinedGeneration5 "Fluid connector for heating service supply line"; Modelica.Fluid.Interfaces.FluidPort_b port_bSerHea( redeclare package Medium = MediumSer, m_flow(max=if allowFlowReversalSer then +Modelica.Constants.inf else 0), h_outflow(start=MediumSer.h_default, nominal=MediumSer.h_default)) if typ <> TypDisSys.Cooling and typ <> TypDisSys.CombinedGeneration5 "Fluid connector for heating service return line"; Modelica.Fluid.Interfaces.FluidPort_a port_aSerCoo( redeclare package Medium = MediumSer, m_flow(min=if allowFlowReversalSer then -Modelica.Constants.inf else 0), h_outflow(start=MediumSer.h_default, nominal=MediumSer.h_default)) if typ == TypDisSys.CombinedGeneration1 or typ == TypDisSys.CombinedGeneration2to4 or typ == TypDisSys.Cooling "Fluid connector for cooling service supply line"; Modelica.Fluid.Interfaces.FluidPort_b port_bSerCoo( redeclare package Medium = MediumSer, m_flow(max=if allowFlowReversalSer then +Modelica.Constants.inf else 0), h_outflow(start=MediumSer.h_default, nominal=MediumSer.h_default)) if typ == TypDisSys.CombinedGeneration1 or typ == TypDisSys.CombinedGeneration2to4 or typ == TypDisSys.Cooling "Fluid connector for cooling service return line"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput PHea( final unit="W") if have_eleHea "Power drawn by heating system"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput PCoo( final unit="W") if have_eleCoo "Power drawn by cooling system"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput PFan( final unit="W") if have_fan "Power drawn by fan motors"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput PPum( final unit="W") if have_pum "Power drawn by pump motors"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput QFue_flow[nFue]( each final unit="W") if nFue>0 "Fuel energy input rate"; BoundaryConditions.WeatherData.Bus weaBus if have_weaBus "Weather data bus"; initial equation assert( nPorts_aHeaWat == nPorts_bHeaWat, "In "+getInstanceName()+": The numbers of heating water supply ports ("+String( nPorts_bHeaWat)+") and return ports ("+String( nPorts_aHeaWat)+") must be equal."); assert( nPorts_aChiWat == nPorts_bChiWat, "In "+getInstanceName()+": The numbers of chilled water supply ports ("+String( nPorts_bChiWat)+") and return ports ("+String( nPorts_aChiWat)+") must be equal."); if have_chiWat then assert( QChiWat_flow_nominal <-Modelica.Constants.eps, "In "+getInstanceName()+": Design heat flow rate for chilled water production must be strictly negative. Obtained QChiWat_flow_nominal = "+String( QChiWat_flow_nominal)); end if; if have_heaWat then assert( QHeaWat_flow_nominal > Modelica.Constants.eps, "In "+getInstanceName()+": Design heat flow rate for heating water production must be strictly positive. Obtained QHeaWat_flow_nominal = "+String( QHeaWat_flow_nominal)); end if; if have_hotWat then assert( QHotWat_flow_nominal > Modelica.Constants.eps, "In "+getInstanceName()+": Design heat flow rate for heating water production must be strictly positive. Obtained QHotWat_flow_nominal = "+String( QHotWat_flow_nominal)); end if; end PartialETS;

Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Pump_m_flow Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Pump_m_flow

Pump with prescribed mass flow rate

Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Pump_m_flow

Information

This is a steady-state model of a pump with ideally controlled mass flow rate as input signal, and no heat added to the medium.

Extends from Buildings.Fluid.Movers.FlowControlled_m_flow (Fan or pump with ideally controlled mass flow rate as input signal).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
BooleanaddPowerToMediumfalseSet to false to avoid any power (=heat and flow work) being added to medium (may give simpler equations)
BooleannominalValuesDefineDefaultPressureCurvetrueSet to true to avoid warning if m_flow_nominal and dp_nominal are used to construct the default pressure curve
MassFlowRateconstantMassFlowRatem_flow_nominalConstant pump mass flow rate, used when inputType=Constant [kg/s]
MassFlowRatemassFlowRates[:]m_flow_nominal*{per.speeds[i...Vector of mass flow rate set points, used when inputType=Stage [kg/s]
Nominal condition
MassFlowRatem_flow_nominalm_flow_nominal(final min=Mod...Nominal mass flow rate [kg/s]
PressureDifferencedp_nominalif rho_default < 500 then 50...Nominal pressure raise, used for default pressure curve if not specified in record per [Pa]
Control
InputTypeinputTypeBuildings.Fluid.Types.InputT...Control input type
Dynamics
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
DynamicsmassDynamicsenergyDynamicsType of mass balance: dynamic (3 initialization options) or steady state
Nominal condition
Timetau1Time constant of fluid volume for nominal flow, used if energy or mass balance is dynamic [s]
Filtered speed
Booleanuse_inputFilterfalse= true, if speed is filtered with a 2nd order CriticalDamping filter
TimeriseTime30Rise time of the filter (time to reach 99.6 % of the speed) [s]
InitinitModelica.Blocks.Types.Init.I...Type of initialization (no init/steady state/initial state/initial output)
Realy_start0Initial value of speed [1]
MassFlowRatem_flow_start0Initial value of mass flow rate [kg/s]
Initialization
AbsolutePressurep_startMedium.p_defaultStart value of pressure [Pa]
TemperatureT_startMedium.T_defaultStart value of temperature [K]
MassFractionX_start[Medium.nX]Medium.X_defaultStart value of mass fractions m_i/m [kg/kg]
ExtraPropertyC_start[Medium.nC]fill(0, Medium.nC)Start value of trace substances
ExtraPropertyC_nominal[Medium.nC]fill(1E-2, Medium.nC)Nominal value of trace substances. (Set to typical order of magnitude.)
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
input IntegerInputstageStage input signal for the pressure head
output RealOutputy_actualActual normalised pump speed that is used for computations [1]
output RealOutputPElectrical power consumed [W]
HeatPort_aheatPortHeat dissipation to environment
input RealInputm_flow_inPrescribed mass flow rate [kg/s]
output RealOutputm_flow_actualActual mass flow rate [kg/s]

Modelica definition

model Pump_m_flow "Pump with prescribed mass flow rate" extends Buildings.Fluid.Movers.FlowControlled_m_flow( per( motorCooledByFluid=false), inputType=Buildings.Fluid.Types.InputType.Continuous, addPowerToMedium=false, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, nominalValuesDefineDefaultPressureCurve=true, use_inputFilter=false); end Pump_m_flow;

Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.StratifiedTank Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.StratifiedTank

Stratified buffer tank model

Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.StratifiedTank

Information

This is a four-port tank model based on Buildings.Fluid.Storage.Stratified which includes the following features.

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium model
VolumeVTan Tank volume [m3]
LengthhTan Height of tank (without insulation) [m]
LengthdIns Thickness of insulation [m]
ThermalConductivitykIns0.04Specific heat conductivity of insulation [W/(m.K)]
IntegernSeg3Number of volume segments
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]

Connectors

TypeNameDescription
replaceable package MediumMedium model
FluidPort_aport_aTopInlet fluid port at tank top
FluidPort_bport_bBotOutlet fluid port at tank bottom
FluidPort_aport_aBotInlet fluid port at tank bottom
FluidPort_bport_bTopOutlet fluid port at tank top
output RealOutputQl_flowHeat loss of tank (positive if heat flows from tank to ambient) [W]
output RealOutputTTopFluid temperature at tank top [K]
output RealOutputTBotFluid temperature at tank bottom [K]
HeatPort_aheaPorAmbHeat port at interface with ambient (outside insulation)

Modelica definition

model StratifiedTank "Stratified buffer tank model" replaceable package Medium=Modelica.Media.Interfaces.PartialMedium "Medium model"; final parameter Boolean allowFlowReversal=true "= true to allow flow reversal, false restricts to design direction (port_a -> port_b)"; parameter Modelica.SIunits.Volume VTan "Tank volume"; parameter Modelica.SIunits.Length hTan "Height of tank (without insulation)"; parameter Modelica.SIunits.Length dIns "Thickness of insulation"; parameter Modelica.SIunits.ThermalConductivity kIns=0.04 "Specific heat conductivity of insulation"; parameter Integer nSeg( min=2)=3 "Number of volume segments"; parameter Modelica.SIunits.MassFlowRate m_flow_nominal "Nominal mass flow rate"; // IO CONNECTORS Modelica.Fluid.Interfaces.FluidPort_a port_aTop( redeclare final package Medium=Medium, m_flow( min= if allowFlowReversal then -Modelica.Constants.inf else 0), h_outflow( start=Medium.h_default, nominal=Medium.h_default)) "Inlet fluid port at tank top"; Modelica.Fluid.Interfaces.FluidPort_b port_bBot( redeclare final package Medium=Medium, m_flow( max= if allowFlowReversal then +Modelica.Constants.inf else 0), h_outflow( start=Medium.h_default, nominal=Medium.h_default)) "Outlet fluid port at tank bottom"; Modelica.Fluid.Interfaces.FluidPort_a port_aBot( redeclare final package Medium=Medium, m_flow( min= if allowFlowReversal then -Modelica.Constants.inf else 0), h_outflow( start=Medium.h_default, nominal=Medium.h_default)) "Inlet fluid port at tank bottom"; Modelica.Fluid.Interfaces.FluidPort_b port_bTop( redeclare final package Medium=Medium, m_flow( max= if allowFlowReversal then +Modelica.Constants.inf else 0), h_outflow( start=Medium.h_default, nominal=Medium.h_default)) "Outlet fluid port at tank top"; Modelica.Blocks.Interfaces.RealOutput Ql_flow( final unit="W") "Heat loss of tank (positive if heat flows from tank to ambient)"; Modelica.Blocks.Interfaces.RealOutput TTop( final unit="K", displayUnit="degC") "Fluid temperature at tank top"; Modelica.Blocks.Interfaces.RealOutput TBot( final unit="K", displayUnit="degC") "Fluid temperature at tank bottom"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heaPorAmb "Heat port at interface with ambient (outside insulation)"; // COMPONENTS Fluid.Storage.Stratified tan( redeclare final package Medium=Medium, final m_flow_nominal=m_flow_nominal, final VTan=VTan, final hTan=hTan, final dIns=dIns, final kIns=kIns, final nSeg=nSeg) "Stratified tank"; Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor senTBot "Tank bottom temperature"; Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor senTTop "Tank top temperature"; protected Modelica.Thermal.HeatTransfer.Components.ThermalCollector theCol( m=3) "Connector to assign multiple heat ports to one heat port"; equation connect(port_aTop,tan.port_a); connect(port_bTop,tan.fluPorVol[1]); connect(tan.port_b,port_bBot); connect(port_aBot,tan.fluPorVol[nSeg]); connect(tan.Ql_flow,Ql_flow); connect(tan.heaPorVol[nSeg],senTBot.port); connect(tan.heaPorVol[1],senTTop.port); connect(senTTop.T,TTop); connect(senTBot.T,TBot); connect(heaPorAmb,theCol.port_b); connect(theCol.port_a[1],tan.heaPorTop); connect(theCol.port_a[2],tan.heaPorSid); connect(theCol.port_a[3],tan.heaPorBot); end StratifiedTank;

Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.computeCoordinates

Coordinates of evenly distributed boreholes given the number of boreholes

Information

This function computes the coordinates of boreholes evenly distributed along the x and y axis, given the number of boreholes (which must be the square of an integer).

Inputs

TypeNameDefaultDescription
IntegernBorHol Number of boreholes
Distancedxy6Distance in x-axis (and y-axis) between borehole axes [m]

Outputs

TypeNameDescription
DistancecooBor[nBorHol, 2]Coordinates of boreholes [m]

Modelica definition

function computeCoordinates "Coordinates of evenly distributed boreholes given the number of boreholes" input Integer nBorHol "Number of boreholes"; input Modelica.SIunits.Distance dxy=6 "Distance in x-axis (and y-axis) between borehole axes"; output Modelica.SIunits.Distance cooBor[nBorHol,2] "Coordinates of boreholes"; protected Integer k=1 "Iteration index"; algorithm for i in 0:sqrt( nBorHol)-1 loop for j in 0:sqrt( nBorHol)-1 loop cooBor[k,1] := i*dxy; cooBor[k,2] := j*dxy; k := k+1; end for; end for; end computeCoordinates;