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 |
Basic
|
Example implementation of flow system |
Simplified1
|
Aggregated pressure drops |
Simplified2
|
Using from_dp |
Simplified3
|
Neglecting pressure drop in splitters |
Simplified4
|
Removed valve dynamics |
Simplified5
|
Removed most mass/energy dynamics |
Simplified6
|
Set allowFlowReversal=false |
Example implementation of flow system
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
extends Modelica.Icons.Example;
package Medium =
Buildings.Media.Water ;
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)
;
Buildings.Fluid.FixedResistances.PressureDrop pipSouth1(
redeclare package Medium = Medium,
dp_nominal=50000,
m_flow_nominal=4) ;
Buildings.Fluid.FixedResistances.PressureDrop pipSouth2(
redeclare package Medium = Medium,
dp_nominal=50000,
m_flow_nominal=3) ;
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)
;
Buildings.Fluid.FixedResistances.PressureDrop pipNorth2(
redeclare package Medium = Medium,
dp_nominal=50000,
m_flow_nominal=5) ;
Buildings.Fluid.FixedResistances.PressureDrop pipNorth1(
redeclare package Medium = Medium,
dp_nominal=50000,
m_flow_nominal=3) ;
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) ;
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) ;
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) ;
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) ;
Modelica.Blocks.Math.BooleanToInteger booleanToInteger(integerTrue=2,
integerFalse=1) ;
Modelica.Blocks.Sources.BooleanPulse stepPump(startTime=5, period=1000)
;
Modelica.Blocks.Sources.Sine sine(
amplitude=0.5,
offset=0.5,
freqHz=0.001)
;
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)
;
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)
;
Buildings.Fluid.HeatExchangers.PrescribedOutlet heater(
m_flow_nominal=10,
dp_nominal=100,
redeclare package Medium = Medium,
use_X_wSet=false) ;
Buildings.Fluid.Sources.Boundary_pT bou(nPorts=1,
redeclare package Medium = Medium) ;
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)
;
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)
;
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)
;
Modelica.Blocks.Sources.Constant Thot(k=273.15 + 50) ;
Buildings.Fluid.Actuators.Valves.TwoWayLinear valHea(
dpFixed_nominal=0,
CvData=Buildings.Fluid.Types.CvTypes.OpPoint,
redeclare package Medium = Medium,
m_flow_nominal=10,
dpValve_nominal=1e4)
;
Modelica.Blocks.Sources.Pulse stepValve(startTime=10, period=500)
;
Buildings.Fluid.Actuators.Valves.TwoWayLinear valCoo(
dpFixed_nominal=0,
CvData=Buildings.Fluid.Types.CvTypes.OpPoint,
redeclare package Medium = Medium,
m_flow_nominal=10,
dpValve_nominal=1e4)
;
Modelica.Blocks.Sources.RealExpression valCooExp(y=1 - stepValve.y)
;
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)
;
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)
;
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)
;
Buildings.Fluid.MixingVolumes.MixingVolume vol(
nPorts=2,
redeclare package Medium = Medium,
m_flow_nominal=10,
V=1) ;
Buildings.HeatTransfer.Sources.FixedTemperature Tcold(T=273.15 + 10)
;
Buildings.Fluid.FixedResistances.PressureDrop tabsSouth1[4](
redeclare each package Medium = Medium,
each dp_nominal=50000,
m_flow_nominal=valSouth1.m_flow_nominal)
;
Buildings.Fluid.FixedResistances.PressureDrop tabsSouth2[8](
redeclare each package Medium = Medium,
each dp_nominal=50000,
m_flow_nominal=valSouth2.m_flow_nominal)
;
Buildings.Fluid.FixedResistances.PressureDrop tabsNorth1[4](
redeclare each package Medium = Medium,
each dp_nominal=50000,
m_flow_nominal=valNorth1.m_flow_nominal)
;
Buildings.Fluid.FixedResistances.PressureDrop tabsNorth2[8](
redeclare each package Medium = Medium,
each dp_nominal=50000,
m_flow_nominal=valNorth2.m_flow_nominal)
;
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;
Aggregated pressure drops
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
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;
Using from_dp
Information
The model is simplified: using from_dp
to find more efficient tearing variables.
Extends from Simplified1 (Aggregated pressure drops).
Modelica definition
model Simplified2
extends Simplified1(
valSouth1(
each from_dp=true),
valSouth2(
each from_dp=true),
valNorth1(
each from_dp=true),
valNorth2(
each from_dp=true));
end Simplified2;
Neglecting pressure drop in splitters
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
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;
Removed valve dynamics
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
extends Simplified3(
valNorth(use_inputFilter=false),
valSouth(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;
Removed most mass/energy dynamics
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
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;
Set allowFlowReversal=false
Information
The model is further simplified by setting allowFlowReversal=false
.
Extends from Simplified5 (Removed most mass/energy dynamics).
Modelica definition
model Simplified6
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;