Buildings.Experimental.DHC.Plants.Cooling.BaseClasses

Package containing base classes

Information

Package containing base classes.

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

Package Content

Name Description
Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.IdealUser IdealUser Ideal user model
Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.ParallelJunctions ParallelJunctions A pair of junctions in parallel
Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.ParallelPipes ParallelPipes CHW supply and return pipes in parallel
Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.ReversibleConnection ReversibleConnection A connection that supports reversible flow with a pump and a valve
Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.TankBranch TankBranch Model of the tank branch of a storage plant
Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.Validation Validation Package containing validation models

Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.IdealUser Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.IdealUser

Ideal user model

Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.IdealUser

Information

This is a simple ideal user model used by Buildings.Experimental.DHC.Plants.Cooling.Examples.StoragePlantDualSource. The load of the user is described by a varying mass flow rate setpoint. The valve is controlled to maintain the requested mass flow rate. The model sets its leaving water temperature to the user-specified temperature T_CHWR_nominal.

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium package
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
TemperatureT_CHWR_nominal Nominal temperature of CHW return [K]
PressureDifferencedp_nominal Nominal pressure drop when valve is fully open [Pa]

Connectors

TypeNameDescription
replaceable package MediumMedium package
input RealInputmPre_flowLoad in terms of flow rate prescription [kg/s]
output RealOutputyVal_actualConsumer control valve actuator position [1]
output RealOutputdpDifferential pressure from the sensor [Pa]
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)

Modelica definition

model IdealUser "Ideal user model" replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium package"; parameter Modelica.Units.SI.MassFlowRate m_flow_nominal "Nominal mass flow rate"; parameter Modelica.Units.SI.Temperature T_CHWR_nominal "Nominal temperature of CHW return"; parameter Modelica.Units.SI.PressureDifference dp_nominal( final displayUnit="Pa") "Nominal pressure drop when valve is fully open"; Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val( redeclare final package Medium = Medium, final use_inputFilter=true, final dpValve_nominal=dp_nominal/2, final init=Modelica.Blocks.Types.Init.InitialState, final dpFixed_nominal=dp_nominal/2, final m_flow_nominal=m_flow_nominal, y_start=0) "User control valve"; Buildings.Controls.Continuous.LimPID conPI( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=0.5, Ti=20, final reverseActing=true) "PI controller"; Modelica.Blocks.Interfaces.RealInput mPre_flow( final quantity = "MassFlowRate", final unit = "kg/s") "Load in terms of flow rate prescription"; Modelica.Blocks.Interfaces.RealOutput yVal_actual( final unit = "1") "Consumer control valve actuator position"; Buildings.Fluid.Sensors.RelativePressure senRelPre( redeclare final package Medium = Medium) "Differential pressure sensor"; Modelica.Blocks.Interfaces.RealOutput dp( final quantity="PressureDifference", final unit="Pa", displayUnit="Pa") "Differential pressure from the sensor"; Modelica.Fluid.Interfaces.FluidPort_a port_a( p(start=Medium.p_default), redeclare final package Medium = Medium, h_outflow(start=Medium.h_default, nominal=Medium.h_default)) "Fluid connector a (positive design flow direction is from port_a to port_b)"; Modelica.Fluid.Interfaces.FluidPort_b port_b( p(start=Medium.p_default), redeclare final package Medium = Medium, h_outflow(start=Medium.h_default, nominal=Medium.h_default)) "Fluid connector b (positive design flow direction is from port_a to port_b)"; Buildings.Fluid.Sensors.MassFlowRate senMasFlo( redeclare final package Medium = Medium) "Mass flow rate sensor"; Buildings.Fluid.Sources.PropertySource_T proSou( redeclare final package Medium = Medium, final use_T_in=true) "Ideal temperature source"; Modelica.Blocks.Sources.Constant TRet(final k=T_CHWR_nominal) "Constant CHW return temperature"; equation connect(senRelPre.p_rel, dp); connect(val.y_actual, yVal_actual); connect(senRelPre.port_a, port_a); connect(senRelPre.port_b, port_b); connect(conPI.y, val.y); connect(senMasFlo.port_b, port_b); connect(senMasFlo.m_flow, conPI.u_m); connect(port_a, val.port_a); connect(conPI.u_s, mPre_flow); connect(senMasFlo.port_a, proSou.port_b); connect(proSou.port_a, val.port_b); connect(TRet.y, proSou.T_in); end IdealUser;

Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.ParallelJunctions Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.ParallelJunctions

