CFD - OpenFOAM

9,479 views

Published on

A basic steps of OpenFOAM

3 Comments
8 Likes
Statistics
Notes
No Downloads
Views
Total views
9,479
On SlideShare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
566
Comments
3
Likes
8
Embeds 0
No embeds

No notes for slide
  • 1 ‹ #› Private & Confidential Copyright© 2008
  • 2 ‹ #› Private & Confidential Copyright© 2008
  • 3 ‹ #› Private & Confidential Copyright© 2008
  • 4 ‹ #› Private & Confidential Copyright© 2008
  • 5 ‹ #› Private & Confidential Copyright© 2008
  • 6 ‹ #› Private & Confidential Copyright© 2008
  • 7 ‹ #› Private & Confidential Copyright© 2008
  • 8 ‹ #› Private & Confidential Copyright© 2008
  • 9 ‹ #› Private & Confidential Copyright© 2008
  • 10 ‹ #› Private & Confidential Copyright© 2008
  • 10 ‹ #› Private & Confidential Copyright© 2008
  • 11 ‹ #› Private & Confidential Copyright© 2008
  • 12 ‹ #› Private & Confidential Copyright© 2008
  • 13 ‹ #› Private & Confidential Copyright© 2008
  • 14 ‹ #› Private & Confidential Copyright© 2008
  • 15 ‹ #› Private & Confidential Copyright© 2008
  • 16 ‹ #› Private & Confidential Copyright© 2008
  • 17 ‹ #› Private & Confidential Copyright© 2008
  • 18 ‹ #› Private & Confidential Copyright© 2008
  • 19 ‹ #› Private & Confidential Copyright© 2008
  • 20 ‹ #› Private & Confidential Copyright© 2008
  • 21 ‹ #› Private & Confidential Copyright© 2008
  • 22 ‹ #› Private & Confidential Copyright© 2008
  • 23 ‹ #› Private & Confidential Copyright© 2008
  • 24 ‹ #› Private & Confidential Copyright© 2008
  • 25 ‹ #› Private & Confidential Copyright© 2008
  • 26 ‹ #› Private & Confidential Copyright© 2008
  • 27 ‹ #› Private & Confidential Copyright© 2008
  • 27 ‹ #› Private & Confidential Copyright© 2008
  • 27 ‹ #› Private & Confidential Copyright© 2008
  • 27 ‹ #› Private & Confidential Copyright© 2008
  • 27 ‹ #› Private & Confidential Copyright© 2008
  • 27 ‹ #› Private & Confidential Copyright© 2008
  • 27 ‹ #› Private & Confidential Copyright© 2008
  • 27 ‹ #› Private & Confidential Copyright© 2008
  • 27 ‹ #› Private & Confidential Copyright© 2008
  • 27 ‹ #› Private & Confidential Copyright© 2008
  • 27 ‹ #› Private & Confidential Copyright© 2008
  • 27 ‹ #› Private & Confidential Copyright© 2008
  • 27 ‹ #› Private & Confidential Copyright© 2008
  • CFD - OpenFOAM

    1. 1. Ross Controls India வணக்கம் Wel come நல்வரவு Ross Controls India Pvt. Ltd 1 Private & Confidential Copyright© 2008
    2. 2. Ross Controls India Hearty Welcome to all Ross Controls India Pvt. Ltd 2 Private & Confidential Copyright© 2008
    3. 3. Ross Controls India Our sincere thanks To Mr. Hiroshi Ota Mr. Neil Stanford Ross Controls India Pvt. Ltd 3 Private & Confidential Copyright© 2008
    4. 4. Ross Controls India Over view <ul><li>Basics of CFD/FEA </li></ul><ul><li>Concepts of CFD </li></ul><ul><li>Software's for CFD </li></ul><ul><li>Preprocessing </li></ul><ul><li>Post Processing </li></ul><ul><li>Evaluation of Results </li></ul><ul><li>Solving </li></ul><ul><li>OpenFOAM </li></ul>Ross Controls India Pvt. Ltd 4 Private & Confidential Copyright© 2008
    5. 5. Ross Controls India Basics of C F D & FEA is a numerical technique for finding approximate solutions of partial differential equations (PDE) as well as of integral equations. Finite Element Analysis/Method (FEA/FEM) numerical methods for approximating the solutions to differential equations using finite difference equations to approximate derivatives. Finite Difference Method (FDM) numerical methods for representing and evaluating partial difference equations as a algebraic equations. similar to the FDM, the values are calculated at discrete places on a meshed geometry. Finite Volume Method (FVM) Ross Controls India Pvt. Ltd 5 Private & Confidential Copyright© 2008
    6. 6. Ross Controls India Basics of CFD & FEA <ul><li>The Finite Difference Method (FDM) is an approximation to the differential equation </li></ul><ul><li>The Finite Element Method (FEM) is an approximation to its solution </li></ul><ul><li>FEM is its ability to handle complex geometries (and boundaries) with relative ease </li></ul><ul><li>FDM in its basic form is restricted to handle rectangular shapes and simple alterations </li></ul><ul><li>FEM is the method of choice in all types of analysis in structural mechanics </li></ul><ul><li>for ex. Structural Linear and Non - Linear Analysis, Thermal, Electromagnetic Applications </li></ul><ul><li>Computational fluid dynamics (CFD) tends to use FDM or FVM </li></ul>Ross Controls India Pvt. Ltd 6
    7. 7. Ross Controls India Computational Fluid Dynamics - is one which solves some distribution of physical variable in the certain domain with using mathematical approximation methods. - Typically FVM is hired with iterative methods using basis of FDM - that uses numerical methods and algorithms to solve and analyze problems that involve fluid flows. - The fundamental basis of any CFD problem, or the flow of any fluids may be analyzed mathematically by using two flow equations which was described in next steps, It consists of a time-dependent continuity equation for conservation of mass three time-dependent conservation of momentum equations and a time-dependent conservation of energy equation. Ross Controls India Pvt. Ltd 7 Private & Confidential Copyright© 2008
    8. 8. Ross Controls India Flow Equations Continuity Equation – (mass balance) mass of fluid entering the volume = mass of fluid leaving the volume The flow of most fluids (,, air, etc,) may be analyzed by the following equations Where the symbol for example is a partial derivative with respect to time Ross Controls India Pvt. Ltd 8 Private & Confidential Copyright© 2008 t
    9. 9. Ross Controls India Momentum Equation or Navier – Stokes Equation (Momentum Balance) It was based on Newton’s Second law of motion, force equals mass time acceleration F = m*a The equations were derived independently by G.G. Stokes, in England, and M. Navier, in France, in the early 1800's. The equations are extensions of the Euler Equations and include the effects of viscosity on the flow. It was a the three-dimensional unsteady form describes how the velocity, pressure, temperature, and density of a moving fluid are related Thus to solve a flow problem, you mainly have to solve all five equations simultaneously; that is why we call this a coupled system of equations. Ross Controls India Pvt. Ltd 9 Private & Confidential Copyright© 2008
    10. 10. Ross Controls India X-Momentum Y-Momentum Z-Momentum Conservation of Momentum Ross Controls India Pvt. Ltd 10 Private & Confidential Copyright© 2008 Navier -Stokes Equations rate of change of momentum in the control volume external forces acting on the control volume. the net momentum flux into the control volume = +
    11. 11. Ross Controls India Conservation of Energy Ross Controls India Pvt. Ltd 11 Private & Confidential Copyright© 2008 Navier -Stokes Equations If the flow is compressible (  is not constant), the energy equation may be used. The change in energy of the fluid within the control volume the net thermal energy transferred into the control volume the rate of work done by external forces. = +
    12. 12. Ross Controls India Software’s for CFD In general, there are many commercial software’s available for CFD like Fluent V4 (Fluent Inc.) ANSYS - CFX, CFX (AEA Technology) FIDAP (Fluid Dynamics International Inc.) CFDesign Siemens – Femap Flow (an UGS product) COSMIC NASA ICEM CFD (Icepak) FLOWTHERM (Flowmerics Inc.) OpenFOAM is a free open source software. It is one of CFD codes using FVM with specific solvers, i.e., incompressible, compressible, laminar ,turbulent, steady state and transient Ross Controls India Pvt. Ltd 11 Private & Confidential Copyright© 2008
    13. 13. Ross Controls India Open FOAM – an open source CFD technique OpenFOAM is free open source software mainly meant for Computational Fluid Dynamics (CFD) supported by OpenCFD Ltd. OpenCFD was established in 2004 to coincide with the release of its OpenFOAM software under general public license. The teams assembled at OpenCFD each have 10 – 20 years of experience in CFD and have supplied development and support services for OpenFOAM to various organizations including: Engineering Companies Audi, Airbus, Bayer, DANONE, Daimler, Delphi, Honda, Mitsubishi, SKF, Shell Academic Institutions: Chalmers University, University of Exeter, Imperial College of London, Hirosaki University, Tokyo Institute of Technology. Ross Controls India Pvt. Ltd 12 Private & Confidential Copyright© 2008 Open Foam – 1.5
    14. 14. Ross Controls India <ul><li>OpenFOAM – A set of generic tools to simulate complex physics on real,3D cases </li></ul><ul><li>OpenFOAM is a programmable tool kit using C++ </li></ul><ul><li>supplied with source code and compilers, customized applications are created for specific problems </li></ul><ul><li>using functionality built into generic libraries </li></ul>OpenFOAM runs on Linux Platform, where we have installed OpenSUSE, a free Linux environment. The current version of OpenFOAM is 1.5 and for OpenSUSE its 11.0. We working in OpenFOAM 1.4.1 and OpenSUSE 10. 3 Numerous applications are preconfigured for complex fluid flows, solid dynamics, pre/post processing, mesh generation, etc., Ross Controls India Pvt. Ltd 13 Private & Confidential Copyright© 2008 Open Foam – 1.5
    15. 15. Ross Controls India Generally, there are three steps in performing an analysis, Pre - processing In Pre-processing, the entire inputs for performing an analysis will be given like Physical Properties, Fluid Properties, Initial Conditions, Boundary Conditions Sol vers - pre-programmed solvers are used to do the mathematical calculations for the specified conditions of the flow medium along the generated mesh geometries Ex: Incompressible, compressible, Laminar, turbulent, steady – state and transient Post - processing -The calculated results are converted into the graphical outputs for user interface. -The interpolation of the results for the various parameters can be done in post processing Ross Controls India Pvt. Ltd 14 Private & Confidential Copyright© 2008 Open Foam – 1.5
    16. 16. Ross Controls India Pvt. Ltd Ross Controls India Pvt. Ltd. 15 Ross Controls India 15 Private & Confidential Copyright© 2008 Open Foam – 1.5
    17. 17. Ross Controls India Ross Controls India Pvt. Ltd 16 Private & Confidential Copyright© 2008 Open Foam – 1.5
    18. 18. Ross Controls India After the flow model is created by using solid edge, the flow model is converted into IGES format. Adventure is a third party software which has capability of analyzing small linear analysis. Adventure on windows operates with the help of another software's for visualization like BC Tool (inbuilt software), Meshman Viewer (to view the generated mesh) The generated mesh will be in the *.cmsh format which enables to read in Open FOAM The procedure to create a mesh is shown in forthcoming slides The IGES is used as input to generate the mesh using this Adventure on Windows Software. Ross Controls India Pvt. Ltd 17 Private & Confidential Copyright© 2008 Mesh Generation
    19. 19. Ross Controls India Ross Controls India Pvt. Ltd 18 Private & Confidential Copyright© 2008 Adventure on Windows
    20. 20. Ross Controls India After the mesh generation from Adventure software, the input of generated mesh for OpenFOAM would extract from *.msh format. Open FOAM is a Linux based software, where we using OpenSUSE 10.3 Linux operating system. The current version is Open SUSE 11.0. The both OpenFOAM and OpenSUSE software is a free open source software which we can download the entire software from their website For OpenSUSE, the software can be download from http://software.opensuse.org/ For OpenFOAM, the software can be download from http://opencfd.co.uk Basically, for the Linux environment the software is a CASE SENSITIVE software and its just as like working through our command prompt. Ross Controls India Pvt. Ltd 19 Private & Confidential Copyright© 2008 Open Foam – 1.4.1
    21. 21. Ross Controls India OpenFOAM 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. Ross Controls India Pvt. Ltd 20 Private & Confidential Copyright© 2008 Open Foam – 1.4.1
    22. 22. Ross Controls India Ross Controls India Pvt. Ltd 21 Private & Confidential Copyright© 2008 Open Foam – 1.4.1
    23. 23. Ross Controls India It contains the full description of the case mesh in a sub directory “polyMesh ” This polyMesh folder contains the files specifying the physical properties for the application concerned. for setting the parameters associated with the solution procedure itself. controlDict - which run the control parameters for the time step and for data output. fvSolution - where the equation solvers, tolerances and other algorithm controls are set for the run. fvSchemes - where discretisation schemes used in the solution may be selected at run-time Contains individual files of data for particular field The data can be: either, initial values and boundary conditions that the user must specify to define the problem; or, results written to file by OpenFOAM Ross Controls India Pvt. Ltd 22 Private & Confidential Copyright© 2008 Open Foam – 1.4.1 Constant Directory System Directory Time Directory
    24. 24. Ross Controls India There was a dual boot system which created in my system can work in both Microsoft and Linux environment. We have installed the OpenSUSE 10.3 OS. <ul><li>The files can be created and handled in two methods </li></ul><ul><li>Command User Interface (CUI) – when need to operate through the commands </li></ul><ul><li>Graphical User Interface (GUI) – it operates with the help of FoamX window </li></ul>The forthcoming slides will show the procedure and the operations using this CUI/GUI for an analysis. <ul><li>As like as FEA, here also three steps basically to do an analysis. They are </li></ul><ul><li>Pre Processing </li></ul><ul><li>Solving </li></ul><ul><li>Post Processing </li></ul>Ross Controls India Pvt. Ltd 23 Private & Confidential Copyright© 2008 Open Foam – 1.4.1
    25. 25. Ross Controls India Some of the important points to be considered, Time and data input /output control : The OpenFOAM solvers begin all runs by setting up a database. Since the database controls I/O and output of data is usually requested at intervals of time, so it is an inextricable part of the database. The controlDict dictionary sets input parameters essential for the creation of the database. fvSchemes dictionary : in the system directory sets the numerical schemes for terms, such as derivatives in equations, that appear in applications being run. There are many numerical schemes listed in this dictionaries as a sub dictionaries , They are Interpolation schemes, Surface normal gradient schemes, Gradient schemes, Laplacian schemes, Divergence Schemes, Time Schemes, Flux Calculation . Surface normal gradient schemes The snGradSchemes sub-dictionary contains surface normal gradient terms. A surface normal gradient is evaluated at a cell face; it is the component, normal to the face, of the gradient of values at the centre's of the 2 cells that the face connects Ross Controls India Pvt. Ltd 24 Private & Confidential Copyright© 2008 Open Foam – 1.4.1
    26. 26. Ross Controls India Some of the important points to be considered, The corrected coefficient of 1 will be used in Gaussian integration to evaluate the Laplacian terms. By default snGradSchemes of limited 0.5 will be used in special cases. Solution and algorithm control The equation solvers, tolerances and algorithms are controlled from the fvSolution dictionary in the system directory. fvSolution - contains a set of sub-dictionaries that are specific to the solver being run. Some of the sub-dictionaries included are solvers, relaxation Factors, PISO and SIMPLE Ross Controls India Pvt. Ltd 25 Private & Confidential Copyright© 2008 Open Foam – 1.4.1
    27. 27. Ross Controls India It specifies each ” linear-solver” that is used for each discretised equation; it also refers to the method of number-crunching to solve the set of linear equations. The term ‘linear-solver’ is abbreviated to ‘solver’. There are different type of solvers and its mentioned below: Preconditioned conjugate gradient solvers There are a range of options for preconditioning of matrices in the conjugate gradient solvers, represented by the “preconditioner ” keyword in the solver dictionary Smooth solvers The solvers that use a smoother require the smoother to be specified. Generally “GaussSeidel” is the most reliable option. Geometric-algebraic multi-grid solvers <ul><li>generating a quick solution on a mesh with a small number of cells; </li></ul><ul><li>mapping this solution onto a finer mesh; </li></ul><ul><li>using it as an initial guess to obtain an accurate solution on the fine mesh. </li></ul>Ross Controls India Pvt. Ltd 26 Private & Confidential Copyright© 2008 Open Foam – 1.4.1 Sol vers
    28. 28. Ross Controls India Ross Controls India Pvt. Ltd 27 Private & Confidential Copyright© 2008 Open Foam – 1.4.1 Sol vers
    29. 29. Ross Controls India Ross Controls India Pvt. Ltd 28 Private & Confidential Copyright© 2008 Open Foam – 1.4.1
    30. 30. Ross Controls India Ross Controls India Pvt. Ltd 29 Private & Confidential Copyright© 2008
    31. 31. Ross Controls India Ross Controls India Pvt. Ltd 30 Private & Confidential Copyright© 2008
    32. 32. Ross Controls India Ross Controls India Pvt. Ltd 31 Private & Confidential Copyright© 2008 The Ultimate result to extract from the ParaView window after the calculation was the Velocity “U” magnitude. Actually, the obtained result will be in m 3 /s, i.e., Volume Flow rate. Res ults The Volume flow rate will be calculated by integrating the each individual cell values at the sectioned area by using the FILTER > INTEGRATE Command in ParaView. As per the result, the x magnitude of the volume flow rate is -0.0077 m 3 /s , the rest of them are Y and Z magnitudes. The negative sign indicates the reverse flow direction As per formula, Flow = Velocity * Area The mean Velocity over the area will be arrived using this formula.
    33. 33. Ross Controls India Ross Controls India Pvt. Ltd 32 Private & Confidential Copyright© 2008 Res ults The Cv will be calculated using “ Mass Flow Rate ”, “ Upstream Pressure ” and “ Downstream Pressure ”. The units of dimensions are necessary to be converted from SI units adopted in CFD.
    34. 34. Ross Controls India Ross Controls India Pvt. Ltd 33 Private & Confidential Copyright© 2008 Res ults
    35. 35. Ross Controls India Ross Controls India Pvt. Ltd 34 Private & Confidential Copyright© 2008 Special Notes Some of the key factors to consider to get good convergence in the results are The sparse matrix solvers are iterative, i.e. they are based on reducing the equation residual over a succession of solutions. The residual is ostensibly a measure of the error in the solution so that the smaller it is, the more accurate the solution. The solver stops if either of the following conditions are reached: • the ratio of current to initial residuals falls below the solver relative tolerance, relTol • the residual falls below the solver tolerance, tolerance,
    36. 36. Ross Controls India Ross Controls India Pvt. Ltd 35 Private & Confidential Copyright© 2008 Special Notes Fluctuation of both K and epsilon If Log file shows the negative value due to bounding K (kinematic energy) and epsilon (energy dissipation) in each iterations, you have to change the Laplacian scheme regarding pressure. As “ Gauss linear corrected ” scheme is default, “ Gauss linear limited 0.5 ” scheme provides better . Both K and epsilon cannot have negative values in the theory. But non - orthoganality affects the bounding between positive and negative values of K and epsilon.
    37. 37. Ross Controls India Ross Controls India Pvt. Ltd 36 Private & Confidential Copyright© 2008 Evaluation of Results <ul><li>The pressure distribution and its value is the key </li></ul><ul><li>If there are some areas where pressures are extremely lower and/or higher, the calculation may be wrong. </li></ul><ul><li>It is necessary to change the relaxation factors become smaller. </li></ul><ul><li>The pressure distribution is smoothly reduced from upstream to downstream as same as the pressure boundary conditions applied. </li></ul><ul><li>Also the residual of pressure might become 10 -4 orders in log file. </li></ul>
    38. 38. Ross Controls India Ross Controls India Pvt. Ltd 37 Private & Confidential Copyright© 2008 Other Results
    39. 39. Ross Controls India Ross Controls India Pvt. Ltd 37 Private & Confidential Copyright© 2008 Que ries …
    40. 40. Ross Controls India Ross Controls India Pvt. Ltd 37 Private & Confidential Copyright© 2008 Thank You !!!

    ×