Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes

Information

This package contains models that validate the pipe models against measured data from real district heating networks.

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

Package Content

Name Description
Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.FlowReversal FlowReversal Simple example of plug flow pipe with flow reversal
Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.MSLAIT MSLAIT Validation pipe against data from Austrian Institute of Technology with standard library components
Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.MSLAIT2Nodes MSLAIT2Nodes Smaller discretisation. Validation pipe against data from Austrian Institute of Technology with standard library components
Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.PlugFlowAIT PlugFlowAIT Validation pipe against data from Austrian Institute of Technology
Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.PlugFlowULg PlugFlowULg Validation against data from Université de Liège
Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.TransportWaterAir TransportWaterAir Validation model, one having water and the other air
Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.Data Data Experimental data for verification of pipe models

Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.FlowReversal Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.FlowReversal

Simple example of plug flow pipe with flow reversal

Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.FlowReversal

Information

Validation model in which water flows into the pipe and then the flow is reversed.

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

Modelica definition

model FlowReversal "Simple example of plug flow pipe with flow reversal" extends Modelica.Icons.Example; package Medium = Buildings.Media.Water "Medium in the pipe"; Modelica.Blocks.Sources.Step m_flow( height=-4, offset=2, startTime=50) "Mass flow rate signal"; Sources.Boundary_pT sin( redeclare package Medium = Medium, nPorts=1, p(displayUnit="Pa") = 101325, T=313.15) "Pressure boundary condition"; Buildings.Fluid.FixedResistances.PlugFlowPipe pip( redeclare package Medium = Medium, nPorts=1, dIns=0.05, kIns=0.028, cPip=500, thickness=0.0032, rhoPip=8000, m_flow_nominal=2, initDelay=true, length=200, v_nominal=2, T_start_in=293.15, T_start_out=293.15) "Pipe"; Buildings.Fluid.Sources.MassFlowSource_T sou( nPorts=1, redeclare package Medium = Medium, m_flow=0, use_m_flow_in=true, T=303.15) "Flow source"; Buildings.Fluid.Sensors.TemperatureTwoPort senTemOut( redeclare package Medium = Medium, tau=0, T_start=323.15, m_flow_nominal=2) "Temperature sensor"; Buildings.Fluid.Sensors.TemperatureTwoPort senTemIn( redeclare package Medium = Medium, tau=0, T_start=323.15, m_flow_nominal=2) "Temperature sensor"; equation connect(pip.ports_b[1], senTemOut.port_a); connect(senTemOut.port_b, sin.ports[1]); connect(sou.ports[1], senTemIn.port_a); connect(senTemIn.port_b, pip.port_a); connect(m_flow.y, sou.m_flow_in); end FlowReversal;

Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.MSLAIT Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.MSLAIT

Validation pipe against data from Austrian Institute of Technology with standard library components

Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.MSLAIT

Information

The example contains experimental data from a real district heating network. This data is used to validate this library's Buildings.Fluid.FixedResistances.PlugFlowPipe in Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.PlugFlowAIT. This model compares its performance with the original Modelica Standard Library pipes, using one discretization element per unit length of pipe. For a coarser discretization, please refer to MSLAIT2Nodes.

Note that these three models are identical, except for the pipe model that is used:

This comparison between different discretization levels and pipe models is made to check the influence of the discretization and pipe model on computation time and simulation accuracy.

The pipes' temperatures are not initialized, thus results of outflow temperature before approximately the first 10000 seconds should not be considered.

Test bench schematic

Schematic of test district heating network

Calibration

To calculate the length specific thermal resistance R of the pipe, the thermal resistance of the surrounding ground is added.

R=1/(0.208)+1/(2   lambda_g   Modelica.Constants.pi)   log(1/0.18)

Where the thermal conductivity of the ground lambda_g = 2.4 W/(m K).

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

Parameters