A pair of junctions in parallel

Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.ParallelJunctions

Information

This model provides junction models in parallel on the distribution pipe lines. This model is for breaking algebraic loops only and has no pressure drop.

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium package
Nominal condition
MassFlowRatem_flow_nominal Design mass flow rate (used to approximate dynamics [kg/s]
Dynamics
Nominal condition
Timetau30Time constant at nominal flow [s]
Initialization
TemperatureT1_startMedium.T_defaultStart temperature of the volume [K]
TemperatureT2_startMedium.T_defaultStart temperature of the volume [K]

Connectors

TypeNameDescription
replaceable package MediumMedium package
FluidPort_aport_a2Fluid connector
FluidPort_bport_b1Fluid connector
FluidPort_bport_b2Fluid connector
FluidPort_aport_a1Fluid connector
FluidPort_aport_c1Fluid connector
FluidPort_bport_c2Fluid connector

Modelica definition

model ParallelJunctions "A pair of junctions in parallel" replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium package"; parameter Modelica.Units.SI.MassFlowRate m_flow_nominal "Design mass flow rate (used to approximate dynamics"; parameter Modelica.Units.SI.Time tau=30 "Time constant at nominal flow"; parameter Modelica.Units.SI.Temperature T1_start=Medium.T_default "Start temperature of the volume"; parameter Modelica.Units.SI.Temperature T2_start=Medium.T_default "Start temperature of the volume"; Modelica.Fluid.Interfaces.FluidPort_a port_a2( redeclare final package Medium = Medium, p(final displayUnit="Pa")) "Fluid connector"; Modelica.Fluid.Interfaces.FluidPort_b port_b1( redeclare final package Medium = Medium, p(final displayUnit="Pa")) "Fluid connector"; Modelica.Fluid.Interfaces.FluidPort_b port_b2( redeclare final package Medium = Medium, p(final displayUnit="Pa")) "Fluid connector"; Modelica.Fluid.Interfaces.FluidPort_a port_a1( redeclare final package Medium = Medium, p(final displayUnit="Pa")) "Fluid connector"; Modelica.Fluid.Interfaces.FluidPort_a port_c1( redeclare final package Medium = Medium, p(final displayUnit="Pa")) "Fluid connector"; Modelica.Fluid.Interfaces.FluidPort_b port_c2( redeclare final package Medium = Medium, p(final displayUnit="Pa")) "Fluid connector"; Buildings.Fluid.FixedResistances.Junction jun1( redeclare final package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, final tau=tau, final T_start=T1_start, final m_flow_nominal={-m_flow_nominal,-m_flow_nominal,m_flow_nominal}, final dp_nominal={0,0,0}) "Junction"; Buildings.Fluid.FixedResistances.Junction jun2( redeclare final package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, final tau=tau, final T_start=T2_start, final m_flow_nominal={m_flow_nominal,m_flow_nominal,-m_flow_nominal}, final dp_nominal={0,0,0}) "Junction"; equation connect(port_a1, jun1.port_1); connect(jun1.port_3,port_c1); connect(jun1.port_2, port_b1); connect(port_b2, jun2.port_1); connect(jun2.port_2, port_a2); connect(jun2.port_3,port_c2); end ParallelJunctions;

Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.ParallelPipes Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.ParallelPipes

CHW supply and return pipes in parallel

Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.ParallelPipes

Information

This model contains two pipes in parallel that represent the supply and return pipes of a district CHW network. Only pressure drop is considered. This model does not consider heat loss.

Extends from Buildings.Fluid.Interfaces.PartialFourPortInterface (Partial model transporting fluid between two ports without storing mass or energy).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
replaceable package MediumModelica.Media.Interfaces.Pa...Medium package
Nominal condition
MassFlowRatem1_flow_nominalm_flow_nominalNominal mass flow rate [kg/s]
MassFlowRatem2_flow_nominalm_flow_nominalNominal mass flow rate [kg/s]
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedp_nominal Nominal pressure drop [Pa]
Assumptions
BooleanallowFlowReversal1true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Advanced
MassFlowRatem1_flow_small1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatem2_flow_small1E-4*abs(m2_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
replaceable package Medium1Medium 1 in the component
replaceable package Medium2Medium 2 in the component
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)
replaceable package MediumMedium package

Modelica definition

model ParallelPipes "CHW supply and return pipes in parallel" extends Buildings.Fluid.Interfaces.PartialFourPortInterface( redeclare final package Medium1 = Medium, redeclare final package Medium2 = Medium, final m1_flow_nominal = m_flow_nominal, final m2_flow_nominal = m_flow_nominal); replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium package"; parameter Modelica.Units.SI.MassFlowRate m_flow_nominal "Nominal mass flow rate"; parameter Modelica.Units.SI.PressureDifference dp_nominal( final displayUnit="Pa") "Nominal pressure drop"; Buildings.Fluid.FixedResistances.PressureDrop preDro1( redeclare package Medium = Medium1, final allowFlowReversal=true, final dp_nominal=dp_nominal, final m_flow_nominal=m1_flow_nominal) "Flow resistance"; Buildings.Fluid.FixedResistances.PressureDrop preDro2( redeclare package Medium = Medium2, final allowFlowReversal=true, final dp_nominal=dp_nominal, final m_flow_nominal=m2_flow_nominal) "Flow resistance"; equation connect(preDro1.port_a, port_a1); connect(preDro1.port_b, port_b1); connect(preDro2.port_a, port_a2); connect(preDro2.port_b, port_b2); end ParallelPipes;

Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.ReversibleConnection Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.ReversibleConnection

A connection that supports reversible flow with a pump and a valve

Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.ReversibleConnection

Information

This model implements a piping connection for reversible mass flow rate between the storage plant and the district network.

Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
MassFlowRatemTan_flow_nominal Nominal mass flow rate for CHW tank branch [kg/s]
PressureDifferencedpPum_nominal Nominal pressure difference for supply pump sizing [Pa]
PressureDifferencedpVal_nominal Nominal pressure difference for return valve sizing [Pa]
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
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
Initialization
ThermodynamicTemperatureT_start Start temperature [K]

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)
output RealOutputPEleEstimated power consumption [W]
input RealInputyPumNormalized speed signal for pump [1]
input RealInputyValNormalized flow signal for valve [1]

Modelica definition

model ReversibleConnection "A connection that supports reversible flow with a pump and a valve" extends Buildings.Fluid.Interfaces.PartialTwoPortInterface( final allowFlowReversal=true); parameter Modelica.Units.SI.MassFlowRate mTan_flow_nominal(min=0) "Nominal mass flow rate for CHW tank branch"; parameter Modelica.Units.SI.PressureDifference dpPum_nominal "Nominal pressure difference for supply pump sizing"; parameter Modelica.Units.SI.PressureDifference dpVal_nominal "Nominal pressure difference for return valve sizing"; parameter Modelica.Units.SI.ThermodynamicTemperature T_start "Start temperature"; Modelica.Blocks.Interfaces.RealOutput PEle( final quantity="Power", final unit="W") "Estimated power consumption"; Modelica.Blocks.Interfaces.RealInput yPum(final unit="1") "Normalized speed signal for pump"; Buildings.Fluid.Movers.Preconfigured.SpeedControlled_y pum( redeclare final package Medium = Medium, final m_flow_nominal=m_flow_nominal, final addPowerToMedium=false, final dp_nominal=dpPum_nominal) "Supply pump"; Buildings.Fluid.FixedResistances.CheckValve cheVal( redeclare final package Medium = Medium, final m_flow_nominal=m_flow_nominal, final dpValve_nominal=0.1*dpPum_nominal, final dpFixed_nominal=0) "Check valve"; Buildings.Fluid.Actuators.Valves.TwoWayPressureIndependent val( redeclare final package Medium = Medium, final m_flow_nominal=mTan_flow_nominal, final dpValve_nominal=dpVal_nominal, y_start=0) "Valve that throttles CHW from the supply line to the tank"; Modelica.Blocks.Interfaces.RealInput yVal(final unit="1") "Normalized flow signal for valve"; protected Buildings.Fluid.FixedResistances.Junction jun1( redeclare final package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, tau=30, T_start=T_start, m_flow_nominal={-mTan_flow_nominal,m_flow_nominal,-m_flow_nominal}, dp_nominal={0,0,0}) "Junction"; Buildings.Fluid.FixedResistances.Junction jun2( redeclare final package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, tau=30, T_start=T_start, m_flow_nominal={-m_flow_nominal,-mTan_flow_nominal,m_flow_nominal}, dp_nominal={0,0,0}) "Junction"; equation connect(pum.port_b, jun2.port_1); connect(jun2.port_3, port_b); connect(val.port_a, jun2.port_2); connect(jun1.port_3, port_a); connect(jun1.port_1, val.port_b); connect(pum.y, yPum); connect(yVal, val.y); connect(pum.P, PEle); connect(jun1.port_2, cheVal.port_a); connect(cheVal.port_b, pum.port_a); end ReversibleConnection;

Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.TankBranch Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.TankBranch

Model of the tank branch of a storage plant

Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.TankBranch

Information

This model is part of a storage plant. This branch has a stratified tank. This tank can potentially be charged remotely by a chiller from the district CHW network, or by a chiller that is local to the energy transfer station that contains this tank.

Extends from Buildings.Fluid.Interfaces.PartialFourPort (Partial model with four ports).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
replaceable package MediumModelica.Media.Interfaces.Pa...Medium package
Nominal values
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
MassFlowRatemTan_flow_nominal Nominal mass flow rate for CHW tank branch [kg/s]
MassFlowRatemChi_flow_nominal Nominal mass flow rate for CHW chiller branch [kg/s]
TemperatureT_CHWS_nominal7 + 273.15Nominal temperature of CHW supply [K]
TemperatureT_CHWR_nominal12 + 273.15Nominal temperature of CHW return [K]
Tank
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)]
IntegernSeg5Number of volume segments
Timetau1Time constant for mixing [s]
Assumptions
BooleanallowFlowReversal1true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Formulation of energy balance
Initialization
AbsolutePressurep_startMedium.p_defaultStart value of pressure [Pa]
TemperatureT_startT_CHWR_nominalStart value of temperature [K]
TemperatureTFlu_start[nSeg]T_start*ones(nSeg)Initial temperature of the tank segments, with TFlu_start[1] being the top segment [K]

