modelInversion1
Example - Inversion with non-linear equations solver and h as iteration variable
Extends from ThermofluidStream.Idealized.Tests.Inversion.BaseClasses.PartialInverse, Modelica.Icons.Example, ThermofluidStream.Idealized.Utilities.IconInertanceNeglect.
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
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Sources.RealExpression | temperatureSetpoint | ||
| Modelica.Blocks.Math.InverseBlockConstraints | inverseBlockConstraints |
Revisions
-
2026, by Raphael Gebhart (raphael.gebhart@dlr.de):
Initial version.