VariableThermalConductor

model VariableThermalConductor "Lumped thermal element transporting heat without storing it with variable conductance"
    input Modelica.Blocks.Interfaces.RealInput G(unit = "W/K") "Variable thermal conductance"
        annotation (Placement(
            visible = true,
            transformation(
                origin = {0, 80},
                extent = {
                    {-20, -20}, 
                    {20, 20}},
                rotation = -90),
            iconTransformation(
                origin = {0, 80},
                extent = {
                    {-20, -20}, 
                    {20, 20}},
                rotation = -90)));

    extends Modelica.Thermal.HeatTransfer.Interfaces.Element1D;
equation
    Q_flow = G * dT;

    annotation (
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Rectangle(
                    fillColor = {192, 192, 192},
                    pattern = LinePattern.None,
                    fillPattern = FillPattern.Backward,
                    extent = {
                        {-90, 70}, 
                        {90, -70}}), 
                Line(
                    points = {
                        {-90, 70}, 
                        {-90, -70}},
                    thickness = 0.5), 
                Line(
                    points = {
                        {90, 70}, 
                        {90, -70}},
                    thickness = 0.5)}),
        Diagram(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Line(
                    points = {
                        {-80, 0}, 
                        {80, 0}},
                    color = {255, 0, 0},
                    thickness = 0.5,
                    arrow = {Arrow.None, Arrow.Filled}), 
                Text(
                    lineColor = {255, 0, 0},
                    extent = {
                        {-100, -20}, 
                        {100, -40}},
                    textString = "Q_flow"), 
                Text(
                    extent = {
                        {-100, 40}, 
                        {100, 20}},
                    textString = "dT = port_a.T - port_b.T")}),
        Documentation(info = "<html>\n                <p>\n                    This is a model for transport of heat without storing it. The thermal conductance is set by an input.\n                </p></html>"));
end VariableThermalConductor;