Connectors

TypeNameDescription
replaceable package Medium1Medium 1 in the component
replaceable package Medium2Medium 2 in the component
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)
replaceable package MediumMedium package
output RealOutputmTan_flowMass flow rate of the tank [kg/s]
output RealOutputQl_flowHeat loss of tank (positive if heat flows from tank to ambient) [W]
HeatPort_aheaPorTopHeat port tank top (outside insulation)
HeatPort_aheaPorSidHeat port tank side (outside insulation)
HeatPort_aheaPorBotHeat port tank bottom (outside insulation). Leave unconnected for adiabatic condition
HeatPort_aheaPorVol[tan.nSeg]Heat port that connects to the control volumes of the tank
output RealOutputTTan[2]Temperatures at the tank 1: top and 2: bottom [K]

Modelica definition

model TankBranch "Model of the tank branch of a storage plant" extends Buildings.Fluid.Interfaces.PartialFourPort( redeclare final package Medium1 = Medium, redeclare final package Medium2 = Medium); replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium package"; parameter Modelica.Units.SI.MassFlowRate m_flow_nominal(min=0) "Nominal mass flow rate"; parameter Modelica.Units.SI.MassFlowRate mTan_flow_nominal(min=0) "Nominal mass flow rate for CHW tank branch"; parameter Modelica.Units.SI.MassFlowRate mChi_flow_nominal(min=0) "Nominal mass flow rate for CHW chiller branch"; parameter Modelica.Units.SI.Temperature T_CHWS_nominal(displayUnit="degC")= 7+273.15 "Nominal temperature of CHW supply"; parameter Modelica.Units.SI.Temperature T_CHWR_nominal(displayUnit="degC")= 12+273.15 "Nominal temperature of CHW return"; // Storage tank parameters parameter Modelica.Units.SI.Volume VTan "Tank volume"; parameter Modelica.Units.SI.Length hTan "Height of tank (without insulation)"; parameter Modelica.Units.SI.Length dIns "Thickness of insulation"; parameter Modelica.Units.SI.ThermalConductivity kIns=0.04 "Specific heat conductivity of insulation"; parameter Integer nSeg(min=2) = 5 "Number of volume segments"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.FixedInitial "Formulation of energy balance"; parameter Medium.AbsolutePressure p_start = Medium.p_default "Start value of pressure"; parameter Medium.Temperature T_start=T_CHWR_nominal "Start value of temperature"; parameter Modelica.Units.SI.Temperature TFlu_start[nSeg]=T_start*ones(nSeg) "Initial temperature of the tank segments, with TFlu_start[1] being the top segment"; parameter Modelica.Units.SI.Time tau=1 "Time constant for mixing"; Buildings.Fluid.Storage.Stratified tan( redeclare final package Medium = Medium, final allowFlowReversal=true, final VTan=VTan, final hTan=hTan, final dIns=dIns, final kIns=kIns, final nSeg=nSeg, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final TFlu_start=TFlu_start, final tau=tau, final m_flow_nominal=mTan_flow_nominal, show_T=true) "Tank"; Buildings.Fluid.Sensors.MassFlowRate senFlo( redeclare final package Medium = Medium, final allowFlowReversal=true) "Flow rate sensor for the tank,"; Modelica.Blocks.Interfaces.RealOutput mTan_flow( final quantity="MassFlowRate", final unit="kg/s") "Mass flow rate of the tank"; Modelica.Blocks.Interfaces.RealOutput Ql_flow( final quantity="HeatFlowRate", final unit="W") "Heat loss of tank (positive if heat flows from tank to ambient)"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heaPorTop "Heat port tank top (outside insulation)"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heaPorSid "Heat port tank side (outside insulation)"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heaPorBot "Heat port tank bottom (outside insulation). Leave unconnected for adiabatic condition"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a[tan.nSeg] heaPorVol "Heat port that connects to the control volumes of the tank"; Modelica.Blocks.Interfaces.RealOutput TTan[2]( each unit="K", each final quantity="Temperature", each displayUnit="degC") "Temperatures at the tank 1: top and 2: bottom"; Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor senTemTop "Temperature sensor for tank top"; Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor senTemBot "Temperature sensor for tank bottom"; protected Buildings.Fluid.FixedResistances.Junction junSup( redeclare final package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, T_start=T_CHWS_nominal, tau=30, m_flow_nominal={-mChi_flow_nominal,mTan_flow_nominal,m_flow_nominal}, dp_nominal={0,0,0}) "Junction on the supply side"; Buildings.Fluid.FixedResistances.Junction junRet( redeclare final package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, T_start=T_CHWR_nominal, tau=30, m_flow_nominal={-m_flow_nominal,mChi_flow_nominal,mTan_flow_nominal}, dp_nominal={0,0,0}) "Junction on the return side"; equation connect(senFlo.m_flow, mTan_flow); connect(tan.Ql_flow, Ql_flow); connect(tan.heaPorTop, heaPorTop); connect(tan.heaPorSid, heaPorSid); connect(tan.heaPorBot, heaPorBot); connect(heaPorVol, tan.heaPorVol); connect(junRet.port_3, senFlo.port_a); connect(senFlo.port_b, tan.port_a); connect(tan.port_b, junSup.port_3); connect(tan.heaPorTop, senTemTop.port); connect(tan.heaPorBot, senTemBot.port); connect(senTemTop.T, TTan[1]); connect(senTemBot.T, TTan[2]); connect(port_b2, junRet.port_2); connect(junRet.port_1, port_a2); connect(junSup.port_2, port_b1); connect(junSup.port_1, port_a1); end TankBranch;