Buildings.Fluid.Examples.FlowSystem

Information

This package contains fluid flow models that demonstrate how such models can be simplified to reduce the dimension of systems of nonlinear equations in order to reduce computing time.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

Name Description
Buildings.Fluid.Examples.FlowSystem.Basic Basic Example implementation of flow system
Buildings.Fluid.Examples.FlowSystem.Simplified1 Simplified1 Aggregated pressure drops
Buildings.Fluid.Examples.FlowSystem.Simplified2 Simplified2 Using from_dp
Buildings.Fluid.Examples.FlowSystem.Simplified3 Simplified3 Neglecting pressure drop in splitters
Buildings.Fluid.Examples.FlowSystem.Simplified4 Simplified4 Removed valve dynamics
Buildings.Fluid.Examples.FlowSystem.Simplified5 Simplified5 Removed most mass/energy dynamics
Buildings.Fluid.Examples.FlowSystem.Simplified6 Simplified6 Set allowFlowReversal=false

Buildings.Fluid.Examples.FlowSystem.Basic Buildings.Fluid.Examples.FlowSystem.Basic

Example implementation of flow system

Buildings.Fluid.Examples.FlowSystem.Basic

Information

Example model demonstrating the use of the Buildings components in a larger system. This model is extended in Buildings.Fluid.Examples.FlowSystem.Simplified1, Buildings.Fluid.Examples.FlowSystem.Simplified2, Buildings.Fluid.Examples.FlowSystem.Simplified3. In these examples, the flow network is simplified in three steps, which reduces the size of algebraic loops.

