Buildings.Fluid.Examples.Performance.PressureDrop

Package with various configurations of pressure drop models to analyze symbolic processing

Information

This package contains examples that demonstrate how parameter settings and boundary conditions can affect the number and size of algebraic loops.

Either a pressure difference or a mass flow rate is prescribed. The parameter from_dp is set to either true or false. These combinations are applied to a flow network consisting of parallel, series or parallel-series components. By looking at the size of the nonlinear equations between the example and its counter-part that ends in Optimised, one can see whether the symbolic processing optimally converts the system of equations.

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

Package Content

Name Description
Buildings.Fluid.Examples.Performance.PressureDrop.ParallelDp ParallelDp Parallel connection with prescribed pressure difference and non-optimised parameters
Buildings.Fluid.Examples.Performance.PressureDrop.ParallelDpOptimised ParallelDpOptimised Parallel connection with prescribed pressure difference and optimised parameters
Buildings.Fluid.Examples.Performance.PressureDrop.ParallelFlow ParallelFlow Parallel connection with prescribed flow rate and non-optimised parameters
Buildings.Fluid.Examples.Performance.PressureDrop.ParallelFlowOptimised ParallelFlowOptimised Parallel connection with prescribed flow rate and optimised parameters
Buildings.Fluid.Examples.Performance.PressureDrop.SeriesDp SeriesDp Series connection with prescribed pressure difference and non-optimised parameters
Buildings.Fluid.Examples.Performance.PressureDrop.SeriesDpOptimised SeriesDpOptimised Series connection with prescribed pressure difference and optimised parameters
Buildings.Fluid.Examples.Performance.PressureDrop.SeriesFlow SeriesFlow Series connection with prescribed flow rate and non-optimised parameters
Buildings.Fluid.Examples.Performance.PressureDrop.SeriesFlowOptimised SeriesFlowOptimised Series connection with prescribed flow and optimised parameters
Buildings.Fluid.Examples.Performance.PressureDrop.SeriesParallelDp SeriesParallelDp Combined series and parallel connection with prescribed pressure difference and non-optimised parameters
Buildings.Fluid.Examples.Performance.PressureDrop.SeriesParallelDpOptimised SeriesParallelDpOptimised Combined series and parallel connection with prescribed pressure difference and non-optimised parameters
Buildings.Fluid.Examples.Performance.PressureDrop.SeriesParallelFlow SeriesParallelFlow Combined series and parallel connection with prescribed flow rate and non-optimised parameters
Buildings.Fluid.Examples.Performance.PressureDrop.SeriesParallelFlowOptimised SeriesParallelFlowOptimised Combined series and parallel connection with prescribed flow rate and non-optimised parameters

Buildings.Fluid.Examples.Performance.PressureDrop.ParallelDp Buildings.Fluid.Examples.Performance.PressureDrop.ParallelDp

Parallel connection with prescribed pressure difference and non-optimised parameters

Buildings.Fluid.Examples.Performance.PressureDrop.ParallelDp

Information

Example model that demonstrates how translation statistics depend on the type of boundary conditions, the parallel or series configuration of the components and the value of parameter from_dp.

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

Parameters

TypeNameDefaultDescription
IntegernRes10Number of resistances
PressureDifferencedp_nominal1Pressure drop at nominal mass flow rate [Pa]
MassFlowRatem_flow_nominal1Nominal mass flow rate [kg/s]

Modelica definition

model ParallelDp "Parallel connection with prescribed pressure difference and non-optimised parameters" extends Modelica.Icons.Example; package Medium = Buildings.Media.Air; parameter Integer nRes(min=2) = 10 "Number of resistances"; parameter Modelica.SIunits.PressureDifference dp_nominal=1 "Pressure drop at nominal mass flow rate"; parameter Modelica.SIunits.MassFlowRate m_flow_nominal=1 "Nominal mass flow rate"; Sources.Boundary_pT sou( redeclare package Medium = Medium, nPorts=1, use_p_in=true) "Pressure boundary condition"; Modelica.Blocks.Sources.Pulse pulse_p( period=1, offset=Medium.p_default, amplitude=dp_nominal) "Pulse input for pressure"; FixedResistances.PressureDrop[nRes] resParallel( redeclare each package Medium = Medium, each m_flow_nominal=m_flow_nominal, each allowFlowReversal=false, dp_nominal={dp_nominal*(1 + mod(i, 3)) for i in 1:nRes}, each from_dp=false) "Parallel pressure drop components"; Sources.Boundary_pT sin(redeclare package Medium = Medium, nPorts=1) "Pressure boundary condition"; equation connect(pulse_p.y, sou.p_in); for i in 1:nRes - 1 loop connect(resParallel[i].port_a, resParallel[i + 1].port_a); connect(resParallel[i].port_b, resParallel[i + 1].port_b); end for; connect(resParallel[nRes].port_b, sin.ports[1]); connect(resParallel[1].port_a, sou.ports[1]); end ParallelDp;

