CheckHeatExchanger model
Requirements.Examples.SteadyState.CheckHeatExchanger
ยท source
HeatExchangerSimulation with its steady-state requirements, checked at the settled end of the run and printed by PrintViolations
Extends Modelica.Icons.Example, HeatExchangerSimulation
The one operating point of HeatExchangerSimulation
(side 1 at 90 degC, side 2 at 10 degC, 0.2 kg/s each in counterflow) with its steady-state requirements checked in a
plain simulation in any Modelica tool. At the end of the run PrintViolations
prints the verdict of every requirement and writes CheckHeatExchanger_log.txt and
CheckHeatExchanger_log.html.
What is different about a steady-state requirement. A requirement block reports a violation if its
property is Violated at any instant. A steady-state requirement is a statement about the
settled operating point, not about the way there: the transient from the start values must not count. Each
steady-state requirement is therefore written as during(steady, check), which is Undefined
(not applicable) while the run is still moving and decides the check only once it has settled:
steadyis true in the last quarter of the run (time ≥ tSettled) while the rates of change of both outlet temperatures are belowdTdtMax. The rates come from ApproximateDerivativeWithFilter (the outlet temperatures are functions of the medium states, which a tool need not be able to differentiate).- R0_settled makes the assumption explicit: if the run has not settled in its last quarter, R0 is violated, and R1 and R2 stay untested rather than being judged on a transient value.
- R1_outletTemperature: the outlet temperature of side 1 at most 80 degC.
- R2_wallTemperature: the hottest wall node below 96 degC.
At the nominal point the run has settled well before 450 s; the outlet of side 1 ends at 37.6 degC, side 2 at 62.5 degC, the hottest wall node at 78.7 degC, and all three requirements are satisfied (decided at t = 450 s, Undefined before).
The standard PrintViolations is used: the verdict of a steady-state requirement is decided at the
end of the run like any other. As in every example of this library, evaluationTime is the StopTime,
so that a tool that does not support terminal() prints the verdict once
printViolations.useEvaluationTime = true is set.
To check another operating point, modify T_in1, T_in2, m_flow1 and
m_flow2; to check a map of them, sweep this model with your tool's parameter-variation facility and
collect the requirement verdicts per run (or sweep the plant alone and evaluate the requirements on its stored
outputs).
Copyright © 2026 Model Based Innovation LLC. All rights reserved.
Parameters
| Name | Type | Description |
|---|---|---|
tSettled parameter | SI.Time | Start of the window in which the run counts as settled (the last quarter of StopTime) |
dTdtMax parameter | Real | Largest rate of change of an outlet temperature that counts as steady |
T_out1_max parameter | SI.Temperature | Requirement R1: the steady outlet temperature of side 1 shall be at most this |
T_wall_limit parameter | SI.Temperature | Requirement R2: the steady hottest wall node shall stay below this |
Components and variables
| Name | Type | Description |
|---|---|---|
printViolations inner | Verify.PrintViolations | Prints the requirement verdicts and writes the log files at the end of the simulation |
derT_out1 | SignalAnalysis.ApproximateDerivativeWithFilter | Rate of change of T_out1 |
derT_out2 | SignalAnalysis.ApproximateDerivativeWithFilter | Rate of change of T_out2 |
steady | Boolean | = true when the run is in its last quarter and both outlet temperatures have stopped moving |
R0_settled | Verify.Requirement | Requirement R0: both outlet temperatures have settled in the last quarter of the run |
R1_outletTemperature | Verify.Requirement | Requirement R1: in steady state the outlet temperature of side 1 is at most T_out1_max |
R2_wallTemperature | Verify.Requirement | Requirement R2: in steady state the hottest wall node stays below T_wall_limit |