Skip to content
HeatCapacitor.md

HeatCapacitor ​

Represents a lumped thermal element that stores heat energy.

This component models the thermal behavior of a body with a given heat capacity C. The temperature T of the component changes over time based on the heat flow rate Q_{flow} into the component through its thermal node. The fundamental relationship governing this behavior is:

CdTdt=Qflow

where dT/dt is the rate of change of temperature, represented by dT in the model. The component's temperature is initialized to T0.

Usage ​

ThermalComponents.HeatCapacitor(C, T0)

Parameters: ​

NameDescriptionUnitsDefault value
CHeat capacity of the elementJ/K
T0Initial temperature of the elementK

Connectors ​

  • node - This connector represents a thermal node with temperature and heat flow as the potential and flow variables, respectively. (Node)

Variables ​

NameDescriptionUnits
TTemperature of the elementK
dTTime derivative of temperature TK/s

Behavior ​

T(t)=node.T(t)dT(t)dt=dT(t)dT(t)=node.Q(t)C

Source ​

dyad
"""
Represents a lumped thermal element that stores heat energy.

This component models the thermal behavior of a body with a given heat capacity `C`.
The temperature `T` of the component changes over time based on the heat flow rate `Q_{flow}`
into the component through its thermal `node`. The fundamental relationship governing
this behavior is:

math C \frac{dT}{dt} = Q_

where `dT/dt` is the rate of change of temperature, represented by `dT` in the model.
The component's temperature is initialized to `T0`.
"""
component HeatCapacitor
  "Thermal port (connector) for heat exchange"
  node = Node() {"Dyad": {"placement": {"icon": {"x1": 450, "y1": 950, "x2": 550, "y2": 1050}}}}
  "Heat capacity of the element"
  parameter C::HeatCapacity
  "Temperature of the element"
  variable T::Temperature
  "Initial temperature of the element"
  parameter T0::Temperature
  "Time derivative of temperature `T`"
  variable dT::TemperatureSlope
relations
  initial T = T0
  T = node.T
  der(T) = dT
  dT = node.Q / C
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://ThermalComponents/HeatCapacitor.svg"}
  }
}
end
Flattened Source
dyad
"""
Represents a lumped thermal element that stores heat energy.

This component models the thermal behavior of a body with a given heat capacity `C`.
The temperature `T` of the component changes over time based on the heat flow rate `Q_{flow}`
into the component through its thermal `node`. The fundamental relationship governing
this behavior is:

math C \frac{dT}{dt} = Q_

where `dT/dt` is the rate of change of temperature, represented by `dT` in the model.
The component's temperature is initialized to `T0`.
"""
component HeatCapacitor
  "Thermal port (connector) for heat exchange"
  node = Node() {"Dyad": {"placement": {"icon": {"x1": 450, "y1": 950, "x2": 550, "y2": 1050}}}}
  "Heat capacity of the element"
  parameter C::HeatCapacity
  "Temperature of the element"
  variable T::Temperature
  "Initial temperature of the element"
  parameter T0::Temperature
  "Time derivative of temperature `T`"
  variable dT::TemperatureSlope
relations
  initial T = T0
  T = node.T
  der(T) = dT
  dT = node.Q / C
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://ThermalComponents/HeatCapacitor.svg"}
  }
}
end


Test Cases ​

No test cases defined.