CheckAirCircuitSystem model
Requirements.Examples.AirCircuitSystem.CheckAirCircuitSystem
ยท source
Air circuit system with the pressure and temperature requirements of pipe2 bound and checked
Extends Modelica.Icons.Example, Components.AirCircuitSystem_B
Example that demonstrates the three steps of requirement checking with the Requirements library: requirement definition, binding to a plant model and checking during simulation.
- The plant is the air circuit AirCircuitSystem_B, inherited by this model.
- The requirements are defined in
PipeRequirements:
in every node of a pipe the pressure shall stay below
pMax(here set to 200000 Pa) and the temperature shall be within[Tmin, Tmax](default 255 K to 300 K). - The binding function
pipeObservation_from_DynamicPipe
maps the medium states of
pipe2to the observation record of the requirement blockpipe2Requirements. Its argument, a MediumVector record, is built at the call site with explicit record constructors from the pressurepand temperatureTof every medium modelpipe2.mediums[i]. - The
innerPrintViolations block prints the verdicts of the 10 requirements (2 per node ofpipe2) at the end of the simulation and writes them to the log files.
The example runs for 1 s (StopTime), and printViolations.evaluationTime is set to the same instant.
Revisions
| Date | Description |
|---|---|
| Dec. 3, 2026 | The pipe instance pipe2 is no longer passed to pipeObservation_from_DynamicPipe; the call site builds the
MediumVector record with explicit record constructors from pipe2.mediums[i].p and pipe2.mediums[i].T.
Passing the instance (record cast) was rejected by Modelon Impact ("Accesses to composite components other than records are not allowed")
and OpenModelica 1.27 (type mismatch). experiment(StopTime=1) and printViolations.evaluationTime=1 are now
explicit (H. Tummescheit, Model Based Innovation LLC) |
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 |
pipe2Requirements | Components.Checks.PipeRequirements | Pressure and temperature requirements of every node of pipe2 |