Presentation is loading. Please wait.

Presentation is loading. Please wait.

Good Practice in CFD Dr Neil Bressloff 13th & 14th October 2005

Similar presentations


Presentation on theme: "Good Practice in CFD Dr Neil Bressloff 13th & 14th October 2005"— Presentation transcript:

1 Good Practice in CFD Dr Neil Bressloff 13th & 14th October 2005
Spalart-Allmaras, 1000 iterations, Turb. Visc. Ratio at inlet. 13th & 14th October 2005

2 Which of the above Cp variations is correct ?
Good Practice in CFD, 2005 Introduction Which of the above Cp variations is correct ? Is either of them correct ? If so, how accurate are they ? Do the associated solutions yield physically meaningful results ?

3 Preamble: Using Gambit and Fluent efficiently
Good Practice in CFD, 2005 Preamble: Using Gambit and Fluent efficiently GUI Precision Input (journal) files Batch mode Running in parallel Check memory usage and machine load Monitor solution and auto-save

4 Preamble: Using Gambit and Fluent efficiently (2)
Good Practice in CFD, 2005 Preamble: Using Gambit and Fluent efficiently (2) GUI (Unix, linux) gambit & fluent & gambit –r2.0.4 –id rae2822 & fluent –r ddp & session name version version Two-dimensional, double precision

5 Preamble: Using Gambit and Fluent efficiently (3)
Good Practice in CFD, 2005 Preamble: Using Gambit and Fluent efficiently (3) Single or Double Precision? 28,000 quadrilaterals, Realizable k-epsilon turbulence model Single precision requires 54 MBytes memory Double precision requires 96 Mbytes memory Results identical here (in terms of force coefficients) BUT, this should always be checked If memory is available, use double precision

6 Preamble: Using Gambit and Fluent efficiently (4)
Good Practice in CFD, 2005 Preamble: Using Gambit and Fluent efficiently (4) Input (journal) files all menu options (widgets, clicks etc) are available through command-line instructions. store instructions/commands in input log files alternatively, load and edit an existing dbs file (Gambit) or cas and dat file (Fluent)

7 Gambit input file example (1)
Good Practice in CFD, 2005 Gambit input file example (1) vertex create "PT128" coordinates vertex create "PT129" coordinates e-05 0 vertex create "PT130" coordinates 1 0 0 / / ***************************** / / *** Define aerofoil edges *** / / * suction side edge create "upper" nurbs "PT1" "PT2" "PT3" "PT4" "PT5" "PT6" "PT7" "PT8“ interpolate face create radius 10 xyplane circle face create "foil" wireframe "upper" "lower" real face subtract "face.1" faces "foil"

