I need help with a cfd homework

profileMEEN
cwk_adeqn_v2.pdf

CFD Advection-Diffusion Equation - 1 David Apsley

ADVECTION-DIFFUSION EQUATION SPRING 2008 1. Notes on the program 2. Assigned exercises 1. NOTES ON THE PROGRAM 1.1 Accessing the Program Download the program file adeqn.exe from the web page for this module. Copy this file to, and run the program from, a folder to which you have write access on the hard disk (not a pen drive, nor your P: drive). The program requires the run-time dynamic link libraries (DLLs) for Salford Fortran to be installed on the computer. This is the case in all the University public clusters. 1.2 Equation to be Solved The program solves the 1-d advection-diffusion equation

S x

AuA x

=φ−φ ) d

d��( d

d

on the interval [0, L], for various types of source S(x). φ is specified at x = 0, whilst either φ or dφ/dx may be specified at x = L. The equation can also be written in integral form:

� �

�=�� �

��

φ−φ e

w

e

w

xS x

AuA d d

d��

i.e. sourcefluxflux we =− for any subinterval [w,e]. 1.3 Parameters � , u, A, � and L are constants with the usual meanings and (mainly obvious) restrictions: � , A, L > 0; � > 0; u � 0. S is the source per unit length (“source density” ). The program allows it to be of the form )(

� 10 ptpt xxSSSS −+φ+=

where each of S0, S1 and Spt are constants. This is just a fancy way of combining three types of source term: • a constant part S0; • a solution-dependent part S1φ , where, for stability, we require 01 ≤S ; • )(

� ptpt xxS − ; shorthand for “a point source of size Spt at location xpt” .

Ilyas
Line
Ilyas
Line
Ilyas
Line
Ilyas
Line
Ilyas
Line
Ilyas
Line
Ilyas
Line
Ilyas
Line
Ilyas
Cross-Out
Ilyas
Typewritten Text
If "adeqn.exe" dos not work, * first, install the following free program on your computer : https://www.silverfrost.com/32/ftn95/ftn95_personal_edition.aspx
Ilyas
Typewritten Text

CFD Advection-Diffusion Equation - 2 David Apsley

1.4 Running the Program The program may be started either by entering adeqn in a command window, or by double- clicking its icon in, e.g, Windows explorer. (Note: in the University clusters, both the Command Window and Windows Explorer must be started from the Salford Software Program Group for this to work.) Most of the work can be done by clicking buttons, or filling in menus. The main button classes are: set-up – sets up one of 4 pre-defined cases; edit – change a default set-up (or begin an entirely new case); solve/plot – self-explanatory; save – saves solution (with a . dat extension) or plot (with a . pcx extension) Some logic has been implemented – certain buttons remain greyed out and non-functional until the necessary previous steps have been performed. For example, one can’ t edit or solve until a case has been set-up, and one can’ t plot until a case has been solved successfully. This logic can be over-ridden by using the “pull-down” menus. Since all button functions communicate with each other by reading or writing files the program can be re-started from a previous run without having to change all parameters again. [ Edi t Par amet er s] – [ Equat i on] Clicking this button allows the user to set the following equation and solution parameters. Name Parameter Restrictions RHO � , density > 0 U u, velocity ≥ 0 GAMMA � , diffusivity > 0 S0 S0, constant part of source density S1 S1, solution-dependent source density ≤ 0 SPT Spt, point-source strength XPT xpt, location of point source AREA A, area > 0 L L, length of domain > 0 Boundary condition at x = 0 VALUE (hard-wired) Boundary condition at x = L VALUE or DERI V Value of φ at x = 0 Value of φ or dφ/dx at x = L Number of control volumes > 0 (integer) Advection scheme UPWI ND, CENTRAL, HYBRI D, QUI CK,

UMI ST or VANLEER Under-relaxation factor 0 < under-relaxation factor ≤ 1 Maximum iterations > 0 (integer)

Ilyas
Line
Ilyas
Cross-Out

CFD Advection-Diffusion Equation - 3 David Apsley

1.5 Pre-Defined Test Cases Case 1 – pure diffusion Insulated rod; temperature fixed at both ends (see Notes 4, page 4).

0) d

d (

d

d =− x

T kA

x , T(0) = 100, T(1) = 500

k = 1000 W m–1 K–1; A = 10–4 m2. Case 2 – diffusion + sources Cooled rod, losing heat at a rate proportional to the temperature difference with its surrounds (see Notes 4, page 5).

)() d

