Examples.HeatExchanger.BaseClasses.WallConstProps ​
Pipe wall with lumped thermal capacitance, one-dimensional heat conduction, and constant material properties.
The wall is divided into segments matching the connected fluid volumes. Each segment stores thermal energy at its mean temperature and conducts heat from both boundary surfaces through half of the wall thickness.
Usage ​
FluidComponents.Examples.HeatExchanger.BaseClasses.WallConstProps(s, area_h, rho_wall, c_wall, k_wall, m=fill(rho_wall * area_h * s / n, n), T_start, dT)
Parameters: ​
| Name | Description | Units | Default value |
|---|---|---|---|
n | – | ||
energyDynamics | – | ||
s | m | ||
area_h | m2 | ||
rho_wall | kg/m3 | ||
c_wall | J/(kg.K) | ||
k_wall | W/(m.K) | ||
m | kg | fill(rho_wa...* s / n, n) | |
T_start | K | ||
dT | K |
Connectors ​
heatPort_a- This connector represents a thermal port with temperature and heat flow as the potential and flow variables, respectively. (HeatPort)heatPort_b- This connector represents a thermal port with temperature and heat flow as the potential and flow variables, respectively. (HeatPort)
Variables ​
| Name | Description | Units |
|---|---|---|
Tb | K | |
Ta | K | |
T | K |
Behavior ​
This component has required parameters without default values, so it is not constructed here; see the Parameters table.
Source ​
"""
Pipe wall with lumped thermal capacitance, one-dimensional heat conduction,
and constant material properties.
The wall is divided into segments matching the connected fluid volumes. Each
segment stores thermal energy at its mean temperature and conducts heat from
both boundary surfaces through half of the wall thickness.
"""
component WallConstProps
# Number of wall segments [-]
structural parameter n::Integer(min = 1)
# Wall thickness [m]
parameter s::Length
# Total heat-transfer area [m2]
parameter area_h::Area
# Wall-material density [kg/m3]
parameter rho_wall::Density
# Wall-material specific heat capacity [J/(kg.K)]
parameter c_wall::SpecificHeatCapacity
# Wall-material thermal conductivity [W/(m.K)]
parameter k_wall::ThermalConductivity
# Wall mass assigned to each segment [kg]
parameter m::Mass[n] = fill(rho_wall * area_h * s / n, n)
# Formulation of the wall energy balance [-]
structural parameter energyDynamics::FluidComponents.Types.Dynamics
# Start value of the wall temperature [K]
parameter T_start::Temperature
# Start value of the temperature difference from side a to side b [K]
parameter dT::TemperatureDifference
# Temperature at boundary side b [K]
variable Tb::Temperature[n]
# Temperature at boundary side a [K]
variable Ta::Temperature[n]
# Mean wall temperature [K]
variable T::Temperature(statePriority = 1)[n]
"Thermal boundary at side a of each wall segment."
heatPort_a = [HeatPort() for i in 1:n] {
"Dyad": {
"placement": {
"icon": {"iconName": "default", "x1": 400, "y1": 200, "x2": 600, "y2": 300, "rot": 0}
}
}
}
"Thermal boundary at side b of each wall segment."
heatPort_b = [HeatPort() for i in 1:n] {
"Dyad": {
"placement": {
"icon": {"iconName": "default", "x1": 400, "y1": 700, "x2": 600, "y2": 800, "rot": 0}
}
}
}
relations
guess Tb = fill(T_start + 0.5 * dT, n)
guess Ta = fill(T_start - 0.5 * dT, n)
guess T = fill(T_start, n)
for i in 1:n
if case(energyDynamics, FluidComponents.Types.Dynamics.SteadyState)
0 = heatPort_a[i].Q_flow + heatPort_b[i].Q_flow
else
c_wall * m[i] * der(T[i]) = heatPort_a[i].Q_flow + heatPort_b[i].Q_flow
end
heatPort_a[i].Q_flow = 2 * k_wall / s * (Ta[i] - T[i]) * area_h / n
heatPort_b[i].Q_flow = 2 * k_wall / s * (Tb[i] - T[i]) * area_h / n
Ta[i] = heatPort_a[i].T
Tb[i] = heatPort_b[i].T
end
if case(energyDynamics, FluidComponents.Types.Dynamics.SteadyStateInitial)
for i in 1:n
initial der(T[i]) = 0
end
end
if case(energyDynamics, FluidComponents.Types.Dynamics.FixedInitial)
for i in 1:n
initial T[i] = T_start
end
end
metadata {
"Dyad": {
"labels": [{"label": "$(instance)", "x": 500, "y": 500, "rot": 0, "layer": "icon"}],
"icons": {"default": "dyad://FluidComponents/icons/WallConstProps.svg"}
}
}
endFlattened Source
"""
Pipe wall with lumped thermal capacitance, one-dimensional heat conduction,
and constant material properties.
The wall is divided into segments matching the connected fluid volumes. Each
segment stores thermal energy at its mean temperature and conducts heat from
both boundary surfaces through half of the wall thickness.
"""
component WallConstProps
# Number of wall segments [-]
structural parameter n::Integer(min = 1)
# Wall thickness [m]
parameter s::Length
# Total heat-transfer area [m2]
parameter area_h::Area
# Wall-material density [kg/m3]
parameter rho_wall::Density
# Wall-material specific heat capacity [J/(kg.K)]
parameter c_wall::SpecificHeatCapacity
# Wall-material thermal conductivity [W/(m.K)]
parameter k_wall::ThermalConductivity
# Wall mass assigned to each segment [kg]
parameter m::Mass[n] = fill(rho_wall * area_h * s / n, n)
# Formulation of the wall energy balance [-]
structural parameter energyDynamics::FluidComponents.Types.Dynamics
# Start value of the wall temperature [K]
parameter T_start::Temperature
# Start value of the temperature difference from side a to side b [K]
parameter dT::TemperatureDifference
# Temperature at boundary side b [K]
variable Tb::Temperature[n]
# Temperature at boundary side a [K]
variable Ta::Temperature[n]
# Mean wall temperature [K]
variable T::Temperature(statePriority = 1)[n]
"Thermal boundary at side a of each wall segment."
heatPort_a = [HeatPort() for i in 1:n] {
"Dyad": {
"placement": {
"icon": {"iconName": "default", "x1": 400, "y1": 200, "x2": 600, "y2": 300, "rot": 0}
}
}
}
"Thermal boundary at side b of each wall segment."
heatPort_b = [HeatPort() for i in 1:n] {
"Dyad": {
"placement": {
"icon": {"iconName": "default", "x1": 400, "y1": 700, "x2": 600, "y2": 800, "rot": 0}
}
}
}
relations
guess Tb = fill(T_start + 0.5 * dT, n)
guess Ta = fill(T_start - 0.5 * dT, n)
guess T = fill(T_start, n)
for i in 1:n
if case(energyDynamics, FluidComponents.Types.Dynamics.SteadyState)
0 = heatPort_a[i].Q_flow + heatPort_b[i].Q_flow
else
c_wall * m[i] * der(T[i]) = heatPort_a[i].Q_flow + heatPort_b[i].Q_flow
end
heatPort_a[i].Q_flow = 2 * k_wall / s * (Ta[i] - T[i]) * area_h / n
heatPort_b[i].Q_flow = 2 * k_wall / s * (Tb[i] - T[i]) * area_h / n
Ta[i] = heatPort_a[i].T
Tb[i] = heatPort_b[i].T
end
if case(energyDynamics, FluidComponents.Types.Dynamics.SteadyStateInitial)
for i in 1:n
initial der(T[i]) = 0
end
end
if case(energyDynamics, FluidComponents.Types.Dynamics.FixedInitial)
for i in 1:n
initial T[i] = T_start
end
end
metadata {
"Dyad": {
"labels": [{"label": "$(instance)", "x": 500, "y": 500, "rot": 0, "layer": "icon"}],
"icons": {"default": "dyad://FluidComponents/icons/WallConstProps.svg"}
}
}
endTest Cases ​
No test cases defined.
Related ​
Examples
Experiments
Analyses