Difference between revisions of "OpenFOAM"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Intermediate Level)
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
Welcome to the Spoken Tutorial series on OpenFOAM.
 
Welcome to the Spoken Tutorial series on OpenFOAM.
OpenFOAM (Open Source Field Operation and Manipulation) is a free, open source CFD software package developed by the OpenFOAM Team at SGI(Silicon Graphics International) Corporation and distributed by the OpenFOAM Foundation.
+
OpenFOAM (Open Source Field Operation and Manipulation) is a free, open source CFD software package developed by the OpenFOAM Team at ESI and distributed by the OpenFOAM Foundation.
 
Development of OpenFOAM started in the late 1980s at Imperial College,since then the user base of OpenFOAM has widened from not only academic areas but also industries have started using it.
 
Development of OpenFOAM started in the late 1980s at Imperial College,since then the user base of OpenFOAM has widened from not only academic areas but also industries have started using it.
  
Line 12: Line 12:
 
The OpenFOAM distribution contains numerous solvers and utilities covering a wide range of problems of 2 Dimensions and 3 Dimensions.
 
The OpenFOAM distribution contains numerous solvers and utilities covering a wide range of problems of 2 Dimensions and 3 Dimensions.
  
In this tutorial we mainly concentrate on two areas,firstly on wide variety of solvers used in Openfoam and secondly on post processing the computed result using paraview.These tutorials are created using Ubuntu 10.04 and 11.04,OpenFOAM version 2.1.0,Paraview version 3.12.0.OpenFOAM runs on Ubuntu 10.04,11.04,12.04, 14.04 and 14.10 as well. OpenFOAM 2.3.1 was released recently with new bbug fixes and a couple of more improvements. You can download the same from the OpenFOAM website.
+
In this tutorial we mainly concentrate on two areas,firstly on wide variety of solvers used in Openfoam and secondly on post processing the computed result using paraview.These tutorials are created using Ubuntu 10.04 and 11.04,OpenFOAM version 2.1.0,Paraview version 3.12.0.OpenFOAM runs on Ubuntu 10.04,11.04,12.04, 14.04 and 14.10 as well. OpenFOAM 2.3.1 was released recently with a couple of more improvements. You can download the same from the OpenFOAM website.
  
 
OpenFOAM can be useful for Engineering Colleges which cannot afford the cost of license CFD Software's.
 
OpenFOAM can be useful for Engineering Colleges which cannot afford the cost of license CFD Software's.
 
Teachers and Students who would be using this software should have some basic knowledge of Computational Fluid Dynamics and Linux Commands.
 
Teachers and Students who would be using this software should have some basic knowledge of Computational Fluid Dynamics and Linux Commands.
  
The Spoken Tutorial effort for OpenFOAM is contributed by Mr.Rahul Ashok Joshi from IIT BOMBAY.  
+
The Spoken Tutorial effort for OpenFOAM is contributed by Mr.Rahul Ashok Joshi from IIT BOMBAY, under the guidance of Prof. Shivasubramanian Gopalakrishna, Dept. of Mechanical Engineering, IIT BOMBAY.
  
Previous Contributors : Saurabh Sawant, Chaitrali Ghodke, Gautam Sharma
+
Other Contributors : Saurabh Sawant, Chaitrali Ghodke, Gautam Sharma, Anmol Sahoo, Pavan Mehta, Deepa Vedartham
 +
 
 +
[ This effort is neither approved nor endorsed by ESI Group, the producer of OpenFOAM® software and owner of OpenFOAM® trademark ]
 +
 
 +
'''Learners''': Mechanical, Civil, Chemical Engineering students in 3rd and 4th year.
  
 
__TOC__
 
__TOC__
Line 25: Line 29:
 
==Basic Level==
 
==Basic Level==
 
#Installing and Running OpenFOAM and Paraview  
 
#Installing and Running OpenFOAM and Paraview  
#*Prerequisites
 
 
#*Introduction to OpenFOAM  
 
#*Introduction to OpenFOAM  
 
#*Introduction to Paraview
 
#*Introduction to Paraview
Line 84: Line 87:
 
#*Analytical result
 
#*Analytical result
 
#*Validating Analytic and Computational Results
 
#*Validating Analytic and Computational Results
#*Assignment
+
#Basic Post Processing using ParaView
 +
