Skip to content
PrescribedHeatFlow.md

PrescribedHeatFlow

Prescribed heat flow boundary condition.

This model allows a specified amount of heat flow rate to be "injected" into a thermal system at a given port. The amount of heat is given by the input signal Q_flow into the model. The heat flows into the component to which the component PrescribedHeatFlow is connected, if the input signal is positive. If parameter alpha is > 0, the heat flow is multiplied by 1 + alpha*(port.T - T_ref) in order to simulate temperature dependent losses.

Usage

PrescribedHeatFlow(T_ref=293.15, alpha=0.0)

Parameters:

NameDescriptionUnitsDefault value
T_refReference temperatureK293.15
alphaTemperature coefficient of heat flow rate1/K0

Connectors

  • node - (Node)

  • Q_flow - This connector represents a real signal as an input to a component (RealInput)

Behavior

node.Q(t)=(1+(T_ref+node.T(t))alpha)Q_flow(t)

Source

dyad
# Prescribed heat flow boundary condition.
#
# This model allows a specified amount of heat flow rate to be "injected" into a
# thermal system at a given port. The amount of heat is given by the input signal
# `Q_flow` into the model. The heat flows into the component to which the component
# `PrescribedHeatFlow` is connected, if the input signal is positive. If parameter
# alpha is > 0, the heat flow is multiplied by `1 + alpha*(port.T - T_ref`) in order
# to simulate temperature dependent losses.
component PrescribedHeatFlow
  node = Node() [{
    "Dyad": {
      "placement": {"icon": {"iconName": "node_b", "x1": 900, "y1": 400, "x2": 1100, "y2": 600}}
    }
  }]
  Q_flow = RealInput() [{"Dyad": {"placement": {"icon": {"x1": -100, "y1": 400, "x2": 100, "y2": 600}}}}]
  # Reference temperature
  parameter T_ref::Temperature = 293.15
  # Temperature coefficient of heat flow rate
  parameter alpha::LinearTemperatureCoefficient = 0.0
relations
  node.Q = -Q_flow*(1+alpha*(node.T-T_ref))
end
Flattened Source
dyad
# Prescribed heat flow boundary condition.
#
# This model allows a specified amount of heat flow rate to be "injected" into a
# thermal system at a given port. The amount of heat is given by the input signal
# `Q_flow` into the model. The heat flows into the component to which the component
# `PrescribedHeatFlow` is connected, if the input signal is positive. If parameter
# alpha is > 0, the heat flow is multiplied by `1 + alpha*(port.T - T_ref`) in order
# to simulate temperature dependent losses.
component PrescribedHeatFlow
  node = Node() [{
    "Dyad": {
      "placement": {"icon": {"iconName": "node_b", "x1": 900, "y1": 400, "x2": 1100, "y2": 600}}
    }
  }]
  Q_flow = RealInput() [{"Dyad": {"placement": {"icon": {"x1": -100, "y1": 400, "x2": 100, "y2": 600}}}}]
  # Reference temperature
  parameter T_ref::Temperature = 293.15
  # Temperature coefficient of heat flow rate
  parameter alpha::LinearTemperatureCoefficient = 0.0
relations
  node.Q = -Q_flow*(1+alpha*(node.T-T_ref))
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