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.
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.
model Basic
extends Modelica.Icons.Example;
package Medium =
Annex60.Media.Water ;
Annex60.Fluid.Movers.FlowControlled_dp pmpSouth(
redeclare package Medium = Medium,
redeclare replaceable Annex60.Fluid.Movers.Data.Pumps.Wilo.Stratos80slash1to12
per,
dp_nominal=12*9810,
m_flow_nominal=27570/3600,
inputType=Annex60.Fluid.Types.InputType.Stages,
heads=pmpSouth.dp_nominal*{0,1},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
;
Annex60.Fluid.FixedResistances.PressureDrop pipSouth1(
redeclare package Medium = Medium,
dp_nominal=50000,
m_flow_nominal=4) ;
Annex60.Fluid.FixedResistances.PressureDrop pipSouth2(
redeclare package Medium = Medium,
dp_nominal=50000,
m_flow_nominal=3) ;
Annex60.Fluid.Movers.FlowControlled_dp pmpNorth(
redeclare package Medium = Medium,
redeclare replaceable Annex60.Fluid.Movers.Data.Pumps.Wilo.Stratos80slash1to12
per,
dp_nominal=12*9810,
m_flow_nominal=24660/3600,
inputType=Annex60.Fluid.Types.InputType.Stages,
heads=pmpNorth.dp_nominal*{0,1},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
;
Annex60.Fluid.FixedResistances.PressureDrop pipNorth2(
redeclare package Medium = Medium,
dp_nominal=50000,
m_flow_nominal=5) ;
Annex60.Fluid.FixedResistances.PressureDrop pipNorth1(
redeclare package Medium = Medium,
dp_nominal=50000,
m_flow_nominal=3) ;
Annex60.Fluid.Actuators.Valves.TwoWayLinear[4] valSouth1(
each dpFixed_nominal=0,
each CvData=Annex60.Fluid.Types.CvTypes.OpPoint,
each dpValve_nominal=8e4,
redeclare each package Medium = Medium,
each m_flow_nominal=1) ;
Annex60.Fluid.Actuators.Valves.TwoWayLinear[8] valSouth2(
each dpFixed_nominal=0,
each CvData=Annex60.Fluid.Types.CvTypes.OpPoint,
each dpValve_nominal=8e4,
redeclare each package Medium = Medium,
each m_flow_nominal=1) ;
Annex60.Fluid.Actuators.Valves.TwoWayLinear[4] valNorth1(
each dpFixed_nominal=0,
each CvData=Annex60.Fluid.Types.CvTypes.OpPoint,
each dpValve_nominal=8e4,
redeclare each package Medium = Medium,
each m_flow_nominal=1) ;
Annex60.Fluid.Actuators.Valves.TwoWayLinear[8] valNorth2(
each dpFixed_nominal=0,
each CvData=Annex60.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)
;
Annex60.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)
;
Annex60.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)
;
Annex60.Fluid.HeatExchangers.HeaterCooler_T heater(
m_flow_nominal=10,
dp_nominal=100,
redeclare package Medium = Medium) ;
Annex60.Fluid.Sources.Boundary_pT bou(nPorts=1,
redeclare package Medium = Medium) ;
Annex60.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)
;
Annex60.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)
;
Annex60.Fluid.Movers.FlowControlled_m_flow pumpHea(
m_flow_nominal=10,
redeclare Annex60.Fluid.Movers.Data.Pumps.Wilo.VeroLine80slash115dash2comma2slash2
per,
redeclare package Medium = Medium,
inputType=Annex60.Fluid.Types.InputType.Stages,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
;
Modelica.Blocks.Sources.Constant Thot(k=273.15 + 50) ;
Annex60.Fluid.Actuators.Valves.TwoWayLinear valHea(
each dpFixed_nominal=0,
each CvData=Annex60.Fluid.Types.CvTypes.OpPoint,
redeclare package Medium = Medium,
each m_flow_nominal=10,
each dpValve_nominal=1e4)
;
Modelica.Blocks.Sources.Pulse stepValve(startTime=10, period=500)
;
Annex60.Fluid.Actuators.Valves.TwoWayLinear valCoo(
each dpFixed_nominal=0,
each CvData=Annex60.Fluid.Types.CvTypes.OpPoint,
redeclare package Medium = Medium,
each m_flow_nominal=10,
each dpValve_nominal=1e4)
;
Modelica.Blocks.Sources.RealExpression valCooExp(y=1 - stepValve.y)
;
Annex60.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)
;
Annex60.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)
;
Annex60.Fluid.Movers.FlowControlled_m_flow pumpCoo(
m_flow_nominal=10,
redeclare Annex60.Fluid.Movers.Data.Pumps.Wilo.VeroLine80slash115dash2comma2slash2
per,
redeclare package Medium = Medium,
inputType=Annex60.Fluid.Types.InputType.Stages,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
;
Annex60.Fluid.MixingVolumes.MixingVolume vol(
nPorts=2,
redeclare package Medium = Medium,
m_flow_nominal=10,
V=1) ;
Modelica.Thermal.HeatTransfer.Sources.FixedTemperature Tcold(T=273.15 + 10)
;
Annex60.Fluid.FixedResistances.PressureDrop tabsSouth1[4](
redeclare each package Medium = Medium,
each dp_nominal=50000,
m_flow_nominal=valSouth1.m_flow_nominal)
;
Annex60.Fluid.FixedResistances.PressureDrop tabsSouth2[8](
redeclare each package Medium = Medium,
each dp_nominal=50000,
m_flow_nominal=valSouth2.m_flow_nominal)
;
Annex60.Fluid.FixedResistances.PressureDrop tabsNorth1[4](
redeclare each package Medium = Medium,
each dp_nominal=50000,
m_flow_nominal=valNorth1.m_flow_nominal)
;
Annex60.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;
The model is simplified: series pressure drop components are aggregated into the valve model.
The model is further simplified by removing some small pressure drops in the bypass.
This allows the solver to identify sub-circuits.
The model is further simplified by removing the valve and pump control dynamics.
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.