modelResistanceVolumeFlowReversal
Extends from Modelica.Icons.Example (Icon for runnable examples).
Information
This model demonstrates the impact of the allowFlowReversal parameter on the size
of nonlinear systems of equations. The user can change the parameter value in the allowFlowReversal
block and rerun the simulation. The results are also demonstrated below for nRes.k = 10,
which is the number of parallel branches containing one pressure drop element and one mixing volume each.
This model was created to demonstrate the influence of a new implementation of
Buildings.Fluid.Interfaces.ConservationEquation.
The old implementation used the actualStream() function
whereas the new implementation uses the semiLinear()
function. This change allows Dymola to exploit knowledge about the min and max attributes
of m_flow.
When Dymola knows in which way the medium will flow, nonlinear systems can be simplified or completely removed.
This is illustrated by the results below.
See issue 216 for a discussion.
Note that Dymola 2015FD01 can only reliably solve the last case. For the other two cases the Newton solver of the nonlinear system does not converge.
These results were generated using Dymola 2015FD01 64 bit on Ubuntu 14.04
and with Evaluate=false.
ResistanceVolumeFlowReversal = true
Sizes of nonlinear systems of equations: {6, 11, 56}
Sizes after manipulation of the nonlinear systems: {1, 9, 12}
ResistanceVolumeFlowReversal = false
Old implementation
Sizes of nonlinear systems of equations: {6, 11, 44}
Sizes after manipulation of the nonlinear systems: {1, 9, 11}
New implementation
Sizes of nonlinear systems of equations: {6, 11, 4}
Sizes after manipulation of the nonlinear systems: {1, 9, 1}
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Real | m_flow_nominal | 0.1 | Gain value multiplied with input signal |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Buildings.Fluid.Sources.Boundary_pT | bou | Boundary for pressure boundary condition | |
| Movers.FlowControlled_m_flow | pump | Pump model with unidirectional flow | |
| Buildings.Fluid.HeatExchangers.Heater_T | hea | Heater | |
| Modelica.Blocks.Sources.Pulse | pulse | Pulse input | |
| Modelica.Blocks.Math.Gain | gain | Gain for m_flow_nominal | |
| Buildings.Fluid.Actuators.Valves.ThreeWayLinear | val | Three way valve with constant input | |
| Modelica.Blocks.Sources.Constant | const | Constant valve set point | |
| Modelica.Blocks.Sources.BooleanConstant | allowFlowReversal | Block for setting allowFlowReversal in components | |
| Buildings.Fluid.FixedResistances.PressureDrop | res | Fluid resistance for splitting flow | |
| Modelica.Blocks.Sources.IntegerConstant | nRes | Number of parallel branches | |
| Delays.DelayFirstOrder | vol | Mixing volumes for enthalpy circuit | |
| Buildings.Fluid.Sensors.TemperatureTwoPort[nRes.k] | senTem | Temperature sensor |
Contents
| Name | Description |
|---|---|
Revisions
-
March 31, 2026, by Michael Wetter:
Corrected unit propagation error that causes Dymola 2026x to not show certain units.
See #2100. -
July 18, 2025, by Hongxiang Fu:
Added two-port temperature sensors to replacevol[:].Tfrom reference results.
This is for #4276. -
September 21, 2017, by Michael Wetter:
Corrected parameterization to be independent ofk.
This is for Buildings, #825. -
May 8, 2017, by Michael Wetter:
Updated heater model.
This is for Buildings, #763. -
April 11, 2016 by Michael Wetter:
Corrected wrong hyperlink in documentation for issue 450. -
February 22, 2016, by Michael Wetter:
Removed parameterdynamicBalancefor issue 411. -
April 17, 2015, by Filip Jorissen:
First implementation.