PrescribedTemperature

model PrescribedTemperature "Variable temperature boundary condition in degCelsius"
    Interfaces.HeatPort_b port annotation (Placement(transformation(extent = {
        {90, -10}, 
        {110, 10}})));
    Modelica.Blocks.Interfaces.RealInput T(unit = "degC") annotation (Placement(transformation(extent = {
        {-140, -20}, 
        {-100, 20}})));
equation
    port.T = Modelica.SIunits.Conversions.from_degC(T);

    annotation (
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Rectangle(
                    extent = {
                        {-100, 100}, 
                        {100, -100}},
                    pattern = LinePattern.None,
                    fillColor = {159, 159, 223},
                    fillPattern = FillPattern.Backward), 
                Line(
                    points = {
                        {-102, 0}, 
                        {64, 0}},
                    color = {191, 0, 0},
                    thickness = 0.5), 
                Text(
                    extent = {
                        {0, 0}, 
                        {-100, -100}},
                    textString = "degC"), 
                Text(
                    extent = {
                        {-150, 150}, 
                        {150, 110}},
                    textString = "%name",
                    lineColor = {0, 0, 255}), 
                Line(
                    points = {
                        {-102, 0}, 
                        {64, 0}},
                    color = {191, 0, 0},
                    thickness = 0.5), 
                Polygon(
                    points = {
                        {52, -20}, 
                        {52, 20}, 
                        {90, 0}, 
                        {52, -20}},
                    lineColor = {191, 0, 0},
                    fillColor = {191, 0, 0},
                    fillPattern = FillPattern.Solid)}),
        Documentation(info = "<html>\n<p>\nThis model represents a variable temperature boundary condition\nThe temperature value in [degC] is given by the input signal\nto the model. The effect is that an instance of this model acts as\nan infinite reservoir able to absorb or generate as much energy\nas required to keep the temperature at the specified value.\n</p>\n</html>"),
        Diagram(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Rectangle(
                    extent = {
                        {-100, 100}, 
                        {100, -100}},
                    pattern = LinePattern.None,
                    fillColor = {159, 159, 223},
                    fillPattern = FillPattern.Backward), 
                Line(
                    points = {
                        {-102, 0}, 
                        {64, 0}},
                    color = {191, 0, 0},
                    thickness = 0.5), 
                Text(
                    extent = {
                        {0, 0}, 
                        {-100, -100}},
                    textString = "degC"), 
                Polygon(
                    points = {
                        {52, -20}, 
                        {52, 20}, 
                        {90, 0}, 
                        {52, -20}},
                    lineColor = {191, 0, 0},
                    fillColor = {191, 0, 0},
                    fillPattern = FillPattern.Solid)}));
end PrescribedTemperature;