model RelTemperatureSensor "Relative Temperature sensor"
extends Modelica.Icons.TranslationalSensor;
Interfaces.HeatPort_a port_a annotation (Placement(transformation(extent = {
{-110, -10},
{-90, 10}})));
Interfaces.HeatPort_b port_b annotation (Placement(transformation(extent = {
{90, -10},
{110, 10}})));
Modelica.Blocks.Interfaces.RealOutput T_rel(unit = "K", displayUnit = "K") "Relative temperature as output signal"
annotation (Placement(transformation(
origin = {0, -90},
extent = {
{10, -10},
{-10, 10}},
rotation = 90)));
equation
0 = port_a.Q_flow;
0 = port_b.Q_flow;
T_rel = port_a.T - port_b.T;
annotation (
Icon(
coordinateSystem(
preserveAspectRatio = true,
extent = {
{-100, -100},
{100, 100}}),
graphics = {
Line(
points = {
{-90, 0},
{-70, 0},
{-70, 0}},
color = {191, 0, 0}),
Line(
points = {
{-90, 0},
{-70, 0},
{-70, 0}},
color = {191, 0, 0}),
Line(
points = {
{70, 0},
{90, 0},
{90, 0}},
color = {191, 0, 0}),
Line(
points = {
{0, -30},
{0, -80}},
color = {0, 0, 255}),
Text(
extent = {
{-150, 80},
{150, 40}},
textString = "%name",
lineColor = {0, 0, 255}),
Text(
extent = {
{92, -62},
{34, -122}},
textString = "K")}),
Diagram(
coordinateSystem(
preserveAspectRatio = true,
extent = {
{-100, -100},
{100, 100}}),
graphics = {
Line(
points = {
{-90, 0},
{-70, 0},
{-70, 0}},
color = {191, 0, 0}),
Line(
points = {
{-98, 0},
{-70, 0},
{-70, 0}},
color = {191, 0, 0}),
Line(
points = {
{70, 0},
{94, 0},
{94, 0}},
color = {191, 0, 0}),
Line(
points = {
{0, -30},
{0, -80}},
color = {0, 0, 255}),
Text(
extent = {
{64, -74},
{32, -102}},
textString = "K")}),
Documentation(info = "<html>\n<p>\nThe relative temperature \"port_a.T - port_b.T\" is determined between\nthe two ports of this component and is provided as output signal in Kelvin.\n</p>\n</html>"));
end RelTemperatureSensor;