#*Post Processing after simulation using solver
 +
#*ParaView and paraFoam command for visualization
 +
#*Basic Visualization techniques
 +
#*Variable Visualization using pitzDaily case file
 +
#*Velocity vector Visualization using pitzDaily case file
 +
#*Glyph filter for visualization
 +
#*Streamlines Visualization using motorBike case file
 +
#*Stream Tracer for visualization
 +
#*Slice filters using hotRadiationRoom case file
 +
#*Clip filters using hotRadiationRoom case file
  
 
==Intermediate Level==
 
==Intermediate Level==
 
#Turbulent flow in a lid driven cavity using OpenFOAM  
 
#Turbulent flow in a lid driven cavity using OpenFOAM  
#*Objective
 
#*Prerequisite
 
 
#*Problem specification
 
#*Problem specification
 
#*Boundary conditions
 
#*Boundary conditions
Line 99: Line 110:
 
#*Analytical result
 
#*Analytical result
 
#*Validating Analytic and Computational Results
 
#*Validating Analytic and Computational Results
#*Assignment
 
 
#Flow over a flat plate using OpenFOAM  
 
#Flow over a flat plate using OpenFOAM  
#*Objective
 
#*About flow over flat plate
 
 
#*Problem specification
 
#*Problem specification
#*Boundary conditions
+
#*Fundamental problem in fluid mechanics
#*Solver
+
#*Description of flow over flat plate
#*Meshing the geometry
+
#*File structure of Flow over flat plate
 +
#*Meshing the Geometry
 +
#*Checking the geometry and viewing in paraview
 +
#*About the Solver
 
#*Solving
 
#*Solving
 
#*Paraview
 
#*Paraview
#*Contour
+
#*U velocity contour
#*Analytical result
+
#*Vector plots
#*Validating Analytic and Computational Results
+
#*Geometry of the flat plate
#*Assignment
+
#*Changing the grid spacing in meshing
 +
#*Post Processing results in ParaView and
 +
#*Visualizing using Vector Plot.
 
#Simulating Hagen Poiseuille flow
 
#Simulating Hagen Poiseuille flow
#*Objective
 
#*Prerequisites
 
 
#*Problem specification
 
#*Problem specification
 
#*Formulas and analytical solution
 
#*Formulas and analytical solution
Line 126: Line 137:
 
#*Plotting the contour
 
#*Plotting the contour
 
#*Validation with respect to analytical results
 
#*Validation with respect to analytical results
#*Assignment
 
 
#Downloading and installing Salome
 
#Downloading and installing Salome
#*Objective
 
 
#*Introduction to Salome
 
#*Introduction to Salome
 
#*Salome website
 
#*Salome website
Line 137: Line 146:
 
#*Starting Salome
 
#*Starting Salome
 
#Creating and meshing a curved pipe geometry in Salome for OpenFOAM
 
#Creating and meshing a curved pipe geometry in Salome for OpenFOAM
#*Objective
 
#*Prerequisites
 
 
#*Starting Salome
 
#*Starting Salome
 
#*Creating a curved pipe geometry using Geometry module
 
#*Creating a curved pipe geometry using Geometry module
Line 145: Line 152:
 
#*Modify the mesh in the flow direction using submesh utility
 
#*Modify the mesh in the flow direction using submesh utility
 
#*Saving the work on the desktop
 
#*Saving the work on the desktop
#*Assignments
 
 
#Exporting geometry from Salome to OpenFOAM
 
#Exporting geometry from Salome to OpenFOAM
#*Objective
 
#*Prerequisites
 
 
#*Starting Salome and opening the previously created .hdf file
 
#*Starting Salome and opening the previously created .hdf file
 
#*Grouping mesh parts as they are required in OpenFOAM
 
#*Grouping mesh parts as they are required in OpenFOAM
Line 158: Line 162:
 
#*Opening the mesh in ParaView
 
#*Opening the mesh in ParaView
 
#*Making it ready for simulation
 
#*Making it ready for simulation
#*Assignments
 
 
#Introduction to SnappyHexMesh
 
#Introduction to SnappyHexMesh
 
#*Introduction to snappyHexMesh in OpenFOAM
 
#*Introduction to snappyHexMesh in OpenFOAM
#*Objective
 
#*Pre-requisite
 
 
#*Methodology for snappyHexMesh
 
