Convection

Gallery
Tutorial
Click on the image to view it full size
The Modelica By Example target code is:

within ModelicaByExample.Components.HeatTransfer;
model Convection "Modeling convection between port_a and port_b"
  parameter Modelica.SIunits.CoefficientOfHeatTransfer h;
  parameter Modelica.SIunits.Area A;
  Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a port_a
    annotation ...
  Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b port_b
    annotation ...
equation
  port_a.Q_flow + port_b.Q_flow = 0 "Conservation of energy";
  port_a.Q_flow = h*A*(port_a.T-port_b.T) "Heat transfer equation";
end Convection;

The block Convection exports via SysPhS to Modelica as:


model Convection
  Convection _Convection;
  model Convection
    parameter CoefficientOfHeatTransfer h;
    parameter Area a;
    HeatPortA hPA;
    HeatPortB hPB;
  equation
    hPA.hFR+hPB.hFR=0;
    hPA.hFR=h*a*(hPA.t-hPB.t);
  end Convection;
  type CoefficientOfHeatTransfer=Real(unit="W/(m2.K)");
  type Area=Real(unit="m2");
  connector HeatPortA
    extends HeatFlowElement;
  end HeatPortA;
  connector HeatPortB
    extends HeatFlowElement;
  end HeatPortB;
  connector HeatFlowElement
    flow HeatFlowRate hFR;
    Temperature t;
  end HeatFlowElement;
  type HeatFlowRate=Real(unit="J/s");
  type Temperature=Real(unit="K");
end Convection;
It will be used in various contexts later.
Up next
Notes
Snippets (quotes/extracts)
Visit also
Visit also (backlinks)
Related slides (includes other tutorials)
Related slides (backlinks, includes other tutorials)
External links