modelExample2
Extends from Modelica.Icons.Example (Icon for runnable examples).
Information
This example demonstrates that the use of the parameter from_dp
can be important for reducing the size of algebraic loops in hydraulic
circuits with many pressure drop components connected in series and
a pump setting the pressure head.
If from_dp=true, we obtain:
Sizes of nonlinear systems of equations: {7}
Sizes after manipulation of the nonlinear systems: {5}
If from_dp=false, we obtain:
Sizes of nonlinear systems of equations: {7}
Sizes after manipulation of the nonlinear systems: {1}
This can have a large impact on computational speed.
Following script can be used in Dymola to compare the CPU times.
cpuOld=OutputCPUtime;
evaluateOld=Evaluate;
OutputCPUtime:=true;
simulateModel("BuildingSystems.Fluid.Examples.Performance.Example2(from_dp.k=false)", stopTime=10000, numberOfIntervals=10, method="dassl", resultFile="Example2");
simulateModel("BuildingSystems.Fluid.Examples.Performance.Example2(from_dp.k=true)", stopTime=10000, numberOfIntervals=10, method="dassl", resultFile="Example2");
createPlot(id=1, position={15, 10, 592, 421}, range={0.0, 10000.0, -0.01, 25}, autoscale=false, grid=true);
plotExpression(apply(Example2[end-1].CPUtime), false, "from_dp=false", 1);
plotExpression(apply(Example2[end].CPUtime), false, "from_dp=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
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Units.SI.MassFlowRate | m_flow_nominal | 1 | Nominal mass flow rate |
| Modelica.Units.SI.PressureDifference | dp_nominal | 1 | Pressure drop at nominal mass flow rate |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Fluid.Movers.FlowControlled_dp | pump_dp | Pump model with unidirectional flow | |
| Fluid.Sources.Boundary_pT | bou | Boundary for absolute pressure boundary condition | |
| Modelica.Blocks.Sources.Pulse | pulse | Pulse input | |
| FixedResistances.PressureDrop | res | ||
| Modelica.Blocks.Sources.BooleanConstant | from_dp | Block for easily changing parameter from_dp.k | |
| Modelica.Blocks.Sources.IntegerConstant | nRes | Number of parallel branches |
Contents
| Name | Description |
|---|---|
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. -
May 20, 2015, by Filip Jorissen:
First implementation.