Buildings.Fluid.Examples.Performance.PressureDrop.ParallelDpOptimised Buildings.Fluid.Examples.Performance.PressureDrop.ParallelDpOptimised

Parallel connection with prescribed pressure difference and optimised parameters

Buildings.Fluid.Examples.Performance.PressureDrop.ParallelDpOptimised

Information

Example model that demonstrates how translation statistics depend on the type of boundary conditions, the parallel or series configuration of the components and the value of parameter from_dp.

Extends from ParallelDp (Parallel connection with prescribed pressure difference and non-optimised parameters).

Parameters

TypeNameDefaultDescription
IntegernRes10Number of resistances
PressureDifferencedp_nominal1Pressure drop at nominal mass flow rate [Pa]
MassFlowRatem_flow_nominal1Nominal mass flow rate [kg/s]

Modelica definition

model ParallelDpOptimised "Parallel connection with prescribed pressure difference and optimised parameters" extends ParallelDp(resParallel(each from_dp=true)); end ParallelDpOptimised;

Buildings.Fluid.Examples.Performance.PressureDrop.ParallelFlow Buildings.Fluid.Examples.Performance.PressureDrop.ParallelFlow

Parallel connection with prescribed flow rate and non-optimised parameters

Buildings.Fluid.Examples.Performance.PressureDrop.ParallelFlow

Information

Example model that demonstrates how translation statistics depend on the type of boundary conditions, the parallel or series configuration of the components and the value of parameter from_dp.

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

Parameters

TypeNameDefaultDescription
IntegernRes10Number of resistances
PressureDifferencedp_nominal1Pressure drop at nominal mass flow rate [Pa]
MassFlowRatem_flow_nominal1Nominal mass flow rate [kg/s]

Modelica definition

model ParallelFlow "Parallel connection with prescribed flow rate and non-optimised parameters" extends Modelica.Icons.Example; package Medium = Buildings.Media.Air; parameter Integer nRes(min=2) = 10 "Number of resistances"; parameter Modelica.SIunits.PressureDifference dp_nominal=1 "Pressure drop at nominal mass flow rate"; parameter Modelica.SIunits.MassFlowRate m_flow_nominal=1 "Nominal mass flow rate"; Sources.MassFlowSource_T sou( redeclare package Medium = Medium, nPorts=1, use_m_flow_in=true) "Flow rate boundary condition"; Modelica.Blocks.Sources.Pulse pulse_m_flow( amplitude=1, period=1, offset=0) "Pulse input for flow rate"; FixedResistances.PressureDrop[nRes] resParallel( redeclare each package Medium = Medium, each m_flow_nominal=m_flow_nominal, each allowFlowReversal=false, dp_nominal={dp_nominal*(1 + mod(i, 3)) for i in 1:nRes}, each from_dp=false) "Parallel pressure drop components"; Sources.Boundary_pT sin(redeclare package Medium = Medium, nPorts=1) "Pressure boundary condition"; equation for i in 1:nRes - 1 loop connect(resParallel[i].port_a, resParallel[i + 1].port_a); connect(resParallel[i].port_b, resParallel[i + 1].port_b); end for; connect(resParallel[nRes].port_b, sin.ports[1]); connect(resParallel[1].port_a, sou.ports[1]); connect(pulse_m_flow.y, sou.m_flow_in); end ParallelFlow;

Buildings.Fluid.Examples.Performance.PressureDrop.ParallelFlowOptimised Buildings.Fluid.Examples.Performance.PressureDrop.ParallelFlowOptimised

Parallel connection with prescribed flow rate and optimised parameters

Buildings.Fluid.Examples.Performance.PressureDrop.ParallelFlowOptimised

Information

Example model that demonstrates how translation statistics depend on the type of boundary conditions, the parallel or series configuration of the components and the value of parameter from_dp.

Extends from ParallelFlow (Parallel connection with prescribed flow rate and non-optimised parameters).

Parameters

TypeNameDefaultDescription
IntegernRes10Number of resistances
PressureDifferencedp_nominal1Pressure drop at nominal mass flow rate [Pa]
MassFlowRatem_flow_nominal1Nominal mass flow rate [kg/s]

Modelica definition

model ParallelFlowOptimised "Parallel connection with prescribed flow rate and optimised parameters" extends ParallelFlow(resParallel(each from_dp=true)); end ParallelFlowOptimised;