#*Methodology for snappyHexMesh
 
#*Learning different parameters in snappyHexMeshDict
 
#*Learning different parameters in snappyHexMeshDict
 
#Generating Mesh using snappyHexMesh
 
#Generating Mesh using snappyHexMesh
#*Objectives
 
#*Pre-requisite
 
 
#*Problem specification
 
#*Problem specification
 
#*About the solver
 
#*About the solver
Line 175: Line 174:
 
#*Paraview visualization
 
#*Paraview visualization
 
#*Result
 
#*Result
#*Assignment
 
 
#Importing Mesh File in OpenFOAM
 
#Importing Mesh File in OpenFOAM
#*Pre-requisite
 
#*Cannot create complex geometry using blockMesh
 
 
#*blockMeshDict
 
#*blockMeshDict
 
#*OpenFOAM utility to import mesh  
 
#*OpenFOAM utility to import mesh  
Line 186: Line 182:
 
#*Boundary Condition name in boundary file
 
#*Boundary Condition name in boundary file
 
#*Setting up the case
 
#*Setting up the case
#*Assignment
 
 
#Installing and running Gmsh
 
#Installing and running Gmsh
 
#*Gmsh introduction
 
#*Gmsh introduction
Line 195: Line 190:
 
#*Define faces
 
#*Define faces
 
#*Define Volume
 
#*Define Volume
 +
#Creating and Meshing aerofoil in Gmsh
 +
#*Aerofoil
 +
#*.dat and .geo file
 +
#*Gmsh
 +
#*Meshing the aerofoil
 +
#Creating a sphere in GMSH
 +
#*Gmsh script introduction
 +
#*Create sphere geometry in Gmsh
 +
#*Basic manipulations using the file with extensions .geo
 +
#Unstructured mesh generation using Gmsh
 +
#*Unstructured mesh Generation
 +
#*Basic Manipulations using the file with extension .geo
 +
#*Mesh optimization using Netgen
 +
#*Mesh conversion
 +
#Installing and Running PyFOAM
 +
#*What is PyFOAM
 +
#*Files required for PyFOAM installation
 +
#*Installation using Pip, source file
 +
#*Checking PyFOAM installation
 +
#Using Template files in PyFoam
 +
#* PyFoam template files
 +
#* Syntax of template files
 +
#* Mechanism of variable substitution in template files
 +
#* Python code inside template files
 +
#* Calculate the coordinates for Wedge15Ma5 case
 +
#* Template file to calculate the coordinates
 +
#* Substitute values in the Wedge15Ma5
 +
#* Python commands to generate the blockMeshDict file
 +
#* Generating the blockMeshDict file
 +
#* Varying the values in the template file
 +
#Using PyFoam Utilities
 +
#* PyFoam Utilities
 +
#* Structure and types of the utilities
 +
#* Execute PyFoam Utilities from the command line
 +
#* Viewing all utilities using Tab Completion
 +
#* Use two utilities - PyFoamRunner.py and PyFoamSamplePlot.py
 +
#* pyFoamRunner.py to run solvers and generate log files
 +
#* Using pyFoamSamplePlot.py to plot data
 +
#* Setup the shock Tube case
 +
#* Use pyFoamRunner.py to run the case and analyze the logs
 +
#* Visualize the data using pyFoamSamplePlot.py

Latest revision as of 15:32, 21 October 2020

Welcome to the Spoken Tutorial series on OpenFOAM. OpenFOAM (Open Source Field Operation and Manipulation) is a free, open source CFD software package developed by the OpenFOAM Team at ESI and distributed by the OpenFOAM Foundation. Development of OpenFOAM started in the late 1980s at Imperial College,since then the user base of OpenFOAM has widened from not only academic areas but also industries have started using it.

It is is first and foremost a C++ library, used primarily to create executables, known as applications. The applications fall into two categories,

Solvers: that are each designed to solve a specific problem in continuum mechanics.

Utilities: that are designed to perform tasks that involve data manipulation.

The OpenFOAM distribution contains numerous solvers and utilities covering a wide range of problems of 2 Dimensions and 3 Dimensions.