The system model is for a hydronic system with a hot and cold water production device, each having its own circulation pump. The warm and cold supply water temperatures are selected by switching the bottom two-way valves. The building consists of a west and east wing. Each wing has multiple zones that are heated or cooled using the hydronic system. Each wing has a north and south section with a different supply temperature, which is controlled using two main three way valves. In total there are therefore four supply pipes, which are each connected to four or eight emission devices in the zones. The flow through the emission devices is controlled using two way valves. The emission device itself also generates a pressure drop, represented by components tabsX. Note that the emission devices are in the real building cooling and heating concrete slabs, but this simplified example only models their flow resistance. The control model consists of dummy inputs.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model Basic "Example implementation of flow system" extends Modelica.Icons.Example; package Medium = Buildings.Media.Water "Medium model"; Buildings.Fluid.Movers.FlowControlled_dp pmpSouth( redeclare package Medium = Medium, redeclare replaceable Buildings.Fluid.Movers.Data.Pumps.Wilo.Stratos80slash1to12 per, dp_nominal=12*9810, m_flow_nominal=27570/3600, inputType=Buildings.Fluid.Types.InputType.Stages, heads=pmpSouth.dp_nominal*{0,1}, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) "Pump to south of building"; Buildings.Fluid.FixedResistances.PressureDrop pipSouth1( redeclare package Medium = Medium, dp_nominal=50000, m_flow_nominal=4) "Pipe 1 to south of building"; Buildings.Fluid.FixedResistances.PressureDrop pipSouth2( redeclare package Medium = Medium, dp_nominal=50000, m_flow_nominal=3) "Pipe 2 to south of building"; Buildings.Fluid.Movers.FlowControlled_dp pmpNorth( redeclare package Medium = Medium, redeclare replaceable Buildings.Fluid.Movers.Data.Pumps.Wilo.Stratos80slash1to12 per, dp_nominal=12*9810, m_flow_nominal=24660/3600, inputType=Buildings.Fluid.Types.InputType.Stages, heads=pmpNorth.dp_nominal*{0,1}, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) "Pump to north of building"; Buildings.Fluid.FixedResistances.PressureDrop pipNorth2( redeclare package Medium = Medium, dp_nominal=50000, m_flow_nominal=5) "Pipe 2 to north of building"; Buildings.Fluid.FixedResistances.PressureDrop pipNorth1( redeclare package Medium = Medium, dp_nominal=50000, m_flow_nominal=3) "Pipe 1 to north of building"; Buildings.Fluid.Actuators.Valves.TwoWayLinear[4] valSouth1( each dpFixed_nominal=0, each CvData=Buildings.Fluid.Types.CvTypes.OpPoint, each dpValve_nominal=8e4, redeclare each package Medium = Medium, each m_flow_nominal=1) "Valves on souther tabs section 1"; Buildings.Fluid.Actuators.Valves.TwoWayLinear[8] valSouth2( each dpFixed_nominal=0, each CvData=Buildings.Fluid.Types.CvTypes.OpPoint, each dpValve_nominal=8e4, redeclare each package Medium = Medium, each m_flow_nominal=1) "Valves on souther tabs section 2"; Buildings.Fluid.Actuators.Valves.TwoWayLinear[4] valNorth1( each dpFixed_nominal=0, each CvData=Buildings.Fluid.Types.CvTypes.OpPoint, each dpValve_nominal=8e4, redeclare each package Medium = Medium, each m_flow_nominal=1) "Valves on northern tabs section 1"; Buildings.Fluid.Actuators.Valves.TwoWayLinear[8] valNorth2( each dpFixed_nominal=0, each CvData=Buildings.Fluid.Types.CvTypes.OpPoint, each dpValve_nominal=8e4, redeclare each package Medium = Medium, each m_flow_nominal=1) "Valves on northern tabs section 2"; Modelica.Blocks.Math.BooleanToInteger booleanToInteger(integerTrue=2, integerFalse=1) "Boolean to integer conversion block"; Modelica.Blocks.Sources.BooleanPulse stepPump(startTime=5, period=1000) "Step control"; Modelica.Blocks.Sources.Sine sine( amplitude=0.5, offset=0.5, freqHz=0.001) "Valve control signal"; Buildings.Fluid.Actuators.Valves.ThreeWayLinear valSouth( redeclare package Medium = Medium, m_flow_nominal=5, dpFixed_nominal={20000,0}, from_dp=true, dpValve_nominal=10000, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) "Three way valve for controlling supply temperature to south of building"; Buildings.Fluid.Actuators.Valves.ThreeWayLinear valNorth( redeclare package Medium = Medium, m_flow_nominal=5, dpFixed_nominal={20000,0}, from_dp=true, dpValve_nominal=10000, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) "Three way valve for controlling supply temperature to north of building"; Buildings.Fluid.HeatExchangers.HeaterCooler_T heater( m_flow_nominal=10, dp_nominal=100, redeclare package Medium = Medium) "Heating device"; Buildings.Fluid.Sources.Boundary_pT bou(nPorts=1, redeclare package Medium = Medium) "Boundary for setting absolute temperature"; Buildings.Fluid.FixedResistances.Junction spl( m_flow_nominal={10,10,10}, dp_nominal={1000,10,10}, redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) "Splitter"; Buildings.Fluid.FixedResistances.Junction spl1( m_flow_nominal={10,10,10}, dp_nominal={10,10,10}, redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) "Splitter"; Buildings.Fluid.Movers.FlowControlled_m_flow pumpHea( m_flow_nominal=10, redeclare Buildings.Fluid.Movers.Data.Pumps.Wilo.VeroLine80slash115dash2comma2slash2 per, redeclare package Medium = Medium, inputType=Buildings.Fluid.Types.InputType.Stages, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) "Pump for circulating hot water"; Modelica.Blocks.Sources.Constant Thot(k=273.15 + 50) "Hot water temperature"; Buildings.Fluid.Actuators.Valves.TwoWayLinear valHea( each dpFixed_nominal=0, each CvData=Buildings.Fluid.Types.CvTypes.OpPoint, redeclare package Medium = Medium, each m_flow_nominal=10, each dpValve_nominal=1e4) "Valve for allowing water to be drawn from hot water circuit"; Modelica.Blocks.Sources.Pulse stepValve(startTime=10, period=500) "Set point for valves"; Buildings.Fluid.Actuators.Valves.TwoWayLinear valCoo( each dpFixed_nominal=0, each CvData=Buildings.Fluid.Types.CvTypes.OpPoint, redeclare package Medium = Medium, each m_flow_nominal=10, each dpValve_nominal=1e4) "Valve for allowing water to be drawn from cold water circuit"; Modelica.Blocks.Sources.RealExpression valCooExp(y=1 - stepValve.y) "Cooling valve opens when heating valve is closed"; Buildings.Fluid.FixedResistances.Junction spl2( m_flow_nominal={10,10,10}, dp_nominal={1000,10,10}, redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) "Splitter"; Buildings.Fluid.FixedResistances.Junction spl3( m_flow_nominal={10,10,10}, dp_nominal={10,10,10}, redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) "Splitter"; Buildings.Fluid.Movers.FlowControlled_m_flow pumpCoo( m_flow_nominal=10, redeclare Buildings.Fluid.Movers.Data.Pumps.Wilo.VeroLine80slash115dash2comma2slash2 per, redeclare package Medium = Medium, inputType=Buildings.Fluid.Types.InputType.Stages, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) "Pump for circulating cold water"; Buildings.Fluid.MixingVolumes.MixingVolume vol( nPorts=2, redeclare package Medium = Medium, m_flow_nominal=10, V=1) "Simplified model of cold water source"; Buildings.HeatTransfer.Sources.FixedTemperature Tcold(T=273.15 + 10) "Cold water temperature"; Buildings.Fluid.FixedResistances.PressureDrop tabsSouth1[4]( redeclare each package Medium = Medium, each dp_nominal=50000, m_flow_nominal=valSouth1.m_flow_nominal) "Pressure drop of southern tabs sections on collector 1"; Buildings.Fluid.FixedResistances.PressureDrop tabsSouth2[8]( redeclare each package Medium = Medium, each dp_nominal=50000, m_flow_nominal=valSouth2.m_flow_nominal) "Pressure drop of southern tabs sections on collector 2"; Buildings.Fluid.FixedResistances.PressureDrop tabsNorth1[4]( redeclare each package Medium = Medium, each dp_nominal=50000, m_flow_nominal=valNorth1.m_flow_nominal) "Pressure drop of northern tabs sections on collector 1"; Buildings.Fluid.FixedResistances.PressureDrop tabsNorth2[8]( redeclare each package Medium = Medium, each dp_nominal=50000, m_flow_nominal=valNorth2.m_flow_nominal) "Pressure drop of northern tabs sections on collector 2"; equation connect(pipSouth2.port_a, pmpSouth.port_b); connect(pmpSouth.port_b, pipSouth1.port_a); connect(pipNorth1.port_a, pmpNorth.port_b); connect(pmpNorth.port_b, pipNorth2.port_a); for i in 1:4 loop connect(tabsNorth1[i].port_b,valNorth. port_3); connect(tabsSouth1[i].port_b, valSouth.port_3); connect(valSouth1[i].y, sine.y); connect(pipSouth1.port_b, valSouth1[i].port_a); connect(pipNorth1.port_b, valNorth1[i].port_a); end for; for i in 1:8 loop connect(tabsNorth2[i].port_b,valNorth. port_3); connect(tabsSouth2[i].port_b, valSouth.port_3); connect(valSouth2[i].y, sine.y); connect(pipSouth2.port_b, valSouth2[i].port_a); connect(pipNorth2.port_b, valNorth2[i].port_a); end for; connect(pmpSouth.stage, pmpNorth.stage); connect(booleanToInteger.y, pmpSouth.stage); connect(stepPump.y, booleanToInteger.u); connect(valSouth1.y, valNorth1.y); connect(valSouth2.y,valNorth2. y); connect(valSouth.port_2, pmpSouth.port_a); connect(valNorth.port_2, pmpNorth.port_a); connect(valNorth.y, valSouth.y); connect(bou.ports[1], heater.port_a); connect(spl1.port_3, spl.port_3); connect(heater.port_b, spl.port_1); connect(pumpHea.port_a, spl1.port_2); connect(pumpHea.port_b, heater.port_a); connect(Thot.y, heater.TSet); connect(spl1.port_1, valSouth.port_3); connect(spl.port_2, valHea.port_a); connect(valHea.port_b, valSouth.port_1); connect(stepValve.y, valSouth.y); connect(stepValve.y, valHea.y); connect(valCooExp.y, valCoo.y); connect(valCoo.port_b, valSouth.port_1); connect(valCoo.port_b,valNorth. port_1); connect(spl2.port_2, valCoo.port_a); connect(spl3.port_1, spl1.port_1); connect(spl3.port_3, spl2.port_3); connect(spl3.port_2, pumpCoo.port_a); connect(vol.ports[1], pumpCoo.port_b); connect(vol.ports[2], spl2.port_1); connect(Tcold.port, vol.heatPort); connect(pumpHea.stage, pumpCoo.stage); connect(pumpHea.stage, booleanToInteger.y); connect(valNorth.port_3, spl3.port_1); connect(valSouth1.port_b, tabsSouth1.port_a); connect(valSouth2.port_b, tabsSouth2.port_a); connect(valNorth1.port_b, tabsNorth1.port_a); connect(valNorth2.port_b, tabsNorth2.port_a); end Basic;

Buildings.Fluid.Examples.FlowSystem.Simplified1 Buildings.Fluid.Examples.FlowSystem.Simplified1

Aggregated pressure drops

Buildings.Fluid.Examples.FlowSystem.Simplified1

Information

The model is simplified: series pressure drop components are aggregated into the valve model.

Extends from Basic (Example implementation of flow system).

Modelica definition

model Simplified1 "Aggregated pressure drops" extends Basic( tabsSouth1(each dp_nominal=0), tabsSouth2(each dp_nominal=0), tabsNorth1(each dp_nominal=0), tabsNorth2(each dp_nominal=0), valSouth1(each dpFixed_nominal=50000), valSouth2(each dpFixed_nominal=50000), valNorth1(each dpFixed_nominal=50000), valNorth2(each dpFixed_nominal=50000)); end Simplified1;

Buildings.Fluid.Examples.FlowSystem.Simplified2 Buildings.Fluid.Examples.FlowSystem.Simplified2

Using from_dp

Buildings.Fluid.Examples.FlowSystem.Simplified2

Information

The model is simplified: using from_dp to find more efficient tearing variables.

Extends from Simplified1 (Aggregated pressure drops).

Modelica definition

model Simplified2 "Using from_dp" extends Simplified1( valSouth1(each from_dp=true), valSouth2(each from_dp=true), valNorth1(each from_dp=true), valNorth2(each from_dp=true)); end Simplified2;

