OpenFOAM GUIDE FOR BEGINNERS

3y ago
131 Views
21 Downloads
486.99 KB
13 Pages
Last View : 2d ago
Last Download : 1m ago
Upload by : Ciara Libby
Transcription

OpenFOAM GUIDE FORBEGINNERS

AuthorsThis guide has been developed by:Jordi Casacuberta PuigIn association with:Pedro Javier Gamez and Gustavo RaushThe Foam HouseBarcelonaJordi Casacuberta PuigETSEIAT-UPCJune 20142

OPENFOAM GUIDE FOR BEGINNERSContentsContentsiList of FiguresvList of Tablesix1 Introduction1.0.1 About OpenF OAM R . . . . . . . . . . . . . . . . . . . . . .1.0.2 About this guide . . . . . . . . . . . . . . . . . . . . . . . . .1.0.3 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11122 Plane-parallel plates laminar flow32.1 Description of the case . . . . . . . . . . . . . . . . . . . . . . . . . . 32.2 Hypotheses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.3 First case: plane-parallel plates with relative movement (Couette flow) 42.3.1 Physics of the problem . . . . . . . . . . . . . . . . . . . . . . 42.3.2 Pre-processing . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.3.2.1 Mesh generation . . . . . . . . . . . . . . . . . . . . 62.3.2.2 Boundary and initial conditions . . . . . . . . . . . . 142.3.2.3 Physical properties . . . . . . . . . . . . . . . . . . . 192.3.2.4 Control . . . . . . . . . . . . . . . . . . . . . . . . . 212.3.2.5 Discretization and linear-solver settings . . . . . . . 242.3.2.6 Creating the mesh . . . . . . . . . . . . . . . . . . . 262.3.3 Viewing the mesh . . . . . . . . . . . . . . . . . . . . . . . . . 282.3.4 Running the application . . . . . . . . . . . . . . . . . . . . . 292.3.5 Post-processing . . . . . . . . . . . . . . . . . . . . . . . . . . 302.3.5.1 Viewing the results as isosurface and contour plots . 302.3.5.2 Plotting variables in ParaView . . . . . . . . . . . . 322.4 Second case: plane-parallel plates with pressure gradient (plane-Poiseuilleflow) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332.4.1 Physics of the problem . . . . . . . . . . . . . . . . . . . . . . 332.4.2 Pre-processing . . . . . . . . . . . . . . . . . . . . . . . . . . . 352.4.2.1 Boundary and initial conditions . . . . . . . . . . . . 352.4.2.2 Control . . . . . . . . . . . . . . . . . . . . . . . . . 382.4.3 Post-processing . . . . . . . . . . . . . . . . . . . . . . . . . . 39Jordi Casacuberta Puigi

CONTENTS2.52.62.4.3.1 Results of the simulation . . . . . . . . . . . . . . .Third case: plane-parallel plates with relative movement and pressuregradient (Couette flow with pressure gradient) . . . . . . . . . . . .2.5.1 Physics of the problem . . . . . . . . . . . . . . . . . . . . .2.5.2 Pre-processing . . . . . . . . . . . . . . . . . . . . . . . . . .2.5.2.1 Boundary and initial conditions . . . . . . . . . . .2.5.3 Post-processing . . . . . . . . . . . . . . . . . . . . . . . . .2.5.3.1 Results of the simulation . . . . . . . . . . . . . . .Additional utilities . . . . . . . . . . . . . . . . . . . . . . . . . . .2.6.1 Vector plots . . . . . . . . . . . . . . . . . . . . . . . . . . .2.6.2 Streamlines . . . . . . . . . . . . . . . . . . . . . . . . . . .2.6.3 Computation of the volumetric flow rate . . . . . . . . . . .2.6.3.1 Refinement of the mesh . . . . . . . . . . . . . . .2.6.4 Computation of the wall shear stress . . . . . . . . . . . . .2.6.4.1 Creation of a graded mesh . . . . . . . . . . . . . .3 Bidimensional laminar flow around a circular cylinder3.1 Description of the case . . . . . . . . . . . . . . . . . . . . . . .3.2 Hypotheses . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.3 Physics of the problem . . . . . . . . . . . . . . . . . . . . . . .3.4 Pre-processing with Re 195 . . . . . . . . . . . . . . . . . . .3.4.1 Mesh generation . . . . . . . . . . . . . . . . . . . . . .3.4.2 Boundary and initial conditions . . . . . . . . . . . . . .3.4.3 Physical properties . . . . . . . . . . . . . . . . . . . . .3.4.4 Control . . . . . . . . . . . . . . . . . . . . . . . . . . .3.4.5 Discretization and linear-solver settings . . . . . . . . . .3.5 Post-processing . . . . . . . . . . . . . . . . . . . . . . . . . . .3.5.1 Results of the simulation with Re 195 . . . . . . . . .3.5.2 Comparative between cases with Re 30 and Re 195 .3.6 Additional utilities . . . . . . . . . . . . . . . . . . . . . . . . .3.6.1 Vorticity . . . . . . . . . . . . . . . . . . . . . . . . . . .3.6.2 Computation of the aerodynamic coefficients . . . . . . .3.6.3 Plotting the results with Gnuplot . . . . . . . . . . . . .3.6.4 Computation of the stream function . . . . . . . . . . . .3.6.5 Convertion to VTK . . . . . . . . . . . . . . . . . . . . .4 Laminar flow through a circular pipe4.0.6 Description of the case . . . .4.0.7 Hypotheses . . . . . . . . . .4.0.8 Physics of the problem . . . .4.0.9 Pre-processing . . . . . . . . .4.0.9.1 Mesh generation . .Jordi Casacuberta Puig. 797985878788899192.939393939596ii