In this tutorial we mainly concentrate on two areas,firstly on wide variety of solvers used in Openfoam and secondly on post processing the computed result using paraview.These tutorials are created using Ubuntu 10.04 and 11.04,OpenFOAM version 2.1.0,Paraview version 3.12.0.OpenFOAM runs on Ubuntu 10.04,11.04,12.04, 14.04 and 14.10 as well. OpenFOAM 2.3.1 was released recently with a couple of more improvements. You can download the same from the OpenFOAM website.

OpenFOAM can be useful for Engineering Colleges which cannot afford the cost of license CFD Software's. Teachers and Students who would be using this software should have some basic knowledge of Computational Fluid Dynamics and Linux Commands.

The Spoken Tutorial effort for OpenFOAM is contributed by Mr.Rahul Ashok Joshi from IIT BOMBAY, under the guidance of Prof. Shivasubramanian Gopalakrishna, Dept. of Mechanical Engineering, IIT BOMBAY.

Other Contributors : Saurabh Sawant, Chaitrali Ghodke, Gautam Sharma, Anmol Sahoo, Pavan Mehta, Deepa Vedartham

[ This effort is neither approved nor endorsed by ESI Group, the producer of OpenFOAM® software and owner of OpenFOAM® trademark ]

Learners: Mechanical, Civil, Chemical Engineering students in 3rd and 4th year.

Basic Level

  1. Installing and Running OpenFOAM and Paraview
    • Introduction to OpenFOAM
    • Introduction to Paraview
    • Install OpenFOAM and Paraview through Synaptic Package Manager
    • Install OpenFOAM and Paraview through openfoam website
    • Configure the installed software
    • Test the installed software
    • Creating user of working directory
    • Example of Lid Driven cavity
    • Running OpenFOAM and Paraview with an example of Lid Driven Cavity
  2. Creating simple geometry in OpenFOAM
    • Simple geometry
    • BlockMeshDict file in openfoam
    • Co-ordinate numbering and value
    • Meshing parameters
    • Boundary patches
    • Paraview
  3. Creating curved geometry in OpenFOAM
    • Steps for creating curved geometry
    • Example of flow over cylinder
    • Breaking the geometry into blocks
    • BlockMeshDict file structure
    • Arcs for curved geometry
    • How to calculate the intermediate point for arc
    • Paraview
    • WireFrame view
  4. Simulating flow in a Lid Driven Cavity using OpenFOAM
    • Problem specification
    • File structure of Lid Driven Cavity
    • Boundary Conditions
    • Meshing the Geometry
    • Checking the geometry and viewing in paraview
    • About the Solver
    • Solving
    • Paraview
    • Streamline contour.
    • Plot U and V velocity
    • Validate result
  5. Supersonic flow over a wedge using OpenFOAM
    • Problem specification
    • Boundary conditions
    • BlockMeshDict file of wedge
    • Mesh parameters of wedge
    • Compressible solver
    • Paraview visualization
    • Calculating Mach number
    • Contour of U (velocity) and T (Temperature)
    • Validation
  6. Two Dimensional Analysis of laminar flow through a channel
    • Problem specification
    • File structure of channel flow
    • Set up boundary conditions
    • Meshing the geometry
    • About the solver
    • Solving
    • Paraview
    • Contour
    • Analytical result
    • Validating Analytic and Computational Results
  7. Basic Post Processing using ParaView
    • Post Processing after simulation using solver
    • ParaView and paraFoam command for visualization
    • Basic Visualization techniques
    • Variable Visualization using pitzDaily case file
    • Velocity vector Visualization using pitzDaily case file
    • Glyph filter for visualization
    • Streamlines Visualization using motorBike case file
    • Stream Tracer for visualization
    • Slice filters using hotRadiationRoom case file
    • Clip filters using hotRadiationRoom case file

