Design Principles Application

Last updated on 2025-05-12 | Edit this page

Overview

Questions

  • What are some ways of using these principles

Objectives

  • Work through a simple example

Example 1 – Problem Description

We have a house with exterior walls made of single material of thickness \(Lx\). The wall has some water pipes shown in the picture. The inside temperature is kept at 70 degrees. But outside temperature is expected to be -40 degrees for 15.5 hours.

The question we are trying to answer is – will the pipes freeze before the storm is over

example1

In general, heat conduction is governed by the partial differential (PDE)…

(1)

where \(u\) is the temperature at spatial positions, \(x\), and times, \(t\), \(\alpha\) is the thermal diffusivity of the homogeneous material through which heat is flowing. This partial differential equation (PDE) is known as the Diffusion Equation and also the Heat Equation.

Simplifying Assumptions

To make the problem tractable for this lesson, we make some simplifying assumptions…

  1. The thermal diffusivity, \(\alpha\), is constant for all space and time.
  2. The only heat source is from the initial and/or boundary conditions.
  3. We will deal only with the one dimensional problem in Cartesian coordinates.

In this case, the PDE our application needs to solve simplifies to…

(2)

The code in the repository has three different numerical algorithms

We will work through one of them – FTCS

Requirement gathering

  • To solve heat equation we need:
    • a discretization scheme
    • a driver for running and book-keeping
    • an integration method to evolve solution
    • Initial conditions
    • Boundary conditions
  • To make sure that we are doing it correctly we need:
    • Ways to inspect the results
    • Ways of verification

Decomposition

  • This is a small design space
  • Several requirements can directly map to components – in this instance functions
    • Driver
    • Initialization – data containers
    • Mesh initialization – applying initial conditions
    • Integrator
    • I/O
    • Boundary conditions
    • Comparison utility
  • Binning components
    • Components that will work for any application of heat equation
      • Driver
      • Initialization – data containers
      • I/O
      • Comparison utility
    • Components that are application specific
      • Mesh initialization – applying initial conditions
      • Integrator
      • Boundary conditions

Connectivity

placeholder alt text

Connectivity – Alternative Possibility

placeholder alt text

Key Points

  • Understanding process of software design with a simple application