Learn about Webel's comprehensive SysMLv2 Workshop Seminar course!
Webel now has a SysMLv2 Online Self-Study course with self-test Quizzes!
Learn about the Webel Q&A online self-testing system for SysML v2/v1
Learn about the Webel SysMLv2 Ports audio mixer case study course module!

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)
Related slides (includes other tutorials)
Related slides (backlinks, includes other tutorials)
Visit also
Visit also (backlinks)
External links