aPSE Primer, ES 552w
Instructor: Dr. A.J. Baker
Author: Shawn Ericson
Date: 11/10/01
Introduction By now most of you will have completed ES 551w, and are familiar with constructing FE GWS templates in Matlab. The following discussion is a brief primer on the corresponding construction of aPSE templates and their associated input data (called a "model file").
A. Preparing Unix and Organization
1. Setting up log in account (taken from the aPSE toolbox)
To execute the labs for 552w in aPSE, you have to set up your region (SUN-account) suitably to handle it.
a. First things first ! Modify your .cshrc file. Bring it up by whichever editor you use, and then add the following 7 lines after your last "set path" line.
# Add the following 6 lines to your
# .cshrc file after your last 'set path' line.
setenv APSE_HOME /cfd3/jorzecho/APSE
set locapse = $APSE_HOME/APSE10
set apsepath = ($APSE_HOME \
$APSE_HOME/PROBLEMS \
$locapse $locapse/comlib $locapse/param \
$locapse/prepro )
set path = ($path $apsepath)
Note: Remember to "source" the .cshrc file after you modify it!
b. Next, type menu at the command line. If you see the following, your path's set all right.
bogue:/u3/chambers % menu
Choose a PROBLEM:
(1) 552W
(2) 651
(3) Quit
PROBLEM:
Select 10 as you are in 552w and hit return.
Choose a(n) 552W MODEL:
(1) LAB2 1D Unsteady Diffusion 17x1
(2) LAB3A 2D Laminar flow 65x1
(3) LAB3B 2D Bradshaw Mixing Length 51x1
(4) LAB3C 2D Bradshaw K-E model 51x1
(5) LAB4A 2D Driven Cavity (GWS) 17x17
(6) LAB4A 2D Driven Cavity (GWS) 33x33
(7) LAB4B 2D Driven Cavity (TWS) 17x17
(8) LAB4B 2D Driven Cavity (TWS) 33x33
(9) LAB5 2D Omega - Psi 17x17
(10) LAB6A 2D Tensor product u,v,t 33x33
(11) LAB6B 2D Newton iteration 33x33
(12) LAB6C 2D Tensor Product phi with k eps 33x33
(13) LAB6D 2D Newton u, v, t, phi combined 33x33
(14) LAB7 2D Rearward Facing Step 80x33
(15) LAB8A 1D WAVE GMP 41x1
(16) LAB8B 1D WAVE TWS 41x1
(17) LAB9 1D Steady Diffusion (PECLET) 21x1
(18) Quit
MODEL:
c. Now to get to the particular lab, say, "Unsteady Diffusion 17x1".
MODEL: 1
problem - you chose: 552W
template - you chose: 1DUN.HC.q.nn
model - you chose: unstdhc17
icdata - you chose: 1DUNSTDIFF
enter name for working directory:
d. Enter the name of your jobfile directory, (usually the lab name)
enter name for working directory: lab2
setdir 1DUN.HC.q.nn unstdhc17 1DUNSTDIFF lab2
e. Highlight the above line from setdir to lab2 and paste it at the command prompt or type the entire line at the command prompt.
bogue:/u3/chambers % setdir 1DUN.HC.q.nn unstdhc17 1DUNSTDIFF lab2
cd lab2
more README to show job sequence.
f. Do a cd to lab2 and an ls to see what you've got.
bogue:/u3/chambers % cd lab2
bogue:/u3/chambers/lab2 % ls
COMMON.std implicit makepvm solv
floc jobstream mod.unstdhc17 temp.1DUN.HC.q.nn
hooks makefile README
g. Now type rungen at the command line followed by return. This will set up the aPSE
input files.
bogue:/u3/chambers/lab2 % rungen
a Problem Solving Environment
miércoles, 26 de enero de 2000, 13:39:23 EST
begin comlib
file identifiers and names:
temp temp.1DUN.HC.q.nn
model mod.unstdhc17
algor talg.data
mdata mdat.data
automatic dirichlet nodes not set
peruse file 2 mod.unstdhc17
peruse file 1 temp.1DUN.HC.q.nn
ALGOR FILE NAME ------------ talg.data 63 recs
peruse file 2 mod.unstdhc17
MDATA FILE NAME ------------ mdat.data 91 recs
FDATA FILE NAME ------------ fdata 5 recs
end comlib
begin param
File identifiers and names:
1-> algor talg.data
2-> mdata mdat.data
3-> cout qtest
6-> gout gtest
end param
bogue:/u3/chambers/lab2 %
h. Now do an ls to see what you've got.
bogue:/u3/chambers/lab2 % ls
COMMON.mtl fort.3 mdat.data solv
COMMON.std hooks mod.unstdhc17 talg.data
COMMON.vec implicit param.bas temp.1DUN.HC.q.nn
fdata jobstream README vardim.bas
floc makefile SCALAR.h VECTOR.h
fort.2 makepvm SCALARS VECTORS
bogue:/u3/chambers/lab2 %
i. Now solve the problem statement via the command solv > stest where there is NO "e"
on solv and stest can be any name you choose. Note that the time in solve depends
on the size of the problem
bogue:/u3/chambers/lab2 % solv > stest &
bogue:/u3/chambers/lab2 % ls
COMMON.mtl implicit itest.8 SCALARS
COMMON.std itest.0 itest.9 solv
COMMON.vec itest.1 jobstream stat
converg itest.10 makefile steps
fdata itest.11 makepvm stest
floc itest.2 mdat.data talg.data
fort.2 itest.3 mod.unstdhc17 temp.1DUN.HC.q.nn
fort.3 itest.4 param.bas timestat
gtest itest.5 qtest vardim.bas
hooks itest.6 README VECTOR.h
icdata itest.7 SCALAR.h VECTORS
bogue:/u3/chambers/lab2 %
j. Edit the itest.* files with your favorite Unix editor to view the integer print fields of the
solution.
bogue:/u3/chambers/lab2 % more itest.11
1-D UNSTEADY HEAT CONDUCTION TUTORIAL (1/99)
STEP 11, ITERATION 1, STEP SIZE 1.00000E-04, STATION 1.10000E-03
1D 17 COLS:
DTLIM EPS EPN XP TFINAL
1.0000E+00 1.0000E-03 1.0000E+02 1.1000E-03 1.1000E-03
$ 22 X1 EXP -2 PLANE 1
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17:
100 106 113 119 125 131 138 144 150 156 163 169 175 181 188 194 200
$ 1 Q EXP 0 PLANE 1
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17:
525 424 361 328 314 308 307 307 307 307 307 307 307 307 307 307 307
$ 2 QNRM EXP 3 PLANE 1
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17:
840 342 102 21 3 0 0 0 0 0 0 0 0 0 0 0 0
2. Structuring subdirectories
Computational experiments will produce enormous amounts of data, some will be used and some will not. A strategy for organizing data on your Unix account is imperative so that information is not accidentally lost.
As an example, Lab 3 will required a laminar and turbulent experiment at several Reynolds numbers and several mesh sizes. One such method of organization is as follows:
Main (directory)
lab3_lam (directory)
(files - mod.* and temp.* files)
rey3 (directory - means Reynolds number of 103.)
(data files - i.e. "Re3N17.itest.10" for Re = 103 with 17 nodes)
rey4 (directory)
rey5 (directory)
etc.
lab3_turb (directory)
rey3 (directory)
etc.
This information is easily and quickly changeable before each iteration. See "Jobstream File" below.
3. Other stuff
a. t command - while the program is running you can type the letter t at the command promt to view the progress of the program. "t" will return the current step (station), iterate and more.
b. Unix editors - There are severall editors that can be used in unix (vi, pico, emacs, xemacs, etc). It does not matter which you choose, but if you are working from a pc and connected to a unix server, some editors will be more friendly than others. One solution to this is to work in a Linux environment. It is strongly suggested that the reader purchase a reference book on basic Unix commands. Until then, a brief description of some commands are available on the UTK/ECC website (http://www.engr.utk.edu/ecc/) as well as a wealth of other much needed information.
c. Additional software. If you are taking this course over the internet, or just prefer to work from home on a pc there is additional software that is available to aid in making presentable reports. The software listed is not the only (or the best) software that can be used, but is listed because it is common or free. The free software listed can be found at www.downloads.com.1) It is suggested that Tecplot is used rather than Excel because it is much more powerful.
2) Token 2 is free telnet software that will allow a pc to connect to unix. Telnet programs are available with Windows, but token has a screen capturing option that often comes in handy.
3) Dreamweaver is an HTML editor. While it is not free, it is very powerful in making presentable reports. If you know how to write HTML then Dreamweaver is not a necessity and the HTML code can be written in any text editor. There is free software that assists in HTML coding available a downloads.com.
4) SnagIt is available at www.techsmith.com and is an image capturing software. If you produce a calculus equation in MSWord, you can then capture it (like taking a photograph) and save it as a GIF to put into your report.
5) FTP - To transfer files from unix to a pc or back WS_FTP95 is very reliable and easy to use. Using the ASCII option will allow the editing of text files on a pc.
B. aPSE Execution: Input and Output Files
1. File Structure. There are three files that you (the student) will use to control the execution of aPSE for the system at hand. These are named: model file, template file, and jobstream file. Throughout, note that the # sign is a comment command; i.e. a line of code will not be executed when proceeded by #. All aPSE files are key-worded by category; e.g., Integration factors, Jacobian, etc. , which must be left justified.
2. Model File. The model file contains the numeric data that varies from problem to problem (i.e. material properties, initial conditions, geometry, etc.). All model file names will have the prefix "mod.", as in "mod.lab2".a. Integration Factors. Contains scalar definitions for time stepping data and iterative convergence criteria. Below is a list of these variables with a little explanation.
- INITIAL_TIME/FINAL_TIME – These variables are self explanatory; they are the beginning and end times of the problem.
- PROBLEM_CONVERGENCE_CRITERIA – aPSE will stop execution when the first iterate (maximum), |d Q(p=0)|, is equal to or less than the problem convergence criteria.
- MAXIMUM_CHANGE_IN_Q_(DQ) – the maximum allowable first iterate, |d Q1|. In areas of high gradients, too large of a change in d Q may cause iterative divergence. This problem is often seen within the first three or four steps of a solution. Getting the algorithm started may be very difficult since a quality initial condition is usually unknown. Therefore, if aPSE stops after only a few time steps, one usually restarts the execution after modifying the initial conditions or initial time step size.
- INITIAL_TIME_STEP – In aPSE, all integration time step variation is based on the original time step size, initial and final times, and possibly the number of iterations.
- TIME_STEP_MULTIPLIER – Much like the mesh can be non-uniform by using a progression ratio, the integration time step can be made non-uniform by using the time step multiplier. When set to 1.0 the time steps are uniform in size. A minus sign before the INITIAL_TIME_STEP indicates that a TIME_STEP_MULTIPLIER other than 1.0 will be used.
- MAXIMUM_TIME_STEP – As noted earlier, the size of the time steps is based upon the initial time step size and the number of steps. If a time step multiplier value is set such that the size of the time steps increases for an indefinite number of steps, then the step size will grow (theoretically) to infinity. It may not be known when the solution will end, so a maximum allowable time step keeps the steps from growing to unreasonable sizes.
- CRITERIA_TO_RAISE_MAX_TIME_STEP - not used.
- MAXIMUM_NUMBER_OF_STEPS – Also self explanatory, the number of steps can be limited through this variable. If through the initial time, final time, and time step size the algorithm will stop after 10 steps, the maximum number of steps can be set to 5 to stop the algorithm sooner.
- MAXIMUM_NUMBER_OF_ITERATIONS_PER_STEP – For non-linear problems employing quasi-Newton jacobians, hence only linear convergence, the number of iterations allowed within a time step can be limited.
- ITERATION_CONVERGENCE_CRITERIA – sets epsilon for |Qp+1-Qp| £ e at each time step.
- THETA_IMPLICITNESS_FACTOR – the time integration implicitness variable q (i.e. for Crank-Nicolson q = 0.5).
- CONVERGENCE_VARIABLE – determines whether the iteration variable is normalized, i.e. DQ (set to 1.0) or DQ/QMAX (set to 2.0).
b. Global Scalars. Recall from ES 551w that there are 6 positions for data in the weak statement template; (global scalars)(element averaged data)(distributed data)(metrics)(master matrix data)(variable or data), e.g.,
(COND)( )(X1)(0;-1)(A3000L)(Q). All global scalar variable names (here, "COND") and their values are defined in this section.
Cell Scalars - not used.
c. Print .The form and format of digital output can be controlled to some degree. The output can contain the data from every step, or every X number of steps by adjusting the Print Interval. The output can contain the solution values, and norms, or not, by adjusting the Variables Printed. Since the nodal positions are the same for every step they only need to printed for one step. If for some reason these positions were required in other steps, this would be communicated to aPSE through Variables Printed First Step Only. Other variables may also be added. Output data format is controlled by the "COUT" File Print Format line.d. Debug - not needed.
e. Others - not needed.
f. Common/Ctherm. All reference data for non-dimensionalization of the problem statement are set here, such that non-D groups can be computed, e.g., Re = UL/n , L = ALC (a length constant), U = UREF (reference velocity) and n = VISCK (kinematic viscosity). Other data in this section include gravitational constant, reference temperatures, specific heat and reference pressure, to name a few.
g. Graphics. Contains the variables to be printed in the graphics file, i.e. "GTEST".
h. Three_integer_print - not needed.
i. Boundary Conditions. The boundary conditions can be defined as Diriclet and Neumann. The code sets the Diriclet BC to 1 at node #17 and sets the Neumann BC to 1 at node 1.
j. Initial Conditions. All array initialization is set in this section. The first lines must contain the state variable array (nodal) initial condition in the order defined in the template. Then follows all working arrays, terminating with the meshing definition statement. For example, in Lab 2 the format for a 1-D, 17 node uniform mesh is [1(1. 16R1.0 2)] $X1. The X1 (the independent variable name) ranges from 1 to 2 across 16 elements with a progression ratio (R) of 1.0. A non-uniform mesh results for R greater or lesser than 1 (much like the time step multiplier). For example, a 1-D 33 node non-uniform mesh with progression ration of 1.3, where X1 varies from 0 to 13 has the format [1(0 32R1.3 13)] $ X1. The model file contains a combination of dimensional and non-dimensional information. However, INPUT and OUTPUT are always dimensional, while the data processed internally is always non-dimesional.
3. Template File.
Template files are simple in structure, adhering directly to the six types of data previously defined. However, as the complexity of the problem statement grows, the length of the template file increases. All template files are proceeded by the prefix "temp.", as in "temp.lab2". At the head of the file is the INTEGRATION FACTORS string, which must match the list in the model file. The TITLE keyword begins template construction. First all residuals that form the {FQ} statement are listed, followed by the jacobians created from, d{FQ}/d{Q}. Next, post-processing residuals and their jacobians are listed, followed by energy norm calculations. Under Group Frequency, the integer set to 1 means this template group is calculated at each iteration. When set to some large value, say 999, this template group is calculated only at problem convergence. Finally, under Solution Type, the first line defines either a linear problem (Q), or iteration for a non-linear problem (DELTA_Q). The remaining lines define the linear algebra solver to be used and the (default) implicit Euler time integration.
4. Jobstream FilesThe jobstream file organizes the aPSE execution sequence. This file contains the name of the model file, template file, and the desired names of the integer print field output file, the graphic output file and the data output file. By utilizing jobstream, the user will not have to use the "rename" or "copy" command after each execution to maintain data from multiple aPSE executions.
a. Data Output (sout). The output data file "sout", or "s-file", will be referenced in a lecture. The fact is that there is no "sout" file unless the user (you) chooses to name the solution streaming (hence "s") file as such; see Section II.A.9. When aPSE is run using the "SOLV > filename" command, this file is generated (with the name filename) to contain pertinent algorithm performance data. For clarity, it is suggested that the SOLV command also use .sout extension, e.g., SOLV > lab2_trial1.sout .
b. Integer Print Fields (itest). Integer print fields are highly useful for detailed assessments of solution quality. This output method, developed when computers were slow and graphics slower, still can exhibit advantages over graphics, which will be discussed with Lab 4. The integer print field files can be generated for any time step interval you specify (hence the numeric extension at the end of the file name, i.e. itest.10). The frequency of creation of the itest (integer print field) file is controlled in the model file under the PRINT section using the Print Interval variable. Note that changing this will also change the frequency of the output in the gout file.
c. Tecplot Formatted Files (gout). This file contains solution data organized in the format of Tecplot, a powerful graphics tool. aPSE formats all of the data for Tecplot and puts it into this 1 file, called gout. It can be renamed to suit the user's needs in the jobstream file.
C. Tecplot
The following is guide to get the reader started on tecplot. It is by no means meant to be a comprehensive manual.
1. Each aPSE program will create a gout file that has been formated to use with tecplot. Before this data can be viewed in Tecplot it must "conditioned". To do so, get to the command prompt where the gout file is located and type "preplot filename.gout". Information will scroll over the screen showing the information being processed and a file called filename.plt will be created.
2. Open Tecplot and go to "File" then "Load DataFile". Browse through the directroies until you find the file that you just preplotted.
3.The first time this is done the data may seem incomprehensible. Press the "Plot Attributes" button on the lower left side of the screen. The screen that appears (and the check boxes above the button) controls the majority of the attributes that need to be changed to present the data the way you choose. For the nonlinear problems each zone represents each step that was selected to print to the gout file. Note that if we set up the model file to run 500 steps and print every 50 steps, we would see 11 zones (including the initial condition).
4. Below is an example of the Tecplot results that can be produced for each lab. With basic HTML knowledge a person could alter these files for personal use. (Actual results not shown.)
D. Labs
1. Verfiying Templates. When verifying template construction, the aPSE abbreviation for metric data strings can become confusing. The following shows how the coordinate transformation abbreviations are defined for an example diffusion term (DIFF).
DET-1 eta ijetaik[B2JK]{PSI}
J
K
IJ IK
I = 1
IJ IK
I = 2
eta ijetaik
(using Figure 1) 1
1
11 11
21 21
11 22
1
2
11 12
21 22
13 24
2
1
12 11
22 21
31 42
2
2
12 12
22 22
33 44
Figure 1. etaij etaik ordering
2. Lab 2. Unsteady Axisymmetric Heat Conduction with Convection
a. Overview. Lab 2 emphasizes the impact of non-uniform mesh solution adaption to promote obtaining a smooth solution. The Lab 2 IC is such as to cause oscillations in the nodal solution for inadequate meshing. It is designed to test the impact of spatial alterations on temporal stability, and the effect of increased implicitness. It also admits comparing GWSh and FVSh constructions.
b. Verify template construction. Ensure that the template construciton is valid.
c. GWSh. theta= 0.5 Starting with delta t = 10-5, note both the spatial and temporal solution smoothness as influenced by different progression ratios and mesh refinement. Recognize the pattern to smoothness as a function of non-uniform to uniform mesh refinement. Notice the requirement for time step refinement as the mesh is further refined.
c. GWSh, theta= 1.0 For delta t = 10-6, run the algorithm for the various progression ratios with theta = 1.0. Note the influence of time truncation error on solution accuracy.
d. FVSh. Uncomment the FVS statement lines in the template file and comment out their respective GWS lines. Run the FVS algorithm for 8 elements, delta t = 10-6, theta = 0.5 and a progression ratio of 1.3. Note the stability of the solution and the ability of the FVS to produce a solution comparable to the GWS.
3. Lab 3. 2-D Boundary Layer Flowa. Overview This is the first "genuine" Navier-Stokes lab. One key issue is getting a solution started in the absence of quality initial conditions. Once settled, you proceed to the issue of convergence studies, etc. Lab 3 is also the introduction of methods for handling mass conservation and pressure.
b. Lab 3A, 2D Laminar BL Flow (Isothermal)
1) Verify the GWSh template residuals and jacobians including all components of the basic equations (i.e. turbulent and bouyancy body force terms). Then note which parts will be zero for the isothermal laminar case and verify that these terms are actually zero in the model file, or multiplied by a zero in the template file. The 2 matrices that are created using a Taylor series on the continuity equation will be given the names "A201V" and "A201U". GDOTI is the gravity vector multiplied by a directional unit vector for use with the hot wall scenario. For the isothermal case it is zero, which eliminates the bouyancy body force.
Notes on modifications:
-> Changing Reynolds number. The model file is set up for a Reynolds number of 104. To change Re, edit the model file and move the decimal on UREF.
-> Mesh. Create a different model file for each meshing definition. In the "Cell Scalars" and "Initial Conditions" sections of the model file change the nodal string lengths accordingly.
->Initial conditions.1. You are asked to conduct a convergence study for laminar boundary layer flows at Re = 104, 105, and 106. Recall the assymptotic error estimate contains both spatial and "temporal" terms. The latter term must remain of uniform size to admit this process. The manner selected for enforcement is to employ a "slug start" initial condition for {u}, the energy of which is uniformly constant. The slug start initial condition in the model file is [S 0 8*1 S1.591377] $ U. This states that the initial condition for U on a 9 node mesh is zero at the wall with rest equal to 1. The string is then multiplied by 1.591377 (remember that input and output are DIMENSIONAL). Later when you change UREF such that Re = 105, you must also change the initial condition accordingly, i.e. [S 0 8*1 S15.91377].
2. Recall again that the error energy norm contains bounds on both "time" and "space". The boundary layer algorithm is strictly spatial but x exhibits "temporal" character. To control the initial condition on U norm, do the following:
Figure 2. Mesh refinement maintaining constant energy norm.a. For an 8 element mesh choose an IC [0 8*1] , scaling excluded for the moment.
b. For a 16 element mesh, we want the IC to contain the same energy, i.e. look exactly the same over the same distance, so define the IC [0 0.5 15*1] (17 nodes).
c. For a 32 element mesh choose [0 0.25 0.5 0.75 29*1]. See Figure 2 above.2) Convergence study. Run the algorithm for M = 16, 32, 64 and 128 element uniform meshes, for Re = 104, 105, and 106, producing 12 sets of data. Note from the previous lab that it is important to have a smooth (non-oscillating) solution. Here, delaying the start of of the {V} solution (continuity) will improve smoothness as the solution generates better approximations to d{u}/dx. For Re = 106 and M =, the solution will become smooth over a long enough distance. Confirm that the data is correct by plotting the Reynolds number vs. the profile for a given nodal quantity (see Figure 3). The profile for each M must be plotted at the same final "time" station.The convergence study is requested at each Reynolds number. Therefore, the final "time" station must be the same for each M for a given Re. This can be checked quickly after each run by using the "t" command mentioned above. (NOTE: it is NOT necessary that the final time be the same for different Re, as was the case with Figure 3.) At this point, the convergence study proceeds as was done in ES 551w by calculating the adherence to the convergence slope logrithmically. The point examined should NOT be in the freestream.
Figure 3. Normalized velocity profile for various Re.
3) Laminar, Hot Walla) Understanding G· i (GDOTI). The value of GDOTI will be -1 or 1 if the bouyancy body force opposes gravity or is in the direction of gravity, respectively. If the flow is isothermal the bouyancy body force is "shut off" by setting GDOTI equal to zero.
b) Temperature initial condition. Like with the velocity initial condition, the temperature input must be scaled at a dimensional number. The initial condition should be 1 at the wall, zero everywhere else, and scaled by the wall temperature.
c) Plot. Put 3 data sets on 1 plot for 64 elements, Re = 104, isothermal, bouyancy body force up and bouyancy body force downward.Tmax = wall temp = 5, Tmin = free stream (keep at zero), Tref = 0, Tabs = 459.6.c. Lab 3B & 3C, Bradshaw Mixing Length & Bradshaw K-E model. Simply run the existing files and compare characteristics to the laminar model. Compare MLT, TKE and law of the wall mathmatical models to experimental data.
4. Lab 4. 2D Driven Cavity - Omega-Psi
a. Verify residuals and jacobians.
b. Lab 4A & 4B, 2D Driven Cavity (GWS) on 17x17 & 33x33 mesh. This is a good time to become familiar with the time integration factors. For various Reynolds numbers the time data output behaves differently. We saw in Lab 3 that at higher Reynolds numbers the solution reaches the free stream value much quicker than at lower Reynolds number, thus satisfying the problem convergence criteria quicker, since the initial condition is closer in form to a higher Reynolds number than a lower one. Hence, even though the large gradients at high Re require more iteration time, the problem can converge to a final solution in a much quicker final time. The comparisons of omega and psi should be evaluated at the same final time for all Reynolds numbers for accurate comparison. An example: Based on the above argument we will set up an algorithm with Re = 2000, 32 elements for 20 steps and observe t_final in the sout file (let's say it is 60 seconds). For now we will assume this to be an acceptable solution, reserving the right to change our opinion on that later. Next, set up a model file for Re = 1000 with 32 elements. The objective is to achieve the same final time with at least the same number of steps. This can be done by setting t_final at 60 seconds, then adjusting the initial time step, time step multiplier and maximum time step as needed. You may also tighten the problem convergence criteria. Repeat for Re = 100 with 16 and 32 elements.
c. Lab 4C & 4D, 2D Driven Cavity (TWS) on 17x17 & 33x33 mesh. Repeat the GWS trials for the TWS and note the impact on stability and energynorm.
d.IC. Remember in Lab 3 it was mentioned that how you begin is very important. That is, what you get out depends on what you put in. Therefore in the non-isothermal cases, when changing the Reynolds number by a factor of 10 you MUST also scale the temperature initial condition accordingly.
e. Mesh transitions from uniform to non-uniform mesh can be more smoothly implemented through the creation of a small Matlab program. .5. Lab 5. 2D Thermal Cavity - Omega-Psi
6. Lab 6. 2D Thermal Cavity - Iterative Approximation (Phi Algorithm)a. Verify residuals and jacobians. Note that the momentum and energy equations are now coupled in the temperature with the addition of the bouyancy body force to the momentum equation.
b. Two templates will be used in this lab.
1) Lab 5A & 5B, 2D Thermal Cavity, Omega-Psi Quasi-Newton, on 17x17 & 33x33 mesh. First evaluate the performance of a quasi-Newton jacobian decoupled in temperature for the GWS (beta = 0).,
2) Lab 5C & 5D, 2D Thermal Cavity, Omega-Psi Full Newton, on 17x17 & 33x33 mesh. Evaluate the full Newton jacobian.
3) TWS. Delta x waves will be dampened through artificial diffusion on the full Newton template. Note the imapact on stability and energy norm.
c. Again, how you begin is very important. A perfectly good algorithm may not converge if the initial condition is improper. At higher Rayleigh numbers much higher gradients are expected and not beginning correctly can cause difficulty.
1) For the "cold start" the initial condition will be linearly interpolated across the domain from the cold wall to the hot wall for a uniform mesh. Where a progression ratio is applied, the linear interpolation will not be recalculated. Therefore the initial condition for each progression ratio is a little different.
2) This lab can make use of a "restart" procedure that allows the data from one solution (at steady state) and use it as the initial condition for a model with a Rayleigh number of 1 order of magnitude higher. This method is used when getting the algorithm started is difficult because a "good" initial condition is unknown. A true restart is not required here but will be demonstrated for high Reynolds numbers. Note that when we use data from Ra=105 to do a restart on an algorithm for Ra=106, the restart data must be scaled by a factor of 10.a) Run the Newton algorithm for Ra=103 to 106, for progression ratios of 1, 0.9, 0.8 and 0.7 on a 16x16 square mesh. Repeat for a 32x32 mesh.
b) For the quasi-newton algorithm template given, at Ra = 103 the initial condition will be a linear interpolation from the hot to the cold wall across the domain. This is termed a "cold" start. Run the algorithm until the problem convergence criteria is met and the program self terminates. For the quasi-newton, run the algorithm for a uniform mesh for Ra= 103 to 106 on a 16x16 square mesh. Compare with the newton algorithm.
c) Restart Procedure. At the final time step (call it XXX) a data file will be produced named TEMP.XXX (give it a new name so that it is not overwritten the next time you reach that time step, say OMGA.Ra3N17). In the "updates" file, put the NAME of this data file. aPSE will read this "updates" file and understand that this is the initial condition for omega, psi and temperature, rather than those specified in the model file.
d) Repeat this procedure for corresponding Rayleigh numbers. The Rayleigh number is modified via TMAX, remebering that Ra = Gr/Re2 = b D TgL/Vo2. For restarting, when increasing Ra by an order of magnitude the temperature values used in the resart file must also be scaled up by the same amount.a. Verify residuals and jacobians.
b. Lab 6C, 2D Thermal Cavity Quasi-Newton (phi 33x33). Much like omega-psi algorithm, run the quasi-nNewton template for a 16x16 uniform mesh for a Ra = 103 to 106.
c. Lab 6B, 2D Thermal Cavity Newton (phi combined 33x33). Choose a quality solution and run the full Newton template for those characteristics. Using the sout file, compare Newton v.s. quasi-Newton iterative convergence. Prepare to run 4 trials for the Newton algorithm. On a uniform mesh, for Ra = 103 to 106, compare the impact of a progression ration of 1.0, 0.9, 0.8 and 0.7. Note the difficulty in getting the program started as Ra = 105 and 106 are approached. Restarts may be required for such small diffusion coefficients. See lab 5 for restart procedure.
d. Lab 6A 2D Thermal Cavity Tensor Product (33x33). Run the tensor product template for Ra = 106 on a progression ratio of 1.0, 0.9, 0.8 and 0.7. Note the quality of the solution compared to the Newton and quasi-Newton.7. Lab 7. 2D Laminar and Turbulent Duct Flow
a. Overview. The duct flow problem is a 2-D duct 0.5 INCHES high and 3.0 FEET long. The input profile for laminar flow is slug flow. For turbulent flow the input
profile is a turbulent slug (included in model file).
b. Verify residuals and jacobians.
c. Lab 7A, 2D LAMINAR Duct Flow Full Newton 33x17. Run the laminar templates for isothermal flow for Re = 100 and 1000 at beta = 0.0 and 0.2 for each. Note the impact of numerical diffusion.
d. Lab 7B, 2D Conjugate Heat, Turbulent Duct, Quasi-Newton33x25. Run the turbulent template with beta = 0.2 for conjugate heat transfer.
d. Lab 7C, 2D Turbulent Duct, Quasi-Newton33x25 (isothermal). Run the turbulent template with beta = 0.2 for isothermal flow.
e. Consider y+ at the 1st node from the wall. Is the calculated value of y+ within the model limits?
f. Perform an iterative convergence study. Compare the laminar flow full Newton jacobian performance to the the turbulent flow quasi-Newton jacobian.
8. Lab 8. Linear Unsteady Convection-Diffusion, Stabilitya. Overview. The unsteady convetion diffusion problem provides an opportunity to examine algorithm performance and comparison to theory. Several algorithms have direct relation to the TWS and can be studied using an appropriate value of alfa, beta and/or gamma. Some of these algorithms are greatly effected by implicitness as well. The following table describes what numerical diffusion values to use with the TWS or other algorithms.
Algorithm Parameters Lab Name alfa beta gamma theta template (temp.*)Lab 8A-1D Wave TWS Galerkin Weak Statement Lab 8B-1D Wave Crank-Nicolson Finite Difference- Crank Nicolson 0.5Lab 8A-1D Wave TWS Taylor-Galerkin 1 1 0.0, 0.5Lab 8A-1D Wave Raymond-Garder Raymond-Garder 1/151/2 1/151/2 0.5Lab 8A-1D Wave TWS Least Squares 2 x theta 2 x theta 0.5, 1.0Lab 8A-1D Wave TWS Taylor Weak Statement, gamma optimal - 0.5 0.5b. Verify residuals and jacobians
c. Run each algorithm listed in the table above, including two trials for different values of theta in the TG and LS algorithms.
d. Run each algorithm for Courant number = 0.25, 0.5, 0.75, and 1.0.
e. Run each Courant number for the gaussian, sine, and square wave initial condition interpolated over 10 elements.
f. This results in 96 runs. It is suggested that the user perform and verify various algorithms before proceeding to the next. This can be done via,1) Comparison of numerical results with those listed in the literature.
2) TG with theta = 0 and C = 1 will be nodally exact.
3) TWS, gamma optimal is nodally exact at C = 1.g. Perform an asymptotic convergence study on:
1) GWS only for all Courant.
2) All algorithms for Courant = 0.75.h. Comment on algorithm performances compared to the spectral distributions given in the Couresware "comparative performance" section.
9. Lab 9 1D Steady Diffusion, (PECLET) 21x1
a. Verify residuals and jacobians.
b. Run the TWS template
1) For beta = 0 with various progresion ratios
2) With one progression ratio and various values of beta.c. Perform part b for Pe = 102, 103, and 104.
d. Perform an asymptotic convergence study on the GWS and TWS for the energy norm and point norm.
e. Comment on the ability to achieve stability with each algorithm and any trade-off in convergence.