SysML v2 — Fuel System, Wired Correctly
The reference model, and the one to copy. A tank, a pump and an engine joined by a typed fuel interface, with the filler neck as a boundary port of the vehicle. Every port opposes the port it meets, every interface binds its ends in the order its definition declares, the payload conforms, and the item arriving at the boundary continues to something inside. Reports clean — and the figure is byte-for-byte the same as the next template's, which does not.
Make it your own.
package FuelSystem {
item def Fuel;
// A port with no directed features is a structural attachment — a bolt
// pattern. It has no direction to get backwards, and this engine never
// accuses one.
port def MountPoint;
// The contract. This is the ONLY place a direction is stated, and it
// sits in a box the interconnection view does not draw.
port def FuelPort {
out item feed : Fuel;
in item spill : Fuel;
}
// The pairing, in declared END ORDER. Nothing on the page shows this.
interface def FuelLine {
end supplier : FuelPort;
end consumer : ~FuelPort;
}
part def Tank {
port outlet : FuelPort;
port fillPoint : ~FuelPort;
}
part def Pump {
port inlet : ~FuelPort;
port outlet : FuelPort;
port base : MountPoint;
}
part def Engine {
port inlet : ~FuelPort;
port foot : MountPoint;
}
part def Vehicle {
// A boundary port: unconnected on the OUTSIDE is correct here, and
// inside the vehicle it is where fuel arrives from.
port fill : ~FuelPort;
part tank : Tank;
part pump : Pump;
part engine : Engine;
interface tankToPump : FuelLine connect tank.outlet to pump.inlet;
interface pumpToEngine : FuelLine connect pump.outlet to engine.inlet;
connect pump.base to engine.foot;
flow of Fuel from fill.feed to tank.fillPoint.feed;
}
}