OPENFOAM GUIDE FOR BEGINNERS4.0.9.2 Boundary and initial conditions . . . . . . . . .4.0.9.3 Physical properties . . . . . . . . . . . . . . . .4.0.9.4 Control . . . . . . . . . . . . . . . . . . . . . .4.0.9.5 Discretization and linear-solver settings . . . .4.0.10 Post-processing . . . . . . . . . . . . . . . . . . . . . . .4.0.10.1 Results of the simulation . . . . . . . . . . . . .4.0.11 Additional utilities . . . . . . . . . . . . . . . . . . . . .4.0.11.1 Computation of average field values at patches4.0.11.2 Read field values with ParaView . . . . . . . .4.0.11.3 Plot the residuals of the simulation . . . . . . .991021021031061061111111121135 Aerodynamics of a 2D airfoil NACA 230125.0.12 Description of the case . . . . . . . . . . . . . . . . . . . . .5.0.13 Hypotheses . . . . . . . . . . . . . . . . . . . . . . . . . . .5.0.14 Physics of the problem . . . . . . . . . . . . . . . . . . . . .5.0.15 Pre-processing with α 15o . . . . . . . . . . . . . . . . . .5.0.15.1 Mesh generation . . . . . . . . . . . . . . . . . . .5.0.15.2 Boundary and initial conditions . . . . . . . . . . .5.0.15.3 Physical properties . . . . . . . . . . . . . . . . . .5.0.15.4 Control . . . . . . . . . . . . . . . . . . . . . . . .5.0.15.5 Discretization and linear-solver settings . . . . . .5.0.16 Post-processing . . . . . . . . . . . . . . . . . . . . . . . . .5.0.16.1 Results of the simulation for α 15o . . . . . . . .5.0.16.2 Results of the simulation for a range of α. Plot ofthe main aerodynamic curves . . . . . . . . . . . .5.0.17 Additional utilities . . . . . . . . . . . . . . . . . . . . . . .5.0.17.1 Mesh conversion . . . . . . . . . . . . . . . . . . .5.0.17.2 Computation of y . . . . . . . . . . . . . . . . . .5.0.17.3 Isobars around a body . . . . . . . . . . . . . . . .5.0.17.4 Tube-like streamlines . . . . . . . . . . . . . . . . .116. 116. 116. 116. 119. 119. 123. 128. 129. 130. 134. 1346 Fluid dynamics of a Very Light Aircraft6.0.18 Description of the case . . . . . . . . . . . . . . .6.0.19 Hypotheses . . . . . . . . . . . . . . . . . . . . .6.0.20 Physics of the problem . . . . . . . . . . . . . . .6.0.21 Pre-processing . . . . . . . . . . . . . . . . . . . .6.0.21.1 Mesh generation . . . . . . . . . . . . .6.0.21.2 Boundary and initial conditions . . . . .6.0.21.3 Physical properties . . . . . . . . . . . .6.0.21.4 Control . . . . . . . . . . . . . . . . . .6.0.21.5 Discretization and linear-solver settings6.0.21.6 External functions . . . . . . . . . . . .145. 145. 145. 146. 149. 149. 167. 173. 174. 175. 178Jordi Casacuberta Puig.137140140141143143iii

CONTENTS6.0.22 Post-processing . . . . . . . . . . . . . . . . . . . . . . . . . . 1816.0.22.1 Results of the simulation . . . . . . . . . . . . . . . . 181A Additional codes184Bibliography193Jordi Casacuberta Puigiv

