MSc in CSTE Computational Methods
Irene Moulitsas Cranfield University
October 7, 2019
Hand in date: 09/12/19 (FT), 20/12/19 (PT), 09:30am
1 Introduction
In this assignment you are asked to examine the application of numerical schemes for the solution of partial differential equations as discussed in the Computa- tional Methods lectures, using C++ Object Oriented and other programming practices discussed in the C++ lectures. In order to do this, we will consider the following problem.
A wall 31cm thick and infinite in other directions (see Figure 1) has an initial uniform temperature Tin of 38◦C. The surface temperatures Tsur at the two sides are suddenly increased and maintained at 149◦C. The wall is composed of nickel steel (40% Ni) with a diffusivity of D = 93 cm2/hr. Please compute the temperature distribution within the wall as a function of time.
The governing equation to be solved is the unsteady one-space dimensional heat conduction equation, which in Cartesian coordinates is:
∂T =D∂2T ∂t ∂x2
2 Tasks
1. Write a C++ program which solves the above problem on a uniform grid with the prescribed initial and boundary conditions using the following methods:
• DuFort-Frankel
• Richardson (Central time, central space, explicit)
• Laasonen Simple Implicit (Forward time, central space, implicit)
1
T_sur T_sur
x=0 x=L
Figure 1: Nomeclature and Problem Domain
• Crank-Nicholson (Trapezoidal)
For each method you may assume that ∆x = 0.05 and ∆t = 0.01
2. The analytical solution of this problem, subject to the imposed initial and boundary conditions, is
T = Tsur + 2(Tin − Tsur)
m=∞
m=1
e
−D(mπ/L)2t
1 − (−1)m mπx mπ sin L
T_in
Use the analytical solution to compare/validate the results of the above numerical methods. Comparisons should be both qualitative and quanti- tative.
In all cases the solution is to be printed and plotted for all x locations every 0.1hrs time intervals from 0.0 to 0.5hrs.
3. Investigate the effect of step size on the accuracy of the solution and required computation time of an implicit method, using the Laasonen simple implicit method, with the following time steps sizes:
• ∆t = 0.01 • ∆t = 0.025 • ∆t = 0.05 • ∆t=0.1
For all cases assume ∆x = 0.05.
2
4. Explain the behaviour of the solutions of the above numerical methods in terms of the expected properties of the numerical methods involved. In particular for the Richardson method, study the accuracy and stability properties in depth and include your detailed mathematical calculations in the Appendix of your report.
Think about the design of your solution before jumping into coding. Remember there is no right or wrong answer when it comes to the design but there are better and worse designs. In terms of software, you are aiming for a clean and effective solution to the problem.
3 Source Code and Report Requirements
The source code must compile on the IT lab PCs using Visual Studio or Intel compilers on Linux, without any other external dependencies/libraries/source codes of third parties.
Write a report to present and discuss your findings. The report should be no less than 2,000 words and must not exceed 4,000 words. The report can contain any number of figures/tables, however all figures/tables should be numbered and discussed. The report should include a description of the design of your solution. The source code should be included as an Appendix to the report. The report should finally contain an Appendix, called Individual Contributions, where each group member will present their opinion of the contribution of every group member towards this assessment.
4 Assignment Submission
The source code should be submitted electronically via the Blackboard sub- mission point by 9:30am on the 9th December (full-time students) or the 20th December (part-time students).
The report should be submitted electronically via the TurnItInUK sub- mission point by the prescribed deadline, for the assignment submission to be considered complete.
This is a group assessment, only one submission per group is required.
5 Marking
The assignment will be assessed based on the following marking scheme: • 20% Introduction, methodology, conclusions
• 40% Source code
• 30% Analysis of the results and derivation of theoretical properties • 10% Report structure, presentation, references
3
6 References
1. K.A. Hoffmann and S.T. Chiang, ‘Computational Fluid Dynamics’, Fourth Edition, Vol. I, Engineering Education System Books, pp. 486, 2000.
2. S. Scott Collis, ‘An Introduction to Numerical Analysis for Computa- tional Fluid Dynamics’, Technical Report SAND2005-2745, Sandia Na- tional Laboratories, 2005.
Links to the following two documents can be found on the C++ BB page under external links:
3. Pras Pathmanathan, ‘Numerical Methods and Object-oriented Design’. 4. Dr O Gloth, ‘Object Oriented Techniques and Numerics’.
4