Buildings.Fluid.Examples.Performance.PressureDrop.SeriesDp Buildings.Fluid.Examples.Performance.PressureDrop.SeriesDp

Series connection with prescribed pressure difference and non-optimised parameters

Buildings.Fluid.Examples.Performance.PressureDrop.SeriesDp

Information

Example model that demonstrates how translation statistics depend on the type of boundary conditions, the parallel or series configuration of the components and the value of parameter from_dp.

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

Parameters

TypeNameDefaultDescription
IntegernRes10Number of resistances
PressureDifferencedp_nominal1Pressure drop at nominal mass flow rate [Pa]
MassFlowRatem_flow_nominal1Nominal mass flow rate [kg/s]

Modelica definition

model SeriesDp "Series connection with prescribed pressure difference and non-optimised parameters" extends Modelica.Icons.Example; package Medium = Buildings.Media.Air; parameter Integer nRes(min=2) = 10 "Number of resistances"; parameter Modelica.SIunits.PressureDifference dp_nominal=1 "Pressure drop at nominal mass flow rate"; parameter Modelica.SIunits.MassFlowRate m_flow_nominal=1 "Nominal mass flow rate"; Sources.Boundary_pT sou( redeclare package Medium = Medium, nPorts=1, use_p_in=true) "Pressure boundary condition"; Modelica.Blocks.Sources.Pulse pulse_p( period=1, offset=Medium.p_default, amplitude=dp_nominal) "Pulse input for pressure"; FixedResistances.PressureDrop[nRes] resSeries( redeclare each package Medium = Medium, each m_flow_nominal=m_flow_nominal, each allowFlowReversal=false, dp_nominal={dp_nominal*(1 + mod(i, 3)) for i in 1:nRes}, each from_dp=true) "Series pressure drop components"; Sources.Boundary_pT sin(redeclare package Medium = Medium, nPorts=1) "Pressure boundary condition"; equation connect(pulse_p.y, sou.p_in); for i in 1:nRes - 1 loop connect(resSeries[i].port_b, resSeries[i + 1].port_a); end for; connect(resSeries[nRes].port_b, sin.ports[1]); connect(resSeries[1].port_a, sou.ports[1]); end SeriesDp;

Buildings.Fluid.Examples.Performance.PressureDrop.SeriesDpOptimised Buildings.Fluid.Examples.Performance.PressureDrop.SeriesDpOptimised

Series connection with prescribed pressure difference and optimised parameters

Buildings.Fluid.Examples.Performance.PressureDrop.SeriesDpOptimised

Information

Example model that demonstrates how translation statistics depend on the type of boundary conditions, the parallel or series configuration of the components and the value of parameter from_dp.

Extends from SeriesDp (Series connection with prescribed pressure difference and non-optimised parameters).

Parameters

TypeNameDefaultDescription
IntegernRes10Number of resistances
PressureDifferencedp_nominal1Pressure drop at nominal mass flow rate [Pa]
MassFlowRatem_flow_nominal1Nominal mass flow rate [kg/s]

Modelica definition

model SeriesDpOptimised "Series connection with prescribed pressure difference and optimised parameters" extends SeriesDp(resSeries(each from_dp=false)); end SeriesDpOptimised;

Buildings.Fluid.Examples.Performance.PressureDrop.SeriesFlow Buildings.Fluid.Examples.Performance.PressureDrop.SeriesFlow

Series connection with prescribed flow rate and non-optimised parameters

Buildings.Fluid.Examples.Performance.PressureDrop.SeriesFlow

Information

Example model that demonstrates how translation statistics depend on the type of boundary conditions, the parallel or series configuration of the components and the value of parameter from_dp.

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

Parameters

TypeNameDefaultDescription
IntegernRes10Number of resistances
PressureDifferencedp_nominal1Pressure drop at nominal mass flow rate [Pa]
MassFlowRatem_flow_nominal1Nominal mass flow rate [kg/s]

Modelica definition

