RelativePressure

model RelativePressure "Ideal relative pressure sensor"
    extends Sensors.BaseClasses.PartialRelativeSensor;

    Modelica.Blocks.Interfaces.RealOutput p_rel(final quantity = "Pressure", final unit = "Pa", displayUnit = "bar") "Relative pressure signal"
        annotation (Placement(transformation(
            origin = {0, -90},
            extent = {
                {10, -10}, 
                {-10, 10}},
            rotation = 90)));
equation
    p_rel = port_a.p - port_b.p;

    annotation (
        Icon(graphics = {
            Line(
                points = {
                    {0, -30}, 
                    {0, -80}},
                color = {0, 0, 127}), 
            Text(
                extent = {
                    {130, -70}, 
                    {4, -100}},
                textString = "p_rel")}),
        Documentation(info = "<html>\n<p>\nThe relative pressure \"port_a.p - port_b.p\" is determined between\nthe two ports of this component and is provided as output signal. The\nsensor should be connected in parallel with other equipment, no flow\nthrough the sensor is allowed.\n</p>\n</html>"));
end RelativePressure;