Skip to content
LIBRARY
Interfaces.PartialHeatTransfer.md

Interfaces.PartialHeatTransfer ​

Common interface for heat transfer between distributed fluid segments and their thermal boundaries.

Extending components define the relation between the fluid temperatures, boundary temperatures, and segment heat-flow rates.

Usage ​

FluidComponents.Interfaces.PartialHeatTransfer(k, T_ambient)

Parameters: ​

NameDescriptionUnitsDefault value
medium_data–
n–
use_k–false
kW/(m2.K)
T_ambientK

Connectors ​

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

Variables ​

NameDescriptionUnits
surfaceAreasm2
Q_flowsW
TsK

Source ​

dyad
"""
Common interface for heat transfer between distributed fluid segments and
their thermal boundaries.

Extending components define the relation between the fluid temperatures,
boundary temperatures, and segment heat-flow rates.
"""
partial component PartialHeatTransfer
  # Immutable medium definition selected at model construction [-]
  structural parameter medium_data::MediaComponents.Interfaces.AbstractPartialMediumData
  # Number of heat-transfer segments [-]
  structural parameter n::Integer
  "Thermodynamic states of the fluid segments."
  states = [MediaComponents.Interfaces.ThermodynamicState(medium_data = medium_data) for i in 1:n]
  # Heat-transfer area of each segment [m2]
  variable surfaceAreas::Area[n]
  # Heat-flow rate into each fluid segment [W]
  variable Q_flows::HeatFlowRate[n]
  # Whether thermal loss to ambient is included [-]
  structural parameter use_k::Boolean = false
  # Heat-transfer coefficient to ambient [W/(m2.K)]
  parameter k::CoefficientOfHeatTransfer
  # Ambient temperature [K]
  parameter T_ambient::Temperature
  "Thermal boundary of each fluid segment."
  heatPorts = [HeatPort() for i in 1:n]
  # Fluid temperature in each segment [K]
  variable Ts::Temperature[n]
relations
  for i in 1:n
    Ts[i] = MediaComponents.Interfaces.temperature_state(medium_data, states[i].p, states[i].T, states[i].d, states[i].h, states[i].X)
  end
  if use_k
    for i in 1:n
      Q_flows[i] = heatPorts[i].Q_flow + k * surfaceAreas[i] * (T_ambient - heatPorts[i].T)
    end
  else
    for i in 1:n
      Q_flows[i] = heatPorts[i].Q_flow
    end
  end
end
Flattened Source
dyad
"""
Common interface for heat transfer between distributed fluid segments and
their thermal boundaries.

Extending components define the relation between the fluid temperatures,
boundary temperatures, and segment heat-flow rates.
"""
partial component PartialHeatTransfer
  # Immutable medium definition selected at model construction [-]
  structural parameter medium_data::MediaComponents.Interfaces.AbstractPartialMediumData
  # Number of heat-transfer segments [-]
  structural parameter n::Integer
  "Thermodynamic states of the fluid segments."
  states = [MediaComponents.Interfaces.ThermodynamicState(medium_data = medium_data) for i in 1:n]
  # Heat-transfer area of each segment [m2]
  variable surfaceAreas::Area[n]
  # Heat-flow rate into each fluid segment [W]
  variable Q_flows::HeatFlowRate[n]
  # Whether thermal loss to ambient is included [-]
  structural parameter use_k::Boolean = false
  # Heat-transfer coefficient to ambient [W/(m2.K)]
  parameter k::CoefficientOfHeatTransfer
  # Ambient temperature [K]
  parameter T_ambient::Temperature
  "Thermal boundary of each fluid segment."
  heatPorts = [HeatPort() for i in 1:n]
  # Fluid temperature in each segment [K]
  variable Ts::Temperature[n]
relations
  for i in 1:n
    Ts[i] = MediaComponents.Interfaces.temperature_state(medium_data, states[i].p, states[i].T, states[i].d, states[i].h, states[i].X)
  end
  if use_k
    for i in 1:n
      Q_flows[i] = heatPorts[i].Q_flow + k * surfaceAreas[i] * (T_ambient - heatPorts[i].T)
    end
  else
    for i in 1:n
      Q_flows[i] = heatPorts[i].Q_flow
    end
  end
metadata {}
end


Test Cases ​

No test cases defined.

  • Examples

  • Experiments

  • Analyses