$(instance)HeatCapacitor Icon

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:

\[C \frac{dT}{dt} = Q_{flow}\]

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

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

\[ \begin{align} T\left( t \right) &= \mathtt{node.T}\left( t \right) \\ \frac{\mathrm{d} T\left( t \right)}{\mathrm{d}t} &= \mathtt{dT}\left( t \right) \\ \mathtt{dT}\left( t \right) &= \frac{\mathtt{node.Q}\left( t \right)}{C} \end{align} \]

Source

# 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_{flow}
# ```
# 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": 400, "y1": 900, "x2": 600, "y2": 1100}}}}]
  # 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
end
Flattened Source
# 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_{flow}
# ```
# 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": 400, "y1": 900, "x2": 600, "y2": 1100}}}}]
  # 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 {}
end


Test Cases

No test cases defined.