Intermediate Level

  1. Turbulent flow in a lid driven cavity using OpenFOAM
    • Problem specification
    • Boundary conditions
    • Solver and file structure of Lid Driven Cavity
    • Meshing the geometry
    • Solving
    • Paraview
    • Contour
    • Analytical result
    • Validating Analytic and Computational Results
  2. Flow over a flat plate using OpenFOAM
    • Problem specification
    • Fundamental problem in fluid mechanics
    • Description of flow over flat plate
    • File structure of Flow over flat plate
    • Meshing the Geometry
    • Checking the geometry and viewing in paraview
    • About the Solver
    • Solving
    • Paraview
    • U velocity contour
    • Vector plots
    • Geometry of the flat plate
    • Changing the grid spacing in meshing
    • Post Processing results in ParaView and
    • Visualizing using Vector Plot.
  3. Simulating Hagen Poiseuille flow
    • Problem specification
    • Formulas and analytical solution
    • About the solver
    • Pressure and Velocity Boundary Conditions
    • Setting up the Case Directory and modifying the files in it
    • Blocking Strategy
    • Solving the case in OpenFOAM
    • Visualizing the results in ParaView
    • Plotting the contour
    • Validation with respect to analytical results
  4. Downloading and installing Salome
    • Introduction to Salome
    • Salome website
    • Creating an account
    • Logging in
    • Downloading and saving the appropriate version of binaries
    • Installing Salome to the right location
    • Starting Salome
  5. Creating and meshing a curved pipe geometry in Salome for OpenFOAM
    • Starting Salome
    • Creating a curved pipe geometry using Geometry module
    • Grouping the objects appropriately
    • Mesh the geometry using Mesh module
    • Modify the mesh in the flow direction using submesh utility
    • Saving the work on the desktop
  6. Exporting geometry from Salome to OpenFOAM
    • Starting Salome and opening the previously created .hdf file
    • Grouping mesh parts as they are required in OpenFOAM
    • Exporting the mesh in .unv file
    • Setting up the case directory
    • Converting the mesh in the format compatible with OpenFOAM
    • Scaling down the geometry
    • Making appropriate changes in P and U file
    • Opening the mesh in ParaView
    • Making it ready for simulation
  7. Introduction to SnappyHexMesh
    • Introduction to snappyHexMesh in OpenFOAM
    • Methodology for snappyHexMesh
    • Learning different parameters in snappyHexMeshDict
  8. Generating Mesh using snappyHexMesh
    • Problem specification
    • About the solver
    • File structure of flange
    • Meshing the geometry by snappyHexMesh
    • Solving
    • Paraview visualization
    • Result
  9. Importing Mesh File in OpenFOAM
    • blockMeshDict
    • OpenFOAM utility to import mesh
    • Fluent, CFX, IdeasUnv
    • Flow over a cylinder
    • importing ".msh" file
    • Boundary Condition name in boundary file
    • Setting up the case
  10. Installing and running Gmsh
    • Gmsh introduction
    • Installing Gmsh
    • Running Gmsh
    • Create basic geometry in Gmsh
    • Example: Creating a cube
    • Define faces
    • Define Volume
  11. Creating and Meshing aerofoil in Gmsh
    • Aerofoil
    • .dat and .geo file
    • Gmsh
    • Meshing the aerofoil
  12. Creating a sphere in GMSH
    • Gmsh script introduction
    • Create sphere geometry in Gmsh
    • Basic manipulations using the file with extensions .geo
  13. Unstructured mesh generation using Gmsh
    • Unstructured mesh Generation
    • Basic Manipulations using the file with extension .geo
    • Mesh optimization using Netgen
    • Mesh conversion
  14. Installing and Running PyFOAM
    • What is PyFOAM
    • Files required for PyFOAM installation
    • Installation using Pip, source file
    • Checking PyFOAM installation
  15. Using Template files in PyFoam
    • PyFoam template files
    • Syntax of template files
    • Mechanism of variable substitution in template files
    • Python code inside template files
    • Calculate the coordinates for Wedge15Ma5 case
    • Template file to calculate the coordinates
    • Substitute values in the Wedge15Ma5
    • Python commands to generate the blockMeshDict file
    • Generating the blockMeshDict file
    • Varying the values in the template file
  16. Using PyFoam Utilities
    • PyFoam Utilities
    • Structure and types of the utilities
    • Execute PyFoam Utilities from the command line
    • Viewing all utilities using Tab Completion
    • Use two utilities - PyFoamRunner.py and PyFoamSamplePlot.py
    • pyFoamRunner.py to run solvers and generate log files
    • Using pyFoamSamplePlot.py to plot data
    • Setup the shock Tube case
    • Use pyFoamRunner.py to run the case and analyze the logs
    • Visualize the data using pyFoamSamplePlot.py

Contributors and Content Editors

Gaurav, Minal, Nancyvarkey, PoojaMoolya, Pratik kamble, Rahuljoshi