modelExample3

Example 3 model with mixed series/parallel pressure drop components

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

Information

This example demonstrates the importance of merging pressure drop components that are connected in series, into one pressure drop component. Parameter mergeDp.k can be used to merge two components that are connected in series. Parameter from_dp also has an influence of the computational speed.

Following script can be used in Dymola to compare the CPU times. For this script to work, make sure that Dymola stores at least 4 results.

cpuOld=OutputCPUtime;
evaluateOld=Evaluate;
OutputCPUtime:=true;
simulateModel("Buildings.Fluid.Examples.Performance.Example3(from_dp.k=false, mergeDp.k=false, nRes.k=10)", stopTime=1000, numberOfIntervals=10, method="dassl", resultFile="Example3");
simulateModel("Buildings.Fluid.Examples.Performance.Example3(from_dp.k=false, mergeDp.k=true, nRes.k=10)", stopTime=1000, numberOfIntervals=10, method="dassl", resultFile="Example3");
simulateModel("Buildings.Fluid.Examples.Performance.Example3(from_dp.k=true, mergeDp.k=false, nRes.k=10)", stopTime=1000, numberOfIntervals=10, method="dassl", resultFile="Example3");
simulateModel("Buildings.Fluid.Examples.Performance.Example3(from_dp.k=true, mergeDp.k=true, nRes.k=10)", stopTime=1000, numberOfIntervals=10, method="dassl", resultFile="Example3");
createPlot(id=1, position={15, 10, 592, 421}, range={0.0, 1000.0, -0.01, 8}, autoscale=false, grid=true);
plotExpression(apply(Example3[end-3].CPUtime), false, "from_dp=false, mergeDp=false", 1);
plotExpression(apply(Example3[end-2].CPUtime), false, "from_dp=false, mergeDp=true", 1);
plotExpression(apply(Example3[end-1].CPUtime), false, "from_dp=true, mergeDp=false", 1);
plotExpression(apply(Example3[end].CPUtime), false, "from_dp=true, mergeDp=true", 1);
OutputCPUtime=cpuOld;
Evaluate=evaluateOld;

See Jorissen et al. (2015) for a discussion.

References

  • Filip Jorissen, Michael Wetter and Lieve Helsen.
    Simulation speed analysis and improvements of Modelica models for building energy simulation.
    Submitted: 11th Modelica Conference. Paris, France. Sep. 2015.

Parameters

TypeNameDefaultDescription
Modelica.Units.SI.MassFlowRatem_flow_nominal1Nominal mass flow rate
Modelica.Units.SI.PressureDifferencedp_nominal1Pressure drop at nominal mass flow rate

Components

TypeNameDefaultDescription
Fluid.Movers.FlowControlled_m_flowpumpPump model with unidirectional flow
Fluid.Sources.Boundary_pTbouBoundary for absolute pressure boundary condition
Modelica.Blocks.Sources.PulsepulsePulse input
FixedResistances.PressureDropresFirst pressure drop component
Modelica.Blocks.Sources.BooleanConstantmergeDpBlock for easily changing parameter mergeDp.k
Modelica.Blocks.Sources.BooleanConstantfrom_dpBlock for easily changing parameter from_dp.k
FixedResistances.PressureDropres1Second pressure drop component
Modelica.Blocks.Sources.IntegerConstantnResBlock for easily changing parameter nRes.k

Contents

NameDescription
Medium

Revisions

  • January 22, 2016, by Michael Wetter:
    Corrected type declaration of pressure difference. This is for #404.
  • July 14, 2015, by Michael Wetter:
    Revised documentation.
  • April 17, 2015, by Filip Jorissen:
    First implementation.