Buildings.Fluid.Examples.FlowSystem.Simplified3 Buildings.Fluid.Examples.FlowSystem.Simplified3

Neglecting pressure drop in splitters

Buildings.Fluid.Examples.FlowSystem.Simplified3

Information

The model is further simplified by removing some small pressure drops in the bypass. This allows the solver to identify sub-circuits.

Extends from Simplified2 (Using from_dp).

Modelica definition

model Simplified3 "Neglecting pressure drop in splitters" extends Simplified2( spl(dp_nominal={1000,0,0}), spl1(dp_nominal={0,0,0}), spl3(dp_nominal={0,0,0}), spl2(dp_nominal={1000,0,0})); end Simplified3;

Buildings.Fluid.Examples.FlowSystem.Simplified4 Buildings.Fluid.Examples.FlowSystem.Simplified4

Removed valve dynamics

Buildings.Fluid.Examples.FlowSystem.Simplified4

Information

The model is further simplified by removing the valve and pump control dynamics.

Extends from Simplified3 (Neglecting pressure drop in splitters).

Modelica definition

model Simplified4 "Removed valve dynamics" extends Simplified3( valNorth(each use_inputFilter=false), valSouth(each use_inputFilter=false), pmpNorth( energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, massDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, use_inputFilter=false), pmpSouth( energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, massDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, use_inputFilter=false), valSouth1(each use_inputFilter=false), valSouth2(each use_inputFilter=false), valNorth1(each use_inputFilter=false), valNorth2(each use_inputFilter=false), pumpHea(use_inputFilter=false), pumpCoo(use_inputFilter=false), valCoo(use_inputFilter=false), valHea(use_inputFilter=false)); end Simplified4;

Buildings.Fluid.Examples.FlowSystem.Simplified5 Buildings.Fluid.Examples.FlowSystem.Simplified5

Removed most mass/energy dynamics

Buildings.Fluid.Examples.FlowSystem.Simplified5

Information

The model is further simplified by setting the mass dynamics and energy dynamics of most models to be steady state. Note that by default, the mass dynamics is set to the same configuration as the energy dynamics.

Extends from Simplified4 (Removed valve dynamics).

Modelica definition

model Simplified5 "Removed most mass/energy dynamics" extends Simplified4( spl1(energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState), spl(energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState), spl2(energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState), spl3(energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState), pumpCoo(energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState), pumpHea(energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState), heater(energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)); end Simplified5;

Buildings.Fluid.Examples.FlowSystem.Simplified6 Buildings.Fluid.Examples.FlowSystem.Simplified6

Set allowFlowReversal=false

Buildings.Fluid.Examples.FlowSystem.Simplified6

Information

The model is further simplified by setting allowFlowReversal=false.

Extends from Simplified5 (Removed most mass/energy dynamics).

Modelica definition

model Simplified6 "Set allowFlowReversal=false" extends Simplified5( pmpNorth(allowFlowReversal=false), pmpSouth(allowFlowReversal=false), tabsSouth1(each allowFlowReversal=false), tabsSouth2(each allowFlowReversal=false), pipSouth1(allowFlowReversal=false), pipSouth2(allowFlowReversal=false), valSouth2(each allowFlowReversal=false), valSouth1(each allowFlowReversal=false), tabsNorth1(each allowFlowReversal=false), valNorth1(each allowFlowReversal=false), pipNorth1(allowFlowReversal=false), pipNorth2(allowFlowReversal=false), valNorth2(each allowFlowReversal=false), tabsNorth2(each allowFlowReversal=false), pumpHea(allowFlowReversal=false), vol(allowFlowReversal=false), heater(allowFlowReversal=false), valCoo(allowFlowReversal=false), valHea(allowFlowReversal=false)); end Simplified6;