8 Gambit input file example (2)
Good Practice in CFD, 2005 Gambit input file example (2) edge mesh "edge.4" "edge.5" successive ratio1 1.1 ratio2 1.1 intervals 40 / blayer create first 1e-03 growth 1.4 total 0.1 transition 1 \ trows 0 wedge blayer attach "b_layer.1" face "face.1" "face.1" edge "edge.4" "edge.5" /* And generate mesh on the domain face face mesh "face.1" triangle size 1 solver select "FLUENT 5/6" / * and then set the BCs physics create "upper" btype "WALL" edge "edge.4" physics create "lower" btype "WALL" edge "edge.5" physics create "pressure-far" btype "PRESSURE_FAR_FIELD" edge "edge.3" / * we can save the mesh here as well export fluent5 "acfd40a.msh" nozval

9 Fluent input file example (1)
Good Practice in CFD, 2005 Fluent input file example (1) file read-case "/home1/utp-10/nwb/Aerocfd/2006/r6_from2005_bl_10m3.msh" grid check define models solver coupled-implicit yes define models energy yes define models viscous spalart-allmaras yes define models viscous sa-alt-prod yes define materials change-create air air yes ideal-gas yes constant no yes constant 1.983e-05 no no no no no no quit define operating-conditions operating-pressure 0.0 define boundary-conditions pressure-far-field pressure no no 0.73 no no no no no yes no 10 solve set courant-number 20 solve set discretization-scheme amg-c 1 nut 1

10 Fluent input file example (2)
Good Practice in CFD, 2005 Fluent input file example (2) solve monitors residual n-save n-display check-convergence yes no no no no solve monitors residual convergence-criteria plot no print yes solve monitors residual scale-by-coefficient? yes solve monitors force drag-coefficient yes lower upper , no yes "/home1/utp-10/nwb/Aerocfd/2006/cd_10m3" no no report reference-values zone fluid report reference-values compute pressure-far-field pressure report reference-values area 1.0 solve initialize compute-defaults pressure-far-field pressure solve initialize initialize-flow solve iterate 1000 file write-case "/home1/utp-10/nwb/Aerocfd/2006/10m3_firstorder.cas" write-data "/home1/utp-10/nwb/Aerocfd/2006/10m3_firstorder.dat" quit

11 Preamble: Using Gambit and Fluent efficiently (5)
Good Practice in CFD, 2005 Preamble: Using Gambit and Fluent efficiently (5) Batch mode (Unix, linux) gambit –r2.0.4 –id rae2822 –inp gambit_input1.jou & fluent –r ddp < fluent_input1.log > fluent_output1.log & Gambit input file Fluent input file Fluent output file

12 Preamble: Using Gambit and Fluent efficiently (6)
Good Practice in CFD, 2005 Preamble: Using Gambit and Fluent efficiently (6) Running in parallel (Unix, linux) fluent –r ddp –t4 –cnf=hostfile < fluent_input1.log > fluent_output1.log & Gambit input file Number of processes Name of file containing list of processors to use

13 Preamble: Using Gambit and Fluent efficiently (7)
Good Practice in CFD, 2005 Preamble: Using Gambit and Fluent efficiently (7) Check memory usage and machine load Fluent will run slowly if more physical memory is needed than is available the computer is overloaded Type top under Unix or Linux Run task manager under Windows Fluent requires approximately 1GB memory for each million grid cells (in single precision; double precision requires approximately twice as much memory).

14 Preamble: Using Gambit and Fluent efficiently (8)
Good Practice in CFD, 2005 Preamble: Using Gambit and Fluent efficiently (8) Monitor solution and auto-save don’t assume that a solution that appears to converge will continue to do so periodically save the solution using the following command in the Fluent input journal file (or through the appropriate clicks in the menu structure). file auto-save case-freq 1834 dat-freq 1834 root-name "./nwb_cab_3d_"

15 Standard aerofoil with available experimental data [1]
Good Practice in CFD, 2005 Example 1: RAE2822 aerofoil Standard aerofoil with available experimental data [1] Validation: How well can CFD predict pressure, lift and drag coefficients? Mesh (resolution, dependence, boundary layer and turbulence model) Boundary conditions (location and definition) Solution (convergence, order of accuracy) Flow physics (shock capture, separation) [1] Cooke, P., McDonald, M. & Firmin, M. (1979), “Airfoil RAE2822 – Pressure Distribution and Boundary Layer Wake Measurements”, AGARD AR-138.

16 Example 1: RAE2822 aerofoil (2)
Good Practice in CFD, 2005 Example 1: RAE2822 aerofoil (2) The problem under consideration involves flow over an RAE 2822 airfoil at a free-stream Mach number of The angle of attack is 3.19 degrees, which corresponds to case 9 in the experimental data of Cooke et al. Since the calculations were done in free-stream conditions, the angle of attack has been modified to account for the wind-tunnel wall effects. An angle of attack equal to 2.79 degrees was used in the calculations, as suggested by Coakley [2]. The domain extends 55 chord lengths from the airfoil, so that the presence of the airfoil is not felt at the outer boundary. [2] Coakley., T. J., 1987, Numerical Simulation of Viscous Transonic Airfoil Flows, AIAA 25th Aerospace Sciences Meeting.

17 Good Practice in CFD, 2005 Mesh dependence Note steepening of shock

18 Lack of convergence (very coarse mesh)
Good Practice in CFD, 2005 Lack of convergence (very coarse mesh) Demonstrate lack of convergence (actually taken from 10m2 mesh results)

19 Better boundary layer resolution
Good Practice in CFD, 2005 Better boundary layer resolution Spalart-Allmaras, 1000 iterations, Turb. Visc. Ratio at inlet., y+ too high for SA model. First point in BL at 0.001m. Same number of cells (3600) as previous mesh.

20 Finer mesh (Realizable k-epsilon)
Good Practice in CFD, 2005 Finer mesh (Realizable k-epsilon) Realizable k-eps, y+~20, Turb. Visc. Ratio.

21 Finer mesh (Spalart-Allmaras)
Good Practice in CFD, 2005 Finer mesh (Spalart-Allmaras) Spalart-Allmaras, y+ < 2ish, Turb. Visc. Ratio.

22 Good Practice in CFD, 2005 Order of accuracy Ran from 10m3 RKE NWF

23 Gradient based adaption
Good Practice in CFD, 2005 Gradient based adaption Static pressure gradient, Experiment with adaption thresholds and dynamic adaption 1) Initial refinement; 2) After 100 iterations; 3) Coarsening as well and another 100 iterations; 4) Another 500 iterations.

24 Good Practice in CFD, 2005 Adaption (2) Grid and X-Y plots not quite at converged state of residual plot

25 Separation (reverse flow)
Good Practice in CFD, 2005 Separation (reverse flow) Adapted 10m3 mesh look at Mach number and separation. Spalart-Allmaras, y+ < 2ish,

26 Separation (reverse flow)
Good Practice in CFD, 2005 Separation (reverse flow) Adapted 10m3 mesh look at Mach number and separation. Angle of attack increased to 5 degrees Spalart-Allmaras, y+ too large, Shock further forward than lower angle of attack.

27 Increased angle of attack
Good Practice in CFD, 2005 Increased angle of attack Angle of attack increased to 5 degrees Spalart-Allmaras, y+ too large, Shock further forward than lower angle of attack.

28 Mesh dependence (revisited 1)
Good Practice in CFD, 2005 Mesh dependence (revisited 1) 50, 100, 200 cells on upper and lower surfaces Outer boundaries 50 chords away Cd experiment = No. of cells Cd 50 100 200

29 Mesh dependence (revisited 2)
Good Practice in CFD, 2005 Mesh dependence (revisited 2) No. of chords Cd 7 20 50 200 cells on foil surfaces Outer boundaries 7, 20, 50 chords away Cd experiment =

30 Final checklist (1) Grid design Geometry Boundary conditions
Good Practice in CFD, 2005 Final checklist (1) Grid design Geometry Boundary conditions Boundary layer (Turbulence model) y+ of first grid point how many points in the boundary layer? structured BL or size functions? Avoid skew cells Local resolution (adaption) Run grid check in Fluent Fluent defaults to SI units (i.e. will assume metres)

31 Good Practice in CFD, 2005 Size functions

32 Final checklist (2) Validation Compare to experimental data
Good Practice in CFD, 2005 Final checklist (2) Validation Compare to experimental data Compare with other simulations Grid dependence At least 3 different grid resolutions 8 times 8? Time dependence At least 3 significantly different time step sizes Use engineering judgement and a sensible Courant number.

33 Final checklist (3) Solution scheme Segregated or coupled solver ?
Good Practice in CFD, 2005 Final checklist (3) Solution scheme Segregated or coupled solver ? Implicit or explicit ? At least 2nd order accuracy (in space and time) Set high under-relaxation parameters Monitor residuals, derived variables, point data Flow physics Post-process (Fluent, Fieldview, TecPlot, Ensight) How meaningful ? Discuss results using graphical evidence Label all axes and figures

34 Final checklist (4) Convergence problems Mesh quality (errors)
Good Practice in CFD, 2005 Final checklist (4) Convergence problems Mesh quality (errors) Boundary conditions Under-relaxation First order and then switch to second order Slowness due to problem size Check memory and CPU power Consider running in parallel speed-up from multiple processors avoid paging through distributed memory

35 Final checklist (5) Research the literature
Good Practice in CFD, 2005 Final checklist (5) Research the literature Journal and conference papers, reports etc Read the Fluent manual Casey, M. & Wintergerste, T., 2000, Special Interest Group on “Quality and Trust in Industrial CFD”, Best Practice Guidelines, Version 1, ERCOFTAC.


Download ppt "Good Practice in CFD Dr Neil Bressloff 13th & 14th October 2005"

Similar presentations


Ads by Google