Skip to content
HeatCapacitor.md

HeatCapacitor

Lumped thermal element storing heat

Usage

HeatCapacitor(C, T0)

Parameters:

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

Connectors

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
# Lumped thermal element storing heat
component HeatCapacitor
  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
dyad
# Lumped thermal element storing heat
component HeatCapacitor
  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

This is setup code, that must be run before each test case.

julia
using ThermalComponents
using ModelingToolkit, OrdinaryDiffEqDefault
using Plots
using CSV, DataFrames

snapshotsdir = joinpath(dirname(dirname(pathof(ThermalComponents))), "test", "snapshots")
"/home/actions-runner-10/.julia/packages/ThermalComponents/uOuoD/test/snapshots"
  • Examples

  • Experiments

  • Analyses