Skip to content
Element1D.md

Element1D

This partial model contains the basic connectors and variables to allow heat transfer models to be created that do not store energy. This model defines and includes equations for the temperature drop across the element, dT, and the heat flow rate through the element from node_a to node_b, Q.

Usage

Element1D()

Connectors

Variables

NameDescriptionUnits
ΔTK
QW

Source

dyad
# This partial model contains the basic connectors and variables to allow heat transfer models to be created that do not
# store energy. This model defines and includes equations for the temperature drop across the element, `dT`, and the heat
# flow rate through the element from `node_a` to `node_b`, `Q`.
partial component Element1D
  node_a = Node() [{
    "Dyad": {
      "placement": {"icon": {"iconName": "node_a", "x1": -100, "y1": 400, "x2": 100, "y2": 600}}
    }
  }]
  node_b = Node() [{
    "Dyad": {
      "placement": {"icon": {"iconName": "node_b", "x1": 900, "y1": 400, "x2": 1100, "y2": 600}}
    }
  }]
  variable ΔT::Temperature
  variable Q::HeatFlowRate
relations
  ΔT = node_a.T-node_b.T
  node_a.Q = Q
  node_a.Q+node_b.Q = 0
end
Flattened Source
dyad
# This partial model contains the basic connectors and variables to allow heat transfer models to be created that do not
# store energy. This model defines and includes equations for the temperature drop across the element, `dT`, and the heat
# flow rate through the element from `node_a` to `node_b`, `Q`.
partial component Element1D
  node_a = Node() [{
    "Dyad": {
      "placement": {"icon": {"iconName": "node_a", "x1": -100, "y1": 400, "x2": 100, "y2": 600}}
    }
  }]
  node_b = Node() [{
    "Dyad": {
      "placement": {"icon": {"iconName": "node_b", "x1": 900, "y1": 400, "x2": 1100, "y2": 600}}
    }
  }]
  variable ΔT::Temperature
  variable Q::HeatFlowRate
relations
  ΔT = node_a.T-node_b.T
  node_a.Q = Q
  node_a.Q+node_b.Q = 0
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