1 / 35

Good Practice in CFD

Good Practice in CFD. Dr Neil Bressloff. 13 th & 14 th October 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 ?.

hjennings
Télécharger la présentation

Good Practice in CFD

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. 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. 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. Good Practice in CFD, 2005 • GUI (Unix, linux) • gambit & • fluent & • gambit –r2.0.4 –id rae2822 & • fluent –r6.2.16 2ddp & Preamble: Using Gambit and Fluent efficiently (2) session name version version Two-dimensional, double precision

  5. 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. 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. Good Practice in CFD, 2005 vertex create "PT128" coordinates 0.997592 0.000137 0 vertex create "PT129" coordinates 0.999398 3.5e-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" / Gambit input file example (1)

  8. Good Practice in CFD, 2005 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 Gambit input file example (2)

  9. Good Practice in CFD, 2005 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 1006.43 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 43765 no 0.73 no 299.5414 no 0.9988147 no 0.04867544 no no yes no 10 solve set courant-number 20 solve set discretization-scheme amg-c 1 nut 1 Fluent input file example (1)

  10. Good Practice in CFD, 2005 solve monitors residual n-save 10000 n-display 10000 check-convergence yes no no no no solve monitors residual convergence-criteria 0.00000001 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 0.9988147 0.04867544 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 Fluent input file example (2)

  11. 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 –r6.2.16 2ddp < fluent_input1.log > fluent_output1.log & Gambit input file Fluent input file Fluent output file

  12. Good Practice in CFD, 2005 Preamble: Using Gambit and Fluent efficiently (6) • Running in parallel (Unix, linux) • fluent –r6.2.16 2ddp –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. 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. 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. 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. 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 0.73. 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

  18. Good Practice in CFD, 2005 Lack of convergence (very coarse mesh)

  19. Good Practice in CFD, 2005 Better boundary layer resolution

  20. Good Practice in CFD, 2005 Finer mesh (Realizable k-epsilon)

  21. Good Practice in CFD, 2005 Finer mesh (Spalart-Allmaras)

  22. Good Practice in CFD, 2005 Order of accuracy

  23. Good Practice in CFD, 2005 Gradient based adaption

  24. Good Practice in CFD, 2005 Adaption (2)

  25. Good Practice in CFD, 2005 Separation (reverse flow)

  26. Good Practice in CFD, 2005 Separation (reverse flow)

  27. Good Practice in CFD, 2005 Increased angle of attack

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

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

  30. Good Practice in CFD, 2005 • 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) Final checklist (1)

  31. Good Practice in CFD, 2005 Size functions

  32. 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. Good Practice in CFD, 2005 • 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 Final checklist (3)

  34. 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. 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.

More Related