model SeriesFlow "Series connection with prescribed flow rate and non-optimised parameters" extends Modelica.Icons.Example; package Medium = Buildings.Media.Air; parameter Integer nRes(min=2) = 10 "Number of resistances"; parameter Modelica.SIunits.PressureDifference dp_nominal=1 "Pressure drop at nominal mass flow rate"; parameter Modelica.SIunits.MassFlowRate m_flow_nominal=1 "Nominal mass flow rate"; Sources.MassFlowSource_T sou( redeclare package Medium = Medium, nPorts=1, use_m_flow_in=true) "Flow rate boundary condition"; Modelica.Blocks.Sources.Pulse pulse_p( amplitude=1, period=1, offset=0) "Pulse input for flow rate"; FixedResistances.PressureDrop[nRes] resSeries( redeclare each package Medium = Medium, each m_flow_nominal=m_flow_nominal, each allowFlowReversal=false, dp_nominal={dp_nominal*(1 + mod(i, 3)) for i in 1:nRes}, each from_dp=true) "Series pressure drop components"; Sources.Boundary_pT sin(redeclare package Medium = Medium, nPorts=1) "Pressure boundary condition"; equation for i in 1:nRes - 1 loop connect(resSeries[i].port_b, resSeries[i + 1].port_a); end for; connect(resSeries[nRes].port_b, sin.ports[1]); connect(resSeries[1].port_a, sou.ports[1]); connect(sou.m_flow_in, pulse_p.y); end SeriesFlow;

Buildings.Fluid.Examples.Performance.PressureDrop.SeriesFlowOptimised Buildings.Fluid.Examples.Performance.PressureDrop.SeriesFlowOptimised

Series connection with prescribed flow and optimised parameters

Buildings.Fluid.Examples.Performance.PressureDrop.SeriesFlowOptimised

Information

Example model that demonstrates how translation statistics depend on the type of boundary conditions, the parallel or series configuration of the components and the value of parameter from_dp.

Extends from SeriesFlow (Series connection with prescribed flow rate and non-optimised parameters).

Parameters

TypeNameDefaultDescription
IntegernRes10Number of resistances
PressureDifferencedp_nominal1Pressure drop at nominal mass flow rate [Pa]
MassFlowRatem_flow_nominal1Nominal mass flow rate [kg/s]

Modelica definition

model SeriesFlowOptimised "Series connection with prescribed flow and optimised parameters" extends SeriesFlow(resSeries(each from_dp=false)); end SeriesFlowOptimised;

Buildings.Fluid.Examples.Performance.PressureDrop.SeriesParallelDp Buildings.Fluid.Examples.Performance.PressureDrop.SeriesParallelDp

Combined series and parallel connection with prescribed pressure difference and non-optimised parameters

Buildings.Fluid.Examples.Performance.PressureDrop.SeriesParallelDp

Information

Example model that demonstrates how translation statistics depend on the type of boundary conditions, the parallel or series configuration of the components and the value of parameter from_dp.

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

Parameters

TypeNameDefaultDescription
IntegernRes10Number of resistances
PressureDifferencedp_nominal1Pressure drop at nominal mass flow rate [Pa]
MassFlowRatem_flow_nominal1Nominal mass flow rate [kg/s]

Modelica definition

model SeriesParallelDp "Combined series and parallel connection with prescribed pressure difference and non-optimised parameters" extends Modelica.Icons.Example; package Medium = Buildings.Media.Air; parameter Integer nRes(min=2) = 10 "Number of resistances"; parameter Modelica.SIunits.PressureDifference dp_nominal=1 "Pressure drop at nominal mass flow rate"; parameter Modelica.SIunits.MassFlowRate m_flow_nominal=1 "Nominal mass flow rate"; Sources.Boundary_pT sou( redeclare package Medium = Medium, nPorts=1, use_p_in=true) "Pressure boundary condition"; Modelica.Blocks.Sources.Pulse pulse_m_flow( period=1, offset=Medium.p_default, amplitude=dp_nominal) "Pulse input for flow rate"; FixedResistances.PressureDrop[nRes] resParallel( redeclare each package Medium = Medium, each m_flow_nominal=m_flow_nominal, each allowFlowReversal=false, dp_nominal={dp_nominal*(1 + mod(i, 3)) for i in 1:nRes}, each from_dp=false) "Parallel pressure drop components"; Sources.Boundary_pT sin(redeclare package Medium = Medium, nPorts=1) "Pressure boundary condition"; FixedResistances.PressureDrop res2( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, dp_nominal=dp_nominal, from_dp=false) "Series pressure drop component"; equation for i in 1:nRes - 1 loop connect(resParallel[i].port_a, resParallel[i + 1].port_a); connect(resParallel[i].port_b, resParallel[i + 1].port_b); end for; connect(resParallel[1].port_a, sou.ports[1]); connect(resParallel[nRes].port_b, res2.port_a); connect(res2.port_b, sin.ports[1]); connect(pulse_m_flow.y, sou.p_in); end SeriesParallelDp;

Buildings.Fluid.Examples.Performance.PressureDrop.SeriesParallelDpOptimised Buildings.Fluid.Examples.Performance.PressureDrop.SeriesParallelDpOptimised