OPENFOAM GUIDE FOR BEGINNERSList of Figures1.1Overview of OpenFOAM structure, extracted from [1] . . . . . . . .2.1Viscous incompressible flow between two plane-parallel plates withrelative movement . . . . . . . . . . . . . . . . . . . . . . . . . . . .Domain of the Couette flow case . . . . . . . . . . . . . . . . . . . .Specifications of a single block . . . . . . . . . . . . . . . . . . . . .Mesh grading along a block edge . . . . . . . . . . . . . . . . . . . .Patches defined in the domain of ppWall . . . . . . . . . . . . . . . .Initial mesh of the ppWall case . . . . . . . . . . . . . . . . . . . . .Base units and nomenclature for SI and USCS, extracted from [1] . .ParaView’s window with the initial ppWall mesh . . . . . . . . . . .Velocity field obtained with icoFoam in the Couette flow case (m/s) .Pressure field obtained with icoFoam in the Couette flow case (m2 /s2 )Distribution of U and p (ordinate axis) along the y-axis (abscissaaxis) obtained with the icoFoam simulation of the Couette flow caseViscous incompressible flow between two plane-parallel plates witha pressure gradient in the x-direction . . . . . . . . . . . . . . . . . .Velocity field obtained with icoFoam in the plane-Poiseuille flow case(m/s) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Pressure field obtained with icoFoam in the plane-Poiseuille flow case(m2 /s2 ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Distribution of U (ordinate axis) along the y-axis (abscissa axis)obtained with the icoFoam simulation of the plane-Poiseuille flow caseDistribution of p (ordinate axis) along the x-axis (abscissa axis) obtained with the icoFoam simulation of the plane-Poiseuille flow caseViscous incompressible flow between two plane-parallel plates withrelative movement and with a pressure gradient in the x-direction . .Velocity field obtained with icoFoam in the Couette flow with pressuregradient case (m/s) . . . . . . . . . . . . . . . . . . . . . . . . . . .Pressure field obtained with icoFoam in the Couette flow with pressure gradient case (m2 /s2 ) . . . . . . . . . . . . . . . . . . . . . . .Distribution of U (ordinate axis) along the y-axis (abscissa axis)obtained with the icoFoam simulation of the Couette flow with pressure gradient case . . . . . . . . . . . . . . . . . . . . . . . . . . . .Distribution of p (ordinate axis) along the x-axis (abscissa axis) obtained with the icoFoam simulation of the Couette flow with pressuregradient case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .162.172.182.192.202.21Jordi Casacuberta Puig14611111314162831323334404041414245454646v

LIST OF 213.224.14.24.34.44.5Vectors of the flow velocity in the plane-Poiseuille flow case (m/s)Streamlines in the plane-Poiseuille flow case (m/s) . . . . . . . . .Table containing the definition of phi depending whether the case iscompressible or incompressible [1] . . . . . . . . . . . . . . . . . .Shear stress at the walls of the plane-Poiseuille flow case (m2 /s2 ) .Graded mesh used to obtain more accurate values of the wall shearstress in the plane-Poiseuille flow case . . . . . . . . . . . . . . . . 48. 49. 50. 57. 60Flow around a circular cylinder . . . . . . . . . . . . . . . . . . . . .Flow structure depending on the Reynolds number, extracted from [2]Drag coefficient as a function of the Reynolds number in an infinitecircular cylinder . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Half of the scheme used for the creation of the mesh, extracted from[1] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Mesh of the bidimensional cylinder case . . . . . . . . . . . . . . . .Detail of the mesh of the bidimensional cylinder case . . . . . . . . .Detail of the mesh gradation on the walls of the bidimensional cylinder case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Velocity field around the bidimensional cylinder at t 0.01 s (m/s) .Velocity field around the bidimensional cylinder at t 0.6 s (m/s) .Velocity field around the bidimensional cylinder at t 1.13 s (m/s) .Pressure field around the bidimensional cylinder at t 0.01 s (m2 /s2 )Pressure field around the bidimensional cylinder at t 0.6 s (m2 /s2 )Pressure field around the bidimensional cylinder at t 1.13 s (m2 /s2 )Streamlines around the bidimensional cylinder at t 0.01 s (m/s) .Streamlines around the bidimensional cylinder at t 0.4 s (m/s) . .Streamlines around the bidimensional cylinder at t 0.6 s (m/s) . .Streamlines around the bidimensional cylinder at t 1.13 s (m/s) .Velocity vectors around the bidimensional cylinder at t 1.13 s (m/s)Vorticity field around the bidimensional cylinder at t 1.75 s . . . .Drag coefficient (ordinate axis) of the bidimensional cylinder at Re 195 in front of time (abscissa axis) . . . . . . . . . . . . . . . . . . .Lift coefficient (ordinate axis) of the bidimensional cylinder at Re 195 in front of time (abscissa axis) . . . . . . . . . . . . . . . . . . .Stream function of the velocity of the bidimensional cylinder casefor Re 195 at t 1.75 s . . . . . . . . . . . . . . . . . . . . . . . .Flow through a circular pipe with a constant inlet velocity . . . . .Scheme of the domain of the circularPipe case, extracted from [1] .Initial mesh of the circularPipe case . . . . . . . . . . . . . . . . . .Velocity field at the inlet of the pipe in the circularPipe case (m/s)Velocity field at the outlet of the pipe in the circularPipe case (m/s)Jordi Casacuberta 49698107107vi

OPENFOAM GUIDE FOR 5.185.195.206.1Pressure field in the circularPipe case (m2 /s2 ) . . . . . . . . . . . .Streamlines of the flow at the inlet of the pipe in the circularPipecase (m/s) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Streamlines of the flow at the outlet of the pipe in the circularPipecase (m/s) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Plot of U (ordinate axis) as a function of r (abscissa axis) at theoutlet of the pipe in the circularPipe case . . . . . . . . . . . . . . .Plot of p (ordinate axis) as a function of z (abscissa axis) in thecircularPipe case . . . . . . . . . . . . . . . . . . . . . . . . . . . .Plot of τw (ordinate axis) as a function of z (abscissa axis) in thecircularPipe case . . . . . . . . . . . . . . . . . . . . . . . . . . . .Menu to read field data in ParaView . . . . . . . . . . . . . . . . .Residuals of the velocity in the circularPipe case . . . . . . . . . . .Residuals of the pressure in the circularPipe case . . . . . . . . . .Airfoil NACA 23012 flying at 45 m/s and ambient pressure . . . .NACA 23012 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Global view of the mesh of the alpha15 case . . . . . . . . . . . . .Airfoil shape in the mesh of the alpha15 case . . . . . . . . . . . .Detail of the mesh grading at the walls of the alpha15 case . . . . .Velocity field around the NACA 23012 at α 15o (m/s) . . . . . .Pressure field around the NACA 23012 at α 15o (m2 /s2 ) . . . .Streamlines around the NACA 23012 at α 15o (m/s) . . . . . . .Velocity vectors around the NACA 23012 at α 15o (m/s) . . . .Distribution of ν t in the domain of the alpha15 case . . . . . . . . .Evolution of the lift coefficient (ordinate axis) with the time (abscissaaxis) in the alpha15 case . . . . . . . . . . . . . . . . . . . . . . . .Behaviour of the flow around the NACA 23012 at α 0o (m/s) . .Behaviour of the flow around the NACA 23012 at α 10o (m/s) .Behaviour of the flow around the NACA 23012 at α 20o (m/s) .Relation between Cl (ordinate axis) and α (abscissa axis) for theNACA 23012 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Relation between Cl (ordinate axis) and Cd (abscissa axis), polarcurve, for the NACA 23012 . . . . . . . . . . . . . . . . . . . . . .Distribution of y at the wall of the airfoil in the alpha15 case att 10000 s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Isobars around the NACA 23012 at the alpha15 case at t 10000 s(m2 /s2 ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Streamlines around the NACA 23012 at the alpha15 case at t 10000s (m/s) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Tube-like streamlines around the NACA 23012 at the alpha15 caseat t 10000 s (m/s) . . . . . . . . . . . . . . . . . . . . . . . . . . 108. 108. 109. 109. 7138138139. 139. 140. 142. 143. 144. 144Aircraft used in the simulation of the Very Light Aircraft case . . . . 146Jordi Casacuberta Puigvii

LIST OF s of the aircraft used in the simulation of the Very LightAircraft case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Very light aircraft flying at 45 m/s and ambient pressure . . . . . .Aircraft’ STL surface used in the simulation of the Very Light Aircraft case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Aircraft’ STL surface contained within the mesh generated withblockMesh in the Very Light Aircraft case . . . . . . . . . . . . . .Shape of the aircraft at the first step of the meshing process of snappyHexMesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Mesh of the domain at the first step of the meshing process of snappyHexMesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Detail of the mesh at the first step of the meshing process of snappyHexMesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Detail of the mesh with a representation of the cell refinement at thefirst step of the meshing process of snappyHexMesh . . . . . . . . .Pressure field around the aircraft (m2 /s2 ) . . . . . . . . . . . . . .Velocity field in the domain of the aircraft case (m/s) . . . . . . . .Velocity field around the aircraft (m/s) . . . . . . . . . . . . . . .Jordi Casacuberta Puig. 147. 147. 151. 154. 163. 164. 164.165182182183viii

OPENFOAM GUIDE FOR BEGINNERSList of TablesJordi Casacuberta Puigix

OPENFOAM GUIDE FOR BEGINNERS1.1.0.1IntroductionAbout OpenF OAMROpenFOAM is first and foremost a C library, used primarily to create executables, known as applications. The applications fall into two categories: solvers, thatare each designed to solve a specific problem in continuum mechanics; and utilities,that are designed to perform tasks that involve data manipulation. The OpenFOAM distribution contains numerous solvers and utilities covering a wide range ofproblems.One of the strengths of OpenFOAM is that new solvers and utilities can be createdby its users with some pre-requisite knowledge of the underlying method, physicsand programming techniques involved.OpenFOAM is supplied with pre- and post-processing environments. The interfaceto the pre- and post- processing are themselves OpenFOAM utilities, thereby ensuring consistent data handling across all environments. The overall structure ofOpenFOAM is shown in Figure 1.1 [1]:Figure 1.1: Overview of OpenFOAM structure, extracted from [1]1.0.2About this guideThe OpenFOAM guide developed in this project allows new users to establish andextend their OpenFOAM background once the main tutorial of the official guide isJordi Casacuberta Puig1

1. Introductiondone. Then with the present guide it will be possible to improve comprehension ofthe OpenFOAM structure, learn programming techniques, understand how to meshdifferent kinds of geometries (2D and 3D), acquire familiarity with the main preand post-processing OpenFOAM and ParaView capabilities, figure out which solversand physical models are more adequate for each kind of fluid mechanics problem,and much more. It sho

OPENFOAM GUIDE FOR BEGINNERS List of Figures 1.1 Overview of OpenFOAM structure, extracted from [1] . . . . . . . .1 2.1 Viscous incompressible ow between two plane-parallel plates with

Related Documents:

INTRODUCTION TO OPENFOAM open Field Operation And Manipulation C libraries Name. INTRODUCTION TO OPENFOAM open Field Operation And Manipulation C libraries Rita F. Carvalho, MARE, Department of Civil Engineering, University of Coimbra, Portugal OpenFOAM Equations Solvers How to use/code Examples Conclusions 3 25 26 33 46 49 50. SOLVE PARTIAL DIFFERENTIAL EQUATIONS (PDE .

Bruksanvisning för bilstereo . Bruksanvisning for bilstereo . Instrukcja obsługi samochodowego odtwarzacza stereo . Operating Instructions for Car Stereo . 610-104 . SV . Bruksanvisning i original

by ESI group, a French-based CAE software company. OpenFOAM is a set of solvers and utilities primarily for CFD with capabilities of standard tasks of CFD working ow from pre-processing, solving and post-processing. OpenFOAM solves wide-rage of problem from in

On the use of OpenFOAM to model Oscillating wave surge converters Schmitt, P., & Elsaesser, B. (2015). On the use of OpenFOAM to model Oscillating wave surge converters. Ocean Engineering, 108, 98-104. DOI: 10.1016/j.oceaneng.2015.07.055 Published in: Ocean Engineering Document

Implementing Fast Parallel Linear System Solvers In OpenFOAM based on CUDA Daniel P. Combest and Dr. P.A. Ramachandran and Dr. M.P. Dudukovic Optimization, HPC, and Pre- and Post-Processing I Session. 6th OpenFOAM Workshop Penn State University. June 15th 2011 Chemical Reaction Engineering Laboratory (CREL)

1. CFD Tools This chapter will give an overview over the main features of OpenFOAM and COMSOL, as well as their di erences. 1.1. OpenFOAM OpenFOAM (Open Field Operation and Manipulation) [1,2,3] is a free and open source computational uid dynamics (CFD) toolbox. It is developed by OpenCFD Ltd. and distributed

OpenFOAM training sessions and OpenFOAM workshops. We gratefully acknowledge the following OpenFOAM users for their consent to use their material: Hrvoje Jasak. Wikki Ltd. Hakan Nilsson. Department of Applied Mechanics, Chalmers University of Technology. Eric Paterson. Applied Research Laboratory Professor of Mechanical

FINAL YEAR MEng PROJECT Reprap Colour Mixing Project James Corbett 1st May 2012 . make the technology widely available for home users and projects such as RepRap have become much more widespread. RepRap is an open source project started by Adrian Bowyer of Bath University in 2005 which was designed around the ideal of creating a low cost home printer that could self replicate a larger .