Sie sind auf Seite 1von 6

Assignment 2

MEC4045F HBSJOS001 Author: Joshua Hobson

23rd May 2013

Plagiarism Declaration
1. I know that plagiarism is wrong. Plagiarism is to use anothers work and pretend that is ones own. 2. Each signicant contribution to, and quotation in, this report from the work of other people has been attributed, and has been cited and referenced. 3. This assignment is my own work. 4. I have not allowed, and will not allow, anyone to copy my work with the intention of passing it o as his or her own work.

Signature:

Derivation of equations used

The governing equation for this particular problem is ux + x x x

0 =

(1)

Higher-order upwinding was used to discretise the advection term. This invloved use of the -scheme to nd |fL and |fR . To take into account the non-equispaced mesh imaginary nodes were introduced, namely uu and u . Figure 1 shows the diagram used to visualise the dicretisation, along with the imaginary nodes.

Figure 1: Nodes used for dicretising

The following equations show the dicretisation to the advection term, as the remaining terms did not change from that displayed in assignment 1. ux ux T nx dA dv = x Ai ux A(|fR |fL )

(2) (3)

vi

|fR M + |fL

1+ (D U ) 1 (D M ) + M D + 2(xD xM ) 4 4 (xD xU ) 1+ 1 (M U U ) U + (M U ) + U M + 2(xM xU ) 4 4 (xM xU U )

(4) (5)

Substituting (4),(5) into (3) the advection term was formed. This was then rearranged into the form where M = i, D = i + 1, U = i 1 and U U = i 2. The resulting expression was rearranged so that expression for each node was found. This was then coded into MATLAB.

Matlab code

The MATLAB code from assignment 1 was modied to adding in the new discretised expression for the advection term. Varies values for were run in the code so that the QUICK, CUI and Central Dierence Scheme could be seen. All code can be seen in the appendix.

Results

For 6 nodes and a growth factor of 0.9 the graphs for the CUI,QUICK and CDS were plotted. The following gures show the results

(a) = 0.5 for QUICK method

(b) = 1 for CDS method

(c) =

1 for CUI method 3

Figure 2: Results for n=6 and growth factor=1.09

From these graphs it can be seen that the Central Dierence scheme gives the highest error, followed by the QUICK method. Both these methods give errors greater than 1%. While the 2

CUI method achieves an error of less than 1%, which was the goal for this code. It is worth noting that the QUICK method had a maximum error of 4% while the CDS method had an error of approximately 17%. This shows that the CDS method can not get near the accuracy achieved by that of the QUICK and CUI methods for a given set of nodes, which is to be expected as the QUICK is a second order accurate method. While the CUI is a third order accurate method. Comparing the results from this assignment with that of assignment 1, it can be noted that the the required number of nodes has decreased by more than a factor of 10. This would represent massive computational time and cost savings if this mesh was used on a much larger scale. A similar argument could be used to say that the CUI method is far better than the QUICK and CDS methods. To decrease the error on those two cases the number of nodes would need to be increased, which would increase computational time and expense. This can be seen in the following gure where the CDS method was used on a mesh of 10 nodes and a growth factor of 1.05. From gure 3 the error has been reduced to approximately 7%, which is a large decrease from 17% as seen earlier.

Figure 3: Results for CDS method, where n=10 and growth factor=1.05

Appendix

Das könnte Ihnen auch gefallen