---
url: /dyad/dev/stdlib/FluidComponents/components/Examples.HeatExchanger.BaseClasses.WallConstProps.md
description: >-
  Dyad Examples.HeatExchanger.BaseClasses.WallConstProps docs.  Pipe wall with
  lumped thermal capacitance, one-dimensional heat conduction, and constant
  material properties.
---

# `Examples.HeatExchanger.BaseClasses.WallConstProps` {#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 {#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: {#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 {#Connectors}

* `heatPort_a` - This connector represents a thermal port with temperature and heat flow as the potential and flow variables, respectively. ([`HeatPort`](/stdlib/Dyad/connectors/HeatPort#HeatPort))

* `heatPort_b` - This connector represents a thermal port with temperature and heat flow as the potential and flow variables, respectively. ([`HeatPort`](/stdlib/Dyad/connectors/HeatPort#HeatPort))

## Variables {#Variables}

| Name | Description | Units |
| ----:| -----------:| -----:|
| `Tb` |             |     K |
| `Ta` |             |     K |
|  `T` |             |     K |

## Behavior {#Behavior}

## Source {#Source}

```dyad
"""
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"}
  }
}
end
```

```dyad
"""
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"}
  }
}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses
