modelInversion1

Example - Inversion with non-linear equations solver and h as iteration variable

Extends from ThermofluidStream.Idealized.Tests.Inversion.BaseClasses.PartialInverse (Base model defining the mixing problem), Modelica.Icons.Example (Icon for runnable examples), ThermofluidStream.Idealized.Utilities.IconInertanceNeglect (Icon for considerInertance = false).

Information

Mixing of two fluid streams, A and B. Assuming constant specific heat capacities c_p, the mixing equation is:

m_flow_A * T_A + m_flow_B * T_B = (m_flow_A + m_flow_B) * T_mix;
  

This equation can be easily solved for a single unknown.

In this test, the goal is to determine the mass flow rate m_flow_B such that the mixture temperature is T_mix = 25 °C. The solution is:

m_flow_B = - m_flow_A * (T_B - T_mix) / (T_A - T_mix)
         = - 1 kg/s * (30 - 25) / (20 - 25)
         = 1 kg/s
  

Dymola uses the mass flow rate junction.m_flowA and the specific enthalpy of the mixture junction.h_mix as the iteration variable. Their default start values might not be appropriate, which can cause the simulation to fail.

Components

TypeNameDefaultDescription
ThermofluidStream.DropOfCommonsdropOfCommons (from PartialInverse)
ThermofluidStream.Boundaries.SourcesourceA (from PartialInverse)
.ThermofluidStream.Idealized.Boundaries.Sink_freesink (from PartialInverse)
ThermofluidStream.Idealized.Topology.JunctionT2junction (from PartialInverse)
ThermofluidStream.Boundaries.SourcesourceB (from PartialInverse)
.ThermofluidStream.Idealized.Boundaries.MassFlowRatemassFlowRateB (from PartialInverse)
.ThermofluidStream.Idealized.Boundaries.MassFlowRatemassFlowRateA (from PartialInverse)
ThermofluidStream.Sensors.SingleSensorSelectsingleSensorSelect (from PartialInverse)
Modelica.Blocks.Sources.RealExpressiontemperatureSetpoint
Modelica.Blocks.Math.InverseBlockConstraintsinverseBlockConstraints

Revisions

  • 2026, by Raphael Gebhart (raphael.gebhart@dlr.de):
    Initial version.