Master's Thesis
Total Page:16
File Type:pdf, Size:1020Kb
Benchmark and validation of Open Source CFD codes, with focus on compressible and rotating capabilities, for integration on the SimScale platform. Master's Thesis in Engineering Mathematics & Computational Sciences Magnus Winter Department of Applied Mechanics Chalmers University of Technology Gothenburg, Sweden 2013 Master's Thesis 2013:81 MASTER'S THESIS IN ENGINEERING MATHEMATICS Benchmark and validation of Open Source CFD codes, with focus on compressible and rotating capabilities, for integration on the SimScale platform. MAGNUS WINTER Department of Applied Mechanics Division of Fluid Dynamics CHALMERS UNIVERSITY OF TECHNOLOGY G¨oteborg, Sweden 2013 Benchmark and validation of Open Source CFD codes, with focus on compressible and rotating capabilities, for integration on the SimScale platform. MAGNUS WINTER c MAGNUS WINTER, 2013 Master's Thesis no 2013:81 ISSN 1652-8557 Department of Applied Mechanics Division of Fluid Dynamics Chalmers University of Technology SE-412 96 G¨oteborg Sweden Telephone + 46 (0)31-772 1000 Cover: Rotating cylinder (! = 1:2733 [rad/s]) in a free stream flow with Reynolds number Re = 333:33 and at the time t = 17:5 [s], calculated using Gerris. Chalmers Reproservice G¨oteborg, Sweden 2013 Benchmark and validation of Open Source CFD codes, with focus on compressible and rotating capabilities, for integration on the SimScale platform. Magnus Winter Department of Applied Mechanics Division of Fluid Dynamics Chalmers University of Technology Abstract The use of CFD is widely spread in industry today. However, smaller business have difficulty to make use of this tool, due to high costs for commercial licenses and hard- ware. As SimScale provides the combination of cloud computing with open source CFD software, the prerequisites to use CFD are lowered. To provide more diverse solvers for the platform, different CFD software are integrated onto the platform. As OpenFOAM was the sole CFD software on the platform at the start of this thesis, two other open source software were researched and compared to OpenFOAM. OpenFOAM was compared to Gerris and SU2 in three different validation cases. OpenFOAM and Gerris rotating body capabilities are investigated in an analyti- cal solvable case of laminar Taylor-Couette flow. Two different approaches were used in OpenFOAM, where AMI (Adaptive Mesh Interface) and MRF (Multiple Reference Frame) were used to solve the problem. OpenFOAM and SU2's turbulent capabilities are compared using a turbulent flat plate case from Wieghardt [1]. Compressible transonic flow over a RAE2822 airfoil was set up for OpenFOAM and SU2. The results were compared to data from NASA [2] It was found that the rotating body capabilities (MRF and AMI) of OpenFOAM were suit- able for integration onto the SimScale platform. Gerris as a software was deemed to be easy to work with, but would require a new work flow on the platform to be integrated. SU2 was integrated onto the platform during this thesis work, but was deemed to still suffer from some early development issues as its first release was done in January 2013. Keywords: OpenFOAM, SU2, Gerris, Turbulent flat plate, Taylor-Couette, RAE2822, RANS, DNS, AMI, MRF Acknowledgements The conducted thesis was done at SimScale GmbH in Garching bei Munchen.¨ First and foremost I would like to express my gratitude to my supervisor at SimScale, Johannes Probst, for always making time to help me when I encountered problems. Also I would like to express my thanks to David Heiny for giving me the opportunity to conduct my thesis at SimScale and to my colleagues at SimScale for keeping an uplifting and fun atmosphere at the workplace. I also like to thank my supervisor at Chalmers, Lars Davidsson, for his support and help during this thesis. To all the developers of the open source software used in this thesis including but not limited to, SU2, OpenFOAM, Gerris, Salome, Eclipse, SVN, Kile, LATEX and Ubuntu. Finally to my friends in Gothenburg and Munich for being helpful distractions from CFD. Magnus Winter, Munich 7/12/13 Nomenclature Abbreviation AMI Arbitrary Mesh Interface BiCGSTAB Biconjugate Gradient Stabilized BC Boundary Condition CFD Computational Fluid Dynamics CFL Courant-Friedrich-Lewy number CGS Conjugate Gradient Squared DNS Direct Numerical Simulation GAMG Generalized Geometric-Algebraic Multigrid GMRES Generalized Minimum Residual Method ILU Incomplete Lower Upper factorization LES Large Eddy Simulation LUDS Linear Upwind Scheme MAC Marker and Cell MRF Multiple Reference Frame OpenFOAM Open source Field Operation And Manipulation PISO Pressure-Implicit Split-Operator QUICK Quadratic Upwind Scheme RANS Reynolds Averaged Navier-Stokes SA Spalart-Allmaras SIMPLE Semi-Implicit Method for Pressure Linked Equations SU2 Stanford University Unstructured TVD Total Variation Diminishing Dimensionless quantities Cf Skin Friction Coefficient CP Pressure Coefficient M Mach number P r Prandtl number i Greek symbols δ Kronecker delta ρ Density γ Isentropic Expansion Factor µ Dynamic viscosity ν Kinematic viscosity @ Partial derivative ! Specific turbulent dissipation τij Viscous stress tensor Turbulent dissipation Roman symbols CD Coefficient of Drag CL Coefficient of Lift E Energy R Specific gas constant CV Heat capacity at constant volume q Heat flux ni Surface normal gradient p Pressure T Temperature t Time k Turbulent kinetic energy ui Velocity vector x Space variable Subscripts 1 Free stream property i;j;k Tensor indices t Turbulence ii Contents 1 Introduction1 1.1 Objective....................................2 1.2 Limitations...................................2 1.3 Outline of Thesis................................2 2 Theory3 2.1 Governing equations..............................3 2.1.1 Incompressible fluids..........................3 2.2 Modeling....................................4 2.2.1 RANS..................................4 2.2.2 Turbulence models...........................5 2.2.2.1 Spalart-Allmaras.......................5 2.2.2.2 k − ! SST..........................5 2.2.3 Artificial compressibility........................6 2.3 SU 2 modeled equations............................7 2.3.1 Compressible solver..........................7 2.3.2 Incompressible solver..........................8 2.4 OpenFOAM modeled equations........................8 2.4.1 simpleFoam...............................8 2.4.2 pimpleFoam...............................9 2.4.3 rhoCentralFoam............................9 2.5 Gerris modeled equations........................... 10 2.6 Finite volume method............................. 10 2.6.1 CFL number.............................. 11 2.6.2 y+ .................................... 11 2.6.3 Wall functions............................. 11 2.7 Discretization of Modeled Equations..................... 11 2.7.1 Time discretization........................... 12 2.7.2 Convective discretization....................... 12 2.7.2.1 Centered schemes...................... 12 iii CONTENTS 2.7.2.2 Upwind schemes....................... 13 2.7.2.3 TVD schemes........................ 13 2.7.2.4 Compressible flow...................... 14 2.7.3 Gradient discretization......................... 15 2.7.4 Viscous discretization......................... 15 2.8 Linear Solvers.................................. 16 2.8.1 Krylov subspace methods....................... 16 2.8.1.1 GMRES........................... 16 2.8.1.2 Conjugate Gradient Method................ 16 2.8.1.3 Biconjugate Gradient Method............... 17 2.8.1.4 BiCGSTAB.......................... 17 2.8.2 LU-SGS................................. 17 2.9 Acceleration techniques............................ 17 2.9.1 Multigrid method........................... 17 2.9.2 Preconditioners............................. 18 2.9.3 Linelet preconditioning........................ 18 2.9.3.1 Roe-Turkel preconditioner................. 18 2.10 Rotating motion................................ 19 2.10.1 MRF................................... 19 2.10.2 AMI................................... 19 3 Software 21 3.1 OpenFOAM................................... 21 3.1.1 0..................................... 22 3.1.2 system.................................. 22 3.1.2.1 fvSchemes.......................... 23 3.1.2.2 fvSolution........................... 24 3.1.3 constant................................. 25 3.1.3.1 polyMesh........................... 25 3.2 SU2 ....................................... 25 3.2.1 Mesh file................................ 25 3.2.2 Configuration file............................ 28 3.2.2.1 Time discretization..................... 28 3.2.2.2 Viscous terms discretization................ 28 3.2.2.3 Convective terms discretization............... 28 3.2.2.4 Linear solvers........................ 29 3.2.2.5 Convergence criterion.................... 29 3.3 Gerris...................................... 29 4 Results 31 4.1 Rotating Taylor-Couette............................ 31 4.1.1 OpenFOAM - MRF.......................... 31 4.1.1.1 Case creation......................... 32 4.1.1.2 Results............................ 34 iv CONTENTS 4.1.2 OpenFOAM - AMI........................... 36 4.1.2.1 Case creation......................... 37 4.1.2.2 Results............................ 39 4.1.3 Gerris.................................. 41 4.1.3.1 Case creation......................... 42 4.1.3.2 Results............................ 42 4.2 Turbulent flat plate............................... 43 4.2.1 OpenFOAM setup........................... 44 4.2.2 SU2 setup................................ 45 4.2.3 Mesh................................... 45 4.2.4 Results................................