View
223
Download
2
Category
Preview:
Citation preview
Introduction to Computer Exercise 1MVK150: Applied CFD
R.Z. Szasz, Energy Sciences, LTHLund University
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
Introduction to Computer Exercise 1
• Grid generation
• Classification of grids
– Structured
– Unstructured
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
Classification of grids
• Structured
– Single/multiblock
– Stretched/unstretched
– Staggered/collocated
– H,O,C
• Unstructured
– Node-centered
– Cell-centered
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
Software to generate grids
• Structured/block structured
– Can be inbuilt in solvers
• Complex
– Gmsh, netgen, gambit, ...
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
How to mesh?
• Plan• Check/Set solver• (Import)• Create objects (vortices,edges,...)• Create mesh• Check mesh• Set BCs• Export• SAVE
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
Problem description: 2D channel
• Until next time think about
– Flow physics
– Meshing strategies
• Advantages
• Disdvantages
1
1
3
3
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
OpenFOAM basics
• What is (not) OpenFOAM?
• How to get it?
• Directory tree structure
• Solving a problem
– Pre-processing
– Running
– Post-Processing
• Further info
• This is just an introduction, NOT a manual, user guide, tutorial,...
• Presentation
• Demonstration
• Questions
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
What is OpenFOAM?
• FOAM = Field Operation And Manipulation
– Mainly Computational Fluid Dynamics (CFD), but not
only
• It is a toolbox (library)
– Open source
– C++
– Example solvers, tutorials provided
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
How to get it
• Unix/Linux
– www.opencfd.co.uk
• MS Windows
– http://sourceforge.net/projects/openfoam-mswin/
• In the followings the MS Windows version is shown,
contact us if you intend to use it in Linux
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
Directory tree structure
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
Pre-processing: Grid
• Unstructured, finite volumes
– Tetrahedral, hexahedral, polyhedral, mixed
• In-built
– blockMesh
• Block-structured hexahedral mesh
– snappyHexMesh
• Unstructured hexahedral (from stl files)
• Import
– Gambit, Star-CD, ...
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
OpenFOAM Designer (Windows only)
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
File -> New case
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
blockMeshDict
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
blockMeshDict (2)
• Block-structured grid
• Scaling
– OF is SI
• Vertices
• Blocks
• Edges
• Boundary surfaces (Patches)
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
• Mesh utilities
– Generation
• blockMesh
• View -> Refresh
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
Check these files
• fvSolution – solution methods
• fvSchemes – discretization schemes
• controlDict – main control (timestep size, number of timesteps, ...)
• polyMesh – grid
• transportProperties – e.g. viscosity
• 0 – initial conditions
– U – velocity
– P - pressure
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
When everything looks OK:
• RUN
– (... and WAIT)
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
When ready:
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
Post-processing
• Paraview / ParaFOAM
• First create an empty file
– ../casename/casename.OpenFOAM
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
• Mark
– Region status
– Vol Field Status
• Apply
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
• Display
– Scroll down
– Representation
• Surface
– Scroll up
– Color by
• U
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
Increase timestep here
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
Paraview (cont.)
• Filter
– Post-processing routines
• File -> Save screenshot
– PNG, BMP, JPG, TIF, ...
• Help
– Included in the installation
R.Z. Szasz / Lund University / Energy Sciences, LTH / Applied CFD / OpenFOAM Introduction
Further informations
• http://www.opencfd.co.uk
– Documentation: User guide, Programmers manual
• http://www.cfd-online.com/Forums/openfoam/
• http://foamcfd.org
• http://openfoamwiki.net/index.php/Main_Page
Recommended