Combined series and parallel connection with prescribed pressure difference and non-optimised parameters

Buildings.Fluid.Examples.Performance.PressureDrop.SeriesParallelDpOptimised

Information

Example model that demonstrates how translation statistics depend on the type of boundary conditions, the parallel or series configuration of the components and the value of parameter from_dp.

Extends from SeriesParallelDp (Combined series and parallel connection with prescribed pressure difference and non-optimised parameters).

Parameters

TypeNameDefaultDescription
IntegernRes10Number of resistances
PressureDifferencedp_nominal1Pressure drop at nominal mass flow rate [Pa]
MassFlowRatem_flow_nominal1Nominal mass flow rate [kg/s]

Modelica definition

model SeriesParallelDpOptimised "Combined series and parallel connection with prescribed pressure difference and non-optimised parameters" extends SeriesParallelDp(res2(from_dp=true), resParallel(each from_dp=true)); end SeriesParallelDpOptimised;

Buildings.Fluid.Examples.Performance.PressureDrop.SeriesParallelFlow Buildings.Fluid.Examples.Performance.PressureDrop.SeriesParallelFlow

Combined series and parallel connection with prescribed flow rate and non-optimised parameters

Buildings.Fluid.Examples.Performance.PressureDrop.SeriesParallelFlow

Information

Example model that demonstrates how translation statistics depend on the type of boundary conditions, the parallel or series configuration of the components and the value of parameter from_dp.

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

Parameters

TypeNameDefaultDescription
IntegernRes10Number of resistances
PressureDifferencedp_nominal1Pressure drop at nominal mass flow rate [Pa]
MassFlowRatem_flow_nominal1Nominal mass flow rate [kg/s]

Modelica definition

model SeriesParallelFlow "Combined series and parallel connection with prescribed flow rate and non-optimised parameters" extends Modelica.Icons.Example; package Medium = Buildings.Media.Air; parameter Integer nRes(min=2) = 10 "Number of resistances"; parameter Modelica.SIunits.PressureDifference dp_nominal=1 "Pressure drop at nominal mass flow rate"; parameter Modelica.SIunits.MassFlowRate m_flow_nominal=1 "Nominal mass flow rate"; Sources.MassFlowSource_T sou( redeclare package Medium = Medium, nPorts=1, use_m_flow_in=true) "Flow rate boundary condition"; Modelica.Blocks.Sources.Pulse pulse_m_flow( amplitude=1, period=1, offset=0) "Pulse input for flow rate"; FixedResistances.PressureDrop[nRes] resParallel( redeclare each package Medium = Medium, each m_flow_nominal=m_flow_nominal, each allowFlowReversal=false, dp_nominal={dp_nominal*(1 + mod(i, 3)) for i in 1:nRes}, each from_dp=false) "Parallel pressure drop components"; Sources.Boundary_pT sin(redeclare package Medium = Medium, nPorts=1) "Pressure boundary condition"; FixedResistances.PressureDrop res2( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, dp_nominal=dp_nominal, from_dp=true) "Series pressure drop component"; equation for i in 1:nRes - 1 loop connect(resParallel[i].port_a, resParallel[i + 1].port_a); connect(resParallel[i].port_b, resParallel[i + 1].port_b); end for; connect(resParallel[1].port_a, sou.ports[1]); connect(pulse_m_flow.y, sou.m_flow_in); connect(resParallel[nRes].port_b, res2.port_a); connect(res2.port_b, sin.ports[1]); end SeriesParallelFlow;

Buildings.Fluid.Examples.Performance.PressureDrop.SeriesParallelFlowOptimised Buildings.Fluid.Examples.Performance.PressureDrop.SeriesParallelFlowOptimised

Combined series and parallel connection with prescribed flow rate and non-optimised parameters

Buildings.Fluid.Examples.Performance.PressureDrop.SeriesParallelFlowOptimised

Information

Example model that demonstrates how translation statistics depend on the type of boundary conditions, the parallel or series configuration of the components and the value of parameter from_dp.

Extends from SeriesParallelFlow (Combined series and parallel connection with prescribed flow rate and non-optimised parameters).

Parameters

TypeNameDefaultDescription
IntegernRes10Number of resistances
PressureDifferencedp_nominal1Pressure drop at nominal mass flow rate [Pa]
MassFlowRatem_flow_nominal1Nominal mass flow rate [kg/s]

Modelica definition

model SeriesParallelFlowOptimised "Combined series and parallel connection with prescribed flow rate and non-optimised parameters" extends SeriesParallelFlow(res2(from_dp=false), resParallel(each from_dp=true)); end SeriesParallelFlowOptimised;