TypeNameDefaultDescription
BooleanallowFlowReversalfalse= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
ThermalResistanceR1/(2*kIns*Modelica.Constants...Thermal resistance of main pipes [K/W]
ThermalResistanceR801/(2*0.024*Modelica.Constant...Thermal resistance of service pipes [K/W]
ThermalConductivitykIns0.024Heat conductivity of pipe insulation material [W/(m.K)]
LengthdIns0.045Thickness of pipe insulation [m]
Diameterdiameter0.089Outer diameter of pipe [m]
MassFlowRatem_flow_nominal1Nominal mass flow rate, used for regularization near zero flow [kg/s]
TimetauHeaTra6500Time constant for heat transfer, default 20 minutes [s]

Modelica definition

model MSLAIT "Validation pipe against data from Austrian Institute of Technology with standard library components" extends Modelica.Icons.Example; Fluid.Sources.MassFlowSource_T Point1( redeclare package Medium = Medium, use_T_in=true, use_m_flow_in=true, nPorts=1) "Mass flow source"; package Medium = Buildings.Media.Water; Fluid.Sources.MassFlowSource_T Point4( redeclare package Medium = Medium, use_m_flow_in=true, nPorts=1) "Substation 4"; Fluid.Sources.MassFlowSource_T Point3( redeclare package Medium = Medium, use_m_flow_in=true, nPorts=1) "Substation 3"; Fluid.Sources.MassFlowSource_T Point2( redeclare package Medium = Medium, use_m_flow_in=true, nPorts=1) "Substation 2"; Modelica.Blocks.Sources.CombiTimeTable DataReader(table=pipeDataAIT151218.data) "Read measurement data"; Data.PipeDataAIT151218 pipeDataAIT151218 "Record with measurement data"; Modelica.Blocks.Sources.RealExpression m_flow_p3(y=-DataReader.y[7]) "Mass flow rate for substation 3"; Modelica.Blocks.Sources.RealExpression m_flow_p2(y=-DataReader.y[6]) "Mass flow rate for substation 2"; Modelica.Blocks.Sources.RealExpression T_p1(y=DataReader.y[1]) "Inlet temperature"; Buildings.Fluid.Sources.Boundary_pT ExcludedBranch(redeclare package Medium = Medium, nPorts=1) "Mass flow sink for excluded branch"; Buildings.HeatTransfer.Sources.PrescribedTemperature prescribedTemperature "Variable environment temperature"; parameter Boolean allowFlowReversal=false "= true to allow flow reversal, false restricts to design direction (port_a -> port_b)"; Modelica.Fluid.Pipes.DynamicPipe pip0( nParallel=1, diameter=0.0825, redeclare package Medium = Medium, use_HeatTransfer=true, length=20, redeclare model HeatTransfer = Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.IdealFlowHeatTransfer, nNodes=20, redeclare model FlowModel = Modelica.Fluid.Pipes.BaseClasses.FlowModels.NominalTurbulentPipeFlow ( dp_nominal(displayUnit="Pa") = 10*pip0.length, m_flow_nominal=0.3), energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, T_start=293.15) "Pipe 0"; inner Modelica.Fluid.System system; parameter Modelica.SIunits.ThermalResistance R= 1/(2*kIns*Modelica.Constants.pi)*log(0.18/0.0899) + 1/(2*2.4*Modelica.Constants.pi)*log(2/0.18) "Thermal resistance of main pipes"; parameter Modelica.SIunits.ThermalResistance R80= 1/(2*0.024*Modelica.Constants.pi)*log(0.07/0.0337) + 1/(2*2.4*Modelica.Constants.pi)*log(2/0.07) "Thermal resistance of service pipes"; Modelica.Thermal.HeatTransfer.Components.ThermalResistor res0[pip0.nNodes](each R= R) "Thermal resistances for pipe 0"; Modelica.Thermal.HeatTransfer.Components.ThermalCollector col0(m=pip0.nNodes) "Combine heat flows to one"; Modelica.Fluid.Pipes.DynamicPipe pip1( nParallel=1, diameter=0.0825, redeclare package Medium = Medium, use_HeatTransfer=true, redeclare model HeatTransfer = Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.IdealFlowHeatTransfer, length=115, nNodes=115, redeclare model FlowModel = Modelica.Fluid.Pipes.BaseClasses.FlowModels.NominalTurbulentPipeFlow ( m_flow_nominal=0.3, dp_nominal=10*pip1.length), energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, T_start=293.15) "Pipe 1"; Modelica.Thermal.HeatTransfer.Components.ThermalCollector col1(m=pip1.nNodes) "Combine heat flows to one"; Modelica.Thermal.HeatTransfer.Components.ThermalResistor res1[pip1.nNodes](each R= R) "Thermal resistances for pipe 1"; Modelica.Fluid.Pipes.DynamicPipe pip2( nParallel=1, redeclare package Medium = Medium, use_HeatTransfer=true, redeclare model HeatTransfer = Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.IdealFlowHeatTransfer, length=76, nNodes=76, redeclare model FlowModel = Modelica.Fluid.Pipes.BaseClasses.FlowModels.NominalTurbulentPipeFlow ( dp_nominal=10*pip2.length, m_flow_nominal=0.3), diameter=0.0337 - 2*0.0032, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, T_start=293.15) "Pipe 2"; Modelica.Thermal.HeatTransfer.Components.ThermalCollector col2(m=pip2.nNodes) "Combine heat flows to one"; Modelica.Thermal.HeatTransfer.Components.ThermalResistor res2[pip2.nNodes](each R= R80) "Thermal resistances for pipe 2"; Modelica.Fluid.Pipes.DynamicPipe pip3( nParallel=1, redeclare package Medium = Medium, use_HeatTransfer=true, redeclare model HeatTransfer = Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.IdealFlowHeatTransfer, length=38, nNodes=38, redeclare model FlowModel = Modelica.Fluid.Pipes.BaseClasses.FlowModels.NominalTurbulentPipeFlow ( dp_nominal=10*pip3.length, m_flow_nominal=0.3), diameter=0.0337 - 2*0.0032, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, T_start=293.15) "Pipe 3"; Modelica.Thermal.HeatTransfer.Components.ThermalCollector col3(m=pip3.nNodes) "Combine heat flows to one"; Modelica.Thermal.HeatTransfer.Components.ThermalResistor res3[pip3.nNodes](each R= R80) "Thermal resistances for pipe 3"; Modelica.Fluid.Pipes.DynamicPipe pip4( nParallel=1, redeclare package Medium = Medium, use_HeatTransfer=true, redeclare model HeatTransfer = Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.IdealFlowHeatTransfer, length=29, nNodes=29, redeclare model FlowModel = Modelica.Fluid.Pipes.BaseClasses.FlowModels.NominalTurbulentPipeFlow ( dp_nominal=10*pip4.length, m_flow_nominal=0.3), diameter=0.0337 - 2*0.0032, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, T_start=293.15) "Pipe 4"; Modelica.Thermal.HeatTransfer.Components.ThermalCollector col4(m=pip4.nNodes) "Combine heat flows to one"; Modelica.Thermal.HeatTransfer.Components.ThermalResistor res4[pip4.nNodes](each R= R80) "Thermal resistances for pipe 4"; Modelica.Fluid.Pipes.DynamicPipe pip5( nParallel=1, diameter=0.0825, redeclare package Medium = Medium, use_HeatTransfer=true, redeclare model HeatTransfer = Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.IdealFlowHeatTransfer, length=20, nNodes=20, redeclare model FlowModel = Modelica.Fluid.Pipes.BaseClasses.FlowModels.NominalTurbulentPipeFlow ( dp_nominal=10*pip5.length, m_flow_nominal=0.3), energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, T_start=293.15) "Pipe 5"; Modelica.Thermal.HeatTransfer.Components.ThermalCollector col5(m=pip5.nNodes) "Combine heat flows to one"; Modelica.Thermal.HeatTransfer.Components.ThermalResistor res5[pip5.nNodes](each R= R) "Thermal resistances for pipe 5"; parameter Modelica.SIunits.ThermalConductivity kIns=0.024 "Heat conductivity of pipe insulation material"; parameter Modelica.SIunits.Length dIns=0.045 "Thickness of pipe insulation"; parameter Modelica.SIunits.Diameter diameter=0.089 "Outer diameter of pipe"; Fluid.Sensors.TemperatureTwoPort senTem_p2(redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, transferHeat=true, tauHeaTra=tauHeaTra) "Temperature sensor"; Fluid.Sensors.TemperatureTwoPort senTem_p3(redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, transferHeat=true, tauHeaTra=tauHeaTra) "Temperature sensor"; Fluid.Sensors.TemperatureTwoPort senTemIn_p2( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, transferHeat=true, tauHeaTra=tauHeaTra) "Temperature sensor"; Fluid.Sensors.TemperatureTwoPort senTem_p1(redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, transferHeat=true, tauHeaTra=tauHeaTra) "Temperature sensor"; Fluid.Sensors.TemperatureTwoPort senTem_p4(redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, transferHeat=true, tauHeaTra=tauHeaTra) "Temperature sensor"; parameter Modelica.SIunits.MassFlowRate m_flow_nominal=1 "Nominal mass flow rate, used for regularization near zero flow"; parameter Modelica.SIunits.Time tauHeaTra=6500 "Time constant for heat transfer, default 20 minutes"; Fluid.Sources.MassFlowSource_T Point5( redeclare package Medium = Medium, use_m_flow_in=true, nPorts=1) "Mass flow sink for substation 4 in case of low flow rates"; Modelica.Blocks.Sources.RealExpression m_flow_p4(y=-DataReader.y[8]) "Measured mass flow rate for substation 4"; Modelica.Blocks.Logical.Switch switch "Switch to avoid mass flow rate measurement noise on substation with flow standstill."; Modelica.Blocks.Sources.RealExpression m_flow_zero(y=0) "Default value when mass flow rate is below noise threshold"; Modelica.Blocks.Logical.LessThreshold lessThreshold(threshold=-0.001) "Check if mass flow rate is lower than 0.001"; Modelica.Blocks.Logical.Switch switch1 "If flow is lower than measurement noise threshold, bypass temperature sensor"; equation connect(m_flow_p3.y, Point3.m_flow_in); connect(Point2.m_flow_in, m_flow_p2.y); connect(T_p1.y, Point1.T_in); connect(DataReader.y[5], Point1.m_flow_in); connect(DataReader.y[9], prescribedTemperature.T); connect(pip0.port_b, ExcludedBranch.ports[1]); connect(pip4.port_a, pip1.port_b); connect(pip5.port_a, pip1.port_b); connect(pip1.port_a, pip0.port_b); connect(pip2.port_b, senTem_p2.port_a); connect(senTem_p2.port_b, Point2.ports[1]); connect(senTem_p3.port_a, pip3.port_b); connect(senTem_p3.port_b, Point3.ports[1]); connect(pip3.port_a, pip5.port_b); connect(senTemIn_p2.port_a, pip5.port_b); connect(senTemIn_p2.port_b, pip2.port_a); connect(pip4.port_b, senTem_p4.port_a); connect(senTem_p4.port_b, Point4.ports[1]); connect(senTem_p1.port_a, Point1.ports[1]); connect(senTem_p1.port_b, pip0.port_a); connect(Point5.ports[1], senTem_p4.port_a); connect(pip2.heatPorts, res2.port_a); connect(res2.port_b, col2.port_a); connect(pip5.heatPorts, res5.port_a); connect(res5.port_b, col5.port_a); connect(res4.port_a, pip4.heatPorts); connect(res4.port_b, col4.port_a); connect(pip3.heatPorts, res3.port_a); connect(res3.port_b, col3.port_a); connect(res1.port_a, pip1.heatPorts); connect(res1.port_b, col1.port_a); connect(pip0.heatPorts, res0.port_a); connect(res0.port_b, col0.port_a); connect(col2.port_b, col5.port_b); connect(col5.port_b, col4.port_b); connect(col0.port_b, prescribedTemperature.port); connect(col3.port_b, prescribedTemperature.port); connect(col4.port_b, prescribedTemperature.port); connect(m_flow_zero.y,switch. u3); connect(switch.u1,m_flow_p4. y); connect(Point4.m_flow_in,switch. y); connect(switch.u2,lessThreshold. y); connect(lessThreshold.u,m_flow_p4. y); connect(lessThreshold.y,switch1. u2); connect(m_flow_p4.y,switch1. u3); connect(m_flow_zero.y,switch1. u1); connect(switch1.y, Point5.m_flow_in); connect(col1.port_b, prescribedTemperature.port); end MSLAIT;

Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.MSLAIT2Nodes Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.MSLAIT2Nodes

Smaller discretisation. Validation pipe against data from Austrian Institute of Technology with standard library components

Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.MSLAIT2Nodes

Information

The example contains experimental data from a real district heating network. This data is used to validate this library's plug flow pipe model in Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.PlugFlowAIT.

Note that these three models are identical, except for the pipe model that is used:

This comparison between different discretization levels and pipe models is made to check the influence of the discretization and pipe model on computation time and simulation accuracy.

The pipes' temperatures are not initialized, thus results of outflow temperature before approximately the first 10000 seconds should not be considered.

Test bench schematic

Schematic of test district heating network

Calibration

To calculate the length specific thermal resistance R of the pipe, the thermal resistance of the surrounding ground is added.

R=1/(0.208)+1/(2   lambdag Modelica.Constants.pi)   log(1/0.18)

Where the thermal conductivity of the ground lambda_g = 2.4 W/(m K).

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

Parameters

TypeNameDefaultDescription
BooleanallowFlowReversalfalse= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
RealR1/(2*kIns*Modelica.Constants...Thermal resistance per unit length of main pipes [(m.K)/W]
RealR801/(2*0.024*Modelica.Constant...Thermal resistance per unit length of service pipes [(m.K)/W]
ThermalConductivitykIns0.024Heat conductivity [W/(m.K)]
LengthdIns0.045Thickness of pipe insulation [m]
Diameterdiameter0.089Outer diameter of pipe [m]
MassFlowRatem_flow_nominal1Nominal mass flow rate, used for regularization near zero flow [kg/s]
TimetauHeaTra6500Time constant for heat transfer, default 20 minutes [s]

Modelica definition

model MSLAIT2Nodes "Smaller discretisation. Validation pipe against data from Austrian Institute of Technology with standard library components" extends Modelica.Icons.Example; Fluid.Sources.MassFlowSource_T Point1( redeclare package Medium = Medium, use_T_in=true, use_m_flow_in=true, nPorts=1); package Medium = Buildings.Media.Water; Fluid.Sources.MassFlowSource_T Point4( redeclare package Medium = Medium, use_m_flow_in=true, nPorts=1) "Substation 4"; Fluid.Sources.MassFlowSource_T Point3( redeclare package Medium = Medium, use_m_flow_in=true, nPorts=1) "Substation 3"; Fluid.Sources.MassFlowSource_T Point2( redeclare package Medium = Medium, use_m_flow_in=true, nPorts=1) "Substation 2"; Modelica.Blocks.Sources.CombiTimeTable DataReader(table=pipeDataAIT151218.data) "Read measurement data"; Data.PipeDataAIT151218 pipeDataAIT151218 "Measurement data from AIT"; Modelica.Blocks.Sources.RealExpression m_flow_p3(y=-DataReader.y[7]) "Mass flow rate for substation 3"; Modelica.Blocks.Sources.RealExpression m_flow_p4(y=-DataReader.y[8]) "Mass flow rate for substation 4"; Modelica.Blocks.Sources.RealExpression m_flow_p2(y=-DataReader.y[6]) "Mass flow rate for substation 2"; Modelica.Blocks.Sources.RealExpression T_p1(y=DataReader.y[1]) "Inlet temperature"; Buildings.Fluid.Sources.Boundary_pT ExcludedBranch(redeclare package Medium = Medium, nPorts=1) "Mass flow sink for excluded branch"; Buildings.HeatTransfer.Sources.PrescribedTemperature prescribedTemperature "Variable environment temperature"; parameter Boolean allowFlowReversal=false "= true to allow flow reversal, false restricts to design direction (port_a -> port_b)"; Modelica.Fluid.Pipes.DynamicPipe pip0( nParallel=1, diameter=0.0825, redeclare package Medium = Medium, use_HeatTransfer=true, length=20, redeclare model HeatTransfer = Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.IdealFlowHeatTransfer, redeclare model FlowModel = Modelica.Fluid.Pipes.BaseClasses.FlowModels.NominalTurbulentPipeFlow ( dp_nominal(displayUnit="Pa") = 10*pip0.length, m_flow_nominal=0.3), nNodes=2, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, T_start=293.15) "Pipe 0"; inner Modelica.Fluid.System system; parameter Real R(unit="(m.K)/W")=1/(2*kIns*Modelica.Constants.pi) *log(0.18/0.0899) + 1/(2*2.4*Modelica.Constants.pi)*log(2/0.18) "Thermal resistance per unit length of main pipes"; parameter Real R80(unit="(m.K)/W")=1/(2*0.024*Modelica.Constants.pi) *log(0.07/0.0337) + 1/(2*2.4*Modelica.Constants.pi)*log(2/0.07) "Thermal resistance per unit length of service pipes"; Modelica.Thermal.HeatTransfer.Components.ThermalResistor res0[pip0.nNodes](each R= 2*R/pip0.length) "Thermal resistances for elements of pipe 0"; Modelica.Thermal.HeatTransfer.Components.ThermalCollector col0(m=pip0.nNodes) "Combine heat flows to one"; Modelica.Fluid.Pipes.DynamicPipe pip1( nParallel=1, diameter=0.0825, redeclare package Medium = Medium, use_HeatTransfer=true, redeclare model HeatTransfer = Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.IdealFlowHeatTransfer, length=115, redeclare model FlowModel = Modelica.Fluid.Pipes.BaseClasses.FlowModels.NominalTurbulentPipeFlow ( m_flow_nominal=0.3, dp_nominal=10*pip1.length), nNodes=2, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, T_start=293.15) "Pipe 1"; Modelica.Thermal.HeatTransfer.Components.ThermalCollector col1(m=pip1.nNodes) "Combine heat flows to one"; Modelica.Thermal.HeatTransfer.Components.ThermalResistor res1[pip1.nNodes](each R= 2*R/pip1.length) "Thermal resistances for elements of pipe 1"; Modelica.Fluid.Pipes.DynamicPipe pip2( nParallel=1, redeclare package Medium = Medium, use_HeatTransfer=true, redeclare model HeatTransfer = Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.IdealFlowHeatTransfer, length=76, redeclare model FlowModel = Modelica.Fluid.Pipes.BaseClasses.FlowModels.NominalTurbulentPipeFlow ( dp_nominal=10*pip2.length, m_flow_nominal=0.3), diameter=0.0337 - 2*0.0032, nNodes=2, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, T_start=293.15) "Pipe 2"; Modelica.Thermal.HeatTransfer.Components.ThermalCollector col2(m=pip2.nNodes) "Combine heat flows to one"; Modelica.Thermal.HeatTransfer.Components.ThermalResistor res2[pip2.nNodes](each R= 2*R80/pip2.length) "Thermal resistances for elements of pipe 2"; Modelica.Fluid.Pipes.DynamicPipe pip3( nParallel=1, redeclare package Medium = Medium, use_HeatTransfer=true, redeclare model HeatTransfer = Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.IdealFlowHeatTransfer, length=38, redeclare model FlowModel = Modelica.Fluid.Pipes.BaseClasses.FlowModels.NominalTurbulentPipeFlow ( dp_nominal=10*pip3.length, m_flow_nominal=0.3), diameter=0.0337 - 2*0.0032, nNodes=2, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, T_start=293.15) "Pipe 3"; Modelica.Thermal.HeatTransfer.Components.ThermalCollector col3(m=pip3.nNodes) "Combine heat flows to one"; Modelica.Thermal.HeatTransfer.Components.ThermalResistor res3[pip3.nNodes](each R= 2*R80/pip3.length) "Thermal resistances for elements of pipe 3"; Modelica.Fluid.Pipes.DynamicPipe pip4( nParallel=1, redeclare package Medium = Medium, use_HeatTransfer=true, redeclare model HeatTransfer = Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.IdealFlowHeatTransfer, length=29, redeclare model FlowModel = Modelica.Fluid.Pipes.BaseClasses.FlowModels.NominalTurbulentPipeFlow ( dp_nominal=10*pip4.length, m_flow_nominal=0.3), diameter=0.0337 - 2*0.0032, nNodes=2, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, T_start=293.15) "Pipe 4"; Modelica.Thermal.HeatTransfer.Components.ThermalCollector col4(m=pip4.nNodes) "Combine heat flows to one"; Modelica.Thermal.HeatTransfer.Components.ThermalResistor res4[pip4.nNodes](each R= 2*R80/pip4.length) "Thermal resistances for elements of pipe 4"; Modelica.Fluid.Pipes.DynamicPipe pip5( nParallel=1, diameter=0.0825, redeclare package Medium = Medium, use_HeatTransfer=true, redeclare model HeatTransfer = Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.IdealFlowHeatTransfer, length=20, redeclare model FlowModel = Modelica.Fluid.Pipes.BaseClasses.FlowModels.NominalTurbulentPipeFlow ( dp_nominal=10*pip5.length, m_flow_nominal=0.3), nNodes=2, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, T_start=293.15) "Pipe 5"; Modelica.Thermal.HeatTransfer.Components.ThermalCollector col5(m=pip5.nNodes) "Combine heat flows to one"; Modelica.Thermal.HeatTransfer.Components.ThermalResistor res5[pip5.nNodes](each R= 2*R/pip5.length) "Thermal resistances for elements of pipe 5"; parameter Modelica.SIunits.ThermalConductivity kIns=0.024 "Heat conductivity"; parameter Modelica.SIunits.Length dIns=0.045 "Thickness of pipe insulation"; parameter Modelica.SIunits.Diameter diameter=0.089 "Outer diameter of pipe"; Fluid.Sensors.TemperatureTwoPort senTem_p2(redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, transferHeat=true, tauHeaTra=tauHeaTra) "Temperature sensor"; Fluid.Sensors.TemperatureTwoPort senTem_p3(redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, transferHeat=true, tauHeaTra=tauHeaTra) "Temperature sensor"; Fluid.Sensors.TemperatureTwoPort senTemIn_p2( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, transferHeat=true, tauHeaTra=tauHeaTra) "Temperature sensor"; Fluid.Sensors.TemperatureTwoPort senTem_p1( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, transferHeat=true, tauHeaTra=tauHeaTra) "Temperature sensor"; Fluid.Sensors.TemperatureTwoPort senTem_p4( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, transferHeat=true, tauHeaTra=tauHeaTra) "Temperature sensor"; parameter Modelica.SIunits.MassFlowRate m_flow_nominal=1 "Nominal mass flow rate, used for regularization near zero flow"; parameter Modelica.SIunits.Time tauHeaTra=6500 "Time constant for heat transfer, default 20 minutes"; Modelica.Blocks.Logical.Switch switch "Decide if mass flow rate is below measurement noise threshold or not"; Modelica.Blocks.Sources.RealExpression m_flow_zero(y=0) "Default value when mass flow rate is below measurement noise threshold"; Modelica.Blocks.Logical.LessThreshold lessThreshold(threshold=-0.001) "Measurement noise threshold"; Fluid.Sources.MassFlowSource_T Point5( redeclare package Medium = Medium, use_m_flow_in=true, nPorts=1) "Low flow bypass of substation 4"; Modelica.Blocks.Logical.Switch switch1 "Decide if mass flow rate is below measurement noise threshold or not"; equation connect(m_flow_p3.y, Point3.m_flow_in); connect(Point2.m_flow_in, m_flow_p2.y); connect(T_p1.y, Point1.T_in); connect(DataReader.y[5], Point1.m_flow_in); connect(DataReader.y[9], prescribedTemperature.T); connect(pip0.port_b, ExcludedBranch.ports[1]); connect(pip4.port_a, pip1.port_b); connect(pip5.port_a, pip1.port_b); connect(pip1.port_a, pip0.port_b); connect(pip2.port_b, senTem_p2.port_a); connect(senTem_p2.port_b, Point2.ports[1]); connect(senTem_p3.port_a, pip3.port_b); connect(senTem_p3.port_b, Point3.ports[1]); connect(pip3.port_a, pip5.port_b); connect(senTemIn_p2.port_a, pip5.port_b); connect(senTemIn_p2.port_b, pip2.port_a); connect(pip4.port_b, senTem_p4.port_a); connect(senTem_p4.port_b, Point4.ports[1]); connect(senTem_p1.port_a, Point1.ports[1]); connect(senTem_p1.port_b, pip0.port_a); connect(m_flow_zero.y,switch. u3); connect(switch.u1, m_flow_p4.y); connect(Point4.m_flow_in, switch.y); connect(switch.u2, lessThreshold.y); connect(lessThreshold.u, m_flow_p4.y); connect(Point5.m_flow_in,switch1. y); connect(lessThreshold.y, switch1.u2); connect(m_flow_p4.y, switch1.u3); connect(m_flow_zero.y, switch1.u1); connect(Point5.ports[1], senTem_p4.port_a); connect(pip2.heatPorts, res2.port_a); connect(res2.port_b, col2.port_a); connect(col5.port_a, res5.port_b); connect(res5.port_a, pip5.heatPorts); connect(res4.port_a, pip4.heatPorts); connect(res4.port_b, col4.port_a); connect(col2.port_b, col5.port_b); connect(col5.port_b, col4.port_b); connect(pip1.heatPorts, res1.port_a); connect(res1.port_b, col1.port_a); connect(col4.port_b, col1.port_b); connect(pip0.heatPorts, res0.port_a); connect(res0.port_b, col0.port_a); connect(col1.port_b, col0.port_b); connect(col0.port_b, prescribedTemperature.port); connect(pip3.heatPorts, res3.port_a); connect(res3.port_b, col3.port_a); connect(col3.port_b, prescribedTemperature.port); end MSLAIT2Nodes;

Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.PlugFlowAIT Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.PlugFlowAIT

Validation pipe against data from Austrian Institute of Technology

Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.PlugFlowAIT

Information

The example contains experimental data from a real district heating network.

The pipes' temperatures are not initialized. Therefore, results of outflow temperature before approximately the first 10000 seconds should not be considered.

Note that these three models are identical, except for the pipe model that is used:

This comparison between different discretization levels and pipe models is made to check the influence of the discretization and pipe model on computation time and simulation accuracy.

Test bench schematic

Schematic of test district heating network

Calibration

To calculate the length specific thermal resistance R of the pipe, the thermal resistance of the surrounding ground is added, which yields

R=1/(0.208)+1/(2   lambda_g   Modelica.Constants.pi)   log(1/0.18),

where the thermal conductivity of the ground lambda_g = 2.4 W/(m K).

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

Parameters

TypeNameDefaultDescription
LengthLcap1Length over which transient effects typically take place [m]
RealR801/(2*0.024*Modelica.Constant...Thermal resistance per unit length of service pipes [(m.K)/W]
BooleanpipVoltrueFlag to decide whether volumes are included at the end points of the pipe
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
MassFlowRatem_flow_nominal1Nominal mass flow rate, used for regularization near zero flow [kg/s]
TimetauHeaTra6500Time constant for heat transfer, default 20 minutes [s]
Lengththickness0.0032Pipe wall thickness [m]

Modelica definition

model PlugFlowAIT "Validation pipe against data from Austrian Institute of Technology" extends Modelica.Icons.Example; package Medium = Buildings.Media.Water; parameter Modelica.SIunits.Length Lcap=1 "Length over which transient effects typically take place"; parameter Real R80(unit="(m.K)/W")=1/(2*0.024*Modelica.Constants.pi) *log(0.07/0.0337) + 1/(2*2.4*Modelica.Constants.pi)*log(2/0.07) "Thermal resistance per unit length of service pipes"; parameter Boolean pipVol=true "Flag to decide whether volumes are included at the end points of the pipe"; parameter Boolean allowFlowReversal=true "= true to allow flow reversal, false restricts to design direction (port_a -> port_b)"; parameter Modelica.SIunits.MassFlowRate m_flow_nominal=1 "Nominal mass flow rate, used for regularization near zero flow"; parameter Modelica.SIunits.Time tauHeaTra=6500 "Time constant for heat transfer, default 20 minutes"; parameter Modelica.SIunits.Length thickness=0.0032 "Pipe wall thickness"; Fluid.Sources.MassFlowSource_T Point1( redeclare package Medium = Medium, use_T_in=true, use_m_flow_in=true, nPorts=1) "Mass flow source"; Fluid.Sources.MassFlowSource_T Point4( redeclare package Medium = Medium, use_m_flow_in=true, nPorts=1) "Substation 4"; Fluid.Sources.MassFlowSource_T Point3( nPorts=1, redeclare package Medium = Medium, use_m_flow_in=true) "Subsation 3"; Fluid.Sources.MassFlowSource_T Point2( redeclare package Medium = Medium, use_m_flow_in=true, nPorts=1) "Subtation 2"; PlugFlowPipe pip1( redeclare package Medium = Medium, dh=0.0825, dIns=0.045, kIns=0.024, length=115, allowFlowReversal=allowFlowReversal, nPorts=2, m_flow_nominal=0.3, R=1/(2*0.024*Modelica.Constants.pi)*log(0.18/0.0899) + 1/(2*2.4*Modelica.Constants.pi) *log(2/0.18), thickness=thickness, cPip=500, rhoPip=8000, initDelay=false, m_flow_start=0) "Pipe 1"; PlugFlowPipe pip4( dh = 0.0337 - 2*0.0032, redeclare package Medium = Medium, length=29, dIns=0.045, kIns=0.024, allowFlowReversal=allowFlowReversal, m_flow_nominal=0.3, thickness=thickness, nPorts=2, R=R80, cPip=500, rhoPip=8000, initDelay=false, m_flow_start=0) "Pipe 4"; PlugFlowPipe pip5( redeclare package Medium = Medium, length=20, dh=0.0825, kIns=0.024, dIns=0.045, allowFlowReversal=allowFlowReversal, nPorts=2, m_flow_nominal=0.3, R=1/(2*0.024*Modelica.Constants.pi)*log(0.18/0.0899) + 1/(2*2.4*Modelica.Constants.pi) *log(2/0.18), thickness=thickness, cPip=500, rhoPip=8000, initDelay=false, m_flow_start=0) "Pipe 5"; PlugFlowPipe pip2( redeclare package Medium = Medium, length=76, dIns=0.045, kIns=0.024, allowFlowReversal=allowFlowReversal, nPorts=1, m_flow_nominal=0.3, thickness=thickness, dh=0.0337 - 2*0.0032, R=R80, cPip=500, rhoPip=8000, initDelay=false, m_flow_start=0) "Pipe 2"; PlugFlowPipe pip3( redeclare package Medium = Medium, length=38, dIns=0.045, kIns=0.024, allowFlowReversal=allowFlowReversal, nPorts=1, m_flow_nominal=0.3, thickness=thickness, dh=0.0337 - 2*0.0032, R=R80, cPip=500, rhoPip=8000, initDelay=false, m_flow_start=0) "Pipe 3"; Modelica.Blocks.Sources.CombiTimeTable DataReader(table=pipeDataAIT151218.data) "Read measurement data"; Data.PipeDataAIT151218 pipeDataAIT151218 "Measurement data from AIT network"; Modelica.Blocks.Sources.RealExpression m_flow_p3(y=-DataReader.y[7]) "Mass flow rate for substation 3"; Modelica.Blocks.Sources.RealExpression m_flow_p4(y=-DataReader.y[8]) "Mass flow rate of substation 4"; Modelica.Blocks.Sources.RealExpression m_flow_p2(y=-DataReader.y[6]); Modelica.Blocks.Sources.RealExpression T_p1(y=DataReader.y[1]) "Inlet temperature"; Fluid.Sensors.TemperatureTwoPort senTem_p3( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, transferHeat=true, tauHeaTra=tauHeaTra) "Temperature sensor"; Fluid.Sensors.TemperatureTwoPort senTem_p2( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, transferHeat=true, tauHeaTra=tauHeaTra) "Temperature sensor"; Fluid.Sensors.TemperatureTwoPort senTem_p4( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, transferHeat=true, tauHeaTra=tauHeaTra) "Temperature sensor"; Fluid.Sensors.TemperatureTwoPort senTem_p1( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, transferHeat=true, tauHeaTra=tauHeaTra) "Temperature sensor"; PlugFlowPipe pip0( redeclare package Medium = Medium, dh=0.0825, dIns=0.045, kIns=0.024, length=20, allowFlowReversal=allowFlowReversal, nPorts=2, m_flow_nominal=0.3, R=1/(2*0.024*Modelica.Constants.pi)*log(0.18/0.0899) + 1/(2*2.4*Modelica.Constants.pi) *log(2/0.18), thickness=thickness, cPip=500, rhoPip=8000, initDelay=false, m_flow_start=0) "Pipe 0"; Buildings.Fluid.Sources.Boundary_pT ExcludedBranch(redeclare package Medium = Medium, nPorts=1) "Mass flow sink for excluded branch"; Buildings.HeatTransfer.Sources.PrescribedTemperature prescribedTemperature "Variable environment temperature"; Fluid.Sensors.TemperatureTwoPort senTemIn_p2( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, transferHeat=true, tauHeaTra=tauHeaTra) "Temperature sensor"; Modelica.Blocks.Logical.Switch switch "Decide if mass flow rate is below measurement noise threshold or not"; Modelica.Blocks.Sources.RealExpression m_flow_zero(y=0) "Default value if mass flow rate is below measurement noise threshold"; Modelica.Blocks.Logical.LessThreshold lessThreshold(threshold=-0.001) "Measurement noise threshold"; Modelica.Blocks.Logical.Switch switch1 "Decide if mass flow rate is below measurement noise threshold or not"; Fluid.Sources.MassFlowSource_T Point5( redeclare package Medium = Medium, use_m_flow_in=true, nPorts=1) "Bypass temperature sensor when flow rate is below measurement threshold"; equation connect(m_flow_p3.y, Point3.m_flow_in); connect(Point2.m_flow_in, m_flow_p2.y); connect(T_p1.y, Point1.T_in); connect(DataReader.y[5], Point1.m_flow_in); connect(DataReader.y[9], prescribedTemperature.T); connect(pip4.heatPort, pip1.heatPort); connect(pip1.heatPort, pip0.heatPort); connect(pip1.heatPort, pip2.heatPort); connect(pip5.heatPort, pip2.heatPort); connect(pip3.heatPort, pip2.heatPort); connect(prescribedTemperature.port, pip0.heatPort); connect(senTem_p2.port_b, Point2.ports[1]); connect(Point3.ports[1], senTem_p3.port_b); connect(senTem_p4.port_b, Point4.ports[1]); connect(Point1.ports[1], senTem_p1.port_b); connect(senTem_p1.port_a, pip0.port_a); connect(switch.u1, m_flow_p4.y); connect(m_flow_zero.y, switch.u3); connect(switch.y, Point4.m_flow_in); connect(switch.u2, lessThreshold.y); connect(lessThreshold.u, m_flow_p4.y); connect(pip1.port_a, pip0.ports_b[1]); connect(pip1.ports_b[1], pip4.port_a); connect(pip5.port_a, pip1.ports_b[2]); connect(pip4.ports_b[1], senTem_p4.port_a); connect(Point5.ports[1], pip4.ports_b[2]); connect(pip5.ports_b[1], senTemIn_p2.port_b); connect(pip3.port_a, pip5.ports_b[2]); connect(senTemIn_p2.port_a, pip2.port_a); connect(pip2.ports_b[1], senTem_p2.port_a); connect(pip3.ports_b[1], senTem_p3.port_a); connect(ExcludedBranch.ports[1], pip0.ports_b[2]); connect(switch1.y, Point5.m_flow_in); connect(m_flow_p4.y, switch1.u3); connect(m_flow_zero.y, switch1.u1); connect(lessThreshold.y, switch1.u2); end PlugFlowAIT;

Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.PlugFlowULg Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.PlugFlowULg

Validation against data from Université de Liège

Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.PlugFlowULg

Information

The example contains experimental data from a real district heating network.

This model compares the results with the original Modelica Standard Library pipes.

The pipes' temperatures are not initialized. Therefore, results of outflow temperature before approximately the first 10000 seconds should not be considered.

Test bench schematic

Schematic of test rig at ULg

Calibration

There are some uncertainties about the heat loss coefficient between pipe and surrounding air as well as regarding the heat conductivity of the insulation material. With the given data, the length specific thermal resistance is R = 2.164 ((m K)/W), calculated as follows:

R=((1/(2*pipe.kIns)*log((0.0603+2*pipe.dIns)/(0.0603)))+1/(5*(0.0603+2*pipe.dIns)))/Modelica.Constants.pi

U = 1/R = 0.462 W/(m K)

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

Parameters

TypeNameDefaultDescription
MassFlowRatem_flow_nominal1Nominal mass flow rate, used for regularization near zero flow [kg/s]
TemperatureT_start_inpipeDataULg.T_start_in + 273...Initial temperature at pipe inlet [K]
TemperatureT_start_outpipeDataULg.T_start_out + 27...Initial temperature at pipe outlet [K]
SpecificHeatCapacitycp_defaultMedium.specificHeatCapacityC...Heat capacity of medium [J/(kg.K)]
ThermodynamicStatesta_defaultMedium.setState_pTX(T=Medium...Default medium state
PipeDataULg151202pipeDataULgredeclare Data.PipeDataULg15...Measurement dataset from ULg (use Change Class... to choose from different experiments)

Modelica definition

model PlugFlowULg "Validation against data from Université de Liège" extends Modelica.Icons.Example; package Medium = Buildings.Media.Water; parameter Modelica.SIunits.MassFlowRate m_flow_nominal=1 "Nominal mass flow rate, used for regularization near zero flow"; parameter Modelica.SIunits.Temperature T_start_in=pipeDataULg.T_start_in + 273.15 "Initial temperature at pipe inlet"; parameter Modelica.SIunits.Temperature T_start_out=pipeDataULg.T_start_out + 273.15 "Initial temperature at pipe outlet"; parameter Modelica.SIunits.SpecificHeatCapacity cp_default= Medium.specificHeatCapacityCp(state=sta_default) "Heat capacity of medium"; parameter Medium.ThermodynamicState sta_default=Medium.setState_pTX( T=Medium.T_default, p=Medium.p_default, X=Medium.X_default) "Default medium state"; Fluid.Sources.MassFlowSource_T WaterCityNetwork( redeclare package Medium = Medium, m_flow=1.245, use_m_flow_in=true, nPorts=1) "Mass flow source"; Fluid.HeatExchangers.Heater_T Boiler( redeclare package Medium = Medium, m_flow_nominal=1, dp_nominal=0) "Boiler with adjustable outlet temperature"; Fluid.Sources.Boundary_pT Sewer1( redeclare package Medium = Medium, nPorts=1) "Mass flow sink"; Fluid.Sensors.TemperatureTwoPort senTem_out( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, tau=0, T_start=T_start_out) "Temperature sensor"; Fluid.Sensors.TemperatureTwoPort senTem_in( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, tau=0, T_start=T_start_in) "Temperature sensor"; Modelica.Blocks.Sources.CombiTimeTable DataReader(table=pipeDataULg.data, extrapolation=Modelica.Blocks.Types.Extrapolation.HoldLastPoint); Modelica.Blocks.Math.UnitConversions.From_degC Tout "Ambient temperature in degrees"; Buildings.HeatTransfer.Sources.FixedTemperature TBou(T=295.15) "Fixed boundary condition"; Modelica.Blocks.Math.UnitConversions.From_degC Tin "Input temperature into pipe"; replaceable Data.PipeDataULg151202 pipeDataULg constrainedby Data.BaseClasses.PipeDataULg "Measurement dataset from ULg (use Change Class... to choose from different experiments)"; Modelica.Blocks.Math.Gain gain(k=1) "Gain to test variations of mass flow rate within measurement uncertainty "; PlugFlowPipe pipe( redeclare package Medium = Medium, dh=0.05248, length=39, dIns(displayUnit="mm") = 0.013, kIns=0.04, m_flow_nominal=m_flow_nominal, thickness=3.9e-3, T_start_out=T_start_out, T_start_in=T_start_in, R=((1/(2*pipe.kIns)*log((0.0603/2 + pipe.dIns)/(0.0603/2))) + 1/(5*(0.0603 + 2*pipe.dIns)))/Modelica.Constants.pi, nPorts=1, initDelay=true, m_flow_start=pipeDataULg.m_flowIni, cPip=500, rhoPip=8000) "Pipe"; Fluid.Sensors.EnthalpyFlowRate senEntOut(redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal) "Outlet enthalpy sensor"; Modelica.Blocks.Math.Add heatLossSim(k1=-1) "Difference between inflowing and outflowing enthalpy streams"; Modelica.Blocks.Continuous.Integrator eneLosInt "Integrate model error"; Fluid.Sensors.EnthalpyFlowRate senEntIn(redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal) "Inlet enthalpy sensor"; Modelica.Blocks.Math.Add delT(k2=-1) "Temperature difference between in- and outlet"; Modelica.Blocks.Math.Product heaLosMea "Heat loss from measurement (mflow*cp*DeltaT)"; Modelica.Blocks.Math.Gain gain3(k=cp_default) "Specific heat of water"; Modelica.Blocks.Math.Feedback heaLosDiff "Difference between simulated and measurement enthalpy flow difference"; Modelica.Blocks.Sources.Constant Tamb(k=273 + 18) "Ambient temperature in Kelvin"; equation connect(DataReader.y[3], Tout.u); connect(DataReader.y[5], Tin.u); connect(DataReader.y[1], gain.u); connect(senTem_in.port_a, Boiler.port_b); connect(Boiler.port_a, WaterCityNetwork.ports[1]); connect(gain.y, WaterCityNetwork.m_flow_in); connect(Tin.y, Boiler.TSet); connect(Sewer1.ports[1], senTem_out.port_b); connect(senTem_out.port_a, senEntOut.port_b); connect(senEntOut.port_a, pipe.ports_b[1]); connect(pipe.port_a, senEntIn.port_b); connect(senTem_in.port_b, senEntIn.port_a); connect(TBou.port, pipe.heatPort); connect(gain.y, gain3.u); connect(heaLosMea.y, heaLosDiff.u2); connect(heatLossSim.y, heaLosDiff.u1); connect(heaLosDiff.y, eneLosInt.u); connect(delT.u1, Tin.y); connect(Tout.y, delT.u2); connect(heaLosMea.u1, gain3.y); connect(heaLosMea.u2, delT.y); connect(heatLossSim.u2, senEntIn.H_flow); connect(heatLossSim.u1, senEntOut.H_flow); end PlugFlowULg;

Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.TransportWaterAir Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.TransportWaterAir

Validation model, one having water and the other air

Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.TransportWaterAir

Information

Validation model in which a step input is applied to the transport of air and water with a species concentration.

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

Parameters

TypeNameDefaultDescription
Lengthlength20Pipe length [m]

Modelica definition

model TransportWaterAir "Validation model, one having water and the other air" extends Modelica.Icons.Example; package MediumW = Buildings.Media.Water "Medium in the pipe"; package MediumA = Buildings.Media.Air(extraPropertiesNames={"CO2"}) "Medium in the duct"; parameter Modelica.SIunits.Length length=20 "Pipe length"; Modelica.Blocks.Sources.Step Tin( startTime=100, height=10, offset=273.15 + 20) "Step input"; Sources.Boundary_pT sin( redeclare package Medium = MediumW, T=273.15 + 10, nPorts=1, p(displayUnit="Pa") = 101325) "Pressure boundary condition"; Buildings.Fluid.FixedResistances.PlugFlowPipe pip( redeclare package Medium = MediumW, nPorts=1, dIns=0.05, kIns=0.028, m_flow_nominal=1, cPip=500, thickness=0.0032, initDelay=true, m_flow_start=1, rhoPip=8000, length=length, T_start_in=293.15, T_start_out=293.15) "Pipe"; Buildings.Fluid.Sources.MassFlowSource_T sou( nPorts=1, redeclare package Medium = MediumW, use_T_in=true, m_flow=1) "Flow source"; Buildings.Fluid.Sensors.TemperatureTwoPort senTemOutW( redeclare package Medium = MediumW, m_flow_nominal=1, tau=0, T_start=323.15) "Temperature sensor"; Buildings.Fluid.Sensors.TemperatureTwoPort senTemIn( redeclare package Medium = MediumW, m_flow_nominal=1, tau=0, T_start=323.15) "Temperature sensor"; Sources.Boundary_pT sin1( T=273.15 + 10, nPorts=1, p(displayUnit="Pa") = 101325, redeclare package Medium = MediumA) "Pressure boundary condition"; PlugFlowPipe duc( nPorts=1, dIns=0.05, kIns=0.028, m_flow_nominal=1, cPip=500, thickness=0.0032, initDelay=true, m_flow_start=1, rhoPip=8000, redeclare package Medium = MediumA, length=length, T_start_in=293.15, T_start_out=293.15) "Duct"; Sources.MassFlowSource_T sou1( nPorts=1, use_T_in=true, redeclare package Medium = MediumA, use_X_in=true, use_C_in=true, m_flow=1) "Flow source"; Sensors.TemperatureTwoPort senTemOutA( m_flow_nominal=1, tau=0, redeclare package Medium = MediumA, T_start=323.15) "Temperature sensor"; Sensors.TemperatureTwoPort senTemIn1( m_flow_nominal=1, tau=0, T_start=323.15, redeclare package Medium = MediumA) "Temperature sensor"; Modelica.Blocks.Sources.Step XiIn[2]( each startTime=100, height={0.01, -0.01}, offset={0.01,0.99}) "Step input"; Modelica.Blocks.Sources.Step CIn[1]( each startTime=100, each height=0.01, each offset=1E-3) "Step input"; equation connect(Tin.y, sou.T_in); connect(pip.ports_b[1], senTemOutW.port_a); connect(senTemOutW.port_b, sin.ports[1]); connect(sou.ports[1], senTemIn.port_a); connect(senTemIn.port_b, pip.port_a); connect(duc.ports_b[1],senTemOutA. port_a); connect(senTemOutA.port_b, sin1.ports[1]); connect(sou1.ports[1], senTemIn1.port_a); connect(senTemIn1.port_b, duc.port_a); connect(sou1.X_in, XiIn.y); connect(sou1.C_in, CIn.y); connect(Tin.y, sou1.T_in); end TransportWaterAir;