d (

d

d ∞−−=− TTcx

T kA

x , T(0) = 100, 0)1(

d

d = x

T

k = 1000 W m–1 K–1; c = 2.5 W m–1 K–1; T∞ = 20º C; A = 10–4 m2. Case 3 – advection-diffusion without sources Concentration, with values fixed at both ends.

0)1(,1)0(,0) d

d��( d

d =φ=φ=φ−φ x

AuA x

Non-dimensional variables: � = 1; u = 1; A = 1; � = 0.05. The default is a central-differencing advection scheme, with 5 control volumes. Case 4 – advection-diffusion with point source and losses (See Notes 4, page 8).

0)1( d

d ,0)0(,)(

��) d

d��( d

d 2 1 =φ=φ−+φ−=φ−φ

x xQ

x AuA

x I

φ is concentration (mass per mass of fluid). � = 1000 kg m–3; u = 0.1 m s–1; � = 0.1 kg m–1 s–1; A = 0.01 m2; L = 1 m; � = 0.5 kg m–1 s–1; QI = 0.01 kg s

–1. The default is a central-differencing advection scheme with 7 control volumes 1.6 Miscellany I have tried to make the program flag any unreasonable data (e.g. negative density). However, I don’ t guarantee to have checked every conceivable error … The graphics parameters should have been set up satisfactorily for each pre-defined case. If you wish, you can alter them using the [ Edi t Par amet er s] – [ Gr aphi cs] button. You might be able to import the . pcx plot files directly into Wor d. Alternatively, use the [ Save t o c l i pboar d] button.

x= L

point source

uφ=0 φ=0ddx 0

0 1

T=100 C T=500 Co o

Rod

x=

0 1

T=100 Co

Rod dT dx =0

T =20 C o

S=-c(T-T )oo

oo

Ilyas
Line

CFD Advection-Diffusion Equation - 4 David Apsley

2. ASSIGNED EXERCISES The assigned exercises use the pre-defined test cases 2, 3 and 4. You should note the definitions of these in Part 1 before doing this assignment. Case 2 (a) Set up case 2; solve and plot. Save plot and data files and include them in your report. (b) Describe the main features of the solution and give physical reasons for its shape. (c) Edit the equation parameters to solve on meshes of 5, 10, 50 and 100 control volumes. Tabulate the maximum absolute error for each. Plot a graph of log10(max|error|) against log10(� x). Is this consistent with an order-2 numerical method? Consider also this last question if you ignore the two coarsest-grid solutions (5 and 10 control volumes). (d) Using the cell-centre values for the numerical solution with 5 control volumes, calculate the total rate of heat loss from the rod. Show that this can also be obtained from the end fluxes only, and confirm that the two methods yield the same results. Case 3 (a) Set up case 3. Solve for central differencing (the default), upwind differencing and Van Leer advection schemes with 5 control volumes. Include a plot of each in your report. Comment on the relative performance of these advection schemes. (b) For the central differencing scheme with 5 control volumes, calculate the cell Peclet number (ref: notes, Section 4.9.1). Is this within the range for which the central-differencing scheme is bounded? How many cells would be needed to give a Peclet number of 1.0? Compute the solution with this Peclet number and include the plot in your report. Case 4 (a) Set up and solve with 7 control volumes. Run with central, upwind, QUICK and UMIST advection schemes (Note part (ii) below for the last of these schemes). Include the plots and comment on whether the solutions obtained with each are physically realistic. (b) For the UMIST scheme you will have to reduce the under-relaxation parameter. State the value that you have used to get a converged solution. Why is under-relaxation used and what difference it makes to the final solution? (ref: notes, Section 4.16). (c) For each of the four advection schemes used in part (i) state whether it is bounded and/or transportive (ref: notes, Sections 4.9-4.12). (d) For the central differencing scheme, how many control volumes are required to give a cell Peclet number ≤ 2? Comment on the relative effectiveness of central differencing compared with a flux-limited scheme like UMIST in this case.

Ilyas
Rectangle
Ilyas
Rectangle
Ilyas
Rectangle
Ilyas
Rectangle
Ilyas
Line
Ilyas
Line
Ilyas
Line
Ilyas
Cross-Out
Ilyas
Cross-Out
Ilyas
Cross-Out
Ilyas
Cross-Out
Ilyas
Cross-Out