Design Principles Application
Overview
Teaching: 0 min
Exercises: 0 minQuestions
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
In general, heat conduction is governed by the partial differential (PDE)…
(1) |
where u is the temperature at spatial positions, x, and times, t, 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…
- The thermal diffusivity, , is constant for all space and time.
- The only heat source is from the initial and/or boundary conditions.
- 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
- Foward Time Centered Space (FTCS), an explicit method
- Crank-Nicholson, an implicit method
- Upwind-15, another explicit method with higher spatial order than FTCS.
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
- Components that will work for any application of heat equation
Connectivity
Connectivity – Alternative Possibility
Key Points
Understanding process of software design with a simple application